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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040
  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. /* PyObjectSetAttrStr.proto */
  1459. #if CYTHON_USE_TYPE_SLOTS
  1460. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
  1461. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
  1462. #else
  1463. #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
  1464. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  1465. #endif
  1466. /* DictGetItem.proto */
  1467. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  1468. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
  1469. #define __Pyx_PyObject_Dict_GetItem(obj, name)\
  1470. (likely(PyDict_CheckExact(obj)) ?\
  1471. __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
  1472. #else
  1473. #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
  1474. #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
  1475. #endif
  1476. /* ExtTypeTest.proto */
  1477. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
  1478. /* GetTopmostException.proto */
  1479. #if CYTHON_USE_EXC_INFO_STACK
  1480. static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
  1481. #endif
  1482. /* SaveResetException.proto */
  1483. #if CYTHON_FAST_THREAD_STATE
  1484. #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
  1485. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1486. #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
  1487. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1488. #else
  1489. #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
  1490. #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
  1491. #endif
  1492. /* PyErrExceptionMatches.proto */
  1493. #if CYTHON_FAST_THREAD_STATE
  1494. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1495. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1496. #else
  1497. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1498. #endif
  1499. /* GetException.proto */
  1500. #if CYTHON_FAST_THREAD_STATE
  1501. #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
  1502. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1503. #else
  1504. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
  1505. #endif
  1506. /* PyObject_GenericGetAttrNoDict.proto */
  1507. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1508. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
  1509. #else
  1510. #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
  1511. #endif
  1512. /* PyObject_GenericGetAttr.proto */
  1513. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1514. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
  1515. #else
  1516. #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
  1517. #endif
  1518. /* SetupReduce.proto */
  1519. static int __Pyx_setup_reduce(PyObject* type_obj);
  1520. /* TypeImport.proto */
  1521. #ifndef __PYX_HAVE_RT_ImportType_proto
  1522. #define __PYX_HAVE_RT_ImportType_proto
  1523. enum __Pyx_ImportType_CheckSize {
  1524. __Pyx_ImportType_CheckSize_Error = 0,
  1525. __Pyx_ImportType_CheckSize_Warn = 1,
  1526. __Pyx_ImportType_CheckSize_Ignore = 2
  1527. };
  1528. static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
  1529. #endif
  1530. /* Import.proto */
  1531. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  1532. /* ImportFrom.proto */
  1533. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  1534. /* CalculateMetaclass.proto */
  1535. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  1536. /* Py3ClassCreate.proto */
  1537. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  1538. PyObject *mkw, PyObject *modname, PyObject *doc);
  1539. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  1540. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
  1541. /* FetchCommonType.proto */
  1542. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  1543. /* CythonFunction.proto */
  1544. #define __Pyx_CyFunction_USED 1
  1545. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  1546. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  1547. #define __Pyx_CYFUNCTION_CCLASS 0x04
  1548. #define __Pyx_CyFunction_GetClosure(f)\
  1549. (((__pyx_CyFunctionObject *) (f))->func_closure)
  1550. #define __Pyx_CyFunction_GetClassObj(f)\
  1551. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  1552. #define __Pyx_CyFunction_Defaults(type, f)\
  1553. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  1554. #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
  1555. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  1556. typedef struct {
  1557. PyCFunctionObject func;
  1558. #if PY_VERSION_HEX < 0x030500A0
  1559. PyObject *func_weakreflist;
  1560. #endif
  1561. PyObject *func_dict;
  1562. PyObject *func_name;
  1563. PyObject *func_qualname;
  1564. PyObject *func_doc;
  1565. PyObject *func_globals;
  1566. PyObject *func_code;
  1567. PyObject *func_closure;
  1568. PyObject *func_classobj;
  1569. void *defaults;
  1570. int defaults_pyobjects;
  1571. size_t defaults_size; // used by FusedFunction for copying defaults
  1572. int flags;
  1573. PyObject *defaults_tuple;
  1574. PyObject *defaults_kwdict;
  1575. PyObject *(*defaults_getter)(PyObject *);
  1576. PyObject *func_annotations;
  1577. } __pyx_CyFunctionObject;
  1578. static PyTypeObject *__pyx_CyFunctionType = 0;
  1579. #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
  1580. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
  1581. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  1582. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  1583. int flags, PyObject* qualname,
  1584. PyObject *self,
  1585. PyObject *module, PyObject *globals,
  1586. PyObject* code);
  1587. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  1588. size_t size,
  1589. int pyobjects);
  1590. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  1591. PyObject *tuple);
  1592. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  1593. PyObject *dict);
  1594. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  1595. PyObject *dict);
  1596. static int __pyx_CyFunction_init(void);
  1597. /* SetNameInClass.proto */
  1598. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  1599. #define __Pyx_SetNameInClass(ns, name, value)\
  1600. (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
  1601. #elif CYTHON_COMPILING_IN_CPYTHON
  1602. #define __Pyx_SetNameInClass(ns, name, value)\
  1603. (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
  1604. #else
  1605. #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
  1606. #endif
  1607. /* CLineInTraceback.proto */
  1608. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1609. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1610. #else
  1611. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1612. #endif
  1613. /* CodeObjectCache.proto */
  1614. typedef struct {
  1615. PyCodeObject* code_object;
  1616. int code_line;
  1617. } __Pyx_CodeObjectCacheEntry;
  1618. struct __Pyx_CodeObjectCache {
  1619. int count;
  1620. int max_count;
  1621. __Pyx_CodeObjectCacheEntry* entries;
  1622. };
  1623. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1624. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1625. static PyCodeObject *__pyx_find_code_object(int code_line);
  1626. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1627. /* AddTraceback.proto */
  1628. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1629. int py_line, const char *filename);
  1630. /* ArrayAPI.proto */
  1631. #ifndef _ARRAYARRAY_H
  1632. #define _ARRAYARRAY_H
  1633. typedef struct arraydescr {
  1634. int typecode;
  1635. int itemsize;
  1636. PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
  1637. int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
  1638. #if PY_MAJOR_VERSION >= 3
  1639. char *formats;
  1640. #endif
  1641. } arraydescr;
  1642. struct arrayobject {
  1643. PyObject_HEAD
  1644. Py_ssize_t ob_size;
  1645. union {
  1646. char *ob_item;
  1647. float *as_floats;
  1648. double *as_doubles;
  1649. int *as_ints;
  1650. unsigned int *as_uints;
  1651. unsigned char *as_uchars;
  1652. signed char *as_schars;
  1653. char *as_chars;
  1654. unsigned long *as_ulongs;
  1655. long *as_longs;
  1656. #if PY_MAJOR_VERSION >= 3
  1657. unsigned long long *as_ulonglongs;
  1658. long long *as_longlongs;
  1659. #endif
  1660. short *as_shorts;
  1661. unsigned short *as_ushorts;
  1662. Py_UNICODE *as_pyunicodes;
  1663. void *as_voidptr;
  1664. } data;
  1665. Py_ssize_t allocated;
  1666. struct arraydescr *ob_descr;
  1667. PyObject *weakreflist;
  1668. #if PY_MAJOR_VERSION >= 3
  1669. int ob_exports;
  1670. #endif
  1671. };
  1672. #ifndef NO_NEWARRAY_INLINE
  1673. static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1674. struct arraydescr *descr) {
  1675. arrayobject *op;
  1676. size_t nbytes;
  1677. if (size < 0) {
  1678. PyErr_BadInternalCall();
  1679. return NULL;
  1680. }
  1681. nbytes = size * descr->itemsize;
  1682. if (nbytes / descr->itemsize != (size_t)size) {
  1683. return PyErr_NoMemory();
  1684. }
  1685. op = (arrayobject *) type->tp_alloc(type, 0);
  1686. if (op == NULL) {
  1687. return NULL;
  1688. }
  1689. op->ob_descr = descr;
  1690. op->allocated = size;
  1691. op->weakreflist = NULL;
  1692. op->ob_size = size;
  1693. if (size <= 0) {
  1694. op->data.ob_item = NULL;
  1695. }
  1696. else {
  1697. op->data.ob_item = PyMem_NEW(char, nbytes);
  1698. if (op->data.ob_item == NULL) {
  1699. Py_DECREF(op);
  1700. return PyErr_NoMemory();
  1701. }
  1702. }
  1703. return (PyObject *) op;
  1704. }
  1705. #else
  1706. PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1707. struct arraydescr *descr);
  1708. #endif
  1709. static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
  1710. void *items = (void*) self->data.ob_item;
  1711. PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
  1712. if (items == NULL) {
  1713. PyErr_NoMemory();
  1714. return -1;
  1715. }
  1716. self->data.ob_item = (char*) items;
  1717. self->ob_size = n;
  1718. self->allocated = n;
  1719. return 0;
  1720. }
  1721. static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
  1722. void *items = (void*) self->data.ob_item;
  1723. Py_ssize_t newsize;
  1724. if (n < self->allocated && n*4 > self->allocated) {
  1725. self->ob_size = n;
  1726. return 0;
  1727. }
  1728. newsize = n + (n / 2) + 1;
  1729. if (newsize <= n) {
  1730. PyErr_NoMemory();
  1731. return -1;
  1732. }
  1733. PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
  1734. if (items == NULL) {
  1735. PyErr_NoMemory();
  1736. return -1;
  1737. }
  1738. self->data.ob_item = (char*) items;
  1739. self->ob_size = n;
  1740. self->allocated = newsize;
  1741. return 0;
  1742. }
  1743. #endif
  1744. /* CppExceptionConversion.proto */
  1745. #ifndef __Pyx_CppExn2PyErr
  1746. #include <new>
  1747. #include <typeinfo>
  1748. #include <stdexcept>
  1749. #include <ios>
  1750. static void __Pyx_CppExn2PyErr() {
  1751. try {
  1752. if (PyErr_Occurred())
  1753. ; // let the latest Python exn pass through and ignore the current one
  1754. else
  1755. throw;
  1756. } catch (const std::bad_alloc& exn) {
  1757. PyErr_SetString(PyExc_MemoryError, exn.what());
  1758. } catch (const std::bad_cast& exn) {
  1759. PyErr_SetString(PyExc_TypeError, exn.what());
  1760. } catch (const std::bad_typeid& exn) {
  1761. PyErr_SetString(PyExc_TypeError, exn.what());
  1762. } catch (const std::domain_error& exn) {
  1763. PyErr_SetString(PyExc_ValueError, exn.what());
  1764. } catch (const std::invalid_argument& exn) {
  1765. PyErr_SetString(PyExc_ValueError, exn.what());
  1766. } catch (const std::ios_base::failure& exn) {
  1767. PyErr_SetString(PyExc_IOError, exn.what());
  1768. } catch (const std::out_of_range& exn) {
  1769. PyErr_SetString(PyExc_IndexError, exn.what());
  1770. } catch (const std::overflow_error& exn) {
  1771. PyErr_SetString(PyExc_OverflowError, exn.what());
  1772. } catch (const std::range_error& exn) {
  1773. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1774. } catch (const std::underflow_error& exn) {
  1775. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1776. } catch (const std::exception& exn) {
  1777. PyErr_SetString(PyExc_RuntimeError, exn.what());
  1778. }
  1779. catch (...)
  1780. {
  1781. PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  1782. }
  1783. }
  1784. #endif
  1785. /* CIntToPy.proto */
  1786. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);
  1787. /* CIntToPy.proto */
  1788. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1789. /* CIntToPy.proto */
  1790. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1791. /* RealImag.proto */
  1792. #if CYTHON_CCOMPLEX
  1793. #ifdef __cplusplus
  1794. #define __Pyx_CREAL(z) ((z).real())
  1795. #define __Pyx_CIMAG(z) ((z).imag())
  1796. #else
  1797. #define __Pyx_CREAL(z) (__real__(z))
  1798. #define __Pyx_CIMAG(z) (__imag__(z))
  1799. #endif
  1800. #else
  1801. #define __Pyx_CREAL(z) ((z).real)
  1802. #define __Pyx_CIMAG(z) ((z).imag)
  1803. #endif
  1804. #if defined(__cplusplus) && CYTHON_CCOMPLEX\
  1805. && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
  1806. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  1807. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  1808. #else
  1809. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  1810. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  1811. #endif
  1812. /* Arithmetic.proto */
  1813. #if CYTHON_CCOMPLEX
  1814. #define __Pyx_c_eq_float(a, b) ((a)==(b))
  1815. #define __Pyx_c_sum_float(a, b) ((a)+(b))
  1816. #define __Pyx_c_diff_float(a, b) ((a)-(b))
  1817. #define __Pyx_c_prod_float(a, b) ((a)*(b))
  1818. #define __Pyx_c_quot_float(a, b) ((a)/(b))
  1819. #define __Pyx_c_neg_float(a) (-(a))
  1820. #ifdef __cplusplus
  1821. #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
  1822. #define __Pyx_c_conj_float(z) (::std::conj(z))
  1823. #if 1
  1824. #define __Pyx_c_abs_float(z) (::std::abs(z))
  1825. #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
  1826. #endif
  1827. #else
  1828. #define __Pyx_c_is_zero_float(z) ((z)==0)
  1829. #define __Pyx_c_conj_float(z) (conjf(z))
  1830. #if 1
  1831. #define __Pyx_c_abs_float(z) (cabsf(z))
  1832. #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
  1833. #endif
  1834. #endif
  1835. #else
  1836. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1837. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1838. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1839. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1840. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1841. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
  1842. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
  1843. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
  1844. #if 1
  1845. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
  1846. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1847. #endif
  1848. #endif
  1849. /* Arithmetic.proto */
  1850. #if CYTHON_CCOMPLEX
  1851. #define __Pyx_c_eq_double(a, b) ((a)==(b))
  1852. #define __Pyx_c_sum_double(a, b) ((a)+(b))
  1853. #define __Pyx_c_diff_double(a, b) ((a)-(b))
  1854. #define __Pyx_c_prod_double(a, b) ((a)*(b))
  1855. #define __Pyx_c_quot_double(a, b) ((a)/(b))
  1856. #define __Pyx_c_neg_double(a) (-(a))
  1857. #ifdef __cplusplus
  1858. #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
  1859. #define __Pyx_c_conj_double(z) (::std::conj(z))
  1860. #if 1
  1861. #define __Pyx_c_abs_double(z) (::std::abs(z))
  1862. #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
  1863. #endif
  1864. #else
  1865. #define __Pyx_c_is_zero_double(z) ((z)==0)
  1866. #define __Pyx_c_conj_double(z) (conj(z))
  1867. #if 1
  1868. #define __Pyx_c_abs_double(z) (cabs(z))
  1869. #define __Pyx_c_pow_double(a, b) (cpow(a, b))
  1870. #endif
  1871. #endif
  1872. #else
  1873. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1874. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1875. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1876. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1877. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1878. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
  1879. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
  1880. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
  1881. #if 1
  1882. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
  1883. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1884. #endif
  1885. #endif
  1886. /* CIntToPy.proto */
  1887. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
  1888. /* CIntFromPy.proto */
  1889. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
  1890. /* CIntFromPy.proto */
  1891. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1892. /* CIntFromPy.proto */
  1893. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1894. /* FastTypeChecks.proto */
  1895. #if CYTHON_COMPILING_IN_CPYTHON
  1896. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1897. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1898. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1899. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1900. #else
  1901. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1902. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1903. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1904. #endif
  1905. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1906. /* CStringEquals.proto */
  1907. static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);
  1908. /* CheckBinaryVersion.proto */
  1909. static int __Pyx_check_binary_version(void);
  1910. /* InitStrings.proto */
  1911. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  1912. /* Module declarations from 'libcpp.vector' */
  1913. /* Module declarations from 'libc.string' */
  1914. /* Module declarations from 'libcpp.string' */
  1915. /* Module declarations from 'libcpp.utility' */
  1916. /* Module declarations from 'libcpp.map' */
  1917. /* Module declarations from 'libcpp' */
  1918. /* Module declarations from 'libcpp.pair' */
  1919. /* Module declarations from 'libcpp.list' */
  1920. /* Module declarations from 'cpython.buffer' */
  1921. /* Module declarations from 'libc.stdio' */
  1922. /* Module declarations from '__builtin__' */
  1923. /* Module declarations from 'cpython.type' */
  1924. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1925. /* Module declarations from 'cpython.version' */
  1926. /* Module declarations from 'cpython.exc' */
  1927. /* Module declarations from 'cpython.module' */
  1928. /* Module declarations from 'cpython.mem' */
  1929. /* Module declarations from 'cpython.tuple' */
  1930. /* Module declarations from 'cpython.list' */
  1931. /* Module declarations from 'cpython.sequence' */
  1932. /* Module declarations from 'cpython.mapping' */
  1933. /* Module declarations from 'cpython.iterator' */
  1934. /* Module declarations from 'cpython.number' */
  1935. /* Module declarations from 'cpython.int' */
  1936. /* Module declarations from '__builtin__' */
  1937. /* Module declarations from 'cpython.bool' */
  1938. static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
  1939. /* Module declarations from 'cpython.long' */
  1940. /* Module declarations from 'cpython.float' */
  1941. /* Module declarations from '__builtin__' */
  1942. /* Module declarations from 'cpython.complex' */
  1943. static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
  1944. /* Module declarations from 'cpython.string' */
  1945. /* Module declarations from 'cpython.unicode' */
  1946. /* Module declarations from 'cpython.dict' */
  1947. /* Module declarations from 'cpython.instance' */
  1948. /* Module declarations from 'cpython.function' */
  1949. /* Module declarations from 'cpython.method' */
  1950. /* Module declarations from 'cpython.weakref' */
  1951. /* Module declarations from 'cpython.getargs' */
  1952. /* Module declarations from 'cpython.pythread' */
  1953. /* Module declarations from 'cpython.pystate' */
  1954. /* Module declarations from 'cpython.cobject' */
  1955. /* Module declarations from 'cpython.oldbuffer' */
  1956. /* Module declarations from 'cpython.set' */
  1957. /* Module declarations from 'cpython.bytes' */
  1958. /* Module declarations from 'cpython.pycapsule' */
  1959. /* Module declarations from 'cpython' */
  1960. /* Module declarations from 'cpython.object' */
  1961. /* Module declarations from 'cpython.ref' */
  1962. /* Module declarations from 'numpy' */
  1963. /* Module declarations from 'numpy' */
  1964. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1965. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1966. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1967. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1968. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1969. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1970. /* Module declarations from 'array' */
  1971. /* Module declarations from 'cpython.array' */
  1972. static PyTypeObject *__pyx_ptype_7cpython_5array_array = 0;
  1973. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
  1974. /* Module declarations from 'gedlibpy' */
  1975. static PyTypeObject *__pyx_ptype_8gedlibpy_GEDEnv = 0;
  1976. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
  1977. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
  1978. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
  1979. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
  1980. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
  1981. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
  1982. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &); /*proto*/
  1983. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &); /*proto*/
  1984. static std::map<std::string,std::string> __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
  1985. static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(std::map<std::string,std::string> const &); /*proto*/
  1986. 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*/
  1987. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(const std::vector<std::vector<size_t> > &); /*proto*/
  1988. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1989. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &); /*proto*/
  1990. 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*/
  1991. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &); /*proto*/
  1992. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &); /*proto*/
  1993. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(const std::vector<std::vector<npy_uint64> > &); /*proto*/
  1994. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *); /*proto*/
  1995. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *); /*proto*/
  1996. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *); /*proto*/
  1997. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &); /*proto*/
  1998. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &); /*proto*/
  1999. 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*/
  2000. #define __Pyx_MODULE_NAME "gedlibpy"
  2001. extern int __pyx_module_is_main_gedlibpy;
  2002. int __pyx_module_is_main_gedlibpy = 0;
  2003. /* Implementation of 'gedlibpy' */
  2004. static PyObject *__pyx_builtin_range;
  2005. static PyObject *__pyx_builtin_print;
  2006. static PyObject *__pyx_builtin_TypeError;
  2007. static PyObject *__pyx_builtin_ValueError;
  2008. static PyObject *__pyx_builtin_RuntimeError;
  2009. static PyObject *__pyx_builtin_ImportError;
  2010. static PyObject *__pyx_builtin_MemoryError;
  2011. static const char __pyx_k_[] = "";
  2012. static const char __pyx_k_g[] = "g";
  2013. static const char __pyx_k_h[] = "h";
  2014. static const char __pyx_k_g1[] = "g1";
  2015. static const char __pyx_k_g2[] = "g2";
  2016. static const char __pyx_k_id[] = "id";
  2017. static const char __pyx_k_np[] = "np";
  2018. static const char __pyx_k_nx[] = "nx";
  2019. static const char __pyx_k_os[] = "os";
  2020. static const char __pyx_k__20[] = "*";
  2021. static const char __pyx_k_doc[] = "__doc__";
  2022. static const char __pyx_k_inf[] = "inf";
  2023. static const char __pyx_k_key[] = "key";
  2024. static const char __pyx_k_res[] = "res";
  2025. static const char __pyx_k_cdll[] = "cdll";
  2026. static const char __pyx_k_file[] = "__file__";
  2027. static const char __pyx_k_g_id[] = "g_id";
  2028. static const char __pyx_k_h_id[] = "h_id";
  2029. static const char __pyx_k_head[] = "head";
  2030. static const char __pyx_k_init[] = "init";
  2031. static const char __pyx_k_lib1[] = "lib1";
  2032. static const char __pyx_k_lib2[] = "lib2";
  2033. static const char __pyx_k_lib3[] = "lib3";
  2034. static const char __pyx_k_lib4[] = "lib4";
  2035. static const char __pyx_k_main[] = "__main__";
  2036. static const char __pyx_k_name[] = "name";
  2037. static const char __pyx_k_path[] = "path";
  2038. static const char __pyx_k_self[] = "self";
  2039. static const char __pyx_k_tail[] = "tail";
  2040. static const char __pyx_k_test[] = "__test__";
  2041. static const char __pyx_k_Error[] = "Error";
  2042. static const char __pyx_k_Graph[] = "Graph";
  2043. static const char __pyx_k_edges[] = "edges";
  2044. static const char __pyx_k_graph[] = "graph";
  2045. static const char __pyx_k_items[] = "items";
  2046. static const char __pyx_k_map_b[] = "map_b";
  2047. static const char __pyx_k_map_u[] = "map_u";
  2048. static const char __pyx_k_nodes[] = "nodes";
  2049. static const char __pyx_k_numpy[] = "numpy";
  2050. static const char __pyx_k_print[] = "print";
  2051. static const char __pyx_k_range[] = "range";
  2052. static const char __pyx_k_utf_8[] = "utf-8";
  2053. static const char __pyx_k_value[] = "value";
  2054. static const char __pyx_k_GEDEnv[] = "GEDEnv";
  2055. static const char __pyx_k_classe[] = "classe";
  2056. static const char __pyx_k_ctypes[] = "ctypes";
  2057. static const char __pyx_k_decode[] = "decode";
  2058. static const char __pyx_k_encode[] = "encode";
  2059. static const char __pyx_k_import[] = "__import__";
  2060. static const char __pyx_k_init_2[] = "__init__";
  2061. static const char __pyx_k_method[] = "method";
  2062. static const char __pyx_k_module[] = "__module__";
  2063. static const char __pyx_k_name_2[] = "__name__";
  2064. static const char __pyx_k_option[] = "option";
  2065. static const char __pyx_k_reduce[] = "__reduce__";
  2066. static const char __pyx_k_NodeMap[] = "NodeMap";
  2067. static const char __pyx_k_classes[] = "classes";
  2068. static const char __pyx_k_dataset[] = "dataset";
  2069. static const char __pyx_k_dirname[] = "dirname";
  2070. static const char __pyx_k_message[] = "message";
  2071. static const char __pyx_k_node_id[] = "node_id";
  2072. static const char __pyx_k_options[] = "options";
  2073. static const char __pyx_k_prepare[] = "__prepare__";
  2074. static const char __pyx_k_add_edge[] = "add_edge";
  2075. static const char __pyx_k_add_node[] = "add_node";
  2076. static const char __pyx_k_gedlibpy[] = "gedlibpy";
  2077. static const char __pyx_k_getstate[] = "__getstate__";
  2078. static const char __pyx_k_graph_id[] = "graph_id";
  2079. static const char __pyx_k_networkx[] = "networkx";
  2080. static const char __pyx_k_node_map[] = "node_map";
  2081. static const char __pyx_k_nx_graph[] = "nx_graph";
  2082. static const char __pyx_k_path_XML[] = "path_XML";
  2083. static const char __pyx_k_qualname[] = "__qualname__";
  2084. static const char __pyx_k_realpath[] = "realpath";
  2085. static const char __pyx_k_setstate[] = "__setstate__";
  2086. static const char __pyx_k_InitError[] = "InitError";
  2087. static const char __pyx_k_TypeError[] = "TypeError";
  2088. static const char __pyx_k_add_graph[] = "add_graph";
  2089. static const char __pyx_k_adj_lists[] = "adj_lists";
  2090. static const char __pyx_k_edge_list[] = "edge_list";
  2091. static const char __pyx_k_edge_type[] = "edge_type";
  2092. static const char __pyx_k_edit_cost[] = "edit_cost";
  2093. static const char __pyx_k_graph_ids[] = "graph_ids";
  2094. static const char __pyx_k_iteritems[] = "iteritems";
  2095. static const char __pyx_k_map_edges[] = "map_edges";
  2096. static const char __pyx_k_metaclass[] = "__metaclass__";
  2097. static const char __pyx_k_node_type[] = "node_type";
  2098. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  2099. static const char __pyx_k_ValueError[] = "ValueError";
  2100. static const char __pyx_k_adj_matrix[] = "adj_matrix";
  2101. static const char __pyx_k_edge_label[] = "edge_label";
  2102. static const char __pyx_k_graph_name[] = "graph_name";
  2103. static const char __pyx_k_map_edge_b[] = "map_edge_b";
  2104. static const char __pyx_k_node_label[] = "node_label";
  2105. static const char __pyx_k_run_method[] = "run_method";
  2106. static const char __pyx_k_set_method[] = "set_method";
  2107. static const char __pyx_k_ImportError[] = "ImportError";
  2108. static const char __pyx_k_LoadLibrary[] = "LoadLibrary";
  2109. static const char __pyx_k_MemoryError[] = "MemoryError";
  2110. static const char __pyx_k_MethodError[] = "MethodError";
  2111. static const char __pyx_k_clear_graph[] = "clear_graph";
  2112. static const char __pyx_k_graph_class[] = "graph_class";
  2113. static const char __pyx_k_init_method[] = "init_method";
  2114. static const char __pyx_k_init_option[] = "init_option";
  2115. static const char __pyx_k_path_folder[] = "path_folder";
  2116. static const char __pyx_k_restart_env[] = "restart_env";
  2117. static const char __pyx_k_RuntimeError[] = "RuntimeError";
  2118. static const char __pyx_k_add_nx_graph[] = "add_nx_graph";
  2119. static const char __pyx_k_edge_label_1[] = "edge_label_1";
  2120. static const char __pyx_k_edge_label_2[] = "edge_label_2";
  2121. static const char __pyx_k_edge_label_b[] = "edge_label_b";
  2122. static const char __pyx_k_gedlibpy_pyx[] = "gedlibpy.pyx";
  2123. static const char __pyx_k_get_node_map[] = "get_node_map";
  2124. static const char __pyx_k_node_label_1[] = "node_label_1";
  2125. static const char __pyx_k_node_label_2[] = "node_label_2";
  2126. static const char __pyx_k_EditCostError[] = "EditCostError";
  2127. static const char __pyx_k_Graphs_loaded[] = "Graphs loaded ! ";
  2128. static const char __pyx_k_get_edge_data[] = "get_edge_data";
  2129. static const char __pyx_k_list_of_edges[] = "list_of_edges";
  2130. static const char __pyx_k_list_of_nodes[] = "list_of_nodes";
  2131. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  2132. static const char __pyx_k_set_edit_cost[] = "set_edit_cost";
  2133. static const char __pyx_k_add_assignment[] = "add_assignment";
  2134. static const char __pyx_k_get_dummy_node[] = "get_dummy_node";
  2135. static const char __pyx_k_is_initialized[] = "is_initialized";
  2136. static const char __pyx_k_decode_your_map[] = "decode_your_map";
  2137. static const char __pyx_k_encode_your_map[] = "encode_your_map";
  2138. static const char __pyx_k_get_graph_edges[] = "get_graph_edges";
  2139. static const char __pyx_k_get_upper_bound[] = "get_upper_bound";
  2140. static const char __pyx_k_gklearn_ged_env[] = "gklearn.ged.env";
  2141. static const char __pyx_k_load_GXL_graphs[] = "load_GXL_graphs";
  2142. static const char __pyx_k_print_to_stdout[] = "print_to_stdout";
  2143. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  2144. static const char __pyx_k_InitError___init[] = "InitError.__init__";
  2145. static const char __pyx_k_Number_of_graphs[] = "Number of graphs = ";
  2146. static const char __pyx_k_get_init_options[] = "get_init_options";
  2147. static const char __pyx_k_set_induced_cost[] = "set_induced_cost";
  2148. static const char __pyx_k_ignore_duplicates[] = "ignore_duplicates";
  2149. static const char __pyx_k_original_node_ids[] = "original_node_ids";
  2150. static const char __pyx_k_MethodError___init[] = "MethodError.__init__";
  2151. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  2152. static const char __pyx_k_decode_graph_edges[] = "decode_graph_edges";
  2153. static const char __pyx_k_edit_cost_constant[] = "edit_cost_constant";
  2154. static const char __pyx_k_get_method_options[] = "get_method_options";
  2155. static const char __pyx_k_get_graph_num_nodes[] = "get_graph_num_nodes";
  2156. static const char __pyx_k_EditCostError___init[] = "EditCostError.__init__";
  2157. static const char __pyx_k_list_of_init_options[] = "list_of_init_options";
  2158. static const char __pyx_k_get_edit_cost_options[] = "get_edit_cost_options";
  2159. static const char __pyx_k_get_graph_node_labels[] = "get_graph_node_labels";
  2160. static const char __pyx_k_get_original_node_ids[] = "get_original_node_ids";
  2161. static const char __pyx_k_lib_nomad_libnomad_so[] = "/lib/nomad/libnomad.so";
  2162. static const char __pyx_k_list_of_method_options[] = "list_of_method_options";
  2163. static const char __pyx_k_lib_nomad_libsgtelib_so[] = "/lib/nomad/libsgtelib.so";
  2164. static const char __pyx_k_Computation_between_graph[] = "Computation between graph ";
  2165. static const char __pyx_k_Initialization_terminated[] = "Initialization terminated !";
  2166. static const char __pyx_k_lib_fann_libdoublefann_so[] = "/lib/fann/libdoublefann.so";
  2167. static const char __pyx_k_lib_libsvm_3_22_libsvm_so[] = "/lib/libsvm.3.22/libsvm.so";
  2168. static const char __pyx_k_list_of_edit_cost_options[] = "list_of_edit_cost_options";
  2169. static const char __pyx_k_Initialization_in_progress[] = "Initialization in progress...";
  2170. static const char __pyx_k_Loading_graphs_in_progress[] = "Loading graphs in progress...";
  2171. static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  2172. static const char __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES[] = "EAGER_WITHOUT_SHUFFLED_COPIES";
  2173. 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";
  2174. 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";
  2175. 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";
  2176. static const char __pyx_k_Class_for_error_s_management_Th[] = "\n\t\tClass for error's management. This one is general. \n\t";
  2177. 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";
  2178. 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";
  2179. 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";
  2180. 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";
  2181. static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
  2182. static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  2183. static const char __pyx_k_with_all_the_others_including_h[] = " with all the others including himself.";
  2184. static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  2185. static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  2186. 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 !";
  2187. 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.";
  2188. 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";
  2189. static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  2190. static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
  2191. static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
  2192. static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  2193. static PyObject *__pyx_kp_u_;
  2194. static PyObject *__pyx_kp_s_Class_for_Edit_Cost_Error_Raise;
  2195. static PyObject *__pyx_kp_s_Class_for_Init_Error_Raise_an_e;
  2196. static PyObject *__pyx_kp_s_Class_for_Method_Error_Raise_an;
  2197. static PyObject *__pyx_kp_s_Class_for_error_s_management_Th;
  2198. static PyObject *__pyx_kp_u_Computation_between_graph;
  2199. static PyObject *__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES;
  2200. static PyObject *__pyx_n_s_EditCostError;
  2201. static PyObject *__pyx_n_s_EditCostError___init;
  2202. static PyObject *__pyx_n_s_Error;
  2203. static PyObject *__pyx_kp_u_Finish_The_return_contains_edit;
  2204. static PyObject *__pyx_kp_u_Finish_You_can_check_the_result;
  2205. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  2206. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  2207. static PyObject *__pyx_n_s_GEDEnv;
  2208. static PyObject *__pyx_n_s_Graph;
  2209. static PyObject *__pyx_kp_u_Graphs_loaded;
  2210. static PyObject *__pyx_n_s_ImportError;
  2211. static PyObject *__pyx_n_s_InitError;
  2212. static PyObject *__pyx_n_s_InitError___init;
  2213. static PyObject *__pyx_kp_u_Initialization_in_progress;
  2214. static PyObject *__pyx_kp_u_Initialization_terminated;
  2215. static PyObject *__pyx_n_s_LoadLibrary;
  2216. static PyObject *__pyx_kp_u_Loading_graphs_in_progress;
  2217. static PyObject *__pyx_n_s_MemoryError;
  2218. static PyObject *__pyx_n_s_MethodError;
  2219. static PyObject *__pyx_n_s_MethodError___init;
  2220. static PyObject *__pyx_n_s_NodeMap;
  2221. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  2222. static PyObject *__pyx_kp_u_Number_of_graphs;
  2223. static PyObject *__pyx_kp_u_Please_don_t_restart_the_environ;
  2224. static PyObject *__pyx_n_s_RuntimeError;
  2225. static PyObject *__pyx_kp_u_This_edit_cost_function_doesn_t;
  2226. static PyObject *__pyx_kp_u_This_init_option_doesn_t_exist_p;
  2227. static PyObject *__pyx_kp_u_This_method_doesn_t_exist_please;
  2228. static PyObject *__pyx_n_s_TypeError;
  2229. static PyObject *__pyx_n_s_ValueError;
  2230. static PyObject *__pyx_n_s__20;
  2231. static PyObject *__pyx_n_s_add_assignment;
  2232. static PyObject *__pyx_n_s_add_edge;
  2233. static PyObject *__pyx_n_s_add_graph;
  2234. static PyObject *__pyx_n_s_add_node;
  2235. static PyObject *__pyx_n_s_add_nx_graph;
  2236. static PyObject *__pyx_n_s_adj_lists;
  2237. static PyObject *__pyx_n_s_adj_matrix;
  2238. static PyObject *__pyx_n_s_cdll;
  2239. static PyObject *__pyx_n_s_classe;
  2240. static PyObject *__pyx_n_s_classes;
  2241. static PyObject *__pyx_n_s_clear_graph;
  2242. static PyObject *__pyx_n_s_cline_in_traceback;
  2243. static PyObject *__pyx_n_s_ctypes;
  2244. static PyObject *__pyx_n_s_dataset;
  2245. static PyObject *__pyx_n_s_decode;
  2246. static PyObject *__pyx_n_s_decode_graph_edges;
  2247. static PyObject *__pyx_n_s_decode_your_map;
  2248. static PyObject *__pyx_n_s_dirname;
  2249. static PyObject *__pyx_n_s_doc;
  2250. static PyObject *__pyx_n_s_edge_label;
  2251. static PyObject *__pyx_n_s_edge_label_1;
  2252. static PyObject *__pyx_n_s_edge_label_2;
  2253. static PyObject *__pyx_n_s_edge_label_b;
  2254. static PyObject *__pyx_n_s_edge_list;
  2255. static PyObject *__pyx_n_s_edge_type;
  2256. static PyObject *__pyx_n_s_edges;
  2257. static PyObject *__pyx_n_s_edit_cost;
  2258. static PyObject *__pyx_n_s_edit_cost_constant;
  2259. static PyObject *__pyx_n_s_encode;
  2260. static PyObject *__pyx_n_s_encode_your_map;
  2261. static PyObject *__pyx_n_s_file;
  2262. static PyObject *__pyx_n_s_g;
  2263. static PyObject *__pyx_n_s_g1;
  2264. static PyObject *__pyx_n_s_g2;
  2265. static PyObject *__pyx_n_s_g_id;
  2266. static PyObject *__pyx_n_s_gedlibpy;
  2267. static PyObject *__pyx_kp_s_gedlibpy_pyx;
  2268. static PyObject *__pyx_n_s_get_dummy_node;
  2269. static PyObject *__pyx_n_s_get_edge_data;
  2270. static PyObject *__pyx_n_s_get_edit_cost_options;
  2271. static PyObject *__pyx_n_s_get_graph_edges;
  2272. static PyObject *__pyx_n_s_get_graph_node_labels;
  2273. static PyObject *__pyx_n_s_get_graph_num_nodes;
  2274. static PyObject *__pyx_n_s_get_init_options;
  2275. static PyObject *__pyx_n_s_get_method_options;
  2276. static PyObject *__pyx_n_s_get_node_map;
  2277. static PyObject *__pyx_n_s_get_original_node_ids;
  2278. static PyObject *__pyx_n_s_get_upper_bound;
  2279. static PyObject *__pyx_n_s_getstate;
  2280. static PyObject *__pyx_n_s_gklearn_ged_env;
  2281. static PyObject *__pyx_n_s_graph;
  2282. static PyObject *__pyx_n_s_graph_class;
  2283. static PyObject *__pyx_n_s_graph_id;
  2284. static PyObject *__pyx_n_s_graph_ids;
  2285. static PyObject *__pyx_n_s_graph_name;
  2286. static PyObject *__pyx_n_s_h;
  2287. static PyObject *__pyx_n_s_h_id;
  2288. static PyObject *__pyx_n_s_head;
  2289. static PyObject *__pyx_n_u_id;
  2290. static PyObject *__pyx_n_s_ignore_duplicates;
  2291. static PyObject *__pyx_n_s_import;
  2292. static PyObject *__pyx_n_s_inf;
  2293. static PyObject *__pyx_n_s_init;
  2294. static PyObject *__pyx_n_s_init_2;
  2295. static PyObject *__pyx_n_s_init_method;
  2296. static PyObject *__pyx_n_s_init_option;
  2297. static PyObject *__pyx_n_s_is_initialized;
  2298. static PyObject *__pyx_n_s_items;
  2299. static PyObject *__pyx_n_s_iteritems;
  2300. static PyObject *__pyx_n_s_key;
  2301. static PyObject *__pyx_n_s_lib1;
  2302. static PyObject *__pyx_n_s_lib2;
  2303. static PyObject *__pyx_n_s_lib3;
  2304. static PyObject *__pyx_n_s_lib4;
  2305. static PyObject *__pyx_kp_u_lib_fann_libdoublefann_so;
  2306. static PyObject *__pyx_kp_u_lib_libsvm_3_22_libsvm_so;
  2307. static PyObject *__pyx_kp_u_lib_nomad_libnomad_so;
  2308. static PyObject *__pyx_kp_u_lib_nomad_libsgtelib_so;
  2309. static PyObject *__pyx_n_s_list_of_edges;
  2310. static PyObject *__pyx_n_s_list_of_edit_cost_options;
  2311. static PyObject *__pyx_n_s_list_of_init_options;
  2312. static PyObject *__pyx_n_s_list_of_method_options;
  2313. static PyObject *__pyx_n_s_list_of_nodes;
  2314. static PyObject *__pyx_n_s_load_GXL_graphs;
  2315. static PyObject *__pyx_n_s_main;
  2316. static PyObject *__pyx_n_s_map_b;
  2317. static PyObject *__pyx_n_s_map_edge_b;
  2318. static PyObject *__pyx_n_s_map_edges;
  2319. static PyObject *__pyx_n_s_map_u;
  2320. static PyObject *__pyx_n_s_message;
  2321. static PyObject *__pyx_n_s_metaclass;
  2322. static PyObject *__pyx_n_s_method;
  2323. static PyObject *__pyx_n_s_module;
  2324. static PyObject *__pyx_n_s_name;
  2325. static PyObject *__pyx_n_s_name_2;
  2326. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  2327. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  2328. static PyObject *__pyx_n_s_networkx;
  2329. static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  2330. static PyObject *__pyx_n_s_node_id;
  2331. static PyObject *__pyx_n_s_node_label;
  2332. static PyObject *__pyx_n_s_node_label_1;
  2333. static PyObject *__pyx_n_s_node_label_2;
  2334. static PyObject *__pyx_n_s_node_map;
  2335. static PyObject *__pyx_n_s_node_type;
  2336. static PyObject *__pyx_n_s_nodes;
  2337. static PyObject *__pyx_n_s_np;
  2338. static PyObject *__pyx_n_s_numpy;
  2339. static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
  2340. static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
  2341. static PyObject *__pyx_n_s_nx;
  2342. static PyObject *__pyx_n_s_nx_graph;
  2343. static PyObject *__pyx_n_s_option;
  2344. static PyObject *__pyx_n_s_options;
  2345. static PyObject *__pyx_n_u_original_node_ids;
  2346. static PyObject *__pyx_n_s_os;
  2347. static PyObject *__pyx_n_s_path;
  2348. static PyObject *__pyx_n_s_path_XML;
  2349. static PyObject *__pyx_n_s_path_folder;
  2350. static PyObject *__pyx_n_s_prepare;
  2351. static PyObject *__pyx_n_s_print;
  2352. static PyObject *__pyx_n_s_print_to_stdout;
  2353. static PyObject *__pyx_n_s_qualname;
  2354. static PyObject *__pyx_n_s_range;
  2355. static PyObject *__pyx_n_s_realpath;
  2356. static PyObject *__pyx_n_s_reduce;
  2357. static PyObject *__pyx_n_s_reduce_cython;
  2358. static PyObject *__pyx_n_s_reduce_ex;
  2359. static PyObject *__pyx_n_s_res;
  2360. static PyObject *__pyx_n_s_restart_env;
  2361. static PyObject *__pyx_n_s_run_method;
  2362. static PyObject *__pyx_n_s_self;
  2363. static PyObject *__pyx_n_s_set_edit_cost;
  2364. static PyObject *__pyx_n_s_set_induced_cost;
  2365. static PyObject *__pyx_n_s_set_method;
  2366. static PyObject *__pyx_n_s_setstate;
  2367. static PyObject *__pyx_n_s_setstate_cython;
  2368. static PyObject *__pyx_n_s_tail;
  2369. static PyObject *__pyx_n_s_test;
  2370. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  2371. static PyObject *__pyx_kp_u_utf_8;
  2372. static PyObject *__pyx_n_s_value;
  2373. static PyObject *__pyx_kp_u_with_all_the_others_including_h;
  2374. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2375. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2376. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2377. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2378. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2379. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2380. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2381. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2382. 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 */
  2383. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2384. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2385. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2386. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2387. 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 */
  2388. 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 */
  2389. 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 */
  2390. 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 */
  2391. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2392. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2393. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2394. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2395. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2396. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2397. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2398. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2399. 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 */
  2400. 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 */
  2401. 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 */
  2402. 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 */
  2403. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2404. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2405. 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 */
  2406. 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 */
  2407. 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 */
  2408. 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 */
  2409. 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 */
  2410. 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 */
  2411. 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 */
  2412. 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 */
  2413. 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 */
  2414. 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 */
  2415. 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 */
  2416. 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 */
  2417. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2418. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2419. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2420. 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 */
  2421. 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 */
  2422. 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 */
  2423. 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 */
  2424. 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 */
  2425. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2426. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2427. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2428. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2429. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2430. 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 */
  2431. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2432. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2433. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels); /* proto */
  2434. 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 */
  2435. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2436. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2437. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels); /* proto */
  2438. 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 */
  2439. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2440. 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 */
  2441. 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 */
  2442. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2443. 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 */
  2444. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2445. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2446. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2447. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u); /* proto */
  2448. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b); /* proto */
  2449. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /* proto */
  2450. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  2451. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2452. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
  2453. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2454. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  2455. static PyObject *__pyx_int_0;
  2456. static PyObject *__pyx_k__2;
  2457. static PyObject *__pyx_k__3;
  2458. static PyObject *__pyx_tuple__4;
  2459. static PyObject *__pyx_tuple__5;
  2460. static PyObject *__pyx_tuple__6;
  2461. static PyObject *__pyx_tuple__7;
  2462. static PyObject *__pyx_tuple__8;
  2463. static PyObject *__pyx_tuple__9;
  2464. static PyObject *__pyx_tuple__10;
  2465. static PyObject *__pyx_tuple__11;
  2466. static PyObject *__pyx_tuple__12;
  2467. static PyObject *__pyx_tuple__13;
  2468. static PyObject *__pyx_tuple__14;
  2469. static PyObject *__pyx_tuple__15;
  2470. static PyObject *__pyx_tuple__16;
  2471. static PyObject *__pyx_tuple__17;
  2472. static PyObject *__pyx_tuple__18;
  2473. static PyObject *__pyx_tuple__19;
  2474. static PyObject *__pyx_tuple__21;
  2475. static PyObject *__pyx_tuple__23;
  2476. static PyObject *__pyx_tuple__25;
  2477. static PyObject *__pyx_tuple__28;
  2478. static PyObject *__pyx_tuple__30;
  2479. static PyObject *__pyx_tuple__32;
  2480. static PyObject *__pyx_tuple__34;
  2481. static PyObject *__pyx_tuple__36;
  2482. static PyObject *__pyx_tuple__38;
  2483. static PyObject *__pyx_codeobj__22;
  2484. static PyObject *__pyx_codeobj__24;
  2485. static PyObject *__pyx_codeobj__26;
  2486. static PyObject *__pyx_codeobj__27;
  2487. static PyObject *__pyx_codeobj__29;
  2488. static PyObject *__pyx_codeobj__31;
  2489. static PyObject *__pyx_codeobj__33;
  2490. static PyObject *__pyx_codeobj__35;
  2491. static PyObject *__pyx_codeobj__37;
  2492. static PyObject *__pyx_codeobj__39;
  2493. /* Late includes */
  2494. /* "gedlibpy.pyx":128
  2495. *
  2496. *
  2497. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2498. * """
  2499. * Searchs the differents edit cost functions and returns the result.
  2500. */
  2501. /* Python wrapper */
  2502. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2503. 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";
  2504. 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};
  2505. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2506. PyObject *__pyx_r = 0;
  2507. __Pyx_RefNannyDeclarations
  2508. __Pyx_RefNannySetupContext("get_edit_cost_options (wrapper)", 0);
  2509. __pyx_r = __pyx_pf_8gedlibpy_get_edit_cost_options(__pyx_self);
  2510. /* function exit code */
  2511. __Pyx_RefNannyFinishContext();
  2512. return __pyx_r;
  2513. }
  2514. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2515. std::string __pyx_7genexpr__pyx_v_option;
  2516. PyObject *__pyx_r = NULL;
  2517. __Pyx_RefNannyDeclarations
  2518. PyObject *__pyx_t_1 = NULL;
  2519. std::vector<std::string> __pyx_t_2;
  2520. std::vector<std::string> ::iterator __pyx_t_3;
  2521. std::vector<std::string> *__pyx_t_4;
  2522. std::string __pyx_t_5;
  2523. PyObject *__pyx_t_6 = NULL;
  2524. __Pyx_RefNannySetupContext("get_edit_cost_options", 0);
  2525. /* "gedlibpy.pyx":139
  2526. * """
  2527. *
  2528. * return [option.decode('utf-8') for option in getEditCostStringOptions()] # <<<<<<<<<<<<<<
  2529. *
  2530. *
  2531. */
  2532. __Pyx_XDECREF(__pyx_r);
  2533. { /* enter inner scope */
  2534. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  2535. __Pyx_GOTREF(__pyx_t_1);
  2536. try {
  2537. __pyx_t_2 = pyged::getEditCostStringOptions();
  2538. } catch(...) {
  2539. __Pyx_CppExn2PyErr();
  2540. __PYX_ERR(0, 139, __pyx_L1_error)
  2541. }
  2542. __pyx_t_4 = &__pyx_t_2;
  2543. __pyx_t_3 = __pyx_t_4->begin();
  2544. for (;;) {
  2545. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2546. __pyx_t_5 = *__pyx_t_3;
  2547. ++__pyx_t_3;
  2548. __pyx_7genexpr__pyx_v_option = __pyx_t_5;
  2549. __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)
  2550. __Pyx_GOTREF(__pyx_t_6);
  2551. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 139, __pyx_L1_error)
  2552. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2553. }
  2554. } /* exit inner scope */
  2555. __pyx_r = __pyx_t_1;
  2556. __pyx_t_1 = 0;
  2557. goto __pyx_L0;
  2558. /* "gedlibpy.pyx":128
  2559. *
  2560. *
  2561. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2562. * """
  2563. * Searchs the differents edit cost functions and returns the result.
  2564. */
  2565. /* function exit code */
  2566. __pyx_L1_error:;
  2567. __Pyx_XDECREF(__pyx_t_1);
  2568. __Pyx_XDECREF(__pyx_t_6);
  2569. __Pyx_AddTraceback("gedlibpy.get_edit_cost_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2570. __pyx_r = NULL;
  2571. __pyx_L0:;
  2572. __Pyx_XGIVEREF(__pyx_r);
  2573. __Pyx_RefNannyFinishContext();
  2574. return __pyx_r;
  2575. }
  2576. /* "gedlibpy.pyx":142
  2577. *
  2578. *
  2579. * def get_method_options() : # <<<<<<<<<<<<<<
  2580. * """
  2581. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2582. */
  2583. /* Python wrapper */
  2584. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2585. 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";
  2586. 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};
  2587. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2588. PyObject *__pyx_r = 0;
  2589. __Pyx_RefNannyDeclarations
  2590. __Pyx_RefNannySetupContext("get_method_options (wrapper)", 0);
  2591. __pyx_r = __pyx_pf_8gedlibpy_2get_method_options(__pyx_self);
  2592. /* function exit code */
  2593. __Pyx_RefNannyFinishContext();
  2594. return __pyx_r;
  2595. }
  2596. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2597. std::string __pyx_8genexpr1__pyx_v_option;
  2598. PyObject *__pyx_r = NULL;
  2599. __Pyx_RefNannyDeclarations
  2600. PyObject *__pyx_t_1 = NULL;
  2601. std::vector<std::string> __pyx_t_2;
  2602. std::vector<std::string> ::iterator __pyx_t_3;
  2603. std::vector<std::string> *__pyx_t_4;
  2604. std::string __pyx_t_5;
  2605. PyObject *__pyx_t_6 = NULL;
  2606. __Pyx_RefNannySetupContext("get_method_options", 0);
  2607. /* "gedlibpy.pyx":152
  2608. * .. note:: Prefer the list_of_method_options attribute of this module.
  2609. * """
  2610. * return [option.decode('utf-8') for option in getMethodStringOptions()] # <<<<<<<<<<<<<<
  2611. *
  2612. *
  2613. */
  2614. __Pyx_XDECREF(__pyx_r);
  2615. { /* enter inner scope */
  2616. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
  2617. __Pyx_GOTREF(__pyx_t_1);
  2618. try {
  2619. __pyx_t_2 = pyged::getMethodStringOptions();
  2620. } catch(...) {
  2621. __Pyx_CppExn2PyErr();
  2622. __PYX_ERR(0, 152, __pyx_L1_error)
  2623. }
  2624. __pyx_t_4 = &__pyx_t_2;
  2625. __pyx_t_3 = __pyx_t_4->begin();
  2626. for (;;) {
  2627. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2628. __pyx_t_5 = *__pyx_t_3;
  2629. ++__pyx_t_3;
  2630. __pyx_8genexpr1__pyx_v_option = __pyx_t_5;
  2631. __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)
  2632. __Pyx_GOTREF(__pyx_t_6);
  2633. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 152, __pyx_L1_error)
  2634. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2635. }
  2636. } /* exit inner scope */
  2637. __pyx_r = __pyx_t_1;
  2638. __pyx_t_1 = 0;
  2639. goto __pyx_L0;
  2640. /* "gedlibpy.pyx":142
  2641. *
  2642. *
  2643. * def get_method_options() : # <<<<<<<<<<<<<<
  2644. * """
  2645. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2646. */
  2647. /* function exit code */
  2648. __pyx_L1_error:;
  2649. __Pyx_XDECREF(__pyx_t_1);
  2650. __Pyx_XDECREF(__pyx_t_6);
  2651. __Pyx_AddTraceback("gedlibpy.get_method_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2652. __pyx_r = NULL;
  2653. __pyx_L0:;
  2654. __Pyx_XGIVEREF(__pyx_r);
  2655. __Pyx_RefNannyFinishContext();
  2656. return __pyx_r;
  2657. }
  2658. /* "gedlibpy.pyx":155
  2659. *
  2660. *
  2661. * def get_init_options() : # <<<<<<<<<<<<<<
  2662. * """
  2663. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2664. */
  2665. /* Python wrapper */
  2666. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2667. 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";
  2668. 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};
  2669. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2670. PyObject *__pyx_r = 0;
  2671. __Pyx_RefNannyDeclarations
  2672. __Pyx_RefNannySetupContext("get_init_options (wrapper)", 0);
  2673. __pyx_r = __pyx_pf_8gedlibpy_4get_init_options(__pyx_self);
  2674. /* function exit code */
  2675. __Pyx_RefNannyFinishContext();
  2676. return __pyx_r;
  2677. }
  2678. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2679. std::string __pyx_8genexpr2__pyx_v_option;
  2680. PyObject *__pyx_r = NULL;
  2681. __Pyx_RefNannyDeclarations
  2682. PyObject *__pyx_t_1 = NULL;
  2683. std::vector<std::string> __pyx_t_2;
  2684. std::vector<std::string> ::iterator __pyx_t_3;
  2685. std::vector<std::string> *__pyx_t_4;
  2686. std::string __pyx_t_5;
  2687. PyObject *__pyx_t_6 = NULL;
  2688. __Pyx_RefNannySetupContext("get_init_options", 0);
  2689. /* "gedlibpy.pyx":165
  2690. * .. note:: Prefer the list_of_init_options attribute of this module.
  2691. * """
  2692. * return [option.decode('utf-8') for option in getInitStringOptions()] # <<<<<<<<<<<<<<
  2693. *
  2694. *
  2695. */
  2696. __Pyx_XDECREF(__pyx_r);
  2697. { /* enter inner scope */
  2698. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  2699. __Pyx_GOTREF(__pyx_t_1);
  2700. try {
  2701. __pyx_t_2 = pyged::getInitStringOptions();
  2702. } catch(...) {
  2703. __Pyx_CppExn2PyErr();
  2704. __PYX_ERR(0, 165, __pyx_L1_error)
  2705. }
  2706. __pyx_t_4 = &__pyx_t_2;
  2707. __pyx_t_3 = __pyx_t_4->begin();
  2708. for (;;) {
  2709. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2710. __pyx_t_5 = *__pyx_t_3;
  2711. ++__pyx_t_3;
  2712. __pyx_8genexpr2__pyx_v_option = __pyx_t_5;
  2713. __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)
  2714. __Pyx_GOTREF(__pyx_t_6);
  2715. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 165, __pyx_L1_error)
  2716. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2717. }
  2718. } /* exit inner scope */
  2719. __pyx_r = __pyx_t_1;
  2720. __pyx_t_1 = 0;
  2721. goto __pyx_L0;
  2722. /* "gedlibpy.pyx":155
  2723. *
  2724. *
  2725. * def get_init_options() : # <<<<<<<<<<<<<<
  2726. * """
  2727. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2728. */
  2729. /* function exit code */
  2730. __pyx_L1_error:;
  2731. __Pyx_XDECREF(__pyx_t_1);
  2732. __Pyx_XDECREF(__pyx_t_6);
  2733. __Pyx_AddTraceback("gedlibpy.get_init_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2734. __pyx_r = NULL;
  2735. __pyx_L0:;
  2736. __Pyx_XGIVEREF(__pyx_r);
  2737. __Pyx_RefNannyFinishContext();
  2738. return __pyx_r;
  2739. }
  2740. /* "gedlibpy.pyx":168
  2741. *
  2742. *
  2743. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2744. * """
  2745. * Returns the ID of a dummy node.
  2746. */
  2747. /* Python wrapper */
  2748. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2749. 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";
  2750. 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};
  2751. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2752. PyObject *__pyx_r = 0;
  2753. __Pyx_RefNannyDeclarations
  2754. __Pyx_RefNannySetupContext("get_dummy_node (wrapper)", 0);
  2755. __pyx_r = __pyx_pf_8gedlibpy_6get_dummy_node(__pyx_self);
  2756. /* function exit code */
  2757. __Pyx_RefNannyFinishContext();
  2758. return __pyx_r;
  2759. }
  2760. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self) {
  2761. PyObject *__pyx_r = NULL;
  2762. __Pyx_RefNannyDeclarations
  2763. size_t __pyx_t_1;
  2764. PyObject *__pyx_t_2 = NULL;
  2765. __Pyx_RefNannySetupContext("get_dummy_node", 0);
  2766. /* "gedlibpy.pyx":177
  2767. * .. note:: A dummy node is used when a node isn't associated to an other node.
  2768. * """
  2769. * return getDummyNode() # <<<<<<<<<<<<<<
  2770. *
  2771. *
  2772. */
  2773. __Pyx_XDECREF(__pyx_r);
  2774. try {
  2775. __pyx_t_1 = pyged::getDummyNode();
  2776. } catch(...) {
  2777. __Pyx_CppExn2PyErr();
  2778. __PYX_ERR(0, 177, __pyx_L1_error)
  2779. }
  2780. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
  2781. __Pyx_GOTREF(__pyx_t_2);
  2782. __pyx_r = __pyx_t_2;
  2783. __pyx_t_2 = 0;
  2784. goto __pyx_L0;
  2785. /* "gedlibpy.pyx":168
  2786. *
  2787. *
  2788. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2789. * """
  2790. * Returns the ID of a dummy node.
  2791. */
  2792. /* function exit code */
  2793. __pyx_L1_error:;
  2794. __Pyx_XDECREF(__pyx_t_2);
  2795. __Pyx_AddTraceback("gedlibpy.get_dummy_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2796. __pyx_r = NULL;
  2797. __pyx_L0:;
  2798. __Pyx_XGIVEREF(__pyx_r);
  2799. __Pyx_RefNannyFinishContext();
  2800. return __pyx_r;
  2801. }
  2802. /* "gedlibpy.pyx":187
  2803. *
  2804. *
  2805. * def __cinit__(self): # <<<<<<<<<<<<<<
  2806. * self.c_env = new PyGEDEnv()
  2807. *
  2808. */
  2809. /* Python wrapper */
  2810. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2811. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2812. int __pyx_r;
  2813. __Pyx_RefNannyDeclarations
  2814. __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  2815. if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
  2816. __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  2817. if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  2818. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv___cinit__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2819. /* function exit code */
  2820. __Pyx_RefNannyFinishContext();
  2821. return __pyx_r;
  2822. }
  2823. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2824. int __pyx_r;
  2825. __Pyx_RefNannyDeclarations
  2826. pyged::PyGEDEnv *__pyx_t_1;
  2827. __Pyx_RefNannySetupContext("__cinit__", 0);
  2828. /* "gedlibpy.pyx":188
  2829. *
  2830. * def __cinit__(self):
  2831. * self.c_env = new PyGEDEnv() # <<<<<<<<<<<<<<
  2832. *
  2833. *
  2834. */
  2835. try {
  2836. __pyx_t_1 = new pyged::PyGEDEnv();
  2837. } catch(...) {
  2838. __Pyx_CppExn2PyErr();
  2839. __PYX_ERR(0, 188, __pyx_L1_error)
  2840. }
  2841. __pyx_v_self->c_env = __pyx_t_1;
  2842. /* "gedlibpy.pyx":187
  2843. *
  2844. *
  2845. * def __cinit__(self): # <<<<<<<<<<<<<<
  2846. * self.c_env = new PyGEDEnv()
  2847. *
  2848. */
  2849. /* function exit code */
  2850. __pyx_r = 0;
  2851. goto __pyx_L0;
  2852. __pyx_L1_error:;
  2853. __Pyx_AddTraceback("gedlibpy.GEDEnv.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2854. __pyx_r = -1;
  2855. __pyx_L0:;
  2856. __Pyx_RefNannyFinishContext();
  2857. return __pyx_r;
  2858. }
  2859. /* "gedlibpy.pyx":191
  2860. *
  2861. *
  2862. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2863. * del self.c_env
  2864. *
  2865. */
  2866. /* Python wrapper */
  2867. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
  2868. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self) {
  2869. __Pyx_RefNannyDeclarations
  2870. __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  2871. __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2872. /* function exit code */
  2873. __Pyx_RefNannyFinishContext();
  2874. }
  2875. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2876. __Pyx_RefNannyDeclarations
  2877. __Pyx_RefNannySetupContext("__dealloc__", 0);
  2878. /* "gedlibpy.pyx":192
  2879. *
  2880. * def __dealloc__(self):
  2881. * del self.c_env # <<<<<<<<<<<<<<
  2882. *
  2883. *
  2884. */
  2885. delete __pyx_v_self->c_env;
  2886. /* "gedlibpy.pyx":191
  2887. *
  2888. *
  2889. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2890. * del self.c_env
  2891. *
  2892. */
  2893. /* function exit code */
  2894. __Pyx_RefNannyFinishContext();
  2895. }
  2896. /* "gedlibpy.pyx":195
  2897. *
  2898. *
  2899. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2900. * """
  2901. * Checks and returns if the computation environment is initialized or not.
  2902. */
  2903. /* Python wrapper */
  2904. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2905. 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";
  2906. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2907. PyObject *__pyx_r = 0;
  2908. __Pyx_RefNannyDeclarations
  2909. __Pyx_RefNannySetupContext("is_initialized (wrapper)", 0);
  2910. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2911. /* function exit code */
  2912. __Pyx_RefNannyFinishContext();
  2913. return __pyx_r;
  2914. }
  2915. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2916. PyObject *__pyx_r = NULL;
  2917. __Pyx_RefNannyDeclarations
  2918. bool __pyx_t_1;
  2919. PyObject *__pyx_t_2 = NULL;
  2920. __Pyx_RefNannySetupContext("is_initialized", 0);
  2921. /* "gedlibpy.pyx":204
  2922. * .. note:: This function exists for internals verifications but you can use it for your code.
  2923. * """
  2924. * return self.c_env.isInitialized() # <<<<<<<<<<<<<<
  2925. *
  2926. *
  2927. */
  2928. __Pyx_XDECREF(__pyx_r);
  2929. try {
  2930. __pyx_t_1 = __pyx_v_self->c_env->isInitialized();
  2931. } catch(...) {
  2932. __Pyx_CppExn2PyErr();
  2933. __PYX_ERR(0, 204, __pyx_L1_error)
  2934. }
  2935. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
  2936. __Pyx_GOTREF(__pyx_t_2);
  2937. __pyx_r = __pyx_t_2;
  2938. __pyx_t_2 = 0;
  2939. goto __pyx_L0;
  2940. /* "gedlibpy.pyx":195
  2941. *
  2942. *
  2943. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2944. * """
  2945. * Checks and returns if the computation environment is initialized or not.
  2946. */
  2947. /* function exit code */
  2948. __pyx_L1_error:;
  2949. __Pyx_XDECREF(__pyx_t_2);
  2950. __Pyx_AddTraceback("gedlibpy.GEDEnv.is_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2951. __pyx_r = NULL;
  2952. __pyx_L0:;
  2953. __Pyx_XGIVEREF(__pyx_r);
  2954. __Pyx_RefNannyFinishContext();
  2955. return __pyx_r;
  2956. }
  2957. /* "gedlibpy.pyx":207
  2958. *
  2959. *
  2960. * def restart_env(self) : # <<<<<<<<<<<<<<
  2961. * """
  2962. * Restarts the environment variable. All data related to it will be delete.
  2963. */
  2964. /* Python wrapper */
  2965. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2966. 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";
  2967. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2968. PyObject *__pyx_r = 0;
  2969. __Pyx_RefNannyDeclarations
  2970. __Pyx_RefNannySetupContext("restart_env (wrapper)", 0);
  2971. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_6restart_env(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2972. /* function exit code */
  2973. __Pyx_RefNannyFinishContext();
  2974. return __pyx_r;
  2975. }
  2976. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2977. PyObject *__pyx_r = NULL;
  2978. __Pyx_RefNannyDeclarations
  2979. __Pyx_RefNannySetupContext("restart_env", 0);
  2980. /* "gedlibpy.pyx":214
  2981. * .. note:: You can now delete and add somes graphs after initialization so you can avoid this function.
  2982. * """
  2983. * self.c_env.restartEnv() # <<<<<<<<<<<<<<
  2984. *
  2985. *
  2986. */
  2987. try {
  2988. __pyx_v_self->c_env->restartEnv();
  2989. } catch(...) {
  2990. __Pyx_CppExn2PyErr();
  2991. __PYX_ERR(0, 214, __pyx_L1_error)
  2992. }
  2993. /* "gedlibpy.pyx":207
  2994. *
  2995. *
  2996. * def restart_env(self) : # <<<<<<<<<<<<<<
  2997. * """
  2998. * Restarts the environment variable. All data related to it will be delete.
  2999. */
  3000. /* function exit code */
  3001. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3002. goto __pyx_L0;
  3003. __pyx_L1_error:;
  3004. __Pyx_AddTraceback("gedlibpy.GEDEnv.restart_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3005. __pyx_r = NULL;
  3006. __pyx_L0:;
  3007. __Pyx_XGIVEREF(__pyx_r);
  3008. __Pyx_RefNannyFinishContext();
  3009. return __pyx_r;
  3010. }
  3011. /* "gedlibpy.pyx":217
  3012. *
  3013. *
  3014. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3015. * """
  3016. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3017. */
  3018. /* Python wrapper */
  3019. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3020. 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";
  3021. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3022. PyObject *__pyx_v_path_folder = 0;
  3023. PyObject *__pyx_v_path_XML = 0;
  3024. PyObject *__pyx_v_node_type = 0;
  3025. PyObject *__pyx_v_edge_type = 0;
  3026. PyObject *__pyx_r = 0;
  3027. __Pyx_RefNannyDeclarations
  3028. __Pyx_RefNannySetupContext("load_GXL_graphs (wrapper)", 0);
  3029. {
  3030. 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};
  3031. PyObject* values[4] = {0,0,0,0};
  3032. if (unlikely(__pyx_kwds)) {
  3033. Py_ssize_t kw_args;
  3034. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3035. switch (pos_args) {
  3036. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3037. CYTHON_FALLTHROUGH;
  3038. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3039. CYTHON_FALLTHROUGH;
  3040. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3041. CYTHON_FALLTHROUGH;
  3042. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3043. CYTHON_FALLTHROUGH;
  3044. case 0: break;
  3045. default: goto __pyx_L5_argtuple_error;
  3046. }
  3047. kw_args = PyDict_Size(__pyx_kwds);
  3048. switch (pos_args) {
  3049. case 0:
  3050. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  3051. else goto __pyx_L5_argtuple_error;
  3052. CYTHON_FALLTHROUGH;
  3053. case 1:
  3054. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  3055. else {
  3056. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 217, __pyx_L3_error)
  3057. }
  3058. CYTHON_FALLTHROUGH;
  3059. case 2:
  3060. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_type)) != 0)) kw_args--;
  3061. else {
  3062. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 217, __pyx_L3_error)
  3063. }
  3064. CYTHON_FALLTHROUGH;
  3065. case 3:
  3066. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_type)) != 0)) kw_args--;
  3067. else {
  3068. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 217, __pyx_L3_error)
  3069. }
  3070. }
  3071. if (unlikely(kw_args > 0)) {
  3072. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
  3073. }
  3074. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  3075. goto __pyx_L5_argtuple_error;
  3076. } else {
  3077. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3078. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3079. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3080. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3081. }
  3082. __pyx_v_path_folder = values[0];
  3083. __pyx_v_path_XML = values[1];
  3084. __pyx_v_node_type = values[2];
  3085. __pyx_v_edge_type = values[3];
  3086. }
  3087. goto __pyx_L4_argument_unpacking_done;
  3088. __pyx_L5_argtuple_error:;
  3089. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
  3090. __pyx_L3_error:;
  3091. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3092. __Pyx_RefNannyFinishContext();
  3093. return NULL;
  3094. __pyx_L4_argument_unpacking_done:;
  3095. __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);
  3096. /* function exit code */
  3097. __Pyx_RefNannyFinishContext();
  3098. return __pyx_r;
  3099. }
  3100. 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) {
  3101. PyObject *__pyx_r = NULL;
  3102. __Pyx_RefNannyDeclarations
  3103. PyObject *__pyx_t_1 = NULL;
  3104. PyObject *__pyx_t_2 = NULL;
  3105. PyObject *__pyx_t_3 = NULL;
  3106. std::string __pyx_t_4;
  3107. std::string __pyx_t_5;
  3108. bool __pyx_t_6;
  3109. bool __pyx_t_7;
  3110. __Pyx_RefNannySetupContext("load_GXL_graphs", 0);
  3111. /* "gedlibpy.pyx":233
  3112. * .. note:: You can call this function multiple times if you want, but not after an init call.
  3113. * """
  3114. * self.c_env.loadGXLGraph(path_folder.encode('utf-8'), path_XML.encode('utf-8'), node_type, edge_type) # <<<<<<<<<<<<<<
  3115. *
  3116. *
  3117. */
  3118. __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)
  3119. __Pyx_GOTREF(__pyx_t_2);
  3120. __pyx_t_3 = NULL;
  3121. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3122. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3123. if (likely(__pyx_t_3)) {
  3124. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3125. __Pyx_INCREF(__pyx_t_3);
  3126. __Pyx_INCREF(function);
  3127. __Pyx_DECREF_SET(__pyx_t_2, function);
  3128. }
  3129. }
  3130. __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);
  3131. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3132. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  3133. __Pyx_GOTREF(__pyx_t_1);
  3134. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3135. __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)
  3136. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3137. __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)
  3138. __Pyx_GOTREF(__pyx_t_2);
  3139. __pyx_t_3 = NULL;
  3140. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3141. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3142. if (likely(__pyx_t_3)) {
  3143. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3144. __Pyx_INCREF(__pyx_t_3);
  3145. __Pyx_INCREF(function);
  3146. __Pyx_DECREF_SET(__pyx_t_2, function);
  3147. }
  3148. }
  3149. __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);
  3150. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3151. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  3152. __Pyx_GOTREF(__pyx_t_1);
  3153. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3154. __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)
  3155. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3156. __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)
  3157. __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)
  3158. try {
  3159. __pyx_v_self->c_env->loadGXLGraph(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
  3160. } catch(...) {
  3161. __Pyx_CppExn2PyErr();
  3162. __PYX_ERR(0, 233, __pyx_L1_error)
  3163. }
  3164. /* "gedlibpy.pyx":217
  3165. *
  3166. *
  3167. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3168. * """
  3169. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3170. */
  3171. /* function exit code */
  3172. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3173. goto __pyx_L0;
  3174. __pyx_L1_error:;
  3175. __Pyx_XDECREF(__pyx_t_1);
  3176. __Pyx_XDECREF(__pyx_t_2);
  3177. __Pyx_XDECREF(__pyx_t_3);
  3178. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3179. __pyx_r = NULL;
  3180. __pyx_L0:;
  3181. __Pyx_XGIVEREF(__pyx_r);
  3182. __Pyx_RefNannyFinishContext();
  3183. return __pyx_r;
  3184. }
  3185. /* "gedlibpy.pyx":236
  3186. *
  3187. *
  3188. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3189. * """
  3190. * Searchs the first and last IDs of the loaded graphs in the environment.
  3191. */
  3192. /* Python wrapper */
  3193. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3194. 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";
  3195. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3196. PyObject *__pyx_r = 0;
  3197. __Pyx_RefNannyDeclarations
  3198. __Pyx_RefNannySetupContext("graph_ids (wrapper)", 0);
  3199. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3200. /* function exit code */
  3201. __Pyx_RefNannyFinishContext();
  3202. return __pyx_r;
  3203. }
  3204. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3205. PyObject *__pyx_r = NULL;
  3206. __Pyx_RefNannyDeclarations
  3207. std::pair<size_t,size_t> __pyx_t_1;
  3208. PyObject *__pyx_t_2 = NULL;
  3209. __Pyx_RefNannySetupContext("graph_ids", 0);
  3210. /* "gedlibpy.pyx":245
  3211. * .. note:: Prefer this function if you have huges structures with lots of graphs.
  3212. * """
  3213. * return self.c_env.getGraphIds() # <<<<<<<<<<<<<<
  3214. *
  3215. *
  3216. */
  3217. __Pyx_XDECREF(__pyx_r);
  3218. try {
  3219. __pyx_t_1 = __pyx_v_self->c_env->getGraphIds();
  3220. } catch(...) {
  3221. __Pyx_CppExn2PyErr();
  3222. __PYX_ERR(0, 245, __pyx_L1_error)
  3223. }
  3224. __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)
  3225. __Pyx_GOTREF(__pyx_t_2);
  3226. __pyx_r = __pyx_t_2;
  3227. __pyx_t_2 = 0;
  3228. goto __pyx_L0;
  3229. /* "gedlibpy.pyx":236
  3230. *
  3231. *
  3232. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3233. * """
  3234. * Searchs the first and last IDs of the loaded graphs in the environment.
  3235. */
  3236. /* function exit code */
  3237. __pyx_L1_error:;
  3238. __Pyx_XDECREF(__pyx_t_2);
  3239. __Pyx_AddTraceback("gedlibpy.GEDEnv.graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3240. __pyx_r = NULL;
  3241. __pyx_L0:;
  3242. __Pyx_XGIVEREF(__pyx_r);
  3243. __Pyx_RefNannyFinishContext();
  3244. return __pyx_r;
  3245. }
  3246. /* "gedlibpy.pyx":248
  3247. *
  3248. *
  3249. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3250. * """
  3251. * Searchs all the IDs of the loaded graphs in the environment.
  3252. */
  3253. /* Python wrapper */
  3254. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3255. 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";
  3256. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3257. PyObject *__pyx_r = 0;
  3258. __Pyx_RefNannyDeclarations
  3259. __Pyx_RefNannySetupContext("get_all_graph_ids (wrapper)", 0);
  3260. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3261. /* function exit code */
  3262. __Pyx_RefNannyFinishContext();
  3263. return __pyx_r;
  3264. }
  3265. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3266. PyObject *__pyx_r = NULL;
  3267. __Pyx_RefNannyDeclarations
  3268. std::vector<size_t> __pyx_t_1;
  3269. PyObject *__pyx_t_2 = NULL;
  3270. __Pyx_RefNannySetupContext("get_all_graph_ids", 0);
  3271. /* "gedlibpy.pyx":257
  3272. * .. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order.
  3273. * """
  3274. * return self.c_env.getAllGraphIds() # <<<<<<<<<<<<<<
  3275. *
  3276. *
  3277. */
  3278. __Pyx_XDECREF(__pyx_r);
  3279. try {
  3280. __pyx_t_1 = __pyx_v_self->c_env->getAllGraphIds();
  3281. } catch(...) {
  3282. __Pyx_CppExn2PyErr();
  3283. __PYX_ERR(0, 257, __pyx_L1_error)
  3284. }
  3285. __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)
  3286. __Pyx_GOTREF(__pyx_t_2);
  3287. __pyx_r = __pyx_t_2;
  3288. __pyx_t_2 = 0;
  3289. goto __pyx_L0;
  3290. /* "gedlibpy.pyx":248
  3291. *
  3292. *
  3293. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3294. * """
  3295. * Searchs all the IDs of the loaded graphs in the environment.
  3296. */
  3297. /* function exit code */
  3298. __pyx_L1_error:;
  3299. __Pyx_XDECREF(__pyx_t_2);
  3300. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3301. __pyx_r = NULL;
  3302. __pyx_L0:;
  3303. __Pyx_XGIVEREF(__pyx_r);
  3304. __Pyx_RefNannyFinishContext();
  3305. return __pyx_r;
  3306. }
  3307. /* "gedlibpy.pyx":260
  3308. *
  3309. *
  3310. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3311. * """
  3312. * Returns the class of a graph with its ID.
  3313. */
  3314. /* Python wrapper */
  3315. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3316. 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";
  3317. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3318. PyObject *__pyx_r = 0;
  3319. __Pyx_RefNannyDeclarations
  3320. __Pyx_RefNannySetupContext("get_graph_class (wrapper)", 0);
  3321. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3322. /* function exit code */
  3323. __Pyx_RefNannyFinishContext();
  3324. return __pyx_r;
  3325. }
  3326. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3327. PyObject *__pyx_r = NULL;
  3328. __Pyx_RefNannyDeclarations
  3329. size_t __pyx_t_1;
  3330. std::string __pyx_t_2;
  3331. PyObject *__pyx_t_3 = NULL;
  3332. __Pyx_RefNannySetupContext("get_graph_class", 0);
  3333. /* "gedlibpy.pyx":272
  3334. * .. note:: An empty string can be a class.
  3335. * """
  3336. * return self.c_env.getGraphClass(id) # <<<<<<<<<<<<<<
  3337. *
  3338. *
  3339. */
  3340. __Pyx_XDECREF(__pyx_r);
  3341. __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)
  3342. try {
  3343. __pyx_t_2 = __pyx_v_self->c_env->getGraphClass(__pyx_t_1);
  3344. } catch(...) {
  3345. __Pyx_CppExn2PyErr();
  3346. __PYX_ERR(0, 272, __pyx_L1_error)
  3347. }
  3348. __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)
  3349. __Pyx_GOTREF(__pyx_t_3);
  3350. __pyx_r = __pyx_t_3;
  3351. __pyx_t_3 = 0;
  3352. goto __pyx_L0;
  3353. /* "gedlibpy.pyx":260
  3354. *
  3355. *
  3356. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3357. * """
  3358. * Returns the class of a graph with its ID.
  3359. */
  3360. /* function exit code */
  3361. __pyx_L1_error:;
  3362. __Pyx_XDECREF(__pyx_t_3);
  3363. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3364. __pyx_r = NULL;
  3365. __pyx_L0:;
  3366. __Pyx_XGIVEREF(__pyx_r);
  3367. __Pyx_RefNannyFinishContext();
  3368. return __pyx_r;
  3369. }
  3370. /* "gedlibpy.pyx":275
  3371. *
  3372. *
  3373. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3374. * """
  3375. * Returns the name of a graph with its ID.
  3376. */
  3377. /* Python wrapper */
  3378. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3379. 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";
  3380. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3381. PyObject *__pyx_r = 0;
  3382. __Pyx_RefNannyDeclarations
  3383. __Pyx_RefNannySetupContext("get_graph_name (wrapper)", 0);
  3384. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3385. /* function exit code */
  3386. __Pyx_RefNannyFinishContext();
  3387. return __pyx_r;
  3388. }
  3389. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3390. PyObject *__pyx_r = NULL;
  3391. __Pyx_RefNannyDeclarations
  3392. size_t __pyx_t_1;
  3393. std::string __pyx_t_2;
  3394. PyObject *__pyx_t_3 = NULL;
  3395. __Pyx_RefNannySetupContext("get_graph_name", 0);
  3396. /* "gedlibpy.pyx":287
  3397. * .. note:: An empty string can be a name.
  3398. * """
  3399. * return self.c_env.getGraphName(id).decode('utf-8') # <<<<<<<<<<<<<<
  3400. *
  3401. *
  3402. */
  3403. __Pyx_XDECREF(__pyx_r);
  3404. __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)
  3405. try {
  3406. __pyx_t_2 = __pyx_v_self->c_env->getGraphName(__pyx_t_1);
  3407. } catch(...) {
  3408. __Pyx_CppExn2PyErr();
  3409. __PYX_ERR(0, 287, __pyx_L1_error)
  3410. }
  3411. __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)
  3412. __Pyx_GOTREF(__pyx_t_3);
  3413. __pyx_r = __pyx_t_3;
  3414. __pyx_t_3 = 0;
  3415. goto __pyx_L0;
  3416. /* "gedlibpy.pyx":275
  3417. *
  3418. *
  3419. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3420. * """
  3421. * Returns the name of a graph with its ID.
  3422. */
  3423. /* function exit code */
  3424. __pyx_L1_error:;
  3425. __Pyx_XDECREF(__pyx_t_3);
  3426. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3427. __pyx_r = NULL;
  3428. __pyx_L0:;
  3429. __Pyx_XGIVEREF(__pyx_r);
  3430. __Pyx_RefNannyFinishContext();
  3431. return __pyx_r;
  3432. }
  3433. /* "gedlibpy.pyx":290
  3434. *
  3435. *
  3436. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3437. * """
  3438. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3439. */
  3440. /* Python wrapper */
  3441. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3442. 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";
  3443. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3444. PyObject *__pyx_v_name = 0;
  3445. PyObject *__pyx_v_classe = 0;
  3446. PyObject *__pyx_r = 0;
  3447. __Pyx_RefNannyDeclarations
  3448. __Pyx_RefNannySetupContext("add_graph (wrapper)", 0);
  3449. {
  3450. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_classe,0};
  3451. PyObject* values[2] = {0,0};
  3452. values[0] = ((PyObject *)__pyx_kp_u_);
  3453. values[1] = ((PyObject *)__pyx_kp_u_);
  3454. if (unlikely(__pyx_kwds)) {
  3455. Py_ssize_t kw_args;
  3456. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3457. switch (pos_args) {
  3458. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3459. CYTHON_FALLTHROUGH;
  3460. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3461. CYTHON_FALLTHROUGH;
  3462. case 0: break;
  3463. default: goto __pyx_L5_argtuple_error;
  3464. }
  3465. kw_args = PyDict_Size(__pyx_kwds);
  3466. switch (pos_args) {
  3467. case 0:
  3468. if (kw_args > 0) {
  3469. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
  3470. if (value) { values[0] = value; kw_args--; }
  3471. }
  3472. CYTHON_FALLTHROUGH;
  3473. case 1:
  3474. if (kw_args > 0) {
  3475. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe);
  3476. if (value) { values[1] = value; kw_args--; }
  3477. }
  3478. }
  3479. if (unlikely(kw_args > 0)) {
  3480. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 290, __pyx_L3_error)
  3481. }
  3482. } else {
  3483. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3484. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3485. CYTHON_FALLTHROUGH;
  3486. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3487. CYTHON_FALLTHROUGH;
  3488. case 0: break;
  3489. default: goto __pyx_L5_argtuple_error;
  3490. }
  3491. }
  3492. __pyx_v_name = values[0];
  3493. __pyx_v_classe = values[1];
  3494. }
  3495. goto __pyx_L4_argument_unpacking_done;
  3496. __pyx_L5_argtuple_error:;
  3497. __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error)
  3498. __pyx_L3_error:;
  3499. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3500. __Pyx_RefNannyFinishContext();
  3501. return NULL;
  3502. __pyx_L4_argument_unpacking_done:;
  3503. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_18add_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_name, __pyx_v_classe);
  3504. /* function exit code */
  3505. __Pyx_RefNannyFinishContext();
  3506. return __pyx_r;
  3507. }
  3508. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe) {
  3509. PyObject *__pyx_r = NULL;
  3510. __Pyx_RefNannyDeclarations
  3511. PyObject *__pyx_t_1 = NULL;
  3512. PyObject *__pyx_t_2 = NULL;
  3513. PyObject *__pyx_t_3 = NULL;
  3514. std::string __pyx_t_4;
  3515. std::string __pyx_t_5;
  3516. size_t __pyx_t_6;
  3517. __Pyx_RefNannySetupContext("add_graph", 0);
  3518. /* "gedlibpy.pyx":304
  3519. * .. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications.
  3520. * """
  3521. * return self.c_env.addGraph(name.encode('utf-8'), classe.encode('utf-8')) # <<<<<<<<<<<<<<
  3522. *
  3523. *
  3524. */
  3525. __Pyx_XDECREF(__pyx_r);
  3526. __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)
  3527. __Pyx_GOTREF(__pyx_t_2);
  3528. __pyx_t_3 = NULL;
  3529. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3530. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3531. if (likely(__pyx_t_3)) {
  3532. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3533. __Pyx_INCREF(__pyx_t_3);
  3534. __Pyx_INCREF(function);
  3535. __Pyx_DECREF_SET(__pyx_t_2, function);
  3536. }
  3537. }
  3538. __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);
  3539. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3540. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3541. __Pyx_GOTREF(__pyx_t_1);
  3542. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3543. __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)
  3544. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3545. __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)
  3546. __Pyx_GOTREF(__pyx_t_2);
  3547. __pyx_t_3 = NULL;
  3548. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3549. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3550. if (likely(__pyx_t_3)) {
  3551. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3552. __Pyx_INCREF(__pyx_t_3);
  3553. __Pyx_INCREF(function);
  3554. __Pyx_DECREF_SET(__pyx_t_2, function);
  3555. }
  3556. }
  3557. __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);
  3558. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3559. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3560. __Pyx_GOTREF(__pyx_t_1);
  3561. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3562. __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)
  3563. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3564. try {
  3565. __pyx_t_6 = __pyx_v_self->c_env->addGraph(__pyx_t_4, __pyx_t_5);
  3566. } catch(...) {
  3567. __Pyx_CppExn2PyErr();
  3568. __PYX_ERR(0, 304, __pyx_L1_error)
  3569. }
  3570. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3571. __Pyx_GOTREF(__pyx_t_1);
  3572. __pyx_r = __pyx_t_1;
  3573. __pyx_t_1 = 0;
  3574. goto __pyx_L0;
  3575. /* "gedlibpy.pyx":290
  3576. *
  3577. *
  3578. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3579. * """
  3580. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3581. */
  3582. /* function exit code */
  3583. __pyx_L1_error:;
  3584. __Pyx_XDECREF(__pyx_t_1);
  3585. __Pyx_XDECREF(__pyx_t_2);
  3586. __Pyx_XDECREF(__pyx_t_3);
  3587. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3588. __pyx_r = NULL;
  3589. __pyx_L0:;
  3590. __Pyx_XGIVEREF(__pyx_r);
  3591. __Pyx_RefNannyFinishContext();
  3592. return __pyx_r;
  3593. }
  3594. /* "gedlibpy.pyx":307
  3595. *
  3596. *
  3597. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3598. * """
  3599. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3600. */
  3601. /* Python wrapper */
  3602. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3603. 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";
  3604. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3605. PyObject *__pyx_v_graph_id = 0;
  3606. PyObject *__pyx_v_node_id = 0;
  3607. PyObject *__pyx_v_node_label = 0;
  3608. PyObject *__pyx_r = 0;
  3609. __Pyx_RefNannyDeclarations
  3610. __Pyx_RefNannySetupContext("add_node (wrapper)", 0);
  3611. {
  3612. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_node_id,&__pyx_n_s_node_label,0};
  3613. PyObject* values[3] = {0,0,0};
  3614. if (unlikely(__pyx_kwds)) {
  3615. Py_ssize_t kw_args;
  3616. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3617. switch (pos_args) {
  3618. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3619. CYTHON_FALLTHROUGH;
  3620. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3621. CYTHON_FALLTHROUGH;
  3622. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3623. CYTHON_FALLTHROUGH;
  3624. case 0: break;
  3625. default: goto __pyx_L5_argtuple_error;
  3626. }
  3627. kw_args = PyDict_Size(__pyx_kwds);
  3628. switch (pos_args) {
  3629. case 0:
  3630. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3631. else goto __pyx_L5_argtuple_error;
  3632. CYTHON_FALLTHROUGH;
  3633. case 1:
  3634. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  3635. else {
  3636. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 307, __pyx_L3_error)
  3637. }
  3638. CYTHON_FALLTHROUGH;
  3639. case 2:
  3640. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label)) != 0)) kw_args--;
  3641. else {
  3642. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 307, __pyx_L3_error)
  3643. }
  3644. }
  3645. if (unlikely(kw_args > 0)) {
  3646. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 307, __pyx_L3_error)
  3647. }
  3648. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  3649. goto __pyx_L5_argtuple_error;
  3650. } else {
  3651. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3652. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3653. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3654. }
  3655. __pyx_v_graph_id = values[0];
  3656. __pyx_v_node_id = values[1];
  3657. __pyx_v_node_label = values[2];
  3658. }
  3659. goto __pyx_L4_argument_unpacking_done;
  3660. __pyx_L5_argtuple_error:;
  3661. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error)
  3662. __pyx_L3_error:;
  3663. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3664. __Pyx_RefNannyFinishContext();
  3665. return NULL;
  3666. __pyx_L4_argument_unpacking_done:;
  3667. __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);
  3668. /* function exit code */
  3669. __Pyx_RefNannyFinishContext();
  3670. return __pyx_r;
  3671. }
  3672. 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) {
  3673. PyObject *__pyx_r = NULL;
  3674. __Pyx_RefNannyDeclarations
  3675. size_t __pyx_t_1;
  3676. PyObject *__pyx_t_2 = NULL;
  3677. PyObject *__pyx_t_3 = NULL;
  3678. PyObject *__pyx_t_4 = NULL;
  3679. std::string __pyx_t_5;
  3680. std::map<std::string,std::string> __pyx_t_6;
  3681. __Pyx_RefNannySetupContext("add_node", 0);
  3682. /* "gedlibpy.pyx":321
  3683. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3684. * """
  3685. * self.c_env.addNode(graph_id, node_id.encode('utf-8'), encode_your_map(node_label)) # <<<<<<<<<<<<<<
  3686. *
  3687. *
  3688. */
  3689. __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)
  3690. __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)
  3691. __Pyx_GOTREF(__pyx_t_3);
  3692. __pyx_t_4 = NULL;
  3693. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3694. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3695. if (likely(__pyx_t_4)) {
  3696. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3697. __Pyx_INCREF(__pyx_t_4);
  3698. __Pyx_INCREF(function);
  3699. __Pyx_DECREF_SET(__pyx_t_3, function);
  3700. }
  3701. }
  3702. __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);
  3703. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3704. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
  3705. __Pyx_GOTREF(__pyx_t_2);
  3706. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3707. __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)
  3708. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3709. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
  3710. __Pyx_GOTREF(__pyx_t_3);
  3711. __pyx_t_4 = NULL;
  3712. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3713. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3714. if (likely(__pyx_t_4)) {
  3715. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3716. __Pyx_INCREF(__pyx_t_4);
  3717. __Pyx_INCREF(function);
  3718. __Pyx_DECREF_SET(__pyx_t_3, function);
  3719. }
  3720. }
  3721. __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);
  3722. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3723. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
  3724. __Pyx_GOTREF(__pyx_t_2);
  3725. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3726. __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)
  3727. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3728. try {
  3729. __pyx_v_self->c_env->addNode(__pyx_t_1, __pyx_t_5, __pyx_t_6);
  3730. } catch(...) {
  3731. __Pyx_CppExn2PyErr();
  3732. __PYX_ERR(0, 321, __pyx_L1_error)
  3733. }
  3734. /* "gedlibpy.pyx":307
  3735. *
  3736. *
  3737. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3738. * """
  3739. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3740. */
  3741. /* function exit code */
  3742. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3743. goto __pyx_L0;
  3744. __pyx_L1_error:;
  3745. __Pyx_XDECREF(__pyx_t_2);
  3746. __Pyx_XDECREF(__pyx_t_3);
  3747. __Pyx_XDECREF(__pyx_t_4);
  3748. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3749. __pyx_r = NULL;
  3750. __pyx_L0:;
  3751. __Pyx_XGIVEREF(__pyx_r);
  3752. __Pyx_RefNannyFinishContext();
  3753. return __pyx_r;
  3754. }
  3755. /* "gedlibpy.pyx":324
  3756. *
  3757. *
  3758. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3759. * """
  3760. * Adds an edge on a graph selected by its ID.
  3761. */
  3762. /* Python wrapper */
  3763. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3764. 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";
  3765. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3766. PyObject *__pyx_v_graph_id = 0;
  3767. PyObject *__pyx_v_tail = 0;
  3768. PyObject *__pyx_v_head = 0;
  3769. PyObject *__pyx_v_edge_label = 0;
  3770. PyObject *__pyx_v_ignore_duplicates = 0;
  3771. PyObject *__pyx_r = 0;
  3772. __Pyx_RefNannyDeclarations
  3773. __Pyx_RefNannySetupContext("add_edge (wrapper)", 0);
  3774. {
  3775. 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};
  3776. PyObject* values[5] = {0,0,0,0,0};
  3777. values[4] = ((PyObject *)Py_True);
  3778. if (unlikely(__pyx_kwds)) {
  3779. Py_ssize_t kw_args;
  3780. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3781. switch (pos_args) {
  3782. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3783. CYTHON_FALLTHROUGH;
  3784. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3785. CYTHON_FALLTHROUGH;
  3786. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3787. CYTHON_FALLTHROUGH;
  3788. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3789. CYTHON_FALLTHROUGH;
  3790. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3791. CYTHON_FALLTHROUGH;
  3792. case 0: break;
  3793. default: goto __pyx_L5_argtuple_error;
  3794. }
  3795. kw_args = PyDict_Size(__pyx_kwds);
  3796. switch (pos_args) {
  3797. case 0:
  3798. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3799. else goto __pyx_L5_argtuple_error;
  3800. CYTHON_FALLTHROUGH;
  3801. case 1:
  3802. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  3803. else {
  3804. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 324, __pyx_L3_error)
  3805. }
  3806. CYTHON_FALLTHROUGH;
  3807. case 2:
  3808. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  3809. else {
  3810. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 324, __pyx_L3_error)
  3811. }
  3812. CYTHON_FALLTHROUGH;
  3813. case 3:
  3814. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  3815. else {
  3816. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 324, __pyx_L3_error)
  3817. }
  3818. CYTHON_FALLTHROUGH;
  3819. case 4:
  3820. if (kw_args > 0) {
  3821. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  3822. if (value) { values[4] = value; kw_args--; }
  3823. }
  3824. }
  3825. if (unlikely(kw_args > 0)) {
  3826. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
  3827. }
  3828. } else {
  3829. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3830. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3831. CYTHON_FALLTHROUGH;
  3832. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3833. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3834. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3835. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3836. break;
  3837. default: goto __pyx_L5_argtuple_error;
  3838. }
  3839. }
  3840. __pyx_v_graph_id = values[0];
  3841. __pyx_v_tail = values[1];
  3842. __pyx_v_head = values[2];
  3843. __pyx_v_edge_label = values[3];
  3844. __pyx_v_ignore_duplicates = values[4];
  3845. }
  3846. goto __pyx_L4_argument_unpacking_done;
  3847. __pyx_L5_argtuple_error:;
  3848. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
  3849. __pyx_L3_error:;
  3850. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3851. __Pyx_RefNannyFinishContext();
  3852. return NULL;
  3853. __pyx_L4_argument_unpacking_done:;
  3854. __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);
  3855. /* function exit code */
  3856. __Pyx_RefNannyFinishContext();
  3857. return __pyx_r;
  3858. }
  3859. 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) {
  3860. PyObject *__pyx_r = NULL;
  3861. __Pyx_RefNannyDeclarations
  3862. size_t __pyx_t_1;
  3863. PyObject *__pyx_t_2 = NULL;
  3864. PyObject *__pyx_t_3 = NULL;
  3865. PyObject *__pyx_t_4 = NULL;
  3866. std::string __pyx_t_5;
  3867. std::string __pyx_t_6;
  3868. std::map<std::string,std::string> __pyx_t_7;
  3869. bool __pyx_t_8;
  3870. __Pyx_RefNannySetupContext("add_edge", 0);
  3871. /* "gedlibpy.pyx":342
  3872. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3873. * """
  3874. * self.c_env.addEdge(graph_id, tail.encode('utf-8'), head.encode('utf-8'), encode_your_map(edge_label), ignore_duplicates) # <<<<<<<<<<<<<<
  3875. *
  3876. *
  3877. */
  3878. __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)
  3879. __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)
  3880. __Pyx_GOTREF(__pyx_t_3);
  3881. __pyx_t_4 = NULL;
  3882. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3883. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3884. if (likely(__pyx_t_4)) {
  3885. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3886. __Pyx_INCREF(__pyx_t_4);
  3887. __Pyx_INCREF(function);
  3888. __Pyx_DECREF_SET(__pyx_t_3, function);
  3889. }
  3890. }
  3891. __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);
  3892. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3893. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3894. __Pyx_GOTREF(__pyx_t_2);
  3895. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3896. __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)
  3897. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3898. __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)
  3899. __Pyx_GOTREF(__pyx_t_3);
  3900. __pyx_t_4 = NULL;
  3901. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3902. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3903. if (likely(__pyx_t_4)) {
  3904. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3905. __Pyx_INCREF(__pyx_t_4);
  3906. __Pyx_INCREF(function);
  3907. __Pyx_DECREF_SET(__pyx_t_3, function);
  3908. }
  3909. }
  3910. __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);
  3911. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3912. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3913. __Pyx_GOTREF(__pyx_t_2);
  3914. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3915. __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)
  3916. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3917. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
  3918. __Pyx_GOTREF(__pyx_t_3);
  3919. __pyx_t_4 = NULL;
  3920. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3921. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3922. if (likely(__pyx_t_4)) {
  3923. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3924. __Pyx_INCREF(__pyx_t_4);
  3925. __Pyx_INCREF(function);
  3926. __Pyx_DECREF_SET(__pyx_t_3, function);
  3927. }
  3928. }
  3929. __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);
  3930. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3931. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3932. __Pyx_GOTREF(__pyx_t_2);
  3933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3934. __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)
  3935. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3936. __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)
  3937. try {
  3938. __pyx_v_self->c_env->addEdge(__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
  3939. } catch(...) {
  3940. __Pyx_CppExn2PyErr();
  3941. __PYX_ERR(0, 342, __pyx_L1_error)
  3942. }
  3943. /* "gedlibpy.pyx":324
  3944. *
  3945. *
  3946. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3947. * """
  3948. * Adds an edge on a graph selected by its ID.
  3949. */
  3950. /* function exit code */
  3951. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3952. goto __pyx_L0;
  3953. __pyx_L1_error:;
  3954. __Pyx_XDECREF(__pyx_t_2);
  3955. __Pyx_XDECREF(__pyx_t_3);
  3956. __Pyx_XDECREF(__pyx_t_4);
  3957. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3958. __pyx_r = NULL;
  3959. __pyx_L0:;
  3960. __Pyx_XGIVEREF(__pyx_r);
  3961. __Pyx_RefNannyFinishContext();
  3962. return __pyx_r;
  3963. }
  3964. /* "gedlibpy.pyx":345
  3965. *
  3966. *
  3967. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  3968. * """
  3969. * Adds a symmetrical edge on a graph selected by its ID.
  3970. */
  3971. /* Python wrapper */
  3972. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3973. 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";
  3974. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3975. PyObject *__pyx_v_graph_id = 0;
  3976. PyObject *__pyx_v_tail = 0;
  3977. PyObject *__pyx_v_head = 0;
  3978. PyObject *__pyx_v_edge_label = 0;
  3979. PyObject *__pyx_r = 0;
  3980. __Pyx_RefNannyDeclarations
  3981. __Pyx_RefNannySetupContext("add_symmetrical_edge (wrapper)", 0);
  3982. {
  3983. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_tail,&__pyx_n_s_head,&__pyx_n_s_edge_label,0};
  3984. PyObject* values[4] = {0,0,0,0};
  3985. if (unlikely(__pyx_kwds)) {
  3986. Py_ssize_t kw_args;
  3987. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3988. switch (pos_args) {
  3989. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3990. CYTHON_FALLTHROUGH;
  3991. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3992. CYTHON_FALLTHROUGH;
  3993. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3994. CYTHON_FALLTHROUGH;
  3995. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3996. CYTHON_FALLTHROUGH;
  3997. case 0: break;
  3998. default: goto __pyx_L5_argtuple_error;
  3999. }
  4000. kw_args = PyDict_Size(__pyx_kwds);
  4001. switch (pos_args) {
  4002. case 0:
  4003. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  4004. else goto __pyx_L5_argtuple_error;
  4005. CYTHON_FALLTHROUGH;
  4006. case 1:
  4007. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  4008. else {
  4009. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 345, __pyx_L3_error)
  4010. }
  4011. CYTHON_FALLTHROUGH;
  4012. case 2:
  4013. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  4014. else {
  4015. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 345, __pyx_L3_error)
  4016. }
  4017. CYTHON_FALLTHROUGH;
  4018. case 3:
  4019. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  4020. else {
  4021. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 345, __pyx_L3_error)
  4022. }
  4023. }
  4024. if (unlikely(kw_args > 0)) {
  4025. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
  4026. }
  4027. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  4028. goto __pyx_L5_argtuple_error;
  4029. } else {
  4030. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4031. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4032. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4033. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4034. }
  4035. __pyx_v_graph_id = values[0];
  4036. __pyx_v_tail = values[1];
  4037. __pyx_v_head = values[2];
  4038. __pyx_v_edge_label = values[3];
  4039. }
  4040. goto __pyx_L4_argument_unpacking_done;
  4041. __pyx_L5_argtuple_error:;
  4042. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
  4043. __pyx_L3_error:;
  4044. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4045. __Pyx_RefNannyFinishContext();
  4046. return NULL;
  4047. __pyx_L4_argument_unpacking_done:;
  4048. __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);
  4049. /* function exit code */
  4050. __Pyx_RefNannyFinishContext();
  4051. return __pyx_r;
  4052. }
  4053. 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) {
  4054. PyObject *__pyx_v_tailB = NULL;
  4055. PyObject *__pyx_v_headB = NULL;
  4056. PyObject *__pyx_v_edgeLabelB = NULL;
  4057. PyObject *__pyx_r = NULL;
  4058. __Pyx_RefNannyDeclarations
  4059. PyObject *__pyx_t_1 = NULL;
  4060. PyObject *__pyx_t_2 = NULL;
  4061. PyObject *__pyx_t_3 = NULL;
  4062. size_t __pyx_t_4;
  4063. std::string __pyx_t_5;
  4064. std::string __pyx_t_6;
  4065. std::map<std::string,std::string> __pyx_t_7;
  4066. __Pyx_RefNannySetupContext("add_symmetrical_edge", 0);
  4067. /* "gedlibpy.pyx":361
  4068. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  4069. * """
  4070. * tailB = tail.encode('utf-8') # <<<<<<<<<<<<<<
  4071. * headB = head.encode('utf-8')
  4072. * edgeLabelB = encode_your_map(edge_label)
  4073. */
  4074. __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)
  4075. __Pyx_GOTREF(__pyx_t_2);
  4076. __pyx_t_3 = NULL;
  4077. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4078. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4079. if (likely(__pyx_t_3)) {
  4080. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4081. __Pyx_INCREF(__pyx_t_3);
  4082. __Pyx_INCREF(function);
  4083. __Pyx_DECREF_SET(__pyx_t_2, function);
  4084. }
  4085. }
  4086. __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);
  4087. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4088. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
  4089. __Pyx_GOTREF(__pyx_t_1);
  4090. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4091. __pyx_v_tailB = __pyx_t_1;
  4092. __pyx_t_1 = 0;
  4093. /* "gedlibpy.pyx":362
  4094. * """
  4095. * tailB = tail.encode('utf-8')
  4096. * headB = head.encode('utf-8') # <<<<<<<<<<<<<<
  4097. * edgeLabelB = encode_your_map(edge_label)
  4098. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4099. */
  4100. __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)
  4101. __Pyx_GOTREF(__pyx_t_2);
  4102. __pyx_t_3 = NULL;
  4103. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4104. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4105. if (likely(__pyx_t_3)) {
  4106. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4107. __Pyx_INCREF(__pyx_t_3);
  4108. __Pyx_INCREF(function);
  4109. __Pyx_DECREF_SET(__pyx_t_2, function);
  4110. }
  4111. }
  4112. __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);
  4113. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4114. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
  4115. __Pyx_GOTREF(__pyx_t_1);
  4116. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4117. __pyx_v_headB = __pyx_t_1;
  4118. __pyx_t_1 = 0;
  4119. /* "gedlibpy.pyx":363
  4120. * tailB = tail.encode('utf-8')
  4121. * headB = head.encode('utf-8')
  4122. * edgeLabelB = encode_your_map(edge_label) # <<<<<<<<<<<<<<
  4123. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4124. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4125. */
  4126. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
  4127. __Pyx_GOTREF(__pyx_t_2);
  4128. __pyx_t_3 = NULL;
  4129. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4130. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4131. if (likely(__pyx_t_3)) {
  4132. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4133. __Pyx_INCREF(__pyx_t_3);
  4134. __Pyx_INCREF(function);
  4135. __Pyx_DECREF_SET(__pyx_t_2, function);
  4136. }
  4137. }
  4138. __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);
  4139. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4140. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
  4141. __Pyx_GOTREF(__pyx_t_1);
  4142. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4143. __pyx_v_edgeLabelB = __pyx_t_1;
  4144. __pyx_t_1 = 0;
  4145. /* "gedlibpy.pyx":364
  4146. * headB = head.encode('utf-8')
  4147. * edgeLabelB = encode_your_map(edge_label)
  4148. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4149. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4150. *
  4151. */
  4152. __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)
  4153. __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)
  4154. __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)
  4155. __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)
  4156. try {
  4157. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, 1);
  4158. } catch(...) {
  4159. __Pyx_CppExn2PyErr();
  4160. __PYX_ERR(0, 364, __pyx_L1_error)
  4161. }
  4162. /* "gedlibpy.pyx":365
  4163. * edgeLabelB = encode_your_map(edge_label)
  4164. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4165. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4166. *
  4167. *
  4168. */
  4169. __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)
  4170. __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)
  4171. __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)
  4172. __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)
  4173. try {
  4174. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_t_7, 1);
  4175. } catch(...) {
  4176. __Pyx_CppExn2PyErr();
  4177. __PYX_ERR(0, 365, __pyx_L1_error)
  4178. }
  4179. /* "gedlibpy.pyx":345
  4180. *
  4181. *
  4182. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  4183. * """
  4184. * Adds a symmetrical edge on a graph selected by its ID.
  4185. */
  4186. /* function exit code */
  4187. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4188. goto __pyx_L0;
  4189. __pyx_L1_error:;
  4190. __Pyx_XDECREF(__pyx_t_1);
  4191. __Pyx_XDECREF(__pyx_t_2);
  4192. __Pyx_XDECREF(__pyx_t_3);
  4193. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4194. __pyx_r = NULL;
  4195. __pyx_L0:;
  4196. __Pyx_XDECREF(__pyx_v_tailB);
  4197. __Pyx_XDECREF(__pyx_v_headB);
  4198. __Pyx_XDECREF(__pyx_v_edgeLabelB);
  4199. __Pyx_XGIVEREF(__pyx_r);
  4200. __Pyx_RefNannyFinishContext();
  4201. return __pyx_r;
  4202. }
  4203. /* "gedlibpy.pyx":368
  4204. *
  4205. *
  4206. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4207. * """
  4208. * Deletes a graph, selected by its ID, to the environment.
  4209. */
  4210. /* Python wrapper */
  4211. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4212. 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";
  4213. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4214. PyObject *__pyx_r = 0;
  4215. __Pyx_RefNannyDeclarations
  4216. __Pyx_RefNannySetupContext("clear_graph (wrapper)", 0);
  4217. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4218. /* function exit code */
  4219. __Pyx_RefNannyFinishContext();
  4220. return __pyx_r;
  4221. }
  4222. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4223. PyObject *__pyx_r = NULL;
  4224. __Pyx_RefNannyDeclarations
  4225. size_t __pyx_t_1;
  4226. __Pyx_RefNannySetupContext("clear_graph", 0);
  4227. /* "gedlibpy.pyx":377
  4228. * .. note:: Call init() after you're finished your modifications.
  4229. * """
  4230. * self.c_env.clearGraph(graph_id) # <<<<<<<<<<<<<<
  4231. *
  4232. *
  4233. */
  4234. __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)
  4235. try {
  4236. __pyx_v_self->c_env->clearGraph(__pyx_t_1);
  4237. } catch(...) {
  4238. __Pyx_CppExn2PyErr();
  4239. __PYX_ERR(0, 377, __pyx_L1_error)
  4240. }
  4241. /* "gedlibpy.pyx":368
  4242. *
  4243. *
  4244. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4245. * """
  4246. * Deletes a graph, selected by its ID, to the environment.
  4247. */
  4248. /* function exit code */
  4249. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4250. goto __pyx_L0;
  4251. __pyx_L1_error:;
  4252. __Pyx_AddTraceback("gedlibpy.GEDEnv.clear_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4253. __pyx_r = NULL;
  4254. __pyx_L0:;
  4255. __Pyx_XGIVEREF(__pyx_r);
  4256. __Pyx_RefNannyFinishContext();
  4257. return __pyx_r;
  4258. }
  4259. /* "gedlibpy.pyx":380
  4260. *
  4261. *
  4262. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4263. * """
  4264. * Searchs and returns the internal Id of a graph, selected by its ID.
  4265. */
  4266. /* Python wrapper */
  4267. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4268. 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";
  4269. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4270. PyObject *__pyx_r = 0;
  4271. __Pyx_RefNannyDeclarations
  4272. __Pyx_RefNannySetupContext("get_graph_internal_id (wrapper)", 0);
  4273. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4274. /* function exit code */
  4275. __Pyx_RefNannyFinishContext();
  4276. return __pyx_r;
  4277. }
  4278. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4279. PyObject *__pyx_r = NULL;
  4280. __Pyx_RefNannyDeclarations
  4281. size_t __pyx_t_1;
  4282. size_t __pyx_t_2;
  4283. PyObject *__pyx_t_3 = NULL;
  4284. __Pyx_RefNannySetupContext("get_graph_internal_id", 0);
  4285. /* "gedlibpy.pyx":392
  4286. * .. note:: These functions allow to collect all the graph's informations.
  4287. * """
  4288. * return self.c_env.getGraphInternalId(graph_id) # <<<<<<<<<<<<<<
  4289. *
  4290. *
  4291. */
  4292. __Pyx_XDECREF(__pyx_r);
  4293. __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)
  4294. try {
  4295. __pyx_t_2 = __pyx_v_self->c_env->getGraphInternalId(__pyx_t_1);
  4296. } catch(...) {
  4297. __Pyx_CppExn2PyErr();
  4298. __PYX_ERR(0, 392, __pyx_L1_error)
  4299. }
  4300. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
  4301. __Pyx_GOTREF(__pyx_t_3);
  4302. __pyx_r = __pyx_t_3;
  4303. __pyx_t_3 = 0;
  4304. goto __pyx_L0;
  4305. /* "gedlibpy.pyx":380
  4306. *
  4307. *
  4308. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4309. * """
  4310. * Searchs and returns the internal Id of a graph, selected by its ID.
  4311. */
  4312. /* function exit code */
  4313. __pyx_L1_error:;
  4314. __Pyx_XDECREF(__pyx_t_3);
  4315. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_internal_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4316. __pyx_r = NULL;
  4317. __pyx_L0:;
  4318. __Pyx_XGIVEREF(__pyx_r);
  4319. __Pyx_RefNannyFinishContext();
  4320. return __pyx_r;
  4321. }
  4322. /* "gedlibpy.pyx":395
  4323. *
  4324. *
  4325. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4326. * """
  4327. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4328. */
  4329. /* Python wrapper */
  4330. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4331. 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";
  4332. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4333. PyObject *__pyx_r = 0;
  4334. __Pyx_RefNannyDeclarations
  4335. __Pyx_RefNannySetupContext("get_graph_num_nodes (wrapper)", 0);
  4336. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4337. /* function exit code */
  4338. __Pyx_RefNannyFinishContext();
  4339. return __pyx_r;
  4340. }
  4341. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4342. PyObject *__pyx_r = NULL;
  4343. __Pyx_RefNannyDeclarations
  4344. size_t __pyx_t_1;
  4345. size_t __pyx_t_2;
  4346. PyObject *__pyx_t_3 = NULL;
  4347. __Pyx_RefNannySetupContext("get_graph_num_nodes", 0);
  4348. /* "gedlibpy.pyx":407
  4349. * .. note:: These functions allow to collect all the graph's informations.
  4350. * """
  4351. * return self.c_env.getGraphNumNodes(graph_id) # <<<<<<<<<<<<<<
  4352. *
  4353. *
  4354. */
  4355. __Pyx_XDECREF(__pyx_r);
  4356. __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)
  4357. try {
  4358. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumNodes(__pyx_t_1);
  4359. } catch(...) {
  4360. __Pyx_CppExn2PyErr();
  4361. __PYX_ERR(0, 407, __pyx_L1_error)
  4362. }
  4363. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
  4364. __Pyx_GOTREF(__pyx_t_3);
  4365. __pyx_r = __pyx_t_3;
  4366. __pyx_t_3 = 0;
  4367. goto __pyx_L0;
  4368. /* "gedlibpy.pyx":395
  4369. *
  4370. *
  4371. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4372. * """
  4373. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4374. */
  4375. /* function exit code */
  4376. __pyx_L1_error:;
  4377. __Pyx_XDECREF(__pyx_t_3);
  4378. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4379. __pyx_r = NULL;
  4380. __pyx_L0:;
  4381. __Pyx_XGIVEREF(__pyx_r);
  4382. __Pyx_RefNannyFinishContext();
  4383. return __pyx_r;
  4384. }
  4385. /* "gedlibpy.pyx":410
  4386. *
  4387. *
  4388. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4389. * """
  4390. * Searchs and returns the number of edges on a graph, selected by its ID.
  4391. */
  4392. /* Python wrapper */
  4393. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4394. 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";
  4395. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4396. PyObject *__pyx_r = 0;
  4397. __Pyx_RefNannyDeclarations
  4398. __Pyx_RefNannySetupContext("get_graph_num_edges (wrapper)", 0);
  4399. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4400. /* function exit code */
  4401. __Pyx_RefNannyFinishContext();
  4402. return __pyx_r;
  4403. }
  4404. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4405. PyObject *__pyx_r = NULL;
  4406. __Pyx_RefNannyDeclarations
  4407. size_t __pyx_t_1;
  4408. size_t __pyx_t_2;
  4409. PyObject *__pyx_t_3 = NULL;
  4410. __Pyx_RefNannySetupContext("get_graph_num_edges", 0);
  4411. /* "gedlibpy.pyx":422
  4412. * .. note:: These functions allow to collect all the graph's informations.
  4413. * """
  4414. * return self.c_env.getGraphNumEdges(graph_id) # <<<<<<<<<<<<<<
  4415. *
  4416. *
  4417. */
  4418. __Pyx_XDECREF(__pyx_r);
  4419. __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)
  4420. try {
  4421. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumEdges(__pyx_t_1);
  4422. } catch(...) {
  4423. __Pyx_CppExn2PyErr();
  4424. __PYX_ERR(0, 422, __pyx_L1_error)
  4425. }
  4426. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
  4427. __Pyx_GOTREF(__pyx_t_3);
  4428. __pyx_r = __pyx_t_3;
  4429. __pyx_t_3 = 0;
  4430. goto __pyx_L0;
  4431. /* "gedlibpy.pyx":410
  4432. *
  4433. *
  4434. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4435. * """
  4436. * Searchs and returns the number of edges on a graph, selected by its ID.
  4437. */
  4438. /* function exit code */
  4439. __pyx_L1_error:;
  4440. __Pyx_XDECREF(__pyx_t_3);
  4441. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4442. __pyx_r = NULL;
  4443. __pyx_L0:;
  4444. __Pyx_XGIVEREF(__pyx_r);
  4445. __Pyx_RefNannyFinishContext();
  4446. return __pyx_r;
  4447. }
  4448. /* "gedlibpy.pyx":425
  4449. *
  4450. *
  4451. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4452. * """
  4453. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4454. */
  4455. /* Python wrapper */
  4456. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4457. 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";
  4458. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4459. PyObject *__pyx_r = 0;
  4460. __Pyx_RefNannyDeclarations
  4461. __Pyx_RefNannySetupContext("get_original_node_ids (wrapper)", 0);
  4462. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4463. /* function exit code */
  4464. __Pyx_RefNannyFinishContext();
  4465. return __pyx_r;
  4466. }
  4467. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4468. std::string __pyx_8genexpr3__pyx_v_gid;
  4469. PyObject *__pyx_r = NULL;
  4470. __Pyx_RefNannyDeclarations
  4471. PyObject *__pyx_t_1 = NULL;
  4472. size_t __pyx_t_2;
  4473. std::vector<std::string> __pyx_t_3;
  4474. std::vector<std::string> ::iterator __pyx_t_4;
  4475. std::vector<std::string> *__pyx_t_5;
  4476. std::string __pyx_t_6;
  4477. PyObject *__pyx_t_7 = NULL;
  4478. __Pyx_RefNannySetupContext("get_original_node_ids", 0);
  4479. /* "gedlibpy.pyx":437
  4480. * .. note:: These functions allow to collect all the graph's informations.
  4481. * """
  4482. * return [gid.decode('utf-8') for gid in self.c_env.getGraphOriginalNodeIds(graph_id)] # <<<<<<<<<<<<<<
  4483. *
  4484. *
  4485. */
  4486. __Pyx_XDECREF(__pyx_r);
  4487. { /* enter inner scope */
  4488. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
  4489. __Pyx_GOTREF(__pyx_t_1);
  4490. __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)
  4491. try {
  4492. __pyx_t_3 = __pyx_v_self->c_env->getGraphOriginalNodeIds(__pyx_t_2);
  4493. } catch(...) {
  4494. __Pyx_CppExn2PyErr();
  4495. __PYX_ERR(0, 437, __pyx_L1_error)
  4496. }
  4497. __pyx_t_5 = &__pyx_t_3;
  4498. __pyx_t_4 = __pyx_t_5->begin();
  4499. for (;;) {
  4500. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4501. __pyx_t_6 = *__pyx_t_4;
  4502. ++__pyx_t_4;
  4503. __pyx_8genexpr3__pyx_v_gid = __pyx_t_6;
  4504. __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)
  4505. __Pyx_GOTREF(__pyx_t_7);
  4506. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 437, __pyx_L1_error)
  4507. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4508. }
  4509. } /* exit inner scope */
  4510. __pyx_r = __pyx_t_1;
  4511. __pyx_t_1 = 0;
  4512. goto __pyx_L0;
  4513. /* "gedlibpy.pyx":425
  4514. *
  4515. *
  4516. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4517. * """
  4518. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4519. */
  4520. /* function exit code */
  4521. __pyx_L1_error:;
  4522. __Pyx_XDECREF(__pyx_t_1);
  4523. __Pyx_XDECREF(__pyx_t_7);
  4524. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_original_node_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4525. __pyx_r = NULL;
  4526. __pyx_L0:;
  4527. __Pyx_XGIVEREF(__pyx_r);
  4528. __Pyx_RefNannyFinishContext();
  4529. return __pyx_r;
  4530. }
  4531. /* "gedlibpy.pyx":440
  4532. *
  4533. *
  4534. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4535. * """
  4536. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4537. */
  4538. /* Python wrapper */
  4539. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4540. 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";
  4541. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4542. PyObject *__pyx_r = 0;
  4543. __Pyx_RefNannyDeclarations
  4544. __Pyx_RefNannySetupContext("get_graph_node_labels (wrapper)", 0);
  4545. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4546. /* function exit code */
  4547. __Pyx_RefNannyFinishContext();
  4548. return __pyx_r;
  4549. }
  4550. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4551. std::map<std::string,std::string> __pyx_8genexpr4__pyx_v_node_label;
  4552. PyObject *__pyx_r = NULL;
  4553. __Pyx_RefNannyDeclarations
  4554. PyObject *__pyx_t_1 = NULL;
  4555. size_t __pyx_t_2;
  4556. std::vector<std::map<std::string,std::string> > __pyx_t_3;
  4557. std::vector<std::map<std::string,std::string> > ::iterator __pyx_t_4;
  4558. std::vector<std::map<std::string,std::string> > *__pyx_t_5;
  4559. std::map<std::string,std::string> __pyx_t_6;
  4560. PyObject *__pyx_t_7 = NULL;
  4561. PyObject *__pyx_t_8 = NULL;
  4562. PyObject *__pyx_t_9 = NULL;
  4563. PyObject *__pyx_t_10 = NULL;
  4564. __Pyx_RefNannySetupContext("get_graph_node_labels", 0);
  4565. /* "gedlibpy.pyx":452
  4566. * .. note:: These functions allow to collect all the graph's informations.
  4567. * """
  4568. * return [decode_your_map(node_label) for node_label in self.c_env.getGraphNodeLabels(graph_id)] # <<<<<<<<<<<<<<
  4569. *
  4570. *
  4571. */
  4572. __Pyx_XDECREF(__pyx_r);
  4573. { /* enter inner scope */
  4574. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  4575. __Pyx_GOTREF(__pyx_t_1);
  4576. __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)
  4577. try {
  4578. __pyx_t_3 = __pyx_v_self->c_env->getGraphNodeLabels(__pyx_t_2);
  4579. } catch(...) {
  4580. __Pyx_CppExn2PyErr();
  4581. __PYX_ERR(0, 452, __pyx_L1_error)
  4582. }
  4583. __pyx_t_5 = &__pyx_t_3;
  4584. __pyx_t_4 = __pyx_t_5->begin();
  4585. for (;;) {
  4586. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4587. __pyx_t_6 = *__pyx_t_4;
  4588. ++__pyx_t_4;
  4589. __pyx_8genexpr4__pyx_v_node_label = __pyx_t_6;
  4590. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 452, __pyx_L1_error)
  4591. __Pyx_GOTREF(__pyx_t_8);
  4592. __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)
  4593. __Pyx_GOTREF(__pyx_t_9);
  4594. __pyx_t_10 = NULL;
  4595. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  4596. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
  4597. if (likely(__pyx_t_10)) {
  4598. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  4599. __Pyx_INCREF(__pyx_t_10);
  4600. __Pyx_INCREF(function);
  4601. __Pyx_DECREF_SET(__pyx_t_8, function);
  4602. }
  4603. }
  4604. __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);
  4605. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  4606. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4607. if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
  4608. __Pyx_GOTREF(__pyx_t_7);
  4609. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4610. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 452, __pyx_L1_error)
  4611. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4612. }
  4613. } /* exit inner scope */
  4614. __pyx_r = __pyx_t_1;
  4615. __pyx_t_1 = 0;
  4616. goto __pyx_L0;
  4617. /* "gedlibpy.pyx":440
  4618. *
  4619. *
  4620. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4621. * """
  4622. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4623. */
  4624. /* function exit code */
  4625. __pyx_L1_error:;
  4626. __Pyx_XDECREF(__pyx_t_1);
  4627. __Pyx_XDECREF(__pyx_t_7);
  4628. __Pyx_XDECREF(__pyx_t_8);
  4629. __Pyx_XDECREF(__pyx_t_9);
  4630. __Pyx_XDECREF(__pyx_t_10);
  4631. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4632. __pyx_r = NULL;
  4633. __pyx_L0:;
  4634. __Pyx_XGIVEREF(__pyx_r);
  4635. __Pyx_RefNannyFinishContext();
  4636. return __pyx_r;
  4637. }
  4638. /* "gedlibpy.pyx":455
  4639. *
  4640. *
  4641. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4642. * """
  4643. * Searchs and returns all the edges on a graph, selected by its ID.
  4644. */
  4645. /* Python wrapper */
  4646. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4647. 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";
  4648. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4649. PyObject *__pyx_r = 0;
  4650. __Pyx_RefNannyDeclarations
  4651. __Pyx_RefNannySetupContext("get_graph_edges (wrapper)", 0);
  4652. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4653. /* function exit code */
  4654. __Pyx_RefNannyFinishContext();
  4655. return __pyx_r;
  4656. }
  4657. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4658. PyObject *__pyx_r = NULL;
  4659. __Pyx_RefNannyDeclarations
  4660. PyObject *__pyx_t_1 = NULL;
  4661. PyObject *__pyx_t_2 = NULL;
  4662. size_t __pyx_t_3;
  4663. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > __pyx_t_4;
  4664. PyObject *__pyx_t_5 = NULL;
  4665. PyObject *__pyx_t_6 = NULL;
  4666. __Pyx_RefNannySetupContext("get_graph_edges", 0);
  4667. /* "gedlibpy.pyx":467
  4668. * .. note:: These functions allow to collect all the graph's informations.
  4669. * """
  4670. * return decode_graph_edges(self.c_env.getGraphEdges(graph_id)) # <<<<<<<<<<<<<<
  4671. *
  4672. *
  4673. */
  4674. __Pyx_XDECREF(__pyx_r);
  4675. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
  4676. __Pyx_GOTREF(__pyx_t_2);
  4677. __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)
  4678. try {
  4679. __pyx_t_4 = __pyx_v_self->c_env->getGraphEdges(__pyx_t_3);
  4680. } catch(...) {
  4681. __Pyx_CppExn2PyErr();
  4682. __PYX_ERR(0, 467, __pyx_L1_error)
  4683. }
  4684. __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)
  4685. __Pyx_GOTREF(__pyx_t_5);
  4686. __pyx_t_6 = NULL;
  4687. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4688. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  4689. if (likely(__pyx_t_6)) {
  4690. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4691. __Pyx_INCREF(__pyx_t_6);
  4692. __Pyx_INCREF(function);
  4693. __Pyx_DECREF_SET(__pyx_t_2, function);
  4694. }
  4695. }
  4696. __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);
  4697. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4698. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4699. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
  4700. __Pyx_GOTREF(__pyx_t_1);
  4701. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4702. __pyx_r = __pyx_t_1;
  4703. __pyx_t_1 = 0;
  4704. goto __pyx_L0;
  4705. /* "gedlibpy.pyx":455
  4706. *
  4707. *
  4708. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4709. * """
  4710. * Searchs and returns all the edges on a graph, selected by its ID.
  4711. */
  4712. /* function exit code */
  4713. __pyx_L1_error:;
  4714. __Pyx_XDECREF(__pyx_t_1);
  4715. __Pyx_XDECREF(__pyx_t_2);
  4716. __Pyx_XDECREF(__pyx_t_5);
  4717. __Pyx_XDECREF(__pyx_t_6);
  4718. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4719. __pyx_r = NULL;
  4720. __pyx_L0:;
  4721. __Pyx_XGIVEREF(__pyx_r);
  4722. __Pyx_RefNannyFinishContext();
  4723. return __pyx_r;
  4724. }
  4725. /* "gedlibpy.pyx":470
  4726. *
  4727. *
  4728. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4729. * """
  4730. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4731. */
  4732. /* Python wrapper */
  4733. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4734. 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";
  4735. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4736. PyObject *__pyx_r = 0;
  4737. __Pyx_RefNannyDeclarations
  4738. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix (wrapper)", 0);
  4739. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4740. /* function exit code */
  4741. __Pyx_RefNannyFinishContext();
  4742. return __pyx_r;
  4743. }
  4744. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4745. PyObject *__pyx_r = NULL;
  4746. __Pyx_RefNannyDeclarations
  4747. size_t __pyx_t_1;
  4748. std::vector<std::vector<size_t> > __pyx_t_2;
  4749. PyObject *__pyx_t_3 = NULL;
  4750. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix", 0);
  4751. /* "gedlibpy.pyx":482
  4752. * .. note:: These functions allow to collect all the graph's informations.
  4753. * """
  4754. * return self.c_env.getGraphAdjacenceMatrix(graph_id) # <<<<<<<<<<<<<<
  4755. *
  4756. *
  4757. */
  4758. __Pyx_XDECREF(__pyx_r);
  4759. __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)
  4760. try {
  4761. __pyx_t_2 = __pyx_v_self->c_env->getGraphAdjacenceMatrix(__pyx_t_1);
  4762. } catch(...) {
  4763. __Pyx_CppExn2PyErr();
  4764. __PYX_ERR(0, 482, __pyx_L1_error)
  4765. }
  4766. __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)
  4767. __Pyx_GOTREF(__pyx_t_3);
  4768. __pyx_r = __pyx_t_3;
  4769. __pyx_t_3 = 0;
  4770. goto __pyx_L0;
  4771. /* "gedlibpy.pyx":470
  4772. *
  4773. *
  4774. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4775. * """
  4776. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4777. */
  4778. /* function exit code */
  4779. __pyx_L1_error:;
  4780. __Pyx_XDECREF(__pyx_t_3);
  4781. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_adjacence_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4782. __pyx_r = NULL;
  4783. __pyx_L0:;
  4784. __Pyx_XGIVEREF(__pyx_r);
  4785. __Pyx_RefNannyFinishContext();
  4786. return __pyx_r;
  4787. }
  4788. /* "gedlibpy.pyx":485
  4789. *
  4790. *
  4791. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4792. * """
  4793. * Sets an edit cost function to the environment, if it exists.
  4794. */
  4795. /* Python wrapper */
  4796. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4797. 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";
  4798. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4799. PyObject *__pyx_v_edit_cost = 0;
  4800. PyObject *__pyx_v_edit_cost_constant = 0;
  4801. PyObject *__pyx_r = 0;
  4802. __Pyx_RefNannyDeclarations
  4803. __Pyx_RefNannySetupContext("set_edit_cost (wrapper)", 0);
  4804. {
  4805. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost,&__pyx_n_s_edit_cost_constant,0};
  4806. PyObject* values[2] = {0,0};
  4807. values[1] = __pyx_k__2;
  4808. if (unlikely(__pyx_kwds)) {
  4809. Py_ssize_t kw_args;
  4810. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4811. switch (pos_args) {
  4812. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4813. CYTHON_FALLTHROUGH;
  4814. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4815. CYTHON_FALLTHROUGH;
  4816. case 0: break;
  4817. default: goto __pyx_L5_argtuple_error;
  4818. }
  4819. kw_args = PyDict_Size(__pyx_kwds);
  4820. switch (pos_args) {
  4821. case 0:
  4822. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  4823. else goto __pyx_L5_argtuple_error;
  4824. CYTHON_FALLTHROUGH;
  4825. case 1:
  4826. if (kw_args > 0) {
  4827. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  4828. if (value) { values[1] = value; kw_args--; }
  4829. }
  4830. }
  4831. if (unlikely(kw_args > 0)) {
  4832. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 485, __pyx_L3_error)
  4833. }
  4834. } else {
  4835. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4836. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4837. CYTHON_FALLTHROUGH;
  4838. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4839. break;
  4840. default: goto __pyx_L5_argtuple_error;
  4841. }
  4842. }
  4843. __pyx_v_edit_cost = values[0];
  4844. __pyx_v_edit_cost_constant = values[1];
  4845. }
  4846. goto __pyx_L4_argument_unpacking_done;
  4847. __pyx_L5_argtuple_error:;
  4848. __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error)
  4849. __pyx_L3_error:;
  4850. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4851. __Pyx_RefNannyFinishContext();
  4852. return NULL;
  4853. __pyx_L4_argument_unpacking_done:;
  4854. __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);
  4855. /* function exit code */
  4856. __Pyx_RefNannyFinishContext();
  4857. return __pyx_r;
  4858. }
  4859. 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) {
  4860. PyObject *__pyx_v_edit_cost_b = NULL;
  4861. PyObject *__pyx_r = NULL;
  4862. __Pyx_RefNannyDeclarations
  4863. PyObject *__pyx_t_1 = NULL;
  4864. int __pyx_t_2;
  4865. int __pyx_t_3;
  4866. PyObject *__pyx_t_4 = NULL;
  4867. PyObject *__pyx_t_5 = NULL;
  4868. std::string __pyx_t_6;
  4869. std::vector<double> __pyx_t_7;
  4870. __Pyx_RefNannySetupContext("set_edit_cost", 0);
  4871. /* "gedlibpy.pyx":497
  4872. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4873. * """
  4874. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4875. * edit_cost_b = edit_cost.encode('utf-8')
  4876. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4877. */
  4878. __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)
  4879. __Pyx_GOTREF(__pyx_t_1);
  4880. __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)
  4881. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4882. __pyx_t_3 = (__pyx_t_2 != 0);
  4883. if (likely(__pyx_t_3)) {
  4884. /* "gedlibpy.pyx":498
  4885. * """
  4886. * if edit_cost in list_of_edit_cost_options:
  4887. * edit_cost_b = edit_cost.encode('utf-8') # <<<<<<<<<<<<<<
  4888. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4889. * else:
  4890. */
  4891. __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)
  4892. __Pyx_GOTREF(__pyx_t_4);
  4893. __pyx_t_5 = NULL;
  4894. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  4895. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4896. if (likely(__pyx_t_5)) {
  4897. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4898. __Pyx_INCREF(__pyx_t_5);
  4899. __Pyx_INCREF(function);
  4900. __Pyx_DECREF_SET(__pyx_t_4, function);
  4901. }
  4902. }
  4903. __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);
  4904. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4905. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
  4906. __Pyx_GOTREF(__pyx_t_1);
  4907. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4908. __pyx_v_edit_cost_b = __pyx_t_1;
  4909. __pyx_t_1 = 0;
  4910. /* "gedlibpy.pyx":499
  4911. * if edit_cost in list_of_edit_cost_options:
  4912. * edit_cost_b = edit_cost.encode('utf-8')
  4913. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) # <<<<<<<<<<<<<<
  4914. * else:
  4915. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function")
  4916. */
  4917. __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)
  4918. __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)
  4919. try {
  4920. __pyx_v_self->c_env->setEditCost(__pyx_t_6, __pyx_t_7);
  4921. } catch(...) {
  4922. __Pyx_CppExn2PyErr();
  4923. __PYX_ERR(0, 499, __pyx_L1_error)
  4924. }
  4925. /* "gedlibpy.pyx":497
  4926. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4927. * """
  4928. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4929. * edit_cost_b = edit_cost.encode('utf-8')
  4930. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4931. */
  4932. goto __pyx_L3;
  4933. }
  4934. /* "gedlibpy.pyx":501
  4935. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4936. * else:
  4937. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") # <<<<<<<<<<<<<<
  4938. *
  4939. *
  4940. */
  4941. /*else*/ {
  4942. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
  4943. __Pyx_GOTREF(__pyx_t_4);
  4944. __pyx_t_5 = NULL;
  4945. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  4946. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4947. if (likely(__pyx_t_5)) {
  4948. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4949. __Pyx_INCREF(__pyx_t_5);
  4950. __Pyx_INCREF(function);
  4951. __Pyx_DECREF_SET(__pyx_t_4, function);
  4952. }
  4953. }
  4954. __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);
  4955. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4956. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
  4957. __Pyx_GOTREF(__pyx_t_1);
  4958. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4959. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  4960. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4961. __PYX_ERR(0, 501, __pyx_L1_error)
  4962. }
  4963. __pyx_L3:;
  4964. /* "gedlibpy.pyx":485
  4965. *
  4966. *
  4967. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4968. * """
  4969. * Sets an edit cost function to the environment, if it exists.
  4970. */
  4971. /* function exit code */
  4972. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4973. goto __pyx_L0;
  4974. __pyx_L1_error:;
  4975. __Pyx_XDECREF(__pyx_t_1);
  4976. __Pyx_XDECREF(__pyx_t_4);
  4977. __Pyx_XDECREF(__pyx_t_5);
  4978. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4979. __pyx_r = NULL;
  4980. __pyx_L0:;
  4981. __Pyx_XDECREF(__pyx_v_edit_cost_b);
  4982. __Pyx_XGIVEREF(__pyx_r);
  4983. __Pyx_RefNannyFinishContext();
  4984. return __pyx_r;
  4985. }
  4986. /* "gedlibpy.pyx":504
  4987. *
  4988. *
  4989. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4990. * """
  4991. * Sets an personal edit cost function to the environment.
  4992. */
  4993. /* Python wrapper */
  4994. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4995. 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";
  4996. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4997. PyObject *__pyx_v_edit_cost_constant = 0;
  4998. PyObject *__pyx_r = 0;
  4999. __Pyx_RefNannyDeclarations
  5000. __Pyx_RefNannySetupContext("set_personal_edit_cost (wrapper)", 0);
  5001. {
  5002. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost_constant,0};
  5003. PyObject* values[1] = {0};
  5004. values[0] = __pyx_k__3;
  5005. if (unlikely(__pyx_kwds)) {
  5006. Py_ssize_t kw_args;
  5007. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5008. switch (pos_args) {
  5009. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5010. CYTHON_FALLTHROUGH;
  5011. case 0: break;
  5012. default: goto __pyx_L5_argtuple_error;
  5013. }
  5014. kw_args = PyDict_Size(__pyx_kwds);
  5015. switch (pos_args) {
  5016. case 0:
  5017. if (kw_args > 0) {
  5018. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  5019. if (value) { values[0] = value; kw_args--; }
  5020. }
  5021. }
  5022. if (unlikely(kw_args > 0)) {
  5023. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 504, __pyx_L3_error)
  5024. }
  5025. } else {
  5026. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5027. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5028. CYTHON_FALLTHROUGH;
  5029. case 0: break;
  5030. default: goto __pyx_L5_argtuple_error;
  5031. }
  5032. }
  5033. __pyx_v_edit_cost_constant = values[0];
  5034. }
  5035. goto __pyx_L4_argument_unpacking_done;
  5036. __pyx_L5_argtuple_error:;
  5037. __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 504, __pyx_L3_error)
  5038. __pyx_L3_error:;
  5039. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5040. __Pyx_RefNannyFinishContext();
  5041. return NULL;
  5042. __pyx_L4_argument_unpacking_done:;
  5043. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edit_cost_constant);
  5044. /* function exit code */
  5045. __Pyx_RefNannyFinishContext();
  5046. return __pyx_r;
  5047. }
  5048. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost_constant) {
  5049. PyObject *__pyx_r = NULL;
  5050. __Pyx_RefNannyDeclarations
  5051. std::vector<double> __pyx_t_1;
  5052. __Pyx_RefNannySetupContext("set_personal_edit_cost", 0);
  5053. /* "gedlibpy.pyx":514
  5054. * .. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function.
  5055. * """
  5056. * self.c_env.setPersonalEditCost(edit_cost_constant) # <<<<<<<<<<<<<<
  5057. *
  5058. *
  5059. */
  5060. __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)
  5061. try {
  5062. __pyx_v_self->c_env->setPersonalEditCost(__pyx_t_1);
  5063. } catch(...) {
  5064. __Pyx_CppExn2PyErr();
  5065. __PYX_ERR(0, 514, __pyx_L1_error)
  5066. }
  5067. /* "gedlibpy.pyx":504
  5068. *
  5069. *
  5070. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5071. * """
  5072. * Sets an personal edit cost function to the environment.
  5073. */
  5074. /* function exit code */
  5075. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5076. goto __pyx_L0;
  5077. __pyx_L1_error:;
  5078. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5079. __pyx_r = NULL;
  5080. __pyx_L0:;
  5081. __Pyx_XGIVEREF(__pyx_r);
  5082. __Pyx_RefNannyFinishContext();
  5083. return __pyx_r;
  5084. }
  5085. /* "gedlibpy.pyx":517
  5086. *
  5087. *
  5088. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5089. * """
  5090. * Initializes the environment with the chosen edit cost function and graphs.
  5091. */
  5092. /* Python wrapper */
  5093. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5094. 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";
  5095. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5096. PyObject *__pyx_v_init_option = 0;
  5097. PyObject *__pyx_v_print_to_stdout = 0;
  5098. PyObject *__pyx_r = 0;
  5099. __Pyx_RefNannyDeclarations
  5100. __Pyx_RefNannySetupContext("init (wrapper)", 0);
  5101. {
  5102. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_init_option,&__pyx_n_s_print_to_stdout,0};
  5103. PyObject* values[2] = {0,0};
  5104. values[0] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  5105. values[1] = ((PyObject *)Py_False);
  5106. if (unlikely(__pyx_kwds)) {
  5107. Py_ssize_t kw_args;
  5108. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5109. switch (pos_args) {
  5110. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5111. CYTHON_FALLTHROUGH;
  5112. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5113. CYTHON_FALLTHROUGH;
  5114. case 0: break;
  5115. default: goto __pyx_L5_argtuple_error;
  5116. }
  5117. kw_args = PyDict_Size(__pyx_kwds);
  5118. switch (pos_args) {
  5119. case 0:
  5120. if (kw_args > 0) {
  5121. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  5122. if (value) { values[0] = value; kw_args--; }
  5123. }
  5124. CYTHON_FALLTHROUGH;
  5125. case 1:
  5126. if (kw_args > 0) {
  5127. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_print_to_stdout);
  5128. if (value) { values[1] = value; kw_args--; }
  5129. }
  5130. }
  5131. if (unlikely(kw_args > 0)) {
  5132. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 517, __pyx_L3_error)
  5133. }
  5134. } else {
  5135. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5136. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5137. CYTHON_FALLTHROUGH;
  5138. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5139. CYTHON_FALLTHROUGH;
  5140. case 0: break;
  5141. default: goto __pyx_L5_argtuple_error;
  5142. }
  5143. }
  5144. __pyx_v_init_option = values[0];
  5145. __pyx_v_print_to_stdout = values[1];
  5146. }
  5147. goto __pyx_L4_argument_unpacking_done;
  5148. __pyx_L5_argtuple_error:;
  5149. __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 517, __pyx_L3_error)
  5150. __pyx_L3_error:;
  5151. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5152. __Pyx_RefNannyFinishContext();
  5153. return NULL;
  5154. __pyx_L4_argument_unpacking_done:;
  5155. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_46init(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_init_option, __pyx_v_print_to_stdout);
  5156. /* function exit code */
  5157. __Pyx_RefNannyFinishContext();
  5158. return __pyx_r;
  5159. }
  5160. 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) {
  5161. PyObject *__pyx_v_init_option_b = NULL;
  5162. PyObject *__pyx_r = NULL;
  5163. __Pyx_RefNannyDeclarations
  5164. PyObject *__pyx_t_1 = NULL;
  5165. int __pyx_t_2;
  5166. int __pyx_t_3;
  5167. PyObject *__pyx_t_4 = NULL;
  5168. PyObject *__pyx_t_5 = NULL;
  5169. std::string __pyx_t_6;
  5170. bool __pyx_t_7;
  5171. __Pyx_RefNannySetupContext("init", 0);
  5172. /* "gedlibpy.pyx":528
  5173. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5174. * """
  5175. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5176. * init_option_b = init_option.encode('utf-8')
  5177. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5178. */
  5179. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  5180. __Pyx_GOTREF(__pyx_t_1);
  5181. __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)
  5182. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5183. __pyx_t_3 = (__pyx_t_2 != 0);
  5184. if (likely(__pyx_t_3)) {
  5185. /* "gedlibpy.pyx":529
  5186. * """
  5187. * if init_option in list_of_init_options:
  5188. * init_option_b = init_option.encode('utf-8') # <<<<<<<<<<<<<<
  5189. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5190. * else:
  5191. */
  5192. __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)
  5193. __Pyx_GOTREF(__pyx_t_4);
  5194. __pyx_t_5 = NULL;
  5195. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5196. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5197. if (likely(__pyx_t_5)) {
  5198. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5199. __Pyx_INCREF(__pyx_t_5);
  5200. __Pyx_INCREF(function);
  5201. __Pyx_DECREF_SET(__pyx_t_4, function);
  5202. }
  5203. }
  5204. __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);
  5205. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5206. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
  5207. __Pyx_GOTREF(__pyx_t_1);
  5208. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5209. __pyx_v_init_option_b = __pyx_t_1;
  5210. __pyx_t_1 = 0;
  5211. /* "gedlibpy.pyx":530
  5212. * if init_option in list_of_init_options:
  5213. * init_option_b = init_option.encode('utf-8')
  5214. * self.c_env.initEnv(init_option_b, print_to_stdout) # <<<<<<<<<<<<<<
  5215. * else:
  5216. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.")
  5217. */
  5218. __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)
  5219. __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)
  5220. try {
  5221. __pyx_v_self->c_env->initEnv(__pyx_t_6, __pyx_t_7);
  5222. } catch(...) {
  5223. __Pyx_CppExn2PyErr();
  5224. __PYX_ERR(0, 530, __pyx_L1_error)
  5225. }
  5226. /* "gedlibpy.pyx":528
  5227. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5228. * """
  5229. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5230. * init_option_b = init_option.encode('utf-8')
  5231. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5232. */
  5233. goto __pyx_L3;
  5234. }
  5235. /* "gedlibpy.pyx":532
  5236. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5237. * else:
  5238. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") # <<<<<<<<<<<<<<
  5239. *
  5240. *
  5241. */
  5242. /*else*/ {
  5243. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
  5244. __Pyx_GOTREF(__pyx_t_4);
  5245. __pyx_t_5 = NULL;
  5246. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5247. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5248. if (likely(__pyx_t_5)) {
  5249. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5250. __Pyx_INCREF(__pyx_t_5);
  5251. __Pyx_INCREF(function);
  5252. __Pyx_DECREF_SET(__pyx_t_4, function);
  5253. }
  5254. }
  5255. __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);
  5256. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5257. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
  5258. __Pyx_GOTREF(__pyx_t_1);
  5259. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5260. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5261. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5262. __PYX_ERR(0, 532, __pyx_L1_error)
  5263. }
  5264. __pyx_L3:;
  5265. /* "gedlibpy.pyx":517
  5266. *
  5267. *
  5268. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5269. * """
  5270. * Initializes the environment with the chosen edit cost function and graphs.
  5271. */
  5272. /* function exit code */
  5273. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5274. goto __pyx_L0;
  5275. __pyx_L1_error:;
  5276. __Pyx_XDECREF(__pyx_t_1);
  5277. __Pyx_XDECREF(__pyx_t_4);
  5278. __Pyx_XDECREF(__pyx_t_5);
  5279. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5280. __pyx_r = NULL;
  5281. __pyx_L0:;
  5282. __Pyx_XDECREF(__pyx_v_init_option_b);
  5283. __Pyx_XGIVEREF(__pyx_r);
  5284. __Pyx_RefNannyFinishContext();
  5285. return __pyx_r;
  5286. }
  5287. /* "gedlibpy.pyx":535
  5288. *
  5289. *
  5290. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5291. * """
  5292. * Sets a computation method to the environment, if its exists.
  5293. */
  5294. /* Python wrapper */
  5295. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5296. 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";
  5297. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5298. PyObject *__pyx_v_method = 0;
  5299. PyObject *__pyx_v_options = 0;
  5300. PyObject *__pyx_r = 0;
  5301. __Pyx_RefNannyDeclarations
  5302. __Pyx_RefNannySetupContext("set_method (wrapper)", 0);
  5303. {
  5304. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_options,0};
  5305. PyObject* values[2] = {0,0};
  5306. values[1] = ((PyObject *)__pyx_kp_u_);
  5307. if (unlikely(__pyx_kwds)) {
  5308. Py_ssize_t kw_args;
  5309. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5310. switch (pos_args) {
  5311. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5312. CYTHON_FALLTHROUGH;
  5313. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5314. CYTHON_FALLTHROUGH;
  5315. case 0: break;
  5316. default: goto __pyx_L5_argtuple_error;
  5317. }
  5318. kw_args = PyDict_Size(__pyx_kwds);
  5319. switch (pos_args) {
  5320. case 0:
  5321. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  5322. else goto __pyx_L5_argtuple_error;
  5323. CYTHON_FALLTHROUGH;
  5324. case 1:
  5325. if (kw_args > 0) {
  5326. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  5327. if (value) { values[1] = value; kw_args--; }
  5328. }
  5329. }
  5330. if (unlikely(kw_args > 0)) {
  5331. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 535, __pyx_L3_error)
  5332. }
  5333. } else {
  5334. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5335. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5336. CYTHON_FALLTHROUGH;
  5337. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5338. break;
  5339. default: goto __pyx_L5_argtuple_error;
  5340. }
  5341. }
  5342. __pyx_v_method = values[0];
  5343. __pyx_v_options = values[1];
  5344. }
  5345. goto __pyx_L4_argument_unpacking_done;
  5346. __pyx_L5_argtuple_error:;
  5347. __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error)
  5348. __pyx_L3_error:;
  5349. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5350. __Pyx_RefNannyFinishContext();
  5351. return NULL;
  5352. __pyx_L4_argument_unpacking_done:;
  5353. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_48set_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_method, __pyx_v_options);
  5354. /* function exit code */
  5355. __Pyx_RefNannyFinishContext();
  5356. return __pyx_r;
  5357. }
  5358. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_options) {
  5359. PyObject *__pyx_v_method_b = NULL;
  5360. PyObject *__pyx_r = NULL;
  5361. __Pyx_RefNannyDeclarations
  5362. PyObject *__pyx_t_1 = NULL;
  5363. int __pyx_t_2;
  5364. int __pyx_t_3;
  5365. PyObject *__pyx_t_4 = NULL;
  5366. PyObject *__pyx_t_5 = NULL;
  5367. std::string __pyx_t_6;
  5368. std::string __pyx_t_7;
  5369. __Pyx_RefNannySetupContext("set_method", 0);
  5370. /* "gedlibpy.pyx":547
  5371. * .. 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.
  5372. * """
  5373. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5374. * method_b = method.encode('utf-8')
  5375. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5376. */
  5377. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  5378. __Pyx_GOTREF(__pyx_t_1);
  5379. __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)
  5380. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5381. __pyx_t_3 = (__pyx_t_2 != 0);
  5382. if (likely(__pyx_t_3)) {
  5383. /* "gedlibpy.pyx":548
  5384. * """
  5385. * if method in list_of_method_options:
  5386. * method_b = method.encode('utf-8') # <<<<<<<<<<<<<<
  5387. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5388. * else:
  5389. */
  5390. __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)
  5391. __Pyx_GOTREF(__pyx_t_4);
  5392. __pyx_t_5 = NULL;
  5393. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5394. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5395. if (likely(__pyx_t_5)) {
  5396. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5397. __Pyx_INCREF(__pyx_t_5);
  5398. __Pyx_INCREF(function);
  5399. __Pyx_DECREF_SET(__pyx_t_4, function);
  5400. }
  5401. }
  5402. __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);
  5403. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5404. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
  5405. __Pyx_GOTREF(__pyx_t_1);
  5406. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5407. __pyx_v_method_b = __pyx_t_1;
  5408. __pyx_t_1 = 0;
  5409. /* "gedlibpy.pyx":549
  5410. * if method in list_of_method_options:
  5411. * method_b = method.encode('utf-8')
  5412. * self.c_env.setMethod(method_b, options.encode('utf-8')) # <<<<<<<<<<<<<<
  5413. * else:
  5414. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method")
  5415. */
  5416. __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)
  5417. __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)
  5418. __Pyx_GOTREF(__pyx_t_4);
  5419. __pyx_t_5 = NULL;
  5420. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5421. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5422. if (likely(__pyx_t_5)) {
  5423. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5424. __Pyx_INCREF(__pyx_t_5);
  5425. __Pyx_INCREF(function);
  5426. __Pyx_DECREF_SET(__pyx_t_4, function);
  5427. }
  5428. }
  5429. __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);
  5430. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5431. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
  5432. __Pyx_GOTREF(__pyx_t_1);
  5433. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5434. __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)
  5435. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5436. try {
  5437. __pyx_v_self->c_env->setMethod(__pyx_t_6, __pyx_t_7);
  5438. } catch(...) {
  5439. __Pyx_CppExn2PyErr();
  5440. __PYX_ERR(0, 549, __pyx_L1_error)
  5441. }
  5442. /* "gedlibpy.pyx":547
  5443. * .. 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.
  5444. * """
  5445. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5446. * method_b = method.encode('utf-8')
  5447. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5448. */
  5449. goto __pyx_L3;
  5450. }
  5451. /* "gedlibpy.pyx":551
  5452. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5453. * else:
  5454. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") # <<<<<<<<<<<<<<
  5455. *
  5456. *
  5457. */
  5458. /*else*/ {
  5459. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
  5460. __Pyx_GOTREF(__pyx_t_4);
  5461. __pyx_t_5 = NULL;
  5462. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5463. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5464. if (likely(__pyx_t_5)) {
  5465. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5466. __Pyx_INCREF(__pyx_t_5);
  5467. __Pyx_INCREF(function);
  5468. __Pyx_DECREF_SET(__pyx_t_4, function);
  5469. }
  5470. }
  5471. __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);
  5472. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5473. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
  5474. __Pyx_GOTREF(__pyx_t_1);
  5475. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5476. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5477. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5478. __PYX_ERR(0, 551, __pyx_L1_error)
  5479. }
  5480. __pyx_L3:;
  5481. /* "gedlibpy.pyx":535
  5482. *
  5483. *
  5484. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5485. * """
  5486. * Sets a computation method to the environment, if its exists.
  5487. */
  5488. /* function exit code */
  5489. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5490. goto __pyx_L0;
  5491. __pyx_L1_error:;
  5492. __Pyx_XDECREF(__pyx_t_1);
  5493. __Pyx_XDECREF(__pyx_t_4);
  5494. __Pyx_XDECREF(__pyx_t_5);
  5495. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5496. __pyx_r = NULL;
  5497. __pyx_L0:;
  5498. __Pyx_XDECREF(__pyx_v_method_b);
  5499. __Pyx_XGIVEREF(__pyx_r);
  5500. __Pyx_RefNannyFinishContext();
  5501. return __pyx_r;
  5502. }
  5503. /* "gedlibpy.pyx":554
  5504. *
  5505. *
  5506. * def init_method(self) : # <<<<<<<<<<<<<<
  5507. * """
  5508. * Inits the environment with the set method.
  5509. */
  5510. /* Python wrapper */
  5511. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5512. 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";
  5513. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5514. PyObject *__pyx_r = 0;
  5515. __Pyx_RefNannyDeclarations
  5516. __Pyx_RefNannySetupContext("init_method (wrapper)", 0);
  5517. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_50init_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5518. /* function exit code */
  5519. __Pyx_RefNannyFinishContext();
  5520. return __pyx_r;
  5521. }
  5522. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5523. PyObject *__pyx_r = NULL;
  5524. __Pyx_RefNannyDeclarations
  5525. __Pyx_RefNannySetupContext("init_method", 0);
  5526. /* "gedlibpy.pyx":561
  5527. * .. note:: Call this function after set the method. You can't launch computation or change the method after that.
  5528. * """
  5529. * self.c_env.initMethod() # <<<<<<<<<<<<<<
  5530. *
  5531. *
  5532. */
  5533. try {
  5534. __pyx_v_self->c_env->initMethod();
  5535. } catch(...) {
  5536. __Pyx_CppExn2PyErr();
  5537. __PYX_ERR(0, 561, __pyx_L1_error)
  5538. }
  5539. /* "gedlibpy.pyx":554
  5540. *
  5541. *
  5542. * def init_method(self) : # <<<<<<<<<<<<<<
  5543. * """
  5544. * Inits the environment with the set method.
  5545. */
  5546. /* function exit code */
  5547. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5548. goto __pyx_L0;
  5549. __pyx_L1_error:;
  5550. __Pyx_AddTraceback("gedlibpy.GEDEnv.init_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5551. __pyx_r = NULL;
  5552. __pyx_L0:;
  5553. __Pyx_XGIVEREF(__pyx_r);
  5554. __Pyx_RefNannyFinishContext();
  5555. return __pyx_r;
  5556. }
  5557. /* "gedlibpy.pyx":564
  5558. *
  5559. *
  5560. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5561. * """
  5562. * Returns the initialization time.
  5563. */
  5564. /* Python wrapper */
  5565. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5566. 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";
  5567. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5568. PyObject *__pyx_r = 0;
  5569. __Pyx_RefNannyDeclarations
  5570. __Pyx_RefNannySetupContext("get_init_time (wrapper)", 0);
  5571. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5572. /* function exit code */
  5573. __Pyx_RefNannyFinishContext();
  5574. return __pyx_r;
  5575. }
  5576. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5577. PyObject *__pyx_r = NULL;
  5578. __Pyx_RefNannyDeclarations
  5579. double __pyx_t_1;
  5580. PyObject *__pyx_t_2 = NULL;
  5581. __Pyx_RefNannySetupContext("get_init_time", 0);
  5582. /* "gedlibpy.pyx":571
  5583. * :rtype: double
  5584. * """
  5585. * return self.c_env.getInitime() # <<<<<<<<<<<<<<
  5586. *
  5587. *
  5588. */
  5589. __Pyx_XDECREF(__pyx_r);
  5590. try {
  5591. __pyx_t_1 = __pyx_v_self->c_env->getInitime();
  5592. } catch(...) {
  5593. __Pyx_CppExn2PyErr();
  5594. __PYX_ERR(0, 571, __pyx_L1_error)
  5595. }
  5596. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  5597. __Pyx_GOTREF(__pyx_t_2);
  5598. __pyx_r = __pyx_t_2;
  5599. __pyx_t_2 = 0;
  5600. goto __pyx_L0;
  5601. /* "gedlibpy.pyx":564
  5602. *
  5603. *
  5604. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5605. * """
  5606. * Returns the initialization time.
  5607. */
  5608. /* function exit code */
  5609. __pyx_L1_error:;
  5610. __Pyx_XDECREF(__pyx_t_2);
  5611. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5612. __pyx_r = NULL;
  5613. __pyx_L0:;
  5614. __Pyx_XGIVEREF(__pyx_r);
  5615. __Pyx_RefNannyFinishContext();
  5616. return __pyx_r;
  5617. }
  5618. /* "gedlibpy.pyx":574
  5619. *
  5620. *
  5621. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5622. * """
  5623. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5624. */
  5625. /* Python wrapper */
  5626. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5627. 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";
  5628. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5629. PyObject *__pyx_v_g = 0;
  5630. PyObject *__pyx_v_h = 0;
  5631. PyObject *__pyx_r = 0;
  5632. __Pyx_RefNannyDeclarations
  5633. __Pyx_RefNannySetupContext("run_method (wrapper)", 0);
  5634. {
  5635. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5636. PyObject* values[2] = {0,0};
  5637. if (unlikely(__pyx_kwds)) {
  5638. Py_ssize_t kw_args;
  5639. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5640. switch (pos_args) {
  5641. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5642. CYTHON_FALLTHROUGH;
  5643. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5644. CYTHON_FALLTHROUGH;
  5645. case 0: break;
  5646. default: goto __pyx_L5_argtuple_error;
  5647. }
  5648. kw_args = PyDict_Size(__pyx_kwds);
  5649. switch (pos_args) {
  5650. case 0:
  5651. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5652. else goto __pyx_L5_argtuple_error;
  5653. CYTHON_FALLTHROUGH;
  5654. case 1:
  5655. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5656. else {
  5657. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 574, __pyx_L3_error)
  5658. }
  5659. }
  5660. if (unlikely(kw_args > 0)) {
  5661. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
  5662. }
  5663. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5664. goto __pyx_L5_argtuple_error;
  5665. } else {
  5666. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5667. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5668. }
  5669. __pyx_v_g = values[0];
  5670. __pyx_v_h = values[1];
  5671. }
  5672. goto __pyx_L4_argument_unpacking_done;
  5673. __pyx_L5_argtuple_error:;
  5674. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
  5675. __pyx_L3_error:;
  5676. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5677. __Pyx_RefNannyFinishContext();
  5678. return NULL;
  5679. __pyx_L4_argument_unpacking_done:;
  5680. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_54run_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5681. /* function exit code */
  5682. __Pyx_RefNannyFinishContext();
  5683. return __pyx_r;
  5684. }
  5685. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5686. PyObject *__pyx_r = NULL;
  5687. __Pyx_RefNannyDeclarations
  5688. size_t __pyx_t_1;
  5689. size_t __pyx_t_2;
  5690. __Pyx_RefNannySetupContext("run_method", 0);
  5691. /* "gedlibpy.pyx":586
  5692. * .. 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.
  5693. * """
  5694. * self.c_env.runMethod(g, h) # <<<<<<<<<<<<<<
  5695. *
  5696. *
  5697. */
  5698. __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)
  5699. __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)
  5700. try {
  5701. __pyx_v_self->c_env->runMethod(__pyx_t_1, __pyx_t_2);
  5702. } catch(...) {
  5703. __Pyx_CppExn2PyErr();
  5704. __PYX_ERR(0, 586, __pyx_L1_error)
  5705. }
  5706. /* "gedlibpy.pyx":574
  5707. *
  5708. *
  5709. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5710. * """
  5711. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5712. */
  5713. /* function exit code */
  5714. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5715. goto __pyx_L0;
  5716. __pyx_L1_error:;
  5717. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5718. __pyx_r = NULL;
  5719. __pyx_L0:;
  5720. __Pyx_XGIVEREF(__pyx_r);
  5721. __Pyx_RefNannyFinishContext();
  5722. return __pyx_r;
  5723. }
  5724. /* "gedlibpy.pyx":589
  5725. *
  5726. *
  5727. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5728. * """
  5729. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5730. */
  5731. /* Python wrapper */
  5732. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5733. 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";
  5734. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5735. PyObject *__pyx_v_g = 0;
  5736. PyObject *__pyx_v_h = 0;
  5737. PyObject *__pyx_r = 0;
  5738. __Pyx_RefNannyDeclarations
  5739. __Pyx_RefNannySetupContext("get_upper_bound (wrapper)", 0);
  5740. {
  5741. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5742. PyObject* values[2] = {0,0};
  5743. if (unlikely(__pyx_kwds)) {
  5744. Py_ssize_t kw_args;
  5745. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5746. switch (pos_args) {
  5747. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5748. CYTHON_FALLTHROUGH;
  5749. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5750. CYTHON_FALLTHROUGH;
  5751. case 0: break;
  5752. default: goto __pyx_L5_argtuple_error;
  5753. }
  5754. kw_args = PyDict_Size(__pyx_kwds);
  5755. switch (pos_args) {
  5756. case 0:
  5757. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5758. else goto __pyx_L5_argtuple_error;
  5759. CYTHON_FALLTHROUGH;
  5760. case 1:
  5761. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5762. else {
  5763. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 589, __pyx_L3_error)
  5764. }
  5765. }
  5766. if (unlikely(kw_args > 0)) {
  5767. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 589, __pyx_L3_error)
  5768. }
  5769. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5770. goto __pyx_L5_argtuple_error;
  5771. } else {
  5772. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5773. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5774. }
  5775. __pyx_v_g = values[0];
  5776. __pyx_v_h = values[1];
  5777. }
  5778. goto __pyx_L4_argument_unpacking_done;
  5779. __pyx_L5_argtuple_error:;
  5780. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 589, __pyx_L3_error)
  5781. __pyx_L3_error:;
  5782. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5783. __Pyx_RefNannyFinishContext();
  5784. return NULL;
  5785. __pyx_L4_argument_unpacking_done:;
  5786. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5787. /* function exit code */
  5788. __Pyx_RefNannyFinishContext();
  5789. return __pyx_r;
  5790. }
  5791. 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) {
  5792. PyObject *__pyx_r = NULL;
  5793. __Pyx_RefNannyDeclarations
  5794. size_t __pyx_t_1;
  5795. size_t __pyx_t_2;
  5796. double __pyx_t_3;
  5797. PyObject *__pyx_t_4 = NULL;
  5798. __Pyx_RefNannySetupContext("get_upper_bound", 0);
  5799. /* "gedlibpy.pyx":604
  5800. * .. 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.
  5801. * """
  5802. * return self.c_env.getUpperBound(g, h) # <<<<<<<<<<<<<<
  5803. *
  5804. *
  5805. */
  5806. __Pyx_XDECREF(__pyx_r);
  5807. __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)
  5808. __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)
  5809. try {
  5810. __pyx_t_3 = __pyx_v_self->c_env->getUpperBound(__pyx_t_1, __pyx_t_2);
  5811. } catch(...) {
  5812. __Pyx_CppExn2PyErr();
  5813. __PYX_ERR(0, 604, __pyx_L1_error)
  5814. }
  5815. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
  5816. __Pyx_GOTREF(__pyx_t_4);
  5817. __pyx_r = __pyx_t_4;
  5818. __pyx_t_4 = 0;
  5819. goto __pyx_L0;
  5820. /* "gedlibpy.pyx":589
  5821. *
  5822. *
  5823. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5824. * """
  5825. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5826. */
  5827. /* function exit code */
  5828. __pyx_L1_error:;
  5829. __Pyx_XDECREF(__pyx_t_4);
  5830. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5831. __pyx_r = NULL;
  5832. __pyx_L0:;
  5833. __Pyx_XGIVEREF(__pyx_r);
  5834. __Pyx_RefNannyFinishContext();
  5835. return __pyx_r;
  5836. }
  5837. /* "gedlibpy.pyx":607
  5838. *
  5839. *
  5840. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5841. * """
  5842. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5843. */
  5844. /* Python wrapper */
  5845. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5846. 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";
  5847. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5848. PyObject *__pyx_v_g = 0;
  5849. PyObject *__pyx_v_h = 0;
  5850. PyObject *__pyx_r = 0;
  5851. __Pyx_RefNannyDeclarations
  5852. __Pyx_RefNannySetupContext("get_lower_bound (wrapper)", 0);
  5853. {
  5854. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5855. PyObject* values[2] = {0,0};
  5856. if (unlikely(__pyx_kwds)) {
  5857. Py_ssize_t kw_args;
  5858. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5859. switch (pos_args) {
  5860. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5861. CYTHON_FALLTHROUGH;
  5862. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5863. CYTHON_FALLTHROUGH;
  5864. case 0: break;
  5865. default: goto __pyx_L5_argtuple_error;
  5866. }
  5867. kw_args = PyDict_Size(__pyx_kwds);
  5868. switch (pos_args) {
  5869. case 0:
  5870. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5871. else goto __pyx_L5_argtuple_error;
  5872. CYTHON_FALLTHROUGH;
  5873. case 1:
  5874. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5875. else {
  5876. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 607, __pyx_L3_error)
  5877. }
  5878. }
  5879. if (unlikely(kw_args > 0)) {
  5880. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 607, __pyx_L3_error)
  5881. }
  5882. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5883. goto __pyx_L5_argtuple_error;
  5884. } else {
  5885. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5886. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5887. }
  5888. __pyx_v_g = values[0];
  5889. __pyx_v_h = values[1];
  5890. }
  5891. goto __pyx_L4_argument_unpacking_done;
  5892. __pyx_L5_argtuple_error:;
  5893. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 607, __pyx_L3_error)
  5894. __pyx_L3_error:;
  5895. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5896. __Pyx_RefNannyFinishContext();
  5897. return NULL;
  5898. __pyx_L4_argument_unpacking_done:;
  5899. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5900. /* function exit code */
  5901. __Pyx_RefNannyFinishContext();
  5902. return __pyx_r;
  5903. }
  5904. 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) {
  5905. PyObject *__pyx_r = NULL;
  5906. __Pyx_RefNannyDeclarations
  5907. size_t __pyx_t_1;
  5908. size_t __pyx_t_2;
  5909. double __pyx_t_3;
  5910. PyObject *__pyx_t_4 = NULL;
  5911. __Pyx_RefNannySetupContext("get_lower_bound", 0);
  5912. /* "gedlibpy.pyx":622
  5913. * .. note:: This function can be ignored, because lower bound doesn't have a crucial utility.
  5914. * """
  5915. * return self.c_env.getLowerBound(g, h) # <<<<<<<<<<<<<<
  5916. *
  5917. *
  5918. */
  5919. __Pyx_XDECREF(__pyx_r);
  5920. __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)
  5921. __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)
  5922. try {
  5923. __pyx_t_3 = __pyx_v_self->c_env->getLowerBound(__pyx_t_1, __pyx_t_2);
  5924. } catch(...) {
  5925. __Pyx_CppExn2PyErr();
  5926. __PYX_ERR(0, 622, __pyx_L1_error)
  5927. }
  5928. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
  5929. __Pyx_GOTREF(__pyx_t_4);
  5930. __pyx_r = __pyx_t_4;
  5931. __pyx_t_4 = 0;
  5932. goto __pyx_L0;
  5933. /* "gedlibpy.pyx":607
  5934. *
  5935. *
  5936. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5937. * """
  5938. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5939. */
  5940. /* function exit code */
  5941. __pyx_L1_error:;
  5942. __Pyx_XDECREF(__pyx_t_4);
  5943. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5944. __pyx_r = NULL;
  5945. __pyx_L0:;
  5946. __Pyx_XGIVEREF(__pyx_r);
  5947. __Pyx_RefNannyFinishContext();
  5948. return __pyx_r;
  5949. }
  5950. /* "gedlibpy.pyx":625
  5951. *
  5952. *
  5953. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  5954. * """
  5955. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  5956. */
  5957. /* Python wrapper */
  5958. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5959. 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";
  5960. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5961. PyObject *__pyx_v_g = 0;
  5962. PyObject *__pyx_v_h = 0;
  5963. PyObject *__pyx_r = 0;
  5964. __Pyx_RefNannyDeclarations
  5965. __Pyx_RefNannySetupContext("get_forward_map (wrapper)", 0);
  5966. {
  5967. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5968. PyObject* values[2] = {0,0};
  5969. if (unlikely(__pyx_kwds)) {
  5970. Py_ssize_t kw_args;
  5971. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5972. switch (pos_args) {
  5973. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5974. CYTHON_FALLTHROUGH;
  5975. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5976. CYTHON_FALLTHROUGH;
  5977. case 0: break;
  5978. default: goto __pyx_L5_argtuple_error;
  5979. }
  5980. kw_args = PyDict_Size(__pyx_kwds);
  5981. switch (pos_args) {
  5982. case 0:
  5983. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5984. else goto __pyx_L5_argtuple_error;
  5985. CYTHON_FALLTHROUGH;
  5986. case 1:
  5987. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5988. else {
  5989. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 625, __pyx_L3_error)
  5990. }
  5991. }
  5992. if (unlikely(kw_args > 0)) {
  5993. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 625, __pyx_L3_error)
  5994. }
  5995. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5996. goto __pyx_L5_argtuple_error;
  5997. } else {
  5998. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5999. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6000. }
  6001. __pyx_v_g = values[0];
  6002. __pyx_v_h = values[1];
  6003. }
  6004. goto __pyx_L4_argument_unpacking_done;
  6005. __pyx_L5_argtuple_error:;
  6006. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 625, __pyx_L3_error)
  6007. __pyx_L3_error:;
  6008. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6009. __Pyx_RefNannyFinishContext();
  6010. return NULL;
  6011. __pyx_L4_argument_unpacking_done:;
  6012. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6013. /* function exit code */
  6014. __Pyx_RefNannyFinishContext();
  6015. return __pyx_r;
  6016. }
  6017. 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) {
  6018. PyObject *__pyx_r = NULL;
  6019. __Pyx_RefNannyDeclarations
  6020. size_t __pyx_t_1;
  6021. size_t __pyx_t_2;
  6022. std::vector<npy_uint64> __pyx_t_3;
  6023. PyObject *__pyx_t_4 = NULL;
  6024. __Pyx_RefNannySetupContext("get_forward_map", 0);
  6025. /* "gedlibpy.pyx":640
  6026. * .. 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 !
  6027. * """
  6028. * return self.c_env.getForwardMap(g, h) # <<<<<<<<<<<<<<
  6029. *
  6030. *
  6031. */
  6032. __Pyx_XDECREF(__pyx_r);
  6033. __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)
  6034. __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)
  6035. try {
  6036. __pyx_t_3 = __pyx_v_self->c_env->getForwardMap(__pyx_t_1, __pyx_t_2);
  6037. } catch(...) {
  6038. __Pyx_CppExn2PyErr();
  6039. __PYX_ERR(0, 640, __pyx_L1_error)
  6040. }
  6041. __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)
  6042. __Pyx_GOTREF(__pyx_t_4);
  6043. __pyx_r = __pyx_t_4;
  6044. __pyx_t_4 = 0;
  6045. goto __pyx_L0;
  6046. /* "gedlibpy.pyx":625
  6047. *
  6048. *
  6049. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  6050. * """
  6051. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6052. */
  6053. /* function exit code */
  6054. __pyx_L1_error:;
  6055. __Pyx_XDECREF(__pyx_t_4);
  6056. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6057. __pyx_r = NULL;
  6058. __pyx_L0:;
  6059. __Pyx_XGIVEREF(__pyx_r);
  6060. __Pyx_RefNannyFinishContext();
  6061. return __pyx_r;
  6062. }
  6063. /* "gedlibpy.pyx":643
  6064. *
  6065. *
  6066. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6067. * """
  6068. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6069. */
  6070. /* Python wrapper */
  6071. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6072. 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";
  6073. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6074. PyObject *__pyx_v_g = 0;
  6075. PyObject *__pyx_v_h = 0;
  6076. PyObject *__pyx_r = 0;
  6077. __Pyx_RefNannyDeclarations
  6078. __Pyx_RefNannySetupContext("get_backward_map (wrapper)", 0);
  6079. {
  6080. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6081. PyObject* values[2] = {0,0};
  6082. if (unlikely(__pyx_kwds)) {
  6083. Py_ssize_t kw_args;
  6084. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6085. switch (pos_args) {
  6086. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6087. CYTHON_FALLTHROUGH;
  6088. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6089. CYTHON_FALLTHROUGH;
  6090. case 0: break;
  6091. default: goto __pyx_L5_argtuple_error;
  6092. }
  6093. kw_args = PyDict_Size(__pyx_kwds);
  6094. switch (pos_args) {
  6095. case 0:
  6096. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6097. else goto __pyx_L5_argtuple_error;
  6098. CYTHON_FALLTHROUGH;
  6099. case 1:
  6100. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6101. else {
  6102. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 643, __pyx_L3_error)
  6103. }
  6104. }
  6105. if (unlikely(kw_args > 0)) {
  6106. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 643, __pyx_L3_error)
  6107. }
  6108. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6109. goto __pyx_L5_argtuple_error;
  6110. } else {
  6111. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6112. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6113. }
  6114. __pyx_v_g = values[0];
  6115. __pyx_v_h = values[1];
  6116. }
  6117. goto __pyx_L4_argument_unpacking_done;
  6118. __pyx_L5_argtuple_error:;
  6119. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error)
  6120. __pyx_L3_error:;
  6121. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6122. __Pyx_RefNannyFinishContext();
  6123. return NULL;
  6124. __pyx_L4_argument_unpacking_done:;
  6125. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6126. /* function exit code */
  6127. __Pyx_RefNannyFinishContext();
  6128. return __pyx_r;
  6129. }
  6130. 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) {
  6131. PyObject *__pyx_r = NULL;
  6132. __Pyx_RefNannyDeclarations
  6133. size_t __pyx_t_1;
  6134. size_t __pyx_t_2;
  6135. std::vector<npy_uint64> __pyx_t_3;
  6136. PyObject *__pyx_t_4 = NULL;
  6137. __Pyx_RefNannySetupContext("get_backward_map", 0);
  6138. /* "gedlibpy.pyx":658
  6139. * .. 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 !
  6140. * """
  6141. * return self.c_env.getBackwardMap(g, h) # <<<<<<<<<<<<<<
  6142. *
  6143. *
  6144. */
  6145. __Pyx_XDECREF(__pyx_r);
  6146. __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)
  6147. __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)
  6148. try {
  6149. __pyx_t_3 = __pyx_v_self->c_env->getBackwardMap(__pyx_t_1, __pyx_t_2);
  6150. } catch(...) {
  6151. __Pyx_CppExn2PyErr();
  6152. __PYX_ERR(0, 658, __pyx_L1_error)
  6153. }
  6154. __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)
  6155. __Pyx_GOTREF(__pyx_t_4);
  6156. __pyx_r = __pyx_t_4;
  6157. __pyx_t_4 = 0;
  6158. goto __pyx_L0;
  6159. /* "gedlibpy.pyx":643
  6160. *
  6161. *
  6162. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6163. * """
  6164. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6165. */
  6166. /* function exit code */
  6167. __pyx_L1_error:;
  6168. __Pyx_XDECREF(__pyx_t_4);
  6169. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6170. __pyx_r = NULL;
  6171. __pyx_L0:;
  6172. __Pyx_XGIVEREF(__pyx_r);
  6173. __Pyx_RefNannyFinishContext();
  6174. return __pyx_r;
  6175. }
  6176. /* "gedlibpy.pyx":661
  6177. *
  6178. *
  6179. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6180. * """
  6181. * Returns the node's image in the adjacence matrix, if it exists.
  6182. */
  6183. /* Python wrapper */
  6184. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6185. 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";
  6186. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6187. PyObject *__pyx_v_g = 0;
  6188. PyObject *__pyx_v_h = 0;
  6189. PyObject *__pyx_v_node_id = 0;
  6190. PyObject *__pyx_r = 0;
  6191. __Pyx_RefNannyDeclarations
  6192. __Pyx_RefNannySetupContext("get_node_image (wrapper)", 0);
  6193. {
  6194. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6195. PyObject* values[3] = {0,0,0};
  6196. if (unlikely(__pyx_kwds)) {
  6197. Py_ssize_t kw_args;
  6198. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6199. switch (pos_args) {
  6200. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6201. CYTHON_FALLTHROUGH;
  6202. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6203. CYTHON_FALLTHROUGH;
  6204. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6205. CYTHON_FALLTHROUGH;
  6206. case 0: break;
  6207. default: goto __pyx_L5_argtuple_error;
  6208. }
  6209. kw_args = PyDict_Size(__pyx_kwds);
  6210. switch (pos_args) {
  6211. case 0:
  6212. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6213. else goto __pyx_L5_argtuple_error;
  6214. CYTHON_FALLTHROUGH;
  6215. case 1:
  6216. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6217. else {
  6218. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error)
  6219. }
  6220. CYTHON_FALLTHROUGH;
  6221. case 2:
  6222. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6223. else {
  6224. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error)
  6225. }
  6226. }
  6227. if (unlikely(kw_args > 0)) {
  6228. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 661, __pyx_L3_error)
  6229. }
  6230. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6231. goto __pyx_L5_argtuple_error;
  6232. } else {
  6233. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6234. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6235. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6236. }
  6237. __pyx_v_g = values[0];
  6238. __pyx_v_h = values[1];
  6239. __pyx_v_node_id = values[2];
  6240. }
  6241. goto __pyx_L4_argument_unpacking_done;
  6242. __pyx_L5_argtuple_error:;
  6243. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error)
  6244. __pyx_L3_error:;
  6245. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6246. __Pyx_RefNannyFinishContext();
  6247. return NULL;
  6248. __pyx_L4_argument_unpacking_done:;
  6249. __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);
  6250. /* function exit code */
  6251. __Pyx_RefNannyFinishContext();
  6252. return __pyx_r;
  6253. }
  6254. 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) {
  6255. PyObject *__pyx_r = NULL;
  6256. __Pyx_RefNannyDeclarations
  6257. size_t __pyx_t_1;
  6258. size_t __pyx_t_2;
  6259. size_t __pyx_t_3;
  6260. size_t __pyx_t_4;
  6261. PyObject *__pyx_t_5 = NULL;
  6262. __Pyx_RefNannySetupContext("get_node_image", 0);
  6263. /* "gedlibpy.pyx":679
  6264. *
  6265. * """
  6266. * return self.c_env.getNodeImage(g, h, node_id) # <<<<<<<<<<<<<<
  6267. *
  6268. *
  6269. */
  6270. __Pyx_XDECREF(__pyx_r);
  6271. __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)
  6272. __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)
  6273. __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)
  6274. try {
  6275. __pyx_t_4 = __pyx_v_self->c_env->getNodeImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6276. } catch(...) {
  6277. __Pyx_CppExn2PyErr();
  6278. __PYX_ERR(0, 679, __pyx_L1_error)
  6279. }
  6280. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
  6281. __Pyx_GOTREF(__pyx_t_5);
  6282. __pyx_r = __pyx_t_5;
  6283. __pyx_t_5 = 0;
  6284. goto __pyx_L0;
  6285. /* "gedlibpy.pyx":661
  6286. *
  6287. *
  6288. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6289. * """
  6290. * Returns the node's image in the adjacence matrix, if it exists.
  6291. */
  6292. /* function exit code */
  6293. __pyx_L1_error:;
  6294. __Pyx_XDECREF(__pyx_t_5);
  6295. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6296. __pyx_r = NULL;
  6297. __pyx_L0:;
  6298. __Pyx_XGIVEREF(__pyx_r);
  6299. __Pyx_RefNannyFinishContext();
  6300. return __pyx_r;
  6301. }
  6302. /* "gedlibpy.pyx":682
  6303. *
  6304. *
  6305. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6306. * """
  6307. * Returns the node's preimage in the adjacence matrix, if it exists.
  6308. */
  6309. /* Python wrapper */
  6310. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6311. 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";
  6312. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6313. PyObject *__pyx_v_g = 0;
  6314. PyObject *__pyx_v_h = 0;
  6315. PyObject *__pyx_v_node_id = 0;
  6316. PyObject *__pyx_r = 0;
  6317. __Pyx_RefNannyDeclarations
  6318. __Pyx_RefNannySetupContext("get_node_pre_image (wrapper)", 0);
  6319. {
  6320. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6321. PyObject* values[3] = {0,0,0};
  6322. if (unlikely(__pyx_kwds)) {
  6323. Py_ssize_t kw_args;
  6324. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6325. switch (pos_args) {
  6326. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6327. CYTHON_FALLTHROUGH;
  6328. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6329. CYTHON_FALLTHROUGH;
  6330. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6331. CYTHON_FALLTHROUGH;
  6332. case 0: break;
  6333. default: goto __pyx_L5_argtuple_error;
  6334. }
  6335. kw_args = PyDict_Size(__pyx_kwds);
  6336. switch (pos_args) {
  6337. case 0:
  6338. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6339. else goto __pyx_L5_argtuple_error;
  6340. CYTHON_FALLTHROUGH;
  6341. case 1:
  6342. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6343. else {
  6344. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 682, __pyx_L3_error)
  6345. }
  6346. CYTHON_FALLTHROUGH;
  6347. case 2:
  6348. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6349. else {
  6350. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 682, __pyx_L3_error)
  6351. }
  6352. }
  6353. if (unlikely(kw_args > 0)) {
  6354. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 682, __pyx_L3_error)
  6355. }
  6356. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6357. goto __pyx_L5_argtuple_error;
  6358. } else {
  6359. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6360. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6361. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6362. }
  6363. __pyx_v_g = values[0];
  6364. __pyx_v_h = values[1];
  6365. __pyx_v_node_id = values[2];
  6366. }
  6367. goto __pyx_L4_argument_unpacking_done;
  6368. __pyx_L5_argtuple_error:;
  6369. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 682, __pyx_L3_error)
  6370. __pyx_L3_error:;
  6371. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6372. __Pyx_RefNannyFinishContext();
  6373. return NULL;
  6374. __pyx_L4_argument_unpacking_done:;
  6375. __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);
  6376. /* function exit code */
  6377. __Pyx_RefNannyFinishContext();
  6378. return __pyx_r;
  6379. }
  6380. 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) {
  6381. PyObject *__pyx_r = NULL;
  6382. __Pyx_RefNannyDeclarations
  6383. size_t __pyx_t_1;
  6384. size_t __pyx_t_2;
  6385. size_t __pyx_t_3;
  6386. size_t __pyx_t_4;
  6387. PyObject *__pyx_t_5 = NULL;
  6388. __Pyx_RefNannySetupContext("get_node_pre_image", 0);
  6389. /* "gedlibpy.pyx":700
  6390. *
  6391. * """
  6392. * return self.c_env.getNodePreImage(g, h, node_id) # <<<<<<<<<<<<<<
  6393. *
  6394. *
  6395. */
  6396. __Pyx_XDECREF(__pyx_r);
  6397. __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)
  6398. __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)
  6399. __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)
  6400. try {
  6401. __pyx_t_4 = __pyx_v_self->c_env->getNodePreImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6402. } catch(...) {
  6403. __Pyx_CppExn2PyErr();
  6404. __PYX_ERR(0, 700, __pyx_L1_error)
  6405. }
  6406. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error)
  6407. __Pyx_GOTREF(__pyx_t_5);
  6408. __pyx_r = __pyx_t_5;
  6409. __pyx_t_5 = 0;
  6410. goto __pyx_L0;
  6411. /* "gedlibpy.pyx":682
  6412. *
  6413. *
  6414. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6415. * """
  6416. * Returns the node's preimage in the adjacence matrix, if it exists.
  6417. */
  6418. /* function exit code */
  6419. __pyx_L1_error:;
  6420. __Pyx_XDECREF(__pyx_t_5);
  6421. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6422. __pyx_r = NULL;
  6423. __pyx_L0:;
  6424. __Pyx_XGIVEREF(__pyx_r);
  6425. __Pyx_RefNannyFinishContext();
  6426. return __pyx_r;
  6427. }
  6428. /* "gedlibpy.pyx":703
  6429. *
  6430. *
  6431. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6432. * """
  6433. * Returns the induced cost between the two indicated graphs.
  6434. */
  6435. /* Python wrapper */
  6436. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6437. 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";
  6438. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6439. PyObject *__pyx_v_g = 0;
  6440. PyObject *__pyx_v_h = 0;
  6441. PyObject *__pyx_r = 0;
  6442. __Pyx_RefNannyDeclarations
  6443. __Pyx_RefNannySetupContext("get_induced_cost (wrapper)", 0);
  6444. {
  6445. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6446. PyObject* values[2] = {0,0};
  6447. if (unlikely(__pyx_kwds)) {
  6448. Py_ssize_t kw_args;
  6449. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6450. switch (pos_args) {
  6451. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6452. CYTHON_FALLTHROUGH;
  6453. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6454. CYTHON_FALLTHROUGH;
  6455. case 0: break;
  6456. default: goto __pyx_L5_argtuple_error;
  6457. }
  6458. kw_args = PyDict_Size(__pyx_kwds);
  6459. switch (pos_args) {
  6460. case 0:
  6461. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6462. else goto __pyx_L5_argtuple_error;
  6463. CYTHON_FALLTHROUGH;
  6464. case 1:
  6465. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6466. else {
  6467. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 703, __pyx_L3_error)
  6468. }
  6469. }
  6470. if (unlikely(kw_args > 0)) {
  6471. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 703, __pyx_L3_error)
  6472. }
  6473. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6474. goto __pyx_L5_argtuple_error;
  6475. } else {
  6476. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6477. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6478. }
  6479. __pyx_v_g = values[0];
  6480. __pyx_v_h = values[1];
  6481. }
  6482. goto __pyx_L4_argument_unpacking_done;
  6483. __pyx_L5_argtuple_error:;
  6484. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 703, __pyx_L3_error)
  6485. __pyx_L3_error:;
  6486. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6487. __Pyx_RefNannyFinishContext();
  6488. return NULL;
  6489. __pyx_L4_argument_unpacking_done:;
  6490. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6491. /* function exit code */
  6492. __Pyx_RefNannyFinishContext();
  6493. return __pyx_r;
  6494. }
  6495. 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) {
  6496. PyObject *__pyx_r = NULL;
  6497. __Pyx_RefNannyDeclarations
  6498. size_t __pyx_t_1;
  6499. size_t __pyx_t_2;
  6500. double __pyx_t_3;
  6501. PyObject *__pyx_t_4 = NULL;
  6502. __Pyx_RefNannySetupContext("get_induced_cost", 0);
  6503. /* "gedlibpy.pyx":719
  6504. *
  6505. * """
  6506. * return self.c_env.getInducedCost(g, h) # <<<<<<<<<<<<<<
  6507. *
  6508. *
  6509. */
  6510. __Pyx_XDECREF(__pyx_r);
  6511. __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)
  6512. __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)
  6513. try {
  6514. __pyx_t_3 = __pyx_v_self->c_env->getInducedCost(__pyx_t_1, __pyx_t_2);
  6515. } catch(...) {
  6516. __Pyx_CppExn2PyErr();
  6517. __PYX_ERR(0, 719, __pyx_L1_error)
  6518. }
  6519. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error)
  6520. __Pyx_GOTREF(__pyx_t_4);
  6521. __pyx_r = __pyx_t_4;
  6522. __pyx_t_4 = 0;
  6523. goto __pyx_L0;
  6524. /* "gedlibpy.pyx":703
  6525. *
  6526. *
  6527. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6528. * """
  6529. * Returns the induced cost between the two indicated graphs.
  6530. */
  6531. /* function exit code */
  6532. __pyx_L1_error:;
  6533. __Pyx_XDECREF(__pyx_t_4);
  6534. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6535. __pyx_r = NULL;
  6536. __pyx_L0:;
  6537. __Pyx_XGIVEREF(__pyx_r);
  6538. __Pyx_RefNannyFinishContext();
  6539. return __pyx_r;
  6540. }
  6541. /* "gedlibpy.pyx":722
  6542. *
  6543. *
  6544. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  6545. * """
  6546. * Returns the Node Map, like C++ NodeMap.
  6547. */
  6548. /* Python wrapper */
  6549. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6550. 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";
  6551. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6552. PyObject *__pyx_v_g = 0;
  6553. PyObject *__pyx_v_h = 0;
  6554. PyObject *__pyx_r = 0;
  6555. __Pyx_RefNannyDeclarations
  6556. __Pyx_RefNannySetupContext("get_node_map (wrapper)", 0);
  6557. {
  6558. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6559. PyObject* values[2] = {0,0};
  6560. if (unlikely(__pyx_kwds)) {
  6561. Py_ssize_t kw_args;
  6562. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6563. switch (pos_args) {
  6564. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6565. CYTHON_FALLTHROUGH;
  6566. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6567. CYTHON_FALLTHROUGH;
  6568. case 0: break;
  6569. default: goto __pyx_L5_argtuple_error;
  6570. }
  6571. kw_args = PyDict_Size(__pyx_kwds);
  6572. switch (pos_args) {
  6573. case 0:
  6574. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6575. else goto __pyx_L5_argtuple_error;
  6576. CYTHON_FALLTHROUGH;
  6577. case 1:
  6578. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6579. else {
  6580. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 722, __pyx_L3_error)
  6581. }
  6582. }
  6583. if (unlikely(kw_args > 0)) {
  6584. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 722, __pyx_L3_error)
  6585. }
  6586. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6587. goto __pyx_L5_argtuple_error;
  6588. } else {
  6589. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6590. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6591. }
  6592. __pyx_v_g = values[0];
  6593. __pyx_v_h = values[1];
  6594. }
  6595. goto __pyx_L4_argument_unpacking_done;
  6596. __pyx_L5_argtuple_error:;
  6597. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 722, __pyx_L3_error)
  6598. __pyx_L3_error:;
  6599. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6600. __Pyx_RefNannyFinishContext();
  6601. return NULL;
  6602. __pyx_L4_argument_unpacking_done:;
  6603. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6604. /* function exit code */
  6605. __Pyx_RefNannyFinishContext();
  6606. return __pyx_r;
  6607. }
  6608. 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) {
  6609. std::vector<std::pair<size_t,size_t> > __pyx_v_map_as_relation;
  6610. double __pyx_v_induced_cost;
  6611. PyObject *__pyx_v_source_map = NULL;
  6612. PyObject *__pyx_v_target_map = NULL;
  6613. Py_ssize_t __pyx_v_num_node_source;
  6614. Py_ssize_t __pyx_v_num_node_target;
  6615. PyObject *__pyx_v_node_map = NULL;
  6616. Py_ssize_t __pyx_v_i;
  6617. std::pair<size_t,size_t> __pyx_8genexpr5__pyx_v_item;
  6618. std::pair<size_t,size_t> __pyx_8genexpr6__pyx_v_item;
  6619. PyObject *__pyx_8genexpr7__pyx_v_item = NULL;
  6620. PyObject *__pyx_8genexpr8__pyx_v_item = NULL;
  6621. PyObject *__pyx_r = NULL;
  6622. __Pyx_RefNannyDeclarations
  6623. size_t __pyx_t_1;
  6624. size_t __pyx_t_2;
  6625. std::vector<std::pair<size_t,size_t> > __pyx_t_3;
  6626. double __pyx_t_4;
  6627. PyObject *__pyx_t_5 = NULL;
  6628. std::vector<std::pair<size_t,size_t> > ::iterator __pyx_t_6;
  6629. std::pair<size_t,size_t> __pyx_t_7;
  6630. PyObject *__pyx_t_8 = NULL;
  6631. PyObject *__pyx_t_9 = NULL;
  6632. Py_ssize_t __pyx_t_10;
  6633. PyObject *__pyx_t_11 = NULL;
  6634. int __pyx_t_12;
  6635. PyObject *__pyx_t_13 = NULL;
  6636. int __pyx_t_14;
  6637. PyObject *__pyx_t_15 = NULL;
  6638. Py_ssize_t __pyx_t_16;
  6639. Py_ssize_t __pyx_t_17;
  6640. __Pyx_RefNannySetupContext("get_node_map", 0);
  6641. /* "gedlibpy.pyx":737
  6642. * .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.
  6643. * """
  6644. * map_as_relation = self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<<
  6645. * 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.
  6646. * 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.
  6647. */
  6648. __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)
  6649. __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)
  6650. try {
  6651. __pyx_t_3 = __pyx_v_self->c_env->getNodeMap(__pyx_t_1, __pyx_t_2);
  6652. } catch(...) {
  6653. __Pyx_CppExn2PyErr();
  6654. __PYX_ERR(0, 737, __pyx_L1_error)
  6655. }
  6656. __pyx_v_map_as_relation = __pyx_t_3;
  6657. /* "gedlibpy.pyx":738
  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. * # print(source_map)
  6663. */
  6664. __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)
  6665. __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)
  6666. try {
  6667. __pyx_t_4 = __pyx_v_self->c_env->getInducedCost(__pyx_t_2, __pyx_t_1);
  6668. } catch(...) {
  6669. __Pyx_CppExn2PyErr();
  6670. __PYX_ERR(0, 738, __pyx_L1_error)
  6671. }
  6672. __pyx_v_induced_cost = __pyx_t_4;
  6673. /* "gedlibpy.pyx":739
  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. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6679. */
  6680. { /* enter inner scope */
  6681. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
  6682. __Pyx_GOTREF(__pyx_t_5);
  6683. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6684. for (;;) {
  6685. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6686. __pyx_t_7 = *__pyx_t_6;
  6687. ++__pyx_t_6;
  6688. __pyx_8genexpr5__pyx_v_item = __pyx_t_7;
  6689. __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)
  6690. __Pyx_GOTREF(__pyx_t_9);
  6691. __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 739, __pyx_L1_error)
  6692. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6693. if (((__pyx_8genexpr5__pyx_v_item.first < __pyx_t_10) != 0)) {
  6694. __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)
  6695. __Pyx_GOTREF(__pyx_t_9);
  6696. __pyx_t_8 = __pyx_t_9;
  6697. __pyx_t_9 = 0;
  6698. } else {
  6699. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error)
  6700. __Pyx_GOTREF(__pyx_t_9);
  6701. __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)
  6702. __Pyx_GOTREF(__pyx_t_11);
  6703. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6704. __pyx_t_8 = __pyx_t_11;
  6705. __pyx_t_11 = 0;
  6706. }
  6707. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 739, __pyx_L1_error)
  6708. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6709. }
  6710. } /* exit inner scope */
  6711. __pyx_v_source_map = ((PyObject*)__pyx_t_5);
  6712. __pyx_t_5 = 0;
  6713. /* "gedlibpy.pyx":741
  6714. * 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.
  6715. * # print(source_map)
  6716. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] # <<<<<<<<<<<<<<
  6717. * # print(target_map)
  6718. * num_node_source = len([item for item in source_map if item != np.inf])
  6719. */
  6720. { /* enter inner scope */
  6721. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
  6722. __Pyx_GOTREF(__pyx_t_5);
  6723. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6724. for (;;) {
  6725. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6726. __pyx_t_7 = *__pyx_t_6;
  6727. ++__pyx_t_6;
  6728. __pyx_8genexpr6__pyx_v_item = __pyx_t_7;
  6729. __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)
  6730. __Pyx_GOTREF(__pyx_t_11);
  6731. __pyx_t_10 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 741, __pyx_L1_error)
  6732. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6733. if (((__pyx_8genexpr6__pyx_v_item.second < __pyx_t_10) != 0)) {
  6734. __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)
  6735. __Pyx_GOTREF(__pyx_t_11);
  6736. __pyx_t_8 = __pyx_t_11;
  6737. __pyx_t_11 = 0;
  6738. } else {
  6739. __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error)
  6740. __Pyx_GOTREF(__pyx_t_11);
  6741. __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)
  6742. __Pyx_GOTREF(__pyx_t_9);
  6743. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6744. __pyx_t_8 = __pyx_t_9;
  6745. __pyx_t_9 = 0;
  6746. }
  6747. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 741, __pyx_L1_error)
  6748. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6749. }
  6750. } /* exit inner scope */
  6751. __pyx_v_target_map = ((PyObject*)__pyx_t_5);
  6752. __pyx_t_5 = 0;
  6753. /* "gedlibpy.pyx":743
  6754. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6755. * # print(target_map)
  6756. * num_node_source = len([item for item in source_map if item != np.inf]) # <<<<<<<<<<<<<<
  6757. * # print(num_node_source)
  6758. * num_node_target = len([item for item in target_map if item != np.inf])
  6759. */
  6760. { /* enter inner scope */
  6761. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L9_error)
  6762. __Pyx_GOTREF(__pyx_t_5);
  6763. __pyx_t_8 = __pyx_v_source_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6764. for (;;) {
  6765. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6766. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6767. __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)
  6768. #else
  6769. __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)
  6770. __Pyx_GOTREF(__pyx_t_9);
  6771. #endif
  6772. __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_item, __pyx_t_9);
  6773. __pyx_t_9 = 0;
  6774. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error)
  6775. __Pyx_GOTREF(__pyx_t_9);
  6776. __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)
  6777. __Pyx_GOTREF(__pyx_t_11);
  6778. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6779. __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)
  6780. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6781. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 743, __pyx_L9_error)
  6782. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6783. if (__pyx_t_12) {
  6784. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr7__pyx_v_item))) __PYX_ERR(0, 743, __pyx_L9_error)
  6785. }
  6786. }
  6787. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6788. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6789. goto __pyx_L13_exit_scope;
  6790. __pyx_L9_error:;
  6791. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6792. goto __pyx_L1_error;
  6793. __pyx_L13_exit_scope:;
  6794. } /* exit inner scope */
  6795. __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)
  6796. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6797. __pyx_v_num_node_source = __pyx_t_10;
  6798. /* "gedlibpy.pyx":745
  6799. * num_node_source = len([item for item in source_map if item != np.inf])
  6800. * # print(num_node_source)
  6801. * num_node_target = len([item for item in target_map if item != np.inf]) # <<<<<<<<<<<<<<
  6802. * # print(num_node_target)
  6803. *
  6804. */
  6805. { /* enter inner scope */
  6806. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L16_error)
  6807. __Pyx_GOTREF(__pyx_t_5);
  6808. __pyx_t_8 = __pyx_v_target_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6809. for (;;) {
  6810. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6811. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6812. __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)
  6813. #else
  6814. __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)
  6815. __Pyx_GOTREF(__pyx_t_9);
  6816. #endif
  6817. __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_item, __pyx_t_9);
  6818. __pyx_t_9 = 0;
  6819. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error)
  6820. __Pyx_GOTREF(__pyx_t_9);
  6821. __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)
  6822. __Pyx_GOTREF(__pyx_t_11);
  6823. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6824. __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)
  6825. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6826. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 745, __pyx_L16_error)
  6827. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6828. if (__pyx_t_12) {
  6829. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr8__pyx_v_item))) __PYX_ERR(0, 745, __pyx_L16_error)
  6830. }
  6831. }
  6832. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6833. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6834. goto __pyx_L20_exit_scope;
  6835. __pyx_L16_error:;
  6836. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6837. goto __pyx_L1_error;
  6838. __pyx_L20_exit_scope:;
  6839. } /* exit inner scope */
  6840. __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)
  6841. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6842. __pyx_v_num_node_target = __pyx_t_10;
  6843. /* "gedlibpy.pyx":748
  6844. * # print(num_node_target)
  6845. *
  6846. * node_map = NodeMap(num_node_source, num_node_target) # <<<<<<<<<<<<<<
  6847. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6848. * for i in range(len(source_map)):
  6849. */
  6850. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 748, __pyx_L1_error)
  6851. __Pyx_GOTREF(__pyx_t_8);
  6852. __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_num_node_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 748, __pyx_L1_error)
  6853. __Pyx_GOTREF(__pyx_t_9);
  6854. __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_num_node_target); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 748, __pyx_L1_error)
  6855. __Pyx_GOTREF(__pyx_t_11);
  6856. __pyx_t_13 = NULL;
  6857. __pyx_t_14 = 0;
  6858. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  6859. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
  6860. if (likely(__pyx_t_13)) {
  6861. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6862. __Pyx_INCREF(__pyx_t_13);
  6863. __Pyx_INCREF(function);
  6864. __Pyx_DECREF_SET(__pyx_t_8, function);
  6865. __pyx_t_14 = 1;
  6866. }
  6867. }
  6868. #if CYTHON_FAST_PYCALL
  6869. if (PyFunction_Check(__pyx_t_8)) {
  6870. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6871. __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)
  6872. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6873. __Pyx_GOTREF(__pyx_t_5);
  6874. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6875. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6876. } else
  6877. #endif
  6878. #if CYTHON_FAST_PYCCALL
  6879. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6880. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6881. __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)
  6882. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6883. __Pyx_GOTREF(__pyx_t_5);
  6884. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6885. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6886. } else
  6887. #endif
  6888. {
  6889. __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 748, __pyx_L1_error)
  6890. __Pyx_GOTREF(__pyx_t_15);
  6891. if (__pyx_t_13) {
  6892. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
  6893. }
  6894. __Pyx_GIVEREF(__pyx_t_9);
  6895. PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_9);
  6896. __Pyx_GIVEREF(__pyx_t_11);
  6897. PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_11);
  6898. __pyx_t_9 = 0;
  6899. __pyx_t_11 = 0;
  6900. __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)
  6901. __Pyx_GOTREF(__pyx_t_5);
  6902. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6903. }
  6904. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6905. __pyx_v_node_map = __pyx_t_5;
  6906. __pyx_t_5 = 0;
  6907. /* "gedlibpy.pyx":750
  6908. * node_map = NodeMap(num_node_source, num_node_target)
  6909. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6910. * for i in range(len(source_map)): # <<<<<<<<<<<<<<
  6911. * node_map.add_assignment(source_map[i], target_map[i])
  6912. * node_map.set_induced_cost(induced_cost)
  6913. */
  6914. __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)
  6915. __pyx_t_16 = __pyx_t_10;
  6916. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  6917. __pyx_v_i = __pyx_t_17;
  6918. /* "gedlibpy.pyx":751
  6919. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6920. * for i in range(len(source_map)):
  6921. * node_map.add_assignment(source_map[i], target_map[i]) # <<<<<<<<<<<<<<
  6922. * node_map.set_induced_cost(induced_cost)
  6923. *
  6924. */
  6925. __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)
  6926. __Pyx_GOTREF(__pyx_t_8);
  6927. __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)
  6928. __Pyx_GOTREF(__pyx_t_15);
  6929. __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)
  6930. __Pyx_GOTREF(__pyx_t_11);
  6931. __pyx_t_9 = NULL;
  6932. __pyx_t_14 = 0;
  6933. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  6934. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  6935. if (likely(__pyx_t_9)) {
  6936. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6937. __Pyx_INCREF(__pyx_t_9);
  6938. __Pyx_INCREF(function);
  6939. __Pyx_DECREF_SET(__pyx_t_8, function);
  6940. __pyx_t_14 = 1;
  6941. }
  6942. }
  6943. #if CYTHON_FAST_PYCALL
  6944. if (PyFunction_Check(__pyx_t_8)) {
  6945. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6946. __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)
  6947. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6948. __Pyx_GOTREF(__pyx_t_5);
  6949. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6950. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6951. } else
  6952. #endif
  6953. #if CYTHON_FAST_PYCCALL
  6954. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6955. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6956. __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)
  6957. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6958. __Pyx_GOTREF(__pyx_t_5);
  6959. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6960. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6961. } else
  6962. #endif
  6963. {
  6964. __pyx_t_13 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 751, __pyx_L1_error)
  6965. __Pyx_GOTREF(__pyx_t_13);
  6966. if (__pyx_t_9) {
  6967. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL;
  6968. }
  6969. __Pyx_GIVEREF(__pyx_t_15);
  6970. PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_14, __pyx_t_15);
  6971. __Pyx_GIVEREF(__pyx_t_11);
  6972. PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_14, __pyx_t_11);
  6973. __pyx_t_15 = 0;
  6974. __pyx_t_11 = 0;
  6975. __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)
  6976. __Pyx_GOTREF(__pyx_t_5);
  6977. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  6978. }
  6979. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6980. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6981. }
  6982. /* "gedlibpy.pyx":752
  6983. * for i in range(len(source_map)):
  6984. * node_map.add_assignment(source_map[i], target_map[i])
  6985. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  6986. *
  6987. * return node_map
  6988. */
  6989. __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)
  6990. __Pyx_GOTREF(__pyx_t_8);
  6991. __pyx_t_13 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 752, __pyx_L1_error)
  6992. __Pyx_GOTREF(__pyx_t_13);
  6993. __pyx_t_11 = NULL;
  6994. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  6995. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
  6996. if (likely(__pyx_t_11)) {
  6997. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6998. __Pyx_INCREF(__pyx_t_11);
  6999. __Pyx_INCREF(function);
  7000. __Pyx_DECREF_SET(__pyx_t_8, function);
  7001. }
  7002. }
  7003. __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);
  7004. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  7005. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  7006. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
  7007. __Pyx_GOTREF(__pyx_t_5);
  7008. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7009. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7010. /* "gedlibpy.pyx":754
  7011. * node_map.set_induced_cost(induced_cost)
  7012. *
  7013. * return node_map # <<<<<<<<<<<<<<
  7014. *
  7015. *
  7016. */
  7017. __Pyx_XDECREF(__pyx_r);
  7018. __Pyx_INCREF(__pyx_v_node_map);
  7019. __pyx_r = __pyx_v_node_map;
  7020. goto __pyx_L0;
  7021. /* "gedlibpy.pyx":722
  7022. *
  7023. *
  7024. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  7025. * """
  7026. * Returns the Node Map, like C++ NodeMap.
  7027. */
  7028. /* function exit code */
  7029. __pyx_L1_error:;
  7030. __Pyx_XDECREF(__pyx_t_5);
  7031. __Pyx_XDECREF(__pyx_t_8);
  7032. __Pyx_XDECREF(__pyx_t_9);
  7033. __Pyx_XDECREF(__pyx_t_11);
  7034. __Pyx_XDECREF(__pyx_t_13);
  7035. __Pyx_XDECREF(__pyx_t_15);
  7036. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7037. __pyx_r = NULL;
  7038. __pyx_L0:;
  7039. __Pyx_XDECREF(__pyx_v_source_map);
  7040. __Pyx_XDECREF(__pyx_v_target_map);
  7041. __Pyx_XDECREF(__pyx_v_node_map);
  7042. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item);
  7043. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item);
  7044. __Pyx_XGIVEREF(__pyx_r);
  7045. __Pyx_RefNannyFinishContext();
  7046. return __pyx_r;
  7047. }
  7048. /* "gedlibpy.pyx":757
  7049. *
  7050. *
  7051. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7052. * """
  7053. * Returns the Assignment Matrix between two selected graphs g and h.
  7054. */
  7055. /* Python wrapper */
  7056. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7057. 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";
  7058. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7059. PyObject *__pyx_v_g = 0;
  7060. PyObject *__pyx_v_h = 0;
  7061. PyObject *__pyx_r = 0;
  7062. __Pyx_RefNannyDeclarations
  7063. __Pyx_RefNannySetupContext("get_assignment_matrix (wrapper)", 0);
  7064. {
  7065. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7066. PyObject* values[2] = {0,0};
  7067. if (unlikely(__pyx_kwds)) {
  7068. Py_ssize_t kw_args;
  7069. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7070. switch (pos_args) {
  7071. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7072. CYTHON_FALLTHROUGH;
  7073. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7074. CYTHON_FALLTHROUGH;
  7075. case 0: break;
  7076. default: goto __pyx_L5_argtuple_error;
  7077. }
  7078. kw_args = PyDict_Size(__pyx_kwds);
  7079. switch (pos_args) {
  7080. case 0:
  7081. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7082. else goto __pyx_L5_argtuple_error;
  7083. CYTHON_FALLTHROUGH;
  7084. case 1:
  7085. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7086. else {
  7087. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 757, __pyx_L3_error)
  7088. }
  7089. }
  7090. if (unlikely(kw_args > 0)) {
  7091. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 757, __pyx_L3_error)
  7092. }
  7093. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7094. goto __pyx_L5_argtuple_error;
  7095. } else {
  7096. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7097. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7098. }
  7099. __pyx_v_g = values[0];
  7100. __pyx_v_h = values[1];
  7101. }
  7102. goto __pyx_L4_argument_unpacking_done;
  7103. __pyx_L5_argtuple_error:;
  7104. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 757, __pyx_L3_error)
  7105. __pyx_L3_error:;
  7106. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7107. __Pyx_RefNannyFinishContext();
  7108. return NULL;
  7109. __pyx_L4_argument_unpacking_done:;
  7110. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7111. /* function exit code */
  7112. __Pyx_RefNannyFinishContext();
  7113. return __pyx_r;
  7114. }
  7115. 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) {
  7116. PyObject *__pyx_r = NULL;
  7117. __Pyx_RefNannyDeclarations
  7118. size_t __pyx_t_1;
  7119. size_t __pyx_t_2;
  7120. std::vector<std::vector<int> > __pyx_t_3;
  7121. PyObject *__pyx_t_4 = NULL;
  7122. __Pyx_RefNannySetupContext("get_assignment_matrix", 0);
  7123. /* "gedlibpy.pyx":772
  7124. * .. note:: This function creates datas so use it if necessary.
  7125. * """
  7126. * return self.c_env.getAssignmentMatrix(g, h) # <<<<<<<<<<<<<<
  7127. *
  7128. *
  7129. */
  7130. __Pyx_XDECREF(__pyx_r);
  7131. __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)
  7132. __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)
  7133. try {
  7134. __pyx_t_3 = __pyx_v_self->c_env->getAssignmentMatrix(__pyx_t_1, __pyx_t_2);
  7135. } catch(...) {
  7136. __Pyx_CppExn2PyErr();
  7137. __PYX_ERR(0, 772, __pyx_L1_error)
  7138. }
  7139. __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)
  7140. __Pyx_GOTREF(__pyx_t_4);
  7141. __pyx_r = __pyx_t_4;
  7142. __pyx_t_4 = 0;
  7143. goto __pyx_L0;
  7144. /* "gedlibpy.pyx":757
  7145. *
  7146. *
  7147. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7148. * """
  7149. * Returns the Assignment Matrix between two selected graphs g and h.
  7150. */
  7151. /* function exit code */
  7152. __pyx_L1_error:;
  7153. __Pyx_XDECREF(__pyx_t_4);
  7154. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7155. __pyx_r = NULL;
  7156. __pyx_L0:;
  7157. __Pyx_XGIVEREF(__pyx_r);
  7158. __Pyx_RefNannyFinishContext();
  7159. return __pyx_r;
  7160. }
  7161. /* "gedlibpy.pyx":775
  7162. *
  7163. *
  7164. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7165. * """
  7166. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7167. */
  7168. /* Python wrapper */
  7169. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7170. 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";
  7171. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7172. PyObject *__pyx_v_g = 0;
  7173. PyObject *__pyx_v_h = 0;
  7174. PyObject *__pyx_r = 0;
  7175. __Pyx_RefNannyDeclarations
  7176. __Pyx_RefNannySetupContext("get_all_map (wrapper)", 0);
  7177. {
  7178. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7179. PyObject* values[2] = {0,0};
  7180. if (unlikely(__pyx_kwds)) {
  7181. Py_ssize_t kw_args;
  7182. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7183. switch (pos_args) {
  7184. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7185. CYTHON_FALLTHROUGH;
  7186. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7187. CYTHON_FALLTHROUGH;
  7188. case 0: break;
  7189. default: goto __pyx_L5_argtuple_error;
  7190. }
  7191. kw_args = PyDict_Size(__pyx_kwds);
  7192. switch (pos_args) {
  7193. case 0:
  7194. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7195. else goto __pyx_L5_argtuple_error;
  7196. CYTHON_FALLTHROUGH;
  7197. case 1:
  7198. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7199. else {
  7200. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error)
  7201. }
  7202. }
  7203. if (unlikely(kw_args > 0)) {
  7204. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 775, __pyx_L3_error)
  7205. }
  7206. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7207. goto __pyx_L5_argtuple_error;
  7208. } else {
  7209. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7210. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7211. }
  7212. __pyx_v_g = values[0];
  7213. __pyx_v_h = values[1];
  7214. }
  7215. goto __pyx_L4_argument_unpacking_done;
  7216. __pyx_L5_argtuple_error:;
  7217. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 775, __pyx_L3_error)
  7218. __pyx_L3_error:;
  7219. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7220. __Pyx_RefNannyFinishContext();
  7221. return NULL;
  7222. __pyx_L4_argument_unpacking_done:;
  7223. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7224. /* function exit code */
  7225. __Pyx_RefNannyFinishContext();
  7226. return __pyx_r;
  7227. }
  7228. 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) {
  7229. PyObject *__pyx_r = NULL;
  7230. __Pyx_RefNannyDeclarations
  7231. size_t __pyx_t_1;
  7232. size_t __pyx_t_2;
  7233. std::vector<std::vector<npy_uint64> > __pyx_t_3;
  7234. PyObject *__pyx_t_4 = NULL;
  7235. __Pyx_RefNannySetupContext("get_all_map", 0);
  7236. /* "gedlibpy.pyx":790
  7237. * .. 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 !
  7238. * """
  7239. * return self.c_env.getAllMap(g, h) # <<<<<<<<<<<<<<
  7240. *
  7241. *
  7242. */
  7243. __Pyx_XDECREF(__pyx_r);
  7244. __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)
  7245. __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)
  7246. try {
  7247. __pyx_t_3 = __pyx_v_self->c_env->getAllMap(__pyx_t_1, __pyx_t_2);
  7248. } catch(...) {
  7249. __Pyx_CppExn2PyErr();
  7250. __PYX_ERR(0, 790, __pyx_L1_error)
  7251. }
  7252. __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)
  7253. __Pyx_GOTREF(__pyx_t_4);
  7254. __pyx_r = __pyx_t_4;
  7255. __pyx_t_4 = 0;
  7256. goto __pyx_L0;
  7257. /* "gedlibpy.pyx":775
  7258. *
  7259. *
  7260. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7261. * """
  7262. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7263. */
  7264. /* function exit code */
  7265. __pyx_L1_error:;
  7266. __Pyx_XDECREF(__pyx_t_4);
  7267. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7268. __pyx_r = NULL;
  7269. __pyx_L0:;
  7270. __Pyx_XGIVEREF(__pyx_r);
  7271. __Pyx_RefNannyFinishContext();
  7272. return __pyx_r;
  7273. }
  7274. /* "gedlibpy.pyx":793
  7275. *
  7276. *
  7277. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7278. * """
  7279. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7280. */
  7281. /* Python wrapper */
  7282. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7283. 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";
  7284. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7285. PyObject *__pyx_v_g = 0;
  7286. PyObject *__pyx_v_h = 0;
  7287. PyObject *__pyx_r = 0;
  7288. __Pyx_RefNannyDeclarations
  7289. __Pyx_RefNannySetupContext("get_runtime (wrapper)", 0);
  7290. {
  7291. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7292. PyObject* values[2] = {0,0};
  7293. if (unlikely(__pyx_kwds)) {
  7294. Py_ssize_t kw_args;
  7295. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7296. switch (pos_args) {
  7297. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7298. CYTHON_FALLTHROUGH;
  7299. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7300. CYTHON_FALLTHROUGH;
  7301. case 0: break;
  7302. default: goto __pyx_L5_argtuple_error;
  7303. }
  7304. kw_args = PyDict_Size(__pyx_kwds);
  7305. switch (pos_args) {
  7306. case 0:
  7307. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7308. else goto __pyx_L5_argtuple_error;
  7309. CYTHON_FALLTHROUGH;
  7310. case 1:
  7311. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7312. else {
  7313. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 793, __pyx_L3_error)
  7314. }
  7315. }
  7316. if (unlikely(kw_args > 0)) {
  7317. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 793, __pyx_L3_error)
  7318. }
  7319. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7320. goto __pyx_L5_argtuple_error;
  7321. } else {
  7322. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7323. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7324. }
  7325. __pyx_v_g = values[0];
  7326. __pyx_v_h = values[1];
  7327. }
  7328. goto __pyx_L4_argument_unpacking_done;
  7329. __pyx_L5_argtuple_error:;
  7330. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 793, __pyx_L3_error)
  7331. __pyx_L3_error:;
  7332. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7333. __Pyx_RefNannyFinishContext();
  7334. return NULL;
  7335. __pyx_L4_argument_unpacking_done:;
  7336. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7337. /* function exit code */
  7338. __Pyx_RefNannyFinishContext();
  7339. return __pyx_r;
  7340. }
  7341. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  7342. PyObject *__pyx_r = NULL;
  7343. __Pyx_RefNannyDeclarations
  7344. size_t __pyx_t_1;
  7345. size_t __pyx_t_2;
  7346. double __pyx_t_3;
  7347. PyObject *__pyx_t_4 = NULL;
  7348. __Pyx_RefNannySetupContext("get_runtime", 0);
  7349. /* "gedlibpy.pyx":808
  7350. * .. note:: Python is a bit longer than C++ due to the functions's encapsulate.
  7351. * """
  7352. * return self.c_env.getRuntime(g,h) # <<<<<<<<<<<<<<
  7353. *
  7354. *
  7355. */
  7356. __Pyx_XDECREF(__pyx_r);
  7357. __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)
  7358. __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)
  7359. try {
  7360. __pyx_t_3 = __pyx_v_self->c_env->getRuntime(__pyx_t_1, __pyx_t_2);
  7361. } catch(...) {
  7362. __Pyx_CppExn2PyErr();
  7363. __PYX_ERR(0, 808, __pyx_L1_error)
  7364. }
  7365. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
  7366. __Pyx_GOTREF(__pyx_t_4);
  7367. __pyx_r = __pyx_t_4;
  7368. __pyx_t_4 = 0;
  7369. goto __pyx_L0;
  7370. /* "gedlibpy.pyx":793
  7371. *
  7372. *
  7373. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7374. * """
  7375. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7376. */
  7377. /* function exit code */
  7378. __pyx_L1_error:;
  7379. __Pyx_XDECREF(__pyx_t_4);
  7380. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7381. __pyx_r = NULL;
  7382. __pyx_L0:;
  7383. __Pyx_XGIVEREF(__pyx_r);
  7384. __Pyx_RefNannyFinishContext();
  7385. return __pyx_r;
  7386. }
  7387. /* "gedlibpy.pyx":811
  7388. *
  7389. *
  7390. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7391. * """
  7392. * Checks and returns if the edit costs are quasimetric.
  7393. */
  7394. /* Python wrapper */
  7395. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  7396. 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";
  7397. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  7398. PyObject *__pyx_r = 0;
  7399. __Pyx_RefNannyDeclarations
  7400. __Pyx_RefNannySetupContext("quasimetric_cost (wrapper)", 0);
  7401. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  7402. /* function exit code */
  7403. __Pyx_RefNannyFinishContext();
  7404. return __pyx_r;
  7405. }
  7406. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  7407. PyObject *__pyx_r = NULL;
  7408. __Pyx_RefNannyDeclarations
  7409. bool __pyx_t_1;
  7410. PyObject *__pyx_t_2 = NULL;
  7411. __Pyx_RefNannySetupContext("quasimetric_cost", 0);
  7412. /* "gedlibpy.pyx":825
  7413. * .. warning:: run_method() between the same two graph must be called before this function.
  7414. * """
  7415. * return self.c_env.quasimetricCosts() # <<<<<<<<<<<<<<
  7416. *
  7417. *
  7418. */
  7419. __Pyx_XDECREF(__pyx_r);
  7420. try {
  7421. __pyx_t_1 = __pyx_v_self->c_env->quasimetricCosts();
  7422. } catch(...) {
  7423. __Pyx_CppExn2PyErr();
  7424. __PYX_ERR(0, 825, __pyx_L1_error)
  7425. }
  7426. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error)
  7427. __Pyx_GOTREF(__pyx_t_2);
  7428. __pyx_r = __pyx_t_2;
  7429. __pyx_t_2 = 0;
  7430. goto __pyx_L0;
  7431. /* "gedlibpy.pyx":811
  7432. *
  7433. *
  7434. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7435. * """
  7436. * Checks and returns if the edit costs are quasimetric.
  7437. */
  7438. /* function exit code */
  7439. __pyx_L1_error:;
  7440. __Pyx_XDECREF(__pyx_t_2);
  7441. __Pyx_AddTraceback("gedlibpy.GEDEnv.quasimetric_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7442. __pyx_r = NULL;
  7443. __pyx_L0:;
  7444. __Pyx_XGIVEREF(__pyx_r);
  7445. __Pyx_RefNannyFinishContext();
  7446. return __pyx_r;
  7447. }
  7448. /* "gedlibpy.pyx":828
  7449. *
  7450. *
  7451. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7452. * """
  7453. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7454. */
  7455. /* Python wrapper */
  7456. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7457. 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";
  7458. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7459. PyObject *__pyx_r = 0;
  7460. __Pyx_RefNannyDeclarations
  7461. __Pyx_RefNannySetupContext("hungarian_LSAP (wrapper)", 0);
  7462. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7463. /* function exit code */
  7464. __Pyx_RefNannyFinishContext();
  7465. return __pyx_r;
  7466. }
  7467. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7468. PyObject *__pyx_r = NULL;
  7469. __Pyx_RefNannyDeclarations
  7470. std::vector<std::vector<size_t> > __pyx_t_1;
  7471. std::vector<std::vector<size_t> > __pyx_t_2;
  7472. PyObject *__pyx_t_3 = NULL;
  7473. __Pyx_RefNannySetupContext("hungarian_LSAP", 0);
  7474. /* "gedlibpy.pyx":839
  7475. * .. seealso:: hungarian_LSAPE()
  7476. * """
  7477. * return self.c_env.hungarianLSAP(matrix_cost) # <<<<<<<<<<<<<<
  7478. *
  7479. *
  7480. */
  7481. __Pyx_XDECREF(__pyx_r);
  7482. __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)
  7483. try {
  7484. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAP(__pyx_t_1);
  7485. } catch(...) {
  7486. __Pyx_CppExn2PyErr();
  7487. __PYX_ERR(0, 839, __pyx_L1_error)
  7488. }
  7489. __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)
  7490. __Pyx_GOTREF(__pyx_t_3);
  7491. __pyx_r = __pyx_t_3;
  7492. __pyx_t_3 = 0;
  7493. goto __pyx_L0;
  7494. /* "gedlibpy.pyx":828
  7495. *
  7496. *
  7497. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7498. * """
  7499. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7500. */
  7501. /* function exit code */
  7502. __pyx_L1_error:;
  7503. __Pyx_XDECREF(__pyx_t_3);
  7504. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7505. __pyx_r = NULL;
  7506. __pyx_L0:;
  7507. __Pyx_XGIVEREF(__pyx_r);
  7508. __Pyx_RefNannyFinishContext();
  7509. return __pyx_r;
  7510. }
  7511. /* "gedlibpy.pyx":842
  7512. *
  7513. *
  7514. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7515. * """
  7516. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7517. */
  7518. /* Python wrapper */
  7519. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7520. 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";
  7521. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7522. PyObject *__pyx_r = 0;
  7523. __Pyx_RefNannyDeclarations
  7524. __Pyx_RefNannySetupContext("hungarian_LSAPE (wrapper)", 0);
  7525. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7526. /* function exit code */
  7527. __Pyx_RefNannyFinishContext();
  7528. return __pyx_r;
  7529. }
  7530. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7531. PyObject *__pyx_r = NULL;
  7532. __Pyx_RefNannyDeclarations
  7533. std::vector<std::vector<double> > __pyx_t_1;
  7534. std::vector<std::vector<double> > __pyx_t_2;
  7535. PyObject *__pyx_t_3 = NULL;
  7536. __Pyx_RefNannySetupContext("hungarian_LSAPE", 0);
  7537. /* "gedlibpy.pyx":853
  7538. * .. seealso:: hungarian_LSAP()
  7539. * """
  7540. * return self.c_env.hungarianLSAPE(matrix_cost) # <<<<<<<<<<<<<<
  7541. *
  7542. *
  7543. */
  7544. __Pyx_XDECREF(__pyx_r);
  7545. __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)
  7546. try {
  7547. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAPE(__pyx_t_1);
  7548. } catch(...) {
  7549. __Pyx_CppExn2PyErr();
  7550. __PYX_ERR(0, 853, __pyx_L1_error)
  7551. }
  7552. __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)
  7553. __Pyx_GOTREF(__pyx_t_3);
  7554. __pyx_r = __pyx_t_3;
  7555. __pyx_t_3 = 0;
  7556. goto __pyx_L0;
  7557. /* "gedlibpy.pyx":842
  7558. *
  7559. *
  7560. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7561. * """
  7562. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7563. */
  7564. /* function exit code */
  7565. __pyx_L1_error:;
  7566. __Pyx_XDECREF(__pyx_t_3);
  7567. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7568. __pyx_r = NULL;
  7569. __pyx_L0:;
  7570. __Pyx_XGIVEREF(__pyx_r);
  7571. __Pyx_RefNannyFinishContext();
  7572. return __pyx_r;
  7573. }
  7574. /* "gedlibpy.pyx":856
  7575. *
  7576. *
  7577. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7578. * """
  7579. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7580. */
  7581. /* Python wrapper */
  7582. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7583. 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";
  7584. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7585. PyObject *__pyx_v_name = 0;
  7586. PyObject *__pyx_v_classe = 0;
  7587. PyObject *__pyx_v_list_of_nodes = 0;
  7588. PyObject *__pyx_v_list_of_edges = 0;
  7589. PyObject *__pyx_v_ignore_duplicates = 0;
  7590. PyObject *__pyx_r = 0;
  7591. __Pyx_RefNannyDeclarations
  7592. __Pyx_RefNannySetupContext("add_random_graph (wrapper)", 0);
  7593. {
  7594. 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};
  7595. PyObject* values[5] = {0,0,0,0,0};
  7596. values[4] = ((PyObject *)Py_True);
  7597. if (unlikely(__pyx_kwds)) {
  7598. Py_ssize_t kw_args;
  7599. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7600. switch (pos_args) {
  7601. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7602. CYTHON_FALLTHROUGH;
  7603. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7604. CYTHON_FALLTHROUGH;
  7605. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7606. CYTHON_FALLTHROUGH;
  7607. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7608. CYTHON_FALLTHROUGH;
  7609. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7610. CYTHON_FALLTHROUGH;
  7611. case 0: break;
  7612. default: goto __pyx_L5_argtuple_error;
  7613. }
  7614. kw_args = PyDict_Size(__pyx_kwds);
  7615. switch (pos_args) {
  7616. case 0:
  7617. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
  7618. else goto __pyx_L5_argtuple_error;
  7619. CYTHON_FALLTHROUGH;
  7620. case 1:
  7621. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  7622. else {
  7623. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 856, __pyx_L3_error)
  7624. }
  7625. CYTHON_FALLTHROUGH;
  7626. case 2:
  7627. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_nodes)) != 0)) kw_args--;
  7628. else {
  7629. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 856, __pyx_L3_error)
  7630. }
  7631. CYTHON_FALLTHROUGH;
  7632. case 3:
  7633. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_edges)) != 0)) kw_args--;
  7634. else {
  7635. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 856, __pyx_L3_error)
  7636. }
  7637. CYTHON_FALLTHROUGH;
  7638. case 4:
  7639. if (kw_args > 0) {
  7640. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  7641. if (value) { values[4] = value; kw_args--; }
  7642. }
  7643. }
  7644. if (unlikely(kw_args > 0)) {
  7645. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 856, __pyx_L3_error)
  7646. }
  7647. } else {
  7648. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7649. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7650. CYTHON_FALLTHROUGH;
  7651. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7652. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7653. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7654. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7655. break;
  7656. default: goto __pyx_L5_argtuple_error;
  7657. }
  7658. }
  7659. __pyx_v_name = values[0];
  7660. __pyx_v_classe = values[1];
  7661. __pyx_v_list_of_nodes = values[2];
  7662. __pyx_v_list_of_edges = values[3];
  7663. __pyx_v_ignore_duplicates = values[4];
  7664. }
  7665. goto __pyx_L4_argument_unpacking_done;
  7666. __pyx_L5_argtuple_error:;
  7667. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 856, __pyx_L3_error)
  7668. __pyx_L3_error:;
  7669. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7670. __Pyx_RefNannyFinishContext();
  7671. return NULL;
  7672. __pyx_L4_argument_unpacking_done:;
  7673. __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);
  7674. /* function exit code */
  7675. __Pyx_RefNannyFinishContext();
  7676. return __pyx_r;
  7677. }
  7678. 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) {
  7679. PyObject *__pyx_v_id = NULL;
  7680. PyObject *__pyx_v_node = NULL;
  7681. PyObject *__pyx_v_edge = NULL;
  7682. PyObject *__pyx_r = NULL;
  7683. __Pyx_RefNannyDeclarations
  7684. PyObject *__pyx_t_1 = NULL;
  7685. PyObject *__pyx_t_2 = NULL;
  7686. PyObject *__pyx_t_3 = NULL;
  7687. int __pyx_t_4;
  7688. PyObject *__pyx_t_5 = NULL;
  7689. Py_ssize_t __pyx_t_6;
  7690. PyObject *(*__pyx_t_7)(PyObject *);
  7691. PyObject *__pyx_t_8 = NULL;
  7692. PyObject *__pyx_t_9 = NULL;
  7693. PyObject *__pyx_t_10 = NULL;
  7694. PyObject *__pyx_t_11 = NULL;
  7695. __Pyx_RefNannySetupContext("add_random_graph", 0);
  7696. /* "gedlibpy.pyx":876
  7697. *
  7698. * """
  7699. * id = self.add_graph(name, classe) # <<<<<<<<<<<<<<
  7700. * for node in list_of_nodes:
  7701. * self.add_node(id, node[0], node[1])
  7702. */
  7703. __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)
  7704. __Pyx_GOTREF(__pyx_t_2);
  7705. __pyx_t_3 = NULL;
  7706. __pyx_t_4 = 0;
  7707. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  7708. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  7709. if (likely(__pyx_t_3)) {
  7710. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  7711. __Pyx_INCREF(__pyx_t_3);
  7712. __Pyx_INCREF(function);
  7713. __Pyx_DECREF_SET(__pyx_t_2, function);
  7714. __pyx_t_4 = 1;
  7715. }
  7716. }
  7717. #if CYTHON_FAST_PYCALL
  7718. if (PyFunction_Check(__pyx_t_2)) {
  7719. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7720. __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)
  7721. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7722. __Pyx_GOTREF(__pyx_t_1);
  7723. } else
  7724. #endif
  7725. #if CYTHON_FAST_PYCCALL
  7726. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  7727. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7728. __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)
  7729. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7730. __Pyx_GOTREF(__pyx_t_1);
  7731. } else
  7732. #endif
  7733. {
  7734. __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error)
  7735. __Pyx_GOTREF(__pyx_t_5);
  7736. if (__pyx_t_3) {
  7737. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  7738. }
  7739. __Pyx_INCREF(__pyx_v_name);
  7740. __Pyx_GIVEREF(__pyx_v_name);
  7741. PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  7742. __Pyx_INCREF(__pyx_v_classe);
  7743. __Pyx_GIVEREF(__pyx_v_classe);
  7744. PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_classe);
  7745. __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)
  7746. __Pyx_GOTREF(__pyx_t_1);
  7747. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7748. }
  7749. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7750. __pyx_v_id = __pyx_t_1;
  7751. __pyx_t_1 = 0;
  7752. /* "gedlibpy.pyx":877
  7753. * """
  7754. * id = self.add_graph(name, classe)
  7755. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7756. * self.add_node(id, node[0], node[1])
  7757. * for edge in list_of_edges:
  7758. */
  7759. if (likely(PyList_CheckExact(__pyx_v_list_of_nodes)) || PyTuple_CheckExact(__pyx_v_list_of_nodes)) {
  7760. __pyx_t_1 = __pyx_v_list_of_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7761. __pyx_t_7 = NULL;
  7762. } else {
  7763. __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)
  7764. __Pyx_GOTREF(__pyx_t_1);
  7765. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L1_error)
  7766. }
  7767. for (;;) {
  7768. if (likely(!__pyx_t_7)) {
  7769. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7770. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7771. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7772. __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)
  7773. #else
  7774. __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)
  7775. __Pyx_GOTREF(__pyx_t_2);
  7776. #endif
  7777. } else {
  7778. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7779. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7780. __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)
  7781. #else
  7782. __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)
  7783. __Pyx_GOTREF(__pyx_t_2);
  7784. #endif
  7785. }
  7786. } else {
  7787. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7788. if (unlikely(!__pyx_t_2)) {
  7789. PyObject* exc_type = PyErr_Occurred();
  7790. if (exc_type) {
  7791. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7792. else __PYX_ERR(0, 877, __pyx_L1_error)
  7793. }
  7794. break;
  7795. }
  7796. __Pyx_GOTREF(__pyx_t_2);
  7797. }
  7798. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_2);
  7799. __pyx_t_2 = 0;
  7800. /* "gedlibpy.pyx":878
  7801. * id = self.add_graph(name, classe)
  7802. * for node in list_of_nodes:
  7803. * self.add_node(id, node[0], node[1]) # <<<<<<<<<<<<<<
  7804. * for edge in list_of_edges:
  7805. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7806. */
  7807. __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)
  7808. __Pyx_GOTREF(__pyx_t_5);
  7809. __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)
  7810. __Pyx_GOTREF(__pyx_t_3);
  7811. __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)
  7812. __Pyx_GOTREF(__pyx_t_8);
  7813. __pyx_t_9 = NULL;
  7814. __pyx_t_4 = 0;
  7815. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7816. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7817. if (likely(__pyx_t_9)) {
  7818. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7819. __Pyx_INCREF(__pyx_t_9);
  7820. __Pyx_INCREF(function);
  7821. __Pyx_DECREF_SET(__pyx_t_5, function);
  7822. __pyx_t_4 = 1;
  7823. }
  7824. }
  7825. #if CYTHON_FAST_PYCALL
  7826. if (PyFunction_Check(__pyx_t_5)) {
  7827. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7828. __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)
  7829. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7830. __Pyx_GOTREF(__pyx_t_2);
  7831. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7832. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7833. } else
  7834. #endif
  7835. #if CYTHON_FAST_PYCCALL
  7836. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7837. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7838. __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)
  7839. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7840. __Pyx_GOTREF(__pyx_t_2);
  7841. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7842. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7843. } else
  7844. #endif
  7845. {
  7846. __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 878, __pyx_L1_error)
  7847. __Pyx_GOTREF(__pyx_t_10);
  7848. if (__pyx_t_9) {
  7849. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7850. }
  7851. __Pyx_INCREF(__pyx_v_id);
  7852. __Pyx_GIVEREF(__pyx_v_id);
  7853. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_id);
  7854. __Pyx_GIVEREF(__pyx_t_3);
  7855. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_3);
  7856. __Pyx_GIVEREF(__pyx_t_8);
  7857. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8);
  7858. __pyx_t_3 = 0;
  7859. __pyx_t_8 = 0;
  7860. __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)
  7861. __Pyx_GOTREF(__pyx_t_2);
  7862. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7863. }
  7864. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7865. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7866. /* "gedlibpy.pyx":877
  7867. * """
  7868. * id = self.add_graph(name, classe)
  7869. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7870. * self.add_node(id, node[0], node[1])
  7871. * for edge in list_of_edges:
  7872. */
  7873. }
  7874. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7875. /* "gedlibpy.pyx":879
  7876. * for node in list_of_nodes:
  7877. * self.add_node(id, node[0], node[1])
  7878. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  7879. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7880. * return id
  7881. */
  7882. if (likely(PyList_CheckExact(__pyx_v_list_of_edges)) || PyTuple_CheckExact(__pyx_v_list_of_edges)) {
  7883. __pyx_t_1 = __pyx_v_list_of_edges; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7884. __pyx_t_7 = NULL;
  7885. } else {
  7886. __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)
  7887. __Pyx_GOTREF(__pyx_t_1);
  7888. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error)
  7889. }
  7890. for (;;) {
  7891. if (likely(!__pyx_t_7)) {
  7892. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7893. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7894. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7895. __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)
  7896. #else
  7897. __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)
  7898. __Pyx_GOTREF(__pyx_t_2);
  7899. #endif
  7900. } else {
  7901. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7902. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7903. __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)
  7904. #else
  7905. __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)
  7906. __Pyx_GOTREF(__pyx_t_2);
  7907. #endif
  7908. }
  7909. } else {
  7910. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7911. if (unlikely(!__pyx_t_2)) {
  7912. PyObject* exc_type = PyErr_Occurred();
  7913. if (exc_type) {
  7914. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7915. else __PYX_ERR(0, 879, __pyx_L1_error)
  7916. }
  7917. break;
  7918. }
  7919. __Pyx_GOTREF(__pyx_t_2);
  7920. }
  7921. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  7922. __pyx_t_2 = 0;
  7923. /* "gedlibpy.pyx":880
  7924. * self.add_node(id, node[0], node[1])
  7925. * for edge in list_of_edges:
  7926. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) # <<<<<<<<<<<<<<
  7927. * return id
  7928. *
  7929. */
  7930. __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)
  7931. __Pyx_GOTREF(__pyx_t_5);
  7932. __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)
  7933. __Pyx_GOTREF(__pyx_t_10);
  7934. __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)
  7935. __Pyx_GOTREF(__pyx_t_8);
  7936. __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)
  7937. __Pyx_GOTREF(__pyx_t_3);
  7938. __pyx_t_9 = NULL;
  7939. __pyx_t_4 = 0;
  7940. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7941. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7942. if (likely(__pyx_t_9)) {
  7943. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7944. __Pyx_INCREF(__pyx_t_9);
  7945. __Pyx_INCREF(function);
  7946. __Pyx_DECREF_SET(__pyx_t_5, function);
  7947. __pyx_t_4 = 1;
  7948. }
  7949. }
  7950. #if CYTHON_FAST_PYCALL
  7951. if (PyFunction_Check(__pyx_t_5)) {
  7952. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7953. __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)
  7954. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7955. __Pyx_GOTREF(__pyx_t_2);
  7956. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7957. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7958. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7959. } else
  7960. #endif
  7961. #if CYTHON_FAST_PYCCALL
  7962. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7963. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7964. __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)
  7965. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7966. __Pyx_GOTREF(__pyx_t_2);
  7967. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7968. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7969. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7970. } else
  7971. #endif
  7972. {
  7973. __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 880, __pyx_L1_error)
  7974. __Pyx_GOTREF(__pyx_t_11);
  7975. if (__pyx_t_9) {
  7976. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7977. }
  7978. __Pyx_INCREF(__pyx_v_id);
  7979. __Pyx_GIVEREF(__pyx_v_id);
  7980. PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_id);
  7981. __Pyx_GIVEREF(__pyx_t_10);
  7982. PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
  7983. __Pyx_GIVEREF(__pyx_t_8);
  7984. PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_4, __pyx_t_8);
  7985. __Pyx_GIVEREF(__pyx_t_3);
  7986. PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_4, __pyx_t_3);
  7987. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  7988. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  7989. PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_4, __pyx_v_ignore_duplicates);
  7990. __pyx_t_10 = 0;
  7991. __pyx_t_8 = 0;
  7992. __pyx_t_3 = 0;
  7993. __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)
  7994. __Pyx_GOTREF(__pyx_t_2);
  7995. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  7996. }
  7997. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7998. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7999. /* "gedlibpy.pyx":879
  8000. * for node in list_of_nodes:
  8001. * self.add_node(id, node[0], node[1])
  8002. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  8003. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8004. * return id
  8005. */
  8006. }
  8007. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8008. /* "gedlibpy.pyx":881
  8009. * for edge in list_of_edges:
  8010. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8011. * return id # <<<<<<<<<<<<<<
  8012. *
  8013. *
  8014. */
  8015. __Pyx_XDECREF(__pyx_r);
  8016. __Pyx_INCREF(__pyx_v_id);
  8017. __pyx_r = __pyx_v_id;
  8018. goto __pyx_L0;
  8019. /* "gedlibpy.pyx":856
  8020. *
  8021. *
  8022. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8023. * """
  8024. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8025. */
  8026. /* function exit code */
  8027. __pyx_L1_error:;
  8028. __Pyx_XDECREF(__pyx_t_1);
  8029. __Pyx_XDECREF(__pyx_t_2);
  8030. __Pyx_XDECREF(__pyx_t_3);
  8031. __Pyx_XDECREF(__pyx_t_5);
  8032. __Pyx_XDECREF(__pyx_t_8);
  8033. __Pyx_XDECREF(__pyx_t_9);
  8034. __Pyx_XDECREF(__pyx_t_10);
  8035. __Pyx_XDECREF(__pyx_t_11);
  8036. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8037. __pyx_r = NULL;
  8038. __pyx_L0:;
  8039. __Pyx_XDECREF(__pyx_v_id);
  8040. __Pyx_XDECREF(__pyx_v_node);
  8041. __Pyx_XDECREF(__pyx_v_edge);
  8042. __Pyx_XGIVEREF(__pyx_r);
  8043. __Pyx_RefNannyFinishContext();
  8044. return __pyx_r;
  8045. }
  8046. /* "gedlibpy.pyx":884
  8047. *
  8048. *
  8049. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8050. * """
  8051. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8052. */
  8053. /* Python wrapper */
  8054. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8055. 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";
  8056. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8057. PyObject *__pyx_v_g = 0;
  8058. PyObject *__pyx_v_classe = 0;
  8059. PyObject *__pyx_v_ignore_duplicates = 0;
  8060. PyObject *__pyx_r = 0;
  8061. __Pyx_RefNannyDeclarations
  8062. __Pyx_RefNannySetupContext("add_nx_graph (wrapper)", 0);
  8063. {
  8064. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_classe,&__pyx_n_s_ignore_duplicates,0};
  8065. PyObject* values[3] = {0,0,0};
  8066. values[2] = ((PyObject *)Py_True);
  8067. if (unlikely(__pyx_kwds)) {
  8068. Py_ssize_t kw_args;
  8069. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8070. switch (pos_args) {
  8071. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8072. CYTHON_FALLTHROUGH;
  8073. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8074. CYTHON_FALLTHROUGH;
  8075. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8076. CYTHON_FALLTHROUGH;
  8077. case 0: break;
  8078. default: goto __pyx_L5_argtuple_error;
  8079. }
  8080. kw_args = PyDict_Size(__pyx_kwds);
  8081. switch (pos_args) {
  8082. case 0:
  8083. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  8084. else goto __pyx_L5_argtuple_error;
  8085. CYTHON_FALLTHROUGH;
  8086. case 1:
  8087. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  8088. else {
  8089. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 884, __pyx_L3_error)
  8090. }
  8091. CYTHON_FALLTHROUGH;
  8092. case 2:
  8093. if (kw_args > 0) {
  8094. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  8095. if (value) { values[2] = value; kw_args--; }
  8096. }
  8097. }
  8098. if (unlikely(kw_args > 0)) {
  8099. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
  8100. }
  8101. } else {
  8102. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8103. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8104. CYTHON_FALLTHROUGH;
  8105. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8106. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8107. break;
  8108. default: goto __pyx_L5_argtuple_error;
  8109. }
  8110. }
  8111. __pyx_v_g = values[0];
  8112. __pyx_v_classe = values[1];
  8113. __pyx_v_ignore_duplicates = values[2];
  8114. }
  8115. goto __pyx_L4_argument_unpacking_done;
  8116. __pyx_L5_argtuple_error:;
  8117. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
  8118. __pyx_L3_error:;
  8119. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8120. __Pyx_RefNannyFinishContext();
  8121. return NULL;
  8122. __pyx_L4_argument_unpacking_done:;
  8123. __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);
  8124. /* function exit code */
  8125. __Pyx_RefNannyFinishContext();
  8126. return __pyx_r;
  8127. }
  8128. 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) {
  8129. PyObject *__pyx_v_id = NULL;
  8130. PyObject *__pyx_v_node = NULL;
  8131. PyObject *__pyx_v_edge = NULL;
  8132. PyObject *__pyx_r = NULL;
  8133. __Pyx_RefNannyDeclarations
  8134. PyObject *__pyx_t_1 = NULL;
  8135. PyObject *__pyx_t_2 = NULL;
  8136. PyObject *__pyx_t_3 = NULL;
  8137. PyObject *__pyx_t_4 = NULL;
  8138. int __pyx_t_5;
  8139. PyObject *__pyx_t_6 = NULL;
  8140. Py_ssize_t __pyx_t_7;
  8141. PyObject *(*__pyx_t_8)(PyObject *);
  8142. PyObject *__pyx_t_9 = NULL;
  8143. PyObject *__pyx_t_10 = NULL;
  8144. PyObject *__pyx_t_11 = NULL;
  8145. PyObject *__pyx_t_12 = NULL;
  8146. PyObject *__pyx_t_13 = NULL;
  8147. PyObject *__pyx_t_14 = NULL;
  8148. __Pyx_RefNannySetupContext("add_nx_graph", 0);
  8149. /* "gedlibpy.pyx":898
  8150. *
  8151. * """
  8152. * id = self.add_graph(g.name, classe) # <<<<<<<<<<<<<<
  8153. * for node in g.nodes:
  8154. * self.add_node(id, str(node), g.nodes[node])
  8155. */
  8156. __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)
  8157. __Pyx_GOTREF(__pyx_t_2);
  8158. __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)
  8159. __Pyx_GOTREF(__pyx_t_3);
  8160. __pyx_t_4 = NULL;
  8161. __pyx_t_5 = 0;
  8162. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8163. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
  8164. if (likely(__pyx_t_4)) {
  8165. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8166. __Pyx_INCREF(__pyx_t_4);
  8167. __Pyx_INCREF(function);
  8168. __Pyx_DECREF_SET(__pyx_t_2, function);
  8169. __pyx_t_5 = 1;
  8170. }
  8171. }
  8172. #if CYTHON_FAST_PYCALL
  8173. if (PyFunction_Check(__pyx_t_2)) {
  8174. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8175. __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)
  8176. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8177. __Pyx_GOTREF(__pyx_t_1);
  8178. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8179. } else
  8180. #endif
  8181. #if CYTHON_FAST_PYCCALL
  8182. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8183. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8184. __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)
  8185. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8186. __Pyx_GOTREF(__pyx_t_1);
  8187. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8188. } else
  8189. #endif
  8190. {
  8191. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error)
  8192. __Pyx_GOTREF(__pyx_t_6);
  8193. if (__pyx_t_4) {
  8194. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8195. }
  8196. __Pyx_GIVEREF(__pyx_t_3);
  8197. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
  8198. __Pyx_INCREF(__pyx_v_classe);
  8199. __Pyx_GIVEREF(__pyx_v_classe);
  8200. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_classe);
  8201. __pyx_t_3 = 0;
  8202. __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)
  8203. __Pyx_GOTREF(__pyx_t_1);
  8204. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8205. }
  8206. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8207. __pyx_v_id = __pyx_t_1;
  8208. __pyx_t_1 = 0;
  8209. /* "gedlibpy.pyx":899
  8210. * """
  8211. * id = self.add_graph(g.name, classe)
  8212. * for node in g.nodes: # <<<<<<<<<<<<<<
  8213. * self.add_node(id, str(node), g.nodes[node])
  8214. * for edge in g.edges:
  8215. */
  8216. __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)
  8217. __Pyx_GOTREF(__pyx_t_1);
  8218. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  8219. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
  8220. __pyx_t_8 = NULL;
  8221. } else {
  8222. __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
  8223. __Pyx_GOTREF(__pyx_t_2);
  8224. __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error)
  8225. }
  8226. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8227. for (;;) {
  8228. if (likely(!__pyx_t_8)) {
  8229. if (likely(PyList_CheckExact(__pyx_t_2))) {
  8230. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
  8231. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8232. __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)
  8233. #else
  8234. __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)
  8235. __Pyx_GOTREF(__pyx_t_1);
  8236. #endif
  8237. } else {
  8238. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  8239. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8240. __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)
  8241. #else
  8242. __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)
  8243. __Pyx_GOTREF(__pyx_t_1);
  8244. #endif
  8245. }
  8246. } else {
  8247. __pyx_t_1 = __pyx_t_8(__pyx_t_2);
  8248. if (unlikely(!__pyx_t_1)) {
  8249. PyObject* exc_type = PyErr_Occurred();
  8250. if (exc_type) {
  8251. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8252. else __PYX_ERR(0, 899, __pyx_L1_error)
  8253. }
  8254. break;
  8255. }
  8256. __Pyx_GOTREF(__pyx_t_1);
  8257. }
  8258. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
  8259. __pyx_t_1 = 0;
  8260. /* "gedlibpy.pyx":900
  8261. * id = self.add_graph(g.name, classe)
  8262. * for node in g.nodes:
  8263. * self.add_node(id, str(node), g.nodes[node]) # <<<<<<<<<<<<<<
  8264. * for edge in g.edges:
  8265. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8266. */
  8267. __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)
  8268. __Pyx_GOTREF(__pyx_t_6);
  8269. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L1_error)
  8270. __Pyx_GOTREF(__pyx_t_3);
  8271. __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)
  8272. __Pyx_GOTREF(__pyx_t_4);
  8273. __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L1_error)
  8274. __Pyx_GOTREF(__pyx_t_9);
  8275. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8276. __pyx_t_4 = NULL;
  8277. __pyx_t_5 = 0;
  8278. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8279. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8280. if (likely(__pyx_t_4)) {
  8281. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8282. __Pyx_INCREF(__pyx_t_4);
  8283. __Pyx_INCREF(function);
  8284. __Pyx_DECREF_SET(__pyx_t_6, function);
  8285. __pyx_t_5 = 1;
  8286. }
  8287. }
  8288. #if CYTHON_FAST_PYCALL
  8289. if (PyFunction_Check(__pyx_t_6)) {
  8290. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8291. __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)
  8292. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8293. __Pyx_GOTREF(__pyx_t_1);
  8294. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8295. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8296. } else
  8297. #endif
  8298. #if CYTHON_FAST_PYCCALL
  8299. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8300. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8301. __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)
  8302. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8303. __Pyx_GOTREF(__pyx_t_1);
  8304. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8305. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8306. } else
  8307. #endif
  8308. {
  8309. __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 900, __pyx_L1_error)
  8310. __Pyx_GOTREF(__pyx_t_10);
  8311. if (__pyx_t_4) {
  8312. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8313. }
  8314. __Pyx_INCREF(__pyx_v_id);
  8315. __Pyx_GIVEREF(__pyx_v_id);
  8316. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_id);
  8317. __Pyx_GIVEREF(__pyx_t_3);
  8318. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_3);
  8319. __Pyx_GIVEREF(__pyx_t_9);
  8320. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_9);
  8321. __pyx_t_3 = 0;
  8322. __pyx_t_9 = 0;
  8323. __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)
  8324. __Pyx_GOTREF(__pyx_t_1);
  8325. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8326. }
  8327. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8328. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8329. /* "gedlibpy.pyx":899
  8330. * """
  8331. * id = self.add_graph(g.name, classe)
  8332. * for node in g.nodes: # <<<<<<<<<<<<<<
  8333. * self.add_node(id, str(node), g.nodes[node])
  8334. * for edge in g.edges:
  8335. */
  8336. }
  8337. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8338. /* "gedlibpy.pyx":901
  8339. * for node in g.nodes:
  8340. * self.add_node(id, str(node), g.nodes[node])
  8341. * for edge in g.edges: # <<<<<<<<<<<<<<
  8342. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8343. * return id
  8344. */
  8345. __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)
  8346. __Pyx_GOTREF(__pyx_t_2);
  8347. if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
  8348. __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
  8349. __pyx_t_8 = NULL;
  8350. } else {
  8351. __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  8352. __Pyx_GOTREF(__pyx_t_1);
  8353. __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
  8354. }
  8355. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8356. for (;;) {
  8357. if (likely(!__pyx_t_8)) {
  8358. if (likely(PyList_CheckExact(__pyx_t_1))) {
  8359. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
  8360. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8361. __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)
  8362. #else
  8363. __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)
  8364. __Pyx_GOTREF(__pyx_t_2);
  8365. #endif
  8366. } else {
  8367. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  8368. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8369. __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)
  8370. #else
  8371. __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)
  8372. __Pyx_GOTREF(__pyx_t_2);
  8373. #endif
  8374. }
  8375. } else {
  8376. __pyx_t_2 = __pyx_t_8(__pyx_t_1);
  8377. if (unlikely(!__pyx_t_2)) {
  8378. PyObject* exc_type = PyErr_Occurred();
  8379. if (exc_type) {
  8380. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8381. else __PYX_ERR(0, 901, __pyx_L1_error)
  8382. }
  8383. break;
  8384. }
  8385. __Pyx_GOTREF(__pyx_t_2);
  8386. }
  8387. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  8388. __pyx_t_2 = 0;
  8389. /* "gedlibpy.pyx":902
  8390. * self.add_node(id, str(node), g.nodes[node])
  8391. * for edge in g.edges:
  8392. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) # <<<<<<<<<<<<<<
  8393. * return id
  8394. *
  8395. */
  8396. __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)
  8397. __Pyx_GOTREF(__pyx_t_6);
  8398. __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)
  8399. __Pyx_GOTREF(__pyx_t_10);
  8400. __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 902, __pyx_L1_error)
  8401. __Pyx_GOTREF(__pyx_t_9);
  8402. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8403. __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)
  8404. __Pyx_GOTREF(__pyx_t_10);
  8405. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
  8406. __Pyx_GOTREF(__pyx_t_3);
  8407. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8408. __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)
  8409. __Pyx_GOTREF(__pyx_t_4);
  8410. __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)
  8411. __Pyx_GOTREF(__pyx_t_11);
  8412. __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)
  8413. __Pyx_GOTREF(__pyx_t_12);
  8414. __pyx_t_13 = NULL;
  8415. __pyx_t_5 = 0;
  8416. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  8417. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
  8418. if (likely(__pyx_t_13)) {
  8419. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  8420. __Pyx_INCREF(__pyx_t_13);
  8421. __Pyx_INCREF(function);
  8422. __Pyx_DECREF_SET(__pyx_t_4, function);
  8423. __pyx_t_5 = 1;
  8424. }
  8425. }
  8426. #if CYTHON_FAST_PYCALL
  8427. if (PyFunction_Check(__pyx_t_4)) {
  8428. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8429. __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)
  8430. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8431. __Pyx_GOTREF(__pyx_t_10);
  8432. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8433. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8434. } else
  8435. #endif
  8436. #if CYTHON_FAST_PYCCALL
  8437. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  8438. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8439. __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)
  8440. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8441. __Pyx_GOTREF(__pyx_t_10);
  8442. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8443. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8444. } else
  8445. #endif
  8446. {
  8447. __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error)
  8448. __Pyx_GOTREF(__pyx_t_14);
  8449. if (__pyx_t_13) {
  8450. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
  8451. }
  8452. __Pyx_GIVEREF(__pyx_t_11);
  8453. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_t_11);
  8454. __Pyx_GIVEREF(__pyx_t_12);
  8455. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_12);
  8456. __pyx_t_11 = 0;
  8457. __pyx_t_12 = 0;
  8458. __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)
  8459. __Pyx_GOTREF(__pyx_t_10);
  8460. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8461. }
  8462. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8463. __pyx_t_4 = NULL;
  8464. __pyx_t_5 = 0;
  8465. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8466. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8467. if (likely(__pyx_t_4)) {
  8468. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8469. __Pyx_INCREF(__pyx_t_4);
  8470. __Pyx_INCREF(function);
  8471. __Pyx_DECREF_SET(__pyx_t_6, function);
  8472. __pyx_t_5 = 1;
  8473. }
  8474. }
  8475. #if CYTHON_FAST_PYCALL
  8476. if (PyFunction_Check(__pyx_t_6)) {
  8477. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8478. __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)
  8479. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8480. __Pyx_GOTREF(__pyx_t_2);
  8481. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8482. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8483. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8484. } else
  8485. #endif
  8486. #if CYTHON_FAST_PYCCALL
  8487. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8488. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8489. __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)
  8490. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8491. __Pyx_GOTREF(__pyx_t_2);
  8492. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8493. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8494. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8495. } else
  8496. #endif
  8497. {
  8498. __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error)
  8499. __Pyx_GOTREF(__pyx_t_14);
  8500. if (__pyx_t_4) {
  8501. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8502. }
  8503. __Pyx_INCREF(__pyx_v_id);
  8504. __Pyx_GIVEREF(__pyx_v_id);
  8505. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_v_id);
  8506. __Pyx_GIVEREF(__pyx_t_9);
  8507. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_9);
  8508. __Pyx_GIVEREF(__pyx_t_3);
  8509. PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_5, __pyx_t_3);
  8510. __Pyx_GIVEREF(__pyx_t_10);
  8511. PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_5, __pyx_t_10);
  8512. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8513. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8514. PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_5, __pyx_v_ignore_duplicates);
  8515. __pyx_t_9 = 0;
  8516. __pyx_t_3 = 0;
  8517. __pyx_t_10 = 0;
  8518. __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)
  8519. __Pyx_GOTREF(__pyx_t_2);
  8520. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8521. }
  8522. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8523. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8524. /* "gedlibpy.pyx":901
  8525. * for node in g.nodes:
  8526. * self.add_node(id, str(node), g.nodes[node])
  8527. * for edge in g.edges: # <<<<<<<<<<<<<<
  8528. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8529. * return id
  8530. */
  8531. }
  8532. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8533. /* "gedlibpy.pyx":903
  8534. * for edge in g.edges:
  8535. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8536. * return id # <<<<<<<<<<<<<<
  8537. *
  8538. *
  8539. */
  8540. __Pyx_XDECREF(__pyx_r);
  8541. __Pyx_INCREF(__pyx_v_id);
  8542. __pyx_r = __pyx_v_id;
  8543. goto __pyx_L0;
  8544. /* "gedlibpy.pyx":884
  8545. *
  8546. *
  8547. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8548. * """
  8549. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8550. */
  8551. /* function exit code */
  8552. __pyx_L1_error:;
  8553. __Pyx_XDECREF(__pyx_t_1);
  8554. __Pyx_XDECREF(__pyx_t_2);
  8555. __Pyx_XDECREF(__pyx_t_3);
  8556. __Pyx_XDECREF(__pyx_t_4);
  8557. __Pyx_XDECREF(__pyx_t_6);
  8558. __Pyx_XDECREF(__pyx_t_9);
  8559. __Pyx_XDECREF(__pyx_t_10);
  8560. __Pyx_XDECREF(__pyx_t_11);
  8561. __Pyx_XDECREF(__pyx_t_12);
  8562. __Pyx_XDECREF(__pyx_t_13);
  8563. __Pyx_XDECREF(__pyx_t_14);
  8564. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8565. __pyx_r = NULL;
  8566. __pyx_L0:;
  8567. __Pyx_XDECREF(__pyx_v_id);
  8568. __Pyx_XDECREF(__pyx_v_node);
  8569. __Pyx_XDECREF(__pyx_v_edge);
  8570. __Pyx_XGIVEREF(__pyx_r);
  8571. __Pyx_RefNannyFinishContext();
  8572. return __pyx_r;
  8573. }
  8574. /* "gedlibpy.pyx":906
  8575. *
  8576. *
  8577. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8578. * """
  8579. * Computes the edit distance between two NX graphs.
  8580. */
  8581. /* Python wrapper */
  8582. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8583. 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";
  8584. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8585. PyObject *__pyx_v_g1 = 0;
  8586. PyObject *__pyx_v_g2 = 0;
  8587. PyObject *__pyx_v_edit_cost = 0;
  8588. PyObject *__pyx_v_method = 0;
  8589. PyObject *__pyx_v_options = 0;
  8590. PyObject *__pyx_v_init_option = 0;
  8591. PyObject *__pyx_r = 0;
  8592. __Pyx_RefNannyDeclarations
  8593. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs (wrapper)", 0);
  8594. {
  8595. 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};
  8596. PyObject* values[6] = {0,0,0,0,0,0};
  8597. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  8598. if (unlikely(__pyx_kwds)) {
  8599. Py_ssize_t kw_args;
  8600. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8601. switch (pos_args) {
  8602. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8603. CYTHON_FALLTHROUGH;
  8604. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8605. CYTHON_FALLTHROUGH;
  8606. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8607. CYTHON_FALLTHROUGH;
  8608. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8609. CYTHON_FALLTHROUGH;
  8610. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8611. CYTHON_FALLTHROUGH;
  8612. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8613. CYTHON_FALLTHROUGH;
  8614. case 0: break;
  8615. default: goto __pyx_L5_argtuple_error;
  8616. }
  8617. kw_args = PyDict_Size(__pyx_kwds);
  8618. switch (pos_args) {
  8619. case 0:
  8620. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g1)) != 0)) kw_args--;
  8621. else goto __pyx_L5_argtuple_error;
  8622. CYTHON_FALLTHROUGH;
  8623. case 1:
  8624. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g2)) != 0)) kw_args--;
  8625. else {
  8626. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 906, __pyx_L3_error)
  8627. }
  8628. CYTHON_FALLTHROUGH;
  8629. case 2:
  8630. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  8631. else {
  8632. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 906, __pyx_L3_error)
  8633. }
  8634. CYTHON_FALLTHROUGH;
  8635. case 3:
  8636. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  8637. else {
  8638. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 906, __pyx_L3_error)
  8639. }
  8640. CYTHON_FALLTHROUGH;
  8641. case 4:
  8642. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  8643. else {
  8644. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 906, __pyx_L3_error)
  8645. }
  8646. CYTHON_FALLTHROUGH;
  8647. case 5:
  8648. if (kw_args > 0) {
  8649. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  8650. if (value) { values[5] = value; kw_args--; }
  8651. }
  8652. }
  8653. if (unlikely(kw_args > 0)) {
  8654. 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)
  8655. }
  8656. } else {
  8657. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8658. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8659. CYTHON_FALLTHROUGH;
  8660. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8661. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8662. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8663. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8664. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8665. break;
  8666. default: goto __pyx_L5_argtuple_error;
  8667. }
  8668. }
  8669. __pyx_v_g1 = values[0];
  8670. __pyx_v_g2 = values[1];
  8671. __pyx_v_edit_cost = values[2];
  8672. __pyx_v_method = values[3];
  8673. __pyx_v_options = values[4];
  8674. __pyx_v_init_option = values[5];
  8675. }
  8676. goto __pyx_L4_argument_unpacking_done;
  8677. __pyx_L5_argtuple_error:;
  8678. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
  8679. __pyx_L3_error:;
  8680. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8681. __Pyx_RefNannyFinishContext();
  8682. return NULL;
  8683. __pyx_L4_argument_unpacking_done:;
  8684. __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);
  8685. /* function exit code */
  8686. __Pyx_RefNannyFinishContext();
  8687. return __pyx_r;
  8688. }
  8689. 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) {
  8690. PyObject *__pyx_v_g = NULL;
  8691. PyObject *__pyx_v_h = NULL;
  8692. PyObject *__pyx_v_resDistance = NULL;
  8693. PyObject *__pyx_v_resMapping = NULL;
  8694. PyObject *__pyx_r = NULL;
  8695. __Pyx_RefNannyDeclarations
  8696. PyObject *__pyx_t_1 = NULL;
  8697. PyObject *__pyx_t_2 = NULL;
  8698. PyObject *__pyx_t_3 = NULL;
  8699. int __pyx_t_4;
  8700. int __pyx_t_5;
  8701. PyObject *__pyx_t_6 = NULL;
  8702. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs", 0);
  8703. /* "gedlibpy.pyx":929
  8704. *
  8705. * """
  8706. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8707. * self.restart_env()
  8708. *
  8709. */
  8710. __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)
  8711. __Pyx_GOTREF(__pyx_t_2);
  8712. __pyx_t_3 = NULL;
  8713. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8714. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8715. if (likely(__pyx_t_3)) {
  8716. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8717. __Pyx_INCREF(__pyx_t_3);
  8718. __Pyx_INCREF(function);
  8719. __Pyx_DECREF_SET(__pyx_t_2, function);
  8720. }
  8721. }
  8722. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8723. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8724. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
  8725. __Pyx_GOTREF(__pyx_t_1);
  8726. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8727. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 929, __pyx_L1_error)
  8728. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8729. if (__pyx_t_4) {
  8730. /* "gedlibpy.pyx":930
  8731. * """
  8732. * if self.is_initialized() :
  8733. * self.restart_env() # <<<<<<<<<<<<<<
  8734. *
  8735. * g = self.add_nx_graph(g1, "")
  8736. */
  8737. __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)
  8738. __Pyx_GOTREF(__pyx_t_2);
  8739. __pyx_t_3 = NULL;
  8740. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8741. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8742. if (likely(__pyx_t_3)) {
  8743. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8744. __Pyx_INCREF(__pyx_t_3);
  8745. __Pyx_INCREF(function);
  8746. __Pyx_DECREF_SET(__pyx_t_2, function);
  8747. }
  8748. }
  8749. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8750. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8751. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
  8752. __Pyx_GOTREF(__pyx_t_1);
  8753. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8754. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8755. /* "gedlibpy.pyx":929
  8756. *
  8757. * """
  8758. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8759. * self.restart_env()
  8760. *
  8761. */
  8762. }
  8763. /* "gedlibpy.pyx":932
  8764. * self.restart_env()
  8765. *
  8766. * g = self.add_nx_graph(g1, "") # <<<<<<<<<<<<<<
  8767. * h = self.add_nx_graph(g2, "")
  8768. *
  8769. */
  8770. __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)
  8771. __Pyx_GOTREF(__pyx_t_2);
  8772. __pyx_t_3 = NULL;
  8773. __pyx_t_5 = 0;
  8774. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8775. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8776. if (likely(__pyx_t_3)) {
  8777. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8778. __Pyx_INCREF(__pyx_t_3);
  8779. __Pyx_INCREF(function);
  8780. __Pyx_DECREF_SET(__pyx_t_2, function);
  8781. __pyx_t_5 = 1;
  8782. }
  8783. }
  8784. #if CYTHON_FAST_PYCALL
  8785. if (PyFunction_Check(__pyx_t_2)) {
  8786. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8787. __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)
  8788. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8789. __Pyx_GOTREF(__pyx_t_1);
  8790. } else
  8791. #endif
  8792. #if CYTHON_FAST_PYCCALL
  8793. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8794. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8795. __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)
  8796. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8797. __Pyx_GOTREF(__pyx_t_1);
  8798. } else
  8799. #endif
  8800. {
  8801. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L1_error)
  8802. __Pyx_GOTREF(__pyx_t_6);
  8803. if (__pyx_t_3) {
  8804. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8805. }
  8806. __Pyx_INCREF(__pyx_v_g1);
  8807. __Pyx_GIVEREF(__pyx_v_g1);
  8808. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g1);
  8809. __Pyx_INCREF(__pyx_kp_u_);
  8810. __Pyx_GIVEREF(__pyx_kp_u_);
  8811. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_u_);
  8812. __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)
  8813. __Pyx_GOTREF(__pyx_t_1);
  8814. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8815. }
  8816. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8817. __pyx_v_g = __pyx_t_1;
  8818. __pyx_t_1 = 0;
  8819. /* "gedlibpy.pyx":933
  8820. *
  8821. * g = self.add_nx_graph(g1, "")
  8822. * h = self.add_nx_graph(g2, "") # <<<<<<<<<<<<<<
  8823. *
  8824. * self.set_edit_cost(edit_cost)
  8825. */
  8826. __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)
  8827. __Pyx_GOTREF(__pyx_t_2);
  8828. __pyx_t_6 = NULL;
  8829. __pyx_t_5 = 0;
  8830. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8831. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8832. if (likely(__pyx_t_6)) {
  8833. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8834. __Pyx_INCREF(__pyx_t_6);
  8835. __Pyx_INCREF(function);
  8836. __Pyx_DECREF_SET(__pyx_t_2, function);
  8837. __pyx_t_5 = 1;
  8838. }
  8839. }
  8840. #if CYTHON_FAST_PYCALL
  8841. if (PyFunction_Check(__pyx_t_2)) {
  8842. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8843. __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)
  8844. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8845. __Pyx_GOTREF(__pyx_t_1);
  8846. } else
  8847. #endif
  8848. #if CYTHON_FAST_PYCCALL
  8849. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8850. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8851. __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)
  8852. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8853. __Pyx_GOTREF(__pyx_t_1);
  8854. } else
  8855. #endif
  8856. {
  8857. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
  8858. __Pyx_GOTREF(__pyx_t_3);
  8859. if (__pyx_t_6) {
  8860. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8861. }
  8862. __Pyx_INCREF(__pyx_v_g2);
  8863. __Pyx_GIVEREF(__pyx_v_g2);
  8864. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g2);
  8865. __Pyx_INCREF(__pyx_kp_u_);
  8866. __Pyx_GIVEREF(__pyx_kp_u_);
  8867. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_);
  8868. __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)
  8869. __Pyx_GOTREF(__pyx_t_1);
  8870. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8871. }
  8872. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8873. __pyx_v_h = __pyx_t_1;
  8874. __pyx_t_1 = 0;
  8875. /* "gedlibpy.pyx":935
  8876. * h = self.add_nx_graph(g2, "")
  8877. *
  8878. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  8879. * self.init(init_option)
  8880. *
  8881. */
  8882. __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)
  8883. __Pyx_GOTREF(__pyx_t_2);
  8884. __pyx_t_3 = NULL;
  8885. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8886. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8887. if (likely(__pyx_t_3)) {
  8888. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8889. __Pyx_INCREF(__pyx_t_3);
  8890. __Pyx_INCREF(function);
  8891. __Pyx_DECREF_SET(__pyx_t_2, function);
  8892. }
  8893. }
  8894. __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);
  8895. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8896. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
  8897. __Pyx_GOTREF(__pyx_t_1);
  8898. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8899. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8900. /* "gedlibpy.pyx":936
  8901. *
  8902. * self.set_edit_cost(edit_cost)
  8903. * self.init(init_option) # <<<<<<<<<<<<<<
  8904. *
  8905. * self.set_method(method, options)
  8906. */
  8907. __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)
  8908. __Pyx_GOTREF(__pyx_t_2);
  8909. __pyx_t_3 = NULL;
  8910. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8911. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8912. if (likely(__pyx_t_3)) {
  8913. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8914. __Pyx_INCREF(__pyx_t_3);
  8915. __Pyx_INCREF(function);
  8916. __Pyx_DECREF_SET(__pyx_t_2, function);
  8917. }
  8918. }
  8919. __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);
  8920. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8921. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
  8922. __Pyx_GOTREF(__pyx_t_1);
  8923. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8924. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8925. /* "gedlibpy.pyx":938
  8926. * self.init(init_option)
  8927. *
  8928. * self.set_method(method, options) # <<<<<<<<<<<<<<
  8929. * self.init_method()
  8930. *
  8931. */
  8932. __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)
  8933. __Pyx_GOTREF(__pyx_t_2);
  8934. __pyx_t_3 = NULL;
  8935. __pyx_t_5 = 0;
  8936. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8937. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8938. if (likely(__pyx_t_3)) {
  8939. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8940. __Pyx_INCREF(__pyx_t_3);
  8941. __Pyx_INCREF(function);
  8942. __Pyx_DECREF_SET(__pyx_t_2, function);
  8943. __pyx_t_5 = 1;
  8944. }
  8945. }
  8946. #if CYTHON_FAST_PYCALL
  8947. if (PyFunction_Check(__pyx_t_2)) {
  8948. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8949. __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)
  8950. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8951. __Pyx_GOTREF(__pyx_t_1);
  8952. } else
  8953. #endif
  8954. #if CYTHON_FAST_PYCCALL
  8955. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8956. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8957. __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)
  8958. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8959. __Pyx_GOTREF(__pyx_t_1);
  8960. } else
  8961. #endif
  8962. {
  8963. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
  8964. __Pyx_GOTREF(__pyx_t_6);
  8965. if (__pyx_t_3) {
  8966. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8967. }
  8968. __Pyx_INCREF(__pyx_v_method);
  8969. __Pyx_GIVEREF(__pyx_v_method);
  8970. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
  8971. __Pyx_INCREF(__pyx_v_options);
  8972. __Pyx_GIVEREF(__pyx_v_options);
  8973. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_options);
  8974. __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)
  8975. __Pyx_GOTREF(__pyx_t_1);
  8976. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8977. }
  8978. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8979. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8980. /* "gedlibpy.pyx":939
  8981. *
  8982. * self.set_method(method, options)
  8983. * self.init_method() # <<<<<<<<<<<<<<
  8984. *
  8985. * resDistance = 0
  8986. */
  8987. __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)
  8988. __Pyx_GOTREF(__pyx_t_2);
  8989. __pyx_t_6 = NULL;
  8990. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8991. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8992. if (likely(__pyx_t_6)) {
  8993. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8994. __Pyx_INCREF(__pyx_t_6);
  8995. __Pyx_INCREF(function);
  8996. __Pyx_DECREF_SET(__pyx_t_2, function);
  8997. }
  8998. }
  8999. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9000. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9001. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L1_error)
  9002. __Pyx_GOTREF(__pyx_t_1);
  9003. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9004. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9005. /* "gedlibpy.pyx":941
  9006. * self.init_method()
  9007. *
  9008. * resDistance = 0 # <<<<<<<<<<<<<<
  9009. * resMapping = []
  9010. * self.run_method(g, h)
  9011. */
  9012. __Pyx_INCREF(__pyx_int_0);
  9013. __pyx_v_resDistance = __pyx_int_0;
  9014. /* "gedlibpy.pyx":942
  9015. *
  9016. * resDistance = 0
  9017. * resMapping = [] # <<<<<<<<<<<<<<
  9018. * self.run_method(g, h)
  9019. * resDistance = self.get_upper_bound(g, h)
  9020. */
  9021. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error)
  9022. __Pyx_GOTREF(__pyx_t_1);
  9023. __pyx_v_resMapping = __pyx_t_1;
  9024. __pyx_t_1 = 0;
  9025. /* "gedlibpy.pyx":943
  9026. * resDistance = 0
  9027. * resMapping = []
  9028. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9029. * resDistance = self.get_upper_bound(g, h)
  9030. * resMapping = self.get_node_map(g, h)
  9031. */
  9032. __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)
  9033. __Pyx_GOTREF(__pyx_t_2);
  9034. __pyx_t_6 = NULL;
  9035. __pyx_t_5 = 0;
  9036. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9037. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9038. if (likely(__pyx_t_6)) {
  9039. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9040. __Pyx_INCREF(__pyx_t_6);
  9041. __Pyx_INCREF(function);
  9042. __Pyx_DECREF_SET(__pyx_t_2, function);
  9043. __pyx_t_5 = 1;
  9044. }
  9045. }
  9046. #if CYTHON_FAST_PYCALL
  9047. if (PyFunction_Check(__pyx_t_2)) {
  9048. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9049. __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)
  9050. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9051. __Pyx_GOTREF(__pyx_t_1);
  9052. } else
  9053. #endif
  9054. #if CYTHON_FAST_PYCCALL
  9055. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9056. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9057. __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)
  9058. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9059. __Pyx_GOTREF(__pyx_t_1);
  9060. } else
  9061. #endif
  9062. {
  9063. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
  9064. __Pyx_GOTREF(__pyx_t_3);
  9065. if (__pyx_t_6) {
  9066. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9067. }
  9068. __Pyx_INCREF(__pyx_v_g);
  9069. __Pyx_GIVEREF(__pyx_v_g);
  9070. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9071. __Pyx_INCREF(__pyx_v_h);
  9072. __Pyx_GIVEREF(__pyx_v_h);
  9073. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9074. __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)
  9075. __Pyx_GOTREF(__pyx_t_1);
  9076. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9077. }
  9078. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9079. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9080. /* "gedlibpy.pyx":944
  9081. * resMapping = []
  9082. * self.run_method(g, h)
  9083. * resDistance = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  9084. * resMapping = self.get_node_map(g, h)
  9085. *
  9086. */
  9087. __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)
  9088. __Pyx_GOTREF(__pyx_t_2);
  9089. __pyx_t_3 = NULL;
  9090. __pyx_t_5 = 0;
  9091. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9092. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9093. if (likely(__pyx_t_3)) {
  9094. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9095. __Pyx_INCREF(__pyx_t_3);
  9096. __Pyx_INCREF(function);
  9097. __Pyx_DECREF_SET(__pyx_t_2, function);
  9098. __pyx_t_5 = 1;
  9099. }
  9100. }
  9101. #if CYTHON_FAST_PYCALL
  9102. if (PyFunction_Check(__pyx_t_2)) {
  9103. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9104. __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)
  9105. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9106. __Pyx_GOTREF(__pyx_t_1);
  9107. } else
  9108. #endif
  9109. #if CYTHON_FAST_PYCCALL
  9110. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9111. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9112. __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)
  9113. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9114. __Pyx_GOTREF(__pyx_t_1);
  9115. } else
  9116. #endif
  9117. {
  9118. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error)
  9119. __Pyx_GOTREF(__pyx_t_6);
  9120. if (__pyx_t_3) {
  9121. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9122. }
  9123. __Pyx_INCREF(__pyx_v_g);
  9124. __Pyx_GIVEREF(__pyx_v_g);
  9125. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g);
  9126. __Pyx_INCREF(__pyx_v_h);
  9127. __Pyx_GIVEREF(__pyx_v_h);
  9128. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_h);
  9129. __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)
  9130. __Pyx_GOTREF(__pyx_t_1);
  9131. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  9132. }
  9133. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9134. __Pyx_DECREF_SET(__pyx_v_resDistance, __pyx_t_1);
  9135. __pyx_t_1 = 0;
  9136. /* "gedlibpy.pyx":945
  9137. * self.run_method(g, h)
  9138. * resDistance = self.get_upper_bound(g, h)
  9139. * resMapping = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  9140. *
  9141. * return resDistance, resMapping
  9142. */
  9143. __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)
  9144. __Pyx_GOTREF(__pyx_t_2);
  9145. __pyx_t_6 = NULL;
  9146. __pyx_t_5 = 0;
  9147. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9148. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9149. if (likely(__pyx_t_6)) {
  9150. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9151. __Pyx_INCREF(__pyx_t_6);
  9152. __Pyx_INCREF(function);
  9153. __Pyx_DECREF_SET(__pyx_t_2, function);
  9154. __pyx_t_5 = 1;
  9155. }
  9156. }
  9157. #if CYTHON_FAST_PYCALL
  9158. if (PyFunction_Check(__pyx_t_2)) {
  9159. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9160. __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)
  9161. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9162. __Pyx_GOTREF(__pyx_t_1);
  9163. } else
  9164. #endif
  9165. #if CYTHON_FAST_PYCCALL
  9166. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9167. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9168. __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)
  9169. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9170. __Pyx_GOTREF(__pyx_t_1);
  9171. } else
  9172. #endif
  9173. {
  9174. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  9175. __Pyx_GOTREF(__pyx_t_3);
  9176. if (__pyx_t_6) {
  9177. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9178. }
  9179. __Pyx_INCREF(__pyx_v_g);
  9180. __Pyx_GIVEREF(__pyx_v_g);
  9181. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9182. __Pyx_INCREF(__pyx_v_h);
  9183. __Pyx_GIVEREF(__pyx_v_h);
  9184. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9185. __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)
  9186. __Pyx_GOTREF(__pyx_t_1);
  9187. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9188. }
  9189. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9190. __Pyx_DECREF_SET(__pyx_v_resMapping, __pyx_t_1);
  9191. __pyx_t_1 = 0;
  9192. /* "gedlibpy.pyx":947
  9193. * resMapping = self.get_node_map(g, h)
  9194. *
  9195. * return resDistance, resMapping # <<<<<<<<<<<<<<
  9196. *
  9197. *
  9198. */
  9199. __Pyx_XDECREF(__pyx_r);
  9200. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
  9201. __Pyx_GOTREF(__pyx_t_1);
  9202. __Pyx_INCREF(__pyx_v_resDistance);
  9203. __Pyx_GIVEREF(__pyx_v_resDistance);
  9204. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_resDistance);
  9205. __Pyx_INCREF(__pyx_v_resMapping);
  9206. __Pyx_GIVEREF(__pyx_v_resMapping);
  9207. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_resMapping);
  9208. __pyx_r = __pyx_t_1;
  9209. __pyx_t_1 = 0;
  9210. goto __pyx_L0;
  9211. /* "gedlibpy.pyx":906
  9212. *
  9213. *
  9214. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9215. * """
  9216. * Computes the edit distance between two NX graphs.
  9217. */
  9218. /* function exit code */
  9219. __pyx_L1_error:;
  9220. __Pyx_XDECREF(__pyx_t_1);
  9221. __Pyx_XDECREF(__pyx_t_2);
  9222. __Pyx_XDECREF(__pyx_t_3);
  9223. __Pyx_XDECREF(__pyx_t_6);
  9224. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9225. __pyx_r = NULL;
  9226. __pyx_L0:;
  9227. __Pyx_XDECREF(__pyx_v_g);
  9228. __Pyx_XDECREF(__pyx_v_h);
  9229. __Pyx_XDECREF(__pyx_v_resDistance);
  9230. __Pyx_XDECREF(__pyx_v_resMapping);
  9231. __Pyx_XGIVEREF(__pyx_r);
  9232. __Pyx_RefNannyFinishContext();
  9233. return __pyx_r;
  9234. }
  9235. /* "gedlibpy.pyx":950
  9236. *
  9237. *
  9238. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9239. * """
  9240. *
  9241. */
  9242. /* Python wrapper */
  9243. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9244. 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";
  9245. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9246. PyObject *__pyx_v_dataset = 0;
  9247. PyObject *__pyx_v_classes = 0;
  9248. PyObject *__pyx_v_edit_cost = 0;
  9249. PyObject *__pyx_v_method = 0;
  9250. PyObject *__pyx_v_options = 0;
  9251. PyObject *__pyx_v_init_option = 0;
  9252. PyObject *__pyx_r = 0;
  9253. __Pyx_RefNannyDeclarations
  9254. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs (wrapper)", 0);
  9255. {
  9256. 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};
  9257. PyObject* values[6] = {0,0,0,0,0,0};
  9258. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  9259. if (unlikely(__pyx_kwds)) {
  9260. Py_ssize_t kw_args;
  9261. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  9262. switch (pos_args) {
  9263. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9264. CYTHON_FALLTHROUGH;
  9265. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9266. CYTHON_FALLTHROUGH;
  9267. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9268. CYTHON_FALLTHROUGH;
  9269. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9270. CYTHON_FALLTHROUGH;
  9271. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9272. CYTHON_FALLTHROUGH;
  9273. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9274. CYTHON_FALLTHROUGH;
  9275. case 0: break;
  9276. default: goto __pyx_L5_argtuple_error;
  9277. }
  9278. kw_args = PyDict_Size(__pyx_kwds);
  9279. switch (pos_args) {
  9280. case 0:
  9281. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dataset)) != 0)) kw_args--;
  9282. else goto __pyx_L5_argtuple_error;
  9283. CYTHON_FALLTHROUGH;
  9284. case 1:
  9285. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classes)) != 0)) kw_args--;
  9286. else {
  9287. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 950, __pyx_L3_error)
  9288. }
  9289. CYTHON_FALLTHROUGH;
  9290. case 2:
  9291. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  9292. else {
  9293. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 950, __pyx_L3_error)
  9294. }
  9295. CYTHON_FALLTHROUGH;
  9296. case 3:
  9297. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  9298. else {
  9299. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 950, __pyx_L3_error)
  9300. }
  9301. CYTHON_FALLTHROUGH;
  9302. case 4:
  9303. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  9304. else {
  9305. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 950, __pyx_L3_error)
  9306. }
  9307. CYTHON_FALLTHROUGH;
  9308. case 5:
  9309. if (kw_args > 0) {
  9310. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  9311. if (value) { values[5] = value; kw_args--; }
  9312. }
  9313. }
  9314. if (unlikely(kw_args > 0)) {
  9315. 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)
  9316. }
  9317. } else {
  9318. switch (PyTuple_GET_SIZE(__pyx_args)) {
  9319. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9320. CYTHON_FALLTHROUGH;
  9321. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9322. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9323. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9324. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9325. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9326. break;
  9327. default: goto __pyx_L5_argtuple_error;
  9328. }
  9329. }
  9330. __pyx_v_dataset = values[0];
  9331. __pyx_v_classes = values[1];
  9332. __pyx_v_edit_cost = values[2];
  9333. __pyx_v_method = values[3];
  9334. __pyx_v_options = values[4];
  9335. __pyx_v_init_option = values[5];
  9336. }
  9337. goto __pyx_L4_argument_unpacking_done;
  9338. __pyx_L5_argtuple_error:;
  9339. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 950, __pyx_L3_error)
  9340. __pyx_L3_error:;
  9341. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9342. __Pyx_RefNannyFinishContext();
  9343. return NULL;
  9344. __pyx_L4_argument_unpacking_done:;
  9345. __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);
  9346. /* function exit code */
  9347. __Pyx_RefNannyFinishContext();
  9348. return __pyx_r;
  9349. }
  9350. 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) {
  9351. PyObject *__pyx_v_graph = NULL;
  9352. PyObject *__pyx_v_listID = NULL;
  9353. PyObject *__pyx_v_resDistance = NULL;
  9354. PyObject *__pyx_v_resMapping = NULL;
  9355. PyObject *__pyx_v_g = NULL;
  9356. PyObject *__pyx_v_h = NULL;
  9357. PyObject *__pyx_r = NULL;
  9358. __Pyx_RefNannyDeclarations
  9359. PyObject *__pyx_t_1 = NULL;
  9360. PyObject *__pyx_t_2 = NULL;
  9361. PyObject *__pyx_t_3 = NULL;
  9362. int __pyx_t_4;
  9363. Py_ssize_t __pyx_t_5;
  9364. PyObject *(*__pyx_t_6)(PyObject *);
  9365. PyObject *__pyx_t_7 = NULL;
  9366. int __pyx_t_8;
  9367. PyObject *__pyx_t_9 = NULL;
  9368. Py_ssize_t __pyx_t_10;
  9369. PyObject *(*__pyx_t_11)(PyObject *);
  9370. PyObject *__pyx_t_12 = NULL;
  9371. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs", 0);
  9372. /* "gedlibpy.pyx":974
  9373. *
  9374. * """
  9375. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9376. * self.restart_env()
  9377. *
  9378. */
  9379. __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)
  9380. __Pyx_GOTREF(__pyx_t_2);
  9381. __pyx_t_3 = NULL;
  9382. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9383. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9384. if (likely(__pyx_t_3)) {
  9385. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9386. __Pyx_INCREF(__pyx_t_3);
  9387. __Pyx_INCREF(function);
  9388. __Pyx_DECREF_SET(__pyx_t_2, function);
  9389. }
  9390. }
  9391. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9392. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9393. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  9394. __Pyx_GOTREF(__pyx_t_1);
  9395. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9396. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
  9397. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9398. if (__pyx_t_4) {
  9399. /* "gedlibpy.pyx":975
  9400. * """
  9401. * if self.is_initialized() :
  9402. * self.restart_env() # <<<<<<<<<<<<<<
  9403. *
  9404. * print("Loading graphs in progress...")
  9405. */
  9406. __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)
  9407. __Pyx_GOTREF(__pyx_t_2);
  9408. __pyx_t_3 = NULL;
  9409. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9410. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9411. if (likely(__pyx_t_3)) {
  9412. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9413. __Pyx_INCREF(__pyx_t_3);
  9414. __Pyx_INCREF(function);
  9415. __Pyx_DECREF_SET(__pyx_t_2, function);
  9416. }
  9417. }
  9418. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9419. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9420. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9421. __Pyx_GOTREF(__pyx_t_1);
  9422. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9423. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9424. /* "gedlibpy.pyx":974
  9425. *
  9426. * """
  9427. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9428. * self.restart_env()
  9429. *
  9430. */
  9431. }
  9432. /* "gedlibpy.pyx":977
  9433. * self.restart_env()
  9434. *
  9435. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  9436. * for graph in dataset :
  9437. * self.add_nx_graph(graph, classes)
  9438. */
  9439. __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)
  9440. __Pyx_GOTREF(__pyx_t_1);
  9441. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9442. /* "gedlibpy.pyx":978
  9443. *
  9444. * print("Loading graphs in progress...")
  9445. * for graph in dataset : # <<<<<<<<<<<<<<
  9446. * self.add_nx_graph(graph, classes)
  9447. * listID = self.graph_ids()
  9448. */
  9449. if (likely(PyList_CheckExact(__pyx_v_dataset)) || PyTuple_CheckExact(__pyx_v_dataset)) {
  9450. __pyx_t_1 = __pyx_v_dataset; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  9451. __pyx_t_6 = NULL;
  9452. } else {
  9453. __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  9454. __Pyx_GOTREF(__pyx_t_1);
  9455. __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L1_error)
  9456. }
  9457. for (;;) {
  9458. if (likely(!__pyx_t_6)) {
  9459. if (likely(PyList_CheckExact(__pyx_t_1))) {
  9460. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
  9461. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9462. __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)
  9463. #else
  9464. __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)
  9465. __Pyx_GOTREF(__pyx_t_2);
  9466. #endif
  9467. } else {
  9468. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  9469. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9470. __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)
  9471. #else
  9472. __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)
  9473. __Pyx_GOTREF(__pyx_t_2);
  9474. #endif
  9475. }
  9476. } else {
  9477. __pyx_t_2 = __pyx_t_6(__pyx_t_1);
  9478. if (unlikely(!__pyx_t_2)) {
  9479. PyObject* exc_type = PyErr_Occurred();
  9480. if (exc_type) {
  9481. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9482. else __PYX_ERR(0, 978, __pyx_L1_error)
  9483. }
  9484. break;
  9485. }
  9486. __Pyx_GOTREF(__pyx_t_2);
  9487. }
  9488. __Pyx_XDECREF_SET(__pyx_v_graph, __pyx_t_2);
  9489. __pyx_t_2 = 0;
  9490. /* "gedlibpy.pyx":979
  9491. * print("Loading graphs in progress...")
  9492. * for graph in dataset :
  9493. * self.add_nx_graph(graph, classes) # <<<<<<<<<<<<<<
  9494. * listID = self.graph_ids()
  9495. * print("Graphs loaded ! ")
  9496. */
  9497. __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)
  9498. __Pyx_GOTREF(__pyx_t_3);
  9499. __pyx_t_7 = NULL;
  9500. __pyx_t_8 = 0;
  9501. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  9502. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
  9503. if (likely(__pyx_t_7)) {
  9504. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  9505. __Pyx_INCREF(__pyx_t_7);
  9506. __Pyx_INCREF(function);
  9507. __Pyx_DECREF_SET(__pyx_t_3, function);
  9508. __pyx_t_8 = 1;
  9509. }
  9510. }
  9511. #if CYTHON_FAST_PYCALL
  9512. if (PyFunction_Check(__pyx_t_3)) {
  9513. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9514. __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)
  9515. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9516. __Pyx_GOTREF(__pyx_t_2);
  9517. } else
  9518. #endif
  9519. #if CYTHON_FAST_PYCCALL
  9520. if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
  9521. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9522. __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)
  9523. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9524. __Pyx_GOTREF(__pyx_t_2);
  9525. } else
  9526. #endif
  9527. {
  9528. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 979, __pyx_L1_error)
  9529. __Pyx_GOTREF(__pyx_t_9);
  9530. if (__pyx_t_7) {
  9531. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9532. }
  9533. __Pyx_INCREF(__pyx_v_graph);
  9534. __Pyx_GIVEREF(__pyx_v_graph);
  9535. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_graph);
  9536. __Pyx_INCREF(__pyx_v_classes);
  9537. __Pyx_GIVEREF(__pyx_v_classes);
  9538. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_classes);
  9539. __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)
  9540. __Pyx_GOTREF(__pyx_t_2);
  9541. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9542. }
  9543. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9544. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9545. /* "gedlibpy.pyx":978
  9546. *
  9547. * print("Loading graphs in progress...")
  9548. * for graph in dataset : # <<<<<<<<<<<<<<
  9549. * self.add_nx_graph(graph, classes)
  9550. * listID = self.graph_ids()
  9551. */
  9552. }
  9553. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9554. /* "gedlibpy.pyx":980
  9555. * for graph in dataset :
  9556. * self.add_nx_graph(graph, classes)
  9557. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  9558. * print("Graphs loaded ! ")
  9559. * print("Number of graphs = " + str(listID[1]))
  9560. */
  9561. __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)
  9562. __Pyx_GOTREF(__pyx_t_2);
  9563. __pyx_t_3 = NULL;
  9564. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9565. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9566. if (likely(__pyx_t_3)) {
  9567. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9568. __Pyx_INCREF(__pyx_t_3);
  9569. __Pyx_INCREF(function);
  9570. __Pyx_DECREF_SET(__pyx_t_2, function);
  9571. }
  9572. }
  9573. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9574. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9575. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  9576. __Pyx_GOTREF(__pyx_t_1);
  9577. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9578. __pyx_v_listID = __pyx_t_1;
  9579. __pyx_t_1 = 0;
  9580. /* "gedlibpy.pyx":981
  9581. * self.add_nx_graph(graph, classes)
  9582. * listID = self.graph_ids()
  9583. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  9584. * print("Number of graphs = " + str(listID[1]))
  9585. *
  9586. */
  9587. __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)
  9588. __Pyx_GOTREF(__pyx_t_1);
  9589. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9590. /* "gedlibpy.pyx":982
  9591. * listID = self.graph_ids()
  9592. * print("Graphs loaded ! ")
  9593. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  9594. *
  9595. * self.set_edit_cost(edit_cost)
  9596. */
  9597. __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)
  9598. __Pyx_GOTREF(__pyx_t_1);
  9599. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  9600. __Pyx_GOTREF(__pyx_t_2);
  9601. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9602. __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)
  9603. __Pyx_GOTREF(__pyx_t_1);
  9604. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9605. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  9606. __Pyx_GOTREF(__pyx_t_2);
  9607. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9608. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9609. /* "gedlibpy.pyx":984
  9610. * print("Number of graphs = " + str(listID[1]))
  9611. *
  9612. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  9613. * print("Initialization in progress...")
  9614. * self.init(init_option)
  9615. */
  9616. __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)
  9617. __Pyx_GOTREF(__pyx_t_1);
  9618. __pyx_t_3 = NULL;
  9619. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9620. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9621. if (likely(__pyx_t_3)) {
  9622. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9623. __Pyx_INCREF(__pyx_t_3);
  9624. __Pyx_INCREF(function);
  9625. __Pyx_DECREF_SET(__pyx_t_1, function);
  9626. }
  9627. }
  9628. __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);
  9629. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9630. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
  9631. __Pyx_GOTREF(__pyx_t_2);
  9632. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9633. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9634. /* "gedlibpy.pyx":985
  9635. *
  9636. * self.set_edit_cost(edit_cost)
  9637. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  9638. * self.init(init_option)
  9639. * print("Initialization terminated !")
  9640. */
  9641. __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)
  9642. __Pyx_GOTREF(__pyx_t_2);
  9643. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9644. /* "gedlibpy.pyx":986
  9645. * self.set_edit_cost(edit_cost)
  9646. * print("Initialization in progress...")
  9647. * self.init(init_option) # <<<<<<<<<<<<<<
  9648. * print("Initialization terminated !")
  9649. *
  9650. */
  9651. __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)
  9652. __Pyx_GOTREF(__pyx_t_1);
  9653. __pyx_t_3 = NULL;
  9654. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9655. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9656. if (likely(__pyx_t_3)) {
  9657. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9658. __Pyx_INCREF(__pyx_t_3);
  9659. __Pyx_INCREF(function);
  9660. __Pyx_DECREF_SET(__pyx_t_1, function);
  9661. }
  9662. }
  9663. __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);
  9664. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9665. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  9666. __Pyx_GOTREF(__pyx_t_2);
  9667. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9668. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9669. /* "gedlibpy.pyx":987
  9670. * print("Initialization in progress...")
  9671. * self.init(init_option)
  9672. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  9673. *
  9674. * self.set_method(method, options)
  9675. */
  9676. __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)
  9677. __Pyx_GOTREF(__pyx_t_2);
  9678. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9679. /* "gedlibpy.pyx":989
  9680. * print("Initialization terminated !")
  9681. *
  9682. * self.set_method(method, options) # <<<<<<<<<<<<<<
  9683. * self.init_method()
  9684. *
  9685. */
  9686. __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)
  9687. __Pyx_GOTREF(__pyx_t_1);
  9688. __pyx_t_3 = NULL;
  9689. __pyx_t_8 = 0;
  9690. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9691. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9692. if (likely(__pyx_t_3)) {
  9693. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9694. __Pyx_INCREF(__pyx_t_3);
  9695. __Pyx_INCREF(function);
  9696. __Pyx_DECREF_SET(__pyx_t_1, function);
  9697. __pyx_t_8 = 1;
  9698. }
  9699. }
  9700. #if CYTHON_FAST_PYCALL
  9701. if (PyFunction_Check(__pyx_t_1)) {
  9702. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9703. __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)
  9704. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9705. __Pyx_GOTREF(__pyx_t_2);
  9706. } else
  9707. #endif
  9708. #if CYTHON_FAST_PYCCALL
  9709. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  9710. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9711. __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)
  9712. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9713. __Pyx_GOTREF(__pyx_t_2);
  9714. } else
  9715. #endif
  9716. {
  9717. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
  9718. __Pyx_GOTREF(__pyx_t_9);
  9719. if (__pyx_t_3) {
  9720. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9721. }
  9722. __Pyx_INCREF(__pyx_v_method);
  9723. __Pyx_GIVEREF(__pyx_v_method);
  9724. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_method);
  9725. __Pyx_INCREF(__pyx_v_options);
  9726. __Pyx_GIVEREF(__pyx_v_options);
  9727. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_options);
  9728. __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)
  9729. __Pyx_GOTREF(__pyx_t_2);
  9730. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9731. }
  9732. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9733. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9734. /* "gedlibpy.pyx":990
  9735. *
  9736. * self.set_method(method, options)
  9737. * self.init_method() # <<<<<<<<<<<<<<
  9738. *
  9739. * resDistance = [[]]
  9740. */
  9741. __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)
  9742. __Pyx_GOTREF(__pyx_t_1);
  9743. __pyx_t_9 = NULL;
  9744. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9745. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
  9746. if (likely(__pyx_t_9)) {
  9747. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9748. __Pyx_INCREF(__pyx_t_9);
  9749. __Pyx_INCREF(function);
  9750. __Pyx_DECREF_SET(__pyx_t_1, function);
  9751. }
  9752. }
  9753. __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  9754. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  9755. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error)
  9756. __Pyx_GOTREF(__pyx_t_2);
  9757. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9758. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9759. /* "gedlibpy.pyx":992
  9760. * self.init_method()
  9761. *
  9762. * resDistance = [[]] # <<<<<<<<<<<<<<
  9763. * resMapping = [[]]
  9764. * for g in range(listID[0], listID[1]) :
  9765. */
  9766. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error)
  9767. __Pyx_GOTREF(__pyx_t_2);
  9768. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  9769. __Pyx_GOTREF(__pyx_t_1);
  9770. __Pyx_GIVEREF(__pyx_t_2);
  9771. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  9772. __pyx_t_2 = 0;
  9773. __pyx_v_resDistance = ((PyObject*)__pyx_t_1);
  9774. __pyx_t_1 = 0;
  9775. /* "gedlibpy.pyx":993
  9776. *
  9777. * resDistance = [[]]
  9778. * resMapping = [[]] # <<<<<<<<<<<<<<
  9779. * for g in range(listID[0], listID[1]) :
  9780. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9781. */
  9782. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
  9783. __Pyx_GOTREF(__pyx_t_1);
  9784. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error)
  9785. __Pyx_GOTREF(__pyx_t_2);
  9786. __Pyx_GIVEREF(__pyx_t_1);
  9787. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  9788. __pyx_t_1 = 0;
  9789. __pyx_v_resMapping = ((PyObject*)__pyx_t_2);
  9790. __pyx_t_2 = 0;
  9791. /* "gedlibpy.pyx":994
  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. * for h in range(listID[0], listID[1]) :
  9797. */
  9798. __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)
  9799. __Pyx_GOTREF(__pyx_t_2);
  9800. __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)
  9801. __Pyx_GOTREF(__pyx_t_1);
  9802. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error)
  9803. __Pyx_GOTREF(__pyx_t_9);
  9804. __Pyx_GIVEREF(__pyx_t_2);
  9805. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  9806. __Pyx_GIVEREF(__pyx_t_1);
  9807. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  9808. __pyx_t_2 = 0;
  9809. __pyx_t_1 = 0;
  9810. __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)
  9811. __Pyx_GOTREF(__pyx_t_1);
  9812. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9813. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9814. __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
  9815. __pyx_t_6 = NULL;
  9816. } else {
  9817. __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error)
  9818. __Pyx_GOTREF(__pyx_t_9);
  9819. __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 994, __pyx_L1_error)
  9820. }
  9821. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9822. for (;;) {
  9823. if (likely(!__pyx_t_6)) {
  9824. if (likely(PyList_CheckExact(__pyx_t_9))) {
  9825. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
  9826. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9827. __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)
  9828. #else
  9829. __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)
  9830. __Pyx_GOTREF(__pyx_t_1);
  9831. #endif
  9832. } else {
  9833. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
  9834. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9835. __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)
  9836. #else
  9837. __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)
  9838. __Pyx_GOTREF(__pyx_t_1);
  9839. #endif
  9840. }
  9841. } else {
  9842. __pyx_t_1 = __pyx_t_6(__pyx_t_9);
  9843. if (unlikely(!__pyx_t_1)) {
  9844. PyObject* exc_type = PyErr_Occurred();
  9845. if (exc_type) {
  9846. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9847. else __PYX_ERR(0, 994, __pyx_L1_error)
  9848. }
  9849. break;
  9850. }
  9851. __Pyx_GOTREF(__pyx_t_1);
  9852. }
  9853. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  9854. __pyx_t_1 = 0;
  9855. /* "gedlibpy.pyx":995
  9856. * resMapping = [[]]
  9857. * for g in range(listID[0], listID[1]) :
  9858. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  9859. * for h in range(listID[0], listID[1]) :
  9860. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9861. */
  9862. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
  9863. __Pyx_GOTREF(__pyx_t_1);
  9864. __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)
  9865. __Pyx_GOTREF(__pyx_t_2);
  9866. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9867. __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)
  9868. __Pyx_GOTREF(__pyx_t_1);
  9869. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9870. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  9871. __Pyx_GOTREF(__pyx_t_2);
  9872. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9873. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9874. /* "gedlibpy.pyx":996
  9875. * for g in range(listID[0], listID[1]) :
  9876. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9877. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9878. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9879. * self.run_method(g, h)
  9880. */
  9881. __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)
  9882. __Pyx_GOTREF(__pyx_t_2);
  9883. __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)
  9884. __Pyx_GOTREF(__pyx_t_1);
  9885. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error)
  9886. __Pyx_GOTREF(__pyx_t_3);
  9887. __Pyx_GIVEREF(__pyx_t_2);
  9888. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9889. __Pyx_GIVEREF(__pyx_t_1);
  9890. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  9891. __pyx_t_2 = 0;
  9892. __pyx_t_1 = 0;
  9893. __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)
  9894. __Pyx_GOTREF(__pyx_t_1);
  9895. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9896. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9897. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
  9898. __pyx_t_11 = NULL;
  9899. } else {
  9900. __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error)
  9901. __Pyx_GOTREF(__pyx_t_3);
  9902. __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 996, __pyx_L1_error)
  9903. }
  9904. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9905. for (;;) {
  9906. if (likely(!__pyx_t_11)) {
  9907. if (likely(PyList_CheckExact(__pyx_t_3))) {
  9908. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
  9909. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9910. __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)
  9911. #else
  9912. __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)
  9913. __Pyx_GOTREF(__pyx_t_1);
  9914. #endif
  9915. } else {
  9916. if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  9917. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9918. __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)
  9919. #else
  9920. __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)
  9921. __Pyx_GOTREF(__pyx_t_1);
  9922. #endif
  9923. }
  9924. } else {
  9925. __pyx_t_1 = __pyx_t_11(__pyx_t_3);
  9926. if (unlikely(!__pyx_t_1)) {
  9927. PyObject* exc_type = PyErr_Occurred();
  9928. if (exc_type) {
  9929. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9930. else __PYX_ERR(0, 996, __pyx_L1_error)
  9931. }
  9932. break;
  9933. }
  9934. __Pyx_GOTREF(__pyx_t_1);
  9935. }
  9936. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  9937. __pyx_t_1 = 0;
  9938. /* "gedlibpy.pyx":998
  9939. * for h in range(listID[0], listID[1]) :
  9940. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9941. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9942. * resDistance[g][h] = self.get_upper_bound(g, h)
  9943. * resMapping[g][h] = self.get_node_map(g, h)
  9944. */
  9945. __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)
  9946. __Pyx_GOTREF(__pyx_t_2);
  9947. __pyx_t_7 = NULL;
  9948. __pyx_t_8 = 0;
  9949. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9950. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  9951. if (likely(__pyx_t_7)) {
  9952. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9953. __Pyx_INCREF(__pyx_t_7);
  9954. __Pyx_INCREF(function);
  9955. __Pyx_DECREF_SET(__pyx_t_2, function);
  9956. __pyx_t_8 = 1;
  9957. }
  9958. }
  9959. #if CYTHON_FAST_PYCALL
  9960. if (PyFunction_Check(__pyx_t_2)) {
  9961. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9962. __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)
  9963. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9964. __Pyx_GOTREF(__pyx_t_1);
  9965. } else
  9966. #endif
  9967. #if CYTHON_FAST_PYCCALL
  9968. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9969. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9970. __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)
  9971. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9972. __Pyx_GOTREF(__pyx_t_1);
  9973. } else
  9974. #endif
  9975. {
  9976. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 998, __pyx_L1_error)
  9977. __Pyx_GOTREF(__pyx_t_12);
  9978. if (__pyx_t_7) {
  9979. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9980. }
  9981. __Pyx_INCREF(__pyx_v_g);
  9982. __Pyx_GIVEREF(__pyx_v_g);
  9983. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  9984. __Pyx_INCREF(__pyx_v_h);
  9985. __Pyx_GIVEREF(__pyx_v_h);
  9986. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  9987. __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)
  9988. __Pyx_GOTREF(__pyx_t_1);
  9989. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  9990. }
  9991. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9992. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9993. /* "gedlibpy.pyx":999
  9994. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9995. * self.run_method(g, h)
  9996. * resDistance[g][h] = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  9997. * resMapping[g][h] = self.get_node_map(g, h)
  9998. *
  9999. */
  10000. __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)
  10001. __Pyx_GOTREF(__pyx_t_2);
  10002. __pyx_t_12 = NULL;
  10003. __pyx_t_8 = 0;
  10004. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10005. __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
  10006. if (likely(__pyx_t_12)) {
  10007. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10008. __Pyx_INCREF(__pyx_t_12);
  10009. __Pyx_INCREF(function);
  10010. __Pyx_DECREF_SET(__pyx_t_2, function);
  10011. __pyx_t_8 = 1;
  10012. }
  10013. }
  10014. #if CYTHON_FAST_PYCALL
  10015. if (PyFunction_Check(__pyx_t_2)) {
  10016. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10017. __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)
  10018. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10019. __Pyx_GOTREF(__pyx_t_1);
  10020. } else
  10021. #endif
  10022. #if CYTHON_FAST_PYCCALL
  10023. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10024. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10025. __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)
  10026. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10027. __Pyx_GOTREF(__pyx_t_1);
  10028. } else
  10029. #endif
  10030. {
  10031. __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 999, __pyx_L1_error)
  10032. __Pyx_GOTREF(__pyx_t_7);
  10033. if (__pyx_t_12) {
  10034. __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
  10035. }
  10036. __Pyx_INCREF(__pyx_v_g);
  10037. __Pyx_GIVEREF(__pyx_v_g);
  10038. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_g);
  10039. __Pyx_INCREF(__pyx_v_h);
  10040. __Pyx_GIVEREF(__pyx_v_h);
  10041. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_h);
  10042. __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)
  10043. __Pyx_GOTREF(__pyx_t_1);
  10044. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  10045. }
  10046. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10047. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  10048. __Pyx_GOTREF(__pyx_t_2);
  10049. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 999, __pyx_L1_error)
  10050. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10051. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10052. /* "gedlibpy.pyx":1000
  10053. * self.run_method(g, h)
  10054. * resDistance[g][h] = self.get_upper_bound(g, h)
  10055. * resMapping[g][h] = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  10056. *
  10057. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10058. */
  10059. __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)
  10060. __Pyx_GOTREF(__pyx_t_2);
  10061. __pyx_t_7 = NULL;
  10062. __pyx_t_8 = 0;
  10063. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10064. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  10065. if (likely(__pyx_t_7)) {
  10066. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10067. __Pyx_INCREF(__pyx_t_7);
  10068. __Pyx_INCREF(function);
  10069. __Pyx_DECREF_SET(__pyx_t_2, function);
  10070. __pyx_t_8 = 1;
  10071. }
  10072. }
  10073. #if CYTHON_FAST_PYCALL
  10074. if (PyFunction_Check(__pyx_t_2)) {
  10075. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10076. __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)
  10077. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10078. __Pyx_GOTREF(__pyx_t_1);
  10079. } else
  10080. #endif
  10081. #if CYTHON_FAST_PYCCALL
  10082. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10083. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10084. __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)
  10085. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10086. __Pyx_GOTREF(__pyx_t_1);
  10087. } else
  10088. #endif
  10089. {
  10090. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10091. __Pyx_GOTREF(__pyx_t_12);
  10092. if (__pyx_t_7) {
  10093. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  10094. }
  10095. __Pyx_INCREF(__pyx_v_g);
  10096. __Pyx_GIVEREF(__pyx_v_g);
  10097. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  10098. __Pyx_INCREF(__pyx_v_h);
  10099. __Pyx_GIVEREF(__pyx_v_h);
  10100. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  10101. __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)
  10102. __Pyx_GOTREF(__pyx_t_1);
  10103. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10104. }
  10105. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10106. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10107. __Pyx_GOTREF(__pyx_t_2);
  10108. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10109. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10110. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10111. /* "gedlibpy.pyx":996
  10112. * for g in range(listID[0], listID[1]) :
  10113. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10114. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10115. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10116. * self.run_method(g, h)
  10117. */
  10118. }
  10119. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10120. /* "gedlibpy.pyx":994
  10121. * resDistance = [[]]
  10122. * resMapping = [[]]
  10123. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10124. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10125. * for h in range(listID[0], listID[1]) :
  10126. */
  10127. }
  10128. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10129. /* "gedlibpy.pyx":1002
  10130. * resMapping[g][h] = self.get_node_map(g, h)
  10131. *
  10132. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  10133. * return resDistance, resMapping
  10134. *
  10135. */
  10136. __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)
  10137. __Pyx_GOTREF(__pyx_t_9);
  10138. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10139. /* "gedlibpy.pyx":1003
  10140. *
  10141. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10142. * return resDistance, resMapping # <<<<<<<<<<<<<<
  10143. *
  10144. *
  10145. */
  10146. __Pyx_XDECREF(__pyx_r);
  10147. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error)
  10148. __Pyx_GOTREF(__pyx_t_9);
  10149. __Pyx_INCREF(__pyx_v_resDistance);
  10150. __Pyx_GIVEREF(__pyx_v_resDistance);
  10151. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_resDistance);
  10152. __Pyx_INCREF(__pyx_v_resMapping);
  10153. __Pyx_GIVEREF(__pyx_v_resMapping);
  10154. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_resMapping);
  10155. __pyx_r = __pyx_t_9;
  10156. __pyx_t_9 = 0;
  10157. goto __pyx_L0;
  10158. /* "gedlibpy.pyx":950
  10159. *
  10160. *
  10161. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10162. * """
  10163. *
  10164. */
  10165. /* function exit code */
  10166. __pyx_L1_error:;
  10167. __Pyx_XDECREF(__pyx_t_1);
  10168. __Pyx_XDECREF(__pyx_t_2);
  10169. __Pyx_XDECREF(__pyx_t_3);
  10170. __Pyx_XDECREF(__pyx_t_7);
  10171. __Pyx_XDECREF(__pyx_t_9);
  10172. __Pyx_XDECREF(__pyx_t_12);
  10173. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10174. __pyx_r = NULL;
  10175. __pyx_L0:;
  10176. __Pyx_XDECREF(__pyx_v_graph);
  10177. __Pyx_XDECREF(__pyx_v_listID);
  10178. __Pyx_XDECREF(__pyx_v_resDistance);
  10179. __Pyx_XDECREF(__pyx_v_resMapping);
  10180. __Pyx_XDECREF(__pyx_v_g);
  10181. __Pyx_XDECREF(__pyx_v_h);
  10182. __Pyx_XGIVEREF(__pyx_r);
  10183. __Pyx_RefNannyFinishContext();
  10184. return __pyx_r;
  10185. }
  10186. /* "gedlibpy.pyx":1006
  10187. *
  10188. *
  10189. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10190. * """
  10191. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10192. */
  10193. /* Python wrapper */
  10194. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10195. 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";
  10196. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10197. PyObject *__pyx_v_path_folder = 0;
  10198. PyObject *__pyx_v_path_XML = 0;
  10199. PyObject *__pyx_v_edit_cost = 0;
  10200. PyObject *__pyx_v_method = 0;
  10201. PyObject *__pyx_v_options = 0;
  10202. PyObject *__pyx_v_init_option = 0;
  10203. PyObject *__pyx_r = 0;
  10204. __Pyx_RefNannyDeclarations
  10205. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs (wrapper)", 0);
  10206. {
  10207. 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};
  10208. PyObject* values[6] = {0,0,0,0,0,0};
  10209. values[4] = ((PyObject *)__pyx_kp_u_);
  10210. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  10211. if (unlikely(__pyx_kwds)) {
  10212. Py_ssize_t kw_args;
  10213. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  10214. switch (pos_args) {
  10215. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10216. CYTHON_FALLTHROUGH;
  10217. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10218. CYTHON_FALLTHROUGH;
  10219. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10220. CYTHON_FALLTHROUGH;
  10221. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10222. CYTHON_FALLTHROUGH;
  10223. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10224. CYTHON_FALLTHROUGH;
  10225. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10226. CYTHON_FALLTHROUGH;
  10227. case 0: break;
  10228. default: goto __pyx_L5_argtuple_error;
  10229. }
  10230. kw_args = PyDict_Size(__pyx_kwds);
  10231. switch (pos_args) {
  10232. case 0:
  10233. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  10234. else goto __pyx_L5_argtuple_error;
  10235. CYTHON_FALLTHROUGH;
  10236. case 1:
  10237. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  10238. else {
  10239. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 1006, __pyx_L3_error)
  10240. }
  10241. CYTHON_FALLTHROUGH;
  10242. case 2:
  10243. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  10244. else {
  10245. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 1006, __pyx_L3_error)
  10246. }
  10247. CYTHON_FALLTHROUGH;
  10248. case 3:
  10249. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  10250. else {
  10251. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 1006, __pyx_L3_error)
  10252. }
  10253. CYTHON_FALLTHROUGH;
  10254. case 4:
  10255. if (kw_args > 0) {
  10256. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  10257. if (value) { values[4] = value; kw_args--; }
  10258. }
  10259. CYTHON_FALLTHROUGH;
  10260. case 5:
  10261. if (kw_args > 0) {
  10262. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  10263. if (value) { values[5] = value; kw_args--; }
  10264. }
  10265. }
  10266. if (unlikely(kw_args > 0)) {
  10267. 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)
  10268. }
  10269. } else {
  10270. switch (PyTuple_GET_SIZE(__pyx_args)) {
  10271. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10272. CYTHON_FALLTHROUGH;
  10273. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10274. CYTHON_FALLTHROUGH;
  10275. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10276. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10277. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10278. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10279. break;
  10280. default: goto __pyx_L5_argtuple_error;
  10281. }
  10282. }
  10283. __pyx_v_path_folder = values[0];
  10284. __pyx_v_path_XML = values[1];
  10285. __pyx_v_edit_cost = values[2];
  10286. __pyx_v_method = values[3];
  10287. __pyx_v_options = values[4];
  10288. __pyx_v_init_option = values[5];
  10289. }
  10290. goto __pyx_L4_argument_unpacking_done;
  10291. __pyx_L5_argtuple_error:;
  10292. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1006, __pyx_L3_error)
  10293. __pyx_L3_error:;
  10294. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10295. __Pyx_RefNannyFinishContext();
  10296. return NULL;
  10297. __pyx_L4_argument_unpacking_done:;
  10298. __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);
  10299. /* function exit code */
  10300. __Pyx_RefNannyFinishContext();
  10301. return __pyx_r;
  10302. }
  10303. 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) {
  10304. PyObject *__pyx_v_listID = NULL;
  10305. PyObject *__pyx_v_g = NULL;
  10306. PyObject *__pyx_v_h = NULL;
  10307. PyObject *__pyx_r = NULL;
  10308. __Pyx_RefNannyDeclarations
  10309. PyObject *__pyx_t_1 = NULL;
  10310. PyObject *__pyx_t_2 = NULL;
  10311. PyObject *__pyx_t_3 = NULL;
  10312. int __pyx_t_4;
  10313. int __pyx_t_5;
  10314. PyObject *__pyx_t_6 = NULL;
  10315. Py_ssize_t __pyx_t_7;
  10316. PyObject *(*__pyx_t_8)(PyObject *);
  10317. Py_ssize_t __pyx_t_9;
  10318. PyObject *(*__pyx_t_10)(PyObject *);
  10319. PyObject *__pyx_t_11 = NULL;
  10320. PyObject *__pyx_t_12 = NULL;
  10321. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs", 0);
  10322. /* "gedlibpy.pyx":1030
  10323. * """
  10324. *
  10325. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10326. * self.restart_env()
  10327. *
  10328. */
  10329. __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)
  10330. __Pyx_GOTREF(__pyx_t_2);
  10331. __pyx_t_3 = NULL;
  10332. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10333. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10334. if (likely(__pyx_t_3)) {
  10335. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10336. __Pyx_INCREF(__pyx_t_3);
  10337. __Pyx_INCREF(function);
  10338. __Pyx_DECREF_SET(__pyx_t_2, function);
  10339. }
  10340. }
  10341. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10342. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10343. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10344. __Pyx_GOTREF(__pyx_t_1);
  10345. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10346. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10347. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10348. if (__pyx_t_4) {
  10349. /* "gedlibpy.pyx":1031
  10350. *
  10351. * if self.is_initialized() :
  10352. * self.restart_env() # <<<<<<<<<<<<<<
  10353. *
  10354. * print("Loading graphs in progress...")
  10355. */
  10356. __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)
  10357. __Pyx_GOTREF(__pyx_t_2);
  10358. __pyx_t_3 = NULL;
  10359. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10360. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10361. if (likely(__pyx_t_3)) {
  10362. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10363. __Pyx_INCREF(__pyx_t_3);
  10364. __Pyx_INCREF(function);
  10365. __Pyx_DECREF_SET(__pyx_t_2, function);
  10366. }
  10367. }
  10368. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10369. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10370. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10371. __Pyx_GOTREF(__pyx_t_1);
  10372. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10373. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10374. /* "gedlibpy.pyx":1030
  10375. * """
  10376. *
  10377. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10378. * self.restart_env()
  10379. *
  10380. */
  10381. }
  10382. /* "gedlibpy.pyx":1033
  10383. * self.restart_env()
  10384. *
  10385. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  10386. * self.load_GXL_graphs(path_folder, path_XML)
  10387. * listID = self.graph_ids()
  10388. */
  10389. __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)
  10390. __Pyx_GOTREF(__pyx_t_1);
  10391. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10392. /* "gedlibpy.pyx":1034
  10393. *
  10394. * print("Loading graphs in progress...")
  10395. * self.load_GXL_graphs(path_folder, path_XML) # <<<<<<<<<<<<<<
  10396. * listID = self.graph_ids()
  10397. * print("Graphs loaded ! ")
  10398. */
  10399. __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)
  10400. __Pyx_GOTREF(__pyx_t_2);
  10401. __pyx_t_3 = NULL;
  10402. __pyx_t_5 = 0;
  10403. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10404. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10405. if (likely(__pyx_t_3)) {
  10406. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10407. __Pyx_INCREF(__pyx_t_3);
  10408. __Pyx_INCREF(function);
  10409. __Pyx_DECREF_SET(__pyx_t_2, function);
  10410. __pyx_t_5 = 1;
  10411. }
  10412. }
  10413. #if CYTHON_FAST_PYCALL
  10414. if (PyFunction_Check(__pyx_t_2)) {
  10415. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10416. __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)
  10417. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10418. __Pyx_GOTREF(__pyx_t_1);
  10419. } else
  10420. #endif
  10421. #if CYTHON_FAST_PYCCALL
  10422. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10423. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10424. __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)
  10425. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10426. __Pyx_GOTREF(__pyx_t_1);
  10427. } else
  10428. #endif
  10429. {
  10430. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
  10431. __Pyx_GOTREF(__pyx_t_6);
  10432. if (__pyx_t_3) {
  10433. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  10434. }
  10435. __Pyx_INCREF(__pyx_v_path_folder);
  10436. __Pyx_GIVEREF(__pyx_v_path_folder);
  10437. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_path_folder);
  10438. __Pyx_INCREF(__pyx_v_path_XML);
  10439. __Pyx_GIVEREF(__pyx_v_path_XML);
  10440. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_path_XML);
  10441. __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)
  10442. __Pyx_GOTREF(__pyx_t_1);
  10443. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10444. }
  10445. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10446. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10447. /* "gedlibpy.pyx":1035
  10448. * print("Loading graphs in progress...")
  10449. * self.load_GXL_graphs(path_folder, path_XML)
  10450. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  10451. * print("Graphs loaded ! ")
  10452. * print("Number of graphs = " + str(listID[1]))
  10453. */
  10454. __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)
  10455. __Pyx_GOTREF(__pyx_t_2);
  10456. __pyx_t_6 = NULL;
  10457. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10458. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10459. if (likely(__pyx_t_6)) {
  10460. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10461. __Pyx_INCREF(__pyx_t_6);
  10462. __Pyx_INCREF(function);
  10463. __Pyx_DECREF_SET(__pyx_t_2, function);
  10464. }
  10465. }
  10466. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10467. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10468. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
  10469. __Pyx_GOTREF(__pyx_t_1);
  10470. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10471. __pyx_v_listID = __pyx_t_1;
  10472. __pyx_t_1 = 0;
  10473. /* "gedlibpy.pyx":1036
  10474. * self.load_GXL_graphs(path_folder, path_XML)
  10475. * listID = self.graph_ids()
  10476. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  10477. * print("Number of graphs = " + str(listID[1]))
  10478. *
  10479. */
  10480. __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)
  10481. __Pyx_GOTREF(__pyx_t_1);
  10482. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10483. /* "gedlibpy.pyx":1037
  10484. * listID = self.graph_ids()
  10485. * print("Graphs loaded ! ")
  10486. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  10487. *
  10488. * self.set_edit_cost(edit_cost)
  10489. */
  10490. __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)
  10491. __Pyx_GOTREF(__pyx_t_1);
  10492. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
  10493. __Pyx_GOTREF(__pyx_t_2);
  10494. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10495. __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)
  10496. __Pyx_GOTREF(__pyx_t_1);
  10497. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10498. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
  10499. __Pyx_GOTREF(__pyx_t_2);
  10500. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10501. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10502. /* "gedlibpy.pyx":1039
  10503. * print("Number of graphs = " + str(listID[1]))
  10504. *
  10505. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  10506. * print("Initialization in progress...")
  10507. * self.init(init_option)
  10508. */
  10509. __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)
  10510. __Pyx_GOTREF(__pyx_t_1);
  10511. __pyx_t_6 = NULL;
  10512. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10513. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10514. if (likely(__pyx_t_6)) {
  10515. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10516. __Pyx_INCREF(__pyx_t_6);
  10517. __Pyx_INCREF(function);
  10518. __Pyx_DECREF_SET(__pyx_t_1, function);
  10519. }
  10520. }
  10521. __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);
  10522. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10523. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10524. __Pyx_GOTREF(__pyx_t_2);
  10525. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10526. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10527. /* "gedlibpy.pyx":1040
  10528. *
  10529. * self.set_edit_cost(edit_cost)
  10530. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  10531. * self.init(init_option)
  10532. * print("Initialization terminated !")
  10533. */
  10534. __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)
  10535. __Pyx_GOTREF(__pyx_t_2);
  10536. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10537. /* "gedlibpy.pyx":1041
  10538. * self.set_edit_cost(edit_cost)
  10539. * print("Initialization in progress...")
  10540. * self.init(init_option) # <<<<<<<<<<<<<<
  10541. * print("Initialization terminated !")
  10542. *
  10543. */
  10544. __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)
  10545. __Pyx_GOTREF(__pyx_t_1);
  10546. __pyx_t_6 = NULL;
  10547. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10548. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10549. if (likely(__pyx_t_6)) {
  10550. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10551. __Pyx_INCREF(__pyx_t_6);
  10552. __Pyx_INCREF(function);
  10553. __Pyx_DECREF_SET(__pyx_t_1, function);
  10554. }
  10555. }
  10556. __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);
  10557. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10558. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
  10559. __Pyx_GOTREF(__pyx_t_2);
  10560. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10561. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10562. /* "gedlibpy.pyx":1042
  10563. * print("Initialization in progress...")
  10564. * self.init(init_option)
  10565. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  10566. *
  10567. * self.set_method(method, options)
  10568. */
  10569. __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)
  10570. __Pyx_GOTREF(__pyx_t_2);
  10571. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10572. /* "gedlibpy.pyx":1044
  10573. * print("Initialization terminated !")
  10574. *
  10575. * self.set_method(method, options) # <<<<<<<<<<<<<<
  10576. * self.init_method()
  10577. *
  10578. */
  10579. __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)
  10580. __Pyx_GOTREF(__pyx_t_1);
  10581. __pyx_t_6 = NULL;
  10582. __pyx_t_5 = 0;
  10583. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10584. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10585. if (likely(__pyx_t_6)) {
  10586. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10587. __Pyx_INCREF(__pyx_t_6);
  10588. __Pyx_INCREF(function);
  10589. __Pyx_DECREF_SET(__pyx_t_1, function);
  10590. __pyx_t_5 = 1;
  10591. }
  10592. }
  10593. #if CYTHON_FAST_PYCALL
  10594. if (PyFunction_Check(__pyx_t_1)) {
  10595. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10596. __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)
  10597. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10598. __Pyx_GOTREF(__pyx_t_2);
  10599. } else
  10600. #endif
  10601. #if CYTHON_FAST_PYCCALL
  10602. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  10603. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10604. __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)
  10605. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10606. __Pyx_GOTREF(__pyx_t_2);
  10607. } else
  10608. #endif
  10609. {
  10610. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
  10611. __Pyx_GOTREF(__pyx_t_3);
  10612. if (__pyx_t_6) {
  10613. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  10614. }
  10615. __Pyx_INCREF(__pyx_v_method);
  10616. __Pyx_GIVEREF(__pyx_v_method);
  10617. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_method);
  10618. __Pyx_INCREF(__pyx_v_options);
  10619. __Pyx_GIVEREF(__pyx_v_options);
  10620. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_options);
  10621. __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)
  10622. __Pyx_GOTREF(__pyx_t_2);
  10623. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10624. }
  10625. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10626. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10627. /* "gedlibpy.pyx":1045
  10628. *
  10629. * self.set_method(method, options)
  10630. * self.init_method() # <<<<<<<<<<<<<<
  10631. *
  10632. * #res = []
  10633. */
  10634. __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)
  10635. __Pyx_GOTREF(__pyx_t_1);
  10636. __pyx_t_3 = NULL;
  10637. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10638. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  10639. if (likely(__pyx_t_3)) {
  10640. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10641. __Pyx_INCREF(__pyx_t_3);
  10642. __Pyx_INCREF(function);
  10643. __Pyx_DECREF_SET(__pyx_t_1, function);
  10644. }
  10645. }
  10646. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  10647. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10648. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10649. __Pyx_GOTREF(__pyx_t_2);
  10650. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10651. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10652. /* "gedlibpy.pyx":1048
  10653. *
  10654. * #res = []
  10655. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10656. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10657. * for h in range(listID[0], listID[1]) :
  10658. */
  10659. __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)
  10660. __Pyx_GOTREF(__pyx_t_2);
  10661. __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)
  10662. __Pyx_GOTREF(__pyx_t_1);
  10663. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10664. __Pyx_GOTREF(__pyx_t_3);
  10665. __Pyx_GIVEREF(__pyx_t_2);
  10666. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10667. __Pyx_GIVEREF(__pyx_t_1);
  10668. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  10669. __pyx_t_2 = 0;
  10670. __pyx_t_1 = 0;
  10671. __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)
  10672. __Pyx_GOTREF(__pyx_t_1);
  10673. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10674. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10675. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
  10676. __pyx_t_8 = NULL;
  10677. } else {
  10678. __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10679. __Pyx_GOTREF(__pyx_t_3);
  10680. __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10681. }
  10682. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10683. for (;;) {
  10684. if (likely(!__pyx_t_8)) {
  10685. if (likely(PyList_CheckExact(__pyx_t_3))) {
  10686. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10687. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10688. __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)
  10689. #else
  10690. __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)
  10691. __Pyx_GOTREF(__pyx_t_1);
  10692. #endif
  10693. } else {
  10694. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  10695. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10696. __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)
  10697. #else
  10698. __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)
  10699. __Pyx_GOTREF(__pyx_t_1);
  10700. #endif
  10701. }
  10702. } else {
  10703. __pyx_t_1 = __pyx_t_8(__pyx_t_3);
  10704. if (unlikely(!__pyx_t_1)) {
  10705. PyObject* exc_type = PyErr_Occurred();
  10706. if (exc_type) {
  10707. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10708. else __PYX_ERR(0, 1048, __pyx_L1_error)
  10709. }
  10710. break;
  10711. }
  10712. __Pyx_GOTREF(__pyx_t_1);
  10713. }
  10714. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  10715. __pyx_t_1 = 0;
  10716. /* "gedlibpy.pyx":1049
  10717. * #res = []
  10718. * for g in range(listID[0], listID[1]) :
  10719. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  10720. * for h in range(listID[0], listID[1]) :
  10721. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10722. */
  10723. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10724. __Pyx_GOTREF(__pyx_t_1);
  10725. __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)
  10726. __Pyx_GOTREF(__pyx_t_2);
  10727. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10728. __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)
  10729. __Pyx_GOTREF(__pyx_t_1);
  10730. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10731. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10732. __Pyx_GOTREF(__pyx_t_2);
  10733. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10734. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10735. /* "gedlibpy.pyx":1050
  10736. * for g in range(listID[0], listID[1]) :
  10737. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10738. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10739. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10740. * self.run_method(g,h)
  10741. */
  10742. __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)
  10743. __Pyx_GOTREF(__pyx_t_2);
  10744. __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)
  10745. __Pyx_GOTREF(__pyx_t_1);
  10746. __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10747. __Pyx_GOTREF(__pyx_t_6);
  10748. __Pyx_GIVEREF(__pyx_t_2);
  10749. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  10750. __Pyx_GIVEREF(__pyx_t_1);
  10751. PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  10752. __pyx_t_2 = 0;
  10753. __pyx_t_1 = 0;
  10754. __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)
  10755. __Pyx_GOTREF(__pyx_t_1);
  10756. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10757. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10758. __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
  10759. __pyx_t_10 = NULL;
  10760. } else {
  10761. __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10762. __Pyx_GOTREF(__pyx_t_6);
  10763. __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10764. }
  10765. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10766. for (;;) {
  10767. if (likely(!__pyx_t_10)) {
  10768. if (likely(PyList_CheckExact(__pyx_t_6))) {
  10769. if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
  10770. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10771. __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)
  10772. #else
  10773. __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)
  10774. __Pyx_GOTREF(__pyx_t_1);
  10775. #endif
  10776. } else {
  10777. if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
  10778. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10779. __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)
  10780. #else
  10781. __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)
  10782. __Pyx_GOTREF(__pyx_t_1);
  10783. #endif
  10784. }
  10785. } else {
  10786. __pyx_t_1 = __pyx_t_10(__pyx_t_6);
  10787. if (unlikely(!__pyx_t_1)) {
  10788. PyObject* exc_type = PyErr_Occurred();
  10789. if (exc_type) {
  10790. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10791. else __PYX_ERR(0, 1050, __pyx_L1_error)
  10792. }
  10793. break;
  10794. }
  10795. __Pyx_GOTREF(__pyx_t_1);
  10796. }
  10797. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  10798. __pyx_t_1 = 0;
  10799. /* "gedlibpy.pyx":1052
  10800. * for h in range(listID[0], listID[1]) :
  10801. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10802. * self.run_method(g,h) # <<<<<<<<<<<<<<
  10803. * #res.append((get_upper_bound(g,h), get_node_map(g,h), get_runtime(g,h)))
  10804. *
  10805. */
  10806. __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)
  10807. __Pyx_GOTREF(__pyx_t_2);
  10808. __pyx_t_11 = NULL;
  10809. __pyx_t_5 = 0;
  10810. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10811. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
  10812. if (likely(__pyx_t_11)) {
  10813. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10814. __Pyx_INCREF(__pyx_t_11);
  10815. __Pyx_INCREF(function);
  10816. __Pyx_DECREF_SET(__pyx_t_2, function);
  10817. __pyx_t_5 = 1;
  10818. }
  10819. }
  10820. #if CYTHON_FAST_PYCALL
  10821. if (PyFunction_Check(__pyx_t_2)) {
  10822. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10823. __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)
  10824. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10825. __Pyx_GOTREF(__pyx_t_1);
  10826. } else
  10827. #endif
  10828. #if CYTHON_FAST_PYCCALL
  10829. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10830. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10831. __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)
  10832. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10833. __Pyx_GOTREF(__pyx_t_1);
  10834. } else
  10835. #endif
  10836. {
  10837. __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10838. __Pyx_GOTREF(__pyx_t_12);
  10839. if (__pyx_t_11) {
  10840. __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
  10841. }
  10842. __Pyx_INCREF(__pyx_v_g);
  10843. __Pyx_GIVEREF(__pyx_v_g);
  10844. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_g);
  10845. __Pyx_INCREF(__pyx_v_h);
  10846. __Pyx_GIVEREF(__pyx_v_h);
  10847. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_h);
  10848. __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)
  10849. __Pyx_GOTREF(__pyx_t_1);
  10850. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10851. }
  10852. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10853. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10854. /* "gedlibpy.pyx":1050
  10855. * for g in range(listID[0], listID[1]) :
  10856. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10857. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10858. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10859. * self.run_method(g,h)
  10860. */
  10861. }
  10862. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10863. /* "gedlibpy.pyx":1048
  10864. *
  10865. * #res = []
  10866. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10867. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10868. * for h in range(listID[0], listID[1]) :
  10869. */
  10870. }
  10871. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10872. /* "gedlibpy.pyx":1057
  10873. * #return res
  10874. *
  10875. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  10876. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10877. * return listID
  10878. */
  10879. __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)
  10880. __Pyx_GOTREF(__pyx_t_3);
  10881. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10882. /* "gedlibpy.pyx":1058
  10883. *
  10884. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10885. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  10886. * return listID
  10887. *
  10888. */
  10889. __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)
  10890. __Pyx_GOTREF(__pyx_t_3);
  10891. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10892. /* "gedlibpy.pyx":1059
  10893. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10894. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10895. * return listID # <<<<<<<<<<<<<<
  10896. *
  10897. *
  10898. */
  10899. __Pyx_XDECREF(__pyx_r);
  10900. __Pyx_INCREF(__pyx_v_listID);
  10901. __pyx_r = __pyx_v_listID;
  10902. goto __pyx_L0;
  10903. /* "gedlibpy.pyx":1006
  10904. *
  10905. *
  10906. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10907. * """
  10908. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10909. */
  10910. /* function exit code */
  10911. __pyx_L1_error:;
  10912. __Pyx_XDECREF(__pyx_t_1);
  10913. __Pyx_XDECREF(__pyx_t_2);
  10914. __Pyx_XDECREF(__pyx_t_3);
  10915. __Pyx_XDECREF(__pyx_t_6);
  10916. __Pyx_XDECREF(__pyx_t_11);
  10917. __Pyx_XDECREF(__pyx_t_12);
  10918. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10919. __pyx_r = NULL;
  10920. __pyx_L0:;
  10921. __Pyx_XDECREF(__pyx_v_listID);
  10922. __Pyx_XDECREF(__pyx_v_g);
  10923. __Pyx_XDECREF(__pyx_v_h);
  10924. __Pyx_XGIVEREF(__pyx_r);
  10925. __Pyx_RefNannyFinishContext();
  10926. return __pyx_r;
  10927. }
  10928. /* "gedlibpy.pyx":1062
  10929. *
  10930. *
  10931. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10932. * """
  10933. * Returns the number of node labels.
  10934. */
  10935. /* Python wrapper */
  10936. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10937. 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";
  10938. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10939. PyObject *__pyx_r = 0;
  10940. __Pyx_RefNannyDeclarations
  10941. __Pyx_RefNannySetupContext("get_num_node_labels (wrapper)", 0);
  10942. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10943. /* function exit code */
  10944. __Pyx_RefNannyFinishContext();
  10945. return __pyx_r;
  10946. }
  10947. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10948. PyObject *__pyx_r = NULL;
  10949. __Pyx_RefNannyDeclarations
  10950. size_t __pyx_t_1;
  10951. PyObject *__pyx_t_2 = NULL;
  10952. __Pyx_RefNannySetupContext("get_num_node_labels", 0);
  10953. /* "gedlibpy.pyx":1071
  10954. * .. note:: If 1 is returned, the nodes are unlabeled.
  10955. * """
  10956. * return self.c_env.getNumNodeLabels() # <<<<<<<<<<<<<<
  10957. *
  10958. *
  10959. */
  10960. __Pyx_XDECREF(__pyx_r);
  10961. try {
  10962. __pyx_t_1 = __pyx_v_self->c_env->getNumNodeLabels();
  10963. } catch(...) {
  10964. __Pyx_CppExn2PyErr();
  10965. __PYX_ERR(0, 1071, __pyx_L1_error)
  10966. }
  10967. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error)
  10968. __Pyx_GOTREF(__pyx_t_2);
  10969. __pyx_r = __pyx_t_2;
  10970. __pyx_t_2 = 0;
  10971. goto __pyx_L0;
  10972. /* "gedlibpy.pyx":1062
  10973. *
  10974. *
  10975. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10976. * """
  10977. * Returns the number of node labels.
  10978. */
  10979. /* function exit code */
  10980. __pyx_L1_error:;
  10981. __Pyx_XDECREF(__pyx_t_2);
  10982. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10983. __pyx_r = NULL;
  10984. __pyx_L0:;
  10985. __Pyx_XGIVEREF(__pyx_r);
  10986. __Pyx_RefNannyFinishContext();
  10987. return __pyx_r;
  10988. }
  10989. /* "gedlibpy.pyx":1074
  10990. *
  10991. *
  10992. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  10993. * """
  10994. * Returns node label.
  10995. */
  10996. /* Python wrapper */
  10997. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  10998. 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";
  10999. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11000. PyObject *__pyx_r = 0;
  11001. __Pyx_RefNannyDeclarations
  11002. __Pyx_RefNannySetupContext("get_node_label (wrapper)", 0);
  11003. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11004. /* function exit code */
  11005. __Pyx_RefNannyFinishContext();
  11006. return __pyx_r;
  11007. }
  11008. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11009. PyObject *__pyx_r = NULL;
  11010. __Pyx_RefNannyDeclarations
  11011. PyObject *__pyx_t_1 = NULL;
  11012. PyObject *__pyx_t_2 = NULL;
  11013. size_t __pyx_t_3;
  11014. std::map<std::string,std::string> __pyx_t_4;
  11015. PyObject *__pyx_t_5 = NULL;
  11016. PyObject *__pyx_t_6 = NULL;
  11017. __Pyx_RefNannySetupContext("get_node_label", 0);
  11018. /* "gedlibpy.pyx":1083
  11019. * :rtype: dict{string : string}
  11020. * """
  11021. * return decode_your_map(self.c_env.getNodeLabel(label_id)) # <<<<<<<<<<<<<<
  11022. *
  11023. *
  11024. */
  11025. __Pyx_XDECREF(__pyx_r);
  11026. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
  11027. __Pyx_GOTREF(__pyx_t_2);
  11028. __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)
  11029. try {
  11030. __pyx_t_4 = __pyx_v_self->c_env->getNodeLabel(__pyx_t_3);
  11031. } catch(...) {
  11032. __Pyx_CppExn2PyErr();
  11033. __PYX_ERR(0, 1083, __pyx_L1_error)
  11034. }
  11035. __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)
  11036. __Pyx_GOTREF(__pyx_t_5);
  11037. __pyx_t_6 = NULL;
  11038. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11039. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11040. if (likely(__pyx_t_6)) {
  11041. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11042. __Pyx_INCREF(__pyx_t_6);
  11043. __Pyx_INCREF(function);
  11044. __Pyx_DECREF_SET(__pyx_t_2, function);
  11045. }
  11046. }
  11047. __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);
  11048. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11049. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11050. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
  11051. __Pyx_GOTREF(__pyx_t_1);
  11052. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11053. __pyx_r = __pyx_t_1;
  11054. __pyx_t_1 = 0;
  11055. goto __pyx_L0;
  11056. /* "gedlibpy.pyx":1074
  11057. *
  11058. *
  11059. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  11060. * """
  11061. * Returns node label.
  11062. */
  11063. /* function exit code */
  11064. __pyx_L1_error:;
  11065. __Pyx_XDECREF(__pyx_t_1);
  11066. __Pyx_XDECREF(__pyx_t_2);
  11067. __Pyx_XDECREF(__pyx_t_5);
  11068. __Pyx_XDECREF(__pyx_t_6);
  11069. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11070. __pyx_r = NULL;
  11071. __pyx_L0:;
  11072. __Pyx_XGIVEREF(__pyx_r);
  11073. __Pyx_RefNannyFinishContext();
  11074. return __pyx_r;
  11075. }
  11076. /* "gedlibpy.pyx":1086
  11077. *
  11078. *
  11079. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11080. * """
  11081. * Returns the number of edge labels.
  11082. */
  11083. /* Python wrapper */
  11084. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11085. 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";
  11086. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11087. PyObject *__pyx_r = 0;
  11088. __Pyx_RefNannyDeclarations
  11089. __Pyx_RefNannySetupContext("get_num_edge_labels (wrapper)", 0);
  11090. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11091. /* function exit code */
  11092. __Pyx_RefNannyFinishContext();
  11093. return __pyx_r;
  11094. }
  11095. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11096. PyObject *__pyx_r = NULL;
  11097. __Pyx_RefNannyDeclarations
  11098. size_t __pyx_t_1;
  11099. PyObject *__pyx_t_2 = NULL;
  11100. __Pyx_RefNannySetupContext("get_num_edge_labels", 0);
  11101. /* "gedlibpy.pyx":1095
  11102. * .. note:: If 1 is returned, the edges are unlabeled.
  11103. * """
  11104. * return self.c_env.getNumEdgeLabels() # <<<<<<<<<<<<<<
  11105. *
  11106. *
  11107. */
  11108. __Pyx_XDECREF(__pyx_r);
  11109. try {
  11110. __pyx_t_1 = __pyx_v_self->c_env->getNumEdgeLabels();
  11111. } catch(...) {
  11112. __Pyx_CppExn2PyErr();
  11113. __PYX_ERR(0, 1095, __pyx_L1_error)
  11114. }
  11115. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
  11116. __Pyx_GOTREF(__pyx_t_2);
  11117. __pyx_r = __pyx_t_2;
  11118. __pyx_t_2 = 0;
  11119. goto __pyx_L0;
  11120. /* "gedlibpy.pyx":1086
  11121. *
  11122. *
  11123. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11124. * """
  11125. * Returns the number of edge labels.
  11126. */
  11127. /* function exit code */
  11128. __pyx_L1_error:;
  11129. __Pyx_XDECREF(__pyx_t_2);
  11130. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_edge_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11131. __pyx_r = NULL;
  11132. __pyx_L0:;
  11133. __Pyx_XGIVEREF(__pyx_r);
  11134. __Pyx_RefNannyFinishContext();
  11135. return __pyx_r;
  11136. }
  11137. /* "gedlibpy.pyx":1098
  11138. *
  11139. *
  11140. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11141. * """
  11142. * Returns edge label.
  11143. */
  11144. /* Python wrapper */
  11145. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  11146. 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";
  11147. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11148. PyObject *__pyx_r = 0;
  11149. __Pyx_RefNannyDeclarations
  11150. __Pyx_RefNannySetupContext("get_edge_label (wrapper)", 0);
  11151. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11152. /* function exit code */
  11153. __Pyx_RefNannyFinishContext();
  11154. return __pyx_r;
  11155. }
  11156. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11157. PyObject *__pyx_r = NULL;
  11158. __Pyx_RefNannyDeclarations
  11159. PyObject *__pyx_t_1 = NULL;
  11160. PyObject *__pyx_t_2 = NULL;
  11161. size_t __pyx_t_3;
  11162. std::map<std::string,std::string> __pyx_t_4;
  11163. PyObject *__pyx_t_5 = NULL;
  11164. PyObject *__pyx_t_6 = NULL;
  11165. __Pyx_RefNannySetupContext("get_edge_label", 0);
  11166. /* "gedlibpy.pyx":1107
  11167. * :rtype: dict{string : string}
  11168. * """
  11169. * return decode_your_map(self.c_env.getEdgeLabel(label_id)) # <<<<<<<<<<<<<<
  11170. *
  11171. *
  11172. */
  11173. __Pyx_XDECREF(__pyx_r);
  11174. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error)
  11175. __Pyx_GOTREF(__pyx_t_2);
  11176. __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)
  11177. try {
  11178. __pyx_t_4 = __pyx_v_self->c_env->getEdgeLabel(__pyx_t_3);
  11179. } catch(...) {
  11180. __Pyx_CppExn2PyErr();
  11181. __PYX_ERR(0, 1107, __pyx_L1_error)
  11182. }
  11183. __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)
  11184. __Pyx_GOTREF(__pyx_t_5);
  11185. __pyx_t_6 = NULL;
  11186. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11187. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11188. if (likely(__pyx_t_6)) {
  11189. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11190. __Pyx_INCREF(__pyx_t_6);
  11191. __Pyx_INCREF(function);
  11192. __Pyx_DECREF_SET(__pyx_t_2, function);
  11193. }
  11194. }
  11195. __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);
  11196. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11197. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11198. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
  11199. __Pyx_GOTREF(__pyx_t_1);
  11200. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11201. __pyx_r = __pyx_t_1;
  11202. __pyx_t_1 = 0;
  11203. goto __pyx_L0;
  11204. /* "gedlibpy.pyx":1098
  11205. *
  11206. *
  11207. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11208. * """
  11209. * Returns edge label.
  11210. */
  11211. /* function exit code */
  11212. __pyx_L1_error:;
  11213. __Pyx_XDECREF(__pyx_t_1);
  11214. __Pyx_XDECREF(__pyx_t_2);
  11215. __Pyx_XDECREF(__pyx_t_5);
  11216. __Pyx_XDECREF(__pyx_t_6);
  11217. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11218. __pyx_r = NULL;
  11219. __pyx_L0:;
  11220. __Pyx_XGIVEREF(__pyx_r);
  11221. __Pyx_RefNannyFinishContext();
  11222. return __pyx_r;
  11223. }
  11224. /* "gedlibpy.pyx":1121
  11225. * # return self.c_env.getNumNodes(graph_id)
  11226. *
  11227. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11228. * """
  11229. * Returns average number of nodes.
  11230. */
  11231. /* Python wrapper */
  11232. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11233. 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";
  11234. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11235. PyObject *__pyx_r = 0;
  11236. __Pyx_RefNannyDeclarations
  11237. __Pyx_RefNannySetupContext("get_avg_num_nodes (wrapper)", 0);
  11238. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11239. /* function exit code */
  11240. __Pyx_RefNannyFinishContext();
  11241. return __pyx_r;
  11242. }
  11243. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11244. PyObject *__pyx_r = NULL;
  11245. __Pyx_RefNannyDeclarations
  11246. double __pyx_t_1;
  11247. PyObject *__pyx_t_2 = NULL;
  11248. __Pyx_RefNannySetupContext("get_avg_num_nodes", 0);
  11249. /* "gedlibpy.pyx":1128
  11250. * :rtype: double
  11251. * """
  11252. * return self.c_env.getAvgNumNodes() # <<<<<<<<<<<<<<
  11253. *
  11254. * def get_node_rel_cost(self, node_label_1, node_label_2):
  11255. */
  11256. __Pyx_XDECREF(__pyx_r);
  11257. try {
  11258. __pyx_t_1 = __pyx_v_self->c_env->getAvgNumNodes();
  11259. } catch(...) {
  11260. __Pyx_CppExn2PyErr();
  11261. __PYX_ERR(0, 1128, __pyx_L1_error)
  11262. }
  11263. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error)
  11264. __Pyx_GOTREF(__pyx_t_2);
  11265. __pyx_r = __pyx_t_2;
  11266. __pyx_t_2 = 0;
  11267. goto __pyx_L0;
  11268. /* "gedlibpy.pyx":1121
  11269. * # return self.c_env.getNumNodes(graph_id)
  11270. *
  11271. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11272. * """
  11273. * Returns average number of nodes.
  11274. */
  11275. /* function exit code */
  11276. __pyx_L1_error:;
  11277. __Pyx_XDECREF(__pyx_t_2);
  11278. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_avg_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11279. __pyx_r = NULL;
  11280. __pyx_L0:;
  11281. __Pyx_XGIVEREF(__pyx_r);
  11282. __Pyx_RefNannyFinishContext();
  11283. return __pyx_r;
  11284. }
  11285. /* "gedlibpy.pyx":1130
  11286. * return self.c_env.getAvgNumNodes()
  11287. *
  11288. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11289. * """
  11290. * Returns node relabeling cost.
  11291. */
  11292. /* Python wrapper */
  11293. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11294. 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";
  11295. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11296. PyObject *__pyx_v_node_label_1 = 0;
  11297. PyObject *__pyx_v_node_label_2 = 0;
  11298. PyObject *__pyx_r = 0;
  11299. __Pyx_RefNannyDeclarations
  11300. __Pyx_RefNannySetupContext("get_node_rel_cost (wrapper)", 0);
  11301. {
  11302. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_label_1,&__pyx_n_s_node_label_2,0};
  11303. PyObject* values[2] = {0,0};
  11304. if (unlikely(__pyx_kwds)) {
  11305. Py_ssize_t kw_args;
  11306. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11307. switch (pos_args) {
  11308. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11309. CYTHON_FALLTHROUGH;
  11310. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11311. CYTHON_FALLTHROUGH;
  11312. case 0: break;
  11313. default: goto __pyx_L5_argtuple_error;
  11314. }
  11315. kw_args = PyDict_Size(__pyx_kwds);
  11316. switch (pos_args) {
  11317. case 0:
  11318. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_1)) != 0)) kw_args--;
  11319. else goto __pyx_L5_argtuple_error;
  11320. CYTHON_FALLTHROUGH;
  11321. case 1:
  11322. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_2)) != 0)) kw_args--;
  11323. else {
  11324. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1130, __pyx_L3_error)
  11325. }
  11326. }
  11327. if (unlikely(kw_args > 0)) {
  11328. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error)
  11329. }
  11330. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11331. goto __pyx_L5_argtuple_error;
  11332. } else {
  11333. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11334. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11335. }
  11336. __pyx_v_node_label_1 = values[0];
  11337. __pyx_v_node_label_2 = values[1];
  11338. }
  11339. goto __pyx_L4_argument_unpacking_done;
  11340. __pyx_L5_argtuple_error:;
  11341. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error)
  11342. __pyx_L3_error:;
  11343. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11344. __Pyx_RefNannyFinishContext();
  11345. return NULL;
  11346. __pyx_L4_argument_unpacking_done:;
  11347. __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);
  11348. /* function exit code */
  11349. __Pyx_RefNannyFinishContext();
  11350. return __pyx_r;
  11351. }
  11352. 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) {
  11353. PyObject *__pyx_r = NULL;
  11354. __Pyx_RefNannyDeclarations
  11355. PyObject *__pyx_t_1 = NULL;
  11356. PyObject *__pyx_t_2 = NULL;
  11357. PyObject *__pyx_t_3 = NULL;
  11358. std::map<std::string,std::string> __pyx_t_4;
  11359. std::map<std::string,std::string> __pyx_t_5;
  11360. double __pyx_t_6;
  11361. __Pyx_RefNannySetupContext("get_node_rel_cost", 0);
  11362. /* "gedlibpy.pyx":1141
  11363. * :rtype: double
  11364. * """
  11365. * return self.c_env.getNodeRelCost(encode_your_map(node_label_1), encode_your_map(node_label_2)) # <<<<<<<<<<<<<<
  11366. *
  11367. *
  11368. */
  11369. __Pyx_XDECREF(__pyx_r);
  11370. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11371. __Pyx_GOTREF(__pyx_t_2);
  11372. __pyx_t_3 = NULL;
  11373. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11374. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11375. if (likely(__pyx_t_3)) {
  11376. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11377. __Pyx_INCREF(__pyx_t_3);
  11378. __Pyx_INCREF(function);
  11379. __Pyx_DECREF_SET(__pyx_t_2, function);
  11380. }
  11381. }
  11382. __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);
  11383. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11384. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11385. __Pyx_GOTREF(__pyx_t_1);
  11386. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11387. __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)
  11388. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11389. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11390. __Pyx_GOTREF(__pyx_t_2);
  11391. __pyx_t_3 = NULL;
  11392. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11393. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11394. if (likely(__pyx_t_3)) {
  11395. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11396. __Pyx_INCREF(__pyx_t_3);
  11397. __Pyx_INCREF(function);
  11398. __Pyx_DECREF_SET(__pyx_t_2, function);
  11399. }
  11400. }
  11401. __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);
  11402. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11403. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11404. __Pyx_GOTREF(__pyx_t_1);
  11405. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11406. __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)
  11407. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11408. try {
  11409. __pyx_t_6 = __pyx_v_self->c_env->getNodeRelCost(__pyx_t_4, __pyx_t_5);
  11410. } catch(...) {
  11411. __Pyx_CppExn2PyErr();
  11412. __PYX_ERR(0, 1141, __pyx_L1_error)
  11413. }
  11414. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11415. __Pyx_GOTREF(__pyx_t_1);
  11416. __pyx_r = __pyx_t_1;
  11417. __pyx_t_1 = 0;
  11418. goto __pyx_L0;
  11419. /* "gedlibpy.pyx":1130
  11420. * return self.c_env.getAvgNumNodes()
  11421. *
  11422. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11423. * """
  11424. * Returns node relabeling cost.
  11425. */
  11426. /* function exit code */
  11427. __pyx_L1_error:;
  11428. __Pyx_XDECREF(__pyx_t_1);
  11429. __Pyx_XDECREF(__pyx_t_2);
  11430. __Pyx_XDECREF(__pyx_t_3);
  11431. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11432. __pyx_r = NULL;
  11433. __pyx_L0:;
  11434. __Pyx_XGIVEREF(__pyx_r);
  11435. __Pyx_RefNannyFinishContext();
  11436. return __pyx_r;
  11437. }
  11438. /* "gedlibpy.pyx":1144
  11439. *
  11440. *
  11441. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11442. * """
  11443. * Returns node deletion cost.
  11444. */
  11445. /* Python wrapper */
  11446. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11447. 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";
  11448. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11449. PyObject *__pyx_r = 0;
  11450. __Pyx_RefNannyDeclarations
  11451. __Pyx_RefNannySetupContext("get_node_del_cost (wrapper)", 0);
  11452. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11453. /* function exit code */
  11454. __Pyx_RefNannyFinishContext();
  11455. return __pyx_r;
  11456. }
  11457. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11458. PyObject *__pyx_r = NULL;
  11459. __Pyx_RefNannyDeclarations
  11460. PyObject *__pyx_t_1 = NULL;
  11461. PyObject *__pyx_t_2 = NULL;
  11462. PyObject *__pyx_t_3 = NULL;
  11463. std::map<std::string,std::string> __pyx_t_4;
  11464. double __pyx_t_5;
  11465. __Pyx_RefNannySetupContext("get_node_del_cost", 0);
  11466. /* "gedlibpy.pyx":1153
  11467. * :rtype: double
  11468. * """
  11469. * return self.c_env.getNodeDelCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11470. *
  11471. *
  11472. */
  11473. __Pyx_XDECREF(__pyx_r);
  11474. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11475. __Pyx_GOTREF(__pyx_t_2);
  11476. __pyx_t_3 = NULL;
  11477. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11478. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11479. if (likely(__pyx_t_3)) {
  11480. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11481. __Pyx_INCREF(__pyx_t_3);
  11482. __Pyx_INCREF(function);
  11483. __Pyx_DECREF_SET(__pyx_t_2, function);
  11484. }
  11485. }
  11486. __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);
  11487. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11488. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11489. __Pyx_GOTREF(__pyx_t_1);
  11490. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11491. __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)
  11492. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11493. try {
  11494. __pyx_t_5 = __pyx_v_self->c_env->getNodeDelCost(__pyx_t_4);
  11495. } catch(...) {
  11496. __Pyx_CppExn2PyErr();
  11497. __PYX_ERR(0, 1153, __pyx_L1_error)
  11498. }
  11499. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11500. __Pyx_GOTREF(__pyx_t_1);
  11501. __pyx_r = __pyx_t_1;
  11502. __pyx_t_1 = 0;
  11503. goto __pyx_L0;
  11504. /* "gedlibpy.pyx":1144
  11505. *
  11506. *
  11507. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11508. * """
  11509. * Returns node deletion cost.
  11510. */
  11511. /* function exit code */
  11512. __pyx_L1_error:;
  11513. __Pyx_XDECREF(__pyx_t_1);
  11514. __Pyx_XDECREF(__pyx_t_2);
  11515. __Pyx_XDECREF(__pyx_t_3);
  11516. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11517. __pyx_r = NULL;
  11518. __pyx_L0:;
  11519. __Pyx_XGIVEREF(__pyx_r);
  11520. __Pyx_RefNannyFinishContext();
  11521. return __pyx_r;
  11522. }
  11523. /* "gedlibpy.pyx":1156
  11524. *
  11525. *
  11526. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11527. * """
  11528. * Returns node insertion cost.
  11529. */
  11530. /* Python wrapper */
  11531. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11532. 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";
  11533. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11534. PyObject *__pyx_r = 0;
  11535. __Pyx_RefNannyDeclarations
  11536. __Pyx_RefNannySetupContext("get_node_ins_cost (wrapper)", 0);
  11537. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11538. /* function exit code */
  11539. __Pyx_RefNannyFinishContext();
  11540. return __pyx_r;
  11541. }
  11542. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11543. PyObject *__pyx_r = NULL;
  11544. __Pyx_RefNannyDeclarations
  11545. PyObject *__pyx_t_1 = NULL;
  11546. PyObject *__pyx_t_2 = NULL;
  11547. PyObject *__pyx_t_3 = NULL;
  11548. std::map<std::string,std::string> __pyx_t_4;
  11549. double __pyx_t_5;
  11550. __Pyx_RefNannySetupContext("get_node_ins_cost", 0);
  11551. /* "gedlibpy.pyx":1165
  11552. * :rtype: double
  11553. * """
  11554. * return self.c_env.getNodeInsCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11555. *
  11556. *
  11557. */
  11558. __Pyx_XDECREF(__pyx_r);
  11559. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11560. __Pyx_GOTREF(__pyx_t_2);
  11561. __pyx_t_3 = NULL;
  11562. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11563. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11564. if (likely(__pyx_t_3)) {
  11565. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11566. __Pyx_INCREF(__pyx_t_3);
  11567. __Pyx_INCREF(function);
  11568. __Pyx_DECREF_SET(__pyx_t_2, function);
  11569. }
  11570. }
  11571. __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);
  11572. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11573. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11574. __Pyx_GOTREF(__pyx_t_1);
  11575. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11576. __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)
  11577. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11578. try {
  11579. __pyx_t_5 = __pyx_v_self->c_env->getNodeInsCost(__pyx_t_4);
  11580. } catch(...) {
  11581. __Pyx_CppExn2PyErr();
  11582. __PYX_ERR(0, 1165, __pyx_L1_error)
  11583. }
  11584. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11585. __Pyx_GOTREF(__pyx_t_1);
  11586. __pyx_r = __pyx_t_1;
  11587. __pyx_t_1 = 0;
  11588. goto __pyx_L0;
  11589. /* "gedlibpy.pyx":1156
  11590. *
  11591. *
  11592. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11593. * """
  11594. * Returns node insertion cost.
  11595. */
  11596. /* function exit code */
  11597. __pyx_L1_error:;
  11598. __Pyx_XDECREF(__pyx_t_1);
  11599. __Pyx_XDECREF(__pyx_t_2);
  11600. __Pyx_XDECREF(__pyx_t_3);
  11601. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11602. __pyx_r = NULL;
  11603. __pyx_L0:;
  11604. __Pyx_XGIVEREF(__pyx_r);
  11605. __Pyx_RefNannyFinishContext();
  11606. return __pyx_r;
  11607. }
  11608. /* "gedlibpy.pyx":1168
  11609. *
  11610. *
  11611. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11612. * """
  11613. * Computes median node label.
  11614. */
  11615. /* Python wrapper */
  11616. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels); /*proto*/
  11617. 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";
  11618. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11619. PyObject *__pyx_r = 0;
  11620. __Pyx_RefNannyDeclarations
  11621. __Pyx_RefNannySetupContext("get_median_node_label (wrapper)", 0);
  11622. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_labels));
  11623. /* function exit code */
  11624. __Pyx_RefNannyFinishContext();
  11625. return __pyx_r;
  11626. }
  11627. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11628. PyObject *__pyx_v_node_labels_b = NULL;
  11629. PyObject *__pyx_8genexpr9__pyx_v_node_label = NULL;
  11630. PyObject *__pyx_r = NULL;
  11631. __Pyx_RefNannyDeclarations
  11632. PyObject *__pyx_t_1 = NULL;
  11633. PyObject *__pyx_t_2 = NULL;
  11634. Py_ssize_t __pyx_t_3;
  11635. PyObject *(*__pyx_t_4)(PyObject *);
  11636. PyObject *__pyx_t_5 = NULL;
  11637. PyObject *__pyx_t_6 = NULL;
  11638. PyObject *__pyx_t_7 = NULL;
  11639. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  11640. std::map<std::string,std::string> __pyx_t_9;
  11641. __Pyx_RefNannySetupContext("get_median_node_label", 0);
  11642. /* "gedlibpy.pyx":1177
  11643. * :rtype: dict{string : string}
  11644. * """
  11645. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] # <<<<<<<<<<<<<<
  11646. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b))
  11647. *
  11648. */
  11649. { /* enter inner scope */
  11650. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11651. __Pyx_GOTREF(__pyx_t_1);
  11652. if (likely(PyList_CheckExact(__pyx_v_node_labels)) || PyTuple_CheckExact(__pyx_v_node_labels)) {
  11653. __pyx_t_2 = __pyx_v_node_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  11654. __pyx_t_4 = NULL;
  11655. } else {
  11656. __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)
  11657. __Pyx_GOTREF(__pyx_t_2);
  11658. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11659. }
  11660. for (;;) {
  11661. if (likely(!__pyx_t_4)) {
  11662. if (likely(PyList_CheckExact(__pyx_t_2))) {
  11663. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  11664. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11665. __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)
  11666. #else
  11667. __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)
  11668. __Pyx_GOTREF(__pyx_t_5);
  11669. #endif
  11670. } else {
  11671. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  11672. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11673. __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)
  11674. #else
  11675. __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)
  11676. __Pyx_GOTREF(__pyx_t_5);
  11677. #endif
  11678. }
  11679. } else {
  11680. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  11681. if (unlikely(!__pyx_t_5)) {
  11682. PyObject* exc_type = PyErr_Occurred();
  11683. if (exc_type) {
  11684. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11685. else __PYX_ERR(0, 1177, __pyx_L5_error)
  11686. }
  11687. break;
  11688. }
  11689. __Pyx_GOTREF(__pyx_t_5);
  11690. }
  11691. __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_node_label, __pyx_t_5);
  11692. __pyx_t_5 = 0;
  11693. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11694. __Pyx_GOTREF(__pyx_t_6);
  11695. __pyx_t_7 = NULL;
  11696. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  11697. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  11698. if (likely(__pyx_t_7)) {
  11699. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  11700. __Pyx_INCREF(__pyx_t_7);
  11701. __Pyx_INCREF(function);
  11702. __Pyx_DECREF_SET(__pyx_t_6, function);
  11703. }
  11704. }
  11705. __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);
  11706. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  11707. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11708. __Pyx_GOTREF(__pyx_t_5);
  11709. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  11710. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1177, __pyx_L5_error)
  11711. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11712. }
  11713. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11714. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11715. goto __pyx_L8_exit_scope;
  11716. __pyx_L5_error:;
  11717. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11718. goto __pyx_L1_error;
  11719. __pyx_L8_exit_scope:;
  11720. } /* exit inner scope */
  11721. __pyx_v_node_labels_b = ((PyObject*)__pyx_t_1);
  11722. __pyx_t_1 = 0;
  11723. /* "gedlibpy.pyx":1178
  11724. * """
  11725. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels]
  11726. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b)) # <<<<<<<<<<<<<<
  11727. *
  11728. *
  11729. */
  11730. __Pyx_XDECREF(__pyx_r);
  11731. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
  11732. __Pyx_GOTREF(__pyx_t_2);
  11733. __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)
  11734. try {
  11735. __pyx_t_9 = __pyx_v_self->c_env->getMedianNodeLabel(__pyx_t_8);
  11736. } catch(...) {
  11737. __Pyx_CppExn2PyErr();
  11738. __PYX_ERR(0, 1178, __pyx_L1_error)
  11739. }
  11740. __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)
  11741. __Pyx_GOTREF(__pyx_t_5);
  11742. __pyx_t_6 = NULL;
  11743. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11744. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11745. if (likely(__pyx_t_6)) {
  11746. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11747. __Pyx_INCREF(__pyx_t_6);
  11748. __Pyx_INCREF(function);
  11749. __Pyx_DECREF_SET(__pyx_t_2, function);
  11750. }
  11751. }
  11752. __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);
  11753. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11754. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11755. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
  11756. __Pyx_GOTREF(__pyx_t_1);
  11757. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11758. __pyx_r = __pyx_t_1;
  11759. __pyx_t_1 = 0;
  11760. goto __pyx_L0;
  11761. /* "gedlibpy.pyx":1168
  11762. *
  11763. *
  11764. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11765. * """
  11766. * Computes median node label.
  11767. */
  11768. /* function exit code */
  11769. __pyx_L1_error:;
  11770. __Pyx_XDECREF(__pyx_t_1);
  11771. __Pyx_XDECREF(__pyx_t_2);
  11772. __Pyx_XDECREF(__pyx_t_5);
  11773. __Pyx_XDECREF(__pyx_t_6);
  11774. __Pyx_XDECREF(__pyx_t_7);
  11775. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11776. __pyx_r = NULL;
  11777. __pyx_L0:;
  11778. __Pyx_XDECREF(__pyx_v_node_labels_b);
  11779. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label);
  11780. __Pyx_XGIVEREF(__pyx_r);
  11781. __Pyx_RefNannyFinishContext();
  11782. return __pyx_r;
  11783. }
  11784. /* "gedlibpy.pyx":1181
  11785. *
  11786. *
  11787. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11788. * """
  11789. * Returns edge relabeling cost.
  11790. */
  11791. /* Python wrapper */
  11792. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11793. 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";
  11794. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11795. PyObject *__pyx_v_edge_label_1 = 0;
  11796. PyObject *__pyx_v_edge_label_2 = 0;
  11797. PyObject *__pyx_r = 0;
  11798. __Pyx_RefNannyDeclarations
  11799. __Pyx_RefNannySetupContext("get_edge_rel_cost (wrapper)", 0);
  11800. {
  11801. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_label_1,&__pyx_n_s_edge_label_2,0};
  11802. PyObject* values[2] = {0,0};
  11803. if (unlikely(__pyx_kwds)) {
  11804. Py_ssize_t kw_args;
  11805. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11806. switch (pos_args) {
  11807. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11808. CYTHON_FALLTHROUGH;
  11809. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11810. CYTHON_FALLTHROUGH;
  11811. case 0: break;
  11812. default: goto __pyx_L5_argtuple_error;
  11813. }
  11814. kw_args = PyDict_Size(__pyx_kwds);
  11815. switch (pos_args) {
  11816. case 0:
  11817. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_1)) != 0)) kw_args--;
  11818. else goto __pyx_L5_argtuple_error;
  11819. CYTHON_FALLTHROUGH;
  11820. case 1:
  11821. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_2)) != 0)) kw_args--;
  11822. else {
  11823. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1181, __pyx_L3_error)
  11824. }
  11825. }
  11826. if (unlikely(kw_args > 0)) {
  11827. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1181, __pyx_L3_error)
  11828. }
  11829. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11830. goto __pyx_L5_argtuple_error;
  11831. } else {
  11832. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11833. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11834. }
  11835. __pyx_v_edge_label_1 = values[0];
  11836. __pyx_v_edge_label_2 = values[1];
  11837. }
  11838. goto __pyx_L4_argument_unpacking_done;
  11839. __pyx_L5_argtuple_error:;
  11840. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1181, __pyx_L3_error)
  11841. __pyx_L3_error:;
  11842. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11843. __Pyx_RefNannyFinishContext();
  11844. return NULL;
  11845. __pyx_L4_argument_unpacking_done:;
  11846. __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);
  11847. /* function exit code */
  11848. __Pyx_RefNannyFinishContext();
  11849. return __pyx_r;
  11850. }
  11851. 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) {
  11852. PyObject *__pyx_r = NULL;
  11853. __Pyx_RefNannyDeclarations
  11854. PyObject *__pyx_t_1 = NULL;
  11855. PyObject *__pyx_t_2 = NULL;
  11856. PyObject *__pyx_t_3 = NULL;
  11857. std::map<std::string,std::string> __pyx_t_4;
  11858. std::map<std::string,std::string> __pyx_t_5;
  11859. double __pyx_t_6;
  11860. __Pyx_RefNannySetupContext("get_edge_rel_cost", 0);
  11861. /* "gedlibpy.pyx":1192
  11862. * :rtype: double
  11863. * """
  11864. * return self.c_env.getEdgeRelCost(encode_your_map(edge_label_1), encode_your_map(edge_label_2)) # <<<<<<<<<<<<<<
  11865. *
  11866. *
  11867. */
  11868. __Pyx_XDECREF(__pyx_r);
  11869. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11870. __Pyx_GOTREF(__pyx_t_2);
  11871. __pyx_t_3 = NULL;
  11872. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11873. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11874. if (likely(__pyx_t_3)) {
  11875. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11876. __Pyx_INCREF(__pyx_t_3);
  11877. __Pyx_INCREF(function);
  11878. __Pyx_DECREF_SET(__pyx_t_2, function);
  11879. }
  11880. }
  11881. __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);
  11882. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11883. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11884. __Pyx_GOTREF(__pyx_t_1);
  11885. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11886. __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)
  11887. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11888. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11889. __Pyx_GOTREF(__pyx_t_2);
  11890. __pyx_t_3 = NULL;
  11891. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11892. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11893. if (likely(__pyx_t_3)) {
  11894. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11895. __Pyx_INCREF(__pyx_t_3);
  11896. __Pyx_INCREF(function);
  11897. __Pyx_DECREF_SET(__pyx_t_2, function);
  11898. }
  11899. }
  11900. __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);
  11901. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11902. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11903. __Pyx_GOTREF(__pyx_t_1);
  11904. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11905. __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)
  11906. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11907. try {
  11908. __pyx_t_6 = __pyx_v_self->c_env->getEdgeRelCost(__pyx_t_4, __pyx_t_5);
  11909. } catch(...) {
  11910. __Pyx_CppExn2PyErr();
  11911. __PYX_ERR(0, 1192, __pyx_L1_error)
  11912. }
  11913. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11914. __Pyx_GOTREF(__pyx_t_1);
  11915. __pyx_r = __pyx_t_1;
  11916. __pyx_t_1 = 0;
  11917. goto __pyx_L0;
  11918. /* "gedlibpy.pyx":1181
  11919. *
  11920. *
  11921. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11922. * """
  11923. * Returns edge relabeling cost.
  11924. */
  11925. /* function exit code */
  11926. __pyx_L1_error:;
  11927. __Pyx_XDECREF(__pyx_t_1);
  11928. __Pyx_XDECREF(__pyx_t_2);
  11929. __Pyx_XDECREF(__pyx_t_3);
  11930. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11931. __pyx_r = NULL;
  11932. __pyx_L0:;
  11933. __Pyx_XGIVEREF(__pyx_r);
  11934. __Pyx_RefNannyFinishContext();
  11935. return __pyx_r;
  11936. }
  11937. /* "gedlibpy.pyx":1195
  11938. *
  11939. *
  11940. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  11941. * """
  11942. * Returns edge deletion cost.
  11943. */
  11944. /* Python wrapper */
  11945. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  11946. 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";
  11947. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11948. PyObject *__pyx_r = 0;
  11949. __Pyx_RefNannyDeclarations
  11950. __Pyx_RefNannySetupContext("get_edge_del_cost (wrapper)", 0);
  11951. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  11952. /* function exit code */
  11953. __Pyx_RefNannyFinishContext();
  11954. return __pyx_r;
  11955. }
  11956. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11957. PyObject *__pyx_r = NULL;
  11958. __Pyx_RefNannyDeclarations
  11959. PyObject *__pyx_t_1 = NULL;
  11960. PyObject *__pyx_t_2 = NULL;
  11961. PyObject *__pyx_t_3 = NULL;
  11962. std::map<std::string,std::string> __pyx_t_4;
  11963. double __pyx_t_5;
  11964. __Pyx_RefNannySetupContext("get_edge_del_cost", 0);
  11965. /* "gedlibpy.pyx":1204
  11966. * :rtype: double
  11967. * """
  11968. * return self.c_env.getEdgeDelCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  11969. *
  11970. *
  11971. */
  11972. __Pyx_XDECREF(__pyx_r);
  11973. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
  11974. __Pyx_GOTREF(__pyx_t_2);
  11975. __pyx_t_3 = NULL;
  11976. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11977. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11978. if (likely(__pyx_t_3)) {
  11979. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11980. __Pyx_INCREF(__pyx_t_3);
  11981. __Pyx_INCREF(function);
  11982. __Pyx_DECREF_SET(__pyx_t_2, function);
  11983. }
  11984. }
  11985. __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);
  11986. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11987. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  11988. __Pyx_GOTREF(__pyx_t_1);
  11989. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11990. __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)
  11991. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11992. try {
  11993. __pyx_t_5 = __pyx_v_self->c_env->getEdgeDelCost(__pyx_t_4);
  11994. } catch(...) {
  11995. __Pyx_CppExn2PyErr();
  11996. __PYX_ERR(0, 1204, __pyx_L1_error)
  11997. }
  11998. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  11999. __Pyx_GOTREF(__pyx_t_1);
  12000. __pyx_r = __pyx_t_1;
  12001. __pyx_t_1 = 0;
  12002. goto __pyx_L0;
  12003. /* "gedlibpy.pyx":1195
  12004. *
  12005. *
  12006. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  12007. * """
  12008. * Returns edge deletion cost.
  12009. */
  12010. /* function exit code */
  12011. __pyx_L1_error:;
  12012. __Pyx_XDECREF(__pyx_t_1);
  12013. __Pyx_XDECREF(__pyx_t_2);
  12014. __Pyx_XDECREF(__pyx_t_3);
  12015. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12016. __pyx_r = NULL;
  12017. __pyx_L0:;
  12018. __Pyx_XGIVEREF(__pyx_r);
  12019. __Pyx_RefNannyFinishContext();
  12020. return __pyx_r;
  12021. }
  12022. /* "gedlibpy.pyx":1207
  12023. *
  12024. *
  12025. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12026. * """
  12027. * Returns edge insertion cost.
  12028. */
  12029. /* Python wrapper */
  12030. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  12031. 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";
  12032. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12033. PyObject *__pyx_r = 0;
  12034. __Pyx_RefNannyDeclarations
  12035. __Pyx_RefNannySetupContext("get_edge_ins_cost (wrapper)", 0);
  12036. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  12037. /* function exit code */
  12038. __Pyx_RefNannyFinishContext();
  12039. return __pyx_r;
  12040. }
  12041. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12042. PyObject *__pyx_r = NULL;
  12043. __Pyx_RefNannyDeclarations
  12044. PyObject *__pyx_t_1 = NULL;
  12045. PyObject *__pyx_t_2 = NULL;
  12046. PyObject *__pyx_t_3 = NULL;
  12047. std::map<std::string,std::string> __pyx_t_4;
  12048. double __pyx_t_5;
  12049. __Pyx_RefNannySetupContext("get_edge_ins_cost", 0);
  12050. /* "gedlibpy.pyx":1216
  12051. * :rtype: double
  12052. * """
  12053. * return self.c_env.getEdgeInsCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  12054. *
  12055. *
  12056. */
  12057. __Pyx_XDECREF(__pyx_r);
  12058. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12059. __Pyx_GOTREF(__pyx_t_2);
  12060. __pyx_t_3 = NULL;
  12061. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12062. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  12063. if (likely(__pyx_t_3)) {
  12064. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12065. __Pyx_INCREF(__pyx_t_3);
  12066. __Pyx_INCREF(function);
  12067. __Pyx_DECREF_SET(__pyx_t_2, function);
  12068. }
  12069. }
  12070. __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);
  12071. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  12072. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12073. __Pyx_GOTREF(__pyx_t_1);
  12074. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12075. __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)
  12076. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12077. try {
  12078. __pyx_t_5 = __pyx_v_self->c_env->getEdgeInsCost(__pyx_t_4);
  12079. } catch(...) {
  12080. __Pyx_CppExn2PyErr();
  12081. __PYX_ERR(0, 1216, __pyx_L1_error)
  12082. }
  12083. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12084. __Pyx_GOTREF(__pyx_t_1);
  12085. __pyx_r = __pyx_t_1;
  12086. __pyx_t_1 = 0;
  12087. goto __pyx_L0;
  12088. /* "gedlibpy.pyx":1207
  12089. *
  12090. *
  12091. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12092. * """
  12093. * Returns edge insertion cost.
  12094. */
  12095. /* function exit code */
  12096. __pyx_L1_error:;
  12097. __Pyx_XDECREF(__pyx_t_1);
  12098. __Pyx_XDECREF(__pyx_t_2);
  12099. __Pyx_XDECREF(__pyx_t_3);
  12100. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12101. __pyx_r = NULL;
  12102. __pyx_L0:;
  12103. __Pyx_XGIVEREF(__pyx_r);
  12104. __Pyx_RefNannyFinishContext();
  12105. return __pyx_r;
  12106. }
  12107. /* "gedlibpy.pyx":1219
  12108. *
  12109. *
  12110. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12111. * """
  12112. * Computes median edge label.
  12113. */
  12114. /* Python wrapper */
  12115. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels); /*proto*/
  12116. 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";
  12117. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12118. PyObject *__pyx_r = 0;
  12119. __Pyx_RefNannyDeclarations
  12120. __Pyx_RefNannySetupContext("get_median_edge_label (wrapper)", 0);
  12121. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_labels));
  12122. /* function exit code */
  12123. __Pyx_RefNannyFinishContext();
  12124. return __pyx_r;
  12125. }
  12126. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12127. CYTHON_UNUSED PyObject *__pyx_v_edge_labels_b = NULL;
  12128. PyObject *__pyx_9genexpr10__pyx_v_edge_label = NULL;
  12129. PyObject *__pyx_r = NULL;
  12130. __Pyx_RefNannyDeclarations
  12131. PyObject *__pyx_t_1 = NULL;
  12132. PyObject *__pyx_t_2 = NULL;
  12133. Py_ssize_t __pyx_t_3;
  12134. PyObject *(*__pyx_t_4)(PyObject *);
  12135. PyObject *__pyx_t_5 = NULL;
  12136. PyObject *__pyx_t_6 = NULL;
  12137. PyObject *__pyx_t_7 = NULL;
  12138. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  12139. std::map<std::string,std::string> __pyx_t_9;
  12140. __Pyx_RefNannySetupContext("get_median_edge_label", 0);
  12141. /* "gedlibpy.pyx":1228
  12142. * :rtype: dict{string : string}
  12143. * """
  12144. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] # <<<<<<<<<<<<<<
  12145. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b))
  12146. *
  12147. */
  12148. { /* enter inner scope */
  12149. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12150. __Pyx_GOTREF(__pyx_t_1);
  12151. if (likely(PyList_CheckExact(__pyx_v_edge_labels)) || PyTuple_CheckExact(__pyx_v_edge_labels)) {
  12152. __pyx_t_2 = __pyx_v_edge_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  12153. __pyx_t_4 = NULL;
  12154. } else {
  12155. __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)
  12156. __Pyx_GOTREF(__pyx_t_2);
  12157. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12158. }
  12159. for (;;) {
  12160. if (likely(!__pyx_t_4)) {
  12161. if (likely(PyList_CheckExact(__pyx_t_2))) {
  12162. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  12163. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12164. __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)
  12165. #else
  12166. __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)
  12167. __Pyx_GOTREF(__pyx_t_5);
  12168. #endif
  12169. } else {
  12170. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  12171. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12172. __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)
  12173. #else
  12174. __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)
  12175. __Pyx_GOTREF(__pyx_t_5);
  12176. #endif
  12177. }
  12178. } else {
  12179. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  12180. if (unlikely(!__pyx_t_5)) {
  12181. PyObject* exc_type = PyErr_Occurred();
  12182. if (exc_type) {
  12183. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12184. else __PYX_ERR(0, 1228, __pyx_L5_error)
  12185. }
  12186. break;
  12187. }
  12188. __Pyx_GOTREF(__pyx_t_5);
  12189. }
  12190. __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_edge_label, __pyx_t_5);
  12191. __pyx_t_5 = 0;
  12192. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12193. __Pyx_GOTREF(__pyx_t_6);
  12194. __pyx_t_7 = NULL;
  12195. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  12196. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  12197. if (likely(__pyx_t_7)) {
  12198. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  12199. __Pyx_INCREF(__pyx_t_7);
  12200. __Pyx_INCREF(function);
  12201. __Pyx_DECREF_SET(__pyx_t_6, function);
  12202. }
  12203. }
  12204. __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);
  12205. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  12206. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12207. __Pyx_GOTREF(__pyx_t_5);
  12208. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12209. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1228, __pyx_L5_error)
  12210. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12211. }
  12212. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12213. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12214. goto __pyx_L8_exit_scope;
  12215. __pyx_L5_error:;
  12216. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12217. goto __pyx_L1_error;
  12218. __pyx_L8_exit_scope:;
  12219. } /* exit inner scope */
  12220. __pyx_v_edge_labels_b = ((PyObject*)__pyx_t_1);
  12221. __pyx_t_1 = 0;
  12222. /* "gedlibpy.pyx":1229
  12223. * """
  12224. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels]
  12225. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b)) # <<<<<<<<<<<<<<
  12226. *
  12227. *
  12228. */
  12229. __Pyx_XDECREF(__pyx_r);
  12230. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12231. __Pyx_GOTREF(__pyx_t_2);
  12232. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12233. __Pyx_GOTREF(__pyx_t_5);
  12234. __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)
  12235. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12236. try {
  12237. __pyx_t_9 = __pyx_v_self->c_env->getMedianEdgeLabel(__pyx_t_8);
  12238. } catch(...) {
  12239. __Pyx_CppExn2PyErr();
  12240. __PYX_ERR(0, 1229, __pyx_L1_error)
  12241. }
  12242. __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)
  12243. __Pyx_GOTREF(__pyx_t_5);
  12244. __pyx_t_6 = NULL;
  12245. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12246. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  12247. if (likely(__pyx_t_6)) {
  12248. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12249. __Pyx_INCREF(__pyx_t_6);
  12250. __Pyx_INCREF(function);
  12251. __Pyx_DECREF_SET(__pyx_t_2, function);
  12252. }
  12253. }
  12254. __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);
  12255. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12256. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12257. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12258. __Pyx_GOTREF(__pyx_t_1);
  12259. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12260. __pyx_r = __pyx_t_1;
  12261. __pyx_t_1 = 0;
  12262. goto __pyx_L0;
  12263. /* "gedlibpy.pyx":1219
  12264. *
  12265. *
  12266. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12267. * """
  12268. * Computes median edge label.
  12269. */
  12270. /* function exit code */
  12271. __pyx_L1_error:;
  12272. __Pyx_XDECREF(__pyx_t_1);
  12273. __Pyx_XDECREF(__pyx_t_2);
  12274. __Pyx_XDECREF(__pyx_t_5);
  12275. __Pyx_XDECREF(__pyx_t_6);
  12276. __Pyx_XDECREF(__pyx_t_7);
  12277. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12278. __pyx_r = NULL;
  12279. __pyx_L0:;
  12280. __Pyx_XDECREF(__pyx_v_edge_labels_b);
  12281. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label);
  12282. __Pyx_XGIVEREF(__pyx_r);
  12283. __Pyx_RefNannyFinishContext();
  12284. return __pyx_r;
  12285. }
  12286. /* "gedlibpy.pyx":1232
  12287. *
  12288. *
  12289. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12290. * """
  12291. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12292. */
  12293. /* Python wrapper */
  12294. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12295. 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";
  12296. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12297. PyObject *__pyx_v_graph_id = 0;
  12298. CYTHON_UNUSED PyObject *__pyx_v_adj_matrix = 0;
  12299. CYTHON_UNUSED PyObject *__pyx_v_adj_lists = 0;
  12300. CYTHON_UNUSED PyObject *__pyx_v_edge_list = 0;
  12301. PyObject *__pyx_r = 0;
  12302. __Pyx_RefNannyDeclarations
  12303. __Pyx_RefNannySetupContext("get_nx_graph (wrapper)", 0);
  12304. {
  12305. 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};
  12306. PyObject* values[4] = {0,0,0,0};
  12307. values[1] = ((PyObject *)Py_True);
  12308. values[2] = ((PyObject *)Py_False);
  12309. values[3] = ((PyObject *)Py_False);
  12310. if (unlikely(__pyx_kwds)) {
  12311. Py_ssize_t kw_args;
  12312. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12313. switch (pos_args) {
  12314. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12315. CYTHON_FALLTHROUGH;
  12316. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12317. CYTHON_FALLTHROUGH;
  12318. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12319. CYTHON_FALLTHROUGH;
  12320. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12321. CYTHON_FALLTHROUGH;
  12322. case 0: break;
  12323. default: goto __pyx_L5_argtuple_error;
  12324. }
  12325. kw_args = PyDict_Size(__pyx_kwds);
  12326. switch (pos_args) {
  12327. case 0:
  12328. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12329. else goto __pyx_L5_argtuple_error;
  12330. CYTHON_FALLTHROUGH;
  12331. case 1:
  12332. if (kw_args > 0) {
  12333. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_matrix);
  12334. if (value) { values[1] = value; kw_args--; }
  12335. }
  12336. CYTHON_FALLTHROUGH;
  12337. case 2:
  12338. if (kw_args > 0) {
  12339. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_lists);
  12340. if (value) { values[2] = value; kw_args--; }
  12341. }
  12342. CYTHON_FALLTHROUGH;
  12343. case 3:
  12344. if (kw_args > 0) {
  12345. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_list);
  12346. if (value) { values[3] = value; kw_args--; }
  12347. }
  12348. }
  12349. if (unlikely(kw_args > 0)) {
  12350. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1232, __pyx_L3_error)
  12351. }
  12352. } else {
  12353. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12354. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12355. CYTHON_FALLTHROUGH;
  12356. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12357. CYTHON_FALLTHROUGH;
  12358. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12359. CYTHON_FALLTHROUGH;
  12360. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12361. break;
  12362. default: goto __pyx_L5_argtuple_error;
  12363. }
  12364. }
  12365. __pyx_v_graph_id = values[0];
  12366. __pyx_v_adj_matrix = values[1];
  12367. __pyx_v_adj_lists = values[2];
  12368. __pyx_v_edge_list = values[3];
  12369. }
  12370. goto __pyx_L4_argument_unpacking_done;
  12371. __pyx_L5_argtuple_error:;
  12372. __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1232, __pyx_L3_error)
  12373. __pyx_L3_error:;
  12374. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12375. __Pyx_RefNannyFinishContext();
  12376. return NULL;
  12377. __pyx_L4_argument_unpacking_done:;
  12378. __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);
  12379. /* function exit code */
  12380. __Pyx_RefNannyFinishContext();
  12381. return __pyx_r;
  12382. }
  12383. 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) {
  12384. PyObject *__pyx_v_graph = NULL;
  12385. PyObject *__pyx_v_nb_nodes = NULL;
  12386. PyObject *__pyx_v_original_node_ids = NULL;
  12387. PyObject *__pyx_v_node_labels = NULL;
  12388. PyObject *__pyx_v_node_id = NULL;
  12389. PyObject *__pyx_v_edges = NULL;
  12390. PyObject *__pyx_v_head = NULL;
  12391. PyObject *__pyx_v_tail = NULL;
  12392. PyObject *__pyx_v_labels = NULL;
  12393. PyObject *__pyx_r = NULL;
  12394. __Pyx_RefNannyDeclarations
  12395. PyObject *__pyx_t_1 = NULL;
  12396. PyObject *__pyx_t_2 = NULL;
  12397. PyObject *__pyx_t_3 = NULL;
  12398. Py_ssize_t __pyx_t_4;
  12399. PyObject *(*__pyx_t_5)(PyObject *);
  12400. PyObject *__pyx_t_6 = NULL;
  12401. PyObject *__pyx_t_7 = NULL;
  12402. Py_ssize_t __pyx_t_8;
  12403. int __pyx_t_9;
  12404. int __pyx_t_10;
  12405. PyObject *__pyx_t_11 = NULL;
  12406. PyObject *(*__pyx_t_12)(PyObject *);
  12407. __Pyx_RefNannySetupContext("get_nx_graph", 0);
  12408. /* "gedlibpy.pyx":1255
  12409. * The obtained graph.
  12410. * """
  12411. * graph = nx.Graph() # <<<<<<<<<<<<<<
  12412. * graph.graph['id'] = graph_id
  12413. *
  12414. */
  12415. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
  12416. __Pyx_GOTREF(__pyx_t_2);
  12417. __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)
  12418. __Pyx_GOTREF(__pyx_t_3);
  12419. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12420. __pyx_t_2 = NULL;
  12421. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  12422. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12423. if (likely(__pyx_t_2)) {
  12424. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12425. __Pyx_INCREF(__pyx_t_2);
  12426. __Pyx_INCREF(function);
  12427. __Pyx_DECREF_SET(__pyx_t_3, function);
  12428. }
  12429. }
  12430. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  12431. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12432. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
  12433. __Pyx_GOTREF(__pyx_t_1);
  12434. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12435. __pyx_v_graph = __pyx_t_1;
  12436. __pyx_t_1 = 0;
  12437. /* "gedlibpy.pyx":1256
  12438. * """
  12439. * graph = nx.Graph()
  12440. * graph.graph['id'] = graph_id # <<<<<<<<<<<<<<
  12441. *
  12442. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12443. */
  12444. __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)
  12445. __Pyx_GOTREF(__pyx_t_1);
  12446. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1256, __pyx_L1_error)
  12447. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12448. /* "gedlibpy.pyx":1258
  12449. * graph.graph['id'] = graph_id
  12450. *
  12451. * nb_nodes = self.get_graph_num_nodes(graph_id) # <<<<<<<<<<<<<<
  12452. * original_node_ids = self.get_original_node_ids(graph_id)
  12453. * node_labels = self.get_graph_node_labels(graph_id)
  12454. */
  12455. __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)
  12456. __Pyx_GOTREF(__pyx_t_3);
  12457. __pyx_t_2 = NULL;
  12458. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12459. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12460. if (likely(__pyx_t_2)) {
  12461. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12462. __Pyx_INCREF(__pyx_t_2);
  12463. __Pyx_INCREF(function);
  12464. __Pyx_DECREF_SET(__pyx_t_3, function);
  12465. }
  12466. }
  12467. __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);
  12468. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12469. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
  12470. __Pyx_GOTREF(__pyx_t_1);
  12471. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12472. __pyx_v_nb_nodes = __pyx_t_1;
  12473. __pyx_t_1 = 0;
  12474. /* "gedlibpy.pyx":1259
  12475. *
  12476. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12477. * original_node_ids = self.get_original_node_ids(graph_id) # <<<<<<<<<<<<<<
  12478. * node_labels = self.get_graph_node_labels(graph_id)
  12479. * # print(original_node_ids)
  12480. */
  12481. __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)
  12482. __Pyx_GOTREF(__pyx_t_3);
  12483. __pyx_t_2 = NULL;
  12484. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12485. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12486. if (likely(__pyx_t_2)) {
  12487. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12488. __Pyx_INCREF(__pyx_t_2);
  12489. __Pyx_INCREF(function);
  12490. __Pyx_DECREF_SET(__pyx_t_3, function);
  12491. }
  12492. }
  12493. __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);
  12494. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12495. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
  12496. __Pyx_GOTREF(__pyx_t_1);
  12497. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12498. __pyx_v_original_node_ids = __pyx_t_1;
  12499. __pyx_t_1 = 0;
  12500. /* "gedlibpy.pyx":1260
  12501. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12502. * original_node_ids = self.get_original_node_ids(graph_id)
  12503. * node_labels = self.get_graph_node_labels(graph_id) # <<<<<<<<<<<<<<
  12504. * # print(original_node_ids)
  12505. * # print(node_labels)
  12506. */
  12507. __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)
  12508. __Pyx_GOTREF(__pyx_t_3);
  12509. __pyx_t_2 = NULL;
  12510. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12511. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12512. if (likely(__pyx_t_2)) {
  12513. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12514. __Pyx_INCREF(__pyx_t_2);
  12515. __Pyx_INCREF(function);
  12516. __Pyx_DECREF_SET(__pyx_t_3, function);
  12517. }
  12518. }
  12519. __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);
  12520. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12521. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
  12522. __Pyx_GOTREF(__pyx_t_1);
  12523. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12524. __pyx_v_node_labels = __pyx_t_1;
  12525. __pyx_t_1 = 0;
  12526. /* "gedlibpy.pyx":1263
  12527. * # print(original_node_ids)
  12528. * # print(node_labels)
  12529. * graph.graph['original_node_ids'] = original_node_ids # <<<<<<<<<<<<<<
  12530. *
  12531. * for node_id in range(0, nb_nodes):
  12532. */
  12533. __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)
  12534. __Pyx_GOTREF(__pyx_t_1);
  12535. 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)
  12536. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12537. /* "gedlibpy.pyx":1265
  12538. * graph.graph['original_node_ids'] = original_node_ids
  12539. *
  12540. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12541. * graph.add_node(node_id, **node_labels[node_id])
  12542. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12543. */
  12544. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12545. __Pyx_GOTREF(__pyx_t_1);
  12546. __Pyx_INCREF(__pyx_int_0);
  12547. __Pyx_GIVEREF(__pyx_int_0);
  12548. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  12549. __Pyx_INCREF(__pyx_v_nb_nodes);
  12550. __Pyx_GIVEREF(__pyx_v_nb_nodes);
  12551. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nb_nodes);
  12552. __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)
  12553. __Pyx_GOTREF(__pyx_t_3);
  12554. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12555. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  12556. __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  12557. __pyx_t_5 = NULL;
  12558. } else {
  12559. __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12560. __Pyx_GOTREF(__pyx_t_1);
  12561. __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12562. }
  12563. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12564. for (;;) {
  12565. if (likely(!__pyx_t_5)) {
  12566. if (likely(PyList_CheckExact(__pyx_t_1))) {
  12567. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
  12568. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12569. __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)
  12570. #else
  12571. __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)
  12572. __Pyx_GOTREF(__pyx_t_3);
  12573. #endif
  12574. } else {
  12575. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  12576. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12577. __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)
  12578. #else
  12579. __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)
  12580. __Pyx_GOTREF(__pyx_t_3);
  12581. #endif
  12582. }
  12583. } else {
  12584. __pyx_t_3 = __pyx_t_5(__pyx_t_1);
  12585. if (unlikely(!__pyx_t_3)) {
  12586. PyObject* exc_type = PyErr_Occurred();
  12587. if (exc_type) {
  12588. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12589. else __PYX_ERR(0, 1265, __pyx_L1_error)
  12590. }
  12591. break;
  12592. }
  12593. __Pyx_GOTREF(__pyx_t_3);
  12594. }
  12595. __Pyx_XDECREF_SET(__pyx_v_node_id, __pyx_t_3);
  12596. __pyx_t_3 = 0;
  12597. /* "gedlibpy.pyx":1266
  12598. *
  12599. * for node_id in range(0, nb_nodes):
  12600. * graph.add_node(node_id, **node_labels[node_id]) # <<<<<<<<<<<<<<
  12601. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12602. *
  12603. */
  12604. __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)
  12605. __Pyx_GOTREF(__pyx_t_3);
  12606. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12607. __Pyx_GOTREF(__pyx_t_2);
  12608. __Pyx_INCREF(__pyx_v_node_id);
  12609. __Pyx_GIVEREF(__pyx_v_node_id);
  12610. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node_id);
  12611. __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)
  12612. __Pyx_GOTREF(__pyx_t_7);
  12613. if (unlikely(__pyx_t_7 == Py_None)) {
  12614. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12615. __PYX_ERR(0, 1266, __pyx_L1_error)
  12616. }
  12617. if (likely(PyDict_CheckExact(__pyx_t_7))) {
  12618. __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12619. __Pyx_GOTREF(__pyx_t_6);
  12620. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12621. } else {
  12622. __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12623. __Pyx_GOTREF(__pyx_t_6);
  12624. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12625. }
  12626. __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)
  12627. __Pyx_GOTREF(__pyx_t_7);
  12628. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12629. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12630. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12631. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12632. /* "gedlibpy.pyx":1265
  12633. * graph.graph['original_node_ids'] = original_node_ids
  12634. *
  12635. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12636. * graph.add_node(node_id, **node_labels[node_id])
  12637. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12638. */
  12639. }
  12640. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12641. /* "gedlibpy.pyx":1269
  12642. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12643. *
  12644. * edges = self.get_graph_edges(graph_id) # <<<<<<<<<<<<<<
  12645. * for (head, tail), labels in edges.items():
  12646. * graph.add_edge(head, tail, **labels)
  12647. */
  12648. __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)
  12649. __Pyx_GOTREF(__pyx_t_7);
  12650. __pyx_t_6 = NULL;
  12651. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12652. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
  12653. if (likely(__pyx_t_6)) {
  12654. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12655. __Pyx_INCREF(__pyx_t_6);
  12656. __Pyx_INCREF(function);
  12657. __Pyx_DECREF_SET(__pyx_t_7, function);
  12658. }
  12659. }
  12660. __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);
  12661. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12662. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  12663. __Pyx_GOTREF(__pyx_t_1);
  12664. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12665. __pyx_v_edges = __pyx_t_1;
  12666. __pyx_t_1 = 0;
  12667. /* "gedlibpy.pyx":1270
  12668. *
  12669. * edges = self.get_graph_edges(graph_id)
  12670. * for (head, tail), labels in edges.items(): # <<<<<<<<<<<<<<
  12671. * graph.add_edge(head, tail, **labels)
  12672. * # print(edges)
  12673. */
  12674. __pyx_t_4 = 0;
  12675. if (unlikely(__pyx_v_edges == Py_None)) {
  12676. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  12677. __PYX_ERR(0, 1270, __pyx_L1_error)
  12678. }
  12679. __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)
  12680. __Pyx_GOTREF(__pyx_t_7);
  12681. __Pyx_XDECREF(__pyx_t_1);
  12682. __pyx_t_1 = __pyx_t_7;
  12683. __pyx_t_7 = 0;
  12684. while (1) {
  12685. __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);
  12686. if (unlikely(__pyx_t_10 == 0)) break;
  12687. if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12688. __Pyx_GOTREF(__pyx_t_7);
  12689. __Pyx_GOTREF(__pyx_t_6);
  12690. if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
  12691. PyObject* sequence = __pyx_t_7;
  12692. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  12693. if (unlikely(size != 2)) {
  12694. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  12695. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  12696. __PYX_ERR(0, 1270, __pyx_L1_error)
  12697. }
  12698. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12699. if (likely(PyTuple_CheckExact(sequence))) {
  12700. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  12701. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  12702. } else {
  12703. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  12704. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  12705. }
  12706. __Pyx_INCREF(__pyx_t_2);
  12707. __Pyx_INCREF(__pyx_t_3);
  12708. #else
  12709. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12710. __Pyx_GOTREF(__pyx_t_2);
  12711. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12712. __Pyx_GOTREF(__pyx_t_3);
  12713. #endif
  12714. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12715. } else {
  12716. Py_ssize_t index = -1;
  12717. __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12718. __Pyx_GOTREF(__pyx_t_11);
  12719. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12720. __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
  12721. index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
  12722. __Pyx_GOTREF(__pyx_t_2);
  12723. index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  12724. __Pyx_GOTREF(__pyx_t_3);
  12725. if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
  12726. __pyx_t_12 = NULL;
  12727. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12728. goto __pyx_L8_unpacking_done;
  12729. __pyx_L7_unpacking_failed:;
  12730. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12731. __pyx_t_12 = NULL;
  12732. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  12733. __PYX_ERR(0, 1270, __pyx_L1_error)
  12734. __pyx_L8_unpacking_done:;
  12735. }
  12736. __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
  12737. __pyx_t_2 = 0;
  12738. __Pyx_XDECREF_SET(__pyx_v_tail, __pyx_t_3);
  12739. __pyx_t_3 = 0;
  12740. __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_6);
  12741. __pyx_t_6 = 0;
  12742. /* "gedlibpy.pyx":1271
  12743. * edges = self.get_graph_edges(graph_id)
  12744. * for (head, tail), labels in edges.items():
  12745. * graph.add_edge(head, tail, **labels) # <<<<<<<<<<<<<<
  12746. * # print(edges)
  12747. *
  12748. */
  12749. __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)
  12750. __Pyx_GOTREF(__pyx_t_6);
  12751. __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12752. __Pyx_GOTREF(__pyx_t_7);
  12753. __Pyx_INCREF(__pyx_v_head);
  12754. __Pyx_GIVEREF(__pyx_v_head);
  12755. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_head);
  12756. __Pyx_INCREF(__pyx_v_tail);
  12757. __Pyx_GIVEREF(__pyx_v_tail);
  12758. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_tail);
  12759. if (unlikely(__pyx_v_labels == Py_None)) {
  12760. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12761. __PYX_ERR(0, 1271, __pyx_L1_error)
  12762. }
  12763. if (likely(PyDict_CheckExact(__pyx_v_labels))) {
  12764. __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12765. __Pyx_GOTREF(__pyx_t_3);
  12766. } else {
  12767. __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12768. __Pyx_GOTREF(__pyx_t_3);
  12769. }
  12770. __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)
  12771. __Pyx_GOTREF(__pyx_t_2);
  12772. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12773. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12774. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12775. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12776. }
  12777. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12778. /* "gedlibpy.pyx":1274
  12779. * # print(edges)
  12780. *
  12781. * return graph # <<<<<<<<<<<<<<
  12782. *
  12783. *
  12784. */
  12785. __Pyx_XDECREF(__pyx_r);
  12786. __Pyx_INCREF(__pyx_v_graph);
  12787. __pyx_r = __pyx_v_graph;
  12788. goto __pyx_L0;
  12789. /* "gedlibpy.pyx":1232
  12790. *
  12791. *
  12792. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12793. * """
  12794. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12795. */
  12796. /* function exit code */
  12797. __pyx_L1_error:;
  12798. __Pyx_XDECREF(__pyx_t_1);
  12799. __Pyx_XDECREF(__pyx_t_2);
  12800. __Pyx_XDECREF(__pyx_t_3);
  12801. __Pyx_XDECREF(__pyx_t_6);
  12802. __Pyx_XDECREF(__pyx_t_7);
  12803. __Pyx_XDECREF(__pyx_t_11);
  12804. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12805. __pyx_r = NULL;
  12806. __pyx_L0:;
  12807. __Pyx_XDECREF(__pyx_v_graph);
  12808. __Pyx_XDECREF(__pyx_v_nb_nodes);
  12809. __Pyx_XDECREF(__pyx_v_original_node_ids);
  12810. __Pyx_XDECREF(__pyx_v_node_labels);
  12811. __Pyx_XDECREF(__pyx_v_node_id);
  12812. __Pyx_XDECREF(__pyx_v_edges);
  12813. __Pyx_XDECREF(__pyx_v_head);
  12814. __Pyx_XDECREF(__pyx_v_tail);
  12815. __Pyx_XDECREF(__pyx_v_labels);
  12816. __Pyx_XGIVEREF(__pyx_r);
  12817. __Pyx_RefNannyFinishContext();
  12818. return __pyx_r;
  12819. }
  12820. /* "gedlibpy.pyx":1277
  12821. *
  12822. *
  12823. * def get_init_type(self): # <<<<<<<<<<<<<<
  12824. * """
  12825. * Returns the initialization type of the last initialization in string.
  12826. */
  12827. /* Python wrapper */
  12828. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  12829. 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";
  12830. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  12831. PyObject *__pyx_r = 0;
  12832. __Pyx_RefNannyDeclarations
  12833. __Pyx_RefNannySetupContext("get_init_type (wrapper)", 0);
  12834. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  12835. /* function exit code */
  12836. __Pyx_RefNannyFinishContext();
  12837. return __pyx_r;
  12838. }
  12839. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  12840. PyObject *__pyx_r = NULL;
  12841. __Pyx_RefNannyDeclarations
  12842. std::string __pyx_t_1;
  12843. PyObject *__pyx_t_2 = NULL;
  12844. __Pyx_RefNannySetupContext("get_init_type", 0);
  12845. /* "gedlibpy.pyx":1286
  12846. * Initialization type in string.
  12847. * """
  12848. * return self.c_env.getInitType().decode('utf-8') # <<<<<<<<<<<<<<
  12849. *
  12850. *
  12851. */
  12852. __Pyx_XDECREF(__pyx_r);
  12853. try {
  12854. __pyx_t_1 = __pyx_v_self->c_env->getInitType();
  12855. } catch(...) {
  12856. __Pyx_CppExn2PyErr();
  12857. __PYX_ERR(0, 1286, __pyx_L1_error)
  12858. }
  12859. __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)
  12860. __Pyx_GOTREF(__pyx_t_2);
  12861. __pyx_r = __pyx_t_2;
  12862. __pyx_t_2 = 0;
  12863. goto __pyx_L0;
  12864. /* "gedlibpy.pyx":1277
  12865. *
  12866. *
  12867. * def get_init_type(self): # <<<<<<<<<<<<<<
  12868. * """
  12869. * Returns the initialization type of the last initialization in string.
  12870. */
  12871. /* function exit code */
  12872. __pyx_L1_error:;
  12873. __Pyx_XDECREF(__pyx_t_2);
  12874. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12875. __pyx_r = NULL;
  12876. __pyx_L0:;
  12877. __Pyx_XGIVEREF(__pyx_r);
  12878. __Pyx_RefNannyFinishContext();
  12879. return __pyx_r;
  12880. }
  12881. /* "gedlibpy.pyx":1308
  12882. *
  12883. *
  12884. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  12885. * """
  12886. * Loads NetworkX Graph into the GED environment.
  12887. */
  12888. /* Python wrapper */
  12889. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12890. 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";
  12891. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12892. PyObject *__pyx_v_nx_graph = 0;
  12893. PyObject *__pyx_v_graph_id = 0;
  12894. PyObject *__pyx_v_graph_name = 0;
  12895. PyObject *__pyx_v_graph_class = 0;
  12896. PyObject *__pyx_r = 0;
  12897. __Pyx_RefNannyDeclarations
  12898. __Pyx_RefNannySetupContext("load_nx_graph (wrapper)", 0);
  12899. {
  12900. 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};
  12901. PyObject* values[4] = {0,0,0,0};
  12902. values[2] = ((PyObject *)__pyx_kp_u_);
  12903. values[3] = ((PyObject *)__pyx_kp_u_);
  12904. if (unlikely(__pyx_kwds)) {
  12905. Py_ssize_t kw_args;
  12906. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12907. switch (pos_args) {
  12908. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12909. CYTHON_FALLTHROUGH;
  12910. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12911. CYTHON_FALLTHROUGH;
  12912. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12913. CYTHON_FALLTHROUGH;
  12914. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12915. CYTHON_FALLTHROUGH;
  12916. case 0: break;
  12917. default: goto __pyx_L5_argtuple_error;
  12918. }
  12919. kw_args = PyDict_Size(__pyx_kwds);
  12920. switch (pos_args) {
  12921. case 0:
  12922. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nx_graph)) != 0)) kw_args--;
  12923. else goto __pyx_L5_argtuple_error;
  12924. CYTHON_FALLTHROUGH;
  12925. case 1:
  12926. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12927. else {
  12928. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1308, __pyx_L3_error)
  12929. }
  12930. CYTHON_FALLTHROUGH;
  12931. case 2:
  12932. if (kw_args > 0) {
  12933. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_name);
  12934. if (value) { values[2] = value; kw_args--; }
  12935. }
  12936. CYTHON_FALLTHROUGH;
  12937. case 3:
  12938. if (kw_args > 0) {
  12939. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_class);
  12940. if (value) { values[3] = value; kw_args--; }
  12941. }
  12942. }
  12943. if (unlikely(kw_args > 0)) {
  12944. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1308, __pyx_L3_error)
  12945. }
  12946. } else {
  12947. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12948. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12949. CYTHON_FALLTHROUGH;
  12950. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12951. CYTHON_FALLTHROUGH;
  12952. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12953. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12954. break;
  12955. default: goto __pyx_L5_argtuple_error;
  12956. }
  12957. }
  12958. __pyx_v_nx_graph = values[0];
  12959. __pyx_v_graph_id = values[1];
  12960. __pyx_v_graph_name = values[2];
  12961. __pyx_v_graph_class = values[3];
  12962. }
  12963. goto __pyx_L4_argument_unpacking_done;
  12964. __pyx_L5_argtuple_error:;
  12965. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1308, __pyx_L3_error)
  12966. __pyx_L3_error:;
  12967. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12968. __Pyx_RefNannyFinishContext();
  12969. return NULL;
  12970. __pyx_L4_argument_unpacking_done:;
  12971. __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);
  12972. /* function exit code */
  12973. __Pyx_RefNannyFinishContext();
  12974. return __pyx_r;
  12975. }
  12976. 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) {
  12977. PyObject *__pyx_v_node = NULL;
  12978. PyObject *__pyx_v_edge = NULL;
  12979. PyObject *__pyx_r = NULL;
  12980. __Pyx_RefNannyDeclarations
  12981. int __pyx_t_1;
  12982. int __pyx_t_2;
  12983. PyObject *__pyx_t_3 = NULL;
  12984. PyObject *__pyx_t_4 = NULL;
  12985. PyObject *__pyx_t_5 = NULL;
  12986. int __pyx_t_6;
  12987. PyObject *__pyx_t_7 = NULL;
  12988. Py_ssize_t __pyx_t_8;
  12989. PyObject *(*__pyx_t_9)(PyObject *);
  12990. PyObject *__pyx_t_10 = NULL;
  12991. PyObject *__pyx_t_11 = NULL;
  12992. PyObject *__pyx_t_12 = NULL;
  12993. PyObject *__pyx_t_13 = NULL;
  12994. PyObject *__pyx_t_14 = NULL;
  12995. PyObject *__pyx_t_15 = NULL;
  12996. PyObject *__pyx_t_16 = NULL;
  12997. __Pyx_RefNannySetupContext("load_nx_graph", 0);
  12998. __Pyx_INCREF(__pyx_v_graph_id);
  12999. /* "gedlibpy.pyx":1331
  13000. * The ID of the newly loaded graph.
  13001. * """
  13002. * if graph_id is None: # <<<<<<<<<<<<<<
  13003. * graph_id = self.add_graph(graph_name, graph_class)
  13004. * else:
  13005. */
  13006. __pyx_t_1 = (__pyx_v_graph_id == Py_None);
  13007. __pyx_t_2 = (__pyx_t_1 != 0);
  13008. if (__pyx_t_2) {
  13009. /* "gedlibpy.pyx":1332
  13010. * """
  13011. * if graph_id is None:
  13012. * graph_id = self.add_graph(graph_name, graph_class) # <<<<<<<<<<<<<<
  13013. * else:
  13014. * self.clear_graph(graph_id)
  13015. */
  13016. __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)
  13017. __Pyx_GOTREF(__pyx_t_4);
  13018. __pyx_t_5 = NULL;
  13019. __pyx_t_6 = 0;
  13020. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13021. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  13022. if (likely(__pyx_t_5)) {
  13023. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13024. __Pyx_INCREF(__pyx_t_5);
  13025. __Pyx_INCREF(function);
  13026. __Pyx_DECREF_SET(__pyx_t_4, function);
  13027. __pyx_t_6 = 1;
  13028. }
  13029. }
  13030. #if CYTHON_FAST_PYCALL
  13031. if (PyFunction_Check(__pyx_t_4)) {
  13032. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13033. __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)
  13034. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13035. __Pyx_GOTREF(__pyx_t_3);
  13036. } else
  13037. #endif
  13038. #if CYTHON_FAST_PYCCALL
  13039. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  13040. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13041. __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)
  13042. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13043. __Pyx_GOTREF(__pyx_t_3);
  13044. } else
  13045. #endif
  13046. {
  13047. __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error)
  13048. __Pyx_GOTREF(__pyx_t_7);
  13049. if (__pyx_t_5) {
  13050. __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  13051. }
  13052. __Pyx_INCREF(__pyx_v_graph_name);
  13053. __Pyx_GIVEREF(__pyx_v_graph_name);
  13054. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_graph_name);
  13055. __Pyx_INCREF(__pyx_v_graph_class);
  13056. __Pyx_GIVEREF(__pyx_v_graph_class);
  13057. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graph_class);
  13058. __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)
  13059. __Pyx_GOTREF(__pyx_t_3);
  13060. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13061. }
  13062. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13063. __Pyx_DECREF_SET(__pyx_v_graph_id, __pyx_t_3);
  13064. __pyx_t_3 = 0;
  13065. /* "gedlibpy.pyx":1331
  13066. * The ID of the newly loaded graph.
  13067. * """
  13068. * if graph_id is None: # <<<<<<<<<<<<<<
  13069. * graph_id = self.add_graph(graph_name, graph_class)
  13070. * else:
  13071. */
  13072. goto __pyx_L3;
  13073. }
  13074. /* "gedlibpy.pyx":1334
  13075. * graph_id = self.add_graph(graph_name, graph_class)
  13076. * else:
  13077. * self.clear_graph(graph_id) # <<<<<<<<<<<<<<
  13078. * for node in nx_graph.nodes:
  13079. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13080. */
  13081. /*else*/ {
  13082. __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)
  13083. __Pyx_GOTREF(__pyx_t_4);
  13084. __pyx_t_7 = NULL;
  13085. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13086. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
  13087. if (likely(__pyx_t_7)) {
  13088. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13089. __Pyx_INCREF(__pyx_t_7);
  13090. __Pyx_INCREF(function);
  13091. __Pyx_DECREF_SET(__pyx_t_4, function);
  13092. }
  13093. }
  13094. __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);
  13095. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13096. if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error)
  13097. __Pyx_GOTREF(__pyx_t_3);
  13098. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13099. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13100. }
  13101. __pyx_L3:;
  13102. /* "gedlibpy.pyx":1335
  13103. * else:
  13104. * self.clear_graph(graph_id)
  13105. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13106. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13107. * for edge in nx_graph.edges:
  13108. */
  13109. __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)
  13110. __Pyx_GOTREF(__pyx_t_3);
  13111. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  13112. __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
  13113. __pyx_t_9 = NULL;
  13114. } else {
  13115. __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13116. __Pyx_GOTREF(__pyx_t_4);
  13117. __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13118. }
  13119. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13120. for (;;) {
  13121. if (likely(!__pyx_t_9)) {
  13122. if (likely(PyList_CheckExact(__pyx_t_4))) {
  13123. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
  13124. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13125. __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)
  13126. #else
  13127. __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)
  13128. __Pyx_GOTREF(__pyx_t_3);
  13129. #endif
  13130. } else {
  13131. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  13132. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13133. __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)
  13134. #else
  13135. __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)
  13136. __Pyx_GOTREF(__pyx_t_3);
  13137. #endif
  13138. }
  13139. } else {
  13140. __pyx_t_3 = __pyx_t_9(__pyx_t_4);
  13141. if (unlikely(!__pyx_t_3)) {
  13142. PyObject* exc_type = PyErr_Occurred();
  13143. if (exc_type) {
  13144. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13145. else __PYX_ERR(0, 1335, __pyx_L1_error)
  13146. }
  13147. break;
  13148. }
  13149. __Pyx_GOTREF(__pyx_t_3);
  13150. }
  13151. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
  13152. __pyx_t_3 = 0;
  13153. /* "gedlibpy.pyx":1336
  13154. * self.clear_graph(graph_id)
  13155. * for node in nx_graph.nodes:
  13156. * self.add_node(graph_id, str(node), nx_graph.nodes[node]) # <<<<<<<<<<<<<<
  13157. * for edge in nx_graph.edges:
  13158. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13159. */
  13160. __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)
  13161. __Pyx_GOTREF(__pyx_t_7);
  13162. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13163. __Pyx_GOTREF(__pyx_t_5);
  13164. __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)
  13165. __Pyx_GOTREF(__pyx_t_10);
  13166. __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13167. __Pyx_GOTREF(__pyx_t_11);
  13168. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13169. __pyx_t_10 = NULL;
  13170. __pyx_t_6 = 0;
  13171. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13172. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13173. if (likely(__pyx_t_10)) {
  13174. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13175. __Pyx_INCREF(__pyx_t_10);
  13176. __Pyx_INCREF(function);
  13177. __Pyx_DECREF_SET(__pyx_t_7, function);
  13178. __pyx_t_6 = 1;
  13179. }
  13180. }
  13181. #if CYTHON_FAST_PYCALL
  13182. if (PyFunction_Check(__pyx_t_7)) {
  13183. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13184. __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)
  13185. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13186. __Pyx_GOTREF(__pyx_t_3);
  13187. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13188. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13189. } else
  13190. #endif
  13191. #if CYTHON_FAST_PYCCALL
  13192. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13193. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13194. __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)
  13195. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13196. __Pyx_GOTREF(__pyx_t_3);
  13197. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13198. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13199. } else
  13200. #endif
  13201. {
  13202. __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13203. __Pyx_GOTREF(__pyx_t_12);
  13204. if (__pyx_t_10) {
  13205. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13206. }
  13207. __Pyx_INCREF(__pyx_v_graph_id);
  13208. __Pyx_GIVEREF(__pyx_v_graph_id);
  13209. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_graph_id);
  13210. __Pyx_GIVEREF(__pyx_t_5);
  13211. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_5);
  13212. __Pyx_GIVEREF(__pyx_t_11);
  13213. PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_6, __pyx_t_11);
  13214. __pyx_t_5 = 0;
  13215. __pyx_t_11 = 0;
  13216. __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)
  13217. __Pyx_GOTREF(__pyx_t_3);
  13218. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13219. }
  13220. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13221. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13222. /* "gedlibpy.pyx":1335
  13223. * else:
  13224. * self.clear_graph(graph_id)
  13225. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13226. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13227. * for edge in nx_graph.edges:
  13228. */
  13229. }
  13230. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13231. /* "gedlibpy.pyx":1337
  13232. * for node in nx_graph.nodes:
  13233. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13234. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13235. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13236. * return graph_id
  13237. */
  13238. __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)
  13239. __Pyx_GOTREF(__pyx_t_4);
  13240. if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
  13241. __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
  13242. __pyx_t_9 = NULL;
  13243. } else {
  13244. __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13245. __Pyx_GOTREF(__pyx_t_3);
  13246. __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13247. }
  13248. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13249. for (;;) {
  13250. if (likely(!__pyx_t_9)) {
  13251. if (likely(PyList_CheckExact(__pyx_t_3))) {
  13252. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
  13253. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13254. __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)
  13255. #else
  13256. __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)
  13257. __Pyx_GOTREF(__pyx_t_4);
  13258. #endif
  13259. } else {
  13260. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  13261. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13262. __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)
  13263. #else
  13264. __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)
  13265. __Pyx_GOTREF(__pyx_t_4);
  13266. #endif
  13267. }
  13268. } else {
  13269. __pyx_t_4 = __pyx_t_9(__pyx_t_3);
  13270. if (unlikely(!__pyx_t_4)) {
  13271. PyObject* exc_type = PyErr_Occurred();
  13272. if (exc_type) {
  13273. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13274. else __PYX_ERR(0, 1337, __pyx_L1_error)
  13275. }
  13276. break;
  13277. }
  13278. __Pyx_GOTREF(__pyx_t_4);
  13279. }
  13280. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4);
  13281. __pyx_t_4 = 0;
  13282. /* "gedlibpy.pyx":1338
  13283. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13284. * for edge in nx_graph.edges:
  13285. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) # <<<<<<<<<<<<<<
  13286. * return graph_id
  13287. *
  13288. */
  13289. __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)
  13290. __Pyx_GOTREF(__pyx_t_7);
  13291. __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)
  13292. __Pyx_GOTREF(__pyx_t_12);
  13293. __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13294. __Pyx_GOTREF(__pyx_t_11);
  13295. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13296. __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)
  13297. __Pyx_GOTREF(__pyx_t_12);
  13298. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13299. __Pyx_GOTREF(__pyx_t_5);
  13300. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13301. __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)
  13302. __Pyx_GOTREF(__pyx_t_10);
  13303. __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)
  13304. __Pyx_GOTREF(__pyx_t_13);
  13305. __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)
  13306. __Pyx_GOTREF(__pyx_t_14);
  13307. __pyx_t_15 = NULL;
  13308. __pyx_t_6 = 0;
  13309. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
  13310. __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
  13311. if (likely(__pyx_t_15)) {
  13312. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
  13313. __Pyx_INCREF(__pyx_t_15);
  13314. __Pyx_INCREF(function);
  13315. __Pyx_DECREF_SET(__pyx_t_10, function);
  13316. __pyx_t_6 = 1;
  13317. }
  13318. }
  13319. #if CYTHON_FAST_PYCALL
  13320. if (PyFunction_Check(__pyx_t_10)) {
  13321. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13322. __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)
  13323. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13324. __Pyx_GOTREF(__pyx_t_12);
  13325. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13326. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13327. } else
  13328. #endif
  13329. #if CYTHON_FAST_PYCCALL
  13330. if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
  13331. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13332. __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)
  13333. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13334. __Pyx_GOTREF(__pyx_t_12);
  13335. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13336. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13337. } else
  13338. #endif
  13339. {
  13340. __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13341. __Pyx_GOTREF(__pyx_t_16);
  13342. if (__pyx_t_15) {
  13343. __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
  13344. }
  13345. __Pyx_GIVEREF(__pyx_t_13);
  13346. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
  13347. __Pyx_GIVEREF(__pyx_t_14);
  13348. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_14);
  13349. __pyx_t_13 = 0;
  13350. __pyx_t_14 = 0;
  13351. __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)
  13352. __Pyx_GOTREF(__pyx_t_12);
  13353. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13354. }
  13355. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13356. __pyx_t_10 = NULL;
  13357. __pyx_t_6 = 0;
  13358. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13359. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13360. if (likely(__pyx_t_10)) {
  13361. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13362. __Pyx_INCREF(__pyx_t_10);
  13363. __Pyx_INCREF(function);
  13364. __Pyx_DECREF_SET(__pyx_t_7, function);
  13365. __pyx_t_6 = 1;
  13366. }
  13367. }
  13368. #if CYTHON_FAST_PYCALL
  13369. if (PyFunction_Check(__pyx_t_7)) {
  13370. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13371. __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)
  13372. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13373. __Pyx_GOTREF(__pyx_t_4);
  13374. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13375. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13376. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13377. } else
  13378. #endif
  13379. #if CYTHON_FAST_PYCCALL
  13380. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13381. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13382. __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)
  13383. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13384. __Pyx_GOTREF(__pyx_t_4);
  13385. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13386. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13387. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13388. } else
  13389. #endif
  13390. {
  13391. __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13392. __Pyx_GOTREF(__pyx_t_16);
  13393. if (__pyx_t_10) {
  13394. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13395. }
  13396. __Pyx_INCREF(__pyx_v_graph_id);
  13397. __Pyx_GIVEREF(__pyx_v_graph_id);
  13398. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_v_graph_id);
  13399. __Pyx_GIVEREF(__pyx_t_11);
  13400. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
  13401. __Pyx_GIVEREF(__pyx_t_5);
  13402. PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_6, __pyx_t_5);
  13403. __Pyx_GIVEREF(__pyx_t_12);
  13404. PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_6, __pyx_t_12);
  13405. __pyx_t_11 = 0;
  13406. __pyx_t_5 = 0;
  13407. __pyx_t_12 = 0;
  13408. __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)
  13409. __Pyx_GOTREF(__pyx_t_4);
  13410. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13411. }
  13412. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13413. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13414. /* "gedlibpy.pyx":1337
  13415. * for node in nx_graph.nodes:
  13416. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13417. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13418. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13419. * return graph_id
  13420. */
  13421. }
  13422. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13423. /* "gedlibpy.pyx":1339
  13424. * for edge in nx_graph.edges:
  13425. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13426. * return graph_id # <<<<<<<<<<<<<<
  13427. *
  13428. *
  13429. */
  13430. __Pyx_XDECREF(__pyx_r);
  13431. __Pyx_INCREF(__pyx_v_graph_id);
  13432. __pyx_r = __pyx_v_graph_id;
  13433. goto __pyx_L0;
  13434. /* "gedlibpy.pyx":1308
  13435. *
  13436. *
  13437. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  13438. * """
  13439. * Loads NetworkX Graph into the GED environment.
  13440. */
  13441. /* function exit code */
  13442. __pyx_L1_error:;
  13443. __Pyx_XDECREF(__pyx_t_3);
  13444. __Pyx_XDECREF(__pyx_t_4);
  13445. __Pyx_XDECREF(__pyx_t_5);
  13446. __Pyx_XDECREF(__pyx_t_7);
  13447. __Pyx_XDECREF(__pyx_t_10);
  13448. __Pyx_XDECREF(__pyx_t_11);
  13449. __Pyx_XDECREF(__pyx_t_12);
  13450. __Pyx_XDECREF(__pyx_t_13);
  13451. __Pyx_XDECREF(__pyx_t_14);
  13452. __Pyx_XDECREF(__pyx_t_15);
  13453. __Pyx_XDECREF(__pyx_t_16);
  13454. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13455. __pyx_r = NULL;
  13456. __pyx_L0:;
  13457. __Pyx_XDECREF(__pyx_v_node);
  13458. __Pyx_XDECREF(__pyx_v_edge);
  13459. __Pyx_XDECREF(__pyx_v_graph_id);
  13460. __Pyx_XGIVEREF(__pyx_r);
  13461. __Pyx_RefNannyFinishContext();
  13462. return __pyx_r;
  13463. }
  13464. /* "gedlibpy.pyx":1342
  13465. *
  13466. *
  13467. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13468. * """
  13469. * Computes the edit cost between two graphs induced by a node map.
  13470. */
  13471. /* Python wrapper */
  13472. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13473. 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";
  13474. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13475. PyObject *__pyx_v_g_id = 0;
  13476. PyObject *__pyx_v_h_id = 0;
  13477. PyObject *__pyx_v_node_map = 0;
  13478. PyObject *__pyx_r = 0;
  13479. __Pyx_RefNannyDeclarations
  13480. __Pyx_RefNannySetupContext("compute_induced_cost (wrapper)", 0);
  13481. {
  13482. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,&__pyx_n_s_node_map,0};
  13483. PyObject* values[3] = {0,0,0};
  13484. if (unlikely(__pyx_kwds)) {
  13485. Py_ssize_t kw_args;
  13486. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13487. switch (pos_args) {
  13488. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13489. CYTHON_FALLTHROUGH;
  13490. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13491. CYTHON_FALLTHROUGH;
  13492. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13493. CYTHON_FALLTHROUGH;
  13494. case 0: break;
  13495. default: goto __pyx_L5_argtuple_error;
  13496. }
  13497. kw_args = PyDict_Size(__pyx_kwds);
  13498. switch (pos_args) {
  13499. case 0:
  13500. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g_id)) != 0)) kw_args--;
  13501. else goto __pyx_L5_argtuple_error;
  13502. CYTHON_FALLTHROUGH;
  13503. case 1:
  13504. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h_id)) != 0)) kw_args--;
  13505. else {
  13506. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 1); __PYX_ERR(0, 1342, __pyx_L3_error)
  13507. }
  13508. CYTHON_FALLTHROUGH;
  13509. case 2:
  13510. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_map)) != 0)) kw_args--;
  13511. else {
  13512. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 2); __PYX_ERR(0, 1342, __pyx_L3_error)
  13513. }
  13514. }
  13515. if (unlikely(kw_args > 0)) {
  13516. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1342, __pyx_L3_error)
  13517. }
  13518. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  13519. goto __pyx_L5_argtuple_error;
  13520. } else {
  13521. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13522. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13523. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13524. }
  13525. __pyx_v_g_id = values[0];
  13526. __pyx_v_h_id = values[1];
  13527. __pyx_v_node_map = values[2];
  13528. }
  13529. goto __pyx_L4_argument_unpacking_done;
  13530. __pyx_L5_argtuple_error:;
  13531. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1342, __pyx_L3_error)
  13532. __pyx_L3_error:;
  13533. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13534. __Pyx_RefNannyFinishContext();
  13535. return NULL;
  13536. __pyx_L4_argument_unpacking_done:;
  13537. __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);
  13538. /* function exit code */
  13539. __Pyx_RefNannyFinishContext();
  13540. return __pyx_r;
  13541. }
  13542. 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) {
  13543. double __pyx_v_induced_cost;
  13544. PyObject *__pyx_r = NULL;
  13545. __Pyx_RefNannyDeclarations
  13546. size_t __pyx_t_1;
  13547. size_t __pyx_t_2;
  13548. double __pyx_t_3;
  13549. PyObject *__pyx_t_4 = NULL;
  13550. PyObject *__pyx_t_5 = NULL;
  13551. PyObject *__pyx_t_6 = NULL;
  13552. PyObject *__pyx_t_7 = NULL;
  13553. __Pyx_RefNannySetupContext("compute_induced_cost", 0);
  13554. /* "gedlibpy.pyx":1359
  13555. * None.
  13556. * """
  13557. * induced_cost = self.c_env.computeInducedCost(g_id, h_id) # <<<<<<<<<<<<<<
  13558. * node_map.set_induced_cost(induced_cost)
  13559. *
  13560. */
  13561. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1359, __pyx_L1_error)
  13562. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1359, __pyx_L1_error)
  13563. try {
  13564. __pyx_t_3 = __pyx_v_self->c_env->computeInducedCost(__pyx_t_1, __pyx_t_2);
  13565. } catch(...) {
  13566. __Pyx_CppExn2PyErr();
  13567. __PYX_ERR(0, 1359, __pyx_L1_error)
  13568. }
  13569. __pyx_v_induced_cost = __pyx_t_3;
  13570. /* "gedlibpy.pyx":1360
  13571. * """
  13572. * induced_cost = self.c_env.computeInducedCost(g_id, h_id)
  13573. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  13574. *
  13575. *
  13576. */
  13577. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1360, __pyx_L1_error)
  13578. __Pyx_GOTREF(__pyx_t_5);
  13579. __pyx_t_6 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L1_error)
  13580. __Pyx_GOTREF(__pyx_t_6);
  13581. __pyx_t_7 = NULL;
  13582. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  13583. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
  13584. if (likely(__pyx_t_7)) {
  13585. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  13586. __Pyx_INCREF(__pyx_t_7);
  13587. __Pyx_INCREF(function);
  13588. __Pyx_DECREF_SET(__pyx_t_5, function);
  13589. }
  13590. }
  13591. __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  13592. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13593. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13594. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1360, __pyx_L1_error)
  13595. __Pyx_GOTREF(__pyx_t_4);
  13596. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13597. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13598. /* "gedlibpy.pyx":1342
  13599. *
  13600. *
  13601. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13602. * """
  13603. * Computes the edit cost between two graphs induced by a node map.
  13604. */
  13605. /* function exit code */
  13606. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13607. goto __pyx_L0;
  13608. __pyx_L1_error:;
  13609. __Pyx_XDECREF(__pyx_t_4);
  13610. __Pyx_XDECREF(__pyx_t_5);
  13611. __Pyx_XDECREF(__pyx_t_6);
  13612. __Pyx_XDECREF(__pyx_t_7);
  13613. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13614. __pyx_r = NULL;
  13615. __pyx_L0:;
  13616. __Pyx_XGIVEREF(__pyx_r);
  13617. __Pyx_RefNannyFinishContext();
  13618. return __pyx_r;
  13619. }
  13620. /* "(tree fragment)":1
  13621. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13622. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13623. * def __setstate_cython__(self, __pyx_state):
  13624. */
  13625. /* Python wrapper */
  13626. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  13627. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  13628. PyObject *__pyx_r = 0;
  13629. __Pyx_RefNannyDeclarations
  13630. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  13631. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  13632. /* function exit code */
  13633. __Pyx_RefNannyFinishContext();
  13634. return __pyx_r;
  13635. }
  13636. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  13637. PyObject *__pyx_r = NULL;
  13638. __Pyx_RefNannyDeclarations
  13639. PyObject *__pyx_t_1 = NULL;
  13640. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  13641. /* "(tree fragment)":2
  13642. * def __reduce_cython__(self):
  13643. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13644. * def __setstate_cython__(self, __pyx_state):
  13645. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13646. */
  13647. __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)
  13648. __Pyx_GOTREF(__pyx_t_1);
  13649. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13650. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13651. __PYX_ERR(1, 2, __pyx_L1_error)
  13652. /* "(tree fragment)":1
  13653. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13654. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13655. * def __setstate_cython__(self, __pyx_state):
  13656. */
  13657. /* function exit code */
  13658. __pyx_L1_error:;
  13659. __Pyx_XDECREF(__pyx_t_1);
  13660. __Pyx_AddTraceback("gedlibpy.GEDEnv.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13661. __pyx_r = NULL;
  13662. __Pyx_XGIVEREF(__pyx_r);
  13663. __Pyx_RefNannyFinishContext();
  13664. return __pyx_r;
  13665. }
  13666. /* "(tree fragment)":3
  13667. * def __reduce_cython__(self):
  13668. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13669. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13670. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13671. */
  13672. /* Python wrapper */
  13673. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  13674. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  13675. PyObject *__pyx_r = 0;
  13676. __Pyx_RefNannyDeclarations
  13677. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  13678. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  13679. /* function exit code */
  13680. __Pyx_RefNannyFinishContext();
  13681. return __pyx_r;
  13682. }
  13683. 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) {
  13684. PyObject *__pyx_r = NULL;
  13685. __Pyx_RefNannyDeclarations
  13686. PyObject *__pyx_t_1 = NULL;
  13687. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  13688. /* "(tree fragment)":4
  13689. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13690. * def __setstate_cython__(self, __pyx_state):
  13691. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13692. */
  13693. __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)
  13694. __Pyx_GOTREF(__pyx_t_1);
  13695. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13696. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13697. __PYX_ERR(1, 4, __pyx_L1_error)
  13698. /* "(tree fragment)":3
  13699. * def __reduce_cython__(self):
  13700. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13701. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13702. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13703. */
  13704. /* function exit code */
  13705. __pyx_L1_error:;
  13706. __Pyx_XDECREF(__pyx_t_1);
  13707. __Pyx_AddTraceback("gedlibpy.GEDEnv.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13708. __pyx_r = NULL;
  13709. __Pyx_XGIVEREF(__pyx_r);
  13710. __Pyx_RefNannyFinishContext();
  13711. return __pyx_r;
  13712. }
  13713. /* "gedlibpy.pyx":1390
  13714. * :type message: string
  13715. * """
  13716. * def __init__(self, message): # <<<<<<<<<<<<<<
  13717. * """
  13718. * Inits the error with its message.
  13719. */
  13720. /* Python wrapper */
  13721. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13722. 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";
  13723. 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__};
  13724. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13725. PyObject *__pyx_v_self = 0;
  13726. PyObject *__pyx_v_message = 0;
  13727. PyObject *__pyx_r = 0;
  13728. __Pyx_RefNannyDeclarations
  13729. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13730. {
  13731. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13732. PyObject* values[2] = {0,0};
  13733. if (unlikely(__pyx_kwds)) {
  13734. Py_ssize_t kw_args;
  13735. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13736. switch (pos_args) {
  13737. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13738. CYTHON_FALLTHROUGH;
  13739. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13740. CYTHON_FALLTHROUGH;
  13741. case 0: break;
  13742. default: goto __pyx_L5_argtuple_error;
  13743. }
  13744. kw_args = PyDict_Size(__pyx_kwds);
  13745. switch (pos_args) {
  13746. case 0:
  13747. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13748. else goto __pyx_L5_argtuple_error;
  13749. CYTHON_FALLTHROUGH;
  13750. case 1:
  13751. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13752. else {
  13753. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1390, __pyx_L3_error)
  13754. }
  13755. }
  13756. if (unlikely(kw_args > 0)) {
  13757. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1390, __pyx_L3_error)
  13758. }
  13759. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13760. goto __pyx_L5_argtuple_error;
  13761. } else {
  13762. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13763. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13764. }
  13765. __pyx_v_self = values[0];
  13766. __pyx_v_message = values[1];
  13767. }
  13768. goto __pyx_L4_argument_unpacking_done;
  13769. __pyx_L5_argtuple_error:;
  13770. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1390, __pyx_L3_error)
  13771. __pyx_L3_error:;
  13772. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13773. __Pyx_RefNannyFinishContext();
  13774. return NULL;
  13775. __pyx_L4_argument_unpacking_done:;
  13776. __pyx_r = __pyx_pf_8gedlibpy_13EditCostError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13777. /* function exit code */
  13778. __Pyx_RefNannyFinishContext();
  13779. return __pyx_r;
  13780. }
  13781. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13782. PyObject *__pyx_r = NULL;
  13783. __Pyx_RefNannyDeclarations
  13784. __Pyx_RefNannySetupContext("__init__", 0);
  13785. /* "gedlibpy.pyx":1397
  13786. * :type message: string
  13787. * """
  13788. * self.message = message # <<<<<<<<<<<<<<
  13789. *
  13790. *
  13791. */
  13792. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1397, __pyx_L1_error)
  13793. /* "gedlibpy.pyx":1390
  13794. * :type message: string
  13795. * """
  13796. * def __init__(self, message): # <<<<<<<<<<<<<<
  13797. * """
  13798. * Inits the error with its message.
  13799. */
  13800. /* function exit code */
  13801. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13802. goto __pyx_L0;
  13803. __pyx_L1_error:;
  13804. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13805. __pyx_r = NULL;
  13806. __pyx_L0:;
  13807. __Pyx_XGIVEREF(__pyx_r);
  13808. __Pyx_RefNannyFinishContext();
  13809. return __pyx_r;
  13810. }
  13811. /* "gedlibpy.pyx":1407
  13812. * :type message: string
  13813. * """
  13814. * def __init__(self, message): # <<<<<<<<<<<<<<
  13815. * """
  13816. * Inits the error with its message.
  13817. */
  13818. /* Python wrapper */
  13819. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13820. 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";
  13821. 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__};
  13822. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13823. PyObject *__pyx_v_self = 0;
  13824. PyObject *__pyx_v_message = 0;
  13825. PyObject *__pyx_r = 0;
  13826. __Pyx_RefNannyDeclarations
  13827. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13828. {
  13829. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13830. PyObject* values[2] = {0,0};
  13831. if (unlikely(__pyx_kwds)) {
  13832. Py_ssize_t kw_args;
  13833. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13834. switch (pos_args) {
  13835. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13836. CYTHON_FALLTHROUGH;
  13837. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13838. CYTHON_FALLTHROUGH;
  13839. case 0: break;
  13840. default: goto __pyx_L5_argtuple_error;
  13841. }
  13842. kw_args = PyDict_Size(__pyx_kwds);
  13843. switch (pos_args) {
  13844. case 0:
  13845. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13846. else goto __pyx_L5_argtuple_error;
  13847. CYTHON_FALLTHROUGH;
  13848. case 1:
  13849. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13850. else {
  13851. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1407, __pyx_L3_error)
  13852. }
  13853. }
  13854. if (unlikely(kw_args > 0)) {
  13855. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1407, __pyx_L3_error)
  13856. }
  13857. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13858. goto __pyx_L5_argtuple_error;
  13859. } else {
  13860. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13861. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13862. }
  13863. __pyx_v_self = values[0];
  13864. __pyx_v_message = values[1];
  13865. }
  13866. goto __pyx_L4_argument_unpacking_done;
  13867. __pyx_L5_argtuple_error:;
  13868. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1407, __pyx_L3_error)
  13869. __pyx_L3_error:;
  13870. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13871. __Pyx_RefNannyFinishContext();
  13872. return NULL;
  13873. __pyx_L4_argument_unpacking_done:;
  13874. __pyx_r = __pyx_pf_8gedlibpy_11MethodError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13875. /* function exit code */
  13876. __Pyx_RefNannyFinishContext();
  13877. return __pyx_r;
  13878. }
  13879. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13880. PyObject *__pyx_r = NULL;
  13881. __Pyx_RefNannyDeclarations
  13882. __Pyx_RefNannySetupContext("__init__", 0);
  13883. /* "gedlibpy.pyx":1414
  13884. * :type message: string
  13885. * """
  13886. * self.message = message # <<<<<<<<<<<<<<
  13887. *
  13888. *
  13889. */
  13890. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1414, __pyx_L1_error)
  13891. /* "gedlibpy.pyx":1407
  13892. * :type message: string
  13893. * """
  13894. * def __init__(self, message): # <<<<<<<<<<<<<<
  13895. * """
  13896. * Inits the error with its message.
  13897. */
  13898. /* function exit code */
  13899. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13900. goto __pyx_L0;
  13901. __pyx_L1_error:;
  13902. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13903. __pyx_r = NULL;
  13904. __pyx_L0:;
  13905. __Pyx_XGIVEREF(__pyx_r);
  13906. __Pyx_RefNannyFinishContext();
  13907. return __pyx_r;
  13908. }
  13909. /* "gedlibpy.pyx":1424
  13910. * :type message: string
  13911. * """
  13912. * def __init__(self, message): # <<<<<<<<<<<<<<
  13913. * """
  13914. * Inits the error with its message.
  13915. */
  13916. /* Python wrapper */
  13917. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13918. 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";
  13919. 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__};
  13920. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13921. PyObject *__pyx_v_self = 0;
  13922. PyObject *__pyx_v_message = 0;
  13923. PyObject *__pyx_r = 0;
  13924. __Pyx_RefNannyDeclarations
  13925. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13926. {
  13927. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13928. PyObject* values[2] = {0,0};
  13929. if (unlikely(__pyx_kwds)) {
  13930. Py_ssize_t kw_args;
  13931. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13932. switch (pos_args) {
  13933. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13934. CYTHON_FALLTHROUGH;
  13935. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13936. CYTHON_FALLTHROUGH;
  13937. case 0: break;
  13938. default: goto __pyx_L5_argtuple_error;
  13939. }
  13940. kw_args = PyDict_Size(__pyx_kwds);
  13941. switch (pos_args) {
  13942. case 0:
  13943. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13944. else goto __pyx_L5_argtuple_error;
  13945. CYTHON_FALLTHROUGH;
  13946. case 1:
  13947. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13948. else {
  13949. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1424, __pyx_L3_error)
  13950. }
  13951. }
  13952. if (unlikely(kw_args > 0)) {
  13953. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1424, __pyx_L3_error)
  13954. }
  13955. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13956. goto __pyx_L5_argtuple_error;
  13957. } else {
  13958. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13959. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13960. }
  13961. __pyx_v_self = values[0];
  13962. __pyx_v_message = values[1];
  13963. }
  13964. goto __pyx_L4_argument_unpacking_done;
  13965. __pyx_L5_argtuple_error:;
  13966. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1424, __pyx_L3_error)
  13967. __pyx_L3_error:;
  13968. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13969. __Pyx_RefNannyFinishContext();
  13970. return NULL;
  13971. __pyx_L4_argument_unpacking_done:;
  13972. __pyx_r = __pyx_pf_8gedlibpy_9InitError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13973. /* function exit code */
  13974. __Pyx_RefNannyFinishContext();
  13975. return __pyx_r;
  13976. }
  13977. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13978. PyObject *__pyx_r = NULL;
  13979. __Pyx_RefNannyDeclarations
  13980. __Pyx_RefNannySetupContext("__init__", 0);
  13981. /* "gedlibpy.pyx":1431
  13982. * :type message: string
  13983. * """
  13984. * self.message = message # <<<<<<<<<<<<<<
  13985. *
  13986. *
  13987. */
  13988. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  13989. /* "gedlibpy.pyx":1424
  13990. * :type message: string
  13991. * """
  13992. * def __init__(self, message): # <<<<<<<<<<<<<<
  13993. * """
  13994. * Inits the error with its message.
  13995. */
  13996. /* function exit code */
  13997. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13998. goto __pyx_L0;
  13999. __pyx_L1_error:;
  14000. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14001. __pyx_r = NULL;
  14002. __pyx_L0:;
  14003. __Pyx_XGIVEREF(__pyx_r);
  14004. __Pyx_RefNannyFinishContext();
  14005. return __pyx_r;
  14006. }
  14007. /* "gedlibpy.pyx":1438
  14008. * #########################################
  14009. *
  14010. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14011. * """
  14012. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14013. */
  14014. /* Python wrapper */
  14015. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u); /*proto*/
  14016. 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";
  14017. 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};
  14018. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14019. PyObject *__pyx_r = 0;
  14020. __Pyx_RefNannyDeclarations
  14021. __Pyx_RefNannySetupContext("encode_your_map (wrapper)", 0);
  14022. __pyx_r = __pyx_pf_8gedlibpy_8encode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_u));
  14023. /* function exit code */
  14024. __Pyx_RefNannyFinishContext();
  14025. return __pyx_r;
  14026. }
  14027. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14028. PyObject *__pyx_v_res = NULL;
  14029. PyObject *__pyx_v_key = NULL;
  14030. PyObject *__pyx_v_value = NULL;
  14031. PyObject *__pyx_r = NULL;
  14032. __Pyx_RefNannyDeclarations
  14033. PyObject *__pyx_t_1 = NULL;
  14034. Py_ssize_t __pyx_t_2;
  14035. Py_ssize_t __pyx_t_3;
  14036. int __pyx_t_4;
  14037. PyObject *__pyx_t_5 = NULL;
  14038. PyObject *__pyx_t_6 = NULL;
  14039. int __pyx_t_7;
  14040. PyObject *__pyx_t_8 = NULL;
  14041. PyObject *__pyx_t_9 = NULL;
  14042. __Pyx_RefNannySetupContext("encode_your_map", 0);
  14043. /* "gedlibpy.pyx":1450
  14044. *
  14045. * """
  14046. * res = {} # <<<<<<<<<<<<<<
  14047. * for key, value in map_u.items():
  14048. * res[key.encode('utf-8')] = value.encode('utf-8')
  14049. */
  14050. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
  14051. __Pyx_GOTREF(__pyx_t_1);
  14052. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14053. __pyx_t_1 = 0;
  14054. /* "gedlibpy.pyx":1451
  14055. * """
  14056. * res = {}
  14057. * for key, value in map_u.items(): # <<<<<<<<<<<<<<
  14058. * res[key.encode('utf-8')] = value.encode('utf-8')
  14059. * return res
  14060. */
  14061. __pyx_t_2 = 0;
  14062. if (unlikely(__pyx_v_map_u == Py_None)) {
  14063. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14064. __PYX_ERR(0, 1451, __pyx_L1_error)
  14065. }
  14066. __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, 1451, __pyx_L1_error)
  14067. __Pyx_GOTREF(__pyx_t_5);
  14068. __Pyx_XDECREF(__pyx_t_1);
  14069. __pyx_t_1 = __pyx_t_5;
  14070. __pyx_t_5 = 0;
  14071. while (1) {
  14072. __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);
  14073. if (unlikely(__pyx_t_7 == 0)) break;
  14074. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1451, __pyx_L1_error)
  14075. __Pyx_GOTREF(__pyx_t_5);
  14076. __Pyx_GOTREF(__pyx_t_6);
  14077. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14078. __pyx_t_5 = 0;
  14079. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14080. __pyx_t_6 = 0;
  14081. /* "gedlibpy.pyx":1452
  14082. * res = {}
  14083. * for key, value in map_u.items():
  14084. * res[key.encode('utf-8')] = value.encode('utf-8') # <<<<<<<<<<<<<<
  14085. * return res
  14086. *
  14087. */
  14088. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
  14089. __Pyx_GOTREF(__pyx_t_5);
  14090. __pyx_t_8 = NULL;
  14091. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14092. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14093. if (likely(__pyx_t_8)) {
  14094. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14095. __Pyx_INCREF(__pyx_t_8);
  14096. __Pyx_INCREF(function);
  14097. __Pyx_DECREF_SET(__pyx_t_5, function);
  14098. }
  14099. }
  14100. __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);
  14101. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14102. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1452, __pyx_L1_error)
  14103. __Pyx_GOTREF(__pyx_t_6);
  14104. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14105. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1452, __pyx_L1_error)
  14106. __Pyx_GOTREF(__pyx_t_8);
  14107. __pyx_t_9 = NULL;
  14108. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14109. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14110. if (likely(__pyx_t_9)) {
  14111. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14112. __Pyx_INCREF(__pyx_t_9);
  14113. __Pyx_INCREF(function);
  14114. __Pyx_DECREF_SET(__pyx_t_8, function);
  14115. }
  14116. }
  14117. __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);
  14118. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14119. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
  14120. __Pyx_GOTREF(__pyx_t_5);
  14121. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14122. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1452, __pyx_L1_error)
  14123. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14124. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14125. }
  14126. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14127. /* "gedlibpy.pyx":1453
  14128. * for key, value in map_u.items():
  14129. * res[key.encode('utf-8')] = value.encode('utf-8')
  14130. * return res # <<<<<<<<<<<<<<
  14131. *
  14132. *
  14133. */
  14134. __Pyx_XDECREF(__pyx_r);
  14135. __Pyx_INCREF(__pyx_v_res);
  14136. __pyx_r = __pyx_v_res;
  14137. goto __pyx_L0;
  14138. /* "gedlibpy.pyx":1438
  14139. * #########################################
  14140. *
  14141. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14142. * """
  14143. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14144. */
  14145. /* function exit code */
  14146. __pyx_L1_error:;
  14147. __Pyx_XDECREF(__pyx_t_1);
  14148. __Pyx_XDECREF(__pyx_t_5);
  14149. __Pyx_XDECREF(__pyx_t_6);
  14150. __Pyx_XDECREF(__pyx_t_8);
  14151. __Pyx_XDECREF(__pyx_t_9);
  14152. __Pyx_AddTraceback("gedlibpy.encode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14153. __pyx_r = NULL;
  14154. __pyx_L0:;
  14155. __Pyx_XDECREF(__pyx_v_res);
  14156. __Pyx_XDECREF(__pyx_v_key);
  14157. __Pyx_XDECREF(__pyx_v_value);
  14158. __Pyx_XGIVEREF(__pyx_r);
  14159. __Pyx_RefNannyFinishContext();
  14160. return __pyx_r;
  14161. }
  14162. /* "gedlibpy.pyx":1456
  14163. *
  14164. *
  14165. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14166. * """
  14167. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14168. */
  14169. /* Python wrapper */
  14170. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b); /*proto*/
  14171. 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";
  14172. 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};
  14173. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14174. PyObject *__pyx_r = 0;
  14175. __Pyx_RefNannyDeclarations
  14176. __Pyx_RefNannySetupContext("decode_your_map (wrapper)", 0);
  14177. __pyx_r = __pyx_pf_8gedlibpy_10decode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_b));
  14178. /* function exit code */
  14179. __Pyx_RefNannyFinishContext();
  14180. return __pyx_r;
  14181. }
  14182. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14183. PyObject *__pyx_v_res = NULL;
  14184. PyObject *__pyx_v_key = NULL;
  14185. PyObject *__pyx_v_value = NULL;
  14186. PyObject *__pyx_r = NULL;
  14187. __Pyx_RefNannyDeclarations
  14188. PyObject *__pyx_t_1 = NULL;
  14189. Py_ssize_t __pyx_t_2;
  14190. Py_ssize_t __pyx_t_3;
  14191. int __pyx_t_4;
  14192. PyObject *__pyx_t_5 = NULL;
  14193. PyObject *__pyx_t_6 = NULL;
  14194. int __pyx_t_7;
  14195. PyObject *__pyx_t_8 = NULL;
  14196. PyObject *__pyx_t_9 = NULL;
  14197. __Pyx_RefNannySetupContext("decode_your_map", 0);
  14198. /* "gedlibpy.pyx":1468
  14199. *
  14200. * """
  14201. * res = {} # <<<<<<<<<<<<<<
  14202. * for key, value in map_b.items():
  14203. * res[key.decode('utf-8')] = value.decode('utf-8')
  14204. */
  14205. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
  14206. __Pyx_GOTREF(__pyx_t_1);
  14207. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14208. __pyx_t_1 = 0;
  14209. /* "gedlibpy.pyx":1469
  14210. * """
  14211. * res = {}
  14212. * for key, value in map_b.items(): # <<<<<<<<<<<<<<
  14213. * res[key.decode('utf-8')] = value.decode('utf-8')
  14214. * return res
  14215. */
  14216. __pyx_t_2 = 0;
  14217. if (unlikely(__pyx_v_map_b == Py_None)) {
  14218. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14219. __PYX_ERR(0, 1469, __pyx_L1_error)
  14220. }
  14221. __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, 1469, __pyx_L1_error)
  14222. __Pyx_GOTREF(__pyx_t_5);
  14223. __Pyx_XDECREF(__pyx_t_1);
  14224. __pyx_t_1 = __pyx_t_5;
  14225. __pyx_t_5 = 0;
  14226. while (1) {
  14227. __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);
  14228. if (unlikely(__pyx_t_7 == 0)) break;
  14229. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1469, __pyx_L1_error)
  14230. __Pyx_GOTREF(__pyx_t_5);
  14231. __Pyx_GOTREF(__pyx_t_6);
  14232. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14233. __pyx_t_5 = 0;
  14234. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14235. __pyx_t_6 = 0;
  14236. /* "gedlibpy.pyx":1470
  14237. * res = {}
  14238. * for key, value in map_b.items():
  14239. * res[key.decode('utf-8')] = value.decode('utf-8') # <<<<<<<<<<<<<<
  14240. * return res
  14241. *
  14242. */
  14243. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14244. __Pyx_GOTREF(__pyx_t_5);
  14245. __pyx_t_8 = NULL;
  14246. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14247. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14248. if (likely(__pyx_t_8)) {
  14249. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14250. __Pyx_INCREF(__pyx_t_8);
  14251. __Pyx_INCREF(function);
  14252. __Pyx_DECREF_SET(__pyx_t_5, function);
  14253. }
  14254. }
  14255. __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);
  14256. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14257. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14258. __Pyx_GOTREF(__pyx_t_6);
  14259. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14260. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14261. __Pyx_GOTREF(__pyx_t_8);
  14262. __pyx_t_9 = NULL;
  14263. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14264. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14265. if (likely(__pyx_t_9)) {
  14266. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14267. __Pyx_INCREF(__pyx_t_9);
  14268. __Pyx_INCREF(function);
  14269. __Pyx_DECREF_SET(__pyx_t_8, function);
  14270. }
  14271. }
  14272. __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);
  14273. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14274. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14275. __Pyx_GOTREF(__pyx_t_5);
  14276. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14277. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14278. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14279. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14280. }
  14281. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14282. /* "gedlibpy.pyx":1471
  14283. * for key, value in map_b.items():
  14284. * res[key.decode('utf-8')] = value.decode('utf-8')
  14285. * return res # <<<<<<<<<<<<<<
  14286. *
  14287. *
  14288. */
  14289. __Pyx_XDECREF(__pyx_r);
  14290. __Pyx_INCREF(__pyx_v_res);
  14291. __pyx_r = __pyx_v_res;
  14292. goto __pyx_L0;
  14293. /* "gedlibpy.pyx":1456
  14294. *
  14295. *
  14296. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14297. * """
  14298. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14299. */
  14300. /* function exit code */
  14301. __pyx_L1_error:;
  14302. __Pyx_XDECREF(__pyx_t_1);
  14303. __Pyx_XDECREF(__pyx_t_5);
  14304. __Pyx_XDECREF(__pyx_t_6);
  14305. __Pyx_XDECREF(__pyx_t_8);
  14306. __Pyx_XDECREF(__pyx_t_9);
  14307. __Pyx_AddTraceback("gedlibpy.decode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14308. __pyx_r = NULL;
  14309. __pyx_L0:;
  14310. __Pyx_XDECREF(__pyx_v_res);
  14311. __Pyx_XDECREF(__pyx_v_key);
  14312. __Pyx_XDECREF(__pyx_v_value);
  14313. __Pyx_XGIVEREF(__pyx_r);
  14314. __Pyx_RefNannyFinishContext();
  14315. return __pyx_r;
  14316. }
  14317. /* "gedlibpy.pyx":1474
  14318. *
  14319. *
  14320. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14321. * """
  14322. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14323. */
  14324. /* Python wrapper */
  14325. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /*proto*/
  14326. 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";
  14327. 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};
  14328. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14329. PyObject *__pyx_r = 0;
  14330. __Pyx_RefNannyDeclarations
  14331. __Pyx_RefNannySetupContext("decode_graph_edges (wrapper)", 0);
  14332. __pyx_r = __pyx_pf_8gedlibpy_12decode_graph_edges(__pyx_self, ((PyObject *)__pyx_v_map_edge_b));
  14333. /* function exit code */
  14334. __Pyx_RefNannyFinishContext();
  14335. return __pyx_r;
  14336. }
  14337. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14338. PyObject *__pyx_v_map_edges = NULL;
  14339. PyObject *__pyx_v_key = NULL;
  14340. PyObject *__pyx_v_value = NULL;
  14341. PyObject *__pyx_r = NULL;
  14342. __Pyx_RefNannyDeclarations
  14343. PyObject *__pyx_t_1 = NULL;
  14344. Py_ssize_t __pyx_t_2;
  14345. Py_ssize_t __pyx_t_3;
  14346. int __pyx_t_4;
  14347. PyObject *__pyx_t_5 = NULL;
  14348. PyObject *__pyx_t_6 = NULL;
  14349. int __pyx_t_7;
  14350. PyObject *__pyx_t_8 = NULL;
  14351. __Pyx_RefNannySetupContext("decode_graph_edges", 0);
  14352. /* "gedlibpy.pyx":1492
  14353. * This is a helper function for function `GEDEnv.get_graph_edges()`.
  14354. * """
  14355. * map_edges = {} # <<<<<<<<<<<<<<
  14356. * for key, value in map_edge_b.items():
  14357. * map_edges[key] = decode_your_map(value)
  14358. */
  14359. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
  14360. __Pyx_GOTREF(__pyx_t_1);
  14361. __pyx_v_map_edges = ((PyObject*)__pyx_t_1);
  14362. __pyx_t_1 = 0;
  14363. /* "gedlibpy.pyx":1493
  14364. * """
  14365. * map_edges = {}
  14366. * for key, value in map_edge_b.items(): # <<<<<<<<<<<<<<
  14367. * map_edges[key] = decode_your_map(value)
  14368. * return map_edges
  14369. */
  14370. __pyx_t_2 = 0;
  14371. if (unlikely(__pyx_v_map_edge_b == Py_None)) {
  14372. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14373. __PYX_ERR(0, 1493, __pyx_L1_error)
  14374. }
  14375. __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, 1493, __pyx_L1_error)
  14376. __Pyx_GOTREF(__pyx_t_5);
  14377. __Pyx_XDECREF(__pyx_t_1);
  14378. __pyx_t_1 = __pyx_t_5;
  14379. __pyx_t_5 = 0;
  14380. while (1) {
  14381. __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);
  14382. if (unlikely(__pyx_t_7 == 0)) break;
  14383. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1493, __pyx_L1_error)
  14384. __Pyx_GOTREF(__pyx_t_5);
  14385. __Pyx_GOTREF(__pyx_t_6);
  14386. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14387. __pyx_t_5 = 0;
  14388. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14389. __pyx_t_6 = 0;
  14390. /* "gedlibpy.pyx":1494
  14391. * map_edges = {}
  14392. * for key, value in map_edge_b.items():
  14393. * map_edges[key] = decode_your_map(value) # <<<<<<<<<<<<<<
  14394. * return map_edges
  14395. *
  14396. */
  14397. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1494, __pyx_L1_error)
  14398. __Pyx_GOTREF(__pyx_t_5);
  14399. __pyx_t_8 = NULL;
  14400. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
  14401. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14402. if (likely(__pyx_t_8)) {
  14403. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14404. __Pyx_INCREF(__pyx_t_8);
  14405. __Pyx_INCREF(function);
  14406. __Pyx_DECREF_SET(__pyx_t_5, function);
  14407. }
  14408. }
  14409. __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);
  14410. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14411. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
  14412. __Pyx_GOTREF(__pyx_t_6);
  14413. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14414. if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  14415. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14416. }
  14417. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14418. /* "gedlibpy.pyx":1495
  14419. * for key, value in map_edge_b.items():
  14420. * map_edges[key] = decode_your_map(value)
  14421. * return map_edges # <<<<<<<<<<<<<<
  14422. *
  14423. *
  14424. */
  14425. __Pyx_XDECREF(__pyx_r);
  14426. __Pyx_INCREF(__pyx_v_map_edges);
  14427. __pyx_r = __pyx_v_map_edges;
  14428. goto __pyx_L0;
  14429. /* "gedlibpy.pyx":1474
  14430. *
  14431. *
  14432. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14433. * """
  14434. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14435. */
  14436. /* function exit code */
  14437. __pyx_L1_error:;
  14438. __Pyx_XDECREF(__pyx_t_1);
  14439. __Pyx_XDECREF(__pyx_t_5);
  14440. __Pyx_XDECREF(__pyx_t_6);
  14441. __Pyx_XDECREF(__pyx_t_8);
  14442. __Pyx_AddTraceback("gedlibpy.decode_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14443. __pyx_r = NULL;
  14444. __pyx_L0:;
  14445. __Pyx_XDECREF(__pyx_v_map_edges);
  14446. __Pyx_XDECREF(__pyx_v_key);
  14447. __Pyx_XDECREF(__pyx_v_value);
  14448. __Pyx_XGIVEREF(__pyx_r);
  14449. __Pyx_RefNannyFinishContext();
  14450. return __pyx_r;
  14451. }
  14452. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  14453. * # experimental exception made for __getbuffer__ and __releasebuffer__
  14454. * # -- the details of this may change.
  14455. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  14456. * # This implementation of getbuffer is geared towards Cython
  14457. * # requirements, and does not yet fulfill the PEP.
  14458. */
  14459. /* Python wrapper */
  14460. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  14461. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14462. int __pyx_r;
  14463. __Pyx_RefNannyDeclarations
  14464. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  14465. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  14466. /* function exit code */
  14467. __Pyx_RefNannyFinishContext();
  14468. return __pyx_r;
  14469. }
  14470. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14471. int __pyx_v_i;
  14472. int __pyx_v_ndim;
  14473. int __pyx_v_endian_detector;
  14474. int __pyx_v_little_endian;
  14475. int __pyx_v_t;
  14476. char *__pyx_v_f;
  14477. PyArray_Descr *__pyx_v_descr = 0;
  14478. int __pyx_v_offset;
  14479. int __pyx_r;
  14480. __Pyx_RefNannyDeclarations
  14481. int __pyx_t_1;
  14482. int __pyx_t_2;
  14483. PyObject *__pyx_t_3 = NULL;
  14484. int __pyx_t_4;
  14485. int __pyx_t_5;
  14486. int __pyx_t_6;
  14487. PyArray_Descr *__pyx_t_7;
  14488. PyObject *__pyx_t_8 = NULL;
  14489. char *__pyx_t_9;
  14490. if (__pyx_v_info == NULL) {
  14491. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  14492. return -1;
  14493. }
  14494. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  14495. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  14496. __Pyx_GIVEREF(__pyx_v_info->obj);
  14497. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
  14498. *
  14499. * cdef int i, ndim
  14500. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  14501. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14502. *
  14503. */
  14504. __pyx_v_endian_detector = 1;
  14505. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
  14506. * cdef int i, ndim
  14507. * cdef int endian_detector = 1
  14508. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  14509. *
  14510. * ndim = PyArray_NDIM(self)
  14511. */
  14512. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  14513. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
  14514. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14515. *
  14516. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  14517. *
  14518. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14519. */
  14520. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  14521. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14522. * ndim = PyArray_NDIM(self)
  14523. *
  14524. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14525. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14526. * raise ValueError(u"ndarray is not C contiguous")
  14527. */
  14528. __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  14529. if (__pyx_t_2) {
  14530. } else {
  14531. __pyx_t_1 = __pyx_t_2;
  14532. goto __pyx_L4_bool_binop_done;
  14533. }
  14534. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
  14535. *
  14536. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14537. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14538. * raise ValueError(u"ndarray is not C contiguous")
  14539. *
  14540. */
  14541. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  14542. __pyx_t_1 = __pyx_t_2;
  14543. __pyx_L4_bool_binop_done:;
  14544. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14545. * ndim = PyArray_NDIM(self)
  14546. *
  14547. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14548. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14549. * raise ValueError(u"ndarray is not C contiguous")
  14550. */
  14551. if (unlikely(__pyx_t_1)) {
  14552. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  14553. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14554. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14555. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  14556. *
  14557. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14558. */
  14559. __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)
  14560. __Pyx_GOTREF(__pyx_t_3);
  14561. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14562. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14563. __PYX_ERR(2, 272, __pyx_L1_error)
  14564. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14565. * ndim = PyArray_NDIM(self)
  14566. *
  14567. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14568. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14569. * raise ValueError(u"ndarray is not C contiguous")
  14570. */
  14571. }
  14572. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14573. * raise ValueError(u"ndarray is not C contiguous")
  14574. *
  14575. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14576. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14577. * raise ValueError(u"ndarray is not Fortran contiguous")
  14578. */
  14579. __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  14580. if (__pyx_t_2) {
  14581. } else {
  14582. __pyx_t_1 = __pyx_t_2;
  14583. goto __pyx_L7_bool_binop_done;
  14584. }
  14585. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
  14586. *
  14587. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14588. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14589. * raise ValueError(u"ndarray is not Fortran contiguous")
  14590. *
  14591. */
  14592. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  14593. __pyx_t_1 = __pyx_t_2;
  14594. __pyx_L7_bool_binop_done:;
  14595. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14596. * raise ValueError(u"ndarray is not C contiguous")
  14597. *
  14598. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14599. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14600. * raise ValueError(u"ndarray is not Fortran contiguous")
  14601. */
  14602. if (unlikely(__pyx_t_1)) {
  14603. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  14604. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14605. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14606. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  14607. *
  14608. * info.buf = PyArray_DATA(self)
  14609. */
  14610. __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)
  14611. __Pyx_GOTREF(__pyx_t_3);
  14612. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14613. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14614. __PYX_ERR(2, 276, __pyx_L1_error)
  14615. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14616. * raise ValueError(u"ndarray is not C contiguous")
  14617. *
  14618. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14619. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14620. * raise ValueError(u"ndarray is not Fortran contiguous")
  14621. */
  14622. }
  14623. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
  14624. * raise ValueError(u"ndarray is not Fortran contiguous")
  14625. *
  14626. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  14627. * info.ndim = ndim
  14628. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14629. */
  14630. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  14631. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
  14632. *
  14633. * info.buf = PyArray_DATA(self)
  14634. * info.ndim = ndim # <<<<<<<<<<<<<<
  14635. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14636. * # Allocate new buffer for strides and shape info.
  14637. */
  14638. __pyx_v_info->ndim = __pyx_v_ndim;
  14639. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14640. * info.buf = PyArray_DATA(self)
  14641. * info.ndim = ndim
  14642. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14643. * # Allocate new buffer for strides and shape info.
  14644. * # This is allocated as one block, strides first.
  14645. */
  14646. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  14647. if (__pyx_t_1) {
  14648. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
  14649. * # Allocate new buffer for strides and shape info.
  14650. * # This is allocated as one block, strides first.
  14651. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
  14652. * info.shape = info.strides + ndim
  14653. * for i in range(ndim):
  14654. */
  14655. __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
  14656. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
  14657. * # This is allocated as one block, strides first.
  14658. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14659. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  14660. * for i in range(ndim):
  14661. * info.strides[i] = PyArray_STRIDES(self)[i]
  14662. */
  14663. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  14664. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
  14665. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14666. * info.shape = info.strides + ndim
  14667. * for i in range(ndim): # <<<<<<<<<<<<<<
  14668. * info.strides[i] = PyArray_STRIDES(self)[i]
  14669. * info.shape[i] = PyArray_DIMS(self)[i]
  14670. */
  14671. __pyx_t_4 = __pyx_v_ndim;
  14672. __pyx_t_5 = __pyx_t_4;
  14673. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  14674. __pyx_v_i = __pyx_t_6;
  14675. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
  14676. * info.shape = info.strides + ndim
  14677. * for i in range(ndim):
  14678. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  14679. * info.shape[i] = PyArray_DIMS(self)[i]
  14680. * else:
  14681. */
  14682. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  14683. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
  14684. * for i in range(ndim):
  14685. * info.strides[i] = PyArray_STRIDES(self)[i]
  14686. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  14687. * else:
  14688. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14689. */
  14690. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  14691. }
  14692. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14693. * info.buf = PyArray_DATA(self)
  14694. * info.ndim = ndim
  14695. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14696. * # Allocate new buffer for strides and shape info.
  14697. * # This is allocated as one block, strides first.
  14698. */
  14699. goto __pyx_L9;
  14700. }
  14701. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
  14702. * info.shape[i] = PyArray_DIMS(self)[i]
  14703. * else:
  14704. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  14705. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14706. * info.suboffsets = NULL
  14707. */
  14708. /*else*/ {
  14709. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  14710. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
  14711. * else:
  14712. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14713. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  14714. * info.suboffsets = NULL
  14715. * info.itemsize = PyArray_ITEMSIZE(self)
  14716. */
  14717. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  14718. }
  14719. __pyx_L9:;
  14720. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
  14721. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14722. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14723. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  14724. * info.itemsize = PyArray_ITEMSIZE(self)
  14725. * info.readonly = not PyArray_ISWRITEABLE(self)
  14726. */
  14727. __pyx_v_info->suboffsets = NULL;
  14728. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
  14729. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14730. * info.suboffsets = NULL
  14731. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  14732. * info.readonly = not PyArray_ISWRITEABLE(self)
  14733. *
  14734. */
  14735. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  14736. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
  14737. * info.suboffsets = NULL
  14738. * info.itemsize = PyArray_ITEMSIZE(self)
  14739. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  14740. *
  14741. * cdef int t
  14742. */
  14743. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  14744. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
  14745. *
  14746. * cdef int t
  14747. * cdef char* f = NULL # <<<<<<<<<<<<<<
  14748. * cdef dtype descr = <dtype>PyArray_DESCR(self)
  14749. * cdef int offset
  14750. */
  14751. __pyx_v_f = NULL;
  14752. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
  14753. * cdef int t
  14754. * cdef char* f = NULL
  14755. * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
  14756. * cdef int offset
  14757. *
  14758. */
  14759. __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  14760. __pyx_t_3 = ((PyObject *)__pyx_t_7);
  14761. __Pyx_INCREF(__pyx_t_3);
  14762. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  14763. __pyx_t_3 = 0;
  14764. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
  14765. * cdef int offset
  14766. *
  14767. * info.obj = self # <<<<<<<<<<<<<<
  14768. *
  14769. * if not PyDataType_HASFIELDS(descr):
  14770. */
  14771. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  14772. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  14773. __Pyx_GOTREF(__pyx_v_info->obj);
  14774. __Pyx_DECREF(__pyx_v_info->obj);
  14775. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  14776. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  14777. * info.obj = self
  14778. *
  14779. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  14780. * t = descr.type_num
  14781. * if ((descr.byteorder == c'>' and little_endian) or
  14782. */
  14783. __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  14784. if (__pyx_t_1) {
  14785. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
  14786. *
  14787. * if not PyDataType_HASFIELDS(descr):
  14788. * t = descr.type_num # <<<<<<<<<<<<<<
  14789. * if ((descr.byteorder == c'>' and little_endian) or
  14790. * (descr.byteorder == c'<' and not little_endian)):
  14791. */
  14792. __pyx_t_4 = __pyx_v_descr->type_num;
  14793. __pyx_v_t = __pyx_t_4;
  14794. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14795. * if not PyDataType_HASFIELDS(descr):
  14796. * t = descr.type_num
  14797. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14798. * (descr.byteorder == c'<' and not little_endian)):
  14799. * raise ValueError(u"Non-native byte order not supported")
  14800. */
  14801. __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
  14802. if (!__pyx_t_2) {
  14803. goto __pyx_L15_next_or;
  14804. } else {
  14805. }
  14806. __pyx_t_2 = (__pyx_v_little_endian != 0);
  14807. if (!__pyx_t_2) {
  14808. } else {
  14809. __pyx_t_1 = __pyx_t_2;
  14810. goto __pyx_L14_bool_binop_done;
  14811. }
  14812. __pyx_L15_next_or:;
  14813. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
  14814. * t = descr.type_num
  14815. * if ((descr.byteorder == c'>' and little_endian) or
  14816. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  14817. * raise ValueError(u"Non-native byte order not supported")
  14818. * if t == NPY_BYTE: f = "b"
  14819. */
  14820. __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
  14821. if (__pyx_t_2) {
  14822. } else {
  14823. __pyx_t_1 = __pyx_t_2;
  14824. goto __pyx_L14_bool_binop_done;
  14825. }
  14826. __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
  14827. __pyx_t_1 = __pyx_t_2;
  14828. __pyx_L14_bool_binop_done:;
  14829. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14830. * if not PyDataType_HASFIELDS(descr):
  14831. * t = descr.type_num
  14832. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14833. * (descr.byteorder == c'<' and not little_endian)):
  14834. * raise ValueError(u"Non-native byte order not supported")
  14835. */
  14836. if (unlikely(__pyx_t_1)) {
  14837. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  14838. * if ((descr.byteorder == c'>' and little_endian) or
  14839. * (descr.byteorder == c'<' and not little_endian)):
  14840. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  14841. * if t == NPY_BYTE: f = "b"
  14842. * elif t == NPY_UBYTE: f = "B"
  14843. */
  14844. __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)
  14845. __Pyx_GOTREF(__pyx_t_3);
  14846. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14847. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14848. __PYX_ERR(2, 306, __pyx_L1_error)
  14849. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14850. * if not PyDataType_HASFIELDS(descr):
  14851. * t = descr.type_num
  14852. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14853. * (descr.byteorder == c'<' and not little_endian)):
  14854. * raise ValueError(u"Non-native byte order not supported")
  14855. */
  14856. }
  14857. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
  14858. * (descr.byteorder == c'<' and not little_endian)):
  14859. * raise ValueError(u"Non-native byte order not supported")
  14860. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  14861. * elif t == NPY_UBYTE: f = "B"
  14862. * elif t == NPY_SHORT: f = "h"
  14863. */
  14864. switch (__pyx_v_t) {
  14865. case NPY_BYTE:
  14866. __pyx_v_f = ((char *)"b");
  14867. break;
  14868. case NPY_UBYTE:
  14869. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
  14870. * raise ValueError(u"Non-native byte order not supported")
  14871. * if t == NPY_BYTE: f = "b"
  14872. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  14873. * elif t == NPY_SHORT: f = "h"
  14874. * elif t == NPY_USHORT: f = "H"
  14875. */
  14876. __pyx_v_f = ((char *)"B");
  14877. break;
  14878. case NPY_SHORT:
  14879. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
  14880. * if t == NPY_BYTE: f = "b"
  14881. * elif t == NPY_UBYTE: f = "B"
  14882. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  14883. * elif t == NPY_USHORT: f = "H"
  14884. * elif t == NPY_INT: f = "i"
  14885. */
  14886. __pyx_v_f = ((char *)"h");
  14887. break;
  14888. case NPY_USHORT:
  14889. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
  14890. * elif t == NPY_UBYTE: f = "B"
  14891. * elif t == NPY_SHORT: f = "h"
  14892. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  14893. * elif t == NPY_INT: f = "i"
  14894. * elif t == NPY_UINT: f = "I"
  14895. */
  14896. __pyx_v_f = ((char *)"H");
  14897. break;
  14898. case NPY_INT:
  14899. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
  14900. * elif t == NPY_SHORT: f = "h"
  14901. * elif t == NPY_USHORT: f = "H"
  14902. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  14903. * elif t == NPY_UINT: f = "I"
  14904. * elif t == NPY_LONG: f = "l"
  14905. */
  14906. __pyx_v_f = ((char *)"i");
  14907. break;
  14908. case NPY_UINT:
  14909. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
  14910. * elif t == NPY_USHORT: f = "H"
  14911. * elif t == NPY_INT: f = "i"
  14912. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  14913. * elif t == NPY_LONG: f = "l"
  14914. * elif t == NPY_ULONG: f = "L"
  14915. */
  14916. __pyx_v_f = ((char *)"I");
  14917. break;
  14918. case NPY_LONG:
  14919. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
  14920. * elif t == NPY_INT: f = "i"
  14921. * elif t == NPY_UINT: f = "I"
  14922. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  14923. * elif t == NPY_ULONG: f = "L"
  14924. * elif t == NPY_LONGLONG: f = "q"
  14925. */
  14926. __pyx_v_f = ((char *)"l");
  14927. break;
  14928. case NPY_ULONG:
  14929. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
  14930. * elif t == NPY_UINT: f = "I"
  14931. * elif t == NPY_LONG: f = "l"
  14932. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  14933. * elif t == NPY_LONGLONG: f = "q"
  14934. * elif t == NPY_ULONGLONG: f = "Q"
  14935. */
  14936. __pyx_v_f = ((char *)"L");
  14937. break;
  14938. case NPY_LONGLONG:
  14939. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
  14940. * elif t == NPY_LONG: f = "l"
  14941. * elif t == NPY_ULONG: f = "L"
  14942. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  14943. * elif t == NPY_ULONGLONG: f = "Q"
  14944. * elif t == NPY_FLOAT: f = "f"
  14945. */
  14946. __pyx_v_f = ((char *)"q");
  14947. break;
  14948. case NPY_ULONGLONG:
  14949. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
  14950. * elif t == NPY_ULONG: f = "L"
  14951. * elif t == NPY_LONGLONG: f = "q"
  14952. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  14953. * elif t == NPY_FLOAT: f = "f"
  14954. * elif t == NPY_DOUBLE: f = "d"
  14955. */
  14956. __pyx_v_f = ((char *)"Q");
  14957. break;
  14958. case NPY_FLOAT:
  14959. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
  14960. * elif t == NPY_LONGLONG: f = "q"
  14961. * elif t == NPY_ULONGLONG: f = "Q"
  14962. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  14963. * elif t == NPY_DOUBLE: f = "d"
  14964. * elif t == NPY_LONGDOUBLE: f = "g"
  14965. */
  14966. __pyx_v_f = ((char *)"f");
  14967. break;
  14968. case NPY_DOUBLE:
  14969. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
  14970. * elif t == NPY_ULONGLONG: f = "Q"
  14971. * elif t == NPY_FLOAT: f = "f"
  14972. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  14973. * elif t == NPY_LONGDOUBLE: f = "g"
  14974. * elif t == NPY_CFLOAT: f = "Zf"
  14975. */
  14976. __pyx_v_f = ((char *)"d");
  14977. break;
  14978. case NPY_LONGDOUBLE:
  14979. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
  14980. * elif t == NPY_FLOAT: f = "f"
  14981. * elif t == NPY_DOUBLE: f = "d"
  14982. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  14983. * elif t == NPY_CFLOAT: f = "Zf"
  14984. * elif t == NPY_CDOUBLE: f = "Zd"
  14985. */
  14986. __pyx_v_f = ((char *)"g");
  14987. break;
  14988. case NPY_CFLOAT:
  14989. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
  14990. * elif t == NPY_DOUBLE: f = "d"
  14991. * elif t == NPY_LONGDOUBLE: f = "g"
  14992. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  14993. * elif t == NPY_CDOUBLE: f = "Zd"
  14994. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  14995. */
  14996. __pyx_v_f = ((char *)"Zf");
  14997. break;
  14998. case NPY_CDOUBLE:
  14999. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
  15000. * elif t == NPY_LONGDOUBLE: f = "g"
  15001. * elif t == NPY_CFLOAT: f = "Zf"
  15002. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  15003. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15004. * elif t == NPY_OBJECT: f = "O"
  15005. */
  15006. __pyx_v_f = ((char *)"Zd");
  15007. break;
  15008. case NPY_CLONGDOUBLE:
  15009. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
  15010. * elif t == NPY_CFLOAT: f = "Zf"
  15011. * elif t == NPY_CDOUBLE: f = "Zd"
  15012. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  15013. * elif t == NPY_OBJECT: f = "O"
  15014. * else:
  15015. */
  15016. __pyx_v_f = ((char *)"Zg");
  15017. break;
  15018. case NPY_OBJECT:
  15019. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
  15020. * elif t == NPY_CDOUBLE: f = "Zd"
  15021. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15022. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  15023. * else:
  15024. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15025. */
  15026. __pyx_v_f = ((char *)"O");
  15027. break;
  15028. default:
  15029. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
  15030. * elif t == NPY_OBJECT: f = "O"
  15031. * else:
  15032. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  15033. * info.format = f
  15034. * return
  15035. */
  15036. __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15037. __Pyx_GOTREF(__pyx_t_3);
  15038. __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)
  15039. __Pyx_GOTREF(__pyx_t_8);
  15040. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15041. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15042. __Pyx_GOTREF(__pyx_t_3);
  15043. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  15044. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15045. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15046. __PYX_ERR(2, 325, __pyx_L1_error)
  15047. break;
  15048. }
  15049. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
  15050. * else:
  15051. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15052. * info.format = f # <<<<<<<<<<<<<<
  15053. * return
  15054. * else:
  15055. */
  15056. __pyx_v_info->format = __pyx_v_f;
  15057. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
  15058. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15059. * info.format = f
  15060. * return # <<<<<<<<<<<<<<
  15061. * else:
  15062. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15063. */
  15064. __pyx_r = 0;
  15065. goto __pyx_L0;
  15066. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  15067. * info.obj = self
  15068. *
  15069. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  15070. * t = descr.type_num
  15071. * if ((descr.byteorder == c'>' and little_endian) or
  15072. */
  15073. }
  15074. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
  15075. * return
  15076. * else:
  15077. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  15078. * info.format[0] = c'^' # Native data types, manual alignment
  15079. * offset = 0
  15080. */
  15081. /*else*/ {
  15082. __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
  15083. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
  15084. * else:
  15085. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15086. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  15087. * offset = 0
  15088. * f = _util_dtypestring(descr, info.format + 1,
  15089. */
  15090. (__pyx_v_info->format[0]) = '^';
  15091. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
  15092. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15093. * info.format[0] = c'^' # Native data types, manual alignment
  15094. * offset = 0 # <<<<<<<<<<<<<<
  15095. * f = _util_dtypestring(descr, info.format + 1,
  15096. * info.format + _buffer_format_string_len,
  15097. */
  15098. __pyx_v_offset = 0;
  15099. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
  15100. * info.format[0] = c'^' # Native data types, manual alignment
  15101. * offset = 0
  15102. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  15103. * info.format + _buffer_format_string_len,
  15104. * &offset)
  15105. */
  15106. __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)
  15107. __pyx_v_f = __pyx_t_9;
  15108. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
  15109. * info.format + _buffer_format_string_len,
  15110. * &offset)
  15111. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  15112. *
  15113. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15114. */
  15115. (__pyx_v_f[0]) = '\x00';
  15116. }
  15117. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  15118. * # experimental exception made for __getbuffer__ and __releasebuffer__
  15119. * # -- the details of this may change.
  15120. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  15121. * # This implementation of getbuffer is geared towards Cython
  15122. * # requirements, and does not yet fulfill the PEP.
  15123. */
  15124. /* function exit code */
  15125. __pyx_r = 0;
  15126. goto __pyx_L0;
  15127. __pyx_L1_error:;
  15128. __Pyx_XDECREF(__pyx_t_3);
  15129. __Pyx_XDECREF(__pyx_t_8);
  15130. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15131. __pyx_r = -1;
  15132. if (__pyx_v_info->obj != NULL) {
  15133. __Pyx_GOTREF(__pyx_v_info->obj);
  15134. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15135. }
  15136. goto __pyx_L2;
  15137. __pyx_L0:;
  15138. if (__pyx_v_info->obj == Py_None) {
  15139. __Pyx_GOTREF(__pyx_v_info->obj);
  15140. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15141. }
  15142. __pyx_L2:;
  15143. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  15144. __Pyx_RefNannyFinishContext();
  15145. return __pyx_r;
  15146. }
  15147. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15148. * f[0] = c'\0' # Terminate format string
  15149. *
  15150. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15151. * if PyArray_HASFIELDS(self):
  15152. * PyObject_Free(info.format)
  15153. */
  15154. /* Python wrapper */
  15155. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  15156. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15157. __Pyx_RefNannyDeclarations
  15158. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  15159. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  15160. /* function exit code */
  15161. __Pyx_RefNannyFinishContext();
  15162. }
  15163. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15164. __Pyx_RefNannyDeclarations
  15165. int __pyx_t_1;
  15166. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  15167. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15168. *
  15169. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15170. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15171. * PyObject_Free(info.format)
  15172. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15173. */
  15174. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  15175. if (__pyx_t_1) {
  15176. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
  15177. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15178. * if PyArray_HASFIELDS(self):
  15179. * PyObject_Free(info.format) # <<<<<<<<<<<<<<
  15180. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15181. * PyObject_Free(info.strides)
  15182. */
  15183. PyObject_Free(__pyx_v_info->format);
  15184. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15185. *
  15186. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15187. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15188. * PyObject_Free(info.format)
  15189. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15190. */
  15191. }
  15192. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15193. * if PyArray_HASFIELDS(self):
  15194. * PyObject_Free(info.format)
  15195. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15196. * PyObject_Free(info.strides)
  15197. * # info.shape was stored after info.strides in the same block
  15198. */
  15199. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  15200. if (__pyx_t_1) {
  15201. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
  15202. * PyObject_Free(info.format)
  15203. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15204. * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
  15205. * # info.shape was stored after info.strides in the same block
  15206. *
  15207. */
  15208. PyObject_Free(__pyx_v_info->strides);
  15209. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15210. * if PyArray_HASFIELDS(self):
  15211. * PyObject_Free(info.format)
  15212. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15213. * PyObject_Free(info.strides)
  15214. * # info.shape was stored after info.strides in the same block
  15215. */
  15216. }
  15217. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15218. * f[0] = c'\0' # Terminate format string
  15219. *
  15220. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15221. * if PyArray_HASFIELDS(self):
  15222. * PyObject_Free(info.format)
  15223. */
  15224. /* function exit code */
  15225. __Pyx_RefNannyFinishContext();
  15226. }
  15227. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15228. * ctypedef npy_cdouble complex_t
  15229. *
  15230. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15231. * return PyArray_MultiIterNew(1, <void*>a)
  15232. *
  15233. */
  15234. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  15235. PyObject *__pyx_r = NULL;
  15236. __Pyx_RefNannyDeclarations
  15237. PyObject *__pyx_t_1 = NULL;
  15238. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  15239. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
  15240. *
  15241. * cdef inline object PyArray_MultiIterNew1(a):
  15242. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  15243. *
  15244. * cdef inline object PyArray_MultiIterNew2(a, b):
  15245. */
  15246. __Pyx_XDECREF(__pyx_r);
  15247. __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
  15248. __Pyx_GOTREF(__pyx_t_1);
  15249. __pyx_r = __pyx_t_1;
  15250. __pyx_t_1 = 0;
  15251. goto __pyx_L0;
  15252. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15253. * ctypedef npy_cdouble complex_t
  15254. *
  15255. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15256. * return PyArray_MultiIterNew(1, <void*>a)
  15257. *
  15258. */
  15259. /* function exit code */
  15260. __pyx_L1_error:;
  15261. __Pyx_XDECREF(__pyx_t_1);
  15262. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15263. __pyx_r = 0;
  15264. __pyx_L0:;
  15265. __Pyx_XGIVEREF(__pyx_r);
  15266. __Pyx_RefNannyFinishContext();
  15267. return __pyx_r;
  15268. }
  15269. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15270. * return PyArray_MultiIterNew(1, <void*>a)
  15271. *
  15272. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15273. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15274. *
  15275. */
  15276. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  15277. PyObject *__pyx_r = NULL;
  15278. __Pyx_RefNannyDeclarations
  15279. PyObject *__pyx_t_1 = NULL;
  15280. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  15281. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
  15282. *
  15283. * cdef inline object PyArray_MultiIterNew2(a, b):
  15284. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  15285. *
  15286. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15287. */
  15288. __Pyx_XDECREF(__pyx_r);
  15289. __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)
  15290. __Pyx_GOTREF(__pyx_t_1);
  15291. __pyx_r = __pyx_t_1;
  15292. __pyx_t_1 = 0;
  15293. goto __pyx_L0;
  15294. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15295. * return PyArray_MultiIterNew(1, <void*>a)
  15296. *
  15297. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15298. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15299. *
  15300. */
  15301. /* function exit code */
  15302. __pyx_L1_error:;
  15303. __Pyx_XDECREF(__pyx_t_1);
  15304. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15305. __pyx_r = 0;
  15306. __pyx_L0:;
  15307. __Pyx_XGIVEREF(__pyx_r);
  15308. __Pyx_RefNannyFinishContext();
  15309. return __pyx_r;
  15310. }
  15311. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15312. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15313. *
  15314. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15315. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15316. *
  15317. */
  15318. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  15319. PyObject *__pyx_r = NULL;
  15320. __Pyx_RefNannyDeclarations
  15321. PyObject *__pyx_t_1 = NULL;
  15322. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  15323. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
  15324. *
  15325. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15326. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  15327. *
  15328. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15329. */
  15330. __Pyx_XDECREF(__pyx_r);
  15331. __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)
  15332. __Pyx_GOTREF(__pyx_t_1);
  15333. __pyx_r = __pyx_t_1;
  15334. __pyx_t_1 = 0;
  15335. goto __pyx_L0;
  15336. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15337. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15338. *
  15339. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15340. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15341. *
  15342. */
  15343. /* function exit code */
  15344. __pyx_L1_error:;
  15345. __Pyx_XDECREF(__pyx_t_1);
  15346. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15347. __pyx_r = 0;
  15348. __pyx_L0:;
  15349. __Pyx_XGIVEREF(__pyx_r);
  15350. __Pyx_RefNannyFinishContext();
  15351. return __pyx_r;
  15352. }
  15353. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15354. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15355. *
  15356. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15357. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15358. *
  15359. */
  15360. 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) {
  15361. PyObject *__pyx_r = NULL;
  15362. __Pyx_RefNannyDeclarations
  15363. PyObject *__pyx_t_1 = NULL;
  15364. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  15365. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
  15366. *
  15367. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15368. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  15369. *
  15370. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15371. */
  15372. __Pyx_XDECREF(__pyx_r);
  15373. __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)
  15374. __Pyx_GOTREF(__pyx_t_1);
  15375. __pyx_r = __pyx_t_1;
  15376. __pyx_t_1 = 0;
  15377. goto __pyx_L0;
  15378. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15379. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15380. *
  15381. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15382. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15383. *
  15384. */
  15385. /* function exit code */
  15386. __pyx_L1_error:;
  15387. __Pyx_XDECREF(__pyx_t_1);
  15388. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15389. __pyx_r = 0;
  15390. __pyx_L0:;
  15391. __Pyx_XGIVEREF(__pyx_r);
  15392. __Pyx_RefNannyFinishContext();
  15393. return __pyx_r;
  15394. }
  15395. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15396. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15397. *
  15398. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15399. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15400. *
  15401. */
  15402. 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) {
  15403. PyObject *__pyx_r = NULL;
  15404. __Pyx_RefNannyDeclarations
  15405. PyObject *__pyx_t_1 = NULL;
  15406. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  15407. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
  15408. *
  15409. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15410. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  15411. *
  15412. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15413. */
  15414. __Pyx_XDECREF(__pyx_r);
  15415. __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)
  15416. __Pyx_GOTREF(__pyx_t_1);
  15417. __pyx_r = __pyx_t_1;
  15418. __pyx_t_1 = 0;
  15419. goto __pyx_L0;
  15420. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15421. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15422. *
  15423. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15424. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15425. *
  15426. */
  15427. /* function exit code */
  15428. __pyx_L1_error:;
  15429. __Pyx_XDECREF(__pyx_t_1);
  15430. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15431. __pyx_r = 0;
  15432. __pyx_L0:;
  15433. __Pyx_XGIVEREF(__pyx_r);
  15434. __Pyx_RefNannyFinishContext();
  15435. return __pyx_r;
  15436. }
  15437. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15438. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15439. *
  15440. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15441. * if PyDataType_HASSUBARRAY(d):
  15442. * return <tuple>d.subarray.shape
  15443. */
  15444. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  15445. PyObject *__pyx_r = NULL;
  15446. __Pyx_RefNannyDeclarations
  15447. int __pyx_t_1;
  15448. __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
  15449. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15450. *
  15451. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15452. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15453. * return <tuple>d.subarray.shape
  15454. * else:
  15455. */
  15456. __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  15457. if (__pyx_t_1) {
  15458. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
  15459. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15460. * if PyDataType_HASSUBARRAY(d):
  15461. * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
  15462. * else:
  15463. * return ()
  15464. */
  15465. __Pyx_XDECREF(__pyx_r);
  15466. __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
  15467. __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
  15468. goto __pyx_L0;
  15469. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15470. *
  15471. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15472. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15473. * return <tuple>d.subarray.shape
  15474. * else:
  15475. */
  15476. }
  15477. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
  15478. * return <tuple>d.subarray.shape
  15479. * else:
  15480. * return () # <<<<<<<<<<<<<<
  15481. *
  15482. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  15483. */
  15484. /*else*/ {
  15485. __Pyx_XDECREF(__pyx_r);
  15486. __Pyx_INCREF(__pyx_empty_tuple);
  15487. __pyx_r = __pyx_empty_tuple;
  15488. goto __pyx_L0;
  15489. }
  15490. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15491. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15492. *
  15493. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15494. * if PyDataType_HASSUBARRAY(d):
  15495. * return <tuple>d.subarray.shape
  15496. */
  15497. /* function exit code */
  15498. __pyx_L0:;
  15499. __Pyx_XGIVEREF(__pyx_r);
  15500. __Pyx_RefNannyFinishContext();
  15501. return __pyx_r;
  15502. }
  15503. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  15504. * return ()
  15505. *
  15506. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  15507. * # Recursive utility function used in __getbuffer__ to get format
  15508. * # string. The new location in the format string is returned.
  15509. */
  15510. 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) {
  15511. PyArray_Descr *__pyx_v_child = 0;
  15512. int __pyx_v_endian_detector;
  15513. int __pyx_v_little_endian;
  15514. PyObject *__pyx_v_fields = 0;
  15515. PyObject *__pyx_v_childname = NULL;
  15516. PyObject *__pyx_v_new_offset = NULL;
  15517. PyObject *__pyx_v_t = NULL;
  15518. char *__pyx_r;
  15519. __Pyx_RefNannyDeclarations
  15520. PyObject *__pyx_t_1 = NULL;
  15521. Py_ssize_t __pyx_t_2;
  15522. PyObject *__pyx_t_3 = NULL;
  15523. PyObject *__pyx_t_4 = NULL;
  15524. int __pyx_t_5;
  15525. int __pyx_t_6;
  15526. int __pyx_t_7;
  15527. long __pyx_t_8;
  15528. char *__pyx_t_9;
  15529. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  15530. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
  15531. *
  15532. * cdef dtype child
  15533. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  15534. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  15535. * cdef tuple fields
  15536. */
  15537. __pyx_v_endian_detector = 1;
  15538. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
  15539. * cdef dtype child
  15540. * cdef int endian_detector = 1
  15541. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  15542. * cdef tuple fields
  15543. *
  15544. */
  15545. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  15546. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  15547. * cdef tuple fields
  15548. *
  15549. * for childname in descr.names: # <<<<<<<<<<<<<<
  15550. * fields = descr.fields[childname]
  15551. * child, new_offset = fields
  15552. */
  15553. if (unlikely(__pyx_v_descr->names == Py_None)) {
  15554. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  15555. __PYX_ERR(2, 851, __pyx_L1_error)
  15556. }
  15557. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  15558. for (;;) {
  15559. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  15560. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15561. __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)
  15562. #else
  15563. __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)
  15564. __Pyx_GOTREF(__pyx_t_3);
  15565. #endif
  15566. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  15567. __pyx_t_3 = 0;
  15568. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
  15569. *
  15570. * for childname in descr.names:
  15571. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  15572. * child, new_offset = fields
  15573. *
  15574. */
  15575. if (unlikely(__pyx_v_descr->fields == Py_None)) {
  15576. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  15577. __PYX_ERR(2, 852, __pyx_L1_error)
  15578. }
  15579. __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)
  15580. __Pyx_GOTREF(__pyx_t_3);
  15581. 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)
  15582. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  15583. __pyx_t_3 = 0;
  15584. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
  15585. * for childname in descr.names:
  15586. * fields = descr.fields[childname]
  15587. * child, new_offset = fields # <<<<<<<<<<<<<<
  15588. *
  15589. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15590. */
  15591. if (likely(__pyx_v_fields != Py_None)) {
  15592. PyObject* sequence = __pyx_v_fields;
  15593. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  15594. if (unlikely(size != 2)) {
  15595. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  15596. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  15597. __PYX_ERR(2, 853, __pyx_L1_error)
  15598. }
  15599. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15600. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  15601. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  15602. __Pyx_INCREF(__pyx_t_3);
  15603. __Pyx_INCREF(__pyx_t_4);
  15604. #else
  15605. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
  15606. __Pyx_GOTREF(__pyx_t_3);
  15607. __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
  15608. __Pyx_GOTREF(__pyx_t_4);
  15609. #endif
  15610. } else {
  15611. __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
  15612. }
  15613. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
  15614. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  15615. __pyx_t_3 = 0;
  15616. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  15617. __pyx_t_4 = 0;
  15618. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15619. * child, new_offset = fields
  15620. *
  15621. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15622. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15623. *
  15624. */
  15625. __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
  15626. __Pyx_GOTREF(__pyx_t_4);
  15627. __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
  15628. __Pyx_GOTREF(__pyx_t_3);
  15629. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15630. __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)
  15631. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15632. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  15633. if (unlikely(__pyx_t_6)) {
  15634. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  15635. *
  15636. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15637. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  15638. *
  15639. * if ((child.byteorder == c'>' and little_endian) or
  15640. */
  15641. __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)
  15642. __Pyx_GOTREF(__pyx_t_3);
  15643. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15644. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15645. __PYX_ERR(2, 856, __pyx_L1_error)
  15646. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15647. * child, new_offset = fields
  15648. *
  15649. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15650. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15651. *
  15652. */
  15653. }
  15654. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15655. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15656. *
  15657. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15658. * (child.byteorder == c'<' and not little_endian)):
  15659. * raise ValueError(u"Non-native byte order not supported")
  15660. */
  15661. __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
  15662. if (!__pyx_t_7) {
  15663. goto __pyx_L8_next_or;
  15664. } else {
  15665. }
  15666. __pyx_t_7 = (__pyx_v_little_endian != 0);
  15667. if (!__pyx_t_7) {
  15668. } else {
  15669. __pyx_t_6 = __pyx_t_7;
  15670. goto __pyx_L7_bool_binop_done;
  15671. }
  15672. __pyx_L8_next_or:;
  15673. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
  15674. *
  15675. * if ((child.byteorder == c'>' and little_endian) or
  15676. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15677. * raise ValueError(u"Non-native byte order not supported")
  15678. * # One could encode it in the format string and have Cython
  15679. */
  15680. __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
  15681. if (__pyx_t_7) {
  15682. } else {
  15683. __pyx_t_6 = __pyx_t_7;
  15684. goto __pyx_L7_bool_binop_done;
  15685. }
  15686. __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
  15687. __pyx_t_6 = __pyx_t_7;
  15688. __pyx_L7_bool_binop_done:;
  15689. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15690. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15691. *
  15692. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15693. * (child.byteorder == c'<' and not little_endian)):
  15694. * raise ValueError(u"Non-native byte order not supported")
  15695. */
  15696. if (unlikely(__pyx_t_6)) {
  15697. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
  15698. * if ((child.byteorder == c'>' and little_endian) or
  15699. * (child.byteorder == c'<' and not little_endian)):
  15700. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15701. * # One could encode it in the format string and have Cython
  15702. * # complain instead, BUT: < and > in format strings also imply
  15703. */
  15704. __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)
  15705. __Pyx_GOTREF(__pyx_t_3);
  15706. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15707. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15708. __PYX_ERR(2, 860, __pyx_L1_error)
  15709. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15710. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15711. *
  15712. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15713. * (child.byteorder == c'<' and not little_endian)):
  15714. * raise ValueError(u"Non-native byte order not supported")
  15715. */
  15716. }
  15717. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
  15718. *
  15719. * # Output padding bytes
  15720. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  15721. * f[0] = 120 # "x"; pad byte
  15722. * f += 1
  15723. */
  15724. while (1) {
  15725. __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
  15726. __Pyx_GOTREF(__pyx_t_3);
  15727. __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)
  15728. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15729. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
  15730. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15731. if (!__pyx_t_6) break;
  15732. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
  15733. * # Output padding bytes
  15734. * while offset[0] < new_offset:
  15735. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  15736. * f += 1
  15737. * offset[0] += 1
  15738. */
  15739. (__pyx_v_f[0]) = 0x78;
  15740. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
  15741. * while offset[0] < new_offset:
  15742. * f[0] = 120 # "x"; pad byte
  15743. * f += 1 # <<<<<<<<<<<<<<
  15744. * offset[0] += 1
  15745. *
  15746. */
  15747. __pyx_v_f = (__pyx_v_f + 1);
  15748. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
  15749. * f[0] = 120 # "x"; pad byte
  15750. * f += 1
  15751. * offset[0] += 1 # <<<<<<<<<<<<<<
  15752. *
  15753. * offset[0] += child.itemsize
  15754. */
  15755. __pyx_t_8 = 0;
  15756. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
  15757. }
  15758. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
  15759. * offset[0] += 1
  15760. *
  15761. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  15762. *
  15763. * if not PyDataType_HASFIELDS(child):
  15764. */
  15765. __pyx_t_8 = 0;
  15766. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
  15767. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  15768. * offset[0] += child.itemsize
  15769. *
  15770. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  15771. * t = child.type_num
  15772. * if end - f < 5:
  15773. */
  15774. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  15775. if (__pyx_t_6) {
  15776. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
  15777. *
  15778. * if not PyDataType_HASFIELDS(child):
  15779. * t = child.type_num # <<<<<<<<<<<<<<
  15780. * if end - f < 5:
  15781. * raise RuntimeError(u"Format string allocated too short.")
  15782. */
  15783. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
  15784. __Pyx_GOTREF(__pyx_t_4);
  15785. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  15786. __pyx_t_4 = 0;
  15787. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  15788. * if not PyDataType_HASFIELDS(child):
  15789. * t = child.type_num
  15790. * if end - f < 5: # <<<<<<<<<<<<<<
  15791. * raise RuntimeError(u"Format string allocated too short.")
  15792. *
  15793. */
  15794. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  15795. if (unlikely(__pyx_t_6)) {
  15796. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  15797. * t = child.type_num
  15798. * if end - f < 5:
  15799. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  15800. *
  15801. * # Until ticket #99 is fixed, use integers to avoid warnings
  15802. */
  15803. __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)
  15804. __Pyx_GOTREF(__pyx_t_4);
  15805. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  15806. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15807. __PYX_ERR(2, 880, __pyx_L1_error)
  15808. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  15809. * if not PyDataType_HASFIELDS(child):
  15810. * t = child.type_num
  15811. * if end - f < 5: # <<<<<<<<<<<<<<
  15812. * raise RuntimeError(u"Format string allocated too short.")
  15813. *
  15814. */
  15815. }
  15816. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
  15817. *
  15818. * # Until ticket #99 is fixed, use integers to avoid warnings
  15819. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  15820. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15821. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15822. */
  15823. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
  15824. __Pyx_GOTREF(__pyx_t_4);
  15825. __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)
  15826. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15827. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
  15828. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15829. if (__pyx_t_6) {
  15830. (__pyx_v_f[0]) = 98;
  15831. goto __pyx_L15;
  15832. }
  15833. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
  15834. * # Until ticket #99 is fixed, use integers to avoid warnings
  15835. * if t == NPY_BYTE: f[0] = 98 #"b"
  15836. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  15837. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15838. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15839. */
  15840. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
  15841. __Pyx_GOTREF(__pyx_t_3);
  15842. __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)
  15843. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15844. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
  15845. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15846. if (__pyx_t_6) {
  15847. (__pyx_v_f[0]) = 66;
  15848. goto __pyx_L15;
  15849. }
  15850. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
  15851. * if t == NPY_BYTE: f[0] = 98 #"b"
  15852. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15853. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  15854. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15855. * elif t == NPY_INT: f[0] = 105 #"i"
  15856. */
  15857. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
  15858. __Pyx_GOTREF(__pyx_t_4);
  15859. __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)
  15860. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15861. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
  15862. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15863. if (__pyx_t_6) {
  15864. (__pyx_v_f[0]) = 0x68;
  15865. goto __pyx_L15;
  15866. }
  15867. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
  15868. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15869. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15870. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  15871. * elif t == NPY_INT: f[0] = 105 #"i"
  15872. * elif t == NPY_UINT: f[0] = 73 #"I"
  15873. */
  15874. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
  15875. __Pyx_GOTREF(__pyx_t_3);
  15876. __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)
  15877. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15878. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
  15879. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15880. if (__pyx_t_6) {
  15881. (__pyx_v_f[0]) = 72;
  15882. goto __pyx_L15;
  15883. }
  15884. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
  15885. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15886. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15887. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  15888. * elif t == NPY_UINT: f[0] = 73 #"I"
  15889. * elif t == NPY_LONG: f[0] = 108 #"l"
  15890. */
  15891. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
  15892. __Pyx_GOTREF(__pyx_t_4);
  15893. __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)
  15894. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15895. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
  15896. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15897. if (__pyx_t_6) {
  15898. (__pyx_v_f[0]) = 0x69;
  15899. goto __pyx_L15;
  15900. }
  15901. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
  15902. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15903. * elif t == NPY_INT: f[0] = 105 #"i"
  15904. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  15905. * elif t == NPY_LONG: f[0] = 108 #"l"
  15906. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15907. */
  15908. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
  15909. __Pyx_GOTREF(__pyx_t_3);
  15910. __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)
  15911. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15912. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
  15913. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15914. if (__pyx_t_6) {
  15915. (__pyx_v_f[0]) = 73;
  15916. goto __pyx_L15;
  15917. }
  15918. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
  15919. * elif t == NPY_INT: f[0] = 105 #"i"
  15920. * elif t == NPY_UINT: f[0] = 73 #"I"
  15921. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  15922. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15923. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15924. */
  15925. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
  15926. __Pyx_GOTREF(__pyx_t_4);
  15927. __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)
  15928. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15929. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
  15930. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15931. if (__pyx_t_6) {
  15932. (__pyx_v_f[0]) = 0x6C;
  15933. goto __pyx_L15;
  15934. }
  15935. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
  15936. * elif t == NPY_UINT: f[0] = 73 #"I"
  15937. * elif t == NPY_LONG: f[0] = 108 #"l"
  15938. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  15939. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15940. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15941. */
  15942. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
  15943. __Pyx_GOTREF(__pyx_t_3);
  15944. __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)
  15945. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15946. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
  15947. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15948. if (__pyx_t_6) {
  15949. (__pyx_v_f[0]) = 76;
  15950. goto __pyx_L15;
  15951. }
  15952. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
  15953. * elif t == NPY_LONG: f[0] = 108 #"l"
  15954. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15955. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  15956. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15957. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15958. */
  15959. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
  15960. __Pyx_GOTREF(__pyx_t_4);
  15961. __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)
  15962. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15963. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
  15964. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15965. if (__pyx_t_6) {
  15966. (__pyx_v_f[0]) = 0x71;
  15967. goto __pyx_L15;
  15968. }
  15969. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
  15970. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15971. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15972. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  15973. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15974. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15975. */
  15976. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
  15977. __Pyx_GOTREF(__pyx_t_3);
  15978. __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)
  15979. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15980. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
  15981. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15982. if (__pyx_t_6) {
  15983. (__pyx_v_f[0]) = 81;
  15984. goto __pyx_L15;
  15985. }
  15986. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
  15987. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15988. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15989. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  15990. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15991. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  15992. */
  15993. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
  15994. __Pyx_GOTREF(__pyx_t_4);
  15995. __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)
  15996. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15997. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
  15998. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15999. if (__pyx_t_6) {
  16000. (__pyx_v_f[0]) = 0x66;
  16001. goto __pyx_L15;
  16002. }
  16003. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
  16004. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16005. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16006. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  16007. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16008. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16009. */
  16010. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
  16011. __Pyx_GOTREF(__pyx_t_3);
  16012. __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)
  16013. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16014. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
  16015. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16016. if (__pyx_t_6) {
  16017. (__pyx_v_f[0]) = 0x64;
  16018. goto __pyx_L15;
  16019. }
  16020. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
  16021. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16022. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16023. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  16024. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16025. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16026. */
  16027. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
  16028. __Pyx_GOTREF(__pyx_t_4);
  16029. __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)
  16030. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16031. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
  16032. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16033. if (__pyx_t_6) {
  16034. (__pyx_v_f[0]) = 0x67;
  16035. goto __pyx_L15;
  16036. }
  16037. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
  16038. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16039. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16040. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  16041. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16042. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16043. */
  16044. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
  16045. __Pyx_GOTREF(__pyx_t_3);
  16046. __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)
  16047. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16048. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
  16049. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16050. if (__pyx_t_6) {
  16051. (__pyx_v_f[0]) = 90;
  16052. (__pyx_v_f[1]) = 0x66;
  16053. __pyx_v_f = (__pyx_v_f + 1);
  16054. goto __pyx_L15;
  16055. }
  16056. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
  16057. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16058. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16059. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  16060. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16061. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16062. */
  16063. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
  16064. __Pyx_GOTREF(__pyx_t_4);
  16065. __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)
  16066. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16067. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
  16068. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16069. if (__pyx_t_6) {
  16070. (__pyx_v_f[0]) = 90;
  16071. (__pyx_v_f[1]) = 0x64;
  16072. __pyx_v_f = (__pyx_v_f + 1);
  16073. goto __pyx_L15;
  16074. }
  16075. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
  16076. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16077. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16078. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  16079. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16080. * else:
  16081. */
  16082. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
  16083. __Pyx_GOTREF(__pyx_t_3);
  16084. __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)
  16085. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16086. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
  16087. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16088. if (__pyx_t_6) {
  16089. (__pyx_v_f[0]) = 90;
  16090. (__pyx_v_f[1]) = 0x67;
  16091. __pyx_v_f = (__pyx_v_f + 1);
  16092. goto __pyx_L15;
  16093. }
  16094. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
  16095. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16096. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16097. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  16098. * else:
  16099. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16100. */
  16101. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
  16102. __Pyx_GOTREF(__pyx_t_4);
  16103. __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)
  16104. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16105. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
  16106. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16107. if (likely(__pyx_t_6)) {
  16108. (__pyx_v_f[0]) = 79;
  16109. goto __pyx_L15;
  16110. }
  16111. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
  16112. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16113. * else:
  16114. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  16115. * f += 1
  16116. * else:
  16117. */
  16118. /*else*/ {
  16119. __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)
  16120. __Pyx_GOTREF(__pyx_t_3);
  16121. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
  16122. __Pyx_GOTREF(__pyx_t_4);
  16123. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16124. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  16125. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16126. __PYX_ERR(2, 901, __pyx_L1_error)
  16127. }
  16128. __pyx_L15:;
  16129. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
  16130. * else:
  16131. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16132. * f += 1 # <<<<<<<<<<<<<<
  16133. * else:
  16134. * # Cython ignores struct boundary information ("T{...}"),
  16135. */
  16136. __pyx_v_f = (__pyx_v_f + 1);
  16137. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  16138. * offset[0] += child.itemsize
  16139. *
  16140. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  16141. * t = child.type_num
  16142. * if end - f < 5:
  16143. */
  16144. goto __pyx_L13;
  16145. }
  16146. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
  16147. * # Cython ignores struct boundary information ("T{...}"),
  16148. * # so don't output it
  16149. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  16150. * return f
  16151. *
  16152. */
  16153. /*else*/ {
  16154. __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)
  16155. __pyx_v_f = __pyx_t_9;
  16156. }
  16157. __pyx_L13:;
  16158. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  16159. * cdef tuple fields
  16160. *
  16161. * for childname in descr.names: # <<<<<<<<<<<<<<
  16162. * fields = descr.fields[childname]
  16163. * child, new_offset = fields
  16164. */
  16165. }
  16166. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16167. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
  16168. * # so don't output it
  16169. * f = _util_dtypestring(child, f, end, offset)
  16170. * return f # <<<<<<<<<<<<<<
  16171. *
  16172. *
  16173. */
  16174. __pyx_r = __pyx_v_f;
  16175. goto __pyx_L0;
  16176. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  16177. * return ()
  16178. *
  16179. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  16180. * # Recursive utility function used in __getbuffer__ to get format
  16181. * # string. The new location in the format string is returned.
  16182. */
  16183. /* function exit code */
  16184. __pyx_L1_error:;
  16185. __Pyx_XDECREF(__pyx_t_1);
  16186. __Pyx_XDECREF(__pyx_t_3);
  16187. __Pyx_XDECREF(__pyx_t_4);
  16188. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16189. __pyx_r = NULL;
  16190. __pyx_L0:;
  16191. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  16192. __Pyx_XDECREF(__pyx_v_fields);
  16193. __Pyx_XDECREF(__pyx_v_childname);
  16194. __Pyx_XDECREF(__pyx_v_new_offset);
  16195. __Pyx_XDECREF(__pyx_v_t);
  16196. __Pyx_RefNannyFinishContext();
  16197. return __pyx_r;
  16198. }
  16199. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16200. * int _import_umath() except -1
  16201. *
  16202. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16203. * Py_INCREF(base) # important to do this before stealing the reference below!
  16204. * PyArray_SetBaseObject(arr, base)
  16205. */
  16206. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  16207. __Pyx_RefNannyDeclarations
  16208. __Pyx_RefNannySetupContext("set_array_base", 0);
  16209. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
  16210. *
  16211. * cdef inline void set_array_base(ndarray arr, object base):
  16212. * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
  16213. * PyArray_SetBaseObject(arr, base)
  16214. *
  16215. */
  16216. Py_INCREF(__pyx_v_base);
  16217. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
  16218. * cdef inline void set_array_base(ndarray arr, object base):
  16219. * Py_INCREF(base) # important to do this before stealing the reference below!
  16220. * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
  16221. *
  16222. * cdef inline object get_array_base(ndarray arr):
  16223. */
  16224. (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
  16225. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16226. * int _import_umath() except -1
  16227. *
  16228. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16229. * Py_INCREF(base) # important to do this before stealing the reference below!
  16230. * PyArray_SetBaseObject(arr, base)
  16231. */
  16232. /* function exit code */
  16233. __Pyx_RefNannyFinishContext();
  16234. }
  16235. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16236. * PyArray_SetBaseObject(arr, base)
  16237. *
  16238. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16239. * base = PyArray_BASE(arr)
  16240. * if base is NULL:
  16241. */
  16242. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  16243. PyObject *__pyx_v_base;
  16244. PyObject *__pyx_r = NULL;
  16245. __Pyx_RefNannyDeclarations
  16246. int __pyx_t_1;
  16247. __Pyx_RefNannySetupContext("get_array_base", 0);
  16248. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
  16249. *
  16250. * cdef inline object get_array_base(ndarray arr):
  16251. * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
  16252. * if base is NULL:
  16253. * return None
  16254. */
  16255. __pyx_v_base = PyArray_BASE(__pyx_v_arr);
  16256. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16257. * cdef inline object get_array_base(ndarray arr):
  16258. * base = PyArray_BASE(arr)
  16259. * if base is NULL: # <<<<<<<<<<<<<<
  16260. * return None
  16261. * return <object>base
  16262. */
  16263. __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  16264. if (__pyx_t_1) {
  16265. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
  16266. * base = PyArray_BASE(arr)
  16267. * if base is NULL:
  16268. * return None # <<<<<<<<<<<<<<
  16269. * return <object>base
  16270. *
  16271. */
  16272. __Pyx_XDECREF(__pyx_r);
  16273. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  16274. goto __pyx_L0;
  16275. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16276. * cdef inline object get_array_base(ndarray arr):
  16277. * base = PyArray_BASE(arr)
  16278. * if base is NULL: # <<<<<<<<<<<<<<
  16279. * return None
  16280. * return <object>base
  16281. */
  16282. }
  16283. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
  16284. * if base is NULL:
  16285. * return None
  16286. * return <object>base # <<<<<<<<<<<<<<
  16287. *
  16288. * # Versions of the import_* functions which are more suitable for
  16289. */
  16290. __Pyx_XDECREF(__pyx_r);
  16291. __Pyx_INCREF(((PyObject *)__pyx_v_base));
  16292. __pyx_r = ((PyObject *)__pyx_v_base);
  16293. goto __pyx_L0;
  16294. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16295. * PyArray_SetBaseObject(arr, base)
  16296. *
  16297. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16298. * base = PyArray_BASE(arr)
  16299. * if base is NULL:
  16300. */
  16301. /* function exit code */
  16302. __pyx_L0:;
  16303. __Pyx_XGIVEREF(__pyx_r);
  16304. __Pyx_RefNannyFinishContext();
  16305. return __pyx_r;
  16306. }
  16307. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16308. * # Versions of the import_* functions which are more suitable for
  16309. * # Cython code.
  16310. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16311. * try:
  16312. * _import_array()
  16313. */
  16314. static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  16315. int __pyx_r;
  16316. __Pyx_RefNannyDeclarations
  16317. PyObject *__pyx_t_1 = NULL;
  16318. PyObject *__pyx_t_2 = NULL;
  16319. PyObject *__pyx_t_3 = NULL;
  16320. int __pyx_t_4;
  16321. PyObject *__pyx_t_5 = NULL;
  16322. PyObject *__pyx_t_6 = NULL;
  16323. PyObject *__pyx_t_7 = NULL;
  16324. PyObject *__pyx_t_8 = NULL;
  16325. __Pyx_RefNannySetupContext("import_array", 0);
  16326. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16327. * # Cython code.
  16328. * cdef inline int import_array() except -1:
  16329. * try: # <<<<<<<<<<<<<<
  16330. * _import_array()
  16331. * except Exception:
  16332. */
  16333. {
  16334. __Pyx_PyThreadState_declare
  16335. __Pyx_PyThreadState_assign
  16336. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16337. __Pyx_XGOTREF(__pyx_t_1);
  16338. __Pyx_XGOTREF(__pyx_t_2);
  16339. __Pyx_XGOTREF(__pyx_t_3);
  16340. /*try:*/ {
  16341. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
  16342. * cdef inline int import_array() except -1:
  16343. * try:
  16344. * _import_array() # <<<<<<<<<<<<<<
  16345. * except Exception:
  16346. * raise ImportError("numpy.core.multiarray failed to import")
  16347. */
  16348. __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
  16349. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16350. * # Cython code.
  16351. * cdef inline int import_array() except -1:
  16352. * try: # <<<<<<<<<<<<<<
  16353. * _import_array()
  16354. * except Exception:
  16355. */
  16356. }
  16357. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16358. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16359. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16360. goto __pyx_L8_try_end;
  16361. __pyx_L3_error:;
  16362. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
  16363. * try:
  16364. * _import_array()
  16365. * except Exception: # <<<<<<<<<<<<<<
  16366. * raise ImportError("numpy.core.multiarray failed to import")
  16367. *
  16368. */
  16369. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16370. if (__pyx_t_4) {
  16371. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16372. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
  16373. __Pyx_GOTREF(__pyx_t_5);
  16374. __Pyx_GOTREF(__pyx_t_6);
  16375. __Pyx_GOTREF(__pyx_t_7);
  16376. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  16377. * _import_array()
  16378. * except Exception:
  16379. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  16380. *
  16381. * cdef inline int import_umath() except -1:
  16382. */
  16383. __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)
  16384. __Pyx_GOTREF(__pyx_t_8);
  16385. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16386. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16387. __PYX_ERR(2, 1038, __pyx_L5_except_error)
  16388. }
  16389. goto __pyx_L5_except_error;
  16390. __pyx_L5_except_error:;
  16391. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16392. * # Cython code.
  16393. * cdef inline int import_array() except -1:
  16394. * try: # <<<<<<<<<<<<<<
  16395. * _import_array()
  16396. * except Exception:
  16397. */
  16398. __Pyx_XGIVEREF(__pyx_t_1);
  16399. __Pyx_XGIVEREF(__pyx_t_2);
  16400. __Pyx_XGIVEREF(__pyx_t_3);
  16401. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16402. goto __pyx_L1_error;
  16403. __pyx_L8_try_end:;
  16404. }
  16405. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16406. * # Versions of the import_* functions which are more suitable for
  16407. * # Cython code.
  16408. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16409. * try:
  16410. * _import_array()
  16411. */
  16412. /* function exit code */
  16413. __pyx_r = 0;
  16414. goto __pyx_L0;
  16415. __pyx_L1_error:;
  16416. __Pyx_XDECREF(__pyx_t_5);
  16417. __Pyx_XDECREF(__pyx_t_6);
  16418. __Pyx_XDECREF(__pyx_t_7);
  16419. __Pyx_XDECREF(__pyx_t_8);
  16420. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16421. __pyx_r = -1;
  16422. __pyx_L0:;
  16423. __Pyx_RefNannyFinishContext();
  16424. return __pyx_r;
  16425. }
  16426. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16427. * raise ImportError("numpy.core.multiarray failed to import")
  16428. *
  16429. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16430. * try:
  16431. * _import_umath()
  16432. */
  16433. static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  16434. int __pyx_r;
  16435. __Pyx_RefNannyDeclarations
  16436. PyObject *__pyx_t_1 = NULL;
  16437. PyObject *__pyx_t_2 = NULL;
  16438. PyObject *__pyx_t_3 = NULL;
  16439. int __pyx_t_4;
  16440. PyObject *__pyx_t_5 = NULL;
  16441. PyObject *__pyx_t_6 = NULL;
  16442. PyObject *__pyx_t_7 = NULL;
  16443. PyObject *__pyx_t_8 = NULL;
  16444. __Pyx_RefNannySetupContext("import_umath", 0);
  16445. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16446. *
  16447. * cdef inline int import_umath() except -1:
  16448. * try: # <<<<<<<<<<<<<<
  16449. * _import_umath()
  16450. * except Exception:
  16451. */
  16452. {
  16453. __Pyx_PyThreadState_declare
  16454. __Pyx_PyThreadState_assign
  16455. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16456. __Pyx_XGOTREF(__pyx_t_1);
  16457. __Pyx_XGOTREF(__pyx_t_2);
  16458. __Pyx_XGOTREF(__pyx_t_3);
  16459. /*try:*/ {
  16460. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
  16461. * cdef inline int import_umath() except -1:
  16462. * try:
  16463. * _import_umath() # <<<<<<<<<<<<<<
  16464. * except Exception:
  16465. * raise ImportError("numpy.core.umath failed to import")
  16466. */
  16467. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
  16468. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16469. *
  16470. * cdef inline int import_umath() except -1:
  16471. * try: # <<<<<<<<<<<<<<
  16472. * _import_umath()
  16473. * except Exception:
  16474. */
  16475. }
  16476. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16477. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16478. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16479. goto __pyx_L8_try_end;
  16480. __pyx_L3_error:;
  16481. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
  16482. * try:
  16483. * _import_umath()
  16484. * except Exception: # <<<<<<<<<<<<<<
  16485. * raise ImportError("numpy.core.umath failed to import")
  16486. *
  16487. */
  16488. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16489. if (__pyx_t_4) {
  16490. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16491. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
  16492. __Pyx_GOTREF(__pyx_t_5);
  16493. __Pyx_GOTREF(__pyx_t_6);
  16494. __Pyx_GOTREF(__pyx_t_7);
  16495. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  16496. * _import_umath()
  16497. * except Exception:
  16498. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16499. *
  16500. * cdef inline int import_ufunc() except -1:
  16501. */
  16502. __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)
  16503. __Pyx_GOTREF(__pyx_t_8);
  16504. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16505. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16506. __PYX_ERR(2, 1044, __pyx_L5_except_error)
  16507. }
  16508. goto __pyx_L5_except_error;
  16509. __pyx_L5_except_error:;
  16510. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16511. *
  16512. * cdef inline int import_umath() except -1:
  16513. * try: # <<<<<<<<<<<<<<
  16514. * _import_umath()
  16515. * except Exception:
  16516. */
  16517. __Pyx_XGIVEREF(__pyx_t_1);
  16518. __Pyx_XGIVEREF(__pyx_t_2);
  16519. __Pyx_XGIVEREF(__pyx_t_3);
  16520. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16521. goto __pyx_L1_error;
  16522. __pyx_L8_try_end:;
  16523. }
  16524. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16525. * raise ImportError("numpy.core.multiarray failed to import")
  16526. *
  16527. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16528. * try:
  16529. * _import_umath()
  16530. */
  16531. /* function exit code */
  16532. __pyx_r = 0;
  16533. goto __pyx_L0;
  16534. __pyx_L1_error:;
  16535. __Pyx_XDECREF(__pyx_t_5);
  16536. __Pyx_XDECREF(__pyx_t_6);
  16537. __Pyx_XDECREF(__pyx_t_7);
  16538. __Pyx_XDECREF(__pyx_t_8);
  16539. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16540. __pyx_r = -1;
  16541. __pyx_L0:;
  16542. __Pyx_RefNannyFinishContext();
  16543. return __pyx_r;
  16544. }
  16545. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16546. * raise ImportError("numpy.core.umath failed to import")
  16547. *
  16548. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16549. * try:
  16550. * _import_umath()
  16551. */
  16552. static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  16553. int __pyx_r;
  16554. __Pyx_RefNannyDeclarations
  16555. PyObject *__pyx_t_1 = NULL;
  16556. PyObject *__pyx_t_2 = NULL;
  16557. PyObject *__pyx_t_3 = NULL;
  16558. int __pyx_t_4;
  16559. PyObject *__pyx_t_5 = NULL;
  16560. PyObject *__pyx_t_6 = NULL;
  16561. PyObject *__pyx_t_7 = NULL;
  16562. PyObject *__pyx_t_8 = NULL;
  16563. __Pyx_RefNannySetupContext("import_ufunc", 0);
  16564. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16565. *
  16566. * cdef inline int import_ufunc() except -1:
  16567. * try: # <<<<<<<<<<<<<<
  16568. * _import_umath()
  16569. * except Exception:
  16570. */
  16571. {
  16572. __Pyx_PyThreadState_declare
  16573. __Pyx_PyThreadState_assign
  16574. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16575. __Pyx_XGOTREF(__pyx_t_1);
  16576. __Pyx_XGOTREF(__pyx_t_2);
  16577. __Pyx_XGOTREF(__pyx_t_3);
  16578. /*try:*/ {
  16579. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
  16580. * cdef inline int import_ufunc() except -1:
  16581. * try:
  16582. * _import_umath() # <<<<<<<<<<<<<<
  16583. * except Exception:
  16584. * raise ImportError("numpy.core.umath failed to import")
  16585. */
  16586. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
  16587. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16588. *
  16589. * cdef inline int import_ufunc() except -1:
  16590. * try: # <<<<<<<<<<<<<<
  16591. * _import_umath()
  16592. * except Exception:
  16593. */
  16594. }
  16595. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16596. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16597. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16598. goto __pyx_L8_try_end;
  16599. __pyx_L3_error:;
  16600. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
  16601. * try:
  16602. * _import_umath()
  16603. * except Exception: # <<<<<<<<<<<<<<
  16604. * raise ImportError("numpy.core.umath failed to import")
  16605. */
  16606. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16607. if (__pyx_t_4) {
  16608. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16609. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
  16610. __Pyx_GOTREF(__pyx_t_5);
  16611. __Pyx_GOTREF(__pyx_t_6);
  16612. __Pyx_GOTREF(__pyx_t_7);
  16613. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
  16614. * _import_umath()
  16615. * except Exception:
  16616. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16617. */
  16618. __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)
  16619. __Pyx_GOTREF(__pyx_t_8);
  16620. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16621. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16622. __PYX_ERR(2, 1050, __pyx_L5_except_error)
  16623. }
  16624. goto __pyx_L5_except_error;
  16625. __pyx_L5_except_error:;
  16626. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16627. *
  16628. * cdef inline int import_ufunc() except -1:
  16629. * try: # <<<<<<<<<<<<<<
  16630. * _import_umath()
  16631. * except Exception:
  16632. */
  16633. __Pyx_XGIVEREF(__pyx_t_1);
  16634. __Pyx_XGIVEREF(__pyx_t_2);
  16635. __Pyx_XGIVEREF(__pyx_t_3);
  16636. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16637. goto __pyx_L1_error;
  16638. __pyx_L8_try_end:;
  16639. }
  16640. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16641. * raise ImportError("numpy.core.umath failed to import")
  16642. *
  16643. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16644. * try:
  16645. * _import_umath()
  16646. */
  16647. /* function exit code */
  16648. __pyx_r = 0;
  16649. goto __pyx_L0;
  16650. __pyx_L1_error:;
  16651. __Pyx_XDECREF(__pyx_t_5);
  16652. __Pyx_XDECREF(__pyx_t_6);
  16653. __Pyx_XDECREF(__pyx_t_7);
  16654. __Pyx_XDECREF(__pyx_t_8);
  16655. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16656. __pyx_r = -1;
  16657. __pyx_L0:;
  16658. __Pyx_RefNannyFinishContext();
  16659. return __pyx_r;
  16660. }
  16661. /* "array.pxd":93
  16662. * __data_union data
  16663. *
  16664. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16665. * # This implementation of getbuffer is geared towards Cython
  16666. * # requirements, and does not yet fulfill the PEP.
  16667. */
  16668. /* Python wrapper */
  16669. 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*/
  16670. static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  16671. int __pyx_r;
  16672. __Pyx_RefNannyDeclarations
  16673. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  16674. __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  16675. /* function exit code */
  16676. __Pyx_RefNannyFinishContext();
  16677. return __pyx_r;
  16678. }
  16679. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
  16680. PyObject *__pyx_v_item_count = NULL;
  16681. int __pyx_r;
  16682. __Pyx_RefNannyDeclarations
  16683. PyObject *__pyx_t_1 = NULL;
  16684. char *__pyx_t_2;
  16685. int __pyx_t_3;
  16686. PyObject *__pyx_t_4 = NULL;
  16687. Py_ssize_t __pyx_t_5;
  16688. int __pyx_t_6;
  16689. char __pyx_t_7;
  16690. if (__pyx_v_info == NULL) {
  16691. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  16692. return -1;
  16693. }
  16694. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  16695. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  16696. __Pyx_GIVEREF(__pyx_v_info->obj);
  16697. /* "array.pxd":98
  16698. * # In particular strided access is always provided regardless
  16699. * # of flags
  16700. * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
  16701. *
  16702. * info.suboffsets = NULL
  16703. */
  16704. __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
  16705. __Pyx_GOTREF(__pyx_t_1);
  16706. __pyx_v_item_count = __pyx_t_1;
  16707. __pyx_t_1 = 0;
  16708. /* "array.pxd":100
  16709. * item_count = Py_SIZE(self)
  16710. *
  16711. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  16712. * info.buf = self.data.as_chars
  16713. * info.readonly = 0
  16714. */
  16715. __pyx_v_info->suboffsets = NULL;
  16716. /* "array.pxd":101
  16717. *
  16718. * info.suboffsets = NULL
  16719. * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
  16720. * info.readonly = 0
  16721. * info.ndim = 1
  16722. */
  16723. __pyx_t_2 = __pyx_v_self->data.as_chars;
  16724. __pyx_v_info->buf = __pyx_t_2;
  16725. /* "array.pxd":102
  16726. * info.suboffsets = NULL
  16727. * info.buf = self.data.as_chars
  16728. * info.readonly = 0 # <<<<<<<<<<<<<<
  16729. * info.ndim = 1
  16730. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16731. */
  16732. __pyx_v_info->readonly = 0;
  16733. /* "array.pxd":103
  16734. * info.buf = self.data.as_chars
  16735. * info.readonly = 0
  16736. * info.ndim = 1 # <<<<<<<<<<<<<<
  16737. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16738. * info.len = info.itemsize * item_count
  16739. */
  16740. __pyx_v_info->ndim = 1;
  16741. /* "array.pxd":104
  16742. * info.readonly = 0
  16743. * info.ndim = 1
  16744. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
  16745. * info.len = info.itemsize * item_count
  16746. *
  16747. */
  16748. __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
  16749. __pyx_v_info->itemsize = __pyx_t_3;
  16750. /* "array.pxd":105
  16751. * info.ndim = 1
  16752. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16753. * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
  16754. *
  16755. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16756. */
  16757. __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  16758. __Pyx_GOTREF(__pyx_t_1);
  16759. __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 105, __pyx_L1_error)
  16760. __Pyx_GOTREF(__pyx_t_4);
  16761. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16762. __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)
  16763. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16764. __pyx_v_info->len = __pyx_t_5;
  16765. /* "array.pxd":107
  16766. * info.len = info.itemsize * item_count
  16767. *
  16768. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
  16769. * if not info.shape:
  16770. * raise MemoryError()
  16771. */
  16772. __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
  16773. /* "array.pxd":108
  16774. *
  16775. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16776. * if not info.shape: # <<<<<<<<<<<<<<
  16777. * raise MemoryError()
  16778. * info.shape[0] = item_count # constant regardless of resizing
  16779. */
  16780. __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
  16781. if (unlikely(__pyx_t_6)) {
  16782. /* "array.pxd":109
  16783. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16784. * if not info.shape:
  16785. * raise MemoryError() # <<<<<<<<<<<<<<
  16786. * info.shape[0] = item_count # constant regardless of resizing
  16787. * info.strides = &info.itemsize
  16788. */
  16789. PyErr_NoMemory(); __PYX_ERR(3, 109, __pyx_L1_error)
  16790. /* "array.pxd":108
  16791. *
  16792. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16793. * if not info.shape: # <<<<<<<<<<<<<<
  16794. * raise MemoryError()
  16795. * info.shape[0] = item_count # constant regardless of resizing
  16796. */
  16797. }
  16798. /* "array.pxd":110
  16799. * if not info.shape:
  16800. * raise MemoryError()
  16801. * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
  16802. * info.strides = &info.itemsize
  16803. *
  16804. */
  16805. __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)
  16806. (__pyx_v_info->shape[0]) = __pyx_t_5;
  16807. /* "array.pxd":111
  16808. * raise MemoryError()
  16809. * info.shape[0] = item_count # constant regardless of resizing
  16810. * info.strides = &info.itemsize # <<<<<<<<<<<<<<
  16811. *
  16812. * info.format = <char*> (info.shape + 1)
  16813. */
  16814. __pyx_v_info->strides = (&__pyx_v_info->itemsize);
  16815. /* "array.pxd":113
  16816. * info.strides = &info.itemsize
  16817. *
  16818. * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
  16819. * info.format[0] = self.ob_descr.typecode
  16820. * info.format[1] = 0
  16821. */
  16822. __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
  16823. /* "array.pxd":114
  16824. *
  16825. * info.format = <char*> (info.shape + 1)
  16826. * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
  16827. * info.format[1] = 0
  16828. * info.obj = self
  16829. */
  16830. __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
  16831. (__pyx_v_info->format[0]) = __pyx_t_7;
  16832. /* "array.pxd":115
  16833. * info.format = <char*> (info.shape + 1)
  16834. * info.format[0] = self.ob_descr.typecode
  16835. * info.format[1] = 0 # <<<<<<<<<<<<<<
  16836. * info.obj = self
  16837. *
  16838. */
  16839. (__pyx_v_info->format[1]) = 0;
  16840. /* "array.pxd":116
  16841. * info.format[0] = self.ob_descr.typecode
  16842. * info.format[1] = 0
  16843. * info.obj = self # <<<<<<<<<<<<<<
  16844. *
  16845. * def __releasebuffer__(self, Py_buffer* info):
  16846. */
  16847. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  16848. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  16849. __Pyx_GOTREF(__pyx_v_info->obj);
  16850. __Pyx_DECREF(__pyx_v_info->obj);
  16851. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  16852. /* "array.pxd":93
  16853. * __data_union data
  16854. *
  16855. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16856. * # This implementation of getbuffer is geared towards Cython
  16857. * # requirements, and does not yet fulfill the PEP.
  16858. */
  16859. /* function exit code */
  16860. __pyx_r = 0;
  16861. goto __pyx_L0;
  16862. __pyx_L1_error:;
  16863. __Pyx_XDECREF(__pyx_t_1);
  16864. __Pyx_XDECREF(__pyx_t_4);
  16865. __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16866. __pyx_r = -1;
  16867. if (__pyx_v_info->obj != NULL) {
  16868. __Pyx_GOTREF(__pyx_v_info->obj);
  16869. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  16870. }
  16871. goto __pyx_L2;
  16872. __pyx_L0:;
  16873. if (__pyx_v_info->obj == Py_None) {
  16874. __Pyx_GOTREF(__pyx_v_info->obj);
  16875. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  16876. }
  16877. __pyx_L2:;
  16878. __Pyx_XDECREF(__pyx_v_item_count);
  16879. __Pyx_RefNannyFinishContext();
  16880. return __pyx_r;
  16881. }
  16882. /* "array.pxd":118
  16883. * info.obj = self
  16884. *
  16885. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  16886. * PyObject_Free(info.shape)
  16887. *
  16888. */
  16889. /* Python wrapper */
  16890. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  16891. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  16892. __Pyx_RefNannyDeclarations
  16893. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  16894. __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  16895. /* function exit code */
  16896. __Pyx_RefNannyFinishContext();
  16897. }
  16898. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  16899. __Pyx_RefNannyDeclarations
  16900. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  16901. /* "array.pxd":119
  16902. *
  16903. * def __releasebuffer__(self, Py_buffer* info):
  16904. * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
  16905. *
  16906. * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
  16907. */
  16908. PyObject_Free(__pyx_v_info->shape);
  16909. /* "array.pxd":118
  16910. * info.obj = self
  16911. *
  16912. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  16913. * PyObject_Free(info.shape)
  16914. *
  16915. */
  16916. /* function exit code */
  16917. __Pyx_RefNannyFinishContext();
  16918. }
  16919. /* "array.pxd":130
  16920. *
  16921. *
  16922. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  16923. * """ fast creation of a new array, given a template array.
  16924. * type will be same as template.
  16925. */
  16926. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
  16927. arrayobject *__pyx_v_op = NULL;
  16928. arrayobject *__pyx_r = NULL;
  16929. __Pyx_RefNannyDeclarations
  16930. PyObject *__pyx_t_1 = NULL;
  16931. int __pyx_t_2;
  16932. int __pyx_t_3;
  16933. int __pyx_t_4;
  16934. __Pyx_RefNannySetupContext("clone", 0);
  16935. /* "array.pxd":134
  16936. * type will be same as template.
  16937. * if zero is true, new array will be initialized with zeroes."""
  16938. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
  16939. * if zero and op is not None:
  16940. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16941. */
  16942. __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)
  16943. __Pyx_GOTREF(__pyx_t_1);
  16944. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  16945. __pyx_t_1 = 0;
  16946. /* "array.pxd":135
  16947. * if zero is true, new array will be initialized with zeroes."""
  16948. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16949. * if zero and op is not None: # <<<<<<<<<<<<<<
  16950. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16951. * return op
  16952. */
  16953. __pyx_t_3 = (__pyx_v_zero != 0);
  16954. if (__pyx_t_3) {
  16955. } else {
  16956. __pyx_t_2 = __pyx_t_3;
  16957. goto __pyx_L4_bool_binop_done;
  16958. }
  16959. __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
  16960. __pyx_t_4 = (__pyx_t_3 != 0);
  16961. __pyx_t_2 = __pyx_t_4;
  16962. __pyx_L4_bool_binop_done:;
  16963. if (__pyx_t_2) {
  16964. /* "array.pxd":136
  16965. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16966. * if zero and op is not None:
  16967. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  16968. * return op
  16969. *
  16970. */
  16971. (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
  16972. /* "array.pxd":135
  16973. * if zero is true, new array will be initialized with zeroes."""
  16974. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16975. * if zero and op is not None: # <<<<<<<<<<<<<<
  16976. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16977. * return op
  16978. */
  16979. }
  16980. /* "array.pxd":137
  16981. * if zero and op is not None:
  16982. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16983. * return op # <<<<<<<<<<<<<<
  16984. *
  16985. * cdef inline array copy(array self):
  16986. */
  16987. __Pyx_XDECREF(((PyObject *)__pyx_r));
  16988. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  16989. __pyx_r = __pyx_v_op;
  16990. goto __pyx_L0;
  16991. /* "array.pxd":130
  16992. *
  16993. *
  16994. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  16995. * """ fast creation of a new array, given a template array.
  16996. * type will be same as template.
  16997. */
  16998. /* function exit code */
  16999. __pyx_L1_error:;
  17000. __Pyx_XDECREF(__pyx_t_1);
  17001. __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17002. __pyx_r = 0;
  17003. __pyx_L0:;
  17004. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17005. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17006. __Pyx_RefNannyFinishContext();
  17007. return __pyx_r;
  17008. }
  17009. /* "array.pxd":139
  17010. * return op
  17011. *
  17012. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17013. * """ make a copy of an array. """
  17014. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17015. */
  17016. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
  17017. arrayobject *__pyx_v_op = NULL;
  17018. arrayobject *__pyx_r = NULL;
  17019. __Pyx_RefNannyDeclarations
  17020. PyObject *__pyx_t_1 = NULL;
  17021. __Pyx_RefNannySetupContext("copy", 0);
  17022. /* "array.pxd":141
  17023. * cdef inline array copy(array self):
  17024. * """ make a copy of an array. """
  17025. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
  17026. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17027. * return op
  17028. */
  17029. __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)
  17030. __Pyx_GOTREF(__pyx_t_1);
  17031. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  17032. __pyx_t_1 = 0;
  17033. /* "array.pxd":142
  17034. * """ make a copy of an array. """
  17035. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17036. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17037. * return op
  17038. *
  17039. */
  17040. (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)));
  17041. /* "array.pxd":143
  17042. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17043. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17044. * return op # <<<<<<<<<<<<<<
  17045. *
  17046. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
  17047. */
  17048. __Pyx_XDECREF(((PyObject *)__pyx_r));
  17049. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  17050. __pyx_r = __pyx_v_op;
  17051. goto __pyx_L0;
  17052. /* "array.pxd":139
  17053. * return op
  17054. *
  17055. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17056. * """ make a copy of an array. """
  17057. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17058. */
  17059. /* function exit code */
  17060. __pyx_L1_error:;
  17061. __Pyx_XDECREF(__pyx_t_1);
  17062. __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17063. __pyx_r = 0;
  17064. __pyx_L0:;
  17065. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17066. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17067. __Pyx_RefNannyFinishContext();
  17068. return __pyx_r;
  17069. }
  17070. /* "array.pxd":145
  17071. * return op
  17072. *
  17073. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17074. * """ efficient appending of new stuff of same type
  17075. * (e.g. of same array type)
  17076. */
  17077. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  17078. Py_ssize_t __pyx_v_itemsize;
  17079. Py_ssize_t __pyx_v_origsize;
  17080. int __pyx_r;
  17081. __Pyx_RefNannyDeclarations
  17082. int __pyx_t_1;
  17083. __Pyx_RefNannySetupContext("extend_buffer", 0);
  17084. /* "array.pxd":149
  17085. * (e.g. of same array type)
  17086. * n: number of elements (not number of bytes!) """
  17087. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
  17088. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17089. * resize_smart(self, origsize + n)
  17090. */
  17091. __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
  17092. __pyx_v_itemsize = __pyx_t_1;
  17093. /* "array.pxd":150
  17094. * n: number of elements (not number of bytes!) """
  17095. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17096. * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
  17097. * resize_smart(self, origsize + n)
  17098. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17099. */
  17100. __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
  17101. /* "array.pxd":151
  17102. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17103. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17104. * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
  17105. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17106. * return 0
  17107. */
  17108. __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)
  17109. /* "array.pxd":152
  17110. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17111. * resize_smart(self, origsize + n)
  17112. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
  17113. * return 0
  17114. *
  17115. */
  17116. (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
  17117. /* "array.pxd":153
  17118. * resize_smart(self, origsize + n)
  17119. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17120. * return 0 # <<<<<<<<<<<<<<
  17121. *
  17122. * cdef inline int extend(array self, array other) except -1:
  17123. */
  17124. __pyx_r = 0;
  17125. goto __pyx_L0;
  17126. /* "array.pxd":145
  17127. * return op
  17128. *
  17129. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17130. * """ efficient appending of new stuff of same type
  17131. * (e.g. of same array type)
  17132. */
  17133. /* function exit code */
  17134. __pyx_L1_error:;
  17135. __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17136. __pyx_r = -1;
  17137. __pyx_L0:;
  17138. __Pyx_RefNannyFinishContext();
  17139. return __pyx_r;
  17140. }
  17141. /* "array.pxd":155
  17142. * return 0
  17143. *
  17144. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17145. * """ extend array with data from another array; types must match. """
  17146. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17147. */
  17148. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  17149. int __pyx_r;
  17150. __Pyx_RefNannyDeclarations
  17151. int __pyx_t_1;
  17152. int __pyx_t_2;
  17153. __Pyx_RefNannySetupContext("extend", 0);
  17154. /* "array.pxd":157
  17155. * cdef inline int extend(array self, array other) except -1:
  17156. * """ extend array with data from another array; types must match. """
  17157. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17158. * PyErr_BadArgument()
  17159. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17160. */
  17161. __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
  17162. if (__pyx_t_1) {
  17163. /* "array.pxd":158
  17164. * """ extend array with data from another array; types must match. """
  17165. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17166. * PyErr_BadArgument() # <<<<<<<<<<<<<<
  17167. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17168. *
  17169. */
  17170. __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 158, __pyx_L1_error)
  17171. /* "array.pxd":157
  17172. * cdef inline int extend(array self, array other) except -1:
  17173. * """ extend array with data from another array; types must match. """
  17174. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17175. * PyErr_BadArgument()
  17176. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17177. */
  17178. }
  17179. /* "array.pxd":159
  17180. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17181. * PyErr_BadArgument()
  17182. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
  17183. *
  17184. * cdef inline void zero(array self):
  17185. */
  17186. __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)
  17187. __pyx_r = __pyx_t_2;
  17188. goto __pyx_L0;
  17189. /* "array.pxd":155
  17190. * return 0
  17191. *
  17192. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17193. * """ extend array with data from another array; types must match. """
  17194. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17195. */
  17196. /* function exit code */
  17197. __pyx_L1_error:;
  17198. __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17199. __pyx_r = -1;
  17200. __pyx_L0:;
  17201. __Pyx_RefNannyFinishContext();
  17202. return __pyx_r;
  17203. }
  17204. /* "array.pxd":161
  17205. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17206. *
  17207. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17208. * """ set all elements of array to zero. """
  17209. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17210. */
  17211. static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
  17212. __Pyx_RefNannyDeclarations
  17213. __Pyx_RefNannySetupContext("zero", 0);
  17214. /* "array.pxd":163
  17215. * cdef inline void zero(array self):
  17216. * """ set all elements of array to zero. """
  17217. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17218. */
  17219. (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
  17220. /* "array.pxd":161
  17221. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17222. *
  17223. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17224. * """ set all elements of array to zero. """
  17225. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17226. */
  17227. /* function exit code */
  17228. __Pyx_RefNannyFinishContext();
  17229. }
  17230. /* "string.to_py":31
  17231. *
  17232. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17233. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17234. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17235. * cdef extern from *:
  17236. */
  17237. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17238. PyObject *__pyx_r = NULL;
  17239. __Pyx_RefNannyDeclarations
  17240. PyObject *__pyx_t_1 = NULL;
  17241. __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
  17242. /* "string.to_py":32
  17243. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17244. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
  17245. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17246. * cdef extern from *:
  17247. * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
  17248. */
  17249. __Pyx_XDECREF(__pyx_r);
  17250. __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)
  17251. __Pyx_GOTREF(__pyx_t_1);
  17252. __pyx_r = __pyx_t_1;
  17253. __pyx_t_1 = 0;
  17254. goto __pyx_L0;
  17255. /* "string.to_py":31
  17256. *
  17257. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17258. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17259. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17260. * cdef extern from *:
  17261. */
  17262. /* function exit code */
  17263. __pyx_L1_error:;
  17264. __Pyx_XDECREF(__pyx_t_1);
  17265. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17266. __pyx_r = 0;
  17267. __pyx_L0:;
  17268. __Pyx_XGIVEREF(__pyx_r);
  17269. __Pyx_RefNannyFinishContext();
  17270. return __pyx_r;
  17271. }
  17272. /* "string.to_py":37
  17273. *
  17274. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17275. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17276. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17277. * cdef extern from *:
  17278. */
  17279. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17280. PyObject *__pyx_r = NULL;
  17281. __Pyx_RefNannyDeclarations
  17282. PyObject *__pyx_t_1 = NULL;
  17283. __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
  17284. /* "string.to_py":38
  17285. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17286. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
  17287. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17288. * cdef extern from *:
  17289. * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
  17290. */
  17291. __Pyx_XDECREF(__pyx_r);
  17292. __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)
  17293. __Pyx_GOTREF(__pyx_t_1);
  17294. __pyx_r = __pyx_t_1;
  17295. __pyx_t_1 = 0;
  17296. goto __pyx_L0;
  17297. /* "string.to_py":37
  17298. *
  17299. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17300. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17301. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17302. * cdef extern from *:
  17303. */
  17304. /* function exit code */
  17305. __pyx_L1_error:;
  17306. __Pyx_XDECREF(__pyx_t_1);
  17307. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17308. __pyx_r = 0;
  17309. __pyx_L0:;
  17310. __Pyx_XGIVEREF(__pyx_r);
  17311. __Pyx_RefNannyFinishContext();
  17312. return __pyx_r;
  17313. }
  17314. /* "string.to_py":43
  17315. *
  17316. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17317. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17318. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17319. * cdef extern from *:
  17320. */
  17321. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17322. PyObject *__pyx_r = NULL;
  17323. __Pyx_RefNannyDeclarations
  17324. PyObject *__pyx_t_1 = NULL;
  17325. __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
  17326. /* "string.to_py":44
  17327. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17328. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
  17329. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17330. * cdef extern from *:
  17331. * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
  17332. */
  17333. __Pyx_XDECREF(__pyx_r);
  17334. __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)
  17335. __Pyx_GOTREF(__pyx_t_1);
  17336. __pyx_r = __pyx_t_1;
  17337. __pyx_t_1 = 0;
  17338. goto __pyx_L0;
  17339. /* "string.to_py":43
  17340. *
  17341. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17342. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17343. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17344. * cdef extern from *:
  17345. */
  17346. /* function exit code */
  17347. __pyx_L1_error:;
  17348. __Pyx_XDECREF(__pyx_t_1);
  17349. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17350. __pyx_r = 0;
  17351. __pyx_L0:;
  17352. __Pyx_XGIVEREF(__pyx_r);
  17353. __Pyx_RefNannyFinishContext();
  17354. return __pyx_r;
  17355. }
  17356. /* "string.to_py":49
  17357. *
  17358. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17359. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17360. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17361. * cdef extern from *:
  17362. */
  17363. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17364. PyObject *__pyx_r = NULL;
  17365. __Pyx_RefNannyDeclarations
  17366. PyObject *__pyx_t_1 = NULL;
  17367. __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
  17368. /* "string.to_py":50
  17369. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17370. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
  17371. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17372. * cdef extern from *:
  17373. * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
  17374. */
  17375. __Pyx_XDECREF(__pyx_r);
  17376. __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)
  17377. __Pyx_GOTREF(__pyx_t_1);
  17378. __pyx_r = __pyx_t_1;
  17379. __pyx_t_1 = 0;
  17380. goto __pyx_L0;
  17381. /* "string.to_py":49
  17382. *
  17383. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17384. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17385. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17386. * cdef extern from *:
  17387. */
  17388. /* function exit code */
  17389. __pyx_L1_error:;
  17390. __Pyx_XDECREF(__pyx_t_1);
  17391. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17392. __pyx_r = 0;
  17393. __pyx_L0:;
  17394. __Pyx_XGIVEREF(__pyx_r);
  17395. __Pyx_RefNannyFinishContext();
  17396. return __pyx_r;
  17397. }
  17398. /* "string.to_py":55
  17399. *
  17400. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17401. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17402. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17403. *
  17404. */
  17405. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17406. PyObject *__pyx_r = NULL;
  17407. __Pyx_RefNannyDeclarations
  17408. PyObject *__pyx_t_1 = NULL;
  17409. __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
  17410. /* "string.to_py":56
  17411. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17412. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
  17413. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17414. *
  17415. */
  17416. __Pyx_XDECREF(__pyx_r);
  17417. __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)
  17418. __Pyx_GOTREF(__pyx_t_1);
  17419. __pyx_r = __pyx_t_1;
  17420. __pyx_t_1 = 0;
  17421. goto __pyx_L0;
  17422. /* "string.to_py":55
  17423. *
  17424. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17425. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17426. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17427. *
  17428. */
  17429. /* function exit code */
  17430. __pyx_L1_error:;
  17431. __Pyx_XDECREF(__pyx_t_1);
  17432. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17433. __pyx_r = 0;
  17434. __pyx_L0:;
  17435. __Pyx_XGIVEREF(__pyx_r);
  17436. __Pyx_RefNannyFinishContext();
  17437. return __pyx_r;
  17438. }
  17439. /* "string.from_py":13
  17440. *
  17441. * @cname("__pyx_convert_string_from_py_std__in_string")
  17442. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17443. * cdef Py_ssize_t length = 0
  17444. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17445. */
  17446. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  17447. Py_ssize_t __pyx_v_length;
  17448. char const *__pyx_v_data;
  17449. std::string __pyx_r;
  17450. __Pyx_RefNannyDeclarations
  17451. char const *__pyx_t_1;
  17452. __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
  17453. /* "string.from_py":14
  17454. * @cname("__pyx_convert_string_from_py_std__in_string")
  17455. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17456. * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
  17457. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17458. * return string(data, length)
  17459. */
  17460. __pyx_v_length = 0;
  17461. /* "string.from_py":15
  17462. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17463. * cdef Py_ssize_t length = 0
  17464. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
  17465. * return string(data, length)
  17466. *
  17467. */
  17468. __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)
  17469. __pyx_v_data = __pyx_t_1;
  17470. /* "string.from_py":16
  17471. * cdef Py_ssize_t length = 0
  17472. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17473. * return string(data, length) # <<<<<<<<<<<<<<
  17474. *
  17475. *
  17476. */
  17477. __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  17478. goto __pyx_L0;
  17479. /* "string.from_py":13
  17480. *
  17481. * @cname("__pyx_convert_string_from_py_std__in_string")
  17482. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17483. * cdef Py_ssize_t length = 0
  17484. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17485. */
  17486. /* function exit code */
  17487. __pyx_L1_error:;
  17488. __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17489. __Pyx_pretend_to_initialize(&__pyx_r);
  17490. __pyx_L0:;
  17491. __Pyx_RefNannyFinishContext();
  17492. return __pyx_r;
  17493. }
  17494. /* "pair.to_py":158
  17495. *
  17496. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17497. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17498. * return p.first, p.second
  17499. *
  17500. */
  17501. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &__pyx_v_p) {
  17502. PyObject *__pyx_r = NULL;
  17503. __Pyx_RefNannyDeclarations
  17504. PyObject *__pyx_t_1 = NULL;
  17505. PyObject *__pyx_t_2 = NULL;
  17506. PyObject *__pyx_t_3 = NULL;
  17507. __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_size_t____size_t", 0);
  17508. /* "pair.to_py":159
  17509. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17510. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p):
  17511. * return p.first, p.second # <<<<<<<<<<<<<<
  17512. *
  17513. *
  17514. */
  17515. __Pyx_XDECREF(__pyx_r);
  17516. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
  17517. __Pyx_GOTREF(__pyx_t_1);
  17518. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error)
  17519. __Pyx_GOTREF(__pyx_t_2);
  17520. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error)
  17521. __Pyx_GOTREF(__pyx_t_3);
  17522. __Pyx_GIVEREF(__pyx_t_1);
  17523. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  17524. __Pyx_GIVEREF(__pyx_t_2);
  17525. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  17526. __pyx_t_1 = 0;
  17527. __pyx_t_2 = 0;
  17528. __pyx_r = __pyx_t_3;
  17529. __pyx_t_3 = 0;
  17530. goto __pyx_L0;
  17531. /* "pair.to_py":158
  17532. *
  17533. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17534. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17535. * return p.first, p.second
  17536. *
  17537. */
  17538. /* function exit code */
  17539. __pyx_L1_error:;
  17540. __Pyx_XDECREF(__pyx_t_1);
  17541. __Pyx_XDECREF(__pyx_t_2);
  17542. __Pyx_XDECREF(__pyx_t_3);
  17543. __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_size_t____size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17544. __pyx_r = 0;
  17545. __pyx_L0:;
  17546. __Pyx_XGIVEREF(__pyx_r);
  17547. __Pyx_RefNannyFinishContext();
  17548. return __pyx_r;
  17549. }
  17550. /* "vector.to_py":60
  17551. *
  17552. * @cname("__pyx_convert_vector_to_py_size_t")
  17553. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17554. * return [v[i] for i in range(v.size())]
  17555. *
  17556. */
  17557. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &__pyx_v_v) {
  17558. size_t __pyx_v_i;
  17559. PyObject *__pyx_r = NULL;
  17560. __Pyx_RefNannyDeclarations
  17561. PyObject *__pyx_t_1 = NULL;
  17562. size_t __pyx_t_2;
  17563. size_t __pyx_t_3;
  17564. size_t __pyx_t_4;
  17565. PyObject *__pyx_t_5 = NULL;
  17566. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_size_t", 0);
  17567. /* "vector.to_py":61
  17568. * @cname("__pyx_convert_vector_to_py_size_t")
  17569. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v):
  17570. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17571. *
  17572. *
  17573. */
  17574. __Pyx_XDECREF(__pyx_r);
  17575. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17576. __Pyx_GOTREF(__pyx_t_1);
  17577. __pyx_t_2 = __pyx_v_v.size();
  17578. __pyx_t_3 = __pyx_t_2;
  17579. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17580. __pyx_v_i = __pyx_t_4;
  17581. __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)
  17582. __Pyx_GOTREF(__pyx_t_5);
  17583. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17584. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17585. }
  17586. __pyx_r = __pyx_t_1;
  17587. __pyx_t_1 = 0;
  17588. goto __pyx_L0;
  17589. /* "vector.to_py":60
  17590. *
  17591. * @cname("__pyx_convert_vector_to_py_size_t")
  17592. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17593. * return [v[i] for i in range(v.size())]
  17594. *
  17595. */
  17596. /* function exit code */
  17597. __pyx_L1_error:;
  17598. __Pyx_XDECREF(__pyx_t_1);
  17599. __Pyx_XDECREF(__pyx_t_5);
  17600. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17601. __pyx_r = 0;
  17602. __pyx_L0:;
  17603. __Pyx_XGIVEREF(__pyx_r);
  17604. __Pyx_RefNannyFinishContext();
  17605. return __pyx_r;
  17606. }
  17607. /* "map.from_py":174
  17608. *
  17609. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17610. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17611. * cdef dict d = o
  17612. * cdef map[X,Y] m
  17613. */
  17614. 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) {
  17615. PyObject *__pyx_v_d = 0;
  17616. std::map<std::string,std::string> __pyx_v_m;
  17617. PyObject *__pyx_v_key = NULL;
  17618. PyObject *__pyx_v_value = NULL;
  17619. std::map<std::string,std::string> __pyx_r;
  17620. __Pyx_RefNannyDeclarations
  17621. PyObject *__pyx_t_1 = NULL;
  17622. Py_ssize_t __pyx_t_2;
  17623. Py_ssize_t __pyx_t_3;
  17624. int __pyx_t_4;
  17625. PyObject *__pyx_t_5 = NULL;
  17626. PyObject *__pyx_t_6 = NULL;
  17627. int __pyx_t_7;
  17628. std::string __pyx_t_8;
  17629. std::string __pyx_t_9;
  17630. __Pyx_RefNannySetupContext("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);
  17631. /* "map.from_py":175
  17632. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17633. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
  17634. * cdef dict d = o # <<<<<<<<<<<<<<
  17635. * cdef map[X,Y] m
  17636. * for key, value in d.iteritems():
  17637. */
  17638. 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)
  17639. __pyx_t_1 = __pyx_v_o;
  17640. __Pyx_INCREF(__pyx_t_1);
  17641. __pyx_v_d = ((PyObject*)__pyx_t_1);
  17642. __pyx_t_1 = 0;
  17643. /* "map.from_py":177
  17644. * cdef dict d = o
  17645. * cdef map[X,Y] m
  17646. * for key, value in d.iteritems(): # <<<<<<<<<<<<<<
  17647. * m.insert(pair[X,Y](<X>key, <Y>value))
  17648. * return m
  17649. */
  17650. __pyx_t_2 = 0;
  17651. if (unlikely(__pyx_v_d == Py_None)) {
  17652. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
  17653. __PYX_ERR(1, 177, __pyx_L1_error)
  17654. }
  17655. __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)
  17656. __Pyx_GOTREF(__pyx_t_5);
  17657. __Pyx_XDECREF(__pyx_t_1);
  17658. __pyx_t_1 = __pyx_t_5;
  17659. __pyx_t_5 = 0;
  17660. while (1) {
  17661. __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);
  17662. if (unlikely(__pyx_t_7 == 0)) break;
  17663. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 177, __pyx_L1_error)
  17664. __Pyx_GOTREF(__pyx_t_5);
  17665. __Pyx_GOTREF(__pyx_t_6);
  17666. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  17667. __pyx_t_5 = 0;
  17668. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  17669. __pyx_t_6 = 0;
  17670. /* "map.from_py":178
  17671. * cdef map[X,Y] m
  17672. * for key, value in d.iteritems():
  17673. * m.insert(pair[X,Y](<X>key, <Y>value)) # <<<<<<<<<<<<<<
  17674. * return m
  17675. *
  17676. */
  17677. __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)
  17678. __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)
  17679. __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  17680. }
  17681. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17682. /* "map.from_py":179
  17683. * for key, value in d.iteritems():
  17684. * m.insert(pair[X,Y](<X>key, <Y>value))
  17685. * return m # <<<<<<<<<<<<<<
  17686. *
  17687. *
  17688. */
  17689. __pyx_r = __pyx_v_m;
  17690. goto __pyx_L0;
  17691. /* "map.from_py":174
  17692. *
  17693. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17694. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17695. * cdef dict d = o
  17696. * cdef map[X,Y] m
  17697. */
  17698. /* function exit code */
  17699. __pyx_L1_error:;
  17700. __Pyx_XDECREF(__pyx_t_1);
  17701. __Pyx_XDECREF(__pyx_t_5);
  17702. __Pyx_XDECREF(__pyx_t_6);
  17703. __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);
  17704. __Pyx_pretend_to_initialize(&__pyx_r);
  17705. __pyx_L0:;
  17706. __Pyx_XDECREF(__pyx_v_d);
  17707. __Pyx_XDECREF(__pyx_v_key);
  17708. __Pyx_XDECREF(__pyx_v_value);
  17709. __Pyx_RefNannyFinishContext();
  17710. return __pyx_r;
  17711. }
  17712. /* "map.to_py":201
  17713. *
  17714. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17715. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17716. * o = {}
  17717. * cdef const map[X,Y].value_type *key_value
  17718. */
  17719. 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) {
  17720. PyObject *__pyx_v_o = NULL;
  17721. std::map<std::string,std::string> ::value_type const *__pyx_v_key_value;
  17722. std::map<std::string,std::string> ::const_iterator __pyx_v_iter;
  17723. PyObject *__pyx_r = NULL;
  17724. __Pyx_RefNannyDeclarations
  17725. PyObject *__pyx_t_1 = NULL;
  17726. int __pyx_t_2;
  17727. PyObject *__pyx_t_3 = NULL;
  17728. __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", 0);
  17729. /* "map.to_py":202
  17730. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17731. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):
  17732. * o = {} # <<<<<<<<<<<<<<
  17733. * cdef const map[X,Y].value_type *key_value
  17734. * cdef map[X,Y].const_iterator iter = s.begin()
  17735. */
  17736. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17737. __Pyx_GOTREF(__pyx_t_1);
  17738. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17739. __pyx_t_1 = 0;
  17740. /* "map.to_py":204
  17741. * o = {}
  17742. * cdef const map[X,Y].value_type *key_value
  17743. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17744. * while iter != s.end():
  17745. * key_value = &cython.operator.dereference(iter)
  17746. */
  17747. __pyx_v_iter = __pyx_v_s.begin();
  17748. /* "map.to_py":205
  17749. * cdef const map[X,Y].value_type *key_value
  17750. * cdef map[X,Y].const_iterator iter = s.begin()
  17751. * while iter != s.end(): # <<<<<<<<<<<<<<
  17752. * key_value = &cython.operator.dereference(iter)
  17753. * o[key_value.first] = key_value.second
  17754. */
  17755. while (1) {
  17756. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17757. if (!__pyx_t_2) break;
  17758. /* "map.to_py":206
  17759. * cdef map[X,Y].const_iterator iter = s.begin()
  17760. * while iter != s.end():
  17761. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17762. * o[key_value.first] = key_value.second
  17763. * cython.operator.preincrement(iter)
  17764. */
  17765. __pyx_v_key_value = (&(*__pyx_v_iter));
  17766. /* "map.to_py":207
  17767. * while iter != s.end():
  17768. * key_value = &cython.operator.dereference(iter)
  17769. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17770. * cython.operator.preincrement(iter)
  17771. * return o
  17772. */
  17773. __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)
  17774. __Pyx_GOTREF(__pyx_t_1);
  17775. __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)
  17776. __Pyx_GOTREF(__pyx_t_3);
  17777. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17778. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17779. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17780. /* "map.to_py":208
  17781. * key_value = &cython.operator.dereference(iter)
  17782. * o[key_value.first] = key_value.second
  17783. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17784. * return o
  17785. *
  17786. */
  17787. (void)((++__pyx_v_iter));
  17788. }
  17789. /* "map.to_py":209
  17790. * o[key_value.first] = key_value.second
  17791. * cython.operator.preincrement(iter)
  17792. * return o # <<<<<<<<<<<<<<
  17793. *
  17794. *
  17795. */
  17796. __Pyx_XDECREF(__pyx_r);
  17797. __Pyx_INCREF(__pyx_v_o);
  17798. __pyx_r = __pyx_v_o;
  17799. goto __pyx_L0;
  17800. /* "map.to_py":201
  17801. *
  17802. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17803. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17804. * o = {}
  17805. * cdef const map[X,Y].value_type *key_value
  17806. */
  17807. /* function exit code */
  17808. __pyx_L1_error:;
  17809. __Pyx_XDECREF(__pyx_t_1);
  17810. __Pyx_XDECREF(__pyx_t_3);
  17811. __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17812. __pyx_r = 0;
  17813. __pyx_L0:;
  17814. __Pyx_XDECREF(__pyx_v_o);
  17815. __Pyx_XGIVEREF(__pyx_r);
  17816. __Pyx_RefNannyFinishContext();
  17817. return __pyx_r;
  17818. }
  17819. 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) {
  17820. PyObject *__pyx_v_o = NULL;
  17821. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::value_type const *__pyx_v_key_value;
  17822. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::const_iterator __pyx_v_iter;
  17823. PyObject *__pyx_r = NULL;
  17824. __Pyx_RefNannyDeclarations
  17825. PyObject *__pyx_t_1 = NULL;
  17826. int __pyx_t_2;
  17827. PyObject *__pyx_t_3 = NULL;
  17828. __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);
  17829. /* "map.to_py":202
  17830. * @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___")
  17831. * 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):
  17832. * o = {} # <<<<<<<<<<<<<<
  17833. * cdef const map[X,Y].value_type *key_value
  17834. * cdef map[X,Y].const_iterator iter = s.begin()
  17835. */
  17836. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17837. __Pyx_GOTREF(__pyx_t_1);
  17838. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17839. __pyx_t_1 = 0;
  17840. /* "map.to_py":204
  17841. * o = {}
  17842. * cdef const map[X,Y].value_type *key_value
  17843. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17844. * while iter != s.end():
  17845. * key_value = &cython.operator.dereference(iter)
  17846. */
  17847. __pyx_v_iter = __pyx_v_s.begin();
  17848. /* "map.to_py":205
  17849. * cdef const map[X,Y].value_type *key_value
  17850. * cdef map[X,Y].const_iterator iter = s.begin()
  17851. * while iter != s.end(): # <<<<<<<<<<<<<<
  17852. * key_value = &cython.operator.dereference(iter)
  17853. * o[key_value.first] = key_value.second
  17854. */
  17855. while (1) {
  17856. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17857. if (!__pyx_t_2) break;
  17858. /* "map.to_py":206
  17859. * cdef map[X,Y].const_iterator iter = s.begin()
  17860. * while iter != s.end():
  17861. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17862. * o[key_value.first] = key_value.second
  17863. * cython.operator.preincrement(iter)
  17864. */
  17865. __pyx_v_key_value = (&(*__pyx_v_iter));
  17866. /* "map.to_py":207
  17867. * while iter != s.end():
  17868. * key_value = &cython.operator.dereference(iter)
  17869. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17870. * cython.operator.preincrement(iter)
  17871. * return o
  17872. */
  17873. __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)
  17874. __Pyx_GOTREF(__pyx_t_1);
  17875. __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)
  17876. __Pyx_GOTREF(__pyx_t_3);
  17877. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17878. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17879. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17880. /* "map.to_py":208
  17881. * key_value = &cython.operator.dereference(iter)
  17882. * o[key_value.first] = key_value.second
  17883. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17884. * return o
  17885. *
  17886. */
  17887. (void)((++__pyx_v_iter));
  17888. }
  17889. /* "map.to_py":209
  17890. * o[key_value.first] = key_value.second
  17891. * cython.operator.preincrement(iter)
  17892. * return o # <<<<<<<<<<<<<<
  17893. *
  17894. *
  17895. */
  17896. __Pyx_XDECREF(__pyx_r);
  17897. __Pyx_INCREF(__pyx_v_o);
  17898. __pyx_r = __pyx_v_o;
  17899. goto __pyx_L0;
  17900. /* "map.to_py":201
  17901. *
  17902. * @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___")
  17903. * 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): # <<<<<<<<<<<<<<
  17904. * o = {}
  17905. * cdef const map[X,Y].value_type *key_value
  17906. */
  17907. /* function exit code */
  17908. __pyx_L1_error:;
  17909. __Pyx_XDECREF(__pyx_t_1);
  17910. __Pyx_XDECREF(__pyx_t_3);
  17911. __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);
  17912. __pyx_r = 0;
  17913. __pyx_L0:;
  17914. __Pyx_XDECREF(__pyx_v_o);
  17915. __Pyx_XGIVEREF(__pyx_r);
  17916. __Pyx_RefNannyFinishContext();
  17917. return __pyx_r;
  17918. }
  17919. /* "vector.to_py":60
  17920. *
  17921. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17922. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17923. * return [v[i] for i in range(v.size())]
  17924. *
  17925. */
  17926. 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) {
  17927. size_t __pyx_v_i;
  17928. PyObject *__pyx_r = NULL;
  17929. __Pyx_RefNannyDeclarations
  17930. PyObject *__pyx_t_1 = NULL;
  17931. size_t __pyx_t_2;
  17932. size_t __pyx_t_3;
  17933. size_t __pyx_t_4;
  17934. PyObject *__pyx_t_5 = NULL;
  17935. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  17936. /* "vector.to_py":61
  17937. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17938. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v):
  17939. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17940. *
  17941. *
  17942. */
  17943. __Pyx_XDECREF(__pyx_r);
  17944. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17945. __Pyx_GOTREF(__pyx_t_1);
  17946. __pyx_t_2 = __pyx_v_v.size();
  17947. __pyx_t_3 = __pyx_t_2;
  17948. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17949. __pyx_v_i = __pyx_t_4;
  17950. __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)
  17951. __Pyx_GOTREF(__pyx_t_5);
  17952. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17953. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17954. }
  17955. __pyx_r = __pyx_t_1;
  17956. __pyx_t_1 = 0;
  17957. goto __pyx_L0;
  17958. /* "vector.to_py":60
  17959. *
  17960. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17961. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17962. * return [v[i] for i in range(v.size())]
  17963. *
  17964. */
  17965. /* function exit code */
  17966. __pyx_L1_error:;
  17967. __Pyx_XDECREF(__pyx_t_1);
  17968. __Pyx_XDECREF(__pyx_t_5);
  17969. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17970. __pyx_r = 0;
  17971. __pyx_L0:;
  17972. __Pyx_XGIVEREF(__pyx_r);
  17973. __Pyx_RefNannyFinishContext();
  17974. return __pyx_r;
  17975. }
  17976. /* "vector.from_py":45
  17977. *
  17978. * @cname("__pyx_convert_vector_from_py_double")
  17979. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  17980. * cdef vector[X] v
  17981. * for item in o:
  17982. */
  17983. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  17984. std::vector<double> __pyx_v_v;
  17985. PyObject *__pyx_v_item = NULL;
  17986. std::vector<double> __pyx_r;
  17987. __Pyx_RefNannyDeclarations
  17988. PyObject *__pyx_t_1 = NULL;
  17989. Py_ssize_t __pyx_t_2;
  17990. PyObject *(*__pyx_t_3)(PyObject *);
  17991. PyObject *__pyx_t_4 = NULL;
  17992. double __pyx_t_5;
  17993. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  17994. /* "vector.from_py":47
  17995. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  17996. * cdef vector[X] v
  17997. * for item in o: # <<<<<<<<<<<<<<
  17998. * v.push_back(<X>item)
  17999. * return v
  18000. */
  18001. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18002. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18003. __pyx_t_3 = NULL;
  18004. } else {
  18005. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18006. __Pyx_GOTREF(__pyx_t_1);
  18007. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18008. }
  18009. for (;;) {
  18010. if (likely(!__pyx_t_3)) {
  18011. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18012. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18013. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18014. __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)
  18015. #else
  18016. __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)
  18017. __Pyx_GOTREF(__pyx_t_4);
  18018. #endif
  18019. } else {
  18020. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18021. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18022. __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)
  18023. #else
  18024. __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)
  18025. __Pyx_GOTREF(__pyx_t_4);
  18026. #endif
  18027. }
  18028. } else {
  18029. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18030. if (unlikely(!__pyx_t_4)) {
  18031. PyObject* exc_type = PyErr_Occurred();
  18032. if (exc_type) {
  18033. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18034. else __PYX_ERR(1, 47, __pyx_L1_error)
  18035. }
  18036. break;
  18037. }
  18038. __Pyx_GOTREF(__pyx_t_4);
  18039. }
  18040. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18041. __pyx_t_4 = 0;
  18042. /* "vector.from_py":48
  18043. * cdef vector[X] v
  18044. * for item in o:
  18045. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18046. * return v
  18047. *
  18048. */
  18049. __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)
  18050. __pyx_v_v.push_back(((double)__pyx_t_5));
  18051. /* "vector.from_py":47
  18052. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  18053. * cdef vector[X] v
  18054. * for item in o: # <<<<<<<<<<<<<<
  18055. * v.push_back(<X>item)
  18056. * return v
  18057. */
  18058. }
  18059. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18060. /* "vector.from_py":49
  18061. * for item in o:
  18062. * v.push_back(<X>item)
  18063. * return v # <<<<<<<<<<<<<<
  18064. *
  18065. *
  18066. */
  18067. __pyx_r = __pyx_v_v;
  18068. goto __pyx_L0;
  18069. /* "vector.from_py":45
  18070. *
  18071. * @cname("__pyx_convert_vector_from_py_double")
  18072. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  18073. * cdef vector[X] v
  18074. * for item in o:
  18075. */
  18076. /* function exit code */
  18077. __pyx_L1_error:;
  18078. __Pyx_XDECREF(__pyx_t_1);
  18079. __Pyx_XDECREF(__pyx_t_4);
  18080. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18081. __Pyx_pretend_to_initialize(&__pyx_r);
  18082. __pyx_L0:;
  18083. __Pyx_XDECREF(__pyx_v_item);
  18084. __Pyx_RefNannyFinishContext();
  18085. return __pyx_r;
  18086. }
  18087. /* "vector.to_py":60
  18088. *
  18089. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18090. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18091. * return [v[i] for i in range(v.size())]
  18092. *
  18093. */
  18094. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &__pyx_v_v) {
  18095. size_t __pyx_v_i;
  18096. PyObject *__pyx_r = NULL;
  18097. __Pyx_RefNannyDeclarations
  18098. PyObject *__pyx_t_1 = NULL;
  18099. size_t __pyx_t_2;
  18100. size_t __pyx_t_3;
  18101. size_t __pyx_t_4;
  18102. PyObject *__pyx_t_5 = NULL;
  18103. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_npy_uint64", 0);
  18104. /* "vector.to_py":61
  18105. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18106. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v):
  18107. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18108. *
  18109. *
  18110. */
  18111. __Pyx_XDECREF(__pyx_r);
  18112. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18113. __Pyx_GOTREF(__pyx_t_1);
  18114. __pyx_t_2 = __pyx_v_v.size();
  18115. __pyx_t_3 = __pyx_t_2;
  18116. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18117. __pyx_v_i = __pyx_t_4;
  18118. __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)
  18119. __Pyx_GOTREF(__pyx_t_5);
  18120. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18121. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18122. }
  18123. __pyx_r = __pyx_t_1;
  18124. __pyx_t_1 = 0;
  18125. goto __pyx_L0;
  18126. /* "vector.to_py":60
  18127. *
  18128. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18129. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18130. * return [v[i] for i in range(v.size())]
  18131. *
  18132. */
  18133. /* function exit code */
  18134. __pyx_L1_error:;
  18135. __Pyx_XDECREF(__pyx_t_1);
  18136. __Pyx_XDECREF(__pyx_t_5);
  18137. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_npy_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18138. __pyx_r = 0;
  18139. __pyx_L0:;
  18140. __Pyx_XGIVEREF(__pyx_r);
  18141. __Pyx_RefNannyFinishContext();
  18142. return __pyx_r;
  18143. }
  18144. 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) {
  18145. size_t __pyx_v_i;
  18146. PyObject *__pyx_r = NULL;
  18147. __Pyx_RefNannyDeclarations
  18148. PyObject *__pyx_t_1 = NULL;
  18149. size_t __pyx_t_2;
  18150. size_t __pyx_t_3;
  18151. size_t __pyx_t_4;
  18152. PyObject *__pyx_t_5 = NULL;
  18153. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  18154. /* "vector.to_py":61
  18155. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18156. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v):
  18157. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18158. *
  18159. *
  18160. */
  18161. __Pyx_XDECREF(__pyx_r);
  18162. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18163. __Pyx_GOTREF(__pyx_t_1);
  18164. __pyx_t_2 = __pyx_v_v.size();
  18165. __pyx_t_3 = __pyx_t_2;
  18166. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18167. __pyx_v_i = __pyx_t_4;
  18168. __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)
  18169. __Pyx_GOTREF(__pyx_t_5);
  18170. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18171. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18172. }
  18173. __pyx_r = __pyx_t_1;
  18174. __pyx_t_1 = 0;
  18175. goto __pyx_L0;
  18176. /* "vector.to_py":60
  18177. *
  18178. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18179. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18180. * return [v[i] for i in range(v.size())]
  18181. *
  18182. */
  18183. /* function exit code */
  18184. __pyx_L1_error:;
  18185. __Pyx_XDECREF(__pyx_t_1);
  18186. __Pyx_XDECREF(__pyx_t_5);
  18187. __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);
  18188. __pyx_r = 0;
  18189. __pyx_L0:;
  18190. __Pyx_XGIVEREF(__pyx_r);
  18191. __Pyx_RefNannyFinishContext();
  18192. return __pyx_r;
  18193. }
  18194. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &__pyx_v_v) {
  18195. size_t __pyx_v_i;
  18196. PyObject *__pyx_r = NULL;
  18197. __Pyx_RefNannyDeclarations
  18198. PyObject *__pyx_t_1 = NULL;
  18199. size_t __pyx_t_2;
  18200. size_t __pyx_t_3;
  18201. size_t __pyx_t_4;
  18202. PyObject *__pyx_t_5 = NULL;
  18203. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0);
  18204. /* "vector.to_py":61
  18205. * @cname("__pyx_convert_vector_to_py_int")
  18206. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v):
  18207. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18208. *
  18209. *
  18210. */
  18211. __Pyx_XDECREF(__pyx_r);
  18212. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18213. __Pyx_GOTREF(__pyx_t_1);
  18214. __pyx_t_2 = __pyx_v_v.size();
  18215. __pyx_t_3 = __pyx_t_2;
  18216. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18217. __pyx_v_i = __pyx_t_4;
  18218. __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)
  18219. __Pyx_GOTREF(__pyx_t_5);
  18220. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18221. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18222. }
  18223. __pyx_r = __pyx_t_1;
  18224. __pyx_t_1 = 0;
  18225. goto __pyx_L0;
  18226. /* "vector.to_py":60
  18227. *
  18228. * @cname("__pyx_convert_vector_to_py_int")
  18229. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<<
  18230. * return [v[i] for i in range(v.size())]
  18231. *
  18232. */
  18233. /* function exit code */
  18234. __pyx_L1_error:;
  18235. __Pyx_XDECREF(__pyx_t_1);
  18236. __Pyx_XDECREF(__pyx_t_5);
  18237. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18238. __pyx_r = 0;
  18239. __pyx_L0:;
  18240. __Pyx_XGIVEREF(__pyx_r);
  18241. __Pyx_RefNannyFinishContext();
  18242. return __pyx_r;
  18243. }
  18244. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &__pyx_v_v) {
  18245. size_t __pyx_v_i;
  18246. PyObject *__pyx_r = NULL;
  18247. __Pyx_RefNannyDeclarations
  18248. PyObject *__pyx_t_1 = NULL;
  18249. size_t __pyx_t_2;
  18250. size_t __pyx_t_3;
  18251. size_t __pyx_t_4;
  18252. PyObject *__pyx_t_5 = NULL;
  18253. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", 0);
  18254. /* "vector.to_py":61
  18255. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18256. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v):
  18257. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18258. *
  18259. *
  18260. */
  18261. __Pyx_XDECREF(__pyx_r);
  18262. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18263. __Pyx_GOTREF(__pyx_t_1);
  18264. __pyx_t_2 = __pyx_v_v.size();
  18265. __pyx_t_3 = __pyx_t_2;
  18266. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18267. __pyx_v_i = __pyx_t_4;
  18268. __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)
  18269. __Pyx_GOTREF(__pyx_t_5);
  18270. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18271. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18272. }
  18273. __pyx_r = __pyx_t_1;
  18274. __pyx_t_1 = 0;
  18275. goto __pyx_L0;
  18276. /* "vector.to_py":60
  18277. *
  18278. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18279. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18280. * return [v[i] for i in range(v.size())]
  18281. *
  18282. */
  18283. /* function exit code */
  18284. __pyx_L1_error:;
  18285. __Pyx_XDECREF(__pyx_t_1);
  18286. __Pyx_XDECREF(__pyx_t_5);
  18287. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18288. __pyx_r = 0;
  18289. __pyx_L0:;
  18290. __Pyx_XGIVEREF(__pyx_r);
  18291. __Pyx_RefNannyFinishContext();
  18292. return __pyx_r;
  18293. }
  18294. 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) {
  18295. size_t __pyx_v_i;
  18296. PyObject *__pyx_r = NULL;
  18297. __Pyx_RefNannyDeclarations
  18298. PyObject *__pyx_t_1 = NULL;
  18299. size_t __pyx_t_2;
  18300. size_t __pyx_t_3;
  18301. size_t __pyx_t_4;
  18302. PyObject *__pyx_t_5 = NULL;
  18303. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", 0);
  18304. /* "vector.to_py":61
  18305. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18306. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v):
  18307. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18308. *
  18309. *
  18310. */
  18311. __Pyx_XDECREF(__pyx_r);
  18312. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18313. __Pyx_GOTREF(__pyx_t_1);
  18314. __pyx_t_2 = __pyx_v_v.size();
  18315. __pyx_t_3 = __pyx_t_2;
  18316. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18317. __pyx_v_i = __pyx_t_4;
  18318. __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)
  18319. __Pyx_GOTREF(__pyx_t_5);
  18320. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18321. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18322. }
  18323. __pyx_r = __pyx_t_1;
  18324. __pyx_t_1 = 0;
  18325. goto __pyx_L0;
  18326. /* "vector.to_py":60
  18327. *
  18328. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18329. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18330. * return [v[i] for i in range(v.size())]
  18331. *
  18332. */
  18333. /* function exit code */
  18334. __pyx_L1_error:;
  18335. __Pyx_XDECREF(__pyx_t_1);
  18336. __Pyx_XDECREF(__pyx_t_5);
  18337. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18338. __pyx_r = 0;
  18339. __pyx_L0:;
  18340. __Pyx_XGIVEREF(__pyx_r);
  18341. __Pyx_RefNannyFinishContext();
  18342. return __pyx_r;
  18343. }
  18344. /* "vector.from_py":45
  18345. *
  18346. * @cname("__pyx_convert_vector_from_py_size_t")
  18347. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18348. * cdef vector[X] v
  18349. * for item in o:
  18350. */
  18351. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *__pyx_v_o) {
  18352. std::vector<size_t> __pyx_v_v;
  18353. PyObject *__pyx_v_item = NULL;
  18354. std::vector<size_t> __pyx_r;
  18355. __Pyx_RefNannyDeclarations
  18356. PyObject *__pyx_t_1 = NULL;
  18357. Py_ssize_t __pyx_t_2;
  18358. PyObject *(*__pyx_t_3)(PyObject *);
  18359. PyObject *__pyx_t_4 = NULL;
  18360. size_t __pyx_t_5;
  18361. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_size_t", 0);
  18362. /* "vector.from_py":47
  18363. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18364. * cdef vector[X] v
  18365. * for item in o: # <<<<<<<<<<<<<<
  18366. * v.push_back(<X>item)
  18367. * return v
  18368. */
  18369. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18370. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18371. __pyx_t_3 = NULL;
  18372. } else {
  18373. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18374. __Pyx_GOTREF(__pyx_t_1);
  18375. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18376. }
  18377. for (;;) {
  18378. if (likely(!__pyx_t_3)) {
  18379. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18380. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18381. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18382. __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)
  18383. #else
  18384. __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)
  18385. __Pyx_GOTREF(__pyx_t_4);
  18386. #endif
  18387. } else {
  18388. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18389. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18390. __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)
  18391. #else
  18392. __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)
  18393. __Pyx_GOTREF(__pyx_t_4);
  18394. #endif
  18395. }
  18396. } else {
  18397. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18398. if (unlikely(!__pyx_t_4)) {
  18399. PyObject* exc_type = PyErr_Occurred();
  18400. if (exc_type) {
  18401. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18402. else __PYX_ERR(1, 47, __pyx_L1_error)
  18403. }
  18404. break;
  18405. }
  18406. __Pyx_GOTREF(__pyx_t_4);
  18407. }
  18408. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18409. __pyx_t_4 = 0;
  18410. /* "vector.from_py":48
  18411. * cdef vector[X] v
  18412. * for item in o:
  18413. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18414. * return v
  18415. *
  18416. */
  18417. __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)
  18418. __pyx_v_v.push_back(((size_t)__pyx_t_5));
  18419. /* "vector.from_py":47
  18420. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18421. * cdef vector[X] v
  18422. * for item in o: # <<<<<<<<<<<<<<
  18423. * v.push_back(<X>item)
  18424. * return v
  18425. */
  18426. }
  18427. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18428. /* "vector.from_py":49
  18429. * for item in o:
  18430. * v.push_back(<X>item)
  18431. * return v # <<<<<<<<<<<<<<
  18432. *
  18433. *
  18434. */
  18435. __pyx_r = __pyx_v_v;
  18436. goto __pyx_L0;
  18437. /* "vector.from_py":45
  18438. *
  18439. * @cname("__pyx_convert_vector_from_py_size_t")
  18440. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18441. * cdef vector[X] v
  18442. * for item in o:
  18443. */
  18444. /* function exit code */
  18445. __pyx_L1_error:;
  18446. __Pyx_XDECREF(__pyx_t_1);
  18447. __Pyx_XDECREF(__pyx_t_4);
  18448. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18449. __Pyx_pretend_to_initialize(&__pyx_r);
  18450. __pyx_L0:;
  18451. __Pyx_XDECREF(__pyx_v_item);
  18452. __Pyx_RefNannyFinishContext();
  18453. return __pyx_r;
  18454. }
  18455. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *__pyx_v_o) {
  18456. std::vector<std::vector<size_t> > __pyx_v_v;
  18457. PyObject *__pyx_v_item = NULL;
  18458. std::vector<std::vector<size_t> > __pyx_r;
  18459. __Pyx_RefNannyDeclarations
  18460. PyObject *__pyx_t_1 = NULL;
  18461. Py_ssize_t __pyx_t_2;
  18462. PyObject *(*__pyx_t_3)(PyObject *);
  18463. PyObject *__pyx_t_4 = NULL;
  18464. std::vector<size_t> __pyx_t_5;
  18465. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18466. /* "vector.from_py":47
  18467. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18468. * cdef vector[X] v
  18469. * for item in o: # <<<<<<<<<<<<<<
  18470. * v.push_back(<X>item)
  18471. * return v
  18472. */
  18473. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18474. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18475. __pyx_t_3 = NULL;
  18476. } else {
  18477. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18478. __Pyx_GOTREF(__pyx_t_1);
  18479. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18480. }
  18481. for (;;) {
  18482. if (likely(!__pyx_t_3)) {
  18483. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18484. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18485. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18486. __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)
  18487. #else
  18488. __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)
  18489. __Pyx_GOTREF(__pyx_t_4);
  18490. #endif
  18491. } else {
  18492. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18493. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18494. __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)
  18495. #else
  18496. __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)
  18497. __Pyx_GOTREF(__pyx_t_4);
  18498. #endif
  18499. }
  18500. } else {
  18501. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18502. if (unlikely(!__pyx_t_4)) {
  18503. PyObject* exc_type = PyErr_Occurred();
  18504. if (exc_type) {
  18505. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18506. else __PYX_ERR(1, 47, __pyx_L1_error)
  18507. }
  18508. break;
  18509. }
  18510. __Pyx_GOTREF(__pyx_t_4);
  18511. }
  18512. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18513. __pyx_t_4 = 0;
  18514. /* "vector.from_py":48
  18515. * cdef vector[X] v
  18516. * for item in o:
  18517. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18518. * return v
  18519. *
  18520. */
  18521. __pyx_t_5 = __pyx_convert_vector_from_py_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18522. __pyx_v_v.push_back(((std::vector<size_t> )__pyx_t_5));
  18523. /* "vector.from_py":47
  18524. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18525. * cdef vector[X] v
  18526. * for item in o: # <<<<<<<<<<<<<<
  18527. * v.push_back(<X>item)
  18528. * return v
  18529. */
  18530. }
  18531. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18532. /* "vector.from_py":49
  18533. * for item in o:
  18534. * v.push_back(<X>item)
  18535. * return v # <<<<<<<<<<<<<<
  18536. *
  18537. *
  18538. */
  18539. __pyx_r = __pyx_v_v;
  18540. goto __pyx_L0;
  18541. /* "vector.from_py":45
  18542. *
  18543. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___")
  18544. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  18545. * cdef vector[X] v
  18546. * for item in o:
  18547. */
  18548. /* function exit code */
  18549. __pyx_L1_error:;
  18550. __Pyx_XDECREF(__pyx_t_1);
  18551. __Pyx_XDECREF(__pyx_t_4);
  18552. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18553. __Pyx_pretend_to_initialize(&__pyx_r);
  18554. __pyx_L0:;
  18555. __Pyx_XDECREF(__pyx_v_item);
  18556. __Pyx_RefNannyFinishContext();
  18557. return __pyx_r;
  18558. }
  18559. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *__pyx_v_o) {
  18560. std::vector<std::vector<double> > __pyx_v_v;
  18561. PyObject *__pyx_v_item = NULL;
  18562. std::vector<std::vector<double> > __pyx_r;
  18563. __Pyx_RefNannyDeclarations
  18564. PyObject *__pyx_t_1 = NULL;
  18565. Py_ssize_t __pyx_t_2;
  18566. PyObject *(*__pyx_t_3)(PyObject *);
  18567. PyObject *__pyx_t_4 = NULL;
  18568. std::vector<double> __pyx_t_5;
  18569. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", 0);
  18570. /* "vector.from_py":47
  18571. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18572. * cdef vector[X] v
  18573. * for item in o: # <<<<<<<<<<<<<<
  18574. * v.push_back(<X>item)
  18575. * return v
  18576. */
  18577. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18578. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18579. __pyx_t_3 = NULL;
  18580. } else {
  18581. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18582. __Pyx_GOTREF(__pyx_t_1);
  18583. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18584. }
  18585. for (;;) {
  18586. if (likely(!__pyx_t_3)) {
  18587. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18588. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18589. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18590. __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)
  18591. #else
  18592. __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)
  18593. __Pyx_GOTREF(__pyx_t_4);
  18594. #endif
  18595. } else {
  18596. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18597. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18598. __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)
  18599. #else
  18600. __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)
  18601. __Pyx_GOTREF(__pyx_t_4);
  18602. #endif
  18603. }
  18604. } else {
  18605. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18606. if (unlikely(!__pyx_t_4)) {
  18607. PyObject* exc_type = PyErr_Occurred();
  18608. if (exc_type) {
  18609. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18610. else __PYX_ERR(1, 47, __pyx_L1_error)
  18611. }
  18612. break;
  18613. }
  18614. __Pyx_GOTREF(__pyx_t_4);
  18615. }
  18616. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18617. __pyx_t_4 = 0;
  18618. /* "vector.from_py":48
  18619. * cdef vector[X] v
  18620. * for item in o:
  18621. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18622. * return v
  18623. *
  18624. */
  18625. __pyx_t_5 = __pyx_convert_vector_from_py_double(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18626. __pyx_v_v.push_back(((std::vector<double> )__pyx_t_5));
  18627. /* "vector.from_py":47
  18628. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18629. * cdef vector[X] v
  18630. * for item in o: # <<<<<<<<<<<<<<
  18631. * v.push_back(<X>item)
  18632. * return v
  18633. */
  18634. }
  18635. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18636. /* "vector.from_py":49
  18637. * for item in o:
  18638. * v.push_back(<X>item)
  18639. * return v # <<<<<<<<<<<<<<
  18640. *
  18641. *
  18642. */
  18643. __pyx_r = __pyx_v_v;
  18644. goto __pyx_L0;
  18645. /* "vector.from_py":45
  18646. *
  18647. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___")
  18648. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *: # <<<<<<<<<<<<<<
  18649. * cdef vector[X] v
  18650. * for item in o:
  18651. */
  18652. /* function exit code */
  18653. __pyx_L1_error:;
  18654. __Pyx_XDECREF(__pyx_t_1);
  18655. __Pyx_XDECREF(__pyx_t_4);
  18656. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18657. __Pyx_pretend_to_initialize(&__pyx_r);
  18658. __pyx_L0:;
  18659. __Pyx_XDECREF(__pyx_v_item);
  18660. __Pyx_RefNannyFinishContext();
  18661. return __pyx_r;
  18662. }
  18663. /* "vector.to_py":60
  18664. *
  18665. * @cname("__pyx_convert_vector_to_py_double")
  18666. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18667. * return [v[i] for i in range(v.size())]
  18668. *
  18669. */
  18670. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &__pyx_v_v) {
  18671. size_t __pyx_v_i;
  18672. PyObject *__pyx_r = NULL;
  18673. __Pyx_RefNannyDeclarations
  18674. PyObject *__pyx_t_1 = NULL;
  18675. size_t __pyx_t_2;
  18676. size_t __pyx_t_3;
  18677. size_t __pyx_t_4;
  18678. PyObject *__pyx_t_5 = NULL;
  18679. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
  18680. /* "vector.to_py":61
  18681. * @cname("__pyx_convert_vector_to_py_double")
  18682. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):
  18683. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18684. *
  18685. *
  18686. */
  18687. __Pyx_XDECREF(__pyx_r);
  18688. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18689. __Pyx_GOTREF(__pyx_t_1);
  18690. __pyx_t_2 = __pyx_v_v.size();
  18691. __pyx_t_3 = __pyx_t_2;
  18692. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18693. __pyx_v_i = __pyx_t_4;
  18694. __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  18695. __Pyx_GOTREF(__pyx_t_5);
  18696. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18697. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18698. }
  18699. __pyx_r = __pyx_t_1;
  18700. __pyx_t_1 = 0;
  18701. goto __pyx_L0;
  18702. /* "vector.to_py":60
  18703. *
  18704. * @cname("__pyx_convert_vector_to_py_double")
  18705. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18706. * return [v[i] for i in range(v.size())]
  18707. *
  18708. */
  18709. /* function exit code */
  18710. __pyx_L1_error:;
  18711. __Pyx_XDECREF(__pyx_t_1);
  18712. __Pyx_XDECREF(__pyx_t_5);
  18713. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18714. __pyx_r = 0;
  18715. __pyx_L0:;
  18716. __Pyx_XGIVEREF(__pyx_r);
  18717. __Pyx_RefNannyFinishContext();
  18718. return __pyx_r;
  18719. }
  18720. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &__pyx_v_v) {
  18721. size_t __pyx_v_i;
  18722. PyObject *__pyx_r = NULL;
  18723. __Pyx_RefNannyDeclarations
  18724. PyObject *__pyx_t_1 = NULL;
  18725. size_t __pyx_t_2;
  18726. size_t __pyx_t_3;
  18727. size_t __pyx_t_4;
  18728. PyObject *__pyx_t_5 = NULL;
  18729. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", 0);
  18730. /* "vector.to_py":61
  18731. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18732. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v):
  18733. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18734. *
  18735. *
  18736. */
  18737. __Pyx_XDECREF(__pyx_r);
  18738. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18739. __Pyx_GOTREF(__pyx_t_1);
  18740. __pyx_t_2 = __pyx_v_v.size();
  18741. __pyx_t_3 = __pyx_t_2;
  18742. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18743. __pyx_v_i = __pyx_t_4;
  18744. __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)
  18745. __Pyx_GOTREF(__pyx_t_5);
  18746. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18747. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18748. }
  18749. __pyx_r = __pyx_t_1;
  18750. __pyx_t_1 = 0;
  18751. goto __pyx_L0;
  18752. /* "vector.to_py":60
  18753. *
  18754. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18755. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18756. * return [v[i] for i in range(v.size())]
  18757. *
  18758. */
  18759. /* function exit code */
  18760. __pyx_L1_error:;
  18761. __Pyx_XDECREF(__pyx_t_1);
  18762. __Pyx_XDECREF(__pyx_t_5);
  18763. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18764. __pyx_r = 0;
  18765. __pyx_L0:;
  18766. __Pyx_XGIVEREF(__pyx_r);
  18767. __Pyx_RefNannyFinishContext();
  18768. return __pyx_r;
  18769. }
  18770. /* "vector.from_py":45
  18771. *
  18772. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18773. * 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 *: # <<<<<<<<<<<<<<
  18774. * cdef vector[X] v
  18775. * for item in o:
  18776. */
  18777. 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) {
  18778. std::vector<std::map<std::string,std::string> > __pyx_v_v;
  18779. PyObject *__pyx_v_item = NULL;
  18780. std::vector<std::map<std::string,std::string> > __pyx_r;
  18781. __Pyx_RefNannyDeclarations
  18782. PyObject *__pyx_t_1 = NULL;
  18783. Py_ssize_t __pyx_t_2;
  18784. PyObject *(*__pyx_t_3)(PyObject *);
  18785. PyObject *__pyx_t_4 = NULL;
  18786. std::map<std::string,std::string> __pyx_t_5;
  18787. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);
  18788. /* "vector.from_py":47
  18789. * 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 *:
  18790. * cdef vector[X] v
  18791. * for item in o: # <<<<<<<<<<<<<<
  18792. * v.push_back(<X>item)
  18793. * return v
  18794. */
  18795. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18796. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18797. __pyx_t_3 = NULL;
  18798. } else {
  18799. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18800. __Pyx_GOTREF(__pyx_t_1);
  18801. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18802. }
  18803. for (;;) {
  18804. if (likely(!__pyx_t_3)) {
  18805. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18806. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18807. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18808. __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)
  18809. #else
  18810. __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)
  18811. __Pyx_GOTREF(__pyx_t_4);
  18812. #endif
  18813. } else {
  18814. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18815. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18816. __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)
  18817. #else
  18818. __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)
  18819. __Pyx_GOTREF(__pyx_t_4);
  18820. #endif
  18821. }
  18822. } else {
  18823. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18824. if (unlikely(!__pyx_t_4)) {
  18825. PyObject* exc_type = PyErr_Occurred();
  18826. if (exc_type) {
  18827. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18828. else __PYX_ERR(1, 47, __pyx_L1_error)
  18829. }
  18830. break;
  18831. }
  18832. __Pyx_GOTREF(__pyx_t_4);
  18833. }
  18834. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18835. __pyx_t_4 = 0;
  18836. /* "vector.from_py":48
  18837. * cdef vector[X] v
  18838. * for item in o:
  18839. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18840. * return v
  18841. *
  18842. */
  18843. __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)
  18844. __pyx_v_v.push_back(((std::map<std::string,std::string> )__pyx_t_5));
  18845. /* "vector.from_py":47
  18846. * 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 *:
  18847. * cdef vector[X] v
  18848. * for item in o: # <<<<<<<<<<<<<<
  18849. * v.push_back(<X>item)
  18850. * return v
  18851. */
  18852. }
  18853. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18854. /* "vector.from_py":49
  18855. * for item in o:
  18856. * v.push_back(<X>item)
  18857. * return v # <<<<<<<<<<<<<<
  18858. *
  18859. *
  18860. */
  18861. __pyx_r = __pyx_v_v;
  18862. goto __pyx_L0;
  18863. /* "vector.from_py":45
  18864. *
  18865. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18866. * 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 *: # <<<<<<<<<<<<<<
  18867. * cdef vector[X] v
  18868. * for item in o:
  18869. */
  18870. /* function exit code */
  18871. __pyx_L1_error:;
  18872. __Pyx_XDECREF(__pyx_t_1);
  18873. __Pyx_XDECREF(__pyx_t_4);
  18874. __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);
  18875. __Pyx_pretend_to_initialize(&__pyx_r);
  18876. __pyx_L0:;
  18877. __Pyx_XDECREF(__pyx_v_item);
  18878. __Pyx_RefNannyFinishContext();
  18879. return __pyx_r;
  18880. }
  18881. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  18882. PyObject *o;
  18883. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  18884. o = (*t->tp_alloc)(t, 0);
  18885. } else {
  18886. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  18887. }
  18888. if (unlikely(!o)) return 0;
  18889. if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  18890. return o;
  18891. bad:
  18892. Py_DECREF(o); o = 0;
  18893. return NULL;
  18894. }
  18895. static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) {
  18896. #if CYTHON_USE_TP_FINALIZE
  18897. 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))) {
  18898. if (PyObject_CallFinalizerFromDealloc(o)) return;
  18899. }
  18900. #endif
  18901. {
  18902. PyObject *etype, *eval, *etb;
  18903. PyErr_Fetch(&etype, &eval, &etb);
  18904. ++Py_REFCNT(o);
  18905. __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o);
  18906. --Py_REFCNT(o);
  18907. PyErr_Restore(etype, eval, etb);
  18908. }
  18909. (*Py_TYPE(o)->tp_free)(o);
  18910. }
  18911. static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = {
  18912. {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized},
  18913. {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env},
  18914. {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs},
  18915. {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids},
  18916. {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids},
  18917. {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class},
  18918. {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name},
  18919. {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph},
  18920. {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node},
  18921. {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge},
  18922. {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge},
  18923. {"clear_graph", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph},
  18924. {"get_graph_internal_id", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id},
  18925. {"get_graph_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes},
  18926. {"get_graph_num_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_32get_graph_num_edges},
  18927. {"get_original_node_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_34get_original_node_ids},
  18928. {"get_graph_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_36get_graph_node_labels},
  18929. {"get_graph_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_38get_graph_edges},
  18930. {"get_graph_adjacence_matrix", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix},
  18931. {"set_edit_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_42set_edit_cost},
  18932. {"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},
  18933. {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_47init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_46init},
  18934. {"set_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_49set_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_48set_method},
  18935. {"init_method", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_51init_method, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_50init_method},
  18936. {"get_init_time", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_52get_init_time},
  18937. {"run_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_55run_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_54run_method},
  18938. {"get_upper_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_56get_upper_bound},
  18939. {"get_lower_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_58get_lower_bound},
  18940. {"get_forward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_60get_forward_map},
  18941. {"get_backward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_62get_backward_map},
  18942. {"get_node_image", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_64get_node_image},
  18943. {"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},
  18944. {"get_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_68get_induced_cost},
  18945. {"get_node_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map},
  18946. {"get_assignment_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_72get_assignment_matrix},
  18947. {"get_all_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_74get_all_map},
  18948. {"get_runtime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_76get_runtime},
  18949. {"quasimetric_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_78quasimetric_cost},
  18950. {"hungarian_LSAP", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_80hungarian_LSAP},
  18951. {"hungarian_LSAPE", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_82hungarian_LSAPE},
  18952. {"add_random_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_84add_random_graph},
  18953. {"add_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_86add_nx_graph},
  18954. {"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},
  18955. {"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},
  18956. {"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},
  18957. {"get_num_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_94get_num_node_labels},
  18958. {"get_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_96get_node_label},
  18959. {"get_num_edge_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_98get_num_edge_labels},
  18960. {"get_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_100get_edge_label},
  18961. {"get_avg_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_102get_avg_num_nodes},
  18962. {"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},
  18963. {"get_node_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_106get_node_del_cost},
  18964. {"get_node_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_108get_node_ins_cost},
  18965. {"get_median_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_110get_median_node_label},
  18966. {"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},
  18967. {"get_edge_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_114get_edge_del_cost},
  18968. {"get_edge_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_116get_edge_ins_cost},
  18969. {"get_median_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_118get_median_edge_label},
  18970. {"get_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_120get_nx_graph},
  18971. {"get_init_type", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_122get_init_type},
  18972. {"load_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_124load_nx_graph},
  18973. {"compute_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost},
  18974. {"__reduce_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__, METH_NOARGS, 0},
  18975. {"__setstate_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__, METH_O, 0},
  18976. {0, 0, 0, 0}
  18977. };
  18978. static PyTypeObject __pyx_type_8gedlibpy_GEDEnv = {
  18979. PyVarObject_HEAD_INIT(0, 0)
  18980. "gedlibpy.GEDEnv", /*tp_name*/
  18981. sizeof(struct __pyx_obj_8gedlibpy_GEDEnv), /*tp_basicsize*/
  18982. 0, /*tp_itemsize*/
  18983. __pyx_tp_dealloc_8gedlibpy_GEDEnv, /*tp_dealloc*/
  18984. #if PY_VERSION_HEX < 0x030800b4
  18985. 0, /*tp_print*/
  18986. #endif
  18987. #if PY_VERSION_HEX >= 0x030800b4
  18988. 0, /*tp_vectorcall_offset*/
  18989. #endif
  18990. 0, /*tp_getattr*/
  18991. 0, /*tp_setattr*/
  18992. #if PY_MAJOR_VERSION < 3
  18993. 0, /*tp_compare*/
  18994. #endif
  18995. #if PY_MAJOR_VERSION >= 3
  18996. 0, /*tp_as_async*/
  18997. #endif
  18998. 0, /*tp_repr*/
  18999. 0, /*tp_as_number*/
  19000. 0, /*tp_as_sequence*/
  19001. 0, /*tp_as_mapping*/
  19002. 0, /*tp_hash*/
  19003. 0, /*tp_call*/
  19004. 0, /*tp_str*/
  19005. 0, /*tp_getattro*/
  19006. 0, /*tp_setattro*/
  19007. 0, /*tp_as_buffer*/
  19008. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  19009. "Cython wrapper class for C++ class PyGEDEnv\n\t", /*tp_doc*/
  19010. 0, /*tp_traverse*/
  19011. 0, /*tp_clear*/
  19012. 0, /*tp_richcompare*/
  19013. 0, /*tp_weaklistoffset*/
  19014. 0, /*tp_iter*/
  19015. 0, /*tp_iternext*/
  19016. __pyx_methods_8gedlibpy_GEDEnv, /*tp_methods*/
  19017. 0, /*tp_members*/
  19018. 0, /*tp_getset*/
  19019. 0, /*tp_base*/
  19020. 0, /*tp_dict*/
  19021. 0, /*tp_descr_get*/
  19022. 0, /*tp_descr_set*/
  19023. 0, /*tp_dictoffset*/
  19024. 0, /*tp_init*/
  19025. 0, /*tp_alloc*/
  19026. __pyx_tp_new_8gedlibpy_GEDEnv, /*tp_new*/
  19027. 0, /*tp_free*/
  19028. 0, /*tp_is_gc*/
  19029. 0, /*tp_bases*/
  19030. 0, /*tp_mro*/
  19031. 0, /*tp_cache*/
  19032. 0, /*tp_subclasses*/
  19033. 0, /*tp_weaklist*/
  19034. 0, /*tp_del*/
  19035. 0, /*tp_version_tag*/
  19036. #if PY_VERSION_HEX >= 0x030400a1
  19037. 0, /*tp_finalize*/
  19038. #endif
  19039. #if PY_VERSION_HEX >= 0x030800b1
  19040. 0, /*tp_vectorcall*/
  19041. #endif
  19042. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  19043. 0, /*tp_print*/
  19044. #endif
  19045. };
  19046. static PyMethodDef __pyx_methods[] = {
  19047. {0, 0, 0, 0}
  19048. };
  19049. static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  19050. static const char* internal_type_names[] = {
  19051. "GEDEnv",
  19052. "PyGEDEnv",
  19053. "UINT32_t",
  19054. "X",
  19055. "Y",
  19056. "__pyx_ctuple_1ac95__89cad__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",
  19057. "__pyx_ctuple_1ac95__89cad__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",
  19058. "__pyx_ctuple_Py_ssize_t",
  19059. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t",
  19060. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t_struct",
  19061. "__pyx_ctuple_Py_ssize_t_struct",
  19062. "__pyx_ctuple_double",
  19063. "__pyx_ctuple_double_struct",
  19064. "__pyx_ctuple_size_t",
  19065. "__pyx_ctuple_size_t__space___const___and_size_t__space___const_",
  19066. "__pyx_ctuple_size_t__space___const___and_size_t__space___const__struct",
  19067. "__pyx_ctuple_size_t_struct",
  19068. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng",
  19069. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng_struct",
  19070. "bool",
  19071. "list",
  19072. "map",
  19073. "pair",
  19074. "string",
  19075. "vector",
  19076. 0
  19077. };
  19078. const char** type_name = internal_type_names;
  19079. while (*type_name) {
  19080. if (__Pyx_StrEq(name, *type_name)) {
  19081. PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
  19082. goto bad;
  19083. }
  19084. type_name++;
  19085. }
  19086. if (0);
  19087. else {
  19088. if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  19089. }
  19090. return 0;
  19091. bad:
  19092. return -1;
  19093. }
  19094. static int
  19095. __Pyx_import_all_from(PyObject *locals, PyObject *v)
  19096. {
  19097. PyObject *all = PyObject_GetAttrString(v, "__all__");
  19098. PyObject *dict, *name, *value;
  19099. int skip_leading_underscores = 0;
  19100. int pos, err;
  19101. if (all == NULL) {
  19102. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19103. return -1;
  19104. PyErr_Clear();
  19105. dict = PyObject_GetAttrString(v, "__dict__");
  19106. if (dict == NULL) {
  19107. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19108. return -1;
  19109. PyErr_SetString(PyExc_ImportError,
  19110. "from-import-* object has no __dict__ and no __all__");
  19111. return -1;
  19112. }
  19113. #if PY_MAJOR_VERSION < 3
  19114. all = PyObject_CallMethod(dict, (char *)"keys", NULL);
  19115. #else
  19116. all = PyMapping_Keys(dict);
  19117. #endif
  19118. Py_DECREF(dict);
  19119. if (all == NULL)
  19120. return -1;
  19121. skip_leading_underscores = 1;
  19122. }
  19123. for (pos = 0, err = 0; ; pos++) {
  19124. name = PySequence_GetItem(all, pos);
  19125. if (name == NULL) {
  19126. if (!PyErr_ExceptionMatches(PyExc_IndexError))
  19127. err = -1;
  19128. else
  19129. PyErr_Clear();
  19130. break;
  19131. }
  19132. if (skip_leading_underscores &&
  19133. #if PY_MAJOR_VERSION < 3
  19134. PyString_Check(name) &&
  19135. PyString_AS_STRING(name)[0] == '_')
  19136. #else
  19137. PyUnicode_Check(name) &&
  19138. PyUnicode_AS_UNICODE(name)[0] == '_')
  19139. #endif
  19140. {
  19141. Py_DECREF(name);
  19142. continue;
  19143. }
  19144. value = PyObject_GetAttr(v, name);
  19145. if (value == NULL)
  19146. err = -1;
  19147. else if (PyDict_CheckExact(locals))
  19148. err = PyDict_SetItem(locals, name, value);
  19149. else
  19150. err = PyObject_SetItem(locals, name, value);
  19151. Py_DECREF(name);
  19152. Py_XDECREF(value);
  19153. if (err != 0)
  19154. break;
  19155. }
  19156. Py_DECREF(all);
  19157. return err;
  19158. }
  19159. static int __pyx_import_star(PyObject* m) {
  19160. int i;
  19161. int ret = -1;
  19162. char* s;
  19163. PyObject *locals = 0;
  19164. PyObject *list = 0;
  19165. #if PY_MAJOR_VERSION >= 3
  19166. PyObject *utf8_name = 0;
  19167. #endif
  19168. PyObject *name;
  19169. PyObject *item;
  19170. locals = PyDict_New(); if (!locals) goto bad;
  19171. if (__Pyx_import_all_from(locals, m) < 0) goto bad;
  19172. list = PyDict_Items(locals); if (!list) goto bad;
  19173. for(i=0; i<PyList_GET_SIZE(list); i++) {
  19174. name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
  19175. item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
  19176. #if PY_MAJOR_VERSION >= 3
  19177. utf8_name = PyUnicode_AsUTF8String(name);
  19178. if (!utf8_name) goto bad;
  19179. s = PyBytes_AS_STRING(utf8_name);
  19180. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19181. Py_DECREF(utf8_name); utf8_name = 0;
  19182. #else
  19183. s = PyString_AsString(name);
  19184. if (!s) goto bad;
  19185. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19186. #endif
  19187. }
  19188. ret = 0;
  19189. bad:
  19190. Py_XDECREF(locals);
  19191. Py_XDECREF(list);
  19192. #if PY_MAJOR_VERSION >= 3
  19193. Py_XDECREF(utf8_name);
  19194. #endif
  19195. return ret;
  19196. }
  19197. #if PY_MAJOR_VERSION >= 3
  19198. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19199. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  19200. static int __pyx_pymod_exec_gedlibpy(PyObject* module); /*proto*/
  19201. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  19202. {Py_mod_create, (void*)__pyx_pymod_create},
  19203. {Py_mod_exec, (void*)__pyx_pymod_exec_gedlibpy},
  19204. {0, NULL}
  19205. };
  19206. #endif
  19207. static struct PyModuleDef __pyx_moduledef = {
  19208. PyModuleDef_HEAD_INIT,
  19209. "gedlibpy",
  19210. __pyx_k_Python_GedLib_module_This_modul, /* m_doc */
  19211. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19212. 0, /* m_size */
  19213. #else
  19214. -1, /* m_size */
  19215. #endif
  19216. __pyx_methods /* m_methods */,
  19217. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19218. __pyx_moduledef_slots, /* m_slots */
  19219. #else
  19220. NULL, /* m_reload */
  19221. #endif
  19222. NULL, /* m_traverse */
  19223. NULL, /* m_clear */
  19224. NULL /* m_free */
  19225. };
  19226. #endif
  19227. #ifndef CYTHON_SMALL_CODE
  19228. #if defined(__clang__)
  19229. #define CYTHON_SMALL_CODE
  19230. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  19231. #define CYTHON_SMALL_CODE __attribute__((cold))
  19232. #else
  19233. #define CYTHON_SMALL_CODE
  19234. #endif
  19235. #endif
  19236. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  19237. {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  19238. {&__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},
  19239. {&__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},
  19240. {&__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},
  19241. {&__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},
  19242. {&__pyx_kp_u_Computation_between_graph, __pyx_k_Computation_between_graph, sizeof(__pyx_k_Computation_between_graph), 0, 1, 0, 0},
  19243. {&__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES, __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES, sizeof(__pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES), 0, 1, 0, 1},
  19244. {&__pyx_n_s_EditCostError, __pyx_k_EditCostError, sizeof(__pyx_k_EditCostError), 0, 0, 1, 1},
  19245. {&__pyx_n_s_EditCostError___init, __pyx_k_EditCostError___init, sizeof(__pyx_k_EditCostError___init), 0, 0, 1, 1},
  19246. {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
  19247. {&__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},
  19248. {&__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},
  19249. {&__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},
  19250. {&__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},
  19251. {&__pyx_n_s_GEDEnv, __pyx_k_GEDEnv, sizeof(__pyx_k_GEDEnv), 0, 0, 1, 1},
  19252. {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  19253. {&__pyx_kp_u_Graphs_loaded, __pyx_k_Graphs_loaded, sizeof(__pyx_k_Graphs_loaded), 0, 1, 0, 0},
  19254. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  19255. {&__pyx_n_s_InitError, __pyx_k_InitError, sizeof(__pyx_k_InitError), 0, 0, 1, 1},
  19256. {&__pyx_n_s_InitError___init, __pyx_k_InitError___init, sizeof(__pyx_k_InitError___init), 0, 0, 1, 1},
  19257. {&__pyx_kp_u_Initialization_in_progress, __pyx_k_Initialization_in_progress, sizeof(__pyx_k_Initialization_in_progress), 0, 1, 0, 0},
  19258. {&__pyx_kp_u_Initialization_terminated, __pyx_k_Initialization_terminated, sizeof(__pyx_k_Initialization_terminated), 0, 1, 0, 0},
  19259. {&__pyx_n_s_LoadLibrary, __pyx_k_LoadLibrary, sizeof(__pyx_k_LoadLibrary), 0, 0, 1, 1},
  19260. {&__pyx_kp_u_Loading_graphs_in_progress, __pyx_k_Loading_graphs_in_progress, sizeof(__pyx_k_Loading_graphs_in_progress), 0, 1, 0, 0},
  19261. {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  19262. {&__pyx_n_s_MethodError, __pyx_k_MethodError, sizeof(__pyx_k_MethodError), 0, 0, 1, 1},
  19263. {&__pyx_n_s_MethodError___init, __pyx_k_MethodError___init, sizeof(__pyx_k_MethodError___init), 0, 0, 1, 1},
  19264. {&__pyx_n_s_NodeMap, __pyx_k_NodeMap, sizeof(__pyx_k_NodeMap), 0, 0, 1, 1},
  19265. {&__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},
  19266. {&__pyx_kp_u_Number_of_graphs, __pyx_k_Number_of_graphs, sizeof(__pyx_k_Number_of_graphs), 0, 1, 0, 0},
  19267. {&__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},
  19268. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  19269. {&__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},
  19270. {&__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},
  19271. {&__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},
  19272. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  19273. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  19274. {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1},
  19275. {&__pyx_n_s_add_assignment, __pyx_k_add_assignment, sizeof(__pyx_k_add_assignment), 0, 0, 1, 1},
  19276. {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1},
  19277. {&__pyx_n_s_add_graph, __pyx_k_add_graph, sizeof(__pyx_k_add_graph), 0, 0, 1, 1},
  19278. {&__pyx_n_s_add_node, __pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 0, 1, 1},
  19279. {&__pyx_n_s_add_nx_graph, __pyx_k_add_nx_graph, sizeof(__pyx_k_add_nx_graph), 0, 0, 1, 1},
  19280. {&__pyx_n_s_adj_lists, __pyx_k_adj_lists, sizeof(__pyx_k_adj_lists), 0, 0, 1, 1},
  19281. {&__pyx_n_s_adj_matrix, __pyx_k_adj_matrix, sizeof(__pyx_k_adj_matrix), 0, 0, 1, 1},
  19282. {&__pyx_n_s_cdll, __pyx_k_cdll, sizeof(__pyx_k_cdll), 0, 0, 1, 1},
  19283. {&__pyx_n_s_classe, __pyx_k_classe, sizeof(__pyx_k_classe), 0, 0, 1, 1},
  19284. {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1},
  19285. {&__pyx_n_s_clear_graph, __pyx_k_clear_graph, sizeof(__pyx_k_clear_graph), 0, 0, 1, 1},
  19286. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  19287. {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  19288. {&__pyx_n_s_dataset, __pyx_k_dataset, sizeof(__pyx_k_dataset), 0, 0, 1, 1},
  19289. {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  19290. {&__pyx_n_s_decode_graph_edges, __pyx_k_decode_graph_edges, sizeof(__pyx_k_decode_graph_edges), 0, 0, 1, 1},
  19291. {&__pyx_n_s_decode_your_map, __pyx_k_decode_your_map, sizeof(__pyx_k_decode_your_map), 0, 0, 1, 1},
  19292. {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  19293. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  19294. {&__pyx_n_s_edge_label, __pyx_k_edge_label, sizeof(__pyx_k_edge_label), 0, 0, 1, 1},
  19295. {&__pyx_n_s_edge_label_1, __pyx_k_edge_label_1, sizeof(__pyx_k_edge_label_1), 0, 0, 1, 1},
  19296. {&__pyx_n_s_edge_label_2, __pyx_k_edge_label_2, sizeof(__pyx_k_edge_label_2), 0, 0, 1, 1},
  19297. {&__pyx_n_s_edge_label_b, __pyx_k_edge_label_b, sizeof(__pyx_k_edge_label_b), 0, 0, 1, 1},
  19298. {&__pyx_n_s_edge_list, __pyx_k_edge_list, sizeof(__pyx_k_edge_list), 0, 0, 1, 1},
  19299. {&__pyx_n_s_edge_type, __pyx_k_edge_type, sizeof(__pyx_k_edge_type), 0, 0, 1, 1},
  19300. {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  19301. {&__pyx_n_s_edit_cost, __pyx_k_edit_cost, sizeof(__pyx_k_edit_cost), 0, 0, 1, 1},
  19302. {&__pyx_n_s_edit_cost_constant, __pyx_k_edit_cost_constant, sizeof(__pyx_k_edit_cost_constant), 0, 0, 1, 1},
  19303. {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  19304. {&__pyx_n_s_encode_your_map, __pyx_k_encode_your_map, sizeof(__pyx_k_encode_your_map), 0, 0, 1, 1},
  19305. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  19306. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  19307. {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1},
  19308. {&__pyx_n_s_g2, __pyx_k_g2, sizeof(__pyx_k_g2), 0, 0, 1, 1},
  19309. {&__pyx_n_s_g_id, __pyx_k_g_id, sizeof(__pyx_k_g_id), 0, 0, 1, 1},
  19310. {&__pyx_n_s_gedlibpy, __pyx_k_gedlibpy, sizeof(__pyx_k_gedlibpy), 0, 0, 1, 1},
  19311. {&__pyx_kp_s_gedlibpy_pyx, __pyx_k_gedlibpy_pyx, sizeof(__pyx_k_gedlibpy_pyx), 0, 0, 1, 0},
  19312. {&__pyx_n_s_get_dummy_node, __pyx_k_get_dummy_node, sizeof(__pyx_k_get_dummy_node), 0, 0, 1, 1},
  19313. {&__pyx_n_s_get_edge_data, __pyx_k_get_edge_data, sizeof(__pyx_k_get_edge_data), 0, 0, 1, 1},
  19314. {&__pyx_n_s_get_edit_cost_options, __pyx_k_get_edit_cost_options, sizeof(__pyx_k_get_edit_cost_options), 0, 0, 1, 1},
  19315. {&__pyx_n_s_get_graph_edges, __pyx_k_get_graph_edges, sizeof(__pyx_k_get_graph_edges), 0, 0, 1, 1},
  19316. {&__pyx_n_s_get_graph_node_labels, __pyx_k_get_graph_node_labels, sizeof(__pyx_k_get_graph_node_labels), 0, 0, 1, 1},
  19317. {&__pyx_n_s_get_graph_num_nodes, __pyx_k_get_graph_num_nodes, sizeof(__pyx_k_get_graph_num_nodes), 0, 0, 1, 1},
  19318. {&__pyx_n_s_get_init_options, __pyx_k_get_init_options, sizeof(__pyx_k_get_init_options), 0, 0, 1, 1},
  19319. {&__pyx_n_s_get_method_options, __pyx_k_get_method_options, sizeof(__pyx_k_get_method_options), 0, 0, 1, 1},
  19320. {&__pyx_n_s_get_node_map, __pyx_k_get_node_map, sizeof(__pyx_k_get_node_map), 0, 0, 1, 1},
  19321. {&__pyx_n_s_get_original_node_ids, __pyx_k_get_original_node_ids, sizeof(__pyx_k_get_original_node_ids), 0, 0, 1, 1},
  19322. {&__pyx_n_s_get_upper_bound, __pyx_k_get_upper_bound, sizeof(__pyx_k_get_upper_bound), 0, 0, 1, 1},
  19323. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  19324. {&__pyx_n_s_gklearn_ged_env, __pyx_k_gklearn_ged_env, sizeof(__pyx_k_gklearn_ged_env), 0, 0, 1, 1},
  19325. {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
  19326. {&__pyx_n_s_graph_class, __pyx_k_graph_class, sizeof(__pyx_k_graph_class), 0, 0, 1, 1},
  19327. {&__pyx_n_s_graph_id, __pyx_k_graph_id, sizeof(__pyx_k_graph_id), 0, 0, 1, 1},
  19328. {&__pyx_n_s_graph_ids, __pyx_k_graph_ids, sizeof(__pyx_k_graph_ids), 0, 0, 1, 1},
  19329. {&__pyx_n_s_graph_name, __pyx_k_graph_name, sizeof(__pyx_k_graph_name), 0, 0, 1, 1},
  19330. {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  19331. {&__pyx_n_s_h_id, __pyx_k_h_id, sizeof(__pyx_k_h_id), 0, 0, 1, 1},
  19332. {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
  19333. {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
  19334. {&__pyx_n_s_ignore_duplicates, __pyx_k_ignore_duplicates, sizeof(__pyx_k_ignore_duplicates), 0, 0, 1, 1},
  19335. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  19336. {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  19337. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  19338. {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  19339. {&__pyx_n_s_init_method, __pyx_k_init_method, sizeof(__pyx_k_init_method), 0, 0, 1, 1},
  19340. {&__pyx_n_s_init_option, __pyx_k_init_option, sizeof(__pyx_k_init_option), 0, 0, 1, 1},
  19341. {&__pyx_n_s_is_initialized, __pyx_k_is_initialized, sizeof(__pyx_k_is_initialized), 0, 0, 1, 1},
  19342. {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  19343. {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  19344. {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  19345. {&__pyx_n_s_lib1, __pyx_k_lib1, sizeof(__pyx_k_lib1), 0, 0, 1, 1},
  19346. {&__pyx_n_s_lib2, __pyx_k_lib2, sizeof(__pyx_k_lib2), 0, 0, 1, 1},
  19347. {&__pyx_n_s_lib3, __pyx_k_lib3, sizeof(__pyx_k_lib3), 0, 0, 1, 1},
  19348. {&__pyx_n_s_lib4, __pyx_k_lib4, sizeof(__pyx_k_lib4), 0, 0, 1, 1},
  19349. {&__pyx_kp_u_lib_fann_libdoublefann_so, __pyx_k_lib_fann_libdoublefann_so, sizeof(__pyx_k_lib_fann_libdoublefann_so), 0, 1, 0, 0},
  19350. {&__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},
  19351. {&__pyx_kp_u_lib_nomad_libnomad_so, __pyx_k_lib_nomad_libnomad_so, sizeof(__pyx_k_lib_nomad_libnomad_so), 0, 1, 0, 0},
  19352. {&__pyx_kp_u_lib_nomad_libsgtelib_so, __pyx_k_lib_nomad_libsgtelib_so, sizeof(__pyx_k_lib_nomad_libsgtelib_so), 0, 1, 0, 0},
  19353. {&__pyx_n_s_list_of_edges, __pyx_k_list_of_edges, sizeof(__pyx_k_list_of_edges), 0, 0, 1, 1},
  19354. {&__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},
  19355. {&__pyx_n_s_list_of_init_options, __pyx_k_list_of_init_options, sizeof(__pyx_k_list_of_init_options), 0, 0, 1, 1},
  19356. {&__pyx_n_s_list_of_method_options, __pyx_k_list_of_method_options, sizeof(__pyx_k_list_of_method_options), 0, 0, 1, 1},
  19357. {&__pyx_n_s_list_of_nodes, __pyx_k_list_of_nodes, sizeof(__pyx_k_list_of_nodes), 0, 0, 1, 1},
  19358. {&__pyx_n_s_load_GXL_graphs, __pyx_k_load_GXL_graphs, sizeof(__pyx_k_load_GXL_graphs), 0, 0, 1, 1},
  19359. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  19360. {&__pyx_n_s_map_b, __pyx_k_map_b, sizeof(__pyx_k_map_b), 0, 0, 1, 1},
  19361. {&__pyx_n_s_map_edge_b, __pyx_k_map_edge_b, sizeof(__pyx_k_map_edge_b), 0, 0, 1, 1},
  19362. {&__pyx_n_s_map_edges, __pyx_k_map_edges, sizeof(__pyx_k_map_edges), 0, 0, 1, 1},
  19363. {&__pyx_n_s_map_u, __pyx_k_map_u, sizeof(__pyx_k_map_u), 0, 0, 1, 1},
  19364. {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  19365. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  19366. {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  19367. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  19368. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  19369. {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  19370. {&__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},
  19371. {&__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},
  19372. {&__pyx_n_s_networkx, __pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 0, 1, 1},
  19373. {&__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},
  19374. {&__pyx_n_s_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1},
  19375. {&__pyx_n_s_node_label, __pyx_k_node_label, sizeof(__pyx_k_node_label), 0, 0, 1, 1},
  19376. {&__pyx_n_s_node_label_1, __pyx_k_node_label_1, sizeof(__pyx_k_node_label_1), 0, 0, 1, 1},
  19377. {&__pyx_n_s_node_label_2, __pyx_k_node_label_2, sizeof(__pyx_k_node_label_2), 0, 0, 1, 1},
  19378. {&__pyx_n_s_node_map, __pyx_k_node_map, sizeof(__pyx_k_node_map), 0, 0, 1, 1},
  19379. {&__pyx_n_s_node_type, __pyx_k_node_type, sizeof(__pyx_k_node_type), 0, 0, 1, 1},
  19380. {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  19381. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  19382. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  19383. {&__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},
  19384. {&__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},
  19385. {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
  19386. {&__pyx_n_s_nx_graph, __pyx_k_nx_graph, sizeof(__pyx_k_nx_graph), 0, 0, 1, 1},
  19387. {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
  19388. {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  19389. {&__pyx_n_u_original_node_ids, __pyx_k_original_node_ids, sizeof(__pyx_k_original_node_ids), 0, 1, 0, 1},
  19390. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  19391. {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  19392. {&__pyx_n_s_path_XML, __pyx_k_path_XML, sizeof(__pyx_k_path_XML), 0, 0, 1, 1},
  19393. {&__pyx_n_s_path_folder, __pyx_k_path_folder, sizeof(__pyx_k_path_folder), 0, 0, 1, 1},
  19394. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  19395. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  19396. {&__pyx_n_s_print_to_stdout, __pyx_k_print_to_stdout, sizeof(__pyx_k_print_to_stdout), 0, 0, 1, 1},
  19397. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  19398. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  19399. {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1},
  19400. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  19401. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  19402. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  19403. {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  19404. {&__pyx_n_s_restart_env, __pyx_k_restart_env, sizeof(__pyx_k_restart_env), 0, 0, 1, 1},
  19405. {&__pyx_n_s_run_method, __pyx_k_run_method, sizeof(__pyx_k_run_method), 0, 0, 1, 1},
  19406. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  19407. {&__pyx_n_s_set_edit_cost, __pyx_k_set_edit_cost, sizeof(__pyx_k_set_edit_cost), 0, 0, 1, 1},
  19408. {&__pyx_n_s_set_induced_cost, __pyx_k_set_induced_cost, sizeof(__pyx_k_set_induced_cost), 0, 0, 1, 1},
  19409. {&__pyx_n_s_set_method, __pyx_k_set_method, sizeof(__pyx_k_set_method), 0, 0, 1, 1},
  19410. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  19411. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  19412. {&__pyx_n_s_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 0, 1, 1},
  19413. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  19414. {&__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},
  19415. {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  19416. {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  19417. {&__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},
  19418. {0, 0, 0, 0, 0, 0, 0}
  19419. };
  19420. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  19421. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 750, __pyx_L1_error)
  19422. __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 977, __pyx_L1_error)
  19423. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  19424. __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
  19425. __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
  19426. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
  19427. __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 109, __pyx_L1_error)
  19428. return 0;
  19429. __pyx_L1_error:;
  19430. return -1;
  19431. }
  19432. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  19433. __Pyx_RefNannyDeclarations
  19434. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  19435. /* "gedlibpy.pyx":977
  19436. * self.restart_env()
  19437. *
  19438. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  19439. * for graph in dataset :
  19440. * self.add_nx_graph(graph, classes)
  19441. */
  19442. __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)
  19443. __Pyx_GOTREF(__pyx_tuple__4);
  19444. __Pyx_GIVEREF(__pyx_tuple__4);
  19445. /* "gedlibpy.pyx":981
  19446. * self.add_nx_graph(graph, classes)
  19447. * listID = self.graph_ids()
  19448. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  19449. * print("Number of graphs = " + str(listID[1]))
  19450. *
  19451. */
  19452. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 981, __pyx_L1_error)
  19453. __Pyx_GOTREF(__pyx_tuple__5);
  19454. __Pyx_GIVEREF(__pyx_tuple__5);
  19455. /* "gedlibpy.pyx":985
  19456. *
  19457. * self.set_edit_cost(edit_cost)
  19458. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  19459. * self.init(init_option)
  19460. * print("Initialization terminated !")
  19461. */
  19462. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 985, __pyx_L1_error)
  19463. __Pyx_GOTREF(__pyx_tuple__6);
  19464. __Pyx_GIVEREF(__pyx_tuple__6);
  19465. /* "gedlibpy.pyx":987
  19466. * print("Initialization in progress...")
  19467. * self.init(init_option)
  19468. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  19469. *
  19470. * self.set_method(method, options)
  19471. */
  19472. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 987, __pyx_L1_error)
  19473. __Pyx_GOTREF(__pyx_tuple__7);
  19474. __Pyx_GIVEREF(__pyx_tuple__7);
  19475. /* "gedlibpy.pyx":1002
  19476. * resMapping[g][h] = self.get_node_map(g, h)
  19477. *
  19478. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  19479. * return resDistance, resMapping
  19480. *
  19481. */
  19482. __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)
  19483. __Pyx_GOTREF(__pyx_tuple__8);
  19484. __Pyx_GIVEREF(__pyx_tuple__8);
  19485. /* "gedlibpy.pyx":1057
  19486. * #return res
  19487. *
  19488. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  19489. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  19490. * return listID
  19491. */
  19492. __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)
  19493. __Pyx_GOTREF(__pyx_tuple__9);
  19494. __Pyx_GIVEREF(__pyx_tuple__9);
  19495. /* "gedlibpy.pyx":1058
  19496. *
  19497. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  19498. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  19499. * return listID
  19500. *
  19501. */
  19502. __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)
  19503. __Pyx_GOTREF(__pyx_tuple__10);
  19504. __Pyx_GIVEREF(__pyx_tuple__10);
  19505. /* "(tree fragment)":2
  19506. * def __reduce_cython__(self):
  19507. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19508. * def __setstate_cython__(self, __pyx_state):
  19509. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19510. */
  19511. __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)
  19512. __Pyx_GOTREF(__pyx_tuple__11);
  19513. __Pyx_GIVEREF(__pyx_tuple__11);
  19514. /* "(tree fragment)":4
  19515. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19516. * def __setstate_cython__(self, __pyx_state):
  19517. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19518. */
  19519. __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)
  19520. __Pyx_GOTREF(__pyx_tuple__12);
  19521. __Pyx_GIVEREF(__pyx_tuple__12);
  19522. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  19523. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  19524. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  19525. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  19526. *
  19527. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19528. */
  19529. __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)
  19530. __Pyx_GOTREF(__pyx_tuple__13);
  19531. __Pyx_GIVEREF(__pyx_tuple__13);
  19532. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  19533. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19534. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  19535. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  19536. *
  19537. * info.buf = PyArray_DATA(self)
  19538. */
  19539. __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)
  19540. __Pyx_GOTREF(__pyx_tuple__14);
  19541. __Pyx_GIVEREF(__pyx_tuple__14);
  19542. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  19543. * if ((descr.byteorder == c'>' and little_endian) or
  19544. * (descr.byteorder == c'<' and not little_endian)):
  19545. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  19546. * if t == NPY_BYTE: f = "b"
  19547. * elif t == NPY_UBYTE: f = "B"
  19548. */
  19549. __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)
  19550. __Pyx_GOTREF(__pyx_tuple__15);
  19551. __Pyx_GIVEREF(__pyx_tuple__15);
  19552. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  19553. *
  19554. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  19555. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  19556. *
  19557. * if ((child.byteorder == c'>' and little_endian) or
  19558. */
  19559. __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)
  19560. __Pyx_GOTREF(__pyx_tuple__16);
  19561. __Pyx_GIVEREF(__pyx_tuple__16);
  19562. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  19563. * t = child.type_num
  19564. * if end - f < 5:
  19565. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  19566. *
  19567. * # Until ticket #99 is fixed, use integers to avoid warnings
  19568. */
  19569. __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)
  19570. __Pyx_GOTREF(__pyx_tuple__17);
  19571. __Pyx_GIVEREF(__pyx_tuple__17);
  19572. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  19573. * _import_array()
  19574. * except Exception:
  19575. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  19576. *
  19577. * cdef inline int import_umath() except -1:
  19578. */
  19579. __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)
  19580. __Pyx_GOTREF(__pyx_tuple__18);
  19581. __Pyx_GIVEREF(__pyx_tuple__18);
  19582. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  19583. * _import_umath()
  19584. * except Exception:
  19585. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  19586. *
  19587. * cdef inline int import_ufunc() except -1:
  19588. */
  19589. __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)
  19590. __Pyx_GOTREF(__pyx_tuple__19);
  19591. __Pyx_GIVEREF(__pyx_tuple__19);
  19592. /* "gedlibpy.pyx":128
  19593. *
  19594. *
  19595. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  19596. * """
  19597. * Searchs the differents edit cost functions and returns the result.
  19598. */
  19599. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 128, __pyx_L1_error)
  19600. __Pyx_GOTREF(__pyx_tuple__21);
  19601. __Pyx_GIVEREF(__pyx_tuple__21);
  19602. __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)
  19603. /* "gedlibpy.pyx":142
  19604. *
  19605. *
  19606. * def get_method_options() : # <<<<<<<<<<<<<<
  19607. * """
  19608. * Searchs the differents method for edit distance computation between graphs and returns the result.
  19609. */
  19610. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 142, __pyx_L1_error)
  19611. __Pyx_GOTREF(__pyx_tuple__23);
  19612. __Pyx_GIVEREF(__pyx_tuple__23);
  19613. __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)
  19614. /* "gedlibpy.pyx":155
  19615. *
  19616. *
  19617. * def get_init_options() : # <<<<<<<<<<<<<<
  19618. * """
  19619. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  19620. */
  19621. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 155, __pyx_L1_error)
  19622. __Pyx_GOTREF(__pyx_tuple__25);
  19623. __Pyx_GIVEREF(__pyx_tuple__25);
  19624. __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)
  19625. /* "gedlibpy.pyx":168
  19626. *
  19627. *
  19628. * def get_dummy_node() : # <<<<<<<<<<<<<<
  19629. * """
  19630. * Returns the ID of a dummy node.
  19631. */
  19632. __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)
  19633. /* "gedlibpy.pyx":1390
  19634. * :type message: string
  19635. * """
  19636. * def __init__(self, message): # <<<<<<<<<<<<<<
  19637. * """
  19638. * Inits the error with its message.
  19639. */
  19640. __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1390, __pyx_L1_error)
  19641. __Pyx_GOTREF(__pyx_tuple__28);
  19642. __Pyx_GIVEREF(__pyx_tuple__28);
  19643. __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, 1390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1390, __pyx_L1_error)
  19644. /* "gedlibpy.pyx":1407
  19645. * :type message: string
  19646. * """
  19647. * def __init__(self, message): # <<<<<<<<<<<<<<
  19648. * """
  19649. * Inits the error with its message.
  19650. */
  19651. __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1407, __pyx_L1_error)
  19652. __Pyx_GOTREF(__pyx_tuple__30);
  19653. __Pyx_GIVEREF(__pyx_tuple__30);
  19654. __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, 1407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1407, __pyx_L1_error)
  19655. /* "gedlibpy.pyx":1424
  19656. * :type message: string
  19657. * """
  19658. * def __init__(self, message): # <<<<<<<<<<<<<<
  19659. * """
  19660. * Inits the error with its message.
  19661. */
  19662. __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1424, __pyx_L1_error)
  19663. __Pyx_GOTREF(__pyx_tuple__32);
  19664. __Pyx_GIVEREF(__pyx_tuple__32);
  19665. __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, 1424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1424, __pyx_L1_error)
  19666. /* "gedlibpy.pyx":1438
  19667. * #########################################
  19668. *
  19669. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  19670. * """
  19671. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  19672. */
  19673. __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, 1438, __pyx_L1_error)
  19674. __Pyx_GOTREF(__pyx_tuple__34);
  19675. __Pyx_GIVEREF(__pyx_tuple__34);
  19676. __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, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1438, __pyx_L1_error)
  19677. /* "gedlibpy.pyx":1456
  19678. *
  19679. *
  19680. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  19681. * """
  19682. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  19683. */
  19684. __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, 1456, __pyx_L1_error)
  19685. __Pyx_GOTREF(__pyx_tuple__36);
  19686. __Pyx_GIVEREF(__pyx_tuple__36);
  19687. __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, 1456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1456, __pyx_L1_error)
  19688. /* "gedlibpy.pyx":1474
  19689. *
  19690. *
  19691. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  19692. * """
  19693. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  19694. */
  19695. __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, 1474, __pyx_L1_error)
  19696. __Pyx_GOTREF(__pyx_tuple__38);
  19697. __Pyx_GIVEREF(__pyx_tuple__38);
  19698. __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, 1474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1474, __pyx_L1_error)
  19699. __Pyx_RefNannyFinishContext();
  19700. return 0;
  19701. __pyx_L1_error:;
  19702. __Pyx_RefNannyFinishContext();
  19703. return -1;
  19704. }
  19705. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  19706. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  19707. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  19708. return 0;
  19709. __pyx_L1_error:;
  19710. return -1;
  19711. }
  19712. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  19713. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  19714. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  19715. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  19716. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  19717. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  19718. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  19719. static int __Pyx_modinit_global_init_code(void) {
  19720. __Pyx_RefNannyDeclarations
  19721. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  19722. /*--- Global init code ---*/
  19723. __Pyx_RefNannyFinishContext();
  19724. return 0;
  19725. }
  19726. static int __Pyx_modinit_variable_export_code(void) {
  19727. __Pyx_RefNannyDeclarations
  19728. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  19729. /*--- Variable export code ---*/
  19730. __Pyx_RefNannyFinishContext();
  19731. return 0;
  19732. }
  19733. static int __Pyx_modinit_function_export_code(void) {
  19734. __Pyx_RefNannyDeclarations
  19735. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  19736. /*--- Function export code ---*/
  19737. __Pyx_RefNannyFinishContext();
  19738. return 0;
  19739. }
  19740. static int __Pyx_modinit_type_init_code(void) {
  19741. __Pyx_RefNannyDeclarations
  19742. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  19743. /*--- Type init code ---*/
  19744. if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  19745. #if PY_VERSION_HEX < 0x030800B1
  19746. __pyx_type_8gedlibpy_GEDEnv.tp_print = 0;
  19747. #endif
  19748. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8gedlibpy_GEDEnv.tp_dictoffset && __pyx_type_8gedlibpy_GEDEnv.tp_getattro == PyObject_GenericGetAttr)) {
  19749. __pyx_type_8gedlibpy_GEDEnv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  19750. }
  19751. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  19752. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  19753. __pyx_ptype_8gedlibpy_GEDEnv = &__pyx_type_8gedlibpy_GEDEnv;
  19754. __Pyx_RefNannyFinishContext();
  19755. return 0;
  19756. __pyx_L1_error:;
  19757. __Pyx_RefNannyFinishContext();
  19758. return -1;
  19759. }
  19760. static int __Pyx_modinit_type_import_code(void) {
  19761. __Pyx_RefNannyDeclarations
  19762. PyObject *__pyx_t_1 = NULL;
  19763. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  19764. /*--- Type import code ---*/
  19765. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  19766. __Pyx_GOTREF(__pyx_t_1);
  19767. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  19768. #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  19769. sizeof(PyTypeObject),
  19770. #else
  19771. sizeof(PyHeapTypeObject),
  19772. #endif
  19773. __Pyx_ImportType_CheckSize_Warn);
  19774. if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
  19775. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19776. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  19777. __Pyx_GOTREF(__pyx_t_1);
  19778. __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
  19779. if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
  19780. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19781. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  19782. __Pyx_GOTREF(__pyx_t_1);
  19783. __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
  19784. if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
  19785. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19786. __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
  19787. __Pyx_GOTREF(__pyx_t_1);
  19788. __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
  19789. if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
  19790. __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
  19791. if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
  19792. __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
  19793. if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
  19794. __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
  19795. if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
  19796. __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
  19797. if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
  19798. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19799. __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 58, __pyx_L1_error)
  19800. __Pyx_GOTREF(__pyx_t_1);
  19801. __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn);
  19802. if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 58, __pyx_L1_error)
  19803. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19804. __Pyx_RefNannyFinishContext();
  19805. return 0;
  19806. __pyx_L1_error:;
  19807. __Pyx_XDECREF(__pyx_t_1);
  19808. __Pyx_RefNannyFinishContext();
  19809. return -1;
  19810. }
  19811. static int __Pyx_modinit_variable_import_code(void) {
  19812. __Pyx_RefNannyDeclarations
  19813. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  19814. /*--- Variable import code ---*/
  19815. __Pyx_RefNannyFinishContext();
  19816. return 0;
  19817. }
  19818. static int __Pyx_modinit_function_import_code(void) {
  19819. __Pyx_RefNannyDeclarations
  19820. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  19821. /*--- Function import code ---*/
  19822. __Pyx_RefNannyFinishContext();
  19823. return 0;
  19824. }
  19825. #if PY_MAJOR_VERSION < 3
  19826. #ifdef CYTHON_NO_PYINIT_EXPORT
  19827. #define __Pyx_PyMODINIT_FUNC void
  19828. #else
  19829. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  19830. #endif
  19831. #else
  19832. #ifdef CYTHON_NO_PYINIT_EXPORT
  19833. #define __Pyx_PyMODINIT_FUNC PyObject *
  19834. #else
  19835. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  19836. #endif
  19837. #endif
  19838. #if PY_MAJOR_VERSION < 3
  19839. __Pyx_PyMODINIT_FUNC initgedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  19840. __Pyx_PyMODINIT_FUNC initgedlibpy(void)
  19841. #else
  19842. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  19843. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)
  19844. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19845. {
  19846. return PyModuleDef_Init(&__pyx_moduledef);
  19847. }
  19848. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  19849. #if PY_VERSION_HEX >= 0x030700A1
  19850. static PY_INT64_T main_interpreter_id = -1;
  19851. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  19852. if (main_interpreter_id == -1) {
  19853. main_interpreter_id = current_id;
  19854. return (unlikely(current_id == -1)) ? -1 : 0;
  19855. } else if (unlikely(main_interpreter_id != current_id))
  19856. #else
  19857. static PyInterpreterState *main_interpreter = NULL;
  19858. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  19859. if (!main_interpreter) {
  19860. main_interpreter = current_interpreter;
  19861. } else if (unlikely(main_interpreter != current_interpreter))
  19862. #endif
  19863. {
  19864. PyErr_SetString(
  19865. PyExc_ImportError,
  19866. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  19867. return -1;
  19868. }
  19869. return 0;
  19870. }
  19871. 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) {
  19872. PyObject *value = PyObject_GetAttrString(spec, from_name);
  19873. int result = 0;
  19874. if (likely(value)) {
  19875. if (allow_none || value != Py_None) {
  19876. result = PyDict_SetItemString(moddict, to_name, value);
  19877. }
  19878. Py_DECREF(value);
  19879. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  19880. PyErr_Clear();
  19881. } else {
  19882. result = -1;
  19883. }
  19884. return result;
  19885. }
  19886. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  19887. PyObject *module = NULL, *moddict, *modname;
  19888. if (__Pyx_check_single_interpreter())
  19889. return NULL;
  19890. if (__pyx_m)
  19891. return __Pyx_NewRef(__pyx_m);
  19892. modname = PyObject_GetAttrString(spec, "name");
  19893. if (unlikely(!modname)) goto bad;
  19894. module = PyModule_NewObject(modname);
  19895. Py_DECREF(modname);
  19896. if (unlikely(!module)) goto bad;
  19897. moddict = PyModule_GetDict(module);
  19898. if (unlikely(!moddict)) goto bad;
  19899. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  19900. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  19901. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  19902. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  19903. return module;
  19904. bad:
  19905. Py_XDECREF(module);
  19906. return NULL;
  19907. }
  19908. static CYTHON_SMALL_CODE int __pyx_pymod_exec_gedlibpy(PyObject *__pyx_pyinit_module)
  19909. #endif
  19910. #endif
  19911. {
  19912. PyObject *__pyx_t_1 = NULL;
  19913. PyObject *__pyx_t_2 = NULL;
  19914. PyObject *__pyx_t_3 = NULL;
  19915. PyObject *__pyx_t_4 = NULL;
  19916. PyObject *__pyx_t_5 = NULL;
  19917. __Pyx_RefNannyDeclarations
  19918. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19919. if (__pyx_m) {
  19920. if (__pyx_m == __pyx_pyinit_module) return 0;
  19921. PyErr_SetString(PyExc_RuntimeError, "Module 'gedlibpy' has already been imported. Re-initialisation is not supported.");
  19922. return -1;
  19923. }
  19924. #elif PY_MAJOR_VERSION >= 3
  19925. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  19926. #endif
  19927. #if CYTHON_REFNANNY
  19928. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  19929. if (!__Pyx_RefNanny) {
  19930. PyErr_Clear();
  19931. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  19932. if (!__Pyx_RefNanny)
  19933. Py_FatalError("failed to import 'refnanny' module");
  19934. }
  19935. #endif
  19936. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)", 0);
  19937. if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19938. #ifdef __Pxy_PyFrame_Initialize_Offsets
  19939. __Pxy_PyFrame_Initialize_Offsets();
  19940. #endif
  19941. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  19942. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  19943. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  19944. #ifdef __Pyx_CyFunction_USED
  19945. if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19946. #endif
  19947. #ifdef __Pyx_FusedFunction_USED
  19948. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19949. #endif
  19950. #ifdef __Pyx_Coroutine_USED
  19951. if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19952. #endif
  19953. #ifdef __Pyx_Generator_USED
  19954. if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19955. #endif
  19956. #ifdef __Pyx_AsyncGen_USED
  19957. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19958. #endif
  19959. #ifdef __Pyx_StopAsyncIteration_USED
  19960. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19961. #endif
  19962. /*--- Library function declarations ---*/
  19963. /*--- Threads initialization code ---*/
  19964. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  19965. #ifdef WITH_THREAD /* Python build with threading support? */
  19966. PyEval_InitThreads();
  19967. #endif
  19968. #endif
  19969. /*--- Module creation code ---*/
  19970. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19971. __pyx_m = __pyx_pyinit_module;
  19972. Py_INCREF(__pyx_m);
  19973. #else
  19974. #if PY_MAJOR_VERSION < 3
  19975. __pyx_m = Py_InitModule4("gedlibpy", __pyx_methods, __pyx_k_Python_GedLib_module_This_modul, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  19976. #else
  19977. __pyx_m = PyModule_Create(&__pyx_moduledef);
  19978. #endif
  19979. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  19980. #endif
  19981. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  19982. Py_INCREF(__pyx_d);
  19983. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  19984. Py_INCREF(__pyx_b);
  19985. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  19986. Py_INCREF(__pyx_cython_runtime);
  19987. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  19988. /*--- Initialize various global constants etc. ---*/
  19989. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19990. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  19991. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19992. #endif
  19993. if (__pyx_module_is_main_gedlibpy) {
  19994. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19995. }
  19996. #if PY_MAJOR_VERSION >= 3
  19997. {
  19998. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  19999. if (!PyDict_GetItemString(modules, "gedlibpy")) {
  20000. if (unlikely(PyDict_SetItemString(modules, "gedlibpy", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  20001. }
  20002. }
  20003. #endif
  20004. /*--- Builtin init code ---*/
  20005. if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  20006. /*--- Constants init code ---*/
  20007. if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  20008. /*--- Global type/function init code ---*/
  20009. (void)__Pyx_modinit_global_init_code();
  20010. (void)__Pyx_modinit_variable_export_code();
  20011. (void)__Pyx_modinit_function_export_code();
  20012. if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  20013. if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  20014. (void)__Pyx_modinit_variable_import_code();
  20015. (void)__Pyx_modinit_function_import_code();
  20016. /*--- Execution code ---*/
  20017. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  20018. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20019. #endif
  20020. /* "gedlibpy.pyx":115
  20021. * #############################
  20022. *
  20023. * import numpy as np # <<<<<<<<<<<<<<
  20024. * import networkx as nx
  20025. * from gklearn.ged.env import NodeMap
  20026. */
  20027. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
  20028. __Pyx_GOTREF(__pyx_t_1);
  20029. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
  20030. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20031. /* "gedlibpy.pyx":116
  20032. *
  20033. * import numpy as np
  20034. * import networkx as nx # <<<<<<<<<<<<<<
  20035. * from gklearn.ged.env import NodeMap
  20036. *
  20037. */
  20038. __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
  20039. __Pyx_GOTREF(__pyx_t_1);
  20040. if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
  20041. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20042. /* "gedlibpy.pyx":117
  20043. * import numpy as np
  20044. * import networkx as nx
  20045. * from gklearn.ged.env import NodeMap # <<<<<<<<<<<<<<
  20046. *
  20047. * # import librariesImport
  20048. */
  20049. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  20050. __Pyx_GOTREF(__pyx_t_1);
  20051. __Pyx_INCREF(__pyx_n_s_NodeMap);
  20052. __Pyx_GIVEREF(__pyx_n_s_NodeMap);
  20053. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NodeMap);
  20054. __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)
  20055. __Pyx_GOTREF(__pyx_t_2);
  20056. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20057. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  20058. __Pyx_GOTREF(__pyx_t_1);
  20059. if (PyDict_SetItem(__pyx_d, __pyx_n_s_NodeMap, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
  20060. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20061. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20062. /* "gedlibpy.pyx":120
  20063. *
  20064. * # import librariesImport
  20065. * from ctypes import * # <<<<<<<<<<<<<<
  20066. * import os
  20067. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20068. */
  20069. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  20070. __Pyx_GOTREF(__pyx_t_2);
  20071. __Pyx_INCREF(__pyx_n_s__20);
  20072. __Pyx_GIVEREF(__pyx_n_s__20);
  20073. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__20);
  20074. __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)
  20075. __Pyx_GOTREF(__pyx_t_1);
  20076. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20077. if (__pyx_import_star(__pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error);
  20078. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20079. /* "gedlibpy.pyx":121
  20080. * # import librariesImport
  20081. * from ctypes import *
  20082. * import os # <<<<<<<<<<<<<<
  20083. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20084. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20085. */
  20086. __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  20087. __Pyx_GOTREF(__pyx_t_1);
  20088. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  20089. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20090. /* "gedlibpy.pyx":122
  20091. * from ctypes import *
  20092. * import os
  20093. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') # <<<<<<<<<<<<<<
  20094. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20095. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20096. */
  20097. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20098. __Pyx_GOTREF(__pyx_t_1);
  20099. __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)
  20100. __Pyx_GOTREF(__pyx_t_2);
  20101. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20102. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20103. __Pyx_GOTREF(__pyx_t_1);
  20104. __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)
  20105. __Pyx_GOTREF(__pyx_t_3);
  20106. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20107. __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)
  20108. __Pyx_GOTREF(__pyx_t_1);
  20109. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20110. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  20111. __Pyx_GOTREF(__pyx_t_3);
  20112. __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)
  20113. __Pyx_GOTREF(__pyx_t_4);
  20114. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20115. __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)
  20116. __Pyx_GOTREF(__pyx_t_3);
  20117. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20118. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20119. __Pyx_GOTREF(__pyx_t_4);
  20120. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  20121. __Pyx_GOTREF(__pyx_t_5);
  20122. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20123. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20124. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20125. __Pyx_GOTREF(__pyx_t_4);
  20126. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20127. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20128. __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)
  20129. __Pyx_GOTREF(__pyx_t_5);
  20130. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20131. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20132. __Pyx_GOTREF(__pyx_t_4);
  20133. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20134. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20135. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  20136. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20137. /* "gedlibpy.pyx":123
  20138. * import os
  20139. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20140. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') # <<<<<<<<<<<<<<
  20141. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20142. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20143. */
  20144. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20145. __Pyx_GOTREF(__pyx_t_4);
  20146. __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)
  20147. __Pyx_GOTREF(__pyx_t_5);
  20148. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20149. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20150. __Pyx_GOTREF(__pyx_t_4);
  20151. __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)
  20152. __Pyx_GOTREF(__pyx_t_2);
  20153. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20154. __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)
  20155. __Pyx_GOTREF(__pyx_t_4);
  20156. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20157. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  20158. __Pyx_GOTREF(__pyx_t_2);
  20159. __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)
  20160. __Pyx_GOTREF(__pyx_t_1);
  20161. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20162. __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)
  20163. __Pyx_GOTREF(__pyx_t_2);
  20164. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20165. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20166. __Pyx_GOTREF(__pyx_t_1);
  20167. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  20168. __Pyx_GOTREF(__pyx_t_3);
  20169. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20170. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20171. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20172. __Pyx_GOTREF(__pyx_t_1);
  20173. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20174. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20175. __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)
  20176. __Pyx_GOTREF(__pyx_t_3);
  20177. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20178. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20179. __Pyx_GOTREF(__pyx_t_1);
  20180. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20181. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20182. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_1) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
  20183. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20184. /* "gedlibpy.pyx":124
  20185. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20186. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20187. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') # <<<<<<<<<<<<<<
  20188. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20189. *
  20190. */
  20191. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20192. __Pyx_GOTREF(__pyx_t_1);
  20193. __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)
  20194. __Pyx_GOTREF(__pyx_t_3);
  20195. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20196. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20197. __Pyx_GOTREF(__pyx_t_1);
  20198. __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)
  20199. __Pyx_GOTREF(__pyx_t_5);
  20200. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20201. __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)
  20202. __Pyx_GOTREF(__pyx_t_1);
  20203. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20204. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
  20205. __Pyx_GOTREF(__pyx_t_5);
  20206. __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)
  20207. __Pyx_GOTREF(__pyx_t_4);
  20208. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20209. __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)
  20210. __Pyx_GOTREF(__pyx_t_5);
  20211. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20212. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20213. __Pyx_GOTREF(__pyx_t_4);
  20214. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20215. __Pyx_GOTREF(__pyx_t_2);
  20216. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20217. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20218. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20219. __Pyx_GOTREF(__pyx_t_4);
  20220. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20221. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20222. __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)
  20223. __Pyx_GOTREF(__pyx_t_2);
  20224. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20225. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20226. __Pyx_GOTREF(__pyx_t_4);
  20227. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20228. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20229. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  20230. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20231. /* "gedlibpy.pyx":125
  20232. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20233. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20234. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') # <<<<<<<<<<<<<<
  20235. *
  20236. *
  20237. */
  20238. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20239. __Pyx_GOTREF(__pyx_t_4);
  20240. __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)
  20241. __Pyx_GOTREF(__pyx_t_2);
  20242. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20243. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20244. __Pyx_GOTREF(__pyx_t_4);
  20245. __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)
  20246. __Pyx_GOTREF(__pyx_t_3);
  20247. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20248. __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)
  20249. __Pyx_GOTREF(__pyx_t_4);
  20250. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20251. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  20252. __Pyx_GOTREF(__pyx_t_3);
  20253. __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)
  20254. __Pyx_GOTREF(__pyx_t_1);
  20255. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20256. __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)
  20257. __Pyx_GOTREF(__pyx_t_3);
  20258. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20259. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20260. __Pyx_GOTREF(__pyx_t_1);
  20261. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20262. __Pyx_GOTREF(__pyx_t_5);
  20263. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20264. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20265. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20266. __Pyx_GOTREF(__pyx_t_1);
  20267. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20268. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20269. __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)
  20270. __Pyx_GOTREF(__pyx_t_5);
  20271. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20272. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20273. __Pyx_GOTREF(__pyx_t_1);
  20274. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20275. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20276. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  20277. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20278. /* "gedlibpy.pyx":128
  20279. *
  20280. *
  20281. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  20282. * """
  20283. * Searchs the differents edit cost functions and returns the result.
  20284. */
  20285. __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)
  20286. __Pyx_GOTREF(__pyx_t_1);
  20287. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
  20288. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20289. /* "gedlibpy.pyx":142
  20290. *
  20291. *
  20292. * def get_method_options() : # <<<<<<<<<<<<<<
  20293. * """
  20294. * Searchs the differents method for edit distance computation between graphs and returns the result.
  20295. */
  20296. __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)
  20297. __Pyx_GOTREF(__pyx_t_1);
  20298. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  20299. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20300. /* "gedlibpy.pyx":155
  20301. *
  20302. *
  20303. * def get_init_options() : # <<<<<<<<<<<<<<
  20304. * """
  20305. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  20306. */
  20307. __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)
  20308. __Pyx_GOTREF(__pyx_t_1);
  20309. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_1) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  20310. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20311. /* "gedlibpy.pyx":168
  20312. *
  20313. *
  20314. * def get_dummy_node() : # <<<<<<<<<<<<<<
  20315. * """
  20316. * Returns the ID of a dummy node.
  20317. */
  20318. __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)
  20319. __Pyx_GOTREF(__pyx_t_1);
  20320. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_1) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
  20321. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20322. /* "gedlibpy.pyx":485
  20323. *
  20324. *
  20325. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20326. * """
  20327. * Sets an edit cost function to the environment, if it exists.
  20328. */
  20329. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
  20330. __Pyx_GOTREF(__pyx_t_1);
  20331. __pyx_k__2 = __pyx_t_1;
  20332. __Pyx_GIVEREF(__pyx_t_1);
  20333. __pyx_t_1 = 0;
  20334. /* "gedlibpy.pyx":504
  20335. *
  20336. *
  20337. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20338. * """
  20339. * Sets an personal edit cost function to the environment.
  20340. */
  20341. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  20342. __Pyx_GOTREF(__pyx_t_1);
  20343. __pyx_k__3 = __pyx_t_1;
  20344. __Pyx_GIVEREF(__pyx_t_1);
  20345. __pyx_t_1 = 0;
  20346. /* "gedlibpy.pyx":1367
  20347. * #####################################################################
  20348. *
  20349. * list_of_edit_cost_options = get_edit_cost_options() # <<<<<<<<<<<<<<
  20350. * list_of_method_options = get_method_options()
  20351. * list_of_init_options = get_init_options()
  20352. */
  20353. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
  20354. __Pyx_GOTREF(__pyx_t_1);
  20355. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error)
  20356. __Pyx_GOTREF(__pyx_t_5);
  20357. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20358. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1367, __pyx_L1_error)
  20359. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20360. /* "gedlibpy.pyx":1368
  20361. *
  20362. * list_of_edit_cost_options = get_edit_cost_options()
  20363. * list_of_method_options = get_method_options() # <<<<<<<<<<<<<<
  20364. * list_of_init_options = get_init_options()
  20365. *
  20366. */
  20367. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  20368. __Pyx_GOTREF(__pyx_t_5);
  20369. __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  20370. __Pyx_GOTREF(__pyx_t_1);
  20371. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20372. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 1368, __pyx_L1_error)
  20373. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20374. /* "gedlibpy.pyx":1369
  20375. * list_of_edit_cost_options = get_edit_cost_options()
  20376. * list_of_method_options = get_method_options()
  20377. * list_of_init_options = get_init_options() # <<<<<<<<<<<<<<
  20378. *
  20379. *
  20380. */
  20381. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error)
  20382. __Pyx_GOTREF(__pyx_t_1);
  20383. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error)
  20384. __Pyx_GOTREF(__pyx_t_5);
  20385. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20386. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1369, __pyx_L1_error)
  20387. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20388. /* "gedlibpy.pyx":1376
  20389. * #####################
  20390. *
  20391. * class Error(Exception): # <<<<<<<<<<<<<<
  20392. * """
  20393. * Class for error's management. This one is general.
  20394. */
  20395. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1376, __pyx_L1_error)
  20396. __Pyx_GOTREF(__pyx_t_5);
  20397. __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20398. __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20399. PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20400. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
  20401. __Pyx_GOTREF(__pyx_t_1);
  20402. __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, 1376, __pyx_L1_error)
  20403. __Pyx_GOTREF(__pyx_t_2);
  20404. __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, 1376, __pyx_L1_error)
  20405. __Pyx_GOTREF(__pyx_t_4);
  20406. if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1376, __pyx_L1_error)
  20407. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20408. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20409. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20410. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20411. /* "gedlibpy.pyx":1383
  20412. *
  20413. *
  20414. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20415. * """
  20416. * 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).
  20417. */
  20418. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
  20419. __Pyx_GOTREF(__pyx_t_5);
  20420. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  20421. __Pyx_GOTREF(__pyx_t_1);
  20422. __Pyx_GIVEREF(__pyx_t_5);
  20423. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20424. __pyx_t_5 = 0;
  20425. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1383, __pyx_L1_error)
  20426. __Pyx_GOTREF(__pyx_t_5);
  20427. __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, 1383, __pyx_L1_error)
  20428. __Pyx_GOTREF(__pyx_t_2);
  20429. /* "gedlibpy.pyx":1390
  20430. * :type message: string
  20431. * """
  20432. * def __init__(self, message): # <<<<<<<<<<<<<<
  20433. * """
  20434. * Inits the error with its message.
  20435. */
  20436. __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, 1390, __pyx_L1_error)
  20437. __Pyx_GOTREF(__pyx_t_4);
  20438. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1390, __pyx_L1_error)
  20439. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20440. /* "gedlibpy.pyx":1383
  20441. *
  20442. *
  20443. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20444. * """
  20445. * 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).
  20446. */
  20447. __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, 1383, __pyx_L1_error)
  20448. __Pyx_GOTREF(__pyx_t_4);
  20449. if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
  20450. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20451. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20452. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20453. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20454. /* "gedlibpy.pyx":1400
  20455. *
  20456. *
  20457. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20458. * """
  20459. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20460. */
  20461. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  20462. __Pyx_GOTREF(__pyx_t_1);
  20463. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1400, __pyx_L1_error)
  20464. __Pyx_GOTREF(__pyx_t_5);
  20465. __Pyx_GIVEREF(__pyx_t_1);
  20466. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  20467. __pyx_t_1 = 0;
  20468. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  20469. __Pyx_GOTREF(__pyx_t_1);
  20470. __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, 1400, __pyx_L1_error)
  20471. __Pyx_GOTREF(__pyx_t_2);
  20472. /* "gedlibpy.pyx":1407
  20473. * :type message: string
  20474. * """
  20475. * def __init__(self, message): # <<<<<<<<<<<<<<
  20476. * """
  20477. * Inits the error with its message.
  20478. */
  20479. __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, 1407, __pyx_L1_error)
  20480. __Pyx_GOTREF(__pyx_t_4);
  20481. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
  20482. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20483. /* "gedlibpy.pyx":1400
  20484. *
  20485. *
  20486. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20487. * """
  20488. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20489. */
  20490. __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, 1400, __pyx_L1_error)
  20491. __Pyx_GOTREF(__pyx_t_4);
  20492. if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  20493. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20494. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20495. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20496. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20497. /* "gedlibpy.pyx":1417
  20498. *
  20499. *
  20500. * class InitError(Error) : # <<<<<<<<<<<<<<
  20501. * """
  20502. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20503. */
  20504. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1417, __pyx_L1_error)
  20505. __Pyx_GOTREF(__pyx_t_5);
  20506. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L1_error)
  20507. __Pyx_GOTREF(__pyx_t_1);
  20508. __Pyx_GIVEREF(__pyx_t_5);
  20509. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20510. __pyx_t_5 = 0;
  20511. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1417, __pyx_L1_error)
  20512. __Pyx_GOTREF(__pyx_t_5);
  20513. __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, 1417, __pyx_L1_error)
  20514. __Pyx_GOTREF(__pyx_t_2);
  20515. /* "gedlibpy.pyx":1424
  20516. * :type message: string
  20517. * """
  20518. * def __init__(self, message): # <<<<<<<<<<<<<<
  20519. * """
  20520. * Inits the error with its message.
  20521. */
  20522. __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, 1424, __pyx_L1_error)
  20523. __Pyx_GOTREF(__pyx_t_4);
  20524. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  20525. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20526. /* "gedlibpy.pyx":1417
  20527. *
  20528. *
  20529. * class InitError(Error) : # <<<<<<<<<<<<<<
  20530. * """
  20531. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20532. */
  20533. __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, 1417, __pyx_L1_error)
  20534. __Pyx_GOTREF(__pyx_t_4);
  20535. if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
  20536. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20537. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20538. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20539. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20540. /* "gedlibpy.pyx":1438
  20541. * #########################################
  20542. *
  20543. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20544. * """
  20545. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20546. */
  20547. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error)
  20548. __Pyx_GOTREF(__pyx_t_1);
  20549. if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1438, __pyx_L1_error)
  20550. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20551. /* "gedlibpy.pyx":1456
  20552. *
  20553. *
  20554. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20555. * """
  20556. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20557. */
  20558. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error)
  20559. __Pyx_GOTREF(__pyx_t_1);
  20560. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1456, __pyx_L1_error)
  20561. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20562. /* "gedlibpy.pyx":1474
  20563. *
  20564. *
  20565. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20566. * """
  20567. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  20568. */
  20569. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error)
  20570. __Pyx_GOTREF(__pyx_t_1);
  20571. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_1) < 0) __PYX_ERR(0, 1474, __pyx_L1_error)
  20572. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20573. /* "gedlibpy.pyx":1
  20574. * # distutils: language = c++ # <<<<<<<<<<<<<<
  20575. *
  20576. * """
  20577. */
  20578. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  20579. __Pyx_GOTREF(__pyx_t_1);
  20580. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20581. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20582. /* "vector.from_py":45
  20583. *
  20584. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  20585. * 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 *: # <<<<<<<<<<<<<<
  20586. * cdef vector[X] v
  20587. * for item in o:
  20588. */
  20589. /*--- Wrapped vars code ---*/
  20590. goto __pyx_L0;
  20591. __pyx_L1_error:;
  20592. __Pyx_XDECREF(__pyx_t_1);
  20593. __Pyx_XDECREF(__pyx_t_2);
  20594. __Pyx_XDECREF(__pyx_t_3);
  20595. __Pyx_XDECREF(__pyx_t_4);
  20596. __Pyx_XDECREF(__pyx_t_5);
  20597. if (__pyx_m) {
  20598. if (__pyx_d) {
  20599. __Pyx_AddTraceback("init gedlibpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  20600. }
  20601. Py_CLEAR(__pyx_m);
  20602. } else if (!PyErr_Occurred()) {
  20603. PyErr_SetString(PyExc_ImportError, "init gedlibpy");
  20604. }
  20605. __pyx_L0:;
  20606. __Pyx_RefNannyFinishContext();
  20607. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20608. return (__pyx_m != NULL) ? 0 : -1;
  20609. #elif PY_MAJOR_VERSION >= 3
  20610. return __pyx_m;
  20611. #else
  20612. return;
  20613. #endif
  20614. }
  20615. /* --- Runtime support code --- */
  20616. /* Refnanny */
  20617. #if CYTHON_REFNANNY
  20618. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  20619. PyObject *m = NULL, *p = NULL;
  20620. void *r = NULL;
  20621. m = PyImport_ImportModule(modname);
  20622. if (!m) goto end;
  20623. p = PyObject_GetAttrString(m, "RefNannyAPI");
  20624. if (!p) goto end;
  20625. r = PyLong_AsVoidPtr(p);
  20626. end:
  20627. Py_XDECREF(p);
  20628. Py_XDECREF(m);
  20629. return (__Pyx_RefNannyAPIStruct *)r;
  20630. }
  20631. #endif
  20632. /* PyObjectGetAttrStr */
  20633. #if CYTHON_USE_TYPE_SLOTS
  20634. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  20635. PyTypeObject* tp = Py_TYPE(obj);
  20636. if (likely(tp->tp_getattro))
  20637. return tp->tp_getattro(obj, attr_name);
  20638. #if PY_MAJOR_VERSION < 3
  20639. if (likely(tp->tp_getattr))
  20640. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  20641. #endif
  20642. return PyObject_GetAttr(obj, attr_name);
  20643. }
  20644. #endif
  20645. /* GetBuiltinName */
  20646. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  20647. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  20648. if (unlikely(!result)) {
  20649. PyErr_Format(PyExc_NameError,
  20650. #if PY_MAJOR_VERSION >= 3
  20651. "name '%U' is not defined", name);
  20652. #else
  20653. "name '%.200s' is not defined", PyString_AS_STRING(name));
  20654. #endif
  20655. }
  20656. return result;
  20657. }
  20658. /* decode_c_bytes */
  20659. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  20660. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  20661. const char* encoding, const char* errors,
  20662. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  20663. if (unlikely((start < 0) | (stop < 0))) {
  20664. if (start < 0) {
  20665. start += length;
  20666. if (start < 0)
  20667. start = 0;
  20668. }
  20669. if (stop < 0)
  20670. stop += length;
  20671. }
  20672. if (stop > length)
  20673. stop = length;
  20674. length = stop - start;
  20675. if (unlikely(length <= 0))
  20676. return PyUnicode_FromUnicode(NULL, 0);
  20677. cstring += start;
  20678. if (decode_func) {
  20679. return decode_func(cstring, length, errors);
  20680. } else {
  20681. return PyUnicode_Decode(cstring, length, encoding, errors);
  20682. }
  20683. }
  20684. /* RaiseArgTupleInvalid */
  20685. static void __Pyx_RaiseArgtupleInvalid(
  20686. const char* func_name,
  20687. int exact,
  20688. Py_ssize_t num_min,
  20689. Py_ssize_t num_max,
  20690. Py_ssize_t num_found)
  20691. {
  20692. Py_ssize_t num_expected;
  20693. const char *more_or_less;
  20694. if (num_found < num_min) {
  20695. num_expected = num_min;
  20696. more_or_less = "at least";
  20697. } else {
  20698. num_expected = num_max;
  20699. more_or_less = "at most";
  20700. }
  20701. if (exact) {
  20702. more_or_less = "exactly";
  20703. }
  20704. PyErr_Format(PyExc_TypeError,
  20705. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  20706. func_name, more_or_less, num_expected,
  20707. (num_expected == 1) ? "" : "s", num_found);
  20708. }
  20709. /* KeywordStringCheck */
  20710. static int __Pyx_CheckKeywordStrings(
  20711. PyObject *kwdict,
  20712. const char* function_name,
  20713. int kw_allowed)
  20714. {
  20715. PyObject* key = 0;
  20716. Py_ssize_t pos = 0;
  20717. #if CYTHON_COMPILING_IN_PYPY
  20718. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  20719. goto invalid_keyword;
  20720. return 1;
  20721. #else
  20722. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  20723. #if PY_MAJOR_VERSION < 3
  20724. if (unlikely(!PyString_Check(key)))
  20725. #endif
  20726. if (unlikely(!PyUnicode_Check(key)))
  20727. goto invalid_keyword_type;
  20728. }
  20729. if ((!kw_allowed) && unlikely(key))
  20730. goto invalid_keyword;
  20731. return 1;
  20732. invalid_keyword_type:
  20733. PyErr_Format(PyExc_TypeError,
  20734. "%.200s() keywords must be strings", function_name);
  20735. return 0;
  20736. #endif
  20737. invalid_keyword:
  20738. PyErr_Format(PyExc_TypeError,
  20739. #if PY_MAJOR_VERSION < 3
  20740. "%.200s() got an unexpected keyword argument '%.200s'",
  20741. function_name, PyString_AsString(key));
  20742. #else
  20743. "%s() got an unexpected keyword argument '%U'",
  20744. function_name, key);
  20745. #endif
  20746. return 0;
  20747. }
  20748. /* RaiseDoubleKeywords */
  20749. static void __Pyx_RaiseDoubleKeywordsError(
  20750. const char* func_name,
  20751. PyObject* kw_name)
  20752. {
  20753. PyErr_Format(PyExc_TypeError,
  20754. #if PY_MAJOR_VERSION >= 3
  20755. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  20756. #else
  20757. "%s() got multiple values for keyword argument '%s'", func_name,
  20758. PyString_AsString(kw_name));
  20759. #endif
  20760. }
  20761. /* ParseKeywords */
  20762. static int __Pyx_ParseOptionalKeywords(
  20763. PyObject *kwds,
  20764. PyObject **argnames[],
  20765. PyObject *kwds2,
  20766. PyObject *values[],
  20767. Py_ssize_t num_pos_args,
  20768. const char* function_name)
  20769. {
  20770. PyObject *key = 0, *value = 0;
  20771. Py_ssize_t pos = 0;
  20772. PyObject*** name;
  20773. PyObject*** first_kw_arg = argnames + num_pos_args;
  20774. while (PyDict_Next(kwds, &pos, &key, &value)) {
  20775. name = first_kw_arg;
  20776. while (*name && (**name != key)) name++;
  20777. if (*name) {
  20778. values[name-argnames] = value;
  20779. continue;
  20780. }
  20781. name = first_kw_arg;
  20782. #if PY_MAJOR_VERSION < 3
  20783. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  20784. while (*name) {
  20785. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  20786. && _PyString_Eq(**name, key)) {
  20787. values[name-argnames] = value;
  20788. break;
  20789. }
  20790. name++;
  20791. }
  20792. if (*name) continue;
  20793. else {
  20794. PyObject*** argname = argnames;
  20795. while (argname != first_kw_arg) {
  20796. if ((**argname == key) || (
  20797. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  20798. && _PyString_Eq(**argname, key))) {
  20799. goto arg_passed_twice;
  20800. }
  20801. argname++;
  20802. }
  20803. }
  20804. } else
  20805. #endif
  20806. if (likely(PyUnicode_Check(key))) {
  20807. while (*name) {
  20808. int cmp = (**name == key) ? 0 :
  20809. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  20810. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  20811. #endif
  20812. PyUnicode_Compare(**name, key);
  20813. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  20814. if (cmp == 0) {
  20815. values[name-argnames] = value;
  20816. break;
  20817. }
  20818. name++;
  20819. }
  20820. if (*name) continue;
  20821. else {
  20822. PyObject*** argname = argnames;
  20823. while (argname != first_kw_arg) {
  20824. int cmp = (**argname == key) ? 0 :
  20825. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  20826. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  20827. #endif
  20828. PyUnicode_Compare(**argname, key);
  20829. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  20830. if (cmp == 0) goto arg_passed_twice;
  20831. argname++;
  20832. }
  20833. }
  20834. } else
  20835. goto invalid_keyword_type;
  20836. if (kwds2) {
  20837. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  20838. } else {
  20839. goto invalid_keyword;
  20840. }
  20841. }
  20842. return 0;
  20843. arg_passed_twice:
  20844. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  20845. goto bad;
  20846. invalid_keyword_type:
  20847. PyErr_Format(PyExc_TypeError,
  20848. "%.200s() keywords must be strings", function_name);
  20849. goto bad;
  20850. invalid_keyword:
  20851. PyErr_Format(PyExc_TypeError,
  20852. #if PY_MAJOR_VERSION < 3
  20853. "%.200s() got an unexpected keyword argument '%.200s'",
  20854. function_name, PyString_AsString(key));
  20855. #else
  20856. "%s() got an unexpected keyword argument '%U'",
  20857. function_name, key);
  20858. #endif
  20859. bad:
  20860. return -1;
  20861. }
  20862. /* PyCFunctionFastCall */
  20863. #if CYTHON_FAST_PYCCALL
  20864. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  20865. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  20866. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  20867. PyObject *self = PyCFunction_GET_SELF(func);
  20868. int flags = PyCFunction_GET_FLAGS(func);
  20869. assert(PyCFunction_Check(func));
  20870. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
  20871. assert(nargs >= 0);
  20872. assert(nargs == 0 || args != NULL);
  20873. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  20874. because it may clear it (directly or indirectly) and so the
  20875. caller loses its exception */
  20876. assert(!PyErr_Occurred());
  20877. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  20878. return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
  20879. } else {
  20880. return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
  20881. }
  20882. }
  20883. #endif
  20884. /* PyFunctionFastCall */
  20885. #if CYTHON_FAST_PYCALL
  20886. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  20887. PyObject *globals) {
  20888. PyFrameObject *f;
  20889. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  20890. PyObject **fastlocals;
  20891. Py_ssize_t i;
  20892. PyObject *result;
  20893. assert(globals != NULL);
  20894. /* XXX Perhaps we should create a specialized
  20895. PyFrame_New() that doesn't take locals, but does
  20896. take builtins without sanity checking them.
  20897. */
  20898. assert(tstate != NULL);
  20899. f = PyFrame_New(tstate, co, globals, NULL);
  20900. if (f == NULL) {
  20901. return NULL;
  20902. }
  20903. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  20904. for (i = 0; i < na; i++) {
  20905. Py_INCREF(*args);
  20906. fastlocals[i] = *args++;
  20907. }
  20908. result = PyEval_EvalFrameEx(f,0);
  20909. ++tstate->recursion_depth;
  20910. Py_DECREF(f);
  20911. --tstate->recursion_depth;
  20912. return result;
  20913. }
  20914. #if 1 || PY_VERSION_HEX < 0x030600B1
  20915. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  20916. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  20917. PyObject *globals = PyFunction_GET_GLOBALS(func);
  20918. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  20919. PyObject *closure;
  20920. #if PY_MAJOR_VERSION >= 3
  20921. PyObject *kwdefs;
  20922. #endif
  20923. PyObject *kwtuple, **k;
  20924. PyObject **d;
  20925. Py_ssize_t nd;
  20926. Py_ssize_t nk;
  20927. PyObject *result;
  20928. assert(kwargs == NULL || PyDict_Check(kwargs));
  20929. nk = kwargs ? PyDict_Size(kwargs) : 0;
  20930. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  20931. return NULL;
  20932. }
  20933. if (
  20934. #if PY_MAJOR_VERSION >= 3
  20935. co->co_kwonlyargcount == 0 &&
  20936. #endif
  20937. likely(kwargs == NULL || nk == 0) &&
  20938. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  20939. if (argdefs == NULL && co->co_argcount == nargs) {
  20940. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  20941. goto done;
  20942. }
  20943. else if (nargs == 0 && argdefs != NULL
  20944. && co->co_argcount == Py_SIZE(argdefs)) {
  20945. /* function called with no arguments, but all parameters have
  20946. a default value: use default values as arguments .*/
  20947. args = &PyTuple_GET_ITEM(argdefs, 0);
  20948. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  20949. goto done;
  20950. }
  20951. }
  20952. if (kwargs != NULL) {
  20953. Py_ssize_t pos, i;
  20954. kwtuple = PyTuple_New(2 * nk);
  20955. if (kwtuple == NULL) {
  20956. result = NULL;
  20957. goto done;
  20958. }
  20959. k = &PyTuple_GET_ITEM(kwtuple, 0);
  20960. pos = i = 0;
  20961. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  20962. Py_INCREF(k[i]);
  20963. Py_INCREF(k[i+1]);
  20964. i += 2;
  20965. }
  20966. nk = i / 2;
  20967. }
  20968. else {
  20969. kwtuple = NULL;
  20970. k = NULL;
  20971. }
  20972. closure = PyFunction_GET_CLOSURE(func);
  20973. #if PY_MAJOR_VERSION >= 3
  20974. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  20975. #endif
  20976. if (argdefs != NULL) {
  20977. d = &PyTuple_GET_ITEM(argdefs, 0);
  20978. nd = Py_SIZE(argdefs);
  20979. }
  20980. else {
  20981. d = NULL;
  20982. nd = 0;
  20983. }
  20984. #if PY_MAJOR_VERSION >= 3
  20985. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  20986. args, (int)nargs,
  20987. k, (int)nk,
  20988. d, (int)nd, kwdefs, closure);
  20989. #else
  20990. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  20991. args, (int)nargs,
  20992. k, (int)nk,
  20993. d, (int)nd, closure);
  20994. #endif
  20995. Py_XDECREF(kwtuple);
  20996. done:
  20997. Py_LeaveRecursiveCall();
  20998. return result;
  20999. }
  21000. #endif
  21001. #endif
  21002. /* PyObjectCall */
  21003. #if CYTHON_COMPILING_IN_CPYTHON
  21004. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  21005. PyObject *result;
  21006. ternaryfunc call = func->ob_type->tp_call;
  21007. if (unlikely(!call))
  21008. return PyObject_Call(func, arg, kw);
  21009. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21010. return NULL;
  21011. result = (*call)(func, arg, kw);
  21012. Py_LeaveRecursiveCall();
  21013. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21014. PyErr_SetString(
  21015. PyExc_SystemError,
  21016. "NULL result without error in PyObject_Call");
  21017. }
  21018. return result;
  21019. }
  21020. #endif
  21021. /* PyObjectCall2Args */
  21022. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  21023. PyObject *args, *result = NULL;
  21024. #if CYTHON_FAST_PYCALL
  21025. if (PyFunction_Check(function)) {
  21026. PyObject *args[2] = {arg1, arg2};
  21027. return __Pyx_PyFunction_FastCall(function, args, 2);
  21028. }
  21029. #endif
  21030. #if CYTHON_FAST_PYCCALL
  21031. if (__Pyx_PyFastCFunction_Check(function)) {
  21032. PyObject *args[2] = {arg1, arg2};
  21033. return __Pyx_PyCFunction_FastCall(function, args, 2);
  21034. }
  21035. #endif
  21036. args = PyTuple_New(2);
  21037. if (unlikely(!args)) goto done;
  21038. Py_INCREF(arg1);
  21039. PyTuple_SET_ITEM(args, 0, arg1);
  21040. Py_INCREF(arg2);
  21041. PyTuple_SET_ITEM(args, 1, arg2);
  21042. Py_INCREF(function);
  21043. result = __Pyx_PyObject_Call(function, args, NULL);
  21044. Py_DECREF(args);
  21045. Py_DECREF(function);
  21046. done:
  21047. return result;
  21048. }
  21049. /* PyObjectCallMethO */
  21050. #if CYTHON_COMPILING_IN_CPYTHON
  21051. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  21052. PyObject *self, *result;
  21053. PyCFunction cfunc;
  21054. cfunc = PyCFunction_GET_FUNCTION(func);
  21055. self = PyCFunction_GET_SELF(func);
  21056. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21057. return NULL;
  21058. result = cfunc(self, arg);
  21059. Py_LeaveRecursiveCall();
  21060. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21061. PyErr_SetString(
  21062. PyExc_SystemError,
  21063. "NULL result without error in PyObject_Call");
  21064. }
  21065. return result;
  21066. }
  21067. #endif
  21068. /* PyObjectCallOneArg */
  21069. #if CYTHON_COMPILING_IN_CPYTHON
  21070. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21071. PyObject *result;
  21072. PyObject *args = PyTuple_New(1);
  21073. if (unlikely(!args)) return NULL;
  21074. Py_INCREF(arg);
  21075. PyTuple_SET_ITEM(args, 0, arg);
  21076. result = __Pyx_PyObject_Call(func, args, NULL);
  21077. Py_DECREF(args);
  21078. return result;
  21079. }
  21080. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21081. #if CYTHON_FAST_PYCALL
  21082. if (PyFunction_Check(func)) {
  21083. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  21084. }
  21085. #endif
  21086. if (likely(PyCFunction_Check(func))) {
  21087. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  21088. return __Pyx_PyObject_CallMethO(func, arg);
  21089. #if CYTHON_FAST_PYCCALL
  21090. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  21091. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  21092. #endif
  21093. }
  21094. }
  21095. return __Pyx__PyObject_CallOneArg(func, arg);
  21096. }
  21097. #else
  21098. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21099. PyObject *result;
  21100. PyObject *args = PyTuple_Pack(1, arg);
  21101. if (unlikely(!args)) return NULL;
  21102. result = __Pyx_PyObject_Call(func, args, NULL);
  21103. Py_DECREF(args);
  21104. return result;
  21105. }
  21106. #endif
  21107. /* PyDictVersioning */
  21108. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  21109. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  21110. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21111. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  21112. }
  21113. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  21114. PyObject **dictptr = NULL;
  21115. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  21116. if (offset) {
  21117. #if CYTHON_COMPILING_IN_CPYTHON
  21118. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  21119. #else
  21120. dictptr = _PyObject_GetDictPtr(obj);
  21121. #endif
  21122. }
  21123. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  21124. }
  21125. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  21126. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21127. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  21128. return 0;
  21129. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  21130. }
  21131. #endif
  21132. /* GetModuleGlobalName */
  21133. #if CYTHON_USE_DICT_VERSIONS
  21134. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  21135. #else
  21136. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  21137. #endif
  21138. {
  21139. PyObject *result;
  21140. #if !CYTHON_AVOID_BORROWED_REFS
  21141. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  21142. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  21143. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21144. if (likely(result)) {
  21145. return __Pyx_NewRef(result);
  21146. } else if (unlikely(PyErr_Occurred())) {
  21147. return NULL;
  21148. }
  21149. #else
  21150. result = PyDict_GetItem(__pyx_d, name);
  21151. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21152. if (likely(result)) {
  21153. return __Pyx_NewRef(result);
  21154. }
  21155. #endif
  21156. #else
  21157. result = PyObject_GetItem(__pyx_d, name);
  21158. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21159. if (likely(result)) {
  21160. return __Pyx_NewRef(result);
  21161. }
  21162. PyErr_Clear();
  21163. #endif
  21164. return __Pyx_GetBuiltinName(name);
  21165. }
  21166. /* PyErrFetchRestore */
  21167. #if CYTHON_FAST_THREAD_STATE
  21168. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  21169. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21170. tmp_type = tstate->curexc_type;
  21171. tmp_value = tstate->curexc_value;
  21172. tmp_tb = tstate->curexc_traceback;
  21173. tstate->curexc_type = type;
  21174. tstate->curexc_value = value;
  21175. tstate->curexc_traceback = tb;
  21176. Py_XDECREF(tmp_type);
  21177. Py_XDECREF(tmp_value);
  21178. Py_XDECREF(tmp_tb);
  21179. }
  21180. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  21181. *type = tstate->curexc_type;
  21182. *value = tstate->curexc_value;
  21183. *tb = tstate->curexc_traceback;
  21184. tstate->curexc_type = 0;
  21185. tstate->curexc_value = 0;
  21186. tstate->curexc_traceback = 0;
  21187. }
  21188. #endif
  21189. /* RaiseException */
  21190. #if PY_MAJOR_VERSION < 3
  21191. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  21192. CYTHON_UNUSED PyObject *cause) {
  21193. __Pyx_PyThreadState_declare
  21194. Py_XINCREF(type);
  21195. if (!value || value == Py_None)
  21196. value = NULL;
  21197. else
  21198. Py_INCREF(value);
  21199. if (!tb || tb == Py_None)
  21200. tb = NULL;
  21201. else {
  21202. Py_INCREF(tb);
  21203. if (!PyTraceBack_Check(tb)) {
  21204. PyErr_SetString(PyExc_TypeError,
  21205. "raise: arg 3 must be a traceback or None");
  21206. goto raise_error;
  21207. }
  21208. }
  21209. if (PyType_Check(type)) {
  21210. #if CYTHON_COMPILING_IN_PYPY
  21211. if (!value) {
  21212. Py_INCREF(Py_None);
  21213. value = Py_None;
  21214. }
  21215. #endif
  21216. PyErr_NormalizeException(&type, &value, &tb);
  21217. } else {
  21218. if (value) {
  21219. PyErr_SetString(PyExc_TypeError,
  21220. "instance exception may not have a separate value");
  21221. goto raise_error;
  21222. }
  21223. value = type;
  21224. type = (PyObject*) Py_TYPE(type);
  21225. Py_INCREF(type);
  21226. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  21227. PyErr_SetString(PyExc_TypeError,
  21228. "raise: exception class must be a subclass of BaseException");
  21229. goto raise_error;
  21230. }
  21231. }
  21232. __Pyx_PyThreadState_assign
  21233. __Pyx_ErrRestore(type, value, tb);
  21234. return;
  21235. raise_error:
  21236. Py_XDECREF(value);
  21237. Py_XDECREF(type);
  21238. Py_XDECREF(tb);
  21239. return;
  21240. }
  21241. #else
  21242. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  21243. PyObject* owned_instance = NULL;
  21244. if (tb == Py_None) {
  21245. tb = 0;
  21246. } else if (tb && !PyTraceBack_Check(tb)) {
  21247. PyErr_SetString(PyExc_TypeError,
  21248. "raise: arg 3 must be a traceback or None");
  21249. goto bad;
  21250. }
  21251. if (value == Py_None)
  21252. value = 0;
  21253. if (PyExceptionInstance_Check(type)) {
  21254. if (value) {
  21255. PyErr_SetString(PyExc_TypeError,
  21256. "instance exception may not have a separate value");
  21257. goto bad;
  21258. }
  21259. value = type;
  21260. type = (PyObject*) Py_TYPE(value);
  21261. } else if (PyExceptionClass_Check(type)) {
  21262. PyObject *instance_class = NULL;
  21263. if (value && PyExceptionInstance_Check(value)) {
  21264. instance_class = (PyObject*) Py_TYPE(value);
  21265. if (instance_class != type) {
  21266. int is_subclass = PyObject_IsSubclass(instance_class, type);
  21267. if (!is_subclass) {
  21268. instance_class = NULL;
  21269. } else if (unlikely(is_subclass == -1)) {
  21270. goto bad;
  21271. } else {
  21272. type = instance_class;
  21273. }
  21274. }
  21275. }
  21276. if (!instance_class) {
  21277. PyObject *args;
  21278. if (!value)
  21279. args = PyTuple_New(0);
  21280. else if (PyTuple_Check(value)) {
  21281. Py_INCREF(value);
  21282. args = value;
  21283. } else
  21284. args = PyTuple_Pack(1, value);
  21285. if (!args)
  21286. goto bad;
  21287. owned_instance = PyObject_Call(type, args, NULL);
  21288. Py_DECREF(args);
  21289. if (!owned_instance)
  21290. goto bad;
  21291. value = owned_instance;
  21292. if (!PyExceptionInstance_Check(value)) {
  21293. PyErr_Format(PyExc_TypeError,
  21294. "calling %R should have returned an instance of "
  21295. "BaseException, not %R",
  21296. type, Py_TYPE(value));
  21297. goto bad;
  21298. }
  21299. }
  21300. } else {
  21301. PyErr_SetString(PyExc_TypeError,
  21302. "raise: exception class must be a subclass of BaseException");
  21303. goto bad;
  21304. }
  21305. if (cause) {
  21306. PyObject *fixed_cause;
  21307. if (cause == Py_None) {
  21308. fixed_cause = NULL;
  21309. } else if (PyExceptionClass_Check(cause)) {
  21310. fixed_cause = PyObject_CallObject(cause, NULL);
  21311. if (fixed_cause == NULL)
  21312. goto bad;
  21313. } else if (PyExceptionInstance_Check(cause)) {
  21314. fixed_cause = cause;
  21315. Py_INCREF(fixed_cause);
  21316. } else {
  21317. PyErr_SetString(PyExc_TypeError,
  21318. "exception causes must derive from "
  21319. "BaseException");
  21320. goto bad;
  21321. }
  21322. PyException_SetCause(value, fixed_cause);
  21323. }
  21324. PyErr_SetObject(type, value);
  21325. if (tb) {
  21326. #if CYTHON_COMPILING_IN_PYPY
  21327. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21328. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  21329. Py_INCREF(tb);
  21330. PyErr_Restore(tmp_type, tmp_value, tb);
  21331. Py_XDECREF(tmp_tb);
  21332. #else
  21333. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21334. PyObject* tmp_tb = tstate->curexc_traceback;
  21335. if (tb != tmp_tb) {
  21336. Py_INCREF(tb);
  21337. tstate->curexc_traceback = tb;
  21338. Py_XDECREF(tmp_tb);
  21339. }
  21340. #endif
  21341. }
  21342. bad:
  21343. Py_XDECREF(owned_instance);
  21344. return;
  21345. }
  21346. #endif
  21347. /* GetItemInt */
  21348. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  21349. PyObject *r;
  21350. if (!j) return NULL;
  21351. r = PyObject_GetItem(o, j);
  21352. Py_DECREF(j);
  21353. return r;
  21354. }
  21355. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  21356. CYTHON_NCP_UNUSED int wraparound,
  21357. CYTHON_NCP_UNUSED int boundscheck) {
  21358. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21359. Py_ssize_t wrapped_i = i;
  21360. if (wraparound & unlikely(i < 0)) {
  21361. wrapped_i += PyList_GET_SIZE(o);
  21362. }
  21363. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
  21364. PyObject *r = PyList_GET_ITEM(o, wrapped_i);
  21365. Py_INCREF(r);
  21366. return r;
  21367. }
  21368. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21369. #else
  21370. return PySequence_GetItem(o, i);
  21371. #endif
  21372. }
  21373. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  21374. CYTHON_NCP_UNUSED int wraparound,
  21375. CYTHON_NCP_UNUSED int boundscheck) {
  21376. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21377. Py_ssize_t wrapped_i = i;
  21378. if (wraparound & unlikely(i < 0)) {
  21379. wrapped_i += PyTuple_GET_SIZE(o);
  21380. }
  21381. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
  21382. PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
  21383. Py_INCREF(r);
  21384. return r;
  21385. }
  21386. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21387. #else
  21388. return PySequence_GetItem(o, i);
  21389. #endif
  21390. }
  21391. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
  21392. CYTHON_NCP_UNUSED int wraparound,
  21393. CYTHON_NCP_UNUSED int boundscheck) {
  21394. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
  21395. if (is_list || PyList_CheckExact(o)) {
  21396. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  21397. if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
  21398. PyObject *r = PyList_GET_ITEM(o, n);
  21399. Py_INCREF(r);
  21400. return r;
  21401. }
  21402. }
  21403. else if (PyTuple_CheckExact(o)) {
  21404. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  21405. if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
  21406. PyObject *r = PyTuple_GET_ITEM(o, n);
  21407. Py_INCREF(r);
  21408. return r;
  21409. }
  21410. } else {
  21411. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  21412. if (likely(m && m->sq_item)) {
  21413. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  21414. Py_ssize_t l = m->sq_length(o);
  21415. if (likely(l >= 0)) {
  21416. i += l;
  21417. } else {
  21418. if (!PyErr_ExceptionMatches(PyExc_OverflowError))
  21419. return NULL;
  21420. PyErr_Clear();
  21421. }
  21422. }
  21423. return m->sq_item(o, i);
  21424. }
  21425. }
  21426. #else
  21427. if (is_list || PySequence_Check(o)) {
  21428. return PySequence_GetItem(o, i);
  21429. }
  21430. #endif
  21431. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21432. }
  21433. /* ObjectGetItem */
  21434. #if CYTHON_USE_TYPE_SLOTS
  21435. static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
  21436. PyObject *runerr;
  21437. Py_ssize_t key_value;
  21438. PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
  21439. if (unlikely(!(m && m->sq_item))) {
  21440. PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
  21441. return NULL;
  21442. }
  21443. key_value = __Pyx_PyIndex_AsSsize_t(index);
  21444. if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
  21445. return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
  21446. }
  21447. if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
  21448. PyErr_Clear();
  21449. PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
  21450. }
  21451. return NULL;
  21452. }
  21453. static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
  21454. PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
  21455. if (likely(m && m->mp_subscript)) {
  21456. return m->mp_subscript(obj, key);
  21457. }
  21458. return __Pyx_PyObject_GetIndex(obj, key);
  21459. }
  21460. #endif
  21461. /* PyObjectCallNoArg */
  21462. #if CYTHON_COMPILING_IN_CPYTHON
  21463. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
  21464. #if CYTHON_FAST_PYCALL
  21465. if (PyFunction_Check(func)) {
  21466. return __Pyx_PyFunction_FastCall(func, NULL, 0);
  21467. }
  21468. #endif
  21469. #ifdef __Pyx_CyFunction_USED
  21470. if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
  21471. #else
  21472. if (likely(PyCFunction_Check(func)))
  21473. #endif
  21474. {
  21475. if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
  21476. return __Pyx_PyObject_CallMethO(func, NULL);
  21477. }
  21478. }
  21479. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
  21480. }
  21481. #endif
  21482. /* IterFinish */
  21483. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  21484. #if CYTHON_FAST_THREAD_STATE
  21485. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21486. PyObject* exc_type = tstate->curexc_type;
  21487. if (unlikely(exc_type)) {
  21488. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
  21489. PyObject *exc_value, *exc_tb;
  21490. exc_value = tstate->curexc_value;
  21491. exc_tb = tstate->curexc_traceback;
  21492. tstate->curexc_type = 0;
  21493. tstate->curexc_value = 0;
  21494. tstate->curexc_traceback = 0;
  21495. Py_DECREF(exc_type);
  21496. Py_XDECREF(exc_value);
  21497. Py_XDECREF(exc_tb);
  21498. return 0;
  21499. } else {
  21500. return -1;
  21501. }
  21502. }
  21503. return 0;
  21504. #else
  21505. if (unlikely(PyErr_Occurred())) {
  21506. if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
  21507. PyErr_Clear();
  21508. return 0;
  21509. } else {
  21510. return -1;
  21511. }
  21512. }
  21513. return 0;
  21514. #endif
  21515. }
  21516. /* PyObjectGetMethod */
  21517. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
  21518. PyObject *attr;
  21519. #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
  21520. PyTypeObject *tp = Py_TYPE(obj);
  21521. PyObject *descr;
  21522. descrgetfunc f = NULL;
  21523. PyObject **dictptr, *dict;
  21524. int meth_found = 0;
  21525. assert (*method == NULL);
  21526. if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
  21527. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21528. goto try_unpack;
  21529. }
  21530. if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
  21531. return 0;
  21532. }
  21533. descr = _PyType_Lookup(tp, name);
  21534. if (likely(descr != NULL)) {
  21535. Py_INCREF(descr);
  21536. #if PY_MAJOR_VERSION >= 3
  21537. #ifdef __Pyx_CyFunction_USED
  21538. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
  21539. #else
  21540. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
  21541. #endif
  21542. #else
  21543. #ifdef __Pyx_CyFunction_USED
  21544. if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
  21545. #else
  21546. if (likely(PyFunction_Check(descr)))
  21547. #endif
  21548. #endif
  21549. {
  21550. meth_found = 1;
  21551. } else {
  21552. f = Py_TYPE(descr)->tp_descr_get;
  21553. if (f != NULL && PyDescr_IsData(descr)) {
  21554. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21555. Py_DECREF(descr);
  21556. goto try_unpack;
  21557. }
  21558. }
  21559. }
  21560. dictptr = _PyObject_GetDictPtr(obj);
  21561. if (dictptr != NULL && (dict = *dictptr) != NULL) {
  21562. Py_INCREF(dict);
  21563. attr = __Pyx_PyDict_GetItemStr(dict, name);
  21564. if (attr != NULL) {
  21565. Py_INCREF(attr);
  21566. Py_DECREF(dict);
  21567. Py_XDECREF(descr);
  21568. goto try_unpack;
  21569. }
  21570. Py_DECREF(dict);
  21571. }
  21572. if (meth_found) {
  21573. *method = descr;
  21574. return 1;
  21575. }
  21576. if (f != NULL) {
  21577. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21578. Py_DECREF(descr);
  21579. goto try_unpack;
  21580. }
  21581. if (descr != NULL) {
  21582. *method = descr;
  21583. return 0;
  21584. }
  21585. PyErr_Format(PyExc_AttributeError,
  21586. #if PY_MAJOR_VERSION >= 3
  21587. "'%.50s' object has no attribute '%U'",
  21588. tp->tp_name, name);
  21589. #else
  21590. "'%.50s' object has no attribute '%.400s'",
  21591. tp->tp_name, PyString_AS_STRING(name));
  21592. #endif
  21593. return 0;
  21594. #else
  21595. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21596. goto try_unpack;
  21597. #endif
  21598. try_unpack:
  21599. #if CYTHON_UNPACK_METHODS
  21600. if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
  21601. PyObject *function = PyMethod_GET_FUNCTION(attr);
  21602. Py_INCREF(function);
  21603. Py_DECREF(attr);
  21604. *method = function;
  21605. return 1;
  21606. }
  21607. #endif
  21608. *method = attr;
  21609. return 0;
  21610. }
  21611. /* PyObjectCallMethod0 */
  21612. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
  21613. PyObject *method = NULL, *result = NULL;
  21614. int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
  21615. if (likely(is_method)) {
  21616. result = __Pyx_PyObject_CallOneArg(method, obj);
  21617. Py_DECREF(method);
  21618. return result;
  21619. }
  21620. if (unlikely(!method)) goto bad;
  21621. result = __Pyx_PyObject_CallNoArg(method);
  21622. Py_DECREF(method);
  21623. bad:
  21624. return result;
  21625. }
  21626. /* RaiseNeedMoreValuesToUnpack */
  21627. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  21628. PyErr_Format(PyExc_ValueError,
  21629. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  21630. index, (index == 1) ? "" : "s");
  21631. }
  21632. /* RaiseTooManyValuesToUnpack */
  21633. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  21634. PyErr_Format(PyExc_ValueError,
  21635. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  21636. }
  21637. /* UnpackItemEndCheck */
  21638. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  21639. if (unlikely(retval)) {
  21640. Py_DECREF(retval);
  21641. __Pyx_RaiseTooManyValuesError(expected);
  21642. return -1;
  21643. } else {
  21644. return __Pyx_IterFinish();
  21645. }
  21646. return 0;
  21647. }
  21648. /* RaiseNoneIterError */
  21649. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  21650. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  21651. }
  21652. /* UnpackTupleError */
  21653. static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
  21654. if (t == Py_None) {
  21655. __Pyx_RaiseNoneNotIterableError();
  21656. } else if (PyTuple_GET_SIZE(t) < index) {
  21657. __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
  21658. } else {
  21659. __Pyx_RaiseTooManyValuesError(index);
  21660. }
  21661. }
  21662. /* UnpackTuple2 */
  21663. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  21664. PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
  21665. PyObject *value1 = NULL, *value2 = NULL;
  21666. #if CYTHON_COMPILING_IN_PYPY
  21667. value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
  21668. value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
  21669. #else
  21670. value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
  21671. value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
  21672. #endif
  21673. if (decref_tuple) {
  21674. Py_DECREF(tuple);
  21675. }
  21676. *pvalue1 = value1;
  21677. *pvalue2 = value2;
  21678. return 0;
  21679. #if CYTHON_COMPILING_IN_PYPY
  21680. bad:
  21681. Py_XDECREF(value1);
  21682. Py_XDECREF(value2);
  21683. if (decref_tuple) { Py_XDECREF(tuple); }
  21684. return -1;
  21685. #endif
  21686. }
  21687. static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
  21688. int has_known_size, int decref_tuple) {
  21689. Py_ssize_t index;
  21690. PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
  21691. iternextfunc iternext;
  21692. iter = PyObject_GetIter(tuple);
  21693. if (unlikely(!iter)) goto bad;
  21694. if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
  21695. iternext = Py_TYPE(iter)->tp_iternext;
  21696. value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
  21697. value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
  21698. if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
  21699. Py_DECREF(iter);
  21700. *pvalue1 = value1;
  21701. *pvalue2 = value2;
  21702. return 0;
  21703. unpacking_failed:
  21704. if (!has_known_size && __Pyx_IterFinish() == 0)
  21705. __Pyx_RaiseNeedMoreValuesError(index);
  21706. bad:
  21707. Py_XDECREF(iter);
  21708. Py_XDECREF(value1);
  21709. Py_XDECREF(value2);
  21710. if (decref_tuple) { Py_XDECREF(tuple); }
  21711. return -1;
  21712. }
  21713. /* dict_iter */
  21714. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
  21715. Py_ssize_t* p_orig_length, int* p_source_is_dict) {
  21716. is_dict = is_dict || likely(PyDict_CheckExact(iterable));
  21717. *p_source_is_dict = is_dict;
  21718. if (is_dict) {
  21719. #if !CYTHON_COMPILING_IN_PYPY
  21720. *p_orig_length = PyDict_Size(iterable);
  21721. Py_INCREF(iterable);
  21722. return iterable;
  21723. #elif PY_MAJOR_VERSION >= 3
  21724. static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
  21725. PyObject **pp = NULL;
  21726. if (method_name) {
  21727. const char *name = PyUnicode_AsUTF8(method_name);
  21728. if (strcmp(name, "iteritems") == 0) pp = &py_items;
  21729. else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
  21730. else if (strcmp(name, "itervalues") == 0) pp = &py_values;
  21731. if (pp) {
  21732. if (!*pp) {
  21733. *pp = PyUnicode_FromString(name + 4);
  21734. if (!*pp)
  21735. return NULL;
  21736. }
  21737. method_name = *pp;
  21738. }
  21739. }
  21740. #endif
  21741. }
  21742. *p_orig_length = 0;
  21743. if (method_name) {
  21744. PyObject* iter;
  21745. iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
  21746. if (!iterable)
  21747. return NULL;
  21748. #if !CYTHON_COMPILING_IN_PYPY
  21749. if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
  21750. return iterable;
  21751. #endif
  21752. iter = PyObject_GetIter(iterable);
  21753. Py_DECREF(iterable);
  21754. return iter;
  21755. }
  21756. return PyObject_GetIter(iterable);
  21757. }
  21758. static CYTHON_INLINE int __Pyx_dict_iter_next(
  21759. PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
  21760. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
  21761. PyObject* next_item;
  21762. #if !CYTHON_COMPILING_IN_PYPY
  21763. if (source_is_dict) {
  21764. PyObject *key, *value;
  21765. if (unlikely(orig_length != PyDict_Size(iter_obj))) {
  21766. PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
  21767. return -1;
  21768. }
  21769. if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
  21770. return 0;
  21771. }
  21772. if (pitem) {
  21773. PyObject* tuple = PyTuple_New(2);
  21774. if (unlikely(!tuple)) {
  21775. return -1;
  21776. }
  21777. Py_INCREF(key);
  21778. Py_INCREF(value);
  21779. PyTuple_SET_ITEM(tuple, 0, key);
  21780. PyTuple_SET_ITEM(tuple, 1, value);
  21781. *pitem = tuple;
  21782. } else {
  21783. if (pkey) {
  21784. Py_INCREF(key);
  21785. *pkey = key;
  21786. }
  21787. if (pvalue) {
  21788. Py_INCREF(value);
  21789. *pvalue = value;
  21790. }
  21791. }
  21792. return 1;
  21793. } else if (PyTuple_CheckExact(iter_obj)) {
  21794. Py_ssize_t pos = *ppos;
  21795. if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
  21796. *ppos = pos + 1;
  21797. next_item = PyTuple_GET_ITEM(iter_obj, pos);
  21798. Py_INCREF(next_item);
  21799. } else if (PyList_CheckExact(iter_obj)) {
  21800. Py_ssize_t pos = *ppos;
  21801. if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
  21802. *ppos = pos + 1;
  21803. next_item = PyList_GET_ITEM(iter_obj, pos);
  21804. Py_INCREF(next_item);
  21805. } else
  21806. #endif
  21807. {
  21808. next_item = PyIter_Next(iter_obj);
  21809. if (unlikely(!next_item)) {
  21810. return __Pyx_IterFinish();
  21811. }
  21812. }
  21813. if (pitem) {
  21814. *pitem = next_item;
  21815. } else if (pkey && pvalue) {
  21816. if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
  21817. return -1;
  21818. } else if (pkey) {
  21819. *pkey = next_item;
  21820. } else {
  21821. *pvalue = next_item;
  21822. }
  21823. return 1;
  21824. }
  21825. /* PyObjectSetAttrStr */
  21826. #if CYTHON_USE_TYPE_SLOTS
  21827. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  21828. PyTypeObject* tp = Py_TYPE(obj);
  21829. if (likely(tp->tp_setattro))
  21830. return tp->tp_setattro(obj, attr_name, value);
  21831. #if PY_MAJOR_VERSION < 3
  21832. if (likely(tp->tp_setattr))
  21833. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  21834. #endif
  21835. return PyObject_SetAttr(obj, attr_name, value);
  21836. }
  21837. #endif
  21838. /* DictGetItem */
  21839. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  21840. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
  21841. PyObject *value;
  21842. value = PyDict_GetItemWithError(d, key);
  21843. if (unlikely(!value)) {
  21844. if (!PyErr_Occurred()) {
  21845. if (unlikely(PyTuple_Check(key))) {
  21846. PyObject* args = PyTuple_Pack(1, key);
  21847. if (likely(args)) {
  21848. PyErr_SetObject(PyExc_KeyError, args);
  21849. Py_DECREF(args);
  21850. }
  21851. } else {
  21852. PyErr_SetObject(PyExc_KeyError, key);
  21853. }
  21854. }
  21855. return NULL;
  21856. }
  21857. Py_INCREF(value);
  21858. return value;
  21859. }
  21860. #endif
  21861. /* ExtTypeTest */
  21862. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  21863. if (unlikely(!type)) {
  21864. PyErr_SetString(PyExc_SystemError, "Missing type object");
  21865. return 0;
  21866. }
  21867. if (likely(__Pyx_TypeCheck(obj, type)))
  21868. return 1;
  21869. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  21870. Py_TYPE(obj)->tp_name, type->tp_name);
  21871. return 0;
  21872. }
  21873. /* GetTopmostException */
  21874. #if CYTHON_USE_EXC_INFO_STACK
  21875. static _PyErr_StackItem *
  21876. __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
  21877. {
  21878. _PyErr_StackItem *exc_info = tstate->exc_info;
  21879. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  21880. exc_info->previous_item != NULL)
  21881. {
  21882. exc_info = exc_info->previous_item;
  21883. }
  21884. return exc_info;
  21885. }
  21886. #endif
  21887. /* SaveResetException */
  21888. #if CYTHON_FAST_THREAD_STATE
  21889. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  21890. #if CYTHON_USE_EXC_INFO_STACK
  21891. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  21892. *type = exc_info->exc_type;
  21893. *value = exc_info->exc_value;
  21894. *tb = exc_info->exc_traceback;
  21895. #else
  21896. *type = tstate->exc_type;
  21897. *value = tstate->exc_value;
  21898. *tb = tstate->exc_traceback;
  21899. #endif
  21900. Py_XINCREF(*type);
  21901. Py_XINCREF(*value);
  21902. Py_XINCREF(*tb);
  21903. }
  21904. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  21905. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21906. #if CYTHON_USE_EXC_INFO_STACK
  21907. _PyErr_StackItem *exc_info = tstate->exc_info;
  21908. tmp_type = exc_info->exc_type;
  21909. tmp_value = exc_info->exc_value;
  21910. tmp_tb = exc_info->exc_traceback;
  21911. exc_info->exc_type = type;
  21912. exc_info->exc_value = value;
  21913. exc_info->exc_traceback = tb;
  21914. #else
  21915. tmp_type = tstate->exc_type;
  21916. tmp_value = tstate->exc_value;
  21917. tmp_tb = tstate->exc_traceback;
  21918. tstate->exc_type = type;
  21919. tstate->exc_value = value;
  21920. tstate->exc_traceback = tb;
  21921. #endif
  21922. Py_XDECREF(tmp_type);
  21923. Py_XDECREF(tmp_value);
  21924. Py_XDECREF(tmp_tb);
  21925. }
  21926. #endif
  21927. /* PyErrExceptionMatches */
  21928. #if CYTHON_FAST_THREAD_STATE
  21929. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  21930. Py_ssize_t i, n;
  21931. n = PyTuple_GET_SIZE(tuple);
  21932. #if PY_MAJOR_VERSION >= 3
  21933. for (i=0; i<n; i++) {
  21934. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  21935. }
  21936. #endif
  21937. for (i=0; i<n; i++) {
  21938. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  21939. }
  21940. return 0;
  21941. }
  21942. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  21943. PyObject *exc_type = tstate->curexc_type;
  21944. if (exc_type == err) return 1;
  21945. if (unlikely(!exc_type)) return 0;
  21946. if (unlikely(PyTuple_Check(err)))
  21947. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  21948. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  21949. }
  21950. #endif
  21951. /* GetException */
  21952. #if CYTHON_FAST_THREAD_STATE
  21953. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
  21954. #else
  21955. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
  21956. #endif
  21957. {
  21958. PyObject *local_type, *local_value, *local_tb;
  21959. #if CYTHON_FAST_THREAD_STATE
  21960. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21961. local_type = tstate->curexc_type;
  21962. local_value = tstate->curexc_value;
  21963. local_tb = tstate->curexc_traceback;
  21964. tstate->curexc_type = 0;
  21965. tstate->curexc_value = 0;
  21966. tstate->curexc_traceback = 0;
  21967. #else
  21968. PyErr_Fetch(&local_type, &local_value, &local_tb);
  21969. #endif
  21970. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  21971. #if CYTHON_FAST_THREAD_STATE
  21972. if (unlikely(tstate->curexc_type))
  21973. #else
  21974. if (unlikely(PyErr_Occurred()))
  21975. #endif
  21976. goto bad;
  21977. #if PY_MAJOR_VERSION >= 3
  21978. if (local_tb) {
  21979. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  21980. goto bad;
  21981. }
  21982. #endif
  21983. Py_XINCREF(local_tb);
  21984. Py_XINCREF(local_type);
  21985. Py_XINCREF(local_value);
  21986. *type = local_type;
  21987. *value = local_value;
  21988. *tb = local_tb;
  21989. #if CYTHON_FAST_THREAD_STATE
  21990. #if CYTHON_USE_EXC_INFO_STACK
  21991. {
  21992. _PyErr_StackItem *exc_info = tstate->exc_info;
  21993. tmp_type = exc_info->exc_type;
  21994. tmp_value = exc_info->exc_value;
  21995. tmp_tb = exc_info->exc_traceback;
  21996. exc_info->exc_type = local_type;
  21997. exc_info->exc_value = local_value;
  21998. exc_info->exc_traceback = local_tb;
  21999. }
  22000. #else
  22001. tmp_type = tstate->exc_type;
  22002. tmp_value = tstate->exc_value;
  22003. tmp_tb = tstate->exc_traceback;
  22004. tstate->exc_type = local_type;
  22005. tstate->exc_value = local_value;
  22006. tstate->exc_traceback = local_tb;
  22007. #endif
  22008. Py_XDECREF(tmp_type);
  22009. Py_XDECREF(tmp_value);
  22010. Py_XDECREF(tmp_tb);
  22011. #else
  22012. PyErr_SetExcInfo(local_type, local_value, local_tb);
  22013. #endif
  22014. return 0;
  22015. bad:
  22016. *type = 0;
  22017. *value = 0;
  22018. *tb = 0;
  22019. Py_XDECREF(local_type);
  22020. Py_XDECREF(local_value);
  22021. Py_XDECREF(local_tb);
  22022. return -1;
  22023. }
  22024. /* PyObject_GenericGetAttrNoDict */
  22025. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22026. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  22027. PyErr_Format(PyExc_AttributeError,
  22028. #if PY_MAJOR_VERSION >= 3
  22029. "'%.50s' object has no attribute '%U'",
  22030. tp->tp_name, attr_name);
  22031. #else
  22032. "'%.50s' object has no attribute '%.400s'",
  22033. tp->tp_name, PyString_AS_STRING(attr_name));
  22034. #endif
  22035. return NULL;
  22036. }
  22037. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  22038. PyObject *descr;
  22039. PyTypeObject *tp = Py_TYPE(obj);
  22040. if (unlikely(!PyString_Check(attr_name))) {
  22041. return PyObject_GenericGetAttr(obj, attr_name);
  22042. }
  22043. assert(!tp->tp_dictoffset);
  22044. descr = _PyType_Lookup(tp, attr_name);
  22045. if (unlikely(!descr)) {
  22046. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  22047. }
  22048. Py_INCREF(descr);
  22049. #if PY_MAJOR_VERSION < 3
  22050. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  22051. #endif
  22052. {
  22053. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  22054. if (unlikely(f)) {
  22055. PyObject *res = f(descr, obj, (PyObject *)tp);
  22056. Py_DECREF(descr);
  22057. return res;
  22058. }
  22059. }
  22060. return descr;
  22061. }
  22062. #endif
  22063. /* PyObject_GenericGetAttr */
  22064. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22065. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  22066. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  22067. return PyObject_GenericGetAttr(obj, attr_name);
  22068. }
  22069. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  22070. }
  22071. #endif
  22072. /* SetupReduce */
  22073. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  22074. int ret;
  22075. PyObject *name_attr;
  22076. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  22077. if (likely(name_attr)) {
  22078. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  22079. } else {
  22080. ret = -1;
  22081. }
  22082. if (unlikely(ret < 0)) {
  22083. PyErr_Clear();
  22084. ret = 0;
  22085. }
  22086. Py_XDECREF(name_attr);
  22087. return ret;
  22088. }
  22089. static int __Pyx_setup_reduce(PyObject* type_obj) {
  22090. int ret = 0;
  22091. PyObject *object_reduce = NULL;
  22092. PyObject *object_reduce_ex = NULL;
  22093. PyObject *reduce = NULL;
  22094. PyObject *reduce_ex = NULL;
  22095. PyObject *reduce_cython = NULL;
  22096. PyObject *setstate = NULL;
  22097. PyObject *setstate_cython = NULL;
  22098. #if CYTHON_USE_PYTYPE_LOOKUP
  22099. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22100. #else
  22101. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22102. #endif
  22103. #if CYTHON_USE_PYTYPE_LOOKUP
  22104. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22105. #else
  22106. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22107. #endif
  22108. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
  22109. if (reduce_ex == object_reduce_ex) {
  22110. #if CYTHON_USE_PYTYPE_LOOKUP
  22111. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22112. #else
  22113. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22114. #endif
  22115. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
  22116. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  22117. reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
  22118. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22119. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22120. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  22121. if (!setstate) PyErr_Clear();
  22122. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  22123. setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
  22124. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22125. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22126. }
  22127. PyType_Modified((PyTypeObject*)type_obj);
  22128. }
  22129. }
  22130. goto __PYX_GOOD;
  22131. __PYX_BAD:
  22132. if (!PyErr_Occurred())
  22133. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  22134. ret = -1;
  22135. __PYX_GOOD:
  22136. #if !CYTHON_USE_PYTYPE_LOOKUP
  22137. Py_XDECREF(object_reduce);
  22138. Py_XDECREF(object_reduce_ex);
  22139. #endif
  22140. Py_XDECREF(reduce);
  22141. Py_XDECREF(reduce_ex);
  22142. Py_XDECREF(reduce_cython);
  22143. Py_XDECREF(setstate);
  22144. Py_XDECREF(setstate_cython);
  22145. return ret;
  22146. }
  22147. /* TypeImport */
  22148. #ifndef __PYX_HAVE_RT_ImportType
  22149. #define __PYX_HAVE_RT_ImportType
  22150. static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
  22151. size_t size, enum __Pyx_ImportType_CheckSize check_size)
  22152. {
  22153. PyObject *result = 0;
  22154. char warning[200];
  22155. Py_ssize_t basicsize;
  22156. #ifdef Py_LIMITED_API
  22157. PyObject *py_basicsize;
  22158. #endif
  22159. result = PyObject_GetAttrString(module, class_name);
  22160. if (!result)
  22161. goto bad;
  22162. if (!PyType_Check(result)) {
  22163. PyErr_Format(PyExc_TypeError,
  22164. "%.200s.%.200s is not a type object",
  22165. module_name, class_name);
  22166. goto bad;
  22167. }
  22168. #ifndef Py_LIMITED_API
  22169. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  22170. #else
  22171. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  22172. if (!py_basicsize)
  22173. goto bad;
  22174. basicsize = PyLong_AsSsize_t(py_basicsize);
  22175. Py_DECREF(py_basicsize);
  22176. py_basicsize = 0;
  22177. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  22178. goto bad;
  22179. #endif
  22180. if ((size_t)basicsize < size) {
  22181. PyErr_Format(PyExc_ValueError,
  22182. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22183. "Expected %zd from C header, got %zd from PyObject",
  22184. module_name, class_name, size, basicsize);
  22185. goto bad;
  22186. }
  22187. if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
  22188. PyErr_Format(PyExc_ValueError,
  22189. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22190. "Expected %zd from C header, got %zd from PyObject",
  22191. module_name, class_name, size, basicsize);
  22192. goto bad;
  22193. }
  22194. else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
  22195. PyOS_snprintf(warning, sizeof(warning),
  22196. "%s.%s size changed, may indicate binary incompatibility. "
  22197. "Expected %zd from C header, got %zd from PyObject",
  22198. module_name, class_name, size, basicsize);
  22199. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  22200. }
  22201. return (PyTypeObject *)result;
  22202. bad:
  22203. Py_XDECREF(result);
  22204. return NULL;
  22205. }
  22206. #endif
  22207. /* Import */
  22208. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  22209. PyObject *empty_list = 0;
  22210. PyObject *module = 0;
  22211. PyObject *global_dict = 0;
  22212. PyObject *empty_dict = 0;
  22213. PyObject *list;
  22214. #if PY_MAJOR_VERSION < 3
  22215. PyObject *py_import;
  22216. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  22217. if (!py_import)
  22218. goto bad;
  22219. #endif
  22220. if (from_list)
  22221. list = from_list;
  22222. else {
  22223. empty_list = PyList_New(0);
  22224. if (!empty_list)
  22225. goto bad;
  22226. list = empty_list;
  22227. }
  22228. global_dict = PyModule_GetDict(__pyx_m);
  22229. if (!global_dict)
  22230. goto bad;
  22231. empty_dict = PyDict_New();
  22232. if (!empty_dict)
  22233. goto bad;
  22234. {
  22235. #if PY_MAJOR_VERSION >= 3
  22236. if (level == -1) {
  22237. if (strchr(__Pyx_MODULE_NAME, '.')) {
  22238. module = PyImport_ImportModuleLevelObject(
  22239. name, global_dict, empty_dict, list, 1);
  22240. if (!module) {
  22241. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  22242. goto bad;
  22243. PyErr_Clear();
  22244. }
  22245. }
  22246. level = 0;
  22247. }
  22248. #endif
  22249. if (!module) {
  22250. #if PY_MAJOR_VERSION < 3
  22251. PyObject *py_level = PyInt_FromLong(level);
  22252. if (!py_level)
  22253. goto bad;
  22254. module = PyObject_CallFunctionObjArgs(py_import,
  22255. name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
  22256. Py_DECREF(py_level);
  22257. #else
  22258. module = PyImport_ImportModuleLevelObject(
  22259. name, global_dict, empty_dict, list, level);
  22260. #endif
  22261. }
  22262. }
  22263. bad:
  22264. #if PY_MAJOR_VERSION < 3
  22265. Py_XDECREF(py_import);
  22266. #endif
  22267. Py_XDECREF(empty_list);
  22268. Py_XDECREF(empty_dict);
  22269. return module;
  22270. }
  22271. /* ImportFrom */
  22272. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  22273. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  22274. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  22275. PyErr_Format(PyExc_ImportError,
  22276. #if PY_MAJOR_VERSION < 3
  22277. "cannot import name %.230s", PyString_AS_STRING(name));
  22278. #else
  22279. "cannot import name %S", name);
  22280. #endif
  22281. }
  22282. return value;
  22283. }
  22284. /* CalculateMetaclass */
  22285. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  22286. Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
  22287. for (i=0; i < nbases; i++) {
  22288. PyTypeObject *tmptype;
  22289. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  22290. tmptype = Py_TYPE(tmp);
  22291. #if PY_MAJOR_VERSION < 3
  22292. if (tmptype == &PyClass_Type)
  22293. continue;
  22294. #endif
  22295. if (!metaclass) {
  22296. metaclass = tmptype;
  22297. continue;
  22298. }
  22299. if (PyType_IsSubtype(metaclass, tmptype))
  22300. continue;
  22301. if (PyType_IsSubtype(tmptype, metaclass)) {
  22302. metaclass = tmptype;
  22303. continue;
  22304. }
  22305. PyErr_SetString(PyExc_TypeError,
  22306. "metaclass conflict: "
  22307. "the metaclass of a derived class "
  22308. "must be a (non-strict) subclass "
  22309. "of the metaclasses of all its bases");
  22310. return NULL;
  22311. }
  22312. if (!metaclass) {
  22313. #if PY_MAJOR_VERSION < 3
  22314. metaclass = &PyClass_Type;
  22315. #else
  22316. metaclass = &PyType_Type;
  22317. #endif
  22318. }
  22319. Py_INCREF((PyObject*) metaclass);
  22320. return (PyObject*) metaclass;
  22321. }
  22322. /* Py3ClassCreate */
  22323. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  22324. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  22325. PyObject *ns;
  22326. if (metaclass) {
  22327. PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
  22328. if (prep) {
  22329. PyObject *pargs = PyTuple_Pack(2, name, bases);
  22330. if (unlikely(!pargs)) {
  22331. Py_DECREF(prep);
  22332. return NULL;
  22333. }
  22334. ns = PyObject_Call(prep, pargs, mkw);
  22335. Py_DECREF(prep);
  22336. Py_DECREF(pargs);
  22337. } else {
  22338. if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
  22339. return NULL;
  22340. PyErr_Clear();
  22341. ns = PyDict_New();
  22342. }
  22343. } else {
  22344. ns = PyDict_New();
  22345. }
  22346. if (unlikely(!ns))
  22347. return NULL;
  22348. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  22349. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  22350. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  22351. return ns;
  22352. bad:
  22353. Py_DECREF(ns);
  22354. return NULL;
  22355. }
  22356. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  22357. PyObject *dict, PyObject *mkw,
  22358. int calculate_metaclass, int allow_py2_metaclass) {
  22359. PyObject *result, *margs;
  22360. PyObject *owned_metaclass = NULL;
  22361. if (allow_py2_metaclass) {
  22362. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  22363. if (owned_metaclass) {
  22364. metaclass = owned_metaclass;
  22365. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  22366. PyErr_Clear();
  22367. } else {
  22368. return NULL;
  22369. }
  22370. }
  22371. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  22372. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  22373. Py_XDECREF(owned_metaclass);
  22374. if (unlikely(!metaclass))
  22375. return NULL;
  22376. owned_metaclass = metaclass;
  22377. }
  22378. margs = PyTuple_Pack(3, name, bases, dict);
  22379. if (unlikely(!margs)) {
  22380. result = NULL;
  22381. } else {
  22382. result = PyObject_Call(metaclass, margs, mkw);
  22383. Py_DECREF(margs);
  22384. }
  22385. Py_XDECREF(owned_metaclass);
  22386. return result;
  22387. }
  22388. /* FetchCommonType */
  22389. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  22390. PyObject* fake_module;
  22391. PyTypeObject* cached_type = NULL;
  22392. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  22393. if (!fake_module) return NULL;
  22394. Py_INCREF(fake_module);
  22395. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  22396. if (cached_type) {
  22397. if (!PyType_Check((PyObject*)cached_type)) {
  22398. PyErr_Format(PyExc_TypeError,
  22399. "Shared Cython type %.200s is not a type object",
  22400. type->tp_name);
  22401. goto bad;
  22402. }
  22403. if (cached_type->tp_basicsize != type->tp_basicsize) {
  22404. PyErr_Format(PyExc_TypeError,
  22405. "Shared Cython type %.200s has the wrong size, try recompiling",
  22406. type->tp_name);
  22407. goto bad;
  22408. }
  22409. } else {
  22410. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  22411. PyErr_Clear();
  22412. if (PyType_Ready(type) < 0) goto bad;
  22413. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  22414. goto bad;
  22415. Py_INCREF(type);
  22416. cached_type = type;
  22417. }
  22418. done:
  22419. Py_DECREF(fake_module);
  22420. return cached_type;
  22421. bad:
  22422. Py_XDECREF(cached_type);
  22423. cached_type = NULL;
  22424. goto done;
  22425. }
  22426. /* CythonFunction */
  22427. #include <structmember.h>
  22428. static PyObject *
  22429. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  22430. {
  22431. if (unlikely(op->func_doc == NULL)) {
  22432. if (op->func.m_ml->ml_doc) {
  22433. #if PY_MAJOR_VERSION >= 3
  22434. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  22435. #else
  22436. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  22437. #endif
  22438. if (unlikely(op->func_doc == NULL))
  22439. return NULL;
  22440. } else {
  22441. Py_INCREF(Py_None);
  22442. return Py_None;
  22443. }
  22444. }
  22445. Py_INCREF(op->func_doc);
  22446. return op->func_doc;
  22447. }
  22448. static int
  22449. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  22450. {
  22451. PyObject *tmp = op->func_doc;
  22452. if (value == NULL) {
  22453. value = Py_None;
  22454. }
  22455. Py_INCREF(value);
  22456. op->func_doc = value;
  22457. Py_XDECREF(tmp);
  22458. return 0;
  22459. }
  22460. static PyObject *
  22461. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22462. {
  22463. if (unlikely(op->func_name == NULL)) {
  22464. #if PY_MAJOR_VERSION >= 3
  22465. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  22466. #else
  22467. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  22468. #endif
  22469. if (unlikely(op->func_name == NULL))
  22470. return NULL;
  22471. }
  22472. Py_INCREF(op->func_name);
  22473. return op->func_name;
  22474. }
  22475. static int
  22476. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  22477. {
  22478. PyObject *tmp;
  22479. #if PY_MAJOR_VERSION >= 3
  22480. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  22481. #else
  22482. if (unlikely(value == NULL || !PyString_Check(value)))
  22483. #endif
  22484. {
  22485. PyErr_SetString(PyExc_TypeError,
  22486. "__name__ must be set to a string object");
  22487. return -1;
  22488. }
  22489. tmp = op->func_name;
  22490. Py_INCREF(value);
  22491. op->func_name = value;
  22492. Py_XDECREF(tmp);
  22493. return 0;
  22494. }
  22495. static PyObject *
  22496. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22497. {
  22498. Py_INCREF(op->func_qualname);
  22499. return op->func_qualname;
  22500. }
  22501. static int
  22502. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  22503. {
  22504. PyObject *tmp;
  22505. #if PY_MAJOR_VERSION >= 3
  22506. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  22507. #else
  22508. if (unlikely(value == NULL || !PyString_Check(value)))
  22509. #endif
  22510. {
  22511. PyErr_SetString(PyExc_TypeError,
  22512. "__qualname__ must be set to a string object");
  22513. return -1;
  22514. }
  22515. tmp = op->func_qualname;
  22516. Py_INCREF(value);
  22517. op->func_qualname = value;
  22518. Py_XDECREF(tmp);
  22519. return 0;
  22520. }
  22521. static PyObject *
  22522. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  22523. {
  22524. PyObject *self;
  22525. self = m->func_closure;
  22526. if (self == NULL)
  22527. self = Py_None;
  22528. Py_INCREF(self);
  22529. return self;
  22530. }
  22531. static PyObject *
  22532. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22533. {
  22534. if (unlikely(op->func_dict == NULL)) {
  22535. op->func_dict = PyDict_New();
  22536. if (unlikely(op->func_dict == NULL))
  22537. return NULL;
  22538. }
  22539. Py_INCREF(op->func_dict);
  22540. return op->func_dict;
  22541. }
  22542. static int
  22543. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  22544. {
  22545. PyObject *tmp;
  22546. if (unlikely(value == NULL)) {
  22547. PyErr_SetString(PyExc_TypeError,
  22548. "function's dictionary may not be deleted");
  22549. return -1;
  22550. }
  22551. if (unlikely(!PyDict_Check(value))) {
  22552. PyErr_SetString(PyExc_TypeError,
  22553. "setting function's dictionary to a non-dict");
  22554. return -1;
  22555. }
  22556. tmp = op->func_dict;
  22557. Py_INCREF(value);
  22558. op->func_dict = value;
  22559. Py_XDECREF(tmp);
  22560. return 0;
  22561. }
  22562. static PyObject *
  22563. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22564. {
  22565. Py_INCREF(op->func_globals);
  22566. return op->func_globals;
  22567. }
  22568. static PyObject *
  22569. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22570. {
  22571. Py_INCREF(Py_None);
  22572. return Py_None;
  22573. }
  22574. static PyObject *
  22575. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22576. {
  22577. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  22578. Py_INCREF(result);
  22579. return result;
  22580. }
  22581. static int
  22582. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  22583. int result = 0;
  22584. PyObject *res = op->defaults_getter((PyObject *) op);
  22585. if (unlikely(!res))
  22586. return -1;
  22587. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  22588. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  22589. Py_INCREF(op->defaults_tuple);
  22590. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  22591. Py_INCREF(op->defaults_kwdict);
  22592. #else
  22593. op->defaults_tuple = PySequence_ITEM(res, 0);
  22594. if (unlikely(!op->defaults_tuple)) result = -1;
  22595. else {
  22596. op->defaults_kwdict = PySequence_ITEM(res, 1);
  22597. if (unlikely(!op->defaults_kwdict)) result = -1;
  22598. }
  22599. #endif
  22600. Py_DECREF(res);
  22601. return result;
  22602. }
  22603. static int
  22604. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22605. PyObject* tmp;
  22606. if (!value) {
  22607. value = Py_None;
  22608. } else if (value != Py_None && !PyTuple_Check(value)) {
  22609. PyErr_SetString(PyExc_TypeError,
  22610. "__defaults__ must be set to a tuple object");
  22611. return -1;
  22612. }
  22613. Py_INCREF(value);
  22614. tmp = op->defaults_tuple;
  22615. op->defaults_tuple = value;
  22616. Py_XDECREF(tmp);
  22617. return 0;
  22618. }
  22619. static PyObject *
  22620. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22621. PyObject* result = op->defaults_tuple;
  22622. if (unlikely(!result)) {
  22623. if (op->defaults_getter) {
  22624. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  22625. result = op->defaults_tuple;
  22626. } else {
  22627. result = Py_None;
  22628. }
  22629. }
  22630. Py_INCREF(result);
  22631. return result;
  22632. }
  22633. static int
  22634. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22635. PyObject* tmp;
  22636. if (!value) {
  22637. value = Py_None;
  22638. } else if (value != Py_None && !PyDict_Check(value)) {
  22639. PyErr_SetString(PyExc_TypeError,
  22640. "__kwdefaults__ must be set to a dict object");
  22641. return -1;
  22642. }
  22643. Py_INCREF(value);
  22644. tmp = op->defaults_kwdict;
  22645. op->defaults_kwdict = value;
  22646. Py_XDECREF(tmp);
  22647. return 0;
  22648. }
  22649. static PyObject *
  22650. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22651. PyObject* result = op->defaults_kwdict;
  22652. if (unlikely(!result)) {
  22653. if (op->defaults_getter) {
  22654. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  22655. result = op->defaults_kwdict;
  22656. } else {
  22657. result = Py_None;
  22658. }
  22659. }
  22660. Py_INCREF(result);
  22661. return result;
  22662. }
  22663. static int
  22664. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22665. PyObject* tmp;
  22666. if (!value || value == Py_None) {
  22667. value = NULL;
  22668. } else if (!PyDict_Check(value)) {
  22669. PyErr_SetString(PyExc_TypeError,
  22670. "__annotations__ must be set to a dict object");
  22671. return -1;
  22672. }
  22673. Py_XINCREF(value);
  22674. tmp = op->func_annotations;
  22675. op->func_annotations = value;
  22676. Py_XDECREF(tmp);
  22677. return 0;
  22678. }
  22679. static PyObject *
  22680. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22681. PyObject* result = op->func_annotations;
  22682. if (unlikely(!result)) {
  22683. result = PyDict_New();
  22684. if (unlikely(!result)) return NULL;
  22685. op->func_annotations = result;
  22686. }
  22687. Py_INCREF(result);
  22688. return result;
  22689. }
  22690. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  22691. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  22692. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  22693. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  22694. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  22695. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  22696. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  22697. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  22698. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  22699. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  22700. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  22701. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  22702. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  22703. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  22704. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  22705. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  22706. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  22707. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  22708. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  22709. {0, 0, 0, 0, 0}
  22710. };
  22711. static PyMemberDef __pyx_CyFunction_members[] = {
  22712. {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
  22713. {0, 0, 0, 0, 0}
  22714. };
  22715. static PyObject *
  22716. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  22717. {
  22718. #if PY_MAJOR_VERSION >= 3
  22719. return PyUnicode_FromString(m->func.m_ml->ml_name);
  22720. #else
  22721. return PyString_FromString(m->func.m_ml->ml_name);
  22722. #endif
  22723. }
  22724. static PyMethodDef __pyx_CyFunction_methods[] = {
  22725. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  22726. {0, 0, 0, 0}
  22727. };
  22728. #if PY_VERSION_HEX < 0x030500A0
  22729. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  22730. #else
  22731. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
  22732. #endif
  22733. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  22734. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  22735. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  22736. if (op == NULL)
  22737. return NULL;
  22738. op->flags = flags;
  22739. __Pyx_CyFunction_weakreflist(op) = NULL;
  22740. op->func.m_ml = ml;
  22741. op->func.m_self = (PyObject *) op;
  22742. Py_XINCREF(closure);
  22743. op->func_closure = closure;
  22744. Py_XINCREF(module);
  22745. op->func.m_module = module;
  22746. op->func_dict = NULL;
  22747. op->func_name = NULL;
  22748. Py_INCREF(qualname);
  22749. op->func_qualname = qualname;
  22750. op->func_doc = NULL;
  22751. op->func_classobj = NULL;
  22752. op->func_globals = globals;
  22753. Py_INCREF(op->func_globals);
  22754. Py_XINCREF(code);
  22755. op->func_code = code;
  22756. op->defaults_pyobjects = 0;
  22757. op->defaults_size = 0;
  22758. op->defaults = NULL;
  22759. op->defaults_tuple = NULL;
  22760. op->defaults_kwdict = NULL;
  22761. op->defaults_getter = NULL;
  22762. op->func_annotations = NULL;
  22763. PyObject_GC_Track(op);
  22764. return (PyObject *) op;
  22765. }
  22766. static int
  22767. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  22768. {
  22769. Py_CLEAR(m->func_closure);
  22770. Py_CLEAR(m->func.m_module);
  22771. Py_CLEAR(m->func_dict);
  22772. Py_CLEAR(m->func_name);
  22773. Py_CLEAR(m->func_qualname);
  22774. Py_CLEAR(m->func_doc);
  22775. Py_CLEAR(m->func_globals);
  22776. Py_CLEAR(m->func_code);
  22777. Py_CLEAR(m->func_classobj);
  22778. Py_CLEAR(m->defaults_tuple);
  22779. Py_CLEAR(m->defaults_kwdict);
  22780. Py_CLEAR(m->func_annotations);
  22781. if (m->defaults) {
  22782. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  22783. int i;
  22784. for (i = 0; i < m->defaults_pyobjects; i++)
  22785. Py_XDECREF(pydefaults[i]);
  22786. PyObject_Free(m->defaults);
  22787. m->defaults = NULL;
  22788. }
  22789. return 0;
  22790. }
  22791. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  22792. {
  22793. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  22794. PyObject_ClearWeakRefs((PyObject *) m);
  22795. __Pyx_CyFunction_clear(m);
  22796. PyObject_GC_Del(m);
  22797. }
  22798. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  22799. {
  22800. PyObject_GC_UnTrack(m);
  22801. __Pyx__CyFunction_dealloc(m);
  22802. }
  22803. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  22804. {
  22805. Py_VISIT(m->func_closure);
  22806. Py_VISIT(m->func.m_module);
  22807. Py_VISIT(m->func_dict);
  22808. Py_VISIT(m->func_name);
  22809. Py_VISIT(m->func_qualname);
  22810. Py_VISIT(m->func_doc);
  22811. Py_VISIT(m->func_globals);
  22812. Py_VISIT(m->func_code);
  22813. Py_VISIT(m->func_classobj);
  22814. Py_VISIT(m->defaults_tuple);
  22815. Py_VISIT(m->defaults_kwdict);
  22816. if (m->defaults) {
  22817. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  22818. int i;
  22819. for (i = 0; i < m->defaults_pyobjects; i++)
  22820. Py_VISIT(pydefaults[i]);
  22821. }
  22822. return 0;
  22823. }
  22824. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  22825. {
  22826. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22827. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  22828. Py_INCREF(func);
  22829. return func;
  22830. }
  22831. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  22832. if (type == NULL)
  22833. type = (PyObject *)(Py_TYPE(obj));
  22834. return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
  22835. }
  22836. if (obj == Py_None)
  22837. obj = NULL;
  22838. return __Pyx_PyMethod_New(func, obj, type);
  22839. }
  22840. static PyObject*
  22841. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  22842. {
  22843. #if PY_MAJOR_VERSION >= 3
  22844. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  22845. op->func_qualname, (void *)op);
  22846. #else
  22847. return PyString_FromFormat("<cyfunction %s at %p>",
  22848. PyString_AsString(op->func_qualname), (void *)op);
  22849. #endif
  22850. }
  22851. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  22852. PyCFunctionObject* f = (PyCFunctionObject*)func;
  22853. PyCFunction meth = f->m_ml->ml_meth;
  22854. Py_ssize_t size;
  22855. switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  22856. case METH_VARARGS:
  22857. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  22858. return (*meth)(self, arg);
  22859. break;
  22860. case METH_VARARGS | METH_KEYWORDS:
  22861. return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
  22862. case METH_NOARGS:
  22863. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  22864. size = PyTuple_GET_SIZE(arg);
  22865. if (likely(size == 0))
  22866. return (*meth)(self, NULL);
  22867. PyErr_Format(PyExc_TypeError,
  22868. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  22869. f->m_ml->ml_name, size);
  22870. return NULL;
  22871. }
  22872. break;
  22873. case METH_O:
  22874. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  22875. size = PyTuple_GET_SIZE(arg);
  22876. if (likely(size == 1)) {
  22877. PyObject *result, *arg0;
  22878. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  22879. arg0 = PyTuple_GET_ITEM(arg, 0);
  22880. #else
  22881. arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  22882. #endif
  22883. result = (*meth)(self, arg0);
  22884. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  22885. Py_DECREF(arg0);
  22886. #endif
  22887. return result;
  22888. }
  22889. PyErr_Format(PyExc_TypeError,
  22890. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  22891. f->m_ml->ml_name, size);
  22892. return NULL;
  22893. }
  22894. break;
  22895. default:
  22896. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  22897. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  22898. "longer supported!");
  22899. return NULL;
  22900. }
  22901. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  22902. f->m_ml->ml_name);
  22903. return NULL;
  22904. }
  22905. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  22906. return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
  22907. }
  22908. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  22909. PyObject *result;
  22910. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  22911. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  22912. Py_ssize_t argc;
  22913. PyObject *new_args;
  22914. PyObject *self;
  22915. argc = PyTuple_GET_SIZE(args);
  22916. new_args = PyTuple_GetSlice(args, 1, argc);
  22917. if (unlikely(!new_args))
  22918. return NULL;
  22919. self = PyTuple_GetItem(args, 0);
  22920. if (unlikely(!self)) {
  22921. Py_DECREF(new_args);
  22922. return NULL;
  22923. }
  22924. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  22925. Py_DECREF(new_args);
  22926. } else {
  22927. result = __Pyx_CyFunction_Call(func, args, kw);
  22928. }
  22929. return result;
  22930. }
  22931. static PyTypeObject __pyx_CyFunctionType_type = {
  22932. PyVarObject_HEAD_INIT(0, 0)
  22933. "cython_function_or_method",
  22934. sizeof(__pyx_CyFunctionObject),
  22935. 0,
  22936. (destructor) __Pyx_CyFunction_dealloc,
  22937. 0,
  22938. 0,
  22939. 0,
  22940. #if PY_MAJOR_VERSION < 3
  22941. 0,
  22942. #else
  22943. 0,
  22944. #endif
  22945. (reprfunc) __Pyx_CyFunction_repr,
  22946. 0,
  22947. 0,
  22948. 0,
  22949. 0,
  22950. __Pyx_CyFunction_CallAsMethod,
  22951. 0,
  22952. 0,
  22953. 0,
  22954. 0,
  22955. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
  22956. 0,
  22957. (traverseproc) __Pyx_CyFunction_traverse,
  22958. (inquiry) __Pyx_CyFunction_clear,
  22959. 0,
  22960. #if PY_VERSION_HEX < 0x030500A0
  22961. offsetof(__pyx_CyFunctionObject, func_weakreflist),
  22962. #else
  22963. offsetof(PyCFunctionObject, m_weakreflist),
  22964. #endif
  22965. 0,
  22966. 0,
  22967. __pyx_CyFunction_methods,
  22968. __pyx_CyFunction_members,
  22969. __pyx_CyFunction_getsets,
  22970. 0,
  22971. 0,
  22972. __Pyx_CyFunction_descr_get,
  22973. 0,
  22974. offsetof(__pyx_CyFunctionObject, func_dict),
  22975. 0,
  22976. 0,
  22977. 0,
  22978. 0,
  22979. 0,
  22980. 0,
  22981. 0,
  22982. 0,
  22983. 0,
  22984. 0,
  22985. 0,
  22986. 0,
  22987. #if PY_VERSION_HEX >= 0x030400a1
  22988. 0,
  22989. #endif
  22990. #if PY_VERSION_HEX >= 0x030800b1
  22991. 0,
  22992. #endif
  22993. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  22994. 0,
  22995. #endif
  22996. };
  22997. static int __pyx_CyFunction_init(void) {
  22998. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  22999. if (unlikely(__pyx_CyFunctionType == NULL)) {
  23000. return -1;
  23001. }
  23002. return 0;
  23003. }
  23004. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  23005. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23006. m->defaults = PyObject_Malloc(size);
  23007. if (unlikely(!m->defaults))
  23008. return PyErr_NoMemory();
  23009. memset(m->defaults, 0, size);
  23010. m->defaults_pyobjects = pyobjects;
  23011. m->defaults_size = size;
  23012. return m->defaults;
  23013. }
  23014. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  23015. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23016. m->defaults_tuple = tuple;
  23017. Py_INCREF(tuple);
  23018. }
  23019. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  23020. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23021. m->defaults_kwdict = dict;
  23022. Py_INCREF(dict);
  23023. }
  23024. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  23025. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23026. m->func_annotations = dict;
  23027. Py_INCREF(dict);
  23028. }
  23029. /* CLineInTraceback */
  23030. #ifndef CYTHON_CLINE_IN_TRACEBACK
  23031. static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
  23032. PyObject *use_cline;
  23033. PyObject *ptype, *pvalue, *ptraceback;
  23034. #if CYTHON_COMPILING_IN_CPYTHON
  23035. PyObject **cython_runtime_dict;
  23036. #endif
  23037. if (unlikely(!__pyx_cython_runtime)) {
  23038. return c_line;
  23039. }
  23040. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  23041. #if CYTHON_COMPILING_IN_CPYTHON
  23042. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  23043. if (likely(cython_runtime_dict)) {
  23044. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  23045. use_cline, *cython_runtime_dict,
  23046. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  23047. } else
  23048. #endif
  23049. {
  23050. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  23051. if (use_cline_obj) {
  23052. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  23053. Py_DECREF(use_cline_obj);
  23054. } else {
  23055. PyErr_Clear();
  23056. use_cline = NULL;
  23057. }
  23058. }
  23059. if (!use_cline) {
  23060. c_line = 0;
  23061. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  23062. }
  23063. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  23064. c_line = 0;
  23065. }
  23066. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  23067. return c_line;
  23068. }
  23069. #endif
  23070. /* CodeObjectCache */
  23071. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  23072. int start = 0, mid = 0, end = count - 1;
  23073. if (end >= 0 && code_line > entries[end].code_line) {
  23074. return count;
  23075. }
  23076. while (start < end) {
  23077. mid = start + (end - start) / 2;
  23078. if (code_line < entries[mid].code_line) {
  23079. end = mid;
  23080. } else if (code_line > entries[mid].code_line) {
  23081. start = mid + 1;
  23082. } else {
  23083. return mid;
  23084. }
  23085. }
  23086. if (code_line <= entries[mid].code_line) {
  23087. return mid;
  23088. } else {
  23089. return mid + 1;
  23090. }
  23091. }
  23092. static PyCodeObject *__pyx_find_code_object(int code_line) {
  23093. PyCodeObject* code_object;
  23094. int pos;
  23095. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  23096. return NULL;
  23097. }
  23098. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23099. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  23100. return NULL;
  23101. }
  23102. code_object = __pyx_code_cache.entries[pos].code_object;
  23103. Py_INCREF(code_object);
  23104. return code_object;
  23105. }
  23106. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  23107. int pos, i;
  23108. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  23109. if (unlikely(!code_line)) {
  23110. return;
  23111. }
  23112. if (unlikely(!entries)) {
  23113. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  23114. if (likely(entries)) {
  23115. __pyx_code_cache.entries = entries;
  23116. __pyx_code_cache.max_count = 64;
  23117. __pyx_code_cache.count = 1;
  23118. entries[0].code_line = code_line;
  23119. entries[0].code_object = code_object;
  23120. Py_INCREF(code_object);
  23121. }
  23122. return;
  23123. }
  23124. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23125. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  23126. PyCodeObject* tmp = entries[pos].code_object;
  23127. entries[pos].code_object = code_object;
  23128. Py_DECREF(tmp);
  23129. return;
  23130. }
  23131. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  23132. int new_max = __pyx_code_cache.max_count + 64;
  23133. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  23134. __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  23135. if (unlikely(!entries)) {
  23136. return;
  23137. }
  23138. __pyx_code_cache.entries = entries;
  23139. __pyx_code_cache.max_count = new_max;
  23140. }
  23141. for (i=__pyx_code_cache.count; i>pos; i--) {
  23142. entries[i] = entries[i-1];
  23143. }
  23144. entries[pos].code_line = code_line;
  23145. entries[pos].code_object = code_object;
  23146. __pyx_code_cache.count++;
  23147. Py_INCREF(code_object);
  23148. }
  23149. /* AddTraceback */
  23150. #include "compile.h"
  23151. #include "frameobject.h"
  23152. #include "traceback.h"
  23153. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  23154. const char *funcname, int c_line,
  23155. int py_line, const char *filename) {
  23156. PyCodeObject *py_code = 0;
  23157. PyObject *py_srcfile = 0;
  23158. PyObject *py_funcname = 0;
  23159. #if PY_MAJOR_VERSION < 3
  23160. py_srcfile = PyString_FromString(filename);
  23161. #else
  23162. py_srcfile = PyUnicode_FromString(filename);
  23163. #endif
  23164. if (!py_srcfile) goto bad;
  23165. if (c_line) {
  23166. #if PY_MAJOR_VERSION < 3
  23167. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23168. #else
  23169. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23170. #endif
  23171. }
  23172. else {
  23173. #if PY_MAJOR_VERSION < 3
  23174. py_funcname = PyString_FromString(funcname);
  23175. #else
  23176. py_funcname = PyUnicode_FromString(funcname);
  23177. #endif
  23178. }
  23179. if (!py_funcname) goto bad;
  23180. py_code = __Pyx_PyCode_New(
  23181. 0,
  23182. 0,
  23183. 0,
  23184. 0,
  23185. 0,
  23186. __pyx_empty_bytes, /*PyObject *code,*/
  23187. __pyx_empty_tuple, /*PyObject *consts,*/
  23188. __pyx_empty_tuple, /*PyObject *names,*/
  23189. __pyx_empty_tuple, /*PyObject *varnames,*/
  23190. __pyx_empty_tuple, /*PyObject *freevars,*/
  23191. __pyx_empty_tuple, /*PyObject *cellvars,*/
  23192. py_srcfile, /*PyObject *filename,*/
  23193. py_funcname, /*PyObject *name,*/
  23194. py_line,
  23195. __pyx_empty_bytes /*PyObject *lnotab*/
  23196. );
  23197. Py_DECREF(py_srcfile);
  23198. Py_DECREF(py_funcname);
  23199. return py_code;
  23200. bad:
  23201. Py_XDECREF(py_srcfile);
  23202. Py_XDECREF(py_funcname);
  23203. return NULL;
  23204. }
  23205. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  23206. int py_line, const char *filename) {
  23207. PyCodeObject *py_code = 0;
  23208. PyFrameObject *py_frame = 0;
  23209. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  23210. if (c_line) {
  23211. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  23212. }
  23213. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  23214. if (!py_code) {
  23215. py_code = __Pyx_CreateCodeObjectForTraceback(
  23216. funcname, c_line, py_line, filename);
  23217. if (!py_code) goto bad;
  23218. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  23219. }
  23220. py_frame = PyFrame_New(
  23221. tstate, /*PyThreadState *tstate,*/
  23222. py_code, /*PyCodeObject *code,*/
  23223. __pyx_d, /*PyObject *globals,*/
  23224. 0 /*PyObject *locals*/
  23225. );
  23226. if (!py_frame) goto bad;
  23227. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  23228. PyTraceBack_Here(py_frame);
  23229. bad:
  23230. Py_XDECREF(py_code);
  23231. Py_XDECREF(py_frame);
  23232. }
  23233. /* CIntFromPyVerify */
  23234. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  23235. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  23236. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  23237. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  23238. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  23239. {\
  23240. func_type value = func_value;\
  23241. if (sizeof(target_type) < sizeof(func_type)) {\
  23242. if (unlikely(value != (func_type) (target_type) value)) {\
  23243. func_type zero = 0;\
  23244. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  23245. return (target_type) -1;\
  23246. if (is_unsigned && unlikely(value < zero))\
  23247. goto raise_neg_overflow;\
  23248. else\
  23249. goto raise_overflow;\
  23250. }\
  23251. }\
  23252. return (target_type) value;\
  23253. }
  23254. /* CIntToPy */
  23255. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
  23256. const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
  23257. const int is_unsigned = neg_one > const_zero;
  23258. if (is_unsigned) {
  23259. if (sizeof(npy_uint64) < sizeof(long)) {
  23260. return PyInt_FromLong((long) value);
  23261. } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
  23262. return PyLong_FromUnsignedLong((unsigned long) value);
  23263. #ifdef HAVE_LONG_LONG
  23264. } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
  23265. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23266. #endif
  23267. }
  23268. } else {
  23269. if (sizeof(npy_uint64) <= sizeof(long)) {
  23270. return PyInt_FromLong((long) value);
  23271. #ifdef HAVE_LONG_LONG
  23272. } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
  23273. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23274. #endif
  23275. }
  23276. }
  23277. {
  23278. int one = 1; int little = (int)*(unsigned char *)&one;
  23279. unsigned char *bytes = (unsigned char *)&value;
  23280. return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
  23281. little, !is_unsigned);
  23282. }
  23283. }
  23284. /* CIntToPy */
  23285. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  23286. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  23287. const int is_unsigned = neg_one > const_zero;
  23288. if (is_unsigned) {
  23289. if (sizeof(int) < sizeof(long)) {
  23290. return PyInt_FromLong((long) value);
  23291. } else if (sizeof(int) <= sizeof(unsigned long)) {
  23292. return PyLong_FromUnsignedLong((unsigned long) value);
  23293. #ifdef HAVE_LONG_LONG
  23294. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  23295. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23296. #endif
  23297. }
  23298. } else {
  23299. if (sizeof(int) <= sizeof(long)) {
  23300. return PyInt_FromLong((long) value);
  23301. #ifdef HAVE_LONG_LONG
  23302. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  23303. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23304. #endif
  23305. }
  23306. }
  23307. {
  23308. int one = 1; int little = (int)*(unsigned char *)&one;
  23309. unsigned char *bytes = (unsigned char *)&value;
  23310. return _PyLong_FromByteArray(bytes, sizeof(int),
  23311. little, !is_unsigned);
  23312. }
  23313. }
  23314. /* CIntToPy */
  23315. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  23316. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  23317. const int is_unsigned = neg_one > const_zero;
  23318. if (is_unsigned) {
  23319. if (sizeof(long) < sizeof(long)) {
  23320. return PyInt_FromLong((long) value);
  23321. } else if (sizeof(long) <= sizeof(unsigned long)) {
  23322. return PyLong_FromUnsignedLong((unsigned long) value);
  23323. #ifdef HAVE_LONG_LONG
  23324. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  23325. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23326. #endif
  23327. }
  23328. } else {
  23329. if (sizeof(long) <= sizeof(long)) {
  23330. return PyInt_FromLong((long) value);
  23331. #ifdef HAVE_LONG_LONG
  23332. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  23333. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23334. #endif
  23335. }
  23336. }
  23337. {
  23338. int one = 1; int little = (int)*(unsigned char *)&one;
  23339. unsigned char *bytes = (unsigned char *)&value;
  23340. return _PyLong_FromByteArray(bytes, sizeof(long),
  23341. little, !is_unsigned);
  23342. }
  23343. }
  23344. /* Declarations */
  23345. #if CYTHON_CCOMPLEX
  23346. #ifdef __cplusplus
  23347. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23348. return ::std::complex< float >(x, y);
  23349. }
  23350. #else
  23351. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23352. return x + y*(__pyx_t_float_complex)_Complex_I;
  23353. }
  23354. #endif
  23355. #else
  23356. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23357. __pyx_t_float_complex z;
  23358. z.real = x;
  23359. z.imag = y;
  23360. return z;
  23361. }
  23362. #endif
  23363. /* Arithmetic */
  23364. #if CYTHON_CCOMPLEX
  23365. #else
  23366. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23367. return (a.real == b.real) && (a.imag == b.imag);
  23368. }
  23369. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23370. __pyx_t_float_complex z;
  23371. z.real = a.real + b.real;
  23372. z.imag = a.imag + b.imag;
  23373. return z;
  23374. }
  23375. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23376. __pyx_t_float_complex z;
  23377. z.real = a.real - b.real;
  23378. z.imag = a.imag - b.imag;
  23379. return z;
  23380. }
  23381. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23382. __pyx_t_float_complex z;
  23383. z.real = a.real * b.real - a.imag * b.imag;
  23384. z.imag = a.real * b.imag + a.imag * b.real;
  23385. return z;
  23386. }
  23387. #if 1
  23388. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23389. if (b.imag == 0) {
  23390. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23391. } else if (fabsf(b.real) >= fabsf(b.imag)) {
  23392. if (b.real == 0 && b.imag == 0) {
  23393. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
  23394. } else {
  23395. float r = b.imag / b.real;
  23396. float s = (float)(1.0) / (b.real + b.imag * r);
  23397. return __pyx_t_float_complex_from_parts(
  23398. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  23399. }
  23400. } else {
  23401. float r = b.real / b.imag;
  23402. float s = (float)(1.0) / (b.imag + b.real * r);
  23403. return __pyx_t_float_complex_from_parts(
  23404. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  23405. }
  23406. }
  23407. #else
  23408. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23409. if (b.imag == 0) {
  23410. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23411. } else {
  23412. float denom = b.real * b.real + b.imag * b.imag;
  23413. return __pyx_t_float_complex_from_parts(
  23414. (a.real * b.real + a.imag * b.imag) / denom,
  23415. (a.imag * b.real - a.real * b.imag) / denom);
  23416. }
  23417. }
  23418. #endif
  23419. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
  23420. __pyx_t_float_complex z;
  23421. z.real = -a.real;
  23422. z.imag = -a.imag;
  23423. return z;
  23424. }
  23425. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
  23426. return (a.real == 0) && (a.imag == 0);
  23427. }
  23428. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
  23429. __pyx_t_float_complex z;
  23430. z.real = a.real;
  23431. z.imag = -a.imag;
  23432. return z;
  23433. }
  23434. #if 1
  23435. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
  23436. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  23437. return sqrtf(z.real*z.real + z.imag*z.imag);
  23438. #else
  23439. return hypotf(z.real, z.imag);
  23440. #endif
  23441. }
  23442. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23443. __pyx_t_float_complex z;
  23444. float r, lnr, theta, z_r, z_theta;
  23445. if (b.imag == 0 && b.real == (int)b.real) {
  23446. if (b.real < 0) {
  23447. float denom = a.real * a.real + a.imag * a.imag;
  23448. a.real = a.real / denom;
  23449. a.imag = -a.imag / denom;
  23450. b.real = -b.real;
  23451. }
  23452. switch ((int)b.real) {
  23453. case 0:
  23454. z.real = 1;
  23455. z.imag = 0;
  23456. return z;
  23457. case 1:
  23458. return a;
  23459. case 2:
  23460. return __Pyx_c_prod_float(a, a);
  23461. case 3:
  23462. z = __Pyx_c_prod_float(a, a);
  23463. return __Pyx_c_prod_float(z, a);
  23464. case 4:
  23465. z = __Pyx_c_prod_float(a, a);
  23466. return __Pyx_c_prod_float(z, z);
  23467. }
  23468. }
  23469. if (a.imag == 0) {
  23470. if (a.real == 0) {
  23471. return a;
  23472. } else if (b.imag == 0) {
  23473. z.real = powf(a.real, b.real);
  23474. z.imag = 0;
  23475. return z;
  23476. } else if (a.real > 0) {
  23477. r = a.real;
  23478. theta = 0;
  23479. } else {
  23480. r = -a.real;
  23481. theta = atan2f(0.0, -1.0);
  23482. }
  23483. } else {
  23484. r = __Pyx_c_abs_float(a);
  23485. theta = atan2f(a.imag, a.real);
  23486. }
  23487. lnr = logf(r);
  23488. z_r = expf(lnr * b.real - theta * b.imag);
  23489. z_theta = theta * b.real + lnr * b.imag;
  23490. z.real = z_r * cosf(z_theta);
  23491. z.imag = z_r * sinf(z_theta);
  23492. return z;
  23493. }
  23494. #endif
  23495. #endif
  23496. /* Declarations */
  23497. #if CYTHON_CCOMPLEX
  23498. #ifdef __cplusplus
  23499. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  23500. return ::std::complex< double >(x, y);
  23501. }
  23502. #else
  23503. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  23504. return x + y*(__pyx_t_double_complex)_Complex_I;
  23505. }
  23506. #endif
  23507. #else
  23508. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  23509. __pyx_t_double_complex z;
  23510. z.real = x;
  23511. z.imag = y;
  23512. return z;
  23513. }
  23514. #endif
  23515. /* Arithmetic */
  23516. #if CYTHON_CCOMPLEX
  23517. #else
  23518. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23519. return (a.real == b.real) && (a.imag == b.imag);
  23520. }
  23521. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23522. __pyx_t_double_complex z;
  23523. z.real = a.real + b.real;
  23524. z.imag = a.imag + b.imag;
  23525. return z;
  23526. }
  23527. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23528. __pyx_t_double_complex z;
  23529. z.real = a.real - b.real;
  23530. z.imag = a.imag - b.imag;
  23531. return z;
  23532. }
  23533. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23534. __pyx_t_double_complex z;
  23535. z.real = a.real * b.real - a.imag * b.imag;
  23536. z.imag = a.real * b.imag + a.imag * b.real;
  23537. return z;
  23538. }
  23539. #if 1
  23540. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23541. if (b.imag == 0) {
  23542. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  23543. } else if (fabs(b.real) >= fabs(b.imag)) {
  23544. if (b.real == 0 && b.imag == 0) {
  23545. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
  23546. } else {
  23547. double r = b.imag / b.real;
  23548. double s = (double)(1.0) / (b.real + b.imag * r);
  23549. return __pyx_t_double_complex_from_parts(
  23550. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  23551. }
  23552. } else {
  23553. double r = b.real / b.imag;
  23554. double s = (double)(1.0) / (b.imag + b.real * r);
  23555. return __pyx_t_double_complex_from_parts(
  23556. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  23557. }
  23558. }
  23559. #else
  23560. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23561. if (b.imag == 0) {
  23562. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  23563. } else {
  23564. double denom = b.real * b.real + b.imag * b.imag;
  23565. return __pyx_t_double_complex_from_parts(
  23566. (a.real * b.real + a.imag * b.imag) / denom,
  23567. (a.imag * b.real - a.real * b.imag) / denom);
  23568. }
  23569. }
  23570. #endif
  23571. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
  23572. __pyx_t_double_complex z;
  23573. z.real = -a.real;
  23574. z.imag = -a.imag;
  23575. return z;
  23576. }
  23577. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
  23578. return (a.real == 0) && (a.imag == 0);
  23579. }
  23580. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
  23581. __pyx_t_double_complex z;
  23582. z.real = a.real;
  23583. z.imag = -a.imag;
  23584. return z;
  23585. }
  23586. #if 1
  23587. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
  23588. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  23589. return sqrt(z.real*z.real + z.imag*z.imag);
  23590. #else
  23591. return hypot(z.real, z.imag);
  23592. #endif
  23593. }
  23594. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23595. __pyx_t_double_complex z;
  23596. double r, lnr, theta, z_r, z_theta;
  23597. if (b.imag == 0 && b.real == (int)b.real) {
  23598. if (b.real < 0) {
  23599. double denom = a.real * a.real + a.imag * a.imag;
  23600. a.real = a.real / denom;
  23601. a.imag = -a.imag / denom;
  23602. b.real = -b.real;
  23603. }
  23604. switch ((int)b.real) {
  23605. case 0:
  23606. z.real = 1;
  23607. z.imag = 0;
  23608. return z;
  23609. case 1:
  23610. return a;
  23611. case 2:
  23612. return __Pyx_c_prod_double(a, a);
  23613. case 3:
  23614. z = __Pyx_c_prod_double(a, a);
  23615. return __Pyx_c_prod_double(z, a);
  23616. case 4:
  23617. z = __Pyx_c_prod_double(a, a);
  23618. return __Pyx_c_prod_double(z, z);
  23619. }
  23620. }
  23621. if (a.imag == 0) {
  23622. if (a.real == 0) {
  23623. return a;
  23624. } else if (b.imag == 0) {
  23625. z.real = pow(a.real, b.real);
  23626. z.imag = 0;
  23627. return z;
  23628. } else if (a.real > 0) {
  23629. r = a.real;
  23630. theta = 0;
  23631. } else {
  23632. r = -a.real;
  23633. theta = atan2(0.0, -1.0);
  23634. }
  23635. } else {
  23636. r = __Pyx_c_abs_double(a);
  23637. theta = atan2(a.imag, a.real);
  23638. }
  23639. lnr = log(r);
  23640. z_r = exp(lnr * b.real - theta * b.imag);
  23641. z_theta = theta * b.real + lnr * b.imag;
  23642. z.real = z_r * cos(z_theta);
  23643. z.imag = z_r * sin(z_theta);
  23644. return z;
  23645. }
  23646. #endif
  23647. #endif
  23648. /* CIntToPy */
  23649. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
  23650. const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
  23651. const int is_unsigned = neg_one > const_zero;
  23652. if (is_unsigned) {
  23653. if (sizeof(enum NPY_TYPES) < sizeof(long)) {
  23654. return PyInt_FromLong((long) value);
  23655. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
  23656. return PyLong_FromUnsignedLong((unsigned long) value);
  23657. #ifdef HAVE_LONG_LONG
  23658. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
  23659. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23660. #endif
  23661. }
  23662. } else {
  23663. if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
  23664. return PyInt_FromLong((long) value);
  23665. #ifdef HAVE_LONG_LONG
  23666. } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
  23667. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23668. #endif
  23669. }
  23670. }
  23671. {
  23672. int one = 1; int little = (int)*(unsigned char *)&one;
  23673. unsigned char *bytes = (unsigned char *)&value;
  23674. return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
  23675. little, !is_unsigned);
  23676. }
  23677. }
  23678. /* CIntFromPy */
  23679. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
  23680. const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
  23681. const int is_unsigned = neg_one > const_zero;
  23682. #if PY_MAJOR_VERSION < 3
  23683. if (likely(PyInt_Check(x))) {
  23684. if (sizeof(size_t) < sizeof(long)) {
  23685. __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
  23686. } else {
  23687. long val = PyInt_AS_LONG(x);
  23688. if (is_unsigned && unlikely(val < 0)) {
  23689. goto raise_neg_overflow;
  23690. }
  23691. return (size_t) val;
  23692. }
  23693. } else
  23694. #endif
  23695. if (likely(PyLong_Check(x))) {
  23696. if (is_unsigned) {
  23697. #if CYTHON_USE_PYLONG_INTERNALS
  23698. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23699. switch (Py_SIZE(x)) {
  23700. case 0: return (size_t) 0;
  23701. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
  23702. case 2:
  23703. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  23704. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23705. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23706. } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
  23707. return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  23708. }
  23709. }
  23710. break;
  23711. case 3:
  23712. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  23713. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23714. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23715. } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
  23716. return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  23717. }
  23718. }
  23719. break;
  23720. case 4:
  23721. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  23722. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23723. __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])))
  23724. } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
  23725. 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]));
  23726. }
  23727. }
  23728. break;
  23729. }
  23730. #endif
  23731. #if CYTHON_COMPILING_IN_CPYTHON
  23732. if (unlikely(Py_SIZE(x) < 0)) {
  23733. goto raise_neg_overflow;
  23734. }
  23735. #else
  23736. {
  23737. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  23738. if (unlikely(result < 0))
  23739. return (size_t) -1;
  23740. if (unlikely(result == 1))
  23741. goto raise_neg_overflow;
  23742. }
  23743. #endif
  23744. if (sizeof(size_t) <= sizeof(unsigned long)) {
  23745. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
  23746. #ifdef HAVE_LONG_LONG
  23747. } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
  23748. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  23749. #endif
  23750. }
  23751. } else {
  23752. #if CYTHON_USE_PYLONG_INTERNALS
  23753. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23754. switch (Py_SIZE(x)) {
  23755. case 0: return (size_t) 0;
  23756. case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
  23757. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
  23758. case -2:
  23759. if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
  23760. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23761. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23762. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23763. return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23764. }
  23765. }
  23766. break;
  23767. case 2:
  23768. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  23769. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23770. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23771. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23772. return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23773. }
  23774. }
  23775. break;
  23776. case -3:
  23777. if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23778. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23779. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23780. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23781. return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23782. }
  23783. }
  23784. break;
  23785. case 3:
  23786. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  23787. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23788. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23789. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23790. return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23791. }
  23792. }
  23793. break;
  23794. case -4:
  23795. if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23796. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23797. __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])))
  23798. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  23799. 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])));
  23800. }
  23801. }
  23802. break;
  23803. case 4:
  23804. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  23805. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23806. __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])))
  23807. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  23808. 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])));
  23809. }
  23810. }
  23811. break;
  23812. }
  23813. #endif
  23814. if (sizeof(size_t) <= sizeof(long)) {
  23815. __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
  23816. #ifdef HAVE_LONG_LONG
  23817. } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
  23818. __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
  23819. #endif
  23820. }
  23821. }
  23822. {
  23823. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  23824. PyErr_SetString(PyExc_RuntimeError,
  23825. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  23826. #else
  23827. size_t val;
  23828. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  23829. #if PY_MAJOR_VERSION < 3
  23830. if (likely(v) && !PyLong_Check(v)) {
  23831. PyObject *tmp = v;
  23832. v = PyNumber_Long(tmp);
  23833. Py_DECREF(tmp);
  23834. }
  23835. #endif
  23836. if (likely(v)) {
  23837. int one = 1; int is_little = (int)*(unsigned char *)&one;
  23838. unsigned char *bytes = (unsigned char *)&val;
  23839. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  23840. bytes, sizeof(val),
  23841. is_little, !is_unsigned);
  23842. Py_DECREF(v);
  23843. if (likely(!ret))
  23844. return val;
  23845. }
  23846. #endif
  23847. return (size_t) -1;
  23848. }
  23849. } else {
  23850. size_t val;
  23851. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  23852. if (!tmp) return (size_t) -1;
  23853. val = __Pyx_PyInt_As_size_t(tmp);
  23854. Py_DECREF(tmp);
  23855. return val;
  23856. }
  23857. raise_overflow:
  23858. PyErr_SetString(PyExc_OverflowError,
  23859. "value too large to convert to size_t");
  23860. return (size_t) -1;
  23861. raise_neg_overflow:
  23862. PyErr_SetString(PyExc_OverflowError,
  23863. "can't convert negative value to size_t");
  23864. return (size_t) -1;
  23865. }
  23866. /* CIntFromPy */
  23867. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  23868. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  23869. const int is_unsigned = neg_one > const_zero;
  23870. #if PY_MAJOR_VERSION < 3
  23871. if (likely(PyInt_Check(x))) {
  23872. if (sizeof(int) < sizeof(long)) {
  23873. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  23874. } else {
  23875. long val = PyInt_AS_LONG(x);
  23876. if (is_unsigned && unlikely(val < 0)) {
  23877. goto raise_neg_overflow;
  23878. }
  23879. return (int) val;
  23880. }
  23881. } else
  23882. #endif
  23883. if (likely(PyLong_Check(x))) {
  23884. if (is_unsigned) {
  23885. #if CYTHON_USE_PYLONG_INTERNALS
  23886. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23887. switch (Py_SIZE(x)) {
  23888. case 0: return (int) 0;
  23889. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  23890. case 2:
  23891. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  23892. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23893. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23894. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  23895. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23896. }
  23897. }
  23898. break;
  23899. case 3:
  23900. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  23901. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23902. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23903. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  23904. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23905. }
  23906. }
  23907. break;
  23908. case 4:
  23909. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  23910. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23911. __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])))
  23912. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  23913. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23914. }
  23915. }
  23916. break;
  23917. }
  23918. #endif
  23919. #if CYTHON_COMPILING_IN_CPYTHON
  23920. if (unlikely(Py_SIZE(x) < 0)) {
  23921. goto raise_neg_overflow;
  23922. }
  23923. #else
  23924. {
  23925. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  23926. if (unlikely(result < 0))
  23927. return (int) -1;
  23928. if (unlikely(result == 1))
  23929. goto raise_neg_overflow;
  23930. }
  23931. #endif
  23932. if (sizeof(int) <= sizeof(unsigned long)) {
  23933. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  23934. #ifdef HAVE_LONG_LONG
  23935. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  23936. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  23937. #endif
  23938. }
  23939. } else {
  23940. #if CYTHON_USE_PYLONG_INTERNALS
  23941. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23942. switch (Py_SIZE(x)) {
  23943. case 0: return (int) 0;
  23944. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  23945. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  23946. case -2:
  23947. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  23948. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23949. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23950. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23951. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23952. }
  23953. }
  23954. break;
  23955. case 2:
  23956. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  23957. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23958. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23959. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23960. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23961. }
  23962. }
  23963. break;
  23964. case -3:
  23965. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23966. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23967. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23968. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23969. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23970. }
  23971. }
  23972. break;
  23973. case 3:
  23974. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  23975. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23976. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23977. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23978. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23979. }
  23980. }
  23981. break;
  23982. case -4:
  23983. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23984. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23985. __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])))
  23986. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  23987. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23988. }
  23989. }
  23990. break;
  23991. case 4:
  23992. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  23993. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23994. __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])))
  23995. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  23996. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23997. }
  23998. }
  23999. break;
  24000. }
  24001. #endif
  24002. if (sizeof(int) <= sizeof(long)) {
  24003. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  24004. #ifdef HAVE_LONG_LONG
  24005. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  24006. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  24007. #endif
  24008. }
  24009. }
  24010. {
  24011. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24012. PyErr_SetString(PyExc_RuntimeError,
  24013. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24014. #else
  24015. int val;
  24016. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24017. #if PY_MAJOR_VERSION < 3
  24018. if (likely(v) && !PyLong_Check(v)) {
  24019. PyObject *tmp = v;
  24020. v = PyNumber_Long(tmp);
  24021. Py_DECREF(tmp);
  24022. }
  24023. #endif
  24024. if (likely(v)) {
  24025. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24026. unsigned char *bytes = (unsigned char *)&val;
  24027. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24028. bytes, sizeof(val),
  24029. is_little, !is_unsigned);
  24030. Py_DECREF(v);
  24031. if (likely(!ret))
  24032. return val;
  24033. }
  24034. #endif
  24035. return (int) -1;
  24036. }
  24037. } else {
  24038. int val;
  24039. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24040. if (!tmp) return (int) -1;
  24041. val = __Pyx_PyInt_As_int(tmp);
  24042. Py_DECREF(tmp);
  24043. return val;
  24044. }
  24045. raise_overflow:
  24046. PyErr_SetString(PyExc_OverflowError,
  24047. "value too large to convert to int");
  24048. return (int) -1;
  24049. raise_neg_overflow:
  24050. PyErr_SetString(PyExc_OverflowError,
  24051. "can't convert negative value to int");
  24052. return (int) -1;
  24053. }
  24054. /* CIntFromPy */
  24055. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  24056. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  24057. const int is_unsigned = neg_one > const_zero;
  24058. #if PY_MAJOR_VERSION < 3
  24059. if (likely(PyInt_Check(x))) {
  24060. if (sizeof(long) < sizeof(long)) {
  24061. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  24062. } else {
  24063. long val = PyInt_AS_LONG(x);
  24064. if (is_unsigned && unlikely(val < 0)) {
  24065. goto raise_neg_overflow;
  24066. }
  24067. return (long) val;
  24068. }
  24069. } else
  24070. #endif
  24071. if (likely(PyLong_Check(x))) {
  24072. if (is_unsigned) {
  24073. #if CYTHON_USE_PYLONG_INTERNALS
  24074. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24075. switch (Py_SIZE(x)) {
  24076. case 0: return (long) 0;
  24077. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  24078. case 2:
  24079. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24080. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24081. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24082. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  24083. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24084. }
  24085. }
  24086. break;
  24087. case 3:
  24088. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24089. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24090. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24091. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  24092. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24093. }
  24094. }
  24095. break;
  24096. case 4:
  24097. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24098. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24099. __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])))
  24100. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  24101. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24102. }
  24103. }
  24104. break;
  24105. }
  24106. #endif
  24107. #if CYTHON_COMPILING_IN_CPYTHON
  24108. if (unlikely(Py_SIZE(x) < 0)) {
  24109. goto raise_neg_overflow;
  24110. }
  24111. #else
  24112. {
  24113. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24114. if (unlikely(result < 0))
  24115. return (long) -1;
  24116. if (unlikely(result == 1))
  24117. goto raise_neg_overflow;
  24118. }
  24119. #endif
  24120. if (sizeof(long) <= sizeof(unsigned long)) {
  24121. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  24122. #ifdef HAVE_LONG_LONG
  24123. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  24124. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24125. #endif
  24126. }
  24127. } else {
  24128. #if CYTHON_USE_PYLONG_INTERNALS
  24129. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24130. switch (Py_SIZE(x)) {
  24131. case 0: return (long) 0;
  24132. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  24133. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  24134. case -2:
  24135. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  24136. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24137. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24138. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24139. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24140. }
  24141. }
  24142. break;
  24143. case 2:
  24144. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24145. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24146. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24147. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24148. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24149. }
  24150. }
  24151. break;
  24152. case -3:
  24153. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24154. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24155. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24156. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24157. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24158. }
  24159. }
  24160. break;
  24161. case 3:
  24162. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24163. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24164. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24165. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24166. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24167. }
  24168. }
  24169. break;
  24170. case -4:
  24171. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24172. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24173. __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])))
  24174. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24175. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24176. }
  24177. }
  24178. break;
  24179. case 4:
  24180. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24181. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24182. __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])))
  24183. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24184. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24185. }
  24186. }
  24187. break;
  24188. }
  24189. #endif
  24190. if (sizeof(long) <= sizeof(long)) {
  24191. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  24192. #ifdef HAVE_LONG_LONG
  24193. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  24194. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  24195. #endif
  24196. }
  24197. }
  24198. {
  24199. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24200. PyErr_SetString(PyExc_RuntimeError,
  24201. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24202. #else
  24203. long val;
  24204. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24205. #if PY_MAJOR_VERSION < 3
  24206. if (likely(v) && !PyLong_Check(v)) {
  24207. PyObject *tmp = v;
  24208. v = PyNumber_Long(tmp);
  24209. Py_DECREF(tmp);
  24210. }
  24211. #endif
  24212. if (likely(v)) {
  24213. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24214. unsigned char *bytes = (unsigned char *)&val;
  24215. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24216. bytes, sizeof(val),
  24217. is_little, !is_unsigned);
  24218. Py_DECREF(v);
  24219. if (likely(!ret))
  24220. return val;
  24221. }
  24222. #endif
  24223. return (long) -1;
  24224. }
  24225. } else {
  24226. long val;
  24227. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24228. if (!tmp) return (long) -1;
  24229. val = __Pyx_PyInt_As_long(tmp);
  24230. Py_DECREF(tmp);
  24231. return val;
  24232. }
  24233. raise_overflow:
  24234. PyErr_SetString(PyExc_OverflowError,
  24235. "value too large to convert to long");
  24236. return (long) -1;
  24237. raise_neg_overflow:
  24238. PyErr_SetString(PyExc_OverflowError,
  24239. "can't convert negative value to long");
  24240. return (long) -1;
  24241. }
  24242. /* FastTypeChecks */
  24243. #if CYTHON_COMPILING_IN_CPYTHON
  24244. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  24245. while (a) {
  24246. a = a->tp_base;
  24247. if (a == b)
  24248. return 1;
  24249. }
  24250. return b == &PyBaseObject_Type;
  24251. }
  24252. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  24253. PyObject *mro;
  24254. if (a == b) return 1;
  24255. mro = a->tp_mro;
  24256. if (likely(mro)) {
  24257. Py_ssize_t i, n;
  24258. n = PyTuple_GET_SIZE(mro);
  24259. for (i = 0; i < n; i++) {
  24260. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  24261. return 1;
  24262. }
  24263. return 0;
  24264. }
  24265. return __Pyx_InBases(a, b);
  24266. }
  24267. #if PY_MAJOR_VERSION == 2
  24268. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  24269. PyObject *exception, *value, *tb;
  24270. int res;
  24271. __Pyx_PyThreadState_declare
  24272. __Pyx_PyThreadState_assign
  24273. __Pyx_ErrFetch(&exception, &value, &tb);
  24274. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  24275. if (unlikely(res == -1)) {
  24276. PyErr_WriteUnraisable(err);
  24277. res = 0;
  24278. }
  24279. if (!res) {
  24280. res = PyObject_IsSubclass(err, exc_type2);
  24281. if (unlikely(res == -1)) {
  24282. PyErr_WriteUnraisable(err);
  24283. res = 0;
  24284. }
  24285. }
  24286. __Pyx_ErrRestore(exception, value, tb);
  24287. return res;
  24288. }
  24289. #else
  24290. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  24291. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  24292. if (!res) {
  24293. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  24294. }
  24295. return res;
  24296. }
  24297. #endif
  24298. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  24299. Py_ssize_t i, n;
  24300. assert(PyExceptionClass_Check(exc_type));
  24301. n = PyTuple_GET_SIZE(tuple);
  24302. #if PY_MAJOR_VERSION >= 3
  24303. for (i=0; i<n; i++) {
  24304. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  24305. }
  24306. #endif
  24307. for (i=0; i<n; i++) {
  24308. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  24309. #if PY_MAJOR_VERSION < 3
  24310. if (likely(exc_type == t)) return 1;
  24311. #endif
  24312. if (likely(PyExceptionClass_Check(t))) {
  24313. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  24314. } else {
  24315. }
  24316. }
  24317. return 0;
  24318. }
  24319. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  24320. if (likely(err == exc_type)) return 1;
  24321. if (likely(PyExceptionClass_Check(err))) {
  24322. if (likely(PyExceptionClass_Check(exc_type))) {
  24323. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  24324. } else if (likely(PyTuple_Check(exc_type))) {
  24325. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  24326. } else {
  24327. }
  24328. }
  24329. return PyErr_GivenExceptionMatches(err, exc_type);
  24330. }
  24331. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  24332. assert(PyExceptionClass_Check(exc_type1));
  24333. assert(PyExceptionClass_Check(exc_type2));
  24334. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  24335. if (likely(PyExceptionClass_Check(err))) {
  24336. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  24337. }
  24338. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  24339. }
  24340. #endif
  24341. /* CStringEquals */
  24342. static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
  24343. while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
  24344. return *s1 == *s2;
  24345. }
  24346. /* CheckBinaryVersion */
  24347. static int __Pyx_check_binary_version(void) {
  24348. char ctversion[4], rtversion[4];
  24349. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  24350. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  24351. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  24352. char message[200];
  24353. PyOS_snprintf(message, sizeof(message),
  24354. "compiletime version %s of module '%.100s' "
  24355. "does not match runtime version %s",
  24356. ctversion, __Pyx_MODULE_NAME, rtversion);
  24357. return PyErr_WarnEx(NULL, message, 1);
  24358. }
  24359. return 0;
  24360. }
  24361. /* InitStrings */
  24362. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  24363. while (t->p) {
  24364. #if PY_MAJOR_VERSION < 3
  24365. if (t->is_unicode) {
  24366. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  24367. } else if (t->intern) {
  24368. *t->p = PyString_InternFromString(t->s);
  24369. } else {
  24370. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  24371. }
  24372. #else
  24373. if (t->is_unicode | t->is_str) {
  24374. if (t->intern) {
  24375. *t->p = PyUnicode_InternFromString(t->s);
  24376. } else if (t->encoding) {
  24377. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  24378. } else {
  24379. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  24380. }
  24381. } else {
  24382. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  24383. }
  24384. #endif
  24385. if (!*t->p)
  24386. return -1;
  24387. if (PyObject_Hash(*t->p) == -1)
  24388. return -1;
  24389. ++t;
  24390. }
  24391. return 0;
  24392. }
  24393. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  24394. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  24395. }
  24396. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  24397. Py_ssize_t ignore;
  24398. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  24399. }
  24400. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24401. #if !CYTHON_PEP393_ENABLED
  24402. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24403. char* defenc_c;
  24404. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  24405. if (!defenc) return NULL;
  24406. defenc_c = PyBytes_AS_STRING(defenc);
  24407. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24408. {
  24409. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  24410. char* c;
  24411. for (c = defenc_c; c < end; c++) {
  24412. if ((unsigned char) (*c) >= 128) {
  24413. PyUnicode_AsASCIIString(o);
  24414. return NULL;
  24415. }
  24416. }
  24417. }
  24418. #endif
  24419. *length = PyBytes_GET_SIZE(defenc);
  24420. return defenc_c;
  24421. }
  24422. #else
  24423. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24424. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  24425. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24426. if (likely(PyUnicode_IS_ASCII(o))) {
  24427. *length = PyUnicode_GET_LENGTH(o);
  24428. return PyUnicode_AsUTF8(o);
  24429. } else {
  24430. PyUnicode_AsASCIIString(o);
  24431. return NULL;
  24432. }
  24433. #else
  24434. return PyUnicode_AsUTF8AndSize(o, length);
  24435. #endif
  24436. }
  24437. #endif
  24438. #endif
  24439. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24440. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24441. if (
  24442. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24443. __Pyx_sys_getdefaultencoding_not_ascii &&
  24444. #endif
  24445. PyUnicode_Check(o)) {
  24446. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  24447. } else
  24448. #endif
  24449. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  24450. if (PyByteArray_Check(o)) {
  24451. *length = PyByteArray_GET_SIZE(o);
  24452. return PyByteArray_AS_STRING(o);
  24453. } else
  24454. #endif
  24455. {
  24456. char* result;
  24457. int r = PyBytes_AsStringAndSize(o, &result, length);
  24458. if (unlikely(r < 0)) {
  24459. return NULL;
  24460. } else {
  24461. return result;
  24462. }
  24463. }
  24464. }
  24465. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  24466. int is_true = x == Py_True;
  24467. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  24468. else return PyObject_IsTrue(x);
  24469. }
  24470. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  24471. int retval;
  24472. if (unlikely(!x)) return -1;
  24473. retval = __Pyx_PyObject_IsTrue(x);
  24474. Py_DECREF(x);
  24475. return retval;
  24476. }
  24477. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  24478. #if PY_MAJOR_VERSION >= 3
  24479. if (PyLong_Check(result)) {
  24480. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  24481. "__int__ returned non-int (type %.200s). "
  24482. "The ability to return an instance of a strict subclass of int "
  24483. "is deprecated, and may be removed in a future version of Python.",
  24484. Py_TYPE(result)->tp_name)) {
  24485. Py_DECREF(result);
  24486. return NULL;
  24487. }
  24488. return result;
  24489. }
  24490. #endif
  24491. PyErr_Format(PyExc_TypeError,
  24492. "__%.4s__ returned non-%.4s (type %.200s)",
  24493. type_name, type_name, Py_TYPE(result)->tp_name);
  24494. Py_DECREF(result);
  24495. return NULL;
  24496. }
  24497. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  24498. #if CYTHON_USE_TYPE_SLOTS
  24499. PyNumberMethods *m;
  24500. #endif
  24501. const char *name = NULL;
  24502. PyObject *res = NULL;
  24503. #if PY_MAJOR_VERSION < 3
  24504. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  24505. #else
  24506. if (likely(PyLong_Check(x)))
  24507. #endif
  24508. return __Pyx_NewRef(x);
  24509. #if CYTHON_USE_TYPE_SLOTS
  24510. m = Py_TYPE(x)->tp_as_number;
  24511. #if PY_MAJOR_VERSION < 3
  24512. if (m && m->nb_int) {
  24513. name = "int";
  24514. res = m->nb_int(x);
  24515. }
  24516. else if (m && m->nb_long) {
  24517. name = "long";
  24518. res = m->nb_long(x);
  24519. }
  24520. #else
  24521. if (likely(m && m->nb_int)) {
  24522. name = "int";
  24523. res = m->nb_int(x);
  24524. }
  24525. #endif
  24526. #else
  24527. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  24528. res = PyNumber_Int(x);
  24529. }
  24530. #endif
  24531. if (likely(res)) {
  24532. #if PY_MAJOR_VERSION < 3
  24533. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  24534. #else
  24535. if (unlikely(!PyLong_CheckExact(res))) {
  24536. #endif
  24537. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  24538. }
  24539. }
  24540. else if (!PyErr_Occurred()) {
  24541. PyErr_SetString(PyExc_TypeError,
  24542. "an integer is required");
  24543. }
  24544. return res;
  24545. }
  24546. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  24547. Py_ssize_t ival;
  24548. PyObject *x;
  24549. #if PY_MAJOR_VERSION < 3
  24550. if (likely(PyInt_CheckExact(b))) {
  24551. if (sizeof(Py_ssize_t) >= sizeof(long))
  24552. return PyInt_AS_LONG(b);
  24553. else
  24554. return PyInt_AsSsize_t(b);
  24555. }
  24556. #endif
  24557. if (likely(PyLong_CheckExact(b))) {
  24558. #if CYTHON_USE_PYLONG_INTERNALS
  24559. const digit* digits = ((PyLongObject*)b)->ob_digit;
  24560. const Py_ssize_t size = Py_SIZE(b);
  24561. if (likely(__Pyx_sst_abs(size) <= 1)) {
  24562. ival = likely(size) ? digits[0] : 0;
  24563. if (size == -1) ival = -ival;
  24564. return ival;
  24565. } else {
  24566. switch (size) {
  24567. case 2:
  24568. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  24569. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24570. }
  24571. break;
  24572. case -2:
  24573. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  24574. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24575. }
  24576. break;
  24577. case 3:
  24578. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  24579. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24580. }
  24581. break;
  24582. case -3:
  24583. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  24584. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24585. }
  24586. break;
  24587. case 4:
  24588. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  24589. 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]));
  24590. }
  24591. break;
  24592. case -4:
  24593. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  24594. 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]));
  24595. }
  24596. break;
  24597. }
  24598. }
  24599. #endif
  24600. return PyLong_AsSsize_t(b);
  24601. }
  24602. x = PyNumber_Index(b);
  24603. if (!x) return -1;
  24604. ival = PyInt_AsSsize_t(x);
  24605. Py_DECREF(x);
  24606. return ival;
  24607. }
  24608. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  24609. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  24610. }
  24611. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  24612. return PyInt_FromSize_t(ival);
  24613. }
  24614. #endif /* Py_PYTHON_H */

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