index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
31,840
stevedore.extension
_load_plugins
null
def _load_plugins(self, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): extensions = [] for ep in self.list_entry_points(): LOG.debug('found extension %r', ep) try: ext = self._load_one_plugin(ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements, ) if ext: extensions.append(ext) except (KeyboardInterrupt, AssertionError): raise except Exception as err: if self._on_load_failure_callback is not None: self._on_load_failure_callback(self, ep, err) else: # Log the reason we couldn't import the module, # usually without a traceback. The most common # reason is an ImportError due to a missing # dependency, and the error message should be # enough to debug that. If debug logging is # enabled for our logger, provide the full # traceback. LOG.error('Could not load %r: %s', ep.name, err, exc_info=LOG.isEnabledFor(logging.DEBUG)) return extensions
(self, invoke_on_load, invoke_args, invoke_kwds, verify_requirements)
[ 0.00984237901866436, -0.03788246959447861, -0.009637909941375256, 0.004426282364875078, 0.005813416559249163, 0.028402559459209442, 0.07148968428373337, -0.002066760091111064, -0.06245588883757591, 0.008034690283238888, 0.023606838658452034, -0.00896873977035284, -0.0028067973908036947, -0.03738059476017952, -0.0639801099896431, -0.07215885818004608, -0.013801636174321175, 0.06673114746809006, 0.02249155566096306, -0.03775235638022423, -0.02747315540909767, 0.05710252746939659, 0.007686163764446974, -0.04773414507508278, -0.002732445253059268, 0.052009399980306625, 0.05937027186155319, 0.004066138528287411, 0.0485520176589489, 0.009015209972858429, -0.005265068728476763, 0.018365005031228065, 0.006617350038141012, 0.013532109558582306, -0.035577550530433655, 0.02074427716434002, 0.04680474102497101, 0.03689730539917946, 0.02329084277153015, 0.019312996417284012, 0.010056141763925552, -0.00658482126891613, 0.07576493918895721, -0.036432601511478424, 0.022714613005518913, 0.019703345373272896, -0.05583854019641876, 0.06345964223146439, -0.007095993030816317, -0.023755542933940887, -0.00750028295442462, -0.01872747205197811, 0.08684343099594116, 0.00467257434502244, 0.0008933887584134936, 0.09918589890003204, 0.03351427614688873, 0.017946774140000343, 0.03420203551650047, 0.03420203551650047, 0.02736162766814232, -0.03306816145777702, 0.015177153050899506, 0.036265309900045395, 0.017816657200455666, 0.002692945534363389, -0.007281873375177383, -0.07911079376935959, -0.06487233936786652, -0.013532109558582306, 0.009963201358914375, -0.017259016633033752, -0.04256666451692581, -0.06338529288768768, 0.04502028599381447, 0.050596706569194794, 0.0018344094278290868, -0.013504227623343468, -0.0044100177474319935, 0.02691551484167576, -0.0069054653868079185, -0.016376083716750145, -0.013606461696326733, 0.022658847272396088, 0.0619354248046875, -0.019870638847351074, -0.010465078987181187, -0.03130229562520981, 0.018476534634828568, 0.048477668315172195, -0.0837206318974495, -0.024294598028063774, 0.03851446509361267, 0.030670303851366043, 0.002746386220678687, -0.021097451448440552, 0.02029816433787346, 0.02159932814538479, 0.006663820240646601, 0.017909597605466843, -0.011905654333531857, -0.035651903599500656, 0.029815252870321274, 0.002667387016117573, 0.03185993805527687, -0.034313563257455826, 0.002651122398674488, 0.043087128549814224, -0.006477939896285534, 0.04461134970188141, -0.02269602380692959, -0.016998782753944397, 0.015251505188643932, -0.03639542683959007, 0.02126474305987358, -0.053236208856105804, 0.015372327528893948, 0.0006761407712474465, 0.030837595462799072, 0.03219452500343323, -0.033142514526844025, 0.030577363446354866, 0.022212734445929527, -0.006124766543507576, 0.010576607659459114, -0.02836538292467594, 0.03490838035941124, 0.02897878922522068, 0.000290148047497496, -0.06223283335566521, 0.06740031391382217, 0.04286407306790352, -0.035856373608112335, -0.03840293735265732, -0.052418336272239685, -0.044499821960926056, -0.0002937785175163299, 0.00614800164476037, -0.028235265985131264, -0.02016804739832878, -0.05174916610121727, 0.01797465607523918, 0.005311538930982351, 0.045354872941970825, 0.013030231930315495, -0.017547130584716797, 0.049816008657217026, 0.015437385998666286, 0.0007725663599558175, -0.003255234332755208, -0.006626644171774387, -0.029685135930776596, -0.05557830631732941, -0.046693213284015656, -0.027175746858119965, -0.027082806453108788, 0.013829518109560013, 0.02061416208744049, -0.038700345903635025, -0.051526110619306564, -0.01505633071064949, 0.04145137965679169, -0.06877583265304565, -0.000034362503356533125, -0.02297484502196312, 0.002683651400730014, 0.011087778955698013, 0.0015788235468789935, -0.04461134970188141, 0.03907210752367973, -0.013866694644093513, 0.03851446509361267, 0.058589573949575424, 0.028625616803765297, 0.06769772619009018, 0.015065624378621578, -0.008118336088955402, 0.01621808484196663, 0.005943533033132553, 0.038737520575523376, -0.025075295940041542, 0.03031712956726551, -0.03775235638022423, -0.015967145562171936, -0.015985732898116112, 0.06832971423864365, 0.014089751057326794, 0.009075621142983437, -0.049704477190971375, -0.020725689828395844, -0.029369138181209564, 0.002081862883642316, 0.08253099769353867, 0.026692457497119904, -0.06312505900859833, 0.05888698250055313, -0.07881338149309158, 0.04866354912519455, -0.10305222123861313, 0.01773301139473915, -0.05695382133126259, -0.02215697057545185, 0.02791927009820938, -0.03654412925243378, -0.002725474536418915, 0.0034364680759608746, 0.002393213100731373, 0.001283738063648343, -0.02187814936041832, -0.026971278712153435, 0.023197902366518974, -0.030577363446354866, -0.06899888813495636, 0.012686352245509624, -0.015753382816910744, -0.007068110629916191, 0.03929516300559044, -0.006199118681252003, -0.0013778401771560311, 0.010604489594697952, -0.01526079885661602, 0.09018927812576294, 0.00680787768214941, 0.06007661670446396, 0.0465073324739933, 0.08201052993535995, -0.0007080889772623777, 0.004498311318457127, -0.011598951183259487, 0.05531807243824005, 0.009461323730647564, 0.02925761044025421, 0.0010548725258558989, -0.027975033968687057, 0.015297975391149521, 0.04119114577770233, 0.0639801099896431, 0.04899813234806061, 0.03799400106072426, 0.05609877407550812, 0.037845294922590256, 0.06832971423864365, -0.04955577477812767, -0.04342171549797058, -0.025335529819130898, -0.001170467003248632, -0.007658281829208136, -0.06472363322973251, -0.012546942569315434, 0.02715715952217579, 0.032324641942977905, 0.05163763836026192, 0.027993621304631233, -0.0551321916282177, -0.06710290163755417, -0.006482586730271578, 0.04331018403172493, -0.021097451448440552, 0.043496064841747284, -0.0017008077120408416, 0.014303513802587986, 0.009470617398619652, 0.02215697057545185, 0.03896057978272438, -0.05212092772126198, 0.0012651500292122364, 0.07074616849422455, -0.004342636093497276, 0.007960338145494461, 0.08119265735149384, 0.1108592078089714, 0.036302484571933746, -0.022993432357907295, 0.040447622537612915, 0.007379460614174604, 0.01731478050351143, -0.055095016956329346, 0.013996810652315617, -0.0032343228813260794, 0.034034743905067444, 0.05650771036744118, 0.00267900456674397, -0.02918325737118721, -0.022045442834496498, 0.013197524473071098, -0.03738059476017952, -0.04858919605612755, -0.01402469351887703, -0.07792115956544876, -0.0034271739423274994, -0.01591138169169426, 0.005957474000751972, 0.009665792807936668, -0.03710177168250084, -0.012481884099543095, 0.027733389288187027, -0.010595195926725864, -0.007858103141188622, 0.03726906329393387, 0.008127630688250065, -0.014191986061632633, -0.03535449504852295, 0.008127630688250065, -0.02503811940550804, -0.003499202663078904, -0.04591251537203789, 0.007411989849060774, -0.05130305141210556, -0.006491880863904953, 0.007862750440835953, 0.015325857326388359, -0.015316563658416271, -0.010502255521714687, -0.010102611966431141, 0.042752545326948166, 0.008206629194319248, 0.030651714652776718, 0.027510331943631172, 0.0063478234224021435, -0.02540988102555275, -0.003773376578465104, 0.09948331117630005, 0.006101531442254782, 0.008940857835114002, 0.035335905849933624, 0.019145704805850983, 0.02195250242948532, 0.018904060125350952, -0.0013197524240240455, -0.0793338492512703, -0.029164670035243034, -0.029108906164765358, -0.00842039193958044, 0.04379347339272499, 0.008866505697369576, -0.002830032492056489, -0.006487233564257622, -0.028923025354743004, -0.003661848371848464, 0.02873714454472065, 0.01560467854142189, -0.01927581988275051, -0.05743711441755295, 0.007816280238330364, -0.04769696667790413, -0.020800041034817696, 0.01662702113389969, 0.033384159207344055, 0.009591439738869667, -0.014461512677371502, 0.039555396884679794, -0.07249344140291214, -0.08543073385953903, -0.056842293590307236, 0.01708242855966091, -0.05212092772126198, -0.03817988187074661, -0.012119417078793049, 0.004512252286076546, -0.011059897020459175, 0.026432225480675697, -0.001435927813872695, -0.060374025255441666, 0.008527273312211037, -0.012937291525304317, -0.04818025603890419, 0.058589573949575424, -0.03329122066497803, 0.01292799785733223, -0.040521975606679916, -0.0028904436621814966, -0.005218598525971174, -0.014944802038371563, -0.040447622537612915, 0.02630210854113102, -0.037603650242090225, 0.04461134970188141, 0.06104319542646408, -0.03284510597586632, 0.024443302303552628, 0.02544705756008625, 0.031562529504299164, 0.00232350779697299, -0.048440489917993546, -0.013290464878082275, -0.026878338307142258, -0.0014568393817171454, -0.0018924970645457506, 0.01882041245698929, 0.022640259936451912, 0.04550357535481453, -0.044945936650037766, -0.0441652350127697, 0.022472968325018883, 0.029685135930776596, -0.008494744077324867, -0.009452030062675476, 0.024183068424463272, -0.003771053161472082, 0.010046848095953465, 0.03795682266354561, 0.011032015085220337, -0.007858103141188622, 0.030019721016287804, 0.01769583486020565, 0.02057698555290699, 0.0050513059832155704, 0.07628540694713593, -0.021246155723929405, 0.037194713950157166, 0.0003584010701160878, 0.02905314229428768, -0.02609764039516449, -0.07483553886413574, -0.09256855398416519, 0.0355403758585453, -0.020075106993317604, -0.01570691354572773, -0.03881187364459038, -0.015167858451604843, 0.02273320034146309, -0.017993245273828506, -0.02304919809103012, -0.013485639356076717, 0.02479647472500801, 0.020837217569351196, -0.02033534087240696, -0.03247334435582161, -0.03113500401377678, -0.017398426309227943, -0.029331961646676064, 0.032250288873910904, -0.009205738082528114, -0.06717725843191147, 0.01642255298793316, -0.034034743905067444, -0.00821592379361391, 0.002407154068350792, -0.019461700692772865, -0.029647959396243095, -0.05011341720819473, 0.034313563257455826, 0.034964144229888916, -0.017026664689183235, 0.020762866362929344, 0.02613481506705284, -0.022380027920007706, 0.019796285778284073, -0.02747315540909767, -0.02702704258263111, -0.05260421708226204, 0.03607942909002304, 0.06832971423864365, 0.0066359383054077625, 0.05182351917028427, 0.009363736025989056, 0.010334962978959084, 0.02691551484167576, -0.029852427542209625, -0.0012233268935233355, 0.0006343176355585456, -0.01093907468020916, 0.016487611457705498, -0.0728280320763588, 0.006645232439041138, 0.001735660363920033, 0.04513181373476982, 0.017435602843761444, -0.002883473178371787, 0.03291945904493332, 0.061340607702732086, -0.014126927591860294, 0.048477668315172195, -0.05119152367115021, -0.001366222626529634, 0.05093128979206085, 0.0929403156042099, -0.018197713419795036, 0.06591326743364334, -0.05472325533628464, -0.003389997873455286, -0.034034743905067444, 0.040038686245679855, 0.008978034369647503, -0.0022735523525625467, -0.028625616803765297, 0.02869996801018715, -0.038625992834568024, -0.03522437810897827, -0.018634531646966934, 0.045280519872903824, 0.022993432357907295, 0.011552480980753899, 0.03011266142129898, 0.04892377927899361, -0.02946207858622074, 0.04286407306790352, 0.04903530701994896, 0.09331206977367401, 0.01611584983766079, 0.030187012627720833, 0.002472212305292487, 0.014442924410104752, -0.003829140914604068, 0.014173397794365883, -0.03706459701061249, 0.07866468280553818, 0.024480478838086128, -0.06029967591166496, -0.015827735885977745, -0.022212734445929527, -0.012323885224759579, -0.04104244336485863, -0.022472968325018883, 0.001050225575454533, -0.020521221682429314, 0.028681380674242973, 0.05204657465219498, -0.010121200233697891, 0.04654450714588165, 0.04085656255483627, -0.016283143311738968, 0.02836538292467594, -0.03717612475156784, 0.00412422651425004, -0.028625616803765297, -0.0682181864976883, 0.0063478234224021435, -0.038663171231746674, 0.029443491250276566, 0.03550319746136665, 0.04996471107006073, -0.0398528054356575, -0.08639731258153915, -0.027993621304631233, -0.05628465116024017, -0.022993432357907295, 0.04022456705570221, 0.037603650242090225, 0.007806986104696989, 0.014758921228349209, 0.027789153158664703, -0.023197902366518974, 0.01992640271782875, 0.007909220643341541, -0.02756609581410885, -0.02812373824417591, -0.008369275368750095, 0.0014254720881581306, -0.02483365125954151, 0.041377026587724686, -0.002899737795814872, -0.028179502114653587, 0.02037251554429531, -0.006431469693779945, -0.13428016006946564, 0.03658130764961243, -0.055875714868307114, -0.05565265938639641, 0.03357004001736641, 0.01944311335682869, 0.001790262758731842, -0.039183635264635086, -0.012203062884509563, -0.03851446509361267, -0.02184097282588482, -0.010093318298459053, 0.026079051196575165, -0.00480966130271554, -0.01229600328952074, 0.04368194565176964, 0.020279577001929283, -0.05792040377855301, -0.06007661670446396, -0.026283519342541695, 0.049704477190971375, 0.00009250465518562123, -0.011431658640503883, -0.018671708181500435, -0.02228708751499653, -0.04171161353588104, -0.03726906329393387, 0.024908004328608513, -0.003582848934456706, -0.008290275931358337, -0.021933913230895996, 0.008699213154613972, 0.0686643049120903, 0.004897954408079386, 0.022640259936451912, -0.03929516300559044, 0.04234360530972481, 0.014805391430854797, -0.025093885138630867, 0.013968928717076778, -0.002407154068350792, -0.008703860454261303, 0.08067218959331512, -0.03275216743350029, -0.07498424500226974, 0.008397157303988934, -0.004168373066931963, 0.03624672070145607, -0.06093166768550873, -0.024238834157586098, -0.009907437488436699, -0.007853456772863865, -0.008355334401130676, -0.020930157974362373, 0.07163839042186737, -0.00041765053174458444, -0.031395237892866135, 0.03717612475156784, -0.023160725831985474, 0.00870850682258606, 0.023792719468474388, -0.02894161269068718, -0.034964144229888916, 0.042715366929769516, -0.00320179364643991, -0.007732633966952562, 0.030465833842754364, 0.024945179000496864, -0.004753896966576576, 0.021450623869895935, -0.028681380674242973, -0.04245513305068016, 0.000957285228651017, 0.02459200657904148, 0.005692594218999147, 0.022640259936451912, 0.024406125769019127, 0.06163801625370979, -0.024499066174030304, 0.011440952308475971, -0.038625992834568024, 0.04364477097988129, -0.06505821645259857, 0.011859184131026268, -0.00871315412223339, 0.04360759258270264, -0.044090885668992996, -0.031227944418787956, -0.05702817440032959, 0.05230680853128433, 0.03933234140276909, -0.05847804248332977, 0.04873789846897125, 0.07230756431818008, 0.008415745571255684, 0.0597420334815979, -0.015995027497410774, -0.07550471276044846, 0.04126549884676933, -0.06892453879117966, 0.0353916697204113, -0.0026604165323078632, -0.012481884099543095, 0.05397973209619522, 0.012045064009726048, -0.0034899087622761726, -0.013662225566804409, -0.02475929819047451, -0.01207294687628746, 0.035410258919000626, -0.03741776943206787, 0.03462956100702286, -0.04539204761385918, 0.004805014003068209, 0.008648095652461052, -0.005813416559249163, -0.015781264752149582, 0.048477668315172195, -0.0007888309191912413, -0.00044262822484597564, -0.0027185040526092052, -0.07331132143735886, 0.022956257686018944, -0.023402370512485504, 0.023532487452030182, -0.039629749953746796, -0.018839001655578613, -0.04516899213194847, 0.0838693380355835, -0.06022532284259796, 0.01721254549920559, 0.042157724499702454, 0.021116038784384727, 0.02492659166455269, -0.014052575454115868, -0.012026476673781872, 0.07903644442558289, 0.05583854019641876, -0.02349531091749668, 0.013030231930315495, 0.017333367839455605, -0.028514087200164795, -0.10729029774665833, -0.03349568694829941, -0.013058113865554333, 0.03501990810036659, -0.01580914668738842, -0.05029929801821709, 0.009833085350692272, -0.038737520575523376, -0.014647393487393856, -0.03771517798304558, 0.015892792493104935, -0.06483516097068787, 0.030056897550821304, -0.027064219117164612, -0.004700456280261278, 0.054128438234329224, -0.044425468891859055, 0.010808958671987057, -0.03903493285179138, 0.038700345903635025, -0.016747843474149704, 0.039183635264635086, 0.0040382565930485725, -0.0049676597118377686, -0.046656034886837006, 0.02537270449101925, -0.02853267639875412, -0.019814874976873398, 0.02208261750638485, -0.025298353284597397, -0.018030419945716858, -0.006050414405763149, 0.0013917811447754502, -0.030911948531866074, -0.03706459701061249, -0.007216815371066332, 0.03587495908141136, 0.0004039999330416322, -0.07223320752382278, -0.003499202663078904, -0.0025233295746147633, 0.02050263248383999, -0.08111830800771713, -0.010204846039414406, -0.012147299014031887, -0.0033528218045830727, 0.017584307119250298, 0.037566475570201874, -0.001559073687531054, 0.03388603776693344, -0.02122756652534008, 0.010455785319209099, 0.04524334520101547, -0.041748788207769394, 0.022826140746474266, -0.02695269137620926, -0.0018681002547964454, -0.01988922618329525, 0.0013987517450004816, -0.006468645762652159, 0.0013220759574323893, -0.05126587674021721, -0.08907399326562881, -0.05174916610121727, -0.027454568073153496, -0.04427676647901535, -0.03580060973763466, 0.07814421504735947, -0.015316563658416271, -0.0002188453945564106, -0.013885282911360264 ]
31,841
stevedore.extension
entry_points_names
Return the list of entry points names for this namespace.
def entry_points_names(self): """Return the list of entry points names for this namespace.""" return list(map(operator.attrgetter("name"), self.list_entry_points()))
(self)
[ -0.0012932545505464077, -0.015527605079114437, -0.01023488026112318, -0.03642489016056061, 0.008494865149259567, 0.0226757749915123, 0.029721340164542198, 0.004140552133321762, 0.06751430034637451, 0.016365548595786095, -0.031038109213113785, -0.03700631856918335, 0.019631817936897278, -0.0180585365742445, -0.031003907322883606, -0.030183065682649612, 0.03515942394733429, 0.032850801944732666, -0.07811684906482697, -0.012423793785274029, -0.01804143562912941, -0.011141227558255196, 0.033449333161115646, -0.08666729182004929, -0.016066282987594604, 0.05345737189054489, 0.04699323698878288, -0.03202996030449867, 0.049045342952013016, -0.035911861807107925, -0.10896684974431992, -0.03184185177087784, -0.026506373658776283, -0.04312843456864357, 0.008935213088989258, -0.011175429448485374, 0.03208126500248909, 0.02017904631793499, 0.05065282806754112, 0.016280043870210648, 0.07326019555330276, 0.010311834514141083, -0.019495010375976562, -0.012646106071770191, 0.04610399156808853, 0.028558481484651566, 0.04117893427610397, -0.0013637957163155079, 0.030422477051615715, -0.018571563065052032, 0.0025181055534631014, -0.01053414586931467, 0.0482587032020092, 0.012740160338580608, 0.0002627925423439592, 0.028353270143270493, 0.04189717397093773, 0.03204706311225891, -0.04921635240316391, 0.05256812646985054, -0.009619249030947685, -0.019170094281435013, 0.033757150173187256, -0.04131574183702469, 0.007096868008375168, -0.027293015271425247, 0.0329534076154232, -0.03387685492634773, -0.05677494406700134, 0.0030076184775680304, 0.0015305293491110206, -0.04801928997039795, -0.03556984290480614, -0.013997076079249382, 0.011799612082540989, -0.017819123342633247, 0.005245697218924761, 0.003659589681774378, 0.006455584894865751, -0.021564217284321785, -0.042683813720941544, 0.005339751951396465, -0.07086607068777084, 0.013629406690597534, 0.08269988745450974, -0.009533744305372238, -0.007520115002989769, -0.04001607373356819, -0.03912682831287384, 0.06816413253545761, -0.04644600674510002, 0.029447726905345917, -0.00398023147135973, 0.021769428625702858, -0.046343401074409485, -0.03666429966688156, -0.018879378214478493, -0.04767727106809616, -0.011893666349351406, 0.028814993798732758, 0.04381247237324715, -0.04005027562379837, 0.035262029618024826, 0.07079767435789108, 0.0048609268851578236, -0.007994664832949638, -0.04860071837902069, -0.014852120541036129, -0.02967003919184208, 0.03796396777033806, -0.00725932652130723, -0.016425400972366333, 0.06276025623083115, -0.016014980152249336, 0.05923747271299362, -0.04066590964794159, -0.002344959182664752, 0.007520115002989769, 0.04685642942786217, -0.027344318106770515, -0.017220592126250267, 0.08379434794187546, -0.00931143295019865, -0.025480320677161217, -0.03680110722780228, -0.02012774348258972, -0.0039161029271781445, 0.04121313616633415, -0.014133882708847523, -0.06200781464576721, 0.060981761664152145, -0.009302882477641106, -0.08646208047866821, -0.004642890766263008, 0.02657477743923664, -0.03816917911171913, 0.09590177237987518, -0.005078963469713926, -0.018212445080280304, 0.08892460912466049, -0.011098475195467472, 0.03755354881286621, -0.03553564101457596, 0.026044650003314018, -0.10281053185462952, -0.01624584197998047, 0.0071866475045681, 0.056090909987688065, 0.029499029740691185, -0.047882482409477234, -0.02418065443634987, -0.01420228648930788, -0.032542988657951355, -0.011868014931678772, -0.01085051242262125, -0.02043556049466133, -0.03539883717894554, -0.033517736941576004, -0.008306755684316158, -0.016972629353404045, -0.044154487550258636, -0.02624986134469509, -0.05920327082276344, -0.058861251920461655, 0.002012560609728098, -0.011679905466735363, 0.04897693917155266, -0.030764495953917503, 0.0013242498971521854, 0.023120399564504623, -0.01622019149363041, -0.0022615923080593348, -0.003648901591077447, 0.0673774927854538, 0.06108436733484268, 0.0009282575338147581, 0.004942156374454498, 0.06245243921875954, 0.034338582307100296, -0.01162005215883255, 0.026113053783774376, -0.033449333161115646, -0.05544107407331467, 0.00047428239486180246, -0.007242225576192141, -0.005993860773742199, 0.016425400972366333, 0.030764495953917503, 0.0004924521199427545, 0.0017645977204665542, -0.013330141082406044, 0.0014824330573901534, -0.014424597844481468, 0.07599633932113647, -0.038100775331258774, 0.019512111321091652, -0.07298658788204193, 0.006784776691347361, -0.04853231459856033, -0.06912178546190262, -0.01985413022339344, 0.021786529570817947, -0.05137106403708458, 0.020350055769085884, 0.06470975279808044, 0.04918215051293373, 0.0058527784422039986, -0.05739057436585426, -0.036253880709409714, 0.012244234792888165, 0.01684437319636345, -0.014664010144770145, -0.007909160107374191, -0.02414645254611969, 0.0016320658614858985, -0.02662608027458191, -0.02746402472257614, -0.007541491184383631, 0.007691123988479376, 0.02471078187227249, 0.010405889712274075, 0.015296743251383305, 0.09029268473386765, 0.002002941444516182, -0.024693680927157402, -0.018486058339476585, 0.05680914595723152, 0.03155113756656647, -0.01840055361390114, -0.06553059816360474, 0.007272152230143547, -0.011124126613140106, -0.03519362583756447, -0.008824057877063751, 0.0018511710222810507, 0.002843022346496582, -0.006070814561098814, 0.007584243081510067, 0.03281660005450249, -0.01344984769821167, -0.02110249362885952, 0.015014578588306904, -0.019495010375976562, 0.011628602631390095, -0.016912776976823807, 0.002458252478390932, 0.005861328914761543, -0.02806255593895912, 0.007845032028853893, -0.011808162555098534, 0.02967003919184208, 0.000751370214857161, 0.015356596559286118, -0.02171812579035759, -0.03584345802664757, -0.050892237573862076, -0.07148170471191406, 0.02814805880188942, 0.00961069855839014, -0.011124126613140106, -0.005267072934657335, 0.004134139511734247, 0.0067719509825110435, 0.04401768371462822, 0.06443613767623901, 0.04087112098932266, 0.05438081920146942, 0.00932853389531374, -0.062213025987148285, -0.007037014700472355, 0.05677494406700134, 0.0026912521570920944, -0.05988730490207672, 0.026779988780617714, 0.011021521873772144, -0.0012024061288684607, -0.01055124681442976, 0.03057638555765152, -0.09186596423387527, -0.029208313673734665, 0.057629987597465515, -0.022077243775129318, -0.05403880029916763, 0.04610399156808853, 0.007862132973968983, -0.07524389773607254, -0.008045966736972332, 0.013834617100656033, -0.03180764988064766, -0.01860576495528221, 0.03738253936171532, 0.038340188562870026, -0.003097398206591606, -0.06604362279176712, -0.0007417509332299232, 0.023000692948698997, -0.000796260021161288, -0.03271399438381195, 0.002569408155977726, 0.0281822606921196, 0.03707472234964371, -0.0015722127864137292, 0.002808820689097047, 0.005356852896511555, -0.026044650003314018, 0.026711585000157356, 0.02684839256107807, 0.035638246685266495, 0.013911571353673935, -0.039947669953107834, -0.006476960610598326, -0.006742024794220924, -0.053354766219854355, -0.010585448704659939, -0.03577505424618721, 0.022128546610474586, -0.025223808363080025, 0.01775071956217289, -0.0060366131365299225, 0.06570160388946533, -0.05704855918884277, 0.03519362583756447, -0.00008483642886858433, -0.011226732283830643, 0.0563645213842392, 0.02106829173862934, -0.003332535270601511, -0.009337084367871284, 0.02296649105846882, -0.024950193241238594, -0.04155515506863594, -0.08222106099128723, -0.014150983653962612, 0.03666429966688156, -0.049660973250865936, 0.04347045347094536, 0.02142741158604622, 0.027412721887230873, -0.004882303066551685, -0.04254700616002083, 0.005006284452974796, 0.0006177695468068123, -0.06022932380437851, 0.03264559432864189, -0.07982693612575531, 0.010790659114718437, 0.01223568432033062, 0.016707565635442734, 0.03943464532494545, 0.00870007649064064, -0.03271399438381195, 0.02691679634153843, -0.012894068844616413, 0.03149983286857605, 0.07113968580961227, 0.016904225572943687, -0.029447726905345917, -0.020418459549546242, 0.0034843056928366423, 0.060981761664152145, 0.08160543441772461, -0.0293109193444252, -0.01544210035353899, -0.0151428347453475, -0.04736945778131485, -0.04894273728132248, 0.0924815982580185, -0.019084589555859566, 0.09255000203847885, -0.053901996463537216, -0.038716405630111694, 0.015006028115749359, -0.014082579873502254, -0.04309423267841339, -0.05157627537846565, -0.010517044924199581, 0.11081374436616898, 0.015416448935866356, -0.0599215067923069, -0.017938829958438873, -0.009337084367871284, 0.0014770891284570098, 0.029550332576036453, 0.0489085353910923, -0.04593298211693764, 0.016673363745212555, -0.018212445080280304, -0.02195753902196884, 0.019973834976553917, 0.04856651648879051, 0.036835309118032455, -0.04121313616633415, -0.04500953480601311, 0.06563320010900497, -0.014321992173790932, -0.04247860237956047, -0.009559395723044872, -0.05629611760377884, -0.021187998354434967, -0.02472788281738758, 0.04866912215948105, -0.027583729475736618, -0.00035030097933486104, -0.006549639627337456, 0.004762596916407347, -0.06231563165783882, 0.02471078187227249, -0.0032128291204571724, 0.012953921221196651, 0.026420870795845985, 0.004942156374454498, -0.015476302243769169, -0.016656262800097466, -0.0824262723326683, 0.01740015298128128, 0.017802022397518158, -0.02409514971077442, 0.012466546148061752, 0.0378955639898777, -0.022402161732316017, -0.018879378214478493, -0.03786136209964752, 0.020076440647244453, 0.049353159964084625, 0.0173659510910511, -0.02838747203350067, -0.05715116485953331, -0.007002813275903463, 0.014569955877959728, 0.012936821207404137, -0.06200781464576721, 0.026078851893544197, -0.0002244491333840415, -0.052089300006628036, 0.012329739518463612, -0.03172214329242706, 0.03827178478240967, -0.044120289385318756, -0.012740160338580608, 0.02265867404639721, -0.01742580346763134, 0.030696092173457146, 0.008935213088989258, 0.010953118093311787, 0.011534548364579678, 0.050002992153167725, -0.04271801561117172, -0.004677092656493187, 0.01898198388516903, -0.047198448330163956, -0.05622771382331848, -0.018246646970510483, 0.03505681827664375, -0.05564628541469574, 0.025531623512506485, 0.0030396825168281794, -0.03608287125825882, -0.02077757753431797, -0.0561935119330883, 0.016331346705555916, -0.016391199082136154, 0.04473591968417168, 0.016356997191905975, -0.023000692948698997, -0.004685643129050732, -0.014715312980115414, 0.0482587032020092, 0.0050575872883200645, 0.013107829727232456, 0.010320384986698627, 0.06508597731590271, 0.008182774297893047, -0.02166682295501232, -0.053320564329624176, -0.007199473213404417, 0.04254700616002083, -0.01160295121371746, 0.022778380662202835, -0.02534351497888565, -0.002676288830116391, -0.03264559432864189, -0.04456491023302078, 0.026968099176883698, 0.010243430733680725, 0.006464135367423296, -0.002624985994771123, 0.010884714312851429, -0.020914385095238686, -0.033192820847034454, -0.045180544257164, 0.05034501105546951, 0.016023531556129456, 0.000008550443453714252, -0.0009827666217461228, 0.04651441052556038, 0.030405376106500626, 0.10205809026956558, 0.007532940711826086, 0.009533744305372238, 0.039879266172647476, -0.004031533841043711, -0.017331749200820923, 0.04928475618362427, 0.0025330688804388046, 0.04196557775139809, 0.01358665432780981, 0.02257317118346691, -0.00797328818589449, -0.012740160338580608, -0.022812582552433014, 0.04408608749508858, -0.036117073148489, 0.05164467915892601, -0.012808564119040966, 0.034082066267728806, 0.006126392632722855, -0.01649380475282669, 0.04620659723877907, -0.0041384147480130196, 0.07558591663837433, 0.001160722691565752, -0.0058399527333676815, 0.019443707540631294, -0.008935213088989258, -0.022727077826857567, 0.04613819345831871, -0.026779988780617714, 0.013826066628098488, -0.04675382375717163, 0.0876249447464943, 0.06084495410323143, 0.009773156605660915, -0.008379434235394001, -0.018178243190050125, -0.0293109193444252, 0.08954024314880371, -0.061665795743465424, -0.027891546487808228, 0.03690371289849281, 0.07107128202915192, 0.05140526592731476, -0.033774252980947495, 0.04220498725771904, -0.001637409906834364, 0.050310809165239334, 0.00015537759463768452, -0.042375996708869934, -0.0290715079754591, -0.006780501455068588, -0.009456790052354336, 0.08899301290512085, -0.038100775331258774, 0.0016876437002792954, -0.06648825109004974, -0.010790659114718437, -0.019460808485746384, 0.000614563119597733, -0.054586030542850494, -0.04336784780025482, 0.041384145617485046, 0.00002598533137643244, 0.0024753534235060215, 0.029841046780347824, 0.02233375795185566, -0.024334561079740524, 0.011714107356965542, -0.030183065682649612, 0.004728395026177168, -0.039263635873794556, 0.04736945778131485, 0.0071524460799992085, 0.0180585365742445, 0.03266269341111183, -0.033107317984104156, -0.018229546025395393, 0.03399656340479851, 0.054859645664691925, 0.012278436683118343, 0.017973031848669052, -0.059134867042303085, 0.019973834976553917, 0.008858258835971355, 0.018879378214478493, -0.020555265247821808, -0.03556984290480614, 0.05102904513478279, -0.0173659510910511, 0.021290604025125504, 0.025223808363080025, -0.0017432216554880142, -0.07722760736942291, 0.00029151668422855437, 0.028968902304768562, -0.030080460011959076, 0.005955383647233248, -0.05906646326184273, -0.008815507404506207, 0.00023273237457033247, 0.007738151121884584, -0.017613913863897324, 0.03138012811541557, -0.0034073516726493835, 0.03799816966056824, 0.015501953661441803, 0.046959035098552704, -0.02960163541138172, 0.001377690234221518, 0.0008518379181623459, -0.036561693996191025, 0.0422733910381794, -0.04849811643362045, -0.025907842442393303, 0.03799816966056824, -0.043538857251405716, -0.015228339470922947, -0.006814703345298767, 0.0811266079545021, -0.01927269995212555, 0.05126845836639404, 0.017955930903553963, -0.006677896250039339, 0.02111959457397461, 0.01118397992104292, 0.025189606472849846, 0.0241293516010046, -0.045967184007167816, 0.030200166627764702, 0.0008411498856730759, 0.06775370985269547, -0.004762596916407347, 0.010859062895178795, 0.01896488294005394, -0.0020296615548431873, -0.11744888871908188, -0.0027275914326310158, 0.04743785783648491, -0.008024591021239758, -0.07893769443035126, -0.045419953763484955, -0.01403127796947956, 0.016271494328975677, -0.027703436091542244, -0.007541491184383631, 0.014339093118906021, -0.0073277298361063, 0.04565936699509621, -0.023684728890657425, -0.022248253226280212, 0.09514933079481125, -0.008011765778064728, 0.001912092906422913, 0.0032256548292934895, -0.008969414979219437, 0.05957948789000511, 0.009054919704794884, 0.019409505650401115, -0.11225022375583649, -0.019631817936897278, -0.025582926347851753, -0.046275001019239426, -0.011662804521620274, -0.058211419731378555, -0.02869528718292713, -0.016989730298519135, 0.004067873582243919, -0.02296649105846882, -0.040529102087020874, 0.021341906860470772, -0.03185895085334778, 0.03632228448987007, -0.008815507404506207, 0.058211419731378555, 0.04316263645887375, -0.037758756428956985, -0.031687941402196884, -0.009148973971605301, -0.004317973740398884, 0.04028968885540962, 0.021598419174551964, -0.03666429966688156, -0.0012643968220800161, -0.03816917911171913, -0.007126794662326574, 0.01313348114490509, 0.018263746052980423, 0.03179054707288742, -0.005010559689253569, 0.008764204569160938, 0.020589467138051987, 0.016929877921938896, -0.03574085235595703, -0.02961873635649681, 0.0740126371383667, 0.06289706379175186, 0.03539883717894554, 0.028797892853617668, 0.015348046086728573, -0.030696092173457146, -0.007661197334527969, -0.00664369435980916, 0.014929073862731457, 0.04678802564740181, 0.0016203089617192745, -0.017904628068208694, 0.013184783980250359, 0.01678452081978321, 0.027053602039813995, 0.009533744305372238, -0.006045163609087467, 0.04644600674510002, -0.006844629999250174, -0.012492197565734386, 0.04093952104449272, -0.0385453999042511, 0.052157703787088394, -0.03769035264849663, 0.035005513578653336, 0.0006241823430173099, 0.04042649641633034, 0.03273109719157219, 0.023907039314508438, 0.020931486040353775, 0.0464802086353302, 0.027139106765389442, -0.004322248976677656, 0.05595410242676735, -0.06436773389577866, -0.02418065443634987, -0.07196053117513657, 0.03298760950565338, -0.05527006462216377, 0.015519054606556892, -0.07134489715099335, 0.06683026254177094, 0.03769035264849663, 0.0009159662295132875, 0.04552255943417549, 0.004127726424485445, -0.0531153529882431, 0.005497935228049755, 0.01867416873574257, -0.021906236186623573, -0.004668542183935642, 0.011534548364579678, 0.06108436733484268, 0.007383307907730341, -0.0027361419051885605, -0.023633426055312157, -0.009713303297758102, 0.02631826512515545, 0.02474498376250267, 0.07025044411420822, -0.032885003834962845, -0.0642993375658989, -0.009986917488276958, -0.045385751873254776, 0.02106829173862934, -0.020982788875699043, 0.004307285882532597, -0.027754738926887512, -0.036253880709409714, -0.005267072934657335, -0.043231040239334106, 0.002635674085468054, 0.0819474458694458, 0.006836079526692629, -0.005271348170936108, -0.005245697218924761 ]
31,842
stevedore.extension
items
Return an iterator of tuples of the form (name, extension). This is analogous to the Mapping.items() method.
def items(self): """Return an iterator of tuples of the form (name, extension). This is analogous to the Mapping.items() method. """ return self._extensions_by_name.items()
(self)
[ 0.07007921487092972, -0.053440965712070465, -0.053851787000894547, -0.02309156395494938, 0.03344767913222313, 0.003797954646870494, -0.010612876154482365, -0.012153455056250095, 0.11071626096963882, -0.009739881381392479, 0.028945764526724815, -0.009560147300362587, 0.006551739294081926, 0.020986106246709824, -0.02437538094818592, -0.011374606750905514, -0.0166896041482687, 0.057446472346782684, -0.042554210871458054, 0.033139560371637344, -0.020541051402688026, 0.057309530675411224, 0.052311208099126816, -0.015380111522972584, -0.010338995605707169, 0.04981204867362976, 0.034817080944776535, -0.01735718734562397, 0.06840170174837112, -0.014250353910028934, -0.09756999462842941, -0.04861382022500038, 0.020746462047100067, -0.042896561324596405, -0.053920257836580276, 0.017314394935965538, -0.009654293768107891, 0.034269317984580994, 0.019240116700530052, 0.034560319036245346, 0.034269317984580994, 0.013830973766744137, 0.024666378274559975, -0.016792308539152145, 0.017973419278860092, 0.008028127253055573, -0.01783647947013378, -0.009397530928254128, 0.06412231177091599, -0.006697238422930241, 0.019787879660725594, 0.00827633123844862, 0.00627785874530673, -0.042554210871458054, -0.06189703196287155, 0.06764853000640869, 0.0036053822841495275, 0.038617175072431564, 0.01882929727435112, 0.0964059978723526, 0.006611650809645653, -0.0586104653775692, 0.035809896886348724, -0.07552259415388107, 0.017160335555672646, -0.01977076195180416, -0.028278179466724396, -0.052105799317359924, -0.0666557103395462, 0.032626036554574966, 0.0016807286301627755, -0.034012556076049805, 0.01903470791876316, 0.013035008683800697, -0.05227697268128395, 0.009834027849137783, -0.023142917081713676, 0.03676848113536835, 0.046559713780879974, -0.042554210871458054, 0.001799481688067317, 0.013882326893508434, -0.04334161803126335, 0.029425054788589478, 0.01746845245361328, 0.015080554410815239, 0.013736827298998833, -0.03017822653055191, -0.01522605400532484, 0.09661141037940979, -0.05121568590402603, 0.03050346113741398, 0.031479161232709885, 0.047963354736566544, -0.05549507215619087, -0.048374176025390625, -0.04471101984381676, -0.00609384523704648, -0.026669131591916084, 0.02476908452808857, 0.006401960738003254, -0.0017213828396052122, 0.013223301619291306, 0.026788953691720963, 0.003986247815191746, 0.0014164766762405634, -0.02410149946808815, -0.06556018441915512, 0.014096296392381191, 0.0067357528023421764, -0.035809896886348724, 0.026925893500447273, 0.034491848200559616, 0.009851145558059216, 0.03307109326124191, -0.03279720991849899, -0.008969591930508614, -0.02591595984995365, 0.030554812401533127, -0.02122575230896473, -0.041355982422828674, 0.07079815119504929, 0.002835092833265662, 0.05436531454324722, 0.012273278087377548, -0.02870611846446991, 0.044026318937540054, -0.015731021761894226, -0.009876822121441364, -0.03717930242419243, 0.05960328131914139, -0.02262939140200615, -0.013959355652332306, -0.021550985053181648, 0.035296373069286346, -0.04854534938931465, 0.07223603129386902, -0.03036651946604252, -0.017596833407878876, 0.06614218652248383, -0.0325918011367321, 0.027661947533488274, -0.007955377921462059, 0.0556662492454052, -0.051249921321868896, -0.06716923415660858, 0.025881724432110786, 0.017990536987781525, -0.002698152558878064, -0.05902128666639328, -0.03236927092075348, 0.003795814933255315, -0.00941464863717556, 0.03135933727025986, -0.04731288552284241, 0.003988387528806925, -0.051900386810302734, 0.011674163863062859, -0.02343391627073288, -0.03390984982252121, -0.0300412867218256, 0.022543802857398987, -0.05823387950658798, 0.022543802857398987, 0.0005889504682272673, 0.010373231023550034, -0.01869235560297966, -0.03810364753007889, 0.008254935033619404, -0.011468753218650818, 0.02711418643593788, -0.01942840963602066, -0.03372155874967575, -0.03050346113741398, 0.012076426297426224, 0.06107538938522339, 0.017237365245819092, 0.0600825734436512, 0.05436531454324722, 0.040431633591651917, -0.0025676314253360033, -0.03146204352378845, -0.08024703711271286, 0.015962108969688416, 0.011075049638748169, 0.02511143498122692, 0.028894411399960518, 0.017904948443174362, 0.06148621067404747, -0.025624960660934448, 0.028654765337705612, -0.0415271557867527, -0.002832953352481127, 0.01970229111611843, -0.03837753087282181, 0.009936733171343803, -0.03697388991713524, 0.028346650302410126, -0.054057199507951736, 0.037076596170663834, -0.07634423673152924, -0.057857293635606766, -0.02369067817926407, 0.02884305827319622, -0.028654765337705612, 0.02497449330985546, 0.03954152390360832, -0.06912063807249069, -0.02649795636534691, -0.005113865714520216, -0.004514751955866814, -0.022252805531024933, -0.00003533836206770502, -0.02069510892033577, 0.031479161232709885, -0.05628247931599617, -0.030007051303982735, -0.04892193526029587, 0.025248374789953232, -0.0014753182185813785, 0.005058233626186848, 0.004938411060720682, -0.009919615462422371, -0.017853597179055214, 0.04371820390224457, -0.030674636363983154, 0.01525173056870699, -0.007163691334426403, -0.033088210970163345, 0.0003551889967638999, 0.03469725698232651, 0.015799490734934807, 0.037008125334978104, -0.027542125433683395, 0.0032608918845653534, 0.04019198939204216, -0.005747214891016483, -0.0037487416993826628, 0.02810700424015522, 0.011434517800807953, 0.01848694495856762, 0.04940122738480568, -0.023348327726125717, 0.03878835216164589, -0.06169162318110466, -0.01448999997228384, 0.020352758467197418, 0.020147347822785378, 0.007232161704450846, -0.00732630817219615, 0.06645029783248901, 0.0012945141643285751, 0.034748610109090805, 0.010493053123354912, 0.01576525717973709, -0.03365308791399002, -0.05833658576011658, -0.03110257349908352, 0.03670001029968262, -0.026583543047308922, 0.028997115790843964, 0.008961033076047897, 0.00869143195450306, 0.07114050537347794, -0.01395079679787159, 0.031753040850162506, 0.03659730404615402, 0.025248374789953232, -0.050428278744220734, 0.06936027854681015, 0.0830543115735054, 0.02937370166182518, -0.034885551780462265, 0.009705646894872189, -0.027542125433683395, 0.011502988636493683, 0.02108881250023842, 0.024460967630147934, -0.04399208351969719, -0.018914883956313133, -0.013112037442624569, 0.017442775890231133, -0.049777813255786896, 0.007309190463274717, -0.004091092385351658, -0.058713171631097794, -0.015705345198512077, 0.03336209058761597, -0.03731624037027359, -0.004073975142091513, 0.029698936268687248, -0.002490602433681488, -0.015987783670425415, -0.04361549764871597, 0.045909248292446136, -0.014276030473411083, -0.02316003479063511, -0.030691754072904587, 0.07908304780721664, 0.04994898661971092, 0.017006278038024902, -0.008477462455630302, -0.01384809147566557, 0.029202526435256004, -0.03906223177909851, 0.05200309306383133, 0.042485740035772324, 0.025077199563384056, -0.061246566474437714, 0.03950728848576546, -0.02636101469397545, -0.02536819688975811, 0.0056188334710896015, 0.02276633121073246, -0.020934754982590675, -0.04847687855362892, -0.03132510185241699, 0.05275626480579376, -0.010142143815755844, 0.056385185569524765, -0.036152251064777374, 0.05039404332637787, -0.011160637252032757, -0.006055330391973257, 0.004887058399617672, 0.02108881250023842, 0.005434819497168064, 0.031598981469869614, 0.034337788820266724, -0.03478284552693367, -0.016201753169298172, -0.04166409745812416, 0.007292073220014572, 0.05029134079813957, -0.03031516820192337, 0.05107874795794487, 0.0467308908700943, 0.03272873908281326, 0.051968857645988464, -0.05039404332637787, 0.0025933077558875084, -0.03800094500184059, -0.04998322203755379, 0.0027002922724932432, -0.030948515981435776, -0.030400754883885384, -0.0017588274786248803, 0.015739580616354942, 0.030828693881630898, -0.02591595984995365, 0.021345574408769608, -0.021054577082395554, -0.013137714006006718, -0.008177906274795532, 0.017245924100279808, -0.0005370628787204623, -0.02382761798799038, -0.015405788086354733, -0.019000472500920296, 0.09284555166959763, 0.0794253945350647, 0.007886908017098904, -0.02511143498122692, -0.03878835216164589, 0.027884475886821747, -0.08729946613311768, 0.03091428056359291, 0.012444453313946724, 0.05474190041422844, -0.0710720345377922, -0.009620058350265026, 0.026925893500447273, -0.04488219693303108, -0.045429956167936325, 0.0016689603216946125, -0.06182856112718582, 0.050702162086963654, 0.06080150976777077, -0.06473854184150696, 0.019719408825039864, 0.031016986817121506, -0.0024114337284117937, -0.0034598831553012133, 0.020250052213668823, 0.006393401883542538, -0.023793384432792664, 0.02557360753417015, -0.02817547507584095, -0.020181583240628242, 0.03130798414349556, -0.009851145558059216, -0.021670809015631676, -0.06614218652248383, 0.037418946623802185, -0.028534943237900734, -0.058918580412864685, -0.012992214411497116, -0.07305767387151718, -0.05950057879090309, -0.014062060974538326, 0.05494730919599533, -0.04895617067813873, -0.03257468342781067, 0.029014233499765396, 0.01251292321830988, -0.06340337544679642, 0.00941464863717556, 0.030623283237218857, -0.013805298134684563, -0.00908085610717535, 0.015910755842924118, -0.027918711304664612, -0.04847687855362892, -0.084629125893116, 0.002578329760581255, -0.026874542236328125, -0.02564207836985588, -0.0069540017284452915, 0.010116467252373695, 0.022047394886612892, 0.012778244912624359, -0.035296373069286346, -0.0012987934751436114, 0.034885551780462265, -0.013728269375860691, -0.03704236075282097, -0.0043863700702786446, 0.0016860779142007232, -0.012153455056250095, -0.0026810350827872753, -0.05152380093932152, -0.026138486340641975, -0.000766544952057302, -0.03978116810321808, 0.05313285067677498, -0.04847687855362892, -0.042485740035772324, -0.07066121697425842, -0.039027996361255646, 0.019856348633766174, 0.005456216633319855, 0.058987051248550415, 0.02363932505249977, -0.04553266242146492, 0.03156474977731705, -0.01882929727435112, -0.05987716466188431, 0.05874740332365036, 0.03913070261478424, -0.02182486653327942, -0.026754718273878098, 0.005421981681138277, 0.10482782870531082, -0.05974022299051285, 0.0355360172688961, 0.04649124667048454, -0.025197021663188934, -0.030024169012904167, -0.02324562333524227, -0.019668055698275566, 0.010244849137961864, 0.013206183910369873, 0.03142780810594559, -0.052174270153045654, 0.018675237894058228, -0.009286266751587391, -0.0012613489525392652, 0.05169497802853584, 0.031753040850162506, 0.03844600170850754, 0.04313620552420616, 0.053167086094617844, -0.030948515981435776, -0.10578641295433044, 0.005965463351458311, 0.03045210801064968, -0.010920992121100426, 0.03322514891624451, 0.017211688682436943, -0.07771363854408264, 0.014832350425422192, -0.06241055950522423, 0.022081630304455757, 0.002130064181983471, 0.005507569294422865, -0.009329060092568398, 0.03149627894163132, -0.03149627894163132, -0.022732095792889595, -0.03570719435811043, 0.040363166481256485, 0.015568404458463192, -0.03257468342781067, 0.029698936268687248, 0.05005169287323952, 0.020523933693766594, 0.016586897894740105, 0.0014143369626253843, -0.002648939611390233, 0.02502584643661976, 0.037418946623802185, -0.010980903171002865, 0.07018192112445831, -0.0012046470073983073, 0.009286266751587391, 0.005233688745647669, 0.009483118541538715, -0.03519366681575775, -0.005272203125059605, -0.06942874938249588, -0.011314695701003075, -0.027610596269369125, 0.0011072909692302346, -0.02129422314465046, 0.034269317984580994, -0.03943881765007973, -0.018709473311901093, 0.03673424571752548, 0.009996645152568817, 0.061383508145809174, 0.013291771523654461, -0.05833658576011658, 0.012735451571643353, -0.008926798589527607, 0.014241795055568218, -0.02363932505249977, -0.0698053389787674, -0.012846715748310089, -0.016937807202339172, 0.04399208351969719, 0.06203397363424301, -0.004835705738514662, -0.00811371486634016, -0.022252805531024933, -0.035159431397914886, -0.02636101469397545, 0.00891823973506689, -0.0033293620217591524, -0.005683023948222399, 0.10428006947040558, 0.05552930757403374, 0.027216892689466476, 0.03177015855908394, -0.012684098444879055, 0.04412902519106865, 0.0065132249146699905, -0.06538901478052139, -0.05128415673971176, 0.053304027765989304, -0.00033459445694461465, 0.015405788086354733, -0.040842454880476, -0.0667584165930748, -0.04467678442597389, 0.025659196078777313, -0.04108210280537605, -0.01763106882572174, -0.037555888295173645, -0.0735369622707367, -0.005956904496997595, 0.032745856791734695, 0.027816006913781166, -0.08565618097782135, 0.005426261108368635, 0.002181416843086481, 0.014250353910028934, 0.01829865202307701, 0.046628184616565704, -0.013231860473752022, 0.02637813240289688, 0.015705345198512077, 0.03396120294928551, 0.020660873502492905, 0.0005745075177401304, 0.021123047918081284, 0.03310532495379448, 0.006611650809645653, -0.0016475634183734655, -0.004578942432999611, -0.06504666060209274, 0.005901272874325514, 0.03557025268673897, 0.05039404332637787, 0.015397229231894016, 0.006607371382415295, 0.0058456407859921455, -0.002370779635384679, 0.03125663101673126, -0.022800566628575325, 0.0326431542634964, 0.003151767421513796, -0.011691281571984291, -0.017168894410133362, -0.03432067111134529, 0.022543802857398987, -0.0496751070022583, -0.039096467196941376, 0.005909831263124943, -0.09127073734998703, -0.026943011209368706, 0.026925893500447273, 0.035878367722034454, 0.03844600170850754, 0.02122575230896473, 0.01559408102184534, -0.04488219693303108, 0.03765859454870224, 0.0035347724333405495, 0.0003530493122525513, 0.037282008677721024, -0.05960328131914139, -0.014532793313264847, 0.003708087606355548, -0.06063033640384674, 0.0050496747717261314, -0.004287944175302982, 0.026463720947504044, 0.02163657359778881, 0.03135933727025986, 0.005272203125059605, -0.05710412189364433, 0.010895315557718277, -0.031616099178791046, 0.07155133038759232, -0.0063292114064097404, -0.07949386537075043, -0.001309491926804185, 0.006663003470748663, 0.04587501287460327, -0.05320132151246071, 0.006414799019694328, -0.0029206806793808937, 0.0608699806034565, -0.041492924094200134, 0.029270997270941734, -0.0022188613656908274, -0.031410690397024155, -0.0638142004609108, -0.06542325019836426, 0.04765523597598076, -0.0044291638769209385, -0.015277406200766563, -0.03135933727025986, -0.0023643604945391417, -0.016347253695130348, 0.06401960551738739, -0.025488020852208138, 0.011460194364190102, 0.05415990203619003, -0.03331073746085167, 0.024272674694657326, 0.015371552668511868, -0.0018262277590110898, 0.02769618295133114, -0.027525007724761963, 0.028346650302410126, -0.00869143195450306, -0.0040696957148611546, -0.009851145558059216, -0.022252805531024933, -0.0020113112404942513, -0.0267033651471138, 0.0028671883046627045, -0.025624960660934448, 0.059979867190122604, -0.022321274504065514, -0.035878367722034454, 0.027952946722507477, 0.01308636087924242, 0.022988859564065933, 0.013026449829339981, 0.05282473564147949, 0.017314394935965538, -0.03933611139655113, -0.06514936685562134, 0.029801640659570694, -0.009936733171343803, 0.040431633591651917, 0.07237296551465988, 0.013574210926890373, -0.0452587828040123, -0.023656442761421204, 0.009996645152568817, 0.06490971893072128, -0.0014571307692676783, 0.005712979938834906, -0.007993891835212708, -0.00981691014021635, 0.019000472500920296, -0.025402432307600975, 0.010236290283501148, -0.020386992022395134, 0.00667584128677845, 0.013736827298998833, 0.026943011209368706, 0.0586104653775692, 0.05172921344637871, -0.061383508145809174, 0.03043499030172825, -0.027627713978290558, 0.02363932505249977, 0.024392498657107353, 0.0355360172688961, -0.030161108821630478, 0.029664700850844383, -0.01666392758488655, -0.01809324137866497, 0.00897815078496933, 0.003919917158782482, 0.043238911777734756, -0.05683023855090141, 0.05706988647580147, -0.02095187082886696, -0.03317379578948021, 0.0482029989361763, -0.06217091530561447, 0.045498427003622055, 0.00782699603587389, 0.022252805531024933, 0.0556662492454052, 0.011134961619973183, -0.005704421084374189, 0.04614889249205589, 0.07182520627975464, -0.00475867697969079, 0.05087333545088768, -0.019941937178373337, 0.021345574408769608, -0.04792911931872368, 0.05429684370756149, -0.01775089092552662, -0.025539373978972435, -0.07018192112445831, 0.05594012886285782, 0.003780837170779705, -0.02743942104279995, -0.021602338179945946, 0.021996041759848595, -0.006243623327463865, -0.015842285007238388, -0.0022103027440607548, 0.022218570113182068, 0.00644047511741519, 0.008139391429722309, -0.017904948443174362, -0.06805934756994247, 0.0392676405608654, 0.007304911036044359, -0.04744982719421387, 0.03331073746085167, 0.023930324241518974, 0.024392498657107353, 0.013411594554781914, -0.01611616648733616, 0.0009452092926949263, 0.018504062667489052, 0.04632006958127022, -0.0821642056107521, -0.035090960562229156, -0.00809231773018837, -0.05453648790717125, -0.002049825619906187, 0.013805298134684563, -0.0014143369626253843, -0.010390347801148891, -0.009594382718205452, 0.020198699086904526, 0.006757149938493967 ]
31,843
stevedore.extension
list_entry_points
Return the list of entry points for this namespace. The entry points are not actually loaded, their list is just read and returned.
def list_entry_points(self): """Return the list of entry points for this namespace. The entry points are not actually loaded, their list is just read and returned. """ if self.namespace not in self.ENTRY_POINT_CACHE: eps = list(_cache.get_group_all(self.namespace)) self.ENTRY_POINT_CACHE[self.namespace] = eps return self.ENTRY_POINT_CACHE[self.namespace]
(self)
[ 0.002601751359179616, -0.0078009250573813915, -0.05676233395934105, 0.004396137315779924, 0.020086731761693954, 0.04730771854519844, 0.0020281539764255285, -0.021246913820505142, 0.017298832535743713, 0.017316147685050964, -0.028017528355121613, -0.046580441296100616, -0.008987081237137318, -0.0072771115228533745, -0.0214373916387558, -0.024502350017428398, 0.014943836256861687, 0.008259803056716919, -0.07085768133401871, -0.04353279620409012, -0.026562971994280815, -0.022788051515817642, 0.04322110489010811, -0.032034873962402344, -0.030476421117782593, 0.03296994790434837, 0.06701349467039108, -0.04148949310183525, 0.029645245522260666, 0.00016653264174237847, -0.05922122672200203, -0.011679742485284805, -0.050216831266880035, -0.031221015378832817, -0.002671015914529562, -0.024935252964496613, 0.02242441289126873, -0.01045895367860794, 0.0014394047902897, 0.0323292501270771, 0.062476664781570435, 0.014147293753921986, 0.02670150063931942, -0.018216587603092194, 0.05870174244046211, 0.040415890514850616, 0.07792266458272934, 0.0012932998361065984, 0.06368879228830338, -0.05149822682142258, -0.011965458281338215, -0.003476216923445463, 0.03615611791610718, 0.013887550681829453, -0.012381046079099178, 0.030164729803800583, 0.019428718835115433, 0.04197434335947037, -0.028086792677640915, 0.04502198472619057, -0.012666762806475163, -0.03736824914813042, 0.03404354676604271, 0.019775042310357094, -0.00170672289095819, 0.006484897807240486, -0.02550668641924858, -0.034545715898275375, -0.07134253531694412, 0.004136395175009966, -0.035498104989528656, -0.039169128984212875, -0.03257167711853981, -0.032952629029750824, 0.0031991584692150354, -0.01106501929461956, 0.041039273142814636, -0.010043365880846977, -0.02827727049589157, 0.012060697190463543, -0.026303229853510857, 0.02116033434867859, -0.039169128984212875, 0.01901313103735447, 0.11151599884033203, 0.0016277179820463061, 0.04384448751807213, 0.007298756390810013, -0.0307188481092453, 0.05676233395934105, -0.029298923909664154, 0.011913510039448738, 0.010995754040777683, 0.0056970128789544106, 0.017991477623581886, -0.05319520831108093, -0.049281757324934006, -0.015091023407876492, -0.014822622761130333, -0.015411372296512127, 0.01596548967063427, -0.038545746356248856, -0.0013907031388953328, 0.04232066869735718, 0.024762092158198357, -0.01967114396393299, -0.01275334320962429, -0.010562850162386894, -0.043117210268974304, 0.06697886437177658, -0.026840029284358025, 0.02851969748735428, 0.060329459607601166, 0.00969704333692789, 0.02027720957994461, -0.010242502205073833, -0.033627960830926895, 0.012155936099588871, 0.051671385765075684, 0.005393980070948601, -0.054441969841718674, 0.10555924475193024, 0.0041775209829211235, -0.0018972004763782024, -0.0168486125767231, -0.008515216410160065, -0.0074113113805651665, 0.052987415343523026, -0.015437345951795578, -0.06981871277093887, 0.08090104907751083, -0.016121333464980125, -0.03447645157575607, -0.009039029479026794, -0.01783563382923603, -0.06109137088060379, 0.08713486045598984, -0.027705837041139603, -0.04536831006407738, 0.08325604349374771, -0.019411401823163033, 0.03253704309463501, -0.02668418549001217, 0.02427724003791809, -0.050216831266880035, -0.026476390659809113, 0.017584549263119698, 0.054545868188142776, 0.0015736049972474575, -0.049281757324934006, 0.011861561797559261, -0.0398271419107914, -0.007519537582993507, -0.019792357459664345, -0.021039120852947235, -0.025697164237499237, -0.004554146900773048, 0.02363654226064682, -0.02207808941602707, -0.04457176476716995, -0.08464133739471436, 0.011316102929413319, -0.03920375928282738, -0.07757634669542313, -0.01899581402540207, -0.0003725677670445293, 0.03322969004511833, -0.02090059034526348, -0.03316042572259903, 0.027169037610292435, -0.02890065126121044, -0.0020162491127848625, -0.0000712938272044994, 0.05707402527332306, 0.027878999710083008, 0.0010340987937524915, 0.008151576854288578, 0.04613022133708, 0.0676715075969696, 0.04872764274477959, 0.01181827113032341, -0.029368188232183456, -0.052052341401576996, 0.025039151310920715, -0.05035535991191864, 0.020121363922953606, 0.032658256590366364, 0.007852873764932156, -0.008168892934918404, 0.029939619824290276, -0.03312579169869423, 0.013316118158400059, 0.01045029517263174, 0.027463411912322044, -0.08020839840173721, 0.02271878719329834, -0.10902246832847595, 0.0215239729732275, -0.09641631692647934, -0.02644175849854946, -0.04242456331849098, -0.007519537582993507, 0.01840706542134285, -0.005917793605476618, 0.055099982768297195, 0.03837258368730545, -0.06538577377796173, -0.027792418375611305, -0.052952781319618225, 0.08429501205682755, -0.009342062287032604, -0.04952418431639671, -0.020710114389657974, -0.000755416986066848, -0.0023160348646342754, 0.012207884341478348, -0.0091948751360178, 0.028969915583729744, -0.0066450717858970165, 0.006948104593902826, 0.0016850776737555861, -0.031498074531555176, 0.031117118895053864, -0.0074113113805651665, -0.06368879228830338, -0.0047013345174491405, 0.070615254342556, 0.028052160516381264, -0.006207839120179415, -0.05437270551919937, 0.03875353932380676, -0.026233965530991554, -0.01565379835665226, -0.04232066869735718, 0.06351563334465027, -0.01567111350595951, 0.019463350996375084, 0.05922122672200203, 0.07598325610160828, 0.01690056174993515, -0.007251137401908636, 0.003171019721776247, 0.017922213301062584, 0.0036147460341453552, -0.03277947008609772, 0.040658317506313324, 0.004437263123691082, -0.053887855261564255, 0.03529031202197075, -0.015013100579380989, 0.0019036941230297089, 0.00935937836766243, -0.00523380609229207, -0.04401765018701553, -0.040381256490945816, -0.05250256136059761, -0.06587062776088715, 0.059359755367040634, 0.026493707671761513, 0.00759313115850091, 0.05028609558939934, 0.02640712633728981, 0.006493555847555399, 0.028052160516381264, 0.0428747832775116, 0.0673944503068924, 0.049905139952898026, 0.02361922711133957, -0.026199333369731903, 0.033922333270311356, 0.014536906965076923, 0.012467626482248306, -0.016580212861299515, 0.009852888062596321, 0.007346375845372677, 0.019463350996375084, 0.006887497846037149, 0.03262362256646156, -0.07342047244310379, -0.005653722677379847, 0.05610432103276253, 0.02112570032477379, -0.032052189111709595, 0.03040715679526329, -0.00482687633484602, -0.060052402317523956, -0.017411386594176292, 0.033004578202962875, -0.017021773383021355, -0.019826989620923996, 0.026233965530991554, 0.02391360141336918, -0.000591995834838599, -0.06285762041807175, 0.010060681961476803, 0.026874663308262825, -0.007822570390999317, -0.06019093096256256, 0.018268536776304245, 0.07155032455921173, -0.0004448085674084723, -0.02055426873266697, 0.028987232595682144, 0.03878817334771156, 0.008385345339775085, 0.04820815846323967, 0.0261127520352602, 0.04048515483736992, 0.025939591228961945, -0.026511022821068764, 0.014441668055951595, -0.024173343554139137, -0.006710007321089506, -0.021108385175466537, -0.030822744593024254, -0.002634219126775861, -0.029835723340511322, 0.004818218294531107, -0.021281545981764793, 0.03321237117052078, -0.06008703634142876, 0.06912606209516525, 0.04013883322477341, 0.0047013345174491405, 0.04107390344142914, 0.02455429919064045, 0.05703939497470856, 0.02181834727525711, 0.02921234257519245, -0.0322599858045578, -0.010675405152142048, -0.07217370718717575, -0.04048515483736992, 0.07916942983865738, -0.01690056174993515, 0.03433792293071747, 0.004562804941087961, -0.036363910883665085, 0.001972958678379655, -0.04758477583527565, 0.04855448007583618, -0.009913494810461998, -0.08055472373962402, 0.01722956821322441, -0.03442450240254402, -0.010337741114199162, 0.06102210655808449, 0.017255542799830437, 0.011601819656789303, -0.027515359222888947, -0.023723123595118523, 0.03317774087190628, -0.01428582239896059, 0.04142022877931595, 0.07584472745656967, -0.0023398445919156075, -0.01686592772603035, -0.03594832494854927, -0.0003474052355159074, 0.028987232595682144, 0.059429023414850235, 0.01745467819273472, -0.06057188659906387, -0.016805322840809822, -0.04820815846323967, -0.040346626192331314, 0.06368879228830338, -0.026857346296310425, 0.10784497112035751, -0.052641090005636215, -0.02976645901799202, -0.0033831424079835415, -0.011445973999798298, -0.017653813585639, -0.01717761904001236, -0.036710236221551895, 0.07258929312229156, 0.03158465400338173, -0.05129043012857437, 0.04055441915988922, -0.006627755705267191, 0.02734219841659069, -0.002218631561845541, -0.001102822250686586, -0.021541288122534752, 0.018562911078333855, 0.0009269550791941583, -0.011272812262177467, 0.04709992557764053, 0.028138741850852966, 0.04522978141903877, -0.017956845462322235, 0.005800909828394651, 0.030563002452254295, -0.03955008462071419, -0.009982760064303875, 0.04207824170589447, -0.0005865845014341176, -0.019238241016864777, -0.03958471491932869, 0.0643468052148819, 0.018216587603092194, 0.021662501618266106, 0.0007667806930840015, 0.006952433846890926, -0.0797928124666214, 0.02517767995595932, -0.04800036549568176, 0.012779317796230316, 0.008679719641804695, -0.01200009137392044, -0.03250240907073021, 0.011030386202037334, -0.059082698076963425, 0.013168931007385254, 0.010216527618467808, -0.032675571739673615, -0.0012521740281954408, 0.04522978141903877, 0.005839871242642403, 0.009748991578817368, -0.030909325927495956, 0.007688370067626238, 0.03194829449057579, -0.009619120508432388, -0.018926549702882767, -0.033956967294216156, -0.01732480712234974, -0.04412154480814934, 0.0042208111844956875, -0.036952659487724304, 0.01624254696071148, -0.01502175908535719, -0.05589652806520462, -0.0029653904493898153, -0.02734219841659069, 0.032658256590366364, -0.044710297137498856, -0.01899581402540207, -0.0058961487375199795, -0.03632928058505058, 0.01963651180267334, 0.04491809010505676, 0.01165376789867878, 0.03309116140007973, 0.047446247190237045, -0.06680569797754288, 0.021039120852947235, 0.01194814220070839, -0.05271035432815552, -0.05045925825834274, -0.04121243208646774, 0.04332500323653221, 0.0047879149205982685, -0.01873607188463211, -0.009151584468781948, -0.03892670199275017, -0.025333525612950325, -0.04183581471443176, 0.031775131821632385, -0.01194814220070839, 0.008848551660776138, 0.023844337090849876, -0.0367795005440712, -0.013497937470674515, -0.012233858928084373, 0.041628021746873856, -0.0018831311026588082, 0.014510932378470898, 0.003935094922780991, 0.02827727049589157, 0.012103987857699394, -0.039411552250385284, -0.10521291941404343, -0.022961212322115898, 0.050182197242975235, 0.009766307659447193, -0.006666717119514942, -0.025679849088191986, -0.010900515131652355, -0.020762061700224876, -0.043428901582956314, 0.049628082662820816, 0.011454632505774498, -0.02514304779469967, -0.04703065752983093, 0.0398271419107914, -0.03643317520618439, -0.05399174988269806, -0.03251972794532776, 0.027584625408053398, -0.0019069408299401402, -0.009134268388152122, -0.012173252180218697, 0.05156749114394188, 0.02245904505252838, 0.09939469397068024, 0.04076221212744713, 0.042182136327028275, 0.00043723275302909315, -0.007268453482538462, -0.0072944276034832, -0.004896141123026609, 0.04176655039191246, 0.02490062080323696, 0.0460609532892704, 0.008839894086122513, -0.004458908457309008, 0.012614814564585686, -0.005684025585651398, 0.0460609532892704, -0.008290106430649757, 0.01930750533938408, -0.002023824956268072, 0.02214735373854637, 0.01809537597000599, 0.004857179708778858, 0.012052039615809917, -0.04703065752983093, 0.048623744398355484, 0.01046761218458414, 0.027705837041139603, 0.0735590010881424, -0.004168862942606211, -0.034840092062950134, 0.0230304766446352, -0.03321237117052078, 0.015376740135252476, -0.05793983116745949, 0.054511234164237976, 0.05710865929722786, 0.024762092158198357, -0.006073639262467623, -0.006445936392992735, -0.006909143179655075, 0.048623744398355484, -0.03174050152301788, -0.05191381275653839, 0.00796542875468731, 0.03324700519442558, 0.010649431496858597, -0.023082425817847252, 0.05340300127863884, -0.012060697190463543, 0.03404354676604271, 0.02394823357462883, -0.007432956714183092, -0.011697058565914631, 0.015065048821270466, -0.017904898151755333, 0.09724748879671097, -0.02083132602274418, 0.06275372207164764, -0.06282299011945724, 0.02981840819120407, -0.06670180708169937, 0.018216587603092194, -0.03165391832590103, -0.04730771854519844, 0.020433055236935616, -0.022528309375047684, -0.00045833681360818446, -0.00792646687477827, 0.013852918520569801, -0.05045925825834274, -0.03722972050309181, -0.06988797336816788, -0.0004488670383580029, -0.0428747832775116, 0.052017711102962494, -0.0021298862993717194, -0.00994812697172165, 0.021870296448469162, -0.07189664989709854, 0.0015194920124486089, 0.03007815033197403, -0.006441607140004635, -0.0024805383291095495, 0.003751110751181841, -0.06171475350856781, 0.0077965958043932915, -0.056312114000320435, 0.05000903829932213, -0.017575889825820923, -0.012874556705355644, 0.06483165919780731, -0.013376724906265736, 0.03187903016805649, 0.026337862014770508, 0.03875353932380676, -0.02851969748735428, 0.025039151310920715, 0.05336837098002434, -0.01873607188463211, -0.00317751313559711, -0.05084021016955376, -0.036987293511629105, 0.007671053986996412, -0.023394117131829262, -0.015887565910816193, 0.021922243759036064, 0.04813889414072037, 0.018545595929026604, -0.016484973952174187, 0.030216678977012634, -0.036052219569683075, -0.009593145921826363, -0.0011450303718447685, -0.016017436981201172, 0.02699587494134903, -0.05468439683318138, -0.0323292501270771, 0.039446186274290085, -0.02819068916141987, 0.009134268388152122, -0.013298802077770233, 0.050182197242975235, -0.010441637597978115, 0.03286604955792427, -0.0040216753259301186, 0.021627869457006454, 0.03007815033197403, 0.029298923909664154, 0.010805276222527027, 0.04633801430463791, -0.03013009764254093, 0.04419080913066864, 0.021852979436516762, 0.07245076447725296, 0.0459570586681366, 0.02334216795861721, 0.03906523063778877, -0.05343763530254364, -0.07646811008453369, 0.026337862014770508, 0.01901313103735447, -0.0035822782665491104, -0.05745498090982437, -0.0025714479852467775, -0.009212191216647625, 0.012736027128994465, -0.008199196308851242, 0.0016158131184056401, -0.039411552250385284, -0.012831266038119793, 0.03075348027050495, -0.01616462506353855, -0.005186186637729406, 0.11899657547473907, 0.00622515520080924, -0.021575920283794403, -0.0215239729732275, 0.015394056215882301, 0.03771457076072693, -0.03342016786336899, 0.041350964456796646, -0.07397458702325821, -0.018181955441832542, -0.02890065126121044, -0.06635548174381256, -0.04142022877931595, -0.025039151310920715, -0.07889237254858017, -0.022251250222325325, -0.016779348254203796, -0.02024257741868496, -0.042805518954992294, 0.04613022133708, -0.03622538223862648, 0.05922122672200203, -0.024173343554139137, 0.04540294036269188, 0.024121394380927086, 0.027740469202399254, -0.06864121556282043, -0.029610613361001015, -0.04356743022799492, 0.02671881765127182, -0.02704782411456108, -0.005454586818814278, -0.003588771680369973, -0.01776636764407158, -0.014779333025217056, 0.020433055236935616, -0.035809796303510666, 0.05555020272731781, -0.0028636581264436245, -0.028969915583729744, 0.010536876507103443, 0.0011580174323171377, -0.01587025076150894, -0.015437345951795578, 0.09323014318943024, 0.011627793312072754, 0.006502213887870312, 0.041350964456796646, -0.01200009137392044, 0.01899581402540207, 0.020969856530427933, -0.030233995988965034, -0.009852888062596321, 0.04824278876185417, -0.012484943494200706, -0.005376663990318775, 0.00906500406563282, 0.025835692882537842, -0.0521216057240963, 0.023186322301626205, -0.05620821937918663, 0.06483165919780731, 0.021575920283794403, -0.004580121487379074, 0.03650243952870369, -0.025697164237499237, 0.0369180291891098, -0.03305652737617493, 0.018632175400853157, -0.017870265990495682, 0.05406101420521736, 0.020381106063723564, 0.010259818285703659, 0.026788081973791122, 0.04076221212744713, 0.005640735384076834, 0.010978437960147858, 0.04966271296143532, -0.04581853002309799, -0.03705655783414841, -0.030164729803800583, 0.01181827113032341, -0.054476603865623474, 0.017627838999032974, -0.03719508647918701, 0.059671446681022644, 0.03622538223862648, -0.03632928058505058, 0.009316087700426579, 0.00434418860822916, -0.0428747832775116, -0.03864964470267296, 0.03035520762205124, -0.06174938380718231, -0.009904837235808372, 0.023723123595118523, 0.04983587563037872, -0.006632084958255291, -0.00859746802598238, -0.03503056988120079, -0.006251129787415266, 0.033610645681619644, 0.013264169916510582, 0.04259772598743439, 0.004160204902291298, -0.01899581402540207, -0.01565379835665226, -0.026043487712740898, 0.002089842688292265, -0.002658028854057193, 0.04855448007583618, -0.027584625408053398, -0.057628143578767776, -0.056346748024225235, -0.06784466654062271, 0.007939454168081284, 0.06109137088060379, -0.006346368230879307, 0.0020249071530997753, -0.025298893451690674 ]
31,844
stevedore.extension
map
Iterate over the extensions invoking func() for each. The signature for func() should be:: def func(ext, *args, **kwds): pass The first argument to func(), 'ext', is the :class:`~stevedore.extension.Extension` instance. Exceptions raised from within func() are propagated up and processing stopped if self.propagate_map_exceptions is True, otherwise they are logged and ignored. :param func: Callable to invoke for each extension. :param args: Variable arguments to pass to func() :param kwds: Keyword arguments to pass to func() :returns: List of values returned from func()
def map(self, func, *args, **kwds): """Iterate over the extensions invoking func() for each. The signature for func() should be:: def func(ext, *args, **kwds): pass The first argument to func(), 'ext', is the :class:`~stevedore.extension.Extension` instance. Exceptions raised from within func() are propagated up and processing stopped if self.propagate_map_exceptions is True, otherwise they are logged and ignored. :param func: Callable to invoke for each extension. :param args: Variable arguments to pass to func() :param kwds: Keyword arguments to pass to func() :returns: List of values returned from func() """ if not self.extensions: # FIXME: Use a more specific exception class here. raise NoMatches('No %s extensions found' % self.namespace) response = [] for e in self.extensions: self._invoke_one_plugin(response.append, func, e, args, kwds) return response
(self, func, *args, **kwds)
[ 0.06424438953399658, -0.05454985424876213, -0.029788995161652565, 0.037873804569244385, -0.010607920587062836, 0.019859328866004944, -0.014541803859174252, 0.006208301521837711, 0.04843650758266449, 0.023928863927721977, 0.017797432839870453, -0.0011332524009048939, 0.01719152368605137, 0.0031991065479815006, -0.0325201041996479, -0.018177255988121033, -0.038705796003341675, 0.06753619015216827, 0.0012378168758004904, -0.0016764221945777535, -0.01536475494503975, 0.03572147339582443, 0.07379423081874847, -0.021252015605568886, -0.0033958007115870714, 0.04583200439810753, 0.037946149706840515, -0.01823151670396328, 0.07223876565694809, -0.022789394482970238, -0.019895503297448158, -0.04456592723727226, -0.02944534458220005, -0.030006036162376404, -0.043372198939323425, 0.01445137057453394, -0.03968248516321182, 0.03259245306253433, -0.02875804528594017, -0.007058382034301758, 0.07216642051935196, -0.03743971884250641, 0.010210010223090649, -0.003015977330505848, 0.01614248752593994, 0.014207198284566402, -0.03517886623740196, 0.024127818644046783, 0.04713425785303116, -0.04912380501627922, -0.01616961881518364, -0.007533160969614983, 0.08493570983409882, -0.02631632424890995, 0.019135857000947, 0.14049842953681946, -0.0006562125054188073, 0.04235933721065521, 0.0344192199409008, 0.01982315629720688, 0.010047229006886482, -0.04594052582979202, -0.020618977025151253, -0.01654944196343422, 0.06040998175740242, -0.0003213236923329532, -0.059686511754989624, -0.06493169069290161, -0.03989952802658081, 0.03622790426015854, -0.009002715349197388, -0.05795017629861832, 0.0006528212106786668, -0.02875804528594017, -0.013519898988306522, 0.051402747631073, 0.005665696691721678, 0.05172830820083618, 0.0488344170153141, 0.008419414982199669, -0.012859730049967766, -0.01732717454433441, -0.04322750121355057, 0.015400928445160389, 0.0175170861184597, -0.04644695669412613, -0.018719859421253204, -0.047025736421346664, -0.03507034480571747, 0.03561295196413994, -0.06149519234895706, -0.0000589941228099633, 0.020854104310274124, 0.019027335569262505, -0.07267285138368607, -0.0250864215195179, -0.006574559491127729, 0.0098754046484828, 0.008283764123916626, 0.022156355902552605, 0.03449156880378723, -0.0019567678682506084, -0.0015057278797030449, 0.0002653675910551101, 0.05281351879239082, -0.03289992734789848, -0.02897508814930916, -0.04029743745923042, -0.009183583781123161, 0.06551046669483185, -0.012136257253587246, 0.019407158717513084, 0.043372198939323425, -0.051836829632520676, 0.004336315207183361, -0.006714732386171818, 0.009812100790441036, -0.0033777139615267515, -0.01726387068629265, 0.005891782231628895, -0.006958904676139355, 0.05928859859704971, -0.005118570290505886, -0.013167206197977066, 0.0070719472132623196, 0.0034771913196891546, 0.04250403121113777, 0.02875804528594017, -0.0015249451389536262, -0.033677659928798676, 0.037729110568761826, 0.009278539568185806, -0.006814209744334221, 0.028739959001541138, 0.009775927290320396, -0.06142284348607063, 0.008247590623795986, -0.037801455706357956, -0.043444544076919556, -0.017725083976984024, -0.024272514507174492, -0.0017691171960905194, 0.01609727181494236, 0.06449760496616364, -0.0006533864070661366, -0.06211014464497566, 0.04706190899014473, 0.006986034568399191, 0.013149118982255459, -0.0331893153488636, 0.017526129260659218, 0.008546022698283195, -0.0369875505566597, -0.00911575835198164, -0.05628618597984314, 0.045108530670404434, 0.05176448076963425, 0.043299850076436996, 0.00007898853800725192, -0.03762058913707733, -0.0444212332367897, 0.03953779116272926, -0.05444133281707764, 0.009296625852584839, -0.003956492058932781, -0.01792404055595398, -0.031109333038330078, 0.017553260549902916, 0.0004018665640614927, 0.011014874093234539, 0.010653138160705566, -0.023404346778988838, 0.07379423081874847, -0.012154343537986279, 0.08124600350856781, 0.07545822113752365, -0.013112945482134819, 0.033822353929281235, -0.010454182513058186, 0.0631953552365303, 0.010499400086700916, 0.007560291327536106, -0.08450163155794144, 0.03961014002561569, -0.014722672291100025, 0.04051448032259941, 0.014849280007183552, 0.021450970321893692, -0.041599687188863754, -0.03572147339582443, 0.03675242140889168, -0.02304260991513729, 0.03758441284298897, 0.0188283808529377, -0.05096866190433502, 0.024688510224223137, -0.06261657178401947, 0.0056430883705616, -0.018168212845921516, 0.03020499087870121, -0.07820741832256317, -0.08037783205509186, 0.03830788657069206, 0.009165496565401554, -0.0413464717566967, -0.0020098979584872723, 0.014930671080946922, -0.011213828809559345, -0.037023723125457764, -0.05104101076722145, 0.034979913383722305, -0.03899518772959709, -0.021107319742441177, -0.017218653112649918, 0.03928457573056221, -0.0036377119831740856, 0.05270499736070633, 0.003418409265577793, 0.00671021081507206, 0.015428058803081512, -0.02892082743346691, 0.014876410365104675, -0.034220267087221146, 0.007451770361512899, 0.05527332425117493, 0.033750008791685104, 0.015220060013234615, 0.00869071763008833, 0.01361033320426941, 0.020257240161299706, -0.0013972069136798382, 0.019244378432631493, 0.010761658661067486, -0.0369332879781723, 0.051836829632520676, 0.0015995532739907503, 0.0750964805483818, -0.00579682644456625, 0.0488344170153141, 0.004241359420120716, 0.0419614240527153, 0.04930467531085014, -0.025430070236325264, 0.019497593864798546, -0.007650725543498993, 0.0007376031717285514, -0.0010586442658677697, 0.012986337766051292, 0.03029542602598667, 0.03819936513900757, 0.06359326094388962, 0.012344255112111568, 0.015590840019285679, 0.007845158688724041, -0.020854104310274124, -0.015400928445160389, 0.036969464272260666, -0.021161580458283424, 0.010011055506765842, 0.019949764013290405, 0.027889877557754517, -0.020022111013531685, -0.01730908825993538, -0.022626614198088646, -0.009513667784631252, -0.0032104107085615396, 0.012968250550329685, 0.011195742525160313, 0.019334811717271805, 0.09282156825065613, 0.025068333372473717, 0.03224880248308182, -0.005231612827628851, 0.020618977025151253, -0.02090836502611637, 0.032465845346450806, 0.011177655309438705, -0.03163385018706322, 0.05751609057188034, -0.004616660997271538, 0.012588427402079105, 0.006832296960055828, -0.08117365092039108, -0.05086014047265053, -0.006515777204185724, -0.038018498569726944, -0.009314713068306446, 0.06692124158143997, -0.02394695207476616, -0.038778144866228104, 0.013800244778394699, 0.03510652109980583, 0.00888062920421362, -0.051077183336019516, 0.0017781605711206794, -0.031326375901699066, -0.040550652891397476, -0.037331197410821915, 0.061459019780159, -0.021487142890691757, 0.010924439877271652, -0.049991972744464874, 0.02259043976664543, 0.025140682235360146, -0.03545016795396805, 0.011240959167480469, 0.034672435373067856, 0.005168308969587088, -0.03928457573056221, 0.01075261551886797, 0.014550847932696342, -0.006248996593058109, -0.03532356023788452, -0.020347673445940018, 0.004067273810505867, 0.005227091256529093, 0.002891630632802844, 0.07111737877130508, -0.010806875303387642, 0.0008568631601519883, -0.03136254847049713, 0.07137059420347214, 0.03628216311335564, 0.035974688827991486, 0.053283777087926865, 0.04304663464426994, 0.05845660716295242, -0.03423835337162018, 0.04561496153473854, -0.07849680632352829, -0.01254321075975895, -0.011738346889615059, -0.00011353719310136512, 0.01953376643359661, -0.041527342051267624, 0.009775927290320396, 0.009830187074840069, -0.020492369309067726, -0.00123894726857543, 0.021143494173884392, -0.023151131346821785, -0.01804160512983799, -0.06934487074613571, 0.014804063364863396, -0.03684285655617714, 0.0009314712951891124, -0.008130026049911976, 0.026225890964269638, -0.01929863914847374, -0.00478396425023675, 0.08168008178472519, -0.04225081577897072, -0.023784169927239418, 0.02112540788948536, 0.001068818150088191, -0.019588027149438858, -0.02159566432237625, -0.042069945484399796, -0.027564315125346184, 0.02356712892651558, 0.03823554143309593, -0.039863355457782745, -0.02532155066728592, -0.012796426191926003, 0.03221262991428375, -0.03152532875537872, 0.04547026753425598, -0.02913786843419075, 0.03409365937113762, -0.020872192457318306, 0.03615555539727211, 0.05357316508889198, -0.06974278390407562, -0.015636056661605835, -0.01056270394474268, -0.05407959595322609, 0.029391083866357803, 0.044891491532325745, -0.07187702506780624, 0.06659567356109619, -0.003169715404510498, -0.016847873106598854, 0.001860681688413024, -0.018095863983035088, 0.04377010837197304, 0.012470862828195095, 0.09549841284751892, -0.02700362354516983, -0.020998800173401833, 0.013158162124454975, 0.0014333805302157998, 0.0002089875633828342, -0.062435705214738846, 0.013673637062311172, -0.026189716532826424, -0.05440515652298927, -0.03534165024757385, 0.02830587513744831, 0.007361336145550013, -0.04286576807498932, 0.00633038766682148, -0.009450363926589489, 0.03675242140889168, 0.05317525565624237, 0.022536179050803185, -0.030259251594543457, -0.02166801132261753, 0.019009249284863472, 0.011177655309438705, 0.04597669839859009, -0.004200664348900318, 0.013682680204510689, -0.02930065058171749, -0.08898716419935226, -0.024579990655183792, 0.03300844877958298, -0.019262464717030525, 0.00141529378015548, -0.03809084743261337, -0.022825568914413452, 0.06153136491775513, -0.052524130791425705, 0.02051045559346676, 0.005322047043591738, 0.004906050395220518, -0.08913185447454453, 0.017110133543610573, -0.04416801780462265, -0.040008049458265305, 0.021794619038701057, -0.04156351462006569, -0.045578788965940475, -0.02060088887810707, -0.05346464365720749, 0.03496182709932327, -0.045578788965940475, -0.03167002275586128, -0.01094252709299326, 0.01707395911216736, 0.02058280259370804, 0.014053460210561752, 0.0558159314095974, 0.0439148023724556, -0.07393892854452133, 0.06308683007955551, 0.014243371784687042, -0.040550652891397476, 0.02349478006362915, 0.002466590143740177, -0.002380677964538336, -0.045868176966905594, 0.013121988624334335, 0.09166400879621506, 0.023440521210432053, 0.0690554827451706, 0.04988345131278038, -0.009075062349438667, -0.07878619432449341, -0.05675644427537918, 0.02302452363073826, 0.005267786793410778, -0.04836415871977806, 0.04608521983027458, -0.04879824444651604, -0.02197548747062683, 0.040152743458747864, 0.0175170861184597, 0.03532356023788452, 0.016630832105875015, 0.0024507641792297363, 0.05635853484272957, 0.004679964855313301, 0.00865454412996769, -0.08529745042324066, 0.04112943261861801, 0.037873804569244385, 0.0015599883627146482, 0.014388066716492176, 0.056430883705616, -0.05089631676673889, -0.006316822487860918, -0.03830788657069206, 0.07813506573438644, -0.003972318023443222, -0.014415196143090725, -0.02105305902659893, 0.11061900109052658, -0.06829583644866943, 0.006434386596083641, -0.021686099469661713, 0.0013452073326334357, 0.02785370498895645, 0.028631437569856644, 0.021252015605568886, -0.01109626516699791, -0.014939714223146439, 0.006750905886292458, -0.02204783447086811, 0.03496182709932327, -0.036047033965587616, 0.020492369309067726, -0.011195742525160313, -0.033297836780548096, 0.0025954588782042265, 0.0026904146652668715, 0.011910172179341316, -0.0007099077338352799, -0.011385654099285603, -0.04243168234825134, -0.00739751011133194, -0.033750008791685104, 0.006913687568157911, -0.058094870299100876, -0.003149367868900299, -0.0034930172841995955, -0.020420020446181297, 0.023151131346821785, 0.01395398285239935, -0.029011260718107224, 0.024959813803434372, 0.032158367335796356, -0.04102091118693352, 0.00035834513255394995, -0.004774920642375946, 0.009332799352705479, -0.02814309298992157, -0.035432081669569016, -0.025954589247703552, -0.01285068690776825, 0.045651137828826904, -0.02121584117412567, 0.0024349382147192955, -0.0024236340541392565, -0.03707798197865486, -0.05429663881659508, -0.009595058858394623, 0.0017826823750510812, -0.02432677522301674, -0.016820743680000305, 0.05635853484272957, 0.021993573755025864, 0.026967450976371765, -0.010363748297095299, -0.0022608526051044464, 0.009902535006403923, -0.02013063244521618, -0.044348884373903275, -0.040623001754283905, 0.04890676587820053, -0.028631437569856644, 0.04217846691608429, -0.015066321939229965, -0.023169217631220818, 0.02396503835916519, 0.025809893384575844, -0.05346464365720749, 0.010671224445104599, -0.05111335590481758, -0.10128620266914368, 0.0017894648481160402, 0.009558885358273983, 0.022536179050803185, -0.044963836669921875, -0.024127818644046783, -0.04416801780462265, 0.021921226754784584, 0.0445297546684742, 0.06594455242156982, -0.037873804569244385, -0.016793614253401756, 0.0375482402741909, 0.03866962343454361, -0.02363947592675686, -0.08413989096879959, -0.008279242552816868, 0.05592445284128189, 0.02722066640853882, -0.06847670674324036, 0.022445745766162872, -0.06229101121425629, -0.05476689338684082, 0.007257337216287851, 0.022174442186951637, 0.003967796452343464, 0.0200582854449749, -0.006669515278190374, -0.01814108155667782, 0.0544775053858757, 0.005543610546737909, 0.014785976149141788, -0.037946149706840515, 0.0413464717566967, -0.0072618587873876095, -0.0006697776261717081, -0.0017363348742946982, -0.042069945484399796, -0.0425763763487339, 0.02989751473069191, -0.0501728430390358, -0.03338827192783356, 0.001408511190675199, 0.02387460321187973, 0.04583200439810753, -0.041382648050785065, 0.008627413772046566, -0.03655346482992172, 0.0012965990463271737, -0.013429464772343636, 0.006646906957030296, 0.05842043086886406, -0.06988747417926788, -0.019479505717754364, 0.034509655088186264, -0.08385050296783447, 0.026750408113002777, -0.045036185532808304, -0.03463626280426979, 0.05849277973175049, 0.06858522444963455, -0.0006940817693248391, -0.024145906791090965, -0.017535172402858734, -0.03427452594041824, 0.0038208409678190947, 0.02669614739716053, -0.017336217686533928, -0.041527342051267624, 0.008324459195137024, 0.03105507232248783, 0.018810294568538666, -0.036119382828474045, 0.019407158717513084, 0.08573153614997864, -0.04774920642375946, 0.047170430421829224, -0.03235732391476631, -0.005837521515786648, -0.03678859397768974, -0.015183886513113976, -0.016685092821717262, 0.004887963645160198, -0.023368172347545624, 0.014523717574775219, -0.06522107869386673, 0.05791400000452995, 0.023368172347545624, -0.04018891602754593, 0.02579180710017681, 0.06963425874710083, -0.025520505383610725, 0.03579381853342056, -0.00004489911952987313, -0.06804262101650238, 0.08377815783023834, -0.014008242636919022, 0.059143904596567154, 0.0012581645278260112, -0.006764471065253019, 0.019588027149438858, 0.006208301521837711, -0.028360135853290558, 0.0021726794075220823, 0.00822498183697462, -0.039863355457782745, -0.012923033908009529, -0.05939712002873421, -0.014252414926886559, -0.0023512868210673332, 0.044819142669439316, 0.01688404753804207, 0.05180065706372261, -0.02045619487762451, -0.009586015716195107, 0.014894497580826283, 0.023928863927721977, 0.004797529429197311, -0.013140075840055943, 0.049919627606868744, -0.0376567617058754, 0.021776532754302025, -0.006800644565373659, -0.014568934217095375, -0.016838829964399338, 0.06927252560853958, -0.06695741415023804, 0.004171273205429316, 0.028468657284975052, 0.023512868210673332, 0.016648918390274048, 0.03899518772959709, 0.02060088887810707, 0.0012479906436055899, 0.04637461155653, 0.0014096415834501386, -0.009739752858877182, 0.07661577314138412, -0.003933883737772703, -0.09926047176122665, 0.021306276321411133, -0.009622189216315746, -0.00880828220397234, 0.0010609051678329706, -0.04250403121113777, 0.013366160914301872, 0.03885049372911453, -0.05360933765769005, -0.029101695865392685, -0.010436096228659153, 0.011675043031573296, 0.021649925038218498, -0.0160068366676569, 0.02646102011203766, 0.0538625530898571, -0.005050744861364365, 0.006719253957271576, -0.06250805407762527, 0.05773313343524933, 0.00856863148510456, 0.03651729226112366, 0.042612552642822266, -0.0016696397215127945, -0.058384258300065994, 0.05219856649637222, 0.005652131512761116, -0.0023897213395684958, 0.009920621290802956, -0.02868569828569889, 0.008555066771805286, 0.007406553253531456, 0.026659974828362465, -0.02859526500105858, -0.06731914728879929, -0.057479918003082275, -0.014324762858450413, -0.045651137828826904, -0.07209406793117523, -0.014189111068844795, 0.014279545284807682, -0.053356122225522995, -0.06211014464497566, -0.018340036273002625, -0.0619654506444931, 0.017725083976984024, 0.029101695865392685, 0.013673637062311172, -0.023151131346821785, 0.044891491532325745, 0.05133039876818657, -0.015464232303202152, 0.03409365937113762, 0.01685691811144352, 0.03286375477910042, -0.0197508092969656, -0.013872591778635979, 0.022626614198088646, 0.014433283358812332, 0.027889877557754517, -0.05932477489113808, -0.04156351462006569, 0.0014379023341462016, -0.039791006594896317, 0.043372198939323425, -0.02273513376712799, -0.007135251071304083, 0.06522107869386673, 0.007352293003350496, 0.011195742525160313, 0.029861342161893845 ]
31,845
stevedore.extension
map_method
Iterate over the extensions invoking a method by name. This is equivalent of using :meth:`map` with func set to `lambda x: x.obj.method_name()` while being more convenient. Exceptions raised from within the called method are propagated up and processing stopped if self.propagate_map_exceptions is True, otherwise they are logged and ignored. .. versionadded:: 0.12 :param method_name: The extension method name to call for each extension. :param args: Variable arguments to pass to method :param kwds: Keyword arguments to pass to method :returns: List of values returned from methods
def map_method(self, method_name, *args, **kwds): """Iterate over the extensions invoking a method by name. This is equivalent of using :meth:`map` with func set to `lambda x: x.obj.method_name()` while being more convenient. Exceptions raised from within the called method are propagated up and processing stopped if self.propagate_map_exceptions is True, otherwise they are logged and ignored. .. versionadded:: 0.12 :param method_name: The extension method name to call for each extension. :param args: Variable arguments to pass to method :param kwds: Keyword arguments to pass to method :returns: List of values returned from methods """ return self.map(self._call_extension_method, method_name, *args, **kwds)
(self, method_name, *args, **kwds)
[ 0.07487338781356812, -0.05641145631670952, 0.014945372939109802, 0.04241848364472389, -0.02937791310250759, -0.03685060143470764, 0.0006851106882095337, -0.0032830368727445602, 0.09384814649820328, 0.05274837464094162, -0.0027908103074878454, -0.02309572882950306, 0.08227281272411346, 0.0022104408126324415, -0.03915834054350853, 0.010668724775314331, -0.0010542806703597307, 0.057070810347795486, -0.02108103409409523, -0.014487487263977528, 0.018635926768183708, 0.017683526501059532, 0.08102736622095108, -0.056631240993738174, -0.003908050246536732, 0.07219933718442917, 0.01726227067410946, 0.024322861805558205, 0.05512937530875206, -0.021044403314590454, -0.04619145765900612, -0.009826215915381908, -0.05102672427892685, -0.021209241822361946, -0.0004444348160177469, 0.011895856820046902, -0.033260781317949295, -0.0006896895356476307, -0.02848045900464058, 0.0017170694191008806, 0.06912234425544739, -0.0006965578650124371, 0.03413992002606392, -0.010403151623904705, -0.024432754144072533, -0.04809626191854477, -0.03908507898449898, 0.03587988391518593, 0.05769353359937668, -0.029451174661517143, -0.030605046078562737, -0.010723670944571495, 0.09003854542970657, -0.015082738362252712, 0.04692407324910164, 0.07172313332557678, -0.028590351343154907, 0.01424022950232029, 0.028956659138202667, 0.01826046034693718, 0.016941752284765244, -0.055898625403642654, -0.03274795040488243, -0.005668618716299534, 0.07663166522979736, -0.03274795040488243, -0.023132359609007835, -0.03392013534903526, 0.0034204022958874702, -0.001031958730891347, 0.007426897529512644, -0.030073899775743484, 0.012839100323617458, 0.009414119645953178, -0.03587988391518593, 0.06186944618821144, 0.020916195586323738, 0.02217995934188366, 0.054543282836675644, -0.019579170271754265, -0.03659418597817421, -0.0009644206729717553, -0.02490895427763462, -0.039561279118061066, -0.053517621010541916, -0.016584601253271103, -0.003019752912223339, -0.04443318024277687, -0.03159407898783684, -0.009972739033401012, -0.05992801487445831, 0.006314236670732498, 0.003598977578803897, 0.05168607831001282, -0.06099030748009682, -0.02910318225622177, 0.012921519577503204, 0.0027450216002762318, -0.03166734054684639, 0.02428623102605343, 0.015522307716310024, 0.018040675669908524, 0.04307783767580986, -0.04197891429066658, 0.034634437412023544, -0.004567404743283987, -0.0069186449982225895, -0.04542221128940582, -0.0034204022958874702, 0.07707123458385468, -0.016648706048727036, 0.008219039067626, 0.0055220951326191425, -0.0703311637043953, 0.01154786441475153, 0.020952826365828514, -0.006181450095027685, -0.028901712968945503, -0.05058715492486954, 0.032253433018922806, 0.010540517047047615, -0.012829942628741264, 0.01150207594037056, -0.0302021075040102, -0.057180702686309814, -0.020842934027314186, -0.004452933557331562, 0.02902992069721222, 0.009226386435329914, -0.03067830763757229, 0.013489297591149807, -0.0025618677027523518, -0.007719944231212139, 0.030330315232276917, 0.007339899428188801, -0.021831965073943138, 0.014258544892072678, 0.002912149764597416, -0.0167036522179842, 0.03375529497861862, 0.029432859271764755, -0.01852603442966938, 0.04443318024277687, 0.05732722580432892, 0.013681609183549881, -0.05813310295343399, 0.03608135133981705, 0.04399360716342926, 0.0065569160506129265, -0.03743669390678406, -0.004084335640072823, 0.025513362139463425, -0.004256042651832104, -0.012967308051884174, -0.013672451488673687, 0.026960279792547226, 0.02217995934188366, 0.06066063046455383, -0.0398176945745945, -0.032894473522901535, -0.017390480265021324, 0.004104940686374903, -0.05912213400006294, -0.03049515374004841, 0.012610157951712608, -0.030531784519553185, -0.018471088260412216, 0.01797657273709774, 0.027033541351556778, 0.02902992069721222, -0.0008510940824635327, -0.013031412847340107, 0.06586220860481262, -0.02300415188074112, 0.11260312795639038, 0.038022786378860474, -0.020146947354078293, 0.06066063046455383, 0.025495046749711037, 0.03468938171863556, 0.004331593867391348, -0.022289851680397987, -0.07175976783037186, 0.0027381533291190863, -0.00006217222107807174, 0.056631240993738174, 0.014432541094720364, -0.01696006767451763, -0.0666680857539177, 0.012710892595350742, 0.05747374892234802, -0.01523841917514801, 0.04934170842170715, 0.005677776411175728, -0.03095303848385811, 0.007797784637659788, -0.06824320554733276, 0.038096047937870026, -0.0015842827269807458, 0.030092215165495872, -0.029249705374240875, -0.028700243681669235, 0.017848365008831024, 0.04289468377828598, -0.00926301721483469, 0.017289744690060616, 0.044579703360795975, -0.009414119645953178, -0.0006410392816178501, -0.036722391843795776, 0.06161303073167801, 0.0028503353241831064, 0.0068865930661559105, -0.034634437412023544, -0.009862846694886684, 0.016044296324253082, 0.08886636048555374, -0.0492684468626976, 0.00184298784006387, 0.03511063754558563, -0.05300479009747505, 0.021245872601866722, -0.02820572815835476, 0.026612287387251854, 0.01734469085931778, -0.009972739033401012, 0.027033541351556778, -0.0011275422293692827, 0.02637418732047081, -0.0055083585903048515, 0.0054305181838572025, 0.021923542022705078, -0.019927162677049637, -0.0319603867828846, -0.03712533041834831, -0.0036058458499610424, 0.022839313372969627, 0.014890425838530064, 0.0319603867828846, -0.002198993694037199, 0.028443828225135803, 0.06029432266950607, -0.04633798077702522, 0.037455007433891296, -0.021154295653104782, -0.05622830241918564, 0.012161430902779102, 0.023297198116779327, 0.03164902329444885, 0.025678200647234917, 0.0646900162100792, -0.021044403314590454, -0.015366626903414726, 0.010549674741923809, 0.0009976173751056194, -0.03313257172703743, -0.009377488866448402, -0.00732616288587451, 0.012216377072036266, 0.020769672468304634, 0.010448940098285675, -0.016676178202033043, 0.00794430822134018, -0.032436586916446686, 0.017198167741298676, 0.020494941622018814, -0.013113832101225853, 0.015540623106062412, 0.002095969393849373, 0.05414034426212311, 0.06212586164474487, -0.04970801621675491, -0.021575549617409706, 0.02747311070561409, -0.009661377407610416, 0.02382834441959858, -0.009743796661496162, -0.012655946426093578, -0.0011504365829750896, -0.03410328924655914, 0.030531784519553185, -0.00967053510248661, -0.05714407190680504, -0.0255499929189682, -0.024615908041596413, 0.007861888967454433, 0.030238738283514977, 0.08139367401599884, 0.010293259285390377, -0.020275156944990158, 0.04608156532049179, 0.01862677000463009, -0.012802469544112682, -0.010393993929028511, 0.008420508354902267, -0.07099051773548126, -0.017683526501059532, -0.02800425887107849, 0.027784472331404686, -0.039561279118061066, 0.00002330563984287437, -0.02373676747083664, -0.01177680678665638, -0.011044190265238285, -0.027033541351556778, -0.01861761137843132, 0.012060696259140968, 0.008649450726807117, -0.05091683194041252, -0.010046000592410564, -0.014579064212739468, -0.018397826701402664, -0.10183366388082504, -0.08117388933897018, 0.008649450726807117, -0.012710892595350742, -0.02454264648258686, 0.08095410466194153, 0.0024405280128121376, 0.011712702922523022, -0.03333404287695885, 0.08022148162126541, -0.028315620496869087, 0.023681821301579475, 0.009230965748429298, 0.0567411333322525, 0.054433390498161316, -0.004707059822976589, 0.021831965073943138, -0.049598123878240585, 0.013287828303873539, 0.015174315311014652, -0.007706207688897848, 0.025897985324263573, -0.025971248745918274, 0.02053157240152359, -0.018013203516602516, 0.0005371565348468721, -0.02282099798321724, 0.04018400236964226, -0.03586156666278839, 0.004702480975538492, -0.05747374892234802, -0.013846447691321373, -0.015412415377795696, 0.04033052548766136, -0.018004044890403748, 0.07172313332557678, 0.004068309906870127, 0.01150207594037056, 0.06992822885513306, -0.07099051773548126, -0.048865508288145065, 0.008919603191316128, -0.022967521101236343, -0.016575444489717484, -0.02208838053047657, -0.039378125220537186, -0.020751357078552246, 0.004100361838936806, 0.02600787952542305, -0.053517621010541916, -0.043956976383924484, -0.017903311178088188, 0.042125437408685684, -0.033260781317949295, 0.034451279789209366, 0.0036333189345896244, 0.005838036071509123, -0.0010720236459746957, 0.005824299529194832, 0.030824830755591393, -0.041026514023542404, 0.0008791395812295377, -0.02928633615374565, -0.003498242935165763, 0.08871983736753464, 0.0456053651869297, -0.04765668883919716, 0.09875667840242386, 0.0012992492411285639, -0.05084357038140297, 0.008708976209163666, 0.008484612219035625, 0.06692449748516083, -0.018132252618670464, 0.07487338781356812, -0.020403364673256874, 0.02483569271862507, -0.02098945714533329, -0.03075156919658184, -0.02309572882950306, -0.10271280258893967, 0.00005415923078544438, -0.029249705374240875, -0.06809668242931366, -0.017445426434278488, 0.005631987936794758, -0.037546586245298386, -0.011941645294427872, 0.012399530969560146, 0.0033997974824160337, 0.02018357813358307, 0.03058673068881035, 0.01546736154705286, -0.02902992069721222, -0.014716429635882378, 0.00750473840162158, 0.011859226040542126, 0.024304546415805817, 0.00898828636854887, 0.026447448879480362, -0.04498264193534851, -0.07172313332557678, -0.014707271941006184, 0.0250921081751585, 0.013800659216940403, -0.022784367203712463, -0.02062314935028553, -0.0065798102878034115, 0.032876156270504, -0.035641781985759735, -0.01917623169720173, 0.014029602520167828, -0.003065541386604309, -0.06626514345407486, 0.020037055015563965, -0.040550313889980316, -0.020128631964325905, 0.05696091800928116, -0.0054259393364191055, -0.030073899775743484, -0.01862677000463009, 0.0031914596911519766, 0.05692428722977638, -0.06978170573711395, -0.04780321195721626, -0.0068224892020225525, -0.014414225704967976, 0.0013690766645595431, -0.03305931016802788, 0.030989669263362885, 0.01491789985448122, -0.0964123085141182, 0.010980086401104927, -0.027161749079823494, -0.0390484482049942, 0.007683313451707363, 0.02948780544102192, -0.04710722714662552, -0.026612287387251854, 0.04461633414030075, 0.09069789946079254, 0.009327121078968048, 0.029249705374240875, 0.053883928805589676, -0.006360025145113468, -0.06527610868215561, 0.03141092509031296, 0.0613199844956398, 0.02298583649098873, -0.02884676679968834, 0.006117346230894327, -0.018406985327601433, -0.01935938559472561, 0.038755401968955994, -0.014166967943310738, 0.060184430330991745, -0.00830603763461113, -0.030916407704353333, 0.07491001486778259, -0.016438078135252, 0.018745819106698036, -0.04692407324910164, 0.0052519431337714195, 0.03743669390678406, -0.022033434361219406, 0.039378125220537186, 0.012481950223445892, -0.036356084048748016, -0.002502342453226447, -0.07011137902736664, 0.06600873172283173, -0.012051538564264774, 0.005828878376632929, -0.05820636451244354, 0.06619188189506531, -0.024689169600605965, -0.010238313116133213, -0.06106356903910637, 0.015769565477967262, 0.023883290588855743, 0.01750952936708927, 0.06355446577072144, -0.022509636357426643, 0.027546372264623642, -0.01108997967094183, -0.04780321195721626, 0.023681821301579475, -0.03732680156826973, 0.020366733893752098, -0.0399642176926136, 0.04776658117771149, 0.017555318772792816, -0.016822701320052147, 0.057070810347795486, 0.04637461155653, 0.014972846023738384, 0.0033540090080350637, 0.014267702586948872, 0.026117771863937378, 0.004100361838936806, -0.041649237275123596, -0.015916088595986366, -0.005554147530347109, -0.023608559742569923, -0.004734532907605171, 0.000963275961112231, -0.060184430330991745, 0.032546479254961014, 0.009972739033401012, -0.057913318276405334, -0.014661483466625214, 0.003727185307070613, 0.008795974776148796, -0.06058736890554428, -0.027802787721157074, -0.00420109648257494, -0.01669449359178543, 0.039561279118061066, 0.007207112852483988, 0.003038068301975727, -0.007880204357206821, -0.03923160210251808, 0.008461718447506428, 0.022289851680397987, -0.018754977732896805, -0.028132466599345207, -0.024945585057139397, 0.0889396220445633, 0.036282822489738464, 0.036923862993717194, -0.0456053651869297, 0.011309764347970486, -0.02857203595340252, -0.060001276433467865, -0.021831965073943138, -0.07589904963970184, 0.05677776411175728, -0.055349159985780716, 0.04282142221927643, 0.033260781317949295, -0.037198591977357864, 0.03293110430240631, 0.04783984273672104, -0.07465360313653946, -0.008484612219035625, -0.010421467013657093, -0.06029432266950607, 0.0026534446515142918, -0.05692428722977638, 0.0015476519474759698, -0.006089873146265745, -0.03192375600337982, -0.04608156532049179, 0.06274858862161636, 0.02800425887107849, 0.061100199818611145, -0.028535405173897743, -0.06278521567583084, 0.039488017559051514, 0.04527568817138672, -0.023974867537617683, -0.08066105097532272, 0.02456096187233925, 0.07263890653848648, 0.06080715358257294, -0.04425002634525299, -0.007033116649836302, -0.07175976783037186, -0.04736364260315895, 0.0053297835402190685, 0.014267702586948872, -0.004011074081063271, -0.028535405173897743, -0.012280480936169624, -0.012427004054188728, 0.04333425313234329, 0.036191243678331375, 0.039927586913108826, -0.03740006312727928, -0.0576569028198719, 0.004560536239296198, 0.004535352811217308, 0.0025664465501904488, 0.022399744018912315, -0.03587988391518593, 0.009588115848600864, -0.03897518664598465, 0.01752784475684166, 0.02053157240152359, -0.011969118379056454, 0.0594884417951107, -0.03177723288536072, 0.001838408992625773, -0.03934149444103241, -0.02399318292737007, -0.015275049954652786, -0.005581620614975691, 0.08483696728944778, -0.026392502710223198, -0.013159620575606823, 0.03842572495341301, -0.010339047759771347, 0.036722391843795776, -0.0061585558578372, 0.01669449359178543, 0.040220633149147034, 0.06274858862161636, 0.01945096254348755, -0.060184430330991745, -0.04315109923481941, -0.026429133489727974, 0.021868595853447914, 0.02655734121799469, -0.04241848364472389, -0.015064422972500324, 0.020861249417066574, 0.0009489670628681779, -0.008415929973125458, -0.06084378436207771, -0.00429267343133688, 0.047876473516225815, -0.04564199596643448, 0.027601318433880806, -0.026447448879480362, 0.014826321974396706, -0.06344456970691681, -0.06216249242424965, 0.013709082268178463, 0.0381326787173748, -0.055715467780828476, -0.0016804386395961046, -0.0037363432347774506, 0.008860078640282154, 0.07425066083669662, -0.013718239963054657, 0.012948992662131786, 0.024799061939120293, 0.004331593867391348, -0.01127313356846571, -0.007829836569726467, -0.052968159317970276, 0.08278564363718033, 0.03040357679128647, 0.006176871247589588, -0.04556873440742493, -0.009505696594715118, -0.027436479926109314, -0.008104567416012287, -0.02355361357331276, 0.0067080180160701275, -0.015036949887871742, -0.04234522208571434, -0.03842572495341301, -0.032638054341077805, -0.04520242661237717, 0.04758342728018761, 0.08835352212190628, 0.03934149444103241, 0.039671171456575394, -0.011602810584008694, 0.015183473005890846, -0.022289851680397987, 0.03868214040994644, 0.015064422972500324, -0.009844531305134296, 0.0028594930190593004, -0.022582897916436195, 0.02800425887107849, -0.04296794533729553, -0.009597273543477058, -0.017811734229326248, 0.10183366388082504, 0.009542327374219894, 0.040550313889980316, 0.057070810347795486, 0.018324565142393112, 0.01979895494878292, 0.03661249950528145, 0.011895856820046902, 0.006414971314370632, 0.025238631293177605, 0.0050596315413713455, 0.0190663393586874, 0.07582578808069229, -0.002884676679968834, -0.11926992982625961, 0.010897667147219181, -0.021868595853447914, -0.0029556488152593374, -0.005718986038118601, 0.011511233635246754, -0.01671280898153782, 0.0509534627199173, -0.03203364834189415, -0.014350121840834618, 0.028535405173897743, 0.033077627420425415, 0.02573314681649208, -0.007893940433859825, -0.0011601665755733848, 0.052894897758960724, -0.025531677529215813, 0.013132147490978241, -0.03716196119785309, 0.028535405173897743, -0.021483972668647766, -0.011621125973761082, 0.05714407190680504, -0.003193749114871025, -0.04875561594963074, 0.03794952481985092, -0.048132892698049545, -0.023040782660245895, 0.021062718704342842, -0.031905438750982285, -0.004830688703805208, -0.014487487263977528, 0.026575656607747078, -0.04666765779256821, -0.05172270908951759, -0.03274795040488243, 0.04399360716342926, -0.036740709096193314, -0.0724557489156723, -0.02446938492357731, 0.04234522208571434, -0.03373698145151138, -0.03313257172703743, -0.03229006379842758, -0.03322415053844452, -0.010421467013657093, 0.021282503381371498, 0.05838951840996742, -0.010833563283085823, 0.029359597712755203, 0.03384687379002571, 0.003498242935165763, -0.011831752955913544, 0.03086146153509617, 0.016401447355747223, -0.016309870406985283, 0.00853498000651598, 0.034011710435152054, -0.0026099456008523703, 0.040477052330970764, -0.035275474190711975, -0.008283142931759357, -0.0052702585235238075, -0.047143857926130295, 0.044946011155843735, -0.017930783331394196, -0.016547970473766327, 0.03769310936331749, 0.0012088168878108263, -0.005998295731842518, 0.04853583127260208 ]
31,846
stevedore.extension
names
Returns the names of the discovered extensions
def names(self): "Returns the names of the discovered extensions" # We want to return the names of the extensions in the order # they would be used by map(), since some subclasses change # that order. return [e.name for e in self.extensions]
(self)
[ 0.029019571840763092, -0.03531297296285629, 0.010025737807154655, 0.0005796265904791653, 0.025837907567620277, 0.0037345218006521463, -0.010532706044614315, -0.04188608005642891, 0.07510125637054443, 0.007206818554550409, 0.014527267776429653, -0.054822515696287155, 0.025907834991812706, -0.026939252391457558, 0.008303793147206306, -0.046011753380298615, 0.021432526409626007, 0.03817996755242348, -0.017114555463194847, -0.013355995528399944, -0.029106980189681053, 0.011564124375581741, 0.018845239654183388, -0.05768951028585434, -0.030435586348176003, 0.06300393491983414, 0.01505171786993742, -0.026991698890924454, 0.010235517285764217, -0.01672995835542679, -0.12139271199703217, -0.03316272795200348, 0.0022442094050347805, -0.0689477026462555, -0.052864570170640945, 0.0076394896022975445, 0.002287913579493761, 0.06062643229961395, 0.014728306792676449, 0.00758704449981451, 0.03615209460258484, -0.029211869463324547, 0.003166367532685399, -0.019754286855459213, 0.014553490094840527, 0.01832078956067562, -0.009562473744153976, 0.02844267711043358, 0.035330455750226974, 0.019317245110869408, 0.012202205136418343, 0.00045397711801342666, -0.008920022286474705, -0.03695625066757202, -0.0244393739849329, 0.06576604396104813, 0.06377313286066055, 0.00024296790070366114, -0.0017503522103652358, 0.05660564824938774, -0.0024168407544493675, -0.040452584624290466, 0.03291798382997513, -0.04667605832219124, 0.010995970107614994, 0.006686738692224026, 0.010725004598498344, -0.01045403815805912, -0.0740523561835289, 0.012079834006726742, 0.004553975071758032, -0.06898266822099686, 0.004468752071261406, 0.028005635365843773, -0.02239401824772358, 0.01761278323829174, -0.004549604374915361, 0.01532268337905407, 0.0006107658264227211, -0.03398436680436134, -0.01426504272967577, 0.00325377588160336, -0.033914439380168915, 0.06282912194728851, 0.052934497594833374, -0.0144573412835598, -0.03765551745891571, -0.03165930509567261, -0.03424658998847008, 0.06468217819929123, -0.08125480264425278, -0.0007276745163835585, 0.03999806195497513, 0.03762055188417435, -0.08230370283126831, -0.03594231233000755, -0.04300490766763687, -0.0026637695264071226, 0.028023116290569305, 0.020156364887952805, 0.015733502805233, -0.0029631429351866245, 0.016380324959754944, 0.04796970263123512, 0.02122274786233902, 0.015689799562096596, -0.042235713452100754, -0.012272132560610771, -0.02499878779053688, 0.012438207864761353, -0.01673869974911213, 0.015847133472561836, 0.06342349946498871, -0.05531200394034386, 0.09104453772306442, -0.0762200802564621, 0.02767348289489746, -0.004372602794319391, 0.023635217919945717, 0.000169080522027798, -0.03262079507112503, 0.11887535452842712, -0.014116448350250721, -0.0016421843320131302, -0.039823245257139206, -0.02318069338798523, 0.06153547763824463, -0.009186617098748684, 0.009422619827091694, -0.03849463537335396, 0.0652066320180893, 0.027149032801389694, -0.05667557194828987, 0.04265527427196503, 0.0556616373360157, -0.00916039478033781, 0.05943767726421356, -0.02491137944161892, 0.012578061781823635, 0.03111737221479416, -0.05587141588330269, 0.017245667055249214, 0.01199242565780878, 0.04856408014893532, -0.022743651643395424, 0.001841038349084556, 0.060241833329200745, 0.012822804972529411, 0.007027631159871817, -0.029491577297449112, -0.00805904995650053, -0.010051960125565529, -0.03492837771773338, -0.042865052819252014, -0.04618657007813454, 0.03232360631227493, -0.030557958409190178, 0.027306368574500084, -0.04188608005642891, -0.03213131055235863, -0.013661924749612808, -0.0017569077899679542, -0.10216287523508072, 0.00299592106603086, 0.021187784150242805, -0.022900987416505814, 0.006407031789422035, 0.017901230603456497, -0.0016323509626090527, 0.032900501042604446, 0.02508619613945484, -0.004210897255688906, 0.00677851727232337, 0.017236925661563873, 0.05370368808507919, 0.05006750300526619, 0.0027948820497840643, 0.0667799785733223, -0.007617637515068054, 0.037375811487436295, 0.030540477484464645, -0.022761134430766106, -0.07122032344341278, 0.0076045263558626175, 0.011188268661499023, -0.009606177918612957, 0.011800127103924751, -0.008640315383672714, 0.008753946051001549, -0.0010368815856054425, 0.035715050995349884, -0.004403195809572935, 0.008517943322658539, 0.06052153930068016, -0.007119410205632448, 0.04422862455248833, -0.028967127203941345, 0.0033258877228945494, -0.05069684237241745, -0.04450833052396774, -0.01528772059828043, -0.021747197955846786, -0.03066284954547882, -0.028739865869283676, -0.001073483843356371, -0.00209342991001904, 0.029806246981024742, -0.029141943901777267, -0.009335211478173733, -0.04992764815688133, 0.049018602818250656, -0.00916039478033781, -0.03178167715668678, -0.06020687147974968, 0.02059340663254261, -0.06108095496892929, -0.011913757771253586, 0.009055504575371742, 0.02727140486240387, -0.000737507943995297, -0.03489341214299202, 0.05307434871792793, -0.00990336574614048, 0.02594279870390892, -0.003983635455369949, 0.010069441981613636, 0.039333757013082504, 0.010384111665189266, -0.024963824078440666, -0.02508619613945484, 0.019159909337759018, 0.02727140486240387, -0.005799544043838978, -0.012315836735069752, 0.019999030977487564, 0.08006604760885239, -0.0024955084081739187, 0.0135220717638731, 0.02019132860004902, 0.005178944673389196, 0.0045321229845285416, 0.02727140486240387, -0.020488517358899117, 0.02978876605629921, -0.0065468852408230305, -0.03183412179350853, 0.005218278616666794, 0.009964551776647568, 0.022673726081848145, 0.00024337762442883104, 0.056710537523031235, -0.004737532697618008, 0.03464866802096367, -0.011494197882711887, -0.05146603658795357, -0.030592922121286392, -0.03270820528268814, 0.012551838532090187, 0.0042917500250041485, -0.027323849499225616, -0.02200942300260067, -0.034543778747320175, -0.038249894976615906, 0.028862236067652702, -0.01450104545801878, 0.006638664286583662, 0.05181566998362541, 0.0005867285653948784, -0.06842325627803802, 0.037375811487436295, 0.11488953232765198, -0.01767396740615368, -0.07594037055969238, 0.018513089045882225, -0.009990774095058441, -0.01347836758941412, -0.017883747816085815, 0.03419414535164833, -0.055836454033851624, -0.03503326699137688, 0.005672801751643419, -0.02365269884467125, -0.023617735132575035, 0.004099451471120119, -0.016214249655604362, -0.015392609871923923, -0.04293498024344444, -0.02003399282693863, -0.08405186980962753, -0.014369932934641838, 0.040907107293605804, 0.009597436524927616, 0.019544506445527077, -0.04926334694027901, 0.006214733701199293, -0.010121886618435383, 0.009142912924289703, -0.007726897951215506, 0.057409804314374924, 0.04461321979761124, -0.014789492823183537, 0.005065314006060362, -0.0028757345862686634, 0.0022485798690468073, -0.055451855063438416, -0.009099208749830723, 0.0315718948841095, 0.0075695631094276905, -0.006577478256076574, 0.019439617171883583, -0.017236925661563873, -0.0008265551878139377, -0.021432526409626007, -0.009815957397222519, 0.016301658004522324, -0.008351868018507957, -0.0036995583213865757, 0.050661880522966385, 0.0006697664503008127, 0.04611664637923241, 0.005130870267748833, 0.08915651589632034, -0.02288350649178028, 0.011896275915205479, 0.03456126153469086, 0.01301510352641344, -0.007469043601304293, 0.014754529111087322, 0.035557717084884644, -0.054892443120479584, -0.0378652960062027, -0.08223377168178558, -0.0010816783178597689, 0.02122274786233902, -0.010952265933156013, 0.028704902157187462, 0.03912397846579552, 0.030295733362436295, 0.02216675691306591, -0.00750400684773922, -0.03671150654554367, -0.04510270804166794, -0.08677900582551956, 0.02263876236975193, -0.06282912194728851, -0.01816345565021038, -0.025663090869784355, 0.05038217082619667, -0.013329773209989071, 0.028669938445091248, 0.0362919457256794, -0.04685087502002716, -0.04181615263223648, -0.010261740535497665, 0.02405477687716484, -0.009676104411482811, -0.02681688219308853, 0.023844998329877853, 0.009973292239010334, 0.0698217898607254, 0.05716506019234657, 0.017097072675824165, 0.004088525660336018, -0.029439132660627365, 0.036816395819187164, -0.0762200802564621, 0.05660564824938774, -0.010995970107614994, 0.055766526609659195, -0.07698927074670792, -0.02648472972214222, 0.0338270328938961, -0.0378652960062027, -0.06164036691188812, -0.007005779072642326, -0.052619826048612595, 0.0866391584277153, 0.027551110833883286, -0.03783033415675163, -0.0005077878595329821, -0.004859904292970896, -0.0026878067292273045, -0.012394503690302372, 0.032341089099645615, -0.03457874432206154, 0.019911622628569603, 0.026047687977552414, -0.022219201549887657, -0.017403002828359604, 0.022673726081848145, -0.016450250521302223, -0.03940368443727493, -0.08740834891796112, 0.09223329275846481, -0.016476474702358246, -0.024876415729522705, -0.05384354293346405, -0.026991698890924454, -0.04999757558107376, -0.028162969276309013, 0.028110524639487267, -0.06968193501234055, -0.015514981932938099, 0.030278252437710762, 0.022428981959819794, -0.00012803958088625222, 0.03723595663905144, 0.03354732319712639, -0.028967127203941345, -0.0016345360781997442, -0.004405380692332983, -0.001035788911394775, -0.045627158135175705, -0.07740883529186249, -0.007954159751534462, -0.0029806247912347317, -0.02043607272207737, -0.004466566722840071, 0.057025205343961716, 0.009361433796584606, -0.02623998560011387, -0.03443888947367668, 0.004199970979243517, 0.04800466448068619, 0.04716554656624794, 0.015139126218855381, -0.026065168902277946, 0.014868159778416157, -0.008771427907049656, 0.010008255951106548, -0.04534745216369629, 0.044683147221803665, 0.0006828777259215713, -0.04898363724350929, 0.04293498024344444, -0.05580148845911026, -0.0002933642826974392, -0.04031272977590561, -0.05440295487642288, 0.005362502299249172, -0.027288885787129402, 0.053004421293735504, 0.004641383420675993, -0.004606420174241066, 0.06069635599851608, 0.028669938445091248, -0.022848542779684067, 0.04394891858100891, -0.025575682520866394, -0.025995243340730667, -0.05209537595510483, -0.008705871179699898, 0.06485699862241745, -0.07115039974451065, 0.04094206914305687, 0.07293352484703064, -0.03597727790474892, 0.000261542183579877, -0.0372709184885025, -0.020331181585788727, -0.0339319221675396, 0.051675815135240555, 0.022498909384012222, -0.008172680623829365, -0.007984752766788006, -0.014562230557203293, 0.0598921999335289, -0.013259846717119217, 0.026677027344703674, 0.027061624452471733, 0.07733890414237976, 0.00954499188810587, 0.00162688794080168, -0.08230370283126831, -0.038319818675518036, 0.039438646286726, -0.021012967452406883, 0.02985869161784649, 0.06216481700539589, -0.05768951028585434, -0.0169659610837698, -0.04548730328679085, 0.02484145201742649, -0.019474580883979797, 0.028093043714761734, -0.016485214233398438, 0.019229836761951447, -0.028407713398337364, -0.019789250567555428, -0.036187056452035904, 0.04237556830048561, 0.03326761722564697, -0.02623998560011387, 0.001990725053474307, 0.04164133593440056, 0.03940368443727493, 0.025645609945058823, -0.013915409334003925, -0.002925994573161006, 0.07342301309108734, 0.01861797831952572, -0.028355268761515617, 0.06377313286066055, 0.008124605752527714, 0.01096974778920412, -0.05590638145804405, 0.030365660786628723, -0.03167678415775299, -0.023233139887452126, -0.03050551377236843, -0.03221871703863144, 0.004816200118511915, 0.008513573557138443, -0.02082066796720028, 0.018041083589196205, -0.05338902026414871, -0.024317001923918724, 0.057409804314374924, 0.03410673886537552, 0.09740786254405975, -0.04290001839399338, -0.038319818675518036, 0.0181459728628397, -0.004881756380200386, 0.009789735078811646, 0.008531054481863976, -0.0718846246600151, 0.004921089857816696, -0.012490653432905674, 0.08747827261686325, 0.07677949219942093, -0.00021715511684305966, -0.011660274118185043, 0.010165590792894363, -0.03505074977874756, -0.010550187900662422, -0.020610889419913292, 0.00430267583578825, 0.006341475527733564, 0.048144519329071045, 0.038634490221738815, -0.002899772021919489, 0.03985820710659027, 0.013967853970825672, 0.015165348537266254, 0.0010969748254865408, -0.06202496588230133, 0.006573108024895191, 0.03276064991950989, -0.012342059053480625, 0.022446464747190475, -0.060486577451229095, -0.05587141588330269, -0.05807410553097725, 0.01926480047404766, -0.06989171355962753, 0.028075560927391052, -0.020628370344638824, -0.07279366999864578, 0.0021043559536337852, -0.004372602794319391, 0.013390959240496159, -0.020173847675323486, -0.004536493215709925, -0.0144573412835598, -0.0013056622119620442, 0.038704417645931244, 0.035015784204006195, -0.02592531591653824, 0.008976837620139122, 0.013897927477955818, 0.0331452451646328, 0.023163212463259697, -0.02066333405673504, -0.010279221460223198, 0.06838829070329666, 0.03468363359570503, 0.0338270328938961, 0.016450250521302223, -0.0399281345307827, 0.020610889419913292, 0.004969164729118347, 0.0025304716546088457, 0.024946343153715134, -0.017254408448934555, -0.015619872137904167, 0.011651532724499702, 0.006559996400028467, -0.04992764815688133, -0.002292284043505788, -0.04576701298356056, 0.028827274218201637, 0.013452145271003246, -0.02853008545935154, -0.0037082992494106293, -0.034001849591732025, -0.026047687977552414, 0.04891371354460716, -0.023303065448999405, -0.024701599031686783, 0.06842325627803802, -0.004597679246217012, 0.06282912194728851, -0.01877531409263611, 0.02311076782643795, -0.04164133593440056, 0.02718399651348591, 0.026205023750662804, -0.0007549896254204214, 0.04450833052396774, -0.06342349946498871, 0.009361433796584606, 0.035487789660692215, -0.0934220403432846, -0.015995727851986885, 0.004593308549374342, 0.019631914794445038, -0.01166901458054781, 0.044053807854652405, 0.022131793200969696, -0.03405429422855377, 0.021519934758543968, -0.0007648230530321598, 0.03405429422855377, 0.01398533582687378, -0.07244403660297394, -0.04097703471779823, 0.014142670668661594, 0.04076725244522095, -0.026851844042539597, 0.013871705159544945, -0.0068353330716490746, 0.060801248997449875, -0.06317875534296036, 0.003660224610939622, 0.003190404735505581, -0.055067259818315506, -0.07087069004774094, -0.042235713452100754, 0.026694510132074356, 0.0166687723249197, -0.028180452063679695, 0.009300248697400093, 0.01745544746518135, -0.008255718275904655, 0.03489341214299202, -0.04929830878973007, 0.00963240023702383, 0.04583693668246269, -0.0291594248265028, 0.03190404921770096, -0.0002686441002879292, -0.018827758729457855, 0.04237556830048561, -0.029683874920010567, 0.03905405104160309, -0.02686932682991028, 0.009440101683139801, 0.015742244198918343, -0.02783081866800785, 0.022201720625162125, -0.007477784063667059, 0.00567717244848609, -0.005109018180519342, 0.025191085413098335, -0.00424149027094245, 0.006826592143625021, -0.006656145676970482, 0.02641480229794979, -0.017822561785578728, 0.008775798603892326, 0.04412373527884483, 0.038879234343767166, -0.05321420356631279, -0.07314330339431763, 0.04667605832219124, 0.003922449890524149, 0.07059098035097122, 0.07992619276046753, -0.016607586294412613, -0.022219201549887657, -0.030995000153779984, -0.000676322088111192, 0.05069684237241745, 0.03779536858201027, 0.009815957397222519, 0.004772495944052935, 0.01728937216103077, 0.042969945818185806, 0.009510028176009655, -0.037061139941215515, 0.00040125896339304745, 0.04034769535064697, 0.036746468394994736, 0.053878504782915115, 0.0562560148537159, 0.04118681326508522, -0.09048512578010559, -0.052549898624420166, -0.04583693668246269, 0.02405477687716484, 0.006997038144618273, -0.004226193763315678, -0.043983880430459976, 0.025523237884044647, 0.01533142477273941, 0.013251105323433876, 0.013452145271003246, -0.00978099461644888, 0.05429806560277939, -0.040277767926454544, 0.01886272244155407, -0.0031423300970345736, -0.022848542779684067, 0.005751469172537327, -0.06842325627803802, 0.07433205842971802, -0.026449766010046005, 0.030627885833382607, 0.08356238156557083, 0.002845141803845763, -0.021974459290504456, 0.05629097670316696, 0.0662904903292656, -0.0038437822367995977, 0.0803457573056221, -0.008976837620139122, 0.008736464194953442, -0.07663963735103607, 0.017936192452907562, -0.0562560148537159, -0.00648132897913456, -0.05275968089699745, 0.03386199474334717, 0.00805904995650053, -0.0354003831744194, 0.023005876690149307, -0.006795999128371477, -0.05492740496993065, -0.008356237784028053, -0.006122954655438662, -0.030855147168040276, 0.01120575051754713, 0.0312747061252594, 0.03057544119656086, -0.04636138677597046, 0.031397078186273575, 0.003323702374473214, -0.019194873049855232, 0.009003059938549995, -0.013679406605660915, 0.005821396131068468, -0.015034236013889313, -0.0793667808175087, -0.013181178830564022, 0.0336347334086895, 0.003870004555210471, -0.04692080244421959, -0.03741077333688736, -0.023233139887452126, -0.036676544696092606, -0.02020880952477455, 0.005004127975553274, -0.004606420174241066, 0.007254892960190773, -0.004272083286195993, 0.021659789606928825, -0.004110377747565508 ]
31,847
stevedore.enabled
EnabledExtensionManager
Loads only plugins that pass a check function. The check_func argument should return a boolean, with ``True`` indicating that the extension should be loaded and made available and ``False`` indicating that the extension should be ignored. :param namespace: The namespace for the entry points. :type namespace: str :param check_func: Function to determine which extensions to load. :type check_func: callable, taking an :class:`Extension` instance as argument :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool
class EnabledExtensionManager(ExtensionManager): """Loads only plugins that pass a check function. The check_func argument should return a boolean, with ``True`` indicating that the extension should be loaded and made available and ``False`` indicating that the extension should be ignored. :param namespace: The namespace for the entry points. :type namespace: str :param check_func: Function to determine which extensions to load. :type check_func: callable, taking an :class:`Extension` instance as argument :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool """ def __init__(self, namespace, check_func, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False,): self.check_func = check_func super(EnabledExtensionManager, self).__init__( namespace, invoke_on_load=invoke_on_load, invoke_args=invoke_args, invoke_kwds=invoke_kwds, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback, verify_requirements=verify_requirements, ) def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): ext = super(EnabledExtensionManager, self)._load_one_plugin( ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements, ) if ext and not self.check_func(ext): LOG.debug('ignoring extension %r', ep.name) return None return ext
(namespace, check_func, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False)
[ 0.05008557438850403, -0.03890248388051987, -0.008437732234597206, 0.05540212616324425, 0.04234907776117325, 0.024822792038321495, 0.032559290528297424, 0.012072236277163029, -0.05210219696164131, -0.01648130640387535, 0.05723541975021362, 0.007273591123521328, 0.007722747977823019, -0.038865819573402405, -0.042789068073034286, -0.07285507768392563, -0.006792351603507996, 0.04557567089796066, 0.023356156423687935, -0.015592159703373909, 0.00507822260260582, 0.055108796805143356, 0.0723050907254219, 0.005490713752806187, -0.010440605692565441, 0.027187740430235863, 0.05111221969127655, 0.023081162944436073, -0.009441460482776165, 0.0062561132945120335, -0.04333905503153801, 0.0038499159272760153, 0.005724458489567041, 0.03743584826588631, -0.008841057308018208, 0.0041890754364430904, 0.03048766776919365, 0.06581523269414902, -0.05719875171780586, -0.010688100010156631, -0.032577622681856155, -0.016875464469194412, 0.08550480008125305, -0.033017612993717194, 0.04861893877387047, 0.030890991911292076, -0.02396114356815815, 0.051185548305511475, -0.04583233222365379, -0.020771212875843048, 0.036959193646907806, 0.002282450208440423, 0.08506481349468231, 0.03197263553738594, -0.02905770018696785, 0.10633101314306259, 0.052945513278245926, 0.028012722730636597, 0.04264240339398384, 0.01842459850013256, 0.01549132913351059, -0.005976536311209202, -0.008318568579852581, 0.03518090024590492, -0.005307384300976992, -0.025042787194252014, -0.05356883257627487, -0.07479836791753769, -0.032082632184028625, 0.062111977487802505, -0.015427163802087307, -0.035272564738988876, 0.03193597123026848, -0.05840872600674629, 0.0576387420296669, 0.0007510773721151054, -0.012512226589024067, -0.028416046872735023, 0.02275117114186287, 0.03637253865599632, 0.01709545962512493, -0.007970242761075497, 0.027004411444067955, 0.020954543724656105, 0.05983869358897209, -0.023337824270129204, 0.02396114356815815, -0.022457843646407127, 0.06614522635936737, 0.0341542549431324, -0.06966514885425568, -0.001302784075960517, 0.034300919622182846, -0.0020979749970138073, -0.005710708908736706, -0.022567840293049812, 0.049498919397592545, 0.011980571784079075, -0.032082632184028625, -0.0014631972881034017, 0.0021037040278315544, -0.031055988743901253, 0.03164264187216759, 0.018598761409521103, 0.05155221000313759, -0.01163224596530199, -0.023374490439891815, 0.022952832281589508, -0.03802250325679779, 0.011375585570931435, 0.003295344766229391, -0.04997557774186134, -0.016829632222652435, -0.00900605320930481, 0.026087764650583267, -0.033494267612695694, -0.03483257442712784, -0.04388904199004173, 0.012915551662445068, 0.01781044527888298, -0.013227211311459541, 0.07043512910604477, -0.018433764576911926, -0.011879741214215755, 0.01769128069281578, -0.039122480899095535, 0.05639210343360901, 0.045429009944200516, 0.01820460334420204, -0.09225132316350937, 0.07065512239933014, 0.021174538880586624, -0.07127844542264938, -0.0052157193422317505, -0.03142264857888222, -0.0630652904510498, 0.03468590974807739, 0.01850709691643715, -0.06255196779966354, 0.013538870960474014, -0.048068951815366745, -0.01015644520521164, 0.007773163728415966, 0.03419091925024986, 0.025006121024489403, -0.04993890970945358, -0.012558059766888618, 0.03585921600461006, 0.04047911614179611, -0.031624309718608856, 0.011036425828933716, -0.0543021485209465, -0.046125661581754684, -0.0007974826148711145, -0.05826206132769585, 0.011192255653440952, 0.0024978620931506157, 0.012374729849398136, 0.020019562914967537, -0.04447569698095322, -0.01638047583401203, 0.017682114616036415, -0.07058179378509521, -0.025079453364014626, -0.02346615493297577, -0.0202945563942194, -0.022677838802337646, -0.014941340312361717, -0.00895563792437315, 0.03978246450424194, -0.013273043558001518, 0.016178812831640244, 0.03221096470952034, 0.019524574279785156, 0.04821561649441719, 0.06731852889060974, -0.0021128705702722073, 0.004464069381356239, -0.0049544754438102245, 0.03435591608285904, 0.038572490215301514, 0.02183452434837818, -0.03710585832595825, -0.005114888306707144, -0.0026903580874204636, 0.03978246450424194, 0.02612443082034588, 0.007209426257759333, -0.034979235380887985, 0.02616109512746334, -0.03761918097734451, -0.014593015424907207, 0.06896849721670151, 0.05474213883280754, -0.04799561947584152, 0.02247617579996586, -0.04025912284851074, 0.02980935014784336, -0.04205574840307236, 0.009661455638706684, -0.07054512947797775, -0.0018619385082274675, 0.04960891604423523, -0.007745664566755295, -0.018727092072367668, 0.027976056560873985, 0.025977766141295433, 0.026289425790309906, -0.03805917128920555, 0.0027613979764282703, 0.026986077427864075, -0.04209241643548012, -0.09628456830978394, 0.03503423556685448, 0.014822176657617092, -0.045649003237485886, 0.07604500651359558, 0.02878270484507084, -0.003817833261564374, 0.042019084095954895, -0.0011406522244215012, 0.05012223869562149, -0.0028966034296900034, 0.04630899056792259, 0.04139576479792595, 0.04942558705806732, 0.04187241941690445, -0.0123380646109581, 0.018956253305077553, 0.026802748441696167, 0.022109517827630043, 0.009404795244336128, 0.007314840331673622, -0.03562089055776596, 0.056098777800798416, -0.016352975741028786, 0.10706432908773422, 0.008941887877881527, 0.028196051716804504, 0.025611108168959618, 0.04799561947584152, 0.027536066249012947, -0.020771212875843048, 0.007223175838589668, -0.02423613704741001, -0.030561000108718872, -0.04715230315923691, -0.028984367847442627, -0.002167869359254837, 0.020001230761408806, 0.010440605692565441, 0.05353216454386711, 0.030689330771565437, -0.02614276297390461, -0.0723050907254219, -0.03074432909488678, -0.010944761335849762, -0.04689564183354378, 0.03657420352101326, 0.012237233109772205, 0.0009619061020202935, 0.0075669181533157825, -0.011898073367774487, -0.009753120131790638, -0.011733077466487885, -0.02498778887093067, 0.042239077389240265, -0.00840106699615717, 0.02350282110273838, 0.06654854863882065, -0.019744569435715675, 0.027976056560873985, 0.006059034261852503, 0.04843560978770256, 0.0037215854972600937, -0.0031372231896966696, 0.006929848808795214, -0.0123380646109581, 0.034979235380887985, 0.026802748441696167, 0.028489379212260246, 0.004835311323404312, -0.04044245183467865, 0.01369470078498125, -0.011806408874690533, -0.05884871631860733, -0.057528745383024216, 0.0273894015699625, -0.057528745383024216, -0.024089474231004715, -0.027774393558502197, 0.02999267913401127, 0.03941580653190613, -0.028929369524121284, -0.003095974214375019, -0.0008605020702816546, -0.028434379026293755, -0.02418113872408867, 0.021247869357466698, -0.012860552407801151, 0.0031395149417221546, 0.0009659164352342486, -0.02859937585890293, 0.017370454967021942, 0.0030913909431546926, -0.007906077429652214, -0.013493038713932037, -0.034007590264081955, -0.0035267979837954044, 0.04964558407664299, 0.04377904534339905, -0.011568080633878708, -0.019946232438087463, -0.006279029883444309, 0.05826206132769585, 0.02297116629779339, 0.05015890672802925, 0.008016075007617474, 0.015427163802087307, 0.032779283821582794, -0.005710708908736706, 0.11102424561977386, 0.0047161472029984, 0.047372300177812576, 0.013850531540811062, -0.04025912284851074, 0.05140554532408714, 0.007044429425150156, 0.015280500054359436, -0.06673187762498856, -0.030561000108718872, -0.04014912247657776, -0.0012134109856560826, -0.013703867793083191, -0.018002940341830254, 0.010678933933377266, 0.004981974605470896, -0.04916892573237419, 0.02663775160908699, 0.02055121771991253, 0.05826206132769585, 0.003267845371738076, -0.06603522598743439, 0.006072784308344126, -0.054815471172332764, -0.024052808061242104, 0.00047579689999110997, 0.0276277307420969, 0.027316071093082428, -0.02320949360728264, 0.05323883891105652, -0.04399903863668442, -0.0761183425784111, -0.013795532286167145, 0.009253548458218575, -0.08337818086147308, -0.004072202835232019, -0.0011028405278921127, -0.011164756491780281, -0.034282583743333817, 0.007269008085131645, -0.03310927748680115, -0.0904180258512497, 0.015674658119678497, -0.003364093368873, -0.05551212280988693, 0.06984847784042358, -0.04168909043073654, 0.021596195176243782, -0.06178198382258415, -0.005651126615703106, -0.00011565502791199833, -0.027261072769761086, -0.07102178037166595, 0.047592293471097946, -0.02011122740805149, 0.04957225173711777, 0.02927769534289837, -0.02518945001065731, 0.04146909713745117, 0.05881205201148987, 0.047372300177812576, -0.05081889033317566, -0.015060504898428917, -0.010339774191379547, -0.01912125013768673, 0.02031289041042328, 0.012374729849398136, 0.005976536311209202, -0.009340629912912846, 0.0687851682305336, -0.0048169782385230064, -0.05767541006207466, 0.043962374329566956, -0.010440605692565441, -0.014382186345756054, -0.04535567760467529, 0.03635420650243759, 0.00019693581270985305, -0.0015857986873015761, 0.04619899392127991, -0.027407735586166382, 0.0958445742726326, 0.011118924245238304, 0.014978006482124329, 0.005614460911601782, 0.010972260497510433, 0.04161575809121132, -0.009276464581489563, 0.059655364602804184, -0.031569309532642365, 0.002672025002539158, -0.018791256472468376, -0.044219035655260086, -0.0687851682305336, 0.033549267798662186, -0.0025941100902855396, 0.010935594327747822, -0.0528721809387207, -0.030561000108718872, 0.02177952416241169, -0.04429236799478531, -0.00839189998805523, -0.010834763757884502, 0.0055319624952971935, -0.012090569362044334, -0.02905770018696785, -0.010348941199481487, -0.07105845212936401, -0.008446899242699146, -0.028984367847442627, -0.03078099526464939, 0.021009542047977448, -0.10457105189561844, -0.018580427393317223, -0.05496213585138321, -0.0026880663353949785, -0.03103765659034252, -0.036207541823387146, -0.017425453290343285, -0.056098777800798416, 0.038829151540994644, 0.031147653236985207, -0.023667816072702408, 0.017370454967021942, 0.024034475907683372, -0.04179908707737923, 0.06295529007911682, -0.014657179825007915, -0.003980538342148066, -0.040332455188035965, 0.055292125791311264, 0.07058179378509521, -0.004803228657692671, -0.005724458489567041, -0.02324615977704525, -0.0007653999491594732, -0.021211203187704086, -0.009299380704760551, 0.023869479075074196, -0.009358962066471577, -0.04773895815014839, -0.016637137159705162, -0.07604500651359558, 0.014822176657617092, 0.017636282369494438, 0.049755580723285675, 0.020642882212996483, -0.004058453254401684, 0.025867769494652748, 0.050965555012226105, -0.00864856131374836, 0.06416526436805725, -0.03635420650243759, 0.019744569435715675, 0.05474213883280754, 0.042935729026794434, -0.015472996048629284, 0.04627232253551483, -0.029406026005744934, -0.018158771097660065, 0.00870814360678196, 0.03127598389983177, -0.005454047583043575, -0.009753120131790638, -0.05551212280988693, 0.04579566791653633, -0.05367882922291756, -0.024841124191880226, -0.002355781849473715, -0.01668296940624714, 0.02297116629779339, 0.012713889591395855, 0.021192871034145355, 0.010018948465585709, -0.03831583261489868, 0.017443785443902016, -0.0006554023711942136, 0.0711684450507164, -0.0362992063164711, 0.017122959718108177, 0.010422272607684135, -0.007411088328808546, 0.002979101613163948, 0.044219035655260086, -0.036207541823387146, -0.03164264187216759, 0.049498919397592545, -0.022897833958268166, 0.02883770503103733, -0.009326879866421223, -0.000035161992855137214, -0.01692129671573639, 0.014849675819277763, 0.027664396911859512, 0.018232101574540138, 0.03551089018583298, 0.041542425751686096, 0.023686150088906288, -0.010083113797008991, 0.0077135819010436535, 0.015472996048629284, 0.07795163244009018, -0.011320586316287518, -0.008387316949665546, -0.015995483845472336, -0.030799327418208122, -0.01406135968863964, -0.02375948242843151, 0.032815951853990555, 0.05565878748893738, 0.046345654875040054, -0.04550234228372574, -0.07868494838476181, -0.004626774229109287, -0.0141713572666049, -0.03266928717494011, 0.024584462866187096, -0.0031968052498996258, 0.006861100438982248, 0.044659025967121124, 0.008671477437019348, 0.04341238737106323, 0.01235639676451683, -0.008286485448479652, -0.011723910458385944, -0.034740909934043884, 0.01985456608235836, 0.02080787904560566, -0.02782939374446869, 0.027224406599998474, 0.01294305082410574, 0.019231246784329414, -0.023796146735548973, 0.03904914855957031, -0.07300174236297607, 0.034484248608350754, -0.030652664601802826, -0.02979101613163948, 0.028691040351986885, -0.0227695032954216, -0.0021988062653690577, -0.06299196183681488, -0.020422887057065964, -0.04704230651259422, -0.023796146735548973, 0.046638984233140945, 0.0023809897247701883, -0.019066249951720238, 0.0034740909468382597, 0.0008163884631358087, 0.021247869357466698, -0.08785142004489899, -0.04762896150350571, -0.052175529301166534, 0.061085332185029984, 0.023044496774673462, -0.014382186345756054, -0.009954783134162426, -0.04256907105445862, -0.034282583743333817, -0.03992912918329239, 0.005586961284279823, 0.017462119460105896, -0.026289425790309906, -0.006379860918968916, 0.025831103324890137, 0.06486191600561142, -0.02735273726284504, 0.03389759361743927, -0.008721892721951008, 0.053605496883392334, 0.04256907105445862, -0.03721585497260094, 0.04091910645365715, 0.00703067984431982, -0.03263262286782265, 0.04748229682445526, 0.05353216454386711, -0.039342474192380905, -0.041542425751686096, -0.010532270185649395, 0.009276464581489563, -0.07399171590805054, 0.012558059766888618, -0.017150459811091423, -0.011705578304827213, -0.03191763535141945, -0.057492077350616455, 0.0034076340962201357, -0.05708875507116318, -0.025611108168959618, 0.03070766292512417, -0.06299196183681488, 0.036060880869627, -0.036225877702236176, -0.0628819614648819, -0.01620631292462349, 0.036225877702236176, -0.01210890244692564, -0.007264425046741962, 0.051442209631204605, 0.0005706125521101058, 0.0056327939964830875, 0.0015434038359671831, -0.03893915191292763, -0.013337208889424801, 0.03901248052716255, 0.019946232438087463, 0.0122189000248909, 0.016756301745772362, 0.037160854786634445, 0.0068519338965415955, -0.06486191600561142, 0.04212908074259758, -0.05826206132769585, -0.004053869750350714, -0.023099496960639954, 0.05012223869562149, -0.004580941516906023, 0.039122480899095535, -0.048068951815366745, -0.008217737078666687, -0.014107191935181618, 0.0016488181427121162, 0.011366418562829494, -0.029626021161675453, 0.04113910347223282, 0.07322173565626144, -0.04231240972876549, -0.0037009608931839466, 0.0003910070809070021, -0.04462236166000366, 0.03435591608285904, -0.02493278868496418, 0.04766562581062317, -0.02225618064403534, 0.011183089576661587, 0.034044258296489716, -0.009872284717857838, -0.017287956550717354, -0.019011251628398895, -0.04678564518690109, 0.054118819534778595, 0.045392341911792755, -0.031330984085798264, 0.023576151579618454, -0.029717685654759407, 0.018497928977012634, 0.012686389498412609, -0.017049627378582954, -0.003552005859091878, -0.0026307760272175074, -0.01051393710076809, -0.007883161306381226, -0.04311905801296234, -0.04414570331573486, 0.0026101514231413603, -0.033805929124355316, 0.055072132498025894, 0.0005620190058834851, 0.012750554829835892, -0.03144098073244095, 0.07303840667009354, -0.06944514811038971, 0.041285764425992966, 0.02806772105395794, -0.01003728061914444, 0.012851386331021786, -0.021596195176243782, -0.018956253305077553, 0.04909559711813927, 0.06148865818977356, 0.010009781457483768, 0.00775941414758563, -0.0203862227499485, -0.05320217087864876, -0.0628819614648819, -0.011733077466487885, -0.041029103100299835, 0.015253000892698765, -0.02546444535255432, -0.06269863247871399, 0.018452096730470657, -0.022127849981188774, 0.002942435909062624, -0.07868494838476181, -0.005843622609972954, -0.017718780785799026, -0.00210714153945446, -0.04245907440781593, 0.05081889033317566, 0.0746883675456047, -0.05829872936010361, 0.012860552407801151, -0.04084577411413193, 0.02080787904560566, -0.06423860043287277, 0.057272084057331085, 0.001302784075960517, -0.005577795207500458, -0.028764372691512108, 0.021669527515769005, -0.014299687929451466, -0.008043574169278145, 0.0464923195540905, -0.034044258296489716, -0.07006847113370895, 0.011980571784079075, 0.0034534663427621126, 0.014950507320463657, -0.010761432349681854, -0.057492077350616455, 0.07490836828947067, 0.054815471172332764, -0.04777562618255615, 0.0016797550488263369, 0.0202945563942194, -0.0171962920576334, -0.05283551290631294, 0.00647610891610384, -0.03263262286782265, 0.014446351677179337, 0.01369470078498125, 0.057272084057331085, 0.036060880869627, 0.0014792385045439005, 0.036464203149080276, -0.001550278626382351, 0.05646543577313423, -0.028507711365818977, -0.010706433095037937, 0.0002376120100961998, 0.025977766141295433, -0.02709607593715191, 0.005756541155278683, -0.027279404923319817, 0.016352975741028786, -0.04777562618255615, -0.07490836828947067, -0.05807873234152794, 0.0006594127044081688, -0.02927769534289837, -0.05389882251620293, 0.049022264778614044, 0.0010083112865686417, 0.016673803329467773, 0.024327803403139114 ]
31,850
stevedore.enabled
__init__
null
def __init__(self, namespace, check_func, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False,): self.check_func = check_func super(EnabledExtensionManager, self).__init__( namespace, invoke_on_load=invoke_on_load, invoke_args=invoke_args, invoke_kwds=invoke_kwds, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback, verify_requirements=verify_requirements, )
(self, namespace, check_func, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False)
[ 0.03294126316905022, -0.05401677265763283, 0.03870167210698128, 0.05018799751996994, 0.020954782143235207, 0.03711497038602829, 0.0064200968481600285, -0.006282122805714607, -0.03763237223029137, -0.012598739005625248, 0.049429140985012054, 0.025438932701945305, 0.020799560472369194, -0.0281811635941267, -0.06146736070513725, -0.062329698354005814, -0.011641545221209526, 0.039012111723423004, -0.013728400692343712, -0.02619778923690319, -0.010373910889029503, 0.06695181876420975, 0.03846021741628647, 0.02023041993379593, 0.013650789856910706, 0.044738028198480606, 0.019264601171016693, 0.04259943217039108, 0.0033199964091181755, 0.010727468878030777, -0.056051887571811676, 0.019195614382624626, 0.0033566455822438, 0.05056742578744888, 0.0075066410936415195, -0.010943052358925343, 0.02599082887172699, 0.05015350133180618, -0.08112863451242447, -0.031182095408439636, -0.009123521856963634, -0.014676970429718494, 0.0791970044374466, 0.0011943363351747394, 0.0333724319934845, 0.040771279484033585, -0.013943984173238277, 0.06719327718019485, 0.004484151024371386, -0.005536201409995556, -0.011356974020600319, 0.0033717365004122257, 0.06395088881254196, 0.020523613318800926, -0.04422062635421753, 0.10334242880344391, 0.06605499237775803, 0.03642510250210762, 0.04528992250561714, 0.03708047792315483, -0.002597789280116558, -0.024162674322724342, 0.0016955694882199168, -0.015409956686198711, -0.007967990823090076, -0.015823878347873688, -0.07926598936319351, -0.042530447244644165, -0.016289539635181427, 0.05549998953938484, 0.021437689661979675, -0.03639061003923416, 0.03506261110305786, -0.02840537019073963, 0.047221556305885315, 0.0016276604728773236, -0.05908730998635292, -0.027198100462555885, -0.009313235990703106, 0.05225760489702225, 0.040771279484033585, -0.008243938907980919, 0.024559348821640015, 0.022282781079411507, 0.03728744015097618, -0.036356113851070404, -0.0018982186447829008, -0.04301335662603378, 0.08381912857294083, 0.049808569252491, -0.0747128501534462, 0.016117073595523834, 0.01167603861540556, -0.03556276485323906, -0.006493395194411278, -0.05425822362303734, 0.05280949920415878, 0.011175883933901787, -0.012538375332951546, 0.011158636771142483, -0.007967990823090076, -0.059225283563137054, 0.004488462582230568, 0.021058261394500732, 0.028974512591958046, -0.007795523852109909, -0.02421441487967968, -0.016160190105438232, -0.021196236833930016, 0.018367771059274673, 0.02485254406929016, -0.008287055417895317, 0.045634858310222626, 0.02112725004553795, 0.019178368151187897, -0.007282433565706015, -0.02221379429101944, -0.05160222947597504, 0.002722828183323145, 0.015366840176284313, 0.0005756097380071878, 0.040529824793338776, 0.004859267268329859, 0.01689317636191845, 0.03663206472992897, -0.005829396191984415, 0.038977619260549545, 0.022334519773721695, 0.051395267248153687, -0.08243938535451889, 0.06129489466547966, -0.005721603985875845, -0.06063951551914215, 0.002824152819812298, -0.010494637303054333, -0.08057674020528793, 0.03573523461818695, 0.040771279484033585, -0.08057674020528793, 0.03464869037270546, -0.032527338713407516, 0.0070064859464764595, 0.020558107644319534, 0.018954161554574966, 0.01122762355953455, -0.027008386328816414, -0.027870722115039825, 0.030716434121131897, 0.02333483099937439, -0.04960160702466965, 0.009364976547658443, -0.03925356641411781, -0.0449104942381382, -0.022506987676024437, -0.07216033339500427, 0.034338247030973434, 0.001310751773416996, -0.01957504265010357, 0.042323485016822815, -0.023179611191153526, -0.03466593474149704, 0.052533552050590515, -0.06695181876420975, -0.050050023943185806, 0.008925184607505798, -0.02312787063419819, -0.02799144946038723, -0.048359841108322144, -0.022506987676024437, 0.036321621388196945, 0.0018658810295164585, -0.04911869764328003, 0.041461147367954254, 0.021868858486413956, 0.06091546639800072, 0.05484461411833763, 0.00347521691583097, 0.018264291808009148, 0.0038697358686476946, 0.060053128749132156, 0.0319582000374794, 0.045669350773096085, -0.018954161554574966, -0.004449657164514065, -0.01573764532804489, 0.06395088881254196, 0.021644651889801025, 0.03042323887348175, -0.018333278596401215, 0.03994343429803848, -0.004898072686046362, 0.012538375332951546, 0.08119762688875198, 0.031044121831655502, -0.04315133020281792, -0.00834741909056902, -0.05401677265763283, 0.029043499380350113, -0.055431004613637924, 0.03135456144809723, -0.000005810667062178254, 0.029181474819779396, 0.03780484199523926, -0.0014433360192924738, -0.021644651889801025, 0.03728744015097618, 0.04194405674934387, 0.0471525713801384, -0.04604877904057503, -0.012391778640449047, 0.03311372920870781, -0.040115904062986374, -0.07995586097240448, 0.06395088881254196, 0.002111647045239806, -0.04328930377960205, 0.04777345433831215, 0.022731196135282516, 0.006040668580681086, 0.03226863965392113, 0.0449104942381382, 0.06136387959122658, -0.03316546976566315, -0.031216587871313095, 0.025042258203029633, 0.06181229650974274, 0.04380670562386513, -0.042978860437870026, 0.0007286745239980519, 0.03887413814663887, 0.0005950123304501176, 0.019592290744185448, -0.007394537329673767, -0.017617538571357727, 0.018833434209227562, -0.01234003808349371, 0.12431445717811584, 0.010511884465813637, -0.031044121831655502, 0.008511262945830822, 0.06401987373828888, 0.02355903945863247, 0.01757442206144333, 0.019885484129190445, -0.010770585387945175, 0.005570695269852877, -0.03314822167158127, -0.0051869554445147514, -0.010063469409942627, 0.008356042206287384, -0.00864492543041706, 0.03487289696931839, -0.0036606192588806152, -0.021454937756061554, -0.07774827629327774, 0.007713601924479008, -0.024576596915721893, -0.06039806455373764, 0.030285265296697617, 0.007459212560206652, 0.03513159602880478, 0.014616606757044792, 0.006790901534259319, 0.0008014341583475471, -0.01730709709227085, -0.004557449370622635, 0.05108482763171196, 0.008235315792262554, 0.02242075465619564, 0.04784243926405907, 0.023662518709897995, -0.02354179136455059, 0.0426684208214283, 0.05925977975130081, -0.018574733287096024, -0.03240661323070526, -0.004400073084980249, -0.02580111473798752, 0.013185128569602966, 0.04104722663760185, 0.06553758680820465, 0.0009992326376959682, -0.0251112449914217, 0.03226863965392113, -0.038770657032728195, -0.04725605249404907, -0.03169949725270271, 0.018574733287096024, -0.06978028267621994, -0.06677935272455215, -0.04625574126839638, 0.05905281752347946, 0.04773895815014839, 0.02354179136455059, 0.03130282089114189, -0.031026873737573624, -0.019937224686145782, -0.007045290898531675, 0.03259632736444473, 0.01973026432096958, 0.013262738473713398, -0.0028586462140083313, -0.03539029881358147, -0.020282158628106117, 0.026128802448511124, -0.0439101867377758, 0.0073212385177612305, 0.019419822841882706, -0.02668069675564766, 0.07899004220962524, 0.042357977479696274, 0.016073955222964287, -0.0347004272043705, -0.008968302048742771, 0.07905902713537216, 0.019005900248885155, 0.031182095408439636, -0.03063019923865795, 0.03182022273540497, 0.047669973224401474, -0.0012644012458622456, 0.05701770260930061, -0.020144185051321983, 0.02735332027077675, -0.0061872657388448715, -0.058983828872442245, 0.06708979606628418, 0.001237453194335103, -0.010511884465813637, -0.04156462848186493, -0.04528992250561714, -0.01822979748249054, 0.04156462848186493, -0.05556897819042206, -0.02599082887172699, 0.006864200346171856, 0.005829396191984415, -0.017850369215011597, -0.0057647209614515305, 0.01221068762242794, 0.018143564462661743, 0.022162053734064102, -0.06305406242609024, 0.010882689617574215, -0.05574144423007965, -0.032768793404102325, -0.01979925110936165, 0.005915629677474499, 0.04953262209892273, -0.049429140985012054, 0.010908558964729309, -0.047876935452222824, -0.06877997517585754, -0.0013592581963166595, 0.031216587871313095, -0.06050154194235802, -0.009873755276203156, -0.012960921041667461, -0.008498327806591988, -0.055948406457901, 0.012357285246253014, -0.015168502926826477, -0.06464076042175293, 0.004484151024371386, 0.013409336097538471, -0.0268531646579504, 0.07623056322336197, -0.0524645633995533, 0.053878799080848694, -0.050532929599285126, 0.0054542794823646545, -0.06729675829410553, -0.045669350773096085, -0.05905281752347946, 0.05070539936423302, 0.00700217392295599, 0.025852855294942856, 0.010563625022768974, -0.02402470074594021, 0.026715191081166267, 0.07133249193429947, 0.04753199964761734, -0.025939088314771652, -0.031044121831655502, 0.009063159115612507, -0.004639371298253536, -0.009511574171483517, 0.055637963116168976, 0.016375774517655373, -0.0017818032065406442, 0.06978028267621994, 0.02440412901341915, -0.046497195959091187, 0.006984927225857973, -0.01728985086083412, 0.006614122539758682, -0.03330344334244728, 0.03939153999090195, 0.02002345770597458, -0.009270119480788708, 0.03280328959226608, -0.001739764353260398, 0.07333311438560486, -0.01666896790266037, 0.008506951853632927, 0.0506364107131958, -0.008144769817590714, 0.03266531601548195, -0.013754270039498806, 0.0537063293159008, -0.0022054261062294245, 0.02862957864999771, -0.03492463752627373, -0.03023352473974228, -0.05174020305275917, 0.02240350842475891, 0.003125970484688878, 0.010054846294224262, -0.051015838980674744, -0.033682871609926224, 0.0015834657242521644, 0.004734228365123272, -0.013935361057519913, 0.019419822841882706, 0.016091203317046165, -0.001211583032272756, -0.008731159381568432, -0.005092098377645016, -0.04021938517689705, -0.030147291719913483, -0.02286916971206665, 0.04021938517689705, -0.0027400748804211617, -0.08278432488441467, 0.0047083585523068905, -0.04801490902900696, -0.03483840450644493, -0.04804940149188042, -0.0381842702627182, -0.007648926693946123, -0.07298817485570908, 0.007967990823090076, 0.043875690549612045, 0.020575353875756264, -0.005674175452440977, -0.0055405134335160255, -0.05756959691643715, 0.06426133215427399, -0.021627403795719147, -0.013607673346996307, -0.025887347757816315, 0.04535891115665436, 0.07264324277639389, -0.0006095642456784844, -0.027387814596295357, -0.03085440769791603, -0.027646515518426895, -0.011572558432817459, 0.02621503546833992, 0.0021504522301256657, -0.04484150931239128, -0.04594529792666435, -0.060742996633052826, -0.09644373506307602, -0.011287987232208252, 0.04128868132829666, 0.03268256038427353, 0.03382084518671036, 0.03438998758792877, 0.010391157120466232, 0.027646515518426895, -0.01642751507461071, 0.03449346870183945, -0.038287751376628876, 0.03549377992749214, 0.05770757049322128, 0.009209755808115005, -0.021696390584111214, 0.018729953095316887, -0.027818981558084488, -0.000544350070413202, 0.027370566502213478, 0.04359974339604378, -0.0023606466129422188, -0.02778448909521103, -0.04549688473343849, 0.0268531646579504, -0.04618675261735916, -0.015125385485589504, 0.014961541630327702, -0.007028044201433659, 0.042323485016822815, -0.0162291768938303, 0.03849470987915993, 0.03670104965567589, -0.05291298031806946, 0.0016201151302084327, -0.006816771812736988, 0.03890863060951233, 0.0054413448087871075, -0.019281849265098572, 0.014607983641326427, -0.025818360969424248, 0.030371498316526413, 0.04973958060145378, -0.00832586083561182, -0.06978028267621994, 0.010805078782141209, -0.014349282719194889, 0.000544350070413202, -0.01800559088587761, 0.009753027930855751, -0.024283401668071747, 0.027681007981300354, -0.00600186362862587, -0.0026107244193553925, 0.006101032253354788, 0.02931944839656353, -0.008343107998371124, 0.014642477035522461, 0.014763204380869865, 0.02262771502137184, 0.07333311438560486, -0.05574144423007965, 0.013892244547605515, -0.04601428657770157, -0.05115381255745888, 0.02088579535484314, -0.00790331605821848, 0.04111621528863907, 0.05556897819042206, 0.010572248138487339, -0.03590770065784454, -0.05667276680469513, -0.021489430218935013, 0.030940640717744827, -0.03794281557202339, 0.017039773985743523, 0.004768721759319305, 0.006437343545258045, 0.049843061715364456, 0.011193130165338516, 0.006355421617627144, 0.023145116865634918, -0.030474979430437088, -0.016134319826960564, -0.0324583537876606, 0.015194372273981571, 0.009951365180313587, -0.005967369768768549, 0.02868131920695305, -0.019850991666316986, -0.018505746498703957, -0.015323723666369915, 0.04642820730805397, -0.07864511013031006, 0.044082652777433395, -0.05770757049322128, -0.026077061891555786, 0.02469732239842415, -0.02178262546658516, 0.005053292959928513, -0.08354318141937256, 0.010063469409942627, -0.03935704752802849, -0.033872585743665695, 0.05136077478528023, -0.0162291768938303, -0.03580421954393387, 0.013866374269127846, 0.005631058476865292, 0.0067434730008244514, -0.058983828872442245, -0.034527961164712906, -0.034803908318281174, 0.056983210146427155, 0.014789074659347534, -0.012400401756167412, -0.009640924632549286, -0.055431004613637924, -0.03825325518846512, -0.020696081221103668, -0.036287128925323486, -0.023455558344721794, -0.022162053734064102, -0.0311303548514843, -0.0019672056660056114, 0.06067401170730591, -0.02728433348238468, 0.014642477035522461, -0.05794902518391609, 0.03438998758792877, -0.004124125465750694, -0.04015039652585983, 0.012348661199212074, 0.005915629677474499, -0.04973958060145378, 0.02773274853825569, 0.03325170278549194, -0.03395881876349449, -0.03135456144809723, 0.029612641781568527, 0.008468146435916424, -0.03504536300897598, -0.011417337693274021, -0.015453074127435684, -0.0069202519953250885, 0.0010897780302911997, -0.03801180049777031, 0.02909523993730545, -0.04028837010264397, -0.01509951613843441, 0.02573212794959545, -0.030957886949181557, 0.035873208194971085, -0.021644651889801025, -0.05039495602250099, 0.01888517290353775, 0.035424791276454926, -0.000914615869987756, -0.018764447420835495, 0.01596185192465782, -0.003300593700259924, 0.004354800563305616, -0.006057915277779102, -0.04863578826189041, 0.007825705222785473, 0.05149874836206436, 0.03890863060951233, 0.005079163238406181, 0.008511262945830822, 0.027198100462555885, 0.0014832190936431289, -0.09499501436948776, 0.0714704692363739, -0.05601739138364792, -0.008265497162938118, 0.004466904327273369, 0.048290856182575226, -0.007890380918979645, 0.01845400594174862, -0.019902730360627174, 0.003902073483914137, -0.03911559283733368, -0.012831570580601692, 0.03161326423287392, -0.05125729367136955, 0.031389057636260986, 0.07291918992996216, -0.027405060827732086, 0.00003328080856590532, -0.012546999379992485, -0.05332690104842186, 0.05529303103685379, -0.018954161554574966, 0.027215346693992615, -0.036356113851070404, 0.020782314240932465, 0.06905592232942581, -0.05194716155529022, -0.08623366802930832, 0.006226071156561375, -0.009718534536659718, 0.0608464777469635, 0.0734710842370987, -0.019488809630274773, 0.016927668824791908, -0.03223414719104767, 0.0015823878347873688, -0.004436722490936518, -0.0035420479252934456, -0.00539391627535224, -0.005527578294277191, 0.04177159070968628, -0.026577217504382133, -0.033855337649583817, -0.03489014133810997, -0.021937845274806023, 0.013245491310954094, 0.06577904522418976, -0.06629644334316254, -0.01712600700557232, -0.048946231603622437, 0.008080095052719116, -0.05481012165546417, 0.012133077718317509, 0.016798319295048714, 0.008817392401397228, -0.0034364117309451103, -0.02554241381585598, -0.05401677265763283, 0.03528681769967079, 0.04663516953587532, -0.010727468878030777, -0.003147528972476721, -0.0006548369419761002, -0.058293960988521576, -0.056327834725379944, 0.007696355227380991, -0.02331758476793766, 0.02466282993555069, -0.026801424100995064, -0.06426133215427399, 0.0029146980959922075, -0.002204348100349307, -0.029146980494260788, -0.06446829438209534, -0.008412094786763191, -0.02090304158627987, 0.028560591861605644, -0.018747199326753616, 0.02645649015903473, 0.041219692677259445, -0.06577904522418976, -0.013383465819060802, -0.024335142225027084, 0.025628646835684776, -0.03925356641411781, 0.020575353875756264, -0.03649408742785454, 0.011279364116489887, -0.008847574703395367, 0.027025632560253143, -0.03556276485323906, 0.04087476059794426, 0.032579079270362854, -0.014487256295979023, -0.009451210498809814, 0.01498741190880537, -0.009166639298200607, 0.040736787021160126, -0.01998896524310112, -0.06198476254940033, 0.07078059762716293, 0.04059881344437599, -0.043668732047080994, -0.00988237839192152, 0.031044121831655502, -0.021144496276974678, -0.009295989759266376, 0.012624609284102917, -0.006773654837161303, 0.014633853919804096, 0.030785420909523964, 0.07278122007846832, 0.034734923392534256, -0.019885484129190445, -0.014961541630327702, 0.03714946657419205, 0.04687662422657013, -0.05915629863739014, 0.021472183987498283, 0.02486979030072689, 0.025369945913553238, 0.018936913460493088, -0.0020642185118049383, -0.022782934829592705, -0.0011124142911285162, -0.031665004789829254, -0.08099066466093063, -0.058983828872442245, -0.019506055861711502, -0.01297816727310419, -0.06764169037342072, 0.047669973224401474, 0.014444139786064625, 0.04315133020281792, 0.012115830555558205 ]
31,853
stevedore.extension
_init_attributes
null
def _init_attributes(self, namespace, propagate_map_exceptions=False, on_load_failure_callback=None): self.namespace = namespace self.propagate_map_exceptions = propagate_map_exceptions self._on_load_failure_callback = on_load_failure_callback
(self, namespace, propagate_map_exceptions=False, on_load_failure_callback=None)
[ 0.009336831048130989, 0.04043073207139969, 0.02310822531580925, 0.02428615465760231, -0.006443972699344158, 0.018673662096261978, 0.009232896380126476, 0.07469464838504791, 0.040465377271175385, 0.01957443356513977, -0.01108640432357788, 0.05740679055452347, 0.05906974896788597, 0.022986967116594315, -0.03514736890792847, 0.03585759177803993, -0.03547649458050728, 0.04909198731184006, -0.044241685420274734, -0.045662131160497665, -0.016378430649638176, -0.015113887377083302, -0.03502611070871353, -0.0024316469207406044, 0.012784010730683804, -0.0028214033227413893, -0.057614658027887344, 0.007258130703121424, 0.1176544725894928, -0.027092400938272476, -0.02302161231637001, -0.047359734773635864, 0.00020259214215911925, 0.049958109855651855, 0.02705775573849678, -0.020977556705474854, -0.018275246024131775, -0.034835562109947205, -0.04597393423318863, 0.01756502315402031, 0.019349241629242897, -0.0024619614705443382, -0.016551656648516655, -0.020735042169690132, 0.01798076182603836, 0.03876776993274689, -0.010713971219956875, 0.048364441841840744, 0.006643181666731834, -0.008804164826869965, -0.02847820147871971, 0.045003872364759445, 0.05099746212363243, 0.0705718919634819, -0.042474787682294846, 0.07677335292100906, -0.008340787142515182, 0.06689952313899994, -0.010852551087737083, -0.0001573912159074098, -0.013346991501748562, -0.03880241513252258, 0.003756818827241659, -0.02906716801226139, 0.001127045601606369, -0.01898546889424324, -0.045488905161619186, -0.007743160706013441, 0.01564222387969494, 0.033328503370285034, 0.05324938893318176, 0.004542827606201172, 0.002325546694919467, 0.009743910282850266, 0.0024771185126155615, 0.02463260479271412, -0.031388383358716965, -0.027594754472374916, 0.028045140206813812, 0.002158817369490862, -0.022051552310585976, 0.020111430436372757, -0.04815657064318657, -0.02295232191681862, 0.037174101918935776, -0.00844472274184227, -0.03438517823815346, -0.01180528849363327, 0.026416823267936707, 0.00991713535040617, -0.09402657300233841, 0.07171518355607986, 0.010627358220517635, -0.0010907766409218311, 0.004997543524950743, 0.00919825118035078, 0.0269018542021513, -0.010480117052793503, 0.05522415414452553, 0.01205646526068449, 0.023662544786930084, -0.11024043709039688, 0.004382594488561153, 0.011701353825628757, 0.00012152821727795526, -0.027248304337263107, -0.02387041598558426, -0.07663477212190628, 0.015789465978741646, 0.030314387753605843, -0.023645222187042236, -0.03849061205983162, 0.0605248399078846, 0.07372459024190903, -0.019782302901148796, -0.024684572592377663, 0.02109881490468979, -0.026919176802039146, 0.05058172345161438, -0.0017344160005450249, 0.007972683757543564, 0.00817189272493124, -0.004997543524950743, 0.019678369164466858, 0.047186508774757385, -0.0074833231046795845, -0.007366396486759186, 0.04434561729431152, 0.07822844386100769, -0.030435645952820778, 0.06107915937900543, -0.05217539146542549, -0.026018405333161354, 0.00410759961232543, -0.031821444630622864, -0.05404622480273247, 0.03338047116994858, 0.0563327930867672, -0.05134391039609909, 0.042405497282743454, 0.004975890275090933, 0.018275246024131775, -0.003650718368589878, -0.025256216526031494, 0.010090360417962074, -0.021202748641371727, -0.03344976156949997, 0.023714512586593628, -0.03377889096736908, -0.06863177567720413, 0.041885823011398315, -0.04940379038453102, -0.024251509457826614, 0.009510056115686893, -0.03540720418095589, -0.01172733772546053, -0.03409069404006004, -0.016854800283908844, 0.04192046821117401, -0.01983427070081234, -0.030643515288829803, 0.0017495732754468918, -0.010488778352737427, -0.06856248527765274, 0.004057797137647867, 0.025516053661704063, 0.033640310168266296, -0.045766063034534454, 0.024667249992489815, 0.0056601292453706264, -0.034922175109386444, -0.06149490177631378, 0.026676662266254425, 0.003273953916504979, 0.011666708625853062, 0.05363048240542412, 0.019210660830140114, -0.05834220349788666, -0.017383135855197906, 0.08328661322593689, 0.047117218375205994, -0.021358652040362358, -0.0218436811119318, 0.04680541530251503, -0.001030147890560329, 0.04604322463274002, -0.021133458241820335, 0.03015848621726036, 0.02033662423491478, 0.030401000753045082, 0.07240808010101318, 0.028339622542262077, -0.009700603783130646, 0.06565230339765549, 0.0340387262403965, 0.012584801763296127, -0.017842182889580727, -0.01625717245042324, -0.0689435824751854, 0.04095040634274483, 0.00877385027706623, 0.024494025856256485, -0.029309682548046112, -0.0066258590668439865, 0.02671130560338497, -0.003696189960464835, -0.028443556278944016, 0.02428615465760231, -0.02714436873793602, -0.008765188977122307, -0.00954470131546259, -0.03568436577916145, 0.01151946745812893, 0.00554320216178894, 0.0023861753288656473, -0.03263560310006142, 0.007084905635565519, 0.015893399715423584, 0.015001291409134865, 0.011077743023633957, 0.07019080221652985, 0.003150531090795994, -0.0026308558881282806, -0.06980970501899719, -0.032375767827034, 0.04015357047319412, 0.02134132944047451, -0.04950772598385811, -0.002254091203212738, 0.05324938893318176, -0.011562773957848549, 0.021705102175474167, -0.036100104451179504, -0.041643306612968445, 0.08688969910144806, -0.0740017518401146, 0.07164589315652847, 0.03942602500319481, -0.015564273111522198, -0.03578830137848854, 0.04302910715341568, 0.0075959195382893085, -0.06575623899698257, -0.03393479064106941, 0.004832979757338762, 0.01075727678835392, -0.037693776190280914, -0.0034558402840048075, -0.015027275308966637, 0.021635811775922775, 0.02419954352080822, 0.026156986132264137, -0.01096514705568552, 0.05318009853363037, -0.014750114642083645, -0.03845596686005592, -0.017028024420142174, -0.007730168756097555, 0.02236335724592209, -0.007318759337067604, 0.06658771634101868, -0.0049066003412008286, -0.001355486223474145, 0.06980970501899719, 0.020890943706035614, 0.009380137547850609, 0.025914471596479416, -0.023333417251706123, 0.003702685935422778, -0.007154195569455624, 0.03513004630804062, -0.007847095839679241, 0.003174349432811141, 0.034159984439611435, -0.015512305311858654, -0.03208128362894058, 0.02075236476957798, -0.0882062092423439, -0.004302477929741144, 0.04476135969161987, 0.06544443219900131, -0.011917885392904282, 0.006677826400846243, 0.047602251172065735, 0.00037324591539800167, -0.05563989281654358, -0.036758359521627426, 0.0370008759200573, -0.015538289211690426, -0.04739437997341156, 0.012749365530908108, 0.028131751343607903, -0.012307641096413136, 0.029430940747261047, 0.022623194381594658, -0.06374682486057281, -0.04926520958542824, 0.04386058822274208, 0.02620895393192768, -0.023246804252266884, 0.01754770055413246, -0.047602251172065735, 0.07531826198101044, 0.01856972835958004, 0.05221003666520119, -0.013035186566412449, 0.017114637419581413, 0.025100313127040863, -0.02049252577126026, 0.06773100048303604, 0.06083664670586586, 0.004321965388953686, -0.04431097209453583, 0.02487512119114399, 0.04091576114296913, -0.001142202876508236, 0.01957443356513977, -0.0504084974527359, 0.007448678370565176, 0.029205746948719025, -0.010705309920012951, -0.011614740826189518, -0.009518717415630817, -0.0016499687917530537, 0.027161691337823868, -0.006374682765454054, 0.0722694993019104, -0.01235960889607668, 0.0010886113159358501, -0.025827858597040176, -0.0281663965433836, -0.0005513429059647024, -0.016109932214021683, -0.03535523638129234, -0.019366562366485596, 0.01586741767823696, -0.053561192005872726, -0.029482906684279442, 0.019816948100924492, -0.03116319142282009, -0.004871955141425133, -0.0004904434899799526, -0.07157660275697708, 0.024892443791031837, -0.04160866141319275, -0.028097106143832207, -0.031977348029613495, -0.02302161231637001, -0.0109218405559659, -0.059208329766988754, -0.047602251172065735, 0.020059462636709213, -0.005512888077646494, 0.10455865412950516, 0.002654674230143428, -0.032479699701070786, -0.017513055354356766, -0.02419954352080822, -0.0049152616411447525, 0.04018821567296982, -0.009639975614845753, -0.024805830791592598, -0.03984176740050316, -0.05699104815721512, 0.05563989281654358, 0.0310939010232687, 0.030903352424502373, -0.0285821370780468, 0.004170393571257591, -0.032722216099500656, 0.009787216782569885, -0.07739696651697159, -0.04157401621341705, -0.002832229947671294, 0.036342620849609375, -0.008080950006842613, 0.022068874910473824, 0.007855757139623165, -0.018171310424804688, 0.013346991501748562, -0.04233620688319206, 0.0006420154240913689, 0.016872122883796692, 0.007907724939286709, 0.009414782747626305, -0.03880241513252258, 0.054739125072956085, 0.006093191914260387, 0.030470291152596474, 0.017157943919301033, -0.0009597751777619123, 0.001359816873446107, 0.002269248478114605, 0.010869873687624931, 0.024667249992489815, 0.0209948793053627, 0.0004000416665803641, 0.014680825173854828, 0.06492475420236588, -0.021220071241259575, -0.03435053303837776, -0.06256889551877975, 0.01948782056570053, 0.02688453160226345, 0.038352031260728836, 0.042648013681173325, 0.009206912480294704, 0.0302624199539423, 0.034835562109947205, 0.01378005463629961, 0.024580638855695724, 0.041054341942071915, -0.04254407808184624, -0.07386317104101181, 0.021497230976819992, -0.012948574498295784, 0.019020112231373787, 0.01394461840391159, -0.011276951991021633, -0.027456173673272133, -0.02219013124704361, 0.0021869665943086147, 0.03665442392230034, -0.029101813212037086, 0.037174101918935776, -0.03249702230095863, 0.008531334809958935, -0.022623194381594658, 0.02917110174894333, 0.018084697425365448, -0.044899940490722656, 0.1075381264090538, -0.05165571719408035, -0.07275453209877014, 0.04964630678296089, 0.006972309201955795, -0.035511139780282974, -0.021566521376371384, -0.01675952598452568, -0.025827858597040176, -0.006452633999288082, 0.0014615865657106042, 0.04396452382206917, 0.004707391373813152, -0.03849061205983162, 0.027092400938272476, -0.08280158787965775, 0.08938413858413696, 0.02596643939614296, -0.037347324192523956, -0.03596152365207672, -0.040881115943193436, 0.03589223697781563, -0.03303402289748192, -0.037763066589832306, 0.009925796650350094, -0.04320233315229416, -0.02395702712237835, 0.0008536748355254531, 0.0024814491625875235, -0.07580329477787018, -0.047948699444532394, -0.015902061015367508, -0.047186508774757385, -0.0076002501882612705, 0.06229173764586449, 0.03034903295338154, -0.006560899782925844, -0.036169394850730896, -0.012671413831412792, 0.029378972947597504, -0.012247012928128242, 0.04933449998497963, -0.06107915937900543, 0.038282740861177444, 0.00268931919708848, -0.010436810553073883, -0.023212159052491188, 0.005997918080538511, -0.03275686129927635, 0.03396943584084511, 0.048191215842962265, 0.03807486966252327, 0.01256747916340828, -0.019279951229691505, -0.019730335101485252, 0.012186383828520775, -0.04216298460960388, 0.03318992257118225, 0.018517760559916496, -0.03901028633117676, 0.02781994640827179, 0.016447721049189568, 0.04160866141319275, 0.03821345046162605, -0.009943119250237942, 0.0419897586107254, 0.005686113145202398, 0.03263560310006142, -0.03201199322938919, -0.04108898714184761, -0.029517551884055138, -0.0428558848798275, 0.031145868822932243, -0.0046857381239533424, 0.037451259791851044, -0.10379646718502045, -0.017461087554693222, 0.01248086616396904, -0.036585137248039246, 0.030123841017484665, 0.024805830791592598, 0.01992088370025158, 0.023246804252266884, -0.02083897590637207, -0.0420244038105011, -0.025325505062937737, 0.012333624996244907, -0.023333417251706123, 0.013390298001468182, 0.05162107199430466, 0.037347324192523956, 0.028963232412934303, -0.051205333322286606, -0.028790006414055824, -0.031804122030735016, 0.037104811519384384, 0.023471998050808907, -0.00753962155431509, -0.01445563230663538, -0.022224776446819305, -0.05993587523698807, -0.00322415167465806, -0.02352396585047245, -0.012039142660796642, 0.05342261120676994, 0.042648013681173325, -0.017270538955926895, -0.009267541579902172, -0.017513055354356766, 0.04632038623094559, 0.03765913099050522, -0.006677826400846243, 0.019868915900588036, 0.061148449778556824, -0.04590464383363724, -0.08869123458862305, 0.010731292888522148, -0.0024727878626435995, 0.02891126461327076, 0.007773475255817175, -0.014767437241971493, -0.0226751621812582, -0.02596643939614296, -0.012368270196020603, -0.07968353480100632, 0.060802001506090164, -0.07462536543607712, 0.00036431397893466055, 0.04884947091341019, -0.013702102936804295, 0.01830989122390747, -0.060386259108781815, -0.01378005463629961, 0.0039495318196713924, 0.002153404289856553, -0.00228007510304451, 0.01813666522502899, -0.0722694993019104, 0.038040224462747574, 0.007847095839679241, -0.0019801792223006487, -0.008886446245014668, -0.0014615865657106042, -0.01850043796002865, 0.036585137248039246, -0.012515511363744736, 0.006950655952095985, 0.03838667646050453, -0.04444955289363861, 0.043306268751621246, 0.020890943706035614, -0.019816948100924492, -0.0022075369488447905, -0.00381095171906054, -0.031977348029613495, -0.03351905196905136, 0.0756647139787674, 0.025568021461367607, -0.04462277889251709, -0.05654066428542137, -0.05855007469654083, -0.03876776993274689, -0.014013908803462982, -0.0008547574980184436, -0.00793370883911848, 0.03268757089972496, -0.03564972057938576, -0.00987382885068655, -0.026434145867824554, -0.007881741039454937, 0.05719891935586929, -0.01651701144874096, 0.03514736890792847, -0.04427633062005043, -0.012913929298520088, -0.01063601952046156, 0.06274212151765823, -0.026867209002375603, 0.045488905161619186, -0.03720874711871147, -0.023073580116033554, 0.0512399785220623, -0.0664491355419159, 0.012420237995684147, -0.0739324614405632, -0.03637726604938507, 0.031024610623717308, 0.02847820147871971, -0.03131909295916557, -0.014880034141242504, -0.08210868388414383, -0.000661503232549876, 0.030210452154278755, -0.014741453342139721, -0.03419462963938713, 0.000784384785220027, -0.03790164738893509, 0.009830523282289505, -0.00996044185012579, 0.028201041743159294, -0.012766688130795956, -0.005863668862730265, -0.13407620787620544, 0.07781270146369934, 0.06336573511362076, 0.07490251958370209, 0.019349241629242897, 0.03015848621726036, 0.005118800792843103, 0.018968146294355392, -0.04192046821117401, 0.0369662307202816, -0.009345492348074913, 0.008483697660267353, 0.01992088370025158, -0.021133458241820335, 0.016439059749245644, 0.05723356455564499, 0.0011411202140152454, 0.012281658127903938, -0.0180673748254776, -0.0021934625692665577, -0.005556194111704826, -0.018552405759692192, 0.0019217156805098057, -0.06537514179944992, 0.00041519885417073965, 0.02134132944047451, -0.00560816191136837, -0.07912921160459518, 0.04327162355184555, -0.02234603464603424, 0.03890635073184967, 0.05913903936743736, -0.029101813212037086, -0.00815023947507143, -0.008691567927598953, -0.0015092234825715423, 0.0142910685390234, -0.015650885179638863, 0.059624072164297104, 0.05518950894474983, 0.04469206929206848, -0.0030660838820040226, -0.013468249700963497, -0.004181220196187496, -0.02293499931693077, 0.04302910715341568, 0.041816532611846924, -0.020908266305923462, 0.02127203904092312, -0.05026991665363312, -0.054739125072956085, -0.027109723538160324, -0.014135166071355343, 0.004811326507478952, -0.005846346262842417, 0.06346967071294785, 0.020544493570923805, 0.011917885392904282, -0.01571151427924633, 0.0327741838991642, 0.04628574103116989, -0.038109514862298965, -0.06288070231676102, -0.0386638380587101, -0.06929002702236176, 0.007747491355985403, 0.024424735456705093, 0.045488905161619186, 0.007847095839679241, -0.06360824406147003, -0.03901028633117676, 0.009683281183242798, -0.00722781615331769, -0.04275194928050041, 0.02395702712237835, -0.018015407025814056, 0.025914471596479416, 0.04493458569049835, 0.00004124245242564939, 0.023298772051930428, -0.07012151181697845, 0.002163148019462824, 0.029604164883494377, -0.00036241934867575765, -0.018968146294355392, -0.041885823011398315, -0.021895648911595345, 0.0060715386644005775, 0.004993212874978781, 0.0016672913916409016, -0.017452426254749298, 0.004111930262297392, 0.012931251898407936, -0.0378323569893837, 0.0021111806854605675, 0.036100104451179504, 0.00733175128698349, 0.012472204864025116, -0.008353779092431068, -0.08280158787965775, 0.04060395807027817, -0.03521665930747986, -0.05619421228766441, -0.004443223122507334, 0.01780753768980503, 0.008457714691758156, 0.00961399171501398, -0.030019905418157578, 0.003971184603869915, 0.009717926383018494, 0.08287087827920914, -0.028253009542822838, 0.04531567916274071, -0.02790655940771103, -0.02612234093248844, 0.022657839581370354, 0.04770618677139282, -0.028114428743720055, 0.05563989281654358, -0.007786467205733061, -0.003128877840936184, 0.01273204293102026, -0.04898805171251297, 0.02134132944047451, -0.004629440139979124, 0.01664692908525467, -0.05934691056609154, -0.014767437241971493, -0.025775890797376633, -0.03495682030916214, -0.012272996827960014, 0.10324214398860931, 0.0807228833436966, 0.028270332142710686, 0.040118925273418427 ]
31,854
stevedore.extension
_init_plugins
null
def _init_plugins(self, extensions): self.extensions = extensions self._extensions_by_name_cache = None
(self, extensions)
[ 0.00940263457596302, -0.060482755303382874, 0.010523651726543903, -0.005270516034215689, -0.0025027345400303602, 0.06548822671175003, 0.021168963983654976, 0.06468874216079712, -0.023828119039535522, 0.048490483313798904, 0.03778434172272682, 0.047447677701711655, -0.010045698843896389, 0.00885950680822134, -0.050958458334207535, -0.07542964071035385, 0.009541675448417664, 0.05585964769124985, -0.004334162920713425, -0.057389095425605774, -0.05019373446702957, -0.0026417754124850035, 0.027547461912035942, 0.021759888157248497, -0.006726099178195, 0.032031528651714325, 0.04292885214090347, 0.014972957782447338, 0.015277109108865261, -0.01389539148658514, -0.040043752640485764, 0.007907946594059467, 0.0034282251726835966, 0.030241377651691437, -0.034829724580049515, -0.02332409657537937, 0.016146114096045494, 0.07320498675107956, -0.052383627742528915, 0.030328277498483658, 0.06614866852760315, -0.011905369348824024, 0.052835509181022644, -0.03413451835513115, -0.01713678054511547, 0.05641581118106842, -0.039591871201992035, 0.025983251631259918, 0.037297699600458145, 0.011079815216362476, -0.02023043856024742, 0.006965075619518757, 0.03168392553925514, 0.01184453908354044, -0.06159508228302002, 0.1199922189116478, 0.07292690873146057, 0.06760859489440918, 0.022872213274240494, 0.03476020321249962, -0.02005663700401783, -0.05151462182402611, 0.018753129988908768, 0.01306114625185728, -0.005127130076289177, -0.02904215082526207, -0.009880587458610535, -0.036915335804224014, -0.016684897243976593, 0.03521208465099335, -0.0019411401590332389, -0.037714820355176926, 0.022976495325565338, -0.039974234998226166, 0.015850652009248734, 0.04178176447749138, -0.03418666124343872, -0.004988089203834534, -0.01504247821867466, 0.03310909494757652, 0.009611195884644985, 0.01608528383076191, -0.03861858695745468, 0.03005019575357437, 0.08655290305614471, -0.012904725968837738, 0.019900215789675713, -0.017779843881726265, 0.051792703568935394, 0.04710007458925247, -0.08119983226060867, -0.020525900647044182, 0.054851602762937546, -0.03422142192721367, -0.003999595995992422, -0.02440166287124157, -0.00438847579061985, -0.01523365918546915, 0.02490568533539772, 0.013652069494128227, -0.009289664216339588, -0.05853618308901787, 0.03135370463132858, -0.01718023046851158, -0.00041576463263481855, -0.04657867178320885, -0.0050358846783638, -0.04014803469181061, -0.008042641915380955, -0.011835848912596703, -0.023167675361037254, -0.011974889785051346, 0.03058897890150547, 0.009393945336341858, 0.04623107239603996, -0.05099321901798248, -0.014338583685457706, 0.010932084172964096, 0.07376115024089813, -0.00019267472089268267, -0.06222076341509819, 0.08564914017915726, -0.04623107239603996, 0.05227934569120407, 0.026139672845602036, -0.027130339294672012, 0.08092175424098969, 0.014703566208481789, -0.008390244096517563, -0.06677435338497162, 0.07556868344545364, 0.0035042630042880774, -0.03806242346763611, -0.04897712543606758, -0.011444796808063984, -0.03192724660038948, 0.013591239228844643, -0.007138876710087061, -0.02984163537621498, 0.002472319407388568, -0.06454969942569733, 0.034586403518915176, -0.0382709838449955, -0.001359993009828031, 0.013886701315641403, 0.020126158371567726, 0.05599868670105934, 0.027477940544486046, -0.03761053830385208, -0.04303313046693802, -0.02056065946817398, -0.02038685977458954, -0.019900215789675713, -0.00794270634651184, -0.018040545284748077, -0.00043640349758788943, -0.010810423642396927, 0.026921777054667473, 0.007781940512359142, -0.014999027363955975, 0.04664819315075874, 0.08140839636325836, -0.08370257169008255, 0.020612800493836403, -0.045188263058662415, -0.006899900268763304, -0.017275821417570114, -0.015450910665094852, -0.023636939004063606, 0.029928535223007202, 0.012226901948451996, 0.011966199614107609, -0.011635977774858475, -0.012713544070720673, 0.03806242346763611, 0.07633340358734131, 0.009002892300486565, -0.0006816258537583053, -0.010714832693338394, 0.06642674654722214, -0.007529929280281067, 0.00789925642311573, -0.057389095425605774, 0.0723012238740921, 0.01650240644812584, 0.023011254146695137, 0.060865115374326706, 0.005070644896477461, -0.013243637979030609, 0.01754521206021309, 0.019900215789675713, 0.007564689498394728, 0.008155613206326962, 0.01142741646617651, -0.01096684392541647, 0.056937213987112045, 0.011766328476369381, -0.028520746156573296, -0.09169741719961166, 0.05523396283388138, -0.06594010442495346, -0.014599285088479519, 0.014903437346220016, -0.058570943772792816, 0.03404761850833893, 0.013382677920162678, 0.03382167965173721, 0.01797102577984333, -0.03008495643734932, -0.00869439635425806, 0.017493072897195816, -0.038792386651039124, -0.043728336691856384, 0.004822978284209967, -0.008090437389910221, -0.053843554109334946, 0.0335957370698452, 0.016024453565478325, 0.05061085522174835, 0.020334718748927116, 0.011514317244291306, 0.052835509181022644, -0.02645251527428627, -0.005683293100446463, 0.010827803052961826, 0.04418021813035011, 0.0464743934571743, -0.013408748432993889, -0.01800578460097313, 0.006795619614422321, 0.03547278791666031, 0.01306114625185728, 0.0040864963084459305, -0.05217506363987923, 0.03509042412042618, 0.019170252606272697, 0.04904664680361748, 0.023880260065197945, -0.0108451833948493, 0.019448334351181984, 0.03823622316122055, 0.020178297534585, -0.01492081768810749, -0.035125184804201126, -0.02645251527428627, 0.011349206790328026, -0.007512548938393593, -0.04814288020133972, -0.009446085430681705, 0.009863208048045635, 0.08717858791351318, -0.010706142522394657, 0.021916307508945465, -0.03505566343665123, -0.09009844809770584, -0.00919407419860363, 0.044736381620168686, -0.0013513029552996159, 0.02410620078444481, -0.053634993731975555, -0.028642408549785614, -0.047204356640577316, -0.02189892902970314, 0.018996451050043106, -0.0346733033657074, 0.021916307508945465, 0.06496682018041611, 0.019952356815338135, -0.02202058956027031, 0.01187060959637165, 0.10608813911676407, 0.06225552409887314, -0.014364654198288918, 0.026296094059944153, -0.005791918840259314, -0.012817825190722942, -0.006213386543095112, -0.04564014822244644, -0.009706786833703518, 0.03050207905471325, 0.06055227294564247, -0.01068007294088602, 0.018040545284748077, 0.009897967800498009, 0.03138846531510353, -0.033700019121170044, -0.01038461085408926, -0.0034977453760802746, -0.08391112834215164, -0.042685531079769135, -0.011018984951078892, 0.04240744933485985, 0.028798827901482582, 0.036081090569496155, 0.022681033238768578, 0.012218211777508259, -0.07591628283262253, 0.04108656197786331, 0.046022508293390274, 0.023463137447834015, -0.03429093956947327, -0.01688476838171482, 0.01492081768810749, 0.01260057371109724, -0.014851297251880169, -0.027060817927122116, -0.04299837350845337, 0.00848148949444294, 0.04487542435526848, 0.04306789115071297, 0.049915652722120285, 0.003126245690509677, -0.015129378996789455, 0.060656554996967316, 0.01847504824399948, -0.02327195554971695, 0.058188579976558685, -0.004809943027794361, -0.025305427610874176, 0.03622013330459595, 0.007560344412922859, 0.058570943772792816, -0.04442353919148445, 0.03396071866154671, 0.006269871722906828, 0.038757625967264175, 0.009637266397476196, -0.007742835208773613, 0.015216278843581676, -0.069207563996315, -0.042476966977119446, 0.0018889998318627477, 0.017110710963606834, -0.029859015718102455, -0.009811067022383213, -0.01094946451485157, 0.004440615884959698, -0.012131310999393463, -0.01797102577984333, -0.01817958615720272, 0.018944310024380684, -0.03303957358002663, -0.10525389760732651, 0.0035716108977794647, 0.0017358376644551754, -0.03521208465099335, 0.013530408963561058, -0.01922239176928997, 0.012565813958644867, -0.05763241648674011, 0.015242349356412888, -0.06371545046567917, 0.00013971971930004656, 0.025062106549739838, 0.045779187232255936, -0.07598580420017242, -0.030241377651691437, -0.002487526973709464, 0.0030306552071124315, -0.020578039810061455, -0.0044167181476950645, 0.02549660950899124, -0.031318943947553635, 0.011922749690711498, 0.02311553619801998, -0.06892948597669601, 0.06653103232383728, 0.00151750014629215, 0.018979070708155632, -0.1303507685661316, 0.02791244350373745, 0.024175722151994705, -0.02865978702902794, -0.013069836422801018, 0.006804309785366058, -0.038931429386138916, 0.00996748823672533, 0.03427356109023094, -0.023602178320288658, 0.020195677876472473, 0.03091920167207718, 0.04470162093639374, -0.0033065644092857838, -0.001970469020307064, -0.0227679330855608, 0.0003486882778815925, 0.003890970256179571, 0.019709035754203796, 0.05130606144666672, -0.010167359374463558, 0.009906657971441746, 0.0025570474099367857, -0.04664819315075874, 0.04139940068125725, 0.02415834181010723, 0.028485987335443497, -0.02883358858525753, -0.00263308547437191, -0.030867060646414757, 0.027026059105992317, 0.05130606144666672, -0.06938136368989944, 0.06180364266037941, 0.05725005641579628, 0.02707819826900959, 0.03234437108039856, 0.020021876320242882, 0.09141933172941208, 0.007108461577445269, 0.045952990651130676, -0.0402870774269104, -0.026209194213151932, -0.02883358858525753, -0.06552298367023468, -0.052626948803663254, -0.028850968927145004, 0.026018012315034866, -0.010827803052961826, -0.019083350896835327, 0.031162522733211517, -0.025757310912013054, -0.02407144010066986, -0.02101254276931286, 0.018023164942860603, 0.03635917231440544, 0.019917596131563187, -0.01374766044318676, -0.030780160799622536, -0.022246530279517174, -0.023532656952738762, -0.08808235824108124, 0.061108436435461044, 0.013878011144697666, -0.07264882326126099, 0.054086875170469284, -0.02502734586596489, -0.0006723926635459065, -0.03705437853932381, -0.07814093679189682, 0.011496936902403831, -0.006608783733099699, 0.01588541269302368, 0.03321337327361107, -0.035872530192136765, -0.009837137535214424, 0.015198899433016777, -0.024262621998786926, 0.06114319711923599, -0.07278786599636078, -0.028277425095438957, -0.035542309284210205, 0.0527312271296978, 0.05130606144666672, -0.04181652516126633, 0.062116485089063644, -0.0006207955302670598, -0.007343092933297157, 0.04789955914020538, -0.027981963008642197, -0.011792398989200592, -0.061907920986413956, 0.004323300439864397, 0.021342765539884567, -0.043902136385440826, -0.026713216677308083, 0.0025179423391819, 0.037749581038951874, 0.009472155012190342, 0.016241705045104027, 0.01023687981069088, 0.021707747131586075, 0.01245284266769886, 0.02035209909081459, -0.061282239854335785, -0.017614733427762985, -0.01687607914209366, 0.02773864194750786, -0.010749593377113342, 0.042303167283535004, -0.05502540245652199, -0.008637910708785057, -0.016980359330773354, 0.042059846222400665, 0.014051812700927258, -0.01638074591755867, -0.04584870859980583, 0.0304673183709383, -0.09267070144414902, 0.010627931915223598, -0.04407593980431557, -0.027651742100715637, 0.03597681224346161, -0.02586159110069275, 0.024853546172380447, 0.010141289792954922, -0.0010867995442822576, 0.00859011523425579, 0.03422142192721367, 0.06399353593587875, -0.028903109952807426, -0.003106693271547556, -0.00981975719332695, 0.013617309741675854, -0.0028633717447519302, 0.0022463782224804163, -0.018996451050043106, -0.0042624701745808125, 0.0013784592738375068, -0.043902136385440826, -0.02038685977458954, -0.03067587874829769, -0.03526422753930092, -0.045153506100177765, -0.03317861258983612, 0.029198570176959038, -0.0320141464471817, -0.017771154642105103, 0.03969615325331688, 0.0007462581270374358, 0.04324169456958771, 0.022455090656876564, -0.02056065946817398, 0.026887018233537674, -0.03597681224346161, 0.02029995806515217, -0.03241388872265816, -0.05081941932439804, -0.023880260065197945, 0.031023481860756874, 0.05394783616065979, 0.018440287560224533, -0.016146114096045494, -0.05579012632369995, -0.02029995806515217, -0.0072996425442397594, -0.05168842151761055, 0.004597037099301815, -0.02436690218746662, 0.050124213099479675, 0.0382709838449955, 0.006682649254798889, -0.0037779996637254953, 0.01805792562663555, -0.03705437853932381, 0.018249107524752617, -0.013408748432993889, -0.015807202085852623, 0.025635650381445885, 0.03966139256954193, 0.01297424640506506, 0.03154488280415535, -0.06527966260910034, -0.04967233166098595, -0.02311553619801998, 0.00470131728798151, -0.06267264485359192, 0.00002977021358674392, -0.06284644454717636, 0.015172828920185566, 0.03740197792649269, 0.01650240644812584, 0.020525900647044182, -0.07195362448692322, 0.005935304798185825, -0.02085612155497074, -0.012061790563166142, 0.009672027081251144, 0.0191007312387228, -0.04800384119153023, 0.02532280795276165, 0.023880260065197945, -0.0274084210395813, -0.031197283416986465, -0.01981331594288349, -0.028364326804876328, 0.031909868121147156, -0.00013191225298214704, 0.04240744933485985, 0.00428202236071229, -0.0052878959104418755, -0.02690439671278, 0.0029437546618282795, -0.006204696372151375, 0.024245241656899452, 0.023758599534630775, -0.01194882020354271, 0.026921777054667473, 0.0485600046813488, 0.0006338306120596826, 0.025809451937675476, -0.00622642133384943, 0.07716765254735947, 0.011018984951078892, -0.02457546442747116, 0.00007698842091485858, -0.02820790559053421, -0.01754521206021309, -0.0028220941312611103, -0.020039256662130356, -0.05130606144666672, -0.00415818952023983, 0.017327960580587387, -0.014008361846208572, -0.02892048843204975, 0.020908262580633163, -0.03722817823290825, -0.024471182376146317, 0.018318627029657364, -0.0008152353693731129, 0.01830124668776989, -0.006904245354235172, 0.004173397086560726, 0.05453876033425331, -0.004214674700051546, 0.0014544972218573093, 0.00825120322406292, -0.012418082915246487, -0.053426433354616165, 0.019118111580610275, -0.009185384027659893, -0.09816281497478485, 0.05332215130329132, 0.0009406980243511498, 0.0033847747836261988, 0.00042988595669157803, -0.0609346367418766, -0.013513029552996159, -0.026191813871264458, 0.022455090656876564, 0.03284839168190956, 0.05686769261956215, -0.030745400115847588, 0.007564689498394728, -0.0402870774269104, 0.02975473366677761, -0.04049563780426979, -0.0010590999154374003, -0.060447994619607925, 0.030867060646414757, 0.01629384607076645, 0.050576094537973404, -0.0569024533033371, 0.03969615325331688, -0.02996329590678215, -0.011618598364293575, 0.011957510374486446, -0.0453968271613121, 0.009950107894837856, 0.0017934092320501804, 0.0028807518538087606, 0.019118111580610275, -0.029198570176959038, -0.04730863869190216, 0.048247162252664566, -0.07508204132318497, 0.041260361671447754, 0.006417602766305208, 0.008246858604252338, 0.06162983924150467, -0.03966139256954193, -0.010158669203519821, 0.0059092347510159016, -0.0030545529443770647, 0.05307883024215698, 0.02812100388109684, -0.02657417580485344, 0.01645895652472973, -0.023793358355760574, -0.0014914299827069044, 0.006517538335174322, 0.0025396673008799553, -0.02507948689162731, -0.0010357454884797335, -0.02695653773844242, -0.0201435387134552, -0.007486478891223669, -0.03187510743737221, 0.034117139875888824, 0.008090437389910221, 0.03907046839594841, -0.04779528081417084, 0.024019300937652588, 0.009585126303136349, 0.01493819709867239, -0.05725005641579628, -0.0004744224715977907, -0.00009402906289324164, 0.01504247821867466, 0.049533288925886154, 0.013052456080913544, -0.03312647342681885, 0.08238168060779572, 0.02573993057012558, 0.012070480734109879, 0.00461876206099987, -0.0018705334514379501, -0.02076922170817852, -0.13765040040016174, -0.039383310824632645, -0.04296361282467842, 0.06986800581216812, -0.02038685977458954, -0.06559250503778458, 0.0010281415889039636, 0.009141933172941208, -0.017023809254169464, -0.03385643661022186, 0.014190852642059326, -0.04529254510998726, -0.019465714693069458, -0.011966199614107609, 0.007469098549336195, 0.03469068184494972, -0.030571598559617996, 0.006230766419321299, 0.016597997397184372, 0.040634676814079285, -0.0028872694820165634, 0.03715865686535835, 0.029441893100738525, 0.041017040610313416, -0.03847954422235489, 0.07132793962955475, 0.027234619483351707, 0.02695653773844242, 0.006243801675736904, -0.029806874692440033, -0.0012785237049683928, 0.02085612155497074, -0.02335885725915432, -0.04984613135457039, -0.04591822996735573, -0.05853618308901787, 0.04108656197786331, -0.0062829069793224335, -0.10003986209630966, 0.049081407487392426, 0.016354676336050034, 0.007277917582541704, -0.028173144906759262, -0.02978949435055256, -0.04428450018167496, -0.011635977774858475, 0.05711101368069649, 0.0517231822013855, 0.003178386017680168, 0.04609202966094017, -0.021029923111200333, -0.0057441238313913345, 0.047830041497945786, -0.047447677701711655, 0.005930959712713957, 0.011566457338631153, 0.020578039810061455, -0.026504654437303543, -0.007204052060842514, 0.002622222760692239, 0.013964911922812462, -0.06760859489440918, -0.046613432466983795, -0.022472470998764038, -0.052418388426303864, 0.03472544252872467, -0.029824255034327507, 0.07160601764917374, -0.009124553762376308, 0.06357641518115997, -0.01871836930513382 ]
31,856
stevedore.enabled
_load_one_plugin
null
def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): ext = super(EnabledExtensionManager, self)._load_one_plugin( ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements, ) if ext and not self.check_func(ext): LOG.debug('ignoring extension %r', ep.name) return None return ext
(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements)
[ 0.022518260404467583, -0.05594191327691078, 0.0334581658244133, 0.059945158660411835, 0.019740145653486252, 0.019722890108823776, 0.10691428184509277, -0.001469941926188767, -0.07440516352653503, -0.0223284512758255, 0.08006492257118225, -0.005672703497111797, -0.012052876874804497, -0.03323384374380112, -0.04065365344285965, -0.056010935455560684, -0.02702191099524498, 0.056563109159469604, 0.01891188696026802, -0.051282964646816254, -0.006004869472235441, 0.028160765767097473, 0.061256568878889084, -0.0070013669319450855, 0.017980096861720085, 0.05007508769631386, 0.07668287307024002, 0.006936659105122089, -0.0015130803221836686, 0.013459189794957638, -0.004581301007419825, 0.009792422875761986, 0.01724674366414547, 0.058944348245859146, 0.01319173164665699, 0.055251698940992355, 0.008075513876974583, 0.07002229988574982, -0.052352797240018845, -0.022915132343769073, -0.011198735795915127, -0.006186050828546286, 0.11878597736358643, -0.014917268417775631, -0.0012218960328027606, 0.03699551522731781, -0.03052475117146969, 0.07053995877504349, -0.0006859010318294168, -0.001012674649246037, 0.022431982681155205, 0.01070695836097002, 0.06463862210512161, 0.03459702059626579, -0.04034305736422539, 0.07902959734201431, 0.047107163816690445, 0.02169000171124935, 0.009222996421158314, 0.06767556816339493, -0.0035848033148795366, -0.020602913573384285, -0.003968735225498676, 0.013795669190585613, 0.015745526179671288, -0.017514202743768692, -0.01998171955347061, -0.03937675803899765, -0.042896851897239685, 0.053422629833221436, -0.01792833022773266, -0.01578003726899624, -0.0030994960106909275, -0.024209285154938698, 0.08006492257118225, 0.008157476782798767, -0.035511553287506104, -0.020930765196681023, 0.020568402484059334, 0.04351804777979851, 0.03156007453799248, -0.004404433537274599, 0.01253602746874094, 0.011716397479176521, 0.038444966077804565, -0.008528467267751694, 0.026176398620009422, -0.03314756974577904, 0.07281766831874847, 0.027280742302536964, -0.022794345393776894, -0.011673258617520332, -0.004046384710818529, -0.013321146368980408, 0.06001418083906174, -0.031680863350629807, 0.04696911945939064, 0.03647785633802414, 0.009663008153438568, -0.03837594762444496, -0.0379963293671608, -0.025641482323408127, 0.0075276559218764305, -0.008028061129152775, 0.06612258404493332, 0.006129970774054527, 0.022656302899122238, 0.04334549233317375, -0.028833726420998573, 0.03004160150885582, 0.013424678705632687, -0.025727758184075356, -0.03306129202246666, 0.023984966799616814, 0.026832101866602898, -0.0381343699991703, -0.03761671110987663, -0.02467518113553524, 0.009248878806829453, 0.040619146078825, -0.048107974231243134, 0.05590740218758583, -0.05621799826622009, -0.02217315137386322, 0.025900311768054962, -0.0060221245512366295, 0.03302678093314171, -0.012052876874804497, 0.02189706638455391, -0.08724315464496613, 0.061808738857507706, 0.07419809699058533, -0.03547704219818115, -0.018066374585032463, -0.0512484535574913, -0.04938487336039543, 0.030938880518078804, 0.029437663033604622, -0.053422629833221436, -0.009352411143481731, -0.06978072226047516, 0.0083817970007658, 0.010922649875283241, -0.012708581052720547, 0.02046487107872963, -0.009688891470432281, -0.01879110001027584, 0.054492462426424026, 0.03906616196036339, -0.008127279579639435, 0.0038673600647598505, -0.05356067419052124, -0.03178439289331436, -0.04493298754096031, -0.0003499604936223477, -0.00505582382902503, -0.008778669871389866, 0.02062016911804676, -0.012182292528450489, -0.07647580653429031, -0.002320847474038601, 0.020948020741343498, -0.05987614020705223, -0.02018878422677517, 0.0037552001886069775, -0.043172940611839294, -0.0353735126554966, 0.010474010370671749, -0.009404177777469158, 0.047348737716674805, -0.002722034929320216, 0.017773032188415527, 0.023070432245731354, 0.031767137348651886, 0.029420407488942146, 0.07029838114976883, 0.018549524247646332, 0.0018333832267671824, -0.016047494485974312, 0.049488406628370285, 0.03166360780596733, 0.041067782789468765, -0.022155897691845894, -0.004126190673559904, 0.027315253391861916, 0.05511365458369255, 0.05149002745747566, -0.023898689076304436, -0.053181055933237076, 0.031025158241391182, -0.03803083673119545, 0.004676205571740866, 0.060704395174980164, 0.01811813935637474, -0.05138649791479111, 0.012967411428689957, -0.024019477888941765, 0.033906806260347366, -0.056563109159469604, 0.007488831412047148, -0.02412300929427147, -0.040550123900175095, 0.049453895539045334, 0.004022658336907625, -0.05697723478078842, 0.04413923993706703, 0.04486396536231041, 0.046900101006031036, -0.03523546829819679, -0.0005920749390497804, 0.0157023873180151, -0.06539785861968994, -0.09801051020622253, 0.0420340858399868, -0.0029592961072921753, -0.04175799712538719, 0.021948833018541336, -0.000019732460714294575, -0.01728988252580166, 0.04231017082929611, -0.005068765487521887, 0.06270601600408554, 0.01351095549762249, 0.022155897691845894, 0.053664203733205795, 0.039204202592372894, 0.007389612961560488, -0.026590527966618538, -0.010128903202712536, 0.04282783344388008, 0.02049938030540943, 0.014071755111217499, 0.029265109449625015, -0.04993704333901405, 0.001552983419969678, 0.05400931090116501, 0.08524153381586075, 0.020792722702026367, -0.02431281842291355, 0.04206859692931175, 0.058081578463315964, 0.03706453740596771, -0.021275872364640236, -0.0072990222834050655, -0.033509932458400726, -0.013088199310004711, -0.02595207840204239, -0.028281554579734802, -0.045243583619594574, -0.015262375585734844, 0.03278520703315735, 0.039480291306972504, 0.04413923993706703, -0.021362150087952614, -0.061291079968214035, -0.013269380666315556, 0.03485585004091263, -0.047383248805999756, 0.038686543703079224, -0.005802118685096502, 0.007868449203670025, 0.012967411428689957, 0.03425191342830658, -0.010939905419945717, -0.044449836015701294, -0.017669500783085823, 0.06701986491680145, -0.002599090337753296, 0.022708069533109665, 0.06798616051673889, -0.006306838244199753, -0.003681864822283387, 0.018860120326280594, 0.02220766246318817, 0.012268569320440292, -0.026694059371948242, -0.02074095606803894, 0.013493700884282589, 0.06884893029928207, 0.051351986825466156, 0.05145551636815071, -0.005357792600989342, -0.009084952995181084, 0.030386708676815033, -0.044656902551651, -0.023898689076304436, -0.026676803827285767, -0.02583129145205021, -0.046900101006031036, -0.03989441692829132, -0.054699528962373734, 0.02967923879623413, 0.0054354420863091946, -0.009024559520184994, -0.010879511944949627, 0.024261051788926125, 0.012363473884761333, -0.026952890679240227, 0.05062726140022278, 0.00942143239080906, 0.00409168004989624, -0.03156007453799248, -0.03937675803899765, -0.006565668620169163, -0.005914278328418732, -0.04745227098464966, -0.011146970093250275, -0.033958569169044495, -0.005953103303909302, 0.024502627551555634, -0.013830180279910564, 0.010301456786692142, -0.05621799826622009, 0.011578354053199291, 0.035511553287506104, 0.02778114750981331, 0.07205843180418015, 0.016547901555895805, 0.03734062239527702, 0.019049929454922676, -0.016280442476272583, 0.09552573412656784, -0.02388143353164196, 0.00910220853984356, 0.03654687479138374, -0.012656815350055695, 0.039480291306972504, -0.013295263983309269, -0.034389954060316086, -0.044656902551651, -0.0538712702691555, -0.03052475117146969, 0.03847947716712952, -0.012130525894463062, -0.012527399696409702, -0.007855507545173168, 0.016151027753949165, -0.04282783344388008, 0.008597488515079021, 0.016703199595212936, 0.01239798404276371, -0.028264299035072327, -0.04441532492637634, -0.007432751357555389, -0.013683509081602097, -0.011845812201499939, 0.016513390466570854, -0.02443360537290573, 0.09366215765476227, -0.04748678207397461, 0.011379917152225971, -0.10063332319259644, -0.041827019304037094, -0.03162909671664238, 0.019326016306877136, -0.060497332364320755, -0.029109811410307884, 0.0366504080593586, 0.013519583269953728, -0.05066176876425743, 0.03285422548651695, -0.043966684490442276, -0.07840840518474579, 0.03568410873413086, -0.018653055652976036, -0.03775475174188614, 0.04482945427298546, -0.012130525894463062, 0.01299329474568367, -0.047935422509908676, -0.025382651016116142, -0.006237816996872425, -0.005914278328418732, -0.07923666387796402, 0.03468329831957817, -0.01370939239859581, 0.015676504001021385, 0.024968521669507027, 0.014037244953215122, -0.016634177416563034, 0.07412907481193542, 0.0628785714507103, -0.0616016760468483, -0.032181266695261, -0.002784585580229759, -0.03000709041953087, -0.016936147585511208, 0.0023079058155417442, 0.006237816996872425, -0.031680863350629807, 0.08448229730129242, 0.008179046213626862, -0.02864391729235649, 0.017471063882112503, 0.0013265067245811224, 0.03525272384285927, -0.05987614020705223, 0.011345406994223595, -0.0027824286371469498, 0.02503754384815693, 0.014002733863890171, -0.0076829539611935616, 0.06412096321582794, 0.024744203314185143, -0.01253602746874094, 0.013890573754906654, 0.01887737587094307, 0.04979900270700455, -0.01939503662288189, 0.03968735411763191, -0.04217212647199631, 0.028678426519036293, -0.029437663033604622, -0.03261265158653259, -0.05849570780992508, 0.06136010214686394, 0.03727160394191742, -0.0210170429199934, -0.04310391843318939, -0.01621142216026783, -0.0033734252210706472, 0.006630376446992159, -0.04759031534194946, -0.0012693483149632812, -0.00016918352048378438, 0.0013265067245811224, -0.030783582478761673, -0.011448939330875874, -0.051282964646816254, 0.009309273213148117, -0.03323384374380112, 0.015055311843752861, 0.02900628000497818, -0.06605356186628342, 0.008722590282559395, -0.028781959787011147, -0.01219954714179039, -0.0249512679874897, -0.0189981646835804, -0.02976551651954651, -0.04755580425262451, 0.046106353402137756, -0.014296075329184532, -0.001598278759047389, 0.041585445404052734, -0.005284457467496395, -0.03285422548651695, 0.05932396650314331, -0.04048110172152519, -0.042862340807914734, -0.02626267448067665, 0.07640678435564041, 0.07640678435564041, 0.0010326261399313807, -0.009136718697845936, -0.026832101866602898, 0.008015120401978493, 0.016625549644231796, 0.032647162675857544, 0.02049938030540943, -0.04148191213607788, -0.0009037500713020563, -0.034079357981681824, -0.08883064985275269, 0.012622304260730743, 0.05538974329829216, 0.027625849470496178, 0.00997360423207283, -0.007726092357188463, 0.03830692544579506, 0.034355442970991135, -0.041585445404052734, 0.06815871596336365, -0.016125144436955452, -0.004576987121254206, 0.04375962167978287, 0.053664203733205795, 0.006371546071022749, 0.061808738857507706, -0.017022423446178436, -0.010931277647614479, 0.013976850546896458, 0.033440910279750824, 0.0023726136423647404, 0.012311707250773907, -0.0072990222834050655, -0.012820741161704063, -0.02208687551319599, -0.021983342245221138, 0.009326527826488018, -0.011060693301260471, 0.020809978246688843, -0.012967411428689957, 0.037961818277835846, 0.015089822001755238, -0.05014410987496376, 0.029851792380213737, 0.002877333201467991, 0.07544048130512238, 0.03269892930984497, 0.004646008834242821, 0.013493700884282589, 0.0037724555004388094, -0.008075513876974583, 0.01994720846414566, -0.06519079208374023, -0.04852210357785225, 0.07198940962553024, -0.057874515652656555, 0.042689789086580276, -0.017315765842795372, 0.025520693510770798, -0.016306325793266296, 0.02137940563261509, 0.020482126623392105, 0.0367884524166584, 0.0512484535574913, 0.03378601744771004, 0.016556529328227043, -0.0023273183032870293, 0.021206852048635483, 0.008334344252943993, 0.055286210030317307, -0.03506291285157204, 0.004065796732902527, -0.0052111223340034485, -0.08054807037115097, 0.012915645726025105, -0.003906184807419777, -0.00007387455843854696, 0.057046256959438324, 0.024692436680197716, -0.03269892930984497, -0.06777910143136978, -0.009964977391064167, -0.02531363070011139, -0.07392200827598572, 0.01982642151415348, -0.007894332520663738, -0.03193969279527664, 0.019774654880166054, -0.053181055933237076, 0.01884286478161812, 0.02113782986998558, -0.01657378487288952, -0.047383248805999756, -0.0236398596316576, 0.029903559014201164, -0.0009301723912358284, -0.01597847416996956, 0.016720455139875412, -0.0015098450239747763, 0.016202794387936592, -0.0472797192633152, 0.034269168972969055, -0.06877990812063217, 0.028281554579734802, -0.024330073967576027, -0.0255897156894207, 0.012061504647135735, 0.005146414507180452, -0.03187067061662674, -0.05687370523810387, 0.025537949055433273, -0.03237107768654823, -0.03651236742734909, 0.03361346200108528, -0.00173092947807163, -0.0007074702298268676, -0.013027805835008621, -0.010948533192276955, -0.007273138966411352, -0.07247255742549896, -0.05780549347400665, -0.005448383744806051, 0.03131850063800812, 0.02196608856320381, -0.004225409124046564, -0.0394112691283226, -0.023898689076304436, -0.06933208554983139, -0.053146544843912125, 0.030507497489452362, -0.012527399696409702, -0.04417375102639198, -0.04800444468855858, 0.02753957360982895, 0.081514373421669, -0.029196089133620262, 0.02586580254137516, -0.009982232004404068, 0.026797592639923096, 0.02964472770690918, -0.05090334638953209, 0.03259539604187012, 0.016703199595212936, -0.009628497064113617, 0.031732626259326935, 0.010741468518972397, -0.030645539984107018, -0.06011771410703659, -0.016634177416563034, 0.04023952782154083, -0.06191227212548256, 0.01851501315832138, -0.004723657853901386, -0.04362157732248306, -0.032491862773895264, -0.01823892816901207, -0.024295562878251076, 0.006026438437402248, -0.006643318105489016, 0.009766540490090847, -0.0249512679874897, 0.0538022480905056, 0.010681075043976307, -0.03668491914868355, -0.028937257826328278, 0.021310383453965187, 0.00785119365900755, -0.05694272741675377, 0.07495733350515366, -0.0006896756240166724, -0.0014602357987314463, -0.015141588635742664, -0.031094178557395935, -0.006285268813371658, 0.02201785333454609, 0.029472174122929573, 0.005487208254635334, 0.01273446436971426, 0.007644129451364279, 0.011371289379894733, -0.04717618599534035, 0.01820441707968712, -0.06560492515563965, 0.012570537626743317, -0.007997864857316017, -0.00023429558495990932, 0.00798923708498478, 0.020206039771437645, -0.015150216408073902, -0.02836783044040203, -0.04410472884774208, 0.007152351550757885, 0.044656902551651, -0.06284406036138535, 0.04748678207397461, 0.040032461285591125, -0.04313842952251434, 0.004658950492739677, -0.02196608856320381, -0.040032461285591125, 0.022794345393776894, -0.019688379019498825, 0.025675993412733078, 0.02003348618745804, 0.026400718837976456, 0.01482236385345459, -0.016323581337928772, -0.019205227494239807, -0.013476445339620113, 0.0022431982215493917, 0.043172940611839294, 0.09352411329746246, -0.016478879377245903, 0.03169811889529228, -0.04493298754096031, -0.023432794958353043, -0.03314756974577904, -0.04834955185651779, -0.032888736575841904, -0.008226498030126095, -0.021241361275315285, 0.004328941460698843, -0.04441532492637634, -0.04431179538369179, -0.005060137715190649, -0.010957160964608192, 0.04572673514485359, -0.03523546829819679, 0.009343783371150494, -0.01641848497092724, 0.05066176876425743, -0.08241165429353714, 0.03485585004091263, 0.05400931090116501, -0.0031145946122705936, 0.019170718267560005, -0.0420340858399868, -0.03803083673119545, 0.006457822863012552, 0.017134584486484528, 0.0021493721287697554, 0.032802462577819824, -0.05307752266526222, -0.026797592639923096, -0.04044659063220024, -0.02924785390496254, 0.012009738944470882, 0.01848050206899643, -0.040274035185575485, -0.047900911420583725, 0.012691325508058071, -0.01692751981317997, 0.0024718318600207567, -0.07026387006044388, 0.004671891685575247, -0.06701986491680145, 0.008071199990808964, -0.052870459854602814, 0.010896767489612103, 0.0696081668138504, -0.024364585056900978, 0.0017223017057403922, -0.0054354420863091946, -0.004503651987761259, -0.0176867563277483, 0.031094178557395935, 0.009119464084506035, -0.03568410873413086, -0.040308546274900436, 0.01823892816901207, -0.033113058656454086, 0.02372613549232483, 0.047624826431274414, -0.0094990823417902, -0.02860940620303154, -0.012303079478442669, 0.012717208825051785, -0.012458378449082375, -0.03958382084965706, -0.020050741732120514, 0.05697723478078842, 0.03830692544579506, -0.055769361555576324, 0.009404177777469158, 0.030421219766139984, -0.005940161645412445, -0.08427523076534271, -0.005978986155241728, -0.019998975098133087, 0.020568402484059334, 0.023415539413690567, 0.0920056402683258, 0.035269979387521744, 0.010922649875283241, -0.00011640635057119653, 0.022000597789883614, 0.04672754555940628, -0.050765302032232285, 0.0022928074467927217, 0.03930773586034775, 0.05218024179339409, -0.03321658819913864, -0.035546064376831055, -0.04179250821471214, 0.04199957475066185, -0.03133575618267059, -0.05045470595359802, -0.026003845036029816, -0.004063639789819717, -0.019757399335503578, -0.010991671122610569, 0.05031666159629822, -0.031042413786053658, 0.031525563448667526, 0.007652757223695517 ]
31,864
stevedore.extension
ExtensionManager
Base class for all of the other managers. :param namespace: The namespace for the entry points. :type namespace: str :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool
class ExtensionManager(object): """Base class for all of the other managers. :param namespace: The namespace for the entry points. :type namespace: str :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool """ def __init__(self, namespace, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False): self._init_attributes( namespace, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) extensions = self._load_plugins(invoke_on_load, invoke_args, invoke_kwds, verify_requirements) self._init_plugins(extensions) @classmethod def make_test_instance(cls, extensions, namespace='TESTING', propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False): """Construct a test ExtensionManager Test instances are passed a list of extensions to work from rather than loading them from entry points. :param extensions: Pre-configured Extension instances to use :type extensions: list of :class:`~stevedore.extension.Extension` :param namespace: The namespace for the manager; used only for identification since the extensions are passed in. :type namespace: str :param propagate_map_exceptions: When calling map, controls whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :return: The manager instance, initialized for testing """ o = cls.__new__(cls) o._init_attributes(namespace, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) o._init_plugins(extensions) return o def _init_attributes(self, namespace, propagate_map_exceptions=False, on_load_failure_callback=None): self.namespace = namespace self.propagate_map_exceptions = propagate_map_exceptions self._on_load_failure_callback = on_load_failure_callback def _init_plugins(self, extensions): self.extensions = extensions self._extensions_by_name_cache = None @property def _extensions_by_name(self): if self._extensions_by_name_cache is None: d = {} for e in self.extensions: d[e.name] = e self._extensions_by_name_cache = d return self._extensions_by_name_cache ENTRY_POINT_CACHE = {} def list_entry_points(self): """Return the list of entry points for this namespace. The entry points are not actually loaded, their list is just read and returned. """ if self.namespace not in self.ENTRY_POINT_CACHE: eps = list(_cache.get_group_all(self.namespace)) self.ENTRY_POINT_CACHE[self.namespace] = eps return self.ENTRY_POINT_CACHE[self.namespace] def entry_points_names(self): """Return the list of entry points names for this namespace.""" return list(map(operator.attrgetter("name"), self.list_entry_points())) def _load_plugins(self, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): extensions = [] for ep in self.list_entry_points(): LOG.debug('found extension %r', ep) try: ext = self._load_one_plugin(ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements, ) if ext: extensions.append(ext) except (KeyboardInterrupt, AssertionError): raise except Exception as err: if self._on_load_failure_callback is not None: self._on_load_failure_callback(self, ep, err) else: # Log the reason we couldn't import the module, # usually without a traceback. The most common # reason is an ImportError due to a missing # dependency, and the error message should be # enough to debug that. If debug logging is # enabled for our logger, provide the full # traceback. LOG.error('Could not load %r: %s', ep.name, err, exc_info=LOG.isEnabledFor(logging.DEBUG)) return extensions def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): # NOTE(dhellmann): Using require=False is deprecated in # setuptools 11.3. if hasattr(ep, 'resolve') and hasattr(ep, 'require'): if verify_requirements: ep.require() plugin = ep.resolve() else: plugin = ep.load() if invoke_on_load: obj = plugin(*invoke_args, **invoke_kwds) else: obj = None return Extension(ep.name, ep, plugin, obj) def names(self): "Returns the names of the discovered extensions" # We want to return the names of the extensions in the order # they would be used by map(), since some subclasses change # that order. return [e.name for e in self.extensions] def map(self, func, *args, **kwds): """Iterate over the extensions invoking func() for each. The signature for func() should be:: def func(ext, *args, **kwds): pass The first argument to func(), 'ext', is the :class:`~stevedore.extension.Extension` instance. Exceptions raised from within func() are propagated up and processing stopped if self.propagate_map_exceptions is True, ot
(namespace, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False)
[ 0.062066491693258286, -0.04361743852496147, -0.035014357417821884, 0.04381164163351059, 0.03759722411632538, 0.007792296353727579, 0.011331601068377495, 0.03924792632460594, -0.03748070448637009, -0.008972064591944218, 0.022235961630940437, -0.001256234711036086, -0.0005334445741027594, 0.008729314431548119, -0.05806595832109451, -0.023051602765917778, -0.018012098968029022, 0.048239413648843765, 0.004981243517249823, -0.02957674115896225, -0.014040698297321796, 0.008297218009829521, 0.06742642819881439, -0.011147110722959042, -0.02786777727305889, 0.01890542171895504, 0.03876242786645889, 0.013079405762255192, 0.031052665784955025, -0.030858464539051056, -0.07045595347881317, -0.02815907821059227, -0.008666198700666428, 0.012263763695955276, 0.0035587248858064413, -0.01627400517463684, 0.012826945632696152, 0.06598934531211853, -0.016400234773755074, 0.0010383659973740578, -0.0159438643604517, -0.019662804901599884, 0.09065280854701996, -0.037558384239673615, 0.06187228858470917, 0.04493800550699234, -0.010011037811636925, 0.058493200689554214, -0.019439473748207092, -0.01910933293402195, 0.01851702108979225, -0.010758710093796253, 0.06987335532903671, 0.02184756100177765, -0.0270521342754364, 0.12343385815620422, 0.04994837939739227, 0.04571480676531792, 0.025964612141251564, -0.005015228874981403, 0.01106943003833294, -0.011147110722959042, 0.009622636251151562, 0.03144106641411781, -0.01382707804441452, -0.034004513174295425, -0.03050890378654003, -0.07286404073238373, -0.03394625335931778, 0.04699653014540672, -0.005185154266655445, -0.03590767830610275, 0.019682224839925766, -0.04695769026875496, 0.05437615141272545, 0.03516971692442894, 0.0032018814235925674, -0.04831709340214729, 0.030858464539051056, 0.032994672656059265, -0.01220550388097763, -0.00406850129365921, -0.017245007678866386, 0.014846631325781345, 0.0772918164730072, 0.005272544454783201, 0.03996647149324417, -0.025537369772791862, 0.015584592707455158, 0.04140355437994003, -0.08832240104675293, -0.0024238654877990484, 0.04699653014540672, 0.0016203607665374875, -0.021905820816755295, -0.04148123413324356, -0.003371806815266609, -0.015982704237103462, -0.0035368772223591805, 0.02103191800415516, 0.007860266603529453, -0.039480969309806824, 0.009064310230314732, 0.01636139489710331, 0.0339268334209919, -0.001147603732533753, -0.026877354830503464, 0.01213753316551447, -0.03483957424759865, 0.011253921315073967, -0.036237820982933044, -0.03891778737306595, -0.010603349655866623, -0.025265488773584366, 0.01550691295415163, -0.028916459530591965, -0.008816704154014587, -0.008637068793177605, 0.05787175893783569, 0.012943465262651443, -0.016108933836221695, 0.0828847885131836, -0.038995467126369476, -0.0008842193055897951, 0.024877088144421577, -0.04404468089342117, 0.05449267104268074, 0.04400584101676941, 0.004255419131368399, -0.0831955075263977, 0.07360200583934784, 0.016905156895518303, -0.05278370529413223, -0.002578012179583311, -0.00027430825866758823, -0.03214018791913986, 0.008258378133177757, 0.0026921050157397985, -0.0715046375989914, 0.0427241176366806, -0.04140355437994003, 0.006054201629012823, -0.002760075032711029, 0.0388595275580883, -0.004689943045377731, -0.05934768170118332, 0.02357594482600689, 0.014768950641155243, -0.0013824650086462498, -0.014458229765295982, 0.005461890250444412, -0.04513220489025116, -0.04699653014540672, 0.011865653097629547, -0.037966202944517136, -0.003869445761665702, -0.010418858379125595, 0.0213620588183403, -0.0008635855047032237, -0.03254801034927368, -0.03528623655438423, 0.004056363832205534, -0.05538599193096161, -0.020857136696577072, -0.037869103252887726, -0.010894649662077427, -0.019789034500718117, -0.014953440986573696, -0.022837983444333076, 0.04159775376319885, -0.016409944742918015, 0.02885819971561432, 0.02004149556159973, 0.019245272502303123, 0.050686340779066086, 0.07962221652269363, 0.0023825978860259056, 0.007845701649785042, -0.006350357551127672, 0.03245091065764427, 0.03802446648478508, -0.007428170647472143, -0.06059056520462036, 0.009093440137803555, -0.006233836989849806, 0.04967649653553963, 0.03305293247103691, 0.015186482109129429, -0.007321360055357218, 0.009540101513266563, -0.03489783778786659, -0.021497998386621475, 0.060318686068058014, 0.050686340779066086, -0.04218035563826561, 0.0555025115609169, -0.043151360005140305, 0.0007100456859916449, -0.03163526579737663, 0.04388932138681412, -0.11434527486562729, 0.014011568389832973, 0.049443457275629044, -0.04493800550699234, 0.01169087179005146, 0.0020937244407832623, 0.009341045282781124, -0.004796753171831369, -0.04602552577853203, 0.006539702881127596, 0.022333061322569847, -0.04287947714328766, -0.06719338148832321, 0.012360864318907261, 0.023517685011029243, -0.07383504509925842, 0.062066491693258286, 0.030139923095703125, 0.026255913078784943, 0.03586883842945099, -0.0028620304074138403, 0.05682307481765747, 0.0015390391927212477, 0.03854880481958389, 0.006224127020686865, 0.017497468739748, 0.045598287135362625, 0.007020349148660898, 0.037053462117910385, 0.008874964900314808, 0.03468421474099159, -0.000984353944659233, 0.007515560835599899, -0.04252991825342178, 0.04482148215174675, -0.033887993544340134, 0.07550516724586487, 0.02775125578045845, 0.029304860159754753, 0.03161584585905075, 0.02947964146733284, 0.02837269753217697, -0.017730507999658585, -0.011700581759214401, -0.040393710136413574, -0.030353544279932976, -0.032276127487421036, -0.04237455502152443, 0.014244609512388706, 0.029246600344777107, 0.0473460890352726, 0.0436951220035553, 0.018953971564769745, -0.009078875184059143, -0.06851395219564438, -0.04361743852496147, 0.012477383948862553, -0.02806197665631771, 0.038471125066280365, -0.002682394813746214, 0.0017344534862786531, -0.019963815808296204, -0.010836389847099781, 0.02134263888001442, -0.014633010141551495, -0.012885205447673798, 0.04027719050645828, -0.020352216437458992, 0.002512469422072172, 0.06358125805854797, 0.059813763946294785, 0.06288213282823563, -0.03346075117588043, 0.057677559554576874, -0.02388666570186615, 0.01728384755551815, -0.0014552902430295944, -0.028392117470502853, 0.0030829336028546095, 0.0010559654328972101, 0.023731306195259094, 0.012283183634281158, -0.02532375045120716, -0.00898662954568863, -0.005185154266655445, -0.05161850154399872, -0.03825750574469566, 0.035538699477910995, -0.04952113702893257, -0.013603747822344303, -0.0026799673214554787, 0.019536573439836502, 0.0001702289009699598, -0.05231762304902077, -0.004306396935135126, -0.010923780500888824, -0.09010905027389526, -0.01068102940917015, 0.01960454322397709, -0.023653624579310417, -0.009219670668244362, -0.010545088909566402, 0.013254186138510704, 0.0455206036567688, -0.010292628780007362, 0.0006809156038798392, 0.014535910449922085, -0.030858464539051056, -0.0010213734349235892, 0.0541042685508728, 0.04016067087650299, -0.0073650553822517395, -0.029130080714821815, 0.018381081521511078, 0.04423888027667999, 0.028916459530591965, 0.05581323429942131, 0.011244211345911026, -0.0062775323167443275, 0.026702573522925377, -0.02916892059147358, 0.09624578803777695, 0.017215877771377563, 0.03184888884425163, 0.050686340779066086, 0.006646513473242521, 0.037869103252887726, 0.027324015274643898, 0.013875627890229225, -0.09158497303724289, -0.039888788014650345, -0.04058791324496269, -0.02369246445596218, 0.01398243848234415, -0.022002920508384705, 0.004461757373064756, 0.014982570894062519, -0.05693959817290306, 0.029032979160547256, -0.0020148304756730795, 0.08203030377626419, 0.022954503074288368, -0.08754560351371765, -0.012477383948862553, -0.03334423154592514, -0.04249107837677002, 0.03668447956442833, 0.027362855151295662, 0.011205370537936687, -0.02316812425851822, 0.041015151888132095, -0.039480969309806824, -0.074068084359169, -0.0008805780671536922, 0.009724591858685017, -0.08832240104675293, -0.024624627083539963, -0.032081928104162216, -0.01688573695719242, -0.00600079633295536, -0.01051595900207758, -0.004447192419320345, -0.07084435224533081, 0.01427373941987753, -0.017235297709703445, -0.07799093425273895, 0.06567861884832382, -0.040510229766368866, 0.031363386660814285, -0.08622504025697708, 0.020177435129880905, -0.0028207628056406975, -0.01657501608133316, -0.05519179254770279, 0.031052665784955025, -0.03656795993447304, 0.06039636582136154, 0.04571480676531792, -0.05907580256462097, 0.03223728761076927, 0.04404468089342117, 0.037461284548044205, -0.04703537002205849, -0.0035927097778767347, -0.0028984430246055126, -0.016196325421333313, 0.05651235580444336, -0.004648675210773945, 0.014768950641155243, -0.009559521451592445, 0.033480171114206314, -0.010176108218729496, -0.040898632258176804, 0.05457035079598427, 0.0036970926448702812, -0.00236317771486938, -0.044588442891836166, 0.017419787123799324, -0.02126495912671089, 0.003218873869627714, 0.058609720319509506, -0.03534449636936188, 0.09057512879371643, 0.054842229932546616, 0.03751954436302185, -0.03017876297235489, 0.0441223606467247, 0.05655119568109512, -0.0022090310230851173, 0.07399040460586548, -0.04167543351650238, 0.0027649300172924995, -0.055852074176073074, -0.065484419465065, -0.07111623883247375, -0.003816040465608239, -0.017565438523888588, 0.00853511318564415, -0.03008166328072548, -0.01184623222798109, 0.004391359630972147, -0.021381478756666183, -0.012739554978907108, -0.01265216525644064, 0.016186615452170372, -0.020313376560807228, -0.05826016142964363, 0.0007804434280842543, -0.07667037099599838, -0.007894251495599747, -0.032353807240724564, -0.014215479604899883, 0.004976388532668352, -0.10028515756130219, 0.005588120315223932, -0.05643467605113983, -0.0003216446493752301, -0.04470496252179146, -0.01961425319314003, 0.004007813520729542, -0.03382973372936249, 0.039306189864873886, 0.05060866102576256, -0.03588825836777687, 0.014807790517807007, 0.026391852647066116, -0.030955566093325615, 0.046297408640384674, -0.01728384755551815, 0.0033863717690110207, -0.03229554742574692, 0.033616114407777786, 0.07733065634965897, -0.02357594482600689, -0.004155891481786966, -0.02928544022142887, 0.006981509272009134, -0.016138063743710518, -0.04159775376319885, 0.014652430079877377, -0.017332397401332855, -0.03194598853588104, 0.04136471450328827, -0.053016744554042816, -0.006161011755466461, 0.018157750368118286, 0.06490182131528854, 0.0078359916806221, -0.005704640876501799, 0.018342239782214165, 0.052278783172369, 0.016196325421333313, 0.042024996131658554, -0.053405147045850754, 0.006161011755466461, 0.024333326146006584, 0.031965408474206924, -0.026916194707155228, 0.029304860159754753, -0.057289157062768936, 0.020915398374199867, -0.01899281144142151, 0.06358125805854797, -0.0012198220938444138, -0.016924576833844185, -0.03272278979420662, 0.10572277009487152, -0.07092203199863434, 0.0019250127952545881, -0.006952379364520311, -0.026158811524510384, 0.040898632258176804, 0.015565172769129276, 0.030372964218258858, -0.003973828628659248, -0.015235031954944134, 0.02153684012591839, 0.006418327800929546, 0.06917423009872437, -0.06754294782876968, 0.03647086024284363, -0.014186348766088486, 0.01595357432961464, -0.031130345538258553, 0.0331694521009922, -0.001597299356944859, -0.010807259939610958, 0.035111457109451294, -0.01499228086322546, -0.017254717648029327, -0.02134263888001442, -0.0043403818272054195, -0.023401163518428802, -0.02062409743666649, 0.01780818961560726, -0.0016070094425231218, 0.021517420187592506, 0.04750145226716995, 0.008457433432340622, -0.012312313541769981, 0.04027719050645828, 0.015235031954944134, 0.06765946745872498, -0.016225455328822136, -0.008748734369874, -0.0053016748279333115, -0.02126495912671089, -0.0013679000549018383, 0.009525536559522152, 0.06008564680814743, 0.01677892543375492, 0.03384915366768837, -0.03598535805940628, -0.0673099085688591, 0.021167857572436333, -0.01381736807525158, -0.043267879635095596, -0.012059853412210941, 0.023245804011821747, 0.0028183353133499622, 0.020371636375784874, 0.020565835759043694, 0.025653891265392303, -0.00230006268247962, 0.00037201540544629097, -0.02804255671799183, -0.010914069600403309, 0.0047215004451572895, -0.0011081567499786615, -0.04726840928196907, 0.04668580740690231, 0.0024760568048805, 0.03182946890592575, 0.015400102362036705, -0.003566007362678647, -0.09181801229715347, 0.023342903703451157, -0.03149932622909546, -0.022002920508384705, 0.041714273393154144, -0.009831402450799942, 0.02316812425851822, -0.060124486684799194, -0.019963815808296204, -0.007952512241899967, 0.025848090648651123, 0.013623167760670185, 0.0213620588183403, -0.040898632258176804, -0.00018266987171955407, 0.009841112419962883, 0.03903430700302124, -0.04994837939739227, -0.04952113702893257, -0.040820952504873276, 0.06540673971176147, 0.008360332809388638, 0.01281723566353321, 0.02481882832944393, -0.05033677816390991, 0.00030965881887823343, -0.007117449771612883, 0.011525801382958889, 0.014079539105296135, -0.012244343757629395, -0.001553604262880981, 0.017021676525473595, 0.07674805074930191, -0.013050275854766369, 0.03138280659914017, -0.03687868267297745, 0.03377147391438484, 0.02532375045120716, -0.042452238500118256, 0.02998456172645092, 0.001631284481845796, -0.03934502974152565, 0.019536573439836502, 0.04140355437994003, -0.04746261239051819, -0.031227445229887962, -0.014730110764503479, 0.01280752569437027, -0.05196806415915489, 0.015370972454547882, -0.025673311203718185, -0.016613855957984924, -0.0024979044683277607, -0.03858764469623566, 0.03505319729447365, -0.04357859864830971, -0.03829634562134743, 0.03307235240936279, -0.07581588625907898, -0.013691137544810772, -0.053210947662591934, -0.0581824816763401, 0.004765195772051811, 0.057599879801273346, -0.003434921847656369, -0.011817102320492268, 0.029130080714821815, 0.011700581759214401, 0.003510174574330449, -0.011185950599610806, -0.036859262734651566, -0.011331601068377495, 0.017730507999658585, 0.02359536476433277, -0.007685486227273941, 0.010651899501681328, 0.01850731112062931, 0.0009558307356201112, -0.06754294782876968, 0.05791059881448746, -0.03586883842945099, 0.027479374781250954, -0.0279648769646883, 0.03738360479474068, 0.03223728761076927, 0.04979301616549492, -0.06668846309185028, 0.002425079233944416, -0.013584326952695847, -0.02563447132706642, 0.02561505138874054, -0.007132014725357294, 0.028411537408828735, 0.06474646180868149, -0.0029300006572157145, 0.017031386494636536, 0.009884807281196117, -0.06027984619140625, 0.021692199632525444, -0.029013559222221375, 0.057172637432813644, -0.015516622923314571, -0.015264161862432957, 0.00900119449943304, 0.016798345372080803, -0.0006144626531749964, -0.00465110270306468, -0.041636593639850616, 0.027828937396407127, 0.03394625335931778, -0.043267879635095596, 0.014244609512388706, -0.006792163476347923, 0.04645276814699173, 0.02002207562327385, 0.007020349148660898, -0.019449183717370033, 0.009224525652825832, -0.014322289265692234, -0.027401695027947426, -0.03996647149324417, -0.03443175554275513, 0.04016067087650299, -0.03245091065764427, 0.03458711504936218, 0.014982570894062519, 0.03089730441570282, -0.03608245775103569, 0.0660281851887703, -0.05608511343598366, 0.02145915850996971, 0.04008299112319946, -0.0073456354439258575, 0.023401163518428802, -0.03588825836777687, 0.0050734891556203365, 0.0500260591506958, 0.06474646180868149, 0.017497468739748, -0.01799267902970314, -0.005806596018373966, -0.047229569405317307, -0.10999518632888794, -0.021420318633317947, -0.05356050655245781, 0.026411272585392, -0.02316812425851822, -0.05064750090241432, -0.0008144284947775304, 0.020662937313318253, 0.025071289390325546, -0.07360200583934784, 0.009409015998244286, 0.004573422484099865, -0.013924178667366505, -0.012865785509347916, 0.01800238899886608, 0.09096352756023407, -0.05165734142065048, 0.02450810745358467, -0.05309442803263664, 0.03509203717112541, -0.03190714865922928, 0.040704432874917984, 0.022896243259310722, -0.023867245763540268, -0.03526681661605835, 0.06532905995845795, 0.003206736408174038, -0.013632877729833126, 0.0339268334209919, -0.029635000973939896, -0.05356050655245781, 0.011195660568773746, 0.02540143020451069, -0.03870416805148125, -0.023323483765125275, -0.05581323429942131, 0.0701063945889473, 0.04614204540848732, -0.06800902634859085, 0.024566367268562317, -0.0033936542458832264, -0.01427373941987753, -0.04990953579545021, -0.004483604803681374, -0.04750145226716995, -0.02633359283208847, 0.029615581035614014, 0.023634204640984535, 0.022604942321777344, 0.024100286886096, 0.0400441512465477, -0.018575280904769897, 0.046608127653598785, -0.000058298090152675286, -0.016409944742918015, -0.02815907821059227, 0.015817632898688316, -0.021711619570851326, -0.02196408063173294, 0.00632608262822032, 0.01688573695719242, -0.03819924592971802, -0.06575629860162735, -0.03068368509411812, -0.05328862741589546, -0.023440005257725716, -0.037752583622932434, 0.0715046375989914, 0.019555993378162384, -0.00929735042154789, 0.03163526579737663 ]
31,867
stevedore.extension
__init__
null
def __init__(self, namespace, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False): self._init_attributes( namespace, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) extensions = self._load_plugins(invoke_on_load, invoke_args, invoke_kwds, verify_requirements) self._init_plugins(extensions)
(self, namespace, invoke_on_load=False, invoke_args=(), invoke_kwds={}, propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False)
[ 0.015484602190554142, -0.05361832678318024, 0.03968040645122528, -0.020373541861772537, 0.02133355103433132, 0.03541369363665581, 0.031182540580630302, 0.02967141382396221, -0.025742484256625175, -0.0031844768673181534, 0.036000367254018784, 0.058916155248880386, -0.0056533911265432835, 0.004942272789776325, -0.06805402785539627, -0.05792059004306793, -0.01074677612632513, 0.04963606223464012, -0.032106995582580566, -0.032658111304044724, -0.005688947159796953, 0.02686249651014805, -0.0007077850168570876, 0.007586744148284197, 0.02028465084731579, 0.015262378379702568, 0.010231215506792068, 0.020640211179852486, 0.04430267587304115, -0.02657804824411869, -0.023911355063319206, 0.021475775167346, 0.019484642893075943, 0.035947032272815704, 0.02181355655193329, -0.012986799702048302, 0.03864928334951401, 0.010844554752111435, -0.008466753177344799, 0.008844534866511822, 0.009093426167964935, -0.018560189753770828, 0.04540490731596947, -0.02128021791577339, 0.028871405869722366, 0.04430267587304115, 0.008240084163844585, 0.06755624711513519, -0.02643582597374916, 0.025582483038306236, -0.011333448812365532, 0.007231184747070074, 0.06880070269107819, 0.030435865744948387, -0.047289371490478516, 0.16241943836212158, 0.054187219589948654, 0.04362711310386658, 0.02654249407351017, 0.026311378926038742, 0.00229780119843781, -0.030880315229296684, 0.025742484256625175, 0.029031407088041306, -0.0018800192046910524, -0.013431248255074024, -0.026133600622415543, -0.05763614550232887, -0.027164721861481667, 0.013049022294580936, 0.037440381944179535, -0.008648977614939213, 0.025618039071559906, -0.03822261095046997, 0.05717391520738602, 0.032693665474653244, -0.04455156624317169, -0.00817786157131195, 0.008168972097337246, 0.04792937636375427, -0.0050800517201423645, -0.004531157203018665, -0.0335114523768425, -0.008137861266732216, 0.05180497467517853, -0.009724543429911137, 0.003728926880285144, -0.03804483264684677, 0.0711473897099495, 0.03148476406931877, -0.10382328182458878, 0.013564582914113998, 0.03633815050125122, -0.004131153225898743, -0.007297852076590061, -0.03125365078449249, 0.035769253969192505, 0.006768958177417517, 0.027484724298119545, 0.02172466553747654, -0.013573471456766129, -0.08149416744709015, 0.011280114762485027, -0.0022933566942811012, 0.029155852273106575, 0.018862415105104446, -0.0007344519253820181, 0.007364519406110048, 0.01857796683907509, 0.016035718843340874, 0.006697846110910177, -0.008284528739750385, 0.027609171345829964, 0.02307579107582569, -0.013609027490019798, -0.03550258278846741, -0.000021927307898295112, -0.022951345890760422, 0.03473813086748123, 0.02803584188222885, -0.04010707512497902, 0.03196477144956589, -0.0006544511415995657, 0.027289167046546936, 0.021066881716251373, -0.02691582962870598, 0.031164763495326042, 0.010204548947513103, 0.020462431013584137, -0.06599178165197372, 0.07957414537668228, -0.018986860290169716, -0.047609373927116394, -0.013022354803979397, -0.0625428631901741, -0.05848948657512665, 0.03493368998169899, 0.031004760414361954, -0.06912070512771606, 0.05621390789747238, -0.01326235756278038, 0.011289004236459732, 0.010640108957886696, 0.012151234783232212, 0.010400106199085712, -0.027449168264865875, 0.006386731751263142, -0.01646238937973976, 0.0030178085435181856, -0.02983141504228115, 0.016222387552261353, -0.03840039297938347, -0.037262603640556335, -0.014213478192687035, -0.009164538234472275, -0.03205366060137749, 0.01156456209719181, -0.017884626984596252, 0.011093446984887123, -0.02510247938334942, -0.00020166872127447277, 0.04131597653031349, -0.035911478102207184, -0.03932484611868858, 0.0007733412203378975, 0.0022778010461479425, 0.03176921233534813, -0.03144920989871025, -0.018684634938836098, 0.02508470043540001, -0.03672926500439644, -0.02307579107582569, 0.017617957666516304, 0.04035596922039986, 0.05191164091229439, 0.05521834269165993, -0.006600067485123873, 0.009546764194965363, -0.0076445224694907665, 0.045938245952129364, 0.008048971183598042, 0.010151214897632599, -0.03964484855532646, 0.018986860290169716, -0.033973678946495056, 0.08846312761306763, 0.022293560206890106, 0.052338313311338425, -0.0017077951924875379, 0.0069778491742908955, 0.032444775104522705, 0.022702453657984734, 0.057493921369314194, 0.052444979548454285, -0.006786735728383064, 0.015422379598021507, -0.06865847855806351, 0.002635582350194454, -0.08376974612474442, 0.05848948657512665, -0.024978032335639, 0.030720314010977745, 0.022044669836759567, -0.012302347458899021, 0.012320125475525856, 0.02305801399052143, 0.017706846818327904, 0.06538733094930649, -0.03182254731655121, -0.024622473865747452, 0.04341377690434456, -0.045902691781520844, -0.060765065252780914, 0.04999162256717682, -0.014524593017995358, -0.017520178109407425, 0.02846251241862774, 0.03361812233924866, 0.0010989001020789146, 0.014862374402582645, 0.06129840388894081, 0.0961432009935379, -0.007893414236605167, -0.0032755890861153603, -0.01689795032143593, 0.062258414924144745, 0.059271715581417084, -0.03512924909591675, -0.012391237542033195, 0.03786705434322357, -0.015875717625021935, 0.02483580820262432, -0.007826746441423893, -0.03383145481348038, -0.006333398167043924, -0.027466947212815285, 0.09607209265232086, 0.03776038438081741, -0.011360116302967072, 0.014666816219687462, 0.06894292682409286, 0.022578008472919464, -0.022044669836759567, -0.03822261095046997, -0.0334225632250309, 0.017369065433740616, -0.05006273463368416, -0.058880601078271866, 0.006902292836457491, 0.026311378926038742, 0.010408994741737843, 0.01960908994078636, -0.005195608362555504, -0.0077511901035904884, -0.07345853000879288, 0.01848907768726349, 0.017111286520957947, -0.05116496607661247, 0.02017798461019993, -0.009244538843631744, 0.05152052640914917, -0.037227045744657516, -0.0028911405242979527, 0.06584955751895905, 0.008684532716870308, -0.006520066410303116, 0.044089339673519135, -0.012960132211446762, 0.020942436531186104, 0.026026932522654533, 0.05137830227613449, 0.0108267767354846, 0.027822505682706833, 0.06040950492024422, -0.025351369753479958, -0.04458712041378021, -0.04465823248028755, -0.037333715707063675, 0.011271226219832897, 0.05998283624649048, 0.0774407908320427, -0.0010677886893972754, -0.020409097895026207, -0.0066622900776565075, 0.006671179085969925, -0.04839160665869713, -0.03669370710849762, 0.022933566942811012, -0.05685391277074814, -0.04984939843416214, -0.014560149051249027, 0.04291599243879318, -0.01637350022792816, 0.011875676922500134, 0.004626713693141937, -0.02504914440214634, -0.07360075414180756, 0.01831129752099514, 0.025955820456147194, -0.012577906250953674, -0.0124445715919137, -0.054364997893571854, 0.007786746136844158, -0.011093446984887123, 0.033760346472263336, -0.010622330941259861, -0.0006605623057112098, -0.0014777928590774536, -0.03840039297938347, 0.0700807124376297, 0.060551729053258896, -0.012133456766605377, -0.03786705434322357, -0.01816907525062561, 0.027609171345829964, 0.029546968638896942, 0.05788503587245941, -0.0702584981918335, 0.024551361799240112, 0.0005458389059640467, -0.010871222242712975, 0.023715797811746597, 0.0016166832065209746, 0.0199468694627285, 0.0035400360357016325, -0.007435631472617388, 0.03159143403172493, 0.0010461218189448118, 0.0034378129057586193, -0.0634317621588707, -0.022969122976064682, 0.03189365938305855, 0.003748927265405655, -0.027306945994496346, -0.034115903079509735, -0.03697815537452698, -0.017866849899291992, -0.04856938496232033, -0.012382348999381065, -0.0024866920430213213, 0.018809080123901367, 0.003315589390695095, -0.07153850793838501, 0.013857918791472912, -0.04647158458828926, -0.028978073969483376, -0.009511208161711693, -0.004484490025788546, 0.062436193227767944, -0.0596628300845623, 0.014453480951488018, -0.04334266483783722, -0.057387251406908035, 0.03507591411471367, 0.02138688415288925, -0.06250730156898499, -0.022631341591477394, -0.030684757977724075, -0.007946747355163097, -0.04177820309996605, -0.018880192190408707, -0.012800130993127823, -0.07160961627960205, 0.0002241689508082345, 0.032551445066928864, -0.011049001477658749, 0.05980505421757698, -0.022720232605934143, -0.008866757154464722, -0.0496005080640316, 0.026275822892785072, -0.07249851524829865, -0.04433823004364967, -0.015271266922354698, 0.048924945294857025, -0.029155852273106575, 0.029458077624440193, 0.01155567355453968, -0.030613645911216736, 0.008088971488177776, 0.00008930646436056122, 0.031235873699188232, -0.02179577760398388, -0.042275987565517426, -0.013680139556527138, 0.0043911561369895935, 0.012204568833112717, 0.025902487337589264, 0.013120134361088276, -0.018880192190408707, 0.040747083723545074, 0.013671251013875008, -0.015635715797543526, 0.005555612500756979, 0.018986860290169716, 0.03672926500439644, -0.015769049525260925, 0.0231824591755867, 0.03708482161164284, -0.0033222560305148363, 0.01807129569351673, -0.04032041132450104, 0.04821382462978363, 0.01843574456870556, 0.026169156655669212, 0.04156486690044403, 0.021884668618440628, 0.042524877935647964, 0.020906880497932434, 0.040818195790052414, 0.0009483430185355246, 0.02999141812324524, -0.0702584981918335, -0.06151174008846283, -0.06112062558531761, 0.014746816828846931, 0.04615158215165138, 0.006071173120290041, -0.05774281173944473, -0.052267201244831085, -0.00665340106934309, 0.005897838156670332, 0.0039911516942083836, -0.017235731706023216, 0.065778449177742, -0.010106769390404224, 0.002448913874104619, -0.04871160909533501, 0.006560067180544138, -0.019004639238119125, -0.07267630100250244, 0.08803645521402359, -0.04280932620167732, -0.08241862058639526, 0.04263154789805412, -0.0566050224006176, -0.03697815537452698, -0.01971575617790222, 0.015129043720662594, -0.003273366717621684, -0.06339620053768158, 0.004582269117236137, 0.0594850517809391, -0.009315650910139084, -0.05482722818851471, 0.010684553533792496, -0.024373581632971764, 0.05162719264626503, -0.03208921477198601, 0.006942293141037226, 0.01675572618842125, 0.03200032562017441, 0.06776957958936691, -0.02661360427737236, 0.011209003627300262, -0.031182540580630302, -0.018613522872328758, 0.020266873762011528, 0.016026830300688744, 0.02133355103433132, -0.057102806866168976, -0.0300980843603611, -0.007995637133717537, -0.07701411843299866, -0.02675582841038704, 0.03496924415230751, 0.04280932620167732, 0.011866787448525429, 0.024409137666225433, 0.024018023163080215, 0.042382653802633286, 0.002395580057054758, 0.05187608674168587, -0.04497823864221573, 0.052267201244831085, 0.03125365078449249, 0.0231824591755867, -0.03651592880487442, 0.020302429795265198, -0.045618243515491486, 0.001974464626982808, 0.035911478102207184, 0.032515887171030045, 0.020657988265156746, -0.0328003354370594, -0.03512924909591675, 0.04824938252568245, -0.05934282764792442, 0.015831273049116135, 0.010497884824872017, -0.005928949452936649, 0.06656067818403244, 0.02346690557897091, 0.012195680290460587, 0.01636461168527603, -0.025351369753479958, 0.039893738925457, 0.03459591045975685, 0.02807139791548252, -0.007964525371789932, -0.022915789857506752, 0.0021133548580110073, -0.016009053215384483, -0.00294669670984149, 0.009760099463164806, -0.002997808391228318, -0.01245346013456583, -0.000300836400128901, 0.0037267047446221113, -0.035733699798583984, -0.04135153442621231, -0.03168032318353653, -0.01984020322561264, -0.015689048916101456, -0.02517358958721161, -0.019626867026090622, -0.013129022903740406, 0.06375176459550858, -0.05155608057975769, 0.003984485287219286, 0.05287165194749832, 0.014506815001368523, 0.053973883390426636, -0.037547048181295395, 0.005084496457129717, -0.03496924415230751, 0.014569037593901157, 0.020302429795265198, 0.012160124257206917, 0.004517823923379183, -0.0018011295469477773, -0.015662381425499916, -0.03811594471335411, -0.0664895698428154, -0.01663128100335598, 0.00843119714409113, -0.05543167516589165, 0.02986697107553482, 0.047680485993623734, -0.005582279060035944, 0.005048940423876047, 0.04170709103345871, -0.016275722533464432, 0.04497823864221573, 0.01403569895774126, -0.01825796440243721, -0.03296033665537834, 0.029262520372867584, -0.0030733647290617228, -0.015653492882847786, 0.022738009691238403, -0.027715837582945824, -0.009688987396657467, 0.02474691905081272, -0.003951151389628649, -0.07153850793838501, 0.03658704087138176, -0.07758301496505737, -0.030702535063028336, 0.0360359251499176, -0.013493470847606659, 0.034169238060712814, -0.06833847612142563, 0.0002252800768474117, -0.015137932263314724, 0.011386782862246037, 0.04992051050066948, -0.008875645697116852, -0.05475611612200737, 0.014293478801846504, 0.02632915787398815, 0.005457833409309387, -0.039182621985673904, -0.008800090290606022, -0.032533664256334305, 0.06567177921533585, 0.012311236932873726, 0.012160124257206917, 0.004053374752402306, -0.03175143525004387, -0.019129084423184395, 0.015884606167674065, -0.0124445715919137, -0.0030178085435181856, -0.022844677790999413, -0.006297842133790255, -0.01840018853545189, 0.08568976074457169, 0.030471421778202057, -0.004213376436382532, -0.020426874980330467, -0.02339579351246357, -0.008591198362410069, -0.015555714257061481, -0.006600067485123873, -0.006684512831270695, -0.02330690436065197, 0.013955698348581791, 0.045796021819114685, -0.08668532967567444, -0.05112941190600395, 0.04462267830967903, -0.006417843513190746, -0.0265958271920681, -0.050596073269844055, 0.013715695589780807, -0.057493921369314194, 0.04476490244269371, -0.00670229084789753, 0.07267630100250244, 0.005013384390622377, -0.03537813946604729, 0.014657927677035332, -0.012933465652167797, 0.02487136423587799, -0.022506896406412125, -0.04497823864221573, 0.0028955850284546614, 0.042489323765039444, -0.04647158458828926, -0.03128920868039131, -0.015822384506464005, 0.01829352043569088, -0.01151122897863388, 0.007417853455990553, -0.040533747524023056, -0.023751353845000267, -0.012346792966127396, 0.021991334855556488, -0.00817786157131195, 0.017555734142661095, -0.022186893969774246, -0.005351165775209665, -0.0961432009935379, 0.03157365694642067, -0.007795635145157576, 0.05376054719090462, -0.003068920224905014, 0.03454257547855377, 0.011146780103445053, 0.017555734142661095, -0.044018227607011795, 0.03818705677986145, -0.044018227607011795, 0.009564542211592197, 0.006408954504877329, -0.03624925762414932, 0.03985818475484848, 0.06108506768941879, 0.005697836168110371, 0.049956064671278, -0.014053476974368095, -0.05280053988099098, 0.03278255835175514, -0.05824059620499611, 0.04661380872130394, -0.0032644777093082666, 0.009440096095204353, 0.06947626173496246, -0.0141068110242486, -0.05176941677927971, 0.011537895537912846, -0.01841796562075615, 0.04188487306237221, 0.0930853933095932, -0.04472934454679489, 0.03361812233924866, -0.044018227607011795, -0.015662381425499916, 0.012702351436018944, -0.020302429795265198, 0.04465823248028755, 0.03978707268834114, 0.03347589820623398, -0.019449086859822273, -0.0035778142046183348, -0.05002717673778534, -0.034275904297828674, -0.007773412857204676, 0.04341377690434456, -0.04647158458828926, 0.00494671706110239, -0.03614259138703346, -0.0300091952085495, -0.0729607418179512, -0.01960908994078636, 0.03132476285099983, 0.023751353845000267, 0.0026689162477850914, -0.044053781777620316, -0.010195659473538399, 0.05959171801805496, 0.05432944372296333, 0.013822363689541817, 0.020657988265156746, -0.003304478246718645, -0.05816948413848877, -0.10154770314693451, -0.013324580155313015, -0.018649078905582428, 0.052480537444353104, -0.010648997500538826, -0.06442732363939285, -0.015902385115623474, -0.02307579107582569, -0.004137820098549128, -0.06133395805954933, 0.00821341760456562, -0.0062311748042702675, 0.0265958271920681, 0.006342287175357342, 0.012506794184446335, 0.024035800248384476, -0.03857817128300667, -0.00023653019161429256, 0.014631260186433792, 0.02005353756248951, -0.0017189064528793097, -0.032444775104522705, -0.02990252710878849, 0.004764493089169264, -0.03614259138703346, 0.029155852273106575, -0.06026728078722954, 0.025724707171320915, 0.01097788941115141, -0.016089053824543953, 0.006137840449810028, 0.04291599243879318, -0.020337985828518867, -0.020604655146598816, -0.0300091952085495, -0.05205386504530907, 0.042098209261894226, 0.0023089125752449036, -0.08711200207471848, 0.0022166892886161804, -0.03160921111702919, 0.017422400414943695, -0.025404702872037888, -0.029635857790708542, 0.007568966131657362, 0.005088940728455782, 0.06798291951417923, 0.054151665419340134, 0.010391216725111008, -0.017689069733023643, -0.015911273658275604, 0.043840449303388596, 0.067022904753685, -0.06794735789299011, 0.06197396665811539, -0.006337842438369989, 0.023786909878253937, 0.0021455774549394846, -0.052267201244831085, 0.010551218874752522, 0.009840100072324276, -0.057493921369314194, -0.11783231049776077, -0.06357397884130478, -0.05845392867922783, -0.014791262336075306, -0.0594850517809391, 0.0968543216586113, 0.0334225632250309, 0.04017818719148636, -0.007968970574438572 ]
31,873
stevedore.extension
_load_one_plugin
null
def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): # NOTE(dhellmann): Using require=False is deprecated in # setuptools 11.3. if hasattr(ep, 'resolve') and hasattr(ep, 'require'): if verify_requirements: ep.require() plugin = ep.resolve() else: plugin = ep.load() if invoke_on_load: obj = plugin(*invoke_args, **invoke_kwds) else: obj = None return Extension(ep.name, ep, plugin, obj)
(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements)
[ 0.023159224539995193, -0.056934554129838943, 0.013962103985249996, 0.0412030965089798, 0.017010292038321495, 0.02005848102271557, 0.12746332585811615, 0.04719436541199684, -0.08205582946538925, -0.029465820640325546, 0.0579155795276165, 0.006709517911076546, -0.04113302379846573, 0.003724833717569709, -0.052414827048778534, -0.04467172548174858, -0.020794250071048737, 0.060122888535261154, -0.004598560277372599, -0.01670372113585472, 0.012849690392613411, 0.018148982897400856, 0.04502209275960922, -0.006459882017225027, 0.024473099038004875, 0.03622789308428764, 0.05581337958574295, 0.011667204089462757, 0.008610256016254425, -0.024893539026379585, 0.011789832264184952, -0.0032233716920018196, 0.013681811280548573, 0.0755390152335167, 0.006832146551460028, 0.05910682678222656, 0.01944533921778202, 0.05209949612617493, 0.029045380651950836, 0.015941675752401352, -0.016484742984175682, 0.0027985521592199802, 0.13720351457595825, -0.022073088213801384, 0.03132276237010956, 0.031883351504802704, -0.011386910453438759, 0.07231564074754715, -0.039976816624403, 0.005851120222359896, 0.026995737105607986, 0.003700745990499854, 0.06930249184370041, 0.022370899096131325, -0.05125861614942551, 0.085489422082901, 0.05816083773970604, 0.05280023068189621, 0.0001505480904597789, 0.06923241913318634, -0.01288472767919302, -0.020198628306388855, 0.00939858052879572, 0.03282934054732323, -0.00454600527882576, -0.015092035755515099, 0.006091997027397156, -0.053676143288612366, -0.033144667744636536, 0.029641004279255867, -0.00701170926913619, 0.006249662023037672, 0.017299344763159752, -0.0428498201072216, 0.09536975622177124, 0.024297915399074554, -0.046213340014219284, -0.043795809149742126, 0.03472131863236427, 0.05507761240005493, -0.007318279705941677, -0.012630711309611797, -0.017754821106791496, 0.006284698843955994, 0.005251117516309023, -0.0028861439786851406, 0.019042417407035828, -0.04558267816901207, 0.09221645444631577, 0.027013255283236504, -0.032549045979976654, -0.008001494221389294, 0.0046423557214438915, 0.0016138756182044744, 0.0578104704618454, -0.036578260362148285, 0.023211779072880745, 0.042289234697818756, 0.01378692127764225, -0.014128528535366058, -0.03668336942791939, -0.044952020049095154, -0.01023946050554514, -0.01773730292916298, 0.03480891138315201, 0.015547513030469418, 0.05840609222650528, 0.0646776556968689, -0.024823464453220367, 0.019462857395410538, 0.004351113922894001, -0.01662489026784897, -0.058195874094963074, 0.02089936099946499, -0.008899308741092682, -0.0414133183658123, -0.008146020583808422, -0.014522690325975418, 0.05441191419959068, 0.03493153676390648, -0.05949223041534424, 0.045968081802129745, -0.053255707025527954, -0.026119820773601532, 0.016090581193566322, -0.00177592015825212, 0.023036595433950424, -0.023737329989671707, 0.013226334936916828, -0.09831283241510391, 0.0856996402144432, 0.07848209142684937, -0.03955637663602829, -0.02100447006523609, -0.047649841755628586, -0.04351551830768585, 0.010204424150288105, 0.025629308074712753, -0.04281478375196457, 0.02473587356507778, -0.08226604759693146, 0.01660737209022045, 0.028186984360218048, 0.04919145256280899, 0.004524107091128826, -0.033022042363882065, -0.02913297340273857, 0.019830742850899696, -0.008185436949133873, 0.015451162122189999, -0.00033503794111311436, -0.027433695271611214, -0.01742197386920452, -0.0371038094162941, 0.024000104516744614, -0.04064251109957695, 0.010694936849176884, 0.017781099304556847, -0.030481884256005287, -0.04316515102982521, 0.020794250071048737, 0.029605967923998833, -0.02040884830057621, 0.008294926024973392, -0.006744554731994867, -0.023527109995484352, -0.010125591419637203, -0.004918269347399473, -0.018709570169448853, 0.06352144479751587, -0.023509591817855835, 0.024490617215633392, 0.0373140312731266, 0.027416177093982697, 0.033810365945100784, 0.057354994118213654, 0.013375240378081799, -0.0025116896722465754, 0.0037335928063839674, 0.02703077346086502, 0.01963804103434086, 0.03197094053030014, -0.01655481569468975, -0.03430087864398956, 0.02077673189342022, 0.08079451322555542, 0.04726443812251091, 0.0013719038106501102, -0.02638259530067444, -0.009284711442887783, -0.027678951621055603, 0.013462832197546959, 0.05416665971279144, 0.033337369561195374, -0.04491698369383812, -0.003558409633114934, -0.04460165277123451, 0.0011096763191744685, -0.0644674301147461, 0.07182513177394867, -0.052239641547203064, -0.008233612403273582, 0.037489213049411774, -0.005093452520668507, -0.015696417540311813, 0.03491402044892311, 0.025786973536014557, 0.046143267303705215, -0.019918333739042282, -0.023807402700185776, 0.04908634349703789, -0.039346154779195786, -0.06905723363161087, 0.03696366399526596, -0.021757759153842926, -0.03871549665927887, -0.010791287757456303, -0.010283255949616432, -0.004778122995048761, 0.014216120354831219, 0.00990661233663559, 0.07203534990549088, 0.016178172081708908, 0.07434776425361633, 0.028922753408551216, 0.02668040804564953, -0.0017157008405774832, -0.047719914466142654, -0.008303686045110226, 0.03840016573667526, -0.00313140032812953, 0.019532931968569756, 0.02349207177758217, -0.059036754071712494, 0.001590882777236402, 0.026890628039836884, 0.05290533974766731, 0.04754473268985748, -0.02468331903219223, 0.06306596845388412, 0.05080313980579376, 0.042709674686193466, -0.03148042783141136, -0.03370525687932968, -0.042779747396707535, -0.01047595776617527, -0.055147685110569, -0.06359151750802994, -0.0240876954048872, -0.003742351895198226, 0.029816187918186188, 0.03337240591645241, 0.03927608206868172, -0.0014748239191249013, -0.03389795869588852, 0.02913297340273857, 0.03643811494112015, -0.07967333495616913, 0.012972318567335606, -0.00842631421983242, 0.007410251069813967, 0.007195651531219482, 0.05402651056647301, 0.01944533921778202, -0.04022207111120224, -0.031690649688243866, 0.02102198824286461, -0.02781909890472889, 0.01949789561331272, 0.04589800909161568, 0.018166502937674522, 0.0269081462174654, 0.019708113744854927, 0.03640307858586311, 0.0001419258042005822, -0.03882060572504997, -0.056373968720436096, -0.0026365078520029783, 0.04095784202218056, 0.0536060705780983, 0.0384352020919323, -0.01237669587135315, -0.003045998513698578, 0.02468331903219223, -0.04039725661277771, -0.02752128802239895, -0.03445854410529137, 0.01746576838195324, -0.04866590350866318, -0.03286437690258026, -0.04214908927679062, 0.033932995051145554, -0.015039481222629547, -0.033337369561195374, -0.03980163112282753, 0.04081769660115242, -0.016002988442778587, 0.017684748396277428, 0.030797213315963745, -0.008505146019160748, -0.002774464664980769, -0.06264552474021912, -0.060788583010435104, 0.0012908815406262875, -0.0014474515337496996, -0.04666881635785103, 0.002364973770454526, -0.06127909943461418, -0.013979623094201088, 0.029641004279255867, 0.006183968391269445, 0.0023167983163148165, -0.07476820796728134, 0.032181162387132645, 0.015731455758213997, 0.03190086781978607, 0.0755390152335167, -0.005728492047637701, 0.03780454397201538, -0.02240593731403351, -0.011500779539346695, 0.050487808883190155, -0.02270374819636345, 0.011395669542253017, 0.032058533281087875, -0.010607345029711723, 0.02046140283346176, 0.0009427047916688025, -0.028081873431801796, -0.04288485646247864, -0.0481753908097744, 0.012350418604910374, 0.026925664395093918, 0.01902489922940731, -0.0373140312731266, -0.03160305693745613, 0.025559235364198685, -0.048490721732378006, -0.002450375584885478, 0.026417633518576622, 0.050592921674251556, -0.005277395248413086, -0.051749128848314285, 0.0012733631301671267, -0.040362220257520676, 0.0067314160987734795, 0.0065781306475400925, -0.034773875027894974, 0.10062525421380997, -0.06555356830358505, 0.01550371665507555, -0.09424858540296555, -0.03836512938141823, -0.035912565886974335, 0.032969485968351364, -0.03221619874238968, -0.025419088080525398, 0.02401762269437313, 0.003803666215389967, -0.07637989521026611, 0.0015240941429510713, -0.051398761570453644, -0.07637989521026611, 0.012122680433094501, -0.026172375306487083, -0.031024951487779617, 0.04039725661277771, 0.0029211805667728186, -0.03191838786005974, -0.014321230351924896, -0.012578156776726246, -0.019830742850899696, 0.013173779472708702, -0.03505416586995125, 0.04778998717665672, -0.009048214182257652, -0.0147854657843709, 0.0385403111577034, -0.031165098771452904, -0.046038154512643814, 0.0386454239487648, 0.050978321582078934, -0.057109735906124115, -0.027346104383468628, 0.001584313460625708, -0.046213340014219284, 0.010948952287435532, 0.007817552424967289, 0.01712416112422943, -0.03445854410529137, 0.060788583010435104, -0.016195690259337425, 0.0018438035622239113, 0.008960622362792492, 0.007970837876200676, 0.02937822975218296, -0.033144667744636536, 0.02070665918290615, 0.01171099953353405, 0.011719758622348309, 0.03563227131962776, -0.020864324644207954, 0.05854623764753342, 0.026172375306487083, -0.011667204089462757, 0.004629217088222504, 0.012569397687911987, 0.06075354665517807, -0.015127073042094707, 0.02130228281021118, -0.02161761187016964, 0.027118366211652756, -0.04796517267823219, -0.0316731296479702, -0.07070395350456238, 0.05220460519194603, 0.05724988132715225, -0.0359826385974884, -0.06292582303285599, -0.04985715076327324, 0.0017868690192699432, 0.0032408898696303368, -0.048490721732378006, -0.021775277331471443, 0.009529968723654747, -0.007602952886372805, -0.01902489922940731, 0.0030941739678382874, -0.029290637001395226, 0.0179913192987442, -0.04358559101819992, -0.0030941739678382874, 0.00441023800522089, -0.05623381957411766, 0.03011399880051613, -0.01623072661459446, -0.009162083268165588, -0.009127046912908554, 0.021600093692541122, -0.03105998784303665, -0.03626292943954468, 0.03191838786005974, 0.02058403007686138, -0.03636804223060608, -0.0003802023711614311, -0.0014266484649851918, -0.025419088080525398, 0.04533742368221283, -0.02359718270599842, -0.028677497059106827, 0.01909497380256653, 0.058371055871248245, 0.08219597488641739, -0.031147580593824387, 0.016546057537198067, -0.04761480540037155, 0.02047892101109028, 0.031024951487779617, 0.022440973669290543, 0.03640307858586311, -0.03233882784843445, -0.022686230018734932, -0.0009865006431937218, -0.079953633248806, 0.0008063903660513461, 0.020391330122947693, 0.018254093825817108, -0.00201679696328938, -0.02088184282183647, 0.030131516978144646, 0.057530175894498825, -0.02739865891635418, 0.07406747341156006, -0.010449680499732494, 0.006783971097320318, 0.04225419834256172, 0.06166449934244156, 0.009232156910002232, 0.04589800909161568, -0.030341736972332, -0.020724177360534668, 0.020496439188718796, 0.023982586339116096, 0.015459921211004257, 0.004751845262944698, 0.008461350575089455, 0.021389873698353767, -0.02992129698395729, -0.007760617416352034, 0.019462857395410538, 0.0064511229284107685, 0.05865135043859482, -0.01255187951028347, 0.015731455758213997, 0.009293470531702042, -0.03337240591645241, 0.04859583079814911, 0.008312445133924484, 0.0719652771949768, 0.004370821639895439, 0.01781613565981388, -0.007480324245989323, 0.03105998784303665, -0.016686202958226204, 0.025489160791039467, -0.043130114674568176, -0.015048240311443806, 0.06562364101409912, -0.0564790777862072, 0.01921760104596615, -0.05234475061297417, -0.012210272252559662, -0.02130228281021118, 0.018762124702334404, 0.02594463713467121, 0.015284737572073936, 0.014251156710088253, 0.043375369161367416, -0.011693481355905533, -0.01944533921778202, 0.048911161720752716, 0.024823464453220367, 0.05276519060134888, -0.022353380918502808, -0.0009760991088114679, -0.0006700758822262287, -0.0482804998755455, 0.011579612269997597, 0.005347468424588442, -0.0015405176673084497, 0.03871549665927887, 0.011369392275810242, -0.04344544559717178, -0.06842657178640366, 0.0001817526062950492, -0.024157768115401268, -0.08871279656887054, 0.039170973002910614, 0.03871549665927887, -0.031024951487779617, 0.00739273289218545, -0.03324978053569794, 0.005579586140811443, 0.023614700883626938, -0.012683266773819923, -0.04757976904511452, 0.0029627864714711905, 0.03475635498762131, -0.0011135084787383676, -0.016414670273661613, -0.0060569606721401215, 0.0064511229284107685, 0.0018865044694393873, 0.014426340349018574, -0.0013795680133625865, -0.07203534990549088, 0.00677521200850606, -0.029833706095814705, -0.03508920222520828, 0.00835186056792736, 0.027854135259985924, 0.003943812567740679, -0.025156313553452492, 0.04743961989879608, -0.018026355654001236, 0.009871575981378555, 0.02685559168457985, 0.005277395248413086, -0.009862816892564297, -0.02293148636817932, -0.0027897930704057217, 0.0064248451963067055, -0.07203534990549088, -0.03713884577155113, -0.006670102011412382, 0.03402058407664299, 0.03594760224223137, -0.008373758755624294, -0.015293496660888195, -0.005023379344493151, -0.08822228014469147, -0.032356344163417816, 0.03223371505737305, -0.0047387066297233105, -0.045722827315330505, -0.0289052352309227, 0.04701918363571167, 0.0883624255657196, 0.0024240980856120586, -0.0071255783550441265, 0.017062848433852196, -0.03773447126150131, 0.03400306776165962, -0.022493528202176094, 0.02883516065776348, 0.0053168111480772495, -0.014312470331788063, 0.025331497192382812, 0.04200894013047218, -0.06534335017204285, -0.06397692114114761, -0.023562146350741386, 0.01418108306825161, -0.04635348543524742, -0.020268701016902924, 0.024227842688560486, -0.061384208500385284, -0.029816187918186188, -0.012595674954354763, 0.00008861808601068333, 0.016116857528686523, -0.03445854410529137, -0.001942344126291573, -0.015801528468728065, 0.01785993203520775, -0.004386150278151035, -0.03948630392551422, -0.033022042363882065, -0.0036262930370867252, -0.005592724774032831, -0.04733451083302498, 0.04677392542362213, 0.011062821373343468, -0.006035062484443188, -0.035369496792554855, -0.006455502472817898, -0.01860446110367775, 0.024245360866189003, 0.022616157308220863, -0.017623433843255043, 0.013270130380988121, 0.0051022120751440525, 0.0047649843618273735, -0.028274575248360634, 0.01818402111530304, -0.06572875380516052, 0.04719436541199684, 0.0007746383780613542, 0.006950395181775093, 0.01872708834707737, 0.016248244792222977, -0.021845350041985512, -0.027906689792871475, -0.035789936780929565, 0.0028423480689525604, 0.03955637663602829, -0.03528190404176712, 0.046563707292079926, 0.025576753541827202, -0.041097987443208694, 0.029465820640325546, 0.026873109862208366, -0.05532286688685417, 0.026505224406719208, -0.017010292038321495, 0.041938867419958115, 0.036998700350522995, -0.013007355853915215, 0.04628341272473335, 0.008001494221389294, 0.017500806599855423, -0.01402341853827238, -0.0018744607223197818, 0.019830742850899696, 0.08576971292495728, -0.021827831864356995, 0.04617830365896225, -0.04022207111120224, -0.01981322467327118, -0.033565107733011246, -0.06145428121089935, -0.023684773594141006, -0.007979596965014935, -0.031165098771452904, 0.010169386863708496, -0.04376077279448509, -0.04631844907999039, -0.007835070602595806, -0.023754848167300224, 0.044706761837005615, -0.020075999200344086, 0.007414630614221096, -0.004835057538002729, 0.017956282943487167, -0.0950193926692009, 0.002048549009487033, 0.0730864480137825, 0.0008447116706520319, 0.013243853114545345, -0.0496118925511837, 0.011281800456345081, 0.01776358112692833, 0.023702291771769524, -0.008128502406179905, 0.0524848997592926, -0.026575297117233276, -0.03685855492949486, -0.08605001121759415, -0.03309211507439613, 0.01355042401701212, 0.04116806015372276, -0.03811987489461899, -0.05483235418796539, 0.013743124902248383, -0.0372089222073555, 0.011097858659923077, -0.07897260785102844, 0.013165020383894444, -0.05858127400279045, -0.014478894881904125, -0.02196797914803028, 0.020005926489830017, 0.05539293959736824, -0.014662837609648705, 0.018271612003445625, -0.006197107024490833, 0.0022664330899715424, -0.008483248762786388, 0.015433643944561481, 0.011842386797070503, -0.03678848221898079, -0.05125861614942551, 0.030779695138335228, -0.039836667478084564, 0.01236793678253889, 0.031462911516427994, -0.029097937047481537, -0.011115376837551594, -0.025454124435782433, -0.014224879443645477, -0.027346104383468628, -0.029238082468509674, -0.020373810082674026, 0.02601471170783043, 0.025979675352573395, -0.04750969633460045, 0.02172272279858589, 0.023316890001296997, 0.03345999866724014, -0.10503987222909927, -0.03678848221898079, -0.009556245990097523, 0.0014156996039673686, 0.0317782387137413, 0.050733067095279694, 0.018324166536331177, 0.01288472767919302, -0.00338760600425303, -0.0018317598151043057, 0.062049902975559235, -0.06516816467046738, 0.02613733895123005, 0.0014901524409651756, 0.06818132102489471, -0.014619041234254837, -0.060122888535261154, -0.051153507083654404, 0.061804648488759995, -0.04376077279448509, -0.07967333495616913, -0.04015199840068817, -0.03004392609000206, -0.013909549452364445, -0.025786973536014557, 0.06061340123414993, 0.004186879377812147, 0.0275738425552845, 0.014724151231348515 ]
31,881
stevedore.hook
HookManager
Coordinate execution of multiple extensions using a common name. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the hooks to load. :type name: str :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :type on_missing_entrypoints_callback: function :param warn_on_missing_entrypoint: Flag to control whether failing to load a plugin is reported via a log mess. Only applies if on_missing_entrypoints_callback is None. :type warn_on_missing_entrypoint: bool
class HookManager(NamedExtensionManager): """Coordinate execution of multiple extensions using a common name. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the hooks to load. :type name: str :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :type on_missing_entrypoints_callback: function :param warn_on_missing_entrypoint: Flag to control whether failing to load a plugin is reported via a log mess. Only applies if on_missing_entrypoints_callback is None. :type warn_on_missing_entrypoint: bool """ def __init__(self, namespace, name, invoke_on_load=False, invoke_args=(), invoke_kwds={}, on_load_failure_callback=None, verify_requirements=False, on_missing_entrypoints_callback=None, # NOTE(dhellmann): This default is different from the # base class because for hooks it is less likely to # be an error to have no entry points present. warn_on_missing_entrypoint=False): super(HookManager, self).__init__( namespace, [name], invoke_on_load=invoke_on_load, invoke_args=invoke_args, invoke_kwds=invoke_kwds, on_load_failure_callback=on_load_failure_callback, on_missing_entrypoints_callback=on_missing_entrypoints_callback, verify_requirements=verify_requirements, warn_on_missing_entrypoint=warn_on_missing_entrypoint, ) def _init_attributes(self, namespace, names, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None): super(HookManager, self)._init_attributes( namespace, names, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) self._name = names[0] def __getitem__(self, name): """Return the named extensions. Accessing a HookManager as a dictionary (``em['name']``) produces a list of the :class:`Extension` instance(s) with the specified name, in the order they would be invoked by map(). """ if name != self._name: raise KeyError(name) return self.extensions
(namespace, name, invoke_on_load=False, invoke_args=(), invoke_kwds={}, on_load_failure_callback=None, verify_requirements=False, on_missing_entrypoints_callback=None, warn_on_missing_entrypoint=False)
[ 0.014461494982242584, -0.049147337675094604, -0.029412290081381798, 0.050125934183597565, 0.021637875586748123, 0.0158025361597538, -0.019662559032440186, 0.0095322635024786, -0.0013795505510643125, 0.005114983767271042, 0.013256371021270752, -0.010057806968688965, 0.011498520150780678, -0.022036563605070114, -0.05407656729221344, -0.05099580064415932, 0.015693802386522293, 0.05259054899215698, -0.04142729192972183, -0.0075977216474711895, 0.048494938760995865, 0.047190140932798386, 0.05867960304021835, -0.02205468714237213, -0.015286054462194443, 0.02622278593480587, 0.02181909792125225, 0.03715045750141144, 0.0006359750404953957, -0.022598352283239365, -0.06904548406600952, -0.036189984530210495, -0.004707234911620617, 0.001679699053056538, -0.022815817967057228, -0.04178973287343979, 0.017143577337265015, 0.07778037339448929, -0.035483218729496, -0.00608905078843236, 0.04280457645654678, -0.005993909202516079, 0.0742284283041954, -0.022507740184664726, 0.042297154664993286, 0.00936010293662548, -0.021855343133211136, 0.018022501841187477, -0.03118826262652874, -0.030680840834975243, 0.031206384301185608, -0.03983253985643387, 0.07640308886766434, 0.02221778593957424, -0.004197548609226942, 0.08096987754106522, 0.05037964507937431, 0.025135455653071404, 0.002120294375345111, 0.020550545305013657, 0.014180601574480534, -0.0024827378802001476, 0.02361319400370121, 0.05161195248365402, -0.009274022653698921, -0.07183630019426346, 0.014461494982242584, -0.05527263134717941, -0.0615791492164135, 0.04160851240158081, -0.000464380718767643, -0.03526575118303299, 0.019771292805671692, -0.05621498450636864, 0.02760007232427597, 0.03535636141896248, 0.030753329396247864, -0.034722086042165756, 0.03655242547392845, 0.0506695993244648, -0.008132325485348701, -0.01331073697656393, -0.038056567311286926, 0.05494643375277519, 0.042949553579092026, -0.00696344580501318, 0.03332667797803879, -0.017207004129886627, 0.022036563605070114, 0.016581790521740913, -0.07582318037748337, 0.011380725540220737, 0.04885738343000412, 0.02711077407002449, -0.032293714582920074, -0.06389878690242767, 0.021293554455041885, 0.0506695993244648, -0.003039994742721319, 0.04244213178753853, -0.009885646402835846, -0.05969444289803505, 0.049944713711738586, 0.0376216359436512, 0.026440253481268883, -0.0007339480798691511, -0.024283714592456818, 0.0014769572298973799, -0.04976349323987961, -0.00399367418140173, -0.017687242478132248, -0.06107172742486, 0.0026956733781844378, -0.014823938719928265, 0.014561166986823082, -0.005409468896687031, -0.008965945802628994, -0.020804256200790405, 0.02248961851000786, 0.011000160127878189, -0.015358543023467064, 0.05701236054301262, 0.005472896620631218, -0.00429722061380744, -0.02892298996448517, -0.035048287361860275, 0.03773036599159241, 0.05092331022024155, 0.002222231589257717, -0.06995159387588501, 0.08459430932998657, 0.020695524290204048, -0.0807524099946022, -0.010356822982430458, 0.020550545305013657, -0.032873623073101044, 0.04273208603262901, 0.0063336999155581, -0.06375381350517273, 0.03202188387513161, -0.029430411756038666, -0.013501020148396492, -0.01392689161002636, 0.03421466425061226, -0.030499620363116264, -0.03414217755198479, 0.02450118027627468, 0.01700766012072563, 0.008730357512831688, -0.03452274203300476, -0.0005167651106603444, -0.04211593419313431, -0.05259054899215698, 0.023885026574134827, -0.030245909467339516, 0.0016196693759411573, -0.03943385183811188, 0.008907048963010311, 0.0014746919041499496, -0.023413849994540215, -0.00878925435245037, -0.006868304219096899, -0.05958570912480354, -0.03878145292401314, -0.035791296511888504, -0.018792694434523582, -0.0003723540576174855, -0.03414217755198479, -0.01152570266276598, 0.07546073198318481, 0.003687862539663911, 0.05099580064415932, 0.05784597992897034, 0.04758882895112038, 0.03867271915078163, 0.05690362676978111, -0.01555788703262806, -0.02540728822350502, 0.024972356855869293, 0.005205594468861818, 0.035537585616111755, -0.004315342754125595, -0.0561787411570549, -0.015440092422068119, -0.04780629649758339, 0.009296675212681293, 0.0210036002099514, 0.02915857918560505, -0.014361822977662086, 0.04501548036932945, -0.009255900979042053, 0.007271522656083107, 0.061760369688272476, 0.03519326448440552, -0.03053586371243, 0.06958915293216705, -0.05911453440785408, 0.012658338993787766, -0.008902518078684807, -0.015485398471355438, -0.05259054899215698, 0.035211384296417236, 0.025461655110120773, 0.0075977216474711895, 0.012631155550479889, 0.022598352283239365, 0.06480489671230316, 0.019590070471167564, -0.06335512548685074, -0.04454430565237999, 0.02335948310792446, -0.010719266720116138, -0.0762581080198288, 0.05153946578502655, -0.014506801031529903, -0.06389878690242767, 0.05317046120762825, 0.020550545305013657, 0.04095611348748207, 0.048494938760995865, 0.032112494111061096, 0.038636475801467896, 0.02368568256497383, 0.05190190672874451, -0.01530417613685131, 0.03153258562088013, 0.07053150236606598, 0.00222789472900331, 0.050198424607515335, 0.02328699454665184, 0.020459935069084167, -0.016907988116145134, 0.001959460088983178, -0.04030371457338333, 0.02718326263129711, -0.011127015575766563, 0.04204344376921654, -0.002480472670868039, 0.02899547852575779, 0.04110109061002731, 0.05400408059358597, 0.05034340173006058, 0.008843621239066124, 0.02279769629240036, -0.013265431858599186, -0.030082810670137405, -0.008150448091328144, -0.031623195856809616, -0.0005354536115191877, 0.012549606151878834, 0.025352923199534416, 0.05545385554432869, 0.04023122787475586, 0.022435251623392105, -0.069734126329422, -0.041898466646671295, 0.0015188647666946054, -0.03202188387513161, 0.013473836705088615, 0.004711765330284834, -0.007819718681275845, -0.0025167169515043497, -0.028198104351758957, 0.02605968713760376, -0.010837060399353504, -0.028596792370080948, 0.04863991588354111, -0.02605968713760376, -0.013328859582543373, 0.06969788670539856, 0.041318558156490326, -0.002355882665142417, -0.016654279083013535, 0.04389190673828125, -0.02743697166442871, -0.014280273579061031, 0.005173881072551012, -0.014425250701606274, -0.01110889296978712, -0.014724266715347767, 0.06755946576595306, 0.005173881072551012, -0.025769732892513275, 0.020314957946538925, 0.004988128785043955, -0.0452691912651062, -0.035863783210515976, 0.022670840844511986, -0.03936136141419411, -0.03606312721967697, 0.03372536599636078, 0.0322212278842926, 0.028560547158122063, -0.021384166553616524, -0.01857522875070572, 0.01018466241657734, -0.08691395074129105, 0.010365883819758892, 0.046139057725667953, -0.014008441008627415, -0.01025715097784996, -0.019916269928216934, 0.00039047622703947127, 0.02361319400370121, -0.0338522233068943, -0.025352923199534416, 0.0237038042396307, -0.04512421414256096, -0.04334824159741402, 0.04186222329735756, 0.04708141088485718, 0.02484550140798092, -0.0397600494325161, -0.022942673414945602, 0.019191382452845573, 0.01579347439110279, 0.046936433762311935, -0.024718645960092545, 0.008517421782016754, 0.039542585611343384, -0.023486338555812836, 0.06563851982355118, -0.0019855108112096786, 0.011788474395871162, 0.05958570912480354, -0.010293395258486271, 0.03216686099767685, 0.013410408981144428, 0.034087810665369034, -0.07154634594917297, -0.06803064048290253, -0.06531231850385666, -0.0040480406023561954, -0.014108113013207912, -0.030064687132835388, -0.002847446594387293, -0.01331073697656393, -0.018457435071468353, 0.041970957070589066, -0.031206384301185608, 0.043203264474868774, -0.005966725759208202, -0.08415938168764114, 0.013981257565319538, -0.031133895739912987, 0.003755820682272315, 0.03698735684156418, 0.054040323942899704, 0.038636475801467896, -0.01873832941055298, 0.04595783352851868, -0.06966163963079453, -0.07618562132120132, -0.02093111164867878, 0.015458215028047562, -0.09546761214733124, -0.03379785642027855, -0.04632027819752693, 0.01225059013813734, -0.01399938017129898, -0.008467585779726505, -0.025878464803099632, -0.05643245205283165, 0.01726137101650238, 0.012323078699409962, -0.06183286011219025, 0.06263023614883423, -0.03135136142373085, 0.00402991846203804, -0.08038996905088425, 0.00624761963263154, -0.010420250706374645, -0.007670210208743811, -0.025950953364372253, -0.002620919607579708, -0.029430411756038666, 0.09111829102039337, 0.013328859582543373, -0.044145617634058, 0.008621624670922756, 0.03907140716910362, 0.0368061363697052, -0.028216226026415825, 0.014398067258298397, 0.012640216387808323, -0.022743329405784607, -0.005037964321672916, 0.0005289409891702235, 0.03251118212938309, -0.0031147487461566925, 0.06306517124176025, -0.011090771295130253, -0.05349665880203247, 0.041644755750894547, -0.031315118074417114, -0.028143737465143204, -0.023758171126246452, 0.009713485836982727, -0.03483081981539726, -0.015204504132270813, 0.05741104856133461, -0.017786914482712746, 0.09358291327953339, -0.0001693290687398985, 0.0408836267888546, -0.009831279516220093, 0.011743169277906418, 0.06904548406600952, -0.040593672543764114, 0.08785630017518997, -0.04472552612423897, 0.04432683810591698, -0.06531231850385666, -0.08198472112417221, -0.038237787783145905, 0.003626700257882476, 0.026530863717198372, 0.022525863721966743, -0.04664647579193115, -0.02598719857633114, 0.00500625092536211, -0.014434312470257282, -0.012105613015592098, 0.024464935064315796, 0.02256210707128048, 0.015811597928404808, -0.05023466795682907, 0.006261211354285479, -0.05563507601618767, 0.01953570358455181, -0.030481496825814247, -0.019318237900733948, -0.003055851673707366, -0.05360539257526398, 0.012658338993787766, -0.049147337675094604, -0.007035934366285801, -0.02190971001982689, -0.031206384301185608, 0.010284334421157837, -0.04574036970734596, 0.03647993877530098, 0.039868783205747604, -0.008200284093618393, -0.004838620778173208, 0.008861743845045567, -0.04309453070163727, 0.045559145510196686, -0.014787694439291954, -0.03109765239059925, -0.011652558110654354, 0.05204688385128975, 0.071365125477314, -0.019445093348622322, 0.013863463886082172, -0.04697267711162567, -0.04570412263274193, -0.021076088771224022, -0.011190442368388176, 0.002462350530549884, -0.04566787928342819, -0.04769756272435188, 0.013337920419871807, -0.036606792360544205, -0.022580228745937347, -0.03352602198719978, 0.06016562134027481, -0.017207004129886627, -0.019173260778188705, 0.026730207726359367, 0.06317389756441116, 0.008096081204712391, 0.06571100652217865, -0.0190645270049572, -0.0009451846708543599, 0.017071088775992393, 0.013446653261780739, -0.06114421784877777, 0.013510080985724926, -0.041173581033945084, 0.0044988300651311874, -0.006773162633180618, 0.04410937428474426, 0.0014056011568754911, -0.0017023517284542322, -0.02036932483315468, 0.056396208703517914, -0.034975796937942505, 0.0038305746857076883, 0.019100772216916084, -0.05480145663022995, 0.04983597993850708, 0.035301994532346725, 0.007334950380027294, -0.002663959749042988, -0.021184822544455528, 0.058752089738845825, 0.008309016935527325, 0.06002064049243927, -0.027563827112317085, 0.011253870092332363, -0.020496180281043053, 0.027890026569366455, -0.02566099911928177, 0.04374692961573601, -0.03365287929773331, -0.011815657839179039, 0.022852061316370964, -0.013790975324809551, 0.015340420417487621, -0.03452274203300476, -0.03232995793223381, 0.027328239753842354, -0.007774413097649813, 0.011407908983528614, -0.02785378322005272, 0.018031563609838486, 0.06266648322343826, 0.003980082459747791, 0.007914859801530838, 0.026331519708037376, 0.005572568625211716, 0.0327286459505558, -0.02857866883277893, 0.008431341499090195, -0.04186222329735756, -0.001427121227607131, -0.0009565110085532069, -0.009011250920593739, 0.03470396250486374, 0.040267471224069595, 0.03662491589784622, -0.05353290215134621, -0.045885346829891205, -0.012603972107172012, -0.0022007115185260773, -0.05070584639906883, 0.04280457645654678, -0.0035451503936201334, 0.011906269006431103, 0.03722294792532921, 0.03809281066060066, 0.023903148248791695, 0.012830499559640884, -0.018937671557068825, -0.03443213179707527, -0.061361681669950485, 0.022670840844511986, 0.009885646402835846, -0.034232787787914276, 0.030499620363116264, -0.023015161976218224, -0.013781913556158543, -0.0005278083262965083, -0.02874176949262619, -0.11547449976205826, 0.040666159242391586, -0.016155919060111046, -0.030843941494822502, 0.03095267340540886, -0.03885394334793091, 0.06023810803890228, -0.032601792365312576, -0.029575388878583908, -0.0005057219532318413, -0.0018620534101501107, 0.05132199823856354, -0.0026911429595202208, -0.049944713711738586, 0.028143737465143204, 0.016790194436907768, 0.05041588842868805, -0.05527263134717941, -0.05867960304021835, -0.03452274203300476, 0.06679833680391312, 0.05389534682035446, -0.029919710010290146, 0.004292690195143223, -0.029357923194766045, 0.009731607511639595, 0.004627950489521027, -0.010302456095814705, 0.005735668353736401, -0.014398067258298397, 0.014724266715347767, 0.015666620805859566, 0.06451494246721268, -0.012957355007529259, 0.03176817297935486, -0.06266648322343826, 0.03990503028035164, 0.02955726720392704, -0.02948477864265442, 0.038563989102840424, 0.007547885645180941, -0.029702244326472282, 0.04407312721014023, 0.04762507602572441, -0.04371068626642227, -0.01792282983660698, -0.030264031141996384, -0.020260591059923172, -0.01693517155945301, -0.006850182078778744, -0.030880184844136238, -0.008467585779726505, -0.010284334421157837, -0.06839308887720108, 0.04697267711162567, -0.04081113636493683, -0.039868783205747604, 0.036208104342222214, -0.014878305606544018, 0.006900018081068993, -0.04429059475660324, -0.018847061321139336, -0.008222936652600765, 0.07353978604078293, -0.009486958384513855, -0.01612873561680317, 0.001449774019420147, -0.00675957091152668, 0.0253347996622324, -0.005993909202516079, -0.06465991586446762, -0.006034684367477894, 0.025751609355211258, 0.05458398908376694, 0.015920329838991165, 0.009867523796856403, 0.04603032395243645, 0.03990503028035164, -0.10670336335897446, 0.0702415481209755, -0.0302821546792984, 0.016889866441488266, -0.04429059475660324, 0.02687518484890461, 0.001320653478614986, 0.04120982438325882, -0.04168100282549858, 0.01082799956202507, -0.003298235824331641, -0.013890646398067474, 0.02810749225318432, -0.010583349503576756, 0.020061247050762177, 0.11931639909744263, 0.0008404158288612962, 0.014144357293844223, -0.0035745990462601185, -0.032946113497018814, 0.05164819583296776, -0.00923777837306261, 0.02580597624182701, -0.021039845421910286, -0.011154198087751865, 0.034867063164711, -0.024211226031184196, -0.038563989102840424, -0.011897207237780094, -0.0397600494325161, 0.051829420030117035, -0.006329169496893883, -0.05389534682035446, 0.0032212166115641594, -0.03020966425538063, 0.03597251698374748, 0.016065306961536407, -0.01124480925500393, 0.006990628782659769, 0.015249810181558132, -0.027074528858065605, -0.023504460230469704, -0.04160851240158081, -0.0184030681848526, 0.035682562738657, 0.028361203148961067, 0.033018603920936584, -0.03281925991177559, 0.013981257565319538, -0.05675864964723587, 0.03950634226202965, -0.03899892047047615, 0.036769893020391464, 0.03932511806488037, 0.014823938719928265, 0.020478056743741035, -0.011933451518416405, 0.018384946510195732, 0.050198424607515335, 0.05371412634849548, 0.0174335315823555, -0.03849149867892265, -0.022109052166342735, -0.04323950782418251, -0.11206752806901932, -0.01669052243232727, -0.06194159388542175, 0.035229507833719254, -0.0007401775801554322, -0.038563989102840424, -0.024446813389658928, -0.005278083495795727, 0.029539145529270172, -0.059730686247348785, -0.0094054089859128, 0.02930355630815029, 0.011009220965206623, -0.026095932349562645, 0.005491018760949373, 0.0785052627325058, -0.04186222329735756, 0.0452691912651062, -0.0555625855922699, -0.0010697746183723211, -0.0319131501019001, 0.019245749339461327, 0.04211593419313431, -0.0269657950848341, 0.005916890222579241, 0.05389534682035446, -0.0036584138870239258, 0.010556166991591454, 0.019354483112692833, 0.004426341038197279, -0.04795127362012863, 0.02450118027627468, 0.019281994551420212, -0.0381290540099144, -0.025769732892513275, -0.05070584639906883, 0.04958226904273033, 0.0583171583712101, -0.06929919868707657, 0.034867063164711, -0.010909548960626125, -0.011163259856402874, -0.04570412263274193, -0.018919549882411957, -0.0302821546792984, -0.0073168277740478516, 0.03736792504787445, 0.06603720784187317, 0.003101157024502754, 0.0027002040296792984, 0.029122333973646164, -0.002246017102152109, 0.02816185913980007, -0.005364163778722286, 0.0022154359612613916, -0.043601952493190765, -0.0037603513337671757, 0.001969653880223632, -0.022362763062119484, 0.021474776789546013, 0.01306608784943819, -0.03184065967798233, -0.06875552982091904, -0.033598512411117554, -0.038056567311286926, -0.013800036162137985, -0.07009657472372055, 0.061361681669950485, -0.01004874613136053, -0.021782854571938515, 0.020695524290204048 ]
31,883
stevedore.hook
__getitem__
Return the named extensions. Accessing a HookManager as a dictionary (``em['name']``) produces a list of the :class:`Extension` instance(s) with the specified name, in the order they would be invoked by map().
def __getitem__(self, name): """Return the named extensions. Accessing a HookManager as a dictionary (``em['name']``) produces a list of the :class:`Extension` instance(s) with the specified name, in the order they would be invoked by map(). """ if name != self._name: raise KeyError(name) return self.extensions
(self, name)
[ 0.052981097251176834, -0.07439173012971878, -0.03465590998530388, 0.017370572313666344, 0.013245274312794209, 0.01656937785446644, -0.03463886305689812, -0.018035391345620155, 0.05216285586357117, 0.014651625417172909, 0.012205426581203938, -0.03852550685405731, 0.020115088671445847, -0.00997231062501669, -0.049878597259521484, -0.02314939722418785, 0.010986587963998318, 0.04704884812235832, -0.031809113919734955, -0.006908169016242027, 0.009827413596212864, 0.02988283708691597, 0.0726870596408844, -0.03399108722805977, -0.02427447959780693, 0.059527020901441574, 0.044560033828020096, 0.032098907977342606, 0.04749206453561783, -0.0457192063331604, -0.08223320543766022, -0.06054982170462608, 0.023677844554185867, -0.00997231062501669, -0.07561909407377243, -0.014574915170669556, -0.018529746681451797, 0.04115069657564163, -0.029729418456554413, 0.027121275663375854, 0.05922018364071846, 0.016134686768054962, 0.052333321422338486, -0.021785663440823555, 0.009401246905326843, -0.00017619346908759326, -0.037536799907684326, 0.02857024408876896, 0.04667382314801216, -0.0029618614353239536, 0.0018122756155207753, -0.01367144100368023, 0.018717259168624878, -0.03279782086610794, -0.04449184611439705, 0.05414026975631714, 0.028058843687176704, 0.03399108722805977, 0.022143643349409103, 0.0713915154337883, 0.006507571786642075, -0.03746861219406128, 0.041184790432453156, 0.0049520619213581085, 0.017592178657650948, -0.060379356145858765, 0.014643101952970028, -0.03549119830131531, -0.06494786590337753, 0.00862562283873558, 0.01593012735247612, -0.03174092620611191, -0.0014958465471863747, -0.020916281268000603, -0.04319629818201065, 0.012640116736292839, 0.012427032925188541, 0.005233332049101591, 0.032371655106544495, 0.030752219259738922, -0.007274672854691744, 0.00681867403909564, -0.03954830765724182, 0.08080128580331802, 0.01334755402058363, -0.003055618144571781, 0.03429792821407318, -0.040502920746803284, -0.021990222856402397, 0.039411935955286026, -0.04677610099315643, 0.03034309856593609, 0.03158750757575035, 0.014191364869475365, -0.047457970678806305, -0.07445991784334183, 0.014191364869475365, 0.03278077393770218, -0.013219703920185566, 0.06153853237628937, 0.003669298952445388, -0.003462607739493251, 0.024206291884183884, 0.03675265237689018, 0.001646070508286357, -0.02098446898162365, -0.01892182044684887, -0.014591962099075317, -0.008220763877034187, 0.022348202764987946, 0.011097392067313194, 0.0077434564009308815, 0.0006243348470889032, 0.001317921793088317, 0.031417038291692734, 0.01798425242304802, 0.006908169016242027, -0.008497771807014942, 0.017072254791855812, 0.0006834655068814754, -0.005919461138546467, 0.051856014877557755, -0.008676762692630291, 0.029098691418766975, 0.018410420045256615, -0.01062860805541277, 0.02471769228577614, 0.014268075115978718, 0.014856185764074326, -0.0532197505235672, 0.04316220432519913, 0.007666746154427528, -0.048037558794021606, -0.0004259007691871375, 0.05240150913596153, -0.0260302871465683, 0.05966339632868767, -0.038082294166088104, -0.04725341126322746, 0.027325835078954697, -0.05536762997508049, 0.0033198418095707893, -0.020456021651625633, 0.03261030837893486, -0.03801410645246506, -0.061231691390275955, 0.03907100111246109, 0.0337524339556694, 0.004457707982510328, -0.04476459324359894, -0.022331155836582184, 0.010534850880503654, -0.035457104444503784, -0.0030918424017727375, -0.045480553060770035, 0.030428331345319748, -0.05966339632868767, 0.010125730186700821, -0.01714044064283371, -0.022723229601979256, -0.0025932269636541605, 0.03961649537086487, -0.09593874216079712, -0.01789901964366436, -0.03688902407884598, -0.025552980601787567, -0.002407844178378582, -0.00903474260121584, -0.010568944737315178, 0.07582364976406097, -0.0030726648401468992, 0.01835927926003933, 0.02248457632958889, 0.022092502564191818, 0.026763293892145157, 0.06948228925466537, -0.03515026345849037, 0.027325835078954697, 0.0240869652479887, 0.0061453296802937984, -0.004555726423859596, 0.011642885394394398, -0.08434699475765228, 0.007879829965531826, -0.04002561420202255, 0.015163025818765163, 0.017072254791855812, 0.04715112969279289, -0.00583422789350152, 0.06211811676621437, -0.0024035824462771416, -0.02277437038719654, 0.053731150925159454, -0.019620733335614204, -0.05816328898072243, 0.06845948845148087, -0.04507143422961235, 0.005114005412906408, -0.05001497268676758, 0.0057063777931034565, -0.03532072901725769, -0.023268723860383034, -0.006243348121643066, 0.035082075744867325, -0.017200104892253876, 0.016910310834646225, 0.10091637074947357, -0.01563180983066559, -0.06211811676621437, -0.04251443222165108, -0.027786096557974815, 0.014574915170669556, -0.031434085220098495, 0.024871112778782845, 0.03168978542089462, -0.02846796251833439, 0.012810583226382732, -0.010125730186700821, 0.053628869354724884, 0.045855581760406494, -0.003202645806595683, -0.0001768593501765281, 0.013040713965892792, 0.023490332067012787, 0.002883020555600524, 0.01806948520243168, 0.015384633094072342, -0.018393373116850853, 0.017114872112870216, 0.002028555376455188, 0.057856447994709015, -0.000011969303159276024, 0.026661014184355736, -0.04449184611439705, 0.04261671006679535, 0.054856229573488235, -0.0033368885051459074, -0.009281919337809086, 0.03736633434891701, 0.05240150913596153, 0.07043690234422684, 0.051856014877557755, 0.011361614800989628, 0.07616458833217621, -0.005373967345803976, 0.011745166033506393, 0.04360542073845863, -0.017677411437034607, -0.009128499776124954, -0.003513747826218605, 0.0506286546587944, 0.0200469009578228, 0.04288945719599724, 0.011259335093200207, -0.03903690725564957, -0.03521845117211342, -0.027018994092941284, -0.004406568128615618, 0.014881755225360394, -0.02444494515657425, -0.03832094743847847, -0.004632436670362949, -0.0057191625237464905, 0.0240869652479887, -0.048378489911556244, 0.01602388359606266, 0.07084602117538452, 0.040332455188035965, -0.02744516171514988, 0.07289162278175354, 0.02903050370514393, 0.025808680802583694, -0.014080561697483063, 0.006494786590337753, 0.017089301720261574, -0.01194120291620493, 0.05795872583985329, 0.04036654904484749, -0.032473932951688766, -0.011370138265192509, 0.03876416012644768, 0.006068619899451733, -0.02700194902718067, 0.04813983663916588, -0.022211829200387, -0.054208457469940186, -0.000290592695819214, 0.04329857975244522, -0.026490548625588417, -0.01985938660800457, 0.042855363339185715, 0.024768833070993423, 0.013202656991779804, -0.02471769228577614, 0.012580453418195248, -0.01975710690021515, -0.05997023731470108, 0.02500748634338379, 0.060754384845495224, 0.03354787454009056, 0.0357639454305172, -0.008480725809931755, -0.01603240706026554, 0.006004694849252701, -0.052708350121974945, -0.007155345752835274, 0.038457319140434265, 0.02023441530764103, -0.03525254502892494, 0.024871112778782845, 0.00800341833382845, -0.00038701301673427224, -0.020575348287820816, 0.03429792821407318, -0.005096958484500647, -0.035832129418849945, 0.009580236859619617, 0.022791417315602303, 0.009929693304002285, 0.06805036216974258, -0.032848961651325226, 0.060856662690639496, -0.0020189667120575905, -0.011122961528599262, 0.056833647191524506, 0.000876838865224272, 0.027905423194169998, -0.00217771390452981, 0.030701078474521637, -0.06600476056337357, -0.054958511143922806, -0.0699595957994461, 0.009622853249311447, -0.01856383867561817, -0.059254273772239685, -0.001991265919059515, 0.01363734807819128, 0.03429792821407318, -0.001506500761024654, -0.04861714318394661, -0.0019880696199834347, -0.048037558794021606, -0.07193700969219208, 0.029729418456554413, 0.01863202638924122, -0.010432571172714233, 0.03158750757575035, 0.042480338364839554, -0.0008826986304484308, -0.008352875709533691, 0.03148522600531578, -0.07350530475378036, -0.008361399173736572, -0.013091853819787502, 0.022348202764987946, -0.06399325281381607, -0.0074025229550898075, -0.04350313916802406, -0.016552330926060677, 0.04251443222165108, 0.015197119675576687, 0.01921161264181137, -0.049503572285175323, 0.0016535284230485559, -0.018495652824640274, -0.08175589889287949, 0.04299173876643181, -0.010585990734398365, 0.06549336016178131, -0.10698499530553818, -0.01096101850271225, 0.032098907977342606, -0.036854930222034454, 0.004947800189256668, -0.02183680236339569, -0.06501605361700058, 0.07302799820899963, 0.03702539950609207, -0.027939515188336372, 0.03365015611052513, 0.04179846867918968, 0.023967638611793518, -0.007180915679782629, 0.04824211820960045, 0.02715536765754223, -0.02727469615638256, -0.019160473719239235, -0.02567230723798275, 0.034707050770521164, 0.011216718703508377, 0.01428512204438448, -0.040707483887672424, -0.09355220198631287, 0.057856447994709015, -0.08052853494882584, -0.03961649537086487, -0.00908588245511055, -0.04190075024962425, -0.07411898672580719, -0.0036969997454434633, 0.07923299074172974, 0.010577468201518059, 0.01808653213083744, 0.004717669915407896, 0.02717241458594799, -0.026303034275770187, 0.0005111341597512364, 0.062254492193460464, -0.03346263989806175, 0.02202431671321392, -0.014412972144782543, 0.02521204575896263, -0.07350530475378036, -0.08775633573532104, -0.004700623452663422, -0.04224168509244919, -0.00041231667273677886, 0.005114005412906408, -0.04619651660323143, 0.032831914722919464, -0.010551897808909416, -0.039684683084487915, -0.029575997963547707, 0.001318987226113677, -0.008118483237922192, 0.007010449189692736, -0.021342448890209198, 0.014566391706466675, -0.054856229573488235, 0.019058194011449814, -0.052333321422338486, -0.03221823275089264, 0.03138294443488121, -0.045003246515989304, 0.037229958921670914, -0.06099303811788559, -0.0260302871465683, -0.0676412433385849, -0.06982322037220001, 0.012111669406294823, 0.013552114367485046, 0.05659499391913414, 0.04507143422961235, -0.002022163011133671, 0.02417219802737236, -0.023967638611793518, -0.053628869354724884, 0.033411502838134766, 0.02323463186621666, -0.0889836922287941, -0.024615412577986717, 0.033701296895742416, 0.11100801080465317, 0.0025037317536771297, 0.0777328833937645, -0.02108674868941307, -0.048958078026771545, -0.025876866653561592, 0.008923939429223537, -0.011148531921207905, -0.05922018364071846, 0.0024845541920512915, 0.0015789491590112448, -0.052128762006759644, -0.002039209706708789, -0.019603686407208443, 0.03371834382414818, 0.00862562283873558, 0.01685917191207409, -0.006541665177792311, 0.03825275972485542, 0.01647561974823475, -0.009256349876523018, -0.10303016006946564, -0.016603469848632812, 0.010500757955014706, -0.007781811524182558, 0.0200469009578228, 0.04104841500520706, -0.042684897780418396, -0.0030087397899478674, -0.08346056938171387, 0.04132116213440895, -0.001154912868514657, -0.001383977709338069, -0.021206075325608253, 0.035354822874069214, -0.02079695463180542, -0.00014742718485649675, -0.019705967977643013, -0.012162809260189533, 0.031621601432561874, -0.004768809769302607, 0.032746680080890656, 0.03257621452212334, -0.011651408858597279, 0.011199671775102615, 0.004709146451205015, 0.05676545947790146, 0.010807598009705544, 0.020745815709233284, -0.018972959369421005, 0.0483103021979332, -0.019705967977643013, 0.0241551510989666, -0.037332240492105484, 0.009878553450107574, 0.013100377283990383, -0.003449822776019573, -0.04360542073845863, -0.04554874077439308, -0.0023780125193297863, -0.00006019610373186879, -0.0017824439564719796, 0.01574261300265789, -0.0481739304959774, -0.010995111428201199, 0.052606068551540375, 0.02323463186621666, 0.07132332772016525, 0.05301518738269806, -0.023013023659586906, 0.018972959369421005, -0.05328793451189995, 0.012631593272089958, -0.05546991154551506, -0.049128543585538864, -0.009213732555508614, -0.028536150231957436, 0.08700627833604813, 0.04121888428926468, 0.01170254871249199, -0.026814434677362442, -0.0016940142959356308, -0.044423658400774, -0.01100363489240408, -0.05161736160516739, 0.004157260060310364, -0.04261671006679535, 0.07596002519130707, 0.03102496638894081, 0.009102929383516312, 0.03308761492371559, -0.04626470059156418, -0.0063626752234995365, -0.01063713151961565, -0.07248250395059586, -0.02952485717833042, 0.031996626406908035, -0.01975710690021515, 0.04142344370484352, -0.04360542073845863, -0.04766253009438515, -0.04350313916802406, 0.03204776719212532, -0.07732376456260681, 0.002226723125204444, -0.05182192102074623, -0.05021953210234642, 0.022620949894189835, -0.014523775316774845, 0.03215004876255989, -0.028877083212137222, 0.010125730186700821, -0.02971237152814865, 0.013944188132882118, 0.0017398272175341845, 0.03262735530734062, -0.016075024381279945, 0.005037295166403055, 0.027530396357178688, 0.00908588245511055, 0.000348125264281407, -0.003211169270798564, 0.0036224203649908304, 0.07589183747768402, 0.049708131700754166, -0.004219054244458675, -0.01232475321739912, -0.03961649537086487, 0.004615389741957188, 0.011046251282095909, -0.020728768780827522, 0.006788841914385557, 0.021240169182419777, 0.010151300579309464, 0.023353958502411842, 0.03017263114452362, -0.021291308104991913, 0.039207372814416885, -0.03419565036892891, 0.029200971126556396, 0.01921161264181137, -0.0066482070833444595, 0.04241215065121651, -0.013194133527576923, -0.04329857975244522, 0.02700194902718067, -0.05103777348995209, -0.006153853144496679, 0.016987022012472153, -0.016731319949030876, 0.03832094743847847, -0.0382186658680439, 0.006724916864186525, -0.031536366790533066, 0.007939493283629417, -0.0022991716396063566, -0.018478605896234512, 0.004811426624655724, -0.05516307055950165, -0.03419565036892891, 0.01199234277009964, 0.0022416389547288418, 0.012213949114084244, -0.0300703514367342, 0.019433220848441124, 0.019842341542243958, 0.05465167015790939, 0.02417219802737236, -0.03484342247247696, 0.030854498967528343, -0.014540822245180607, 0.03474114462733269, -0.014438541606068611, -0.12962299585342407, 0.03474114462733269, 0.004888136871159077, 0.03271258622407913, 0.0026166660245507956, -0.005288734100759029, 0.044423658400774, 0.05799281969666481, -0.08209683001041412, 0.03412746265530586, 0.0011730249971151352, 0.0024973393883556128, -0.07998304069042206, -0.02146177552640438, 0.03665037080645561, -0.01372258085757494, -0.015896033495664597, 0.007313027512282133, -0.01593012735247612, -0.01996166817843914, 0.07364168018102646, -0.022552764043211937, 0.014361831359565258, 0.09348402172327042, 0.005152360536158085, 0.0019539762288331985, -0.018768399953842163, -0.03579803928732872, 0.0693800076842308, -0.015145978890359402, 0.024768833070993423, 0.01574261300265789, 0.010500757955014706, -0.018717259168624878, -0.04244624450802803, -0.053185656666755676, -0.005535910837352276, -0.0683572068810463, 0.0188195388764143, 0.01722567528486252, -0.05441301688551903, -0.055401723831892014, 0.012486696243286133, 0.04824211820960045, 0.0363435298204422, 0.014191364869475365, 0.022433437407016754, -0.017166011035442352, -0.0300703514367342, -0.02464950643479824, 0.0006738767260685563, -0.00250586261972785, 0.013219703920185566, 0.07111876457929611, 0.029831698164343834, -0.049708131700754166, -0.004998940043151379, 0.00871511735022068, 0.0976434126496315, -0.011958248913288116, 0.06181127950549126, 0.03787773475050926, 0.004589819815009832, 0.026064381003379822, 0.01837632618844509, -0.0002612937241792679, 0.018308138474822044, 0.034434303641319275, 0.03354787454009056, 0.004534418229013681, 0.015981266275048256, 0.006111236289143562, -0.09293852746486664, -0.018325185403227806, -0.03383766859769821, 0.02323463186621666, 0.0009871096117421985, -0.006102713290601969, -0.05171963945031166, 0.010279150679707527, -0.013142993673682213, -0.009162592701613903, -0.007977847941219807, -0.018478605896234512, 0.02717241458594799, -0.02988283708691597, 0.009835937060415745, 0.07132332772016525, -0.022211829200387, 0.05789054185152054, -0.048105742782354355, -0.005365443881601095, -0.014208411797881126, 0.016236966475844383, 0.07070964574813843, -0.004841258283704519, 0.0011080345138907433, 0.05414026975631714, 0.048958078026771545, 0.011583222076296806, 0.005633929278701544, -0.014566391706466675, -0.03890053555369377, -0.047457970678806305, 0.04012789577245712, -0.03484342247247696, -0.05519716441631317, -0.045310087502002716, 0.015878986567258835, 0.027786096557974815, -0.06522061675786972, 0.013407217338681221, 0.019416173920035362, -0.0025676568038761616, -0.015708519145846367, 0.01363734807819128, -0.014549345709383488, -0.01771150529384613, 0.028058843687176704, 0.032746680080890656, -0.03832094743847847, 0.0178819727152586, 0.014310691505670547, -0.037980012595653534, 0.01948435977101326, 0.028536150231957436, 0.02454722486436367, -0.01806948520243168, 0.0020498638041317463, 0.03569575771689415, -0.018700212240219116, 0.015350539237260818, -0.04159390926361084, -0.005071388557553291, -0.006290226709097624, -0.04704884812235832, 0.0036181588657200336, -0.01694440469145775, -0.0036181588657200336, -0.023388050496578217, -0.03852550685405731, -0.024666553363204002, -0.0175239909440279 ]
31,884
stevedore.hook
__init__
null
def __init__(self, namespace, name, invoke_on_load=False, invoke_args=(), invoke_kwds={}, on_load_failure_callback=None, verify_requirements=False, on_missing_entrypoints_callback=None, # NOTE(dhellmann): This default is different from the # base class because for hooks it is less likely to # be an error to have no entry points present. warn_on_missing_entrypoint=False): super(HookManager, self).__init__( namespace, [name], invoke_on_load=invoke_on_load, invoke_args=invoke_args, invoke_kwds=invoke_kwds, on_load_failure_callback=on_load_failure_callback, on_missing_entrypoints_callback=on_missing_entrypoints_callback, verify_requirements=verify_requirements, warn_on_missing_entrypoint=warn_on_missing_entrypoint, )
(self, namespace, name, invoke_on_load=False, invoke_args=(), invoke_kwds={}, on_load_failure_callback=None, verify_requirements=False, on_missing_entrypoints_callback=None, warn_on_missing_entrypoint=False)
[ -0.015060080215334892, -0.04795658215880394, 0.009926976636052132, 0.02562088333070278, 0.005628560204058886, 0.015595708973705769, 0.002825438976287842, 0.021817924454808235, -0.02099662646651268, 0.015515364706516266, 0.014952954836189747, 0.02197861298918724, -0.0013111733132973313, -0.024263959378004074, -0.03583353012800217, -0.025335215032100677, -0.0030240677297115326, 0.037958186119794846, -0.0667392760515213, -0.04467139393091202, 0.03863665089011192, 0.05824064463376999, 0.045242730528116226, 0.00011870302841998637, 0.02297845110297203, 0.026049386709928513, 0.01795247383415699, 0.032673321664333344, 0.01408702228218317, 0.0012576105073094368, -0.056098129600286484, 0.011899873614311218, 0.02329982817173004, 0.033887412399053574, 0.006119552534073591, -0.06234712898731232, 0.03599421679973602, 0.04345730319619179, -0.0479922890663147, -0.006833723746240139, 0.05770501494407654, 0.004731382708996534, 0.03713688999414444, 0.0076505565084517, 0.046885326504707336, 0.012953275814652443, 0.01818457804620266, 0.03229838237166405, -0.035512153059244156, -0.01944330520927906, -0.04206467047333717, -0.021407274529337883, 0.07327394187450409, 0.027816960588097572, -0.00019542060908861458, 0.08670035749673843, 0.0561695471405983, -0.005106322467327118, -0.009293150156736374, 0.03792247921228409, 0.005878519732505083, 0.003611027030274272, 0.03863665089011192, 0.013578175567090511, 0.023032015189528465, -0.04031495377421379, 0.023371245712041855, -0.025049546733498573, -0.028584694489836693, 0.035851381719112396, 0.04074345529079437, -0.0010171356843784451, 0.011399954557418823, -0.03924369439482689, 0.06370405107736588, 0.04002928361296654, 0.030745061114430428, -0.028245462104678154, 0.021835777908563614, 0.06281133741140366, 0.005900837946683168, -0.024281812831759453, -0.03495866805315018, 0.04274313524365425, 0.03026299551129341, -0.014328055083751678, 0.04013640806078911, -0.044278599321842194, 0.030477246269583702, 0.04013640806078911, -0.0709528848528862, 0.007846953347325325, 0.02265707403421402, -0.011792748235166073, -0.028031211346387863, -0.07420236617326736, 0.03963648900389671, 0.03567283973097801, 0.0035775501746684313, 0.04252888262271881, -0.019532576203346252, -0.07066722214221954, 0.027442019432783127, 0.014765485189855099, 0.03660126402974129, -0.002783035160973668, -0.022674929350614548, -0.02167508937418461, -0.03081647865474224, 0.010587585158646107, 0.007521113380789757, -0.03444089740514755, 0.015515364706516266, 0.025156673043966293, -0.028227608650922775, -0.0065078833140432835, -0.028156191110610962, -0.027245623990893364, -0.006280241068452597, 0.036958348006010056, -0.025031693279743195, 0.015310040675103664, 0.03613705188035965, -0.00966808944940567, -0.006356121972203255, -0.01641700603067875, 0.012765806168317795, 0.011908801272511482, 0.03313753381371498, -0.056098129600286484, 0.08662894368171692, 0.017657877877354622, -0.058562021702528, -0.017622169107198715, -0.01331036165356636, -0.03444089740514755, 0.058562021702528, 0.03294113650918007, -0.06548947840929031, 0.04410005733370781, -0.009918049909174442, -0.015934940427541733, 0.003622185904532671, -0.005293792579323053, -0.026317201554775238, -0.016443787142634392, -0.0023232875391840935, 0.004691210575401783, 0.008025496266782284, -0.023906873539090157, 0.03161992132663727, -0.06606081873178482, -0.02342480793595314, 0.02785266935825348, -0.028995342552661896, 0.0027986576315015554, -0.0055794608779251575, -0.031191417947411537, -0.0008240863680839539, -0.010801835916936398, 0.00235006888397038, 0.031227126717567444, -0.03161992132663727, -0.07813030481338501, -0.03561927750706673, -0.01735435426235199, 0.020407436415553093, -0.053669948130846024, -0.020621687173843384, 0.07777322083711624, -0.011087504215538502, 0.009489546529948711, 0.029691658914089203, 0.06309700757265091, 0.03792247921228409, 0.02762056328356266, -0.008788766339421272, -0.025281652808189392, 0.010310843586921692, 0.028441859409213066, 0.019407596439123154, 0.009061044082045555, -0.02938813529908657, -0.03367316350340843, -0.06224000081419945, 0.04042207822203636, 0.013899552635848522, 0.06720349192619324, -0.023174848407506943, 0.05824064463376999, -0.0033811533357948065, 0.0064766379073262215, 0.06827474385499954, 0.002161483047530055, -0.010650075040757656, 0.04781374707818031, -0.061168745160102844, 0.02076452225446701, -0.02485314942896366, -0.00876198522746563, 0.0021670626010745764, 0.051991648972034454, 0.01988966204226017, 0.004878680687397718, 0.0016660270048305392, 0.05131318420171738, 0.04820654168725014, 0.04163616895675659, -0.03810102120041847, -0.03935082256793976, 0.03594065457582474, -0.014551233500242233, -0.06502526998519897, 0.07159563899040222, -0.03208412975072861, -0.04331447184085846, 0.04752808064222336, 0.0034949742257595062, 0.0016191594768315554, 0.05866914615035057, 0.07505936920642853, 0.08591476827859879, 0.011980217881500721, 0.009810923598706722, -0.04142191633582115, 0.07663054764270782, 0.0659179836511612, -0.031102146953344345, 0.03367316350340843, 0.01705976016819477, -0.01656876690685749, 0.0016771858790889382, -0.016327735036611557, -0.009703798219561577, -0.012765806168317795, -0.033762432634830475, 0.06124016270041466, 0.0019204503623768687, -0.03731543570756912, 0.02199646644294262, 0.08762878179550171, 0.035958509892225266, 0.02099662646651268, 0.008462926372885704, -0.013658519834280014, 0.009516328573226929, -0.04106483235955238, -0.030745061114430428, -0.007329179905354977, 0.015720689669251442, 0.00869056861847639, 0.02772768773138523, 0.018836259841918945, 0.019157636910676956, -0.04684961587190628, -0.028656110167503357, 0.005289328750222921, -0.04709957540035248, 0.018006036058068275, 0.028548985719680786, 0.03469085693359375, 0.023728331550955772, 0.011301755905151367, 0.06777482479810715, -0.005423235706984997, -0.0218893401324749, 0.051098935306072235, -0.04609973728656769, 0.001686113071627915, 0.06309700757265091, 0.09541324526071548, -0.028584694489836693, 0.030316557735204697, 0.052098773419857025, -0.050206221640110016, -0.06598939746618271, -0.025156673043966293, -0.009873413480818272, -0.02087164670228958, 0.009186024777591228, 0.10191220045089722, -0.003983735106885433, 0.01221232395619154, 0.010382261127233505, -0.009056581184267998, -0.03742256015539169, -0.03581567481160164, 0.05045618116855621, -0.04838508367538452, -0.05024192854762077, 0.031030729413032532, 0.03604777902364731, -0.013060402125120163, 0.0075032589957118034, -0.009516328573226929, -0.01716688461601734, -0.0802014023065567, 0.04495706409215927, 0.035958509892225266, -0.02244282327592373, -0.010409042239189148, -0.06884608417749405, -0.006436466239392757, -0.010301916860044003, -0.0011571801733225584, -0.023335536941885948, 0.01816672459244728, -0.00825313851237297, -0.03899373486638069, 0.038493815809488297, 0.059954654425382614, 0.027977649122476578, -0.07034584134817123, -0.0299416184425354, 0.0006410800269804895, 0.023692622780799866, 0.051991648972034454, -0.07684479653835297, 0.026245784014463425, 0.02365691401064396, -0.027763396501541138, 0.012024854309856892, 0.0035775501746684313, -0.002827670658007264, 0.04388580843806267, -0.011132140643894672, 0.036529846489429474, 0.005039369221776724, 0.008592369966208935, -0.04320734366774559, -0.03613705188035965, -0.045921195298433304, 0.02076452225446701, -0.038386691361665726, -0.04649253189563751, -0.03949365392327309, -0.02133585885167122, -0.03156635910272598, 0.004601939115673304, -0.04199325293302536, 0.02619222179055214, 0.010507240891456604, -0.058847688138484955, 0.027763396501541138, -0.013453195802867413, 0.035190775990486145, 0.03356603533029556, -0.017149031162261963, 0.08470068126916885, -0.03315538913011551, 0.03251263499259949, -0.06306129693984985, -0.06777482479810715, -0.009293150156736374, 0.02619222179055214, -0.0875573605298996, -0.020693104714155197, -0.060383155941963196, 0.01865771785378456, -0.051206059753894806, -0.03920798748731613, -0.010132300667464733, -0.05534825101494789, 0.023014159873127937, -0.007311325520277023, -0.027763396501541138, 0.05095610022544861, -0.03028084896504879, 0.0049009984359145164, -0.03433376923203468, 0.02938813529908657, -0.07420236617326736, -0.0344051867723465, -0.010873253457248211, 0.02672784961760044, -0.022389261052012444, 0.0812726616859436, -0.0026312738191336393, -0.024995984509587288, -0.007422914728522301, -0.011524934321641922, 0.05424128472805023, -0.05249156802892685, -0.027584854513406754, 0.01795247383415699, -0.012239105068147182, -0.04563552513718605, 0.027334894984960556, 0.061382997781038284, -0.017425771802663803, 0.06163295730948448, -0.0007867039530538023, -0.019389742985367775, -0.01011444628238678, -0.03322680667042732, 0.014265565201640129, 0.016327735036611557, -0.01490831933915615, 0.010542948730289936, -0.012997912243008614, 0.05977611243724823, 0.007271153386682272, 0.06391829997301102, -0.025692300871014595, 0.031887736171483994, 0.03513721376657486, -0.021728651598095894, 0.03810102120041847, -0.02740631252527237, 0.0802014023065567, 0.008329018950462341, 0.0503847636282444, -0.06423968076705933, -0.09005696326494217, -0.05802639201283455, -0.013685301877558231, 0.023728331550955772, 0.0005225164932198822, -0.04120766744017601, -0.06588227301836014, -0.005307183135300875, 0.0369226410984993, -0.002662518760189414, 0.026763558387756348, 0.03863665089011192, 0.0291560310870409, -0.015229696407914162, -0.009873413480818272, -0.013899552635848522, 0.001652636332437396, -0.014372691512107849, 0.027691980823874474, -0.004976878874003887, -0.03290542960166931, 0.0205681249499321, -0.018622009083628654, -0.03647628426551819, -0.022175008431077003, -0.036279886960983276, 0.010980378836393356, -0.05909764766693115, -0.01490831933915615, 0.06113303825259209, 0.03885090351104736, 0.01215876080095768, 0.017157958820462227, -0.034530166536569595, 0.016666965559124947, 0.008275456726551056, -0.020585978403687477, -0.0157563965767622, 0.03229838237166405, 0.0422075055539608, -0.023281974717974663, -0.014613723382353783, -0.06770341098308563, -0.08870003372430801, 0.012373012490570545, 0.013953115791082382, 0.010971452109515667, -0.08105840533971786, -0.04192183539271355, -0.01177489385008812, -0.06323984265327454, -0.01182845700532198, -0.021407274529337883, 0.02208573743700981, 0.003111107274889946, 0.004695674404501915, -0.00889142882078886, 0.04467139393091202, 0.002591101685538888, 0.05481262505054474, 0.0043385885655879974, 0.0007772188982926309, 0.021389421075582504, -0.010364406742155552, -0.07195273041725159, -0.003278491087257862, -0.017488261684775352, 0.0125961909070611, 0.03945794701576233, 0.029905909672379494, 0.0014919477980583906, -0.019407596439123154, -0.04145762696862221, -0.0030820942483842373, -0.03654770180583, 0.03147708624601364, 0.03945794701576233, -0.03483368828892708, 0.058490604162216187, 0.04456426948308945, -0.0012040477013215423, -0.010810763575136662, -0.03115570917725563, 0.05206306651234627, 0.02399614453315735, 0.0366726815700531, 0.028156191110610962, -0.023692622780799866, 0.02429966814815998, -0.013122892007231712, -0.010730419307947159, 0.02210359275341034, -0.03517292067408562, -0.03203056752681732, -0.004793872591108084, 0.009141388349235058, 0.0076014576479792595, -0.028370441868901253, -0.05045618116855621, 0.011623132973909378, -0.006972094066441059, -0.008565587922930717, -0.033530328422784805, -0.011132140643894672, 0.04720670357346535, -0.0664893165230751, -0.003860986791551113, 0.043814390897750854, 0.026120804250240326, 0.037529684603214264, -0.046885326504707336, 0.00770411966368556, -0.048563625663518906, 0.01807745359838009, 0.027977649122476578, 0.002103456761687994, 0.01976468227803707, 0.028566839173436165, 0.002092297887429595, -0.05681230127811432, -0.05702655389904976, -0.027549145743250847, 0.04410005733370781, -0.06348980218172073, 0.0474923700094223, 0.010846471413969994, -0.010194790549576283, 0.030405830591917038, 0.040064990520477295, 0.007507722359150648, 0.022799909114837646, -0.027799105271697044, -0.04285025969147682, -0.051456019282341, 0.03835098072886467, 0.0065078833140432835, -0.021282294765114784, 0.025835135951638222, -0.0406363308429718, 0.0026647504419088364, 0.022157154977321625, 0.0004882028151769191, -0.07820172607898712, 0.0625256672501564, -0.04417147487401962, -0.010542948730289936, 0.03070935234427452, -0.03713688999414444, 0.054312702268362045, -0.046242572367191315, 0.014292347244918346, -0.00485636293888092, -0.0020443145185709, 0.030762914568185806, -0.0029392598662525415, -0.03781535476446152, 0.03613705188035965, 0.02974522113800049, 0.015854595229029655, -0.047349534928798676, -0.023674767464399338, -0.019818244501948357, 0.060811661183834076, 0.043707262724637985, -0.022175008431077003, -0.010659001767635345, -0.04410005733370781, -0.012337303720414639, -0.006851578131318092, -0.05174168944358826, -0.016979414969682693, -0.04742095246911049, -0.02608509548008442, -0.014729776419699192, 0.05502687394618988, 0.009248514659702778, 0.03217340260744095, -0.05477691441774368, -0.002932564588263631, 0.0035351463593542576, -0.015827814117074013, -0.010659001767635345, -0.004597475752234459, 0.013238945044577122, 0.006440929602831602, 0.05245585739612579, -0.040279243141412735, -0.029888056218624115, 0.011453516781330109, -0.03404810279607773, 0.0039502582512795925, -0.03515506535768509, -0.002289810683578253, -0.044457145035266876, 0.027156351134181023, -0.040279243141412735, 0.06859612464904785, -0.012078416533768177, -0.04288596659898758, 0.03117356449365616, 0.033191096037626266, 0.023942582309246063, -0.021514400839805603, 0.001684997114352882, 0.017470408231019974, 0.07670196145772934, -0.02153225615620613, -0.003481583669781685, -0.03831527382135391, 0.014569087885320187, 0.024728169664740562, -0.014845829457044601, -0.051206059753894806, 0.01304254774004221, -0.015622490085661411, 0.03636915609240532, 0.00486528966575861, 0.012381939217448235, 0.03433376923203468, -0.005423235706984997, -0.11033941805362701, 0.0672391951084137, 0.023371245712041855, 0.03594065457582474, -0.029084613546729088, 0.028566839173436165, -0.020264601334929466, 0.020282456651329994, -0.03670838847756386, 0.039279405027627945, -0.030995020642876625, -0.010757200419902802, 0.01414058543741703, -0.02440679259598255, 0.03885090351104736, 0.1234801635146141, 0.0024504992179572582, 0.01663125678896904, -0.024388939142227173, -0.02962024137377739, 0.06891749799251556, -0.013292507268488407, 0.007855881005525589, 0.0011197978165000677, 0.012756879441440105, 0.021264441311359406, -0.04849221184849739, -0.09098538011312485, -0.0017887750873342156, -0.031030729413032532, 0.03501223400235176, 0.03713688999414444, -0.04331447184085846, 0.016640184447169304, -0.020246747881174088, -0.01535467617213726, 0.03174490109086037, -0.026709994301199913, 0.04110053926706314, 0.02951311692595482, 0.010123373940587044, -0.008619151078164577, -0.03336963802576065, -0.0325840525329113, -0.01010551955550909, 0.04559981822967529, 0.04188612848520279, -0.08041565120220184, 0.009311004541814327, -0.05741934850811958, 0.022817762568593025, -0.02542448788881302, 0.04652823880314827, 0.022674929350614548, 0.029691658914089203, -0.007989787496626377, -0.009159242734313011, -0.009703798219561577, 0.03710118308663368, 0.04274313524365425, 0.008619151078164577, -0.035744257271289825, 0.004628720693290234, -0.0714528039097786, -0.10469746589660645, 0.007418450899422169, -0.026834974065423012, 0.055312544107437134, 0.0049947332590818405, -0.03688693046569824, -0.026120804250240326, -0.029013196006417274, -0.009748433716595173, -0.05495545640587807, -0.007097074296325445, -0.005842811428010464, 0.04395722597837448, 0.008467390201985836, -0.0036891396157443523, 0.054741207510232925, -0.03285186365246773, 0.01822921447455883, -0.02917388454079628, -0.02331768348813057, -0.016550913453102112, -0.020443145185709, -0.011640987358987331, -0.02199646644294262, -0.006177579052746296, 0.01387277152389288, -0.05345569923520088, 0.05009909346699715, -0.016916925087571144, -0.021692942827939987, -0.040279243141412735, 0.020175330340862274, 0.01298898458480835, -0.00649002892896533, -0.034423042088747025, -0.03345891088247299, 0.03810102120041847, 0.03902944549918175, -0.07113143056631088, 0.03763681277632713, -0.025388779118657112, 0.023335536941885948, -0.022139299660921097, -0.021246585994958878, -0.01890767738223076, -0.001793238683603704, 0.03156635910272598, 0.08791445195674896, -0.008913747034966946, -0.017595387995243073, 0.005780321545898914, 0.012024854309856892, 0.04274313524365425, -0.05124176666140556, 0.031762756407260895, -0.026049386709928513, 0.028263317421078682, -0.01547965593636036, -0.0398150309920311, 0.020157476887106895, 0.002163714962080121, -0.008860183879733086, -0.06627506762742996, -0.028906071558594704, -0.06573943793773651, -0.013685301877558231, -0.07205985486507416, 0.08798586577177048, 0.009127997793257236, 0.006048135459423065, 0.00029180580168031156 ]
31,887
stevedore.hook
_init_attributes
null
def _init_attributes(self, namespace, names, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None): super(HookManager, self)._init_attributes( namespace, names, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) self._name = names[0]
(self, namespace, names, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None)
[ -0.02447650581598282, 0.01982526108622551, -0.0010251968633383512, 0.016809912398457527, -0.0036011766642332077, 0.0030219817999750376, 0.013060620985925198, 0.06136811524629593, 0.043612040579319, 0.01876414194703102, -0.015810690820217133, 0.029145434498786926, 0.04134831577539444, -0.00029180804267525673, -0.0369623526930809, 0.01679222658276558, 0.0085287531837821, 0.07350026071071625, -0.0995330736041069, -0.05981180816888809, 0.012600801885128021, 0.01876414194703102, -0.012167511507868767, -0.005769840907305479, 0.010124854743480682, 0.017402371391654015, -0.03289472684264183, 0.017685336992144585, 0.05843235179781914, -0.017481954768300056, -0.027730606496334076, -0.025767534971237183, 0.01640314981341362, 0.029428400099277496, 0.004607030190527439, -0.06582482159137726, -0.02978210709989071, 0.025254659354686737, -0.043470557779073715, -0.012706913985311985, 0.07802770286798477, 0.010230966843664646, -0.008652551099658012, -0.006985707674175501, 0.006954758428037167, 0.024529561400413513, 0.010018742643296719, 0.03515844792127609, 0.017322786152362823, -0.010460876859724522, -0.006671793293207884, -0.008360742591321468, 0.07187320291996002, 0.05634548142552376, -0.016456205397844315, 0.04891764000058174, 0.03584817796945572, 0.033053893595933914, -0.02378677763044834, 0.016084812581539154, 0.0016237349482253194, -0.013688450679183006, 0.01933007314801216, -0.05146433040499687, -0.025466883555054665, -0.06299516558647156, 0.03287703916430473, -0.012981036677956581, -0.03639642149209976, 0.04085312783718109, 0.03558289632201195, -0.029074693098664284, -0.004801568575203419, 0.001251237583346665, -0.009894945658743382, 0.06504666805267334, 0.003919512499123812, -0.00414721155539155, 0.03724531829357147, 0.018339693546295166, -0.04966042563319206, 0.01934775710105896, -0.04785652086138725, 0.02315010502934456, -0.020497305318713188, -0.0038134006317704916, -0.00009070643136510625, -0.02426428161561489, 0.04760892689228058, -0.005721206311136484, -0.09436895698308945, 0.06281831115484238, 0.008440326899290085, 0.02919849008321762, -0.011468940414488316, -0.008192731998860836, 0.0331776924431324, 0.014325122348964214, 0.044142600148916245, 0.04431945085525513, -0.010602358728647232, -0.11014427244663239, 0.04997875913977623, 0.004717563278973103, -0.0062119741924107075, -0.03188665956258774, -0.025396142154932022, -0.06964485347270966, -0.007529532071202993, 0.004445651546120644, -0.02426428161561489, -0.053232863545417786, 0.07958400994539261, 0.04304610937833786, 0.010186753235757351, -0.03501696512103081, 0.020055171102285385, -0.028933210298419, 0.033230748027563095, 0.0064905183389782906, 0.01715477555990219, 0.005398449022322893, 0.016279352828860283, 0.015518882311880589, -0.018887938931584358, 0.01971914991736412, 0.0022449323441833258, 0.0180125143378973, 0.07852289080619812, -0.04141905903816223, 0.07576397806406021, -0.031320732086896896, -0.040711645036935806, -0.01084995362907648, 0.025343086570501328, -0.040074970573186874, 0.05206562951207161, 0.052949897944927216, -0.026386521756649017, 0.04435482248663902, 0.012883767485618591, -0.016933709383010864, 0.007304043974727392, -0.02343307062983513, -0.018251266330480576, 0.004615872632712126, 0.006061648949980736, 0.019082477316260338, -0.026156611740589142, -0.057866420596838, 0.02852644771337509, -0.023362329229712486, -0.04502686485648155, 0.028314223513007164, -0.0156426802277565, -0.004032256547361612, -0.07219154387712479, -0.02258417382836342, -0.010372449643909931, -0.007671014405786991, 0.015801848843693733, -0.02000211551785469, -0.04057016223669052, -0.07456137984991074, -0.007887659594416618, -0.003468536539003253, 0.017941772937774658, -0.05928124859929085, 0.011902231723070145, 0.04771503806114197, -0.0026063765399158, -0.018905624747276306, 0.08849742263555527, 0.031055450439453125, 0.014077527448534966, 0.019400814548134804, 0.020904067903757095, -0.057689566165208817, 0.008913409896194935, 0.052207112312316895, 0.0331953763961792, -0.022619545459747314, -0.042161840945482254, 0.01736699976027012, -0.014572717249393463, 0.01450197584927082, -0.00034956171293742955, 0.044142600148916245, 0.04000423103570938, 0.07364173978567123, 0.041489798575639725, 0.041489798575639725, 0.009275958873331547, 0.026103556156158447, 0.05033246800303459, 0.06564796715974808, -0.010885324329137802, -0.015819532796740532, -0.022142041474580765, 0.002327832393348217, 0.00627829460427165, 0.030012015253305435, -0.05761882662773132, 0.002179717645049095, 0.04152517020702362, 0.040145713835954666, 0.031922031193971634, 0.02834959328174591, -0.019506925716996193, -0.0360073447227478, -0.017048664391040802, -0.01726088859140873, -0.028844783082604408, 0.03876625746488571, -0.028703300282359123, -0.05132284760475159, -0.0013451909180730581, -0.015023693442344666, 0.06794705986976624, 0.03354908153414726, 0.05556732788681984, 0.049837276339530945, 0.018958680331707, -0.049837276339530945, -0.03291241079568863, 0.041772764176130295, 0.046229470521211624, -0.034946225583553314, 0.004226795397698879, 0.0995330736041069, 0.008236945606768131, 0.0029180804267525673, -0.034380294382572174, -0.03802347183227539, 0.013768034055829048, -0.03054257668554783, 0.03422112390398979, -0.00018265636754222214, -0.05577955022454262, -0.009753462858498096, 0.030277295038104057, 0.0530913807451725, -0.024016685783863068, -0.005946694407612085, 0.00011889243614859879, -0.04032256826758385, -0.03537067398428917, -0.005256966222077608, -0.01679222658276558, 0.01119481772184372, 0.028420334681868553, 0.05517824739217758, 0.016084812581539154, 0.06310127675533295, -0.0474320724606514, -0.04686614125967026, 0.03347834199666977, -0.020833326503634453, 0.014351650141179562, -0.023061677813529968, 0.011787276715040207, -0.00590248079970479, -0.03338991478085518, 0.04658317565917969, 0.008519911207258701, 0.007175825070589781, 0.06667371839284897, -0.03593660145998001, -0.0654003769159317, 0.018074413761496544, 0.053232863545417786, -0.02428196743130684, 0.00041588174644857645, 0.014280908741056919, -0.0013219788670539856, -0.04088849574327469, 0.024706413969397545, -0.04601724445819855, -0.06338424235582352, 0.009311329573392868, 0.10696091502904892, 0.00216976972296834, -0.0038929847069084644, 0.05549658462405205, 0.0014789362903684378, -0.039862748235464096, -0.01781797595322132, 0.013467383570969105, -0.02865024469792843, -0.04842245206236839, 0.028703300282359123, 0.04937746003270149, 0.002840707078576088, 0.011079862713813782, 0.0040764701552689075, -0.04297536611557007, -0.03830643743276596, 0.06465759128332138, -0.0008754241280257702, -0.020992493256926537, -0.008475697599351406, -0.04920060560107231, 0.06433925032615662, -0.015660366043448448, 0.024335023015737534, -0.03261176124215126, 0.020037485286593437, -0.004096365999430418, -0.04322296008467674, 0.04417797178030014, 0.033036209642887115, 0.04431945085525513, -0.07746177166700363, 0.015430456027388573, 0.027536068111658096, 0.024211226031184196, 0.05348045751452446, -0.026156611740589142, 0.03738680109381676, 0.05089839920401573, -0.017570381984114647, -0.01803020015358925, -0.06278294324874878, -0.03301852196455002, 0.05967032536864281, 0.031126191839575768, 0.050686173141002655, -0.001272238907404244, 0.02284945361316204, -0.027447642758488655, -0.07183783501386642, -0.051818035542964935, 0.008661393076181412, -0.013370114378631115, -0.012026028707623482, 0.02398131601512432, -0.052949897944927216, -0.009470497258007526, 0.03450408950448036, -0.07449063658714294, -0.030082756653428078, -0.04492075368762016, -0.08552628755569458, 0.016341250389814377, -0.03858940303325653, -0.005592987406998873, 0.02872098609805107, 0.012300151400268078, 0.04039330780506134, -0.02230120822787285, -0.039792004972696304, -0.045380573719739914, -0.014616930857300758, 0.07378322631120682, 0.04258628934621811, -0.03639642149209976, -0.047467444092035294, -0.01869340054690838, 0.015571938827633858, 0.020461933687329292, -0.005539931356906891, -0.03643179312348366, -0.015342028811573982, -0.026474948972463608, 0.021275458857417107, -0.0369623526930809, 0.035034652799367905, -0.013944887556135654, -0.0018602763302624226, -0.07689584046602249, 0.02265491522848606, -0.042515549808740616, -0.019418498501181602, -0.007427841424942017, -0.007485318463295698, -0.00723330257460475, 0.0730758085846901, -0.004432387184351683, -0.01715477555990219, -0.029729049652814865, -0.03609577193856239, 0.010796898044645786, 0.002730173757299781, 0.0241758543998003, 0.005482454318553209, -0.02721773274242878, 0.0350700207054615, -0.015492354519665241, 0.0559210330247879, -0.02626272477209568, 0.033513713628053665, -0.012264780700206757, 0.0010185647988691926, 0.019896002486348152, -0.03195740282535553, 0.0066850571893155575, -0.015377399511635303, -0.022407321259379387, -0.004012360703200102, -0.032682500779628754, -0.006609894335269928, -0.07084745913743973, 0.006574523635208607, -0.009523553773760796, 0.026793284341692924, 0.025396142154932022, -0.004991685971617699, 0.05719437822699547, -0.0017033189069479704, 0.054011017084121704, -0.03176286444067955, 0.05111062154173851, -0.03337223082780838, -0.10108938068151474, 0.0016270509222522378, 0.004198056645691395, 0.027465326711535454, 0.00900625716894865, -0.0014513029018417, -0.015669208019971848, -0.02380446344614029, 0.013714978471398354, 0.01507674902677536, 0.010027585551142693, 0.03862477466464043, 0.0125565892085433, -0.013396642170846462, -0.003130304627120495, 0.014572717249393463, 0.025661423802375793, -0.0616510808467865, 0.08644592016935349, -0.03545909747481346, -0.023167790845036507, 0.07134264707565308, 0.005159697029739618, -0.026386521756649017, -0.040747012943029404, -0.05800790339708328, -0.004889995325356722, -0.02551994100213051, -0.0020570256747305393, 0.020461933687329292, 0.02106323465704918, -0.03402658551931381, 0.02597975917160511, -0.06950337439775467, 0.06037773936986923, 0.03232879564166069, -0.034468721598386765, -0.04343518614768982, 0.01084995362907648, 0.030206553637981415, -0.05945809930562973, -0.03809421509504318, 0.011557367630302906, -0.05705289542675018, -0.007768284063786268, 0.01563383638858795, -0.01535971462726593, -0.09069040417671204, -0.02447650581598282, -0.010867639444768429, -0.033053893595933914, -0.006247344892472029, 0.034097328782081604, -0.001853644265793264, -0.02654569037258625, -0.006477254442870617, -0.0011937601957470179, 0.043010737746953964, -0.006017435807734728, 0.06494055688381195, -0.026598745957016945, -0.03234647959470749, -0.01631472259759903, -0.008121990598738194, -0.026616431772708893, -0.015766477212309837, -0.034380294382572174, 0.04697225242853165, 0.019294701516628265, 0.053621940314769745, -0.015138647519052029, 0.016562316566705704, -0.013255159370601177, -0.017473112791776657, -0.026793284341692924, 0.03282398357987404, 0.03436260670423508, -0.039792004972696304, -0.008192731998860836, 0.02095712348818779, 0.04608798772096634, 0.011433569714426994, -0.01408637035638094, 0.061014410108327866, 0.0026063765399158, 0.027712922543287277, -0.01418363954871893, -0.0483870804309845, -0.016447363421320915, 0.030860912054777145, 0.004445651546120644, 0.018940994516015053, 0.003552541835233569, -0.06497592478990555, -0.03837718069553375, -0.009700407274067402, -0.0050580063834786415, -0.0033977951388806105, -0.029145434498786926, 0.03586586192250252, -0.010169068351387978, -0.0032916832715272903, -0.027925146743655205, -0.023256218060851097, 0.043965745717287064, -0.024989379569888115, 0.015103276818990707, 0.040994610637426376, -0.009497025981545448, -0.0028009151574224234, -0.0218237042427063, -0.004295325838029385, -0.03273555636405945, 0.026439577341079712, 0.014952952042222023, 0.010036428458988667, 0.010213281959295273, 0.025732165202498436, -0.0035702271852642298, -0.020320450887084007, -0.022265838459134102, 0.003351371269673109, 0.030224239453673363, 0.008369585499167442, 0.027642181143164635, -0.008838246576488018, -0.0004355013952590525, 0.07120116055011749, 0.033319175243377686, 0.021275458857417107, -0.005066848825663328, 0.010867639444768429, -0.07449063658714294, -0.08793149143457413, 0.009700407274067402, -0.0050977980718016624, -0.005075691733509302, 0.007865553721785545, -0.05280841514468193, -0.0701754167675972, -0.05302063748240471, -0.017570381984114647, -0.11177132278680801, 0.031126191839575768, -0.030489519238471985, -0.008334214799106121, 0.04198498651385307, 0.0012224988313391805, 0.052879154682159424, -0.035423729568719864, -0.003954883199185133, -0.004049941897392273, -0.013723821379244328, -0.026528004556894302, 0.00966503657400608, -0.041772764176130295, 0.04817485436797142, 0.024246595799922943, -0.009779990650713444, -0.007304043974727392, 0.010664258152246475, -0.012742284685373306, 0.031285360455513, 0.04856393486261368, 0.0175438541918993, -0.005637201014906168, -0.0165888462215662, 0.04371815174818039, 0.012777655385434628, -0.047644294798374176, -0.009771148674190044, -0.027359215542674065, -0.013078305870294571, 0.009505867958068848, 0.07795695960521698, 0.028844783082604408, -0.010973751544952393, -0.0891340970993042, -0.03397352993488312, 0.0004125657433178276, -0.03742217272520065, -0.006839803885668516, -0.004136158153414726, 0.04219721257686615, -0.03496390953660011, -0.03139147162437439, -0.015952173620462418, 0.0057079424150288105, 0.02997664548456669, -0.017234360799193382, 0.057866420596838, -0.043965745717287064, -0.0473967008292675, -0.018940994516015053, 0.04591113328933716, -0.02495400980114937, 0.05560269579291344, -0.015067906118929386, -0.018711086362600327, 0.06483444571495056, 0.004467757884413004, 0.022354265674948692, -0.039579782634973526, 0.013679607771337032, -0.01943618431687355, 0.08184773474931717, -0.04393037408590317, -0.05195951834321022, -0.06893744319677353, -0.013007564470171928, 0.03943829983472824, -0.02739458531141281, -0.05659307539463043, 0.017605751752853394, -0.02428196743130684, 0.040994610637426376, 0.010593516752123833, 0.015987543389201164, 0.00694591598585248, -0.007644486613571644, -0.14112898707389832, 0.05910439416766167, 0.049271345138549805, 0.04817485436797142, -0.016190925613045692, -0.01185801811516285, -0.021929817274212837, 0.020497305318713188, -0.06267683207988739, 0.04523909091949463, 0.019029421731829643, -0.0388723686337471, 0.03837718069553375, -0.011539681814610958, 0.010354764759540558, 0.10123086720705032, 0.00021761254174634814, 0.013856461271643639, -0.031320732086896896, -0.021010179072618484, 0.018958680331707, 0.0014048789162188768, 0.012919138185679913, -0.060271624475717545, -0.009072577580809593, 0.011751906014978886, -0.027359215542674065, -0.070140041410923, 0.016084812581539154, -0.0062119741924107075, 0.05818475782871246, 0.02265491522848606, -0.02230120822787285, 0.0006184341036714613, -0.018728770315647125, -0.006229659542441368, 0.0045849233865737915, -0.04230332374572754, 0.04134831577539444, 0.06777020543813705, -0.011911073699593544, -0.019400814548134804, 0.01698676496744156, 0.015518882311880589, 0.004465547390282154, 0.11495468765497208, 0.051252104341983795, -0.06264146417379379, 0.007993771694600582, -0.01507674902677536, -0.019188590347766876, 0.017039822414517403, 0.035140763968229294, 0.006645265035331249, 0.03461020439863205, 0.039792004972696304, 0.022814083844423294, 0.0218237042427063, -0.01887025311589241, 0.0379527322947979, 0.052773043513298035, -0.0512167327105999, -0.03496390953660011, -0.013078305870294571, -0.09217597544193268, 0.025343086570501328, 0.018905624747276306, 0.03848329186439514, -0.003448640462011099, -0.04049941897392273, -0.04782114923000336, -0.016482733190059662, -0.03480474278330803, -0.05047395080327988, 0.034946225583553314, 0.010973751544952393, 0.04630021005868912, 0.009355543181300163, -0.039402928203344345, 0.04297536611557007, -0.03453946113586426, 0.008882460184395313, 0.0065391529351472855, -0.004956315271556377, -0.017481954768300056, -0.009965687058866024, 0.039862748235464096, -0.021947503089904785, 0.03756365552544594, 0.0012700281804427505, -0.016624215990304947, 0.026315780356526375, -0.011044492945075035, -0.02758912369608879, -0.02484789676964283, -0.007547217421233654, 0.015704577788710594, 0.008219259791076183, -0.02295556664466858, -0.08382849395275116, 0.05348045751452446, 0.003251891117542982, -0.0663907527923584, 0.0502263568341732, 0.040711645036935806, -0.003822243306785822, 0.026032814756035805, -0.044142600148916245, -0.004567238036543131, -0.00016428019443992525, 0.07930104434490204, -0.005230438429862261, 0.006618737243115902, -0.027536068111658096, -0.012406263500452042, 0.0043572247959673405, 0.044708531349897385, -0.0077948118560016155, 0.0426924005150795, -0.017658809199929237, -0.002929133828729391, -0.0068132756277918816, -0.04997875913977623, 0.01535971462726593, 0.013078305870294571, 0.030701743438839912, -0.05273767188191414, 0.008860353380441666, -0.056274741888046265, -0.03280629962682724, -0.013538124971091747, 0.0891340970993042, 0.004903259687125683, 0.023061677813529968, 0.020178968086838722 ]
31,888
stevedore.named
_init_plugins
null
def _init_plugins(self, extensions): super(NamedExtensionManager, self)._init_plugins(extensions) if self._name_order: self.extensions = [self[n] for n in self._names if n not in self._missing_names]
(self, extensions)
[ 0.012483938597142696, -0.023366034030914307, 0.011204204522073269, -0.00012684441753663123, -0.0056369248777627945, 0.04976164177060127, 0.023087451234459877, 0.028032274916768074, 0.029460005462169647, 0.0320194736123085, 0.03778263181447983, 0.01788145676255226, 0.014686474576592445, -0.022199472412467003, -0.05275639519095421, -0.0703766793012619, 0.03642454743385315, 0.08301731944084167, -0.030504686757922173, -0.03903624787926674, -0.04084702953696251, -0.0030535156838595867, 0.012362059205770493, -0.0024593533016741276, -0.003880554810166359, 0.04049880430102348, 0.02298298291862011, 0.013406740501523018, -0.016497254371643066, -0.031915005296468735, -0.05693511664867401, 0.020545395091176033, 0.015966208651661873, 0.020719507709145546, -0.030818091705441475, -0.009315072558820248, 0.01259711291640997, 0.08148512244224548, -0.019483301788568497, 0.0262911394238472, 0.0960410088300705, -0.010890800505876541, 0.04843837767839432, -0.04432930052280426, 0.008052749559283257, 0.053801074624061584, -0.02855461649596691, 0.059337884187698364, 0.02895507588982582, 0.035118695348501205, 0.0004605846479535103, -0.020110109820961952, 0.03287263214588165, 0.024271422997117043, -0.06605866551399231, 0.09597136825323105, 0.06417824327945709, 0.05940752848982811, 0.03921036422252655, -0.002668289467692375, -0.019640004262328148, -0.045791853219270706, -0.0070211272686719894, -0.010969150811433792, -0.03722546994686127, -0.06069596856832504, 0.04697582498192787, -0.05004022270441055, -0.0694364681839943, 0.035240575671195984, 0.004718475975096226, -0.04819462075829506, 0.0009434775565750897, -0.03128819912672043, 0.011831013485789299, 0.06832214444875717, -0.025821033865213394, -0.000848259252961725, -0.011717839166522026, 0.02075432986021042, -0.012858282774686813, 0.00855332612991333, -0.041891708970069885, 0.059477176517248154, 0.0360414981842041, -0.0010343430330976844, 0.01967482641339302, -0.013284861110150814, 0.0451650433242321, 0.019048018380999565, -0.06490951776504517, -0.02740546688437462, 0.052442990243434906, -0.010481633245944977, -0.007060302887111902, -0.012988868169486523, 0.0011175910476595163, 0.000013075517017568927, 0.011474080383777618, 0.03687724098563194, -0.014425304718315601, -0.07897789031267166, 0.026378197595477104, -0.008966845460236073, 0.005201641004532576, -0.032315466552972794, -0.004509539809077978, -0.029703764244914055, -0.029564473778009415, 0.0218860674649477, -0.048682138323783875, -0.014555889181792736, 0.047289229929447174, -0.0131455697119236, 0.04558291658759117, -0.05690029636025429, -0.0012449115747585893, 0.011343494988977909, 0.04248369485139847, -0.007264886051416397, -0.039941638708114624, 0.0839923545718193, -0.034021779894828796, 0.035118695348501205, -0.02397543005645275, -0.02202535979449749, 0.06968022882938385, 0.005967740435153246, 0.016157733276486397, -0.07765462249517441, 0.06055667996406555, 0.013737555593252182, -0.05885036662220955, -0.06445682048797607, -0.005610807798802853, -0.03226323425769806, 0.013032396323978901, -0.02589067816734314, -0.024271422997117043, -0.0024092956446111202, -0.04885625094175339, 0.010882094502449036, -0.019500713795423508, 0.009384717792272568, 0.007573937531560659, 0.033725786954164505, 0.05230369791388512, 0.025838445872068405, -0.06250675022602081, -0.05334838107228279, -0.04095149785280228, 0.01190936379134655, -0.03642454743385315, -0.03252440318465233, -0.010263991542160511, 0.01939624547958374, -0.013267449103295803, 0.0033734492026269436, -0.02672642469406128, -0.00008188775973394513, 0.051607243716716766, 0.03334273770451546, -0.09485703706741333, 0.014669063501060009, -0.03318603336811066, -0.02103291265666485, -0.00598515197634697, -0.04607043415307999, -0.03896660357713699, 0.042588163167238235, 0.03349943831562996, 0.03941929712891579, 0.03973270207643509, -0.0016736661782488227, 0.03005199134349823, 0.056447599083185196, -0.004204841330647469, -0.009480481036007404, -0.006085267290472984, 0.05721370130777359, 0.0054323417134583, 0.0013461150228977203, -0.043841782957315445, 0.04805532842874527, 0.013833318836987019, 0.019361421465873718, 0.039245184510946274, 0.011439257301390171, -0.008636030368506908, 0.019065428525209427, 0.03158419206738472, 0.013728850521147251, 0.01802074909210205, 0.021711954846978188, 0.02437589131295681, 0.07114277780056, 0.007991810329258442, -0.004561773966997862, -0.05742263421416283, 0.026273729279637337, -0.04558291658759117, -0.030226105824112892, -0.01857791095972061, -0.03459635376930237, 0.02075432986021042, 0.021920891478657722, 0.038130857050418854, 0.012997573241591454, -0.002118743723258376, -0.03285522013902664, 0.022390997037291527, -0.015321988612413406, -0.06553632766008377, 0.0004896942409686744, -0.021363727748394012, -0.052686747163534164, 0.01163078285753727, -0.011987715028226376, 0.0867781713604927, 0.023296387866139412, -0.021851245313882828, 0.0750081017613411, 0.02021457813680172, 0.012240179814398289, 0.0011741779744625092, 0.048264265060424805, 0.04283192381262779, -0.03534504398703575, -0.004705417435616255, 0.042031001299619675, 0.028223799541592598, -0.014320836402475834, -0.02439330331981182, -0.051711712032556534, 0.007782873697578907, 0.04150865972042084, 0.04084702953696251, -0.016027148813009262, -0.026935359463095665, 0.047324053943157196, 0.01123032160103321, 0.028589438647031784, -0.026935359463095665, -0.01273640338331461, -0.012483938597142696, -0.010150817222893238, 0.010586101561784744, -0.031862773001194, -0.0027923453599214554, 0.03611114248633385, 0.06181029602885246, 0.0217293668538332, 0.03360390663146973, -0.004048139322549105, -0.09813037514686584, -0.060870084911584854, 0.02559468522667885, 0.004600949585437775, 0.012187945656478405, -0.0487169586122036, -0.057144053280353546, -0.031183728948235512, -0.03837461769580841, 0.027196530252695084, -0.02879837527871132, 0.009445657953619957, 0.04311050474643707, 0.004796827211976051, -0.05098043754696846, 0.03348202630877495, 0.0587807223200798, 0.02811933122575283, -0.025559863075613976, 0.03475305810570717, 0.026256317272782326, 0.020040465518832207, 0.010411988012492657, -0.022895926609635353, -0.04603561386466026, 0.024741530418395996, 0.07438129186630249, 0.001604020711965859, -0.0001306531485170126, 0.024724118411540985, 0.026621956378221512, -0.02369684912264347, -0.004328897222876549, -0.03450929746031761, -0.09555349498987198, -0.04182206466794014, -0.013615676201879978, 0.04321497306227684, 0.03893177956342697, 0.02232135273516178, 0.006611960474401712, -0.01503470167517662, -0.04962234944105148, 0.05125901848077774, 0.01516528706997633, 0.029581885784864426, -0.029303302988409996, 0.0015311107272282243, 0.03833979368209839, -0.003828320885077119, 0.007913459092378616, -0.06302908807992935, -0.02451518177986145, 0.009480481036007404, 0.011047502048313618, 0.039001427590847015, 0.015522219240665436, 0.005332226399332285, -0.03750405088067055, 0.02771886996924877, 0.04338908568024635, -0.010020232759416103, 0.05766639485955238, 0.009976704604923725, 0.011056208051741123, 0.03487493470311165, -0.0061418539844453335, 0.0192569550126791, -0.11157193779945374, -0.0006534697604365647, -0.001362438197247684, 0.030556920915842056, 0.001748752547428012, 0.002966458909213543, 0.006315967533737421, -0.05432341620326042, -0.0399068184196949, -0.02728358656167984, 0.0030056345276534557, -0.02771886996924877, -0.017768284305930138, -0.016105499118566513, 0.011334789916872978, 0.0009766679722815752, 0.02394060790538788, -0.006860072258859873, -0.032890040427446365, -0.027596991509199142, -0.08649959415197372, 0.002210153266787529, -0.029111778363585472, -0.03504905104637146, 0.002711817855015397, 0.03666830435395241, 0.00005356030669645406, -0.016462432220578194, -0.018368976190686226, -0.05237334221601486, -0.03134043142199516, 0.02230394072830677, 0.06887930631637573, -0.04053362458944321, -0.035136107355356216, 0.00491435406729579, -0.004966587759554386, 0.007878636009991169, 0.019152486696839333, 0.014286013320088387, -0.025298692286014557, 0.0038174386136233807, 0.012771226465702057, -0.09283732622861862, 0.07535632699728012, -0.010272697545588017, 0.025141991674900055, -0.15503066778182983, 0.000901037419680506, -0.001309115905314684, -0.0262911394238472, -0.021938301622867584, -0.013215215876698494, -0.03403919190168381, 0.05205994099378586, 0.026569722220301628, -0.019361421465873718, -0.014181545004248619, 0.024689296260476112, 0.019431067630648613, 0.017115358263254166, 0.027492523193359375, -0.04446858912706375, -0.010890800505876541, 0.025176813825964928, 0.0075478204526007175, 0.02232135273516178, -0.02037128061056137, 0.025559863075613976, -0.004037256818264723, -0.02770145982503891, 0.055890437215566635, 0.016479844227433205, 0.01620996743440628, -0.049517881125211716, -0.03182794898748398, -0.05550738796591759, -0.0031013968400657177, 0.022373586893081665, -0.08503703773021698, 0.04916965588927269, 0.0511893704533577, 0.04335426539182663, 0.0061897351406514645, 0.02740546688437462, 0.10015009343624115, -0.025176813825964928, 0.07264015823602676, -0.057944975793361664, -0.009288955479860306, -0.018038159236311913, -0.06567561626434326, -0.03569326922297478, 0.005667394958436489, 0.04502575471997261, 0.009619771502912045, 0.0038435556925833225, 0.016375375911593437, -0.01899578422307968, -0.03771298751235008, -0.010142112150788307, 0.024341069161891937, 0.045896321535110474, 0.013937786221504211, -0.03477046638727188, -0.02383613958954811, -0.03033057413995266, -0.03478787839412689, -0.08225122094154358, 0.05773603916168213, 0.012066066265106201, -0.052721571177244186, 0.06856589764356613, -0.022547699511051178, 0.016645250841975212, -0.03597185015678406, -0.09290696680545807, -0.0016453727148473263, -0.006080914288759232, 0.029964935034513474, 0.005941623356193304, -0.02810192108154297, 0.010324930772185326, 0.03934965282678604, -0.003436565399169922, 0.06818284839391708, -0.08622100949287415, -0.02117220312356949, -0.04123007878661156, 0.04471234977245331, 0.03722546994686127, -0.046592775732278824, 0.02409731037914753, 0.024045076221227646, 0.04948306083679199, 0.024306245148181915, -0.006533609703183174, -0.017515819519758224, -0.04809015244245529, 0.028502382338047028, 0.009471775032579899, -0.01523493230342865, -0.007526056375354528, 0.017576759681105614, 0.025977736338973045, -0.01856050081551075, 0.024341069161891937, 0.013963903300464153, 0.038165681064128876, 0.02244323119521141, 0.0501098670065403, -0.0683569610118866, -0.04607043415307999, -0.014982467517256737, 0.046627599745988846, 0.007360648829489946, 0.040394335985183716, -0.04199617728590965, -0.0021742423996329308, -0.013058513402938843, 0.04199617728590965, -0.011221615597605705, 0.010002820752561092, -0.029547063633799553, 0.02481117472052574, -0.08329590409994125, -0.005205994006246328, -0.038722842931747437, -0.005040585994720459, 0.019361421465873718, -0.008266039192676544, 0.038130857050418854, 0.015905268490314484, 0.001586609403602779, 0.0010522985830903053, 0.020388692617416382, 0.0654318556189537, -0.007508645299822092, 0.011343494988977909, 0.000029738723242189735, 0.043284617364406586, 0.004013316240161657, 0.014938939362764359, -0.00816592387855053, 0.013293566182255745, 0.014225074090063572, -0.044398944824934006, -0.012135711498558521, -0.04140419140458107, -0.026970183476805687, -0.029564473778009415, -0.031009616330266, 0.025821033865213394, -0.019465889781713486, -0.036354899406433105, 0.04283192381262779, 0.03785227611660957, 0.05637795478105545, 0.02561209723353386, -0.038304973393678665, -0.0070907725021243095, -0.0074651166796684265, 0.028746141120791435, -0.028885431587696075, -0.07507774233818054, -0.024567415937781334, 0.02315709739923477, 0.032071709632873535, 0.04241405054926872, -0.004161312710493803, -0.052965328097343445, -0.021241847425699234, 0.0006409553461708128, -0.03767816349864006, -0.011935480870306492, 0.005562926642596722, 0.03285522013902664, 0.05495022237300873, 0.01391166914254427, 0.020876210182905197, 0.041334547102451324, -0.04791603982448578, 0.011334789916872978, -0.013728850521147251, -0.054497528821229935, 0.016741013154387474, 0.03687724098563194, 0.01923954300582409, 0.014869294129312038, -0.05679582804441452, -0.0734759047627449, -0.023226741701364517, 0.01266675814986229, -0.09910541027784348, -0.030435042455792427, -0.041752420365810394, -0.009315072558820248, 0.026204083114862442, 0.03729511424899101, 0.04168277606368065, -0.03583256155252457, -0.013685322366654873, -0.01060351263731718, -0.006738192867487669, -0.006424788385629654, 0.006298556458204985, -0.03403919190168381, 0.03973270207643509, 0.011012679897248745, -0.029581885784864426, -0.05122419446706772, -0.008270392194390297, -0.027771104127168655, 0.03313380107283592, 0.024149544537067413, 0.03809603676199913, -0.017472291365265846, -0.02270440198481083, -0.007817696779966354, 0.0008738322067074478, -0.00842274073511362, 0.014555889181792736, 0.024619650095701218, -0.011987715028226376, 0.028467558324337006, 0.034544121474027634, 0.016540784388780594, 0.012205356732010841, -0.046871356666088104, 0.04878660663962364, 0.03452670946717262, -0.02726617641746998, -0.01494764443486929, -0.010185640305280685, -0.033011920750141144, 0.010028937831521034, -0.017594169825315475, -0.05992987006902695, 0.020702095702290535, 0.002478941110894084, 0.010507750324904919, -0.014930233359336853, 0.03384766727685928, -0.043145328760147095, -0.013546030968427658, 0.009288955479860306, -0.027335820719599724, 0.0279974527657032, -0.007882989011704922, 0.02051057107746601, 0.035937029868364334, -0.009985409677028656, -0.0073345317505300045, 0.003181924344971776, -0.0003991008270531893, -0.06578008085489273, 0.030800679698586464, -0.003980670124292374, -0.09130512177944183, 0.02851979248225689, -0.025664331391453743, 0.008675205521285534, -0.0028815786354243755, -0.05874589830636978, -0.003057868452742696, 0.0009717710199765861, 0.044259656220674515, 0.031131494790315628, 0.019500713795423508, 0.006363848689943552, -0.015696333721280098, -0.04572220891714096, 0.006707722786813974, -0.04781157150864601, -0.012518761679530144, -0.07814214378595352, 0.01446883287280798, -0.007569584995508194, 0.04805532842874527, -0.07716710865497589, 0.03645936772227287, -0.014277308247983456, -0.03687724098563194, 0.03722546994686127, -0.04697582498192787, -0.0006572785205207765, 0.02272181399166584, 0.01662784069776535, 0.020580217242240906, -0.04861249029636383, -0.04053362458944321, 0.04540880396962166, -0.014355658553540707, 0.056830648332834244, -0.04565256088972092, -0.0029251070227473974, 0.07535632699728012, -0.01653207838535309, 0.00941083487123251, -0.012475232593715191, 0.0036585601046681404, 0.07744568586349487, 0.018038159236311913, -0.015478691086173058, 0.018647557124495506, -0.052826039493083954, 0.006459611468017101, -0.00546716433018446, -0.024445537477731705, -0.01059480756521225, 0.025733977556228638, -0.04154348373413086, -0.03383025527000427, 0.02533351629972458, -0.022756636142730713, 0.050910789519548416, 0.048821426928043365, 0.03945412114262581, -0.03980235010385513, -0.02077174186706543, 0.013450268656015396, 0.021851245313882828, -0.014434009790420532, 0.02284369245171547, 0.01350250281393528, 0.021224437281489372, 0.03907107189297676, 0.014790942892432213, -0.0012275002663955092, 0.03833979368209839, 0.029668942093849182, 0.03976752609014511, -0.005580338183790445, 0.03339496999979019, -0.021346315741539, -0.1344156265258789, -0.04450341314077377, -0.029425183311104774, 0.053801074624061584, -0.020806564018130302, -0.051711712032556534, -0.020458336919546127, 0.007948282174766064, -0.008627324365079403, -0.006690311711281538, 0.02395801991224289, -0.019761882722377777, -0.003253746312111616, -0.05031880363821983, -0.01053386740386486, 0.01350250281393528, -0.020876210182905197, 0.005619513336569071, 0.004045962821692228, 0.07674923539161682, -0.017898868769407272, 0.06288979947566986, 0.03292486444115639, 0.049935754388570786, -0.01136090699583292, 0.06379518657922745, 0.029007310047745705, 0.017359117045998573, 0.015530925244092941, -0.022547699511051178, -0.031235963106155396, -0.004387660417705774, 0.00900166854262352, -0.033464618027210236, 0.0009695946355350316, -0.05167689174413681, 0.06891413033008575, 0.01772475615143776, -0.059895046055316925, 0.05766639485955238, 0.05488057807087898, -0.04321497306227684, -0.002387531567364931, -0.04721958562731743, -0.031671248376369476, -0.009489186108112335, 0.07093384116888046, 0.041090790182352066, -0.0005740305059589446, 0.04241405054926872, 0.004115608055144548, -0.011195498518645763, 0.0528956837952137, -0.022686989977955818, -0.0056238663382828236, 0.0026073497720062733, 0.019309189170598984, -0.03365614265203476, -0.004207017831504345, 0.015722449868917465, 0.01510434690862894, -0.05871107429265976, -0.061287954449653625, -0.016915127635002136, -0.028450148180127144, 0.00886237807571888, -0.004957882221788168, 0.056830648332834244, -0.035536568611860275, 0.06466575711965561, -0.014660357497632504 ]
31,898
stevedore.named
NamedExtensionManager
Loads only the named extensions. This is useful for explicitly enabling extensions in a configuration file, for example. :param namespace: The namespace for the entry points. :type namespace: str :param names: The names of the extensions to load. :type names: list(str) :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param name_order: If true, sort the loaded extensions to match the order used in ``names``. :type name_order: bool :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param on_missing_entrypoints_callback: Callback function that will be called when one or more names cannot be found. The provided argument will be a subset of the 'names' parameter. :type on_missing_entrypoints_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :param warn_on_missing_entrypoint: Flag to control whether failing to load a plugin is reported via a log mess. Only applies if on_missing_entrypoints_callback is None. :type warn_on_missing_entrypoint: bool
class NamedExtensionManager(ExtensionManager): """Loads only the named extensions. This is useful for explicitly enabling extensions in a configuration file, for example. :param namespace: The namespace for the entry points. :type namespace: str :param names: The names of the extensions to load. :type names: list(str) :param invoke_on_load: Boolean controlling whether to invoke the object returned by the entry point after the driver is loaded. :type invoke_on_load: bool :param invoke_args: Positional arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_args: tuple :param invoke_kwds: Named arguments to pass when invoking the object returned by the entry point. Only used if invoke_on_load is True. :type invoke_kwds: dict :param name_order: If true, sort the loaded extensions to match the order used in ``names``. :type name_order: bool :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param on_missing_entrypoints_callback: Callback function that will be called when one or more names cannot be found. The provided argument will be a subset of the 'names' parameter. :type on_missing_entrypoints_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :param warn_on_missing_entrypoint: Flag to control whether failing to load a plugin is reported via a log mess. Only applies if on_missing_entrypoints_callback is None. :type warn_on_missing_entrypoint: bool """ def __init__(self, namespace, names, invoke_on_load=False, invoke_args=(), invoke_kwds={}, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None, on_missing_entrypoints_callback=None, verify_requirements=False, warn_on_missing_entrypoint=True): self._init_attributes( namespace, names, name_order=name_order, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) extensions = self._load_plugins(invoke_on_load, invoke_args, invoke_kwds, verify_requirements) self._missing_names = set(names) - set([e.name for e in extensions]) if self._missing_names: if on_missing_entrypoints_callback: on_missing_entrypoints_callback(self._missing_names) elif warn_on_missing_entrypoint: LOG.warning('Could not load %s' % ', '.join(self._missing_names)) self._init_plugins(extensions) @classmethod def make_test_instance(cls, extensions, namespace='TESTING', propagate_map_exceptions=False, on_load_failure_callback=None, verify_requirements=False): """Construct a test NamedExtensionManager Test instances are passed a list of extensions to use rather than loading them from entry points. :param extensions: Pre-configured Extension instances :type extensions: list of :class:`~stevedore.extension.Extension` :param namespace: The namespace for the manager; used only for identification since the extensions are passed in. :type namespace: str :param propagate_map_exceptions: Boolean controlling whether exceptions are propagated up through the map call or whether they are logged and then ignored :type propagate_map_exceptions: bool :param on_load_failure_callback: Callback function that will be called when an entrypoint can not be loaded. The arguments that will be provided when this is called (when an entrypoint fails to load) are (manager, entrypoint, exception) :type on_load_failure_callback: function :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool :return: The manager instance, initialized for testing """ o = cls.__new__(cls) names = [e.name for e in extensions] o._init_attributes(namespace, names, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) o._init_plugins(extensions) return o def _init_attributes(self, namespace, names, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None): super(NamedExtensionManager, self)._init_attributes( namespace, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) self._names = names self._missing_names = set() self._name_order = name_order def _init_plugins(self, extensions): super(NamedExtensionManager, self)._init_plugins(extensions) if self._name_order: self.extensions = [self[n] for n in self._names if n not in self._missing_names] def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements): # Check the name before going any further to prevent # undesirable code from being loaded at all if we are not # going to use it. if ep.name not in self._names: return None return super(NamedExtensionManager, self)._load_one_plugin( ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements, )
(namespace, names, invoke_on_load=False, invoke_args=(), invoke_kwds={}, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None, on_missing_entrypoints_callback=None, verify_requirements=False, warn_on_missing_entrypoint=True)
[ 0.044534407556056976, -0.04689233750104904, -0.0068123191595077515, 0.026507670059800148, 0.025690002366900444, 0.015735363587737083, 0.008994353003799915, 0.03194611892104149, -0.01323482021689415, -0.00612775981426239, 0.016743188723921776, -0.00025195599300786853, 0.008499949239194393, 0.003736554877832532, -0.04510487616062164, -0.04867979884147644, 0.0052673062309622765, 0.05792135372757912, -0.02401663362979889, -0.030063578858971596, -0.002880855230614543, 0.01730414666235447, 0.06628819555044174, -0.010449042543768883, -0.01552619319409132, 0.019700106233358383, 0.037498656660318375, 0.01826443150639534, 0.008309793658554554, -0.03384767100214958, -0.07541565597057343, -0.013995441608130932, -0.0011641079327091575, 0.03546399250626564, 0.0005279785254970193, -0.011485389433801174, 0.012122410349547863, 0.07986529171466827, -0.02084103785455227, -0.016724172979593277, 0.020042385905981064, -0.021392488852143288, 0.07842011004686356, -0.03455124795436859, 0.04708249121904373, 0.05598176643252373, -0.02928394079208374, 0.07096602022647858, -0.018587695434689522, 0.0019669204484671354, 0.030729122459888458, -0.014176089316606522, 0.053015340119600296, 0.03375259414315224, -0.03139466792345047, 0.10260788351297379, 0.05594373494386673, 0.045979589223861694, 0.03196513280272484, 0.002880855230614543, 0.01083886157721281, -0.020365649834275246, 0.022799639031291008, 0.023598292842507362, -0.03559710085391998, -0.05153213068842888, -0.006940674036741257, -0.07180269807577133, -0.0440780371427536, 0.04042705148458481, 0.006327422801405191, -0.04742477089166641, 0.018806375563144684, -0.04734870791435242, 0.0529392808675766, 0.04978270083665848, -0.02049875818192959, -0.028352178633213043, 0.016952360048890114, 0.03759373351931572, -0.01304466463625431, -0.011219171807169914, -0.030653059482574463, 0.036072488874197006, 0.053547777235507965, 0.00754441786557436, 0.03162285313010216, -0.03303000330924988, 0.042442698031663895, 0.031337618827819824, -0.081234410405159, -0.0031280573457479477, 0.04848964139819145, 0.017893629148602486, -0.037479642778635025, -0.05172228440642357, 0.016847774386405945, 0.010971969924867153, 0.001844507991336286, 0.028143007308244705, -0.004858471918851137, -0.050353165715932846, 0.024282852187752724, 0.009417449124157429, 0.022286219522356987, -0.003869663691148162, -0.024130728095769882, 0.004266613163053989, -0.04202435538172722, 0.006156282965093851, -0.03401881083846092, -0.054726742208004, 0.006422500591725111, -0.02593720518052578, 0.03128057345747948, -0.028257101774215698, 0.007515894714742899, -0.023579277098178864, 0.03211725875735283, -0.0015081705059856176, -0.016819249838590622, 0.07849617302417755, -0.029683267697691917, 0.006218083668500185, 0.00870436616241932, -0.03420896828174591, 0.06811368465423584, 0.02312290295958519, 0.02523363009095192, -0.08678694814443588, 0.10215151309967041, 0.02049875818192959, -0.06229492649435997, -0.015659302473068237, 0.0042048124596476555, -0.03736554831266403, 0.008713874034583569, 0.008048329502344131, -0.05563948675990105, 0.03955233469605446, -0.03552103787660599, -0.008000791072845459, -0.006807565223425627, 0.04339347407221794, 0.007924729026854038, -0.0511137880384922, 0.02926492504775524, 0.005447953939437866, -0.01403347309678793, -0.024092696607112885, -0.006954935844987631, -0.02608932927250862, -0.06294145435094833, -0.0021309296134859324, -0.03633870929479599, -0.013016141019761562, -0.01410953514277935, 0.007953251712024212, -0.014575416222214699, -0.029036737978458405, -0.00724016921594739, -0.0029735560528934, -0.08267959207296371, -0.02257145382463932, -0.0388297438621521, -0.02983539178967476, -0.02082202211022377, -0.028675442561507225, -0.023712385445833206, 0.048451609909534454, -0.013463006354868412, 0.028276117518544197, 0.036281660199165344, 0.030786169692873955, 0.055107053369283676, 0.054080210626125336, -0.00011669305968098342, -0.007406555116176605, 0.00590908108279109, 0.004910764750093222, 0.03479845076799393, 0.013605623506009579, -0.06282736361026764, 0.008595027029514313, -0.0007826085784472525, 0.041187673807144165, 0.021411504596471786, 0.0326877236366272, 0.0010262452997267246, 0.03067207522690296, -0.010952954180538654, -0.01083886157721281, 0.048946015536785126, 0.05191244184970856, -0.02205803245306015, 0.0511518195271492, -0.03650984913110733, 0.008400117047131062, -0.02896067686378956, 0.027819743379950523, -0.09104643017053604, 0.012217488139867783, 0.019253240898251534, -0.04723461717367172, 0.013710208237171173, 0.00696444371715188, 0.0317179299890995, 0.008000791072845459, -0.029340988025069237, -0.02329404279589653, 0.02981637604534626, -0.02629850059747696, -0.08868850767612457, 0.03493155911564827, 0.0024839057587087154, -0.06636425852775574, 0.060089126229286194, 0.01907259225845337, 0.03719440847635269, 0.03723243996500969, 0.010430026799440384, 0.07541565597057343, 0.0255759097635746, 0.031147463247179985, 0.01420461293309927, 0.02297077886760235, 0.03970446065068245, -0.006950181908905506, 0.02363632433116436, 0.028675442561507225, 0.04248072952032089, -0.015478654764592648, 0.0029806867241859436, -0.04871783033013344, 0.026241453364491463, -0.01339645218104124, 0.06959690153598785, 0.004585123620927334, 0.006655441131442785, 0.03810715302824974, 0.039400212466716766, 0.0370042510330677, -0.03128057345747948, -0.0026550455950200558, -0.019129639491438866, -0.04776705056428909, -0.03633870929479599, -0.03128057345747948, 0.006864611990749836, 0.02065088227391243, 0.04746280238032341, 0.06050746515393257, 0.026222437620162964, 0.004007526207715273, -0.0794089213013649, -0.036928191781044006, 0.0057284333743155, -0.04308922588825226, 0.026032282039523125, -0.01286401692777872, -0.022191142663359642, -0.030957309529185295, -0.028276117518544197, 0.023598292842507362, -0.018169354647397995, -0.02097414620220661, 0.041035547852516174, -0.024929380044341087, -0.02278062328696251, 0.04856570437550545, 0.05187441036105156, 0.03673803433775902, -0.030957309529185295, 0.036985237151384354, -0.007030997890979052, -0.0033633746206760406, 0.017760518938302994, -0.0299875158816576, 0.0074968789704144, 0.005747448652982712, 0.0335434228181839, 0.004948795773088932, -0.02472020871937275, 0.006983458995819092, 0.0019205701537430286, -0.038582541048526764, -0.055829644203186035, 0.017865104600787163, -0.0581875704228878, -0.02508150413632393, 0.0013263343134894967, 0.015031789429485798, 0.007282954175025225, -0.03426601365208626, -0.01482261810451746, -0.023864509537816048, -0.09036187082529068, 0.0012538376031443477, 0.025804094970226288, -0.01994730718433857, -0.021430520340800285, -0.00724016921594739, 0.014271167106926441, 0.03333425149321556, -0.01162800658494234, -0.03352440893650055, 0.00033009800245054066, -0.03304901719093323, -0.024625131860375404, 0.06952083855867386, 0.02472020871937275, 0.01208437979221344, -0.027477463707327843, 0.012997125275433064, 0.07473109662532806, 0.039590366184711456, 0.05891016125679016, 0.0011860947124660015, 0.017075959593057632, 0.025632955133914948, -0.015763888135552406, 0.07971316576004028, -0.03652886301279068, 0.014603938907384872, 0.03865860402584076, -0.0006292957114055753, 0.0282190702855587, 0.02785777486860752, 0.020917100831866264, -0.07549171894788742, -0.058643944561481476, -0.05875803530216217, -0.004986826796084642, -0.009526788257062435, -0.022666530683636665, 0.013909871689975262, 0.008718627505004406, -0.03135663643479347, 0.029493112117052078, -0.009555311873555183, 0.04742477089166641, -0.0008931364282034338, -0.10549824684858322, -0.015155389904975891, -0.04476259648799896, -0.020042385905981064, 0.028123991563916206, 0.047006428241729736, 0.02983539178967476, -0.019177177920937538, 0.029226893559098244, -0.04073129966855049, -0.06465285271406174, -0.006954935844987631, 0.013016141019761562, -0.08100622892379761, -0.023046841844916344, -0.016828758642077446, -0.013111218810081482, -0.006802811753004789, -0.008400117047131062, -0.007881944067776203, -0.072297103703022, -0.0008675842545926571, 0.002450628438964486, -0.08085410296916962, 0.07362819463014603, -0.03420896828174591, 0.026165390387177467, -0.11219172179698944, 0.008851736783981323, -0.005485984962433577, -0.010182824917137623, -0.05411824211478233, 0.027287308126688004, -0.039818551391363144, 0.08153866231441498, 0.04114964231848717, -0.05080953985452652, 0.0180742759257555, 0.036585912108421326, 0.03706130012869835, -0.024415960535407066, 0.018739821389317513, -0.0076822806149721146, -0.02715419977903366, 0.04133979603648186, 0.004268989898264408, 0.006417746655642986, -0.009888083674013615, 0.037669796496629715, -0.00776309659704566, -0.04974466934800148, 0.06769534200429916, 0.005305337253957987, -0.008642565459012985, -0.06374011188745499, 0.012483705766499043, -0.04620777815580368, 0.006688718218356371, 0.04906011000275612, -0.05571554973721504, 0.07918073236942291, 0.0422905758023262, 0.0282190702855587, -0.013092203065752983, 0.0459035262465477, 0.07168860733509064, -0.027249276638031006, 0.07632840424776077, -0.034304045140743256, 0.021981971338391304, -0.06377813965082169, -0.07267741858959198, -0.06206674128770828, 0.0255759097635746, 0.009464987553656101, 0.025651970878243446, -0.02681192010641098, -0.019291270524263382, -0.00034733081702142954, -0.03921005502343178, -0.01579241082072258, -0.0012728531146422029, 0.03493155911564827, 0.006037435960024595, -0.05377596244215965, 0.001400019507855177, -0.06644031405448914, -0.013833809643983841, -0.055525392293930054, -0.01679072715342045, 0.009260570630431175, -0.08876457065343857, 0.037175390869379044, -0.06282736361026764, 0.0012360104592517018, -0.07351410388946533, -0.05206456407904625, -0.0021630183327943087, -0.03827829286456108, 0.03928611800074577, 0.030653059482574463, -0.021658707410097122, -0.008262254297733307, 0.02329404279589653, -0.044724564999341965, 0.056552235037088394, -0.017503809183835983, -0.01092443149536848, -0.03584430366754532, 0.036262646317481995, 0.07727918028831482, -0.03951430320739746, 0.012027332559227943, -0.01788412034511566, 0.023864509537816048, -0.0081719309091568, -0.01798870600759983, 0.0016091905999928713, -0.01843557134270668, -0.023693369701504707, 0.0282190702855587, -0.04194829240441322, 0.004052688367664814, 0.023902541026473045, 0.056704357266426086, 0.011846684850752354, 0.01252173725515604, 0.023921556770801544, 0.04883192107081413, 0.027116168290376663, 0.047196585685014725, -0.036585912108421326, -0.003964741248637438, 0.026507670059800148, 0.029188862070441246, -0.006498562637716532, 0.0343610905110836, -0.048793889582157135, 0.022457359358668327, -0.020955132320523262, 0.052292753010988235, 0.0008384667453356087, 0.004630285315215588, -0.04548518732190132, 0.09097037464380264, -0.055107053369283676, -0.0034275520592927933, -0.0030971569940447807, -0.023579277098178864, 0.03050093539059162, 0.02046072669327259, 0.02278062328696251, -0.013301374390721321, -0.017427748069167137, 0.023160934448242188, 0.007649003528058529, 0.06659244000911713, -0.04620777815580368, 0.03196513280272484, -0.011780130676925182, 0.028352178633213043, -0.015240959823131561, 0.037650782614946365, -0.015754379332065582, 0.0017862728564068675, 0.026184406131505966, -0.01375774759799242, -0.015554716810584068, -0.04655005782842636, -0.008490441367030144, -0.010705752298235893, -0.018064768984913826, 0.023712385445833206, -0.0016341485315933824, 0.01713300682604313, 0.05598176643252373, 0.008827967569231987, 0.008804197423160076, 0.023959588259458542, -0.005291075445711613, 0.03293492645025253, -0.00048667911323718727, -0.004972565453499556, -0.009973653592169285, -0.02681192010641098, -0.0008194511756300926, 0.006893135607242584, 0.06084974855184555, 0.03719440847635269, 0.037669796496629715, -0.046816274523735046, -0.052140627056360245, 0.010258886963129044, -0.02066989801824093, -0.04993482306599617, 0.016334353014826775, 0.024453992024064064, 0.023389121517539024, 0.038354355841875076, 0.02928394079208374, 0.04670218005776405, 0.002365058520808816, -0.015478654764592648, -0.03510269895195961, -0.03603446111083031, 0.011266711167991161, 0.023560261353850365, -0.03244052082300186, 0.04476259648799896, -0.015307513996958733, -0.011399819515645504, -0.017941167578101158, 0.007435078267008066, -0.11188746988773346, 0.025176582857966423, -0.035045649856328964, -0.03825927898287773, 0.038753680884838104, -0.007530156057327986, 0.0494404174387455, -0.047538865357637405, -0.019319795072078705, -0.0028356933034956455, 0.016971373930573463, 0.017855597659945488, 0.000712488719727844, -0.03567316383123398, 0.010163809172809124, 0.01392888743430376, 0.02842824161052704, -0.047538865357637405, -0.030101608484983444, -0.04324135184288025, 0.0687221810221672, 0.04430622234940529, 0.017770027741789818, 0.006736257113516331, -0.027116168290376663, 0.011599482968449593, 0.0020964639261364937, -0.005890065338462591, 0.019700106233358383, -0.008276516571640968, -0.009298602119088173, 0.03384767100214958, 0.07218301296234131, -0.01375774759799242, 0.02314191870391369, -0.044344253838062286, 0.03365751728415489, 0.04255679249763489, -0.02983539178967476, 0.016524508595466614, 0.001946716452948749, -0.03901990130543709, 0.029512127861380577, 0.05362384021282196, -0.04731067642569542, -0.025994250550866127, -0.02542378567159176, 0.009973653592169285, -0.03778389096260071, 0.009412695653736591, -0.024986427277326584, -0.02188689261674881, -0.0031280573457479477, -0.04320332035422325, 0.04145389050245285, -0.03304901719093323, -0.03071010671555996, 0.03310606628656387, -0.059366535395383835, -0.004107357934117317, -0.04476259648799896, -0.038924820721149445, -0.014613446779549122, 0.061686430126428604, -0.02133544161915779, -0.04073129966855049, 0.02414974384009838, -0.0010482319630682468, 0.022799639031291008, -0.013177772983908653, -0.058149538934230804, -0.0149937579408288, 0.030481919646263123, 0.029017722234129906, 0.002966425148770213, 0.01083886157721281, 0.02222917228937149, -0.009859560988843441, -0.07667068392038345, 0.033410314470529556, -0.05925244092941284, 0.0255759097635746, -0.03913399204611778, 0.039590366184711456, 0.022514406591653824, 0.048946015536785126, -0.06389223784208298, 0.010715260170400143, 0.006137267220765352, -0.035711195319890976, 0.03426601365208626, -0.011856192722916603, 0.021221349015831947, 0.09020975232124329, -0.012055856175720692, 0.01581142656505108, -0.0003250469744671136, -0.04795720800757408, 0.0326877236366272, -0.01350103784352541, 0.04628383740782738, -0.03211725875735283, 0.006317914929240942, 0.031660884618759155, 0.00007561651000287384, -0.01835000142455101, -0.018397539854049683, -0.026526685804128647, 0.05206456407904625, 0.02896067686378956, -0.03263067826628685, 0.01251222938299179, -0.027838759124279022, 0.03280181810259819, 0.0018100423039868474, -0.008808951824903488, 0.00350599130615592, 0.03601544350385666, -0.03145171329379082, -0.02171575278043747, -0.014974742196500301, -0.02842824161052704, 0.03420896828174591, 0.006294145714491606, 0.05168425291776657, -0.002690699649974704, 0.023351090028882027, -0.020898085087537766, 0.05925244092941284, -0.04864176735281944, 0.032725755125284195, 0.035711195319890976, -0.0014582546427845955, 0.03476041927933693, -0.013263342902064323, 0.0032421506475657225, 0.061686430126428604, 0.05579161271452904, 0.034665338695049286, -0.02662176452577114, 0.0032516582868993282, -0.023198965936899185, -0.11690757423639297, -0.03603446111083031, -0.03527383878827095, 0.025632955133914948, -0.022153111174702644, -0.05088559910655022, -0.01934831775724888, 0.007406555116176605, 0.019490934908390045, -0.07096602022647858, 0.01886342093348503, 0.018977515399456024, -0.02274259366095066, -0.03985658288002014, 0.01956699602305889, 0.07682280242443085, -0.05191244184970856, 0.012940078973770142, -0.0343991219997406, 0.04183420166373253, -0.03316311165690422, 0.03673803433775902, 0.03827829286456108, -0.003864909755066037, -0.018045753240585327, 0.05875803530216217, 0.0037864705082029104, -0.022704562172293663, 0.026431608945131302, -0.028903629630804062, -0.06316964328289032, 0.00705001363530755, 0.03652886301279068, -0.037308499217033386, -0.007206891663372517, -0.06484301388263702, 0.07108011096715927, 0.04639793187379837, -0.07522550225257874, 0.040465082973241806, 0.014936711639165878, -0.014594431035220623, -0.035216789692640305, -0.01700940541923046, -0.02188689261674881, -0.007601464632898569, 0.04537109285593033, 0.02561393938958645, 0.013795778155326843, 0.030101608484983444, 0.03384767100214958, -0.01941487193107605, 0.061496276408433914, -0.018226400017738342, -0.01702842116355896, -0.04335544630885124, 0.02574704959988594, -0.03225036710500717, -0.022286219522356987, -0.005352876149117947, 0.023046841844916344, -0.050353165715932846, -0.08054985105991364, -0.0370042510330677, -0.03375259414315224, -0.009983161464333534, -0.04377378523349762, 0.05704663693904877, 0.0009050211519934237, -0.004906010814011097, 0.025975234806537628 ]
31,901
stevedore.named
__init__
null
def __init__(self, namespace, names, invoke_on_load=False, invoke_args=(), invoke_kwds={}, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None, on_missing_entrypoints_callback=None, verify_requirements=False, warn_on_missing_entrypoint=True): self._init_attributes( namespace, names, name_order=name_order, propagate_map_exceptions=propagate_map_exceptions, on_load_failure_callback=on_load_failure_callback) extensions = self._load_plugins(invoke_on_load, invoke_args, invoke_kwds, verify_requirements) self._missing_names = set(names) - set([e.name for e in extensions]) if self._missing_names: if on_missing_entrypoints_callback: on_missing_entrypoints_callback(self._missing_names) elif warn_on_missing_entrypoint: LOG.warning('Could not load %s' % ', '.join(self._missing_names)) self._init_plugins(extensions)
(self, namespace, names, invoke_on_load=False, invoke_args=(), invoke_kwds={}, name_order=False, propagate_map_exceptions=False, on_load_failure_callback=None, on_missing_entrypoints_callback=None, verify_requirements=False, warn_on_missing_entrypoint=True)
[ -0.006634961813688278, -0.05227600783109665, 0.0169321671128273, -0.04453141614794731, -0.002314017154276371, 0.023032860830426216, 0.029352741315960884, 0.02748965471982956, -0.012594098225235939, 0.023325109854340553, 0.02297806367278099, 0.05381031706929207, 0.012119193561375141, -0.013954881578683853, -0.0645139291882515, -0.05023026838898659, 0.018850049003958702, 0.06327187269926071, -0.05804792419075966, -0.05859588831663132, -0.00923780258744955, 0.015069080516695976, 0.003369994228705764, -0.011288111098110676, 0.020000780001282692, 0.026996485888957977, 0.02758098393678665, 0.0027512486558407545, 0.02621106617152691, -0.015954960137605667, -0.03547170013189316, 0.04953617602586746, -0.005497931037098169, 0.021279368549585342, 0.0347045473754406, -0.029224881902337074, 0.03121582791209221, 0.024859415367245674, -0.0016153596807271242, 0.0063746776431798935, 0.03452189266681671, -0.024585433304309845, 0.03919787332415581, -0.028676915913820267, 0.03475934639573097, 0.04789227619767189, 0.010347435250878334, 0.06641354411840439, -0.02222917601466179, -0.00269873533397913, -0.02374521642923355, 0.009543750435113907, 0.08299867063760757, 0.026941688731312752, -0.026503315195441246, 0.14963139593601227, 0.084752157330513, 0.05063210800290108, -0.0036599598824977875, 0.012804151512682438, 0.0032489849254488945, -0.015708373859524727, 0.03596487268805504, 0.02116977423429489, -0.0038608810864388943, -0.010575754567980766, 0.008950120769441128, -0.0775189995765686, -0.04299710690975189, 0.04292404651641846, 0.03664069622755051, -0.028676915913820267, -0.01605542004108429, -0.045115914195775986, 0.06824009865522385, 0.04825758934020996, -0.02504207193851471, 0.0021473439410328865, 0.023580826818943024, 0.033334631472826004, -0.018904846161603928, -0.005383771378546953, -0.0425952672958374, 0.002447583945468068, 0.05377378314733505, -0.0017477850196883082, 0.01084973756223917, -0.04394691810011864, 0.06626742333173752, 0.03430270776152611, -0.11646115779876709, 0.0013562171952798963, 0.028092417865991592, 0.009644211269915104, -0.019799858331680298, -0.02838466688990593, 0.029992036521434784, -0.008840527385473251, 0.015863630920648575, 0.033206772059202194, -0.0049773626960814, -0.08336398005485535, 0.03534384444355965, -0.012932010926306248, 0.02465849556028843, -0.007689797319471836, -0.024311449378728867, -0.0010114549659192562, -0.019069235771894455, 0.006370111368596554, 0.010091717354953289, -0.0223570354282856, 0.04007462039589882, 0.012868081219494343, -0.009635078720748425, -0.04632144048810005, -0.01322425901889801, -0.03464975208044052, 0.011068924330174923, 0.013069001957774162, -0.027763638645410538, 0.041535865515470505, 0.006265084259212017, 0.012055263854563236, -0.008100772276520729, -0.020347824320197105, 0.02582748979330063, -0.0023973537608981133, 0.051180075854063034, -0.059143856167793274, 0.11470766365528107, -0.020092107355594635, -0.05315275490283966, -0.022302238270640373, -0.04708859324455261, -0.05304316058754921, 0.015498320572078228, 0.020256496965885162, -0.04708859324455261, 0.05121660605072975, -0.00019920867634937167, -0.0004355192359071225, 0.009516352787613869, 0.02990070730447769, -0.011872608214616776, -0.0231059230864048, 0.017297478392720222, -0.03452189266681671, -0.004045819863677025, -0.020895790308713913, 0.014712901785969734, -0.026101473718881607, -0.04895167797803879, -0.012868081219494343, -0.00796834658831358, -0.028603853657841682, 0.020000780001282692, -0.03592833876609802, -0.014612440951168537, -0.013014205731451511, 0.013370383530855179, 0.02107844687998295, -0.038832563906908035, -0.036001402884721756, -0.005890640430152416, 0.01284981518983841, 0.03912481293082237, -0.040512993931770325, -0.01052095741033554, 0.054869718849658966, -0.026759034022688866, 0.011123720556497574, 0.032183900475502014, 0.05538115277886391, 0.057573020458221436, 0.011763015761971474, 0.013507375493645668, 0.0052970098331570625, 0.0081464359536767, 0.035252515226602554, 0.016904767602682114, -0.003931660205125809, -0.04785574600100517, 0.004324369598180056, -0.020493948832154274, 0.07229505479335785, 0.006141791585832834, 0.05958222970366478, 0.0022112734150141478, 0.004854070488363504, 0.006552766542881727, 0.01976332627236843, 0.0551619678735733, 0.07898024469614029, 0.00478557450696826, 0.033572085201740265, -0.07664225250482559, 0.028439464047551155, -0.05497930943965912, 0.022685814648866653, -0.03284146264195442, 0.03656763583421707, 0.015498320572078228, -0.02993723936378956, 0.02453063614666462, 0.04723471775650978, 0.026265863329172134, 0.04902474209666252, -0.019690264016389847, -0.02325204759836197, 0.04632144048810005, -0.04610225185751915, -0.07328139245510101, 0.06981094181537628, -0.036914680153131485, -0.0034499061293900013, 0.051801104098558426, 0.007306220475584269, 0.014840761199593544, 0.021900396794080734, 0.04785574600100517, 0.10959330946207047, 0.02864038571715355, 0.02414705976843834, -0.006972874514758587, 0.05381031706929207, 0.05596565082669258, -0.013881819322705269, -0.001989803509786725, 0.041097491979599, -0.009671609848737717, 0.010731011629104614, -0.03660416603088379, -0.01849387027323246, -0.015571382828056812, -0.05223947763442993, 0.06703457236289978, 0.02915181964635849, -0.013151197694242, 0.013233392499387264, 0.05958222970366478, 0.04135321080684662, -0.040622588247060776, -0.02308765798807144, 0.011388571932911873, -0.01758972555398941, -0.05443134531378746, -0.043727729469537735, 0.0009886230109259486, 0.01976332627236843, 0.0026348058599978685, 0.030393877997994423, 0.0010028929682448506, -0.017653655260801315, -0.08226804435253143, 0.0015959525480866432, 0.014703769236803055, -0.04829411953687668, 0.02016516961157322, -0.0007934098830446601, 0.04708859324455261, -0.024731557816267014, 0.005516196601092815, 0.07397548109292984, 0.013105533085763454, -0.014877292327582836, 0.05918038636445999, -0.03759050369262695, -0.02016516961157322, 0.034229643642902374, 0.06071469560265541, 0.023800013586878777, 0.01014651358127594, 0.04427569732069969, -0.02095058746635914, -0.04263179749250412, -0.03419311344623566, -0.04979189485311508, -0.02798282541334629, 0.03759050369262695, 0.09556536376476288, 0.015489188022911549, -0.03401045873761177, 0.012429707683622837, 0.02464022859930992, -0.042193423956632614, -0.034850671887397766, 0.00815100222826004, -0.06677885353565216, -0.040366869419813156, 0.012283583171665668, 0.04157239571213722, 0.00015440098650287837, -0.0217177402228117, -0.0033540120348334312, -0.01084060501307249, -0.07050503045320511, 0.003796951612457633, 0.008164701983332634, -0.023215515539050102, -0.02604667656123638, -0.05881507694721222, 0.023325109854340553, -0.018685659393668175, 0.02527952380478382, -0.025608303025364876, 0.00880399625748396, -0.0016416164580732584, -0.03338942676782608, 0.059655290096998215, 0.055929120630025864, 0.00229461002163589, -0.03083225153386593, -0.013306454755365849, 0.038832563906908035, 0.0436546690762043, 0.06009366363286972, -0.06334493309259415, 0.01706915721297264, -0.0015160407638177276, -0.01193653792142868, 0.027270467951893806, -0.011507297866046429, -0.00757107138633728, 0.008561977185308933, 0.0036211456172168255, 0.013799624517560005, 0.008899889886379242, 0.012877213768661022, -0.04920739680528641, -0.035508234053850174, -0.01194567047059536, 0.014082740060985088, 0.0011221898021176457, -0.020201699808239937, -0.010913667269051075, -0.0010000389302149415, -0.03687814995646477, 0.0069591752253472805, -0.011114588007330894, 0.01706915721297264, 0.004628034308552742, -0.08847833424806595, 0.03192818537354469, -0.058742012828588486, -0.013233392499387264, 0.026795564219355583, -0.00031079977634362876, 0.062212470918893814, -0.037024274468421936, -0.001963546732440591, -0.02606494165956974, -0.0623951256275177, 0.04146280139684677, 0.03388259932398796, -0.0408783033490181, -0.026539847254753113, -0.04522550478577614, 0.01644812896847725, -0.05684239789843559, 0.016530323773622513, -0.02442104183137417, -0.06904378533363342, 0.005890640430152416, -0.002504663774743676, -0.03868643939495087, 0.08044148981571198, -0.016996094956994057, -0.02261275239288807, -0.0775189995765686, 0.040512993931770325, -0.04683287441730499, -0.022503159940242767, -0.02155335061252117, 0.027526186779141426, -0.029334476217627525, 0.06568292528390884, 0.018923111259937286, -0.03287799283862114, -0.01590016297996044, -0.033590350300073624, 0.03978237137198448, -0.024822885170578957, -0.016484661027789116, -0.007940948940813541, -0.0014886424178257585, 0.024494104087352753, 0.023160720244050026, 0.029243148863315582, -0.021608147770166397, 0.04760002717375755, -0.001167853712104261, -0.025991879403591156, 0.008210365660488605, 0.0005014464841224253, 0.0206583384424448, 0.007977480068802834, 0.017014361917972565, 0.005657754838466644, -0.010210443288087845, 0.026631174609065056, -0.032549213618040085, 0.03941706195473671, 0.024092262610793114, 0.021608147770166397, 0.017553195357322693, 0.02721567265689373, 0.025389116257429123, 0.014521113596856594, 0.05454093590378761, -0.006055030506104231, 0.01565357856452465, -0.05947263538837433, -0.07229505479335785, -0.07382936030626297, 0.04906127229332924, 0.019489344209432602, -0.016238074749708176, -0.03337116166949272, -0.06659620255231857, -0.01824728585779667, -0.01263976190239191, 0.017434468492865562, 0.01206439733505249, 0.06886112689971924, 0.005114354658871889, -0.018776986747980118, -0.046905938535928726, 0.014731167815625668, -0.034101784229278564, -0.08460603654384613, 0.059399574995040894, -0.05633096024394035, -0.07039543986320496, 0.04175505042076111, -0.04160892590880394, -0.019288422539830208, -0.027197405695915222, -0.004356333985924721, -0.005036725662648678, -0.09293513000011444, -0.010950198397040367, 0.03664069622755051, 0.0005508205504156649, -0.07065115123987198, 0.013479976914823055, -0.012356645427644253, 0.04292404651641846, -0.03428443893790245, -0.00815556850284338, 0.0008904456626623869, 0.030375612899661064, 0.0387594997882843, -0.05289703607559204, 0.021370695903897285, -0.012749355286359787, -0.02014690265059471, 0.026795564219355583, 0.0027969125658273697, 0.01731574349105358, -0.03326157107949257, -0.028804775327444077, 0.010511824861168861, -0.06674232333898544, -0.0343940332531929, 0.024457573890686035, 0.04182811453938484, -0.012301849201321602, 0.016475528478622437, 0.0018733605975285172, 0.05435828119516373, 0.010694480501115322, 0.05724423751235008, -0.01644812896847725, -0.000050836741138482466, 0.03198298066854477, 0.030759189277887344, -0.02759924903512001, 0.01354390662163496, -0.03868643939495087, 0.019178830087184906, 0.017955036833882332, 0.040768712759017944, 0.024439308792352676, -0.013142064213752747, -0.04233954846858978, 0.035910073667764664, -0.06659620255231857, 0.033298101276159286, 0.014018811285495758, 0.005315275397151709, 0.02348949946463108, 0.04482366517186165, -0.0006661218358203769, -0.009507219307124615, -0.005141752772033215, 0.048732493072748184, 0.02608320862054825, 0.0217177402228117, -0.0034019590821117163, -0.009689874947071075, 0.016767775639891624, 0.002065148903056979, -0.001009742496535182, 0.019854655489325523, -0.014548512175679207, 0.011498164385557175, -0.017370538786053658, -0.009201271459460258, -0.024110527709126472, -0.040403399616479874, -0.050412923097610474, 0.0010405656648799777, -0.004249023739248514, 0.005904339719563723, -0.017881974577903748, -0.023325109854340553, 0.05903426185250282, -0.06820356845855713, 0.011507297866046429, 0.049755364656448364, 0.009644211269915104, 0.04686940461397171, -0.01568097621202469, -0.018795251846313477, -0.010548355989158154, 0.016913900151848793, 0.01706002466380596, 0.022831939160823822, 0.0023973537608981133, 0.00539747066795826, 0.006653227377682924, -0.046029191464185715, -0.07061462104320526, -0.015763171017169952, 0.00715552968904376, -0.03850378468632698, 0.04752696678042412, 0.04507938027381897, 0.020840995013713837, 0.02104191482067108, 0.04789227619767189, 0.005566427018493414, 0.032421354204416275, 0.0033334631007164717, -0.04986495524644852, -0.044860195368528366, 0.008767465129494667, 0.018338613212108612, -0.03618405759334564, 0.03132542222738266, -0.027836700901389122, -0.010000390000641346, 0.0037170397117733955, 0.007507141679525375, -0.07700756937265396, 0.03251268342137337, -0.05227600783109665, -0.04697899892926216, 0.03580048307776451, -0.008036842569708824, 0.04986495524644852, -0.037809692323207855, -0.015516586601734161, -0.030339080840349197, -0.003509269095957279, 0.02259448729455471, -0.014849893748760223, -0.03105143830180168, -0.0028654083143919706, 0.017443601042032242, 0.017233548685908318, -0.02964499033987522, -0.0027033016085624695, -0.0408783033490181, 0.05768261104822159, 0.04453141614794731, 0.006698891054838896, -0.010256106965243816, -0.029042227193713188, 0.002324291504919529, -0.01123331394046545, -0.03687814995646477, -0.013845288194715977, -0.02527952380478382, 0.0017957320669665933, -0.029170086607336998, 0.07182014733552933, 0.04391038790345192, 0.00767153175547719, -0.013215126469731331, -0.01643899641931057, 0.005443134345114231, -0.012329247780144215, -0.010036921128630638, -0.013881819322705269, -0.021370695903897285, 0.02029302716255188, 0.03298758715391159, -0.08204885572195053, -0.05505237355828285, 0.036257121711969376, -0.015891030430793762, -0.02734353020787239, -0.028293339535593987, 0.0025777260307222605, -0.06502536684274673, 0.027672311291098595, -0.024548901244997978, 0.05987447872757912, 0.020128637552261353, -0.036257121711969376, 0.03247614949941635, -0.007813089527189732, 0.026229333132505417, -0.0015320231905207038, -0.01706915721297264, -0.01393661554902792, 0.05969182401895523, -0.0328962579369545, -0.02942580357193947, -0.040366869419813156, 0.005543595179915428, 0.009292599745094776, -0.0018824933795258403, -0.05278744548559189, -0.014566777274012566, -0.005840410012751818, 0.03245788440108299, 0.011826944537460804, 0.025772692635655403, -0.012210520915687084, -0.007507141679525375, -0.09921848028898239, 0.024969009682536125, 0.006187455728650093, 0.05713464692234993, -0.020000780001282692, 0.030978376045823097, -0.015845365822315216, 0.030119894072413445, -0.06122612953186035, 0.037553973495960236, -0.02259448729455471, -0.005465966183692217, 0.014018811285495758, -0.02158988267183304, 0.02568136528134346, 0.12084489315748215, 0.001358500448986888, 0.04394691810011864, 0.0030982941389083862, -0.03295105695724487, 0.03092357888817787, -0.04650409519672394, 0.034722812473773956, -0.046029191464185715, -0.005324408411979675, 0.05377378314733505, -0.006187455728650093, -0.052458666265010834, -0.009388493373990059, -0.014137537218630314, 0.03737131878733635, 0.059399574995040894, -0.024749822914600372, 0.01657598838210106, -0.04124361649155617, -0.022631019353866577, 0.01989118568599224, -0.02659464254975319, 0.055929120630025864, 0.0796378031373024, 0.016512058675289154, -0.02348949946463108, 0.02219264581799507, -0.03622058779001236, -0.029042227193713188, 0.0153339309617877, 0.03687814995646477, -0.0474904328584671, 0.0036028800532221794, -0.02374521642923355, -0.0048677693121135235, -0.0608973503112793, -0.005351806525141001, 0.007164662703871727, 0.03180032595992088, -0.0010114549659192562, -0.033316366374492645, 0.008128170855343342, 0.053481534123420715, 0.0649522989988327, 0.02900569699704647, -0.006749121472239494, 0.01821075566112995, -0.05581952631473541, -0.13216952979564667, -0.01431105937808752, -0.0016575987683609128, 0.04887861758470535, 0.0040503861382603645, -0.06897072494029999, -0.025736162438988686, -0.04190117493271828, -0.009972991421818733, -0.050376392900943756, 0.018512137234210968, 0.0020126355811953545, 0.01758972555398941, -0.011854343116283417, 0.013790491968393326, 0.025736162438988686, -0.033425960689783096, 0.009726406075060368, 0.006150924600660801, 0.04548122361302376, -0.005155452061444521, 0.005529895890504122, -0.014913822524249554, 0.015763171017169952, -0.017032627016305923, 0.02206478640437126, -0.054248686879873276, 0.005265045445412397, -0.003778686048462987, -0.038467250764369965, -0.03136195242404938, 0.012804151512682438, -0.00923780258744955, -0.0023973537608981133, -0.008447817526757717, -0.04920739680528641, 0.06732682138681412, -0.000569086114410311, -0.09585761278867722, 0.05435828119516373, -0.008228630758821964, 0.0037261724937707186, -0.007050503045320511, -0.03927093744277954, -0.006434040609747171, 0.0030297983903437853, 0.0596187599003315, 0.04584653303027153, -0.00577191449701786, -0.014658105559647083, -0.007160096429288387, 0.04168199002742767, 0.06882459670305252, -0.05651361867785454, 0.05253172665834427, -0.028293339535593987, 0.0125119024887681, -0.008758331649005413, -0.05863242223858833, -0.0011689952807500958, 0.02350776456296444, -0.04445835202932358, -0.09936460107564926, -0.056805867701768875, -0.034339237958192825, -0.029973769560456276, -0.05107048153877258, 0.10272546112537384, 0.017790647223591805, 0.03167246654629707, 0.005694285966455936 ]
31,924
sonetel.account
Account
Class representing the company account.
class Account(util.Resource): """ Class representing the company account. """ def __init__(self, access_token: str): if not access_token: raise e.AuthException('access_token missing') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}/{const.API_ENDPOINT_ACCOUNT}/{self._accountid}' def get(self) -> dict: """ Get information about your Sonetel account. :returns: The account information if the request was processed successfully. """ return util.send_api_request( token=self._token, uri=self._url, method='get', ) def update(self, name: str = '', language: str = '', timezone: str = '') -> dict: """ Update your account information. Pass one or more of the following parameters: :param name: String. New company name. :param language: String. The ID of the new language you want to switch to. Changes the language you see in app.sonetel.com :param timezone: String. The ID of the new timezone you want to switch to. :returns: dict. The updated account information if the request was processed successfully. """ body = {} if name: body['name'] = name if language: body['language'] = language if timezone: body['timezone_details'] = { "zone_id": timezone } if len(body) == 0: return util.prepare_error( code=const.ERR_ACCOUNT_UPDATE_BODY_EMPTY, message='request body cannot be empty' ) return util.send_api_request( token=self._token, uri=self._url, method='put', body=dumps(body) ) def get_balance(self, currency: bool = False) -> str: """ Get the current prepaid balance in the account :param currency: Boolean. Optional. Set to true if currency should be returned in the response. :returns: A string representing the current prepaid balance in the Sonetel account. """ response = util.send_api_request( token=self._token, uri=self._url, method='get', ) balance = response['response']['credit_balance'] if currency: balance += f" {response['response']['currency']}" return balance def get_accountid(self) -> str: """ Get your account ID. :returns: String. Sonetel account ID. """ return self._accountid
(access_token: str)
[ -0.001550439279526472, -0.07337780296802521, -0.047836609184741974, 0.011669349856674671, 0.015204931609332561, -0.0549464114010334, -0.012239293195307255, -0.021522609516978264, -0.018180228769779205, -0.020112240687012672, -0.004402571357786655, -0.05266663804650307, 0.02436266653239727, 0.0042745755054056644, -0.045595474541187286, 0.010056120343506336, 0.04289065673947334, -0.0023039239458739758, 0.004371176473796368, -0.043818023055791855, 0.03338516131043434, 0.008872763253748417, 0.04884125292301178, 0.03321127966046333, -0.0038688532076776028, 0.05382584407925606, 0.03523989021778107, 0.020788444206118584, 0.019754819571971893, -0.029868898913264275, 0.015185611322522163, 0.029192695394158363, 0.03446708619594574, 0.030912185087800026, -0.01747504435479641, -0.02898017317056656, -0.0002706325612962246, 0.05954459682106972, -0.12774460017681122, 0.030158700421452522, 0.002808661898598075, 0.050270941108465195, 0.06935921311378479, -0.012490455061197281, 0.01208473276346922, 0.02662312053143978, 0.003653916995972395, 0.05251207575201988, 0.003550071269273758, -0.003344795200973749, 0.02770504727959633, 0.012529095634818077, -0.03211003169417381, -0.017590966075658798, 0.0133405402302742, -0.021696491166949272, -0.01638345792889595, 0.06572703272104263, -0.0380219891667366, -0.019938359037041664, 0.01717558316886425, -0.04439762607216835, -0.01394912414252758, 0.0016422098269686103, 0.011592069640755653, 0.025927595794200897, -0.04992318153381348, 0.009800128638744354, 0.035549014806747437, 0.044668108224868774, 0.07515525072813034, 0.0020660448353737593, -0.0293472558259964, 0.00800818856805563, 0.02252725511789322, -0.007085652556270361, -0.0002511615166440606, -0.0258889552205801, -0.03753898665308952, -0.014345185831189156, 0.02216017246246338, -0.048454850912094116, -0.01705966331064701, -0.010056120343506336, 0.026217397302389145, 0.030545104295015335, 0.03323059901595116, -0.07851695269346237, -0.03672754019498825, 0.032554395496845245, -0.054366808384656906, 0.022392014041543007, -0.054482728242874146, -0.023106858134269714, 0.062210772186517715, -0.028535811230540276, -0.04567275568842888, -0.03423524647951126, -0.023783063516020775, 0.03294079750776291, -0.029327936470508575, 0.02770504727959633, -0.06282901763916016, 0.011978471651673317, 0.061244767159223557, -0.04319978132843971, -0.028535811230540276, 0.010684024542570114, 0.035896774381399155, 0.008177239447832108, -0.05680114030838013, 0.009742168709635735, -0.03750034421682358, -0.010558443143963814, -0.02990753948688507, -0.007303003687411547, -0.016064677387475967, 0.02235337346792221, -0.006829660851508379, -0.03222595527768135, 0.05614425614476204, -0.021715810522437096, 0.013437140733003616, -0.012963797897100449, 0.06259717792272568, 0.006631630007177591, -0.01506969053298235, 0.04238833487033844, 0.007505865301936865, -0.03817654773592949, -0.045518193393945694, -0.009273655712604523, 0.012500114738941193, -0.04188601300120354, 0.027144763618707657, -0.03398408368229866, 0.007689406163990498, 0.037307143211364746, -0.08894981443881989, 0.08060352504253387, 0.022797737270593643, 0.042967937886714935, -0.01966787874698639, -0.03253507614135742, -0.043083857744932175, -0.03174294903874397, -0.03174294903874397, -0.031936150044202805, -0.030834905803203583, 0.008607111871242523, 0.02758912555873394, 0.003298909869045019, -0.0036973871756345034, 0.03290215879678726, -0.0523575134575367, -0.026391278952360153, -0.005245411302894354, -0.014741248451173306, 0.0060133859515190125, -0.007534845266491175, -0.052782557904720306, 0.02102028578519821, 0.02948249690234661, -0.06982289999723434, -0.01577487401664257, 0.007800496648997068, -0.05231887474656105, -0.0383504293859005, 0.0160067155957222, -0.001904238946735859, -0.02136804908514023, -0.0406881645321846, -0.05150742828845978, 0.023918304592370987, -0.012162012979388237, 0.0002692741109058261, 0.05096646770834923, -0.06468375027179718, -0.011167027056217194, -0.0042842356488108635, 0.004557132255285978, -0.04818436875939369, 0.003632181789726019, 0.009099774993956089, 0.024266066029667854, 0.006356318015605211, 0.03771286830306053, 0.05181655287742615, 0.0023208288475871086, 0.020054280757904053, 0.010104420594871044, 0.040340401232242584, 0.0037070473190397024, 0.009553797543048859, -0.07631445676088333, 0.00400167889893055, 0.012490455061197281, -0.06321541965007782, -0.03361700102686882, -0.007631445769220591, -0.049961820244789124, 0.05262799561023712, 0.01863425225019455, -0.023358020931482315, 0.06101292744278908, -0.007843967527151108, 0.020112240687012672, -0.01790974847972393, -0.04041768237948418, -0.03149178996682167, -0.011804590933024883, 0.013920143246650696, -0.04146096855401993, -0.0038640231359750032, 0.01948433741927147, -0.04586595669388771, 0.040108561515808105, -0.010761304758489132, 0.010258981958031654, 0.02660379931330681, 0.016953401267528534, -0.04234969615936279, -0.014606007374823093, -0.10811536759138107, -0.03964487835764885, 0.017929067835211754, 0.017706885933876038, 0.003967868629842997, -0.031047426164150238, -0.04663876071572304, -0.007312663830816746, -0.005868485197424889, -0.030931506305933, 0.021889692172408104, -0.03838907182216644, -0.04397258535027504, 0.023068219423294067, -0.003617691807448864, -0.0076217856258153915, 0.007819817401468754, 0.04316113889217377, 0.004431551788002253, 0.01147614885121584, 0.01584249548614025, -0.06966833770275116, -0.01582317426800728, -0.006597819738090038, -0.006916601676493883, -0.04157688841223717, -0.09211831539869308, 0.0076797460205852985, -0.07434380799531937, 0.020266801118850708, 0.046136438846588135, 0.011814250610768795, -0.12318506091833115, -0.032554395496845245, 0.03375224396586418, 0.001621682196855545, -0.013987763784825802, -0.04791388660669327, -0.047179725021123886, -0.04146096855401993, 0.011794931255280972, -0.0002858773514162749, 0.016721559688448906, -0.01470260787755251, 0.04142232984304428, 0.047720685601234436, -0.013804223388433456, 0.11244307458400726, 0.02003495953977108, -0.036688901484012604, 0.015610653907060623, -0.0042745755054056644, -0.016180597245693207, -0.0063466583378612995, 0.007757026702165604, -0.038891393691301346, -0.03788674622774124, -0.013321219943463802, -0.033462442457675934, 0.06047196313738823, 0.011282947845757008, 0.041383687406778336, -0.08423570543527603, 0.007293344009667635, 0.03902663290500641, -0.03002346120774746, -0.0016880951588973403, -0.00592161575332284, 0.02923133596777916, -0.0293472558259964, -0.00849119108170271, 0.027067482471466064, 0.01522425189614296, -0.05050278455018997, 0.013697962276637554, 0.055564653128385544, -0.05034822225570679, -0.005936105735599995, 0.03825382888317108, 0.031878191977739334, -0.035104651004076004, 0.0011676595313474536, -0.03794470801949501, 0.04733428359031677, 0.003359285183250904, 0.004803463816642761, 0.05413496494293213, 0.007254703436046839, -0.03431252762675285, 0.04745020344853401, 0.006317677907645702, -0.028709692880511284, -0.015629973262548447, -0.009606927633285522, 0.020479323342442513, 0.023918304592370987, 0.0586945116519928, -0.0280141681432724, 0.032554395496845245, 0.01150512881577015, -0.003921983763575554, 0.06499286741018295, -0.03319196030497551, 0.016248216852545738, 0.05884907394647598, 0.009790468961000443, 0.01589079573750496, -0.08253553509712219, -0.021657850593328476, -0.037365105003118515, -0.01355306152254343, -0.03537513315677643, -0.018682552501559258, -0.0062886979430913925, -0.07055706530809402, -0.009181885048747063, -0.0006194512243382633, 0.03825382888317108, -0.035549014806747437, -0.020923685282468796, 0.0021203828509896994, -0.006820001173764467, -0.004337366204708815, 0.051121026277542114, 0.0017170753562822938, -0.0006719777593389153, 0.009080454707145691, -0.03585813567042351, 0.012239293195307255, 0.08856341242790222, 0.057342104613780975, 0.05541009455919266, -0.07206403464078903, -0.04003128036856651, -0.034737568348646164, 0.01734946481883526, -0.033404480665922165, -0.029096094891428947, -0.04165416955947876, 0.0017955632647499442, 0.033520400524139404, -0.039065275341272354, -0.030583743005990982, -0.0027893418446183205, -0.07998528331518173, 0.07874879240989685, -0.058424029499292374, -0.022334054112434387, -0.024439947679638863, -0.01144716888666153, -0.04173145070672035, 0.04609779641032219, 0.018112609162926674, 0.0325157567858696, 0.038891393691301346, -0.04513179138302803, 0.031028106808662415, 0.07550301402807236, 0.036032017320394516, -0.002009292133152485, 0.06955241411924362, 0.051236946135759354, -0.05513961240649223, 0.014316205866634846, -0.02642991952598095, 0.010162381455302238, 0.018499011173844337, 0.03717190399765968, 0.01675054058432579, -0.021232808008790016, 0.0013886333908885717, -0.10131468623876572, -0.004827613942325115, -0.04219513386487961, -0.025715073570609093, -0.027608446776866913, -0.00935093592852354, 0.04451354593038559, 0.0018317884532734752, 0.07496204972267151, 0.010741984471678734, -0.03149178996682167, -0.027936886996030807, 0.048995815217494965, -0.007162933237850666, -0.01339850015938282, 0.09034086018800735, -0.078207828104496, -0.028535811230540276, 0.012229633517563343, -0.018499011173844337, -0.006694420240819454, -0.04397258535027504, 0.012181333266198635, 0.049111735075712204, -0.00995951984077692, 0.028613092377781868, 0.014345185831189156, -0.022218134254217148, 0.012934817932546139, 0.01960025727748871, -0.03197479248046875, -0.0059312754310667515, 0.027241364121437073, 0.0043639312498271465, -0.020305441692471504, -0.010056120343506336, 0.05231887474656105, 0.017339803278446198, -0.057458024471998215, -0.08655411750078201, 0.038891393691301346, 0.013272919692099094, 0.03311467915773392, -0.017929067835211754, -0.012558075599372387, -0.014625327661633492, 0.01663462072610855, 0.009833939373493195, 0.009877409785985947, -0.007805326953530312, -0.0022809812799096107, -0.020865725353360176, -0.07183219492435455, -0.02600487694144249, 0.05255071446299553, -0.024208106100559235, -0.031221307814121246, 0.036089975386857986, -0.005235751625150442, -0.001951331738382578, -0.04262017458677292, -0.05865587294101715, 0.05421224609017372, -0.03344311937689781, 0.0059167854487895966, -0.008027507923543453, 0.004279405809938908, -0.005061870440840721, 0.024072865024209023, 0.0549464114010334, 0.03585813567042351, 0.005757394712418318, 0.044127143919467926, 0.01482818927615881, 0.015871474519371986, -0.012693316675722599, 0.006520539056509733, -0.012983118183910847, -0.0006260924856178463, 0.034447766840457916, 0.02478770911693573, 0.008998343721032143, 0.03241915628314018, -0.012075072154402733, -0.0676976889371872, -0.007544505409896374, 0.019938359037041664, 0.027859607711434364, 0.018856434151530266, -0.02467178739607334, 0.006689590401947498, -0.06348589807748795, 0.012219973839819431, 0.007921247743070126, -0.021116886287927628, 0.001868013758212328, -0.005153641104698181, -0.008829292841255665, -0.032361194491386414, 0.030950825661420822, -0.09690970182418823, 0.009056304581463337, -0.032728277146816254, 0.039432357996702194, 0.00855398178100586, -0.03871751204133034, -0.00803716853260994, -0.05061870440840721, 0.0013210129691287875, -0.01894337311387062, -0.003680482041090727, 0.008930724114179611, -0.09490040689706802, 0.03386816382408142, 0.049961820244789124, 0.033288560807704926, -0.010722664184868336, -0.007235383614897728, 0.04949813708662987, -0.033153317868709564, 0.006621969863772392, 0.03976079821586609, -0.009080454707145691, 0.047720685601234436, 0.0033327199053019285, -0.04590459540486336, 0.023396659642457962, 0.00570909446105361, 0.07685542106628418, 0.04130640998482704, 0.00418522022664547, 0.05560329556465149, -0.0406881645321846, -0.050386860966682434, -0.0007667671306990087, 0.037307143211364746, 0.0043760063126683235, -0.024497907608747482, -0.03659230098128319, -0.07337780296802521, 0.01607433706521988, 0.033713601529598236, -0.08392658084630966, -0.05815355107188225, 0.027724366635084152, 0.03147247061133385, -0.0023099614772945642, 0.006443258840590715, -0.03842771053314209, -0.021580569446086884, -0.06139932945370674, -0.06530199199914932, -0.000869405223056674, 0.007075992412865162, -0.028110768646001816, -0.013002438470721245, 0.07156170904636383, -0.002405354520305991, 0.06371774524450302, -0.0006200549541972578, 0.004453286528587341, 0.01840241067111492, -0.04408850520849228, -0.050386860966682434, 0.005757394712418318, 0.02478770911693573, -0.012780256569385529, -0.002948732813820243, -0.042852018028497696, 0.035954736173152924, -0.0023292815312743187, -0.0042625004425644875, 0.03216799348592758, 0.012905837967991829, 0.0288062933832407, 0.03695938363671303, 0.00947168655693531, 0.0320134311914444, 0.02046000212430954, 0.04076544567942619, -0.0034583008382469416, 0.010664704255759716, 0.0015914945397526026, -0.0012594300787895918, 0.044436268508434296, 0.018547311425209045, 0.04451354593038559, 0.0006013386300764978, -0.0005992254591546953, -0.10131468623876572, 0.023184139281511307, 0.02161921001970768, 0.018470030277967453, 0.026507198810577393, 0.08276737481355667, 0.018383091315627098, -0.05452136695384979, 0.03417728468775749, -0.020595243200659752, -0.00473825866356492, 0.0038229678757488728, 0.02733796462416649, -0.00785362720489502, -0.06522471457719803, -0.006665439810603857, 0.03495008870959282, -0.022875016555190086, 0.03245779499411583, -0.022913657128810883, -0.04362482205033302, 0.03549105301499367, 0.012529095634818077, -0.07082754373550415, -0.0644519105553627, 0.016789181157946587, 0.02082708477973938, 0.04621371626853943, -0.03811858966946602, -0.008500850759446621, -0.025425272062420845, 0.042658817023038864, 0.010828925296664238, -0.031047426164150238, 0.006998712196946144, 0.026932241395115852, -0.007901927456259727, 0.0035331661347299814, 0.053748562932014465, -0.047411564737558365, 0.039799440652132034, -0.09636873751878738, 0.03153042867779732, 0.051236946135759354, -0.02467178739607334, -0.06557247042655945, -0.008988684043288231, -0.005839505232870579, 0.0203440822660923, -0.015755554661154747, -0.0033906803000718355, -0.016711900010704994, 0.033636320382356644, 0.038582272827625275, -0.006332167889922857, 0.016653940081596375, 0.032805558294057846, 0.04281337559223175, 0.0327669158577919, 0.007964718155562878, 0.053439442068338394, -0.05181655287742615, 0.07840102910995483, -0.05846267193555832, -0.07163899391889572, -0.005781544838100672, -0.011118726804852486, -0.07623717933893204, 0.05506233125925064, 0.007544505409896374, 0.02996549941599369, -0.023531900718808174, -0.002714476315304637, -0.012558075599372387, 0.007351303938776255, 0.030004139989614487, 0.027511844411492348, -0.016538020223379135, -0.01693408191204071, 0.006902111694216728, -0.05061870440840721, -0.012162012979388237, -0.015301532112061977, 0.005540043115615845, -0.01297345757484436, 0.013920143246650696, 0.025599153712391853, -0.007418924476951361, 0.009486177004873753, 0.0356842540204525, -0.0058008646592497826, 0.01501173060387373, 0.015533373691141605, -0.009722848422825336, -0.0076459357514977455, 0.021097566932439804, 0.023164819926023483, 0.019687198102474213, -0.015881136059761047, 0.03406136482954025, 0.0356842540204525, -0.017755186185240746, 0.06522471457719803, 0.009978840127587318, 0.0005753771984018385, -0.04671604186296463, -0.016306178644299507, -0.009104604832828045, -0.05525553226470947, -0.025966236367821693, 0.01150512881577015, 0.026719721034169197, -0.042117852717638016, -0.06290629506111145, 0.010587424039840698, -0.025908276438713074, 0.04532499238848686, 0.04756612703204155, -0.02642991952598095, 0.05085054412484169, 0.012277933768928051, -0.016335157677531242, 0.012529095634818077, -0.0011054729111492634, -0.0676204040646553, 0.05529417097568512, 0.026700399816036224, 0.04377938434481621, 0.10154653340578079, 0.08531763404607773, -0.03491144999861717, 0.0013198053929954767, 0.041924651712179184, 0.008616771548986435, 0.0216771699488163, -0.017011363059282303, 0.04323842003941536, -0.02046000212430954, -0.021483968943357468, 0.051739271730184555, -0.049961820244789124, 0.06464511156082153, 0.008331799879670143, 0.047295644879341125, 0.007501034997403622, 0.005501403007656336, 0.02252725511789322, -0.0008681977051310241, 0.01991903968155384, -0.0676204040646553, 0.04061088338494301, 0.027299324050545692, -0.028168728575110435, 0.02277841605246067, -0.004989420063793659, 0.0015999471070244908, 0.03098946623504162, 0.02552187256515026, 0.029617737978696823, -0.02685496211051941, -0.007182253058999777, -0.001951331738382578, 0.043933942914009094, 0.019764479249715805, -0.015137311071157455, 0.042233772575855255, 0.055564653128385544, 0.05011638253927231, 0.02691292203962803, 0.037674225866794586, 0.02467178739607334, -0.00688279140740633, -0.04853213205933571, -0.00824968982487917, 0.05510096997022629, 0.0280141681432724, 0.018131928518414497, 0.02467178739607334, -0.009978840127587318, -0.02905745431780815, 0.04238833487033844, 0.08578131347894669, 0.038157228380441666, -0.01065504364669323, 0.012857536785304546 ]
31,925
sonetel.account
__init__
null
def __init__(self, access_token: str): if not access_token: raise e.AuthException('access_token missing') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}/{const.API_ENDPOINT_ACCOUNT}/{self._accountid}'
(self, access_token: str)
[ -0.04255072399973869, -0.023252276703715324, -0.03364519774913788, 0.05023244768381119, 0.004961113445460796, -0.008745492435991764, 0.010581198148429394, 0.05482641980051994, -0.0045139542780816555, 0.00883492361754179, 0.05377206578850746, 0.056144364178180695, 0.021331846714019775, -0.0023770041298121214, 0.004233891144394875, 0.029088880866765976, 0.07425666600465775, 0.026321200653910637, 0.03901110589504242, -0.019580865278840065, -0.04236244782805443, 0.004895216319710016, -0.04010311886668205, 0.027243761345744133, 0.010985994711518288, 0.07007690519094467, -0.020221007987856865, 0.025210363790392876, 0.034981969743967056, -0.02306399866938591, 0.02470201440155506, 0.03379581868648529, 0.024777324870228767, 0.10182049870491028, 0.029408952221274376, -0.06936144828796387, -0.006246107630431652, 0.006340246181935072, -0.15935811400413513, 0.02475849725306034, 0.019731486216187477, 0.013847813941538334, 0.0432661809027195, -0.010110503993928432, 0.05399800091981888, 0.0029889061115682125, -0.017312120646238327, 0.044282879680395126, -0.03338160738348961, -0.03370168060064316, -0.0432661809027195, 0.02020218037068844, -0.05211522430181503, -0.01988210901618004, -0.0325908437371254, 0.0768548920750618, 0.014431473799049854, 0.030802207067608833, -0.04236244782805443, 0.030143234878778458, -0.0730893462896347, -0.01732153445482254, 0.024532563984394073, -0.00884904433041811, 0.022706272080540657, 0.03050096333026886, -0.08216431736946106, 0.045035988092422485, 0.01352774165570736, 0.03790026903152466, 0.11206279695034027, 0.046956419944763184, -0.05015713721513748, -0.008905528113245964, 0.02289455011487007, 0.028844119980931282, -0.056257329881191254, 0.003457246348261833, -0.03238373622298241, 0.018234679475426674, 0.02475849725306034, -0.02656596153974533, -0.029823163524270058, -0.02790273167192936, -0.0032430808059871197, -0.016982635483145714, -0.055240631103515625, -0.10792069137096405, -0.03549031913280487, 0.06329891085624695, -0.036111634224653244, 0.012238040566444397, -0.06808116286993027, -0.04145871475338936, 0.014431473799049854, -0.011776760220527649, -0.00497052725404501, -0.056257329881191254, -0.009893985465168953, 0.015401103533804417, 0.009093805216252804, -0.04703173041343689, -0.0691731721162796, 0.017425086349248886, 0.0172932930290699, -0.036902397871017456, 0.028015699237585068, -0.07067938894033432, 0.03575390577316284, -0.00836893729865551, -0.025379812344908714, 0.005930742714554071, 0.017651019617915154, 0.039877183735370636, -0.05919446051120758, 0.027770938351750374, 0.023252276703715324, 0.0004571614263113588, 0.026716584339737892, -0.02524801902472973, 0.067742258310318, -0.007691137958317995, 0.004400987643748522, 0.05121149122714996, 0.06838240474462509, 0.02475849725306034, -0.03240256384015083, -0.020917635411024094, 0.03140469640493393, -0.08495082706212997, 0.033287469297647476, 0.022122612223029137, 0.004299788270145655, -0.05844134837388992, -0.028298115357756615, 0.01219097152352333, 0.020541079342365265, 0.013433602638542652, -0.04951699450612068, 0.01766984723508358, -0.0017309767426922917, 0.024645531550049782, 0.0011531999334692955, -0.023553520441055298, -0.010694164782762527, 0.021501295268535614, -0.014440887607634068, -0.008962010964751244, 0.03656350076198578, -0.0027488521300256252, 0.03995249420404434, -0.00521999504417181, 0.0600605383515358, 0.003311331383883953, -0.06631135195493698, -0.035527974367141724, -0.005836603697389364, 0.004295081365853548, 0.044923022389411926, 0.024720842018723488, 0.0012555759167298675, -0.012388662435114384, 0.017274465411901474, -0.036958880722522736, 0.00358668714761734, 0.0018074644031003118, 0.027243761345744133, -0.058479007333517075, -0.03174359351396561, -0.04834967479109764, 0.02140715718269348, -0.07516039907932281, -0.04548785462975502, -0.025869334116578102, -0.020277490839362144, -0.015090445056557655, 0.014836270362138748, -0.0029794920701533556, -0.009705707430839539, 0.0021204757504165173, 0.03560328483581543, -0.02417483739554882, -0.021877851337194443, -0.029954956844449043, 0.027356727048754692, 0.006679146084934473, 0.006222573108971119, 0.05354613438248634, 0.01641780138015747, 0.07248685508966446, 0.014695062302052975, -0.007036873139441013, 0.021181223914027214, -0.04292728006839752, -0.002164015080779791, -0.03597983717918396, 0.02200964465737343, -0.041797615587711334, -0.010750647634267807, 0.07060407847166061, -0.037749648094177246, 0.05584311857819557, -0.0020133929792791605, -0.014817442744970322, 0.07967905700206757, 0.013066461309790611, 0.008152417838573456, -0.05049603804945946, 0.006213158834725618, -0.01825350895524025, -0.041308093816041946, -0.02635885588824749, -0.0013250032206997275, 0.04164699465036392, -0.05313192307949066, 0.034134719520807266, -0.009875156916677952, -0.010251712054014206, 0.05629498511552811, 0.013047633692622185, 0.08600518107414246, -0.02023983560502529, -0.01201210729777813, -0.10023896396160126, 0.014553854241967201, 0.037542544305324554, 0.03405940905213356, -0.036638811230659485, -0.09233130514621735, 0.00007759094296488911, -0.028975915163755417, -0.0614161342382431, 0.005309426691383123, 0.009884570725262165, 0.008303039707243443, -0.049291063100099564, 0.061077237129211426, -0.03238373622298241, -0.05411096662282944, -0.013828985393047333, 0.0484626404941082, 0.018498267978429794, -0.026584789156913757, 0.015579966828227043, -0.025473952293395996, 0.0015732942847535014, -0.08705953508615494, 0.04458412155508995, -0.03938766196370125, -0.03511376306414604, -0.006627369672060013, -0.026434168219566345, -0.04752125218510628, -0.026114095002412796, -0.011042478494346142, -0.06299766898155212, -0.01574941724538803, 0.014826856553554535, 0.02140715718269348, 0.017867539077997208, -0.02630237303674221, -0.023082826286554337, -0.01644604280591011, 0.023082826286554337, 0.019251378253102303, -0.005092907696962357, -0.01057178433984518, 0.0012543991906568408, 0.04763421788811684, 0.00023578820400871336, 0.11831361055374146, 0.011757932603359222, 0.034134719520807266, 0.04447115585207939, -0.014139643870294094, -0.014535026624798775, 0.006523816846311092, -0.004316262900829315, -0.0659724548459053, -0.0345865860581398, 0.021124741062521935, -0.07508508861064911, 0.027770938351750374, 0.041534025222063065, 0.003909112419933081, -0.018008748069405556, 0.04680579900741577, 0.006914492696523666, -0.010091676376760006, 0.015881210565567017, 0.054487522691488266, 0.009597447700798512, -0.016540182754397392, 0.023139311000704765, 0.0033066244795918465, -0.04352976754307747, 0.023515865206718445, 0.03511376306414604, -0.017895780503749847, 0.036375220865011215, -0.0015838848194107413, -0.006792112253606319, -0.02438194304704666, 0.014742132276296616, 0.035791561007499695, -0.028411081060767174, 0.04379335790872574, 0.038822829723358154, -0.0002552043297328055, 0.03705302253365517, 0.03343809396028519, 0.043492112308740616, -0.0326661542057991, 0.009503308683633804, 0.003864396596327424, -0.002047518268227577, 0.015561139211058617, -0.006613248959183693, 0.027657970786094666, 0.025850506499409676, -0.019486725330352783, 0.014092573896050453, 0.013744261115789413, -0.018451198935508728, 0.03718481585383415, 0.0384274460375309, 0.011917968280613422, 0.05546656623482704, -0.04639158770442009, 0.005224701948463917, -0.055617187172174454, 0.0031183469109237194, -0.041157472878694534, -0.05313192307949066, -0.022235577926039696, -0.034417133778333664, -0.03656350076198578, -0.023628832772374153, -0.0008266561198979616, -0.01755688153207302, -0.010110503993928432, -0.037749648094177246, 0.01601300574839115, 0.05004417151212692, -0.03790026903152466, -0.04044201597571373, 0.019693830981850624, -0.049441684037446976, -0.01572117581963539, -0.04804842919111252, -0.08321867883205414, -0.00345489289611578, 0.08894231170415878, 0.029145363718271255, 0.0839717835187912, -0.01386664155870676, -0.029823163524270058, 0.01939258724451065, -0.02087998017668724, -0.008881993591785431, -0.00505054509267211, -0.026716584339737892, -0.019731486216187477, 0.01577765867114067, -0.027074310928583145, -0.022292060777544975, -0.02837342582643032, -0.03227077051997185, 0.0368647426366806, -0.02694251760840416, -0.032553188502788544, -0.051249146461486816, -0.027808593586087227, 0.005615377798676491, 0.06954972445964813, 0.01347125880420208, -0.038822829723358154, -0.0015297550708055496, -0.02232971601188183, 0.02364766038954258, 0.01559879444539547, 0.015852969139814377, 0.058591973036527634, 0.06122785806655884, -0.0011561417486518621, -0.021501295268535614, -0.034981969743967056, -0.006439092103391886, 0.07192201912403107, 0.053282544016838074, -0.011127202771604061, -0.00495640654116869, -0.023779453709721565, 0.012294523417949677, -0.03735426440834999, -0.02114356867969036, -0.0432661809027195, -0.030971655622124672, -0.007705258671194315, 0.025963474065065384, 0.02344055473804474, 0.015288136899471283, 0.02720610611140728, 0.016088316217064857, 0.051625702530145645, -0.00681564724072814, 0.041797615587711334, 0.0034031167160719633, -0.0009019671124406159, -0.02428780309855938, -0.07049111276865005, -0.07147015631198883, -0.026076439768075943, 0.000858427956700325, 0.024212492629885674, -0.04002780467271805, -0.02502208575606346, 0.005558894481509924, 0.00510232150554657, 0.0004309790674597025, 0.023421727120876312, 0.0015344619750976562, 0.021614262834191322, -0.04808608442544937, -0.06536996364593506, 0.025869334116578102, 0.006994511000812054, -0.0008001795504242182, 0.03511376306414604, -0.04044201597571373, 0.011334308423101902, 0.06729039549827576, -0.04842498525977135, -0.0032148391474038363, 0.017942849546670914, 0.028975915163755417, -0.026641272008419037, 0.01235100720077753, -0.01190855447202921, -0.03324981406331062, -0.003497255500406027, -0.01102364994585514, 0.04236244782805443, 0.01052471436560154, 0.04394397884607315, 0.007907656952738762, -0.031272899359464645, 0.0009961058385670185, 0.04424522444605827, -0.06879661232233047, -0.027337899431586266, 0.02513505145907402, -0.02609526738524437, -0.03306153789162636, -0.08231494575738907, -0.05855431780219078, -0.029898473992943764, 0.01604124717414379, 0.0284299086779356, 0.05117383599281311, -0.0058883801102638245, -0.0023511159233748913, -0.062093935906887054, -0.04160933941602707, 0.029352469369769096, 0.03991483896970749, 0.07516039907932281, 0.033927612006664276, -0.010166987776756287, -0.019750313833355904, -0.02545512467622757, 0.0045869117602705956, -0.014789201319217682, 0.02816632017493248, -0.0070886495523154736, 0.004255072679370642, 0.021237706765532494, -0.012680492363870144, -0.021331846714019775, 0.012736976146697998, -0.003932647407054901, 0.048914507031440735, -0.003676119027659297, 0.013301808387041092, 0.0009784548310562968, -0.00825126376003027, -0.03788144141435623, 0.02737555466592312, 0.032553188502788544, -0.014177299104630947, 0.011193100363016129, 0.05030776187777519, -0.0619809664785862, 0.0394253171980381, -0.02886294759809971, 0.0478224977850914, -0.0361492894589901, 0.017811056226491928, 0.032440222799777985, -0.0007825285429134965, -0.009249133989214897, -0.014036091044545174, 0.011475516483187675, -0.011277824640274048, 0.0006772108026780188, 0.030915172770619392, -0.0994105413556099, 0.043228525668382645, 0.019900936633348465, -0.028975915163755417, 0.017048532143235207, 0.013584224507212639, 0.0015403457218781114, 0.00674975011497736, 0.026057612150907516, 0.007568757515400648, -0.0503830723464489, 0.013584224507212639, -0.034981969743967056, 0.006006053648889065, 0.004829319193959236, 0.0245513916015625, 0.03735426440834999, -0.035207901149988174, -0.0002753559092525393, -0.011240169405937195, 0.05452517792582512, 0.002445254707708955, -0.0002653536794241518, 0.03332512453198433, -0.01572117581963539, -0.01865830458700657, -0.013188841752707958, 0.020541079342365265, 0.04059264063835144, 0.054223932325839996, -0.06160441413521767, -0.03289208561182022, 0.01854533888399601, 0.04002780467271805, -0.005620084702968597, -0.030783379450440407, -0.006542644929140806, -0.04228713735938072, -0.08110996335744858, -0.06424029916524887, -0.024513736367225647, 0.050721969455480576, 0.009559792466461658, -0.011155444197356701, 0.08585456013679504, -0.018027575686573982, 0.0065520587377250195, 0.00528589216992259, -0.02907005324959755, 0.029691368341445923, -0.027300244197249413, -0.0452619232237339, 0.03219546005129814, 0.030425650998950005, 0.009790432639420033, 0.024739669635891914, -0.06088895723223686, 0.005464755930006504, -0.007611119654029608, -0.016464872285723686, -0.01655901037156582, 0.0003130114055238664, -0.022913377732038498, 0.024946775287389755, 0.006081364583224058, -0.03400292620062828, -0.02528567425906658, 0.06296001374721527, -0.0049846479669213295, 0.028034526854753494, 0.006490868516266346, 0.020108042284846306, 0.073014035820961, -0.021990817040205002, 0.037542544305324554, 0.003946768119931221, -0.004163287114351988, -0.0530189573764801, -0.006782698445022106, -0.027865076437592506, -0.018771272152662277, -0.037806130945682526, 0.06627369672060013, -0.04842498525977135, -0.053809721022844315, -0.0665372833609581, -0.021821368485689163, 0.008157124742865562, -0.03767433762550354, 0.020842324942350388, -0.03315567597746849, -0.07263747602701187, -0.02402421459555626, -0.007785276509821415, 0.020070387050509453, 0.07900125533342361, -0.03901110589504242, 0.005864845588803291, 0.0055777220986783504, 0.019844453781843185, -0.028524048626422882, 0.013264153152704239, -0.02513505145907402, -0.0053753238171339035, 0.03788144141435623, 0.048123739659786224, -0.02848639339208603, -0.002981845522299409, -0.006519109942018986, 0.030406823381781578, -0.06047474592924118, 0.05734933912754059, -0.02014569751918316, 0.04213651642203331, 0.05350847914814949, 0.0011502581182867289, -0.03995249420404434, 0.10144393891096115, -0.06036178022623062, 0.03620577231049538, 0.09669934958219528, -0.07147015631198883, -0.0814865231513977, 0.012849942781031132, 0.01557055301964283, 0.021501295268535614, -0.062357522547245026, -0.01195562444627285, -0.017208566889166832, 0.03343809396028519, 0.031329382210969925, 0.01418671291321516, 0.060813646763563156, 0.049818240106105804, -0.02816632017493248, 0.012991150841116905, -0.03183773159980774, 0.03070806711912155, -0.03304271027445793, 0.02492794767022133, -0.07523570954799652, -0.03957594186067581, -0.017811056226491928, -0.003271322464570403, -0.026001129299402237, 0.021990817040205002, 0.03565976768732071, 0.01565527729690075, -0.034417133778333664, -0.01918548159301281, -0.03645053133368492, 0.021294189617037773, 0.03539617732167244, 0.01568351872265339, 0.0009743362898007035, -0.029559575021266937, 0.013904296793043613, -0.0032077787909656763, -0.04819905012845993, 0.007060408126562834, 0.03682708740234375, -0.05128680169582367, -0.045412544161081314, 0.04040436074137688, -0.013593639247119427, 0.003033621935173869, -0.004379806574434042, -0.005737758241593838, 0.049931205809116364, -0.011174272745847702, -0.014996306970715523, -0.020541079342365265, 0.0459020659327507, 0.05207756906747818, 0.024645531550049782, 0.01214390154927969, 0.03965125232934952, -0.0004998180666007102, -0.03968890756368637, 0.059872258454561234, -0.014365577138960361, 0.02560574561357498, -0.0000829597920528613, -0.015259895473718643, -0.0005171748925931752, -0.018987789750099182, -0.054713454097509384, -0.035471487790346146, -0.018027575686573982, 0.0007654658984392881, -0.056031398475170135, -0.04680579900741577, 0.03012440726161003, 0.022292060777544975, 0.02434428595006466, -0.009282083250582218, 0.0206728745251894, 0.01195562444627285, -0.036318738013505936, -0.009573913179337978, 0.026321200653910637, -0.0320260114967823, -0.00516821863129735, -0.012416903860867023, 0.013678363524377346, 0.01402667723596096, 0.010185815393924713, 0.0010790657252073288, 0.006288470234721899, 0.01828175038099289, 0.023459382355213165, 0.0026288251392543316, -0.042061202228069305, -0.00714513286948204, 0.0005698337336070836, -0.025530435144901276, 0.010835372842848301, 0.042324792593717575, 0.05633264034986496, -0.025699885562062263, -0.0022487398236989975, 0.01732153445482254, 0.057688239961862564, -0.026377683505415916, 0.012831115163862705, 0.03018089011311531, -0.03390878438949585, 0.034191202372312546, -0.007338117342442274, -0.030576273798942566, -0.027017828077077866, -0.000615432218182832, 0.05915680527687073, 0.10114269703626633, -0.0033395730424672365, -0.01395136583596468, -0.005638912320137024, -0.021971989423036575, 0.014535026624798775, 0.0839717835187912, -0.015636449679732323, -0.043755702674388885, 0.03428534045815468, 0.06838240474462509, 0.00850073155015707, 0.005361203104257584, 0.021218879148364067, 0.01755688153207302, 0.010825959034264088, 0.00850073155015707, -0.05384737625718117, 0.005521239247173071, 0.006674439180642366, -0.029521919786930084, -0.016756702214479446, -0.006490868516266346, -0.00008781382348388433, -0.04545019939541817, 0.016841426491737366, 0.08886700123548508, 0.036318738013505936, -0.009272669441998005 ]
31,926
sonetel.account
get
Get information about your Sonetel account. :returns: The account information if the request was processed successfully.
def get(self) -> dict: """ Get information about your Sonetel account. :returns: The account information if the request was processed successfully. """ return util.send_api_request( token=self._token, uri=self._url, method='get', )
(self) -> dict
[ 0.014803837984800339, -0.033611174672842026, 0.01215607114136219, 0.0007250650669448078, 0.032719485461711884, 0.00413088034838438, -0.013757470063865185, -0.06292768567800522, 0.0037419043947011232, 0.02138231135904789, -0.007633939851075411, -0.06369198858737946, 0.05022568255662918, -0.0006050739320926368, 0.028934361413121223, -0.01431250013411045, 0.044074855744838715, -0.009763072244822979, 0.030790528282523155, 0.003653190564364195, 0.012656508013606071, -0.0007825015927664936, 0.06711316108703613, 0.025658773258328438, -0.03390233591198921, 0.030626747757196426, 0.0428738072514534, 0.0025681520346552134, 0.032555706799030304, 0.014731047675013542, -0.011682930402457714, -0.014621861279010773, 0.029716862365603447, 0.017742767930030823, -0.042946599423885345, 0.0321553573012352, -0.015286077745258808, 0.02953488565981388, -0.11100603640079498, 0.03317442908883095, -0.0682414174079895, 0.0005081142298877239, 0.08341830968856812, 0.010017840191721916, 0.018743643537163734, -0.00011963573342654854, 0.006592120975255966, 0.024111967533826828, -0.006974272895604372, -0.02160068415105343, 0.03890670835971832, 0.04520311579108238, -0.04200031980872154, -0.07715829461812973, 0.0024817129597067833, -0.04367450624704361, -0.012328949756920338, 0.0014376192120835185, -0.010818539187312126, 0.03999856859445572, 0.033247217535972595, -0.03912508115172386, -0.0004614825884345919, -0.00839824415743351, -0.0007114167674444616, 0.019234981387853622, -0.020836379379034042, 0.022674348205327988, 0.021709870547056198, 0.003973925020545721, 0.08458296209573746, 0.013948545791208744, -0.05757755786180496, 0.003332455875352025, -0.017879251390695572, -0.047750793397426605, -0.014203313738107681, -0.038688335567712784, -0.055321041494607925, -0.004303758963942528, -0.011883105151355267, -0.0027501292061060667, -0.012219763360917568, 0.009881357662379742, -0.023183884099125862, 0.048442307859659195, 0.024512317031621933, -0.08596599102020264, -0.06536617875099182, 0.0613262876868248, -0.03803321719169617, 0.032282739877700806, -0.04931579902768135, 0.0032801374327391386, 0.02351144328713417, -0.03039017878472805, -0.027842499315738678, 0.024985458701848984, -0.019471550360322, 0.04356532171368599, -0.03171861171722412, 0.044547997415065765, -0.0360860601067543, 0.05870581790804863, 0.035958677530288696, -0.02980785071849823, -0.011755721643567085, 0.0017105848528444767, 0.07384631037712097, 0.01936236582696438, -0.0488426573574543, 0.03395693004131317, -0.009753973223268986, 0.0035508284345269203, -0.0014888002770021558, -0.012119675986468792, 0.0062600127421319485, 0.04240066930651665, -0.04298299551010132, -0.03887031227350235, 0.014785640873014927, 0.02101835608482361, 0.028188254684209824, -0.04331055283546448, 0.05204545333981514, 0.022419581189751625, -0.0428738072514534, 0.0008228777442127466, 0.04240066930651665, -0.006724054459482431, -0.0181795135140419, -0.01393944676965475, 0.010709352791309357, -0.011591942049562931, 0.0005194877739995718, 0.0007062986842356622, 0.0311362836509943, 0.028443023562431335, -0.01605038158595562, 0.0898239016532898, -0.017133144661784172, 0.01972631923854351, -0.025313016027212143, -0.02953488565981388, -0.04312857612967491, -0.010208915919065475, 0.013930347748100758, -0.039489034563302994, 0.056485697627067566, -0.021873649209737778, 0.06707676500082016, 0.018461577594280243, 0.05743197724223137, -0.028188254684209824, -0.08865924924612045, -0.0011510052718222141, 0.029625874012708664, 0.008157123811542988, 0.0018846004968509078, 0.011209790594875813, -0.05044405534863472, 0.004465263336896896, -0.00008587045158492401, -0.09193483740091324, 0.010618364438414574, -0.003264214377850294, -0.031227272003889084, 0.015495351515710354, 0.029098140075802803, -0.03155483305454254, -0.045821838080883026, -0.027496742084622383, -0.07151700556278229, -0.03008081763982773, 0.031645819544792175, -0.055539414286613464, 0.029917037114501, -0.01726962812244892, -0.0120741818100214, -0.017742767930030823, -0.03379315137863159, -0.06598490476608276, -0.024512317031621933, 0.0363590270280838, 0.03941624239087105, -0.018497973680496216, 0.06136268377304077, 0.018998410552740097, -0.03395693004131317, 0.04170915484428406, 0.007097107358276844, 0.005968849174678326, -0.027660520747303963, 0.022001033648848534, -0.022692546248435974, -0.02878877893090248, 0.028279243037104607, -0.028552209958434105, -0.07621201872825623, -0.019289573654532433, -0.018743643537163734, 0.010818539187312126, -0.02030864544212818, 0.00459947157651186, 0.021728066727519035, -0.03071773611009121, 0.03530355915427208, -0.014003138989210129, 0.017669977620244026, 0.0156682301312685, -0.010654759593307972, -0.00812072865664959, -0.04800556227564812, 0.009899554774165154, 0.012583717703819275, -0.010945923626422882, 0.018743643537163734, -0.025458598509430885, 0.011209790594875813, -0.004895184189081192, 0.011801215820014477, -0.06351001560688019, 0.017888350412249565, -0.05484790354967117, -0.05299173668026924, 0.01936236582696438, 0.016177766025066376, -0.032919660210609436, -0.07490178197622299, -0.10955022275447845, 0.03342919424176216, -0.027423951774835587, -0.010227113962173462, 0.02906174585223198, -0.0826176106929779, -0.04880626127123833, -0.005063513293862343, 0.009844961576163769, 0.0221830103546381, 0.008725802414119244, 0.05077161639928818, 0.010199816897511482, -0.02223760262131691, 0.06420152634382248, -0.05146312713623047, -0.029625874012708664, 0.011118801310658455, 0.04207310825586319, -0.006655813194811344, -0.07490178197622299, 0.023384058848023415, -0.07810457795858383, 0.027533138170838356, 0.03268308937549591, -0.008734901435673237, -0.10780324041843414, -0.037141527980566025, 0.03956182301044464, 0.023984583094716072, -0.0358130969107151, -0.04196392372250557, -0.012729299254715443, -0.025949936360120773, 0.02660505473613739, 0.0038260689470916986, 0.017997536808252335, -0.014594564214348793, 0.0542655773460865, 0.0181795135140419, -0.009299030527472496, 0.13822981715202332, 0.031536635011434555, -0.02527662180364132, -0.023857200518250465, -0.02303830347955227, -0.028006277978420258, 0.042691830545663834, 0.025895344093441963, -0.022219406440854073, -0.010763945989310741, -0.050626032054424286, -0.031918786466121674, 0.027842499315738678, -0.035649318248033524, -0.03375675529241562, -0.03448466211557388, 0.024494118988513947, 0.02853401191532612, -0.01756989024579525, -0.015559043735265732, 0.009717578068375587, 0.005290984641760588, -0.06398314982652664, -0.043965671211481094, 0.058414652943611145, -0.01950794644653797, -0.04141798987984657, 0.02351144328713417, 0.04116322472691536, 0.0057959710247814655, 0.022801732644438744, -0.015904799103736877, -0.03193698450922966, -0.03301065042614937, 0.029735060408711433, -0.012883979827165604, 0.03510338440537453, 0.011500953696668148, -0.015950294211506844, 0.023420454934239388, -0.026532262563705444, 0.0036622893530875444, 0.05732279270887375, 0.021928241476416588, -0.05757755786180496, -0.03497600182890892, -0.033774953335523605, 0.03199157491326332, 0.04141798987984657, 0.07311840355396271, -0.017142243683338165, 0.04105403646826744, 0.04185473546385765, -0.018907422199845314, 0.05572139099240303, -0.005454764235764742, 0.008762198500335217, 0.066203273832798, -0.01026350911706686, 0.03683216869831085, -0.05102638155221939, -0.0049725244753062725, -0.02201923169195652, -0.015468054451048374, -0.06682199984788895, -0.013802964240312576, 0.017142243683338165, -0.04240066930651665, -0.030626747757196426, 0.015167792327702045, -0.005909706931561232, -0.07577527314424515, 0.017924746498465538, 0.008766747079789639, 0.017588088288903236, 0.018652653321623802, 0.03970740735530853, -0.02245597541332245, -0.012574618682265282, -0.04629497975111008, -0.018943818286061287, 0.022747138515114784, 0.05350127071142197, 0.0468045137822628, 0.04749602824449539, -0.05000730976462364, -0.014894827269017696, 0.005341028328984976, -0.020290447399020195, 0.007078909780830145, -0.04323776066303253, -0.02480348013341427, -0.022310394793748856, 0.04869707673788071, -0.08451016992330551, -0.04472997412085533, 0.013075055554509163, -0.05677685886621475, 0.11923140287399292, -0.029498489573597908, -0.020326843485236168, -0.01540436316281557, -0.035485535860061646, 0.01685108058154583, 0.008070684969425201, 0.051535919308662415, 0.01215607114136219, -0.015604537911713123, -0.024166561663150787, 0.04112682864069939, 0.06241815164685249, 0.03561292216181755, -0.024621503427624702, 0.04727765545248985, 0.06099873036146164, -0.0633644312620163, -0.030899714678525925, 0.016505325213074684, -0.013111450709402561, 0.016887476667761803, 0.005195446778088808, -0.018570763990283012, -0.012747497297823429, 0.0286250002682209, -0.09047902375459671, -0.007529302965849638, -0.03544914349913597, -0.04462078958749771, -0.06085314601659775, 0.020235855132341385, 0.042145900428295135, -0.0076657859608531, 0.03470303490757942, 0.009335425682365894, -0.0398893840610981, -0.04553067311644554, 0.010536475107073784, -0.08865924924612045, 0.018552565947175026, -0.00417864928022027, -0.07249968498945236, -0.03524896875023842, 0.00160026119556278, -0.020199459046125412, 0.023802606388926506, -0.016805587336421013, -0.0009570858674123883, 0.0757024809718132, 0.017469802871346474, 0.03726891428232193, 0.010736649855971336, -0.08341830968856812, -0.015895700082182884, 0.01925317943096161, -0.030899714678525925, 0.02249237149953842, 0.0043014842085540295, 0.018416084349155426, 0.02121853083372116, -0.019799109548330307, 0.02938930317759514, 0.006141727790236473, -0.03483042120933533, -0.046731721609830856, 0.013684678822755814, 0.03341099992394447, -0.013056857511401176, -0.016532620415091515, -0.006669461261481047, -0.009371821768581867, -0.0038169699255377054, 0.011391767300665379, -0.006514780689030886, -0.03206436708569527, 0.04782358556985855, -0.017669977620244026, -0.044438812881708145, -0.015195089392364025, 0.05058963969349861, -0.05765035003423691, -0.03577670082449913, 0.022164812311530113, 0.019580736756324768, -0.006564824376255274, -0.014139621518552303, -0.03699594736099243, -0.010654759593307972, -0.011983193457126617, 0.036013271659612656, 0.012228862382471561, 0.0006346451700665057, 0.024566911160945892, -0.03370216116309166, 0.03257390484213829, 0.04472997412085533, -0.03359297662973404, 0.039052288979291916, 0.05215464159846306, 0.006514780689030886, -0.0542655773460865, 0.020272251218557358, -0.012228862382471561, -0.04469357803463936, 0.023020105436444283, 0.032828669995069504, 0.0041468036361038685, 0.004763251170516014, 0.021728066727519035, -0.041199617087841034, -0.03668658807873726, -0.03220994770526886, 0.019817307591438293, -0.004346978385001421, -0.030353782698512077, 0.01563183404505253, -0.05230022221803665, 0.008821340277791023, 0.009226239286363125, -0.005659488029778004, -0.01972631923854351, 0.032919660210609436, 0.01826140284538269, -0.036395423114299774, 0.012574618682265282, -0.05109917372465134, 0.04447520524263382, -0.014567268081009388, 0.005686784628778696, 0.0066194175742566586, 0.018516171723604202, -0.006801394745707512, -0.037560075521469116, 0.0508808009326458, -0.000593700329773128, -0.020399633795022964, -0.014458081685006618, -0.044438812881708145, 0.0632188469171524, 0.0693332776427269, 0.02682342752814293, 0.02420295588672161, 0.021309519186615944, -0.006332803517580032, -0.04880626127123833, 0.01972631923854351, 0.0005954063963145018, 0.001085607218556106, 0.03726891428232193, -0.015559043735265732, -0.015267879702150822, 0.026641448959708214, 0.027969881892204285, 0.050626032054424286, 0.03341099992394447, -0.027769707143306732, 0.04360171779990196, -0.04975254461169243, -0.002672788919880986, -0.0637647807598114, 0.026896217837929726, 0.03524896875023842, -0.004267363343387842, -0.04567625746130943, -0.06445629149675369, -0.010800342075526714, -0.00441294489428401, -0.0757024809718132, -0.030535759404301643, 0.021072950214147568, 0.020672600716352463, 0.043164972215890884, -0.06383757293224335, -0.030881516635417938, 0.009526502341032028, -0.0757024809718132, -0.03166401758790016, -0.007047063671052456, 0.015950294211506844, 0.01941695809364319, -0.021309519186615944, 0.060489192605018616, -0.02160068415105343, 0.056594882160425186, -0.05972488969564438, -0.016559917479753494, 0.05288254842162132, -0.0542655773460865, -0.057140812277793884, -0.026332087814807892, -0.008498331531882286, 0.014339796267449856, -0.04600381478667259, -0.07497457414865494, 0.04312857612967491, -0.027642324566841125, -0.034357279539108276, 0.030426573008298874, 0.03952543064951897, -0.013493603095412254, -0.004485735669732094, 0.021473299711942673, 0.0687873512506485, 0.010463683865964413, 0.05765035003423691, 0.027533138170838356, 0.020672600716352463, 0.009526502341032028, 0.0010520551586523652, 0.05022568255662918, 0.0026932612527161837, 0.021764462813735008, 0.017005762085318565, 0.003079962683841586, -0.0006443127058446407, 0.023438652977347374, -0.013711975887417793, -0.02671424113214016, -0.03832438215613365, 0.0613262876868248, 0.02372981607913971, -0.013575492426753044, -0.0229291170835495, -0.010727550834417343, -0.009267184883356094, 0.00835729856044054, 0.034739430993795395, -0.013502702116966248, -0.04869707673788071, 0.010554672218859196, 0.017142243683338165, 0.00041541963582858443, 0.05069882422685623, -0.013730172999203205, -0.05961570143699646, 0.004808745346963406, 0.015313373878598213, -0.028661396354436874, -0.03510338440537453, 0.01956254057586193, -0.05437476187944412, 0.0344664640724659, -0.055211856961250305, -0.045130323618650436, 0.01740611158311367, -0.005873311311006546, 0.07344596087932587, 0.018497973680496216, 0.008006992749869823, 0.0013136472553014755, 0.012101477943360806, 0.06234535947442055, 0.035958677530288696, -0.04542148858308792, 0.0641651302576065, -0.028497615829110146, 0.017060354351997375, 0.07242689281702042, 0.016423434019088745, -0.073809914290905, 0.014539971016347408, -0.042473457753658295, 0.026750635355710983, -0.0008188970386981964, -0.005541203077882528, -0.02100015990436077, 0.008311804383993149, 0.048333123326301575, -0.03295605629682541, -0.011337174102663994, 0.058196280151605606, 0.00505441427230835, 0.0887320414185524, -0.010399991646409035, 0.05517546087503433, -0.023911792784929276, 0.07239049673080444, -0.06693118065595627, 0.0018664028029888868, 0.015185990370810032, -0.021145740523934364, -0.040180545300245285, 0.012410839088261127, 0.015504450537264347, 0.0583418644964695, -0.038360774517059326, -0.05317371338605881, -0.00034859991865232587, 0.012647409923374653, -0.033192627131938934, -0.00038385798688977957, -0.03854275122284889, -0.015531746670603752, 0.006423792336136103, -0.05815988406538963, -0.020126668736338615, -0.016841981559991837, -0.06361919641494751, -0.014403488487005234, 0.033938731998205185, -0.010427288711071014, 0.030572155490517616, 0.04738683998584747, 0.04800556227564812, -0.0007313205278478563, -0.011227987706661224, 0.01776096597313881, -0.023693419992923737, -0.007269985508173704, 0.008448287844657898, 0.02431214228272438, 0.04494834691286087, -0.015431659296154976, 0.03077233023941517, 0.02922552451491356, 0.006933328229933977, 0.04873347282409668, 0.013921249657869339, -0.017861053347587585, -0.06886014342308044, 0.002918458078056574, -0.04498474299907684, -0.07621201872825623, -0.042691830545663834, 0.06602130085229874, 0.08218086510896683, 0.0037419043947011232, -0.03455745428800583, 0.029662270098924637, 0.03417530283331871, 0.03956182301044464, 0.030062619596719742, -0.0404353141784668, 0.04130880534648895, 0.02085457742214203, 0.016841981559991837, -0.008307254873216152, 0.023420454934239388, -0.037560075521469116, -0.014385290443897247, 0.029134536162018776, 0.0028979855123907328, 0.05528464913368225, 0.0393434539437294, -0.00013427920930553228, -0.012010489590466022, 0.008066135458648205, -0.0383971706032753, 0.03861554339528084, -0.04826033115386963, 0.06041640043258667, -0.010791243053972721, -0.04403846338391304, 0.044766370207071304, -0.0036827619187533855, 0.059215351939201355, 0.06947886198759079, 0.02010847069323063, 0.0010981181403622031, -0.006642164662480354, 0.024330340325832367, -0.008666659705340862, -0.029443897306919098, -0.05586697533726692, 0.06372838467359543, -0.004624493420124054, -0.0008621165761724114, -0.02394818887114525, 0.011000516824424267, 0.03481222316622734, 0.02687801979482174, 0.04862428456544876, 0.037450890988111496, 0.013102352619171143, -0.014085028320550919, -0.004410670138895512, 0.011692029424011707, 0.01715134270489216, -0.04072647914290428, 0.033884137868881226, 0.051426731050014496, 0.051426731050014496, 0.00667856028303504, 0.07344596087932587, 0.0017594912787899375, -0.010445486754179, 0.009763072244822979, -0.026113715022802353, 0.016623608767986298, 0.04250985383987427, 0.022583359852433205, 0.014166918583214283, 0.01135537214577198, -0.02463970147073269, 0.027969881892204285, 0.009208042174577713, 0.03171861171722412, 0.03146384283900261, 0.0234022568911314 ]
31,927
sonetel.account
get_accountid
Get your account ID. :returns: String. Sonetel account ID.
def get_accountid(self) -> str: """ Get your account ID. :returns: String. Sonetel account ID. """ return self._accountid
(self) -> str
[ -0.021444033831357956, -0.029476206749677658, 0.0520036518573761, 0.027664298191666603, 0.042850710451602936, -0.027795054018497467, 0.01600830815732479, -0.00006081773608457297, 0.00401375163346529, -0.020099112764000893, -0.03648100793361664, -0.02979375794529915, 0.0020524070132523775, -0.003880660282447934, -0.002729537896811962, -0.008326374925673008, 0.0388159416615963, 0.008443121798336506, 0.03171774372458458, -0.0005052213673479855, 0.012767419219017029, 0.04557791352272034, 0.04232768341898918, 0.0026781694032251835, -0.040758609771728516, 0.07475525140762329, 0.04886550083756447, 0.018548715859651566, -0.005398367531597614, -0.005459075793623924, -0.007994813844561577, -0.02172422595322132, 0.041879378259181976, 0.03508004918694496, -0.029196014627814293, -0.026506170630455017, -0.03201661631464958, 0.07494204491376877, -0.10520278662443161, 0.001209495821967721, -0.013804130256175995, 0.07236427813768387, 0.11865200847387314, -0.00981606263667345, -0.04501752927899361, -0.009722664952278137, 0.022415366023778915, -0.015438583679497242, -0.03664912283420563, 0.012907515279948711, 0.042290326207876205, 0.03550967574119568, -0.04176729917526245, -0.055515389889478683, -0.0024983794428408146, 0.0008750164997763932, 0.022191213443875313, -0.01167467050254345, -0.03937632590532303, 0.029420169070363045, -0.02011779136955738, -0.05611313506960869, -0.0020605793688446283, -0.028841104358434677, 0.023424057289958, 0.04453186318278313, -0.015821512788534164, 0.05095760151743889, 0.029270732775330544, 0.014485931023955345, 0.04512960463762283, -0.012403169646859169, -0.03227812796831131, 0.0015153721906244755, 0.006934754084795713, -0.04300014674663544, -0.016792844980955124, 0.013869508169591427, -0.0188756063580513, 0.0209957268089056, 0.02745882421731949, 0.0007874565199017525, -0.005865354090929031, 0.027664298191666603, 0.008293685503304005, 0.007116878870874643, 0.013066290877759457, -0.03741498291492462, -0.05947544053196907, 0.03321210294961929, -0.0037685835268348455, -0.002970036119222641, -0.03937632590532303, 0.0222098920494318, -0.008910108357667923, -0.04561527073383331, 0.004588145297020674, 0.006948763504624367, 0.002836944768205285, 0.058242592960596085, -0.04498016834259033, 0.04643716663122177, -0.0036028032191097736, 0.03265171870589256, 0.0033366207499057055, -0.04643716663122177, -0.043896760791540146, -0.0019858614541590214, 0.05491764843463898, 0.026524851098656654, -0.015223769471049309, 0.01797899231314659, -0.039226893335580826, 0.002380465157330036, -0.0006491116364486516, -0.029420169070363045, -0.0005989105557091534, 0.029121296480298042, 0.004709561821073294, -0.0325956791639328, 0.0394136868417263, 0.003236218588426709, -0.046250373125076294, -0.018445977941155434, 0.05857882648706436, 0.010609940625727177, -0.04666132107377052, 0.01452329009771347, 0.019576087594032288, -0.03169906511902809, 0.013607995584607124, -0.016867563128471375, 0.024208595976233482, -0.06175433471798897, 0.021313278004527092, 0.016064345836639404, 0.07770660519599915, 0.0651913583278656, -0.03543495759367943, 0.10654771327972412, -0.007630564272403717, 0.04755793511867523, -0.026861080899834633, -0.03524816408753395, -0.03125075623393059, 0.024918416514992714, -0.022564802318811417, 0.00166597543284297, -0.0004515178734436631, -0.01855805516242981, 0.03519212454557419, -0.0012550270184874535, 0.039787277579307556, 0.05506708472967148, -0.07740773260593414, 0.01829654350876808, 0.008359063416719437, -0.005337659269571304, 0.0360887385904789, -0.052451957017183304, 0.0026781694032251835, -0.012758079916238785, 0.03341757506132126, -0.07273786514997482, 0.016157742589712143, 0.0045157624408602715, -0.001998703461140394, 0.014710084535181522, 0.03405267745256424, -0.032315485179424286, -0.020341945812106133, -0.026338055729866028, -0.08816710859537125, 0.02067817561328411, -0.04658660292625427, 0.01074069645255804, 0.023218583315610886, 0.011982881464064121, 0.00038935025804676116, 0.05256403610110283, -0.02785109356045723, -0.013664034195244312, 0.026991836726665497, 0.05902713164687157, 0.08622444421052933, -0.009017514996230602, 0.0779307559132576, 0.02882242575287819, 0.027402786538004875, -0.018912965431809425, 0.019744202494621277, -0.000429044128395617, -0.038591790944337845, 0.014962256886065006, -0.03717214986681938, -0.024488788098096848, 0.025292005389928818, -0.0735224038362503, -0.07598809152841568, -0.041879378259181976, 0.01916513778269291, 0.046549245715141296, -0.0391148142516613, -0.010236350819468498, 0.052526675164699554, -0.011870804242789745, 0.026431452482938766, -0.0006654561730101705, -0.009162280708551407, -0.012935534119606018, -0.004660528153181076, -0.036499690264463425, -0.02824336290359497, 0.05917656794190407, 0.03595798462629318, -0.04251447692513466, -0.013355822302401066, -0.016578031703829765, 0.013047611340880394, 0.06351020187139511, 0.054133109748363495, -0.051630061119794846, 0.012141657061874866, -0.09601248800754547, -0.020939689129590988, 0.0005837334902025759, 0.02979375794529915, -0.0328945517539978, -0.03752705827355385, -0.06933820247650146, 0.01556934043765068, 0.0006847194163128734, -0.0208462905138731, 0.04266391322016716, -0.04113219678401947, -0.05641200765967369, -0.040347661823034286, -0.018399279564619064, -0.006593853700906038, 0.011310419999063015, -0.015223769471049309, 0.029831117019057274, 0.0523025207221508, 0.09257546067237854, -0.01749332621693611, 0.008690624497830868, -0.02792581170797348, 0.07419486343860626, -0.0027645619120448828, -0.06455625593662262, 0.013430540449917316, -0.09108110517263412, -0.012263073585927486, 0.04251447692513466, 0.01946401037275791, -0.05757013335824013, -0.03205397352576256, 0.0700480192899704, -0.028523553162813187, -0.0259271077811718, -0.030783770605921745, -0.05891505628824234, -0.040198225528001785, -0.017259832471609116, 0.004833313636481762, 0.001785057014785707, -0.027626939117908478, 0.06369700282812119, 0.04804360121488571, -0.01904372125864029, 0.14652177691459656, 0.03732158616185188, -0.044718656688928604, 0.001956674735993147, -0.022265931591391563, -0.07666055113077164, -0.004529771860688925, 0.06832951307296753, -0.05626257136464119, -0.024339351803064346, -0.04512960463762283, 0.004686212632805109, 0.03825555741786957, -0.003866650862619281, 0.009157611057162285, -0.04908965155482292, 0.013355822302401066, -0.01425243727862835, -0.03870386630296707, 0.0038573110941797495, -0.019744202494621277, -0.0029023229144513607, -0.055664826184511185, -0.007028151303529739, 0.01320638693869114, -0.004639513790607452, -0.01086211297661066, 0.010488524101674557, 0.034967973828315735, -0.026338055729866028, -0.01795097254216671, 0.0360887385904789, -0.04191673547029495, -0.03149358928203583, -0.029158655554056168, 0.008060192689299583, -0.009409784339368343, -0.00317784515209496, 0.023237263783812523, 0.031176039949059486, -0.03732158616185188, 0.02753354236483574, 0.014663386158645153, 0.04217824712395668, -0.008060192689299583, -0.019893638789653778, -0.022490084171295166, 0.014598007313907146, 0.0173625685274601, 0.08487952500581741, -0.03519212454557419, 0.01639123633503914, 0.04613829776644707, -0.011824105866253376, 0.03504268825054169, 0.0416925810277462, -0.035696472972631454, 0.05577690526843071, -0.02712259441614151, 0.042066171765327454, -0.07718358188867569, -0.01223505474627018, -0.013477238826453686, -0.027346746996045113, -0.03003659099340439, -0.0704963281750679, 0.04217824712395668, -0.03332417830824852, -0.012001561000943184, -0.0003800105187110603, 0.023480096831917763, -0.0783790647983551, 0.015756133943796158, 0.008125570602715015, -0.0015795829240232706, 0.013794790022075176, 0.013897527009248734, -0.02687976136803627, 0.010245690122246742, -0.021294597536325455, 0.021686866879463196, -0.008835390210151672, 0.020491380244493484, 0.021070444956421852, 0.030466219410300255, -0.05555275082588196, -0.02745882421731949, 0.05626257136464119, -0.006308991927653551, 0.02036062441766262, -0.0694502741098404, -0.11147908866405487, 0.025796351954340935, 0.021911021322011948, -0.07453109323978424, 0.027869772166013718, -0.07516619563102722, -0.047595296055078506, 0.11835313588380814, -0.010385786183178425, -0.027309387922286987, 0.0028392798267304897, -0.00549176475033164, -0.03571515157818794, -0.0010816581780090928, 0.04408355429768562, 0.019576087594032288, 0.00893812719732523, -0.03300662711262703, -0.005879363976418972, 0.02510521002113819, 0.0009182128123939037, 0.02841147780418396, 0.068516306579113, -0.010217671282589436, -0.0029513565823435783, -0.02405915968120098, -0.025404082611203194, -0.04120691493153572, 0.025478800758719444, 0.019501369446516037, 0.015223769471049309, -0.002336101606488228, -0.0009386434685438871, -0.09526530653238297, -0.04348581284284592, -0.047520577907562256, -0.04733378440141678, -0.023368019610643387, 0.016167083755135536, 0.024937095120549202, -0.029326772317290306, 0.057121824473142624, 0.026207299903035164, -0.03571515157818794, -0.0017500329995527864, 0.024731621146202087, -0.024339351803064346, -0.012571284547448158, -0.010609940625727177, -0.08644859492778778, -0.007597875315696001, 0.013467899523675442, -0.04923908784985542, 0.06317397207021713, -0.015093013644218445, -0.014140360057353973, 0.03855443000793457, 0.0037078752648085356, 0.010591261088848114, -0.02872902899980545, -0.027626939117908478, -0.033679086714982986, 0.0700480192899704, -0.06332340836524963, 0.02760826051235199, 0.039787277579307556, 0.04651188477873802, 0.029177336022257805, -0.0023349339608103037, -0.008629916235804558, 0.01824050396680832, -0.023517455905675888, -0.03679855912923813, 0.0327451154589653, 0.01787625439465046, 0.01590557023882866, -0.007513817865401506, -0.022751597687602043, -0.00191581342369318, 0.02140667475759983, -0.013953565619885921, -0.0009497344144620001, -0.042701274156570435, 0.050584010779857635, -0.03877858445048332, -0.06634948402643204, 0.016839543357491493, 0.04385939985513687, -0.03306266665458679, 0.001304060686379671, 0.05585162341594696, 0.005879363976418972, -0.042290326207876205, -0.017521344125270844, -0.058466747403144836, -0.040198225528001785, -0.036182139068841934, 0.03833027556538582, -0.0348745733499527, -0.0445692203938961, 0.056636158376932144, -0.020510060712695122, 0.030783770605921745, 0.03960048034787178, -0.002864964073523879, 0.0259271077811718, 0.016839543357491493, 0.014074982143938541, 0.001746530644595623, 0.029009221121668816, -0.01972552202641964, -0.024358032271265984, 0.04255183786153793, 0.03113868087530136, 0.021294597536325455, -0.0034090036060661077, 0.0003225127584300935, -0.06384643912315369, -0.0004766184138134122, -0.026356736198067665, 0.028467515483498573, -0.00024823268176987767, 0.004767935257405043, 0.013430540449917316, -0.02301310934126377, 0.01202957984060049, -0.002338436432182789, -0.020416663959622383, -0.013897527009248734, 0.04217824712395668, 0.030970564112067223, -0.052676111459732056, 0.0018866267055273056, -0.01513037271797657, -0.006369700189679861, 0.020155150443315506, 0.024843698367476463, -0.028056567534804344, 0.0016834874404594302, -0.030148668214678764, -0.056860312819480896, 0.021761585026979446, -0.034164756536483765, 0.02770165726542473, -0.02695447765290737, -0.0833851620554924, 0.06422002613544464, 0.02060345746576786, -0.0023232593666762114, 0.024656902998685837, -0.011030228808522224, -0.01203892007470131, -0.03222208842635155, 0.025460120290517807, 0.014906219206750393, 0.009956158697605133, 0.015672076493501663, -0.017549363896250725, 0.002305747242644429, -0.0247876588255167, -0.024096518754959106, -0.008293685503304005, 0.00383162684738636, 0.004861332476139069, 0.0444197840988636, -0.07057104259729385, 0.006897395011037588, -0.04628773033618927, 0.05480557307600975, -0.0155413206666708, -0.0036214827559888363, -0.03748970106244087, -0.03125075623393059, -0.016475293785333633, 0.03444494679570198, -0.12560077011585236, -0.04064653068780899, 0.03571515157818794, 0.032390203326940536, -0.013953565619885921, -0.05248931795358658, -0.053983673453330994, 0.001046050456352532, -0.03933896869421005, -0.02461954392492771, -0.02841147780418396, 0.04845454916357994, -0.014159039594233036, 0.0027528873179107904, 0.0835345983505249, -0.022340647876262665, 0.042290326207876205, -0.06478040665388107, 0.014579327777028084, 0.010189652442932129, -0.04789416491985321, -0.023311981931328773, -0.01075003668665886, 0.011506554670631886, -0.0024400060065090656, -0.022116495296359062, -0.01965080387890339, 0.014429892413318157, 0.013103649951517582, -0.03711611032485962, 0.0030073949601501226, -0.045279040932655334, -0.014626027084887028, -0.0019741866271942854, -0.018530037254095078, 0.03709743171930313, 0.03082112967967987, 0.07568921893835068, -0.0756518617272377, 0.007929435931146145, -0.005211572628468275, 0.004903361666947603, 0.03519212454557419, 0.03663044422864914, -0.01658737100660801, 0.01710105687379837, 0.022004418075084686, -0.013141009025275707, -0.02527332678437233, -0.015672076493501663, -0.021537430584430695, 0.0028276049997657537, 0.057831645011901855, -0.0043966807425022125, -0.03218473121523857, -0.01303827203810215, -0.03483721613883972, -0.006122197024524212, 0.025777671486139297, 0.0024726951960474253, 0.026935799047350883, -0.06392115354537964, 0.023293301463127136, -0.025983145460486412, 0.027739016339182854, 0.07273786514997482, -0.002881308551877737, 0.03343625366687775, 0.041879378259181976, 0.00981606263667345, -0.041729941964149475, -0.05248931795358658, -0.010367106646299362, -0.016521994024515152, -0.02461954392492771, -0.03483721613883972, 0.012748739682137966, 0.012048259377479553, 0.0035794537980109453, 0.04363524541258812, 0.03478117659687996, -0.028056567534804344, -0.004730576183646917, 0.008106891065835953, 0.00798080489039421, 0.07412014901638031, -0.03663044422864914, 0.00942379329353571, -0.037938009947538376, 0.014140360057353973, 0.028523553162813187, -0.01790427416563034, -0.04023558273911476, -0.006579844281077385, -0.0703468918800354, 0.007144898176193237, 0.0006841356516815722, -0.04763265326619148, 0.001151706208474934, 0.03582722693681717, 0.008718643337488174, -0.00659852335229516, -0.01904372125864029, 0.018940985202789307, 0.02882242575287819, 0.06257623434066772, -0.031755100935697556, 0.049948908388614655, 0.011114286258816719, 0.05495500564575195, -0.07255107164382935, -0.044868092983961105, -0.03728422522544861, -0.024675583466887474, -0.07830435037612915, 0.003198859514668584, -0.01303827203810215, 0.060820359736680984, -0.008975486271083355, -0.015233109705150127, -0.018007012084126472, 0.04243976250290871, -0.023872366175055504, -0.014159039594233036, -0.015924250707030296, -0.01037644688040018, -0.04378468170762062, -0.05876561999320984, -0.02036062441766262, -0.03310002386569977, -0.018455319106578827, -0.017016999423503876, 0.0014079652028158307, -0.026263337582349777, 0.020510060712695122, 0.049612678587436676, 0.020939689129590988, -0.03296926990151405, -0.00543572660535574, -0.01916513778269291, -0.025292005389928818, 0.02308782748878002, 0.02092100866138935, 0.004889351781457663, 0.010049556382000446, -0.043186940252780914, 0.04789416491985321, -0.04763265326619148, 0.003250228241086006, 0.03253963962197304, 0.02310650795698166, -0.009582568891346455, -0.026991836726665497, -0.02882242575287819, -0.0521530881524086, -0.058728259056806564, -0.04617565497756004, 0.041244275867938995, 0.08637388050556183, -0.025945786386728287, 0.001015696325339377, 0.05674823746085167, 0.022097814828157425, 0.029027899727225304, 0.0016344537725672126, 0.006565834395587444, 0.044718656688928604, 0.028056567534804344, 0.006131536792963743, -0.03113868087530136, 0.04875342175364494, -0.04512960463762283, 0.01673680730164051, 0.021556111052632332, 0.03196057677268982, 0.03735894337296486, 0.04557791352272034, 0.005239591933786869, 0.01340252161026001, -0.004501753021031618, -0.03582722693681717, 0.0654902309179306, -0.02181762270629406, 0.0626135915517807, 0.0001313400425715372, -0.029663002118468285, 0.034407589584589005, -0.03717214986681938, 0.054282546043395996, 0.05805579945445061, 0.005949412006884813, 0.040347661823034286, 0.01456998847424984, 0.032633036375045776, 0.012281753122806549, -0.01754002459347248, -0.03756441920995712, 0.06343548744916916, 0.00914827175438404, 0.045503195375204086, -0.004312623292207718, -0.03461306169629097, -0.025572197511792183, 0.0062015848234295845, 0.03082112967967987, 0.053796879947185516, 0.0032922569662332535, 0.006467767059803009, 0.022844994440674782, 0.06623740494251251, 0.024245955049991608, 0.006836686749011278, 0.03216605260968208, 0.008718643337488174, 0.0520036518573761, 0.048902858048677444, 0.026524851098656654, -0.004041770938783884, -0.025292005389928818, -0.012739400379359722, -0.003735894337296486, 0.045914143323898315, 0.018352581188082695, 0.03575250878930092, 0.034090038388967514, 0.001057141344062984, -0.025067850947380066, 0.011170323938131332, 0.0654902309179306, 0.011076927185058594, 0.024937095120549202, 0.02904658019542694 ]
31,928
sonetel.account
get_balance
Get the current prepaid balance in the account :param currency: Boolean. Optional. Set to true if currency should be returned in the response. :returns: A string representing the current prepaid balance in the Sonetel account.
def get_balance(self, currency: bool = False) -> str: """ Get the current prepaid balance in the account :param currency: Boolean. Optional. Set to true if currency should be returned in the response. :returns: A string representing the current prepaid balance in the Sonetel account. """ response = util.send_api_request( token=self._token, uri=self._url, method='get', ) balance = response['response']['credit_balance'] if currency: balance += f" {response['response']['currency']}" return balance
(self, currency: bool = False) -> str
[ -0.038939330726861954, -0.042310863733291626, 0.03347448632121086, 0.006432770285755396, 0.0016498735640197992, 0.0007548895082436502, 0.039828527718782425, -0.025397632271051407, 0.043163008987903595, -0.07454418390989304, 0.011346498504281044, -0.054129745811223984, -0.016681669279932976, -0.004992459435015917, -0.01937704160809517, -0.023767441511154175, 0.041940364986658096, -0.0031608103308826685, 0.04308890923857689, 0.010976000688970089, 0.06865326315164566, -0.018691619858145714, 0.0048766788095235825, 0.03136264905333519, -0.050461817532777786, 0.010466566309332848, 0.07087624818086624, 0.02582370489835739, -0.01536640152335167, 0.009910819120705128, 0.04590469226241112, 0.018182184547185898, 0.011578059755265713, 0.021562978625297546, -0.05453729256987572, 0.07602617144584656, 0.002305191708728671, 0.0642813891172409, -0.09151298552751541, -0.021211005747318268, -0.016329696401953697, -0.0016556625487282872, 0.037735212594270706, -0.018617520108819008, -0.02541615627706051, -0.008470508269965649, -0.00728954654186964, 0.01926589198410511, -0.023989740759134293, 0.01778390072286129, 0.07461827993392944, 0.09284678101539612, -0.0191362164914608, -0.017922837287187576, 0.004969303496181965, -0.0617620013654232, 0.02665732428431511, 0.017580125480890274, -0.017885787412524223, 0.07213594764471054, 0.0019289047922939062, -0.007150609977543354, -0.005812186282128096, -0.025731081143021584, 0.02828751504421234, 0.035123202949762344, 0.01413449551910162, -0.03927277773618698, 0.045867640525102615, -0.023508092388510704, 0.055018939077854156, -0.0042283073998987675, -0.06487418711185455, 0.047238484025001526, -0.019821638241410255, -0.028454240411520004, 0.012874802574515343, -0.02072935923933983, -0.04775718227028847, 0.008743750862777233, -0.010892638936638832, -0.02434171363711357, 0.010133118368685246, -0.011837408877909184, -0.033400386571884155, -0.0029639832209795713, 0.005497262813150883, -0.039198677986860275, -0.040940020233392715, 0.09032738953828812, -0.0259163286536932, -0.029658358544111252, -0.00546021293848753, 0.04245905950665474, 0.046238139271736145, -0.018598996102809906, -0.022433649748563766, -0.013467599637806416, -0.013023002073168755, -0.012559879571199417, -0.050684116780757904, 0.05490779131650925, -0.01800619810819626, -0.06028001010417938, -0.0023445570841431618, -0.0383094847202301, 0.017570864409208298, 0.03258529305458069, 0.06587453186511993, -0.03692011907696724, -0.05953901633620262, -0.09951574355363846, -0.08076854795217514, -0.05112871155142784, 0.035734523087739944, 0.023656291887164116, 0.01621854677796364, 0.030547553673386574, 0.0064790821634233, 0.0376981645822525, 0.07558157294988632, -0.021173955872654915, 0.024415813386440277, -0.060909856110811234, 0.03842063248157501, 0.015838785097002983, 0.03282611444592476, 0.009642207995057106, 0.06391089409589767, 0.04138461872935295, 0.024045314639806747, 0.015718374401330948, -0.048831626772880554, -0.0420144647359848, -0.02800964191555977, -0.012633979320526123, 0.006312358193099499, 0.07417368143796921, 0.008516821078956127, 0.06483713537454605, 0.04786833003163338, -0.043644655495882034, 0.01414375752210617, -0.044385649263858795, 0.023026445880532265, -0.018756456673145294, -0.0321221686899662, -0.007294177543371916, 0.00877153780311346, 0.04186626523733139, 0.04986901953816414, 0.04768308252096176, 0.013004477135837078, 0.014921803958714008, -0.023637767881155014, -0.008577026426792145, 0.03362268581986427, 0.04123641923069954, 0.018247023224830627, -0.007460901979357004, 0.009669995866715908, 0.04064362123608589, 0.041903313249349594, -0.05516713857650757, -0.02630535140633583, 0.016598306596279144, -0.04642339050769806, -0.014106708578765392, 0.03245561569929123, -0.03373383358120918, 0.012365368194878101, -0.03175166994333267, -0.08795620501041412, 0.04838702827692032, 0.07017230242490768, -0.011402073316276073, 0.01889539323747158, -0.0016753452364355326, -0.05457434430718422, -0.04468204826116562, 0.05750127509236336, -0.004716901574283838, -0.004508496727794409, 0.009169823490083218, 0.05261070281267166, -0.035493701696395874, 0.0506100170314312, -0.0029084086418151855, -0.04557124525308609, 0.008512189611792564, 0.04138461872935295, 0.05505599081516266, -0.018737932667136192, 0.02939900942146778, -0.010522141121327877, -0.031214449554681778, 0.02421203814446926, -0.004693745635449886, -0.047127336263656616, 0.006191946566104889, -0.007502582855522633, 0.01104083750396967, 0.006020591128617525, -0.022878246381878853, 0.03169609606266022, -0.026194201782345772, -0.0703205019235611, -0.007423852104693651, -0.06483713537454605, -0.050424765795469284, -0.0016440844628959894, 0.020970182493329048, 0.019284415990114212, 0.0033483749721199274, -0.03727209195494652, -0.027824394404888153, 0.027453895658254623, -0.0015051477821543813, 0.016227807849645615, 0.04701618477702141, -0.004723848309367895, -0.06316989660263062, 0.043274156749248505, 0.014458681456744671, 0.013662111014127731, 0.013310137204825878, -0.00780824339017272, 0.00028684642165899277, -0.038087185472249985, -0.042273811995983124, -0.019469665363430977, -0.003028820501640439, -0.05172150954604149, 0.01658904366195202, -0.014773604460060596, -0.06754177063703537, -0.005325907375663519, -0.03171462193131447, -0.030436404049396515, 0.03547517582774162, 0.04249611124396324, 0.033159565180540085, 0.011105675250291824, 0.051906757056713104, -0.03014000505208969, -0.023378418758511543, -0.010253529995679855, 0.015542387962341309, -0.024915985763072968, -0.011892982758581638, 0.0034618398640304804, -0.03580862283706665, 0.03519730269908905, 0.00026151942438445985, -0.012402418069541454, -0.04486729949712753, -0.0567602813243866, 0.05546353757381439, -0.03742028772830963, 0.016024034470319748, 0.009605158120393753, -0.08595551550388336, -0.02248922362923622, -0.04557124525308609, -0.03321513906121254, 0.03695716708898544, 0.004212098196148872, 0.01124461181461811, 0.029324909672141075, -0.03443778306245804, 0.09862654656171799, -0.02604600414633751, -0.01210601907223463, -0.04546009376645088, -0.009336547926068306, -0.07221004366874695, 0.0028111529536545277, 0.032900214195251465, 0.022822672501206398, 0.025230908766388893, -0.009114248678088188, -0.028491290286183357, 0.06387384235858917, -0.021414779126644135, 0.002052790019661188, -0.021451829001307487, 0.03927277773618698, -0.017052166163921356, -0.013384236954152584, 0.028065217658877373, 0.0013743157032877207, 0.024378763511776924, -0.017987674102187157, -0.01272660307586193, 0.03323366492986679, -0.019358515739440918, 0.003126076189801097, -0.04212561249732971, 0.026120103895664215, 0.012745128013193607, -0.04786833003163338, 0.031084775924682617, -0.0018073351820930839, 0.0006431612418964505, -0.04064362123608589, -0.02382301539182663, 0.04245905950665474, 0.011272398754954338, -0.011587322689592838, 0.0007780456217005849, 0.004425134509801865, -0.015329351648688316, 0.07250644266605377, 0.008067592047154903, -0.026861099526286125, -0.05157331004738808, -0.00128748023416847, -0.022933820262551308, 0.032270368188619614, -0.00663654413074255, -0.029084086418151855, 0.03134412318468094, 0.02480483613908291, 0.07083920389413834, -0.0017181840958073735, 0.002767156343907118, -0.04038427397608757, 0.09129069000482559, -0.02986213192343712, 0.03373383358120918, -0.051425110548734665, -0.027250122278928757, -0.05272185429930687, -0.0010495511814951897, -0.022007577121257782, 0.03423400595784187, -0.024378763511776924, -0.08654831349849701, -0.022322500124573708, -0.015875834971666336, 0.04082886874675751, -0.031066250056028366, 0.008836375549435616, -0.005038771778345108, 0.00430935388430953, 0.017135528847575188, 0.011707734316587448, 0.024045314639806747, 0.03530845046043396, 0.016153709962964058, -0.036994218826293945, 0.014597618021070957, -0.004821103997528553, 0.048720475286245346, 0.0058723920956254005, -0.05531533807516098, -0.04219971224665642, -0.01340276189148426, 0.012791440822184086, -0.007516476325690746, 0.012226431630551815, -0.04749783128499985, 0.007789718918502331, 0.08439942449331284, -0.04323710501194, -0.010420253500342369, -0.019302941858768463, -0.043792854994535446, 0.050461817532777786, 0.0014345216332003474, -0.03916162997484207, -0.0023121386766433716, -0.017033642157912254, 0.000036778430512640625, -0.019488191232085228, 0.03386351093649864, -0.009466221556067467, 0.016765030100941658, 0.015162627212703228, 0.020970182493329048, -0.0024036052636802197, -0.04108821973204613, -0.053166452795267105, 0.0654299333691597, 0.025601405650377274, -0.034511879086494446, 0.03677191957831383, -0.04642339050769806, -0.024063840508461, -0.026249777525663376, 0.015060740523040295, 0.0033437437377870083, -0.043163008987903595, 0.02558288164436817, -0.09321727603673935, -0.006594862788915634, 0.02310054562985897, -0.04249611124396324, 0.017320778220891953, 0.04590469226241112, 0.07139495015144348, -0.041681014001369476, 0.01588509790599346, -0.04642339050769806, -0.09803374856710434, 0.000055104330385802314, -0.016570519655942917, 0.004483024589717388, -0.021303629502654076, 0.012884065508842468, -0.07369203865528107, -0.028620963916182518, 0.0022241452243179083, 0.01259692944586277, -0.01277291588485241, -0.003985168412327766, 0.032270368188619614, 0.008975312113761902, -0.018673095852136612, -0.00337847787886858, 0.0481647290289402, -0.04286660999059677, -0.0163482204079628, -0.01828407309949398, 0.001667240634560585, 0.016311170533299446, 0.028991462662816048, 0.01135576143860817, -0.009521796368062496, 0.016533469781279564, 0.023915641009807587, -0.03960622847080231, -0.03423400595784187, -0.06894966214895248, 0.03162199631333351, 0.041421666741371155, 0.07891605794429779, 0.02109985612332821, -0.015597961843013763, 0.0382724329829216, 0.0005528523470275104, 0.038605883717536926, -0.03238151967525482, 0.012624716386198997, 0.04134756699204445, -0.009734832681715488, -0.06198430061340332, -0.03975442796945572, 0.04912802204489708, -0.014097445644438267, -0.031436748802661896, -0.008919737301766872, 0.06320694088935852, 0.02517533302307129, -0.030177054926753044, -0.028806213289499283, 0.003322903299704194, 0.0029500897508114576, -0.009725570678710938, 0.05012836679816246, -0.0001552907342556864, 0.020896082744002342, 0.03332628682255745, 0.07076510041952133, 0.047090284526348114, -0.023545142263174057, 0.00685884291306138, -0.0027046347968280315, -0.05861277133226395, 0.0011659106239676476, -0.013106363825500011, -0.05116576328873634, 0.004492287058383226, 0.026972249150276184, -0.0216000284999609, -0.042533159255981445, -0.007488688919693232, -0.0327334925532341, -0.011828145943582058, -0.010096068494021893, -0.07758226245641708, 0.023433992639183998, -0.04134756699204445, -0.023897115141153336, 0.027453895658254623, -0.03571600094437599, 0.0005392481107264757, 0.05842752009630203, -0.025230908766388893, -0.03971737623214722, -0.0469420850276947, 0.04901687428355217, 0.012467254884541035, 0.022507747635245323, -0.07009820640087128, 0.0376981645822525, 0.0056917741894721985, -0.023174645379185677, 0.024508437141776085, -0.0043417722918093204, 0.015940673649311066, 0.011837408877909184, 0.018598996102809906, -0.047127336263656616, -0.03706831485033035, 0.017015116289258003, -0.09092018753290176, 0.025897804647684097, 0.048572275787591934, 0.019969837740063667, 0.01656125672161579, 0.04371875524520874, -0.0259163286536932, -0.006553181912750006, -0.040458373725414276, 0.03901343047618866, 0.0690608099102974, 0.011883720755577087, 0.03653109446167946, -0.08847489953041077, 0.022896770387887955, 0.03430810570716858, 0.00955884624272585, 0.009160560555756092, 0.008035173639655113, 0.08180593699216843, -0.0351787768304348, -0.0052842264994978905, -0.07861965894699097, -0.005274964030832052, 0.012587666511535645, 0.008577026426792145, -0.015347876586019993, -0.020043937489390373, -0.04431154951453209, 0.010160905309021473, -0.0022334076929837465, -0.029639832675457, -0.036216169595718384, 0.021562978625297546, 0.014032608829438686, -0.0580199733376503, 0.028231941163539886, 0.003709610318765044, -0.04001377522945404, 0.029102610424160957, -0.0265647005289793, 0.06431844085454941, -0.027861442416906357, 0.006840317975729704, 0.024878935888409615, -0.027379795908927917, 0.017644964158535004, -0.06246594712138176, 0.12900736927986145, -0.003693401115015149, -0.021451829001307487, 0.014560568146407604, 0.008424196392297745, 0.013300875201821327, 0.03553074970841408, -0.057241927832365036, -0.027824394404888153, 0.06324399262666702, 0.0071552409790456295, -0.010216480121016502, -0.0023399258498102427, 0.04642339050769806, 0.06643027812242508, -0.07009820640087128, 0.03264086693525314, 0.011337236501276493, 0.022804146632552147, 0.0382724329829216, -0.026397977024316788, 0.0018524895422160625, 0.012291268445551395, -0.0024962297175079584, 0.02323021925985813, 0.07235824316740036, 0.03188134729862213, -0.03960622847080231, 0.015449763275682926, -0.02148887887597084, -0.00043272998300381005, 0.007558157667517662, -0.01656125672161579, -0.024489913135766983, 0.08602961897850037, 0.0027092660311609507, -0.03606797382235527, -0.045126646757125854, 0.041051167994737625, 0.012689553201198578, 0.011605847626924515, -0.018598996102809906, -0.0011352287838235497, -0.029343435540795326, 0.01610739715397358, 0.032770540565252304, 0.03695716708898544, 0.04557124525308609, 0.023433992639183998, 0.03249266743659973, 0.06035410985350609, 0.0407177209854126, -0.06209545210003853, -0.0395321287214756, -0.0014611511724069715, 0.00043736121733672917, 0.0296213086694479, -0.006919048726558685, -0.03223332017660141, -0.01549607515335083, -0.0010894954903051257, -0.0019126954721286893, 0.0003140548651572317, -0.03597534820437431, -0.04112526774406433, 0.0407177209854126, -0.0022704575676470995, 0.08536271750926971, -0.05387039855122566, 0.04642339050769806, -0.06372564285993576, 0.007669306825846434, 0.005071190185844898, -0.06083575636148453, -0.02567550539970398, -0.04382990300655365, -0.01702437922358513, 0.004770160652697086, 0.006066903471946716, 0.013152675703167915, -0.0729139894247055, 0.02717602252960205, 0.045385994017124176, -0.01017943024635315, -0.005034140311181545, 0.003269644221290946, 0.006539288442581892, 0.019784588366746902, -0.022915296256542206, 0.011077887378633022, -0.012522829696536064, -0.014486468397080898, -0.0740625336766243, -0.044385649263858795, -0.026583226397633553, -0.015070002526044846, -0.0568343810737133, -0.013115625828504562, 0.04097706824541092, 0.04294070973992348, -0.01770053803920746, -0.002198673551902175, 0.0035197301767766476, 0.09173528105020523, -0.0013361080782487988, -0.008933630771934986, -0.0580570250749588, -0.0691719576716423, -0.06405908614397049, -0.018580470234155655, -0.006238258443772793, 0.00005506814704858698, -0.0704316571354866, -0.06268824636936188, -0.018543420359492302, -0.0518326573073864, 0.0003265012928750366, 0.05342580005526543, 0.01216159388422966, -0.056241583079099655, 0.015810998156666756, 0.0002508097095414996, -0.03580862283706665, 0.046497490257024765, 0.028491290286183357, 0.032529715448617935, 0.06887556612491608, 0.015894360840320587, 0.02554583176970482, 0.014412368647754192, 0.027565045282244682, 0.04998016729950905, -0.015764687210321426, -0.012050445191562176, -0.04923917353153229, -0.0033113250974565744, -0.028732113540172577, -0.0567602813243866, 0.00017222363385371864, 0.059279665350914, 0.059576064348220825, 0.003227963112294674, -0.020470010116696358, 0.04471909999847412, -0.07572977244853973, 0.03641994670033455, 0.03152937442064285, 0.01463466789573431, 0.06454073637723923, 0.020284760743379593, -0.0006310042808763683, -0.016070347279310226, 0.03742028772830963, -0.014653192833065987, 0.00006215970643097535, -0.005844604689627886, 0.026194201782345772, 0.01493106596171856, 0.02519385889172554, -0.008933630771934986, -0.028787687420845032, 0.044274501502513885, -0.0022658263333141804, 0.016403796151280403, -0.05172150954604149, 0.06157675385475159, -0.08632601797580719, -0.04823882877826691, 0.056130435317754745, 0.0032094381749629974, -0.0015537756262347102, 0.04716438427567482, 0.04801652953028679, -0.04112526774406433, -0.019840164110064507, 0.01704290509223938, -0.039458028972148895, -0.0015618802281096578, -0.002449917374178767, 0.0019671123009175062, 0.024230564013123512, -0.01180035900324583, -0.0013094785390421748, 0.002882936969399452, 0.03336333855986595, 0.009707045741379261, 0.0012527460930868983, 0.02310054562985897, -0.0075998385436832905, 0.005228651687502861, -0.02048853412270546, 0.01847858354449272, -0.03236299380660057, -0.045385994017124176, 0.03001033142209053, 0.004304722882807255, 0.014060395769774914, 0.02678699977695942, 0.03234446793794632, 0.027602095156908035, 0.01272660307586193, 0.022618897259235382, -0.025101233273744583, 0.04823882877826691, -0.03738323971629143, -0.0061132158152759075, 0.002283193403854966, 0.017922837287187576, -0.010105330497026443, 0.04716438427567482, 0.06335514038801193, 0.012643241323530674, -0.013467599637806416, 0.004536283668130636 ]
31,929
sonetel.account
update
Update your account information. Pass one or more of the following parameters: :param name: String. New company name. :param language: String. The ID of the new language you want to switch to. Changes the language you see in app.sonetel.com :param timezone: String. The ID of the new timezone you want to switch to. :returns: dict. The updated account information if the request was processed successfully.
def update(self, name: str = '', language: str = '', timezone: str = '') -> dict: """ Update your account information. Pass one or more of the following parameters: :param name: String. New company name. :param language: String. The ID of the new language you want to switch to. Changes the language you see in app.sonetel.com :param timezone: String. The ID of the new timezone you want to switch to. :returns: dict. The updated account information if the request was processed successfully. """ body = {} if name: body['name'] = name if language: body['language'] = language if timezone: body['timezone_details'] = { "zone_id": timezone } if len(body) == 0: return util.prepare_error( code=const.ERR_ACCOUNT_UPDATE_BODY_EMPTY, message='request body cannot be empty' ) return util.send_api_request( token=self._token, uri=self._url, method='put', body=dumps(body) )
(self, name: str = '', language: str = '', timezone: str = '') -> dict
[ 0.008708453737199306, -0.049090541899204254, -0.0677284300327301, -0.004084893502295017, -0.04733089730143547, -0.0829547569155693, -0.05454903841018677, -0.051424767822027206, 0.010046144016087055, -0.007532363757491112, -0.016160018742084503, -0.07322283834218979, 0.0016204906860366464, 0.04262653738260269, -0.02693336270749569, -0.04054369032382965, 0.026107406243681908, 0.01869175396859646, 0.004668449517339468, -0.02483256161212921, 0.02907007746398449, -0.058786552399396896, 0.05041925609111786, 0.045176226645708084, 0.026969274505972862, -0.006683962885290384, 0.0994020625948906, 0.03314599394798279, -0.03318190202116966, 0.002866158727556467, 0.020074333995580673, -0.008663564920425415, -0.006872496567666531, 0.04625356197357178, -0.033846259117126465, -0.030614256858825684, -0.042877912521362305, 0.0013354459078982472, -0.06079757958650589, -0.01027956698089838, -0.0031579367350786924, 0.05092201009392738, 0.007649075239896774, -0.027094963937997818, 0.04927009716629982, 0.022067401558160782, -0.003465426154434681, 0.0333973690867424, -0.01576499454677105, 0.020271845161914825, 0.028567319735884666, -0.04169284552335739, 0.005691917613148689, -0.03889177739620209, -0.0005796283949166536, -0.013035748153924942, 0.003945737611502409, -0.007653564214706421, -0.02630491741001606, -0.03224821388721466, -0.0004174671194050461, -0.07699351012706757, -0.04661267250776291, 0.004812094382941723, -0.01406819373369217, 0.03558795154094696, 0.019661355763673782, 0.00005681256152456626, 0.006603162735700607, -0.03307417035102844, 0.06248540058732033, 0.003335248213261366, -0.015199394896626472, -0.06323953717947006, -0.042877912521362305, 0.054764505475759506, -0.026538340374827385, 0.02901620976626873, -0.023414069786667824, -0.0033711593132466078, -0.00478964950889349, -0.035839326679706573, -0.0238450039178133, -0.046109918504953384, 0.02431184984743595, 0.027310431003570557, 0.01590863987803459, -0.05016787722706795, -0.0597202442586422, -0.005471961572766304, 0.003341981442645192, -0.07605981826782227, -0.009893521666526794, 0.03596501797437668, 0.05077836662530899, -0.05505179241299629, 0.026646073907613754, -0.0591815747320652, 0.00915734376758337, 0.03492359444499016, 0.036234352737665176, -0.028693009167909622, -0.04654085263609886, -0.025640562176704407, 0.07871723920106888, -0.04018457606434822, -0.0010184177663177252, -0.023288380354642868, 0.042482890188694, -0.053723081946372986, -0.03596501797437668, -0.06837482750415802, -0.05390263721346855, -0.034366972744464874, 0.016680728644132614, 0.024617094546556473, -0.003959204535931349, 0.04190831258893013, 0.0016418129671365023, 0.02786705270409584, 0.022731758654117584, 0.041046444326639175, 0.02186989039182663, 0.0041679381392896175, 0.05271757021546364, -0.013394859619438648, -0.0238450039178133, 0.05548272654414177, 0.005045516882091761, -0.007128363475203514, 0.020487312227487564, -0.061767179518938065, 0.0003983893257100135, -0.052322547882795334, 0.049449656158685684, 0.0343310609459877, 0.06420914083719254, -0.016088195145130157, -0.03047061152756214, 0.04833640903234482, 0.022157179191708565, 0.00174169079400599, 0.017776019871234894, -0.02704109624028206, -0.0015812128549441695, -0.03485177084803581, 0.00034845038317143917, -0.03810173273086548, -0.05350761488080025, -0.027831142768263817, 0.027849096804857254, 0.053471703082323074, 0.0009740899549797177, -0.01601637341082096, -0.046361297369003296, -0.04901872202754021, 0.025604650378227234, -0.051317036151885986, -0.033433280885219574, 0.008044097572565079, -0.022875402122735977, 0.04718725383281708, 0.001226590247824788, -0.017264286056160927, -0.0295907873660326, -0.015648283064365387, -0.00960623286664486, 0.0007485230453312397, -0.0005459617241285741, -0.03158385679125786, -0.02567647211253643, -0.04305747151374817, -0.018135130405426025, 0.024958249181509018, -0.06302406638860703, 0.027489986270666122, -0.006944318767637014, -0.0601152665913105, 0.03375648334622383, -0.027633629739284515, 0.02786705270409584, -0.006006139796227217, -0.0076041859574615955, 0.03835310786962509, 0.05386672541499138, 0.01419388223439455, 0.009363832883536816, 0.07936364412307739, 0.004316071514040232, 0.013511570170521736, 0.060402557253837585, -0.02860323153436184, 0.006360762752592564, -0.000280415581073612, -0.05178387835621834, 0.00031899200985208154, 0.0061093843542039394, -0.05688326433300972, -0.026071496307849884, -0.0010464733932167292, 0.01534303929656744, 0.016061261296272278, 0.02061299979686737, 0.017345085740089417, 0.046109918504953384, -0.037132129073143005, 0.07368968427181244, -0.03497746214270592, 0.018655842170119286, -0.04894689843058586, 0.04654085263609886, -0.007186719216406345, -0.023988649249076843, -0.01531610544770956, -0.028818698599934578, 0.0015453017549589276, -0.016267750412225723, -0.01116836816072464, 0.052430279552936554, 0.03939453139901161, -0.013906593434512615, -0.013053703121840954, 0.03508519381284714, -0.08431938290596008, 0.03361283615231514, -0.00785556435585022, -0.003077136818319559, 0.005256494507193565, -0.06991901248693466, -0.054046280682086945, -0.0055168503895401955, -0.03975364565849304, -0.010755389928817749, -0.0360727496445179, -0.014983927831053734, -0.01738099753856659, -0.00811592023819685, -0.06618425250053406, -0.030488567426800728, 0.01046810019761324, 0.034097637981176376, 0.006486451718956232, 0.0032948481384664774, 0.04549942910671234, -0.06905714422464371, -0.014579927548766136, 0.0006710896268486977, -0.01456197164952755, 0.009740899316966534, -0.07577253133058548, -0.016276728361845016, -0.038065820932388306, -0.005485428497195244, 0.07117590308189392, 0.020469356328248978, -0.02723860740661621, 0.025119850412011147, 0.016294684261083603, 0.03928679972887039, 0.0018539131851866841, -0.08151831477880478, -0.015298150479793549, -0.0486236996948719, -0.003923293203115463, 0.021564645692706108, 0.015747040510177612, 0.03774261847138405, 0.031117012724280357, 0.03549817204475403, -0.03109905682504177, 0.08597129583358765, 0.05092201009392738, -0.011671124026179314, -0.007792719639837742, 0.020900290459394455, -0.025586694478988647, 0.04901872202754021, 0.027094963937997818, -0.02896234393119812, -0.051747966557741165, 0.052681658416986465, -0.027885008603334427, 0.0022556690964847803, 0.014804371632635593, -0.012227746658027172, -0.040076844394207, -0.033110082149505615, 0.017228374257683754, -0.0701344758272171, 0.0515684112906456, 0.025658518075942993, 0.009085521101951599, -0.020702779293060303, 0.021905802190303802, -0.022139225155115128, 0.023090869188308716, -0.05580592900514603, 0.035929106175899506, 0.06672291457653046, 0.01631264016032219, 0.003117536660283804, 0.07038585841655731, 0.0291239432990551, -0.036252304911613464, 0.013834770768880844, -0.04442209377884865, 0.02860323153436184, 0.0008427898283116519, -0.030919501557946205, 0.06503509730100632, 0.007209163624793291, -0.0382094644010067, 0.005189161282032728, -0.00009826468885876238, -0.014490148983895779, -0.058319710195064545, 0.025496916845440865, -0.03079381212592125, 0.025981716811656952, 0.027741363272070885, -0.001639568479731679, -0.028998253867030144, 0.004856983199715614, -0.0324636809527874, -0.00540013937279582, -0.05350761488080025, 0.03774261847138405, 0.08223653584718704, 0.056595973670482635, -0.028639143332839012, -0.04585853964090347, -0.038855865597724915, 0.005956762004643679, -0.024922339245676994, -0.05257392302155495, -0.00926507730036974, 0.004268938209861517, -0.03135043382644653, 0.011985346674919128, 0.033325549215078354, 0.020810510963201523, 0.0056784506887197495, -0.025083938613533974, 0.012389346957206726, -0.054405394941568375, -0.010396278463304043, 0.037239864468574524, -0.007348319049924612, 0.017596464604139328, 0.036880750209093094, -0.04664858430624008, -0.0360727496445179, 0.06000753119587898, 0.032068658620119095, 0.05885837599635124, -0.05997162312269211, 0.005440539214760065, -0.040112756192684174, 0.019751133397221565, -0.029734432697296143, -0.05149659141898155, -0.05989979952573776, 0.055662285536527634, 0.01519041694700718, 0.0016541574150323868, -0.03831719607114792, -0.024958249181509018, 0.014211838133633137, 0.019481798633933067, -0.03763488680124283, -0.004089382477104664, -0.005606628488749266, 0.016168994829058647, 0.016842329874634743, 0.036342084407806396, 0.02154668979346752, 0.024240026250481606, 0.05907384306192398, -0.038065820932388306, 0.016106151044368744, 0.03115292266011238, -0.0177670419216156, 0.007788230665028095, 0.03047061152756214, 0.03928679972887039, -0.005045516882091761, 0.006167740095406771, -0.008026142604649067, 0.0028886031359434128, -0.008026142604649067, -0.005543783772736788, 0.05893019959330559, 0.0014970460906624794, -0.0047357832081615925, -0.1068715825676918, 0.06589695811271667, -0.05023970082402229, -0.0497010312974453, -0.09265077114105225, -0.016599928960204124, -0.029249632731080055, -0.009489521384239197, 0.06237766891717911, -0.02217513509094715, -0.006975741125643253, -0.01863788813352585, -0.006760274060070515, 0.004522560629993677, -0.007631119340658188, 0.049557387828826904, -0.05709873139858246, -0.01910473220050335, 0.006333829369395971, -0.03925088793039322, -0.020343666896224022, 0.027274519205093384, 0.005269961431622505, -0.014508104883134365, 0.0067423186264932156, 0.03695257380604744, 0.026915406808257103, -0.013610325753688812, -0.040687333792448044, 0.06140806898474693, -0.0013231014600023627, -0.008120409213006496, 0.023503847420215607, -0.040687333792448044, -0.015109616331756115, -0.048300497233867645, -0.014813349582254887, -0.03465425968170166, -0.026753807440400124, -0.001586823957040906, 0.030668122693896294, 0.021977623924613, 0.09308170527219772, -0.003772915340960026, -0.03443879261612892, 0.012936991639435291, 0.04736680909991264, -0.026807673275470734, -0.008138364180922508, -0.029716476798057556, -0.05799650773406029, -0.00991147756576538, -0.027723409235477448, -0.0907115638256073, 0.012021257542073727, -0.01935611106455326, 0.030650166794657707, 0.05839153006672859, -0.023467937484383583, -0.028980297967791557, 0.0317993238568306, -0.012883124873042107, -0.00019652937771752477, -0.04470938444137573, 0.016249796375632286, -0.026286961510777473, -0.014104104600846767, 0.0007490841671824455, 0.05192752555012703, 0.08467849344015121, 0.07634710520505905, 0.024383671581745148, 0.02860323153436184, -0.008192230947315693, 0.05688326433300972, 0.0029559365939348936, 0.00949849933385849, -0.013834770768880844, 0.004567449446767569, 0.05835561826825142, -0.00222088024020195, -0.005480939522385597, -0.024150248616933823, 0.019661355763673782, -0.06543011963367462, 0.028944388031959534, 0.007617652881890535, 0.03589319437742233, 0.023234514519572258, 0.010180811397731304, 0.03846084326505661, -0.07390514761209488, 0.02551487274467945, -0.005799650680273771, -0.010216722264885902, 0.0014521571574732661, 0.017336107790470123, -0.024150248616933823, 0.023737270385026932, -0.029141899198293686, -0.08898783475160599, -0.019804999232292175, -0.004594382829964161, 0.013143480755388737, 0.029249632731080055, -0.022893358021974564, -0.0079812528565526, -0.02797478623688221, 0.03928679972887039, -0.0309913232922554, 0.012972903437912464, -0.0030659143812954426, -0.034941550344228745, 0.05458495020866394, 0.0567755289375782, 0.059935711324214935, -0.06101304665207863, 0.006172229070216417, 0.0573141984641552, -0.057745128870010376, 0.043237026780843735, 0.02907007746398449, -0.03287665918469429, 0.028172297403216362, -0.011258145794272423, 0.0029918476939201355, 0.006086939945816994, 0.03266119211912155, 0.08173377811908722, 0.035300660878419876, 0.030757900327444077, 0.03278687968850136, 0.01940997689962387, -0.06033073365688324, 0.017614418640732765, 0.0023185135796666145, -0.01573806256055832, 0.006077962461858988, -0.05896611139178276, -0.009749877266585827, 0.04032822325825691, 0.0030008256435394287, -0.08805414289236069, -0.009794766083359718, -0.07034994661808014, 0.039322711527347565, -0.011805790476500988, 0.01976908929646015, -0.02009228803217411, -0.03181727975606918, -0.07591617107391357, -0.043596137315034866, 0.03767079859972, -0.003503581741824746, -0.006324851419776678, -0.010854145511984825, 0.004136515781283379, -0.03741941973567009, 0.018404465168714523, 0.05756557360291481, -0.026538340374827385, 0.025281449779868126, -0.04388342797756195, -0.04776183143258095, -0.014005349017679691, 0.003543981583788991, -0.006378718186169863, -0.007433608174324036, 0.0020918245427310467, -0.0006722118705511093, 0.013762948103249073, 0.0174348633736372, -0.009081032127141953, 0.020271845161914825, 0.031009279191493988, 0.06851847469806671, 0.01211103517562151, 0.06683064997196198, 0.047725919634103775, 0.0034497149754315615, -0.004217315930873156, -0.02088233456015587, 0.06388593465089798, 0.03668323904275894, 0.038389019668102264, 0.02494029328227043, -0.0037078263703733683, 0.02687949687242508, -0.034420836716890335, -0.021905802190303802, 0.03878404200077057, 0.007801697589457035, 0.007236097007989883, 0.01430161576718092, 0.08137466758489609, 0.04718725383281708, -0.07713714987039566, 0.009624188765883446, 0.008681520819664001, 0.03240981325507164, -0.002077235607430339, 0.016402417793869972, -0.023342248052358627, -0.08546853810548782, 0.0025227584410458803, 0.007070007734000683, -0.015405884012579918, -0.03109905682504177, -0.018108198419213295, 0.017470775172114372, 0.012218768708407879, 0.03813764080405235, -0.06912896782159805, -0.038065820932388306, 0.0027337362989783287, -0.01967930980026722, 0.050131965428590775, -0.047941386699676514, -0.037239864468574524, 0.014337526634335518, 0.027220651507377625, -0.008183253929018974, -0.009000232443213463, -0.00034396149567328393, -0.01038730051368475, 0.02066686749458313, -0.061084866523742676, 0.013008814305067062, -0.040579602122306824, 0.0333973690867424, -0.0515684112906456, 0.012622769922018051, 0.02239060215651989, 0.032391857355833054, -0.09293805807828903, -0.001339934766292572, -0.030704034492373466, 0.049341920763254166, -0.03652163967490196, -0.05386672541499138, 0.01291903667151928, 0.0355340838432312, -0.021726246923208237, -0.027418164536356926, -0.016061261296272278, 0.03364874795079231, 0.04029231145977974, 0.10787709802389145, 0.038065820932388306, 0.014535038731992245, -0.0159625057131052, 0.0945899710059166, -0.054764505475759506, -0.056344594806432724, -0.02160055749118328, -0.036773018538951874, -0.07228914648294449, 0.03957408666610718, 0.006270984653383493, 0.051424767822027206, -0.0147953936830163, 0.006495429202914238, -0.056811440736055374, 0.04869551956653595, 0.0006396673852577806, -0.026843585073947906, -0.020738689228892326, -0.033271681517362595, -0.00513978349044919, -0.04585853964090347, 0.007774764206260443, 0.016195928677916527, -0.013574414886534214, -0.012407302856445312, 0.04937783256173134, -0.04180058091878891, -0.04937783256173134, 0.008587254211306572, 0.058104243129491806, 0.029213720932602882, 0.008138364180922508, -0.01463379431515932, -0.011374857276678085, -0.015360995195806026, 0.014418327249586582, -0.003155692480504513, 0.046792227774858475, -0.03680893033742905, 0.04869551956653595, -0.006661518476903439, 0.007963297888636589, 0.05041925609111786, 0.0030165365897119045, 0.014400371350347996, 0.010459122247993946, 0.06392184644937515, -0.024132292717695236, -0.0046056052669882774, -0.06424504518508911, 0.014579927548766136, 0.07060132175683975, -0.027669541537761688, -0.04467347264289856, 0.026430606842041016, -0.04966512322425842, 0.03975364565849304, 0.038855865597724915, 0.0007260785787366331, 0.02145691215991974, 0.009731922298669815, 0.024150248616933823, 0.03235594555735588, -0.0250480268150568, -0.029518965631723404, 0.026592206209897995, 0.011177346110343933, -0.0029918476939201355, 0.05559046193957329, 0.011805790476500988, 0.010638678446412086, 0.014346504583954811, 0.050491079688072205, 0.002852692035958171, 0.007132852450013161, 0.007631119340658188, 0.05828379839658737, -0.01226365752518177, 0.06216220185160637, 0.011787835508584976, -0.07512612640857697, 0.0064460514113307, -0.00618569552898407, 0.006683962885290384, -0.02991398796439171, -0.03361283615231514, 0.06769251823425293, -0.04338067024946213, 0.02646651864051819, -0.02520962804555893, 0.046576760709285736, 0.017174508422613144, 0.004318316001445055, 0.007972275838255882, -0.028351852670311928, -0.005368717014789581, 0.014948016963899136, 0.02833389863371849, 0.06262904405593872, 0.019589532166719437, -0.005274450406432152, 0.007702942006289959, 0.0169680193066597, -0.005988184362649918, -0.025065982714295387, 0.04269835725426674, 0.08618675917387009, 0.051317036151885986, 0.006082450971007347, 0.03522883728146553, 0.025353271514177322, 0.01675255224108696, -0.04578671604394913, -0.00014546822058036923, 0.02661016210913658, 0.0177670419216156, 0.05961250886321068, 0.022713802754878998, 0.04338067024946213, -0.015298150479793549, 0.010414233431220055, 0.06112077832221985, -0.030614256858825684, -0.006975741125643253, -0.01051298901438713 ]
31,930
sonetel.auth
Auth
Authentication class. Create, refresh and fetch tokens.
class Auth: """ Authentication class. Create, refresh and fetch tokens. """ def __init__(self, username: str, password: str): self.__username = username self.__password = password # Get access token from API token = self.create_token() self._access_token = token['access_token'] self._refresh_token = token['refresh_token'] self._decoded_token = decode( self._access_token, audience='api.sonetel.com', options={"verify_signature": False} ) def create_token(self, refresh_token: str = '', grant_type: str = 'password', refresh: str = 'yes', ): """ Create an API access token from the user's Sonetel email address and password. Optionally, generate a refresh token. Set the ``grant_type`` to ``refresh_token`` to refresh an existing access token. **Documentation**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjExMzI3NDM3-authentication :param refresh: Optional. Flag to return refresh token in the response. Accepted values 'yes' and 'no'. Defaults to 'yes' :param grant_type: Optional. The OAuth2 grant type - `password` and `refresh_token` accepted. Defaults to 'password' :param refresh_token: Optional. Pass the `refresh_token` generated from a previous request in this field to generate a new access_token. :return: dict. The access token and refresh token if the request was processed successfully. If the request failed, the error message is returned. """ # Checks if grant_type.strip().lower() not in const.CONST_TYPES_GRANT: raise e.AuthException(f'invalid grant: {grant_type}') if refresh.strip().lower() not in const.CONST_TYPES_REFRESH: refresh = 'yes' if grant_type.strip().lower() == 'refresh_token' and not refresh_token: refresh_token = self._refresh_token # Prepare the request body. body = f"grant_type={grant_type}&refresh={refresh}" # Add the refresh token to the request body if passed to the function if grant_type == 'refresh_token': body += f"&refresh_token={refresh_token}" else: body += f"&username={self.__username}&password={self.__password}" # Prepare the request auth = (const.CONST_JWT_USER, const.CONST_JWT_PASS) headers = {'Content-Type': const.CONTENT_TYPE_AUTH} # Send the request try: req = requests.post( url=const.API_URI_AUTH, data=body, headers=headers, auth=auth, timeout=60 ) req.raise_for_status() except requests.exceptions.ConnectionError as err: return {'status': 'failed', 'error': 'ConnectionError', 'message': err} except requests.exceptions.Timeout: return {'status': 'failed', 'error': 'Timeout', 'message': 'Operation timed out. Please try again.'} except requests.exceptions.HTTPError as err: return {'status': 'failed', 'error': 'Timeout', 'message': err} # Check the response and handle accordingly. if req.status_code == requests.codes.ok: # pylint: disable=no-member response_json = req.json() if refresh_token and grant_type == 'refresh_token': self._access_token = response_json["access_token"] self._refresh_token = response_json["refresh_token"] self._decoded_token = decode( self._access_token, audience='api.sonetel.com', options={"verify_signature": False} ) return response_json return {'status': 'failed', 'error': 'Unknown error', 'message': req.text} def get_access_token(self): """ Returns the access token """ return self._access_token if hasattr(self, '_access_token') else False def get_refresh_token(self): """ Return the refresh token """ return self._refresh_token if hasattr(self, '_refresh_token') else False def get_decoded_token(self): """ Returns the decoded token """ return self._decoded_token if hasattr(self, '_decoded_token') else False
(username: str, password: str)
[ 0.043202955275774, -0.04144446179270744, -0.014497567899525166, 0.05119609832763672, 0.02473878674209118, -0.042203810065984726, -0.023819575086236, 0.02995431423187256, -0.022240929305553436, -0.008058089762926102, 0.016226086765527725, -0.025977723300457, 0.03668854013085365, 0.02809590846300125, 0.017455032095313072, 0.02042248845100403, -0.00018296809867024422, 0.030673697590827942, -0.01690550334751606, -0.05147586017847061, 0.013698253780603409, -0.03676846995949745, -0.007943188771605492, 0.036188967525959015, -0.02465885505080223, 0.03467027097940445, -0.0014350194251164794, 0.015766480937600136, 0.0390864834189415, -0.03696829825639725, -0.028455600142478943, 0.005055664572864771, 0.02951469086110592, 0.03816727176308632, -0.024159284308552742, -0.04739935323596001, -0.01780473254621029, 0.05874962359666824, -0.11614041030406952, 0.021881237626075745, -0.07141875475645065, 0.033970870077610016, 0.020462453365325928, 0.00821295753121376, -0.0023879522923380136, 0.01608620584011078, -0.022160997614264488, 0.03411075100302696, -0.0034170697908848524, -0.011959744617342949, -0.005430343560874462, -0.03427061438560486, -0.04596059024333954, 0.005155579186975956, 0.03209248185157776, 0.009926487691700459, -0.005093132611364126, 0.0026926910504698753, -0.020962025970220566, -0.01039109006524086, 0.0019483292708173394, -0.0014774830779060721, -0.009411929175257683, 0.05035682022571564, 0.017694827169179916, 0.03221237659454346, -0.036188967525959015, 0.0562317818403244, 0.022760482504963875, 0.044841546565294266, 0.058309998363256454, -0.01170995831489563, -0.04124463349580765, -0.010351124219596386, 0.053953733295202255, 0.007798313163220882, -0.07017982006072998, -0.01780473254621029, -0.02773621678352356, -0.04156436026096344, 0.012229513376951218, -0.011240361258387566, 0.02687695249915123, 0.029614605009555817, 0.06986009329557419, 0.018194397911429405, -0.010351124219596386, -0.04584069177508354, -0.06098770350217819, -0.01757492870092392, -0.016206102445721626, 0.027016833424568176, -0.0476791150867939, -0.03954608738422394, 0.00439373217523098, -0.024858683347702026, -0.0521153099834919, -0.023819575086236, -0.009526831097900867, -0.0007936944020912051, 0.015736505389213562, 0.043162986636161804, -0.03998571261763573, 0.02517841011285782, 0.02641734667122364, -0.03369110822677612, -0.014527542516589165, -0.020412495359778404, 0.02423921413719654, -0.009596770629286766, -0.08912357687950134, -0.01596630923449993, 0.009232083335518837, 0.032731931656599045, -0.008947327733039856, 0.009481869637966156, 0.0302740391343832, 0.03163287416100502, -0.006099769379943609, -0.0151669941842556, 0.05415356159210205, 0.006574362516403198, 0.02865542843937874, 0.006459461059421301, 0.045321136713027954, -0.007508561480790377, -0.03377104178071022, -0.00421638460829854, 0.048318568617105484, -0.09767623990774155, -0.03520980849862099, 0.03153296187520027, 0.024598905816674232, 0.03279188275337219, -0.00456608459353447, -0.02639736421406269, -0.041884083300828934, 0.00859762728214264, -0.020452462136745453, -0.01669568382203579, -0.007908218540251255, 0.047838978469371796, -0.005535253323614597, -0.026637159287929535, -0.07869251817464828, 0.01320867333561182, -0.05994859337806702, -0.011560087092220783, 0.01598629169166088, -0.009976444765925407, 0.04148442670702934, -0.025478152558207512, 0.06318581849336624, -0.006529401056468487, -0.029314862564206123, -0.06010845676064491, -0.024359112605452538, 0.024578923359513283, -0.01192977000027895, 0.04128459841012955, -0.020922059193253517, -0.04360261186957359, 0.02296031080186367, -0.050077058374881744, 0.04851839691400528, -0.014657431282103062, 0.0025628022849559784, -0.021381665021181107, -0.03858691081404686, 0.01123037002980709, -0.0016036248998716474, 0.042723365128040314, -0.018973730504512787, -0.018843840807676315, 0.023499848321080208, 0.020372530445456505, 0.043123021721839905, -0.0000017075201412808383, -0.022320859134197235, -0.010301167145371437, -0.02214101329445839, -0.041404496878385544, -0.01451755128800869, -0.03219239413738251, 0.011879812926054, 0.056551508605480194, 0.03287181258201599, 0.0004889557021670043, -0.004873320925980806, 0.014797311276197433, -0.010670850053429604, 0.018314296379685402, -0.015476728789508343, 0.0216414425522089, -0.006949041038751602, 0.023519832640886307, -0.004098985344171524, 0.007988150231540203, 0.04500140994787216, -0.004933269694447517, -0.051276031881570816, 0.06646300852298737, 0.030653715133666992, -0.03291177749633789, 0.003169781994074583, -0.015057088807225227, 0.0195632241666317, -0.020522402599453926, -0.021421631798148155, 0.005650154780596495, -0.0005844988045282662, 0.013048810884356499, -0.010106333531439304, 0.023240070790052414, 0.014507560059428215, -0.022280894219875336, 0.09335994720458984, -0.029274897649884224, 0.02337995171546936, -0.0033995849080383778, 0.046640004962682724, -0.0034145719837397337, -0.06822150200605392, -0.07745358347892761, 0.010341132059693336, 0.03475020080804825, 0.030673697590827942, -0.006794174201786518, -0.023899506777524948, -0.052195243537425995, 0.006099769379943609, -0.06390520185232162, -0.011879812926054, 0.029554657638072968, -0.06834139674901962, -0.07049954682588577, 0.05463315173983574, -0.002645231783390045, -0.0217013917863369, -0.036109037697315216, 0.047838978469371796, -0.0184941403567791, -0.007423634175211191, 0.03754780441522598, -0.028815289959311485, -0.0005204911576583982, 0.006299598142504692, 0.03998571261763573, -0.0649842768907547, -0.03463030606508255, -0.007338706869632006, -0.044002268463373184, 0.015726514160633087, -0.00199828646145761, -0.002537823747843504, -0.06798170506954193, -0.019743070006370544, 0.029814433306455612, 0.03976590186357498, -0.04715956002473831, 0.02086210995912552, -0.002190621569752693, -0.03820723667740822, 0.053474146872758865, -0.009821577928960323, 0.0003184769011568278, -0.004213886801153421, -0.012739076279103756, -0.016585778445005417, -0.04460175335407257, 0.09639734029769897, -0.0034195678308606148, -0.014807302504777908, -0.004438693635165691, -0.02383955754339695, 0.029194965958595276, -0.014657431282103062, -0.0029999276157468557, -0.017205245792865753, -0.01906365342438221, -0.02337995171546936, -0.08280899375677109, 0.024099335074424744, 0.04859832674264908, 0.015636591240763664, 0.02122180163860321, -0.030873525887727737, 0.03345131501555443, 0.012459316290915012, 0.012958887964487076, 0.013518407940864563, -0.0194633100181818, 0.0346902534365654, 0.016685692593455315, 0.04847842827439308, 0.027056798338890076, -0.0070639424957334995, 0.020232651382684708, 0.017644869163632393, -0.012719093821942806, -0.005740077700465918, 0.04560089856386185, 0.015326857566833496, -0.060827840119600296, 0.058669690042734146, -0.04508134350180626, 0.03632884845137596, -0.022760482504963875, 0.004473663866519928, 0.004333783872425556, 0.011000567115843296, -0.009406933560967445, -0.0020419990178197622, -0.030533816665410995, -0.029814433306455612, 0.0027176695875823498, 0.004091491457074881, 0.027216661721467972, 0.038387082517147064, 0.05799027159810066, 0.0066293152049183846, 0.022680550813674927, 0.05319438502192497, -0.012878956273198128, 0.1083870604634285, -0.058669690042734146, 0.01041107252240181, 0.025757912546396255, -0.00421638460829854, 0.023959454149007797, -0.06846129149198532, -0.0693405419588089, -0.003651868551969528, -0.019852975383400917, 0.029135016724467278, -0.002625248860567808, -0.015706531703472137, -0.02895517088472843, 0.023180123418569565, -0.02907506749033928, -0.032292310148477554, -0.08440762013196945, -0.000008337577128259, 0.06202681362628937, -0.03800740838050842, -0.017894655466079712, 0.04364257678389549, -0.03600912168622017, 0.03540963679552078, -0.0434027835726738, -0.029115034267306328, 0.0162360779941082, 0.05123606324195862, 0.029234930872917175, 0.09288035333156586, -0.028015976771712303, -0.01043105497956276, -0.023619746789336205, -0.0058300006203353405, -0.04236367344856262, -0.04026547074317932, 0.007683411706238985, 0.005620180629193783, 0.03347129747271538, -0.057430751621723175, -0.017065366730093956, -0.018384234979748726, -0.03219239413738251, 0.040964871644973755, -0.030633730813860893, -0.029095051810145378, -0.023959454149007797, -0.0519954152405262, -0.021961167454719543, 0.00034314324147999287, 0.010760772973299026, -0.04671993851661682, 0.033531248569488525, -0.03534968942403793, 0.058270033448934555, 0.0733770802617073, 0.03498999774456024, 0.0017410070868209004, 0.0433628149330616, 0.05539250001311302, -0.0651841014623642, -0.018094483762979507, -0.053554076701402664, 0.07237793505191803, 0.029794450849294662, -0.045720793306827545, -0.008098055608570576, -0.010710815899074078, 0.03261203691363335, -0.047918908298015594, 0.05167568847537041, -0.06150725856423378, 0.01017127837985754, -0.04408219829201698, -0.010590918362140656, 0.042723365128040314, 0.024379095062613487, 0.06826146692037582, 0.025458170101046562, 0.01774478331208229, -0.015486720018088818, 0.05207534506917, -0.02335996925830841, -0.02021266706287861, 0.07869251817464828, -0.07505563646554947, -0.073496975004673, 0.034910064190626144, 0.014237791299819946, 0.020642299205064774, -0.0054153562523424625, -0.03998571261763573, 0.08304878324270248, 0.06558376550674438, 0.04244360327720642, 0.010251209139823914, -0.012958887964487076, -0.008282897062599659, 0.03379102423787117, -0.07429628819227219, 0.028055941686034203, 0.005635167937725782, 0.01604624092578888, -0.06314585357904434, -0.01868397928774357, 0.025877809152007103, 0.07621464878320694, -0.04172421991825104, -0.03886667266488075, 0.011560087092220783, 0.0216414425522089, -0.030533816665410995, 0.01881386712193489, 0.008462742902338505, -0.03626890107989311, 0.04851839691400528, 0.03159290924668312, 0.009267053566873074, -0.0004243236326146871, 0.05679130181670189, -0.03734797239303589, -0.046160418540239334, 0.03826718404889107, 0.04108477011322975, -0.021141869947314262, -0.004850840196013451, 0.03165285661816597, -0.03720809519290924, 0.020882094278931618, -0.04799884185194969, -0.022400790825486183, 0.024379095062613487, 0.06966026872396469, 0.04416213184595108, -0.009766625240445137, 0.007533540017902851, -0.03628888353705406, -0.04120466858148575, 0.03115328587591648, -0.033930905163288116, 0.05363401025533676, 0.04160432517528534, 0.029095051810145378, -0.05035682022571564, -0.010101337917149067, 0.05099627003073692, -0.0519154816865921, -0.043482713401317596, 0.01145018171519041, -0.001668569166213274, 0.002872536890208721, 0.040485285222530365, -0.023300020024180412, -0.03930629417300224, -0.011789890006184578, -0.026277467608451843, 0.032731931656599045, -0.023180123418569565, -0.04076504334807396, 0.029174981638789177, -0.030174124985933304, 0.003272194182500243, -0.04280329495668411, 0.0019221018301323056, -0.01923350803554058, -0.0303339883685112, 0.026097621768712997, -0.013158716261386871, 0.02260061912238598, -0.05874962359666824, 0.03207249939441681, -0.03936624526977539, -0.017794741317629814, -0.02477875165641308, -0.011090490035712719, 0.027136730030179024, 0.0018821361009031534, 0.00791820976883173, -0.0047334409318864346, 0.03680843859910965, -0.006334567908197641, -0.10710815340280533, -0.013938047923147678, -0.00006869110075058416, 0.04512130841612816, -0.009346985258162022, -0.0259977076202631, 0.044002268463373184, -0.0281158909201622, 0.0020107757300138474, 0.009651723317801952, 0.01587638631463051, 0.04723949357867241, -0.02288038097321987, 0.01038109790533781, 0.006944045424461365, 0.04300312325358391, 0.013708245009183884, 0.018763909116387367, -0.027356542646884918, 0.06142732501029968, 0.021461596712470055, -0.009621749632060528, 0.025737930089235306, 0.0025253344792872667, 0.005815013777464628, -0.009212100878357887, -0.031473010778427124, -0.043562643229961395, 0.026077639311552048, -0.025358255952596664, -0.011290318332612514, -0.04711959511041641, 0.0063445596024394035, 0.0030174124985933304, -0.013398510403931141, 0.001171495416201651, -0.04124463349580765, 0.0047159562818706036, -0.09687692672014236, -0.03942619264125824, 0.0035244778264313936, -0.02084212750196457, 0.028415633365511894, -0.04244360327720642, 0.04032542183995247, -0.006149726454168558, 0.06098770350217819, -0.0024853688664734364, -0.09008275717496872, -0.005610189400613308, 0.016825571656227112, -0.04024548828601837, 0.028395650908350945, 0.007718381471931934, -0.005430343560874462, 0.03954608738422394, -0.03031400591135025, -0.0036793448962271214, -0.005590206477791071, 0.0045760758221149445, 0.04580072686076164, 0.05275476351380348, -0.045281171798706055, 0.036208949983119965, -0.0184142105281353, 0.017425058409571648, 0.021521545946598053, -0.0022767975460737944, 0.011839847080409527, 0.034410491585731506, -0.031333133578300476, 0.019723087549209595, 0.042243774980306625, -0.026797020807862282, 0.06690263003110886, 0.0058100176975131035, -0.01782471500337124, -0.09335994720458984, 0.006139735225588083, -0.0020857115741819143, 0.0033671127166599035, -0.008897370658814907, 0.04452182352542877, 0.005430343560874462, -0.05283469334244728, -0.01388809084892273, -0.01965314708650112, -0.013288605026900768, -0.0151370195671916, 0.07853265851736069, 0.0022118533961474895, -0.01761489547789097, -0.01885383203625679, 0.04855836182832718, -0.055232636630535126, 0.02433912828564644, -0.05531257018446922, -0.0822494700551033, 0.0063845254480838776, -0.030234074220061302, -0.01448757667094469, -0.014467594213783741, 0.009601766243577003, -0.009676702320575714, 0.04156436026096344, 0.01063088420778513, 0.007053951267153025, -0.017924629151821136, 0.025837844237685204, 0.06094773858785629, -0.02819582261145115, 0.0823293998837471, 0.029174981638789177, -0.008217953145503998, 0.023120174184441566, 0.010311158373951912, -0.0691806748509407, 0.02463887259364128, -0.04600055515766144, 0.04240363836288452, 0.03988579660654068, -0.03812730684876442, -0.078172966837883, -0.009966453537344933, 0.0075685097835958, -0.009376958943903446, 0.02086210995912552, -0.0217013917863369, 0.00987653061747551, 0.03796744346618652, 0.025638015940785408, -0.03510989248752594, 0.02463887259364128, 0.055712226778268814, 0.02208106592297554, -0.0014699895400553942, 0.005370394792407751, 0.028735360130667686, -0.0778132751584053, 0.042203810065984726, 0.00011607234046095982, -0.01971309632062912, 0.04152439162135124, -0.011360258795320988, -0.028855256736278534, 0.08057091385126114, 0.05099627003073692, -0.027496421709656715, -0.07505563646554947, -0.0908820703625679, -0.06878101825714111, 0.003654366359114647, 0.06898085027933121, -0.021521545946598053, 0.05363401025533676, 0.012429341673851013, 0.07437622547149658, -0.027995994314551353, -0.05231513828039169, -0.013288605026900768, 0.011290318332612514, 0.015656573697924614, 0.07477588206529617, 0.051315996795892715, 0.006484439596533775, -0.051955446600914, 0.07541532814502716, 0.00027367158327251673, 0.014027970843017101, -0.010026402771472931, 0.033990852534770966, -0.06558376550674438, 0.04648014158010483, 0.053953733295202255, -0.04739935323596001, 0.07141875475645065, -0.010341132059693336, 0.01640593260526657, -0.04468168690800667, 0.029135016724467278, 0.03415071591734886, 0.021481579169631004, -0.03431057929992676, -0.04296315833926201, -0.007843274623155594, -0.041884083300828934, -0.015456745401024818, -0.04252353683114052, -0.03429059684276581, -0.0038641863502562046, -0.07629457861185074, 0.01106051541864872, -0.015726514160633087, 0.02337995171546936, 0.022620603442192078, -0.027016833424568176, 0.013818151317536831, 0.02595774084329605, 0.03724806010723114, 0.008187978528439999, -0.025058511644601822, 0.0015062084421515465, -0.00389416073448956, -0.03425063192844391, -0.009027259424328804, 0.020882094278931618, 0.07565512508153915, -0.011030541732907295, 0.019363395869731903, -0.005320437718182802, -0.013158716261386871, 0.037427905946969986, 0.02951469086110592, 0.010510986670851707, -0.026157569140195847, 0.01150013878941536, 0.07193831354379654, 0.053074490278959274, 0.060907769948244095, -0.0067592039704322815, 0.03976590186357498, 0.018973730504512787, -0.0012526757782325149, -0.057830411940813065, -0.013498425483703613, 0.03552953526377678, -0.019193541258573532, 0.02021266706287861, -0.05667140334844589, -0.08037108182907104, 0.015866395086050034, 0.015716522932052612, -0.039626020938158035, 0.06094773858785629, 0.005854979157447815, -0.030094195157289505, -0.0694204717874527, 0.025638015940785408, -0.029115034267306328, 0.03676846995949745, 0.035289738327264786, -0.06098770350217819, 0.025298306718468666, 0.045321136713027954, 0.020682264119386673, -0.01675563119351864, -0.001985797192901373, 0.024838700890541077, -0.05467311665415764, 0.03343133255839348, -0.052674829959869385, 0.015077071264386177, 0.02769625000655651, 0.00913216918706894, 0.003234726144000888, -0.028815289959311485, -0.018783893436193466, -0.008772477507591248, -0.02258063666522503, 0.07529543340206146, -0.021761339157819748, 0.012179556302726269 ]
31,931
sonetel.auth
__init__
null
def __init__(self, username: str, password: str): self.__username = username self.__password = password # Get access token from API token = self.create_token() self._access_token = token['access_token'] self._refresh_token = token['refresh_token'] self._decoded_token = decode( self._access_token, audience='api.sonetel.com', options={"verify_signature": False} )
(self, username: str, password: str)
[ -0.0059340656735002995, -0.03955385461449623, 0.027804208919405937, 0.04905230924487114, -0.006615347694605589, -0.029660455882549286, -0.005583551246672869, 0.06729882210493088, 0.007582965772598982, 0.03376789391040802, 0.026955073699355125, 0.03289901465177536, 0.01685432717204094, 0.020556947216391563, -0.0011305332882329822, 0.01761459745466709, 0.005993307568132877, 0.05118501931428909, -0.06086120009422302, -0.017851565033197403, -0.009814411401748657, -0.03623630851507187, -0.021208608523011208, 0.09194345772266388, -0.030094895511865616, 0.047117073088884354, -0.028199154883623123, 0.02551352046430111, 0.022827886044979095, -0.019362233579158783, 0.006358632817864418, 0.037796344608068466, 0.03661150857806206, 0.0640997588634491, 0.004208644852042198, -0.0406794510781765, -0.0006405532476492226, 0.06631145626306534, -0.1725124716758728, 0.008733246475458145, -0.04672212898731232, 0.009982263669371605, 0.03969208523631096, 0.03647327423095703, 0.017357882112264633, 0.013763872906565666, 0.022097237408161163, 0.011848384514451027, -0.02638240158557892, -0.008812235668301582, -0.053515203297138214, 0.03499222919344902, -0.03605858236551285, 0.019579455256462097, -0.0020055859349668026, 0.042535699903964996, 0.022393446415662766, 0.03738165274262428, -0.08388655632734299, 0.03420233726501465, -0.07875225692987442, -0.011512679979205132, 0.01929311826825142, 0.022571172565221786, 0.007943354547023773, 0.04423396661877632, -0.02174178510904312, 0.05410762131214142, 0.03396536782383919, 0.03131922706961632, 0.09557696431875229, 0.021801026538014412, -0.025296300649642944, -0.004801063798367977, 0.05047411844134331, -0.010861018672585487, -0.08775702863931656, 0.0045542228035628796, -0.04905230924487114, -0.009419465437531471, -0.000530400313436985, -0.00042456708615645766, -0.033925872296094894, 0.02792269177734852, 0.016350770369172096, -0.01624215953052044, -0.017821945250034332, -0.06978698074817657, -0.026323160156607628, 0.045497793704271317, -0.06248047947883606, 0.02501983754336834, -0.06354683637619019, -0.0010805479250848293, -0.031082261353731155, 0.006274706684052944, -0.023400558158755302, 0.026224423199892044, 0.0028707648161798716, 0.03062807396054268, -0.020872903987765312, 0.007528660818934441, -0.05347570776939392, 0.04794646054506302, -0.01496845856308937, -0.001815518015064299, -0.003606352023780346, -0.04332559183239937, 0.03062807396054268, -0.011779268272221088, -0.04300963506102562, 0.016439633443951607, 0.017851565033197403, 0.08096396178007126, -0.04123237729072571, -0.00857526808977127, 0.029541971161961555, -0.016587737947702408, 0.016498874872922897, -0.01559049915522337, 0.043404579162597656, 0.01568923518061638, 0.007795249577611685, 0.03258305788040161, 0.047788482159376144, 0.005262657534331083, -0.030450347810983658, -0.027113052085042, 0.020912397652864456, -0.06567954272031784, 0.004650490824133158, 0.010327841155230999, 0.03641403466463089, 0.025158068165183067, -0.0231043491512537, -0.050118666142225266, 0.0342220813035965, -0.004551754333078861, -0.01874019391834736, 0.004460422787815332, -0.009844032116234303, 0.05189592391252518, 0.01574847660958767, -0.02077416703104973, -0.0659560039639473, -0.004171618726104498, -0.05959737300872803, -0.06259896606206894, 0.042614687234163284, -0.010387083515524864, 0.0231043491512537, -0.033609915524721146, 0.08214879781007767, -0.02278839237987995, -0.02859410084784031, -0.05995282530784607, 0.005973560269922018, -0.021978752687573433, 0.03594009950757027, 0.06848365813493729, 0.018236637115478516, -0.04411548376083374, -0.0025868972297757864, -0.03455778583884239, 0.012717265635728836, 0.00044986832654103637, 0.023696769028902054, -0.06765427440404892, -0.016893820837140083, -0.016627231612801552, -0.0078594284132123, -0.02397323027253151, -0.04028450697660446, 0.004312318284064531, 0.011107860133051872, -0.031042765825986862, 0.053317729383707047, 0.0008429631707258523, -0.01309246476739645, 0.006881936453282833, -0.03443930298089981, -0.0017328262329101562, -0.007508913520723581, -0.012243330478668213, 0.04103490337729454, 0.01712091453373432, 0.05007917061448097, 0.03787533566355705, 0.015126436948776245, 0.02266990765929222, -0.0031546324025839567, 0.02199850045144558, -0.03830977529287338, 0.012845623306930065, 0.013131959363818169, 0.002059890888631344, 0.02359803207218647, -0.026224423199892044, -0.010535188019275665, 0.004028450697660446, -0.03740140050649643, 0.07132727652788162, 0.015353531576693058, -0.02699456922709942, 0.01441553421318531, 0.019372107461094856, -0.004954105708748102, 0.011631163768470287, -0.01022910512983799, -0.06390228867530823, 0.01764421910047531, -0.006195717491209507, -0.0005356456968002021, 0.048696860671043396, -0.01537327840924263, -0.021801026538014412, 0.04609021544456482, -0.022748896852135658, 0.0634283497929573, 0.03242507949471474, 0.09770967811346054, 0.03609807789325714, -0.055450439453125, -0.10434477031230927, -0.028692837804555893, 0.039593350142240524, 0.017831819131970406, -0.03542666882276535, -0.041864290833473206, -0.0770539939403534, -0.02118886075913906, -0.03955385461449623, -0.03969208523631096, 0.05181693285703659, -0.053949642926454544, -0.05663527548313141, 0.026836590841412544, -0.01589658297598362, -0.06729882210493088, -0.05722769722342491, 0.04897332191467285, -0.021722037345170975, -0.01781207136809826, 0.012924612499773502, -0.0357426255941391, -0.011907625943422318, -0.04893382638692856, 0.06382329761981964, -0.04170631244778633, -0.053199246525764465, -0.043286096304655075, -0.03118099831044674, 0.008525899611413479, 0.005667476914823055, 0.0037890144158154726, -0.07527673244476318, 0.011226343922317028, 0.0008349408162757754, 0.02938399277627468, -0.023617779836058617, -0.000014164450476528145, -0.031398218125104904, -0.04265418276190758, 0.05146148055791855, 0.05205390229821205, -0.00833830051124096, -0.00311266933567822, -0.013763872906565666, 0.015215300023555756, -0.0455767847597599, 0.15876834094524384, -0.002806585980579257, 0.00945896003395319, -0.0020339726470410824, -0.03007514774799347, -0.03357042372226715, -0.006417874712496996, 0.00257208663970232, -0.00017217182903550565, -0.009088697843253613, -0.006175970192998648, -0.0757506713271141, 0.03376789391040802, 0.06441571563482285, 0.03495273366570473, -0.030825546011328697, -0.010367335751652718, 0.03228684514760971, -0.012924612499773502, -0.030173884704709053, 0.01615329645574093, 0.0031472269911319017, 0.002427684608846903, -0.0019377045100554824, 0.029680201783776283, 0.005450256634503603, -0.02926550805568695, 0.028021428734064102, 0.0070744724944233894, -0.036196812987327576, -0.013615768402814865, 0.0030929220374673605, -0.009157813154160976, -0.033175475895404816, 0.013744126074016094, -0.020556947216391563, 0.04056096822023392, 0.04407598823308945, -0.013349179178476334, -0.012865370139479637, 0.050987545400857925, 0.016380392014980316, 0.004603590816259384, 0.01796017587184906, -0.03327421098947525, 0.008604888804256916, 0.03382713720202446, -0.004559159278869629, 0.0462086983025074, 0.059913329780101776, 0.02484211139380932, -0.01734801009297371, 0.05304126814007759, -0.03264229744672775, 0.055173974484205246, 0.010396957397460938, 0.009972389787435532, 0.03605858236551285, -0.04411548376083374, 0.038605984300374985, -0.05845202878117561, 0.010337715037167072, -0.011631163768470287, -0.030766304582357407, -0.02705381065607071, -0.028357133269309998, -0.048696860671043396, 0.016953062266111374, 0.010614177212119102, -0.07247261703014374, -0.028317637741565704, -0.0727095827460289, -0.015057321637868881, 0.0751977413892746, 0.008402478881180286, -0.030213380232453346, -0.005410762038081884, -0.06935254484415054, 0.044036492705345154, -0.058807481080293655, -0.015323909930884838, 0.031635187566280365, 0.05754365399479866, 0.018621711060404778, 0.07938417047262192, -0.02569124661386013, -0.032820023596286774, -0.005430509336292744, -0.032010383903980255, -0.03929714113473892, -0.05513448268175125, -0.024664387106895447, 0.01014024205505848, 0.01580771990120411, -0.03550565615296364, -0.020734671503305435, -0.001147812232375145, -0.023459801450371742, 0.028376881033182144, 0.004855369217693806, -0.011265838518738747, -0.05845202878117561, -0.039336636662483215, 0.032010383903980255, -0.01349728461354971, 0.02513832226395607, -0.03153644874691963, -0.007059662137180567, -0.03832952305674553, 0.027804208919405937, 0.014395786449313164, 0.02243294008076191, 0.020872903987765312, 0.030154136940836906, 0.015017827041447163, -0.015610245987772942, -0.06682488322257996, -0.019342487677931786, 0.05809657648205757, 0.06007130816578865, -0.04885483905673027, -0.03676948696374893, -0.00044770847307518125, 0.0077508180402219296, -0.038349270820617676, 0.032938506454229355, -0.044707901775836945, 0.014287176541984081, -0.011176975443959236, 0.010456198826432228, 0.023341316729784012, -0.02796218730509281, 0.051856428384780884, 0.021090123802423477, 0.013823115266859531, 0.014158818870782852, 0.05402863025665283, -0.003329889615997672, 0.007977912202477455, 0.008619699627161026, -0.030707063153386116, -0.07405240088701248, -0.006896746810525656, 0.006827631499618292, 0.02525680512189865, -0.0060624233447015285, -0.007681702263653278, 0.018177395686507225, 0.044510431587696075, 0.005716845393180847, 0.01245067734271288, 0.008624636568129063, 0.005825455766171217, -0.01746649295091629, -0.04458941891789436, 0.04407598823308945, 0.03890219330787659, -0.011868131347000599, 0.02292662300169468, -0.03765811398625374, -0.014642627909779549, 0.0764220803976059, -0.036078330129384995, -0.052646320313215256, 0.02545427903532982, 0.022531677037477493, -0.03501197695732117, -0.008654257282614708, -0.0008133422234095633, -0.017486240714788437, 0.002897917293012142, -0.004423396661877632, 0.05564790964126587, -0.009439213201403618, 0.05410762131214142, -0.02168254368007183, -0.05663527548313141, 0.06003181263804436, 0.061572104692459106, -0.04652465507388115, -0.02223546802997589, 0.03769760951399803, 0.0023758478928357363, -0.04506335407495499, -0.035821616649627686, -0.029897423461079597, -0.011631163768470287, 0.037559378892183304, 0.08167485892772675, -0.011325080879032612, -0.007276882417500019, -0.024229945614933968, -0.0341825895011425, -0.03191164880990982, -0.02028048411011696, 0.04182479530572891, 0.027192041277885437, 0.007138651330024004, -0.0024869265034794807, -0.007242324762046337, 0.030410852283239365, -0.030608326196670532, -0.008807298727333546, 0.035031720995903015, 0.034972481429576874, -0.006472179666161537, 0.03181290999054909, -0.01851310022175312, -0.032188110053539276, -0.01668647490441799, -0.06457369029521942, 0.0431281179189682, -0.0127863809466362, -0.0009324431302957237, 0.013971219770610332, -0.013082590885460377, -0.029127277433872223, -0.043523065745830536, 0.05102704092860222, -0.00563785620033741, -0.01250991877168417, 0.065916508436203, -0.03495273366570473, 0.0060722967609763145, -0.055055491626262665, 0.045932237058877945, -0.011018997058272362, 0.014158818870782852, -0.023696769028902054, -0.002656012773513794, -0.023400558158755302, 0.010772155597805977, 0.018295880407094955, -0.043839022517204285, 0.023953482508659363, 0.011690406128764153, -0.09012670814990997, -0.01556087750941515, 0.018384743481874466, 0.039514362812042236, 0.01653837040066719, -0.010387083515524864, 0.00016785210755188018, -0.031042765825986862, 0.005079994909465313, 0.018759941682219505, -0.043720535933971405, 0.04786747321486473, -0.03694721311330795, 0.0012385264271870255, -0.0017439340008422732, 0.050316136330366135, 0.015116563066840172, -0.01210509892553091, -0.014622881077229977, 0.04198277369141579, 0.0010842506308108568, 0.013763872906565666, 0.01712091453373432, 0.027152547612786293, 0.003803825005888939, -0.04030425474047661, -0.04154833406209946, -0.013546652160584927, 0.017654092982411385, 0.00036223966162651777, -0.06192755326628685, -0.01537327840924263, 0.01920425519347191, 0.03230659291148186, 0.0014835164183750749, 0.007153462152928114, -0.04233822599053383, -0.01897716149687767, -0.07401290535926819, -0.021090123802423477, -0.0714852511882782, 0.022966118529438972, -0.010880766436457634, 0.00014741056656930596, 0.0640602633357048, -0.03694721311330795, -0.0032163425348699093, -0.017535608261823654, -0.04759100824594498, 0.0068078842014074326, -0.008540710434317589, -0.050869062542915344, -0.0017994733061641455, 0.03137847036123276, 0.006042676046490669, 0.003505147062242031, -0.06271744519472122, 0.03495273366570473, -0.008111205883324146, -0.013388673774898052, 0.0332939587533474, -0.004406117834150791, -0.04545830190181732, 0.017979923635721207, 0.009009708650410175, 0.017051799222826958, 0.014030461199581623, 0.07290706038475037, -0.007429924327880144, 0.00409756600856781, 0.007676765788346529, 0.013951472006738186, 0.05983433872461319, 0.0023770821280777454, 0.056398309767246246, 0.03368890658020973, -0.039593350142240524, -0.05315975099802017, -0.030233126133680344, -0.005904444959014654, 0.001551397843286395, -0.027389515191316605, 0.05651679262518883, -0.045616280287504196, -0.0051787314005196095, -0.07500027120113373, -0.012746886350214481, 0.012312445789575577, -0.0560823529958725, 0.006551168859004974, -0.00505037372931838, -0.05833354592323303, 0.02798193320631981, -0.0025264210999011993, -0.01836499571800232, 0.0579385980963707, -0.05742516741156578, -0.03313598036766052, -0.013349179178476334, -0.02476312220096588, -0.04731454700231552, 0.004045729525387287, -0.0075879027135670185, 0.005553930066525936, 0.04964473098516464, 0.0075632184743881226, -0.01891792006790638, -0.023400558158755302, 0.02691558003425598, 0.07373644411563873, 0.010564809665083885, 0.03376789391040802, 0.021228354424238205, 0.005830392241477966, 0.027646230533719063, 0.00046622156514786184, -0.05288328975439072, 0.07819933444261551, -0.06761477887630463, 0.016874073073267937, 0.06694336980581284, -0.043167613446712494, -0.03676948696374893, 0.030213380232453346, -0.002902854233980179, -0.005943939555436373, -0.03698670491576195, 0.0014106982853263617, -0.025414783507585526, 0.04759100824594498, 0.031694427132606506, -0.0072275144048035145, 0.06682488322257996, 0.046603646129369736, -0.014613007195293903, 0.003431094577535987, 0.028791572898626328, 0.02545427903532982, -0.05987383425235748, 0.019727559760212898, -0.0381912924349308, -0.007503976579755545, 0.014553764835000038, 0.0014995611272752285, -0.012124846689403057, 0.05620083585381508, 0.04838090389966965, 0.03485399857163429, -0.0702214241027832, -0.04454992339015007, -0.0523698590695858, 0.046485159546136856, 0.07322301715612411, -0.009157813154160976, -0.0016809895168989897, 0.003083048388361931, 0.06524509936571121, 0.023301823064684868, -0.01405020896345377, -0.0036952148657292128, -0.007128777913749218, -0.016429759562015533, 0.0058995080180466175, 0.05497650429606438, 0.01967819221317768, 0.025000089779496193, 0.05675376206636429, 0.006847378797829151, 0.04924978315830231, -0.010732661001384258, 0.006032802164554596, -0.0628754273056984, 0.07527673244476318, 0.05635881423950195, -0.042535699903964996, 0.04048198089003563, 0.031753670424222946, -0.04632718116044998, -0.039948802441358566, 0.06457369029521942, 0.011265838518738747, 0.055805888026952744, -0.014632754027843475, -0.04387851431965828, -0.018345247954130173, -0.0301936324685812, -0.044273462146520615, -0.02278839237987995, -0.011117734014987946, 0.0001335257402388379, -0.03370865434408188, -0.03694721311330795, 0.037124935537576675, 0.02871258370578289, 0.003455778816714883, 0.007592839654535055, -0.030825546011328697, 0.018355121836066246, 0.017950301989912987, -0.01955970749258995, -0.03746064007282257, -0.00620559137314558, 0.024308934807777405, -0.03124023973941803, 0.022590918466448784, 0.010861018672585487, 0.03815179690718651, -0.030489841476082802, 0.029423488304018974, 0.03449854627251625, -0.02821890078485012, 0.029620960354804993, -0.012519792653620243, 0.015936076641082764, -0.012065604329109192, -0.03193139657378197, 0.029107529670000076, 0.059241920709609985, 0.08025305718183517, -0.004307381343096495, 0.0009231865988112986, 0.014395786449313164, 0.02028048411011696, -0.0499211922287941, -0.03362966328859329, 0.0033792578615248203, -0.06109816953539848, 0.036137573421001434, -0.06236199662089348, -0.06682488322257996, 0.021583806723356247, 0.013043096289038658, 0.030331863090395927, 0.09154851734638214, -0.003922308795154095, -0.027626482769846916, -0.010801777243614197, 0.05035563185811043, -0.03001590631902218, 0.039830319583415985, -0.009246676228940487, -0.07342048734426498, 0.024486660957336426, 0.03161543980240822, -0.00620559137314558, 0.0051540471613407135, -0.0058649503625929356, 0.022353950887918472, -0.04573476314544678, 0.0004683814477175474, -0.02784370258450508, 0.02211698330938816, -0.0184834785759449, -0.03347168490290642, -0.027369767427444458, -0.0027078494895249605, -0.009577443823218346, -0.031635187566280365, -0.01816752180457115, 0.08475544303655624, 0.02020149491727352, 0.003329889615997672 ]
31,932
sonetel.auth
create_token
Create an API access token from the user's Sonetel email address and password. Optionally, generate a refresh token. Set the ``grant_type`` to ``refresh_token`` to refresh an existing access token. **Documentation**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjExMzI3NDM3-authentication :param refresh: Optional. Flag to return refresh token in the response. Accepted values 'yes' and 'no'. Defaults to 'yes' :param grant_type: Optional. The OAuth2 grant type - `password` and `refresh_token` accepted. Defaults to 'password' :param refresh_token: Optional. Pass the `refresh_token` generated from a previous request in this field to generate a new access_token. :return: dict. The access token and refresh token if the request was processed successfully. If the request failed, the error message is returned.
def create_token(self, refresh_token: str = '', grant_type: str = 'password', refresh: str = 'yes', ): """ Create an API access token from the user's Sonetel email address and password. Optionally, generate a refresh token. Set the ``grant_type`` to ``refresh_token`` to refresh an existing access token. **Documentation**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjExMzI3NDM3-authentication :param refresh: Optional. Flag to return refresh token in the response. Accepted values 'yes' and 'no'. Defaults to 'yes' :param grant_type: Optional. The OAuth2 grant type - `password` and `refresh_token` accepted. Defaults to 'password' :param refresh_token: Optional. Pass the `refresh_token` generated from a previous request in this field to generate a new access_token. :return: dict. The access token and refresh token if the request was processed successfully. If the request failed, the error message is returned. """ # Checks if grant_type.strip().lower() not in const.CONST_TYPES_GRANT: raise e.AuthException(f'invalid grant: {grant_type}') if refresh.strip().lower() not in const.CONST_TYPES_REFRESH: refresh = 'yes' if grant_type.strip().lower() == 'refresh_token' and not refresh_token: refresh_token = self._refresh_token # Prepare the request body. body = f"grant_type={grant_type}&refresh={refresh}" # Add the refresh token to the request body if passed to the function if grant_type == 'refresh_token': body += f"&refresh_token={refresh_token}" else: body += f"&username={self.__username}&password={self.__password}" # Prepare the request auth = (const.CONST_JWT_USER, const.CONST_JWT_PASS) headers = {'Content-Type': const.CONTENT_TYPE_AUTH} # Send the request try: req = requests.post( url=const.API_URI_AUTH, data=body, headers=headers, auth=auth, timeout=60 ) req.raise_for_status() except requests.exceptions.ConnectionError as err: return {'status': 'failed', 'error': 'ConnectionError', 'message': err} except requests.exceptions.Timeout: return {'status': 'failed', 'error': 'Timeout', 'message': 'Operation timed out. Please try again.'} except requests.exceptions.HTTPError as err: return {'status': 'failed', 'error': 'Timeout', 'message': err} # Check the response and handle accordingly. if req.status_code == requests.codes.ok: # pylint: disable=no-member response_json = req.json() if refresh_token and grant_type == 'refresh_token': self._access_token = response_json["access_token"] self._refresh_token = response_json["refresh_token"] self._decoded_token = decode( self._access_token, audience='api.sonetel.com', options={"verify_signature": False} ) return response_json return {'status': 'failed', 'error': 'Unknown error', 'message': req.text}
(self, refresh_token: str = '', grant_type: str = 'password', refresh: str = 'yes')
[ 0.036514218896627426, -0.025097375735640526, 0.03427021950483322, 0.03840390592813492, 0.03641580045223236, -0.03722285106778145, -0.025432007387280464, 0.04326590523123741, -0.033955272287130356, -0.014782845973968506, 0.03749843314290047, -0.007967186160385609, 0.051612015813589096, 0.024880848824977875, 0.027794113382697105, 0.026357164606451988, -0.015343846753239632, 0.015442267060279846, -0.027990955859422684, -0.031947482377290726, 0.0062497383914887905, -0.04858064651489258, -0.006795975379645824, 0.002499895403161645, 0.002556487452238798, 0.023168321698904037, 0.00950255524367094, 0.03265611454844475, 0.01856221631169319, -0.030412113294005394, -0.019674373790621758, -0.014143109321594238, 0.021199900656938553, 0.0716899111866951, 0.0031716192606836557, -0.02915232442319393, -0.03686853498220444, 0.07661096751689911, -0.11369603127241135, 0.004643014632165432, -0.06291075050830841, 0.028463376685976982, 0.00786876492202282, 0.012332160957157612, -0.0004779573646374047, -0.00641705421730876, -0.01065900269895792, 0.00888742320239544, -0.02836495451629162, -0.0075685810297727585, -0.005673975218087435, -0.04362022131681442, -0.04976169764995575, 0.007332370616495609, 0.018552374094724655, 0.0016374806873500347, -0.0016879214672371745, -0.007681765127927065, -0.004800488241016865, 0.010432634502649307, 0.017046531662344933, 0.012253424152731895, -0.019989321008324623, 0.05858022719621658, 0.02332579530775547, 0.046139802783727646, -0.03322695568203926, 0.054013486951589584, 0.03903380036354065, 0.03655358776450157, 0.06082422658801079, 0.006456422619521618, -0.045785486698150635, -0.017843741923570633, 0.055273279547691345, 0.01868032105267048, -0.059013281017541885, -0.02423126995563507, -0.017282741144299507, -0.04283285513520241, 0.010560581460595131, -0.01148573961108923, 0.023581691086292267, 0.027813797816634178, 0.06645391136407852, 0.02297147922217846, -0.02153453230857849, -0.04783264547586441, -0.082201287150383, -0.050076644867658615, 0.015688320621848106, 0.009335239417850971, -0.053816646337509155, -0.025648534297943115, -0.012814424932003021, -0.06251706928014755, -0.025865059345960617, -0.018079953268170357, 0.02360137552022934, 0.00244822446256876, 0.03114042989909649, 0.02173137478530407, -0.04649411886930466, 0.021888848394155502, 0.030195586383342743, -0.036789800971746445, -0.00394668523222208, -0.01570800505578518, 0.006456422619521618, -0.03066800907254219, -0.0867680236697197, -0.021692005917429924, 0.0072437915951013565, 0.007770344149321318, -0.021967584267258644, 0.018749216571450233, 0.04602169618010521, 0.055470120161771774, -0.006707396358251572, -0.025432007387280464, 0.05511580407619476, 0.003931921906769276, 0.01620011031627655, -0.014300582930445671, 0.06420991569757462, 0.014507267624139786, -0.03686853498220444, -0.007293002214282751, 0.04145495966076851, -0.09369686990976334, -0.043856434524059296, 0.033955272287130356, 0.01883779466152191, 0.028601165860891342, -0.03362064063549042, -0.045864224433898926, -0.02484147995710373, 0.003631737781688571, -0.010176739655435085, -0.042045485228300095, -0.011092055588960648, 0.04401390627026558, 0.0015242964727804065, -0.01328684575855732, -0.08346107602119446, 0.0036957114934921265, -0.05086401477456093, -0.006978054530918598, 0.01411358267068863, 0.028679901733994484, 0.04637601226568222, -0.006889475509524345, 0.0598006471991539, -0.032990746200084686, -0.022814005613327026, -0.06487917900085449, -0.022735269740223885, 0.022656532004475594, -0.0061808438040316105, 0.03639611601829529, -0.01384784560650587, -0.04519496113061905, 0.03749843314290047, -0.045982327312231064, 0.05267496034502983, 0.008749634027481079, 0.014851740561425686, -0.007588265463709831, -0.03141601011157036, 0.006874712649732828, -0.0029846192337572575, 0.034093063324689865, -0.02858148142695427, -0.03251832351088524, 0.014389161951839924, 0.014310425147414207, 0.027990955859422684, -0.0076276338659226894, -0.02742011286318302, -0.0063432385213673115, -0.02616032212972641, -0.038108643144369125, -0.0024543756153434515, -0.03539222106337547, 0.014713951386511326, 0.048423171043395996, 0.02747916616499424, 0.001953658415004611, -0.014861582778394222, 0.015501320362091064, -0.014408846385776997, 0.0028911191038787365, -0.02803032286465168, 0.017076056450605392, 0.00936476606875658, -0.00044320241431705654, -0.015668636187911034, 0.013109687715768814, 0.04283285513520241, 0.022105375304818153, -0.04409264400601387, 0.0688553899526596, 0.02692800760269165, -0.03680948540568352, 0.019635004922747612, -0.03379780054092407, 0.023483268916606903, -0.034230850636959076, -0.020373163744807243, 0.0007824475760571659, 0.002736106049269438, 0.016249319538474083, -0.012174687348306179, 0.04318717122077942, 0.004364974796772003, -0.014664741232991219, 0.07948486506938934, -0.02277463860809803, 0.01713510975241661, 0.0034964089281857014, 0.018995268270373344, 0.02165263704955578, -0.052911173552274704, -0.0840122327208519, 0.03066800907254219, 0.021062111482024193, 0.01716463640332222, -0.030963271856307983, -0.038167696446180344, -0.06417054682970047, -0.01779453083872795, -0.06932780891656876, 0.009940529242157936, 0.017361478880047798, -0.06515475362539291, -0.07424886524677277, 0.06720191240310669, -0.0064711859449744225, -0.026455586776137352, -0.025786323472857475, 0.03379780054092407, 0.0035751457326114178, -0.004962882958352566, 0.03881727531552315, -0.01526510901749134, 0.02354232221841812, 0.004542132839560509, 0.05539138242602348, -0.07661096751689911, -0.044250115752220154, -0.015767056494951248, -0.03314821794629097, 0.005044080317020416, 0.0044092643074691296, 0.014822214841842651, -0.04354148730635643, -0.00296001392416656, 0.014900951646268368, 0.020510952919721603, -0.05861959606409073, 0.014339950866997242, -0.009965134784579277, -0.0479113832116127, 0.05657243728637695, -0.0028468298260122538, -0.030353061854839325, -0.01785358414053917, 0.003233132418245077, -0.021003058180212975, -0.0339946411550045, 0.07413075864315033, 0.036514218896627426, 0.0003024910402018577, -0.007607949431985617, -0.0009700627415440977, 0.030431797727942467, 0.000026104653443326242, -0.01653474196791649, 0.022243164479732513, -0.014339950866997242, -0.05047032982110977, -0.06657201796770096, 0.025432007387280464, 0.05511580407619476, -0.0016743886517360806, 0.03535285219550133, -0.044250115752220154, 0.0027484085876494646, 0.008877580985426903, 0.021495163440704346, 0.017479583621025085, -0.002905882429331541, 0.014645056799054146, 0.018326004967093468, 0.04417138174176216, 0.047596435993909836, 0.027459481731057167, 0.020806215703487396, 0.0068255020305514336, -0.0025835533160716295, -0.009108871221542358, 0.048344433307647705, -0.01843426749110222, -0.07200486212968826, 0.055745698511600494, -0.05972190946340561, 0.02057000622153282, -0.030353061854839325, -0.007642396725714207, -0.0016497833421453834, -0.0015993425622582436, -0.012145161628723145, -0.010846002958714962, -0.02125895395874977, -0.025294218212366104, 0.003835961688309908, 0.009222054854035378, 0.024054111912846565, 0.058934543281793594, 0.05558822676539421, -0.0005837600328959525, -0.006067659705877304, 0.0712568610906601, -0.04145495966076851, 0.09472044557332993, -0.051454540342092514, -0.0031076455488801003, 0.026554007083177567, -0.003927001263946295, 0.037262219935655594, -0.054997701197862625, -0.06306822597980499, 0.01705637387931347, -0.022892743349075317, 0.01148573961108923, -0.011131424456834793, 0.004180435556918383, -0.018995268270373344, 0.012243581935763359, -0.014172635041177273, -0.033325377851724625, -0.07747707515954971, -0.0024248494300991297, 0.06802865117788315, -0.017174478620290756, -0.008808686397969723, 0.05310801416635513, -0.051730118691921234, 0.057202331721782684, -0.0548008568584919, -0.029664114117622375, 0.025510743260383606, 0.023916322737932205, 0.02165263704955578, 0.0976337119936943, -0.013769108802080154, -0.0007547666318714619, 0.001718678162433207, -0.012656951323151588, -0.04893496260046959, -0.06058801710605621, -0.0011269213864579797, 0.01661347784101963, 0.026475271210074425, -0.06330443918704987, -0.006766449194401503, -0.03137664124369621, -0.0011705957585945725, 0.025628849864006042, -0.027794113382697105, -0.01512731984257698, -0.025156427174806595, -0.03440801054239273, -0.014054530300199986, -0.0073717390187084675, 0.0024531453382223845, -0.07507559657096863, 0.01065900269895792, -0.03728190436959267, 0.047990117222070694, 0.05684801563620567, 0.01837521605193615, -0.000048556961701251566, 0.03458516672253609, 0.05047032982110977, -0.048698749393224716, -0.012312477454543114, -0.04090379923582077, 0.055627595633268356, 0.01628868840634823, -0.06881602108478546, -0.0075095281936228275, -0.006077501457184553, 0.05050969868898392, -0.017223689705133438, 0.05484022572636604, -0.06409180909395218, 0.019014952704310417, -0.047163382172584534, 0.0017088359454646707, 0.05259622633457184, 0.025156427174806595, 0.07440633326768875, 0.01298174075782299, 0.001734671532176435, -0.02789253368973732, 0.03635674715042114, -0.039427485316991806, -0.029742849990725517, 0.05787159502506256, -0.05141517147421837, -0.06704443693161011, 0.028345270082354546, 0.003230671864002943, 0.02913263998925686, 0.011958161368966103, -0.045509908348321915, 0.1104678213596344, 0.05767475441098213, 0.03251832351088524, 0.016574108973145485, -0.007273317780345678, 0.0028960402123630047, 0.05779285728931427, -0.06897348910570145, 0.038856640458106995, 0.0003620050265453756, 0.03371906280517578, -0.053265489637851715, -0.03155379742383957, 0.04326590523123741, 0.07184738665819168, -0.022873058915138245, -0.022046322003006935, 0.0073717390187084675, 0.018139004707336426, -0.00995529256761074, 0.01612137258052826, 0.004473238252103329, -0.029742849990725517, 0.07854001969099045, 0.014526951126754284, 0.012342003174126148, -0.0023657965939491987, 0.04511622339487076, -0.04161243140697479, -0.05578506737947464, 0.0232667438685894, 0.039840854704380035, -0.021081795915961266, 0.009866713546216488, 0.05094275251030922, -0.02021569013595581, 0.034978851675987244, -0.04035264253616333, -0.034722957760095596, 0.006525317672640085, 0.06739875674247742, 0.049997907131910324, -0.0012179608456790447, 0.02004837431013584, -0.018631109967827797, -0.045785486698150635, 0.04029358923435211, -0.00634815962985158, 0.055903173983097076, 0.0181586891412735, 0.027026427909731865, -0.015215898863971233, -0.007056791335344315, 0.02423126995563507, -0.07267412543296814, -0.05676927790045738, 0.008961238898336887, 0.01724337227642536, 0.0017961846897378564, 0.029467271640896797, 0.0020533096976578236, -0.031042007729411125, -0.00812958087772131, -0.045234329998493195, 0.03393558785319328, -0.04070695862174034, -0.022853374481201172, 0.020038532093167305, -0.00822308100759983, -0.005009633023291826, -0.03641580045223236, -0.0002749638806562871, 0.002518349327147007, -0.030648324638605118, 0.012519161216914654, -0.010668844915926456, 0.025845374912023544, -0.07314654439687729, 0.015245425514876842, -0.027026427909731865, -0.030884534120559692, -0.036573272198438644, 0.0011096976231783628, 0.028286218643188477, 0.020009005442261696, -0.006687712389975786, 0.007106001954525709, 0.03364032506942749, -0.020471584051847458, -0.1031452938914299, -0.03053021803498268, -0.00024789810413494706, 0.03913222253322601, -0.016141057014465332, -0.028069691732525826, 0.02616032212972641, -0.023719480261206627, -0.0002446686557959765, 0.017400847747921944, 0.05598191171884537, 0.04021485149860382, -0.033955272287130356, 0.01744021475315094, -0.00693868612870574, 0.05039159208536148, -0.007888449355959892, 0.03116011433303356, -0.03986053913831711, 0.059564437717199326, 0.03114042989909649, -0.017253214493393898, 0.03521506115794182, 0.01966453157365322, 0.011859740130603313, -0.015452109277248383, -0.01936926878988743, -0.033325377851724625, 0.008567554876208305, -0.044328853487968445, -0.02915232442319393, -0.026908323168754578, 0.004849698860198259, -0.011899108998477459, -0.02913263998925686, -0.016938267275691032, -0.045431170612573624, 0.005811764858663082, -0.08920886367559433, -0.026219375431537628, 0.022262848913669586, -0.04114001244306564, 0.038305483758449554, -0.04393516853451729, 0.0415336973965168, -0.013040793128311634, 0.05995812267065048, 0.014507267624139786, -0.08810655027627945, 0.019566111266613007, 0.017912637442350388, -0.05826527997851372, 0.032006535679101944, 0.015304477885365486, -0.008370712399482727, 0.042045485228300095, 0.0044092643074691296, 0.0020397768821567297, 0.0004505840188357979, 0.03641580045223236, 0.03184906020760536, 0.03785274550318718, -0.044683169573545456, 0.0276169553399086, -0.024388743564486504, 0.00565921189263463, 0.03393558785319328, -0.010747581720352173, 0.008542949333786964, 0.026081586256623268, -0.02110148034989834, 0.0020533096976578236, 0.030608955770730972, -0.03842359036207199, 0.0367504321038723, 0.010501529090106487, -0.023168321698904037, -0.07137496769428253, -0.0020114807412028313, -0.007425870280712843, 0.005929870065301657, -0.002900961320847273, 0.02948695607483387, -0.0003749227907974273, -0.05047032982110977, -0.004040185362100601, -0.026042217388749123, 0.004702067002654076, -0.014654899016022682, 0.0766897052526474, 0.03864011541008949, -0.021003058180212975, -0.030845167115330696, 0.054643385112285614, -0.06743812561035156, 0.04082506522536278, -0.052714329212903976, -0.052714329212903976, -0.004529830068349838, -0.046139802783727646, -0.0032651193905621767, -0.02478242851793766, 0.011859740130603313, -0.016160741448402405, 0.05972190946340561, 0.01730242557823658, -0.006289106793701649, -0.031730957329273224, 0.011899108998477459, 0.06043054163455963, -0.018326004967093468, 0.0693671777844429, 0.04499811679124832, -0.02055032178759575, 0.005944633390754461, 0.012194371782243252, -0.0616115964949131, 0.02125895395874977, -0.055627595633268356, 0.05224191024899483, 0.0433446429669857, -0.025313902646303177, -0.06629643589258194, -0.04192737862467766, -0.01456631999462843, -0.011997529305517673, 0.01508795190602541, -0.030136534944176674, 0.025077691301703453, 0.029467271640896797, 0.03482137620449066, -0.0176862683147192, 0.050627805292606354, 0.054997701197862625, 0.00995529256761074, 0.02395569160580635, 0.019320057705044746, 0.01983184739947319, -0.06550907343626022, 0.030884534120559692, 0.010737739503383636, -0.029506640508770943, 0.020333794876933098, -0.011643214151263237, -0.027459481731057167, 0.06767433136701584, 0.0538560152053833, -0.03578590601682663, -0.06090296432375908, -0.06964275240898132, -0.07361897081136703, -0.01672174222767353, 0.0399392731487751, -0.03137664124369621, 0.07554802298545837, 0.010668844915926456, 0.06133601814508438, -0.024310005828738213, -0.06724128127098083, -0.006047975271940231, 0.015855636447668076, 0.020924322307109833, 0.0693671777844429, 0.05094275251030922, 0.016416635364294052, -0.048698749393224716, 0.07948486506938934, 0.006426896434277296, 0.03466390445828438, -0.01952674239873886, 0.02436905913054943, -0.06519412249326706, 0.04362022131681442, 0.06861917674541473, -0.030963271856307983, 0.05192696303129196, -0.008282134309411049, 0.019762953743338585, -0.056375592947006226, 0.03663232550024986, 0.033246640115976334, 0.017804373055696487, -0.022656532004475594, -0.06035180762410164, -0.008902186527848244, -0.03137664124369621, -0.03832516819238663, -0.050627805292606354, -0.047990117222070694, -0.003181461477652192, -0.07287096977233887, 0.018690163269639015, -0.014064372517168522, 0.04519496113061905, 0.0018687702249735594, -0.00844452902674675, -0.004672540817409754, 0.04539180174469948, 0.03842359036207199, 0.011308582499623299, -0.025707585737109184, 0.004180435556918383, -0.016770951449871063, -0.03590400889515877, -0.011220003478229046, 0.01573752984404564, 0.06543033570051193, -0.0035923693794757128, 0.013532898388803005, -0.05625749006867409, -0.0392896942794323, 0.0542890690267086, 0.029801903292536736, 0.009276187047362328, -0.02332579530775547, 0.014428529888391495, 0.059406962245702744, 0.04720275104045868, 0.05228127911686897, -0.008926792070269585, 0.013769108802080154, 0.02547137625515461, 0.008611844852566719, -0.06424928456544876, -0.010324371047317982, 0.022026637569069862, 0.013414792716503143, 0.02153453230857849, -0.0351560078561306, -0.05314738303422928, 0.0076620811596512794, 0.017263056710362434, -0.04728148505091667, 0.037537798285484314, 0.003329093102365732, -0.0069534494541585445, -0.07054822891950607, 0.02492021769285202, -0.025924112647771835, 0.046061065047979355, 0.04314780235290527, -0.06771370023488998, 0.015186372213065624, 0.04968295991420746, 0.010865687392652035, -0.025038322433829308, -0.008646291680634022, 0.04936801269650459, -0.052084434777498245, 0.038167696446180344, -0.0556669645011425, 0.02995937690138817, 0.010708213783800602, 0.02539263851940632, 0.00148000696208328, -0.02401474304497242, -0.032912008464336395, -0.014930477365851402, -0.03785274550318718, 0.06834359467029572, -0.013788793236017227, 0.0001817714364733547 ]
31,933
sonetel.auth
get_access_token
Returns the access token
def get_access_token(self): """ Returns the access token """ return self._access_token if hasattr(self, '_access_token') else False
(self)
[ 0.0008581497822888196, 0.004443397745490074, 0.020344039425253868, 0.05129917711019516, 0.0720457062125206, -0.02038062922656536, 0.045042287558317184, 0.049689218401908875, 0.042480986565351486, -0.015367799438536167, 0.02907075360417366, -0.0025269966572523117, 0.01534950453788042, -0.0001427152892574668, 0.03433971479535103, 0.0015722265234217048, 0.0047566997818648815, 0.03907811641693115, 0.01641061343252659, -0.012943712063133717, -0.02994891256093979, -0.020270857959985733, -0.04566431790590286, -0.03955378755927086, -0.02371031790971756, 0.0628250241279602, 0.04255416616797447, -0.0064581348560750484, 0.05847081542015076, 0.014736621640622616, -0.0306624174118042, -0.007857701741158962, 0.054958175867795944, 0.0408710278570652, -0.007144196890294552, -0.014800653792917728, -0.021789344027638435, 0.04738404601812363, -0.14570137858390808, -0.047749947756528854, -0.0408710278570652, 0.01524888165295124, 0.010684279724955559, -0.013245578855276108, 0.0008358527556993067, -0.03516298905014992, -0.002680217381566763, 0.04255416616797447, -0.010492182336747646, -0.02650945447385311, 0.03710225969552994, -0.0003630413848441094, -0.052543237805366516, -0.011717947199940681, -0.05411660671234131, 0.0011731667909771204, 0.02345418930053711, 0.023618843406438828, -0.03408358246088028, 0.06567904353141785, -0.04420071840286255, -0.0031856168061494827, 0.05660472810268402, -0.040139228105545044, 0.036096032708883286, 0.04925013706088066, -0.03413846716284752, 0.023381007835268974, 0.03240044414997101, 0.08049799501895905, -0.004649216774851084, 0.0206916444003582, -0.0174991674721241, 0.03146739676594734, 0.000553423713427037, -0.05067714676260948, -0.0771317183971405, -0.016996053978800774, -0.01372124906629324, 0.003910555969923735, 0.00013614051567856222, 0.0023120304103940725, 0.0015539315063506365, 0.005314697045832872, -0.0003679009969346225, 0.010730016976594925, -0.03801700845360756, -0.056641317903995514, -0.04306642711162567, 0.048408567905426025, 0.007985766977071762, 0.05228710547089577, -0.005634859669953585, 0.007093885913491249, -0.02698512375354767, -0.04043194651603699, -0.02585083432495594, 0.001819208962842822, -0.04742063581943512, 0.023893268778920174, -0.014654294587671757, 0.028649969026446342, -0.01824011467397213, 0.04793289676308632, 0.02263091318309307, -0.013584036380052567, 0.0007981193484738469, -0.028064528480172157, 0.05272618681192398, -0.021368559449911118, -0.04010263830423355, -0.08386427909135818, 0.04076125845313072, 0.05660472810268402, 0.022191833704710007, -0.007798243314027786, 0.03060753270983696, 0.014873834326863289, -0.009796972386538982, -0.0011605890467762947, 0.040797848254442215, -0.00385795789770782, 0.021697869524359703, -0.01543183159083128, 0.05964169651269913, 0.023289533331990242, 0.018057163804769516, -0.017773590981960297, 0.028540197759866714, -0.04266393929719925, 0.013346201740205288, 0.01829499937593937, 0.007414048537611961, -0.02003302425146103, -0.04141987860202789, 0.015742845833301544, 0.07800987362861633, 0.018459653481841087, -0.03508980944752693, -0.003256509779021144, -0.04990875720977783, 0.028704853728413582, 0.014727474190294743, -0.026399683207273483, -0.027863282710313797, -0.009888446889817715, -0.03340666741132736, 0.03080877847969532, 0.07420451939105988, -0.011443521827459335, 0.08642557263374329, -0.05726334825158119, 0.02109413407742977, 0.006490150932222605, -0.08254703879356384, 0.009133778512477875, -0.029802553355693817, 0.012266797013580799, 0.014169476926326752, -0.009513399563729763, -0.008626092225313187, -0.02080141380429268, -0.0372852087020874, -0.010455591604113579, 0.08766963332891464, -0.002687077969312668, 0.03772428631782532, -0.04365186765789986, -0.03488856181502342, -0.01298030186444521, 0.012815646827220917, 0.027625449001789093, -0.01952076330780983, -0.01972200907766819, 0.002648201072588563, 0.004802437033504248, -0.00019224041898269206, 0.037175439298152924, 0.019904958084225655, 0.04313960671424866, -0.03260168805718422, -0.0017185864271596074, -0.07420451939105988, -0.0015081940218806267, 0.04328596591949463, 0.05247005820274353, 0.05126258730888367, 0.014416459016501904, 0.027003418654203415, 0.09008457511663437, -0.01658441685140133, -0.02702171355485916, 0.002013593213632703, -0.04526182636618614, -0.03197965770959854, -0.03723032400012016, 0.00104395835660398, 0.00766560435295105, 0.0025361443404108286, 0.05268959701061249, -0.05386047810316086, 0.001621394301764667, -0.003670434234663844, 0.014032264240086079, 0.04317619651556015, 0.028521902859210968, -0.0027168074157088995, -0.014736621640622616, -0.03375427424907684, 0.017462575808167458, -0.0781562328338623, -0.04471297934651375, 0.008863926865160465, 0.05623882636427879, -0.0022628626320511103, -0.010144577361643314, 0.009641464799642563, -0.013556594029068947, 0.020453808829188347, 0.04690837860107422, 0.07844895869493484, -0.01103188470005989, 0.00030558364233002067, -0.06432521343231201, 0.06622789800167084, 0.003693302860483527, 0.015505011193454266, -0.0309185478836298, -0.1021592766046524, -0.061032116413116455, -0.011974076740443707, 0.003992883488535881, 0.008955402299761772, 0.01997813954949379, 0.001748315873555839, -0.0649106577038765, 0.07647309452295303, -0.04643270745873451, -0.03194306790828705, -0.01298030186444521, 0.027003418654203415, 0.018541982397437096, 0.02146003395318985, 0.07127731293439865, -0.03457754850387573, 0.023015107959508896, -0.04760358855128288, 0.04193213954567909, -0.0024103661999106407, -0.03973673656582832, -0.006037349812686443, 0.0023829236160963774, -0.04760358855128288, -0.013199841603636742, 0.0013229571050032973, -0.05579974874854088, -0.024698248133063316, 0.048152435570955276, 0.0005142609588801861, 0.010391559451818466, 0.012486336752772331, -0.002783126663416624, 0.006467282306402922, 0.04098079726099968, 0.013986526988446712, 0.00429017748683691, 0.057958558201789856, 0.010675132274627686, -0.03260168805718422, -0.009842709638178349, 0.1251377910375595, 0.008159569464623928, -0.01886214315891266, -0.023289533331990242, -0.008918811567127705, -0.06611812859773636, 0.03587649390101433, -0.0005365580436773598, -0.06249571591615677, -0.004626347683370113, -0.027973053976893425, -0.06670356541872025, 0.0070893121883273125, 0.08649875223636627, -0.04987216740846634, -0.018048016354441643, 0.030991727486252785, 0.012312534265220165, -0.0010553927859291434, -0.0021633836440742016, 0.0296378992497921, -0.018084606155753136, 0.012943712063133717, -0.007615293376147747, 0.027314433827996254, -0.013080923818051815, -0.019173158332705498, -0.021844228729605675, -0.025832539424300194, 0.05451909825205803, -0.0037527617532759905, 0.017910804599523544, -0.06725241988897324, -0.0014395876787602901, 0.06765490770339966, 0.024808019399642944, 0.0069155097007751465, 0.028009643778204918, 0.004784142132848501, 0.06048326566815376, -0.021478328853845596, -0.024588478729128838, -0.022960223257541656, 0.013291317038238049, -0.031138088554143906, -0.05038442835211754, -0.02616184763610363, 0.018432211130857468, 0.026436273008584976, 0.06567904353141785, -0.04727427661418915, -0.011406932026147842, 0.0370473712682724, -0.013602332212030888, 0.06267866492271423, -0.024460414424538612, -0.012321681715548038, 0.008722140453755856, -0.05115281790494919, 0.055104538798332214, -0.059348978102207184, -0.026582634076476097, -0.007034427020698786, 0.0017025783890858293, -0.02698512375354767, -0.014571966603398323, 0.0004213567008264363, -0.029857438057661057, 0.03479708731174469, -0.012019813992083073, -0.0418955460190773, -0.05309208855032921, 0.012275944463908672, 0.017078381031751633, -0.07786351442337036, 0.02795475907623768, 0.017252184450626373, 0.0004728113708551973, 0.027149777859449387, -0.06498383730649948, -0.03616921231150627, 0.011690503917634487, 0.06198345497250557, 0.002799134934321046, 0.03889516741037369, -0.04354209825396538, 0.018450506031513214, 0.036864422261714935, -0.006682248320430517, 0.041822366416454315, 0.013318759389221668, -0.014361574314534664, 0.01369380671530962, 0.05645836517214775, -0.05762924626469612, 0.0022834446281194687, -0.07080164551734924, -0.020270857959985733, 0.05378729850053787, -0.08320565521717072, -0.04507887735962868, -0.027735218405723572, -0.019758598878979683, -0.00396772800013423, 0.02268579788506031, 0.014901276677846909, -0.035839904099702835, 0.01812119595706463, -0.03699248656630516, 0.06783785670995712, 0.008877648040652275, 0.02508244290947914, 0.025155624374747276, 0.05748288705945015, -0.01915486343204975, 0.00422614486888051, -0.06165414676070213, -0.048408567905426025, 0.0045531680807471275, 0.028320658951997757, -0.034467779099941254, -0.0398465059697628, -0.11657573282718658, 0.013135809451341629, -0.048554927110672, -0.007167065981775522, -0.060117367655038834, -0.02416769415140152, 0.01093126181513071, 0.024039627984166145, 0.07296045869588852, 0.05228710547089577, 0.018102901056408882, -0.001565365819260478, 0.008040651679039001, 0.019703714177012444, 0.03260168805718422, 0.0007152201142162085, -0.040907617658376694, -0.03616921231150627, -0.061141885817050934, -0.06575222313404083, 0.008909664116799831, -0.028576787561178207, 0.04910377785563469, -0.006892641074955463, -0.008557485416531563, 0.05634859576821327, 0.028540197759866714, 0.01693202182650566, 0.041163746267557144, 0.01105932705104351, -0.016511237248778343, -0.01911827363073826, -0.055507026612758636, -0.006270610727369785, 0.030680714175105095, 0.03668147325515747, -0.007226524408906698, -0.02998550422489643, 0.03600455820560455, 0.036864422261714935, -0.011333751492202282, -0.006631937343627214, 0.01977689377963543, 0.009577431716024876, -0.038602448999881744, -0.02835724875330925, -0.037577927112579346, 0.005419893655925989, 0.022393079474568367, 0.023435894399881363, 0.006124251056462526, -0.01946587860584259, 0.06249571591615677, -0.013776134699583054, -0.053714118897914886, 0.06882578879594803, 0.07083823531866074, -0.0843033567070961, -0.0240213330835104, 0.07808305323123932, 0.006764575839042664, -0.03633386641740799, -0.04540818929672241, -0.030644122511148453, -0.06033690646290779, 0.009344170801341534, 0.016602711752057076, 0.023563958704471588, -0.003315968671813607, 0.02482631430029869, -0.06915509700775146, -0.03437630459666252, 0.04306642711162567, 0.053933657705783844, 0.02641797810792923, 0.04021240770816803, -0.032162606716156006, 0.01946587860584259, 0.0429200679063797, -0.056129056960344315, -0.03357132151722908, -0.06209322810173035, -0.003343411022797227, 0.009714644402265549, -0.013172399252653122, 0.02958301268517971, 0.004596618469804525, 0.004425102844834328, -0.04057830944657326, 0.06015395745635033, -0.04533500596880913, 0.01019031461328268, -0.009842709638178349, -0.004829879850149155, -0.021478328853845596, -0.002031888347119093, 0.047896306961774826, -0.07211888581514359, 0.024515299126505852, 0.03055264800786972, -0.019758598878979683, 0.025484934449195862, -0.0314125120639801, 0.02396644838154316, 0.0060190544463694096, -0.019136568531394005, 0.036150917410850525, 0.05404342710971832, -0.026893649250268936, 0.01589835435152054, 0.006494724657386541, -0.004093505907803774, 0.04848174750804901, -0.012897973880171776, -0.08613285422325134, -0.030314812436699867, -0.017563199624419212, -0.03805359825491905, -0.0009759238455444574, 0.014233509078621864, 0.02217353880405426, 0.013858461752533913, 0.04859151691198349, 0.009170368313789368, -0.008502600714564323, 0.011516701430082321, -0.006206578575074673, 0.03827313706278801, 0.01775529608130455, -0.028906097635626793, 0.003350271610543132, -0.04449343681335449, -0.035272758454084396, -0.00046394974924623966, -0.014736621640622616, 0.038748808205127716, -0.05506794527173042, 0.028082823380827904, 0.010034807026386261, -0.03657170385122299, -0.01875237375497818, 0.01784677244722843, -0.010821491479873657, -0.01167220901697874, -0.06406908482313156, 0.006202004849910736, 0.026125257834792137, 0.07691217213869095, 0.020398924127221107, -0.10398877412080765, -0.012248502112925053, 0.02789987437427044, -0.0669596940279007, -0.0066548059694468975, -0.04946967586874962, -0.025558114051818848, 0.04515205696225166, 0.010940409265458584, 0.06520337611436844, -0.0047338311560451984, 0.03545570746064186, -0.03638875484466553, 0.025064148008823395, 0.026546044275164604, -0.005973317194730043, -0.02074652910232544, 0.025612998753786087, 0.0022914486471563578, 0.029034163802862167, 0.003565237857401371, -0.04987216740846634, 0.0029066179413348436, -0.017050938680768013, -0.04226144775748253, -0.023820089176297188, 0.021807638928294182, -0.02431405335664749, -0.006723412312567234, 0.010748311877250671, -0.060519855469465256, 0.00860779732465744, 0.06633766740560532, 0.03479708731174469, 0.07270432263612747, -0.01384931430220604, 0.031851593405008316, 0.001114851445890963, -0.002373776165768504, 0.0418955460190773, -0.008090963587164879, 0.05697062611579895, -0.02268579788506031, -0.025667883455753326, -0.04760358855128288, -0.029747668653726578, -0.02641797810792923, 0.03274804726243019, -0.06509360671043396, -0.0582512766122818, -0.0005437044892460108, 0.007903439924120903, -0.02846701815724373, 0.014306689612567425, 0.015623928979039192, -0.009787824004888535, -0.03823654726147652, -0.0025109886191785336, -0.02605207823216915, 0.046871788799762726, 0.043395739048719406, -0.024588478729128838, -0.000529697397723794, 0.005804088432341814, 0.024844609200954437, -0.04489592835307121, -0.03148569166660309, -0.03179670870304108, -0.02422257885336876, -0.022777274250984192, 0.015386094339191914, -0.025942308828234673, 0.015880059450864792, 0.005287254694849253, 0.06732559949159622, -0.023746909573674202, 0.044420257210731506, -0.017819328233599663, -0.0013389652594923973, 0.04423730820417404, 0.019191453233361244, -0.017288774251937866, 0.03157716989517212, -0.028887802734971046, -0.016090450808405876, 0.0597880557179451, -0.058434225618839264, -0.03754133731126785, 0.02641797810792923, 0.010720869526267052, -0.0008192729437723756, 0.017517462372779846, -0.03948060795664787, 0.018990209326148033, 0.03970014676451683, 0.013629774563014507, -0.0188987348228693, 0.04899400845170021, 0.043249376118183136, -0.03357132151722908, -0.0018317868234589696, -0.032729752361774445, 0.016090450808405876, -0.021935703232884407, 0.026546044275164604, -0.04017581790685654, 0.02722295932471752, 0.03015015833079815, -0.012440599501132965, -0.07844895869493484, 0.0408710278570652, 0.07383861392736435, -0.005570827051997185, -0.01205640472471714, -0.08298611640930176, -0.02621673420071602, 0.030772188678383827, 0.0007929738494567573, -0.07299704849720001, 0.0014555958332493901, -0.05938556790351868, -0.04676201567053795, -0.03049776330590248, 0.002348620444536209, -0.0044662668369710445, -0.05247005820274353, 0.026838762685656548, -0.0004656648961827159, 0.051116228103637695, -0.004454832058399916, 0.039370838552713394, 0.051116228103637695, -0.014032264240086079, 0.017050938680768013, -0.033242013305425644, 0.025777652859687805, -0.022868748754262924, 0.02661922387778759, 0.026637518778443336, -0.021899113431572914, 0.04925013706088066, 0.018130343407392502, 0.024003038182854652, -0.043761637061834335, 0.008100111037492752, 0.006147119682282209, -0.016456350684165955, 0.015806879848241806, -0.05181143805384636, -0.010464739054441452, -0.05093327537178993, -0.010181167162954807, 0.02713148295879364, -0.003933424595743418, 0.004319906700402498, -0.001946130534633994, 0.04120033606886864, -0.0010451017878949642, 0.03719373419880867, -0.013346201740205288, 0.0019404133781790733, 0.00010519624629523605, -0.01461770385503769, 0.008406552486121655, -0.009467662312090397, 0.01641061343252659, -0.0186426043510437, -0.03433971479535103, -0.04281029850244522, -0.011891749687492847, -0.011516701430082321, 0.03973673656582832, 0.022923633456230164, 0.027607154101133347, -0.0853278785943985, -0.01613618992269039, 0.049835577607154846, 0.03422994166612625, 0.03470561280846596, -0.04665224626660347, 0.0135382991284132, 0.008708419278264046, 0.06838670372962952, 0.03856585919857025, 0.006645658519119024, -0.056385185569524765, -0.014123739674687386, -0.033022474497556686, -0.017791885882616043, 0.00294320797547698, 0.004146104212850332, -0.0012520640157163143, 0.03684612736105919, -0.03871221840381622, -0.007139623165130615, -0.02012449875473976, 0.016200222074985504, 0.009806119836866856, 0.05272618681192398, 0.024844609200954437, 0.009412776678800583, -0.0028906099032610655, -0.009989069774746895, -0.008100111037492752, 0.028906097635626793, -0.012129584327340126, -0.05514112859964371, 0.027259549126029015, 0.02718636766076088, 0.03966355696320534, -0.019703714177012444, 0.029107343405485153, -0.006375807337462902, 0.012230207212269306, 0.08913323283195496, -0.10223245620727539, 0.006490150932222605, 0.01167220901697874, -0.012257649563252926, -0.03904152661561966, 0.01627340167760849, -0.06417885422706604, -0.02550322934985161, 0.006252315826714039, 0.06322751939296722, 0.013236431404948235, 0.022100359201431274 ]
31,934
sonetel.auth
get_decoded_token
Returns the decoded token
def get_decoded_token(self): """ Returns the decoded token """ return self._decoded_token if hasattr(self, '_decoded_token') else False
(self)
[ 0.03927961736917496, 0.010221239179372787, 0.017052477225661278, 0.08662009239196777, 0.0371619313955307, -0.02973296120762825, 0.013500233180820942, 0.0156093779951334, 0.036786213517189026, -0.025002330541610718, 0.031953115016222, 0.0035479741636663675, 0.0012221510987728834, 0.0022372303064912558, 0.05007297173142433, 0.02051079086959362, 0.0065110232681035995, 0.03688868507742882, -0.0074247014708817005, -0.01427728682756424, -0.05020959675312042, 0.01628396287560463, -0.013884490355849266, 0.00937587395310402, -0.03637634217739105, 0.022970037534832954, 0.002057910431176424, -0.029459713026881218, -0.00821029394865036, 0.01871759071946144, -0.048262692987918854, -0.013662475161254406, 0.08217979222536087, 0.06411116570234299, -0.014951871708035469, -0.03197019174695015, -0.04269523546099663, 0.05273715406656265, -0.1578015834093094, -0.03507840633392334, -0.06926874816417694, 0.02423381619155407, 0.025770844891667366, 0.00479040527716279, 0.000532089383341372, -0.017641671001911163, -0.0073350416496396065, 0.018102779984474182, -0.024951094761490822, 0.005127697717398405, 0.07302593439817429, -0.016377892345190048, -0.03226051852107048, 0.020425399765372276, -0.030996741726994514, -0.02735910750925541, 0.019981369376182556, 0.020732806995511055, -0.015361745841801167, 0.06636547297239304, -0.028161777183413506, -0.0045342338271439075, -0.009700357913970947, 0.001744100358337164, 0.023892253637313843, 0.058065518736839294, 0.0044659217819571495, 0.029169384390115738, 0.022628474980592728, 0.05468405783176422, 0.0002735163434408605, -0.007761993911117315, -0.03600062429904938, 0.053010404109954834, 0.047784507274627686, -0.0788324847817421, -0.0609346404671669, -0.02942555584013462, -0.027529887855052948, 0.03890389949083328, -0.014798169024288654, 0.015558144077658653, 0.02587331272661686, -0.011211768724024296, -0.025190189480781555, -0.01684753969311714, 0.04522279277443886, -0.029169384390115738, -0.052395593374967575, 0.020852353423833847, 0.010289551690220833, 0.014968949370086193, -0.02824716828763485, 0.02751280926167965, -0.03511255979537964, -0.056699272245168686, -0.012723180465400219, 0.03270455077290535, -0.05082440748810768, -0.04594007506966591, 0.002839233260601759, 0.08846452832221985, -0.0728893056511879, 0.024045957252383232, 0.024045957252383232, 0.03552243486046791, -0.020254619419574738, -0.01709517277777195, 0.03521503135561943, -0.04368576407432556, -0.03801583871245384, -0.044573824852705, 0.03613724559545517, 0.09495420008897781, 0.03133830428123474, -0.03582984209060669, 0.009034311398863792, 0.02869119867682457, -0.013756404630839825, 0.013858873397111893, 0.03197019174695015, -0.017863687127828598, -0.01962273009121418, -0.06031982973217964, 0.0016811249079182744, 0.017291570082306862, 0.04730632156133652, -0.0065110232681035995, 0.03658127784729004, -0.026351498439908028, 0.010528645478188992, 0.053147029131650925, -0.021467164158821106, -0.001225353218615055, -0.0245070643723011, -0.025343891233205795, 0.05024375393986702, 0.011032449081540108, -0.03627387061715126, 0.02095482125878334, -0.01471277792006731, 0.0579630509018898, 0.02273094281554222, -0.04180717468261719, -0.06865394115447998, 0.022526007145643234, -0.04949231818318367, 0.034548982977867126, 0.026522280648350716, -0.05512808635830879, 0.07302593439817429, -0.05024375393986702, 0.024438751861453056, 0.019571496173739433, -0.0036013431381434202, 0.019349480047822, -0.001271250657737255, 0.04860425740480423, -0.03214097395539284, 0.004816022701561451, 0.021620867773890495, -0.03760596364736557, -0.040065210312604904, -0.04389070346951485, 0.07002018392086029, -0.010426176711916924, 0.08573203533887863, -0.04395901411771774, -0.04402732849121094, 0.0401335209608078, -0.01798323355615139, 0.028896136209368706, -0.050756096839904785, 0.032619159668684006, -0.008176137693226337, 0.008351188153028488, -0.014798169024288654, 0.047033071517944336, -0.03832324221730232, 0.043173421174287796, -0.01829063892364502, -0.00008025370334507897, -0.026795530691742897, -0.04870672523975372, 0.06127620115876198, 0.0505853146314621, 0.038254931569099426, 0.028435027226805687, 0.04044092819094658, 0.027717746794223785, 0.006165191996842623, -0.00304630515165627, 0.005844977684319019, -0.042012110352516174, -0.02484862692654133, -0.0490482859313488, 0.017180562019348145, 0.03996273875236511, 0.017641671001911163, -0.010870207101106644, -0.006271929945796728, 0.009973607026040554, -0.013986959122121334, -0.0038105498533695936, -0.04535941779613495, 0.03251669183373451, -0.009700357913970947, 0.05973917245864868, 0.007189877796918154, -0.010221239179372787, -0.026795530691742897, -0.0460766963660717, 0.01730864867568016, 0.0698835626244545, 0.015831394121050835, -0.04696476086974144, -0.02689799852669239, -0.004288736265152693, 0.00662203086540103, 0.04149976745247841, 0.11859028786420822, -0.0054564508609473705, -0.0009713165927678347, -0.059807486832141876, -0.0014345599338412285, 0.00844084843993187, -0.016258345916867256, -0.0475454144179821, -0.07685142755508423, -0.06148114055395126, -0.00432716216892004, -0.008906225673854351, -0.0021006055176258087, 0.04180717468261719, 0.014448068104684353, -0.02554882876574993, 0.056528490036726, -0.01770998351275921, -0.016616985201835632, 0.0064427112229168415, 0.005260053090751171, -0.015284894034266472, -0.004487269092351198, 0.055537961423397064, -0.02377270720899105, 0.06739015877246857, 0.03617140278220177, 0.039484553039073944, -0.006195078603923321, -0.02915230765938759, -0.021825803443789482, -0.021791648119688034, -0.03253376856446266, 0.00950395967811346, 0.017829529941082, -0.0624375119805336, -0.03839155659079552, 0.011408166959881783, 0.06486260145902634, 0.026710139587521553, -0.011843658052384853, -0.003966387361288071, -0.0018113453406840563, 0.06452103704214096, -0.010383481159806252, -0.011570408940315247, 0.016505977138876915, 0.016335196793079376, -0.011672877706587315, -0.042866017669439316, 0.08340941369533539, -0.05970501899719238, -0.031953115016222, -0.0334901437163353, 0.02081819623708725, -0.04225120320916176, 0.028486261144280434, 0.004088068846613169, -0.04891166090965271, -0.015874087810516357, -0.004290871322154999, -0.05779227241873741, 0.03478807955980301, 0.03183356672525406, -0.00029539765091612935, 0.017334265634417534, 0.0029715884011238813, -0.021381773054599762, 0.009153858758509159, -0.021928273141384125, -0.008415230549871922, -0.02795683965086937, 0.029066916555166245, 0.04430057480931282, 0.056289397180080414, -0.044505514204502106, -0.004224693402647972, -0.0341903455555439, -0.0038596491795033216, -0.0012893960811197758, -0.041704706847667694, 0.02807638607919216, -0.028264245018363, 0.00024282914819195867, 0.03208974003791809, 0.010093153454363346, -0.0011879949597641826, 0.03876727446913719, -0.00220947852358222, 0.03343890979886055, -0.002909680362790823, 0.037845056504011154, 0.004147842060774565, 0.013560006394982338, -0.03692283853888512, -0.0348905473947525, 0.0006137440213933587, 0.019554417580366135, 0.06356466561555862, 0.08211147785186768, -0.005968793760985136, -0.0400993637740612, 0.021381773054599762, -0.008265797980129719, 0.03675206005573273, -0.049287378787994385, -0.034412357956171036, -0.036342184990644455, -0.005866325460374355, 0.030518554151058197, -0.0431392677128315, -0.05215650051832199, 0.00713864341378212, -0.031867723912000656, -0.016856078058481216, -0.026419810950756073, -0.016762148588895798, -0.0065622576512396336, 0.0371960885822773, -0.043036796152591705, -0.019247012212872505, -0.09618382900953293, 0.017291570082306862, 0.010374941863119602, -0.0490824431180954, 0.010801894590258598, -0.03183356672525406, 0.011638721451163292, 0.055537961423397064, -0.030723491683602333, -0.047613725066185, -0.04983387887477875, 0.05570874363183975, 0.034839313477277756, -0.0029459712095558643, -0.05400093272328377, 0.012859804555773735, 0.0639403834939003, 0.010545723140239716, 0.028008073568344116, -0.002474188804626465, -0.0053155566565692425, -0.010964136570692062, 0.0171122495085001, -0.03996273875236511, -0.038254931569099426, -0.048535943031311035, 0.005097811110317707, 0.07029343396425247, -0.039757803082466125, -0.040065210312604904, -0.004098742734640837, -0.020886508747935295, 0.004305814392864704, -0.008176137693226337, -0.014892098493874073, -0.028298402205109596, 0.031184600666165352, -0.022662630304694176, 0.04385654628276825, 0.01993013545870781, 0.04225120320916176, -0.03104797564446926, 0.054923150688409805, 0.016181495040655136, 0.0038959402590990067, -0.06742431223392487, -0.01960565149784088, -0.0017835934413596988, 0.017778296023607254, -0.050141286104917526, -0.009418568573892117, -0.08136004209518433, 0.023106660693883896, -0.08641515672206879, 0.016369353979825974, -0.040782488882541656, -0.003891670610755682, -0.007992547936737537, -0.001386527786962688, 0.05663096159696579, 0.049731411039829254, 0.040201835334300995, 0.007147182244807482, 0.01904207468032837, 0.039757803082466125, 0.036615435034036636, 0.006959323305636644, -0.04269523546099663, -0.019878901541233063, -0.04255861043930054, -0.058646176010370255, 0.008667132817208767, -0.07377737015485764, 0.002388798398897052, -0.036615435034036636, 0.023977644741535187, 0.05157584324479103, 0.04993634670972824, 0.011724111624062061, -0.011356933042407036, 0.024712001904845238, -0.028195934370160103, -0.022064898163080215, -0.07972054183483124, 0.02720540389418602, 0.04416394978761673, 0.020988978445529938, -0.023140817880630493, -0.006293277721852064, -0.005008151289075613, -0.018683435395359993, -0.0005368925631046295, -0.020852353423833847, 0.01813693530857563, 0.010323707945644855, -0.04518863558769226, -0.02573668770492077, -0.046759821474552155, 0.03251669183373451, -5.128431439516135e-7, 0.04341251403093338, -0.015831394121050835, 0.011194691061973572, 0.07029343396425247, -0.04068002104759216, -0.07910573482513428, 0.08429747074842453, 0.023704394698143005, -0.04716969653964043, -0.043002642691135406, 0.05331781134009361, -0.028588728979229927, -0.04190964251756668, -0.017761217430233955, -0.008948921225965023, 0.016258345916867256, 0.035624902695417404, 0.057279929518699646, 0.005298478528857231, -0.011792424134910107, 0.04802360013127327, -0.03849402442574501, 0.010989753529429436, 0.03227759897708893, 0.08197484910488129, -0.034275736659765244, 0.04054339602589607, -0.03243130072951317, -0.0010876611340790987, 0.020732806995511055, -0.018239405006170273, -0.03048439882695675, -0.06663872301578522, -0.013013508170843124, 0.026351498439908028, 0.024882784113287926, 0.01888837292790413, -0.021791648119688034, -0.019400715827941895, -0.05885111168026924, 0.012296227738261223, -0.05693836510181427, -0.025651296600699425, -0.00018372293561697006, -0.04518863558769226, -0.01977643370628357, -0.006007219664752483, 0.036068934947252274, -0.005746778566390276, -0.005157584324479103, 0.05034622177481651, -0.019247012212872505, 0.017206178978085518, 0.009965067729353905, 0.004850178956985474, 0.013875951990485191, -0.012202298268675804, 0.04047508165240288, 0.004820291884243488, 0.015122652053833008, -0.0009675807668827474, 0.044573824852705, -0.042012110352516174, 0.04238782823085785, -0.04293432831764221, -0.08559540659189224, -0.006660456769168377, 0.004811753053218126, -0.002762381685897708, 0.002435763133689761, 0.02425089292228222, 0.024899860844016075, -0.011869275011122227, 0.022526007145643234, 0.03835739940404892, -0.0031188868451863527, 0.004722093231976032, 0.017419656738638878, 0.06783419102430344, -0.018085701391100883, 0.015122652053833008, 0.026044093072414398, -0.06435026228427887, -0.014687160961329937, 0.025002330541610718, -0.10144387930631638, 0.025036485865712166, -0.025617141276597977, 0.007258189842104912, 0.02705170027911663, -0.02751280926167965, 0.009333178400993347, 0.011707033962011337, -0.0042844670824706554, 0.028025152161717415, -0.03685452789068222, 0.029340166598558426, -0.03214097395539284, 0.03524918481707573, 0.0065110232681035995, -0.06223257631063461, -0.034275736659765244, 0.005943176802247763, -0.05902189388871193, 0.015498370863497257, -0.0505170039832592, 0.018615122884511948, 0.018376030027866364, 0.015190964564681053, -0.02361900359392166, 0.018615122884511948, 0.012876883149147034, -0.057621490210294724, 0.05034622177481651, -0.00452996464446187, 0.007574134971946478, 0.047511257231235504, 0.017197640612721443, 0.018085701391100883, 0.023670239374041557, 0.026044093072414398, -0.0564601793885231, 0.015455675311386585, -0.03436112403869629, 0.0012968677328899503, -0.015566682443022728, -0.012697562575340271, -0.0505511574447155, -0.00008885945862857625, 0.0029331627301871777, -0.04149976745247841, 0.035146716982126236, 0.04269523546099663, 0.05676758661866188, 0.06909796595573425, -0.0034455053973942995, 0.03613724559545517, 0.0038895360194146633, -0.018478497862815857, 0.03682037070393562, 0.024712001904845238, 0.053898464888334274, -0.05622108653187752, -0.015566682443022728, -0.05113181471824646, -0.008611628785729408, -0.0075869434513151646, 0.03244837746024132, -0.04829685017466545, -0.029237696900963783, -0.025958703830838203, -0.00007731840014457703, -0.006182270124554634, 0.04921906813979149, 0.027273716405034065, 0.000872050179168582, 0.020135072991251945, -0.0061310357414186, -0.00821029394865036, 0.06356466561555862, 0.02095482125878334, 0.0022756559774279594, -0.01643766649067402, 0.03675206005573273, 0.00467939767986536, -0.04416394978761673, -0.0009334245696663857, -0.021040212363004684, -0.01383325643837452, -0.020476635545492172, -0.005183201748877764, -0.0029929359443485737, 0.015370285138487816, 0.040201835334300995, 0.021501321345567703, -0.01024685613811016, 0.00958081055432558, -0.015652073547244072, 0.05065362900495529, 0.04149976745247841, 0.035761527717113495, -0.03133830428123474, 0.03958702087402344, -0.03243130072951317, -0.0035223569720983505, 0.018922528252005577, -0.01196320541203022, -0.03630802780389786, -0.0016320253489539027, -0.01582285389304161, 0.014661544002592564, 0.018768824636936188, -0.05471821501851082, -0.005003881640732288, 0.01689877361059189, 0.0021144815254956484, -0.00981990434229374, 0.04129483178257942, 0.04863841086626053, -0.04474460706114769, 0.015694769099354744, -0.053727682679891586, 0.016616985201835632, -0.07241111993789673, 0.018683435395359993, -0.01196320541203022, 0.006899550091475248, 0.04419810697436333, 0.011749728582799435, -0.049731411039829254, 0.06339388340711594, 0.06489675492048264, 0.0063701290637254715, 0.005127697717398405, -0.0995311364531517, 0.0007055387832224369, 0.046623196452856064, 0.0326533168554306, -0.05406924709677696, -0.003197873244062066, -0.04737463220953941, -0.03702530637383461, -0.02124514989554882, -0.023567769676446915, 0.02049371227622032, -0.04218289256095886, 0.04129483178257942, -0.004969725385308266, -0.04976556822657585, 0.014337060041725636, 0.017376961186528206, 0.03552243486046791, -0.05143921822309494, -0.004743440542370081, 0.013004968874156475, -0.002087797038257122, -0.07603167742490768, 0.07049836963415146, 0.03528334200382233, -0.01677068881690502, 0.03938208520412445, -0.018854215741157532, 0.043651606887578964, -0.035590749233961105, 0.05751902237534523, 0.019520262256264687, 0.01744527369737625, 0.008090747520327568, -0.09126533567905426, 0.00923070963472128, -0.06725353747606277, -0.009623506106436253, -0.003061248455196619, -0.008983077481389046, 0.04395901411771774, -0.02793976292014122, 0.037093620747327805, 0.024609534069895744, 0.022696787491440773, -0.03914299234747887, -0.035010091960430145, 0.020544948056340218, -0.05721161514520645, 0.01825648359954357, 0.005763856694102287, 0.01607048697769642, -0.019247012212872505, -0.04146561399102211, -0.016488900408148766, -0.003930096514523029, -0.022970037534832954, 0.01516534760594368, -0.06595560163259506, -0.0012925982009619474, -0.05557211861014366, -0.07370905578136444, 0.05458158999681473, 0.029818352311849594, 0.0274957325309515, -0.02408011257648468, 0.006668995600193739, 0.01381617784500122, 0.06305232644081116, 0.05526471138000488, 0.021347617730498314, -0.029545102268457413, -0.00936733465641737, -0.03183356672525406, -0.012637789361178875, 0.006703151855617762, 0.030552711337804794, -0.026658905670046806, 0.04785282164812088, -0.09290483593940735, -0.04129483178257942, -0.006861124187707901, 0.015173886902630329, -0.007937043905258179, 0.0728893056511879, 0.031116288155317307, 0.029903743416070938, -0.0017718522576615214, 0.05560627579689026, 0.011911970563232899, 0.03511255979537964, -0.016198571771383286, -0.02112560160458088, 0.004081664606928825, -0.0002370919828535989, 0.05188325047492981, -0.005063654854893684, -0.009657662361860275, 0.017914921045303345, -0.024011800065636635, 0.09297314286231995, -0.051814936101436615, 0.031748175621032715, 0.002435763133689761, -0.006007219664752483, -0.055367182940244675, 0.000643096980638802, -0.044232264161109924, -0.009555193595588207, -0.07596336305141449, 0.05451327562332153, 0.004280197434127331, 0.018666356801986694 ]
31,935
sonetel.auth
get_refresh_token
Return the refresh token
def get_refresh_token(self): """ Return the refresh token """ return self._refresh_token if hasattr(self, '_refresh_token') else False
(self)
[ 0.04812219366431236, -0.0354347787797451, 0.033077262341976166, 0.05442091077566147, 0.03302327170968056, -0.029316026717424393, 0.039951860904693604, 0.06385099142789841, 0.022333448752760887, -0.004242635332047939, 0.01699753664433956, -0.04365910589694977, 0.024600988253951073, 0.019292069599032402, 0.014703004620969296, 0.009897983632981777, -0.017375459894537926, -0.00235077110119164, 0.014217102900147438, -0.055896610021591187, -0.00622223224490881, -0.04401903226971626, -0.02613067626953125, -0.024582991376519203, -0.013929162174463272, 0.055320728570222855, 0.034588951617479324, 0.017501434311270714, 0.02218947932124138, 0.019544018432497978, -0.06957382708787918, -0.025320840999484062, 0.02809227630496025, 0.04038377106189728, -0.0106718260794878, -0.007351502310484648, -0.04099564626812935, 0.03955594077706337, -0.13576433062553406, -0.03327522054314613, -0.029801927506923676, 0.03077372908592224, -0.0038827089592814445, -0.012228508479893208, 0.04153553768992424, -0.00022059568436816335, -0.01376719493418932, 0.03467893600463867, -0.0027061987202614546, -0.01869818940758705, 0.038548145443201065, 0.0009886735351756215, -0.06773819774389267, 0.021181683987379074, -0.021721573546528816, -0.012903370894491673, 0.022279459983110428, 0.04157153144478798, -0.02422306500375271, 0.042435355484485626, -0.012435466051101685, -0.01952602155506611, 0.0019953434821218252, -0.00444734375923872, 0.06514672935009003, 0.025986704975366592, -0.011958563700318336, 0.029963895678520203, 0.0373963788151741, 0.05553668364882469, -0.0002946899621747434, 0.03302327170968056, -0.046502526849508286, 0.009520060382783413, 0.02218947932124138, -0.05895598605275154, -0.08242320269346237, -0.04070770740509033, -0.029370015487074852, 0.006087259855121374, 0.008129843510687351, 0.01543185580521822, 0.05143352225422859, 0.006748625077307224, 0.015530835837125778, -0.025896724313497543, 0.0035520263481885195, -0.0456027090549469, -0.04553072154521942, 0.015449851751327515, 0.024618983268737793, 0.026004701852798462, -0.011904573999345303, -0.03487689420580864, 0.011346688494086266, -0.08271114528179169, -0.0426873043179512, 0.01751043274998665, -0.028002293780446053, -0.027678361162543297, -0.01445105578750372, 0.029891910031437874, -0.029172055423259735, 0.01869818940758705, 0.04293924942612648, -0.011958563700318336, 0.0004766216443385929, -0.05442091077566147, 0.018338263034820557, -0.058560069650411606, -0.015323877334594727, -0.057948194444179535, 0.02071378007531166, 0.05438492074608803, 0.029855916276574135, 0.004445094149559736, 0.0057993181981146336, 0.0357947051525116, 0.02879413403570652, -0.030593765899538994, 0.03631659969687462, 0.0006040019216015935, 0.019328061491250992, -0.022585397586226463, 0.06385099142789841, 0.02407909370958805, -0.01736646145582199, 0.021937530487775803, 0.0655786395072937, -0.029190052300691605, -0.002183180069550872, 0.023071298375725746, -0.004382106941193342, -0.018041323870420456, -0.017879357561469078, -0.03367114067077637, 0.048590101301670074, 0.03417503833770752, -0.005610357038676739, -0.023863138630986214, -0.040635719895362854, 0.048734068870544434, 0.0010167928412556648, 0.011931569315493107, -0.002404760103672743, 0.03289729729294777, -0.060035768896341324, 0.07558459788560867, 0.016556626185774803, -0.01311032846570015, 0.07295713573694229, -0.032537370920181274, 0.033221229910850525, -0.03145759180188179, -0.0302338395267725, -0.009493065997958183, -0.05553668364882469, 0.04538675397634506, -0.0013598479563370347, -0.02548280730843544, 0.016169704496860504, -0.029747938737273216, -0.024942917749285698, -0.051181573420763016, 0.06939385831356049, 0.014127121306955814, 0.01868019439280033, -0.03529081121087074, -0.0442349873483181, 0.05452888831496239, 0.0058578066527843475, 0.022369442507624626, -0.01715950295329094, -0.013470255769789219, 0.02620266191661358, 0.040563736110925674, 0.00018291585729457438, 0.035830698907375336, 0.009996962733566761, 0.06043168529868126, -0.03872811049222946, -0.037252411246299744, -0.04239936172962189, -0.043335169553756714, 0.0426873043179512, 0.050605688244104385, 0.03732439503073692, -0.015206901356577873, 0.011940566822886467, 0.060611650347709656, -0.03410305082798004, -0.007000573445111513, 0.004742033779621124, -0.01950802467763424, -0.0029131565243005753, -0.0551767572760582, -0.026454610750079155, 0.023773156106472015, 0.029190052300691605, 0.05359308049082756, -0.03566873073577881, 0.01708751916885376, 0.005925292614847422, -0.022333448752760887, 0.001208003843203187, 0.004301123786717653, 0.005983780603855848, -0.01334428135305643, -0.005448389798402786, 0.031925495713949203, -0.060539666563272476, 0.007891392335295677, 0.009178129956126213, 0.04344314709305763, -0.022567402571439743, -0.021163687109947205, 0.044594913721084595, -0.03295128792524338, -0.020389845594763756, 0.049921829253435135, 0.06662242859601974, -0.025050895288586617, -0.06705433875322342, -0.06431889533996582, 0.016187701374292374, 0.027696356177330017, -0.0014824479585513473, -0.049309954047203064, -0.08350298553705215, -0.0722372829914093, -0.007868897169828415, -0.01009594276547432, 0.04412700980901718, 0.00889468751847744, -0.018329264596104622, -0.08681431412696838, 0.038584139198064804, 0.023755159229040146, -0.0001854465954238549, -0.00639319745823741, 0.019274072721600533, 0.03644257411360741, -0.003279831726104021, 0.09790005534887314, 0.014676009304821491, 0.005421395413577557, 0.003880459349602461, 0.06118753179907799, -0.04070770740509033, -0.03635259345173836, 0.0016837819712236524, -0.028434205800294876, -0.03644257411360741, -0.010815796442329884, 0.027732349932193756, -0.055212751030921936, -0.03550676628947258, 0.06691036373376846, 0.02143363282084465, 0.0013587231514975429, 0.038656122982501984, 0.0002228452212875709, -0.004199894145131111, 0.04153553768992424, -0.030971689149737358, -0.021775562316179276, 0.026346631348133087, 0.002692701295018196, -0.06154745817184448, -0.015341874212026596, 0.13576433062553406, -0.04693443700671196, -0.04293924942612648, -0.00935809314250946, -0.0034148043487221003, -0.05758826807141304, -0.0017456443747505546, -0.02335924096405506, -0.021793559193611145, -0.031097663566470146, -0.0038917071651667356, -0.05888400226831436, 0.054060984402894974, 0.07094154506921768, -0.02150561846792698, 0.03973590210080147, -0.01647564396262169, 0.03401307016611099, -0.01540486142039299, 0.005866804625838995, 0.028398213908076286, -0.045962635427713394, 0.011715613305568695, 0.017951343208551407, 0.0616554394364357, 0.024493008852005005, 0.033869098871946335, -0.0032663345336914062, -0.007261520251631737, 0.05564466118812561, 0.031151652336120605, 0.027876319363713264, -0.1260463148355484, -0.015197903849184513, 0.040563736110925674, -0.01573779433965683, 0.0020560810808092356, 0.006991575472056866, -0.002658958313986659, 0.04308322072029114, 0.004697042983025312, -0.018608208745718002, -0.04887804016470909, -0.003983938135206699, -0.008336801081895828, -0.04337116330862045, -0.02492492087185383, -0.017555423080921173, 0.03473292291164398, 0.031151652336120605, -0.0444149486720562, -0.021181683987379074, 0.06237529218196869, -0.01275940053164959, 0.03797226399183273, -0.03147558867931366, -0.03597467020153999, -0.0013294791569933295, -0.06291518360376358, 0.027984298765659332, -0.033221229910850525, -0.0630231574177742, 0.049813851714134216, 0.005304419435560703, 0.005754327401518822, -0.008660735562443733, 0.02739041857421398, -0.018239283934235573, 0.005317916627973318, -0.009718019515275955, 0.010482864454388618, -0.03541678562760353, 0.00967302918434143, 0.03736038878560066, -0.053881023079156876, 0.031925495713949203, 0.009996962733566761, -0.010077946819365025, 0.04984984174370766, -0.0732450783252716, -0.04106763377785683, -0.03286130353808403, 0.009520060382783413, 0.020353853702545166, 0.07587254047393799, -0.028020290657877922, 0.004863508976995945, 0.03215944766998291, 0.017780376598238945, -0.011292698793113232, 0.0026522097177803516, -0.006406694650650024, 0.019921941682696342, 0.04038377106189728, -0.07983173429965973, 0.037252411246299744, -0.06719830632209778, 0.017132509499788284, 0.03761233761906624, -0.0632031187415123, -0.047330357134342194, -0.0023575196973979473, 0.020965728908777237, -0.008687729947268963, 0.0057363309897482395, -0.019292069599032402, -0.04099564626812935, 0.023935122415423393, -0.02742641232907772, 0.02753438986837864, 0.03073773719370365, 0.024960914626717567, 0.004926496185362339, 0.019292069599032402, 0.01538686454296112, -0.00651467265561223, -0.06154745817184448, -0.06669440865516663, 0.038008254021406174, -0.014990945346653461, -0.04830215871334076, -0.003983938135206699, -0.11064145714044571, 0.029136063531041145, -0.05082164332270622, -0.0006574285216629505, -0.003812973154708743, 0.019705984741449356, 0.008017366752028465, -0.011130732484161854, 0.08119945228099823, 0.043875060975551605, 0.028596173971891403, -0.00634370744228363, 0.008462775498628616, -0.010797799564898014, 0.009709022007882595, -0.014127121306955814, -0.030971689149737358, -0.03410305082798004, -0.043335169553756714, -0.06442687660455704, 0.01619669981300831, -0.01775338314473629, 0.00036920601269230247, -0.005524874199181795, -0.01810431107878685, 0.04941793158650398, 0.06752224266529083, 0.05409697815775871, 0.0015015690587460995, 0.033131249248981476, -0.023323247209191322, 0.037864286452531815, -0.08307107537984848, 0.030323822051286697, 0.026292642578482628, 0.03829619660973549, -0.05416896194219589, 0.0028051785193383694, 0.0426873043179512, 0.04427098110318184, -0.008791209198534489, 0.02825424261391163, 0.013236302882432938, -0.006672140676528215, -0.02206350490450859, 0.009888985194265842, -0.07954379171133041, 0.0035430281423032284, 0.03703645244240761, -0.011058746837079525, 0.021649589762091637, -0.026328636333346367, 0.05355708673596382, -0.055860619992017746, -0.06817010790109634, 0.05172146111726761, 0.03685649111866951, -0.0549967959523201, -0.034588951617479324, 0.026598580181598663, -0.02751639299094677, 0.016655607149004936, -0.028452202677726746, -0.026616577059030533, -0.014262094162404537, 0.05035373941063881, 0.04912998899817467, -0.021001720800995827, -0.02217148244380951, 0.044522929936647415, -0.09041357785463333, -0.012156522832810879, 0.031781524419784546, 0.05366506427526474, 0.01938205026090145, 0.007490973919630051, -0.030485788360238075, 0.01610671915113926, 0.052585285156965256, -0.06781018525362015, -0.03732439503073692, -0.04491884633898735, -0.02820025384426117, 0.013380274176597595, -0.03626261278986931, 0.0710495263338089, -0.00435961177572608, -0.012966358102858067, -0.08343099802732468, 0.06154745817184448, -0.04617859050631523, -0.01143667008727789, 0.011013755574822426, -0.04308322072029114, -0.0326993390917778, -0.032537370920181274, 0.006055766250938177, -0.04614259675145149, -0.012894372455775738, 0.024618983268737793, -0.024690968915820122, 0.04218340665102005, -0.03080972284078598, 0.023161280900239944, 0.00825581792742014, 0.0007777790306136012, 0.05168546736240387, 0.07493673264980316, 0.013497250154614449, 0.030539777129888535, -0.004026679787784815, 0.04499083384871483, 0.04329917952418327, -0.07680834829807281, -0.05409697815775871, -0.005110958591103554, 0.013362277299165726, -0.0014329580590128899, 0.01168861798942089, -0.01313732285052538, 0.023809147998690605, 0.03951994702219963, 0.006618151441216469, -0.018041323870420456, 0.006019773427397013, -0.0073335058987140656, 0.006721630692481995, 0.07248923182487488, 0.0021336902864277363, 0.02287334017455578, 0.011913572438061237, -0.03822421282529831, -0.03597467020153999, 0.0029334023129194975, -0.007909388281404972, 0.00784190185368061, -0.01945403590798378, 0.035254817456007004, 0.030683748424053192, -0.02607668749988079, -0.0033630647230893373, 0.007077057845890522, -0.0007980248774401844, -0.0017996333772316575, -0.04959789291024208, -0.043875060975551605, -0.06467881798744202, 0.008800206705927849, -0.005961285438388586, -0.05877602472901344, 0.017024531960487366, 0.03354516625404358, -0.08623842895030975, -0.021703578531742096, -0.006132250651717186, -0.015575826168060303, 0.03293329104781151, -0.016466645523905754, 0.04412700980901718, 0.0014903213595971465, 0.004370859358459711, -0.050569698214530945, -0.05780422315001488, 0.004015431739389896, -0.00450808135792613, 0.004573318175971508, 0.03743237257003784, -0.003153857309371233, 0.0015758039662614465, -0.007967876270413399, 0.04401903226971626, 0.03428301587700844, -0.011058746837079525, -0.0022607892751693726, -0.0011202717432752252, 0.007810408715158701, -0.05215337499976158, -0.006312213838100433, 0.010293902829289436, -0.06496676057577133, 0.03608264774084091, 0.033851101994514465, 0.05963984876871109, 0.047834254801273346, 0.004836514592170715, 0.007765417918562889, 0.01036588754504919, -0.03419303148984909, 0.03280731663107872, -0.004881505388766527, 0.051181573420763016, -0.06385099142789841, -0.027174463495612144, -0.04430697113275528, -0.015449851751327515, 0.0309177003800869, 0.006789116654545069, -0.021181683987379074, -0.042543333023786545, 0.013020346872508526, 0.0008930680342018604, -0.033869098871946335, 0.02269337698817253, 0.03557875007390976, 0.029873913154006004, -0.021613596007227898, -0.023305252194404602, 0.03966391831636429, 0.028668159618973732, 0.06460683792829514, 0.007140045054256916, -0.04625057801604271, -0.02285534329712391, -0.012858380563557148, -0.04203943535685539, -0.01102275401353836, -0.020299863070249557, -0.027174463495612144, 0.009888985194265842, -0.012480457313358784, -0.0023687672801315784, 0.03811623528599739, 0.010059949941933155, 0.057840216904878616, -0.02816426195204258, 0.049201976507902145, -0.030647754669189453, 0.00705456268042326, 0.029244041070342064, 0.03696446865797043, -0.03233940899372101, 0.02413308247923851, -0.044558919966220856, 0.026328636333346367, 0.02546481229364872, -0.009101645089685917, -0.06331110000610352, -0.008030863478779793, -0.02353920415043831, -0.025626778602600098, 0.05960385501384735, -0.03556075319647789, 0.01477498933672905, 0.003920950926840305, -0.0022315452806651592, 0.0019121103687211871, 0.024313045665621758, 0.021109698340296745, 0.010518856346607208, 0.03493088111281395, -0.015368868596851826, 0.019292069599032402, -0.05906396731734276, 0.016448648646473885, 0.001624169060960412, 0.009038658812642097, 0.04556671530008316, -0.01766340062022209, -0.0454227440059185, 0.057984184473752975, 0.09329298883676529, 0.015179906971752644, -0.04754631221294403, -0.08451078087091446, -0.04099564626812935, 0.006658643484115601, 0.015503841452300549, -0.08775012195110321, 0.014559033326804638, -0.027228452265262604, -0.03768432140350342, -0.03304126858711243, -0.023845141753554344, 0.01875218003988266, -0.03629860281944275, 0.05092962458729744, 0.012813389301300049, 0.016061726957559586, 0.0030953693203628063, 0.01009594276547432, 0.053881023079156876, -0.0026004700921475887, -0.0005089588230475783, -0.04819418117403984, -0.020929735153913498, -0.0413195826113224, 0.019220083951950073, 0.0426873043179512, -0.006424691062420607, 0.05254929140210152, -0.02881212905049324, 0.056652456521987915, -0.0589199960231781, 0.057984184473752975, 0.005259428173303604, -0.006834107451140881, 0.0027106977067887783, -0.051253557205200195, -0.012237506918609142, -0.04139156639575958, -0.002800679299980402, 0.007661938667297363, 0.008278313092887402, 0.012795393355190754, -0.04959789291024208, 0.03437299653887749, 0.015890762209892273, 0.006636147852987051, -0.017555423080921173, 0.003857963951304555, -0.01677258312702179, 0.02015589363873005, 0.039160020649433136, -0.0006849854253232479, 0.013002350926399231, -0.021685581654310226, -0.05100160837173462, -0.01880616880953312, -0.020443834364414215, -0.004123409744352102, 0.031979482620954514, -0.012543444521725178, 0.008417785167694092, -0.08739019185304642, -0.020677786320447922, 0.004312371369451284, 0.03008987009525299, 0.015251892618834972, -0.026400620117783546, 0.02748040109872818, 0.0035340299364179373, 0.06424690783023834, 0.05146951228380203, 0.020893743261694908, 0.0028839122969657183, 0.006055766250938177, -0.034606948494911194, -0.02805628441274166, 0.013209308497607708, 0.004764529410749674, 0.04369509592652321, 0.04686245322227478, 0.000007289042059710482, -0.007490973919630051, -0.004778026603162289, 0.02418707124888897, -0.03358115628361702, 0.05640050768852234, 0.026472605764865875, -0.025986704975366592, -0.04754631221294403, 0.024295050650835037, 0.00024983970797620714, 0.014478050172328949, 0.006982577499002218, -0.037252411246299744, 0.021253669634461403, 0.00751796830445528, 0.018077317625284195, -0.03671251982450485, 0.0036847491282969713, 0.008935179561376572, -0.028416210785508156, 0.07551261782646179, -0.1233108788728714, 0.0391240268945694, 0.017204495146870613, 0.0315115787088871, -0.014235099777579308, 0.006613652687519789, -0.06633448600769043, -0.0027511895168572664, -0.019058117642998695, 0.071229487657547, 0.012174519710242748, 0.039232008159160614 ]
31,936
sonetel.calls
Call
Phone call class
class Call(util.Resource): """ Phone call class """ def __init__(self, access_token, app_name: str = 'PythonSonetelPackage') -> None: """ Initiate the Call class. :param access_token: Required. The access token generated from the Auth class. :param app_name: The name of the app that is making the request. Defaults to 'PythonSonetelPackage'. """ if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_CALLBACK}' if len(app_name) < 2: raise e.SonetelException('app_name must be at least 2 characters long') self._app_name = f"{app_name}__{self._accountid}__{self._userid}" def callback(self, num1: str, num2: str, cli1: str = 'automatic', cli2: str = 'automatic'): """ Use Sonetel's CallBack API to make business quality international calls at the cost of 2 local calls. **Docs**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE1OTMzOTIy-make-calls **Number Format:**\n It is recommended that both the phone numbers (num1 and num2) be entered in the international E164 format with a leading +. For example, if you want to call a US number (212) 555-1234, it should be set as `+12125551234`. However you can also provide SIP addresses. Additionally, `num1` can be your Sonetel username - this will make sure that the incoming call to you is handled as per your incoming settings defined in the app. **Caller ID:**\n It is best to use 'automatic' CLI as our system selects the best possible phone to be shown from the numbers available in your account. If you don't have a Sonetel number, then your verified mobile number is used as CLI. Read more at https://sonetel.com/cli :param num1: Required. The first phone number that will be called. This should be your phone number, SIP address or Sonetel email address. :param num2: Required.The phone number or address that you wish to connect to. :param cli1: Optional. The caller ID shown to the first person. Defaults to automatic. :param cli2: Optional. The caller ID shown to the second person. Defaults to automatic. :return: Return the status code and message as a dict. """ # Check if num1 and num2 are defined. if num1 and num2: # Initiate the callback body = { "app_id": f'{self._app_name}-{const.PKG_VERSION}', "call1": num1, "call2": num2, "show_1": cli1, "show_2": cli2 } return util.send_api_request( token=self._token, uri=self._url, method='post', body=dumps(body) ) return util.prepare_error( code=const.ERR_CALLBACK_NUM_EMPTY, message='num1 & num2 are required to make a call.' )
(access_token, app_name: str = 'PythonSonetelPackage') -> None
[ 0.0004174388013780117, -0.0678253322839737, 0.008916862308979034, 0.013427049852907658, -0.005717833526432514, -0.020525049418210983, -0.013515775091946125, 0.014619908295571804, 0.009971704334020615, -0.04032058268785477, 0.004399281460791826, -0.0004078885540366173, 0.03207901865243912, 0.01747882552444935, -0.018346358090639114, -0.010016066953539848, 0.06447350233793259, -0.020840516313910484, 0.024330366402864456, -0.03817146643996239, 0.01921389251947403, 0.04684679955244064, 0.020367316901683807, 0.02521761693060398, -0.0003256330674048513, 0.11427780240774155, 0.03174383193254471, 0.03438586741685867, 0.02210238389670849, -0.027524467557668686, -0.015191691927611828, -0.008837996050715446, 0.00453483359888196, 0.006570579018443823, -0.004244012758135796, 0.013929825276136398, -0.020120859146118164, 0.04653133451938629, -0.106864333152771, -0.017715424299240112, 0.005017891526222229, -0.010050570592284203, 0.02237841673195362, 0.038664381951093674, -0.0048207249492406845, 0.024350084364414215, -0.04810866713523865, 0.057809267193078995, -0.015921209007501602, -0.022141816094517708, 0.00034812241210602224, 0.0002014796918956563, -0.028884917497634888, 0.008128196001052856, -0.02162918448448181, 0.013584783300757408, -0.01705491729080677, 0.0713743343949318, -0.013890392147004604, -0.030422817915678024, -0.023541700094938278, 0.007719075307250023, -0.003583504119887948, -0.009917483665049076, 0.003038831287994981, 0.010001279413700104, -0.029318682849407196, 0.035095665603876114, 0.04542719945311546, 0.04661019891500473, 0.0732671320438385, 0.01458047516644001, -0.06624799966812134, 0.00023321120534092188, 0.09369359910488129, -0.00021303242829162627, -0.013476341962814331, 0.03706733509898186, -0.02519790083169937, -0.018070325255393982, 0.049291666597127914, -0.012027166783809662, 0.03198043256998062, 0.0038989707827568054, 0.0334000326693058, 0.027130134403705597, 0.029594717547297478, -0.03525340184569359, -0.04012341797351837, 0.07981307059526443, -0.07650066912174225, -0.013387616723775864, -0.049331098794937134, -0.0427851676940918, 0.024428950622677803, -0.0404980331659317, -0.0020394427701830864, -0.027642767876386642, 0.021984083577990532, 0.011652549728751183, -0.012076458893716335, -0.006619871128350496, -0.08572806417942047, -0.021826351061463356, 0.043573834002017975, -0.032473351806402206, -0.010794875212013721, 0.050001468509435654, 0.02632175013422966, 0.03377465158700943, -0.044677965342998505, -0.022693883627653122, -0.0548911988735199, -0.021550316363573074, -0.030856583267450333, 0.02342339977622032, 0.006230466533452272, 0.023245951160788536, -0.037875715643167496, -0.0006186104146763682, 0.01853366754949093, 0.005717833526432514, -0.008207062259316444, -0.051697101444005966, 0.013417191803455353, 0.04101066663861275, -0.020406750962138176, 0.02103768289089203, 0.07358259707689285, -0.057060033082962036, 0.0018767801811918616, -0.0019642729312181473, 0.03489850088953972, -0.007536695804446936, -0.02235870063304901, 0.03087630122900009, -0.044993434101343155, 0.019391341134905815, -0.061713166534900665, 0.04870016872882843, 0.0037905292119830847, 0.047083400189876556, -0.018415367230772972, -0.003233533352613449, -0.03454359993338585, 0.010011137463152409, -0.009414708241820335, -0.029772166162729263, -0.013565067201852798, 0.0427851676940918, 0.0067578875459730625, -0.007699358277022839, 0.05011976882815361, 0.00945414137095213, -0.016916900873184204, 0.00007859710603952408, -0.002473209286108613, -0.027287866920232773, 0.00943442527204752, 0.0024682802613824606, -0.015438150614500046, -0.006856470834463835, 0.031132616102695465, -0.03629838302731514, 0.0022033376153558493, -0.03519425168633461, -0.04388929903507233, -0.008576749823987484, 0.008073975332081318, 0.041128966957330704, -0.004667920991778374, 0.00017729596584104002, -0.010992041788995266, -0.02991018444299698, 0.013555208221077919, -0.013939683325588703, 0.014176283031702042, -0.04246969893574715, -0.012401783838868141, 0.0024855323135852814, 0.0012600182089954615, 0.004692566581070423, 0.007147291675209999, 0.0349576510488987, 0.0028884916100651026, 0.04164160043001175, 0.04519059881567955, -0.02310793288052082, 0.014136849902570248, -0.019411059096455574, -0.010104792192578316, 0.04028115049004555, 0.051105599850416183, 0.03377465158700943, -0.03474076837301254, 0.027583617717027664, 0.020406750962138176, -0.0056734709069132805, -0.027899082750082016, -0.09842560440301895, -0.05118446797132492, 0.08131153136491776, 0.01405798364430666, -0.03136921674013138, 0.0029870751313865185, -0.0074479710310697556, 0.04724113270640373, 0.02851030044257641, -0.05299840122461319, -0.025434499606490135, 0.020446183159947395, -0.010001279413700104, -0.007817658595740795, 0.010913175530731678, 0.04483570158481598, -0.04349496588110924, 0.05749380216002464, -0.008152841590344906, 0.01775485835969448, -0.00108749745413661, 0.02419234998524189, -0.04866073280572891, 0.01603950932621956, -0.049212802201509476, -0.051066167652606964, 0.06892947107553482, 0.009316124953329563, -0.004759110510349274, 0.020544767379760742, -0.002306849928572774, -0.02281218394637108, -0.012914416380226612, 0.02634146623313427, 0.03379436582326889, -0.12263766676187515, -0.07646123319864273, 0.018228057771921158, -0.019756101071834564, -0.02638090029358864, -0.057060033082962036, 0.07571200281381607, 0.002024655230343342, 0.004998174961656332, -0.012135608121752739, -0.001719046849757433, -0.01988425850868225, 0.024074049666523933, 0.001860760385170579, -0.08383526653051376, -0.05516723543405533, 0.03296626731753349, -0.05895283445715904, 0.030422817915678024, -0.0157043244689703, -0.023364249616861343, -0.05713890120387077, -0.049212802201509476, 0.014688916504383087, 0.021550316363573074, -0.025434499606490135, -0.002292062621563673, -0.004633416887372732, -0.046452466398477554, 0.038664381951093674, -0.031822700053453445, 0.013298891484737396, -0.02344311773777008, 0.0014060448156669736, -0.0015600812621414661, 0.015586025081574917, 0.11151746660470963, 0.02456696704030037, -0.004184862598776817, -0.009345700033009052, -0.05307726562023163, -0.013722799718379974, -0.049685999751091, 0.00961680430918932, -0.0037634188774973154, -0.05370819941163063, 0.02131371758878231, -0.024961300194263458, 0.026262599974870682, 0.005525595974177122, 0.06313277035951614, -0.05938659980893135, 0.03799401596188545, 0.02387688308954239, -0.026578066870570183, -0.02131371758878231, 0.014126991853117943, 0.008956296369433403, -0.012125750072300434, 0.010548416525125504, -0.04294290021061897, 0.012934133410453796, -0.012313058599829674, 0.021195417270064354, 0.037560250610113144, -0.11206953227519989, 0.018780125305056572, 0.0029575000517070293, -0.006299475207924843, -0.06076676771044731, -0.009256974793970585, -0.033991534262895584, 0.02634146623313427, -0.027977950870990753, -0.028175117447972298, 0.02809625118970871, -0.03375493362545967, -0.012697533704340458, 0.0006426401087082922, -0.07271506637334824, -0.0013789343647658825, 0.08801519870758057, 0.05331386625766754, 0.054260268807411194, 0.03211845085024834, 0.07318826764822006, 0.0033690854907035828, -0.00042852942715398967, 0.009256974793970585, 0.03024536743760109, 0.06360596418380737, -0.022477000951766968, 0.006945196073502302, 0.009902696125209332, 0.00028727800236083567, 0.021924933418631554, -0.05153936892747879, -0.013308750465512276, 0.011070908047258854, -0.05004090070724487, 0.03560829907655716, -0.00008033001358853653, 0.00036167760845273733, -0.021550316363573074, -0.011346941813826561, -0.025138750672340393, 0.013387616723775864, -0.05654739961028099, -0.06049073487520218, 0.016976051032543182, -0.02133343368768692, 0.013831241987645626, 0.02600628323853016, -0.021116551011800766, 0.04452023282647133, -0.03237476572394371, -0.023206517100334167, -0.0019728990737348795, 0.06155543401837349, 0.02527676708996296, 0.06940266489982605, 0.003351833438500762, -0.05658683553338051, -0.048542432487010956, 0.04041916877031326, -0.07981307059526443, -0.022161534056067467, -0.016857750713825226, -0.025730250403285027, 0.04081350192427635, -0.0576120987534523, -0.023265667259693146, 0.014807216823101044, -0.012401783838868141, 0.06415803730487823, -0.01352563314139843, -0.00888235867023468, -0.0611611008644104, -0.021944649517536163, -0.012046883814036846, 0.0034578104969114065, 0.008956296369433403, 0.030343949794769287, 0.00958722922950983, -0.04089236631989479, 0.005052396096289158, 0.021471450105309486, 0.06175260245800018, -0.004870016593486071, 0.022319266572594643, 0.06258069723844528, -0.05520666763186455, -0.03383380174636841, 0.012943991459906101, -0.027110416442155838, 0.04016285017132759, 0.06829853355884552, 0.008995729498565197, -0.04089236631989479, -0.0006913156248629093, -0.05579816550016403, -0.002499087480828166, -0.015763474628329277, 0.015724042430520058, -0.02135314978659153, -0.03351833298802376, 0.01994340866804123, -0.039965685456991196, 0.03424784913659096, 0.036436401307582855, 0.022575583308935165, -0.0002751091087702662, 0.04105009883642197, -0.004056704230606556, -0.011751133017241955, 0.06348766386508942, -0.027209000661969185, -0.03943333402276039, -0.025000734254717827, -0.03093544952571392, -0.04384986683726311, 0.01137651689350605, -0.03980794921517372, 0.09424566477537155, 0.005850920919328928, 0.0056537543423473835, 0.040734633803367615, -0.004722141660749912, 0.052130866795778275, 0.050711266696453094, -0.010203375481069088, 0.02381773293018341, 0.017330950126051903, -0.014856508933007717, 0.032157883048057556, 0.0013271780917420983, 0.018997007980942726, 0.016177525743842125, -0.03235505148768425, -0.08430846780538559, -0.02385716699063778, 0.019795533269643784, 0.0030807291623204947, -0.0248429998755455, 0.009912554174661636, -0.043140068650245667, 0.009256974793970585, 0.04243026673793793, -0.0157043244689703, -0.005776983220130205, -0.032217033207416534, -0.042114801704883575, -0.027682200074195862, 0.007615562528371811, -0.0015305062988772988, -0.05911056697368622, 0.007270521018654108, 0.010982183739542961, 0.030146783217787743, 0.015280417166650295, -0.02450781688094139, -0.062068067491054535, -0.003418377134948969, 0.011228641495108604, -0.007004345767199993, -0.01282569207251072, -0.018070325255393982, -0.01672959141433239, -0.03308456763625145, -0.001698097912594676, -0.019273042678833008, 0.056705132126808167, 0.06502556800842285, 0.016522567719221115, -0.03949248418211937, -0.029851034283638, 0.019273042678833008, -0.006851541809737682, 0.02068278379738331, 0.08178473263978958, 0.021609466522932053, 0.03815175220370293, 0.035016801208257675, -0.040300868451595306, -0.03409011662006378, 0.012914416380226612, -0.0010024693328887224, -0.019982842728495598, 0.0036032209172844887, -0.03464218229055405, -0.008596466854214668, -0.024054333567619324, -0.00856689177453518, -0.04369213432073593, -0.023324817419052124, 0.016650725156068802, -0.030008766800165176, 0.011327224783599377, 0.01920403353869915, 0.012589091435074806, -0.07981307059526443, 0.010124508291482925, -0.02529648318886757, -0.012549658305943012, -0.01475792471319437, -0.005259420722723007, -0.029298966750502586, -0.019706808030605316, 0.001153424964286387, -0.018582958728075027, 0.029042650014162064, 0.0036697646137326956, -0.09132760018110275, 0.04041916877031326, -0.029062366113066673, 0.02703155018389225, -0.03702789917588234, -0.012894700281322002, 0.06092450022697449, -0.010992041788995266, -0.029989050701260567, -0.040360018610954285, 0.03864466771483421, 0.05307726562023163, -0.04089236631989479, -0.037934865802526474, 0.05623193457722664, 0.03661385178565979, 0.030028482899069786, 0.07898496836423874, 0.01958850771188736, 0.000011398698006814811, -0.04952826723456383, -0.02166861668229103, 0.008443662896752357, 0.02064334973692894, 0.013151017017662525, 0.01779429242014885, -0.013229883275926113, -0.039650216698646545, 0.04235139861702919, -0.03807288408279419, -0.06474953144788742, -0.023344533517956734, 0.017350666224956512, 0.006023441907018423, -0.018691400066018105, 0.033281732350587845, -0.07583030313253403, -0.021609466522932053, -0.04302176833152771, -0.07050680369138718, 0.025355633348226547, 0.04444136843085289, 0.00011683665798045695, -0.04032058268785477, 0.04053746536374092, -0.01995326764881611, 0.08075946569442749, 0.030324233695864677, -0.02210238389670849, -0.005737550090998411, 0.0012550890678539872, -0.01458047516644001, -0.015507158823311329, 0.0018669218989089131, -0.04381043463945389, 0.04972543567419052, -0.056744568049907684, -0.014363591559231281, -0.005826274864375591, 0.037165917456150055, 0.021530600264668465, 0.0020345135126262903, -0.010341391898691654, -0.014974808320403099, -0.0009938431903719902, 0.029989050701260567, 0.0005046234582550824, 0.048187535256147385, -0.0014984667068347335, 0.013200308196246624, 0.009764679707586765, 0.009917483665049076, 0.023186801001429558, 0.02020958438515663, 0.050356365740299225, 0.01740981638431549, -0.0668000653386116, -0.08730540424585342, 0.02028845064342022, 0.029673583805561066, -0.02805681712925434, -0.0016685229493305087, 0.032532501965761185, 0.03351833298802376, -0.015793049708008766, -0.0030560833401978016, -0.03842778503894806, -0.0001390179095324129, -0.0040394519455730915, 0.06676063686609268, 0.014186142012476921, -0.01958850771188736, 0.01819848269224167, 0.06005696579813957, -0.07870893180370331, 0.03832919895648956, -0.006974770687520504, -0.09795240312814713, 0.026578066870570183, 0.01600007526576519, -0.10205347090959549, -0.038664381951093674, -0.028372284024953842, 0.04290346801280975, 0.05721776559948921, -0.010913175530731678, -0.030698850750923157, -0.00904009211808443, 0.017902733758091927, 0.012441216967999935, -0.049607135355472565, 0.03580546751618385, 0.046807367354631424, -0.00835986714810133, 0.03304513543844223, 0.02596685104072094, -0.052130866795778275, 0.00814791303128004, -0.06987586617469788, 0.04152330011129379, 0.012559516355395317, -0.006708595901727676, -0.06459180265665054, -0.021057400852441788, 0.03941361606121063, 0.02740616723895073, 0.07405579835176468, -0.023955749347805977, 0.04558493196964264, -0.01744925044476986, 0.035450566560029984, 0.004399281460791826, 0.01263838354498148, 0.0463341660797596, 0.014541042037308216, -0.025749966502189636, 0.006605083588510752, -0.06739156693220139, -0.012027166783809662, 0.05023806542158127, -0.04491456598043442, -0.04668906703591347, 0.017626700922846794, -0.02058419957756996, -0.02732730098068714, 0.050711266696453094, -0.016453558579087257, 0.024093767628073692, -0.010597708635032177, -0.011297649703919888, -0.008502812124788761, -0.002804695861414075, 0.011879291385412216, 0.034346435219049454, -0.02381773293018341, -0.005924858618527651, 0.07898496836423874, -0.047477733343839645, -0.03190156817436218, 0.0017104208236560225, 0.05666569992899895, -0.040379732847213745, 0.021057400852441788, 0.03308456763625145, -0.013624216429889202, -0.0056537543423473835, 0.033932384103536606, 0.0031817771960049868, 0.013022858649492264, -0.0008410390582866967, -0.0062797581776976585, 0.003926081117242575, 0.009414708241820335, 0.02164890058338642, -0.05658683553338051, 0.0014220646116882563, -0.0010086307302117348, 0.04160216823220253, -0.008857712149620056, 0.010992041788995266, 0.0576120987534523, 0.032887399196624756, -0.026775233447551727, -0.010104792192578316, 0.01547758374363184, -0.03742223232984543, -0.02200379967689514, -0.012017308734357357, -0.0074874041602015495, -0.03838834911584854, -0.09692713618278503, -0.058164168149232864, -0.07965533435344696, 0.03351833298802376, 0.058440200984478, -0.0348590686917305, 0.01295385044068098, -0.011346941813826561, -0.02314736694097519, 0.0242120660841465, -0.016069084405899048, -0.04653133451938629, 0.05335330218076706, 0.010568133555352688, -0.005180553998798132, 0.03125091642141342, 0.06478896737098694, -0.0160197913646698, -0.051105599850416183, -0.03478020057082176, 0.006708595901727676, 0.0780780017375946, -0.005436870735138655, 0.017587266862392426, -0.010183658450841904, 0.003896506270393729, 0.09132760018110275, -0.05481233447790146, 0.09251060336828232, -0.0019285364542156458, 0.0699153020977974, -0.01847451739013195, 0.037875715643167496, -0.021195417270064354, -0.03901928290724754, -0.014067841693758965, -0.06786476820707321, 0.02665693312883377, 0.03872353211045265, -0.041128966957330704, 0.034346435219049454, -0.004975993651896715, -0.010883600451052189, -0.06313277035951614, -0.007521908264607191, -0.019470209255814552, -0.010834308341145515, -0.01958850771188736, 0.02803710103034973, 0.0745289996266365, 0.05792756751179695, -0.04944939911365509, 0.017715424299240112, -0.008290858007967472, 0.004837977234274149, 0.04834526777267456, 0.021984083577990532, 0.023660000413656235, -0.006003724876791239, -0.038250334560871124, -0.0255725160241127, 0.04306120052933693, -0.00021857774117961526, -0.012175042182207108, 0.04164160043001175, 0.04310063272714615, 0.010439975187182426, 0.008956296369433403, 0.10497153550386429, 0.07843290269374847, -0.004027129150927067, 0.03592376783490181 ]
31,937
sonetel.calls
__init__
Initiate the Call class. :param access_token: Required. The access token generated from the Auth class. :param app_name: The name of the app that is making the request. Defaults to 'PythonSonetelPackage'.
def __init__(self, access_token, app_name: str = 'PythonSonetelPackage') -> None: """ Initiate the Call class. :param access_token: Required. The access token generated from the Auth class. :param app_name: The name of the app that is making the request. Defaults to 'PythonSonetelPackage'. """ if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_CALLBACK}' if len(app_name) < 2: raise e.SonetelException('app_name must be at least 2 characters long') self._app_name = f"{app_name}__{self._accountid}__{self._userid}"
(self, access_token, app_name: str = 'PythonSonetelPackage') -> NoneType
[ -0.020052893087267876, -0.08696623146533966, -0.04359825327992439, 0.016896242275834084, 0.007642167154699564, -0.03446411341428757, -0.020340735092759132, 0.014449597336351871, 0.025368349626660347, -0.006855403073132038, 0.015169198624789715, 0.023909958079457283, 0.02582889422774315, 0.008640014566481113, -0.015869610011577606, 0.005555323325097561, 0.08082563430070877, 0.01611907221376896, 0.03546195849776268, -0.007320745382457972, -0.0014272095868363976, 0.03573061153292656, -0.03999065235257149, 0.0037922996561974287, 0.009556307457387447, 0.08305159956216812, 0.003535641822963953, 0.045325297862291336, 0.024850236251950264, -0.028361892327666283, -0.006332492921501398, 0.001297681243158877, 0.002842425834387541, 0.055649179965257645, -0.015313118696212769, -0.017481517046689987, -0.012300387024879456, 0.0016718740807846189, -0.13693535327911377, -0.027671074494719505, 0.010026446543633938, -0.007459868211299181, 0.019314102828502655, 0.019266128540039062, 0.018824774771928787, -0.0091341407969594, -0.05246374383568764, 0.06973417848348618, 0.0008299403125420213, -0.012079709209501743, -0.027287287637591362, 0.022432375699281693, -0.027152961120009422, -0.0016167046269401908, -0.018776800483465195, 0.06647198647260666, -0.013902699574828148, 0.04547881335020065, -0.02736404351890087, 0.01827787607908249, -0.04828045889735222, 0.0019009471870958805, 0.021453717723488808, 0.012684174813330173, 0.00839535053819418, 0.021799126639962196, -0.03999065235257149, 0.029551632702350616, 0.0207053329795599, 0.018181929364800453, 0.10646263509988785, 0.030088935047388077, -0.07272771745920181, 0.01443040743470192, 0.06309465318918228, 0.00313506368547678, -0.04144904389977455, 0.014478380791842937, -0.04555556923151016, -0.0035164523869752884, 0.031777601689100266, -0.01270336378365755, -0.016867458820343018, -0.009124546311795712, 0.05326969549059868, 0.004821329843252897, -0.005349037237465382, -0.07238230854272842, -0.057337842881679535, 0.07537585496902466, -0.05384537950158119, 0.013835537247359753, -0.06405412405729294, -0.002122824313119054, 0.0005322052165865898, -0.03843631222844124, -0.00794919766485691, -0.04248527064919472, -0.014852574095129967, 0.02803567238152027, 0.003933821339160204, -0.013682021759450436, -0.10323882102966309, -0.0017186481272801757, 0.033408697694540024, -0.027862967923283577, 0.011811058036983013, -0.005176333244889975, 0.06574279069900513, 0.0016011132393032312, -0.04125715047121048, -0.00265532941557467, 0.01055415440350771, 0.027613505721092224, -0.04052795469760895, 0.02304643578827381, 0.019784241914749146, -0.007032904773950577, -0.030376775190234184, 0.016704348847270012, 0.03444492444396019, 0.02218291349709034, 0.027133772149682045, -0.002475429093465209, 0.034080322831869125, 0.050659943372011185, -0.009143735282123089, -0.007867642678320408, 0.050928592681884766, -0.06532061845064163, 0.03736170753836632, 0.0028903991915285587, 0.007277569267898798, -0.050851836800575256, -0.048242080956697464, 0.05411402881145477, 0.023833200335502625, -0.010506181046366692, -0.08136294037103653, 0.05580269545316696, -0.004878897685557604, 0.024984562769532204, 0.014833384193480015, -0.004375176969915628, -0.012521064840257168, 0.015495417639613152, -0.014372839592397213, -0.037035487592220306, 0.03598007187247276, 0.010794022120535374, 0.04943182319402695, -0.013998647220432758, 0.02237480692565441, 0.004284027498215437, -0.0722287967801094, -0.012214034795761108, -0.0036507779732346535, -0.0010020449990406632, -0.0009258872014470398, 0.03087569959461689, -0.02886081486940384, -0.025425918400287628, 0.00125090719666332, -0.04474961385130882, 0.010093609802424908, -0.06025462970137596, 0.02103155106306076, -0.0061214095912873745, -0.03047272190451622, -0.0046174428425729275, 0.015946367755532265, -0.001939325942657888, -0.04133390635251999, -0.03189273551106453, 0.007632572669535875, -0.007282366510480642, -0.010707669891417027, -0.009114951826632023, 0.007042499724775553, -0.017846116796135902, 0.002736884169280529, -0.007522233761847019, -0.044404204934835434, 0.014900547452270985, 0.0000839535059640184, 0.047282613813877106, 0.026615658774971962, 0.036498185247182846, 0.010909157805144787, 0.02899514138698578, -0.028803247958421707, 0.02366049587726593, 0.06958065927028656, 0.0016143058892339468, -0.02588646300137043, 0.010928347706794739, -0.005113967694342136, 0.01698259450495243, -0.05614810064435005, -0.045133404433727264, -0.034137893468141556, 0.0899597778916359, 0.0006428439519368112, -0.011312134563922882, 0.020475059747695923, 0.0066635096445679665, 0.08213051408529282, -0.019640322774648666, -0.041832830756902695, -0.02778621017932892, -0.011177808977663517, -0.019534781575202942, -0.0009072974789887667, -0.0018997478764504194, -0.015121225267648697, -0.016665969043970108, 0.03728494793176651, -0.006246140692383051, 0.06439953297376633, 0.006020665634423494, 0.0574529804289341, -0.04739774763584137, 0.027920536696910858, -0.045939356088638306, -0.023487791419029236, 0.046745311468839645, 0.027882156893610954, -0.04801180958747864, -0.05415240675210953, -0.02899514138698578, -0.03525087609887123, -0.02500375173985958, 0.038800910115242004, 0.02722971886396408, -0.08136294037103653, -0.04935506358742714, 0.053768619894981384, -0.037783872336149216, -0.06566602736711502, -0.06493683159351349, 0.08604514598846436, -0.010995510034263134, -0.013979457318782806, 0.03114435076713562, -0.02636619657278061, 0.019429238513112068, -0.00029263790929690003, 0.015245956368744373, -0.059487052261829376, -0.03471357375383377, 0.017942063510417938, -0.04563232511281967, -0.0060974229127168655, -0.00859683845192194, -0.00780527712777257, -0.09226249903440475, -0.029973799362778664, 0.009757795371115208, 0.025464296340942383, -0.0018361830152571201, -0.02291210927069187, 0.000639245961792767, -0.043444737792015076, 0.03281382471323013, -0.010295097716152668, 0.018776800483465195, -0.0003669967409223318, 0.003943415824323893, -0.012348361313343048, -0.0028304322622716427, 0.16073018312454224, 0.04524853825569153, 0.036229535937309265, -0.003588412655517459, -0.05307780206203461, -0.021453717723488808, -0.04037443920969963, 0.015821637585759163, -0.0396452434360981, -0.032525986433029175, 0.046476658433675766, -0.061981670558452606, 0.03728494793176651, 0.07913696765899658, 0.008448121137917042, -0.05046804994344711, 0.03690116107463837, 0.008803124539554119, -0.005828771740198135, -0.01088996883481741, 0.008030751720070839, 0.011791869066655636, 0.011580785736441612, 0.02379482053220272, -0.03870496153831482, 0.0024346516001969576, 0.02945568598806858, 0.039414968341588974, 0.031317055225372314, -0.04881776124238968, 0.04494151100516319, -0.002576173283159733, 0.011177808977663517, -0.027555938810110092, 0.039798758924007416, -0.026385385543107986, 0.01610947772860527, 0.01422891952097416, -0.018719231709837914, 0.03749603405594826, -0.027613505721092224, -0.00805953610688448, 0.010909157805144787, -0.04225499555468559, -0.03156651556491852, 0.043866902589797974, 0.04206310212612152, 0.008683190681040287, 0.04889452084898949, 0.07560612261295319, -0.010563748888671398, -0.016330154612660408, 0.006390060763806105, 0.002305123256519437, 0.04643828049302101, -0.015936773270368576, 0.015735285356640816, 0.0003025324549525976, -0.014267298392951488, 0.0034157081972807646, -0.06716280430555344, -0.02204858884215355, -0.021991020068526268, -0.041218772530555725, -0.014200135134160519, 0.013432560488581657, -0.034080322831869125, -0.012569038197398186, 0.00388344912789762, -0.02596322074532509, -0.006346884649246931, -0.05944867432117462, -0.047896672040224075, 0.07364881038665771, -0.031988684087991714, -0.005185927730053663, 0.008131496608257294, -0.03613358736038208, 0.035500336438417435, -0.029474874958395958, -0.04252364858984947, -0.019563565030694008, 0.07487692683935165, 0.03661332279443741, 0.10454370081424713, -0.004375176969915628, -0.036709267646074295, -0.010525370948016644, 0.0008473307243548334, -0.048165325075387955, -0.028553785756230354, -0.02924460358917713, -0.02333427593111992, 0.036632511764764786, -0.04340635985136032, -0.023814011365175247, -0.0013096745824441314, -0.010832400061190128, 0.05150427296757698, -0.022413186728954315, -0.01644529215991497, -0.07875318080186844, -0.036306291818618774, 0.0014979703119024634, 0.016541238874197006, 0.03757278993725777, -0.015121225267648697, -0.015485823154449463, -0.06363195925951004, 0.04110363498330116, 0.020513439550995827, 0.06359358131885529, 0.03281382471323013, 0.05415240675210953, 0.04509502276778221, -0.027076203376054764, -0.09164843708276749, -0.006634725257754326, 0.06892822682857513, 0.05384537950158119, 0.02696106769144535, -0.014449597336351871, -0.030914077535271645, 0.02373725362122059, -0.05292428657412529, -0.013662832789123058, -0.0440971776843071, -0.009057383984327316, -0.012338765896856785, -0.017817331477999687, 0.0362871028482914, -0.02210615575313568, 0.049508579075336456, 0.009057383984327316, 0.023084813728928566, 0.010698074474930763, 0.04900965467095375, -0.008539270609617233, -0.015361092053353786, 0.024293744936585426, -0.023545360192656517, -0.06359358131885529, -0.044250693172216415, -0.03619115427136421, -0.029705148190259933, 0.022010209038853645, -0.048433974385261536, 0.07813912630081177, 0.03254517540335655, -0.004917276557534933, 0.04559394717216492, -0.0034133095759898424, 0.043252844363451004, 0.008683190681040287, -0.02838108129799366, 0.03736170753836632, 0.013490128330886364, -0.025732947513461113, 0.026116734370589256, -0.03755360096693039, 0.007867642678320408, 0.045747462660074234, -0.05062156170606613, -0.029206223785877228, -0.004519097041338682, 0.05941029638051987, -0.01611907221376896, -0.008769542910158634, -0.03753441199660301, -0.005862352903932333, -0.014104188419878483, 0.025425918400287628, 0.011235377751290798, 0.004492711741477251, 0.019765052944421768, 0.0027320869266986847, -0.07510720193386078, 0.0020808475092053413, 0.014890952967107296, -0.06462980806827545, 0.00207245210185647, 0.042101483792066574, -0.0025377944111824036, -0.0002915885124821216, -0.09249277412891388, -0.03878172114491463, -0.03655575215816498, -0.001831385656259954, 0.0092396829277277, 0.01598474755883217, -0.020743710920214653, -0.014401623979210854, -0.010774832218885422, -0.016867458820343018, 0.031643275171518326, 0.05142751708626747, 0.049585338681936264, 0.019035857170820236, -0.03127867728471756, -0.04302257299423218, 0.01526514533907175, -0.014564733020961285, 0.012194845825433731, 0.04616962745785713, 0.023161571472883224, 0.00707608088850975, 0.02556024305522442, -0.0256178118288517, -0.02790134772658348, 0.01422891952097416, -0.026308629661798477, 0.008903868496418, -0.009052585810422897, 0.004756565671414137, -0.011782274581491947, -0.008323390036821365, -0.025713758543133736, -0.015015683136880398, -0.0010925948154181242, 0.002023279434069991, -0.02224048227071762, 0.059832461178302765, -0.027920536696910858, 0.022701026871800423, -0.040412817150354385, 0.0472058542072773, -0.026980256661772728, 0.025425918400287628, 0.0013516513863578439, -0.0204942487180233, -0.02663484774529934, -0.008947044610977173, -0.00394101720303297, -0.050314534455537796, 0.022298051044344902, -0.013087151572108269, -0.1051577553153038, 0.006706685293465853, 0.006634725257754326, -0.006634725257754326, -0.025464296340942383, 0.002289531985297799, 0.005229103844612837, -0.018018819391727448, 0.015389876440167427, -0.012396334670484066, 0.011235377751290798, 0.02231724001467228, -0.05407565087080002, -0.030626237392425537, 0.05426754429936409, 0.04866424575448036, 0.03924226388335228, 0.03557709604501724, -0.00010741550795501098, -0.015869610011577606, 0.0260783564299345, 0.005488160531967878, -0.014526354148983955, 0.03619115427136421, -0.019266128540039062, -0.004936465993523598, -0.04286905750632286, 0.02062857523560524, 0.08320511877536774, -0.01439202856272459, -0.0988636463880539, 0.017807736992836, -0.0024610369000583887, 0.042024724185466766, -0.016953811049461365, -0.0016898640897125006, -0.048971276730298996, -0.05576431378722191, -0.07556774467229843, -0.061444368213415146, 0.00009804569708649069, 0.07821588218212128, 0.008553662337362766, -0.035903315991163254, 0.05373024195432663, -0.024754289537668228, 0.06712442636489868, 0.020532628521323204, -0.04732099175453186, -0.015015683136880398, -0.029110277071595192, -0.042024724185466766, -0.007320745382457972, -0.007008918095380068, -0.04605449363589287, 0.04751288518309593, -0.04194796830415726, -0.01732800342142582, -0.012089304625988007, 0.01618623547255993, -0.01385472621768713, 0.02527240291237831, -0.029820283874869347, 0.020379113033413887, 0.0256178118288517, -0.007786087691783905, 0.0038162863347679377, 0.05465133115649223, 0.010439018718898296, 0.018488960340619087, 0.017097730189561844, 0.06140599027276039, 0.04866424575448036, 0.02082046866416931, 0.047896672040224075, 0.011168214492499828, -0.05004588142037392, -0.05799028277397156, -0.0091341407969594, 0.006965741980820894, -0.004130512475967407, -0.043713390827178955, 0.06390061229467392, 0.003823482431471348, -0.06244221702218056, -0.018038010224699974, -0.025790516287088394, 0.018776800483465195, -0.01138889230787754, 0.03968362137675285, 0.009800971485674381, -0.02953244373202324, 0.01270336378365755, 0.01766381599009037, -0.03396518900990486, 0.07890670001506805, -0.023545360192656517, -0.05058318376541138, 0.029628390446305275, 0.021069930866360664, -0.11413838714361191, 0.024926993995904922, -0.0050420076586306095, 0.03444492444396019, 0.038186851888895035, 0.027325665578246117, -0.03929983451962471, 0.015485823154449463, 0.0036819607485085726, 0.034963034093379974, -0.052003197371959686, 0.0579519048333168, 0.03500141575932503, 0.00006971139373490587, 0.05522701144218445, 0.006869795266538858, -0.051811303943395615, 0.05561079829931259, -0.08097914606332779, 0.016733132302761078, 0.062058430165052414, -0.03715062513947487, -0.06274924427270889, -0.009882526472210884, 0.047628022730350494, 0.041487421840429306, 0.019707484170794487, -0.05108210816979408, 0.04739774763584137, 0.039338212460279465, 0.010899563319981098, -0.014411218464374542, 0.029628390446305275, 0.05910326540470123, 0.024025093764066696, -0.008841503411531448, 0.01773097924888134, -0.03133624419569969, -0.02304643578827381, 0.04582421854138374, -0.05046804994344711, -0.020666953176259995, 0.024485638365149498, 0.0012605019146576524, -0.02387157827615738, 0.017097730189561844, 0.03945335000753403, 0.032314904034137726, -0.025637000799179077, -0.02279697358608246, -0.047896672040224075, 0.008999815210700035, 0.024082662537693977, -0.020743710920214653, -0.02425536699593067, -0.03599926084280014, 0.04413555562496185, -0.020724521949887276, -0.03607602044939995, 0.00467021344229579, 0.024312933906912804, -0.04497988894581795, 0.002108432352542877, 0.06006273254752159, -0.003482870990410447, 0.0018409803742542863, 0.01880558393895626, 0.006433236878365278, 0.020263977348804474, -0.017500707879662514, -0.005967894569039345, -0.016205424442887306, 0.03290977329015732, 0.013989051803946495, -0.04578584060072899, 0.017136109992861748, 0.021415339782834053, 0.019860999658703804, -0.02628943882882595, 0.019362077116966248, 0.026673227548599243, 0.030376775190234184, -0.02648133412003517, -0.04490312933921814, 0.0027800602838397026, -0.03066461719572544, -0.03686278313398361, -0.010256719775497913, -0.015073251910507679, -0.03170084208250046, -0.08036509156227112, -0.032660309225320816, -0.048971276730298996, 0.018114767968654633, 0.06359358131885529, -0.0293981172144413, 0.010084015317261219, -0.006764253601431847, -0.03949172794818878, 0.03786063194274902, 0.01672353781759739, -0.033466264605522156, -0.009421981871128082, 0.02312319353222847, -0.005536133889108896, -0.008572852239012718, 0.0512356236577034, -0.006936958059668541, -0.006174180656671524, -0.01799963042140007, -0.03690116107463837, 0.05534214898943901, -0.04482637345790863, 0.02076289989054203, -0.04490312933921814, -0.003974598832428455, 0.05373024195432663, 0.013979457318782806, 0.12150710076093674, -0.031374622136354446, 0.03195030614733696, -0.004310412798076868, 0.03511654958128929, -0.008203456178307533, -0.005838366225361824, -0.01385472621768713, -0.07641208171844482, 0.040067408233881, 0.03857063874602318, -0.031163539737462997, 0.004154499154537916, 0.013576480560004711, 0.029820283874869347, 0.016694754362106323, 0.0023770835250616074, -0.012309982441365719, -0.04590097814798355, -0.031317055225372314, 0.02521483413875103, 0.07614342868328094, 0.0013888308312743902, -0.07545261085033417, 0.019198967143893242, 0.026001598685979843, 0.02770945243537426, 0.039069563150405884, 0.016867458820343018, 0.020206408575177193, -0.006697090808302164, -0.027210529893636703, -0.026980256661772728, 0.018527338281273842, 0.0031326650641858578, -0.023104004561901093, 0.02076289989054203, 0.042293377220630646, -0.010736453346908092, -0.03747684508562088, 0.05580269545316696, 0.07322664558887482, 0.007738114334642887, -0.012396334670484066 ]
31,938
sonetel.calls
callback
Use Sonetel's CallBack API to make business quality international calls at the cost of 2 local calls. **Docs**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE1OTMzOTIy-make-calls **Number Format:** It is recommended that both the phone numbers (num1 and num2) be entered in the international E164 format with a leading +. For example, if you want to call a US number (212) 555-1234, it should be set as `+12125551234`. However you can also provide SIP addresses. Additionally, `num1` can be your Sonetel username - this will make sure that the incoming call to you is handled as per your incoming settings defined in the app. **Caller ID:** It is best to use 'automatic' CLI as our system selects the best possible phone to be shown from the numbers available in your account. If you don't have a Sonetel number, then your verified mobile number is used as CLI. Read more at https://sonetel.com/cli :param num1: Required. The first phone number that will be called. This should be your phone number, SIP address or Sonetel email address. :param num2: Required.The phone number or address that you wish to connect to. :param cli1: Optional. The caller ID shown to the first person. Defaults to automatic. :param cli2: Optional. The caller ID shown to the second person. Defaults to automatic. :return: Return the status code and message as a dict.
def callback(self, num1: str, num2: str, cli1: str = 'automatic', cli2: str = 'automatic'): """ Use Sonetel's CallBack API to make business quality international calls at the cost of 2 local calls. **Docs**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE1OTMzOTIy-make-calls **Number Format:**\n It is recommended that both the phone numbers (num1 and num2) be entered in the international E164 format with a leading +. For example, if you want to call a US number (212) 555-1234, it should be set as `+12125551234`. However you can also provide SIP addresses. Additionally, `num1` can be your Sonetel username - this will make sure that the incoming call to you is handled as per your incoming settings defined in the app. **Caller ID:**\n It is best to use 'automatic' CLI as our system selects the best possible phone to be shown from the numbers available in your account. If you don't have a Sonetel number, then your verified mobile number is used as CLI. Read more at https://sonetel.com/cli :param num1: Required. The first phone number that will be called. This should be your phone number, SIP address or Sonetel email address. :param num2: Required.The phone number or address that you wish to connect to. :param cli1: Optional. The caller ID shown to the first person. Defaults to automatic. :param cli2: Optional. The caller ID shown to the second person. Defaults to automatic. :return: Return the status code and message as a dict. """ # Check if num1 and num2 are defined. if num1 and num2: # Initiate the callback body = { "app_id": f'{self._app_name}-{const.PKG_VERSION}', "call1": num1, "call2": num2, "show_1": cli1, "show_2": cli2 } return util.send_api_request( token=self._token, uri=self._url, method='post', body=dumps(body) ) return util.prepare_error( code=const.ERR_CALLBACK_NUM_EMPTY, message='num1 & num2 are required to make a call.' )
(self, num1: str, num2: str, cli1: str = 'automatic', cli2: str = 'automatic')
[ -0.00213326676748693, -0.03737325966358185, 0.02540937252342701, 0.01924222894012928, -0.03478046879172325, 0.00472490256652236, -0.043744124472141266, 0.04066981002688408, 0.011223089881241322, -0.02939116209745407, 0.010593411512672901, -0.007556139957159758, 0.021316463127732277, -0.0028219774831086397, -0.005148546304553747, -0.009320165030658245, 0.051374342292547226, -0.032020993530750275, 0.02159426175057888, -0.017630992457270622, 0.017140213400125504, 0.01801065169274807, 0.020001547411084175, 0.03985493257641792, -0.011380509473383427, 0.07808011025190353, 0.01539933867752552, 0.02666872926056385, 0.022501740604639053, -0.02216838113963604, -0.031020916998386383, -0.046559154987335205, -0.020612705498933792, 0.012825066223740578, -0.009005325846374035, 0.028261445462703705, -0.019908947870135307, 0.05515241250395775, -0.0794876292347908, -0.0034817506093531847, -0.012371326796710491, -0.0381510965526104, 0.010528592392802238, 0.054411616176366806, -0.004954086616635323, 0.04429972171783447, -0.0763021931052208, 0.03737325966358185, -0.018686629831790924, 0.0007761016604490578, -0.0029678221326321363, -0.0008137203403748572, -0.00975075364112854, -0.02027934603393078, -0.022520260885357857, 0.03478046879172325, 0.009209045208990574, 0.033021073788404465, 0.0012443092418834567, -0.038817815482616425, -0.006491242907941341, 0.020001547411084175, 0.004484143108129501, 0.009454434737563133, -0.005042056553065777, 0.019575588405132294, 0.015936417505145073, 0.03959565609693527, 0.030983878299593925, 0.022242460399866104, 0.05192994326353073, 0.019575588405132294, -0.08067290484905243, -0.02922448143362999, 0.07230188697576523, 0.01955706812441349, -0.029354121536016464, 0.04522572085261345, -0.03578054532408714, 0.017853232100605965, 0.022723980247974396, -0.017686553299427032, 0.04074389114975929, 0.028724443167448044, 0.009889653883874416, 0.013334364630281925, 0.016742035746574402, -0.010491551831364632, -0.03744734078645706, 0.05985648185014725, -0.08096922188997269, -0.06096767634153366, -0.03691026195883751, -0.024798214435577393, -0.01605679653584957, -0.04200324788689613, 0.012093528173863888, -0.03303959220647812, 0.02985415980219841, 0.007181110791862011, -0.008954396471381187, -0.01929778791964054, -0.02839108370244503, -0.03553978353738785, 0.034947145730257034, -0.061523277312517166, -0.03355814889073372, 0.03811405971646309, 0.016732774674892426, 0.025020454078912735, -0.051152102649211884, -0.06626438349485397, -0.055448733270168304, -0.05152250453829765, -0.026520568877458572, 0.031965434551239014, 0.027909565716981888, 0.05444865673780441, -0.053781937807798386, 0.01351956371217966, 0.01976078748703003, 0.006046764086931944, 0.005764334462583065, -0.06711629778146744, -0.0010197547962889075, 0.0125472666695714, -0.0005428660660982132, 0.03398410975933075, 0.078450508415699, -0.04752219468355179, 0.023594416677951813, -0.01257504615932703, 0.024020375683903694, 0.006639402359724045, -0.021946141496300697, 0.02755768597126007, -0.02896520309150219, 0.00871826708316803, -0.02552049234509468, 0.029891200363636017, -0.005917124450206757, 0.03487306833267212, -0.015028939582407475, -0.006519022397696972, -0.03457674756646156, 0.036317624151706696, 0.004173933994024992, -0.031446877866983414, 0.0003379890986252576, 0.04370708391070366, 0.00794505886733532, 0.02290917932987213, 0.04485531896352768, 0.0031020918395370245, -0.02483525313436985, -0.010658231563866138, 0.02253877930343151, -0.03111351653933525, 0.02546493150293827, 0.024242615327239037, 0.007482060231268406, -0.006009723991155624, 0.05004090815782547, -0.04359596222639084, 0.0071209208108484745, -0.01735319383442402, -0.0397438146173954, 0.03135427460074425, 0.001269774162210524, 0.059523120522499084, 0.010343392379581928, 0.016927234828472137, -0.022816579788923264, -0.02750212699174881, 0.022575819864869118, -0.01872367039322853, 0.004599892534315586, -0.036836180835962296, -0.02526121214032173, -0.015195619314908981, -0.019260749220848083, 0.03140983730554581, 0.004518867935985327, 0.021557223051786423, 0.01264912635087967, 0.020890504121780396, 0.061152875423431396, -0.013945522718131542, 0.0015371559420600533, -0.035058267414569855, 0.005870824214071035, 0.0209090244024992, 0.04841114953160286, 0.0381510965526104, 0.0031784866005182266, 0.0190755482763052, 0.03598426282405853, 0.011926848441362381, -0.01981634646654129, -0.12852846086025238, -0.02081642486155033, 0.037558458745479584, -0.0030743118841201067, -0.040817972272634506, 0.0015221084468066692, -0.01880701072514057, 0.03539162501692772, 0.04963346943259239, -0.03676210343837738, -0.04189212992787361, 0.047929633408784866, -0.004312833305448294, -0.012871365994215012, 0.024131495505571365, 0.027779925614595413, -0.034484148025512695, 0.03731770068407059, -0.002210819162428379, 0.01586233824491501, 0.005157806444913149, 0.030650518834590912, -0.029372641816735268, 0.044521961361169815, -0.04207732900977135, -0.005667104851454496, 0.06674589961767197, 0.030872758477926254, -0.004097539000213146, 0.04733699560165405, -0.016010496765375137, -0.015047459863126278, -0.013945522718131542, 0.0029307822696864605, 0.025761252269148827, -0.10163749009370804, -0.08911800384521484, 0.027594726532697678, -0.04785555228590965, -0.02059418521821499, -0.039558615535497665, 0.0737464427947998, 0.013732543215155602, 0.01858477108180523, 0.01340844389051199, 0.003923914395272732, -0.020520105957984924, 0.044262681156396866, 0.0222239401191473, -0.0820804238319397, -0.0036530601792037487, 0.02698356844484806, -0.06122695654630661, 0.03587314486503601, 0.0023254111874848604, -0.01646423526108265, -0.018334751948714256, -0.011639788746833801, 0.03311367332935333, 0.02813180536031723, -0.02859480306506157, -0.0016714255325496197, -0.0037248251028358936, -0.08015434443950653, 0.04348484426736832, -0.04481828212738037, 0.00807469803839922, -0.005250405985862017, -0.009584074839949608, 0.006468092557042837, 0.0261501707136631, 0.08245082199573517, 0.025131573900580406, 0.0019897371530532837, -0.02139054238796234, -0.05941200256347656, -0.003541940590366721, -0.029446721076965332, -0.027261367067694664, 0.015223399735987186, -0.045929476618766785, 0.038817815482616425, -0.013834402896463871, -0.006685702130198479, -0.02253877930343151, 0.050114985555410385, -0.04574427753686905, 0.03696582093834877, 0.006431052926927805, -0.008935876190662384, -0.03779922053217888, 0.018140291795134544, 0.009630374610424042, -0.010963810607790947, 0.009611854329705238, -0.03628058359026909, 0.014371481724083424, 0.01884404942393303, 0.02546493150293827, 0.027020607143640518, -0.08756233006715775, 0.002019832143560052, -0.008528437465429306, -0.01586233824491501, -0.07785787433385849, -0.01626051589846611, -0.040188293904066086, 0.039188217371702194, -0.027150247246026993, -0.0292800422757864, 0.003921599593013525, -0.04041053354740143, -0.003930859733372927, -0.011760168708860874, -0.0810433030128479, -0.004433213267475367, 0.10178565233945847, 0.07763563096523285, 0.04696659371256828, 0.03948453441262245, 0.0627085492014885, 0.011380509473383427, -0.021835021674633026, 0.014167762361466885, 0.01720503345131874, 0.04281812533736229, -0.016649436205625534, -0.01728837378323078, 0.01571417786180973, 0.021260904148221016, 0.03089127689599991, -0.0316505953669548, -0.029835641384124756, 0.02618720941245556, -0.04441084340214729, 0.024798214435577393, -0.00794505886733532, 0.0037664950359612703, -0.009028475731611252, 0.0020244622137397528, -0.021427582949399948, -0.02316845767199993, -0.05244849994778633, -0.046410996466875076, 0.00819970853626728, -0.01152866892516613, 0.024483375251293182, 0.021723901852965355, -0.010102633386850357, 0.06867197901010513, -0.014658540487289429, -0.01623273640871048, -0.0032294164411723614, 0.029872680082917213, 0.032076556235551834, 0.0663755014538765, 0.029094843193888664, -0.025390852242708206, -0.0695609375834465, 0.040706850588321686, -0.0863029733300209, -0.0381510965526104, -0.0321691557765007, -0.0054587554186582565, 0.036521341651678085, -0.038817815482616425, -0.005222626030445099, 0.019631147384643555, 0.0033104412723332644, 0.052152179181575775, 0.008935876190662384, 0.00046733938506804407, -0.04930010810494423, -0.004646192770451307, 0.03889189660549164, -0.008764566853642464, 0.00592175405472517, 0.003916969522833824, 0.004451733082532883, -0.047077715396881104, -0.02127942256629467, 0.029094843193888664, 0.009945213794708252, -0.026798369362950325, 0.009639634750783443, 0.07522804290056229, -0.04044757038354874, -0.032817352563142776, 0.019834866747260094, -0.04429972171783447, 0.03142835572361946, 0.05726368725299835, -0.005069836508482695, -0.02227950096130371, 0.009278494864702225, -0.046040598303079605, 0.01089899055659771, -0.00062273332150653, 0.017242074012756348, -0.03578054532408714, -0.04481828212738037, 0.007963579148054123, -0.05248554050922394, -0.002143684308975935, 0.02316845767199993, 0.03459526598453522, 0.005176326259970665, 0.0017431903397664428, 0.01732541434466839, -0.002666872926056385, 0.03491010516881943, -0.026131650432944298, -0.043892282992601395, -0.027909565716981888, -0.03948453441262245, -0.0768207535147667, 0.04522572085261345, -0.08437689393758774, 0.0868215262889862, -0.013380664400756359, 0.006699592340737581, 0.043892282992601395, -0.026427969336509705, 0.026335369795560837, 0.08237674087285995, 0.03978085517883301, 0.024501895532011986, 0.018482910469174385, -0.02216838113963604, 0.052892979234457016, -0.009871133603155613, 0.004354503471404314, 0.017593953758478165, -0.014778920449316502, -0.0810433030128479, -0.043744124472141266, 0.05530057102441788, 0.006806082092225552, -0.011463849805295467, 0.04952234774827957, -0.0057597048580646515, -0.004021144472062588, 0.03581758588552475, -0.040188293904066086, -0.039077095687389374, -0.028539244085550308, -0.05756000801920891, -0.022779539227485657, -0.01639941707253456, 0.0020047847647219896, -0.06519022583961487, -0.00962111447006464, 0.030187519267201424, 0.019908947870135307, 0.03283587098121643, 0.03874373808503151, -0.05307817831635475, -0.03426190838217735, 0.029983799904584885, -0.0027409526519477367, -0.015991976484656334, -0.011862028390169144, -0.021779462695121765, -0.029094843193888664, 0.011584228835999966, 0.0015070609515532851, 0.07122772932052612, 0.06989429146051407, 0.002044139662757516, -0.04107724875211716, -0.035058267414569855, 0.008695117197930813, -0.03611390292644501, 0.0012767191510647535, 0.08637704700231552, 0.05263369902968407, 0.029928240925073624, 0.015010420233011246, -0.07463540136814117, -0.02190910093486309, -0.0018427351024001837, -0.03692878037691116, -0.030557919293642044, 0.00585693446919322, -0.028835562989115715, -0.008005248382687569, -0.042373646050691605, -0.011278649792075157, -0.08659929037094116, -0.05000386759638786, 0.005426345393061638, -0.0318913534283638, 0.018862569704651833, 0.05155954137444496, -0.014686320908367634, -0.053152259439229965, -0.005236516240984201, 0.007968208752572536, -0.024242615327239037, -0.02127942256629467, 0.017075395211577415, -0.022612860426306725, 0.02755768597126007, -0.008292308077216148, -0.03179875388741493, 0.024335214868187904, -0.03002084046602249, -0.06070839986205101, 0.029668960720300674, -0.0737464427947998, 0.03852149844169617, -0.04500348120927811, -0.010658231563866138, 0.036317624151706696, -0.0018948224605992436, -0.036150943487882614, -0.05381897836923599, 0.05830080434679985, 0.044892359524965286, -0.04152172803878784, -0.03398410975933075, 0.03992901369929314, 0.04607763886451721, 0.0015522033208981156, 0.047299955040216446, 0.03153947740793228, 0.0025835330598056316, -0.06963501125574112, -0.01898294873535633, 0.002622887957841158, 0.004454048350453377, 0.007074621040374041, 0.024501895532011986, 0.0009653524029999971, -0.021631302312016487, 0.009107185527682304, -0.03498418629169464, -0.04141061007976532, -0.006417162716388702, -0.027539165690541267, 0.00658847251906991, -0.02703912742435932, 0.02127942256629467, -0.09274791181087494, -0.027539165690541267, -0.019149629399180412, -0.04192916676402092, 0.024038895964622498, 0.029835641384124756, 0.03407670930027962, -0.020631225779652596, 0.007315380498766899, -0.024353735148906708, 0.10223012417554855, 0.033169232308864594, -0.04722587391734123, 0.010287832468748093, 0.004694807343184948, -0.03518790751695633, -0.01838105171918869, -0.009472955018281937, -0.040188293904066086, 0.024668574333190918, -0.05152250453829765, -0.019742267206311226, -0.02076086401939392, 0.06044911965727806, 0.04774443432688713, 0.024390775710344315, -0.0008623352041468024, -0.01732541434466839, -0.004518867935985327, 0.05844896286725998, 0.004190139006823301, 0.02216838113963604, -0.05496721342206001, 0.01089899055659771, 0.03737325966358185, -0.06489390879869461, 0.0063708629459142685, 0.006505132652819157, 0.021057184785604477, 0.028094764798879623, -0.03948453441262245, -0.045781318098306656, 0.018362531438469887, 0.05141138285398483, -0.03337294980883598, -0.012213907204568386, 0.0024886184837669134, 0.05667104944586754, -0.004206344019621611, -0.024038895964622498, -0.06489390879869461, 0.016038278117775917, -0.005926384124904871, 0.06415311247110367, 0.027428047731518745, -0.0022038740571588278, 0.03963269293308258, 0.043892282992601395, -0.08437689393758774, 0.02468709461390972, -0.01213056780397892, -0.06570878624916077, 0.013213984668254852, 0.01626051589846611, -0.07237596809864044, -0.033539630472660065, -0.02922448143362999, 0.03496566787362099, 0.07100549340248108, -0.00004807229197467677, -0.014260361902415752, -0.02916892245411873, 0.021983182057738304, 0.03716954216361046, -0.0033567410428076982, 0.03394706919789314, 0.04241068661212921, 0.01516783982515335, 0.014149242080748081, 0.019149629399180412, -0.05552281066775322, -0.006639402359724045, -0.059374962002038956, -0.007389460224658251, -0.0009613012080080807, -0.010408212430775166, -0.035373106598854065, -0.02357589639723301, 0.01098233088850975, 0.02907632291316986, 0.07926538586616516, -0.0533374585211277, 0.07563547790050507, -0.006245853379368782, 0.02216838113963604, 0.0036137052811682224, -0.011408289894461632, 0.03318775072693825, 0.0009335212525911629, 0.023149937391281128, 0.010611931793391705, -0.06722742319107056, 0.010500811971724033, 0.036150943487882614, -0.06252335011959076, -0.010111892595887184, 0.030557919293642044, -0.02437225542962551, -0.014528901316225529, 0.047929633408784866, -0.03450266644358635, 0.05800448730587959, -0.03513234481215477, -0.0041137440130114555, -0.02039046585559845, 0.0033197011798620224, 0.016704995185136795, 0.00037965900264680386, -0.04663323611021042, 0.012000927701592445, 0.06544950604438782, -0.026224249973893166, -0.03242843225598335, -0.008690486662089825, 0.046670276671648026, -0.05118914321064949, 0.038299258798360825, -0.002253646496683359, 0.002428428502753377, -0.018131032586097717, 0.04570723697543144, 0.009454434737563133, 0.04841114953160286, 0.004016514401882887, -0.00819970853626728, 0.04052165150642395, 0.015649357810616493, 0.03796589747071266, -0.03841037675738335, 0.01445482112467289, -0.001387838856317103, 0.019631147384643555, 0.007037581410259008, -0.005630065221339464, 0.05618952959775925, 0.04485531896352768, -0.016010496765375137, 0.02687244862318039, 0.007588549982756376, -0.018677370622754097, -0.0418180488049984, -0.004345243331044912, 0.005810634698718786, -0.01864033006131649, -0.1030450090765953, -0.07537619769573212, -0.09141447395086288, 0.02200170047581196, 0.06830158084630966, -0.017334673553705215, -0.0016911029815673828, -0.004085964057594538, -0.010500811971724033, -0.001081680878996849, -0.026372410356998444, -0.05559689179062843, 0.040336452424526215, 0.0038243697490543127, -0.01801065169274807, 0.004720272496342659, 0.043003324419260025, 0.007185740862041712, -0.06944981217384338, -0.015353038907051086, -0.023390697315335274, 0.08045066893100739, 0.007023691199719906, 0.031391315162181854, -0.014991899952292442, -0.008250637911260128, 0.08200634270906448, -0.03622502461075783, 0.07504283636808395, 0.014547421596944332, 0.08296938240528107, -0.029354121536016464, 0.021057184785604477, -0.03550274670124054, -0.03415079042315483, -0.049114909023046494, -0.0465221144258976, 0.006403272971510887, 0.02200170047581196, -0.04144765064120293, 0.02635389007627964, -0.009148855693638325, -0.013223244808614254, -0.07456132024526596, -0.011565709486603737, -0.03185431659221649, 0.013899222947657108, -0.01076935138553381, 0.013871443457901478, 0.05630065128207207, 0.053930096328258514, -0.050485383719205856, 0.02472413331270218, -0.001497801044024527, -0.008736786432564259, 0.043929323554039, 0.020408986136317253, 0.02881704270839691, -0.021094223484396935, -0.009667414240539074, -0.018964430317282677, 0.05081874504685402, -0.02352033741772175, 0.0073200105689466, 0.04378116503357887, 0.08608072996139526, 0.031150557100772858, 0.0000011303681048957515, 0.1118604987859726, 0.05744888633489609, 0.0008056178339757025, 0.04429972171783447 ]
31,939
sonetel.phonenumber
PhoneNumber
Phone number class
class PhoneNumber(util.Resource): """ Phone number class """ def __init__(self, access_token): if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_ACCOUNT}{self._accountid}' \ f'{const.API_ENDPOINT_NUMBERSUBSCRIPTION}' def get(self, e164only: bool = True, number: str = '') -> dict: """ List all the phone numbers present in the account. :param e164only: Optional. Boolean. Only return a list of phone numbers if set to True. Set to True by default. :param number: Optional. String. If you only want information about one of your numbers, pass it as a string. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :return: Information about the numbers assigned to account. """ url = self._url if not isinstance(number, str): number = str(number) if number: if is_e164(number): url += number else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) api_response = util.send_api_request(token=self._token, uri=url) response = api_response['response'] # No numbers are found if response == 'No entries found': return { 'status': 'success', 'response': 'No entries found' } # Only return a list of e164 numbers, without any additional metadata if e164only: nums = [] for entry in response: nums.append(entry['phnum']) return { 'status': 'success', 'response': nums } # Return full response return { 'status': 'success', 'response': response } def add(self, number: str) -> dict: """ Buy a phone number that is available. Numbers that are available for purchase can be checked from the ``/availablephonenumber`` API endpoint. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :param number: the phone number you want to purchase. :return: Dict containing the success response or an error message. """ if not isinstance(number, str): number = str(number) # Request body if is_e164(number): body = { "phnum": number } else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) return util.send_api_request( token=self._token, uri=self._url, method='post', body=dumps(body) ) def delete(self, number: str): """ Remove a number from account. The phone number is removed immediately and cannot be recovered. :param number: The phone number to remove from account. :return: Dict containing the success response or an error message. """ if not isinstance(number, str): number = str(number) if is_e164(number): url = f'{self._url}{number}' else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) return util.send_api_request( token=self._token, uri=url, method='delete' ) def update(self, number: str, connect_to_type: str, connect_to) -> dict: """ Update the number's call forwarding settings. :param number: E164number for which the settings should be updated :param connect_to: the ID of the destination where the incoming calls to this number should be forwarded. :param connect_to_type: The destination type where the calls should be forwarded. Accepted values 'user', 'phnum', 'sip' and 'app'. """ # Checks if not number: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message='number is required to update call settings' ) if not connect_to: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message='connect_to is required to update call settings' ) if connect_to_type not in const.CONST_CONNECT_TO_TYPES: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message=f'invalid connect_to_type value - {connect_to_type}' ) # Prepare request body = { "connect_to_type": connect_to_type, "connect_to": connect_to } url = f'{self._url}{number}' # Return result return util.send_api_request( token=self._token, uri=url, method='put', body=dumps(body) )
(access_token)
[ -0.013105273246765137, -0.038309287279844284, -0.03631655499339104, 0.021391386166214943, -0.0155046870931983, -0.005480017513036728, -0.04676823690533638, -0.04493817687034607, 0.003812628099694848, -0.0843454971909523, 0.008067521266639233, -0.017202578485012054, 0.05038769170641899, 0.018727628514170647, -0.004381980746984482, 0.008281027898192406, 0.05677257478237152, -0.012251244857907295, 0.0562438890337944, -0.06234409287571907, 0.0023498497903347015, 0.01292226742953062, 0.03678423538804054, 0.06571953743696213, -0.01820911094546318, 0.07791995257139206, 0.034384820610284805, 0.04587354138493538, 0.012688426300883293, -0.019083473831415176, -0.002706965897232294, -0.009094389155507088, -0.003738917177543044, 0.028528625145554543, -0.004135430790483952, -0.015270845964550972, -0.026535890996456146, 0.019957836717367172, -0.12086539715528488, 0.05160773545503616, 0.016846733167767525, 0.0053173452615737915, 0.05160773545503616, 0.029667329043149948, 0.0006246355478651822, 0.06885097920894623, -0.04579220339655876, 0.06197808310389519, -0.005729109048843384, -0.005739276297390461, 0.025641195476055145, -0.004509068094193935, -0.03361212834715843, -0.003805002896115184, -0.027552591636776924, -0.017426252365112305, -0.003932090476155281, 0.045141518115997314, 0.00865720771253109, -0.020059507340192795, -0.016541723161935806, 0.014742162078619003, -0.03395780920982361, -0.037963610142469406, 0.03237175568938255, 0.042010076344013214, -0.015321681275963783, 0.00988233182579279, 0.04274210333824158, 0.02574286423623562, 0.07552053779363632, -0.029423322528600693, -0.03841095790266991, -0.004737825598567724, 0.08044137060642242, -0.01215974148362875, 0.01753808930516243, 0.05677257478237152, -0.045100849121809006, -0.011132873594760895, 0.06673624366521835, 0.028630295768380165, 0.04623955488204956, 0.01861579157412052, 0.026942571625113487, 0.027471255511045456, 0.06498751789331436, 0.0013649208704009652, -0.03473050147294998, 0.03745525702834129, -0.06897298246622086, -0.04436882212758064, -0.06059536710381508, -0.05461716651916504, 0.06177474185824394, -0.05360046774148941, -0.008286111988127232, -0.062059417366981506, -0.0352591834962368, -0.01753808930516243, -0.0051927994936704636, 0.029301317408680916, -0.07466650754213333, -0.034425489604473114, 0.06840363144874573, -0.06136806309223175, -0.013420450501143932, 0.032127745449543, 0.03776026889681816, 0.02316044457256794, -0.04994034394621849, -0.012688426300883293, -0.04644289240241051, -0.06169340759515762, 0.00508604571223259, 0.022021740674972534, 0.010182258673012257, 0.04900497943162918, 0.0037999192718416452, -0.007635422982275486, 0.035015176981687546, -0.0014754870207980275, -0.03672323375940323, -0.0072897449135780334, 0.034384820610284805, 0.018951302394270897, -0.0216353926807642, 0.021493054926395416, 0.09125906229019165, -0.1008567214012146, -0.026271549984812737, -0.018219279125332832, 0.03820761665701866, 0.019357983022928238, -0.018819132819771767, 0.029748665168881416, -0.058439962565898895, 0.008662290871143341, -0.05689457803964615, 0.05262443423271179, -0.0014487986918538809, 0.03511684760451317, 0.012983269058167934, -0.030806034803390503, -0.016806064173579216, 0.01815827749669552, -0.03017568029463291, 0.01307477243244648, -0.06637022644281387, -0.014477820135653019, -0.008941884152591228, 0.030013008043169975, 0.0722670927643776, 0.007157573942095041, -0.028630295768380165, 0.01008567214012146, 0.01990700140595436, -0.003050102386623621, -0.020822033286094666, -0.00011993892258033156, -0.008153940550982952, 0.04632088914513588, 0.04900497943162918, -0.04522285237908363, -0.02580386772751808, -0.019734162837266922, -0.031578727066516876, -0.06929832696914673, 0.014599823392927647, 0.027613595128059387, -0.02730858325958252, -0.0160638727247715, -0.009414649568498135, 0.0023333283606916666, 0.01776176318526268, 0.0070508201606571674, 0.047744270414114, -0.047012247145175934, -0.027064576745033264, 0.020547524094581604, 0.023282449692487717, 0.008570787496864796, 0.007925182580947876, 0.03977333754301071, 0.01910380832850933, 0.030196014791727066, 0.024156810715794563, -0.0033322370145469904, 0.020140843465924263, 0.007193158380687237, 0.05730125680565834, 0.022692762315273285, 0.04367746785283089, 0.008342030458152294, -0.054373160004615784, 0.02003917284309864, 0.02614954486489296, -0.031131379306316376, -0.03993600979447365, -0.05421048775315285, -0.04119671881198883, 0.031985409557819366, 0.03312411159276962, -0.02405514195561409, -0.029179314151406288, -0.043799471110105515, 0.013684793375432491, -0.00444044079631567, -0.02222508005797863, 0.017660092562437057, 0.006145956460386515, 0.0003742729895748198, -0.0021223630756139755, 0.04318945109844208, 0.018930969759821892, -0.01722291111946106, 0.05189241096377373, -0.007223659195005894, 0.0071626571007072926, -0.00785909779369831, 0.007869264110922813, -0.04056636244058609, -0.009206226095557213, -0.08084804564714432, 0.0034313653595745564, 0.05648789927363396, -0.004605654627084732, 0.0365808941423893, 0.022204745560884476, 0.004343854263424873, 0.01598253659904003, 0.016663726419210434, -0.02181839942932129, 0.03698757663369179, -0.044653501361608505, -0.09426850080490112, -0.02102537266910076, -0.023445120081305504, 0.031883738934993744, -0.015016671270132065, 0.05351912975311279, 0.009135057218372822, 0.013267945498228073, 0.015199677087366581, -0.025722531601786613, -0.013888132758438587, 0.025051508098840714, 0.03227008506655693, -0.06624822318553925, -0.08548420667648315, 0.03566586598753929, -0.07470717281103134, 0.026901904493570328, 0.013135774992406368, -0.02039501816034317, -0.05864330381155014, -0.04481617361307144, 0.0031746483873575926, 0.0059934514574706554, -0.023973805829882622, -0.00007716600521234795, -0.03851262852549553, -0.009221476502716541, -0.012373249046504498, -0.052990447729825974, 0.006176457274705172, -0.0140609722584486, 0.02450248971581459, 0.010929534211754799, 0.0030755200423300266, 0.0557965412735939, -0.027064576745033264, -0.021493054926395416, 0.011692059226334095, 0.002607837552204728, 0.0010573688196018338, -0.018717462196946144, 0.04721558466553688, -0.03306310996413231, -0.037902604788541794, -0.01115320809185505, -0.02061869204044342, 0.03723158314824104, -0.0018097275169566274, 0.055633869022130966, -0.03044002316892147, 0.00801160279661417, 0.05502384901046753, 0.00387108838185668, 0.010131423361599445, -0.029443655163049698, -0.00444044079631567, -0.016389217227697372, 0.023709462955594063, -0.02379079908132553, -0.014477820135653019, -0.04477550461888313, -0.0007491814321838319, 0.04493817687034607, -0.013694959692656994, -0.005922282114624977, 0.07698458433151245, 0.02173706330358982, -0.03623521700501442, -0.018930969759821892, -0.017070407047867775, 0.07824529707431793, -0.024604160338640213, -0.0034999926574528217, 0.024868501350283623, -0.0234247874468565, 0.026088543236255646, -0.01158022228628397, -0.023770464584231377, 0.034872837364673615, 0.03521851822733879, 0.006400131620466709, 0.05730125680565834, 0.005917198956012726, 0.052909109741449356, -0.021940404549241066, 0.02297743782401085, 0.03593020513653755, 0.022570759057998657, 0.07198242098093033, -0.052095748484134674, 0.002409580862149596, 0.02293677069246769, -0.016409551724791527, -0.005907031707465649, -0.06059536710381508, -0.04855763167142868, -0.030358687043190002, -0.020313682034611702, 0.030826369300484657, -0.05486117675900459, 0.017832932993769646, -0.021310050040483475, -0.0316803976893425, 0.02865062840282917, 0.003832962131127715, -0.023058773949742317, -0.043230120092630386, 0.012454585172235966, -0.041969411075115204, -0.02757292613387108, 0.035767536610364914, -0.016938235610723495, 0.015860533341765404, -0.045670200139284134, -0.024197479709982872, 0.014335481449961662, 0.06454017013311386, 0.03588953986763954, 0.06620755791664124, -0.0705183669924736, -0.060229357331991196, -0.06360480189323425, 0.028223615139722824, -0.0276745967566967, -0.012647758238017559, -0.02151338942348957, -0.014681159518659115, 0.05189241096377373, -0.06193741410970688, -0.04089170694351196, -0.001667389296926558, -0.0379432737827301, 0.08239343762397766, -0.019449487328529358, -0.018259946256875992, -0.05510518327355385, -0.008159023709595203, 0.0010974014876410365, 0.03538118675351143, 0.0048394957557320595, 0.002765426179394126, 0.057057250291109085, -0.044246818870306015, 0.005881614051759243, 0.03538118675351143, 0.04717491939663887, -0.04117638245224953, 0.031029708683490753, 0.051526397466659546, -0.07324312627315521, 0.04262010008096695, 0.006664474029093981, -0.02307910844683647, 0.015037004835903645, 0.013308613561093807, 0.03279876708984375, -0.0339171402156353, 0.030277350917458534, -0.07800129055976868, -0.0016788272187113762, -0.046483561396598816, 0.0021922611631453037, -0.024848168715834618, -0.021228713914752007, 0.022062407806515694, -0.011498886160552502, 0.03052135929465294, 0.050631701946258545, 0.014264312572777271, -0.015169176273047924, 0.035584527999162674, 0.004214224871248007, 0.018930969759821892, 0.04811028391122818, -0.05811461806297302, -0.05128239095211029, 0.015728361904621124, -0.013542454689741135, -0.05738259479403496, -0.0020486521534621716, -0.026881569996476173, 0.03515751287341118, -0.016673892736434937, 0.032554760575294495, 0.07295845448970795, -0.029891004785895348, -0.001926648081280291, 0.04754092916846275, -0.034872837364673615, 0.00294589065015316, 0.03133472055196762, 0.022245414555072784, -0.012678259052336216, 0.02936231903731823, 0.019561324268579483, 0.005952783394604921, -0.007920099422335625, -0.07173840701580048, 0.015453852713108063, -0.009780662134289742, 0.01575886271893978, -0.0216353926807642, -0.035462524741888046, -0.04245742782950401, 0.016389217227697372, 0.03330712020397186, -0.018219279125332832, -0.02405514195561409, 0.022347083315253258, -0.0379432737827301, -0.013888132758438587, -0.02248942293226719, -0.0035228682681918144, -0.04217274859547615, -0.018046438694000244, -0.018463287502527237, 0.050713036209344864, -0.0016572222812101245, -0.012932434678077698, -0.04160339757800102, 0.015494520775973797, 0.0155046870931983, 0.007523586042225361, -0.0249905064702034, -0.029748665168881416, -0.00022129129501990974, -0.04408414661884308, 0.015169176273047924, -0.008357280865311623, 0.08056337386369705, 0.05827729031443596, 0.00008125663589453325, -0.05372247099876404, 0.028670962899923325, -0.002722216537222266, -0.0016445135697722435, 0.012739261612296104, 0.06092071160674095, -0.03029768355190754, 0.004707324784249067, 0.017731262370944023, -0.02110670879483223, -0.02637321874499321, -0.029260650277137756, 0.060310691595077515, -0.02311977744102478, 0.00252650142647326, -0.02869129739701748, 0.022021740674972534, -0.026515556499361992, 0.02289610169827938, -0.01490483433008194, -0.011976735666394234, -0.011590389534831047, -0.01695857010781765, -0.019581656903028488, 0.0155046870931983, 0.0036957075353711843, -0.063360795378685, -0.0010147944558411837, -0.0464022271335125, -0.021391386166214943, 0.020008672028779984, -0.00415068119764328, -0.004603113047778606, -0.03668256476521492, 0.01623671129345894, -0.013267945498228073, 0.05189241096377373, 0.04733759164810181, -0.09727793186903, 0.09451250731945038, -0.020740697160363197, 0.012210576795041561, -0.04485683888196945, 0.010726193897426128, 0.11492785811424255, -0.015311514027416706, -0.027654262259602547, 0.033856138586997986, 0.02950465865433216, 0.05315311998128891, -0.025986872613430023, -0.014579489827156067, 0.03153805807232857, 0.03495417535305023, 0.01601303741335869, 0.0647435113787651, 0.034344155341386795, 0.06039202958345413, -0.08015669137239456, -0.03712991252541542, -0.007920099422335625, 0.005617272108793259, 0.037190914154052734, 0.013044271618127823, 0.002821344882249832, -0.029382653534412384, -0.0034110313281416893, -0.01135654840618372, -0.02450248971581459, -0.0771879255771637, 0.028060942888259888, 0.024400819092988968, -0.042376089841127396, 0.05189241096377373, -0.06185607612133026, -0.03806527704000473, -0.062059417366981506, -0.04087137430906296, 0.015372516587376595, 0.021350717172026634, -0.008616539649665356, -0.03993600979447365, 0.045100849121809006, -0.011539554223418236, 0.10630623996257782, -0.014782830141484737, 0.02629188261926174, -0.030582360923290253, 0.017395751550793648, -0.012820597738027573, -0.010919366963207722, -0.023465454578399658, -0.026840901002287865, -0.009282478131353855, -0.053803808987140656, 0.0070406533777713776, -0.01940881833434105, 0.01690773479640484, -0.033490125089883804, -0.010197509080171585, -0.0006008066120557487, -0.012454585172235966, 0.011590389534831047, -0.004831870552152395, 0.015921534970402718, 0.0464022271335125, -0.02009000815451145, -0.029789334163069725, -0.0075693377293646336, -0.02663756161928177, 0.05494251102209091, 0.01820911094546318, 0.015047172084450722, 0.0042803105898201466, -0.059415996074676514, -0.07267377525568008, 0.047459594905376434, 0.0015987619990482926, -0.021391386166214943, 0.024970171973109245, 0.06132739409804344, -0.016084207221865654, -0.019174978137016296, -0.02307910844683647, -0.0040718866512179375, -0.01100070308893919, 0.007925182580947876, 0.08385748416185379, -0.04453149437904358, -0.037861939519643784, 0.02745092287659645, 0.0544544942677021, -0.04109504818916321, 0.06661424040794373, 0.007101655006408691, -0.08768028020858765, 0.0334697924554348, 0.005429182201623917, -0.06242543086409569, -0.06580087542533875, -0.009806079789996147, -0.05262443423271179, 0.04961499944329262, -0.018676793202757835, -0.0415017269551754, -0.033856138586997986, 0.013725461438298225, -0.03940732404589653, -0.03450682759284973, 0.05140439420938492, -0.017212744802236557, -0.012932434678077698, 0.02133038267493248, 0.03092803806066513, -0.062466099858284, 0.03151772543787956, -0.05644723027944565, 0.04404348134994507, 0.010258511640131474, -0.0007707863114774227, -0.10118206590414047, 0.004712408408522606, 0.03765859827399254, 0.006933899596333504, 0.0464022271335125, 0.01623671129345894, -0.019002137705683708, -0.013023937121033669, 0.028081277385354042, 0.018595457077026367, 0.026088543236255646, 0.04412481561303139, 0.03450682759284973, 0.011885232292115688, -0.036174215376377106, -0.031131379306316376, -0.01180389616638422, 0.09142173826694489, -0.04615821689367294, -0.1102103665471077, -0.01044151745736599, -0.005136881023645401, -0.047744270414114, 0.05360046774148941, 0.009185891598463058, 0.001625450444407761, -0.030826369300484657, -0.022550424560904503, -0.017741428688168526, 0.030419688671827316, 0.016968736425042152, 0.01647055335342884, -0.026251215487718582, 0.024380486458539963, 0.027328917756676674, -0.07824529707431793, -0.0011151937069371343, 0.023262115195393562, 0.03997667506337166, -0.011265045031905174, 0.03330712020397186, 0.03088737092912197, -0.008560621179640293, -0.003812628099694848, 0.015423351898789406, 0.03593020513653755, -0.006867813877761364, 0.011437884531915188, -0.011620890349149704, 0.032148078083992004, -0.0011641224846243858, 0.020547524094581604, -0.027694931253790855, -0.007991268299520016, 0.011295545846223831, 0.05217708647251129, -0.02905730903148651, 0.0015568231465294957, 0.04133905470371246, 0.020822033286094666, -0.037556927651166916, 0.011793729849159718, -0.008972384966909885, -0.025580191984772682, -0.0397326685488224, -0.018087107688188553, -0.004376897122710943, -0.029687663540244102, -0.08153940737247467, -0.025112509727478027, -0.057504598051309586, 0.01968332752585411, 0.039875004440546036, -0.02928098291158676, 0.05360046774148941, -0.01571819558739662, 0.007884514518082142, 0.002104570623487234, -0.05083503946661949, -0.027613595128059387, 0.03765859827399254, -0.0035025342367589474, 0.010594022460281849, 0.04477550461888313, 0.023140110075473785, -0.021432053297758102, -0.04859830066561699, 0.03247342258691788, 0.020384851843118668, 0.08027869462966919, 0.008443700149655342, 0.02842695452272892, 0.007889598608016968, 0.019805332645773888, 0.09142173826694489, -0.027389919385313988, 0.05055036395788193, 0.022347083315253258, 0.05392581224441528, -0.02320111356675625, 0.0015377600211650133, -0.025071842595934868, -0.027145911008119583, 0.027613595128059387, -0.029524991288781166, 0.006888147909194231, 0.023058773949742317, -0.04526352137327194, 0.0361335463821888, 0.010370348580181599, -0.025946205481886864, -0.03910231217741966, 0.0035381189081817865, 0.0012473647948354483, -0.013379782438278198, -0.007010152097791433, 0.01748725399374962, 0.08068537712097168, 0.036174215376377106, -0.05189241096377373, 0.03725191950798035, -0.0013725460739806294, 0.006659390404820442, 0.026169879361987114, 0.016887400299310684, 0.007864180952310562, -0.014894667081534863, -0.012210576795041561, -0.03633688762784004, 0.0540071465075016, 0.009409566409885883, -0.009867081418633461, -0.005810445174574852, 0.004547194577753544, 0.0000839572458062321, 0.040729034692049026, 0.04619888588786125, 0.05921265482902527, 0.003156855935230851, 0.028853969648480415 ]
31,940
sonetel.phonenumber
__init__
null
def __init__(self, access_token): if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_ACCOUNT}{self._accountid}' \ f'{const.API_ENDPOINT_NUMBERSUBSCRIPTION}'
(self, access_token)
[ -0.04284660890698433, -0.018001526594161987, -0.03516620397567749, 0.0409497506916523, -0.005448808893561363, 0.0031056352891027927, 0.001112310215830803, 0.02677913010120392, 0.00487231370061636, 0.021665059030056, 0.04440872371196747, 0.061220064759254456, 0.02759738080203533, -0.010153753682971, -0.011436919681727886, 0.02640719711780548, 0.08227143436670303, 0.0012169161345809698, 0.050880346447229385, -0.003796034725382924, -0.046751897782087326, 0.00867532193660736, -0.029326865449547768, 0.03101915866136551, 0.0006032278179191053, 0.08041177690029144, -0.012469031848013401, 0.029010724276304245, 0.017118187621235847, -0.03710025176405907, 0.027244044467806816, 0.03518480062484741, 0.020642245188355446, 0.10034734755754471, 0.04611961171030998, -0.05229368805885315, -0.02216716855764389, -0.016318531706929207, -0.18388335406780243, 0.05790986865758896, 0.04147045686841011, 0.004844418726861477, 0.058058641850948334, -0.007127153687179089, 0.0543765090405941, 0.025384383276104927, -0.025849299505352974, 0.04768172651529312, -0.02285524271428585, -0.013612723909318447, -0.028638791292905807, 0.02729983441531658, -0.060624975711107254, -0.023282965645194054, -0.05712880939245224, 0.08636268973350525, 0.02413840964436531, 0.06237305700778961, -0.029791781678795815, 0.033436719328165054, -0.05850496143102646, -0.02207418531179428, 0.0222601518034935, -0.011316042393445969, 0.028043700382113457, 0.020623648539185524, -0.07513033598661423, 0.03349250927567482, 0.007601367775350809, 0.049504198133945465, 0.11663798987865448, 0.04403679072856903, -0.07014644145965576, -0.02040049061179161, 0.03273004665970802, 0.024845082312822342, -0.05634775385260582, 0.021813832223415375, -0.0421399362385273, 0.003126556286588311, 0.03204197436571121, -0.03470128774642944, -0.005671968217939138, -0.0008141831494867802, 0.027839137241244316, -0.0015504930634051561, -0.02995915152132511, -0.10168630629777908, -0.042809415608644485, 0.07684122771024704, -0.04559890553355217, 0.02028891071677208, -0.04853717237710953, -0.038383420556783676, 0.016578884795308113, -0.023952443152666092, -0.027244044467806816, -0.055008795112371445, -0.023859459906816483, -0.0014098561368882656, 0.00030335731571540236, -0.06192673742771149, -0.053930193185806274, -0.003465944668278098, 0.026072457432746887, -0.032562676817178726, 0.027058079838752747, -0.05221930146217346, 0.029029320925474167, -0.012152889743447304, 0.003368312492966652, 0.028694581240415573, 0.005578985437750816, 0.034031812101602554, -0.06999766826629639, 0.015509579330682755, 0.00006712216418236494, -0.009939892217516899, 0.014858697541058064, -0.026239827275276184, 0.062001124024391174, -0.004988542757928371, 0.004716567229479551, 0.07691561430692673, 0.04373924434185028, 0.03548234701156616, -0.028899144381284714, -0.009437783621251583, 0.05597582086920738, -0.10481053590774536, 0.033157769590616226, 0.012152889743447304, 0.01338956505060196, -0.05095473304390907, -0.033845845609903336, -0.0003998272877652198, 0.02739281766116619, 0.01295254472643137, -0.0519961416721344, 0.011836747638881207, -0.014272904023528099, 0.005695214029401541, -0.0034822167363017797, -0.011734466068446636, 0.0016295285895466805, 0.011836747638881207, -0.008363828994333744, 0.009586556814610958, 0.022018395364284515, -0.015825722366571426, 0.013212896883487701, 0.0064623248763382435, 0.06133164465427399, -0.016690464690327644, -0.04217712953686714, -0.05281439423561096, 0.006834256928414106, 0.011492709629237652, 0.03198618441820145, 0.014310097321867943, 0.009902698919177055, 0.007503735367208719, -0.011502007953822613, -0.030591435730457306, -0.00148889166302979, -0.011780957691371441, 0.0421399362385273, -0.06824959069490433, -0.029717395082116127, -0.03252548351883888, 0.025644736364483833, -0.062112703919410706, -0.05564108118414879, -0.028787564486265182, -0.0439252108335495, -0.02168365567922592, 0.028620194643735886, 0.012357452884316444, -0.007838474586606026, 0.0005631288513541222, 0.034533917903900146, -0.01511905062943697, -0.02776475064456463, -0.00921462383121252, 0.017685383558273315, 0.010544282384216785, 0.0009792281780391932, 0.055417921394109726, 0.028285454958677292, 0.0427350290119648, 0.007559525314718485, -0.00024073902750387788, 0.024064023047685623, -0.03559392690658569, -0.013594127260148525, -0.028341244906187057, 0.01373360212892294, -0.040838174521923065, -0.04537574574351311, 0.07397734373807907, -0.03760236129164696, 0.0339016355574131, 0.00012066008639521897, -0.023096999153494835, 0.07691561430692673, 0.005118718836456537, 0.007122504524886608, -0.02168365567922592, -0.0013505793176591396, -0.011976221576333046, -0.038067277520895004, 0.0014749442925676703, 0.02668614685535431, 0.03589147329330444, -0.04016869515180588, 0.01830836944282055, -0.0043190643191337585, -0.012534120120108128, 0.04474346339702606, 0.0035682260058820248, 0.10027296096086502, -0.04399959743022919, 0.008094177581369877, -0.09588415920734406, 0.005495300516486168, 0.03563112020492554, 0.047830499708652496, -0.03239530697464943, -0.09075149148702621, 0.007824527099728584, -0.01113007590174675, -0.03990834206342697, 0.019954171031713486, 0.006146182306110859, -0.02677913010120392, -0.05035964027047157, 0.028229665011167526, -0.027857733890414238, -0.025384383276104927, 0.003175372490659356, 0.04106133058667183, 0.011009197682142258, -0.01536080613732338, 0.03897850960493088, -0.02471490576863289, 0.015444491058588028, -0.08569321781396866, 0.05839338153600693, -0.030758805572986603, -0.028434228152036667, -0.00047072689631022513, -0.03938763588666916, -0.06977450847625732, -0.013185001909732819, -0.014337992295622826, -0.04913226515054703, -0.030089328065514565, 0.0013250090414658189, 0.006346095819026232, -0.005155912134796381, -0.01567694917321205, -0.007996546104550362, -0.041321683675050735, 0.021032774820923805, -0.0011448542354628444, -0.011111479252576828, -0.011641482822597027, 0.003298575058579445, 0.02709527313709259, 0.005848636385053396, 0.10979443043470383, 0.019377674907445908, 0.038941316306591034, 0.03812306746840477, -0.024082619696855545, -0.019173113629221916, -0.0027453256770968437, 0.006373990792781115, -0.07594858855009079, -0.04351608455181122, 0.02443595603108406, -0.04611961171030998, 0.034031812101602554, 0.04243748262524605, 0.012106398120522499, -0.022706469520926476, 0.04905787855386734, -0.001645800657570362, -0.00524424621835351, 0.007708298042416573, 0.025886492803692818, 0.007122504524886608, -0.004056387115269899, 0.043776437640190125, -0.0029266427736729383, -0.0289735309779644, 0.007908212020993233, 0.040652208030223846, 0.008103475905954838, 0.040615014731884, 0.002068873727694154, 0.024287182837724686, -0.02056785859167576, 0.015714142471551895, 0.023692091926932335, -0.029419848695397377, 0.05504598841071129, 0.04288380220532417, 0.009716732427477837, 0.01713678427040577, 0.0166532713919878, 0.041805196553468704, -0.02365489862859249, 0.005086175166070461, 0.011939028277993202, -0.0028243614360690117, 0.014654135331511497, -0.014607643708586693, 0.01187394093722105, 0.041916776448488235, -0.018949953839182854, -0.0007124828989617527, 0.029140900820493698, -0.008494005538523197, 0.05114069953560829, 0.03589147329330444, -0.005899777170270681, 0.04433433711528778, -0.03803008422255516, 0.011176567524671555, -0.07539068907499313, 0.02069803513586521, -0.03682130202651024, -0.05300036072731018, -0.03291601315140724, -0.025663333013653755, -0.03732341155409813, -0.013036228716373444, -0.011418323032557964, -0.007094609551131725, -0.02067943848669529, -0.02610965073108673, 0.000174343294929713, 0.059248823672533035, -0.039945535361766815, -0.03656094893813133, 0.0023757179733365774, -0.05586424097418785, -0.0032474345061928034, -0.06977450847625732, -0.08375916630029678, 0.011687974445521832, 0.07751069962978363, 0.04187958315014839, 0.08762726187705994, -0.01113937422633171, -0.034329354763031006, 0.022706469520926476, -0.009977085515856743, -0.002924318192526698, 0.0006991166155785322, 0.0013343073660507798, -0.02817387692630291, 0.0050489818677306175, -0.023487528786063194, -0.021553480997681618, -0.023208579048514366, -0.024082619696855545, 0.022408924996852875, -0.03710025176405907, -0.02590508945286274, -0.049504198133945465, -0.019879784435033798, 0.012580611743032932, 0.05411615967750549, 0.012543418444693089, -0.04701225087046623, -0.002631421433761716, -0.029996344819664955, 0.006401885766535997, 0.011929729953408241, 0.019619431346654892, 0.058839697390794754, 0.054041773080825806, -0.0044073984026908875, -0.01822468638420105, -0.040838174521923065, 0.006834256928414106, 0.062112703919410706, 0.05772390216588974, -0.0021327997092157602, 0.012515523470938206, -0.0237478818744421, 0.000522739312145859, -0.0382346473634243, -0.044780656695365906, -0.02867598459124565, -0.031465478241443634, -0.0009542389307171106, 0.020251717418432236, 0.02335735224187374, 0.02019592747092247, -0.004549197852611542, 0.01471922267228365, 0.059434790164232254, -0.02432437613606453, 0.06214989721775055, 0.003923886455595493, 0.012887456454336643, -0.03170723468065262, -0.04730979725718498, -0.08948692679405212, -0.03853219375014305, 0.008098826743662357, 0.001829442335292697, -0.03842061385512352, -0.03691428527235985, 0.014663432724773884, -0.008494005538523197, -0.005128017161041498, 0.021144354715943336, 0.011483411304652691, 0.027430010959506035, -0.03927605599164963, -0.05486002191901207, 0.015351507812738419, -0.0022490285336971283, -0.0008333609439432621, 0.034310758113861084, -0.032060571014881134, 0.012720086611807346, 0.049690164625644684, -0.055120375007390976, 0.00014194450341165066, 0.02904791757464409, 0.015035365708172321, -0.034124795347452164, 0.010330420918762684, -0.022911032661795616, -0.02915949746966362, 0.0007188754971139133, -0.018261877819895744, 0.03957360237836838, 0.005648722872138023, 0.03477567434310913, -0.007447945419698954, -0.036988671869039536, -0.021237337961792946, 0.03113073855638504, -0.0627821832895279, -0.021497691050171852, 0.02313419245183468, -0.002369906520470977, -0.032339517027139664, -0.0693281888961792, -0.062112703919410706, -0.007392155472189188, 0.014310097321867943, 0.020233120769262314, 0.0061601297929883, -0.011790256015956402, -0.012589910067617893, -0.0573519691824913, -0.01890346221625805, 0.036300599575042725, 0.045078203082084656, 0.0732334777712822, 0.027132464572787285, -0.019191710278391838, -0.010972004383802414, -0.032339517027139664, 0.015639755874872208, -0.026555970311164856, 0.026462987065315247, -0.004660777281969786, 0.0032497588545084, -0.007182943634688854, -0.019842591136693954, -0.020437683910131454, 0.0016876431182026863, -0.002089794958010316, 0.06069936230778694, 0.007006275933235884, 0.028583001345396042, -0.010739547200500965, -0.01364991720765829, -0.03349250927567482, 0.017294853925704956, 0.006718028336763382, -0.006267060060054064, 0.0030056782998144627, 0.03801148757338524, -0.057389162480831146, 0.03998272866010666, -0.032153550535440445, 0.038457807153463364, -0.050582800060510635, 0.036393582820892334, 0.0344967246055603, 0.0037286218721419573, -0.014347290620207787, -0.0045561715960502625, 0.013026930391788483, 0.008893832564353943, 0.01059077400714159, 0.043478891253471375, -0.09804137051105499, 0.05400457978248596, 0.012775876559317112, -0.03912728279829025, 0.007099258713424206, 0.017908543348312378, 0.0024896222166717052, 0.015444491058588028, 0.029680201783776283, 0.016904326155781746, -0.05348387360572815, 0.02382226660847664, -0.032562676817178726, 0.006206621415913105, 0.02099558152258396, 0.02739281766116619, 0.018550125882029533, -0.004512004554271698, 0.014635538682341576, -0.024807889014482498, 0.025068240240216255, -0.008401022292673588, -0.007805930450558662, 0.04087536782026291, -0.021516287699341774, -0.024975256994366646, -0.027132464572787285, 0.023524722084403038, 0.025458769872784615, 0.05575266107916832, -0.06616676598787308, -0.048797525465488434, 0.04217712953686714, 0.03812306746840477, -0.023989636451005936, 0.001935210544615984, -0.009516819380223751, -0.06296814978122711, -0.09893400967121124, -0.037286218255758286, -0.015881512314081192, 0.047607339918613434, 0.019916977733373642, -0.0042586256749928, 0.08814796805381775, -0.030368277803063393, 0.016606779769062996, 0.017471522092819214, -0.026872113347053528, 0.028638791292905807, -0.027504397556185722, -0.04366485774517059, 0.026555970311164856, 0.018085211515426636, -0.005355826113373041, 0.020902598276734352, -0.04589645192027092, 0.018847672268748283, -0.010339719243347645, -0.009521468542516232, -0.004098229575902224, -0.00524889538064599, -0.01861521415412426, 0.031577058136463165, 0.01320359855890274, -0.06512535363435745, -0.0344967246055603, 0.06203831732273102, -0.03053564578294754, 0.008247599937021732, 0.013036228716373444, 0.0030823894776403904, 0.07062995433807373, 0.009595855139195919, 0.04414837062358856, 0.004765383433550596, 0.0038378769531846046, -0.04745857045054436, -0.003570550587028265, -0.011976221576333046, -0.009228571318089962, -0.04195396974682808, 0.05750074237585068, -0.05861654132604599, -0.040838174521923065, -0.04228870943188667, -0.003570550587028265, 0.009763224050402641, -0.04403679072856903, 0.017964333295822144, -0.01625344343483448, -0.07044398784637451, -0.02216716855764389, -0.015509579330682755, 0.023004015907645226, 0.08532128483057022, -0.024287182837724686, 0.002332713222131133, 0.008735761046409607, 0.010079367086291313, -0.02540297992527485, 0.00257098232395947, -0.03656094893813133, 0.00046811174252070487, 0.0366167388856411, 0.04325573146343231, -0.023468932136893272, -0.003744893940165639, -0.011092882603406906, 0.01584431901574135, -0.08108125627040863, 0.06029023602604866, -0.018782583996653557, 0.027708960697054863, 0.03559392690658569, 0.020642245188355446, -0.05132666602730751, 0.10659581422805786, -0.07684122771024704, 0.04455749690532684, 0.09506591409444809, -0.07899843156337738, -0.07937036454677582, 0.02019592747092247, 0.0231527891010046, 0.0032497588545084, -0.01724836230278015, -0.01683923788368702, -0.006662238389253616, 0.020251717418432236, 0.025272803381085396, 0.039164476096630096, 0.06107129156589508, 0.04284660890698433, -0.012199381366372108, 0.0020456279162317514, -0.01911732368171215, 0.015704844146966934, -0.028806161135435104, 0.03842061385512352, -0.07312189787626266, -0.053037554025650024, -0.0294384453445673, 0.006406534928828478, -0.02562613971531391, 0.04288380220532417, 0.03656094893813133, 0.02490087039768696, -0.048499979078769684, -0.01123235747218132, -0.008545146323740482, 0.013082720339298248, 0.029326865449547768, 0.021516287699341774, 0.007694350555539131, -0.03834622725844383, 0.008624181151390076, -0.0002904268621932715, -0.03397602215409279, -0.012124994769692421, 0.04422275722026825, -0.045636098831892014, -0.05545511469244957, 0.04678909108042717, 0.006025304086506367, 0.01084182783961296, -0.004047088790684938, 0.004946700297296047, 0.04455749690532684, -0.00568591570481658, -0.00994919054210186, -0.034310758113861084, 0.04031746834516525, 0.052740007638931274, 0.017099590972065926, 0.012720086611807346, 0.03200478106737137, -0.00841496977955103, -0.050880346447229385, 0.047049444168806076, -0.019638027995824814, 0.024603325873613358, -0.02335735224187374, -0.028731774538755417, 0.022911032661795616, -0.017796963453292847, -0.06475342065095901, -0.05184737220406532, -0.02266927808523178, 0.012422541156411171, -0.047830499708652496, -0.04838839918375015, 0.01133463904261589, 0.0030661174096167088, 0.01969381794333458, -0.014654135331511497, 0.032265130430459976, 0.010999899357557297, -0.048128046095371246, -0.0008850827580317855, 0.007257330231368542, -0.04262344911694527, 0.005713810678571463, -0.013361670076847076, 0.024194199591875076, 0.01712748594582081, 0.0026058510411530733, -0.01147411298006773, -0.008805498480796814, 0.02129312790930271, 0.011976221576333046, 0.03656094893813133, -0.040131501853466034, 0.0031474775169044733, 0.003331119194626808, -0.03349250927567482, 0.01555607095360756, 0.028899144381284714, 0.0723036527633667, 0.001123351976275444, 0.03392023220658302, 0.01941486820578575, 0.05843057483434677, -0.03617042303085327, 0.009363397024571896, 0.03252548351883888, -0.026574566960334778, 0.024491745978593826, 0.013361670076847076, -0.03367847576737404, -0.03693288192152977, 0.007768737152218819, 0.05921163037419319, 0.08948692679405212, 0.015035365708172321, -0.01626274175941944, 0.014709924347698689, -0.012041309848427773, -0.006838906090706587, 0.07937036454677582, -0.011009197682142258, -0.05095473304390907, 0.04344169795513153, 0.05221930146217346, 0.005923022981733084, 0.016485901549458504, -0.005007139407098293, 0.011725167743861675, -0.01319430023431778, -0.011715869419276714, -0.0480908527970314, 0.010376912541687489, -0.014970277436077595, -0.030591435730457306, -0.01722046732902527, 0.0007537441560998559, 0.014161324128508568, -0.028118086978793144, 0.008828744292259216, 0.10198385268449783, 0.04470627009868622, -0.012376049533486366 ]
31,941
sonetel.phonenumber
add
Buy a phone number that is available. Numbers that are available for purchase can be checked from the ``/availablephonenumber`` API endpoint. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :param number: the phone number you want to purchase. :return: Dict containing the success response or an error message.
def add(self, number: str) -> dict: """ Buy a phone number that is available. Numbers that are available for purchase can be checked from the ``/availablephonenumber`` API endpoint. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :param number: the phone number you want to purchase. :return: Dict containing the success response or an error message. """ if not isinstance(number, str): number = str(number) # Request body if is_e164(number): body = { "phnum": number } else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) return util.send_api_request( token=self._token, uri=self._url, method='post', body=dumps(body) )
(self, number: str) -> dict
[ -0.0005361203802749515, 0.015876611694693565, -0.018925761803984642, 0.018417570739984512, -0.023814916610717773, -0.010207644663751125, -0.0637868270277977, -0.021133767440915108, -0.015315848402678967, -0.0813106819987297, 0.02966788411140442, 0.00982211995869875, 0.04563211277127266, 0.005633919034153223, 0.0018432902870699763, -0.010768407955765724, 0.059756338596343994, -0.01832995004951954, 0.013388223946094513, -0.03182331845164299, 0.012722318060696125, 0.03827209770679474, 0.04465077817440033, 0.09315680712461472, -0.008196782320737839, 0.09582043439149857, 0.016393564641475677, 0.04997802898287773, -0.0131078427657485, -0.014045368880033493, -0.00009145260992227122, -0.05541042611002922, 0.017550138756632805, 0.019276238977909088, -0.0027271497529000044, 0.03573113679885864, -0.028458738699555397, -0.022763485088944435, -0.07107675075531006, 0.030894553288817406, 0.019118525087833405, 0.020608052611351013, 0.037991713732481, 0.055130042135715485, 0.0038946764543652534, 0.04980279132723808, -0.03827209770679474, 0.04847097769379616, -0.002451149048283696, 0.0176027100533247, 0.02220272272825241, 0.013055270537734032, 0.01523699052631855, -0.06014186516404152, -0.04741954803466797, -0.0034784849267452955, 0.01723470911383629, 0.02078329026699066, 0.031437791883945465, 0.024340633302927017, -0.00190900475718081, 0.041531533002853394, -0.059721291065216064, -0.05747823789715767, 0.025321967899799347, 0.05719785764813423, -0.005980014801025391, 0.002468672813847661, 0.04882145673036575, 0.03336541727185249, 0.07458151876926422, -0.04622792452573776, -0.035082753747701645, 0.004534297157078981, 0.05947595834732056, 0.01753261499106884, 0.012056411243975163, 0.04468582570552826, -0.016393564641475677, 0.007513352204114199, 0.028493786230683327, -0.00859983079135418, 0.027459878474473953, 0.020327670499682426, -0.0251467302441597, 0.043143726885318756, 0.0360991396009922, 0.008205544203519821, -0.043143726885318756, 0.020765766501426697, -0.04819059744477272, -0.04727935791015625, -0.042267534881830215, -0.00909487996250391, 0.06701121479272842, -0.0850958302617073, 0.05453423038125038, -0.025129206478595734, -0.01407165452837944, 0.013151652179658413, -0.012722318060696125, 0.04517649486660957, -0.041531533002853394, -0.04819059744477272, 0.06333120912313461, -0.04188200831413269, -0.018417570739984512, 0.01709451898932457, 0.030088456347584724, 0.017523853108286858, 0.0007776209968142211, -0.04791021719574928, -0.027617592364549637, -0.04570221155881882, -0.012100220657885075, 0.025339491665363312, 0.059756338596343994, 0.051379937678575516, -0.022255294024944305, 0.007456399500370026, 0.0398842915892601, -0.011364218778908253, -0.0016253374051302671, -0.008608592674136162, 0.026706352829933167, -0.021624434739351273, -0.010812217369675636, -0.00024150060198735446, 0.08103030174970627, -0.1052132174372673, 0.008512211963534355, -0.026513589546084404, 0.043213821947574615, 0.03583627939224243, -0.06185920163989067, 0.05078412592411041, -0.03033379092812538, -0.007250494323670864, -0.0013843844644725323, 0.03939362242817879, -0.00481029786169529, -0.003993248101323843, 0.012292983010411263, -0.027091877534985542, 0.00002549857526901178, 0.02267586626112461, -0.0823621079325676, -0.006006300915032625, -0.0543239451944828, -0.02193986438214779, -0.011478124186396599, 0.0440199188888073, 0.10794693976640701, 0.008718117140233517, -0.018207283690571785, 0.008223067969083786, 0.059546053409576416, 0.003125817282125354, -0.028493786230683327, 0.012433174066245556, 0.042267534881830215, 0.0700603649020195, 0.057758621871471405, -0.017848044633865356, -0.01629718393087387, -0.019959669560194016, -0.04633306711912155, -0.002992197871208191, 0.013563462533056736, 0.019731858745217323, -0.02416539378464222, -0.023499486967921257, -0.011206503957509995, 0.0043305824510753155, 0.004639440216124058, -0.04181191325187683, 0.03492503985762596, -0.025269396603107452, -0.009270118549466133, -0.015096799470484257, 0.021081196144223213, 0.018400046974420547, 0.012100220657885075, 0.053307563066482544, 0.018382523208856583, -0.01643737405538559, 0.008591068908572197, 0.017147090286016464, -0.010926122777163982, -0.0035222945734858513, 0.09098384529352188, 0.05351784825325012, 0.02318405732512474, 0.01290631853044033, -0.03473227843642235, -0.015876611694693565, 0.023481963202357292, -0.016577566042542458, -0.07969848811626434, -0.013598510064184666, -0.02085338532924652, 0.002527815755456686, 0.004678868688642979, 0.0002153517270926386, -0.00812668725848198, -0.0668710246682167, -0.013440795242786407, -0.007561542559415102, 0.012292983010411263, -0.01520194299519062, 0.04188200831413269, 0.006291063502430916, -0.011145170778036118, 0.08446497470140457, -0.009699452668428421, -0.024918919429183006, -0.00916497502475977, -0.016533756628632545, 0.027091877534985542, -0.013800034299492836, -0.0136686060577631, -0.012056411243975163, 0.03348808363080025, -0.050363555550575256, 0.03431170433759689, 0.037886571139097214, 0.009287642315030098, 0.0440199188888073, 0.00755278067663312, 0.011004979722201824, -0.007342494558542967, 0.02898445352911949, -0.014860227704048157, -0.0029396263416856527, -0.08039943873882294, -0.08874079585075378, -0.020134907215833664, -0.0455620177090168, 0.024112822487950325, -0.020748242735862732, 0.07801619917154312, 0.029843121767044067, -0.005796014331281185, 0.03606409206986427, -0.028371118009090424, 0.0021707674022763968, 0.017322329804301262, 0.062209680676460266, -0.049417268484830856, -0.0552702322602272, 0.014132987707853317, -0.06157882139086723, 0.042162392288446426, 0.022886153310537338, -0.0048497263342142105, -0.02008233591914177, -0.012100220657885075, -0.02814330905675888, 0.0205905269831419, -0.010619455017149448, 0.010076215490698814, -0.0041882009245455265, -0.0068693505600094795, -0.019924622029066086, -0.06434758752584457, -0.005673347506672144, -0.016595089808106422, 0.025392062962055206, 0.001476384699344635, -0.018470142036676407, 0.023376820608973503, -0.0489966943860054, 0.01829490251839161, -0.011329171247780323, 0.018417570739984512, -0.029001977294683456, -0.014413369819521904, 0.06999026983976364, -0.014325750060379505, -0.01943395286798477, -0.008661164902150631, 0.001994433579966426, 0.03222636505961418, 0.0004438463656697422, -0.011232790537178516, 0.008446497842669487, 0.0040808673948049545, 0.06091291457414627, 0.02048538438975811, -0.014474702998995781, -0.0618942491710186, 0.02369225025177002, -0.010181359015405178, 0.04545687511563301, -0.001935290521942079, -0.003331722691655159, -0.007136589381843805, 0.013037746772170067, 0.054954804480075836, 0.02831854671239853, 0.010969932191073895, 0.07556285709142685, -0.004494868218898773, -0.06038719788193703, -0.06203444302082062, -0.02004728838801384, 0.07486189901828766, -0.010181359015405178, -0.10353092849254608, 0.0014260035241022706, -0.01764652132987976, 0.05463937669992447, 0.0015070514054968953, -0.01997719332575798, 0.04090067371726036, 0.05369308590888977, 0.005682109389454126, 0.02237796038389206, -0.02311396226286888, 0.01607813499867916, 0.010067453607916832, -0.004113724455237389, 0.01022516842931509, -0.01808461733162403, 0.046963926404714584, -0.0364496149122715, -0.011539457365870476, -0.02460348978638649, -0.007324970792979002, 0.0001110300436266698, -0.05442908778786659, -0.033961229026317596, -0.009419071488082409, 0.023517010733485222, -0.009454119019210339, -0.03254179656505585, 0.03648466244339943, 0.005857347976416349, -0.06115824729204178, 0.047840118408203125, -0.01876804791390896, -0.007408209145069122, -0.038552477955818176, 0.019521573558449745, -0.027021782472729683, -0.045807354152202606, -0.02372729778289795, -0.0333128459751606, 0.02689911425113678, -0.047034021466970444, -0.05127479508519173, -0.008954688906669617, 0.03844733536243439, 0.025602350011467934, 0.05618147552013397, -0.042477820068597794, -0.04209229722619057, -0.01694556698203087, 0.022921200841665268, -0.02409529872238636, 0.006777350325137377, -0.03578370809555054, -0.03199855610728264, 0.034907516092061996, -0.06992017477750778, -0.03226141259074211, 0.027459878474473953, 0.002643911400809884, 0.06746683269739151, -0.014860227704048157, 0.03634447231888771, -0.05488470941781998, -0.004770868923515081, 0.09841395914554596, 0.0196442399173975, 0.0030360075179487467, 0.015420990996062756, 0.031367696821689606, -0.043669443577528, -0.0009019308490678668, 0.00002010793650697451, 0.026338351890444756, -0.04482601583003998, -0.008902117609977722, 0.09084365516901016, -0.0537281334400177, 0.046087734401226044, -0.0008515497320331633, -0.03380351513624191, -0.0005875967326574028, 0.012038887478411198, 0.03220884129405022, 0.0012485745828598738, 0.05982643738389015, -0.06315597146749496, -0.020432813093066216, -0.04815554991364479, -0.03616923466324806, -0.06084281951189041, 0.013913939706981182, 0.03851743042469025, -0.04033990949392319, -0.038762763142585754, 0.03387361019849777, 0.007907639257609844, -0.010172597132623196, -0.04440544545650482, -0.008271259255707264, 0.02810826152563095, 0.00852973572909832, -0.033295322209596634, -0.054148707538843155, 0.015648800879716873, -0.055936139076948166, -0.08944174647331238, 0.006072015035897493, -0.024743681773543358, -0.0014730988768860698, -0.04345915839076042, 0.003055721987038851, 0.09785319864749908, -0.02791549824178219, -0.06031710281968117, 0.07766571640968323, -0.016752803698182106, 0.003866200102493167, 0.022868629544973373, 0.03199855610728264, 0.023201581090688705, -0.0004583582922350615, -0.013230509124696255, -0.003918771632015705, 0.010006120428442955, -0.05162527412176132, 0.011548219248652458, -0.023341773077845573, -0.01160955335944891, -0.042407725006341934, -0.031910937279462814, -0.0278103556483984, -0.013055270537734032, 0.007614114321768284, -0.04041000455617905, -0.012389364652335644, 0.00807411503046751, -0.06942950934171677, 0.0032922939863055944, -0.060457292944192886, 0.022956248372793198, -0.05274679884314537, 0.04174181818962097, -0.029860645532608032, 0.07584323734045029, 0.02038024179637432, 0.05250146612524986, -0.020467860624194145, -0.012494507245719433, -0.023779869079589844, 0.0033339131623506546, -0.027862926945090294, -0.07111179828643799, 0.0011740982299670577, -0.030088456347584724, 0.05730300024151802, -0.000394560513086617, 0.08411449939012527, 0.011627077125012875, 0.006203444208949804, -0.016235850751399994, 0.026215685531497, -0.024866348132491112, 0.0016932423459365964, 0.012967651709914207, 0.043669443577528, -0.017103280872106552, -0.014001558534801006, 0.019381381571292877, -0.02467358484864235, -0.004067724570631981, -0.03655475750565529, 0.07773581147193909, -0.03340046480298042, -0.0166564229875803, 0.017699092626571655, 0.0271619725972414, 0.02456844225525856, 0.02372729778289795, -0.014185559004545212, 0.012590888887643814, 0.037711333483457565, -0.013432033360004425, -0.014737560413777828, 0.04104086384177208, 0.021238910034298897, -0.022518152371048927, 0.010645740665495396, -0.0442652553319931, -0.028931882232427597, -0.008170496672391891, -0.01486898958683014, -0.006203444208949804, -0.007048970088362694, 0.007193542085587978, -0.024656061083078384, 0.0191710963845253, 0.03157798573374748, -0.07654419541358948, 0.10191873461008072, -0.015096799470484257, 0.05246641859412193, -0.04892659932374954, 0.005944967269897461, 0.05982643738389015, -0.00829316396266222, 0.012170316651463509, 0.06182415410876274, 0.041391342878341675, 0.019731858745217323, -0.05744319036602974, -0.0026417209301143885, 0.033593226224184036, 0.07710495591163635, 0.03219131752848625, 0.012389364652335644, 0.037781428545713425, 0.04573725908994675, -0.07563295215368271, -0.0440199188888073, -0.009401547722518444, 0.026636257767677307, 0.045071352273225784, 0.028809215873479843, -0.012748603709042072, -0.019784430041909218, -0.008017162792384624, -0.009278880432248116, 0.03247170150279999, -0.03844733536243439, 0.008626116439700127, -0.038692668080329895, -0.020134907215833664, 0.02274596132338047, -0.029334930703043938, -0.032681986689567566, -0.054113660007715225, -0.0046350592747330666, 0.017453758046030998, -0.02625073306262493, -0.011924982070922852, -0.034031324088573456, 0.011548219248652458, -0.010304026305675507, 0.07072627544403076, 0.015692610293626785, 0.04345915839076042, -0.035993993282318115, 0.0417768657207489, -0.009270118549466133, -0.027319688349962234, -0.019591668620705605, -0.03827209770679474, -0.015604991465806961, -0.03185836598277092, 0.03602904453873634, -0.03439932316541672, -0.009892215020954609, -0.06606492400169373, -0.016577566042542458, 0.0575132854282856, -0.05288698896765709, 0.02919474057853222, 0.011478124186396599, 0.020240051671862602, 0.03036883845925331, -0.04724431037902832, -0.05803900212049484, -0.03480237349867821, -0.034171514213085175, -0.00117300299461931, 0.01135545689612627, -0.04931212216615677, 0.020678147673606873, -0.08138077706098557, -0.03220884129405022, 0.018067093566060066, -0.008477164432406425, -0.029773026704788208, -0.00359458033926785, 0.010873551480472088, 0.004150962922722101, 0.011302885599434376, -0.08418459445238113, 0.024691110476851463, 0.02493644319474697, 0.017777949571609497, 0.03469723090529442, -0.01578023098409176, -0.036800093948841095, 0.00004538404391496442, 0.04486106336116791, -0.000549263262655586, 0.06277044117450714, 0.010041167959570885, -0.04885650426149368, 0.043354012072086334, 0.028633976355195045, -0.07605352252721786, -0.049557458609342575, -0.03138522058725357, -0.09434843063354492, 0.043143726885318756, -0.03261189162731171, -0.05565575882792473, -0.009462880901992321, 0.0051432508043944836, -0.023008819669485092, -0.021414149552583694, 0.01971433497965336, -0.003603342454880476, 0.0256198737770319, 0.0027381021063774824, -0.0057609668001532555, -0.038797810673713684, 0.04286334663629532, -0.019889574497938156, -0.015578705817461014, 0.00452991621568799, 0.0015661944635212421, -0.08369392156600952, -0.029212264344096184, -0.013064032420516014, 0.029212264344096184, 0.06157882139086723, -0.022080054506659508, -0.0011116694658994675, 0.00859983079135418, 0.017550138756632805, 0.04209229722619057, 0.01825985498726368, 0.03483742102980614, -0.005673347506672144, 0.04167172312736511, -0.058669861406087875, -0.04640316218137741, 0.02996578998863697, 0.10794693976640701, -0.062384918332099915, -0.10226920992136002, -0.00504686962813139, -0.034066371619701385, 0.008017162792384624, 0.012801175005733967, 0.0035003896337002516, 0.018242331221699715, 0.03890295326709747, -0.030631696805357933, -0.019661763682961464, 0.0521860346198082, -0.020573003217577934, 0.02018747851252556, -0.009357737377285957, 0.0056076329201459885, 0.020537955686450005, -0.06858836114406586, -0.002521244343370199, 0.02048538438975811, 0.028931882232427597, -0.06641540676355362, 0.01709451898932457, 0.018803095445036888, 0.00329448445700109, -0.01801452226936817, 0.003171817399561405, 0.023026343435049057, 0.02216767519712448, 0.022623294964432716, -0.043389059603214264, 0.03432922810316086, 0.014325750060379505, 0.005401727743446827, -0.02537453919649124, -0.03199855610728264, 0.04997802898287773, -0.007421351969242096, -0.023639678955078125, 0.014290702529251575, 0.020240051671862602, 0.04896164685487747, -0.043389059603214264, -0.015429752878844738, 0.0163322314620018, -0.052256129682064056, -0.04016467183828354, 0.026110541075468063, 0.0037873429246246815, 0.030999697744846344, -0.05092431977391243, -0.01231926865875721, -0.03602904453873634, -0.01245069783180952, 0.039288479834795, 0.012135268189013004, 0.055165089666843414, -0.018925761803984642, 0.008336973376572132, -0.015131847932934761, -0.05618147552013397, -0.0018082426395267248, 0.02835359424352646, -0.040480103343725204, -0.013537176884710789, 0.019293762743473053, -0.005051250569522381, 0.0171295665204525, -0.03981419652700424, 0.011425552889704704, 0.011854887008666992, 0.08902117609977722, -0.011381742544472218, 0.01197755429893732, -0.0043064868077635765, 0.014588608406484127, 0.09476900100708008, -0.04847097769379616, 0.04829574003815651, 0.004356868099421263, 0.05937081575393677, -0.07451142370700836, 0.008542878553271294, -0.01811966486275196, -0.04268810525536537, 0.01427317876368761, -0.007841924205422401, 0.0030031504575163126, -0.025654921308159828, -0.012073935009539127, 0.0069525889120996, 0.019924622029066086, 0.007951448671519756, -0.04664849862456322, -0.0003225484397262335, 0.027389783412218094, 0.037851523607969284, -0.03240160644054413, 0.018277378752827644, 0.051450032740831375, -0.0026570542249828577, -0.055235184729099274, 0.015420990996062756, 0.024480823427438736, 0.009313927963376045, 0.03350560739636421, 0.03290979564189911, 0.03830714523792267, 0.01071583665907383, 0.0018640998750925064, 0.0068693505600094795, 0.04731440544128418, 0.04657840356230736, -0.02399015612900257, -0.041216105222702026, -0.014457179233431816, -0.0010612884070724249, -0.003662485396489501, 0.027652639895677567, 0.01924119144678116, 0.01836499758064747, 0.05176546424627304 ]
31,942
sonetel.phonenumber
delete
Remove a number from account. The phone number is removed immediately and cannot be recovered. :param number: The phone number to remove from account. :return: Dict containing the success response or an error message.
def delete(self, number: str): """ Remove a number from account. The phone number is removed immediately and cannot be recovered. :param number: The phone number to remove from account. :return: Dict containing the success response or an error message. """ if not isinstance(number, str): number = str(number) if is_e164(number): url = f'{self._url}{number}' else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) return util.send_api_request( token=self._token, uri=url, method='delete' )
(self, number: str)
[ -0.03280571103096008, 0.04761151596903801, -0.019499897956848145, 0.020399894565343857, -0.037870392203330994, -0.0083955442532897, -0.0824466273188591, 0.013905810192227364, 0.018564609810709953, -0.0710819810628891, 0.012529347091913223, 0.014373455196619034, 0.016711678355932236, -0.033211592584848404, 0.010499945841729641, -0.025270456448197365, 0.05728205665946007, 0.01722344011068344, 0.04238801449537277, -0.05082326382398605, 0.0032955710776150227, 0.05551736056804657, -0.005060267634689808, 0.0454585887491703, -0.0376233346760273, 0.09472891688346863, 0.04694093391299248, 0.0713290423154831, 0.0019466810626909137, -0.02729985862970352, -0.01784108392894268, -0.010394063778221607, 0.01080876775085926, 0.05752911418676376, -0.028552792966365814, -0.0018937401473522186, -0.02165282890200615, 0.004844092298299074, -0.09049364924430847, 0.032505713403224945, -0.011267588473856449, 0.023276349529623985, 0.02294105663895607, 0.036988042294979095, 0.01619991660118103, 0.04245860129594803, 0.002580869011580944, 0.02751162275671959, -0.02422928623855114, 0.025270456448197365, 0.02419399283826351, 0.028023384511470795, -0.027529269456863403, -0.032858651131391525, -0.03548805043101311, -0.03652922064065933, 0.0326998308300972, 0.03631746023893356, 0.02879985049366951, 0.00513526750728488, 0.009308774955570698, 0.041999783366918564, -0.08230545371770859, -0.06557612866163254, 0.04694093391299248, 0.03052925318479538, 0.02622339315712452, 0.008099958300590515, 0.026999859139323235, -0.008197016082704067, 0.0277763269841671, -0.027211623266339302, -0.01652638427913189, -0.016473444178700447, 0.06984669715166092, -0.02701750583946705, 0.01567932963371277, 0.0680467039346695, -0.047858573496341705, 0.00586761673912406, 0.05759970098733902, -0.011135236360132694, 0.05392913147807121, 0.014241102151572704, -0.04895268753170967, 0.002245576586574316, 0.07623489946126938, -0.01992342621088028, -0.03811744973063469, 0.0531526654958725, -0.03684686869382858, -0.06991728395223618, -0.0555526539683342, -0.06878788024187088, 0.05248207971453667, -0.05279972404241562, 0.03970567509531975, -0.0391409732401371, -0.02662927284836769, -0.0507526770234108, 0.061834972351789474, 0.029788080602884293, -0.03289394825696945, -0.04489388316869736, 0.045635055750608444, -0.023046938702464104, 0.005016150418668985, -0.022129297256469727, 0.017355792224407196, 0.041293904185295105, -0.03479981794953346, -0.017073441296815872, -0.035170406103134155, -0.05830558016896248, 0.04245860129594803, 0.017744025215506554, 0.04016449674963951, 0.006008792202919722, -0.0027242505457252264, -0.02165282890200615, 0.035435110330581665, -0.007491137366741896, -0.041293904185295105, -0.02516457438468933, 0.0424233078956604, 0.001172420335933566, 0.0059911455027759075, 0.0015264626126736403, 0.07821135967969894, -0.08357603847980499, -0.017294026911258698, -0.04415271058678627, 0.02475869469344616, 0.009132305160164833, -0.018882254138588905, 0.055764418095350266, -0.009979359805583954, -0.013385224156081676, -0.01655285432934761, 0.04362330213189125, -0.01889990270137787, 0.0174263808876276, 0.0021407976746559143, 0.0008332677534781396, 0.05347030982375145, 0.008280839771032333, -0.03176454082131386, -0.0335821770131588, -0.050787970423698425, -0.01675579510629177, -0.041152726858854294, 0.06229379400610924, 0.13764634728431702, -0.012211700901389122, -0.035523343831300735, 0.03832921385765076, 0.040764495730400085, -0.0052279140800237656, -0.04196448624134064, -0.016217563301324844, 0.03815274313092232, 0.11188177019357681, 0.05841146036982536, -0.040023323148489, -0.014523454010486603, -0.020964596420526505, 0.009158776141703129, -0.01195582002401352, -0.0005327177932485938, -0.0041205668821930885, -0.04718799144029617, -0.003033072454854846, 0.02977043390274048, 0.027264563366770744, 0.0167910885065794, -0.012714640237390995, 0.01760284975171089, -0.023805757984519005, -0.022623412311077118, -0.007636724971234798, 0.024652812629938126, 0.0032073361799120903, 0.03981155902147293, 0.04718799144029617, 0.02182929776608944, -0.0071602570824325085, 0.00028538453625515103, 0.010102888569235802, -0.01760284975171089, -0.02369987778365612, 0.025129280984401703, 0.01872343197464943, 0.019729308784008026, 0.022958705201745033, 0.03307041525840759, -0.008404368534684181, 0.032241009175777435, -0.023770464584231377, -0.05082326382398605, -0.04281154274940491, -0.02267635241150856, 0.028146913275122643, -0.01133817620575428, -0.042176250368356705, -0.024617519229650497, -0.0472232848405838, 0.030917486175894737, -0.0021882238797843456, -0.002193738706409931, 0.05862322449684143, 0.01965872198343277, 0.006282320246100426, 0.03393511846661568, 0.07969370484352112, -0.0006148865213617682, -0.05032914876937866, -0.008624955080449581, -0.005651441402733326, 0.04757622256875038, 0.04725857824087143, -0.013641105964779854, 0.008647013455629349, 0.04944680258631706, -0.05759970098733902, 0.012546993792057037, 0.060776155441999435, 0.003761009778827429, 0.045635055750608444, 0.0357351079583168, -0.014479336328804493, 0.02138812467455864, 0.025711631402373314, -0.012017584405839443, 0.007049963343888521, -0.042705658823251724, -0.11625821888446808, -0.038223329931497574, -0.07242315262556076, 0.048035044223070145, -0.020523423328995705, 0.04556446895003319, 0.020135190337896347, 0.0025235163047909737, 0.06808199733495712, 0.006123497616499662, 0.008885247632861137, 0.014073456637561321, 0.05505853891372681, -0.025358691811561584, -0.09359951317310333, 0.0019985190592706203, -0.08618778735399246, 0.01369404699653387, 0.009158776141703129, 0.020699892193078995, -0.01877637393772602, -0.04598799720406532, -0.0057352641597390175, -0.021935179829597473, 0.044576238840818405, 0.011505822651088238, -0.08802307397127151, 0.023770464584231377, -0.022835176438093185, -0.01207052543759346, 0.007857312448322773, 0.0006044086185283959, 0.06194085627794266, 0.05209384858608246, -0.007522019557654858, 0.014629336073994637, -0.05343501642346382, 0.03132336586713791, -0.007376432418823242, 0.0249351654201746, -0.0020944743882864714, -0.03218806907534599, 0.0036176282446831465, 0.018741078674793243, -0.01579403504729271, -0.0029073378536850214, -0.04012920334935188, 0.05639970675110817, -0.020117541775107384, 0.0415409617125988, 0.023046938702464104, 0.02417634427547455, 0.025482220575213432, 0.04348212853074074, 0.06681142002344131, -0.014188162051141262, -0.023064585402607918, -0.0660349503159523, 0.027317505329847336, -0.03132336586713791, -0.007773489225655794, -0.04023508355021477, 0.008986718021333218, 0.02724691666662693, 0.07778783142566681, 0.0056249708868563175, 0.05777617171406746, 0.014894040301442146, -0.03178218752145767, -0.011249941773712635, 0.0030154255218803883, 0.08534073084592819, -0.0030308666173368692, -0.029399847611784935, 0.05463501065969467, 0.014735217206180096, 0.012105819769203663, -0.02267635241150856, -0.01311169657856226, 0.056646764278411865, 0.06194085627794266, 0.01695873588323593, 0.03917626664042473, -0.03398805856704712, -0.012970521114766598, 0.0036043929867446423, -0.003657334018498659, 0.011355823837220669, 0.04895268753170967, 0.02507634088397026, -0.07807018607854843, -0.04877621680498123, 0.04792916402220726, -0.032593946903944016, 0.0024793988559395075, -0.042846836149692535, -0.02244694158434868, -0.03367041423916817, -0.02977043390274048, 0.019552839919924736, -0.04425859451293945, 0.059434983879327774, -0.01391463354229927, -0.02791750244796276, 0.08505838364362717, -0.01815873011946678, 0.0013974192552268505, 0.019199900329113007, -0.012767580337822437, -0.05414089560508728, -0.021317536011338234, -0.01717049814760685, -0.014426395297050476, 0.029099848121404648, -0.01889990270137787, 0.002136385999619961, 0.036052752286195755, 0.01722344011068344, 0.018229316920042038, 0.03684686869382858, -0.03328217938542366, -0.011408763937652111, -0.012008761055767536, 0.02112342044711113, -0.004707328509539366, 0.026611626148223877, -0.05188208445906639, -0.013561693951487541, -0.009970536455512047, -0.044082123786211014, -0.05159973353147507, -0.02818220667541027, -0.052023258060216904, 0.05696440860629082, 0.007738194894045591, 0.007786724250763655, -0.05392913147807121, 0.0042617423459887505, 0.05488206818699837, 0.058729108422994614, 0.0083955442532897, 0.014894040301442146, 0.043023306876420975, -0.058023229241371155, 0.004246301483362913, 0.010773473419249058, -0.008699954487383366, -0.00586761673912406, -0.01670285500586033, -0.004049979150295258, -0.01249405276030302, 0.013341107405722141, 0.007164668757468462, -0.0713290423154831, 0.02481163665652275, -0.0031963069923222065, 0.023629289120435715, 0.01511462777853012, 0.014417571946978569, -0.08463485538959503, 0.004945562686771154, -0.041788019239902496, -0.016358738765120506, -0.02481163665652275, 0.004504388198256493, -0.021582240238785744, 0.025570455938577652, -0.0713290423154831, 0.02511163428425789, 0.031217485666275024, 0.008894071914255619, -0.03875273838639259, -0.012458758428692818, 0.014135221019387245, -0.034640997648239136, -0.010773473419249058, -0.06218791380524635, 0.05954086780548096, 0.01702049933373928, 0.03305276855826378, 0.01031465269625187, -0.035170406103134155, -0.01877637393772602, -0.010402887128293514, 0.0016345502808690071, 0.06681142002344131, -0.00503820925951004, -0.05791734531521797, 0.011108765378594398, -0.010023477487266064, 0.018741078674793243, 0.013746987096965313, 0.021352829411625862, 0.023188114166259766, -0.0011492586927488446, -0.02578221820294857, -0.028535146266222, -0.020294012501835823, -0.039035093039274216, 0.00493673887103796, 0.015017569065093994, -0.0039992439560592175, 0.0035558638628572226, -0.026964565739035606, -0.025799866765737534, 0.011311706155538559, 0.012299936264753342, -0.003970567602664232, -0.04711740091443062, 0.011532292701303959, -0.01960578002035618, 0.017532261088490486, -0.023452820256352425, 0.017655789852142334, -0.01453227736055851, 0.019782250747084618, -0.015370508655905724, 0.03141160309314728, -0.03603510558605194, 0.0350998193025589, -0.0343409962952137, -0.037517450749874115, 0.039246853440999985, -0.014699923805892467, -0.02071753889322281, -0.06292908638715744, 0.06377614289522171, -0.06119968369603157, -0.028835143893957138, 0.0004056045145262033, 0.0890113040804863, 0.07125845551490784, -0.0011514646466821432, -0.012017584405839443, -0.004857327789068222, -0.06303496658802032, -0.03266453742980957, -0.0018650637939572334, 0.09755243360996246, -0.06642318516969681, 0.02876455709338188, 0.030017491430044174, -0.004272771999239922, 0.01306757889688015, 0.008519073016941547, 0.06991728395223618, -0.04055273160338402, -0.017091087996959686, 0.012838169001042843, 0.03688216209411621, 0.019694015383720398, -0.002214694395661354, 0.020611656829714775, 0.020611656829714775, -0.02308223396539688, -0.025764571502804756, -0.02272929437458515, 0.018829314038157463, -0.022288119420409203, 0.0409056693315506, -0.034235116094350815, -0.03439394012093544, -0.023399878293275833, 0.0011349206324666739, -0.017717555165290833, -0.007067610509693623, -0.007751430384814739, -0.00597791001200676, -0.03562922775745392, 0.053011488169431686, 0.041117433458566666, 0.0021562387701123953, 0.09070540964603424, -0.020999891683459282, 0.0013654340291395783, -0.0771525427699089, 0.06342320144176483, 0.07778783142566681, 0.024741047993302345, -0.025852806866168976, 0.005355854518711567, -0.007072022184729576, -0.01588227041065693, -0.0020845478866249323, 0.03135865926742554, 0.01133817620575428, 0.03832921385765076, -0.03755274787545204, 0.03527628630399704, 0.03554099053144455, -0.009194069541990757, -0.05925851687788963, -0.0020172689110040665, -0.0025080752093344927, -0.0005340964999049902, 0.04574093967676163, 0.03631746023893356, 0.03337041661143303, -0.026064570993185043, -0.006533789448440075, -0.009149952791631222, -0.020205777138471603, -0.07708195596933365, 0.02955866977572441, 0.023399878293275833, -0.07256432622671127, -0.006339672952890396, -0.028588086366653442, -0.000682165555190295, -0.0609879195690155, -0.003652922110632062, 0.031835127621889114, 0.0019157988717779517, -0.01799108274281025, 0.024617519229650497, 0.04108214005827904, -0.027264563366770744, 0.09247010946273804, -0.050082091242074966, 0.03178218752145767, 0.005479383282363415, -0.015370508655905724, -0.024564579129219055, -0.012352877296507359, -0.050787970423698425, -0.03970567509531975, 0.0013919045450165868, 0.025499867275357246, 0.025976335629820824, -0.004133801907300949, 0.021194007247686386, -0.06723494827747345, -0.07369373738765717, 0.05170561373233795, -0.06314084678888321, 0.0012727874564006925, -0.0037720391992479563, 0.08138781040906906, 0.040270380675792694, -0.06070556864142418, -0.003895567962899804, -0.008532308973371983, -0.044223301112651825, 0.005183796398341656, 0.04150566831231117, -0.025323398411273956, -0.024882223457098007, -0.049058567732572556, -0.01833519898355007, 0.012264641933143139, -0.00881907157599926, -0.018388139083981514, -0.029452787712216377, 0.024952812120318413, -0.016685208305716515, 0.021688122302293777, -0.052164435386657715, 0.05177620053291321, 0.0024816046934574842, 0.008536720648407936, 0.022888116538524628, 0.010402887128293514, -0.05823499336838722, -0.06109379976987839, 0.05894086882472038, 0.030405724421143532, 0.04101155325770378, 0.030299842357635498, -0.010676414705812931, 0.012732286937534809, 0.0507526770234108, -0.064905546605587, -0.07404667139053345, -0.015714624896645546, -0.09811713546514511, 0.028429264202713966, -0.0008465029532089829, -0.06038792058825493, -0.00771172484382987, 0.037305690348148346, -0.025093987584114075, 0.017179323360323906, -0.01717049814760685, -0.06836435198783875, 0.025941042229533195, 0.014938157983124256, -0.03367041423916817, -0.0357351079583168, 0.010191123932600021, -0.024970458820462227, 0.01939401775598526, -0.021758710965514183, 0.007597019430249929, -0.10143476724624634, -0.024829283356666565, -0.03945861756801605, -0.023805757984519005, 0.0004828099918086082, 0.049729153513908386, -0.06501142680644989, -0.057882051914930344, 0.0013135961489751935, 0.02680574357509613, 0.0017227851785719395, 0.028499852865934372, 0.05752911418676376, 0.0002274804428452626, -0.07849370688199997, 0.0016577119240537286, -0.0219704732298851, 0.03111160360276699, -0.03719980642199516, -0.06335261464118958, -0.031217485666275024, -0.01672932505607605, -0.013341107405722141, 0.026646919548511505, 0.026346921920776367, -0.017558733001351357, -0.01925284042954445, -0.02472340129315853, 0.049411509186029434, 0.06271731853485107, -0.03797627240419388, 0.008982306346297264, -0.009555832482874393, -0.010508769191801548, -0.04549388214945793, -0.03315865248441696, 0.003730127587914467, 0.0071779037825763226, 0.0319410115480423, -0.03562922775745392, 0.008122016675770283, -0.019199900329113007, -0.016429325565695763, 0.007508784532546997, 0.011364647187292576, 0.004089684691280127, -0.020046954974532127, 0.00015689256542827934, -0.024476343765854836, 0.05018797516822815, 0.011364647187292576, 0.01593521051108837, -0.019429311156272888, -0.005236737430095673, 0.04743504896759987, -0.013729340396821499, 0.006119085941463709, 0.04739975556731224, 0.00330660049803555, 0.057670287787914276, -0.0472232848405838, 0.007777900900691748, -0.024864576756954193, -0.03829392045736313, -0.046658582985401154, -0.026523390784859657, -0.013623458333313465, 0.03808215633034706, -0.046482112258672714, 0.01769108511507511, -0.03127042576670647, -0.0064587900415062904, 0.003836009418591857, -0.03125277906656265, 0.05054091289639473, -0.0124675827100873, -0.0008260986651293933, -0.03688216209411621, -0.0020977831445634365, -0.008999953046441078, 0.014444042928516865, -0.00262278039008379, 0.00927348155528307, -0.01863519661128521, -0.005982321687042713, 0.03779980540275574, 0.0021021950524300337, 0.05470559746026993, 0.0034036587458103895, 0.03331747278571129, 0.022217530757188797, 0.01195582002401352, 0.008549955673515797, -0.007786724250763655, 0.10715238749980927, 0.004336742218583822, -0.007332314737141132, -0.00024071565712802112, 0.04139978438615799, -0.02701750583946705, -0.023576349020004272, -0.0010124947875738144, -0.02587045356631279, 0.0071999626234173775, -0.014638159424066544, -0.0008018340449780226, -0.003966155927628279, -0.004649975802749395, 0.008880835957825184, -0.012476406060159206, 0.02950572967529297, -0.02205870859324932, -0.02417634427547455, 0.03959979489445686, -0.02445869706571102, -0.02085871435701847, 0.0007119448273442686, 0.06974081695079803, -0.01810578815639019, -0.01828225888311863, 0.06416437029838562, 0.003169836476445198, -0.003529393346980214, -0.014814629219472408, 0.0007527534617111087, 0.03049395978450775, 0.0264528039842844, 0.011205824092030525, -0.055940885096788406, 0.04298801347613335, 0.02848220430314541, -0.005554382689297199, -0.023064585402607918, 0.01948225125670433, -0.039388030767440796, -0.006202909164130688, 0.0264528039842844, 0.017920495942234993, 0.006957316771149635, 0.019199900329113007 ]
31,943
sonetel.phonenumber
get
List all the phone numbers present in the account. :param e164only: Optional. Boolean. Only return a list of phone numbers if set to True. Set to True by default. :param number: Optional. String. If you only want information about one of your numbers, pass it as a string. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :return: Information about the numbers assigned to account.
def get(self, e164only: bool = True, number: str = '') -> dict: """ List all the phone numbers present in the account. :param e164only: Optional. Boolean. Only return a list of phone numbers if set to True. Set to True by default. :param number: Optional. String. If you only want information about one of your numbers, pass it as a string. **DOCS**: https://docs.sonetel.com/docs/sonetel-documentation/YXBpOjE2MjQ3MzI4-phone-numbers :return: Information about the numbers assigned to account. """ url = self._url if not isinstance(number, str): number = str(number) if number: if is_e164(number): url += number else: return util.prepare_error( code=const.ERR_NUM_NOT_E164, message=f'"{number}" is not a valid e164 number' ) api_response = util.send_api_request(token=self._token, uri=url) response = api_response['response'] # No numbers are found if response == 'No entries found': return { 'status': 'success', 'response': 'No entries found' } # Only return a list of e164 numbers, without any additional metadata if e164only: nums = [] for entry in response: nums.append(entry['phnum']) return { 'status': 'success', 'response': nums } # Return full response return { 'status': 'success', 'response': response }
(self, e164only: bool = True, number: str = '') -> dict
[ 0.00550730898976326, -0.025621751323342323, -0.009756325744092464, 0.02352459728717804, -0.021919818595051765, 0.035688091069459915, -0.04617386311292648, -0.09409838914871216, 0.04741391912102699, -0.09935039281845093, 0.0010252119973301888, -0.014324474148452282, 0.0288130734115839, -0.020442692562937737, 0.022211596369743347, 0.0021598406601697206, 0.034922175109386444, 0.010549596510827541, 0.04883633553981781, -0.046684473752975464, 0.009254831820726395, 0.016157204285264015, 0.010303408838808537, 0.05153528228402138, -0.01415123138576746, 0.055729590356349945, 0.021135665476322174, 0.007654612418264151, 0.017825810238718987, -0.008653040044009686, 0.0008189158979803324, -0.04449613764882088, -0.014443009160459042, 0.03235088288784027, -0.04380316659808159, 0.005179058760404587, -0.014771259389817715, 0.018436720594763756, -0.13202953338623047, 0.08476150035858154, -0.026223544031381607, -0.05365067347884178, 0.07578932493925095, 0.039937108755111694, -0.03461216017603874, 0.042927831411361694, 0.0017563665751367807, -0.00964690838009119, -0.016157204285264015, -0.019895609468221664, 0.039499443024396896, 0.013667973689734936, -0.038697052747011185, -0.046246808022260666, -0.03928060829639435, -0.03173085302114487, -0.0067108930088579655, 0.04912811517715454, 0.004005108494311571, 0.02853953093290329, -0.028338933363556862, 0.004214823711663485, -0.038441747426986694, -0.04026535898447037, 0.025348210707306862, 0.0751328244805336, 0.005356860812753439, 0.008238168433308601, 0.003191321389749646, 0.0034899378661066294, 0.05744378641247749, -0.039937108755111694, -0.04577266797423363, 0.017634330317378044, 0.050988197326660156, -0.030417852103710175, 0.005703347269445658, 0.03156672790646553, -0.049201060086488724, -0.0025507775135338306, 0.03149378299713135, 0.037201691418886185, 0.032897964119911194, 0.06189339980483055, -0.0133944321423769, 0.01365885604172945, 0.06696303933858871, -0.004691242706030607, -0.009719853289425373, 0.044459667056798935, -0.07155854254961014, -0.03273383900523186, -0.046465639024972916, -0.01075931265950203, 0.014005342498421669, -0.04329255595803261, 0.0067108930088579655, -0.006305139511823654, -0.01327589713037014, -0.0009186446550302207, -0.0008029592572711408, 0.007435779087245464, -0.03898882865905762, -0.04274547100067139, 0.039681803435087204, -0.05492720007896423, -0.02855776809155941, 0.017479322850704193, 0.046429168432950974, 0.03680049628019333, -0.07123029232025146, 0.00042712417780421674, -0.03222322836518288, -0.04336550086736679, 0.01565571129322052, 0.032660894095897675, 0.05033169686794281, 0.05000344663858414, -0.015746891498565674, -0.0375664122402668, 0.028138337656855583, 0.006911490578204393, -0.03630812093615532, -0.01376827247440815, 0.028211280703544617, 0.010704603977501392, -0.034885700792074203, 0.008183459751307964, 0.10350823402404785, -0.05106114223599434, 0.016613107174634933, 0.0016173161566257477, 0.036454007029533386, 0.009528374299407005, -0.014926265925168991, 0.04110421985387802, -0.05062347650527954, 0.006592358462512493, -0.004559030756354332, 0.06426409631967545, -0.038186442106962204, 0.001341494731605053, 0.025220558047294617, -0.01679546944797039, -0.020169151946902275, 0.008119633421301842, -0.009519255720078945, 0.02651532180607319, -0.019913846626877785, -0.008903786540031433, 0.02554880827665329, 0.06966198980808258, 0.07681054621934891, -0.00460690027102828, -0.04125010967254639, 0.017379024997353554, 0.05317653343081474, 0.002200871938839555, -0.03379153460264206, 0.006606035400182009, 0.0001557193900225684, 0.051754117012023926, 0.05839206278324127, -0.06710892915725708, -0.02432698756456375, -0.02802892029285431, -0.0011112637585029006, -0.04879986494779587, 0.042198386043310165, 0.03027196414768696, -0.037712302058935165, -0.012473507784307003, -0.029232503846287727, -0.009081589058041573, 0.00614557322114706, -0.0038113496266305447, 0.040119469165802, -0.01177141722291708, -0.03386447951197624, 0.023871084675192833, 0.022211596369743347, 0.009674263186752796, 0.0029770468827337027, 0.05908503755927086, 0.04154188558459282, 0.008001098409295082, 0.03377329930663109, -0.031967923045158386, -0.02781008742749691, 0.005092437379062176, 0.046246808022260666, 0.020223859697580338, -0.00393900228664279, 0.03180379793047905, -0.04464202746748924, -0.019166164100170135, 0.030162546783685684, -0.00787800457328558, -0.0922018364071846, -0.045444417744874954, -0.030709629878401756, 0.006419115234166384, -0.02501996047794819, -0.0016081980429589748, -0.050696421414613724, -0.0064738234505057335, 0.014825967140495777, 0.008233609609305859, 0.005675992928445339, 0.01705077476799488, 0.010567832738161087, -0.00991133227944374, -0.019220873713493347, 0.05193647742271423, 0.014908029697835445, 0.025421155616641045, 0.009528374299407005, 0.019658539444208145, -0.015582766383886337, -0.013047945685684681, -0.03379153460264206, -0.07943654805421829, -0.0026373991277068853, -0.06291462481021881, 0.016157204285264015, 0.04303725063800812, -0.0019261904526501894, 0.03807702288031578, 0.0010850492399185896, -0.010741076432168484, 0.029196031391620636, 0.021682750433683395, -0.028411878272891045, 0.03986416384577751, -0.05565664544701576, -0.08359438180923462, -0.01982266455888748, -0.019622066989541054, 0.08344849944114685, 0.000525713199749589, 0.08797105401754379, 0.01902027614414692, -0.0280653927475214, 0.02883130870759487, -0.015491586178541183, -0.035195715725421906, 0.01251909788697958, 0.07433043420314789, -0.037931133061647415, -0.07330921292304993, 0.015418641269207, -0.08344849944114685, 0.06751012802124023, 0.02553057111799717, -0.014771259389817715, -0.058246176689863205, -0.05007639154791832, 0.0006747365114279091, 0.015126863494515419, -0.043693751096725464, 0.010814020410180092, -0.03873352333903313, -0.015218044631183147, -0.04314666613936424, -0.030983172357082367, 0.01303882710635662, 0.0037224486004561186, 0.020132679492235184, 0.025676460936665535, 0.009049675427377224, -0.015245398506522179, -0.037420522421598434, -0.02230277843773365, -0.04157835990190506, 0.018582608550786972, 0.025968238711357117, 0.01338531356304884, 0.04726802930235863, -0.021846875548362732, -0.003845542436465621, -0.03599810600280762, -0.00991133227944374, 0.016138968989253044, -0.006163809448480606, 0.029378393664956093, -0.04708566889166832, 0.017497560009360313, 0.05080583691596985, 0.019239109009504318, -0.014825967140495777, -0.014443009160459042, -0.0002853668120224029, -0.05303064361214638, 0.001282227342016995, -0.013449139893054962, -0.010421943850815296, 0.017616095021367073, -0.05233767256140709, 0.028703656047582626, 0.018354658037424088, -0.011060208082199097, 0.038478218019008636, 0.011297278106212616, -0.041468940675258636, -0.03163967281579971, 0.009131737984716892, 0.06718187779188156, -0.01715107262134552, -0.03528689593076706, -0.013239424675703049, -0.038478218019008636, 0.03588869050145149, 0.020223859697580338, 0.005543781444430351, -0.004422259517014027, 0.03207733854651451, -0.007969185709953308, 0.06014273315668106, -0.0028493942227214575, 0.024855835363268852, -0.010221346281468868, 0.030946699902415276, 0.06189339980483055, 0.028904253616929054, 0.09212888777256012, -0.05386950448155403, -0.03005312941968441, 0.026752391830086708, -0.0008667857036925852, 0.02204747125506401, -0.019840901717543602, -0.06787484884262085, -0.05386950448155403, -0.006327934563159943, 0.033390339463949203, -0.035432785749435425, 0.01592925377190113, -0.01353120245039463, -0.05587548017501831, 0.03475804999470711, -0.02580411359667778, -0.056714341044425964, -0.03446627035737038, 0.02926897630095482, -0.03222322836518288, -0.017844045534729958, 0.04431377723813057, -0.011807889677584171, -0.0026487968862056732, -0.06357112526893616, -0.008885550312697887, 0.0285030584782362, 0.05204589292407036, 0.06696303933858871, 0.050915252417325974, -0.031165532767772675, -0.048726920038461685, -0.0446055568754673, 0.01640339195728302, 0.021372735500335693, -0.0012240997748449445, -0.05233767256140709, -0.01954912394285202, 0.05131644755601883, -0.07695643603801727, -0.032405588775873184, 0.010768430307507515, -0.031165532767772675, 0.10124695301055908, -0.005703347269445658, -0.03774877265095711, -0.039718274027109146, -0.02582234889268875, 0.04201602563261986, 0.014187702909111977, 0.01301147323101759, -0.008894668892025948, 0.025220558047294617, -0.039499443024396896, 0.01153434719890356, -0.010868729092180729, 0.03608928620815277, -0.04562677815556526, 0.02554880827665329, 0.056459035724401474, -0.06499353796243668, 0.06495706737041473, 0.02354283444583416, -0.022175125777721405, 0.00272402074187994, -0.022448666393756866, 0.025184085592627525, -0.02024209499359131, 0.03357269987463951, -0.09446311742067337, -0.009546610526740551, -0.023360472172498703, -0.0014372343430295587, -0.02478289045393467, -0.011443166993558407, 0.02233925089240074, -0.025111140683293343, 0.010649895295500755, 0.044423192739486694, -0.004043860360980034, -0.03705580160021782, 0.014105640351772308, -0.05241061747074127, 0.053942449390888214, 0.0161663219332695, -0.05084231123328209, -0.046976249665021896, 0.01720578223466873, -0.04876339063048363, -0.03785819187760353, 0.017807573080062866, -0.009200124070048332, 0.06896901875734329, -0.01513598207384348, 0.011561702005565166, 0.09081588685512543, -0.06718187779188156, -0.011096680536866188, 0.0461009182035923, -0.009081589058041573, 0.02206570841372013, 0.021682750433683395, 0.011333750560879707, 0.016950475051999092, 0.014233293943107128, -0.012282028794288635, 0.005457159597426653, -0.029232503846287727, -0.07071968168020248, 0.02580411359667778, -0.007531518582254648, -0.00044194102520123124, -0.014889794401824474, -0.011406694538891315, -0.04752333462238312, 0.0008895808714441955, 0.06134631484746933, -0.0285030584782362, -0.04526205733418465, 0.03515924513339996, -0.04927400127053261, -0.016996067017316818, -0.009177329018712044, 0.03173085302114487, -0.0745127946138382, -0.006642507389187813, -0.02202923595905304, 0.08286494016647339, 0.013148244470357895, 0.03384624421596527, -0.021463915705680847, -0.007344598416239023, 0.031931448727846146, 0.04165130481123924, -0.004404023755341768, -0.05638609081506729, 0.01798081584274769, -0.04424083232879639, 0.005429805256426334, 0.028156572952866554, 0.054234229028224945, 0.012737931683659554, -0.005666875280439854, -0.0565684512257576, 0.0005778571357950568, -0.0008559579728171229, 0.00840685237199068, 0.0029793265275657177, 0.059012092649936676, -0.016549281775951385, -0.007964626885950565, 0.010859610512852669, -0.03204086795449257, -0.010020749643445015, -0.04114069044589996, 0.03833232820034027, -0.04329255595803261, -0.03459392488002777, -0.04730449989438057, 0.03160319849848747, 0.00033765321131795645, 0.003218675497919321, -0.010567832738161087, -0.05215530842542648, -0.014944502152502537, -0.00577173288911581, 0.012318500317633152, 0.021390970796346664, -0.0068522230722010136, -0.029451338574290276, 0.0017347111133858562, 0.0030271962750703096, -0.033390339463949203, 0.02507466822862625, 0.03975474834442139, 0.025694696232676506, -0.04876339063048363, 0.032405588775873184, -0.02181040309369564, 0.029980184510350227, 0.023396944627165794, -0.06787484884262085, 0.0776858851313591, -0.017534032464027405, 0.024892307817935944, -0.01832730323076248, 0.03577927127480507, 0.09468194842338562, -0.0003504754859022796, -0.024217570200562477, 0.023342236876487732, 0.036727551370859146, 0.05310358852148056, -0.02456405758857727, 0.016412509605288506, 0.025184085592627525, 0.04781511425971985, -0.023433417081832886, 0.06470176577568054, 0.02182863838970661, 0.08643922209739685, -0.08738750219345093, -0.02509290538728237, -0.04486086219549179, 0.0013346562627702951, 0.026497086510062218, 0.005402451381087303, -0.0017347111133858562, -0.017105482518672943, -0.04854455962777138, 0.002123368438333273, 0.019950317218899727, -0.037456996738910675, 0.02507466822862625, 0.04591855779290199, -0.007467692252248526, 0.0095010194927454, -0.02150038816034794, -0.023415181785821915, -0.03627164661884308, -0.01176229864358902, -0.010823138989508152, 0.020205624401569366, 0.029633698984980583, -0.03149378299713135, 0.05642256140708923, -0.04026535898447037, 0.12356796860694885, -0.04679388925433159, 0.045006752014160156, 0.006929726339876652, 0.010704603977501392, -0.01240056287497282, -0.038915883749723434, -0.04362080618739128, -0.012592042796313763, -0.009865742176771164, -0.06430056691169739, 0.030673157423734665, -0.04956578090786934, 0.012728813104331493, -0.03535984084010124, 0.021974528208374977, -0.016330447047948837, -0.05386950448155403, 0.008224491029977798, 0.030199019238352776, 0.011023735627532005, 0.05106114223599434, -0.0031662466935813427, -0.012318500317633152, -0.0017632050439715385, -0.05930386856198311, 0.058465007692575455, 0.014479481615126133, -0.024381695315241814, -0.01982266455888748, -0.022503376007080078, -0.020406220108270645, 0.045699723064899445, 0.021099193021655083, -0.027645962312817574, -0.013312369585037231, 0.07046438008546829, 0.0006741666584275663, 0.02481936290860176, -0.07053732126951218, 0.012391445226967335, 0.011196979321539402, 0.0017027979483827949, 0.07732115685939789, -0.057699091732501984, -0.02308693155646324, 0.016695169731974602, 0.017096364870667458, -0.03898882865905762, 0.09854800254106522, 0.017989935353398323, -0.07783176749944687, 0.034393325448036194, 0.012455271556973457, -0.012655869126319885, -0.056021369993686676, -0.016376037150621414, -0.09511961787939072, 0.02677062712609768, -0.04307372123003006, -0.035141006112098694, -0.035432785749435425, 0.049966976046562195, -0.013239424675703049, 0.00900864414870739, 0.050696421414613724, -0.01718754507601261, 0.003736125538125634, 0.06342523545026779, 0.00953749194741249, -0.04631974920630455, 0.049201060086488724, -0.018263475969433784, -0.0033736827317625284, 0.01799905300140381, 0.017278725281357765, -0.06586887687444687, 0.023105166852474213, 0.009929568506777287, 0.010659013874828815, 0.046502113342285156, -0.0037680387031286955, -0.015619238838553429, 0.0005556318792514503, 0.05908503755927086, 0.008078602142632008, -0.007814178243279457, 0.06678067892789841, -0.015847191214561462, 0.033700354397296906, -0.058501482009887695, -0.005703347269445658, 0.0054708365350961685, 0.08301082998514175, -0.05510956048965454, -0.05379655957221985, 0.012838230468332767, -0.0021826359443366528, -0.011734944768249989, 0.05412480980157852, 0.01364973746240139, 0.005201853811740875, -0.06579592823982239, -0.039681803435087204, -0.014962738379836082, 0.03581574559211731, -0.012427917681634426, 0.018236123025417328, -0.0357610359787941, 0.02104448527097702, 0.008858196437358856, -0.11021912097930908, 0.016348684206604958, -0.00870318990200758, -0.02826599031686783, -0.0010537059279158711, 0.051717642694711685, 0.0021324865520000458, 0.014698314480483532, 0.0300896018743515, 0.014388300478458405, 0.029104851186275482, -0.018728498369455338, 0.02532997354865074, -0.00832023099064827, 0.044204361736774445, 0.012473507784307003, 0.012938529253005981, 0.00808316096663475, -0.012610279023647308, 0.033426813781261444, 0.028010684996843338, -0.025968238711357117, -0.0018144941423088312, 0.004837131593376398, 0.026424141600728035, -0.05988742783665657, 0.019640304148197174, -0.0011163926683366299, -0.05985095351934433, -0.02051563747227192, -0.006296021398156881, 0.038697052747011185, 0.012500861659646034, -0.06780190020799637, 0.0031776444520801306, -0.02503819577395916, 0.02458229288458824, 0.0062869032844901085, -0.025658223778009415, 0.05186353251338005, 0.010804902762174606, 0.012674105353653431, -0.027408892288804054, -0.0450432226061821, -0.0019079543417319655, -0.015828954055905342, -0.0280653927475214, -0.014041814021766186, 0.03406507521867752, -0.014443009160459042, 0.003430670592933893, -0.03304385393857956, 0.015072154812514782, 0.01037635374814272, 0.08133310824632645, 0.019968554377555847, 0.017105482518672943, 0.027171822264790535, 0.010330763645470142, 0.0731997936964035, 0.026223544031381607, 0.019166164100170135, 0.04259958118200302, 0.045407943427562714, -0.04128658026456833, -0.014269765466451645, -0.0053842151537537575, -0.027171822264790535, -0.0006981015903875232, -0.017944345250725746, -0.0390617735683918, -0.014461245387792587, -0.037675827741622925, 0.018363775685429573, -0.0055756946094334126, -0.005051406100392342, -0.047742169350385666, 0.007960067130625248, 0.01579248160123825, 0.01139757689088583, 0.013175598345696926, -0.007659171242266893, 0.049456365406513214, 0.012765285558998585, -0.019439706578850746, 0.018299948424100876, 0.005817322991788387, -0.014962738379836082, 0.045006752014160156, 0.02450934797525406, 0.008215373381972313, -0.010276054963469505, 0.017296962440013885, -0.022120416164398193, 0.03689167648553848, 0.018965566530823708, 0.006487500388175249, -0.03007136657834053, 0.008183459751307964, -0.03149378299713135, 0.0342656746506691, 0.0033805212005972862, 0.03599810600280762, -0.0001478835620218888, 0.024600530043244362 ]
31,944
sonetel.phonenumber
update
Update the number's call forwarding settings. :param number: E164number for which the settings should be updated :param connect_to: the ID of the destination where the incoming calls to this number should be forwarded. :param connect_to_type: The destination type where the calls should be forwarded. Accepted values 'user', 'phnum', 'sip' and 'app'.
def update(self, number: str, connect_to_type: str, connect_to) -> dict: """ Update the number's call forwarding settings. :param number: E164number for which the settings should be updated :param connect_to: the ID of the destination where the incoming calls to this number should be forwarded. :param connect_to_type: The destination type where the calls should be forwarded. Accepted values 'user', 'phnum', 'sip' and 'app'. """ # Checks if not number: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message='number is required to update call settings' ) if not connect_to: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message='connect_to is required to update call settings' ) if connect_to_type not in const.CONST_CONNECT_TO_TYPES: return util.prepare_error( code=const.ERR_NUM_UPDATE_EMPTY, message=f'invalid connect_to_type value - {connect_to_type}' ) # Prepare request body = { "connect_to_type": connect_to_type, "connect_to": connect_to } url = f'{self._url}{number}' # Return result return util.send_api_request( token=self._token, uri=url, method='put', body=dumps(body) )
(self, number: str, connect_to_type: str, connect_to) -> dict
[ -0.05240122973918915, -0.04897145926952362, -0.04105116426944733, 0.04334946349263191, -0.04522346332669258, 0.0020209567155689, -0.06558993458747864, -0.017643868923187256, -0.04522346332669258, -0.08012225478887558, -0.0348811149597168, -0.035676680505275726, 0.03145134449005127, 0.04607206583023071, 0.011297025717794895, -0.00590928178280592, 0.05699782818555832, -0.0070982095785439014, 0.06000329554080963, -0.005065098404884338, 0.0024971908424049616, -0.006598771549761295, 0.024361975491046906, 0.03123919479548931, -0.008565585128962994, 0.054169151932001114, 0.006709266919642687, 0.05830609053373337, -0.0034209303557872772, 0.007442954462021589, -0.014912428334355354, -0.009131320752203465, -0.010218593291938305, 0.026448123157024384, 0.015672635287046432, -0.00017817346088122576, -0.050916172564029694, 0.03123919479548931, -0.053638774901628494, 0.0003591093118302524, 0.02800389565527439, -0.023212825879454613, -0.01319754309952259, 0.04193512722849846, 0.021975278854370117, 0.06053367257118225, -0.09348775446414948, 0.09186126291751862, 0.003741366555914283, -0.029718780890107155, 0.0019944377709180117, -0.03009004518389702, -0.028923215344548225, 0.021108997985720634, -0.01090808305889368, -0.012967713177204132, -0.008057307451963425, -0.007991010323166847, 0.03385572135448456, -0.02747351862490177, 0.0018220653291791677, 0.015557720325887203, -0.009272754192352295, -0.05300232395529747, 0.03290104120969772, -0.00022803440515417606, 0.007093789987266064, 0.022134391590952873, 0.016892502084374428, -0.011535695753991604, 0.05540669709444046, -0.01035118754953146, -0.024627164006233215, -0.027897819876670837, 0.058518242090940475, -0.020861487835645676, 0.0322292298078537, 0.07998082041740417, -0.04617813974618912, 0.011526855640113354, 0.05409843474626541, 0.01454116404056549, 0.018669264391064644, -0.023318899795413017, -0.01718420907855034, 0.030867930501699448, 0.07018653303384781, -0.022222789004445076, -0.06311484426259995, 0.013904712162911892, -0.061948012560606, -0.10515604168176651, -0.02015431970357895, -0.06350378692150116, 0.03258281573653221, -0.02770334854722023, 0.030196119099855423, -0.0995694100856781, -0.010572178289294243, -0.036207057535648346, -0.002572327619418502, -0.06597887724637985, -0.06254910677671432, -0.06406951695680618, 0.052330512553453445, -0.11251059919595718, 0.005732489284127951, 0.013957750052213669, 0.02043718658387661, 0.018174245953559875, -0.023336580023169518, -0.05621994286775589, -0.04925432801246643, -0.02689010463654995, 0.009087122976779938, 0.05590171739459038, 0.048016779124736786, 0.03974290192127228, 0.02179848775267601, 0.022222789004445076, -0.02639508619904518, 0.08231448382139206, -0.03357285261154175, 0.00016974820755422115, -0.003763465443626046, 0.06792359054088593, 0.014240617863833904, 0.033254627138376236, 0.10246880352497101, -0.0511283241212368, -0.04624885693192482, -0.04363233223557472, -0.01185392215847969, 0.028056932613253593, -0.011871601454913616, 0.0538509264588356, -0.04250086098909378, -0.039672184735536575, -0.03949539363384247, 0.03288336098194122, -0.0013900292105972767, 0.020578620955348015, 0.0295596681535244, -0.05356805771589279, 0.0027933178935199976, 0.01912892423570156, -0.021904561668634415, 0.03176956996321678, -0.08563817292451859, -0.006236347369849682, -0.020808450877666473, 0.0375506766140461, 0.056326016783714294, 0.005538017954677343, -0.06000329554080963, 0.04978470504283905, 0.030249157920479774, -0.010050640441477299, -0.004570080433040857, -0.02390231564640999, -0.03201708197593689, 0.05225979536771774, 0.06643853336572647, -0.02904696948826313, -0.02881713956594467, -0.04402127489447594, 0.0045612407848238945, -0.021391864866018295, 0.006691587623208761, 0.009502585045993328, -0.03818713128566742, -0.03523470088839531, 0.015531200915575027, 0.005520338658243418, 0.03283032402396202, -0.006678327918052673, 0.0076551055535674095, -0.09044692665338516, 0.02635972760617733, 0.02984253503382206, 0.0403086394071579, 0.01852783001959324, -0.022116713225841522, 0.015266012400388718, -0.0034474493004381657, 0.01829800009727478, -0.012401977553963661, 0.029153045266866684, 0.012967713177204132, 0.00821200106292963, 0.10975264012813568, 0.002609896007925272, 0.04189976677298546, -0.019022848457098007, -0.0309032890945673, 0.008273878134787083, 0.006696007214486599, -0.014576522633433342, -0.008795415051281452, -0.010660573840141296, 0.0430312380194664, -0.0228769201785326, 0.02524593658745289, -0.004298262298107147, 0.0004552401078399271, -0.06856004148721695, 0.055583491921424866, -0.030585063621401787, 0.021869203075766563, 0.04349089786410332, 0.02476859651505947, -0.02853427268564701, 0.040237922221422195, -0.005184433422982693, -0.046142783015966415, -0.003149112220853567, 0.030744176357984543, 0.008967787958681583, 0.021674731746315956, 0.01248153392225504, 0.03999041020870209, -0.011871601454913616, 0.024344295263290405, -0.05759892240166664, 0.03847000002861023, 0.050421155989170074, -0.040980447083711624, -0.004914825316518545, -0.0006088283844292164, -0.02128578908741474, 0.026819387450814247, 0.008914750069379807, -0.021391864866018295, 0.057987865060567856, 0.029983969405293465, -0.09016405791044235, -0.02208135463297367, -0.051764778792858124, -0.04946647584438324, -0.007977751083672047, 0.029135366901755333, 0.011420780792832375, 0.03705566003918648, -0.00369495851919055, -0.06470596790313721, -0.050916172564029694, 0.0431373156607151, -0.03557060658931732, -0.054522737860679626, -0.03145134449005127, 0.06247838959097862, -0.05784643068909645, -0.02802157588303089, 0.04486987739801407, -0.018351037055253983, 0.01170364860445261, -0.02448572963476181, -0.0038408120162785053, -0.03010772354900837, -0.02361944690346718, -0.0019878081511706114, -0.008247359655797482, -0.017325643450021744, -0.06053367257118225, -0.01590246520936489, 0.0018121207831427455, -0.01912892423570156, 0.027226010337471962, 0.011332384310662746, 0.0021148775704205036, 0.06693355739116669, -0.016503559425473213, 0.005971158854663372, 0.06767608225345612, -0.021356506273150444, 0.011765525676310062, 0.01932339556515217, 0.006289385259151459, 0.013613005168735981, -0.04090972989797592, 0.00982081051915884, -0.02528129518032074, -0.015796389430761337, -0.046637799590826035, 0.0458245575428009, 0.0255818422883749, 0.005334706977009773, 0.07305056601762772, -0.02800389565527439, 0.032936401665210724, 0.025440407916903496, -0.013975429348647594, -0.017104651778936386, 0.019959846511483192, -0.06032152473926544, 0.022240467369556427, -0.034280020743608475, 0.03896501660346985, 0.05441666021943092, 0.019535545259714127, -0.012057232670485973, 0.010678253136575222, -0.024609483778476715, -0.025687916204333305, 0.059578996151685715, -0.01934107393026352, 0.07835433632135391, -0.003756835823878646, 0.009458386339247227, 0.02528129518032074, -0.017113491892814636, 0.03353749215602875, -0.009873848408460617, -0.045011311769485474, 0.03450985252857208, -0.017643868923187256, -0.023743202909827232, 0.0016032849671319127, 0.014682598412036896, 0.0672517791390419, -0.04356161504983902, -0.028445877134799957, -0.028109971433877945, 0.018174245953559875, -0.007495992351323366, -0.06672140210866928, 0.020012885332107544, 0.03864679113030434, -0.012676006183028221, -0.018934452906250954, -0.05816465616226196, -0.02987789362668991, 0.022381901741027832, -0.04144010692834854, -0.03118615597486496, -0.03896501660346985, 0.010572178289294243, 0.013763278722763062, 0.004145778715610504, 0.07131800055503845, -0.004861787427216768, 0.017970934510231018, -0.041510824114084244, -0.025122182443737984, -0.031115440651774406, -0.02929447963833809, -0.0018408495234325528, -0.008556745946407318, 0.06930257380008698, -0.03730316832661629, -0.059331487864255905, -0.008835193701088428, 0.007836317643523216, 0.0033944116439670324, 0.0377274714410305, 0.007628586608916521, -0.01263180747628212, -0.10713611543178558, 0.0510929673910141, -0.07439418882131577, -0.01584942638874054, 0.02072005346417427, 0.011456139385700226, 0.045011311769485474, 0.011862761341035366, 0.017670387402176857, -0.045364897698163986, 0.008565585128962994, 0.06403416395187378, 0.01195999700576067, -0.001453011529520154, -0.027314405888319016, 0.018722301349043846, 0.03719709441065788, 0.0282690841704607, 0.0457184799015522, -0.03364356979727745, 0.07729358226060867, -0.028976254165172577, -0.022806202992796898, 0.03341373801231384, 0.004371189046651125, -0.012242864817380905, 0.04271301254630089, 0.04377376660704613, -0.027491198852658272, 0.02720833010971546, 0.007442954462021589, -0.018439434468746185, 0.028392838314175606, 0.0377274714410305, 0.04621350020170212, -0.01158873364329338, 0.03306015580892563, -0.016362125054001808, 0.03571203723549843, 0.008406472392380238, -0.01248153392225504, 0.009095962159335613, -0.07227268069982529, 0.008044048212468624, -0.07920293509960175, 0.021657053381204605, 0.017802981659770012, 0.0127820810303092, -0.010368866845965385, -0.0076551055535674095, 0.0255641620606184, -0.0188106968998909, -0.035888832062482834, 0.002399955177679658, -0.02934751659631729, 0.004570080433040857, 0.015778711065649986, -0.041581541299819946, 0.0457184799015522, -0.062266238033771515, 0.002852985169738531, -0.007982171140611172, 0.05600779131054878, 0.11378350853919983, -0.06845396757125854, -0.020914524793624878, 0.03666671738028526, 0.027031539008021355, -0.016220690682530403, 0.027049217373132706, 0.005003221333026886, 0.004271743353456259, 0.03610098361968994, 0.02043718658387661, -0.012711364775896072, 0.05551277473568916, 0.01932339556515217, -0.0038010338321328163, 0.028640348464250565, 0.05031508207321167, -0.003995505161583424, -0.00766836479306221, -0.003962356597185135, 0.06276125460863113, -0.014488127082586288, -0.030797213315963745, -0.028339801356196404, 0.004353509750217199, -0.031875647604465485, -0.006992134265601635, -0.06845396757125854, -0.023212825879454613, 0.014912428334355354, -0.01994216814637184, -0.04486987739801407, 0.021073639392852783, -0.01547816302627325, 0.014682598412036896, -0.012136789038777351, -0.04780463129281998, 0.019959846511483192, 0.03634849190711975, -0.0054054236970841885, -0.012030714191496372, -0.016194172203540802, -0.06127620115876198, 0.011862761341035366, -0.019588584080338478, 0.04677923396229744, 0.03949539363384247, -0.0348811149597168, -0.04384448379278183, -0.001804386149160564, -0.02666027471423149, -0.052578020840883255, -0.015230653807520866, 0.0592254102230072, -0.021586336195468903, 0.010810847394168377, -0.008570005185902119, 0.011535695753991604, -0.019235000014305115, -0.011252827942371368, 0.020366469398140907, -0.012348940595984459, 0.010183234699070454, 0.0215156190097332, 0.012994231656193733, -0.01060753595083952, 0.007876095362007618, 0.009838489815592766, -0.010059480555355549, -0.006497115828096867, -0.002972319955006242, -0.019164282828569412, 0.04458701238036156, -0.04197048395872116, -0.021091317757964134, 0.015566559508442879, -0.04967862740159035, -0.03875286504626274, -0.011270507238805294, 0.01877533830702305, -0.014461607672274113, -0.02823372557759285, -0.01719304919242859, -0.0017635029507800937, 0.034050192683935165, 0.0484764389693737, -0.075454942882061, 0.0697268694639206, -0.01935875415802002, 0.03450985252857208, -0.015433965250849724, 0.03730316832661629, 0.04681459441781044, -0.012702524662017822, -0.02581167221069336, -0.021162034943699837, 0.03935395926237106, 0.0004077271732967347, -0.06513027101755142, -0.0671810656785965, 0.020348791033029556, 0.02934751659631729, 0.018669264391064644, 0.04412735253572464, 0.07488920539617538, 0.004702674224972725, -0.0065501537173986435, -0.02098524197936058, -0.006399880163371563, -0.04465772956609726, 0.04730961099267006, 0.05936684459447861, 0.0023115589283406734, 0.013683721423149109, 0.06297340989112854, -0.03634849190711975, -0.020861487835645676, -0.03843463957309723, -0.09497281163930893, 0.029188403859734535, -0.0698329508304596, 0.0148063525557518, -0.08563817292451859, -0.050421155989170074, 0.009228556416928768, -0.015345568768680096, 0.013922391459345818, -0.0007143512484617531, -0.021922241896390915, -0.04136938974261284, -0.008760057389736176, -0.009166679345071316, 0.09101266413927078, 0.035411491990089417, -0.010837365873157978, -0.0017933365888893604, 0.01638864353299141, -0.05289624631404877, 0.005290508735924959, -0.004271743353456259, -0.03903573378920555, -0.02879946120083332, -0.021197393536567688, 0.00517559377476573, -0.035871151834726334, -0.008344595320522785, -0.05604315176606178, -0.0006292699836194515, -0.018492471426725388, 0.01720188744366169, 0.05165870115160942, 0.029188403859734535, -0.03572971746325493, 0.0027535397093743086, 0.008702599443495274, -0.05809393897652626, 0.03988433629274368, 0.004525882191956043, 0.03433305770158768, 0.022523336112499237, -0.025352012366056442, 0.05215372145175934, -0.021391864866018295, -0.003319274866953492, 0.051552627235651016, -0.01611461490392685, -0.05537134036421776, 0.01877533830702305, 0.03530541807413101, -0.03389107808470726, -0.04543561488389969, -0.026182934641838074, -0.018174245953559875, -0.02773870714008808, -0.030814893543720245, 0.057952508330345154, -0.03118615597486496, -0.07188373804092407, 0.1050146073102951, 0.04656708613038063, -0.051481910049915314, 0.01439973060041666, -0.009131320752203465, -0.02255869470536709, -0.009988763369619846, -0.007716982625424862, -0.013506929390132427, 0.011120233684778214, 0.014735635370016098, -0.03445681184530258, 0.08295093476772308, 0.014762154780328274, -0.017334481701254845, 0.00014081227709539235, -0.00875563733279705, -0.05218907818198204, 0.006094913464039564, 0.04999685287475586, -0.03677279129624367, 0.02229350619018078, -0.03037291206419468, 0.022753166034817696, -0.02473323792219162, 0.024821635335683823, -0.0322469100356102, 0.040485430508852005, -0.008539066649973392, -0.007756760809570551, -0.05332054942846298, -0.02773870714008808, 0.008799835108220577, 0.018351037055253983, 0.05084545910358429, 0.013321297243237495, -0.024680200964212418, -0.04246550425887108, 0.00993572548031807, 0.042076561599969864, -0.0053656455129384995, 0.015672635287046432, 0.0565381683409214, 0.017405198886990547, 0.012684845365583897, -0.06601423770189285, 0.032087795436382294, 0.041263315826654434, 0.005423102993518114, -0.07686927914619446, -0.03171653300523758, 0.015283691696822643, -0.03709101676940918, -0.0007226383895613253, -0.033749643713235855, 0.020225035026669502, -0.014629560522735119, -0.007845156826078892, 0.017856018617749214, 0.03740924596786499, 0.031345270574092865, -0.027544235810637474, -0.053638774901628494, 0.012092591263353825, 0.0282160472124815, -0.04494059458374977, 0.04469308629631996, 0.06276125460863113, 0.039389319717884064, 0.013948909938335419, 0.03311319276690483, -0.020914524793624878, 0.003944677766412497, -0.004015394486486912, 0.0003455736441537738, 0.06880754977464676, 0.035871151834726334, -0.02337193861603737, -0.04593063145875931, 0.0201719980686903, -0.02660723775625229, -0.03309551253914833, -0.033519815653562546, -0.0174935944378376, -0.000678440323099494, 0.03332534432411194, -0.014947786927223206, 0.013436212204396725, 0.04932504519820213, 0.014293654821813107, -0.00952910352498293, 0.07177766412496567, -0.03198172152042389, -0.004547981079667807, -0.07870791852474213, -0.03309551253914833, -0.00779653899371624, -0.025104502215981483, -0.09065907448530197, -0.0375506766140461, -0.03684350848197937, -0.027844782918691635, 0.03935395926237106, -0.01545164454728365, 0.03864679113030434, -0.005626413971185684, 0.022099032998085022, -0.0019944377709180117, -0.008397633209824562, -0.030779534950852394, 0.038576073944568634, 0.04197048395872116, 0.0019005169160664082, -0.008609783835709095, -0.02876410260796547, 0.0053789047524333, -0.05515918880701065, 0.04055614769458771, 0.011951157823204994, 0.04752176254987717, 0.0011425201082602143, 0.03666671738028526, -0.003365682903677225, 0.032671213150024414, 0.06223088130354881, -0.029718780890107155, 0.04409199208021164, -0.0028927635867148638, 0.04281908646225929, 0.0053126076236367226, -0.026695633307099342, -0.03440377488732338, -0.0255111251026392, -0.010934601537883282, -0.018351037055253983, 0.0322469100356102, 0.053957000374794006, 0.023584088310599327, -0.0028264664579182863, 0.004307101480662823, -0.00618772953748703, -0.001780077232979238, -0.009599820710718632, 0.02612989768385887, -0.02902929112315178, -0.01854550838470459, 0.006382200866937637, 0.04822893068194389, 0.011226309463381767, -0.05547741428017616, 0.04069758206605911, 0.01035118754953146, 0.007982171140611172, 0.021727770566940308, 0.045046672224998474, -0.025210577994585037, 0.015159937553107738, -0.011659449897706509, -0.021162034943699837, 0.018244963139295578, 0.007460633758455515, 0.01937643252313137, 0.03306015580892563, 0.018899094313383102, 0.05084545910358429, 0.03949539363384247, 0.05250730365514755, 0.03663135692477226, -0.00822526030242443, -0.024008389562368393 ]
31,945
sonetel.recording
Recording
Class representing the call recording resource.
class Recording(util.Resource): """ Class representing the call recording resource. """ def __init__(self, access_token: str = None): super().__init__(access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_CALL_RECORDING}' def get(self, start_time: str = None, end_time: str = None, file_access_details: bool = False, voice_call_details: bool = False, rec_id: str = None ): """ Get a list of all the call recordings. :param start_time: The start timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20201231T23:59:59. Limit the results to recordings created after this timestamp. :param end_time: The end timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20221123T18:59:59. Limit the results to recordings created before this timestamp. :param rec_id: The unique recording ID. If not included, returns all the recordings. :param file_access_details: Boolean. Include the details needed to download recordings. :param voice_call_details: Boolean. Include the details of the voice calls. """ url = self._url # Prepare the request URL based on the params passed to the method if rec_id: # Get a single recording url += f'/{rec_id}' else: # Search for and return multiple recordings url += f'?account_id={self._accountid}' if util.is_valid_date(start_time) and util.is_valid_date(end_time) and util.date_diff(start_time, end_time): url += f'&created_date_max={end_time}&created_date_min={start_time}' fields = [] if file_access_details: fields.append('file_access_details') if voice_call_details: fields.append('voice_call_details') if len(fields) > 0: url += '&fields=' + ','.join(fields) return util.send_api_request(token=self._token, uri=url, method='get') def delete(self, rec_id: str) -> dict: """ Delete a call recording. :param rec_id: The ID of the recording that should be deleted :returns: A representation of the deleted recording. """ url = f'{self._url}/{rec_id}' return util.send_api_request(token=self._token, uri=url, method='delete')
(access_token: str = None)
[ -0.022170044481754303, -0.0369873046875, -0.11220908910036087, 0.05290282517671585, -0.02814534679055214, -0.04255308210849762, -0.039984263479709625, 0.058077700436115265, -0.026004662737250328, -0.03279900923371315, -0.02086701989173889, 0.01840057782828808, 0.037973880767822266, 0.01388652715831995, 0.012090213596820831, 0.0010424202773720026, 0.019210316240787506, -0.013616614043712616, -0.011131558567285538, -0.07121963798999786, 0.024180427193641663, 0.0634014904499054, -0.02257956750690937, 0.03920244798064232, -0.0076320054940879345, 0.12777093052864075, -0.011206017807126045, -0.0017195279942825437, -0.013607307337224483, 0.0466483049094677, 0.033487748354673386, 0.0048025790601968765, 0.017414001747965813, 0.026879550889134407, -0.016632186248898506, -0.009144444949924946, -0.03410203382372856, 0.006315018981695175, -0.1906139850616455, 0.024869168177247047, -0.005314481910318136, 0.010293900035321712, 0.05323788896203041, 0.0083765909075737, 0.018419193103909492, 0.04627601429820061, -0.021462688222527504, 0.02308216318488121, -0.0015415254747495055, -0.0407288484275341, 0.05934349447488785, 0.05353572592139244, -0.05282836779952049, 0.0012250764993950725, 0.003292465815320611, -0.04795132949948311, -0.0317007452249527, 0.04255308210849762, -0.0000022495728444482666, -0.02911330759525299, -0.005137642379850149, -0.0044442471116781235, 0.04985002428293228, -0.01304886769503355, 0.020494725555181503, 0.011987832374870777, -0.03199857845902443, -0.02488778345286846, 0.04649939015507698, 0.05253053456544876, 0.04594095051288605, -0.012080905959010124, 0.006166101898998022, -0.012415969744324684, 0.0608326680958271, -0.02224450372159481, -0.015896908938884735, 0.002236084546893835, -0.013002331368625164, -0.054764293134212494, 0.051339197903871536, 0.0008254432468675077, -0.008697694167494774, -0.005547164939343929, 0.029802050441503525, 0.025688212364912033, 0.015906216576695442, -0.067533940076828, -0.022728484123945236, 0.04340935871005058, -0.050743527710437775, -0.0009551640832796693, -0.025744056329131126, -0.02315662056207657, 0.03614964336156845, -0.07885164767503738, -0.06708718836307526, -0.022523723542690277, -0.06239629536867142, -0.014603191055357456, -0.047057826071977615, -0.03765743225812912, -0.06615645438432693, 0.008902454748749733, 0.025818515568971634, -0.073974609375, 0.028052272275090218, -0.024701636284589767, 0.015273317694664001, 0.043372128158807755, -0.0452335923910141, 0.000967379950452596, -0.02948560006916523, -0.013169863261282444, -0.00833936221897602, 0.025111159309744835, -0.0010313678067177534, -0.006947916932404041, -0.05926903709769249, -0.05986470356583595, 0.03460462763905525, -0.04545696824789047, -0.0036670854315161705, -0.008669772185385227, 0.006291750818490982, -0.0008434762130491436, -0.01298371609300375, 0.025520680472254753, 0.029373912140727043, -0.026153579354286194, -0.03693145886063576, 0.029001619666814804, -0.0096330801025033, 0.026898164302110672, 0.04087776318192482, 0.03942582383751869, 0.05357295274734497, 0.0648161992430687, -0.0641833022236824, 0.058375533670186996, 0.011206017807126045, -0.006994453724473715, 0.051413655281066895, -0.006045106798410416, -0.011438700370490551, -0.02907607890665531, -0.02244926430284977, -0.018949709832668304, -0.0416223518550396, 0.03752712905406952, -0.0016648474847897887, -0.02784751169383526, 0.02090424858033657, -0.002408270025625825, 0.013477004133164883, -0.006859497632831335, -0.030434947460889816, 0.024012895300984383, 0.011615539900958538, -0.025148387998342514, -0.0099867582321167, 0.0449729859828949, -0.020383037626743317, -0.05569502338767052, 0.004737427458167076, 0.031049231067299843, -0.043669961392879486, -0.005435477010905743, 0.009186328388750553, 0.00988437794148922, -0.01645534858107567, 0.027456603944301605, 0.02894577570259571, -0.009311976842582226, -0.05178594961762428, -0.02298908866941929, 0.01828888989984989, 0.011448008008301258, 0.006836229003965855, 0.00923286471515894, 0.013644536025822163, -0.04318598285317421, -0.020383037626743317, 0.020215507596731186, 0.007697156630456448, 0.0035809928085654974, 0.006798999849706888, 0.0035600513219833374, 0.04318598285317421, 0.003106319345533848, -0.022728484123945236, 0.01273241825401783, 0.04914266988635063, -0.02589297480881214, -0.050371233373880386, -0.01269518956542015, 0.04564311355352402, 0.00520279398187995, -0.00898156687617302, -0.002552533522248268, -0.031067846342921257, 0.0371176078915596, 0.011829608120024204, -0.06016254052519798, -0.001838196418248117, 0.021518532186746597, 0.051748719066381454, -0.0027061044238507748, -0.12092074751853943, 0.037676043808460236, -0.015599073842167854, 0.002188384532928467, 0.027828898280858994, -0.0185588039457798, 0.028796859085559845, -0.022635411471128464, 0.01195991039276123, 0.027735823765397072, 0.020792560651898384, -0.008948992006480694, 0.04560588672757149, -0.040207639336586, -0.058040469884872437, -0.054764293134212494, -0.021481303498148918, 0.05416862294077873, 0.05398247763514519, 0.01581314206123352, -0.07378846406936646, -0.05063183978199959, 0.003806695342063904, 0.0019568647257983685, 0.019340617582201958, 0.01311401929706335, -0.04854699969291687, -0.007227136753499508, -0.000755638349801302, 0.024608563631772995, 0.041994642466306686, -0.030044039711356163, 0.07684126496315002, 0.045680344104766846, 0.025204231962561607, -0.009325938299298286, -0.031607672572135925, -0.04754180833697319, 0.0235847570002079, 0.032017193734645844, 0.011410778388381004, -0.07311833649873734, 0.0421435609459877, -0.016194742172956467, -0.015859678387641907, -0.02064364403486252, 0.010377665981650352, -0.05666298419237137, -0.043744418770074844, -0.030230186879634857, 0.032817624509334564, -0.017981749027967453, -0.006142833735793829, 0.04489852860569954, -0.019675681367516518, 0.01708824560046196, -0.023361381143331528, 0.008753538131713867, -0.005900843068957329, -0.005807769950479269, 0.004609452094882727, 0.02298908866941929, 0.04586648941040039, -0.0038532319013029337, -0.019992131739854813, -0.04616432636976242, -0.02714015543460846, -0.016930021345615387, 0.021686064079403877, 0.008078756742179394, -0.04932881519198418, -0.03689423203468323, -0.03153321146965027, -0.024403803050518036, 0.09195635467767715, -0.009856455959379673, 0.07840489596128464, -0.0622473806142807, 0.015664225444197655, 0.08346807956695557, -0.03618687391281128, -0.004016110207885504, 0.025446223095059395, 0.00990299228578806, -0.031831044703722, -0.004227851517498493, -0.044042255729436874, 0.0037136219907552004, -0.05029677599668503, -0.04966387897729874, 0.04765349626541138, 0.00004813631312572397, -0.04348381608724594, 0.04981279373168945, 0.10171043127775192, 0.010265978053212166, -0.08361699432134628, -0.019526764750480652, 0.039351362735033035, -0.03291069716215134, 0.018642568960785866, -0.021220697090029716, -0.030900314450263977, 0.0023477724753320217, 0.027921970933675766, -0.03158905729651451, 0.011671383865177631, 0.02734491601586342, -0.028070887550711632, 0.0677945464849472, 0.006235906854271889, 0.08406374603509903, -0.01236012578010559, 0.08019190281629562, 0.006124218925833702, 0.05178594961762428, 0.07531486451625824, -0.08197890222072601, -0.007082873024046421, 0.051711488515138626, -0.025185616686940193, 0.030099883675575256, -0.07166638970375061, 0.002282621106132865, -0.02458994835615158, 0.007124755997210741, 0.025018084794282913, -0.006156794726848602, -0.029001619666814804, -0.051711488515138626, 0.014370507560670376, 0.02874101512134075, 0.028964390978217125, -0.04340935871005058, 0.0004220289411023259, 0.0041929492726922035, -0.006431360729038715, -0.0029271531384438276, 0.07192699611186981, 0.014435659162700176, 0.030062654986977577, 0.003597280476242304, 0.0033878658432513475, -0.02027135156095028, 0.047392889857292175, 0.0634014904499054, 0.0586361400783062, -0.07937285304069519, -0.019712911918759346, -0.053424037992954254, -0.01581314206123352, -0.021499916911125183, -0.010573119856417179, 0.05230715870857239, -0.031644899398088455, 0.048695918172597885, -0.0061195651069283485, -0.018940404057502747, 0.01298371609300375, -0.04966387897729874, -0.025315919890999794, -0.030602479353547096, -0.06734779477119446, -0.02231896109879017, -0.015515307895839214, 0.004393056500703096, 0.03335744887590408, 0.01571076177060604, 0.06496512144804001, 0.011243246495723724, -0.02915053814649582, 0.05930626392364502, -0.007627351675182581, 0.06451836973428726, -0.01273241825401783, 0.014044751413166523, 0.01187614444643259, -0.04143620282411575, -0.0174605380743742, -0.0007027029059827328, 0.0024012895300984383, 0.016864869743585587, 0.06221015006303787, -0.00422087125480175, -0.051934864372015, -0.01179237850010395, -0.061093270778656006, -0.07315555959939957, -0.011448008008301258, 0.015515307895839214, 0.017851445823907852, -0.021053165197372437, 0.006515126675367355, -0.00490961316972971, -0.012341511435806751, 0.03467908874154091, 0.010117060504853725, 0.021965283900499344, 0.08614858984947205, -0.035367827862501144, -0.015962060540914536, -0.01237874012440443, -0.004306964110583067, -0.08004298061132431, -0.019117241725325584, 0.0283501073718071, 0.015841064974665642, -0.012136749923229218, -0.010293900035321712, 0.05294005572795868, -0.01882871612906456, 0.0677945464849472, 0.021164853125810623, 0.02231896109879017, 0.05562056601047516, 0.0266747884452343, 0.010843032039701939, 0.0058449991047382355, 0.018810100853443146, 0.011196710169315338, -0.008348668925464153, -0.03748989850282669, 0.0418829545378685, 0.019619837403297424, -0.033860042691230774, -0.04754180833697319, 0.02257956750690937, 0.03748989850282669, 0.0077297319658100605, -0.006491858046501875, -0.004849115386605263, 0.0018032939406111836, 0.008948992006480694, -0.024645792320370674, -0.01711616851389408, -0.011354934424161911, -0.012080905959010124, -0.02315662056207657, -0.036335792392492294, 0.013625921681523323, 0.06503957509994507, -0.005542511120438576, 0.020215507596731186, 0.018242353573441505, 0.035702891647815704, -0.030714167281985283, -0.018782179802656174, -0.05692359060049057, 0.03979811444878578, -0.0068129608407616615, -0.010089138522744179, -0.06764562427997589, 0.049403272569179535, 0.051413655281066895, -0.01331877987831831, -0.06299196928739548, -0.03426956385374069, 0.05688636004924774, 0.029690362513065338, 0.033115457743406296, -0.050334006547927856, -0.03207303583621979, 0.04947773367166519, 0.039649199694395065, -0.030341874808073044, 0.030732782557606697, 0.012909257784485817, 0.021834980696439743, 0.02274709939956665, 0.002387328539043665, -0.013812067918479443, -0.025315919890999794, 0.04888206347823143, -0.04862145707011223, -0.03523752838373184, -0.0003879990545101464, 0.015803836286067963, -0.0251297727227211, -0.022802943363785744, 0.02944837138056755, -0.03367389738559723, -0.03220333904027939, 0.010545197874307632, 0.040207639336586, -0.009595850482583046, 0.032854851335287094, -0.055062126368284225, -0.005407555028796196, 0.0013972619781270623, 0.03263147547841072, 0.017227856442332268, -0.0018777524819597602, 0.023342767730355263, -0.06809237599372864, -0.0007742529851384461, 0.018437808379530907, -0.02505531534552574, 0.05867336690425873, -0.06716164946556091, 0.029224995523691177, -0.034325409680604935, -0.006631467957049608, -0.03762020170688629, 0.01628781668841839, 0.04393056780099869, 0.010219440795481205, -0.058077700436115265, -0.014780029654502869, -0.046424929052591324, 0.010777880437672138, -0.0552855022251606, -0.012201901525259018, 0.034995537251234055, 0.049738336354494095, 0.03240809962153435, 0.007436551619321108, -0.00004420978802954778, -0.0322219543159008, -0.06954432278871536, -0.028722399845719337, -0.00919563602656126, 0.0167531818151474, -0.004185968544334173, 0.02228173241019249, 0.006282443180680275, -0.03657777979969978, 0.01876356452703476, 0.03317129984498024, -0.059790246188640594, -0.06716164946556091, 0.011271168477833271, 0.01409128773957491, 0.032817624509334564, 0.03668946772813797, -0.0399470329284668, -0.0650768056511879, -0.05156257376074791, -0.025167003273963928, 0.029839279130101204, 0.05699804797768593, 0.03983534500002861, -0.016194742172956467, 0.05826384574174881, -0.03743405640125275, 0.046424929052591324, -0.026749247685074806, -0.041361745446920395, 0.009144444949924946, 0.04713228717446327, -0.03140290826559067, 0.012434584088623524, -0.007236443925648928, 0.0024990164674818516, 0.03359943628311157, -0.015487385913729668, 0.032445330172777176, -0.045754801481962204, 0.02710292674601078, 0.0720386877655983, 0.0192661602050066, 0.005523896310478449, -0.028368722647428513, 0.003527475520968437, 0.008613928221166134, -0.006640775129199028, 0.023770904168486595, -0.02734491601586342, 0.055806711316108704, -0.02311939187347889, 0.011643461883068085, 0.02211420051753521, 0.011680690571665764, 0.07818152010440826, -0.0015985327772796154, -0.0025269384495913982, -0.10893291234970093, 0.006389477755874395, 0.001437981496565044, 0.006640775129199028, 0.0019812965765595436, 0.042702000588178635, 0.014770722016692162, -0.0175908412784338, 0.031812433153390884, -0.016706645488739014, -0.023175235837697983, -0.0011238593142479658, 0.09657278656959534, -0.01296510174870491, -0.019619837403297424, -0.05212101340293884, 0.025408992543816566, -0.004113837145268917, 0.02542760781943798, 0.009540006518363953, -0.049738336354494095, -0.004853769205510616, 0.005016647279262543, -0.06879973411560059, -0.018875252455472946, -0.05569502338767052, -0.0037299098912626505, -0.026283882558345795, -0.020010745152831078, -0.005179525353014469, 0.013439775444567204, 0.06544909626245499, -0.025613754987716675, -0.07066120207309723, 0.043669961392879486, 0.03523752838373184, -0.04259031265974045, -0.005156257189810276, -0.002293091733008623, -0.02365921624004841, 0.05629069358110428, -0.06343871355056763, 0.034790776669979095, -0.0020010746084153652, -0.022840172052383423, -0.051376424729824066, -0.03748989850282669, 0.031849659979343414, 0.0012146057561039925, 0.01638088934123516, 0.05859890952706337, 0.023007703945040703, -0.013514233753085136, 0.03289208188652992, -0.00899552833288908, 0.041994642466306686, 0.03618687391281128, 0.012844106182456017, -0.016557728871703148, -0.023547528311610222, -0.014584575779736042, -0.03652193769812584, 0.06552355736494064, -0.04061716049909592, -0.06745947897434235, 0.011689998209476471, 0.004779310431331396, -0.04311152175068855, 0.03542367368936539, -0.012118135578930378, -0.02458994835615158, 0.017749065533280373, 0.027661366388201714, 0.02019689232110977, -0.02077394537627697, 0.01644604094326496, 0.029839279130101204, -0.01229497417807579, -0.025111159309744835, 0.013179169967770576, -0.06872528046369553, -0.05629069358110428, -0.02261679619550705, -0.007994990795850754, -0.032854851335287094, 0.02244926430284977, 0.05230715870857239, -0.006566316820681095, -0.012825491838157177, 0.03408341854810715, 0.056476838886737823, -0.011401471681892872, 0.02375228889286518, -0.005333096254616976, -0.029969582334160805, 0.017479153349995613, -0.011159480549395084, -0.014100595377385616, 0.014016829431056976, 0.005621623247861862, 0.06232183799147606, 0.017134781926870346, 0.03979811444878578, 0.026786476373672485, -0.01271380390971899, -0.008004298433661461, -0.006263828836381435, 0.019954901188611984, -0.008465010672807693, -0.01732092909514904, -0.009865762665867805, -0.042292479425668716, -0.037713274359703064, -0.04694613814353943, -0.04895652085542679, -0.0014449619920924306, 0.01417505368590355, -0.007306248880922794, 0.0018952037207782269, 0.05815215781331062, 0.009507430717349052, -0.006901380605995655, -0.0005712370038963854, -0.001257652067579329, -0.023677831515669823, 0.04054270312190056, 0.004400037229061127, 0.04478684067726135, 0.08369145542383194, 0.035795968025922775, -0.030062654986977577, -0.021723292768001556, -0.023808132857084274, 0.02647002786397934, 0.013458389788866043, 0.017665300518274307, 0.04054270312190056, 0.008637196384370327, -0.00926544051617384, 0.027456603944301605, -0.04720674455165863, 0.01015429012477398, 0.011569003574550152, 0.028722399845719337, 0.013914449140429497, 0.006826921831816435, -0.030044039711356163, 0.00503526208922267, 0.0002959438133984804, -0.042702000588178635, -0.005696082022041082, 0.08719100803136826, -0.05565779656171799, 0.00053488026605919, -0.04553142562508583, 0.07028890401124954, 0.02198389731347561, -0.03687561675906181, 0.03430679440498352, -0.0010482373181730509, 0.028964390978217125, -0.047392889857292175, 0.03564704954624176, 0.05424308031797409, -0.023715060204267502, 0.02555791102349758, -0.04895652085542679, 0.045754801481962204, -0.0034134609159082174, -0.0028364069294184446, -0.00830678641796112, 0.005305174272507429, -0.0032831584103405476, -0.058412764221429825, 0.019173085689544678, -0.004667622968554497, -0.001213442301377654, -0.029336683452129364, 0.006491858046501875, 0.011987832374870777, 0.04244139418005943, -0.01221120823174715, 0.07479365170001984, 0.00965169444680214, 0.05212101340293884 ]
31,946
sonetel.recording
__init__
null
def __init__(self, access_token: str = None): super().__init__(access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_CALL_RECORDING}'
(self, access_token: Optional[str] = None)
[ -0.041263651102781296, -0.03165886178612709, -0.04942772164940834, 0.036091841757297516, -0.010380560532212257, 0.011405686847865582, -0.01139645092189312, 0.0775771364569664, -0.008861341513693333, 0.017427150160074234, 0.009881850332021713, 0.04215024784207344, 0.026265403255820274, 0.007656124886125326, 0.040303170680999756, 0.0175564456731081, 0.04717428982257843, 0.01070379838347435, 0.029941082000732422, -0.019800640642642975, -0.03237922117114067, 0.01614343374967575, -0.07436323165893555, 0.016919204965233803, 0.0016462054336443543, 0.12220246344804764, -0.039822932332754135, -0.004733128938823938, 0.007637653965502977, -0.019837582483887672, 0.042261071503162384, 0.0025697427336126566, -0.016762202605605125, 0.07979363203048706, 0.03926881030201912, -0.04215024784207344, -0.03420782461762428, -0.006617145147174597, -0.19342567026615143, 0.0003988527168985456, 0.021924776956439018, 0.0013206584844738245, 0.011904397048056126, -0.000011445009477029089, 0.07159262150526047, 0.028795896098017693, -0.04185471311211586, 0.033154990524053574, -0.0017662652535364032, -0.03945351764559746, -0.025748223066329956, 0.06512785702943802, -0.053047988563776016, -0.010786917060613632, -0.052900221198797226, 0.0395643413066864, 0.014656538143754005, 0.026080695912241936, -0.023624086752533913, 0.034115470945835114, -0.04577051103115082, -0.013141936622560024, 0.04927995428442955, -0.00011681304749799892, 0.023383965715765953, 0.0318620391190052, -0.04831947758793831, 0.031529564410448074, 0.028814366087317467, 0.03727396950125694, 0.09590011835098267, 0.011368745006620884, -0.0597713403403759, -0.008958312682807446, 0.028906719759106636, 0.004862424451857805, -0.05748096480965614, 0.017491798847913742, -0.035556189715862274, -0.01061144471168518, 0.020188527181744576, -0.014554949477314949, -0.024972449988126755, -0.009207667782902718, -0.014785833656787872, -0.03446641564369202, -0.04185471311211586, -0.09191043674945831, -0.039342693984508514, 0.0727008655667305, -0.04617686942219734, 0.013372821733355522, -0.061987828463315964, -0.03127097710967064, 0.008519632741808891, -0.048873599618673325, -0.018082862719893456, -0.032545458525419235, -0.01674373261630535, -0.004206712823361158, -0.00781774427741766, -0.06690105050802231, -0.07007801532745361, -0.009110696613788605, 0.00960478838533163, -0.04746982082724571, 0.04148529842495918, -0.05688990280032158, 0.027373647317290306, 0.012578579597175121, -0.01824909821152687, -0.00781774427741766, -0.00609534652903676, 0.019615933299064636, -0.040303170680999756, 0.05688990280032158, 0.023734910413622856, -0.012624756433069706, 0.01292952336370945, -0.026523994281888008, 0.03989681601524353, 0.004876277409493923, -0.020188527181744576, 0.02284831553697586, 0.05360211059451103, 0.03219451382756233, -0.00857042707502842, -0.009650965221226215, 0.045474980026483536, -0.08614756911993027, 0.03841915354132652, 0.0419655367732048, -0.011461098678410053, -0.03912104293704033, -0.017279384657740593, 0.02657940611243248, 0.044218968600034714, 0.031769685447216034, -0.0476914718747139, 0.027909299358725548, -0.033746056258678436, -0.004308301955461502, 0.027650708332657814, -0.024215150624513626, 0.0006914986297488213, 0.012864875607192516, -0.016919204965233803, 0.005121015012264252, 0.014130122028291225, 0.028186360374093056, 0.04905830696225166, -0.010519091039896011, 0.07543453574180603, -0.014785833656787872, -0.028094006702303886, -0.025489632040262222, -0.004033549688756466, 0.012033691629767418, 0.055338360369205475, 0.008528867736458778, 0.018443042412400246, -0.00390887213870883, -0.00547195877879858, -0.037089262157678604, 0.0073605929501354694, 0.009780260734260082, 0.0274844728410244, -0.0379389151930809, -0.025064803659915924, -0.02417820878326893, 0.03363523259758949, -0.03655361011624336, -0.013539058156311512, -0.0008842870593070984, 0.0067741465754806995, 0.000012355920262052678, 0.011017801240086555, 0.03908410295844078, 0.01618037559092045, -0.01149804051965475, 0.027706122025847435, 0.012144516222178936, -0.040968120098114014, -0.009420081041753292, 0.018452277407050133, 0.00018441886641085148, -0.001336820307187736, 0.029294606298208237, 0.006889588665217161, 0.06261583417654037, 0.007577624171972275, -0.008528867736458778, 0.04266742616891861, -0.045474980026483536, -0.019431225955486298, -0.033210404217243195, 0.04244577884674072, -0.0229960810393095, -0.013446704484522343, 0.03860386088490486, -0.021961718797683716, 0.07377216964960098, -0.009369286708533764, -0.030439792200922966, 0.05640966445207596, 0.007743861060589552, 0.023975029587745667, -0.02595140039920807, -0.05271551385521889, 0.004525333177298307, -0.016078785061836243, -0.018092097714543343, 0.016679085791110992, 0.022164897993206978, -0.04713734611868858, 0.008062480948865414, -0.018877103924751282, 0.01532148476690054, 0.04141141474246979, -0.010011144913733006, 0.11370592564344406, -0.029996493831276894, -0.0009974204003810883, -0.09974204003810883, 0.016457436606287956, 0.04200248047709465, 0.0678984671831131, -0.046952638775110245, -0.11281932890415192, -0.02452915348112583, -0.03357981890439987, -0.06184006482362747, 0.00025527150137349963, 0.02973790280520916, -0.007960892282426357, -0.05201362445950508, 0.034743476659059525, -0.0046754078939557076, -0.039047159254550934, -0.05127479508519173, 0.08821628987789154, 0.022663608193397522, -0.013031112030148506, 0.004557657055556774, -0.027650708332657814, -0.001411857781931758, -0.05330657586455345, 0.044034261256456375, -0.009650965221226215, -0.03103085607290268, 0.02657940611243248, -0.0318620391190052, -0.050166551023721695, -0.01948663964867592, -0.0009125703945755959, -0.05352822691202164, -0.007046590093523264, 0.01750103384256363, 0.022571254521608353, -0.022571254521608353, -0.04314766824245453, 0.007503741420805454, -0.019431225955486298, 0.03202827647328377, 0.001755875418893993, 0.01882169209420681, -0.004264433868229389, -0.030716853216290474, 0.037384793162345886, -0.005416546948254108, 0.12899969518184662, -0.0016196536598727107, 0.013151172548532486, -0.0033385877031832933, -0.04303684085607529, -0.02826024405658245, -0.013806884177029133, -0.01930193044245243, -0.049538545310497284, -0.037754207849502563, 0.023642556741833687, -0.09094996005296707, 0.06143370643258095, 0.029368488118052483, 0.02318078838288784, -0.024880096316337585, 0.036756787449121475, 0.04621380940079689, -0.018092097714543343, -0.029756374657154083, 0.05474729463458061, 0.024122796952724457, -0.023162318393588066, 0.03343205153942108, -0.024011971428990364, -0.022238779813051224, 0.028795896098017693, 0.04004457965493202, -0.006727969739586115, 0.0210197102278471, -0.02561892755329609, -0.007425240706652403, 0.028906719759106636, 0.028371067717671394, -0.007919332943856716, -0.013012642040848732, 0.043849553912878036, 0.012052162550389767, 0.014287123456597328, -0.0015007482143118978, 0.010445207357406616, 0.05851532891392708, -0.020908886566758156, -0.012126046232879162, -0.01644820161163807, 0.016217315569519997, 0.0038003562949597836, -0.009835673496127129, 0.023827264085412025, 0.04222412779927254, -0.01328970305621624, 0.009433934465050697, 0.01572784222662449, -0.00490860128775239, 0.03768032416701317, -0.008565809577703476, 0.03171427547931671, 0.024639977142214775, -0.04473615065217018, 0.013225055299699306, -0.04078340902924538, -0.005601254291832447, -0.02691187895834446, -0.03952740132808685, -0.005901403725147247, -0.02820483222603798, -0.0703735500574112, -0.012532401829957962, -0.005688990466296673, -0.0009085299097932875, -0.018406100571155548, -0.02792777121067047, -0.010426737368106842, 0.02935001812875271, -0.0379389151930809, -0.026708701625466347, 0.025803634896874428, -0.039342693984508514, 0.02820483222603798, -0.07007801532745361, -0.0508684404194355, -0.025803634896874428, 0.06638386845588684, 0.04905830696225166, 0.10136746615171432, -0.03908410295844078, -0.029756374657154083, 0.0034632652532309294, -0.025840576738119125, -0.014139357022941113, -0.013686823658645153, 0.001461497857235372, -0.02011464349925518, 0.03764338418841362, -0.006561733316630125, -0.0038880924694240093, -0.0008294520084746182, -0.016734497621655464, 0.010103498585522175, -0.008487308397889137, -0.03620266541838646, -0.043369315564632416, -0.011461098678410053, 0.027909299358725548, 0.039822932332754135, 0.025157159194350243, -0.016522083431482315, -0.020853474736213684, -0.049538545310497284, 0.03688608482480049, 0.007429858203977346, 0.044662266969680786, 0.06350243091583252, 0.04994489997625351, 0.007259003818035126, -0.031769685447216034, -0.04861500859260559, 0.015746312215924263, 0.048060886561870575, 0.05153338611125946, 0.020465588197112083, -0.02811247855424881, -0.05688990280032158, 0.014942835085093975, -0.035851720720529556, -0.05345434322953224, -0.04107894375920296, -0.015284543856978416, 0.0033686025999486446, 0.005776726175099611, 0.04100506007671356, -0.007614565547555685, -0.010713033378124237, 0.0181567445397377, 0.05655742809176445, -0.009909556247293949, 0.051791977137327194, 0.0010389795061200857, -0.012246105819940567, -0.044994741678237915, -0.031640391796827316, -0.09833826124668121, -0.048578064888715744, 0.024621507152915, 0.010528326034545898, -0.021629245951771736, -0.019024869427084923, 0.029479313641786575, -0.004991719499230385, 0.01954205147922039, 0.035648543387651443, 0.023254672065377235, 0.04621380940079689, -0.0028052448760718107, -0.019080283120274544, 0.0460660457611084, 0.016549790278077126, -0.010786917060613632, 0.04469921067357063, -0.04458838328719139, -0.006007610820233822, 0.05397152528166771, -0.042113304138183594, 0.007780802436172962, 0.008274895139038563, 0.046435460448265076, -0.00897216610610485, -0.00468233460560441, -0.0181567445397377, -0.010306676849722862, -0.02369796857237816, -0.04022928699851036, 0.034115470945835114, 0.005970668978989124, 0.041743889451026917, 0.01498901192098856, -0.04059870168566704, -0.00000167300959219574, 0.05626189708709717, -0.05851532891392708, -0.019800640642642975, 0.00530572235584259, 0.011812043376266956, -0.041263651102781296, -0.05995604768395424, -0.06039934605360031, -0.02390114776790142, 0.013169643469154835, 0.03304416686296463, 0.001230613561347127, 0.006552497856318951, 0.010768446139991283, -0.06076876074075699, -0.07033661007881165, 0.012412342242896557, 0.0525677464902401, 0.052604690194129944, 0.029294606298208237, -0.04650934413075447, -0.035316068679094315, -0.017445622012019157, 0.025840576738119125, -0.04008152335882187, 0.04004457965493202, -0.004181315656751394, 0.023069964721798897, -0.01292952336370945, -0.04115282744169235, -0.01130409725010395, -0.006460144184529781, -0.027669180184602737, 0.013622176833450794, -0.003264704719185829, 0.023587144911289215, 0.011313333176076412, 0.005190280266106129, -0.021130535751581192, 0.027706122025847435, 0.021536892279982567, -0.026080695912241936, 0.02369796857237816, 0.09516128897666931, -0.04155918210744858, 0.015219896100461483, -0.02417820878326893, 0.0549689456820488, 0.0004912064177915454, 0.028703542426228523, 0.0258590467274189, 0.02729976549744606, 0.005956816021353006, -0.01831374689936638, -0.008681251667439938, 0.008076334372162819, 0.008122511208057404, 0.03773573786020279, -0.07669054716825485, 0.029183780774474144, -0.033118050545454025, -0.014471830800175667, -0.005906021688133478, 0.03256392851471901, 0.0036248841788619757, 0.02179548144340515, -0.00037056938163004816, -0.006552497856318951, -0.03647972643375397, 0.011913632042706013, -0.03727396950125694, -0.010121969506144524, 0.01722397282719612, 0.03572242707014084, 0.020521000027656555, -0.050351258367300034, -0.006654086988419294, -0.027262823656201363, 0.00723129790276289, 0.012652462348341942, -0.029922612011432648, 0.0476914718747139, -0.011045507155358791, -0.012181458063423634, -0.012264576740562916, 0.04898442327976227, 0.041300591081380844, 0.0775771364569664, -0.046139929443597794, -0.03574089705944061, 0.02092735655605793, 0.043406255543231964, 0.0011388370767235756, -0.019708286970853806, -0.029719432815909386, -0.06634692847728729, -0.07074296474456787, -0.05168115347623825, -0.01477659773081541, 0.0792025625705719, 0.04632463678717613, -0.010657621547579765, 0.07683830708265305, -0.03620266541838646, -0.007503741420805454, -0.004035858437418938, -0.04543804004788399, 0.027133528143167496, 0.006450908724218607, -0.03827138990163803, 0.03219451382756233, 0.00972484890371561, -0.021481478586792946, 0.014675009064376354, -0.057628732174634933, 0.023624086752533913, -0.021666187793016434, 0.0018632366554811597, 0.0010707261972129345, 0.009212285280227661, -0.04115282744169235, -0.002017929218709469, 0.027170469984412193, -0.05408234894275665, -0.00539807602763176, 0.049834076315164566, -0.012292282655835152, 0.03563007339835167, 0.012218399904668331, 0.032545458525419235, 0.060510169714689255, -0.011202508583664894, 0.03400464728474617, 0.016882263123989105, -0.009881850332021713, -0.06361325830221176, -0.02480621449649334, -0.03007037751376629, -0.017787329852581024, -0.05038819834589958, 0.07787267118692398, -0.05770261585712433, -0.046767931431531906, -0.0525677464902401, -0.016226552426815033, 0.0054257819429039955, -0.051607269793748856, 0.04296295717358589, -0.03908410295844078, -0.05858921259641647, -0.0030338203068822622, 0.0005174695397727191, 0.013151172548532486, 0.09087608009576797, -0.023494791239500046, -0.0034055442083626986, -0.004834718070924282, 0.006030699238181114, -0.03640584275126457, 0.04189165681600571, -0.046767931431531906, 0.00021154778369236737, 0.01477659773081541, 0.018766280263662338, -0.034743476659059525, 0.0006360863917507231, -0.0005067911115474999, 0.008884429931640625, -0.043701790273189545, 0.06797235459089279, 0.0019775244873017073, 0.0014280197210609913, 0.049353837966918945, -0.001567704719491303, -0.03529759868979454, 0.09191043674945831, -0.05068373307585716, 0.027262823656201363, 0.07861150056123734, -0.09021113067865372, -0.061618413776159286, 0.004839336033910513, 0.026948820799589157, 0.011747395619750023, -0.03647972643375397, -0.01017738226801157, 0.020133115351200104, -0.0004002957430202514, 0.034115470945835114, 0.011100918985903263, 0.061618413776159286, 0.027041174471378326, -0.024159738793969154, 0.006760293617844582, -0.025729751214385033, 0.0050425142981112, -0.04181777313351631, 0.032397691160440445, -0.08444825559854507, -0.042408835142850876, -0.010029615834355354, 0.007910097949206829, -0.021813953295350075, -0.0035440747160464525, 0.042593542486429214, 0.04107894375920296, -0.005638195667415857, -0.00468233460560441, -0.033838409930467606, 0.017002323642373085, 0.04263048619031906, -0.006363172549754381, -0.017759623005986214, -0.05024043470621109, -0.0020617973059415817, 0.002017929218709469, -0.060029931366443634, 0.0034170884173363447, 0.029386959969997406, -0.06424126029014587, -0.04625075310468674, 0.04746982082724571, -0.016291199252009392, 0.00021717559138778597, 0.004686952102929354, 0.024455269798636436, 0.05149644613265991, -0.008062480948865414, -0.022294191643595695, -0.006030699238181114, 0.05966051667928696, 0.02901754528284073, -0.00432215491309762, 0.005947580561041832, 0.04916913062334061, 0.00513486796990037, -0.03782809153199196, 0.057591792196035385, -0.017602622509002686, 0.024732330814003944, 0.026523994281888008, 0.008805928751826286, -0.004349861294031143, -0.011405686847865582, -0.04780229553580284, -0.027170469984412193, -0.03688608482480049, -0.0008190622320398688, -0.04540109634399414, -0.0889551192522049, 0.021185947582125664, 0.012126046232879162, 0.029719432815909386, 0.012809463776648045, 0.024935510009527206, 0.007956274785101414, -0.02342090755701065, 0.017519503831863403, 0.020428646355867386, -0.021518420428037643, -0.012107575312256813, -0.009203050285577774, 0.04133753478527069, 0.009290786460042, -0.02026241086423397, -0.010399030521512032, 0.013871531933546066, 0.003966593183577061, 0.007836214266717434, 0.01810133270919323, -0.03683067113161087, 0.02609916590154171, 0.01130409725010395, -0.01750103384256363, 0.011747395619750023, 0.03646125644445419, 0.07443711161613464, 0.0029876434709876776, -0.0013818427687510848, 0.018932515755295753, 0.049353837966918945, -0.0509423203766346, -0.0007671132334508002, 0.03671984747052193, -0.043221548199653625, 0.003315499285236001, 0.03647972643375397, -0.021352184936404228, -0.015469251200556755, -0.010574502870440483, 0.0839310735464096, 0.046915698796510696, -0.018766280263662338, -0.006903442088514566, 0.015238367021083832, -0.0010915057500824332, -0.013788413256406784, 0.08540873974561691, 0.02203560248017311, -0.07159262150526047, 0.02816789038479328, 0.03243463113903999, -0.0145364785566926, 0.020133115351200104, -0.005314957816153765, 0.012366165407001972, -0.01581096090376377, -0.001331048202700913, -0.04942772164940834, 0.007633036468178034, -0.02149995043873787, -0.04314766824245453, -0.030162731185555458, -0.002765994518995285, 0.018858633935451508, -0.02931307628750801, 0.016189610585570335, 0.10284512490034103, 0.05153338611125946, 0.007997834123671055 ]
31,947
sonetel.recording
delete
Delete a call recording. :param rec_id: The ID of the recording that should be deleted :returns: A representation of the deleted recording.
def delete(self, rec_id: str) -> dict: """ Delete a call recording. :param rec_id: The ID of the recording that should be deleted :returns: A representation of the deleted recording. """ url = f'{self._url}/{rec_id}' return util.send_api_request(token=self._token, uri=url, method='delete')
(self, rec_id: str) -> dict
[ -0.03774499520659447, 0.019155418500304222, -0.043669693171978, 0.04217187687754631, -0.061011090874671936, -0.025829026475548744, -0.054187700152397156, 0.11796142905950546, -0.020137321203947067, 0.001162888715043664, -0.062475621700286865, 0.03624717891216278, 0.024880409240722656, -0.007414195220917463, 0.009902236051857471, -0.04396925866603851, -0.000777512788772583, 0.010884138755500317, 0.014994814991950989, -0.05911385267972946, 0.0014291673433035612, 0.054587118327617645, -0.022167695686221123, 0.0278594009578228, -0.05255674198269844, 0.11749543994665146, 0.023299379274249077, 0.03930938243865967, -0.005496157333254814, 0.025396322831511497, 0.016742268577218056, -0.01762431673705578, -0.02275018021464348, 0.049228258430957794, -0.061177514493465424, -0.002687749918550253, -0.03168715536594391, 0.0025774938985705376, -0.18359911441802979, -0.0005767636466771364, -0.057616036385297775, 0.0619763508439064, 0.04044106602668762, -0.0024318727664649487, 0.028808018192648888, 0.040407780557870865, -0.012565022334456444, 0.016201389953494072, -0.007035580463707447, -0.03468279168009758, 0.02521325647830963, 0.04626591131091118, -0.033318113535642624, -0.022284192964434624, 0.017840666696429253, -0.053555287420749664, 0.002897860249504447, -0.0014634922845289111, 0.011649689637124538, -0.03246935084462166, 0.016792194917798042, -0.0027834437787532806, -0.0008024763665162027, -0.015668831765651703, 0.03484921529889107, -0.006374044343829155, 0.016983583569526672, -0.015161238610744476, 0.031487446278333664, -0.04346998408436775, -0.001862910226918757, -0.05019351840019226, -0.00006549699901370332, -0.03178701177239418, 0.051425058394670486, -0.027759546414017677, 0.0073309834115207195, 0.019621405750513077, -0.03261912986636162, -0.0383441224694252, 0.029390502721071243, -0.022633682936429977, 0.02691078372299671, 0.031620584428310394, -0.020270459353923798, 0.0162762813270092, 0.06334102898836136, -0.014179336838424206, -0.029873132705688477, 0.05202418565750122, 0.023182881996035576, -0.044601667672395706, -0.04899526759982109, -0.04207202047109604, 0.017141686752438545, -0.04979410395026207, 0.0064322929829359055, 0.008495952002704144, -0.035814475268125534, -0.038044556975364685, -0.0018036216497421265, -0.05771589279174805, -0.06547125428915024, -0.015843577682971954, -0.0030892479699105024, -0.06723535060882568, 0.04626591131091118, -0.08527573198080063, 0.036480169743299484, 0.049194976687431335, -0.009902236051857471, -0.008329528383910656, -0.02353237383067608, -0.030172696337103844, 0.043569840490818024, 0.04160603508353233, 0.019638048484921455, -0.03837740793824196, -0.05372171103954315, -0.023682154715061188, 0.016051607206463814, -0.016434384509921074, -0.027543194591999054, -0.007921788841485977, 0.021185792982578278, 0.004738927353173494, -0.006336599122732878, 0.042904142290353775, 0.05951327085494995, 0.0026648666244000196, 0.008483470417559147, -0.01358853094279766, -0.00946121197193861, -0.000227402983000502, 0.014387366361916065, 0.09206583350896835, 0.10717714577913284, 0.03296862170100212, -0.0017786580137908459, 0.01853964850306511, 0.0011275234865024686, -0.0060703204944729805, 0.032136499881744385, 0.03245270624756813, 0.02681092917919159, -0.020952798426151276, -0.057882316410541534, -0.02181820385158062, -0.07169552147388458, 0.05312258377671242, -0.05042651295661926, 0.03140423446893692, 0.06493870168924332, -0.020703162997961044, -0.016933655366301537, 0.03180365264415741, -0.009336394257843494, 0.03484921529889107, 0.011724580079317093, -0.025446251034736633, 0.06690250337123871, 0.07529027760028839, 0.03431665897369385, -0.050260089337825775, 0.024880409240722656, -0.008887048810720444, 0.00818390678614378, 0.02075308933854103, -0.027243630960583687, 0.01392137911170721, -0.024897051975131035, 0.03313504531979561, 0.04862913489341736, -0.03393388167023659, -0.0309881754219532, -0.0011098409304395318, 0.021851489320397377, 0.02983984723687172, -0.004360312595963478, -0.009444570168852806, 0.028075752779841423, -0.003621805226430297, 0.023615585640072823, 0.047231171280145645, 0.0543874092400074, -0.01787395216524601, -0.0019523631781339645, -0.0024131499230861664, 0.0221843384206295, -0.03325154259800911, -0.015161238610744476, -0.02301645837724209, 0.040008362382650375, -0.008371134288609028, 0.015868540853261948, 0.0106428237631917, 0.06623680889606476, -0.03841068968176842, -0.021452071145176888, -0.042105305939912796, 0.005587690509855747, 0.0067817834205925465, -0.0226170402020216, -0.06843360513448715, -0.006582074798643589, 0.005113381426781416, 0.07995015382766724, -0.01571875996887684, -0.08461003005504608, 0.057616036385297775, 0.033035192638635635, -0.0015446239849552512, 0.043669693171978, 0.0009652600274421275, 0.02168506570160389, -0.04706474766135216, -0.03233620896935463, 0.02509675920009613, 0.050260089337825775, -0.009952163323760033, 0.0039816973730921745, -0.011583119630813599, 0.0016361572779715061, -0.058614581823349, -0.011624726466834545, 0.05348871648311615, 0.027925970032811165, 0.018689431250095367, -0.03677973523736, -0.06460584700107574, 0.03250263258814812, -0.009660921059548855, 0.035281918942928314, -0.005238199606537819, -0.011616405099630356, -0.04037449508905411, -0.04090705141425133, -0.03674644976854324, 0.058614581823349, -0.02955692633986473, 0.08054928481578827, 0.04912840574979782, 0.04456838592886925, 0.040274642407894135, -0.006519665475934744, 0.030555471777915955, 0.040274642407894135, 0.028741449117660522, 0.009419606067240238, -0.07868533581495285, 0.042238447815179825, -0.06264204531908035, 0.009511139243841171, 0.011799471452832222, 0.05002709478139877, 0.005995429586619139, -0.021052652969956398, 0.009169969707727432, 0.021119223907589912, -0.012115676887333393, -0.023981718346476555, 0.05292287468910217, -0.0038693612441420555, 0.011133775115013123, -0.0004371234099380672, 0.030272550880908966, 0.01629292219877243, 0.012340350076556206, 0.01775745488703251, 0.020054109394550323, 0.037645138800144196, -0.0286415945738554, 0.02692742645740509, -0.059346847236156464, -0.03275227174162865, -0.002282090950757265, -0.0010437914170324802, 0.018090303987264633, 0.006673607975244522, -0.0018077822169288993, 0.0014406089903786778, -0.04350326955318451, 0.07355947047472, 0.015585620887577534, -0.0037819885183125734, 0.026977352797985077, 0.02905765362083912, 0.04520079493522644, -0.003715418977662921, 0.015136275440454483, 0.032136499881744385, 0.010526326484978199, -0.05482011288404465, 0.03727900609374046, -0.06297489255666733, 0.016284601762890816, -0.031737081706523895, -0.023732082918286324, 0.031187882646918297, 0.08807165175676346, -0.0293072909116745, 0.029756635427474976, 0.06830046325922012, -0.0075556556694209576, -0.0775536447763443, 0.014387366361916065, 0.06983156502246857, -0.012689840979874134, 0.006166014354676008, 0.002388186287134886, -0.041572749614715576, 0.0240649301558733, -0.03561476618051529, -0.03494906798005104, 0.018240084871649742, 0.04320370778441429, -0.015294378623366356, 0.029923060908913612, 0.0059455023147165775, 0.07475772500038147, 0.018090303987264633, 0.016010001301765442, -0.0139297004789114, 0.08634084463119507, 0.06836703419685364, -0.1007198914885521, -0.012831301428377628, 0.028075752779841423, 0.012223852798342705, 0.03115459904074669, -0.028025824576616287, -0.02143542841076851, -0.014944887720048428, -0.030655326321721077, 0.06723535060882568, -0.030039556324481964, 0.027959255501627922, -0.009893914684653282, -0.01070107240229845, 0.06387358158826828, -0.008537557907402515, -0.023415876552462578, 0.03824426606297493, 0.015593941323459148, -0.009544424712657928, 0.011674653738737106, 0.006007911171764135, -0.015593941323459148, 0.05495325103402138, 0.029257362708449364, 0.016259638592600822, -0.011333484202623367, 0.01918870396912098, 0.02143542841076851, 0.06124408170580864, -0.05035994574427605, 0.03386731073260307, 0.019887683913111687, -0.025179972872138023, -0.02521325647830963, -0.013055973686277866, 0.016417741775512695, -0.029373859986662865, 0.01720825582742691, 0.008229673840105534, -0.007846898399293423, -0.043303560465574265, -0.044135682284832, -0.019138775765895844, 0.0012429802445694804, -0.0394425205886364, 0.012298744171857834, -0.01176618691533804, 0.0425712950527668, 0.006644483655691147, 0.06057838723063469, 0.048695702105760574, 0.00825047679245472, -0.008142300881445408, 0.023432519286870956, -0.05871443450450897, 0.022966530174016953, 0.01531102042645216, 0.001081756898202002, -0.027543194591999054, 0.0047888546250760555, -0.06923244148492813, -0.012606628239154816, -0.041073478758335114, 0.0271937046200037, 0.07548999041318893, -0.018589576706290245, -0.047364309430122375, 0.0035510750021785498, -0.07036412507295609, -0.053289007395505905, -0.010759320110082626, -0.01109216921031475, -0.007401713635772467, -0.014695251360535622, -0.011067205108702183, 0.020520096644759178, -0.08101527392864227, 0.007089668419212103, 0.03511549159884453, 0.06560439616441727, -0.0145953968167305, -0.04313713684678078, -0.01176618691533804, -0.07595597952604294, 0.059313561767339706, -0.07029755413532257, 0.019804472103714943, 0.04307056590914726, 0.04230501502752304, 0.022134410217404366, -0.03641360253095627, 0.029423788189888, -0.03997507691383362, 0.021069295704364777, 0.045001085847616196, 0.04556692764163017, 0.00601207185536623, 0.02747662551701069, 0.015693796798586845, 0.03088832087814808, -0.009003546088933945, 0.0001193573116324842, 0.03340132534503937, -0.050260089337825775, -0.009344715625047684, -0.0269607100635767, 0.018173515796661377, -0.013738312758505344, -0.010351581498980522, 0.04966096207499504, 0.01759103126823902, 0.05928027629852295, -0.013771597295999527, 0.04160603508353233, 0.004347830545157194, -0.043536555022001266, -0.018955709412693977, -0.08973589539527893, -0.012981082312762737, 0.012723125517368317, 0.036546740680933, -0.0007941551739349961, 0.04942796751856804, 0.003709177952259779, 0.073093481361866, -0.008271279744803905, 0.02324945293366909, -0.04676518216729164, -0.011907647363841534, -0.04270443320274353, -0.016758911311626434, 0.026611220091581345, -0.03348453715443611, -0.06007911264896393, 0.0067734625190496445, 0.0601789690554142, -0.06740177422761917, -0.0673019215464592, -0.037245720624923706, 0.09958820790052414, 0.03721243888139725, 0.036580026149749756, -0.016193069517612457, -0.026727717369794846, 0.0302059818059206, 0.022067841142416, -0.010925744660198689, 0.06543797254562378, -0.0004509054124355316, 0.04942796751856804, 0.02471398375928402, -0.014778463169932365, -0.01564386859536171, 0.030505545437335968, 0.038676969707012177, -0.06723535060882568, -0.05961312726140022, 0.0018119427841156721, 0.017308110371232033, -0.0024297924246639013, -0.054487261921167374, 0.010825890116393566, -0.023748723790049553, -0.02944043092429638, 0.017125044018030167, 0.011533192358911037, -0.002485960489138961, -0.04283757135272026, 0.04396925866603851, -0.03335139900445938, 0.008084052242338657, 0.00532141188159585, -0.009777418337762356, -0.029357217252254486, 0.003080926835536957, -0.03624717891216278, -0.03827755153179169, -0.010118587873876095, -0.028591666370630264, -0.007260253187268972, -0.012323707342147827, 0.05651763826608658, -0.03406701982021332, -0.0027168740052729845, -0.08500944823026657, 0.04862913489341736, 0.023166239261627197, 0.021368859335780144, -0.0546204037964344, -0.02349908836185932, -0.030938247218728065, -0.0407739132642746, -0.05518624559044838, 0.003110051155090332, 0.05648435279726982, 0.03313504531979561, -0.004381115548312664, 0.009802381508052349, 0.021585211157798767, -0.0668359324336052, -0.062375765293836594, -0.017108401283621788, 0.02905765362083912, 0.010293332859873772, -0.021734992042183876, 0.06147707626223564, 0.028808018192648888, -0.02982320636510849, 0.014487220905721188, 0.011682974174618721, -0.04626591131091118, -0.06230919808149338, -0.03624717891216278, 0.011666332371532917, -0.00755149545148015, -0.004162683617323637, -0.022051198408007622, -0.05808202549815178, -0.04773044213652611, 0.022550471127033234, 0.03940923511981964, 0.022633682936429977, 0.02245061658322811, 0.019105490297079086, 0.015360947698354721, -0.038044556975364685, 0.018190158531069756, -0.04230501502752304, -0.051425058394670486, 0.05338886380195618, 0.016850443556904793, -0.041040193289518356, 0.023948432877659798, -0.046199340373277664, -0.027393413707613945, 0.022816749289631844, 0.06869988143444061, 0.010376544669270515, -0.0026648666244000196, 0.028608309105038643, 0.0341169498860836, -0.020819660276174545, 0.00946121197193861, -0.056983623653650284, -0.048795558512210846, -0.012956119142472744, 0.039608944207429886, 0.028857946395874023, -0.07662167400121689, 0.02389850653707981, -0.009036830626428127, 0.00920325517654419, -0.004254217259585857, 0.04114004597067833, 0.022433973848819733, 0.015410874970257282, -0.011058883741497993, -0.043702978640794754, -0.033184971660375595, 0.006611199118196964, 0.003628046251833439, -0.020137321203947067, 0.013738312758505344, 0.019754545763134956, -0.00945289060473442, 0.021984629333019257, 0.006274189800024033, -0.05268988385796547, -0.021135864779353142, 0.03977536782622337, 0.04323698952794075, -0.024514274671673775, -0.05821516364812851, 0.0177241712808609, 0.03957565873861313, -0.023216167464852333, 0.03090496174991131, -0.03864368423819542, -0.015926789492368698, 0.030821749940514565, -0.062475621700286865, 0.008154782466590405, -0.03300190716981888, -0.08054928481578827, -0.04506765678524971, -0.008612449280917645, -0.044734809547662735, 0.034616220742464066, 0.04952782392501831, -0.043303560465574265, 0.008196388371288776, 0.00387352192774415, -0.031603943556547165, 0.004651554860174656, -0.0214021448045969, -0.04626591131091118, -0.025662602856755257, 0.01030997559428215, -0.016650734469294548, 0.039742082357406616, -0.031054744496941566, -0.0014343680813908577, -0.06297489255666733, -0.0293072909116745, -0.019504908472299576, 0.031603943556547165, -0.006673607975244522, 0.04783029854297638, 0.03494906798005104, -0.04899526759982109, -0.014096124097704887, -0.05115877836942673, 0.037378862500190735, 0.051591482013463974, 0.06713549792766571, 0.001822344260290265, -0.053954705595970154, -0.005637617781758308, -0.0399085097014904, 0.06443942338228226, -0.013313931412994862, -0.031171241775155067, -0.0026939907111227512, -0.044368676841259, -0.01878928579390049, -0.012365313246846199, -0.04030792787671089, -0.046698614954948425, 0.022633682936429977, 0.019471624866127968, 0.05022680386900902, 0.039242811501026154, -0.05641778185963631, 0.009020187892019749, -0.009411284700036049, -0.03714586794376373, -0.024381136521697044, -0.049194976687431335, -0.01169129554182291, -0.014037876389920712, 0.008084052242338657, -0.023432519286870956, 0.005042651202529669, -0.0021489516366273165, -0.01837322488427162, -0.014345760457217693, 0.02456420287489891, 0.026744358241558075, -0.031038101762533188, -0.0038901641964912415, -0.020070750266313553, 0.0177241712808609, 0.0651051253080368, -0.007767846807837486, -0.020570022985339165, 0.036047469824552536, 0.053555287420749664, -0.0143207972869277, 0.025130044668912888, 0.027909327298402786, 0.02260039746761322, 0.00423965509980917, -0.010875817388296127, -0.002240485046058893, -0.011258592829108238, -0.01348035503178835, -0.013646779581904411, -0.027093850076198578, -0.052357032895088196, -0.019887683913111687, -0.03250263258814812, -0.02023717574775219, -0.018689431250095367, 0.014761821366846561, -0.02366551198065281, 0.011058883741497993, 0.02275018021464348, 0.010484720580279827, 0.02155192568898201, -0.017274824902415276, 0.020153963938355446, 0.0085292374715209, 0.01785730943083763, 0.004056588280946016, 0.00851675495505333, 0.0394425205886364, -0.012140640988945961, 0.028025824576616287, -0.01392137911170721, -0.0019159578951075673, -0.010534647852182388, -0.00051565479952842, -0.0011826514964923263, 0.041339755058288574, -0.00008925794827518985, 0.0013886013766750693, 0.03458293527364731, -0.005504478234797716, 0.009378000162541866, -0.015469123609364033, 0.04190559685230255, 0.03155401721596718, -0.021452071145176888, -0.029540283605456352, 0.0030351602472364902, -0.042904142290353775, -0.03390059620141983, -0.01625131629407406, 0.016908692196011543, -0.020420242100954056, -0.008104855194687843, -0.059346847236156464, 0.0829457938671112, -0.011866041459143162, -0.06180992349982262, 0.04773044213652611, 0.009336394257843494, 0.006731856614351273, -0.022234264761209488, 0.05851472541689873, 0.006386526394635439, 0.012556700967252254, 0.04313713684678078, -0.037778280675411224, 0.033850669860839844, 0.021119223907589912, 0.0016756830736994743, -0.0067526595667004585, -0.004730605985969305, -0.0011181621812283993, -0.09346379339694977, 0.014803427271544933, -0.0032910373993217945, 0.041839029639959335, -0.008000840432941914, -0.00348242511972785, -0.024930335581302643, -0.0118161141872406, 0.008171425200998783, 0.019405053928494453, 0.037645138800144196, 0.029257362708449364 ]
31,948
sonetel.recording
get
Get a list of all the call recordings. :param start_time: The start timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20201231T23:59:59. Limit the results to recordings created after this timestamp. :param end_time: The end timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20221123T18:59:59. Limit the results to recordings created before this timestamp. :param rec_id: The unique recording ID. If not included, returns all the recordings. :param file_access_details: Boolean. Include the details needed to download recordings. :param voice_call_details: Boolean. Include the details of the voice calls.
def get(self, start_time: str = None, end_time: str = None, file_access_details: bool = False, voice_call_details: bool = False, rec_id: str = None ): """ Get a list of all the call recordings. :param start_time: The start timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20201231T23:59:59. Limit the results to recordings created after this timestamp. :param end_time: The end timestamp in the format YYYYMMDDTHH:MM:SSZ. Example 20221123T18:59:59. Limit the results to recordings created before this timestamp. :param rec_id: The unique recording ID. If not included, returns all the recordings. :param file_access_details: Boolean. Include the details needed to download recordings. :param voice_call_details: Boolean. Include the details of the voice calls. """ url = self._url # Prepare the request URL based on the params passed to the method if rec_id: # Get a single recording url += f'/{rec_id}' else: # Search for and return multiple recordings url += f'?account_id={self._accountid}' if util.is_valid_date(start_time) and util.is_valid_date(end_time) and util.date_diff(start_time, end_time): url += f'&created_date_max={end_time}&created_date_min={start_time}' fields = [] if file_access_details: fields.append('file_access_details') if voice_call_details: fields.append('voice_call_details') if len(fields) > 0: url += '&fields=' + ','.join(fields) return util.send_api_request(token=self._token, uri=url, method='get')
(self, start_time: Optional[str] = None, end_time: Optional[str] = None, file_access_details: bool = False, voice_call_details: bool = False, rec_id: Optional[str] = None)
[ -0.031165311112999916, 0.018549934029579163, -0.07007753103971481, 0.060411661863327026, -0.05134991183876991, -0.033901602029800415, -0.06705694645643234, 0.012606492266058922, -0.012570956721901894, -0.06186864897608757, -0.039445262402296066, 0.012482115998864174, 0.022032488137483597, 0.02704310230910778, 0.06769660115242004, 0.03377722576260567, -0.010127837769687176, -0.0172262080013752, -0.027114175260066986, -0.05092347785830498, 0.025994783267378807, 0.033190879970788956, -0.018816456198692322, 0.03308426961302757, -0.021517213433980942, 0.10930957645177841, -0.006991761736571789, 0.002443118719384074, -0.0444558747112751, 0.07348901033401489, 0.05664481967687607, -0.010483200661838055, -0.039658479392528534, 0.010776374489068985, -0.011691433377563953, 0.030223598703742027, -0.005086129065603018, -0.00163133698515594, -0.1416475772857666, 0.05913235619664192, -0.03418589383363724, -0.008351024240255356, 0.04498891904950142, 0.03901882842183113, -0.014969654381275177, 0.0018556597642600536, -0.02528405748307705, -0.0251596812158823, 0.016364453360438347, -0.023880375549197197, 0.06037612631917, 0.062295086681842804, -0.052096176892519, -0.06119346246123314, -0.003866790561005473, -0.047760751098394394, -0.05902574956417084, 0.011780274100601673, 0.026616668328642845, -0.014294465072453022, -0.020042456686496735, -0.0203800518065691, 0.04932434484362602, -0.016524367034435272, 0.00047862916835583746, 0.03455902636051178, -0.018167918547987938, -0.03423919901251793, 0.02542620338499546, 0.01327279768884182, 0.004957309924066067, 0.01352155115455389, -0.01823010854423046, -0.03317311033606529, 0.016142351552844048, -0.0056014047004282475, -0.020593270659446716, 0.0331198051571846, -0.033226415514945984, -0.04036920517683029, 0.0233117938041687, 0.037099868059158325, -0.01482750941067934, 0.013494899496436119, -0.010714186355471611, 0.040120452642440796, -0.007817979902029037, -0.033901602029800415, -0.018079077824950218, -0.008964024484157562, -0.03221363201737404, -0.020397819578647614, -0.029726091772317886, 0.03235577419400215, -0.020237907767295837, -0.08443418145179749, -0.040973320603370667, -0.015404974110424519, -0.09232323616743088, 0.0090928440913558, -0.03590940311551094, -0.07139237225055695, -0.029637251049280167, 0.010456548072397709, -0.0064365072175860405, -0.09346039593219757, 0.02020237036049366, -0.027469538152217865, 0.023187417536973953, 0.03207148611545563, -0.041364219039678574, -0.018709847703576088, -0.01902967318892479, -0.024271273985505104, -0.004735208116471767, 0.06997092068195343, 0.04495338350534439, 0.012695332989096642, -0.08514490723609924, -0.037277549505233765, 0.03567841649055481, -0.030667802318930626, 0.0060722604393959045, -0.023365098983049393, -0.02199695259332657, -0.007529247552156448, -0.02874884381890297, 0.012650912627577782, 0.059736475348472595, -0.027611684054136276, 0.01560930721461773, 0.0006601972854696214, -0.021677125245332718, 0.04729877784848213, 0.03006368689239025, 0.08507383614778519, 0.06972216814756393, 0.06481815874576569, -0.018425557762384415, 0.05092347785830498, -0.022103561088442802, -0.03877007216215134, 0.08144913613796234, -0.01140714343637228, -0.02190811187028885, -0.03006368689239025, 0.0014803078956902027, -0.04872022941708565, -0.034310270100831985, 0.05831502377986908, -0.006631956901401281, -0.02263660542666912, 0.019918080419301987, -0.0039956094697117805, -0.0033737248741090298, -0.01970486342906952, 0.004162185825407505, 0.0309520922601223, 0.016026858240365982, 0.03033020906150341, -0.015102915465831757, 0.027967046946287155, -0.0017412772867828608, -0.08571349084377289, 0.019136281684041023, 0.004570852965116501, -0.02137506753206253, 0.010563156567513943, 0.01867431029677391, -0.0022498902399092913, -0.00741375470533967, 0.04847147688269615, 0.013921334408223629, -0.04157743975520134, -0.04626822471618652, -0.08884067833423615, -0.0019578265491873026, 0.03990723192691803, 0.009692518040537834, 0.007840190082788467, 0.003913431894034147, -0.02034451626241207, -0.033635079860687256, 0.032515689730644226, 0.031058702617883682, 0.005779086146503687, -0.006973993498831987, -0.010607576929032803, 0.02205025777220726, 0.007267167791724205, -0.025177448987960815, -0.013796958141028881, 0.011709202080965042, -0.03180496394634247, -0.03365284949541092, -0.019331732764840126, 0.06879822164773941, 0.03773952275514603, -0.029726091772317886, 0.019225122407078743, 0.012490999884903431, 0.00796456728130579, 0.004979520104825497, -0.04957310110330582, -0.0010388806695118546, 0.032693371176719666, 0.045735184103250504, -0.007760233245790005, -0.07093039900064468, 0.04562857374548912, -0.014809741638600826, -0.024129128083586693, 0.019491644576191902, -0.027682755142450333, -0.003877895651385188, 0.039622943848371506, -0.026918726041913033, 0.010856331326067448, 0.02546173892915249, 0.0038401384372264147, 0.02775382809340954, -0.07590547949075699, -0.05792412534356117, -0.02862446755170822, -0.002360941143706441, 0.05543658509850502, 0.01938503608107567, -0.004433149937540293, -0.07491046190261841, -0.07419973611831665, 0.02501753531396389, -0.015946902334690094, 0.012304434552788734, 0.006463159341365099, -0.05319780111312866, 0.009914619848132133, -0.012704216875135899, 0.02816249616444111, 0.028020350262522697, -0.02078871987760067, 0.05117223039269447, 0.06538674235343933, -0.014090131968259811, 0.006463159341365099, -0.046232689172029495, -0.08294165879487991, 0.01027886662632227, 0.056680355221033096, 0.027931509539484978, -0.03176942840218544, 0.025355130434036255, -0.0030072571244090796, -0.006942898966372013, -0.0256038848310709, 0.004393171519041061, -0.005996746011078358, -0.0191718190908432, -0.04331871494650841, 0.030756643041968346, -0.04950202628970146, 0.015316133387386799, 0.035216446965932846, -0.03663789480924606, -0.010021228343248367, 0.001277084811590612, 0.024271273985505104, -0.0027629451360553503, -0.006174427457153797, -0.01149598415941, 0.007507037371397018, -0.03274667635560036, -0.012393275275826454, -0.001036104396916926, -0.05380191653966904, -0.02322295308113098, -0.016506599262356758, 0.05660928040742874, -0.0008001214009709656, -0.0690469741821289, -0.024679940193891525, -0.054512642323970795, 0.021090777590870857, 0.03852131962776184, -0.027380697429180145, 0.062117405235767365, -0.06314795464277267, 0.03338632732629776, 0.060944706201553345, -0.041364219039678574, -0.007351566106081009, 0.038947753608226776, 0.018709847703576088, -0.04822272062301636, -0.029637251049280167, -0.03180496394634247, -0.010492084547877312, 0.008382118307054043, -0.09047535061836243, 0.025977015495300293, 0.0407601036131382, -0.040120452642440796, 0.030188063159585, 0.0827995166182518, 0.02064657397568226, -0.07555011659860611, -0.023649388924241066, 0.02672327682375908, -0.0337594598531723, 0.02313411235809326, -0.05920343101024628, -0.05003507062792778, 0.0019311743089929223, 0.027380697429180145, -0.03649575263261795, 0.009816895239055157, 0.029992613941431046, -0.04125761240720749, 0.07839301973581314, 0.017119599506258965, 0.10106515884399414, -0.010882982984185219, 0.056396063417196274, 0.04648144543170929, 0.017670411616563797, 0.07839301973581314, -0.07377330213785172, -0.01352155115455389, 0.06300581246614456, 0.0025497274473309517, 0.03427473455667496, -0.04360300675034523, -0.013903566636145115, 0.010900751687586308, 0.029548410326242447, 0.03370615467429161, 0.002725187921896577, -0.018194571137428284, -0.021854806691408157, 0.02348947525024414, 0.022778751328587532, 0.04161297529935837, -0.0392320454120636, 0.006196637637913227, -0.004333204124122858, 0.020770950242877007, 0.0056991297751665115, 0.0766872763633728, 0.005494796205312014, 0.032675601541996, -0.000319271202897653, -0.02555057965219021, -0.05511675775051117, 0.023063041269779205, 0.03837917372584343, 0.018301179632544518, -0.0021144081838428974, 0.008986234664916992, -0.025141913443803787, -0.017474962398409843, -0.01345047913491726, -0.027611684054136276, 0.0564315989613533, -0.04253691807389259, 0.06481815874576569, -0.009550373069941998, -0.00014422729145735502, -0.0001596356014488265, -0.005588078871369362, -0.009097285568714142, 0.016479946672916412, -0.07945910096168518, -0.012197825126349926, 0.002556390594691038, 0.04449141398072243, 0.009106169454753399, 0.020806487649679184, 0.03306649997830391, -0.006107796914875507, -0.012695332989096642, 0.056360527873039246, -0.034256964921951294, 0.03349293768405914, -0.022121328860521317, -0.008333255536854267, 0.019864775240421295, -0.010092301294207573, 0.005894578993320465, 0.01844332553446293, -0.006400971207767725, -0.008879626169800758, 0.046374835073947906, 0.0008650860982015729, -0.03127191960811615, -0.02622576802968979, -0.03884114697575569, -0.06169096753001213, 0.03121861442923546, 0.0285356268286705, 0.00581462262198329, -0.034399110823869705, -0.00027165815117768943, -0.025408433750271797, -0.038805607706308365, 0.029690556228160858, 0.013725885190069675, 0.008253299631178379, 0.05799519643187523, -0.08471847325563431, -0.00823553092777729, -0.05970093607902527, -0.0003983949136454612, -0.08336809277534485, -0.039303116500377655, 0.03546519950032234, -0.011416027322411537, 0.031964875757694244, -0.015938017517328262, 0.04712109640240669, 0.0010860773036256433, 0.06595531851053238, 0.033812761306762695, -0.02739846520125866, 0.023702694103121758, 0.014321117661893368, 0.03578502684831619, 0.014463262632489204, 0.03383053094148636, 0.0033737248741090298, -0.006809638347476721, -0.06464047729969025, 0.03159174695611, 0.04569964483380318, -0.035482969135046005, -0.008919604122638702, 0.024004751816391945, 0.04584179073572159, 0.0037712869234383106, 0.008919604122638702, 0.01943834125995636, -0.020984169095754623, 0.031431831419467926, -0.036424677819013596, -0.0385923907160759, -0.04257245361804962, -0.01347713079303503, -0.029299655929207802, -0.00818666908890009, -0.010163374245166779, 0.06488922983407974, -0.020930863916873932, 0.009443764574825764, 0.024804318323731422, 0.051456522196531296, -0.02947733737528324, 0.016231192275881767, -0.04516660049557686, -0.007675834931433201, 0.01327279768884182, 0.005312672816216946, -0.04626822471618652, 0.0450955294072628, 0.024555563926696777, -0.015529351308941841, -0.04800950363278389, 0.01709294691681862, 0.07562118768692017, -0.013192840851843357, 0.031609512865543365, -0.060767024755477905, -0.05280689895153046, 0.032462384551763535, 0.008364349603652954, -0.040333669632673264, 0.02073541469871998, 0.06663051247596741, 0.03343963250517845, 0.01170031726360321, 0.0077646756544709206, 0.03823702782392502, -0.03368838503956795, 0.04733431339263916, -0.07590547949075699, -0.053517624735832214, 0.002534180413931608, 0.033812761306762695, -0.02825133688747883, -0.0048951213248074055, 0.03073887526988983, -0.06837178766727448, -0.05007060617208481, 0.04601947218179703, 0.05763983353972435, 0.00027957052225247025, 0.02771829254925251, -0.009772474877536297, 0.010465431958436966, 0.03249792009592056, -0.02668774127960205, 0.013583740219473839, 0.04349639639258385, 0.023045271635055542, -0.034718938171863556, 0.038627926260232925, 0.02196141704916954, -0.013503783382475376, 0.07213862985372543, -0.061442214995622635, 0.02119738608598709, -0.04527321085333824, -0.007951240986585617, -0.010625345632433891, 0.03518090769648552, 0.016977453604340553, 0.01705741137266159, -0.049111127853393555, -0.020895328372716904, -0.030188063159585, 0.020486660301685333, -0.0684073269367218, -0.0017168461345136166, 0.021250691264867783, 0.07739800214767456, 0.0035869425628334284, 0.0023764881771057844, 0.017625991255044937, -0.022654373198747635, -0.09232323616743088, -0.01795470155775547, -0.03823702782392502, 0.010456548072397709, 0.01902967318892479, 0.04783182218670845, 0.009274967014789581, -0.01705741137266159, 0.01673758402466774, 0.006871826481074095, -0.05330440774559975, -0.030756643041968346, -0.008044523186981678, 0.03233800828456879, 0.05781751498579979, -0.0004719661083072424, -0.019011905416846275, -0.04935988038778305, -0.04516660049557686, 0.03036574460566044, 0.037277549505233765, 0.04481123760342598, 0.06673712283372879, -0.015795873478055, 0.05287797376513481, -0.05913235619664192, 0.06236615777015686, -0.03091655671596527, -0.056893572211265564, 0.005801296327263117, 0.02690095826983452, -0.027167480438947678, -0.02272544614970684, -0.03335079178214073, 0.045735184103250504, 0.027522843331098557, -0.025710493326187134, 0.036602359265089035, -0.08720601350069046, 0.013334985822439194, 0.06286366283893585, 0.03535858914256096, 0.017243975773453712, -0.05931003764271736, -0.016186771914362907, 0.047583069652318954, -0.04161297529935837, 0.043354250490665436, -0.005010614171624184, 0.06499584019184113, -0.012686449103057384, 0.0012559851165860891, -0.005965651478618383, -0.010172258131206036, 0.07519475370645523, -0.01496077049523592, 0.006383202970027924, -0.03582056239247322, 0.0018756488570943475, -0.009337155148386955, -0.013121768832206726, -0.023382866755127907, 0.04019152373075485, 0.020593270659446716, 0.024377882480621338, 0.00328488415107131, -0.004080008249729872, 0.0003459234139882028, -0.010065648704767227, 0.09317610412836075, -0.03667343407869339, 0.01709294691681862, -0.03349293768405914, 0.01575145311653614, -0.009239430539309978, 0.028873221948742867, 0.021925879642367363, -0.03409705311059952, -0.03265783563256264, 0.01988254487514496, -0.02654559537768364, 0.011389375664293766, -0.042359236627817154, -0.013796958141028881, -0.003442576387897134, -0.00535265076905489, -0.0016491051064804196, 0.03432803973555565, 0.054477106779813766, -0.013859146274626255, -0.020308978855609894, 0.06652390211820602, 0.02110854536294937, -0.00039783967076800764, -0.006889594718813896, 0.0041466387920081615, -0.005765760317444801, 0.07334686815738678, -0.034541256725788116, 0.034043747931718826, 0.006512022111564875, -0.012899667024612427, -0.018603239208459854, -0.032782211899757385, 0.0072405156679451466, 0.021570516750216484, -0.002623021136969328, 0.054192814975976944, 0.03688665106892586, -0.018212338909506798, 0.04562857374548912, -0.011575940996408463, 0.01149598415941, 0.06083809956908226, -0.03367061913013458, 0.038450244814157486, -0.018958602100610733, -0.017306163907051086, 0.0035669533535838127, 0.05678696185350418, -0.04189726337790489, -0.03605154901742935, 0.018194571137428284, 0.009914619848132133, -0.037099868059158325, 0.016586555168032646, -0.01352155115455389, 0.0011815810576081276, 0.010465431958436966, 0.015955785289406776, 0.008844089694321156, -0.04772521182894707, -0.004279899876564741, 0.018212338909506798, -0.011202809400856495, -0.034665632992982864, 0.027469538152217865, -0.11307641863822937, -0.06353885680437088, -0.021073009818792343, -0.032142557203769684, 0.010927403345704079, 0.05330440774559975, 0.03436357527971268, 0.014498799107968807, -0.026474522426724434, 0.028731076046824455, 0.06805196404457092, -0.01305069588124752, 0.03567841649055481, -0.012588724493980408, -0.05259368196129799, 0.030881021171808243, -0.006027840077877045, 0.006649725139141083, 0.005876811221241951, -0.0003814596857409924, 0.04619715362787247, 0.031342990696430206, 0.025266289710998535, 0.01691526547074318, -0.027167480438947678, 0.004939541686326265, 0.007840190082788467, 0.01178915798664093, -0.007169442716985941, -0.03146737068891525, 0.0010066760005429387, 0.03176942840218544, -0.004739650525152683, -0.04392283409833908, -0.05071026086807251, 0.030134757980704308, 0.0309520922601223, -0.03335079178214073, 0.019633790478110313, 0.0490400567650795, 0.03335079178214073, 0.002636347198858857, -0.04349639639258385, 0.012428810819983482, 0.004368740599602461, 0.02384483814239502, -0.019864775240421295, 0.0035069859586656094, 0.019136281684041023, 0.008337697945535183, 0.009505952708423138, -0.04079563915729523, -0.06783874332904816, 0.03628253564238548, 0.029690556228160858, 0.031058702617883682, 0.04545089229941368, 0.03788166493177414, -0.0001279167045140639, 0.03329748660326004, -0.0392320454120636, 0.024591099470853806, 0.04733431339263916, -0.028731076046824455, 0.007800211664289236, -0.007471501361578703, -0.027096407487988472, -0.018390020355582237, -0.027700524777173996, 0.005512564443051815, -0.014729784801602364, 0.028340177610516548, -0.0420394092798233, -0.028855452314019203, -0.027469538152217865, 0.044349268078804016, 0.0076269726268947124, -0.029406264424324036, 0.03182273358106613, 0.02947733737528324, 0.027682755142450333, -0.055543191730976105, 0.015351669862866402, 0.04427819699048996, -0.044846776872873306, 0.021517213433980942, -0.055685337632894516, 0.03388383612036705, -0.023702694103121758, 0.02276098169386387, -0.03335079178214073, -0.00830216147005558, 0.03383053094148636, -0.05931003764271736, -0.010021228343248367, -0.005499238148331642, -0.002796260407194495, -0.015724800527095795, 0.03128968924283981, -0.0001861489872680977, 0.038272563368082047, -0.05117223039269447, 0.05373084172606468, 0.016035743057727814, 0.05714232474565506 ]
31,949
sonetel.users
User
Create and manage users in a Sonetel account
class User(util.Resource): """ Create and manage users in a Sonetel account """ def __init__(self, access_token: str): if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_ACCOUNT}{self._accountid}{const.API_ENDPOINT_USER}' def get(self, all_users: bool = False, userid: str = ''): """ Fetch details about all users or a specific user. If userid is not included with the request, details of the current user are fetched. :param all_users: Boolean. Optional. Get a list of all the users in the account. Defaults to False. :param userid: String. Optional. ID of a specific user to get the information for. """ url = self._url if userid: url += userid elif not all_users: url += self._userid return util.send_api_request( token=self._token, uri=url, method='get') if util.is_valid_token(self._decoded_token) else False def add(self, email: str, f_name: str, l_name: str, password: str, user_type: str = 'regular' ) -> dict: """ Adds a new user. Account admin privilege required. :param email: Required. String. The email address of the user. :param f_name: Required. String. The first name of the user :param l_name: Required. String. The last name of the user. :param password: Required. String. The password to be used. :param user_type: Required. String. The privilege level of the new user. Accepted values regular and admin. Defaults to regular. """ # Checks if not password: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='password cannot be empty' ) if not email: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='email cannot be empty' ) if not f_name: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='first name cannot be empty' ) if not l_name: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='last name cannot be empty' ) # Request url = self._url body = { "user_fname": f_name, "user_lname": l_name, "email": email, "password": password, "type": user_type } return util.send_api_request( token=self._token, uri=url, method='post', body=dumps(body) ) def delete(self, userid: str): """ Delete a user from your Sonetel account. :param userid: String. Required. The unique ID of the user to be deleted. """ if not userid: return util.prepare_error( code=const.ERR_USED_ID_EMPTY, message='user id cannot be empty' ) url = self._url + userid return util.send_api_request( token=self._token, uri=url, method='delete' ) def update(self, request: dict): """ update user settings """ raise NotImplementedError
(access_token: str)
[ -0.015810290351510048, -0.03371252864599228, -0.0005383871612139046, 0.013869205489754677, 0.0228907261043787, -0.05109177902340889, 0.00179022375959903, -0.03236483037471771, -0.0441722609102726, -0.0013363818870857358, 0.019109129905700684, -0.03391367569565773, 0.0336320698261261, 0.03884182125329971, -0.010052408091723919, 0.017771489918231964, 0.020195333287119865, 0.01387926284223795, 0.0008768827538006008, -0.039163656532764435, 0.025586118921637535, 0.009589766152203083, 0.09011463075876236, 0.048396386206150055, -0.007165923714637756, 0.038721129298210144, 0.014754259958863258, 0.017691031098365784, 0.0696779191493988, -0.027497030794620514, -0.0034245571587234735, 0.020798778161406517, 0.06126990541815758, 0.029951045289635658, 0.008946090005338192, -0.027537262067198753, 0.011374960653483868, 0.12406853586435318, -0.11095364391803741, 0.028221167623996735, -0.027818869799375534, 0.06456874310970306, 0.04992511495947838, -0.017007125541567802, 0.01746976748108864, 0.03679010272026062, 0.018948210403323174, 0.0664595440030098, -0.03351137787103653, 0.03504011034965515, 0.03248551860451698, -0.002098232740536332, -0.024178078398108482, -0.018053099513053894, 0.016544483602046967, -0.042321693152189255, -0.024459686130285263, 0.022830381989479065, -0.017399365082383156, -0.027497030794620514, 0.016836149618029594, -0.007231296971440315, 0.013094782829284668, -0.01178731583058834, 0.0045585329644382, 0.006798827089369297, -0.054672226309776306, 0.004699337296187878, 0.05157453566789627, 0.08705717325210571, 0.04899983108043671, -0.02333325333893299, -0.015407992526888847, -0.0014998152619227767, 0.0453791543841362, 0.018535856157541275, -0.009956861846148968, -0.021583259105682373, -0.025183821097016335, -0.022548772394657135, 0.04654581844806671, -0.014925235882401466, -0.04071250185370445, 0.018686717376112938, 0.03711194172501564, 0.06098829582333565, 0.010771514847874641, -0.08408016711473465, -0.036488380283117294, 0.024459686130285263, -0.039847563952207565, -0.010218355804681778, -0.0275573767721653, -0.027034388855099678, 0.05036764219403267, -0.02204590104520321, -0.034497007727622986, -0.010610595345497131, -0.012682427652180195, 0.00964508205652237, -0.010560308583080769, -0.0037564525846391916, -0.011535880155861378, 0.043126288801431656, 0.054390616714954376, -0.042120546102523804, -0.006466931663453579, 0.006255725398659706, 0.024318881332874298, 0.011877832934260368, -0.06497103720903397, 0.006899401545524597, -0.03994813933968544, 0.02832174114882946, -0.043126288801431656, -0.03600562363862991, 0.006919516250491142, 0.04630443826317787, -0.004339783918112516, -0.05515498295426369, 0.015749946236610413, -0.0257269237190485, -0.012712599709630013, 0.002934257034212351, 0.09606863558292389, 0.005425986833870411, -0.058775659650564194, 0.01124421413987875, 0.042603302747011185, -0.04690788313746452, -0.07281584292650223, -0.015055982396006584, -0.0017939952667802572, -0.03063495270907879, 0.000318695034366101, -0.05861474201083183, -0.032304488122463226, 0.04566076397895813, -0.0066731092520058155, 0.07337905466556549, 0.009690340608358383, 0.0579308345913887, -0.043166518211364746, -0.02560623362660408, -0.03139931708574295, -0.03954584151506424, 0.002306924434378743, -0.002392412628978491, -0.023836124688386917, -0.0037514239083975554, 0.00917741097509861, -0.003766509937122464, 0.014925235882401466, 0.010962605476379395, -0.03314930945634842, -0.020044472068548203, -0.008654423989355564, -0.06408598273992538, 0.004988488741219044, -0.0204568263143301, -0.03115793876349926, -0.028945302590727806, -0.006235610693693161, -0.02808036282658577, -0.007935317233204842, 0.026068875566124916, -0.0232930239289999, -0.023976929485797882, 0.022629233077168465, 0.03544240817427635, -0.03079587034881115, -0.025465428829193115, -0.024117732420563698, 0.03540217503905296, -0.021744178608059883, -0.00045258464524522424, 0.04332743585109711, -0.07965489476919174, -0.011566052213311195, -0.02029590681195259, -0.022629233077168465, -0.05258027836680412, 0.06195380911231041, -0.008800256997346878, 0.03210333734750748, 0.024540144950151443, 0.030292998999357224, 0.05254004895687103, -0.018847636878490448, 0.03220391273498535, -0.012521508149802685, 0.022226935252547264, 0.004490645602345467, 0.02645105868577957, -0.042723990976810455, 0.033571723848581314, 0.00048244267236441374, -0.028140706941485405, -0.0253246258944273, -0.034818846732378006, -0.08041926473379135, 0.06271817535161972, 0.003263638122007251, -0.048798684030771255, 0.01915941759943962, 0.012833288870751858, 0.020265735685825348, 0.007854858413338661, -0.05093085765838623, -0.06219518929719925, -0.008604137226939201, 0.008392930962145329, -0.030494147911667824, 0.03208322450518608, 0.029709666967391968, -0.058896347880363464, 0.06251702457666397, -0.030031505972146988, -0.008181724697351456, 0.03415505588054657, 0.042361922562122345, -0.0003576675953809172, -0.03135908767580986, -0.06899401545524597, -0.031218282878398895, 0.03552286699414253, 0.014311732724308968, -0.02588784135878086, 0.011354845948517323, -0.028341855853796005, 0.02216659113764763, 0.0008850544109009206, 0.023474056273698807, 0.05708600953221321, -0.0871376320719719, -0.008689625188708305, 0.019068900495767593, 0.005707595497369766, 0.0020617744885385036, -0.0014155842363834381, 0.0328274741768837, -0.018938153982162476, -0.0018442824948579073, -0.030051620677113533, -0.029428059235215187, 0.008357729762792587, 0.022709691897034645, -0.0071860384196043015, -0.04948258772492409, -0.09574679285287857, 0.01592092216014862, -0.02548554353415966, 0.025505660101771355, 0.038721129298210144, -0.028422316536307335, -0.08576981723308563, -0.014925235882401466, 0.021361995488405228, 0.0003755824000108987, -0.05491360276937485, -0.015508566983044147, -0.03833894804120064, -0.047833167016506195, 0.05652279406785965, -0.006889344193041325, -0.03083609975874424, -0.029709666967391968, 0.027376342564821243, -0.009660167619585991, -0.01286346185952425, 0.13147081434726715, 0.06235610693693161, -0.043448127806186676, -0.008040920831263065, -0.027074620127677917, -0.006577563472092152, 0.000308794726151973, 0.0023848696146160364, -0.0014784431550651789, -0.047953858971595764, -0.04421249032020569, -0.04409180209040642, 0.07784456014633179, 0.0413159504532814, 0.04582168161869049, -0.04710903391242027, 0.011968349106609821, 0.06295955181121826, -0.03843952342867851, 0.01290369126945734, 0.0022679518442600965, 0.01416087057441473, -0.071327343583107, -0.033652182668447495, -0.000637390068732202, 0.011606281623244286, -0.10194217413663864, 0.013064609840512276, 0.0453791543841362, -0.07800547778606415, -0.023192448541522026, 0.042321693152189255, -0.020436711609363556, -0.05072971060872078, 0.034818846732378006, -0.06271817535161972, 0.054350387305021286, -0.029267139732837677, -0.0027481946162879467, 0.022709691897034645, 0.001238950528204441, -0.03914354369044304, 0.0071206651628017426, 0.0232930239289999, 0.010530136525630951, -0.0054310159757733345, 0.002213893225416541, 0.01693672314286232, 0.030735526233911514, 0.0704825147986412, -0.0022729807533323765, 0.025384970009326935, 0.01879734918475151, -0.030212540179491043, 0.06923539191484451, -0.014824661426246166, 0.0038721130695194006, 0.04992511495947838, -0.03753435239195824, 0.04670673608779907, -0.08247098326683044, -0.028663694858551025, -0.012541623786091805, -0.0004981574020348489, -0.04908028990030289, -0.013054552488029003, 0.024741293862462044, -0.013406562618911266, -0.010102694854140282, -0.007256440352648497, 0.001503586769104004, -0.039203889667987823, -0.012833288870751858, 0.010198241099715233, 0.012591910548508167, -0.05201706290245056, 0.05221820995211601, -0.006039490457624197, 0.039123427122831345, 0.0009818573016673326, 0.00046169920824468136, 0.015790175646543503, 0.06179289147257805, -0.01022841315716505, 0.05282165855169296, -0.09566633403301239, -0.054672226309776306, -0.016262875869870186, 0.01709764264523983, -0.03982744738459587, -0.019803091883659363, -0.022669462487101555, 0.0047948830761015415, 0.013456850312650204, -0.031620580703020096, 0.004276924766600132, 0.01402006670832634, -0.059781402349472046, 0.07728134095668793, -0.03699125349521637, -0.0002756366156972945, -0.01628299057483673, -0.03375275805592537, -0.015780117362737656, 0.053304415196180344, 0.03011196479201317, 0.0068742576986551285, 0.018636429682374, -0.09301117062568665, 0.01120398472994566, 0.07181009650230408, 0.04541938379406929, -0.004380013793706894, 0.06271817535161972, 0.06432736665010452, -0.06219518929719925, -0.0019637146033346653, -0.0032183798030018806, 0.005938916467130184, 0.009836172685027122, 0.028020018711686134, -0.005657308269292116, -0.030735526233911514, 0.02763783559203148, -0.0437699630856514, 0.008654423989355564, -0.02260911837220192, -0.0032083222176879644, -0.03286770358681679, 0.004038061015307903, 0.026310253888368607, -0.015015752986073494, 0.07277560979127884, 0.0417182482779026, -0.016383564099669456, 0.00954450760036707, 0.041517097502946854, 0.020818892866373062, -0.0502469539642334, 0.10709158331155777, -0.023916583508253098, -0.039887793362140656, -0.00680888444185257, -0.006597678642719984, 0.03266655281186104, -0.07060320675373077, -0.02524416521191597, 0.09767782688140869, 0.03451712056994438, 0.04049123823642731, -0.00031508062966167927, -0.00579308345913887, 0.003411985468119383, 0.025183821097016335, -0.05624118447303772, 0.01749994046986103, 0.009398674592375755, -0.0038042254745960236, -0.00512677850201726, 0.02435911074280739, 0.03747401013970375, 0.013295930810272694, -0.022387854754924774, -0.06304001063108444, 0.01672551780939102, -0.05290211737155914, 0.008523677475750446, -0.024540144950151443, -0.01406029611825943, 0.006818941794335842, 0.040511354804039, 0.011867775581777096, 0.015055982396006584, 0.008458304218947887, 0.012149383313953876, -0.03367229923605919, -0.05624118447303772, 0.05595957860350609, 0.07872961461544037, -0.007744226139038801, -0.01589074917137623, 0.0002613362157717347, 0.016785861924290657, 0.002280523767694831, -0.047873396426439285, -0.034054480493068695, 0.020356250926852226, -0.02904587611556053, 0.04554007202386856, -0.005511475261300802, 0.028422316536307335, -0.02791944332420826, -0.03298839181661606, 0.04574122279882431, -0.004797397181391716, 0.001292380620725453, 0.05668371170759201, 0.021703947335481644, 0.03994813933968544, -0.0052650682628154755, 0.006914487574249506, -0.034416548907756805, -0.015951095148921013, 0.025022901594638824, 0.016826091334223747, 0.0020793750882148743, 0.04626420885324478, 0.006114921532571316, -0.05801129341125488, -0.04489639773964882, 0.030695296823978424, -0.006597678642719984, 0.0206579752266407, -0.023695319890975952, 0.00014056838699616492, -0.06489057838916779, 0.017489882186055183, -0.008558878675103188, 0.008860602043569088, -0.01656459830701351, 0.01523701660335064, -0.03572401404380798, -0.02892518788576126, 0.019923781976103783, -0.10789617896080017, -0.029930930584669113, -0.036609068512916565, 0.011324673891067505, -0.01624275930225849, -0.014724086970090866, 0.018244190141558647, -0.008257155306637287, 0.00645184563472867, 0.006577563472092152, 0.03341080620884895, 0.0222872793674469, -0.04147686809301376, 0.019139301031827927, 0.013547367416322231, 0.0005726452800445259, -0.018425224348902702, -0.0095193637534976, 0.007754283491522074, -0.024298766627907753, -0.006698252633213997, 0.00645184563472867, 0.017027240246534348, 0.08721809089183807, 0.0006958488957025111, -0.03711194172501564, 0.01859620027244091, 0.03600562363862991, 0.04674696549773216, 0.07382158190011978, 0.006668080575764179, 0.03823837265372276, -0.05221820995211601, -0.027497030794620514, 0.047672249376773834, 0.028462545946240425, 0.022025786340236664, -0.01280311681330204, -0.03856021165847778, -0.07144802808761597, -0.00025505031226202846, -0.018103385344147682, -0.06219518929719925, -0.05322395637631416, 0.03831883519887924, 0.00016736202815081924, 0.02747691608965397, 0.033169426023960114, -0.03518091142177582, -0.02580738253891468, -0.07261469215154648, -0.07060320675373077, -0.001038430375047028, 0.00836778711527586, 0.004143663682043552, -0.0607871450483799, 0.042080312967300415, 0.010862031951546669, 0.02920679561793804, 0.034899305552244186, -0.007437474559992552, 0.018334707245230675, -0.029146451503038406, -0.010781572200357914, -0.019561713561415672, 0.026652207598090172, -0.02232750877737999, -0.00342958583496511, -0.031379200518131256, 0.03371252864599228, -0.004374985117465258, -0.021442454308271408, 0.013155126944184303, -0.005164493806660175, -0.0005484445719048381, 0.02301141433417797, -0.054390616714954376, 0.02548554353415966, -0.02460048906505108, 0.034014251083135605, -0.003102719085291028, -0.012068923562765121, -0.004674193449318409, 0.0056623369455337524, 0.041597556322813034, -0.016192473471164703, 0.03156023472547531, 0.01361776888370514, -0.01859620027244091, -0.08383879065513611, 0.0160013809800148, 0.007462617941200733, 0.013738458044826984, 0.037252746522426605, 0.029247025027871132, 0.020446768030524254, -0.012964035384356976, -0.012390761636197567, -0.05262050777673721, -0.011897947639226913, 0.011415190994739532, 0.05684463307261467, 0.006054576952010393, -0.0583331324160099, -0.01896832510828972, 0.0453791543841362, -0.05217798054218292, 0.016031553968787193, -0.01770108751952648, -0.08041926473379135, 0.0072363256476819515, 0.0012986664660274982, -0.039244119077920914, -0.02612921968102455, -0.018304534256458282, -0.0036282201763242483, 0.04103434085845947, -0.028341855853796005, -0.007090492639690638, 0.04710903391242027, -0.015458280220627785, 0.02468094974756241, -0.01648413948714733, 0.001320038572885096, 0.03622688725590706, -0.06179289147257805, -0.042522840201854706, 0.04614352062344551, -0.039847563952207565, 0.0376751571893692, -0.07486756145954132, 0.010650825686752796, 0.029709666967391968, 0.023675205186009407, -0.05278142914175987, -0.010851973667740822, -0.03176138550043106, -0.009227697737514973, 0.0011251757387071848, 0.0047948830761015415, 0.014522938057780266, 0.003884684992954135, 0.024701064452528954, -0.03347114846110344, 0.04113491624593735, 0.006587620824575424, 0.027456801384687424, 0.010972663760185242, 0.0090164914727211, 0.02317233383655548, -0.04401134327054024, 0.09244795888662338, -0.03214356675744057, -0.05720669776201248, 0.027979789301753044, -0.015729831531643867, -0.05612049624323845, 0.07382158190011978, 0.009951833635568619, -0.0068390569649636745, -0.016464022919535637, 0.0010887174867093563, -0.030695296823978424, -0.01609189808368683, -0.0021937782876193523, 0.03942515328526497, 0.008523677475750446, -0.026712551712989807, 0.09582725912332535, -0.031620580703020096, -0.05157453566789627, 0.025143591687083244, 0.00781965721398592, -0.028382085263729095, 0.021563144400715828, 0.03512056916952133, 0.008614194579422474, 0.005521532613784075, 0.060183700174093246, 0.018344763666391373, 0.011153697036206722, 0.014673800207674503, 0.015810290351510048, -0.041557326912879944, -0.04031020775437355, 0.03431597352027893, -0.022186705842614174, 0.010560308583080769, 0.025103362277150154, 0.019662288948893547, -0.024097617715597153, 0.05173545330762863, 0.042442381381988525, 0.01426144503057003, -0.027155078947544098, -0.03962630033493042, -0.03220391273498535, -0.036287229508161545, -0.021703947335481644, 0.009765771217644215, -0.027336113154888153, -0.04509754478931427, -0.02860334888100624, 0.015066039748489857, 0.006119950208812952, 0.08351695537567139, 0.01284334622323513, -0.0279596745967865, 0.028020018711686134, 0.012189612723886967, -0.017851950600743294, 0.016665171831846237, -0.018646487966179848, -0.06352277100086212, 0.048677992075681686, 0.006019375752657652, 0.031861960887908936, 0.07478709518909454, 0.08279281854629517, -0.06569517403841019, -0.014532996341586113, 0.010102694854140282, 0.01286346185952425, 0.029407944530248642, -0.030132079496979713, 0.04049123823642731, 0.008418074809014797, -0.042563073337078094, 0.05133315548300743, -0.059700943529605865, 0.023856239393353462, -0.02864358015358448, -0.0026023616082966328, -0.025626348331570625, 0.03479873016476631, 0.00826721265912056, 0.004895457066595554, 0.0018027955666184425, -0.06122967228293419, 0.06098829582333565, 0.02504301629960537, -0.06126990541815758, 0.03906308487057686, -0.01749994046986103, 0.0024640720803290606, 0.03530160337686539, -0.014532996341586113, 0.012048808857798576, -0.03463781252503395, 0.016343334689736366, -0.041838936507701874, 0.021341880783438683, 0.05012626573443413, 0.0016041611088439822, 0.009876403026282787, 0.07551123201847076, 0.024238422513008118, -0.011264328844845295, -0.0005069576436653733, 0.04421249032020569, 0.00358044751919806, -0.037252746522426605, -0.015790175646543503, 0.03188207373023033, 0.0052348957397043705, 0.009997092187404633, 0.006627850700169802, -0.015850519761443138, -0.02341371215879917, 0.03638780489563942, 0.05829290300607681, 0.054109007120132446, -0.023675205186009407, 0.048637762665748596 ]
31,950
sonetel.users
__init__
null
def __init__(self, access_token: str): if not access_token: raise e.AuthException('access_token is required') super().__init__(access_token=access_token) self._url = f'{const.API_URI_BASE}{const.API_ENDPOINT_ACCOUNT}{self._accountid}{const.API_ENDPOINT_USER}'
(self, access_token: str)
[ -0.04960211366415024, -0.023836255073547363, -0.015361142344772816, 0.05349915102124214, 0.009742596186697483, -0.014604435302317142, 0.015058459714055061, 0.04873190075159073, -0.004372344817966223, 0.01396123506128788, 0.06390386819839478, 0.05183439701795578, 0.02251201868057251, 0.007798806298524141, -0.0018421073909848928, 0.037456970661878586, 0.06867111474275589, 0.025822609663009644, 0.03594356030225754, -0.004540238995105028, -0.040862150490283966, -0.005155063234269619, -0.03159249573945999, 0.03711645305156708, 0.006625911220908165, 0.06693068891763687, -0.023193053901195526, 0.02934129536151886, 0.051456041634082794, -0.0251037385314703, 0.026863081380724907, 0.039197396486997604, 0.032273534685373306, 0.09617739915847778, 0.035451699048280716, -0.07143309712409973, -0.0008329683332704008, 0.03270863741636276, -0.16662678122520447, 0.014982788823544979, 0.01083036232739687, 0.017356956377625465, 0.028622424229979515, -0.004824004136025906, 0.06015816703438759, 0.00038840327761135995, -0.01598542556166649, 0.04808869957923889, -0.03904605656862259, -0.031743839383125305, -0.03881904482841492, 0.01779206283390522, -0.048013027757406235, -0.01754613220691681, -0.03673810139298439, 0.06995751708745956, 0.015067918226122856, 0.021301288157701492, -0.047483332455158234, 0.03456256911158562, -0.06825492531061172, -0.014349047094583511, 0.036851607263088226, -0.008446736261248589, 0.018586603924632072, 0.03051418997347355, -0.08482679724693298, 0.04377547279000282, 0.016032719984650612, 0.050018299371004105, 0.10291208326816559, 0.04525104910135269, -0.04846705123782158, -0.007666382938623428, 0.021320205181837082, 0.034865252673625946, -0.06734687834978104, 0.003620367730036378, -0.034278806298971176, 0.007387347519397736, 0.029852071776986122, -0.024952396750450134, -0.04184586927294731, -0.025009149685502052, -0.0014637542190030217, -0.022417429834604263, -0.059666309505701065, -0.1160031110048294, -0.022133665159344673, 0.0727194994688034, -0.04078648239374161, 0.0044882153160870075, -0.059704143553972244, -0.03567871078848839, 0.012532951310276985, -0.0033744380343705416, -0.005788804963231087, -0.04464568570256233, -0.013289658352732658, 0.008408901281654835, 0.01817987486720085, -0.056563813239336014, -0.06046085059642792, 0.02930345945060253, 0.013138316571712494, -0.02816840074956417, 0.03308699280023575, -0.07018452882766724, 0.04472135379910469, -0.01111412700265646, -0.04294309392571449, -0.00031627967837266624, 0.015143589116632938, 0.04926159232854843, -0.05584494024515152, 0.019560864195227623, 0.02705225721001625, 0.005760428495705128, 0.0351300984621048, -0.017574509605765343, 0.06133106350898743, -0.0026792141143232584, 0.007548147346824408, 0.051380373537540436, 0.06965483725070953, 0.024309197440743446, -0.037778571248054504, -0.02506590262055397, 0.0461212620139122, -0.08664289861917496, 0.027998141944408417, 0.01750829629600048, 0.0015488836215808988, -0.06640099734067917, -0.02877376601099968, 0.001338424626737833, 0.015143589116632938, 0.017319120466709137, -0.018832532688975334, 0.020979687571525574, -0.0045662508346140385, 0.027487363666296005, -0.0025680726394057274, -0.02788463421165943, -0.009473019279539585, 0.017574509605765343, 0.00023070680617820472, 0.0020809429697692394, 0.0365489237010479, -0.0060394639149308205, 0.042640410363674164, 0.002631919924169779, 0.07245464622974396, -0.006729958578944206, -0.0695413276553154, -0.035186853259801865, -0.0072927591390907764, -0.020639169961214066, 0.047104980796575546, 0.03127089515328407, 0.007382617797702551, -0.03363560512661934, 0.002712319837883115, -0.02054458111524582, 0.003941968083381653, 0.012315398082137108, 0.031478989869356155, -0.05849341303110123, -0.02621988020837307, -0.038648784160614014, 0.02307954803109169, -0.0798325389623642, -0.0409756563603878, -0.014680106192827225, -0.013762599788606167, -0.013705846853554249, 0.022171501070261, -0.0123721519485116, -0.008082571439445019, 0.0014377423794940114, 0.033238332718610764, -0.018596062436699867, -0.010281750001013279, -0.03668134659528732, 0.02425244450569153, 0.010262832045555115, 0.010139867663383484, 0.05164521932601929, 0.004138238728046417, 0.07937851548194885, -0.000996724353171885, -0.007259652949869633, 0.018321756273508072, -0.03250054642558098, 0.007401535753160715, -0.02141479402780533, 0.021830983459949493, -0.02794138714671135, -0.012438363395631313, 0.056261129677295685, -0.040559470653533936, 0.06242828816175461, -0.004190262407064438, -0.022303923964500427, 0.07177361100912094, 0.008957513608038425, 0.008862924762070179, -0.03751372545957565, -0.006763064302504063, -0.03425988927483559, -0.03437339514493942, -0.02281470224261284, -0.005230733659118414, 0.05156954750418663, -0.056261129677295685, 0.030835790559649467, -0.005566522479057312, -0.00620026420801878, 0.0404459647834301, 0.020998606458306313, 0.09723678976297379, -0.02080942876636982, -0.0123721519485116, -0.09186416864395142, 0.016524579375982285, 0.03984059765934944, 0.030287178233265877, -0.05523957684636116, -0.08679423481225967, -0.004048380069434643, -0.022587688639760017, -0.06443355977535248, 0.013015352189540863, 0.022020159289240837, -0.013554505072534084, -0.03965141996741295, 0.06447139382362366, -0.021868817508220673, -0.06231478229165077, -0.018567686900496483, 0.04351062327623367, 0.015607072040438652, -0.024422703310847282, 0.0031616142950952053, -0.019806792959570885, 0.0014211894012987614, -0.07370321452617645, 0.04071081057190895, -0.045478060841560364, -0.04566723853349686, -0.009865561500191689, -0.014415259473025799, -0.04411599040031433, -0.023287642747163773, -0.024101102724671364, -0.05864475667476654, -0.012031633406877518, 0.020733758807182312, 0.024365950375795364, 0.006493487861007452, -0.01665700227022171, -0.02559559792280197, -0.024895643815398216, 0.03702186793088913, 0.017356956377625465, -0.01568274199962616, -0.013204528950154781, -0.004599356558173895, 0.029984496533870697, -0.000699953525327146, 0.11297628283500671, 0.029549390077590942, 0.022852536290884018, 0.030949296429753304, -0.01665700227022171, -0.011832998134195805, -0.010442550294101238, -0.004263568203896284, -0.056866493076086044, -0.0466509573161602, 0.014755777083337307, -0.08792929351329803, 0.027998141944408417, 0.05009397119283676, 0.005334781017154455, -0.022663360461592674, 0.047142814844846725, 0.005008451174944639, -0.012343775480985641, 0.00817715935409069, 0.06371469050645828, 0.0048145451582968235, -0.036321911960840225, 0.022947125136852264, -0.000057455010392004624, -0.041732363402843475, 0.02107427641749382, 0.034051794558763504, -0.022379595786333084, 0.02502806857228279, -0.0027194139547646046, -0.010054738260805607, -0.03798666596412659, 0.011038456112146378, 0.04642394557595253, -0.023552490398287773, 0.04922375828027725, 0.02682524546980858, -0.0038662974257022142, 0.030873626470565796, 0.036057066172361374, 0.027714375406503677, -0.037173207849264145, 0.012287021614611149, -0.0041926270350813866, -0.005585439968854189, 0.02194448933005333, -0.01111412700265646, 0.026673905551433563, 0.023420067504048347, -0.02160397171974182, 0.008569701574742794, 0.016874555498361588, -0.02160397171974182, 0.03168708458542824, 0.034600406885147095, 0.009037913754582405, 0.06201209872961044, -0.06424438208341599, 0.020128393545746803, -0.05349915102124214, 0.00534423952922225, -0.02845216542482376, -0.04320794343948364, -0.026995504274964333, -0.019560864195227623, -0.03310590982437134, -0.0010321949375793338, 0.009146690368652344, -0.019863545894622803, -0.012220810167491436, -0.04010544344782829, 0.006545511540025473, 0.045705072581768036, -0.036284077912569046, -0.05690433084964752, 0.014708482660353184, -0.046575285494327545, -0.002108137123286724, -0.05221274867653847, -0.08293503522872925, 0.00390649726614356, 0.07998387515544891, 0.015853000804781914, 0.0901237428188324, -0.010991161689162254, -0.040067609399557114, 0.016004342585802078, -0.007027911953628063, -0.01750829629600048, 0.0003015002585016191, -0.027468446642160416, -0.015900295227766037, 0.01811366155743599, -0.020922934636473656, -0.009350054897367954, -0.02417677268385887, -0.016486743465065956, 0.031157391145825386, -0.013554505072534084, -0.023230889812111855, -0.045137543231248856, -0.026276633143424988, 0.002830555196851492, 0.0730978474020958, 0.021301288157701492, -0.045440226793289185, -0.002445108024403453, -0.04161885753273964, 0.018813615664839745, 0.027808964252471924, 0.019021710380911827, 0.060574356466531754, 0.06647666543722153, 0.01511521264910698, -0.02334439568221569, -0.03893255069851875, 0.0034690264146775007, 0.06942782551050186, 0.04903458058834076, -0.014708482660353184, -0.006115134339779615, -0.02873593010008335, 0.007855559699237347, -0.027846800163388252, -0.014897659420967102, -0.028698094189167023, -0.021906653419137, -0.008002171292901039, 0.022303923964500427, 0.01997705176472664, 0.008314312435686588, 0.029398048296570778, 0.012192433699965477, 0.047407664358615875, 0.004168979823589325, 0.03641650080680847, 0.004682121332734823, -0.013308575376868248, -0.008664289489388466, -0.06575779616832733, -0.07608684152364731, -0.03900822252035141, 0.007964336313307285, 0.033162664622068405, -0.03825151547789574, -0.0363597497344017, 0.015171965584158897, 0.01607055403292179, 0.006824546959251165, 0.019428439438343048, 0.008640642277896404, 0.018492015078663826, -0.03539494797587395, -0.06938998401165009, 0.02589827962219715, 0.010073655284941196, -0.013592340983450413, 0.04127833992242813, -0.02761978842318058, 0.014576058834791183, 0.0667036771774292, -0.0455915667116642, 0.0015110482927411795, 0.012060009874403477, 0.011010079644620419, -0.021906653419137, 0.006715770345181227, -0.018652815371751785, -0.03244379162788391, 0.0006437916890718043, -0.012362692505121231, 0.051683053374290466, 0.027752211317420006, 0.04248907044529915, 0.0042422860860824585, -0.03878120705485344, 0.015304389409720898, 0.03787316009402275, -0.05894743651151657, -0.031157391145825386, 0.017858274281024933, -0.015389518812298775, -0.03437339514493942, -0.08376741409301758, -0.047483332455158234, -0.04339711740612984, 0.01495441235601902, 0.040635138750076294, 0.05841774120926857, -0.00047412392450496554, -0.010508761741220951, -0.0730978474020958, -0.03620840609073639, 0.019863545894622803, 0.033427510410547256, 0.07476260513067245, 0.030022330582141876, -0.012930222786962986, -0.017252909019589424, -0.02990882471203804, -0.008460924960672855, -0.020128393545746803, 0.02850891835987568, -0.008196077309548855, -0.006346875801682472, 0.015436813235282898, -0.013876105658710003, -0.0242146085947752, 0.0008057741797529161, -0.019239263609051704, 0.04483485966920853, 0.00199344870634377, 0.018756862729787827, 0.008006900548934937, -0.003979803528636694, -0.03556520491838455, 0.018425803631544113, 0.03384369984269142, -0.020052721723914146, 0.01155869197100401, 0.051683053374290466, -0.062201276421546936, 0.03297348693013191, -0.046840135008096695, 0.03953791409730911, -0.027487363666296005, 0.00698061753064394, 0.02710901014506817, 0.011133044958114624, -0.00648402888327837, 0.00712722958996892, 0.009856102056801319, -0.002095131203532219, 0.012986975722014904, 0.04237556457519531, -0.08997240662574768, 0.030627695843577385, 0.014576058834791183, -0.029814235866069794, 0.013582881540060043, 0.014992248266935349, 0.0033815321512520313, 0.014339588582515717, 0.02141479402780533, -0.008101489394903183, -0.04566723853349686, 0.022266089916229248, -0.027998141944408417, -0.0015075012343004346, 0.002193266525864601, 0.030949296429753304, 0.0267874114215374, -0.02533075027167797, 0.002098678145557642, -0.00499426294118166, 0.05864475667476654, 0.014642271213233471, 0.01025337353348732, 0.02710901014506817, -0.014282835647463799, -0.015957048162817955, -0.017025897279381752, 0.03163033351302147, 0.036643512547016144, 0.04377547279000282, -0.06015816703438759, -0.026976587250828743, 0.017981238663196564, 0.04124050587415695, 0.008432548493146896, -0.02366599626839161, -0.010499303229153156, -0.03897038474678993, -0.08210265636444092, -0.06897380203008652, -0.030079083517193794, 0.05917444825172424, 0.019182510673999786, -0.020374322310090065, 0.06708203256130219, -0.020393241196870804, 0.003989262040704489, 0.01766909658908844, -0.026144210249185562, 0.038856878876686096, -0.028092728927731514, -0.026919834315776825, 0.027752211317420006, 0.028073811903595924, 0.000011491002624097746, 0.00939262006431818, -0.0631471574306488, 0.01655295491218567, -0.008503489196300507, -0.01992029882967472, -0.02502806857228279, 0.01341262273490429, -0.027146846055984497, 0.021566135808825493, -0.002823461079970002, -0.030022330582141876, -0.03649217262864113, 0.057963717728853226, -0.008546054363250732, 0.017725849524140358, 0.008465654216706753, 0.03533819317817688, 0.07778943330049515, -0.0239497609436512, 0.03611381724476814, 0.009865561500191689, -0.004474027082324028, -0.04672662913799286, -0.00781299453228712, -0.033427510410547256, -0.025538844987750053, -0.03556520491838455, 0.0610283799469471, -0.0461212620139122, -0.051115524023771286, -0.07907582819461823, -0.04282958805561066, 0.010149326175451279, -0.03984059765934944, 0.015171965584158897, -0.04025678709149361, -0.0793028399348259, -0.019768957048654556, -0.007798806298524141, 0.004161885939538479, 0.08270802348852158, -0.045099709182977676, -0.0002670641988515854, -0.005382074974477291, 0.01553140114992857, -0.028130564838647842, 0.024630796164274216, -0.031762756407260895, 0.0007448829710483551, 0.04615909606218338, 0.058833930641412735, -0.02538750320672989, 0.019314933568239212, -0.02281470224261284, 0.04161885753273964, -0.053423479199409485, 0.05016964301466942, -0.020298652350902557, 0.029984496533870697, 0.03170600160956383, 0.009014266543090343, -0.03953791409730911, 0.1066199466586113, -0.06212560459971428, 0.027506282553076744, 0.09466398507356644, -0.056525975465774536, -0.07298434525728226, 0.00640362873673439, 0.013355869799852371, 0.006819817237555981, -0.053991008549928665, -0.0057415105402469635, -0.009780432097613811, 0.026352304965257645, 0.026295552030205727, 0.01140735112130642, 0.05868259072303772, 0.039121728390455246, -0.03024934232234955, 0.015871919691562653, -0.02364707924425602, 0.02449837327003479, -0.03221677988767624, 0.03728671371936798, -0.07222763448953629, -0.03074120171368122, -0.010452008806169033, -0.0061245933175086975, -0.022663360461592674, 0.02222825400531292, 0.053120795637369156, 0.01453822385519743, -0.038894716650247574, -0.021244535222649574, -0.04540238901972771, 0.019040627405047417, 0.033786945044994354, 0.018265003338456154, -0.009496666491031647, -0.03495984151959419, 0.034600406885147095, -0.00010707692854339257, -0.056790824979543686, 0.02016622945666313, 0.03308699280023575, -0.05092635005712509, -0.05240192636847496, 0.043094437569379807, -0.012845093384385109, 0.011832998134195805, 0.0019106839317828417, -0.008716313168406487, 0.059704143553972244, -0.01940952241420746, -0.010508761741220951, -0.03637866675853729, 0.025728020817041397, 0.046613119542598724, 0.020658086985349655, 0.016950225457549095, 0.03509226441383362, -0.01080198585987091, -0.04638610780239105, 0.057661037892103195, -0.008621725253760815, 0.03615165501832962, 0.00356361479498446, -0.016600249335169792, -0.011104668490588665, -0.017896108329296112, -0.05062366649508476, -0.03384369984269142, -0.021131029352545738, -0.0022807607892900705, -0.049677781760692596, -0.041467517614364624, 0.03600031137466431, 0.030419601127505302, 0.022095831111073494, -0.001838560332544148, 0.00939262006431818, 0.01919196918606758, -0.041997212916612625, -0.004003450274467468, 0.022020159289240837, -0.03495984151959419, -0.005036827642470598, -0.011899209581315517, 0.013620717450976372, 0.005121957045048475, 0.009931772947311401, -0.01027229055762291, 0.01155869197100401, 0.01592867262661457, 0.025557762011885643, 0.010177702642977238, -0.04672662913799286, -0.0035943558905273676, 0.004762521479278803, -0.02848999947309494, 0.012457281351089478, 0.03904605656862259, 0.044570013880729675, -0.025009149685502052, -0.012920763343572617, 0.00939262006431818, 0.064925417304039, -0.02220933698117733, 0.007604900281876326, 0.028584588319063187, -0.03163033351302147, 0.040294621139764786, -0.005675298627465963, -0.03384369984269142, -0.025141574442386627, -0.0035257793497294188, 0.062239110469818115, 0.10586324334144592, -0.007935959845781326, -0.022928208112716675, -0.003833191469311714, -0.023155219852924347, -0.0024782137479633093, 0.07427074760198593, -0.016486743465065956, -0.042564742267131805, 0.02987098880112171, 0.08225400000810623, 0.006015816703438759, -0.000009477305866312236, 0.020393241196870804, 0.015815166756510735, 0.022606607526540756, 0.005249651614576578, -0.0574718602001667, -0.005320592783391476, 0.003071755403652787, -0.03212219104170799, -0.014992248266935349, -0.0035778030287474394, -0.006105675827711821, -0.047710344195365906, 0.02169855870306492, 0.08800496906042099, 0.02729818783700466, 0.0029606141615659 ]
31,951
sonetel.users
add
Adds a new user. Account admin privilege required. :param email: Required. String. The email address of the user. :param f_name: Required. String. The first name of the user :param l_name: Required. String. The last name of the user. :param password: Required. String. The password to be used. :param user_type: Required. String. The privilege level of the new user. Accepted values regular and admin. Defaults to regular.
def add(self, email: str, f_name: str, l_name: str, password: str, user_type: str = 'regular' ) -> dict: """ Adds a new user. Account admin privilege required. :param email: Required. String. The email address of the user. :param f_name: Required. String. The first name of the user :param l_name: Required. String. The last name of the user. :param password: Required. String. The password to be used. :param user_type: Required. String. The privilege level of the new user. Accepted values regular and admin. Defaults to regular. """ # Checks if not password: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='password cannot be empty' ) if not email: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='email cannot be empty' ) if not f_name: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='first name cannot be empty' ) if not l_name: return util.prepare_error( code=const.ERR_USER_DETAIL_EMPTY, message='last name cannot be empty' ) # Request url = self._url body = { "user_fname": f_name, "user_lname": l_name, "email": email, "password": password, "type": user_type } return util.send_api_request( token=self._token, uri=url, method='post', body=dumps(body) )
(self, email: str, f_name: str, l_name: str, password: str, user_type: str = 'regular') -> dict
[ -0.05172855034470558, 0.032741039991378784, 0.04882502928376198, 0.0018958857981488109, 0.024870965629816055, -0.08305603265762329, -0.020171843469142914, -0.02404957450926304, -0.08488983660936356, -0.024584433063864708, 0.043400026857852936, -0.028194734826683998, -0.013705774210393429, 0.04202467203140259, -0.008944569155573845, 0.008486118167638779, 0.0029082982800900936, -0.02213936112821102, -0.015892967581748962, -0.022998956963419914, -0.016112642362713814, -0.01729697361588478, 0.10605499148368835, 0.09910181909799576, 0.016762113198637962, -0.0023626938927918673, 0.011060129851102829, 0.014307490549981594, 0.0459597110748291, 0.03650416061282158, 0.023782145231962204, -0.023113569244742393, -0.007492808159440756, 0.010592128150165081, 0.0017836608458310366, -0.033199492841959, -0.019770698621869087, 0.09573984891176224, -0.05023858696222305, 0.018567264080047607, 0.007445052731782198, 0.06250215321779251, 0.002652807394042611, 0.0021633156575262547, 0.020248251035809517, 0.005405900999903679, 0.006752600893378258, 0.01897796057164669, -0.02706770971417427, 0.029283557087183, 0.006981826387345791, -0.04427872225642204, 0.019751597195863724, -0.06380109488964081, -0.02351471409201622, -0.040496502071619034, 0.015596884302794933, -0.053676970303058624, -0.012368625029921532, 0.008333301171660423, 0.00434573320671916, -0.021337073296308517, -0.024851864203810692, -0.019388655200600624, -0.017545301467180252, 0.034613050520420074, -0.05700073763728142, 0.0023340408224612474, 0.05432644113898277, 0.03904474154114723, 0.010210085660219193, -0.03132748231291771, -0.013973203487694263, -0.027220526710152626, 0.07304652035236359, 0.060286302119493484, 0.006857662461698055, 0.0009360041003674269, -0.007220603059977293, 0.0187009796500206, 0.022120259702205658, 0.01509067788720131, -0.07969406247138977, 0.0229034461081028, 0.01584521122276783, 0.07602645456790924, -0.02194834128022194, -0.0846606120467186, -0.04229210317134857, 0.009990410879254341, -0.03709632530808449, -0.06273137778043747, 0.008992324583232403, 0.01973249390721321, 0.0424831248819828, -0.07136553525924683, 0.0086628133431077, -0.017984649166464806, 0.0543646439909935, 0.02513839490711689, 0.029092535376548767, -0.01241638045758009, 0.025348518043756485, 0.020611191168427467, 0.044775377959012985, -0.08099300414323807, -0.0028127876576036215, -0.016895828768610954, -0.0192835945636034, 0.004739714320749044, -0.04370566084980965, -0.04630354791879654, -0.04511921852827072, 0.05700073763728142, -0.022082054987549782, 0.024164186790585518, 0.04420231655240059, 0.03745926544070244, 0.015969375148415565, 0.003708199830725789, 0.021203357726335526, 0.0007909473497420549, -0.0010339025175198913, 0.017755424603819847, 0.07637029141187668, 0.01889200136065483, -0.06571130454540253, -0.046685591340065, 0.04932168498635292, -0.06020989641547203, -0.006437415722757578, -0.01241638045758009, -0.01822342723608017, 0.0068051316775381565, 0.005463207606226206, -0.0035076276399195194, -0.005057287402451038, 0.047908127307891846, 0.04492819681763649, 0.02970380336046219, -0.0006244006799533963, 0.02189103327691555, 0.002047508955001831, -0.011604540050029755, -0.035090602934360504, -0.028710491955280304, -0.01567329280078411, 0.003722526365891099, -0.04588330164551735, 0.02320908010005951, 0.006919744424521923, 0.03451753780245781, 0.0106207812204957, -0.01564463973045349, -0.01842399872839451, -0.010534821078181267, 0.03763118386268616, -0.04955090954899788, -0.004536754451692104, 0.010028615593910217, -0.018739184364676476, 0.018901551142334938, 0.029455475509166718, 0.011986582539975643, 0.007889177650213242, 0.015167086385190487, 0.06678102910518646, -0.0011318008182570338, 0.0023806022945791483, 0.015233944170176983, -0.04171903803944588, -0.07281729578971863, 0.0022480811458081007, 0.04355284199118614, -0.038280658423900604, -0.0265328511595726, 0.054097216576337814, -0.05302749574184418, -0.020725805312395096, -0.03807053342461586, 0.019866209477186203, -0.013934999704360962, 0.059866055846214294, -0.0024593984708189964, 0.0395796000957489, 0.008462240919470787, 0.015243494883179665, 0.0727790892124176, -0.01889200136065483, 0.04485178738832474, -0.0030038089025765657, 0.003211544593796134, -0.016981787979602814, 0.009894900023937225, 0.011738255620002747, 0.007220603059977293, -0.017736321315169334, 0.03337141126394272, -0.023304590955376625, -0.016972236335277557, -0.03543443977832794, 0.030658908188343048, -0.022082054987549782, -0.03446023166179657, 0.00900187622755766, -0.022502301260828972, -0.015950273722410202, 0.016886277124285698, -0.03554905205965042, -0.07824230194091797, 0.026609258726239204, -0.014173775911331177, -0.035033296793699265, 0.06991377472877502, -0.016637949272990227, -0.05757380276918411, 0.0005265023210085928, -0.015940722078084946, -0.011126987636089325, 0.055548977106809616, 0.04282696172595024, 0.009818491525948048, 0.0009515245328657329, -0.021623603999614716, 0.019713392481207848, 0.03212977200746536, -0.003560158424079418, -0.05646587908267975, 0.018385794013738632, -0.02723962813615799, -0.0003456290578469634, -0.0024522352032363415, 0.03356243297457695, 0.019942617043852806, -0.08863385766744614, 0.02236858755350113, 0.023075366392731667, 0.0134096909314394, -0.033772554248571396, 0.010725842788815498, 0.0395796000957489, 0.011212946847081184, -0.01984710618853569, 0.005840474274009466, -0.012368625029921532, 0.023075366392731667, 0.039847031235694885, 0.000648875255137682, -0.020897723734378815, -0.06895866990089417, -0.04317079856991768, 0.002855767495930195, 0.013476548716425896, 0.05570179224014282, -0.01668570563197136, 0.012187154963612556, 0.036771588027477264, 0.0018349977908656001, 0.0004393488634377718, -0.03980882838368416, 0.023476511240005493, -0.041528016328811646, -0.007449828553944826, 0.021375276148319244, -0.0015102616744115949, -0.0571153499186039, -0.029245352372527122, 0.038949232548475266, 0.0403054803609848, -0.022158464416861534, 0.13371486961841583, 0.08359089493751526, 0.038949232548475266, -0.05906376615166664, -0.026189012452960014, -0.032683733850717545, 0.01780317910015583, 0.008433587849140167, 0.020114537328481674, -0.0437820665538311, -0.02446982078254223, -0.03084992989897728, 0.018022853881120682, 0.014498512260615826, -0.0039636907167732716, -0.018213875591754913, -0.02158539928495884, 0.054517462849617004, -0.0344984345138073, -0.00771248247474432, -0.009546286426484585, 0.018987512215971947, -0.07044863700866699, -0.03054429590702057, 0.04504280909895897, 0.00998086016625166, -0.016762113198637962, -0.00566855538636446, 0.011193844489753246, -0.0028748696204274893, -0.004161875229328871, 0.018987512215971947, 0.020286455750465393, -0.0621965155005455, 0.027927305549383163, -0.06177626922726631, 0.033944472670555115, -0.031976956874132156, -0.07346677035093307, 0.0009801777778193355, -0.025061987340450287, -0.010028615593910217, -0.003087380900979042, 0.06410672515630722, 0.013829938136041164, 0.000897799851372838, 0.021929237991571426, -0.022998956963419914, 0.008170933462679386, 0.011556784622371197, 0.014574920758605003, -0.027277832850813866, 0.020190944895148277, -0.05455566570162773, 0.057955846190452576, 0.01723966747522354, 0.013505201786756516, 0.04084034264087677, 0.00932183675467968, 0.017039094120264053, -0.07954124361276627, -0.017984649166464806, 0.00968477688729763, 0.04939809441566467, -0.07602645456790924, -0.02989482507109642, 0.04198646917939186, 0.005974189378321171, -0.012129848822951317, -0.030506091192364693, -0.05585461109876633, -0.004140385426580906, 0.013696222566068172, 0.020038127899169922, 0.03977062180638313, -0.08672364056110382, 0.013104056939482689, -0.03266463056206703, 0.03726824373006821, 0.05432644113898277, -0.03325679898262024, -0.017812730744481087, 0.0004512876912485808, -0.051040876656770706, 0.021986544132232666, -0.053791582584381104, -0.041833650320768356, -0.01401140820235014, 0.04660918191075325, -0.044049497693777084, -0.005224430933594704, -0.015549128875136375, -0.015052474103868008, 0.008806079626083374, -0.02267422154545784, 0.004682408180087805, 0.020725805312395096, 0.022082054987549782, 0.033638838678598404, -0.0036890977062284946, 0.062158312648534775, -0.017870036885142326, -0.02765987627208233, 0.06116500124335289, 0.041948262602090836, 0.009226325899362564, 0.02404957450926304, 0.01729697361588478, -0.1274493783712387, -0.009570164605975151, 0.010888210497796535, -0.005558717995882034, -0.04806094244122505, 0.024565331637859344, 0.07847152650356293, -0.021451685577630997, 0.03031507134437561, 0.014030510559678078, -0.004866266157478094, -0.012168052606284618, 0.01881559193134308, -0.015883415937423706, 0.027736283838748932, 0.01600757986307144, -0.018376244232058525, 0.0012308930745348334, -0.054097216576337814, -0.03163311630487442, -0.09123174101114273, 0.01651378534734249, 0.0024976027198135853, -0.027354242280125618, 0.03787951171398163, -0.026914892718195915, -0.004980878904461861, 0.048863232135772705, -0.025997990742325783, 0.008213913068175316, -0.047793515026569366, 0.044240519404411316, 0.0208022128790617, -0.016284560784697533, -0.0286340843886137, -0.039847031235694885, 0.008710568770766258, -0.006680967751890421, -0.028958819806575775, 0.0487104170024395, 0.018911102786660194, 0.0346512533724308, 0.014106919057667255, -0.019694289192557335, -0.01476594153791666, 0.06792715191841125, -0.03264553099870682, 0.03300847113132477, 0.012311318889260292, -0.012607402168214321, -0.019808903336524963, -0.014832799322903156, 0.0036103015299886465, 0.018242528662085533, 0.00663321278989315, 0.014832799322903156, -0.018958857282996178, -0.04282696172595024, 0.01825208030641079, -0.05917838215827942, -0.015377209521830082, 0.052110593765974045, 0.019866209477186203, -0.03216797858476639, -0.0119961341843009, 0.05444105342030525, -0.02189103327691555, -0.051461122930049896, -0.04997115582227707, -0.004484223667532206, 0.08198631554841995, 0.018720081076025963, 0.03816604241728783, 0.011088782921433449, 0.055892813950777054, 0.052530840039253235, 0.00015505551709793508, 0.022120259702205658, -0.06307521462440491, -0.06345725804567337, 0.061432432383298874, 0.011270252987742424, 0.02189103327691555, -0.010458412580192089, -0.0030348498839884996, 0.08236835896968842, 0.0035720972809940577, 0.041413404047489166, 0.05883454158902168, -0.004887755960226059, 0.040572911500930786, 0.015778355300426483, -0.025482233613729477, -0.046685591340065, -0.017764976248145103, -0.0033977902494370937, 0.010573025792837143, 0.004209630656987429, 0.0260935015976429, -0.00975640956312418, -0.0423303060233593, -0.07839512079954147, 0.06108859181404114, -0.0015233943704515696, 0.007994239218533039, 0.01494741253554821, 0.027736283838748932, -0.015415414236485958, 0.04389668256044388, 0.0007037938921712339, 0.03772669658064842, 0.03772669658064842, -0.0011097140377387404, -0.057955846190452576, 0.005692433100193739, 0.028729595243930817, -0.07507134974002838, -0.017058197408914566, -0.0003972644917666912, -0.03507149964570999, -0.04515742138028145, 0.006456518080085516, 0.023056263104081154, 0.023170877248048782, 0.023419203236699104, 0.01729697361588478, 0.038891926407814026, -0.0022815100383013487, -0.027564365416765213, 0.017392484471201897, -0.022101158276200294, 0.015405862592160702, -0.05123189836740494, 0.014746840111911297, -0.002447459613904357, -0.026303624734282494, 0.011604540050029755, 0.03012404963374138, 0.05050601437687874, 0.0208022128790617, -0.024202391505241394, -0.042788758873939514, -0.00335242273285985, 0.05348594859242439, 0.01794644631445408, -0.002913073869422078, 0.018347589299082756, 0.051461122930049896, 0.005210104398429394, -0.028825106099247932, 0.04962731897830963, 0.000021471234504133463, 0.0023925411514937878, 0.05432644113898277, -0.002731603803113103, -0.051995981484651566, -0.0093504898250103, -0.020534783601760864, -0.03893012925982475, 0.019751597195863724, 0.022521404549479485, -0.03992344066500664, 0.043820273131132126, 0.0060601490549743176, -0.032989367842674255, -0.025596845895051956, -0.046685591340065, -0.03797502443194389, 0.03440292552113533, -0.017153708264231682, -0.02874869666993618, -0.06124141067266464, 0.033295001834630966, -0.01934090070426464, -0.01959878019988537, 0.056809715926647186, 0.002858155407011509, 0.09879618883132935, 0.01758350431919098, -0.000755727756768465, -0.01886334829032421, -0.01939820684492588, -0.015167086385190487, -0.01638007164001465, -0.030811725184321404, 0.040916748344898224, -0.04408770054578781, -0.05276006832718849, -0.0029465025290846825, -0.010658985003829002, 0.01662839949131012, 0.004560632165521383, -0.07510954886674881, 0.011556784622371197, -0.04271234944462776, -0.03079262375831604, -0.0036962609738111496, -0.054823096841573715, -0.013915897347033024, 0.02267422154545784, -0.0013025260996073484, -0.01800375245511532, -0.04527203366160393, 0.040993157774209976, -0.033772554248571396, -0.036045707762241364, -0.015778355300426483, 0.0075835431925952435, -0.007077336777001619, 0.0007002122583799064, -0.026609258726239204, 0.034613050520420074, -0.018041955307126045, -0.022827038541436195, -0.038395270705223083, -0.010601678863167763, 0.020592089742422104, 0.011766908690333366, 0.01680031791329384, -0.05402080714702606, -0.03300847113132477, 0.03608391061425209, -0.010200534015893936, -0.03935037553310394, -0.03211066871881485, -0.029188046231865883, -0.0017418749630451202, -0.0075357877649366856, -0.010811801999807358, 0.014059163630008698, -0.01308495458215475, -0.059331197291612625, 0.056083835661411285, -0.00766950286924839, -0.02147078700363636, 0.07434546947479248, -0.02483276091516018, -0.008920691907405853, 0.003581648226827383, -0.03789861500263214, 0.05845249816775322, 0.012569197453558445, -0.09474653750658035, 0.017430687323212624, 0.02038196660578251, 0.05402080714702606, -0.01760260760784149, -0.0026098277885466814, -0.01833803951740265, 0.011489927768707275, 0.0039804051630198956, -0.026131706312298775, -0.0719003975391388, 0.003820424899458885, -0.027258731424808502, -0.04294157400727272, 0.05978965014219284, -0.01690538041293621, 0.011432621628046036, -0.024030471220612526, 0.06338084489107132, -0.019885310903191566, -0.0479845367372036, 0.03904474154114723, 0.0006512630498036742, -0.014727737754583359, 0.007392521947622299, 0.11010464280843735, -0.019083021208643913, -0.06338084489107132, 0.08259758353233337, -0.044164109975099564, -0.0565422885119915, 0.06391570717096329, 0.010935965925455093, 0.01760260760784149, -0.043209005147218704, 0.031193768605589867, -0.04893964156508446, 0.0058070458471775055, -0.04756429046392441, -0.00879175215959549, -0.005878678523004055, -0.04576868936419487, 0.10445041209459305, -0.021508991718292236, -0.06177626922726631, 0.021738216280937195, 0.0430561862885952, -0.035453543066978455, 0.018414447084069252, -0.010152778588235378, -0.002454622881487012, -0.015711497515439987, 0.07977046817541122, 0.08168068528175354, 0.03717273473739624, 0.026628360152244568, -0.030811725184321404, -0.019923515617847443, -0.04263594001531601, -0.003930261824280024, 0.004952225834131241, 0.014355245977640152, 0.03285565227270126, -0.030391478911042213, 0.007110765669494867, 0.07560620456933975, 0.04355284199118614, 0.03048698976635933, -0.012540544383227825, 0.00281995115801692, -0.025310315191745758, -0.037440162152051926, -0.04168083518743515, 0.0070486837066709995, 0.02460353635251522, 0.01758350431919098, -0.00840015895664692, 0.012320869602262974, -0.00015386163431685418, 0.06578771770000458, -0.009450775571167469, 0.021910136565566063, -0.024794556200504303, 0.06834740191698074, -0.0023626938927918673, -0.00023668725043535233, -0.02899702452123165, -0.025654152035713196, 0.021146051585674286, -0.017029544338583946, 0.04064932093024254, 0.05153753235936165, 0.056809715926647186, -0.015883415937423706, -0.05413541942834854, -0.010687638074159622, 0.04439333453774452, 0.02200564742088318, -0.061012182384729385, 0.01106968056410551, -0.005630351137369871, -0.036122117191553116, 0.059751443564891815, -0.06788894534111023, 0.020955029875040054, -0.06792715191841125, -0.07629388570785522, -0.08183349668979645, -0.021738216280937195, 0.013218670152127743, 0.013132710009813309, 0.005405900999903679, -0.0013598324730992317, 0.10521449893712997, 0.004560632165521383, -0.03849077969789505, -0.004937899298965931, 0.015596884302794933, 0.004061589017510414, 0.023476511240005493, 0.002927400404587388, 0.06166165694594383, 0.00703435717150569, -0.010830904357135296, -0.07266447693109512, -0.003584036137908697, -0.005487085320055485, -0.0019340900471433997, -0.013056301511824131, 0.08305603265762329, 0.015549128875136375, -0.03518611192703247, -0.003063503187149763, 0.036122117191553116, 0.004085466731339693, -0.013180465437471867, 0.03574007377028465, -0.004352896474301815, 0.039235763251781464, 0.012530993670225143, 0.016141295433044434, -0.007067786063998938, 0.019636983051896095, 0.03084992989897728, 0.023247284814715385, 0.006891091354191303, -0.0714801475405693, 0.026360930874943733 ]
31,952
sonetel.users
delete
Delete a user from your Sonetel account. :param userid: String. Required. The unique ID of the user to be deleted.
def delete(self, userid: str): """ Delete a user from your Sonetel account. :param userid: String. Required. The unique ID of the user to be deleted. """ if not userid: return util.prepare_error( code=const.ERR_USED_ID_EMPTY, message='user id cannot be empty' ) url = self._url + userid return util.send_api_request( token=self._token, uri=url, method='delete' )
(self, userid: str)
[ -0.03319070488214493, 0.026257457211613655, 0.03939507529139519, -0.017724227160215378, -0.016266467049717903, -0.025635242462158203, -0.011048753745853901, 0.05930594354867935, -0.023110829293727875, 0.0731724426150322, -0.00908877793699503, -0.032710712403059006, 0.022950829938054085, 0.02129751816391945, -0.0017199789872393012, -0.028479652479290962, 0.016337577253580093, 0.03921729698777199, 0.016515353694558144, -0.02433747984468937, 0.020515304058790207, 0.03610622510313988, 0.04369724541902542, 0.003748842980712652, -0.03322625905275345, 0.03267515450716019, 0.05308379605412483, 0.05895039066672325, -0.01585758477449417, -0.044515009969472885, -0.0007911014254204929, -0.0006805472658015788, 0.02520858123898506, 0.045226115733385086, -0.03815064579248428, -0.0052399360574781895, -0.015590920113027096, 0.09080778062343597, -0.07807904481887817, 0.020319752395153046, -0.07093246281147003, 0.0873233750462532, 0.04924384132027626, -0.029510749503970146, 0.007191023323684931, 0.01585758477449417, 0.025795239955186844, 0.004911051131784916, -0.08476340770721436, 0.06367921829223633, 0.001979975728318095, -0.00684436084702611, 0.005915483459830284, -0.02503080479800701, 0.01519092544913292, -0.02497747167944908, 0.00466216541826725, -0.006453254260122776, -0.03804397955536842, 0.03306626155972481, 0.032764043658971786, -0.017502008005976677, -0.012986508198082447, -0.010870978236198425, 0.02725300006568432, -0.020497526973485947, 0.012924286536872387, 0.007253244519233704, 0.01532425731420517, 0.013813164085149765, 0.004168837796896696, -0.023750821128487587, -0.02124418504536152, -0.03187516704201698, 0.047394976019859314, 0.016710907220840454, -0.02143973857164383, 0.020657524466514587, -0.022364171221852303, -0.038363974541425705, 0.0429505854845047, -0.03921729698777199, 0.003619955852627754, 0.024159705266356468, -0.041421715170145035, 0.07118134945631027, 0.05304824188351631, -0.04337724670767784, -0.03388402983546257, 0.05813262239098549, -0.007759904954582453, -0.04622165858745575, -0.04533277824521065, -0.04405279457569122, 0.06250590085983276, 0.029652971774339676, 0.06140369549393654, 0.030097410082817078, 0.01062209252268076, -0.020284196361899376, 0.032550714910030365, -0.028532983735203743, 0.0007294355309568346, 0.016888681799173355, -0.0010449872352182865, -0.02750188671052456, 0.04846163094043732, -0.03633733466267586, 0.05052382871508598, 0.028870757669210434, -0.053937118500471115, 0.008928779512643814, -0.029884079471230507, -0.0030399628449231386, -0.00157442525960505, -0.022915275767445564, 0.039003968238830566, 0.03032851777970791, -0.0026999670080840588, -0.03079073503613472, -0.016390910372138023, -0.005817706696689129, -0.026684118434786797, -0.027110779657959938, 0.09806102514266968, -0.022648612037301064, -0.0818478912115097, 0.04355502501130104, 0.025830795988440514, 0.003948840778321028, -0.03621289134025574, -0.0011966520687565207, -0.02152862586081028, -0.05852372944355011, -0.008128789253532887, 0.029528528451919556, 0.045226115733385086, 0.03432846814393997, 0.02455081045627594, 0.038115087896585464, -0.006208812817931175, 0.04551055654883385, -0.02474636398255825, 0.005991037935018539, 0.017013125121593475, -0.0011644301703199744, -0.014915373176336288, -0.04412390664219856, -0.032657377421855927, 0.020693080499768257, 0.00016194245836231858, 0.07039914280176163, 0.08995445817708969, -0.01877310313284397, -0.026381900534033775, -0.024017484858632088, -0.0009844324085861444, -0.057421520352363586, -0.00626659020781517, -0.003062184900045395, 0.04095949977636337, 0.014817596413195133, 0.012675400823354721, -0.00789323728531599, -0.023910818621516228, 0.009839879348874092, -0.00939544104039669, 0.0606214813888073, -0.011217640712857246, 0.026613008230924606, -0.03971507027745247, 0.016062024980783463, -0.011235417798161507, -0.002121085301041603, 0.04092394560575485, -0.0558570958673954, 0.01375094335526228, -0.053297124803066254, -0.008946557529270649, -0.04888829216361046, -0.020444193854928017, -0.02791077084839344, 0.09301219880580902, 0.0188264362514019, 0.06719917804002762, -0.0016766461776569486, 0.013039840385317802, 0.048319410532712936, -0.02499525062739849, -0.017777560278773308, -0.06993692368268967, 0.00019110877474304289, -0.010942088440060616, 0.06968803703784943, 0.04696831479668617, 0.03722621127963066, 0.026755228638648987, -0.04095949977636337, -0.05777707323431969, -0.08760781586170197, -0.0431283600628376, 0.0482482984662056, -0.020515304058790207, -0.07751016318798065, 0.00171331234741956, -0.026630785316228867, 0.03436402603983879, 0.009964322671294212, -0.044195014983415604, -0.01103986520320177, 0.02200862020254135, 0.004113283008337021, -0.0011183196911588311, 0.07157246023416519, 0.017493119463324547, -0.06748361885547638, 0.0005286046653054655, -0.007959902286529541, 0.020728634670376778, 0.04917273297905922, 0.04604388028383255, -0.006688807159662247, 0.016808683052659035, -0.02124418504536152, 0.017217567190527916, 0.0315551683306694, 0.038683973252773285, -0.002515524858608842, 0.0050577158108353615, -0.05973260477185249, 0.047750528901815414, -0.002566635375842452, 0.05162603408098221, 0.03342181444168091, -0.03351069986820221, -0.03950173780322075, -0.057421520352363586, -0.01871977187693119, -0.0022388615179806948, -0.011857632547616959, 0.026204124093055725, -0.019893089309334755, 0.01581314019858837, 0.0498482808470726, 0.026008570566773415, 0.06808805465698242, 0.026026347652077675, 0.0438394658267498, -0.05219491943717003, -0.08903001993894577, 0.008999889716506004, -0.07999902218580246, 0.022933052852749825, -0.0005197158898226917, 0.023466380313038826, -0.01561758667230606, -0.005817706696689129, 0.04540389031171799, -0.05162603408098221, -0.017608674243092537, -0.022950829938054085, -0.044372789561748505, -0.060479260981082916, 0.07331465929746628, 0.017333121970295906, 0.00467105396091938, -0.008159900084137917, 0.05162603408098221, 0.02199084311723709, -0.004137727431952953, 0.06975914537906647, 0.020195309072732925, 0.019875312224030495, -0.0424172580242157, -0.04415946081280708, -0.025457466021180153, -0.0615103580057621, 0.026453010737895966, 0.07199911773204803, 0.0019421984907239676, -0.05013272166252136, -0.07260355353355408, 0.05948371812701225, 0.008217677474021912, -0.007928792387247086, -0.01382205355912447, 0.0631103366613388, 0.05578598380088806, -0.0004666609747800976, 0.0546126663684845, 0.0033288481645286083, -0.00456883292645216, -0.11498526483774185, 0.009973211213946342, -0.060337040573358536, 0.032444048672914505, -0.08021235466003418, 0.01831088773906231, 0.04017728567123413, 0.022933052852749825, -0.022435281425714493, 0.03347514569759369, -0.05599931627511978, -0.08170566707849503, 0.012995396740734577, 0.004088839050382376, 0.05194603279232979, -0.015164258889853954, 0.016702018678188324, 0.0074310204945504665, -0.0017110902117565274, -0.026897449046373367, -0.08682560175657272, -0.012879842892289162, 0.028781870380043983, 0.035164013504981995, 0.025368578732013702, -0.025901906192302704, 0.016506465151906013, 0.05155492573976517, -0.003517734818160534, 0.00035555122303776443, 0.028408542275428772, 0.002591079333797097, 0.025333024561405182, -0.04405279457569122, -0.0241241492331028, 0.024088595062494278, -0.04846163094043732, 0.05582154169678688, 0.03327959403395653, 0.04287947714328766, 0.01375983189791441, -0.04519055783748627, -0.014124271459877491, -0.07338576763868332, 0.07274577766656876, 0.035661786794662476, -0.01248873583972454, 0.060230374336242676, -0.004786608275026083, -0.044657230377197266, 0.04316391795873642, 0.028746316209435463, 0.011359861120581627, -0.04529722407460213, -0.02119085192680359, -0.05439933389425278, 0.07964347302913666, 0.02759077399969101, 0.06915470957756042, 0.05902149900794029, 0.026488564908504486, -0.03493290767073631, 0.04846163094043732, -0.038683973252773285, 0.013510946184396744, 0.028568539768457413, -0.02497747167944908, -0.023093050345778465, -0.029652971774339676, -0.06158147007226944, 0.025813017040491104, -0.008408785797655582, -0.050737157464027405, -0.009315441362559795, 0.009022112004458904, -0.0869678258895874, 0.05628375709056854, 0.022861942648887634, -0.0041466159746050835, -0.00044027238618582487, -0.011733190156519413, 0.019644204527139664, 0.0066221412271261215, 0.05813262239098549, -0.0005649930681101978, -0.0315551683306694, -0.06175924465060234, -0.02503080479800701, 0.008924335241317749, 0.008911002427339554, 0.041137274354696274, 0.012106518261134624, 0.006688807159662247, -0.014310936443507671, -0.03443513438105583, 0.014070939272642136, -0.039003968238830566, 0.02159973606467247, 0.05311935022473335, -0.026488564908504486, 0.020461972802877426, -0.0010410983813926578, -0.05944816395640373, -0.01512870378792286, 0.0017866448033601046, -0.006724362261593342, -0.05457711219787598, 0.0075287967920303345, 0.006359922233968973, 0.00026541342958807945, -0.026204124093055725, 0.05013272166252136, -0.008182122372090816, 0.03141294792294502, -0.025386355817317963, -0.03418624773621559, -0.03975062444806099, 0.017084235325455666, 0.038648415356874466, -0.028977423906326294, -0.008688782341778278, 0.04376835376024246, 0.07018581032752991, -0.03982173651456833, -0.04874607175588608, 0.056603752076625824, 0.028408542275428772, 0.028621872887015343, 0.005693263839930296, 0.0003413847298361361, -0.007164356764405966, 0.019519761204719543, -0.008048790507018566, 0.04682609438896179, -0.0017866448033601046, -0.00393106322735548, 0.07338576763868332, -0.02741299755871296, -0.017902003601193428, -0.03127072751522064, 0.0021333072800189257, -0.04394612833857536, -0.01823977753520012, 0.01879088208079338, -0.011546525172889233, 0.02775077149271965, -0.005542154423892498, -0.0041621713899075985, 0.05500377342104912, -0.023573044687509537, -0.005008827894926071, -0.05518154799938202, 0.02181306667625904, 0.010435428470373154, -0.009973211213946342, 0.04387501999735832, 0.028675206005573273, -0.0030132965184748173, 0.038719527423381805, -0.00688436022028327, 0.03996395692229271, -0.035608451813459396, -0.02197306416928768, -0.0553237684071064, -0.008853225037455559, 0.004215504042804241, 0.03608844801783562, -0.04007062315940857, 0.0007283244049176574, 0.038470640778541565, -0.07146579027175903, -0.017164234071969986, -0.01370649877935648, 0.02728855609893799, 0.0498482808470726, -0.026719672605395317, 0.05806151404976845, -0.03415069356560707, 0.015208703465759754, -0.03982173651456833, 0.001077209017239511, 0.050239384174346924, 0.0002465247525833547, 0.06862138211727142, 0.038470640778541565, 0.038790635764598846, -0.007795460056513548, 0.013528723269701004, -0.014550933614373207, -0.0433061383664608, 0.014435378834605217, -0.011004310101270676, 0.008271009661257267, -0.019199766218662262, -0.0440172404050827, -0.0070888022892177105, 0.05596376210451126, -0.029777413234114647, 0.028621872887015343, -0.029670748859643936, -0.03950173780322075, -0.013866497203707695, 0.032515157014131546, -0.051128264516592026, -0.020497526973485947, -0.0028044101782143116, -0.03452402353286743, -0.005902150180190802, 0.0000392009096685797, 0.03166183456778526, -0.01076431293040514, -0.0030710736755281687, 0.031821832060813904, -0.0033644032664597034, 0.06538587063550949, 0.04334169253706932, -0.019537538290023804, -0.01234651543200016, -0.05610598251223564, 0.016710907220840454, 0.008782114833593369, -0.023573044687509537, 0.010364317335188389, -0.02782188169658184, -0.008386564441025257, 0.04412390664219856, 0.013475391082465649, -0.020266419276595116, 0.04302169755101204, 0.037972867488861084, -0.020390862599015236, 0.0782923772931099, -0.006319922860711813, -0.02159973606467247, -0.06286145746707916, -0.008915446698665619, 0.04991938918828964, 0.032621823251247406, 0.031964052468538284, 0.007128801662474871, 0.02142195962369442, -0.047430530190467834, -0.007115468382835388, -0.06417699158191681, -0.05973260477185249, -0.054292671382427216, 0.038541752845048904, 0.0071199131198227406, 0.013937607407569885, -0.007435464765876532, -0.01859532855451107, 0.0038555085193365812, -0.06353700160980225, 0.022861942648887634, 0.005066604819148779, 0.04067505896091461, 0.02127973921597004, 0.019573094323277473, 0.026950782164931297, -0.02467525377869606, 0.00919988751411438, 0.0036021783016622066, -0.016435354948043823, 0.026808561757206917, -0.057528186589479446, -0.009519883431494236, -0.03418624773621559, -0.012293183244764805, -0.0359640046954155, -0.003131072735413909, 0.07907459139823914, 0.020373083651065826, 0.02467525377869606, -0.016124246641993523, -0.01531536877155304, -0.06172369047999382, 0.053510457277297974, -0.029670748859643936, -0.047572750598192215, -0.026381900534033775, 0.04974161460995674, 0.04362613335251808, -0.03032851777970791, 0.003186627756804228, -0.038861747831106186, -0.06890582293272018, 0.03070184774696827, -0.0014522044220939279, -0.04063950479030609, 0.020746413618326187, -0.014382046647369862, -0.029848523437976837, -0.0020888634026050568, -0.029315197840332985, 0.019679758697748184, -0.012568735517561436, 0.04920828714966774, 0.006248812656849623, -0.009830990806221962, -0.019644204527139664, -0.019910868257284164, -0.010942088440060616, -0.025724129751324654, 0.026150790974497795, 0.06488809734582901, -0.05802595615386963, -0.022470835596323013, 0.04746608808636665, 0.02485303021967411, 0.02421303652226925, 0.042168375104665756, -0.013155395165085793, 0.01804422400891781, 0.05528821423649788, -0.06385699659585953, -0.03612400218844414, -0.05027494207024574, -0.07047025114297867, 0.041457269340753555, -0.017039792612195015, -0.005328823812305927, 0.08369675278663635, -0.032319605350494385, 0.032550714910030365, 0.03326181694865227, -0.05887927860021591, -0.026008570566773415, -0.03418624773621559, -0.03804397955536842, -0.05802595615386963, -0.027217445895075798, -0.011590969748795033, -0.05802595615386963, -0.002058863639831543, -0.0005733263096772134, 0.03495068475604057, -0.06307478249073029, 0.019626427441835403, -0.09542994201183319, -0.015217592008411884, 0.002375526586547494, 0.026773005723953247, -0.027146335691213608, -0.03132406249642372, -0.029101867228746414, -0.0429505854845047, 0.00196553161367774, 0.009866545908153057, 0.06129702925682068, 0.041492827236652374, -0.03043518401682377, 0.028675206005573273, -0.04647054150700569, 0.029350752010941505, -0.032355159521102905, 0.00007340188312809914, 0.0058088176883757114, -0.014408713206648827, -0.004153282381594181, 0.012382070533931255, 0.038328420370817184, -0.03358181193470955, -0.004951050505042076, 0.020195309072732925, 0.008604339323937893, 0.031964052468538284, -0.038541752845048904, 0.013262060470879078, 0.04359057918190956, -0.029599638655781746, 0.029190754517912865, -0.013484279625117779, -0.05223047360777855, -0.028301876038312912, 0.0484260730445385, -0.06183035671710968, 0.002435525879263878, -0.019484207034111023, -0.008782114833593369, 0.05834595486521721, 0.04711053520441055, 0.003937729634344578, -0.01803533546626568, -0.029244087636470795, -0.019644204527139664, -0.004831051919609308, -0.04657720774412155, 0.008555451408028603, -0.05240824818611145, 0.02748410776257515, 0.03125295042991638, -0.03925285488367081, -0.02120862901210785, 0.03601733595132828, 0.004415501374751329, 0.023946374654769897, -0.04063950479030609, -0.0553237684071064, -0.047750528901815414, -0.04028395190834999, -0.03943062946200371, 0.00045277224853634834, -0.00939544104039669, -0.023857485502958298, -0.02479969710111618, 0.06616807729005814, -0.008991001173853874, 0.08362564444541931, -0.017013125121593475, -0.007066580466926098, 0.03171516954898834, 0.020693080499768257, -0.005297712981700897, 0.006391033064574003, -0.004164393525570631, -0.013199838809669018, 0.01893310248851776, -0.02504858188331127, 0.008568784222006798, -0.029315197840332985, 0.01902198977768421, 0.004791052546352148, -0.0020566415041685104, 0.035928450524806976, -0.05653264373540878, 0.016017582267522812, -0.004191060084849596, 0.01868421584367752, 0.023839708417654037, -0.035324010998010635, 0.053581565618515015, -0.026488564908504486, -0.005502155050635338, -0.04053283855319023, -0.0039110635407269, 0.007199911866337061, 0.03310181945562363, -0.00692435959354043, 0.010319873690605164, -0.008862113580107689, -0.026684118434786797, 0.014310936443507671, -0.011422082781791687, -0.009044334292411804, -0.011359861120581627, -0.047608308494091034, 0.06887026876211166, -0.009519883431494236, -0.08312787115573883, 0.04494167119264603, -0.020764190703630447, -0.017955336719751358, -0.020248642191290855, 0.02407081611454487, 0.026275234296917915, 0.026790782809257507, 0.020941967144608498, 0.028355209156870842, 0.008506562560796738, -0.03086184523999691, -0.023715265095233917, 0.04099505394697189, 0.03651510924100876, -0.01823977753520012, -0.04874607175588608, 0.010115431621670723, -0.02472858689725399, -0.004911051131784916, -0.0031510726548731327, 0.022204173728823662, -0.06773250550031662, 0.019537538290023804, 0.04014173150062561, 0.014559822157025337, 0.006511031650006771, 0.05187492072582245 ]
31,953
sonetel.users
get
Fetch details about all users or a specific user. If userid is not included with the request, details of the current user are fetched. :param all_users: Boolean. Optional. Get a list of all the users in the account. Defaults to False. :param userid: String. Optional. ID of a specific user to get the information for.
def get(self, all_users: bool = False, userid: str = ''): """ Fetch details about all users or a specific user. If userid is not included with the request, details of the current user are fetched. :param all_users: Boolean. Optional. Get a list of all the users in the account. Defaults to False. :param userid: String. Optional. ID of a specific user to get the information for. """ url = self._url if userid: url += userid elif not all_users: url += self._userid return util.send_api_request( token=self._token, uri=url, method='get') if util.is_valid_token(self._decoded_token) else False
(self, all_users: bool = False, userid: str = '')
[ -0.055115509778261185, -0.012988722883164883, -0.002191791543737054, 0.015989534556865692, -0.004736489150673151, -0.015554506331682205, 0.022301893681287766, -0.08409376442432404, -0.012535937130451202, 0.00041921480442397296, -0.008713897317647934, -0.05671357363462448, 0.005424545146524906, 0.060193806886672974, 0.04488788917660713, 0.029368896037340164, 0.002639028010889888, 0.03327528014779091, 0.06236007437109947, -0.002241730922833085, 0.00552220456302166, 0.023491565138101578, 0.05799202620983124, 0.022017793729901314, -0.024876555427908897, 0.008514138869941235, 0.03803396224975586, -0.017880579456686974, 0.04964657500386238, 0.031819261610507965, 0.005255860276520252, -0.018519805744290352, 0.022887852042913437, 0.01887493208050728, -0.05245206505060196, 0.0072046127170324326, 0.012171933427453041, 0.09368216246366501, -0.028143711388111115, 0.04566916450858116, -0.0441066138446331, 0.014284931123256683, 0.06928502768278122, -0.024148548021912575, -0.011142069473862648, -0.0005892867338843644, 0.04190483316779137, 0.0017589819617569447, -0.02651013433933258, 0.019851526245474815, 0.043005723506212234, 0.012482668273150921, -0.043609436601400375, -0.06193392351269722, -0.003986285999417305, -0.030150173231959343, -0.03189028799533844, -0.0013761121081188321, -0.01417839340865612, 0.049469009041786194, -0.026474621146917343, -0.051741816103458405, 0.020259922370314598, -0.018608586862683296, 0.01653110235929489, 0.0006730742170475423, -0.021840231493115425, -0.000843978428747505, -0.0012473789975047112, 0.06086854636669159, 0.02807268686592579, 0.0075641777366399765, -0.01622924394905567, -0.023722397163510323, -0.020277677103877068, -0.003868650645017624, -0.06800657510757446, -0.028445569798350334, -0.058950867503881454, 0.006108161993324757, 0.01901698112487793, -0.0071113924495875835, -0.02777083031833172, 0.025231681764125824, -0.035672377794981, 0.04875876009464264, -0.018466535955667496, -0.0974464938044548, -0.0072889551520347595, 0.05628742277622223, -0.013308336026966572, -0.031339842826128006, -0.027966149151325226, 0.010405182838439941, 0.020632803440093994, -0.031659457832574844, -0.01661100424826145, 0.07130923867225647, -0.02574661374092102, 0.009579516015946865, -0.03492661193013191, -0.087645024061203, -0.019443131983280182, 0.045314040035009384, 0.0045766825787723064, -0.03476680815219879, 0.01049396488815546, -0.003114008577540517, 0.08025840669870377, 0.02317195199429989, -0.096310093998909, 0.01753433234989643, -0.010946749709546566, 0.02143183723092079, -0.03261829540133476, 0.007164661306887865, 0.009961276315152645, 0.04275713488459587, -0.028942745178937912, -0.03490885719656944, -0.0075641777366399765, 0.02682974748313427, 0.03615179657936096, -0.030008122324943542, 0.037004098296165466, 0.01349477656185627, -0.08871040493249893, 0.009455221705138683, 0.06193392351269722, 0.019088007509708405, -0.023509321734309196, -0.012021005153656006, -0.027202628552913666, -0.015163867734372616, 0.038992803543806076, 0.010316401720046997, -0.009366440586745739, 0.05163527652621269, 0.03956100344657898, 0.07393717020750046, -0.024130791425704956, -0.0012540376046672463, 0.022728044539690018, -0.000776837463490665, -0.028552107512950897, -0.012544815428555012, 0.0699242502450943, -0.0331687405705452, -0.02116549201309681, -0.025835394859313965, 0.056784600019454956, 0.06278622150421143, 0.009552881121635437, -0.03283137083053589, -0.03970305249094963, 0.009179999120533466, 0.04375148564577103, -0.04201137274503708, -0.007355540990829468, 0.017223596572875977, -0.012642474845051765, -0.0208281222730875, -0.017960483208298683, -0.04105253145098686, -0.004616633988916874, -0.0005546064930967987, -0.02654564566910267, -0.0009238817146979272, 0.02006460167467594, 0.02374015375971794, -0.042259957641363144, -0.013459264300763607, -0.02913806401193142, -0.006423335988074541, 0.02038421481847763, -0.08352556824684143, -0.03231643885374069, -0.06349647790193558, 0.008740531280636787, 0.028143711388111115, -0.01791609264910221, -0.06729631870985031, 0.03661346063017845, -0.0018044825410470366, 0.054795894771814346, 0.008301063440740108, 0.04964657500386238, 0.016761932522058487, -0.044248662889003754, 0.04169175773859024, -0.061685334891080856, 0.007284516002982855, -0.026297058910131454, 0.022941119968891144, -0.02068607322871685, -0.018644100055098534, 0.020117871463298798, 0.009330928325653076, -0.04261508584022522, -0.04446173831820488, -0.02343829721212387, 0.03354162350296974, 0.0006847267504781485, -0.04133663326501846, -0.005002833437174559, 0.007475396152585745, -0.008705019019544125, -0.021112224087119102, -0.012171933427453041, -0.013210676610469818, 0.01614934206008911, -0.0029586409218609333, -0.041762784123420715, 0.04932695999741554, -0.016371294856071472, 0.04865222051739693, -0.01187895517796278, -0.0097304442897439, 0.018679611384868622, 0.015075086615979671, 0.07855380326509476, -0.09460549056529999, -0.0013572460738942027, -0.002645686501637101, -0.026758721098303795, 0.05784997716546059, 0.054795894771814346, -0.026936285197734833, -0.044674813747406006, -0.041017018258571625, 0.04645044356584549, -0.0337369404733181, 0.057423826307058334, 0.049007348716259, -0.08047148585319519, -0.0009638333576731384, -0.004192702937871218, 0.011514950543642044, 0.019372107461094856, 0.03192580118775368, 0.039774078875780106, 0.014817619696259499, -0.007510908879339695, 0.01725023053586483, -0.01556338369846344, -0.002856542356312275, -0.012775647453963757, 0.0560743473470211, -0.03338181599974632, -0.0560743473470211, -0.0012540376046672463, -0.03506866469979286, 0.024805530905723572, -0.014755473472177982, -0.02851659432053566, -0.05891535431146622, -0.06726080924272537, 0.00009509322990197688, -0.001934325322508812, -0.04460378736257553, 0.019691720604896545, 0.013139651156961918, -0.05323334410786629, 0.06793554872274399, 0.006902755703777075, -0.000581518339458853, -0.009899129159748554, 0.0008018072694540024, -0.03444719314575195, -0.01801375113427639, 0.04634390398859978, 0.03874421492218971, -0.0161848533898592, -0.0228523388504982, -0.029049282893538475, -0.01661100424826145, 0.0016091633588075638, 0.02897825837135315, -0.02620827779173851, -0.028019418939948082, -0.08061353862285614, -0.01686847023665905, 0.012171933427453041, -0.0027832977939397097, 0.013459264300763607, -0.05784997716546059, 0.05319783091545105, 0.05046336352825165, -0.05209694057703018, 0.003422524081543088, 0.05912842974066734, -0.001834446215070784, -0.09680726379156113, -0.03279585763812065, -0.012367252260446548, 0.001001565484330058, -0.060300346463918686, -0.03860216587781906, 0.03631160408258438, 0.02313643880188465, -0.01693061739206314, 0.007155783008784056, -0.04510096460580826, -0.06864579766988754, 0.04985965043306351, -0.018129168078303337, 0.020029090344905853, -0.018626343458890915, 0.005118249449878931, 0.03714614734053612, 0.01887493208050728, -0.049895159900188446, -0.01050284318625927, -0.001392758684232831, -0.014489129185676575, -0.05458281934261322, 0.0009693821775726974, 0.0031406430061906576, 0.04371597617864609, 0.040235742926597595, -0.031499650329351425, 0.013450386002659798, 0.04286367446184158, -0.028711913153529167, 0.05408564582467079, 0.002069717040285468, -0.005890647415071726, 0.07091860473155975, -0.0650235190987587, 0.0732269212603569, 0.023402784019708633, -0.0016979448264464736, -0.029351139441132545, 0.016238123178482056, -0.05486692115664482, -0.006041576154530048, 0.014622300863265991, 0.026492377743124962, 0.023811178281903267, 0.03036324866116047, 0.003842016216367483, -0.059554580599069595, 0.01225183717906475, 0.028623132035136223, 0.0066452897153794765, -0.029795046895742416, 0.038708701729774475, 0.014409225434064865, 0.011008896864950657, -0.039489977061748505, -0.011275241151452065, -0.05937701836228371, 0.04204688221216202, 0.007577494718134403, 0.02512514404952526, 0.0075508602894842625, -0.019407620653510094, -0.0045766825787723064, 0.01018323004245758, -0.020881392061710358, -0.016903983429074287, -0.0503213107585907, -0.009206634014844894, 0.039170365780591965, -0.08338351547718048, 0.0030496420804411173, 0.042721621692180634, -0.049113884568214417, 0.07471844553947449, -0.0028609815053641796, -0.0367555096745491, -0.00446348637342453, -0.008851508609950542, 0.012438277713954449, 0.011994370259344578, 0.02714936062693596, -0.025817638263106346, -0.008824873715639114, -0.04723171889781952, 0.021041197702288628, 0.00433697272092104, 0.028392300009727478, 0.027859611436724663, 0.05323334410786629, 0.04020022973418236, -0.033807966858148575, -0.011292997747659683, 0.019318837672472, -0.020597290247678757, 0.011301875114440918, 0.03952549025416374, -0.0058862087316811085, -0.01669090799987316, -0.013991952873766422, -0.06395813822746277, -0.010378548875451088, 0.0818919911980629, 0.006383384577929974, -0.02130754292011261, -0.022763557732105255, 0.02697179652750492, -0.022177601233124733, 0.02221311256289482, 0.04307674989104271, -0.022728044539690018, 0.005797427147626877, 0.027824098244309425, -0.08949168026447296, -0.04243752360343933, 0.024130791425704956, 0.005082736723124981, -0.043893538415431976, -0.02588866464793682, 0.02084587886929512, 0.05713972449302673, -0.038424599915742874, -0.031322088092565536, 0.10220517963171005, 0.07983225584030151, 0.08423581719398499, 0.00019934204465243965, -0.0704924538731575, -0.0080347191542387, 0.017054911702871323, -0.03970305249094963, 0.013690096326172352, 0.010147716850042343, -0.014196150004863739, 0.0667281225323677, -0.016975007951259613, 0.044994425028562546, -0.02956421487033367, -0.023988740518689156, -0.0012606962118297815, 0.03389674797654152, -0.02327848970890045, 0.005300251301378012, -0.002443708712235093, -0.000777392357122153, -0.015918510034680367, 0.03183702006936073, -0.010467329993844032, 0.000994906877167523, -0.040519844740629196, -0.009206634014844894, -0.031659457832574844, -0.029315626248717308, 0.07024386525154114, 0.02819698117673397, -0.053730517625808716, -0.01788945682346821, 0.0038375770673155785, 0.017214719206094742, -0.013903171755373478, -0.014915280044078827, -0.03192580118775368, -0.015829728916287422, 0.007914864458143711, 0.05745933949947357, 0.03725268691778183, 0.030753886327147484, -0.011079922318458557, -0.06932053714990616, 0.003393670078366995, 0.028765182942152023, -0.050996050238609314, 0.006849486846476793, 0.016983887180685997, 0.016078315675258636, -0.0321388766169548, 0.006805096287280321, -0.018679611384868622, -0.02787736803293228, 0.012615840882062912, 0.01622924394905567, 0.016921740025281906, 0.013432629406452179, 0.037359222769737244, -0.013663461431860924, -0.05191937834024429, -0.009659418836236, -0.013201798312366009, 0.013512533158063889, -0.03469578176736832, 0.01610495150089264, -0.04098150506615639, -0.004878539592027664, 0.04641493037343025, 0.00439246091991663, -0.022284138947725296, 0.02883620746433735, 0.043005723506212234, -0.05184835195541382, 0.021041197702288628, -0.04172727093100548, -0.004976199008524418, 0.02377566508948803, -0.035033151507377625, 0.009579516015946865, 0.07017283886671066, 0.022284138947725296, -0.022337406873703003, 0.04794197157025337, 0.03828255087137222, 0.01841326802968979, 0.012092030607163906, -0.008505260571837425, 0.01317516341805458, -0.0003870315267704427, -0.028445569798350334, -0.0012118665035814047, 0.013698973692953587, 0.0068006571382284164, -0.03094920516014099, -0.012473789975047112, -0.060193806886672974, 0.0002072491479339078, 0.047586843371391296, 0.012154176831245422, -0.0026212716475129128, 0.03444719314575195, 0.08061353862285614, 0.015714311972260475, 0.071344755589962, 0.008394284173846245, 0.03629384562373161, -0.08317044377326965, 0.012775647453963757, -0.030913691967725754, 0.02235516346991062, 0.005464497022330761, 0.004847466014325619, 0.01772965118288994, -0.0010531697189435363, -0.03155291825532913, -0.0667281225323677, -0.05476038530468941, -0.031641699373722076, -0.0009344245190732181, -0.0007313370006158948, 0.07677818089723587, -0.011621488258242607, 0.012589205987751484, -0.03251175954937935, -0.06349647790193558, -0.01110655628144741, -0.03267156332731247, 0.04510096460580826, 0.09694931656122208, -0.011790173128247261, 0.045775704085826874, -0.04034227877855301, 0.0024281719233840704, -0.027025066316127777, -0.01325506716966629, 0.0037088440731167793, -0.06410019099712372, 0.04357392340898514, -0.07216154038906097, 0.004949564579874277, 0.025231681764125824, 0.011275241151452065, -0.015909630805253983, 0.027504485100507736, -0.035938721150159836, -0.04506545141339302, 0.0017489941092208028, 0.026723209768533707, 0.03183702006936073, -0.03803396224975586, -0.027646536007523537, 0.014577910304069519, -0.03799844905734062, 0.04971759766340256, 0.018963713198900223, 0.010556112043559551, -0.010138838551938534, -0.03004363551735878, 0.06225353479385376, -0.019993577152490616, -0.0038841874338686466, 0.017037155106663704, 0.02958197146654129, -0.030842667445540428, 0.05138668790459633, -0.02700730971992016, -0.006640850566327572, -0.01187895517796278, 0.09971930086612701, -0.005078297574073076, 0.010822456330060959, -0.050996050238609314, -0.021396324038505554, -0.004059530794620514, 0.006352311000227928, 0.04907837137579918, -0.0392058789730072, -0.0098014697432518, -0.0007901546778157353, -0.010058935731649399, -0.0018144703935831785, 0.05454730987548828, 0.02317195199429989, -0.05593229830265045, -0.004785318858921528, 0.04879427328705788, -0.038531139492988586, 0.013627949170768261, -0.05344641953706741, -0.01978050172328949, 0.04446173831820488, -0.01914127543568611, 0.02544475719332695, 0.08174993842840195, -0.021698180586099625, 0.06129469722509384, 0.008478626608848572, 0.013645704835653305, -0.03860216587781906, -0.05270065367221832, -0.009135608561336994, 0.002827688353136182, -0.04190483316779137, 0.05365949496626854, -0.06449082493782043, -0.036577947437763214, 0.02988382801413536, 0.04985965043306351, -0.022195355966687202, 0.04179829731583595, -0.05131566524505615, 0.00038453456363640726, -0.01074255257844925, 0.030114660039544106, 0.019265569746494293, -0.036400385200977325, 0.03608077019453049, -0.012171933427453041, -0.009135608561336994, 0.03789191320538521, -0.030682861804962158, 0.09893801808357239, -0.014391468837857246, -0.013849902898073196, -0.0030341052915900946, 0.023580346256494522, -0.07954815775156021, 0.028729669749736786, 0.06942707300186157, -0.017747407779097557, -0.046983130276203156, 0.051102589815855026, 0.05969662964344025, 0.0277530737221241, -0.06086854636669159, 0.002303878078237176, -0.03354162350296974, -0.007031489163637161, -0.030008122324943542, 0.03022119775414467, -0.01933659426867962, -0.03799844905734062, 0.07457640022039413, -0.08835527300834656, -0.06491697579622269, 0.0017256889259442687, -0.06299930065870285, -0.04368046298623085, 0.039489977061748505, -0.02301214635372162, 0.024645723402500153, 0.08182096481323242, 0.05934150516986847, 0.006534312851727009, -0.03789191320538521, -0.01930108293890953, -0.03620506450533867, -0.030309978872537613, -0.05078297480940819, 0.006627533584833145, 0.033950015902519226, -0.015004061162471771, 0.01604280434548855, 0.005393471568822861, -0.015936266630887985, 0.017427794635295868, -0.0013761121081188321, 0.01990479603409767, -0.04954003542661667, -0.01074255257844925, -0.008141256868839264, -0.05394359305500984, 0.001784506719559431, 0.03501539304852486, 0.05369500815868378, 0.026634428650140762, -0.0604068823158741, 0.03418084979057312, 0.051422201097011566, 0.06576927751302719, -0.04904285818338394, -0.026137251406908035, 0.038637675344944, 0.03375469893217087, -0.00797257199883461, 0.016442319378256798, 0.015101720578968525, -0.03497988358139992, -0.04204688221216202, -0.022177601233124733, -0.020330946892499924, 0.002672320930287242, 0.012660231441259384, -0.013219553977251053, -0.01011220458894968, -0.02695404179394245, 0.027255898341536522, 0.006121479440480471, -0.00486522214487195, 0.037359222769737244, 0.0638871118426323, -0.030629592016339302, 0.035920966416597366, -0.001968728145584464, 0.005446740426123142, 0.010600502602756023, -0.02175145037472248, -0.015368064865469933, 0.026172764599323273, 0.019105762243270874, 0.03924139216542244, -0.026723209768533707, 0.012438277713954449, 0.029777290299534798, 0.014276053756475449, -0.009295415133237839, 0.001739006140269339, -0.044994425028562546, 0.02727365493774414, 0.03295566514134407, -0.037785373628139496, -0.004807514138519764, 0.0227102879434824, 0.02974177710711956, -0.08927860110998154, -0.02054402232170105, 0.04172727093100548, -0.0045167552307248116, 0.020455241203308105, 0.06289276480674744, 0.014897523447871208, -0.00021210437989793718, 0.022621506825089455, -0.008931411430239677, 0.061720848083496094, 0.02835678681731224, -0.04687659442424774, 0.008039157837629318, 0.020632803440093994, -0.009872494265437126, -0.023100927472114563, 0.022106574848294258, -0.06814862042665482, 0.043786998838186264, 0.008633993566036224, 0.05660703778266907, 0.029990365728735924, 0.07954815775156021 ]
31,954
sonetel.users
update
update user settings
def update(self, request: dict): """ update user settings """ raise NotImplementedError
(self, request: dict)
[ -0.01078008022159338, -0.025055034086108208, -0.03575913980603218, 0.015296402387320995, -0.0031740879639983177, -0.026203108951449394, -0.05081917345523834, -0.004778015427291393, 0.01648668572306633, 0.014148328453302383, -0.015127567574381828, -0.04835418984293938, 0.020817289128899574, 0.06858056038618088, 0.0035180882550776005, -0.031588926911354065, 0.01875750906765461, -0.008821601048111916, 0.03937219828367233, -0.0638531967997551, 0.005090359132736921, -0.03775138780474663, 0.040824174880981445, 0.0556478388607502, -0.018453607335686684, 0.00793099869042635, 0.05801152065396309, 0.013616499491035938, 0.05081917345523834, -0.020361436530947685, 0.018436724320054054, 0.003241621656343341, 0.02196536399424076, 0.051629580557346344, -0.0026443698443472385, -0.05372312664985657, -0.04011506959795952, 0.08792898803949356, -0.0824587494134903, -0.006647856906056404, -0.0876588523387909, 0.01345610711723566, -0.0032268487848341465, -0.020141951739788055, 0.04285018518567085, 0.07340922206640244, -0.029242129996418953, 0.09995000064373016, 0.010433970019221306, 0.030525270849466324, 0.003594063688069582, -0.008602116256952286, -0.014123002998530865, -0.005702383816242218, -0.03079540655016899, 0.006373500917106867, 0.0054744575172662735, 0.014502880163490772, 0.005951414816081524, 0.0018170808907598257, 0.02437969669699669, -0.025274518877267838, 0.011143074370920658, -0.040013767778873444, -0.00641993060708046, -0.019973117858171463, -0.027452483773231506, 0.011725553311407566, 0.015566537156701088, 0.023349806666374207, 0.023991378024220467, -0.035252634435892105, -0.01874062605202198, -0.016216550022363663, -0.003480100305750966, 0.011362559162080288, -0.01564251258969307, 0.01936531253159046, -0.041060540825128555, 0.028786275535821915, 0.0572686493396759, -0.03778515383601189, -0.0013306266628205776, 0.012958045117557049, -0.008378410711884499, -0.03646824508905411, 0.024193977937102318, -0.0670948177576065, -0.017845802009105682, 0.029596680775284767, -0.00122827070299536, -0.01153983548283577, 0.01316064689308405, -0.03643447905778885, 0.04585544019937515, -0.00841639842838049, -0.000545018760021776, -0.06020636856555939, -0.07800152152776718, -0.034982502460479736, 0.007821256294846535, 0.004229303449392319, 0.05294648930430412, -0.015000942163169384, 0.048793159425258636, -0.05902452766895294, 0.03337857499718666, -0.05470236763358116, 0.025916090235114098, -0.01672305352985859, 0.011877504177391529, -0.04956979677081108, -0.07867685705423355, 0.040857940912246704, -0.006850458215922117, 0.003505425527691841, -0.040418971329927444, -0.0019310441566631198, 0.04669961333274841, -0.011151515878736973, -0.07394949346780777, 0.054432231932878494, -0.012215173803269863, 0.022303031757473946, 0.07482743263244629, 0.0029524927958846092, -0.018065286800265312, 0.035894207656383514, 0.04389696195721626, -0.003364026779308915, -0.0809054747223854, -0.04649700969457626, -0.02586543932557106, -0.020344553515315056, 0.0448424331843853, -0.016807470470666885, 0.048590559512376785, -0.04133067652583122, 0.018909459933638573, 0.07908206433057785, -0.006225770805031061, 0.06159081310033798, 0.021830296143889427, -0.036940980702638626, 0.022336799651384354, -0.007074164226651192, 0.02027701959013939, 0.01552432868629694, -0.01830165646970272, -0.030272020027041435, 0.052068550139665604, 0.02497061714529991, 0.01098268199712038, -0.004218751098960638, -0.09144074469804764, 0.036333177238702774, -0.002408001571893692, -0.07496250420808792, -0.010847614146769047, -0.013101554475724697, -0.010594362393021584, 0.00894822645932436, 0.004562751390039921, 0.005791021976619959, -0.0025810569059103727, 0.028077172115445137, 0.0190107598900795, -0.03727864846587181, 0.026371942833065987, 0.022978371009230614, -0.0258316732943058, -0.04227615147829056, -0.03724488243460655, 0.016663961112499237, 0.05021136999130249, 0.0317239947617054, 0.0010235588997602463, -0.07361182570457458, 0.04585544019937515, -0.003543413244187832, 0.005339390132576227, -0.01705228164792061, -0.015887323766946793, 0.05132567882537842, 0.03445911407470703, 0.03768385201692581, -0.015667838975787163, 0.04842172563076019, -0.02610180899500847, 0.04389696195721626, 0.04312032088637352, -0.0582478903234005, 0.006740715820342302, -0.02324850484728813, -0.03430716320872307, -0.005352052394300699, -0.002024958375841379, -0.07192347943782806, -0.01237556617707014, 0.008091391995549202, 0.0050312671810388565, -0.050346437841653824, -0.015237309969961643, 0.014637948013842106, 0.03278765454888344, 0.034982502460479736, 0.07550277560949326, -0.005318285431712866, 0.00004877073661191389, -0.01637694239616394, 0.008513477630913258, 0.025781022384762764, -0.01121904980391264, 0.0021864064037799835, -0.011725553311407566, -0.027975870296359062, 0.025274518877267838, 0.0017358292825520039, -0.045146334916353226, 0.014823665842413902, 0.008239122107625008, 0.036502011120319366, 0.003505425527691841, -0.04875939339399338, 0.06517010182142258, -0.0008183195604942739, 0.006010506767779589, -0.03515133634209633, -0.04693597927689552, -0.030272020027041435, 0.01896011084318161, 0.004402358550578356, 0.014097677543759346, 0.06702728569507599, 0.018841926008462906, -0.011852179653942585, -0.015676280483603477, -0.04480866715312004, -0.044268395751714706, 0.008922901004552841, 0.012586609460413456, -0.004372812807559967, 0.03508380055427551, 0.0418371818959713, -0.06756754964590073, -0.01294116210192442, 0.010611246339976788, 0.0016746268374845386, -0.017119813710451126, -0.0560530424118042, 0.06901952624320984, -0.03192659839987755, -0.03981116786599159, 0.0556478388607502, -0.017525017261505127, 0.025325169786810875, 0.008424839936196804, 0.085295170545578, 0.005791021976619959, -0.03378377482295036, -0.016875004395842552, -0.022995254024863243, -0.027081048116087914, 0.008880692534148693, -0.006128691136837006, -0.02546023763716221, 0.03687344864010811, 0.042377449572086334, -0.006614089943468571, 0.003484321292489767, 0.0712481439113617, 0.08421462774276733, -0.009632006287574768, 0.025105684995651245, 0.009176152758300304, -0.049063295125961304, 0.03873062506318092, 0.048387955874204636, -0.04139821231365204, -0.03636694326996803, 0.044943735003471375, -0.05480366572737694, 0.03167334571480751, 0.07084294408559799, -0.03145385906100273, -0.031133074313402176, 0.013202855363488197, 0.09920713305473328, -0.03670461103320122, 0.01581134833395481, 0.026996631175279617, 0.01831853948533535, -0.025342052802443504, 0.015802904963493347, -0.02848237380385399, 0.01875750906765461, -0.047780152410268784, 0.04291772097349167, 0.06419086456298828, 0.03562407195568085, 0.022083546966314316, -0.0027604433707892895, -0.09272389113903046, -0.030508387833833694, 0.11460483074188232, -0.01983805000782013, 0.08543024212121964, -0.0028617442585527897, 0.008990434929728508, 0.0586530938744545, 0.008319318294525146, -0.018706858158111572, -0.05146074295043945, 0.0732741579413414, -0.057673852890729904, -0.047780152410268784, -0.019939349964261055, -0.015211985446512699, 0.00915082823485136, 0.05561407282948494, -0.04355929046869278, 0.0004049389099236578, 0.02264070138335228, 0.004339045844972134, -0.02135756053030491, -0.017280207946896553, 0.03214608132839203, 0.04659831151366234, -0.004735806491225958, 0.001033055828884244, -0.06820912659168243, -0.0024523206520825624, 0.05618811026215553, -0.015887323766946793, -0.10704105347394943, 0.00818847119808197, 0.019973117858171463, 0.003096001921221614, 0.03162269666790962, 0.012662584893405437, 0.011987246572971344, -0.0007222949643619359, -0.028313539922237396, -0.009159269742667675, -0.024700481444597244, -0.054229628294706345, 0.01808217167854309, 0.008534582331776619, 0.060476504266262054, -0.023653708398342133, -0.024430347606539726, -0.00791411567479372, 0.015423028729856014, -0.009522263891994953, 0.06257005035877228, -0.02696286328136921, 0.016993189230561256, -0.0728689581155777, 0.009665773250162601, -0.07104554027318954, -0.013447664678096771, -0.011480743996798992, 0.060071300715208054, 0.016917213797569275, -0.01963544823229313, 0.006027390249073505, -0.02130690962076187, 0.001839240430854261, 0.1048799678683281, -0.05834919214248657, 0.041094306856393814, 0.01034111063927412, 0.019027644768357277, 0.02885380946099758, 0.02586543932557106, 0.02284330315887928, -0.043255388736724854, 0.02390695922076702, -0.08779392391443253, 0.002798431320115924, 0.06395449489355087, -0.0060780406929552555, -0.007559563033282757, 0.04659831151366234, 0.007618654984980822, -0.01875750906765461, 0.017280207946896553, 0.003469548188149929, 0.0003337118832860142, 0.02307967096567154, -0.0063481759279966354, 0.01571848802268505, -0.040182601660490036, 0.03839295729994774, -0.06601427495479584, 0.03660331293940544, -0.005060812924057245, -0.010501503944396973, -0.029191479086875916, -0.004060468636453152, 0.02949538081884384, -0.056390710175037384, 0.0263212937861681, 0.0037080268375575542, -0.0044403462670743465, -0.002041841857135296, -0.03165646269917488, 0.08853679150342941, 0.020547153428196907, 0.007331636734306812, -0.044268395751714706, -0.004343266598880291, 0.007724176626652479, -0.023434223607182503, -0.005128346849232912, -0.06621687859296799, -0.03450976312160492, -0.03361494094133377, 0.004453008994460106, 0.060847941786050797, 0.06871562451124191, 0.036974746733903885, -0.03040708601474762, 0.0788794606924057, -0.0018339643720537424, -0.028617441654205322, 0.04960356652736664, -0.015997065231204033, 0.010265135206282139, 0.0400475338101387, -0.025392703711986542, 0.007808594033122063, -0.0017453262116760015, 0.010155392810702324, 0.011556719429790974, -0.004554309882223606, 0.021171841770410538, -0.01811593770980835, -0.07881192862987518, 0.01897699385881424, 0.022590050473809242, -0.02154327742755413, -0.006740715820342302, -0.017305532470345497, 0.05814658850431442, -0.011430093087255955, -0.05794398859143257, 0.0025409585796296597, -0.0009264791151508689, -0.03354740887880325, -0.026034275069832802, 0.001391829107888043, -0.010476178489625454, -0.02093547396361828, -0.006685844622552395, -0.01705228164792061, -0.05210231617093086, -0.03302402049303055, 0.03359805792570114, -0.0045585306361317635, -0.010754755698144436, -0.019517263397574425, -0.04811782389879227, 0.010501503944396973, 0.047307416796684265, 0.021897830069065094, 0.035421472042798996, 0.006386163644492626, -0.0044192420318722725, -0.008762508630752563, -0.003834652714431286, -0.039946235716342926, -0.02649012766778469, -0.012806094251573086, -0.027486249804496765, -0.003302824217826128, -0.021627694368362427, 0.04788145422935486, -0.05176464840769768, -0.02046273648738861, -0.018673092126846313, 0.041499510407447815, 0.022792652249336243, 0.04609180986881256, 0.0187237411737442, -0.10798652470111847, 0.03234868496656418, -0.01714514009654522, 0.04119560867547989, -0.02220173180103302, 0.0299343504011631, -0.04497750103473663, 0.0015902096638455987, -0.03768385201692581, -0.05196724832057953, -0.032213617116212845, -0.03775138780474663, 0.008922901004552841, 0.028803160414099693, 0.02956291474401951, 0.011894388124346733, -0.01056903786957264, 0.02242121659219265, 0.014156769961118698, 0.03256816789507866, 0.012890511192381382, -0.052304916083812714, 0.04832042381167412, 0.04048650339245796, 0.0158619973808527, -0.0278239194303751, 0.005778359714895487, 0.03721111640334129, -0.010282019153237343, 0.06432592868804932, -0.004415021277964115, -0.028836926445364952, 0.026355059817433357, 0.013363247737288475, -0.012569725513458252, 0.005347831640392542, -0.0013190192403271794, 0.09805905818939209, 0.0034294500946998596, 0.006668961141258478, -0.0034969837870448828, -0.009783957153558731, -0.016123691573739052, 0.012544400990009308, 0.027081048116087914, 0.0019521485082805157, 0.0071037099696695805, -0.027216115966439247, 0.007361182477325201, 0.03515133634209633, 0.005242309998720884, -0.04528140276670456, -0.04693597927689552, -0.06452853232622147, 0.01747436635196209, -0.015541212633252144, -0.0004439818731043488, -0.0025240753311663866, 0.013000253587961197, -0.03256816789507866, -0.05406079441308975, -0.00034083458012901247, -0.019500380381941795, -0.0065507772378623486, -0.07773138582706451, -0.13162334263324738, -0.010324227623641491, 0.033496756106615067, 0.05254128575325012, -0.05730241537094116, -0.030964240431785583, -0.03251751884818077, -0.011877504177391529, 0.005238089244812727, 0.03015383519232273, -0.023890076205134392, -0.08873939514160156, 0.034155212342739105, 0.04919836297631264, -0.028735626488924026, 0.028583675622940063, -0.030677221715450287, 0.04382942616939545, -0.030542153865098953, 0.01121904980391264, 0.006533893756568432, 0.012021013535559177, -0.010493061505258083, 0.016621753573417664, -0.0038008857518434525, -0.025949856266379356, 0.022134197875857353, 0.007196568883955479, 0.023890076205134392, -0.015693163499236107, -0.0504477359354496, 0.018656209111213684, 0.016714612022042274, -0.021053656935691833, -0.0014720255276188254, -0.017069164663553238, 0.019297778606414795, 0.06223238259553909, 0.01764320209622383, 0.05662707984447479, -0.05574914067983627, -0.013498315587639809, -0.05200101435184479, -0.02198224700987339, 0.004689377266913652, 0.004381254315376282, -0.055512771010398865, -0.11352429538965225, 0.008652766235172749, 0.008745625615119934, -0.05669461190700531, 0.01689188741147518, -0.0015458905836567283, 0.0003487486974336207, -0.007289427798241377, 0.011801528744399548, -0.04396449401974678, -0.005280297715216875, -0.03128502517938614, -0.05622187629342079, 0.017373066395521164, -0.022134197875857353, -0.006875783670693636, 0.08853679150342941, 0.002532517071813345, 0.008855368010699749, 0.003207854926586151, 0.006453697569668293, 0.004094235599040985, -0.03721111640334129, -0.05173087865114212, 0.03229803219437599, -0.017947103828191757, 0.004803340416401625, -0.04767885431647301, 0.013616499491035938, 0.03812282159924507, 0.0297317486256361, -0.08191848546266556, -0.01980428211390972, -0.024025144055485725, -0.004461450502276421, 0.01899387687444687, 0.015161334536969662, 0.04555153846740723, -0.0013971051666885614, -0.021712111309170723, -0.039574798196554184, -0.006913771387189627, -0.0046091810800135136, 0.08198601752519608, 0.03354740887880325, 0.07820412516593933, -0.004372812807559967, 0.0008816324407234788, 0.1145372986793518, -0.042647585272789, -0.030727872624993324, -0.017356183379888535, -0.003361916169524193, -0.06591297686100006, 0.00197852891869843, 0.000364049308700487, 0.03559030592441559, 0.0276213176548481, 0.0037671190220862627, 0.0002915032673627138, 0.0013506757095456123, 0.017356183379888535, -0.06223238259553909, -0.052271150052547455, -0.007048838771879673, 0.04285018518567085, -0.014637948013842106, 0.023805659264326096, 0.06071287393569946, -0.060476504266262054, 0.024092677980661392, 0.03727864846587181, 0.0009570803376846015, 0.06061157211661339, 0.025342052802443504, 0.028836926445364952, 0.059834934771060944, 0.019331546500325203, -0.044268395751714706, 0.005090359132736921, -0.011159958317875862, -0.003653155639767647, 0.010678780265152454, 0.0024839770048856735, -0.018065286800265312, -0.012974928133189678, 0.023603057488799095, -0.006432592868804932, -0.005136788357049227, 0.016773704439401627, -0.012831419706344604, -0.011126191355288029, 0.04332292452454567, -0.040824174880981445, -0.05497249960899353, -0.07719111442565918, -0.006487464066594839, 0.04166834428906441, -0.06321161985397339, -0.05081917345523834, 0.013101554475724697, 0.012291149236261845, 0.05791022256016731, 0.01830165646970272, -0.01608148217201233, 0.013608057983219624, 0.008061845786869526, 0.0060484944842755795, 0.0011206388007849455, -0.02179653011262417, -0.049704864621162415, 0.007078384980559349, -0.008310876786708832, -0.0009053748217411339, 0.010189159773290157, 0.024497881531715393, -0.026625195518136024, 0.030052535235881805, 0.046226877719163895, -0.020614687353372574, -0.0008900741813704371, 0.0034779899287968874, 0.03104865737259388, -0.0235186405479908, 0.01046773698180914, 0.00232147378847003, -0.05308155715465546, 0.03447599709033966, -0.05801152065396309, -0.05902452766895294, -0.004689377266913652, -0.002035510493442416, 0.024227745831012726, -0.005736150778830051, -0.021644577383995056, -0.041702114045619965, 0.004765352699905634, 0.026422593742609024, -0.0025409585796296597, -0.0452476367354393, -0.008424839936196804, -0.016419151797890663, 0.04048650339245796, -0.0005545156891457736, 0.0007222949643619359, -0.02524075284600258, 0.004144886042922735, 0.007846581749618053, -0.012730118818581104, 0.012105431407690048, -0.047948986291885376, 0.010670337826013565, 0.09164334833621979, 0.06462983042001724, -0.0027498912531882524, -0.003511756891384721, 0.012958045117557049, 0.06729741394519806, -0.0239238440990448, -0.03386819362640381, 0.0011480743996798992, 0.030643455684185028, 0.08164834976196289, 0.01835230551660061, 0.011235933750867844, -0.0007259881822392344, 0.012130755931138992, 0.03731241822242737, 0.016663961112499237, 0.00007867949898354709, 0.0034294500946998596 ]
31,964
pingouin.utils
_check_dataframe
Checks whether data is a dataframe or can be converted to a dataframe. If successful, a dataframe is returned. If not successful, a ValueError is raised.
def _check_dataframe(data=None, dv=None, between=None, within=None, subject=None, effects=None): """Checks whether data is a dataframe or can be converted to a dataframe. If successful, a dataframe is returned. If not successful, a ValueError is raised. """ # Check that data is a dataframe if not isinstance(data, pd.DataFrame): # DataMatrix objects can be safely convert to DataFrame objects. By # first checking the name of the class, we avoid having to actually # import DataMatrix unless it is necessary. if data.__class__.__name__ == "DataMatrix": # noqa try: from datamatrix import DataMatrix, convert as cnv # noqa except ImportError: raise ValueError( "Failed to convert object to pandas dataframe (DataMatrix not available)" # noqa ) else: if isinstance(data, DataMatrix): data = cnv.to_pandas(data) else: raise ValueError("Data must be a pandas dataframe or compatible object.") else: raise ValueError("Data must be a pandas dataframe or compatible object.") # Check that both dv and data are provided. if any(v is None for v in [dv, data]): raise ValueError("DV and data must be specified") # Check that dv is a numeric variable if data[dv].dtype.kind not in "fi": raise ValueError("DV must be numeric.") # Check that effects is provided if effects not in ["within", "between", "interaction", "all"]: raise ValueError("Effects must be: within, between, interaction, all") # Check that within is a string, int or a list (rm_anova2) if effects == "within" and not isinstance(within, (str, int, list)): raise ValueError("within must be a string, int or a list.") # Check that subject identifier is provided in rm_anova and friedman. if effects == "within" and subject is None: raise ValueError("subject must be specified when effects=within") # Check that between is a string or a list (anova2) if effects == "between" and not isinstance(between, (str, int, list)): raise ValueError("between must be a string, int or a list.") # Check that both between and within are present for interaction if effects == "interaction": for input in [within, between]: if not isinstance(input, (str, int, list)): raise ValueError("within and between must be specified when effects=interaction") return data
(data=None, dv=None, between=None, within=None, subject=None, effects=None)
[ 0.020296545699238777, -0.006109868176281452, 0.024002375081181526, 0.02772720903158188, -0.026320893317461014, -0.034663762897253036, 0.019184796139597893, 0.01593506895005703, 0.0047890725545585155, -0.03759041801095009, -0.008176581002771854, 0.02556072361767292, -0.003850737353786826, -0.013673561625182629, -0.0519576333463192, 0.020391566678881645, -0.003306740429252386, 0.0397569015622139, 0.09418509155511856, 0.01508937869220972, -0.01874769851565361, 0.02609284222126007, -0.0429496169090271, 0.011754131875932217, -0.03149005025625229, 0.07058180868625641, -0.028829455375671387, 0.004713055212050676, 0.03211719170212746, 0.042341481894254684, -0.019916459918022156, -0.02073364332318306, -0.006508957594633102, 0.02392635866999626, -0.03000771999359131, 0.005582500249147415, -0.004171434324234724, -0.050095219165086746, -0.028696425259113312, 0.057886961847543716, -0.0657167136669159, -0.014633276499807835, 0.07681520283222198, 0.018016034737229347, -0.06446243822574615, -0.03137602657079697, -0.027670197188854218, -0.014946847222745419, -0.025275660678744316, -0.002477679867297411, 0.03907274827361107, -0.02822132036089897, 0.04336770996451378, -0.006119370460510254, -0.0076444619335234165, 0.022672077640891075, -0.010490349493920803, 0.09669364988803864, 0.04625635966658592, -0.010851429775357246, 0.05754488706588745, 0.05074136331677437, -0.028620408847928047, -0.037457387894392014, -0.010214786976575851, 0.030900919809937477, 0.029399583116173744, -0.03498683497309685, -0.018225081264972687, 0.016077600419521332, -0.07749935239553452, 0.04466000199317932, -0.010243293829262257, 0.07844956964254379, 0.014243689365684986, -0.02922854572534561, -0.0021035335958003998, -0.004741561599075794, -0.014405225403606892, 0.012894387356936932, 0.07822151482105255, -0.025522714480757713, -0.018462633714079857, 0.027537167072296143, 0.0049125999212265015, -0.010490349493920803, -0.032326240092515945, 0.05917925387620926, 0.05997743085026741, -0.035195883363485336, -0.007867761887609959, -0.03213619813323021, 0.019270315766334534, -0.003073938423767686, 0.01548846811056137, 0.008029297925531864, 0.008119568228721619, 0.015802038833498955, -0.056670691817998886, 0.013531030155718327, -0.005891319364309311, 0.07404057681560516, 0.0355379581451416, 0.04161931946873665, -0.045078095048666, -0.018614668399095535, 0.010053250938653946, -0.035290904343128204, 0.0029931701719760895, -0.04363377019762993, -0.09623754769563675, -0.020087499171495438, -0.030577847734093666, 0.007615955546498299, -0.0014514500508084893, -0.03572800010442734, -0.02535167708992958, -0.026377907022833824, -0.1309773325920105, -0.018766703084111214, 0.01966940425336361, 0.05636662244796753, 0.024895574897527695, -0.05370602756738663, 0.060965653508901596, -0.03177511692047119, 0.00953538529574871, -0.03358051925897598, -0.007782242726534605, -0.018310600891709328, 0.01325546856969595, -0.022824110463261604, -0.04682648554444313, 0.053592000156641006, -0.01587805524468422, 0.026643967255949974, 0.028810450807213783, 0.016961298882961273, -0.00707908533513546, -0.03238325193524361, 0.026681974530220032, 0.012998910620808601, -0.008490150794386864, -0.015745025128126144, 0.010034247301518917, 0.006466197781264782, 0.012580817565321922, -0.03240225464105606, -0.042227454483509064, 0.05420013889670372, -0.024097396060824394, -0.022387012839317322, -0.00377234467305243, -0.06822527945041656, 0.0035799266770482063, -0.03971889615058899, 0.014015638269484043, -0.09562941640615463, 0.035290904343128204, 0.004159556236118078, -0.010233791545033455, -0.019536374136805534, -0.049183014780282974, 0.04215143993496895, 0.030995940789580345, 0.042759574949741364, -0.01883321814239025, -0.024211421608924866, 0.026282886043190956, 0.021113727241754532, 0.015032365918159485, 0.09243670105934143, -0.03409363329410553, -0.003482529893517494, -0.07255824655294418, 0.0042070671916007996, -0.02084766887128353, -0.0026962286792695522, 0.012590319849550724, -0.054276153445243835, -0.001474017626605928, 0.008513906970620155, -0.06514658778905869, 0.02031554840505123, -0.02662496268749237, 0.000969810935202986, -0.042987626045942307, 0.005297436378896236, -0.013531030155718327, 0.018548153340816498, -0.04116321727633476, -0.04310165345668793, 0.04511610418558121, 0.030881915241479874, 0.024572502821683884, -0.053097888827323914, 0.02185489423573017, 0.035499949008226395, 0.01851014420390129, -0.020771650597453117, 0.07141799479722977, -0.029285557568073273, 0.05845709145069122, 0.00714559992775321, -0.054276153445243835, 0.012903889641165733, -0.05477026477456093, 0.0016688111936673522, -0.025845788419246674, -0.04504008591175079, -0.0019111154833808541, -0.038369592279195786, -0.019184796139597893, 0.00989171490073204, 0.04002296179533005, -0.004406611900776625, 0.0800459235906601, -0.06712303310632706, 0.01257131528109312, 0.026377907022833824, 0.0864313542842865, -0.020923685282468796, -0.05648064613342285, 0.04389983043074608, 0.070505790412426, -0.009340591728687286, 0.03228823095560074, 0.0662488341331482, 0.08369474112987518, -0.03185113146901131, -0.011592595838010311, -0.03749539703130722, 0.016989804804325104, -0.04975314065814018, -0.012362268753349781, 0.009768187068402767, 0.024116400629281998, -0.013616548851132393, 0.05100742354989052, -0.007501929998397827, 0.015412451699376106, 0.013036919757723808, 0.02938057854771614, 0.05446619540452957, 0.04051707312464714, -0.09137246012687683, 0.012143719010055065, 0.017284370958805084, -0.029247550293803215, -0.01338849775493145, -0.039528850466012955, -0.015117885544896126, -0.026263881474733353, 0.00613837456330657, -0.00896050687879324, -0.004112045746296644, 0.018643174320459366, -0.02974165976047516, 0.049183014780282974, -0.021455803886055946, 0.04629436507821083, -0.017141839489340782, 0.04306364431977272, 0.026225872337818146, -0.06742709875106812, -0.021759873256087303, -0.028449371457099915, -0.02689102105796337, 0.04485004395246506, -0.015535978600382805, -0.011716123670339584, 0.011573591269552708, 0.03546193987131119, 0.019327327609062195, -0.003482529893517494, 0.01792101375758648, 0.013901612721383572, -0.03774245083332062, -0.018491141498088837, 0.02025853656232357, -0.02046758309006691, -0.034017618745565414, -0.013160446658730507, -0.004501632880419493, -0.03903474286198616, -0.026643967255949974, -0.006413936149328947, -0.06951756775379181, 0.036450162529945374, -0.017968524247407913, -0.07004968822002411, -0.03228823095560074, 0.0013493021251633763, 0.023508263751864433, -0.07396456599235535, 0.011573591269552708, 0.027347123250365257, -0.04618034139275551, 0.03320043534040451, 0.003902998985722661, -0.02236800827085972, -0.00881322380155325, 0.03352350741624832, 0.03614609315991402, -0.02922854572534561, -0.023622289299964905, 0.019593387842178345, -0.06229595094919205, -0.011421557515859604, -0.06826328486204147, 0.042987626045942307, 0.041505295783281326, -0.0005425121053121984, -0.014338711276650429, 0.04146728664636612, -0.014063148759305477, -0.006038602441549301, -0.03675423189997673, 0.003451647935435176, 0.04466000199317932, -0.02556072361767292, -0.02556072361767292, 0.03542393445968628, -0.02905750647187233, 0.004128674510866404, 0.018880728632211685, 0.012533307075500488, -0.006703751161694527, 0.03415064886212349, 0.03743838518857956, -0.036203108727931976, 0.010632880963385105, 0.0933489054441452, -0.017883004620671272, 0.04861288517713547, -0.03874967619776726, -0.04694051295518875, 0.011212510988116264, 0.07141799479722977, 0.07578897476196289, 0.031737107783555984, -0.0011337226023897529, 0.03987092897295952, -0.06035751476883888, 0.04618034139275551, -0.03038780577480793, 0.005511234048753977, 0.02067662961781025, 0.03388458862900734, 0.0201445110142231, -0.08787567913532257, 0.07613104581832886, -0.03614609315991402, -0.01129802968353033, -0.013065425679087639, 0.002260318724438548, 0.0355379581451416, 0.026700979098677635, 0.006998317316174507, -0.00793902762234211, 0.11448163539171219, -0.015678510069847107, 0.0043092151172459126, -0.020657625049352646, -0.03960486873984337, 0.009663663804531097, -0.01620112732052803, -0.017540927976369858, -0.020980698987841606, 0.00033168363734148443, 0.014576263725757599, -0.0005478570819832385, -0.019184796139597893, -0.03610808402299881, 0.0012257745256647468, 0.05020924285054207, -0.018405621871352196, 0.0028720181435346603, 0.021094724535942078, 0.01691378839313984, 0.02396436594426632, -0.0312810055911541, -0.019859448075294495, -0.015402949415147305, 0.033333465456962585, -0.06317014247179031, -0.020277541130781174, 0.04739661514759064, -0.02381233312189579, -0.024097396060824394, -0.03489181399345398, -0.03038780577480793, 0.036887262016534805, 0.0016723745502531528, -0.013635553419589996, -0.006233396008610725, -0.00006239482900127769, 0.013502523303031921, -0.009620903991162777, -0.021930910646915436, -0.028563397005200386, 0.037932492792606354, -0.003912501037120819, -0.018462633714079857, -0.037096306681632996, 0.07628308236598969, 0.008518657647073269, -0.003893496934324503, -0.018852220848202705, 0.007045827805995941, 0.053211916238069534, 0.010632880963385105, -0.017493417486548424, 0.031794119626283646, 0.011402553878724575, 0.036925267428159714, 0.052679795771837234, -0.003907749895006418, 0.01866217888891697, 0.015688013285398483, 0.040479063987731934, -0.056556664407253265, -0.02407839149236679, 0.06050955131649971, 0.003587053157389164, 0.019650399684906006, -0.0721401572227478, 0.006005344912409782, 0.003781846957281232, 0.006062357686460018, -0.00978719163686037, 0.00042700188350863755, -0.052261702716350555, -0.03854063153266907, 0.044507965445518494, 0.005297436378896236, -0.07301434874534607, 0.05343996733427048, 0.047966741025447845, 0.08133821189403534, 0.01476630661636591, -0.004040780011564493, 0.044888053089380264, -0.027404136955738068, -0.06351222097873688, -0.04709254577755928, 0.01835811138153076, 0.002477679867297411, -0.06921350210905075, -0.029665643349289894, 0.058419082313776016, 0.04203741252422333, 0.0061811343766748905, -0.016837770119309425, -0.0418853797018528, 0.012362268753349781, -0.04158131033182144, -0.005306938197463751, 0.004470751155167818, 0.03225022181868553, -0.016571711748838425, -0.02725210227072239, -0.07974185794591904, 0.04724457859992981, -0.03432168439030647, 0.08103414624929428, 0.014804314821958542, -0.0668189600110054, -0.020448578521609306, 0.00747817475348711, -0.013141443021595478, -0.06145976111292839, 0.0073926555924117565, -0.029760664328932762, 0.01851014420390129, 0.04842284321784973, -0.013065425679087639, -0.012628328055143356, -0.015497970394790173, 0.03426467254757881, 0.009502127766609192, 0.004843709524720907, 0.019441353157162666, 0.04063109681010246, -0.011497574858367443, -0.03352350741624832, -0.04036504030227661, 0.051197465509176254, -0.022044936195015907, -0.05720280855894089, -0.009297831915318966, 0.006048104260116816, 0.016106106340885162, 0.04173334687948227, 0.038578640669584274, 0.00563476188108325, 0.010319311171770096, -0.01839611865580082, -0.005658517125993967, -0.04291160777211189, 0.07791744917631149, -0.009407106786966324, -0.05902721732854843, 0.010746906511485577, 0.009274076670408249, -0.059521328657865524, 0.029665643349289894, -0.005425714887678623, 0.0060338512994349, -0.05340195819735527, -0.05328793451189995, 0.020828664302825928, 0.008219340816140175, 0.05765891075134277, 0.011031970381736755, -0.01118400413542986, -0.051083438098430634, 0.022672077640891075, -0.012514302507042885, 0.005653765983879566, -0.011069978587329388, -0.05997743085026741, 0.03413164243102074, -0.015184400603175163, 0.017835494130849838, 0.01118400413542986, -0.026910025626420975, 0.014015638269484043, 0.027499157935380936, -0.03257329389452934, -0.06028150022029877, 0.0026819754857569933, 0.07681520283222198, 0.012723349034786224, -0.01455726008862257, -0.011421557515859604, 0.015688013285398483, -0.03198416158556938, -0.05313589796423912, 0.007839255034923553, 0.004323468077927828, 0.009825199842453003, -0.01800653152167797, -0.018700188025832176, -0.0004914382006973028, -0.04370978847146034, -0.008181331679224968, 0.012438285164535046, 0.00798178743571043, 0.014965851791203022, -0.023888349533081055, 0.00019672374764923006, 0.0689474418759346, 0.07168405503034592, -0.012058200314640999, 0.011925170198082924, 0.02046758309006691, 0.09456517547369003, 0.04747262969613075, -0.04777669906616211, -0.03397960960865021, -0.08133821189403534, 0.08384677767753601, -0.03918677568435669, -0.0748007521033287, -0.009977234527468681, 0.03494882583618164, 0.008157576434314251, -0.028354348614811897, -0.04735860601067543, 0.012419281527400017, 0.006870038341730833, -0.0028720181435346603, -0.02185489423573017, -0.0022436899598687887, -0.01068039145320654, -0.04549618810415268, -0.0008961694547906518, -0.03091992437839508, -0.002589329844340682, 0.03696327656507492, -0.01026229839771986, -0.04994318261742592, -0.025959813967347145, -0.04355775564908981, 0.0026392159052193165, -0.062333960086107254, -0.018557656556367874, 0.016638224944472313, -0.017303375527262688, -0.00406453525647521, -0.016923289746046066, 0.004017024766653776, -0.018728693947196007, 0.03059685230255127, 0.09844204783439636, 0.0052356724627316, -0.022501038387417793, 0.057772938162088394, -0.03139502927660942, -0.004848460666835308, 0.030615855008363724, -0.012105710804462433, -0.06704701483249664, -0.006836780812591314, -0.0037699693348258734, 0.013112936168909073, 0.022672077640891075, 0.0060243490152060986, -0.041543301194906235, 0.021702859550714493, 0.03249727562069893, 0.022406017407774925, -0.005601504351943731, 0.02386934496462345, -0.05845709145069122, -0.06982163339853287, -0.004936355631798506, -0.00848540011793375, 0.02698604390025139, 0.007853508926928043, -0.011031970381736755, -0.0044873799197375774, 0.019422348588705063, 0.0072596254758536816, -0.016239136457443237, 0.025484707206487656, -0.06195387244224548, -0.05055132135748863, -0.1076401025056839, 0.02428743802011013, -0.01415817067027092, 0.04602830857038498, -0.017883004620671272, -0.008499653078615665, 0.011383549310266972, 0.04500207677483559, 0.004964862018823624, -0.019707413390278816, 0.07274828851222992, 0.016372166574001312, -0.03276333585381508, 0.017816489562392235, 0.017018310725688934, 0.04184737056493759, -0.001886172336526215, -0.006209640763700008, -0.043139658868312836, 0.008433138020336628, 0.024686528369784355, 0.027176085859537125, 0.030197761952877045, -0.030520834028720856, -0.019032761454582214, 0.04344372823834419, 0.04925902932882309, 0.0307488851249218, -0.007340393960475922, 0.01638166792690754, 0.011402553878724575, -0.0047629415057599545, 0.006950806360691786, 0.0328773632645607, 0.01227674912661314, 0.06298010051250458, 0.01824408583343029, 0.030368801206350327, 0.025579728186130524, 0.04853687062859535, 0.05431416258215904, 0.006946055684238672, 0.053211916238069534, -0.021835889667272568, 0.03278234228491783, 0.06317014247179031, -0.037096306681632996, 0.015203404240310192, -0.039110757410526276, -0.007335642818361521, -0.011117490008473396, -0.004444620106369257, 0.0508933961391449, -0.029950706288218498, -0.012846876867115498, 0.04519211873412132, -0.04161931946873665, 0.013369494117796421, -0.021702859550714493, 0.011212510988116264, -0.04344372823834419, -0.013207958079874516, -0.027974264696240425, -0.014728298410773277, 0.0035229139029979706, -0.03806552290916443, -0.03641215339303017, -0.10649985074996948, 0.01436721719801426, -0.010319311171770096, 0.041543301194906235, -0.008110065944492817, -0.000015691502994741313, 0.028354348614811897, 0.08544313162565231, 0.036450162529945374, -0.0036440659314393997, -0.01723686046898365, 0.05127348005771637, 0.05100742354989052, -0.09099237620830536, 0.008414134383201599, -0.003558546770364046, 0.034549735486507416, 0.02715708129107952, -0.0014253192348405719, -0.015811540186405182, -0.015098880976438522, 0.0546182319521904, -0.011944174766540527, -0.030026724562048912, 0.03143303841352463, 0.012827872298657894, 0.02926655299961567, -0.009677916765213013, -0.0013291101204231381, 0.019954469054937363, -0.00046916757128201425, -0.04355775564908981, 0.06560268998146057, -0.042607542127370834, 0.03261130303144455, 0.051995642483234406, 0.01889973320066929, 0.02624487690627575, -0.01824408583343029, -0.058989208191633224, -0.03432168439030647, 0.0054969810880720615, -0.01578303426504135, 0.038217559456825256, -0.008133821189403534, -0.002288825111463666, 0.01039532758295536, -0.04283559322357178, -0.014167672954499722, 0.02322320081293583, -0.000848658790346235, -0.03580401837825775, 0.014633276499807835, -0.03753340616822243, 0.04427991434931755, -0.0731663852930069, -0.013293476775288582, -0.01556448545306921, 0.026929030194878578, 0.057088784873485565, -0.0129894083365798, 0.0002090468187816441, 0.014794813469052315, -0.026738988235592842, -0.00519766379147768, 0.04732059687376022, 0.03610808402299881, 0.029627634212374687, -0.04051707312464714, 0.02544669806957245, 0.0005487478920258582, 0.08278253674507141 ]
31,965
pingouin.utils
_check_eftype
Check validity of eftype
def _check_eftype(eftype): """Check validity of eftype""" if eftype.lower() in [ "none", "hedges", "cohen", "r", "pointbiserialr", "eta-square", "odds-ratio", "auc", "cles", ]: return True else: return False
(eftype)
[ 0.039559878408908844, -0.005833873990923166, 0.03590076416730881, -0.004163970705121756, 0.01266882661730051, -0.018364621326327324, 0.033812303096055984, -0.031206047162413597, -0.03783388063311577, -0.024716293439269066, 0.02069471776485443, 0.03370874375104904, 0.01732039265334606, -0.018778860569000244, 0.011909387074410915, -0.0002130529028363526, -0.061445534229278564, 0.03370874375104904, 0.06151457503437996, -0.014006474986672401, -0.07414888590574265, 0.005475729238241911, -0.02166127786040306, -0.042735714465379715, 0.04832794889807701, 0.05923625826835632, 0.05833873897790909, -0.01959007978439331, 0.011020498350262642, 0.027564190328121185, -0.02639051154255867, -0.028979510068893433, -0.013445526361465454, 0.03583172336220741, 0.04625675082206726, -0.02771953120827675, -0.0016040995251387358, 0.007896441966295242, -0.0020086304284632206, 0.018450921401381493, -0.07028264552354813, 0.025579292327165604, -0.02992880903184414, 0.01986623927950859, -0.07573679834604263, -0.005730314180254936, -0.006390508264303207, 0.01862351968884468, -0.04346063360571861, -0.01496440451592207, -0.0020474654156714678, -0.0218338780105114, 0.05371306464076042, 0.010433658957481384, 0.004642935004085302, -0.00014010250743012875, 0.0011639699805527925, -0.008478966541588306, -0.05678534135222435, 0.03407120332121849, 0.010813378728926182, 0.010209279134869576, 0.0019514566520228982, -0.07104208320379257, -0.002604099689051509, 0.01482632476836443, -0.02000431902706623, -0.009346280246973038, -0.023093855008482933, 0.03666020184755325, -0.04881122708320618, -0.01524056401103735, -0.05719957873225212, 0.008642936125397682, 0.040353838354349136, -0.01699245162308216, -0.030860846862196922, 0.0816742330789566, 0.006778857670724392, 0.018381880596280098, 0.007037757430225611, 0.03431284427642822, 0.021212518215179443, -0.0027594396378844976, -0.002282632514834404, 0.0069471425376832485, -0.041354916989803314, 0.03462352231144905, 0.05744121968746185, 0.036211442202329636, -0.0034951462876051664, -0.04045739769935608, -0.013807985931634903, -0.07131824642419815, 0.03439914435148239, 0.02854800969362259, 0.028617050498723984, -0.037488680332899094, -0.03821359947323799, -0.03769579902291298, 0.02445739507675171, 0.030446607619524002, 0.08533334732055664, -0.004066883120685816, -0.0097001101821661, 0.001283711171709001, 0.003976268228143454, -0.007495147176086903, 0.0012060411972925067, 0.01701834239065647, -0.03098166733980179, -0.06883280724287033, 0.026131613180041313, 0.026891052722930908, -0.015930963680148125, -0.06862568855285645, 0.0436677560210228, 0.006174758542329073, -0.05008846893906593, -0.02644229307770729, 0.021730316802859306, 0.013419635593891144, -0.03890400007367134, -0.02556203305721283, 0.09182310104370117, -0.0050226547755301, -0.01062351930886507, 0.0034735712688416243, -0.03631500154733658, -0.0034541538916528225, -0.019848980009555817, 0.03586624190211296, -0.056094940751791, 0.006645093206316233, -0.022696876898407936, 0.0062135932967066765, -0.018796119838953018, -0.010752968490123749, 0.0030571743845939636, -0.03852428123354912, -0.024215754121541977, 0.08153615146875381, 0.033259984105825424, -0.040526438504457474, -0.02892773039638996, 0.06955772638320923, -0.0429428331553936, -0.0224897563457489, -0.010062569752335548, 0.04304639622569084, 0.00960517954081297, -0.0008527509635314345, -0.06627833098173141, -0.030032368376851082, -0.0026645096950232983, -0.03918015956878662, 0.01395469531416893, -0.04587703198194504, -0.013920175842940807, -0.0194002203643322, -0.018192021176218987, 0.02934196963906288, -0.01266882661730051, 0.007460627239197493, 0.055749740451574326, 0.03783388063311577, -0.024388354271650314, -0.012582526542246342, 0.051607344299554825, -0.003749730996787548, -0.02998058870434761, 0.03351888433098793, 0.0032772391568869352, 0.019710900261998177, 0.053678542375564575, 0.05205610394477844, 0.001373247359879315, -0.009467099793255329, -0.010571738705039024, 0.0464293509721756, 0.013911545276641846, -0.017967641353607178, -0.04239051416516304, 0.02920388989150524, 0.0360388420522213, -0.016699032858014107, -0.013480045832693577, -0.02749515138566494, 0.0006688243011012673, -0.01253074686974287, -0.059754058718681335, 0.0029838194604963064, 0.000338996818754822, 0.016569582745432854, 0.03098166733980179, -0.028496230021119118, 0.024526434019207954, 0.0022081988863646984, 0.035797201097011566, -0.02547573298215866, -0.0032923414837569, 0.004474650137126446, 0.024526434019207954, 0.015715213492512703, -0.057130541652441025, 0.042321477085351944, 0.016146713867783546, -0.03527940437197685, -0.00112082005944103, 0.018934199586510658, -0.03236246481537819, -0.03053290769457817, -0.05985761806368828, 0.06903992593288422, 0.03467530384659767, -0.02304207533597946, -0.00018905074102804065, 0.008556636050343513, -0.050916947424411774, 0.030153188854455948, 0.03039482794702053, 0.047982748597860336, 0.04598059132695198, 0.011305288411676884, 0.07739375531673431, 0.03797195851802826, 0.008543690666556358, 0.06662353128194809, -0.020470337942242622, 0.03136138617992401, -0.02611435204744339, 0.03686732053756714, 0.005255664698779583, 0.04318447411060333, 0.029169369488954544, 0.047810148447752, 0.025044234469532967, 0.056578218936920166, -0.04004315659403801, 0.007111112587153912, 0.035331182181835175, 0.01066666841506958, -0.037039920687675476, -0.03949083760380745, 0.001625674543902278, -0.039525359869003296, 0.04929450899362564, 0.058787498623132706, -0.08505719155073166, -0.00716289272531867, -0.005462784320116043, -0.00145954720210284, 0.011987057514488697, -0.02193743735551834, -0.010847898200154305, 0.003549083834514022, -0.008487596176564693, -0.029549088329076767, 0.08243367075920105, -0.05554262176156044, 0.008854370564222336, 0.06317153573036194, 0.08409063518047333, 0.08761166781187057, -0.057544779032468796, -0.010752968490123749, 0.04332255572080612, 0.004793960135430098, 0.02155771665275097, -0.020297739654779434, 0.04566991329193115, 0.05416182428598404, 0.004867314826697111, 0.027063651010394096, 0.025303132832050323, -0.021126218140125275, 0.01303128618746996, -0.007249192334711552, 0.03155124559998512, 0.06593313068151474, -0.01862351968884468, -0.020936358720064163, -0.006425028201192617, 0.08015535771846771, -0.05167638510465622, -0.03260410577058792, -0.0381445586681366, -0.050916947424411774, 0.028444450348615646, -0.005096009466797113, -0.06320605427026749, 0.017259981483221054, 0.00733549240976572, -0.023974115028977394, -0.0035685012117028236, 0.03600432351231575, 0.10487165302038193, -0.08498815447092056, 0.04339159280061722, 0.031378645449876785, 0.004651565104722977, 0.0242330152541399, 0.04791371151804924, -0.03866235911846161, 0.000937432749196887, -0.015223303809762001, 0.007555556949228048, -0.059892136603593826, 0.011633227579295635, -0.011926647275686264, -0.024388354271650314, 0.050744347274303436, -0.0733894407749176, 0.0186753012239933, 0.01566343382000923, 0.08001727610826492, 0.02326645515859127, -0.06317153573036194, -0.012988136149942875, 0.01618986390531063, -0.010088459588587284, 0.031050708144903183, 0.061825256794691086, 0.0067270779982209206, -0.029549088329076767, -0.04277023673057556, 0.02000431902706623, -0.028064731508493423, 0.0013128373539075255, 0.00027723846142180264, -0.04239051416516304, -0.08968286961317062, 0.07059332728385925, 0.023111116141080856, -0.029825247824192047, 0.011529668234288692, -0.015870552510023117, -0.00641208328306675, 0.02942826971411705, 0.02740885131061077, -0.01588781364262104, 0.03098166733980179, 0.004038835875689983, -0.004867314826697111, 0.07014456391334534, -0.026960091665387154, 0.003743258537724614, -0.01259978674352169, 0.08795686811208725, 0.03376052528619766, -0.050468187779188156, -0.07780800014734268, -0.0015372171765193343, -0.013359226286411285, 0.027598710730671883, 0.03376052528619766, 0.014412084594368935, -0.016621362417936325, -0.007244877517223358, 0.03208630532026291, 0.10714996606111526, -0.069178007543087, -0.02326645515859127, -0.000747033569496125, -0.05564618110656738, 0.007080907467752695, 0.06244661286473274, 0.01671629212796688, 0.03931823745369911, 0.007154262624680996, 0.0287378691136837, 0.02349083498120308, -0.020056098699569702, -0.07939592003822327, 0.015680693089962006, -0.02069471776485443, 0.011728157289326191, -0.02041855826973915, 0.010157499462366104, 0.007115427404642105, 0.006977347657084465, 0.02583819255232811, -0.040629997849464417, 0.015965484082698822, 0.0026343048084527254, -0.021039918065071106, -0.018658040091395378, 0.03541748225688934, -0.013126215897500515, 0.007831716910004616, 0.04049191623926163, 0.01618986390531063, 0.04387487471103668, -0.0019029129762202501, -0.006200648378580809, 0.015128374099731445, -0.05733766034245491, -0.036349520087242126, -0.025389432907104492, 0.025113273411989212, -0.037868399173021317, 0.012168287299573421, -0.009812300093472004, 0.04698166996240616, 0.0005954693770036101, 0.05416182428598404, -0.034692563116550446, -0.007762677036225796, 0.009449840523302555, -0.015154263935983181, 0.061549097299575806, -0.013480045832693577, -0.07656528055667877, -0.01876159943640232, -0.001819849363528192, 0.05112406611442566, -0.029531829059123993, -0.04277023673057556, 0.020850058645009995, -0.01853722147643566, -0.008004317060112953, 0.0020841427613049746, 0.00953613966703415, 0.07532256096601486, 0.02744337171316147, 0.018364621326327324, -0.03260410577058792, 0.030170448124408722, 0.017665591090917587, 0.03659116104245186, -0.07552967965602875, 0.0374196395277977, -0.04832794889807701, -0.02887594886124134, -0.007495147176086903, -0.016983821988105774, -0.047879189252853394, 0.028996769338846207, -0.02671845257282257, -0.010960088111460209, -0.05868393927812576, 0.0164401326328516, -0.03614240139722824, 0.022317156195640564, 0.028772389516234398, -0.007965481840074062, 0.00015560952306259423, 0.012478967197239399, -0.007037757430225611, -0.005251349415630102, -0.07138728350400925, 0.03962891921401024, -0.0526774637401104, -0.011909387074410915, 0.01726861111819744, 0.0380755215883255, -0.006701188161969185, 0.008932041004300117, 0.03817908093333244, -0.012478967197239399, -0.04394391551613808, 0.01273786649107933, -0.05730314180254936, -0.01701834239065647, 0.03628048300743103, 0.03231068700551987, 0.01588781364262104, 0.011754048056900501, 0.05868393927812576, 0.05802806094288826, -0.06351673603057861, 0.006735708098858595, 0.05412730202078819, -0.02238619700074196, 0.02202373743057251, 0.05447250232100487, 0.018554480746388435, 0.03396764397621155, 0.037178002297878265, -0.014144554734230042, -0.0012405612505972385, 0.004435815382748842, -0.015741104260087013, 0.01701834239065647, 0.010856528766453266, -0.022748656570911407, -0.06355125457048416, 0.006666668225079775, -0.014110035263001919, -0.034226544201374054, -0.02749515138566494, -0.09023518860340118, 0.003954693209379911, 0.03949083760380745, 0.06662353128194809, 0.0225242767482996, 0.042735714465379715, 0.02680475264787674, -0.061721693724393845, 0.05633658170700073, 0.07076592743396759, 0.03341532498598099, -0.018330100923776627, -0.014550164341926575, -0.008245956152677536, -0.07297520339488983, 0.0009250271832570434, -0.02238619700074196, 0.01784682087600231, -0.0194002203643322, 0.00359870633110404, 0.0225242767482996, 0.08195039629936218, -0.00570010906085372, 0.02763323113322258, 0.03407120332121849, 0.06317153573036194, -0.026459552347660065, 0.02727077156305313, 0.05968501791357994, 0.005471414420753717, -0.04377131536602974, 0.006683927960693836, -0.015137003734707832, 0.00278101465664804, 0.046636469662189484, -0.027512410655617714, 0.022507015615701675, 0.028289109468460083, -0.020245958119630814, 0.028944989666342735, 0.03067098744213581, 0.06696873158216476, -0.020401298999786377, -0.03346710652112961, -0.034468185156583786, -0.024388354271650314, -0.015594393946230412, -0.003341963980346918, -0.047810148447752, -0.04170011729001999, -0.042735714465379715, 0.01381661556661129, 0.0021197416353970766, 0.03890400007367134, -0.03246602416038513, 0.06110033765435219, -0.06486301124095917, 0.03659116104245186, -0.036798279732465744, 0.025216832756996155, 0.011201728135347366, 0.03762676194310188, -0.05499030277132988, -0.0011316075688228011, 0.0443236343562603, 0.061997853219509125, 0.02235167659819126, 0.011659117415547371, -0.04308091476559639, -0.05343690514564514, -0.03769579902291298, 0.03683280199766159, -0.01618986390531063, -0.04970874637365341, -0.08340023458003998, -0.0011057176161557436, 0.028220070526003838, -0.019607339054346085, -0.0422869548201561, -0.04363323375582695, 0.0200906191021204, 0.038869477808475494, -0.02942826971411705, -0.006330098491162062, -0.020953617990016937, -0.0062740035355091095, 0.01330744568258524, -0.0058295587077736855, -0.04194175451993942, -0.04239051416516304, -0.05654370039701462, -0.0845739096403122, -0.05084790661931038, -0.002435815054923296, -0.00485005509108305, 0.035797201097011566, 0.027667751535773277, -0.06054801493883133, -0.02326645515859127, -0.02602805197238922, 0.04100971668958664, 0.031464945524930954, -0.08754263073205948, 0.00036380806704983115, 0.03312190622091293, 0.04794823005795479, 0.01167637761682272, -0.003508091438561678, 0.004932039882987738, -0.030498387292027473, 0.010588998906314373, 0.005454154219478369, -0.09313486516475677, 0.04045739769935608, -0.030998926609754562, -0.008845740929245949, 0.06586409360170364, 0.01889968104660511, -0.043840352445840836, 0.06362029165029526, 0.03835168108344078, -0.001860841759480536, -0.0055404542945325375, 0.04556635394692421, -0.007926646620035172, -0.004444445483386517, -0.038558799773454666, 0.002431500004604459, 0.012582526542246342, -0.0408371165394783, 0.03890400007367134, 0.01953830011188984, -0.020159658044576645, 0.001957929227501154, -0.05896009877324104, -0.0345890037715435, -0.08940670639276505, -0.02528587356209755, -0.11053292453289032, -0.006174758542329073, -0.03334628418087959, -0.018053941428661346, -0.08809494972229004, 0.011279398575425148, -0.02450917474925518, -0.016155343502759933, 0.001335491077043116, 0.007650487124919891, 0.01934843882918358, -0.04736138880252838, 0.037868399173021317, -0.021402377635240555, -0.007900756783783436, 0.007784252054989338, -0.0038381884805858135, -0.02238619700074196, -0.03251780569553375, 0.05481770262122154, -0.02934196963906288, 0.03293204680085182, 0.060168296098709106, 0.025078753009438515, -0.00421359296888113, -0.00020536681404337287, 0.07511544227600098, 0.0020021579694002867, -0.009398059919476509, 0.005096009466797113, -0.039836037904024124, 0.0023408851120620966, -0.011650487780570984, 0.021644016727805138, 0.02809925004839897, 0.05357498303055763, -0.001484358450397849, 0.017536140978336334, -0.017501622438430786, -0.03484790399670601, -0.0030183393973857164, -0.029946068301796913, 0.026235172525048256, 0.0533333458006382, -0.02445739507675171, 0.001290183630771935, -0.0059935287572443485, -0.03067098744213581, 0.04608415067195892, 0.030860846862196922, 0.02304207533597946, 0.028151029720902443, 0.06272277235984802, -0.024629993364214897, -0.015930963680148125, 0.0225242767482996, -0.00491909496486187, -0.028772389516234398, 0.03379504382610321, -0.03168932721018791, -0.06862568855285645, -0.05968501791357994, -0.050192028284072876, -0.012435817159712315, 0.009518880397081375, 0.005303129553794861, -0.05678534135222435, -0.020384037867188454, 0.09085654467344284, 0.006347358226776123, 0.00963107030838728, -0.02119525708258152, 0.008146711625158787, -0.0374196395277977, 0.0422179140150547, 0.00737001234665513, 0.016655882820487022, -0.058649417012929916, 0.003193096723407507, -0.0290658101439476, -0.02036677859723568, -0.029221149161458015, -0.01774326153099537, -0.006683927960693836, -0.023318234831094742, 0.004308523144572973, -0.040629997849464417, -0.014550164341926575, 0.014170445501804352, 0.026960091665387154, -0.04380583390593529, 0.01577562279999256, 0.00009162622882286087, 0.010822008363902569, 0.024837113916873932, -0.019762679934501648, -0.02418123558163643, -0.06051349639892578, 0.0027443370781838894, 0.030153188854455948, -0.057406701147556305, 0.042321477085351944, -0.0022330102510750294, -0.02583819255232811, 0.06734845042228699, -0.027391592040657997, -0.031930968165397644, -0.013730315491557121, 0.014800434932112694, -0.07076592743396759, -0.04138943552970886, 0.018450921401381493, -0.0000041506546040182, -0.03313916549086571, -0.07394175976514816, -0.00469039985910058, 0.061825256794691086, 0.023024816066026688, -0.009570660069584846, 0.00026200112188234925, -0.005346279591321945, 0.04042287915945053, -0.049950387328863144, 0.014006474986672401, 0.005354909226298332, 0.05723410099744797, -0.021644016727805138, 0.02473355457186699, -0.0034994613379240036, -0.005423949100077152, 0.018192021176218987, -0.02155771665275097, 0.0018651568097993731, 0.007594392169266939, 0.01815750077366829, -0.0360388420522213, -0.001040992676280439, -0.0290658101439476, -0.005238404497504234 ]
31,966
pingouin.utils
_flatten_list
Flatten an arbitrarily nested list into a new list. This can be useful to select pandas DataFrame columns. From https://stackoverflow.com/a/16176969/10581531 Examples -------- >>> from pingouin.utils import _flatten_list >>> x = ['X1', ['M1', 'M2'], 'Y1', ['Y2']] >>> _flatten_list(x) ['X1', 'M1', 'M2', 'Y1', 'Y2'] >>> x = ['Xaa', 'Xbb', 'Xcc'] >>> _flatten_list(x) ['Xaa', 'Xbb', 'Xcc'] >>> x = ['Xaa', ('Xbb', 'Xcc'), (1, 2), (1)] >>> _flatten_list(x) ['Xaa', ('Xbb', 'Xcc'), (1, 2), 1] >>> _flatten_list(x, include_tuple=True) ['Xaa', 'Xbb', 'Xcc', 1, 2, 1]
def _flatten_list(x, include_tuple=False): """Flatten an arbitrarily nested list into a new list. This can be useful to select pandas DataFrame columns. From https://stackoverflow.com/a/16176969/10581531 Examples -------- >>> from pingouin.utils import _flatten_list >>> x = ['X1', ['M1', 'M2'], 'Y1', ['Y2']] >>> _flatten_list(x) ['X1', 'M1', 'M2', 'Y1', 'Y2'] >>> x = ['Xaa', 'Xbb', 'Xcc'] >>> _flatten_list(x) ['Xaa', 'Xbb', 'Xcc'] >>> x = ['Xaa', ('Xbb', 'Xcc'), (1, 2), (1)] >>> _flatten_list(x) ['Xaa', ('Xbb', 'Xcc'), (1, 2), 1] >>> _flatten_list(x, include_tuple=True) ['Xaa', 'Xbb', 'Xcc', 1, 2, 1] """ # If x is not iterable, return x if not isinstance(x, collections.abc.Iterable): return x # Initialize empty output variable result = [] # Loop over items in x for el in x: # Check if element is iterable el_is_iter = isinstance(el, collections.abc.Iterable) if el_is_iter: if not isinstance(el, (str, tuple)): result.extend(_flatten_list(el)) else: if isinstance(el, tuple) and include_tuple: result.extend(_flatten_list(el)) else: result.append(el) else: result.append(el) # Remove None from output result = [r for r in result if r is not None] return result
(x, include_tuple=False)
[ -0.018087320029735565, -0.03840550407767296, 0.055117763578891754, 0.00825516413897276, 0.01920275203883648, -0.027808893471956253, 0.0016130504664033651, 0.006312772631645203, 0.0708492174744606, 0.016231469810009003, 0.006192575208842754, -0.02109706588089466, -0.006654133554548025, -0.020962443202733994, 0.021520160138607025, 0.0035842894576489925, -0.012048597447574139, -0.017394982278347015, 0.057079389691352844, 0.06834910809993744, 0.014414084143936634, 0.0007975104381330311, -0.042655687779188156, 0.05104066804051399, -0.022097108885645866, 0.01057737972587347, 0.039847876876592636, 0.011327411979436874, -0.07323393225669861, -0.009639839641749859, 0.015577595680952072, -0.02734733559191227, -0.02659730240702629, -0.05138683319091797, -0.05388694256544113, 0.01921236887574196, -0.0833112895488739, 0.00923597626388073, 0.02055858075618744, -0.03015514835715294, -0.03850166127085686, -0.06511819362640381, 0.012740935198962688, 0.012029365636408329, 0.023501014336943626, -0.012423613108694553, -0.0025073199067264795, 0.031020570546388626, -0.0957733690738678, -0.03854012489318848, 0.018683498725295067, 0.00012440441059879959, -0.038559358566999435, 0.028481999412178993, -0.002846276853233576, 0.01781807653605938, -0.011635118164122105, 0.05115605518221855, 0.060464151203632355, 0.015500669367611408, 0.02584727108478546, 0.046732787042856216, -0.05061757192015648, -0.011731276288628578, 0.022097108885645866, 0.0019604212138801813, -0.04915596917271614, -0.013385193422436714, -0.0587717704474926, -0.03157828748226166, -0.056502439081668854, 0.047502052038908005, -0.04361726716160774, 0.01640455424785614, 0.030232075601816177, 0.0293858852237463, 0.010096590034663677, 0.046886641532182693, 0.016116080805659294, -0.001294527086429298, -0.02123168669641018, 0.04219413176178932, -0.05607934668660164, 0.02448182739317417, 0.019385453313589096, 0.01581799052655697, 0.01912582665681839, 0.06938761472702026, 0.025520334020256996, 0.05557932332158089, 0.0076493690721690655, 0.01778922975063324, -0.03486689180135727, 0.03602078557014465, -0.0451173335313797, 0.015423743054270744, -0.031212886795401573, -0.02319330908358097, -0.001848637592047453, -0.000026124174837605096, -0.017260361462831497, -0.016933424398303032, -0.07196464389562607, 0.03371299430727959, 0.0032164850272238255, 0.011404338292777538, 0.005038679111748934, -0.029808979481458664, 0.07007995247840881, 0.006586823146790266, -0.04527118802070618, -0.017519988119602203, -0.02253943495452404, -0.01994316838681698, -0.026866545900702477, -0.03150136023759842, -0.007668600417673588, -0.018587341532111168, -0.04896365478634834, -0.059733349829912186, 0.044040363281965256, 0.012452460825443268, -0.04280954226851463, -0.022770214825868607, -0.028443535789847374, 0.05665629357099533, 0.045425038784742355, -0.001936381682753563, -0.025674186646938324, 0.016731491312384605, 0.0004182872944511473, 0.020962443202733994, -0.046155840158462524, 0.006562783382833004, 0.00374054629355669, -0.030616706237196922, 0.0004516421176958829, -0.03013591654598713, 0.03569385036826134, -0.05484852194786072, -0.03467457368969917, -0.040655601769685745, 0.041963350027799606, 0.04230951890349388, -0.006024298723787069, -0.04765590280294418, 0.05965642258524895, 0.02313561551272869, -0.05250226706266403, 0.013433272950351238, -0.046886641532182693, -0.0035554419737309217, -0.031770601868629456, -0.059041012078523636, -0.030559012666344643, 0.03836704045534134, -0.0726185217499733, -0.022077877074480057, 0.06300272047519684, -0.043424952775239944, -0.03192445635795593, -0.009341749362647533, -0.023020224645733833, 0.0218663290143013, -0.014577552676200867, -0.022808676585555077, -0.05742555856704712, -0.07554172724485397, -0.03734776750206947, -0.03538614511489868, 0.07192618399858475, -0.025616491213440895, 0.0009231168078258634, -0.02394334226846695, -0.0076493690721690655, 0.07492631673812866, 0.007322431541979313, 0.012894787825644016, -0.011154327541589737, 0.03478996455669403, -0.009524449706077576, -0.07604174315929413, -0.00825516413897276, -0.0299820639193058, 0.014760253019630909, 0.004841555375605822, -0.029193568974733353, -0.03477073088288307, 0.01907774619758129, 0.0037742014974355698, 0.030982106924057007, -0.05254073068499565, 0.006649325601756573, -0.01984701119363308, -0.05011754855513573, -0.004709337837994099, -0.07107999175786972, 0.0035746735520660877, -0.007697447668761015, 0.010904316790401936, -0.039924800395965576, -0.039251696318387985, 0.059233326464891434, 0.008106118999421597, 0.012904403731226921, -0.0033487023320049047, -0.050848349928855896, -0.014904489740729332, 0.03207830712199211, -0.025501102209091187, 0.07277237623929977, -0.026981934905052185, -0.002162352902814746, 0.0051636844873428345, -0.022289425134658813, 0.035847701132297516, 0.0012620737543329597, -0.01396214123815298, -0.002540975110605359, -0.033789921551942825, -0.00204696343280375, -0.061848826706409454, -0.02677038684487343, 0.02128938026726246, 0.026212669909000397, 0.009760037064552307, -0.013817904517054558, -0.025078006088733673, 0.01158703863620758, -0.056348588317632675, 0.008274395950138569, -0.09685033559799194, 0.011837049387395382, -0.03275141492486, -0.00926482304930687, 0.018895046785473824, 0.0617334358394146, -0.0077551426365971565, 0.06561821699142456, -0.04757897928357124, -0.057156313210725784, -0.008303243666887283, 0.01782769337296486, -0.06461817771196365, -0.03630926087498665, 0.009125393815338612, -0.017385365441441536, 0.06811832636594772, -0.031847529113292694, -0.012865940108895302, 0.002839064924046397, 0.055002376437187195, 0.05950257182121277, -0.011163943447172642, 0.020943211391568184, -0.020077791064977646, 0.0029592623468488455, 0.011933207511901855, -0.010375448502600193, 0.011394723318517208, 0.06615670025348663, -0.06907990574836731, 0.05354077368974686, 0.019981632009148598, -0.01064469013363123, -0.0603487603366375, -0.01646224968135357, 0.00009593262802809477, 0.024058731272816658, 0.04088637977838516, 0.060579538345336914, 0.01574106514453888, 0.01768345572054386, 0.015481437556445599, -0.0032501404639333487, 0.010385064408183098, 0.03327066823840141, -0.01635647565126419, -0.003401589347049594, 0.02105860225856304, -0.05188685655593872, 0.025616491213440895, -0.00565409054979682, 0.024885689839720726, -0.07334931939840317, -0.006471433211117983, -0.02880893647670746, 0.010029279626905918, -0.06388737261295319, 0.054233111441135406, 0.025654954835772514, -0.011846665292978287, 0.03613617643713951, -0.03840550407767296, 0.009452331811189651, 0.04723281040787697, -0.029097409918904305, 0.008144582621753216, 0.04030943289399147, -0.015269890427589417, 0.03988633677363396, 0.0603487603366375, 0.0029328190721571445, 0.01973162218928337, 0.06642594933509827, -0.042078740894794464, -0.016846882179379463, -0.03152059391140938, -0.04915596917271614, 0.023712562397122383, 0.03150136023759842, 0.017933467403054237, -0.0437326580286026, -0.03748238831758499, -0.007245505228638649, -0.0407709926366806, 0.014442931860685349, 0.02657807059586048, -0.0043054744601249695, 0.01698150299489498, 0.0006839237757958472, -0.0421556681394577, 0.04865594953298569, 0.04896365478634834, 0.02873201109468937, 0.0761955976486206, 0.0506560355424881, 0.0423479825258255, -0.02605881728231907, -0.02453952096402645, -0.02319330908358097, -0.014731405302882195, -0.03071286529302597, 0.0381939560174942, -0.019962400197982788, -0.054463889449834824, 0.02592419646680355, -0.009317710064351559, -0.016212237998843193, -0.028347378596663475, -0.0694645419716835, 0.033789921551942825, -0.012462076731026173, 0.01061584334820509, 0.02669346146285534, 0.01978931576013565, 0.013846752233803272, 0.01971239037811756, 0.04034789651632309, 0.04104023426771164, 0.014414084143936634, -0.060387223958969116, -0.024943385273218155, 0.005803135223686695, 0.011077401228249073, 0.013760210014879704, -0.06277193874120712, -0.009240783751010895, 0.009288862347602844, -0.006606054492294788, 0.06704135984182358, -0.020289337262511253, 0.06634902209043503, -0.03832857683300972, 0.029770515859127045, -0.00037922311457805336, -0.06419508159160614, -0.017298823222517967, 0.01536604855209589, 0.02584727108478546, -0.005384847987443209, 0.00749551597982645, 0.02515493333339691, -0.03694390505552292, 0.017519988119602203, -0.01234668679535389, -0.013000561855733395, 0.008365745656192303, -0.03752085193991661, 0.033232204616069794, -0.02178940363228321, -0.0246356800198555, 0.05888715758919716, -0.04577120766043663, 0.04311724752187729, -0.0005294699803926051, 0.00849075149744749, -0.04188642278313637, -0.05354077368974686, -0.03836704045534134, -0.05280997231602669, 0.046886641532182693, 0.024943385273218155, 0.008346514776349068, -0.08700376003980637, -0.06781062483787537, 0.037213146686553955, -0.012539003044366837, 0.0065964385867118835, 0.016144927591085434, -0.005865638144314289, -0.02244327776134014, -0.0260203555226326, 0.0106350751593709, -0.025578027591109276, 0.013385193422436714, -0.010356216691434383, -0.04584813490509987, -0.017500756308436394, -0.02730887196958065, 0.04934828355908394, 0.01774115115404129, 0.0008347716066055, 0.012221681885421276, 0.07458014786243439, 0.03627079725265503, -0.003447264200076461, 0.11538960039615631, 0.03954016789793968, 0.006615670397877693, 0.0028510845731943846, -0.030482085421681404, -0.044155754148960114, 0.055002376437187195, -0.05146376043558121, -0.0058127511292696, -0.02121245488524437, 0.04857902228832245, 0.010077358223497868, -0.0073560867458581924, -0.010990859009325504, -0.017221897840499878, -0.06169497221708298, -0.04857902228832245, 0.011837049387395382, 0.009894657880067825, -0.007841684855520725, 0.033136047422885895, -0.015558364801108837, -0.028539694845676422, 0.0409633070230484, 0.04784822091460228, 0.03469380736351013, -0.055694714188575745, 0.098542720079422, 0.03946324437856674, -0.07423397898674011, 0.05961795896291733, -0.02930895797908306, -0.004425671882927418, 0.002718867501243949, -0.013904446735978127, 0.055694714188575745, -0.0045434655621647835, -0.09108085930347443, 0.03213600441813469, -0.00023243192117661238, 0.020789358764886856, 0.028308914974331856, 0.0015962227480486035, 0.036616966128349304, -0.014808331616222858, 0.0947733223438263, -0.022327886894345284, 0.0381939560174942, -0.019568152725696564, -0.008216701447963715, -0.01925083063542843, -0.017308440059423447, 0.023577941581606865, 0.04654047265648842, -0.031270582228899, 0.01396214123815298, -0.0017957506934180856, 0.14092916250228882, 0.02798197790980339, -0.044771164655685425, 0.0023991421330720186, 0.009351365268230438, -0.03627079725265503, -0.05669475719332695, 0.003389569465070963, 0.026481913402676582, -0.051579151302576065, -0.030424391850829124, 0.006894528400152922, 0.008884998969733715, -0.05927179008722305, 0.004776648711413145, -0.007365702651441097, -0.06542590260505676, 0.07096460461616516, -0.011442801915109158, -0.018818121403455734, 0.03950170800089836, 0.01977008394896984, -0.03486689180135727, 0.020327800884842873, 0.04604044929146767, 0.05004062131047249, 0.033693764358758926, 0.01902005262672901, 0.03271295130252838, 0.011933207511901855, 0.011260101571679115, 0.07715717703104019, 0.040040191262960434, 0.028193525969982147, -0.06096417084336281, -0.029751285910606384, -0.0888499915599823, 0.05269458517432213, 0.01330826710909605, 0.006582015193998814, -0.0026034777984023094, 0.0018342138500884175, -0.021347075700759888, 0.02255866676568985, 0.0617334358394146, -0.013904446735978127, 0.018702730536460876, 0.04015558212995529, -0.0039665172807872295, 0.0315590538084507, 0.03011668473482132, -0.005346384830772877, 0.03296296298503876, 0.027789661660790443, -0.02940511703491211, 0.05592549219727516, 0.0003741147229447961, 0.009461946785449982, -0.01093316450715065, 0.012769781984388828, 0.01706804521381855, 0.0328475721180439, -0.04665585979819298, 0.010385064408183098, 0.036482345312833786, 0.03644388169050217, 0.018981589004397392, 0.04942521080374718, -0.058540988713502884, 0.043348025530576706, -0.019385453313589096, -0.017577681690454483, -0.0299820639193058, 0.053579237312078476, 0.002870316384360194, 0.03307835012674332, -0.017375750467181206, -0.007538787089288235, -0.005481006111949682, 0.0874653160572052, 0.010683153755962849, -0.11331258714199066, -0.0008317666943185031, 0.01921236887574196, -0.05615627020597458, -0.02250097133219242, 0.00853883009403944, 0.0038895912002772093, -0.016712259501218796, -0.035847701132297516, -0.005783903878182173, 0.03286680579185486, 0.007596482057124376, 0.04519426077604294, -0.004603564273566008, -0.007245505228638649, -0.017279593273997307, -0.001052329083904624, 0.00994273740798235, -0.02184709720313549, 0.0204816535115242, 0.0164718646556139, 0.011019706726074219, -0.026251133531332016, -0.05646397918462753, -0.002394334180280566, -0.029039716348052025, -0.05869484320282936, 0.014202536083757877, -0.021347075700759888, 0.007062804885208607, 0.0010667528258636594, 0.021481696516275406, -0.010856238193809986, -0.07861877977848053, -0.031232118606567383, 0.014846795238554478, 0.0005757460021413863, 0.0617334358394146, 0.0340399332344532, 0.025808807462453842, -0.07392627000808716, -0.06142573058605194, -0.0030482085421681404, 0.03461688011884689, -0.0561947338283062, 0.011798586696386337, 0.013558277860283852, 0.05761787295341492, 0.04534811154007912, -0.0029304150957614183, -0.03334759548306465, 0.008548445999622345, -0.046117376536130905, 0.03219369798898697, 0.012789013795554638, 0.006096417084336281, 0.05169454216957092, 0.048232853412628174, 0.0033270667772740126, -0.03917476907372475, 0.00784649234265089, -0.0734262466430664, 0.033751457929611206, 0.00423816405236721, -0.00001329684801021358, 0.0191450584679842, 0.0217701718211174, 0.008822496049106121, 0.029578201472759247, -0.04484809190034866, 0.008380169980227947, -0.026347292587161064, -0.01973162218928337, 0.01843348890542984, -0.008654220029711723, 0.024924153462052345, -0.039155539125204086, 0.0658874586224556, -0.012048597447574139, -0.035905398428440094, -0.022981761023402214, -0.0029304150957614183, -0.020789358764886856, -0.02263559401035309, 0.026328060775995255, 0.04496347904205322, 0.009274438954889774, -0.004206912592053413, -0.02805890515446663, 0.048232853412628174, -0.01902005262672901, -0.035770777612924576, -0.053425382822752, 0.007101268041878939, 0.015279506333172321, -0.03873244300484657, 0.05004062131047249, -0.019010435789823532, 0.06496434658765793, -0.01332749892026186, 0.050232939422130585, -0.019596999511122704, 0.008726338855922222, -0.03546306863427162, 0.05938718095421791, 0.03752085193991661, -0.02311638370156288, 0.017500756308436394, 0.03534768149256706, 0.03350144624710083, 0.0003678043431136757, -0.02950127422809601, 0.06611824035644531, 0.04877133667469025, -0.016712259501218796, 0.009961969219148159, -0.02390487864613533, -0.012567850761115551, 0.03557845950126648, 0.030193611979484558, -0.01126971747726202, -0.028174294158816338, 0.017635377123951912, -0.041347939521074295, -0.0370015986263752, 0.0066349017433822155, -0.021597087383270264, 0.011106248944997787, 0.011452417820692062, -0.03980941325426102, -0.04654047265648842, 0.016193008050322533, 0.0027164635248482227, -0.029828211292624474, -0.01646224968135357, 0.02253943495452404, -0.022962531074881554, -0.024116426706314087, -0.046732787042856216, -0.03213600441813469, 0.013135182671248913, 0.001966431038454175, -0.0041059465147554874, 0.05246380344033241, 0.006250270176678896, 0.04515579715371132, -0.006057953927665949, -0.011000474914908409, 0.08084964752197266, 0.08123427629470825, -0.007274352479726076, -0.04565581679344177, -0.023424088954925537, 0.01700073480606079, 0.020750897005200386, -0.011019706726074219, 0.03194368630647659, -0.015616059303283691, -0.00496175279840827, 0.008784033358097076, -0.05734863132238388, -0.024404900148510933, 0.004281435161828995, 0.0016911787679418921, 0.05415618419647217, 0.03488612174987793, 0.006211806554347277, 0.054925449192523956, -0.013173646293580532, -0.03821318969130516, 0.022943299263715744, 0.05211763456463814, 0.0343284048140049, -0.010808159597218037, 0.007567634340375662, -0.0019928745459765196, 0.01982777938246727, 0.03630926087498665, 0.08546523004770279, 0.05954103171825409, -0.00577909592539072, -0.06961838901042938, 0.06881066411733627, -0.02515493333339691, -0.01541412714868784, -0.017548834905028343, -0.0546177439391613, 0.0024171716067939997, 0.04034789651632309, -0.03213600441813469, -0.06404122710227966, 0.0658874586224556, 0.02396257407963276, -0.029616663232445717, -0.02050088532269001, -0.006067569833248854, -0.018029624596238136, -0.04904057830572128, -0.06142573058605194, 0.03575154393911362, 0.012837093323469162, -0.03877090662717819, -0.010586995631456375, -0.05107912793755531, -0.046078912913799286, 0.04534811154007912, 0.029635895043611526, 0.016731491312384605, -0.005610819440335035, -0.0246356800198555, 0.014096762984991074, 0.0238471832126379, 0.03548230230808258 ]
31,967
pingouin.utils
_is_mpmath_installed
Check if mpmath is installed.
def _is_mpmath_installed(raise_error=False): """Check if mpmath is installed.""" try: import mpmath # noqa is_installed = True except OSError: # pragma: no cover is_installed = False # Raise error (if needed) : if raise_error and not is_installed: # pragma: no cover raise OSError("mpmath needs to be installed. Please use `pip " "install mpmath`.") return is_installed
(raise_error=False)
[ 0.046786319464445114, 0.010977745987474918, 0.03343908488750458, 0.040183696895837784, 0.07930245250463486, 0.01793534681200981, -0.007640936877578497, -0.027972396463155746, -0.019328642636537552, 0.02188449539244175, 0.0795864388346672, -0.02266545034945011, 0.060062557458877563, -0.030084526166319847, -0.020304836332798004, 0.01805071532726288, 0.0491291843354702, -0.009460208006203175, 0.04714129865169525, 0.021742504090070724, -0.030758986249566078, 0.04923567920923233, 0.015352870337665081, -0.002742217853665352, 0.009202847257256508, 0.07426173985004425, 0.06520976126194, 0.0043950919061899185, 0.0011437000939622521, 0.02962305210530758, -0.00809797365218401, 0.01634681224822998, 0.023268915712833405, 0.004253100138157606, 0.008390831761062145, 0.04078716039657593, 0.064961276948452, -0.06201494485139847, -0.016994651407003403, -0.053388938307762146, 0.006846670061349869, 0.06705565750598907, 0.04405297338962555, 0.018689678981900215, -0.0578971803188324, -0.05992056429386139, -0.07603663951158524, 0.022434713318943977, 0.010915623977780342, 0.02743992768228054, 0.05906861275434494, -0.007019722368568182, 0.04444345086812973, 0.012255672365427017, -0.059104111045598984, 0.02724468894302845, 0.03915425390005112, -0.024049870669841766, -0.04920018091797829, -0.012965631671249866, 0.03567545488476753, 0.04224257916212082, 0.024724332615733147, -0.049377668648958206, 0.027564169839024544, -0.024866323918104172, -0.004208727274090052, -0.0657777264714241, -0.03125595673918724, 0.020713062956929207, -0.08200030028820038, 0.010498522780835629, -0.0982583686709404, -0.04014819860458374, 0.006309763062745333, 0.01160783413797617, 0.004073391668498516, -0.04820623621344566, 0.005568743217736483, -0.00451267883181572, -0.060737017542123795, -0.0011603396851569414, -0.01357797160744667, 0.03805381804704666, -0.0010033721337094903, -0.008586070500314236, 0.03546246886253357, 0.08377519994974136, 0.0516495406627655, 0.014953517355024815, -0.013897453434765339, 0.03402480110526085, 0.024227360263466835, 0.007414637599140406, 0.01050739735364914, -0.01012579444795847, 0.027670662850141525, -0.030510500073432922, -0.051756031811237335, -0.011634457856416702, -0.019825613126158714, 0.014261307194828987, 0.07159939408302307, 0.014421048574149609, 0.03395380452275276, 0.03260488063097, -0.0031349139753729105, -0.049945637583732605, 0.031397949904203415, -0.02925032377243042, -0.055483318865299225, -0.032356396317481995, -0.02646373212337494, 0.005981407128274441, 0.031291455030441284, -0.06339936703443527, 0.021955491974949837, 0.015725597739219666, 0.0006894370308145881, 0.007609876338392496, 0.005937034729868174, 0.05086858570575714, 0.043556004762649536, -0.02294943481683731, 0.06435780972242355, -0.01977236568927765, 0.05555431544780731, 0.0008536151144653559, 0.039438240230083466, -0.00731701822951436, 0.021458519622683525, -0.0073835765942931175, 0.03883477300405502, 0.01685265824198723, -0.05992056429386139, 0.018778422847390175, -0.04728328809142113, -0.004131075460463762, 0.016240319237113, -0.014012821950018406, -0.05193352326750755, -0.007197212427854538, -0.015556982718408108, -0.01500676479190588, -0.00978856347501278, 0.07752755284309387, -0.03844429552555084, -0.0006495018023997545, -0.013888578861951828, -0.012868012301623821, 0.03603043407201767, -0.07603663951158524, -0.007210524287074804, -0.07461672276258469, -0.02552303671836853, 0.017642488703131676, 0.04998113587498665, 0.02657022699713707, 0.009424709714949131, -0.023464154452085495, -0.0007044127560220659, 0.04721229523420334, -0.022860689088702202, -0.016550926491618156, -0.030421756207942963, -0.029374565929174423, -0.02247021161019802, -0.06574223190546036, 0.008115721866488457, 0.06755262613296509, 0.007228272967040539, 0.023943377658724785, 0.04944866523146629, -0.024724332615733147, 0.022434713318943977, -0.0378408320248127, 0.02275419607758522, 0.05250148847699165, 0.001523084589280188, 0.004503804259002209, 0.0009784126887097955, -0.00795598141849041, -0.06457079946994781, 0.02658797614276409, -0.005107269622385502, 0.0708894357085228, -0.02160051092505455, -0.028362873941659927, -0.025114810094237328, 0.03526723012328148, -0.028362873941659927, -0.0160184558480978, 0.03136245161294937, 0.00347880064509809, -0.027794906869530678, 0.021281030029058456, 0.04284604266285896, -0.02875335142016411, -0.027031701058149338, 0.01442992314696312, -0.003425553673878312, -0.014873647131025791, 0.007778491359204054, 0.0451534129679203, -0.010436401702463627, -0.10067223012447357, -0.07074744254350662, -0.002733343280851841, -0.055696308612823486, 0.008355333469808102, -0.020517824217677116, -0.05101057514548302, -0.014074943028390408, 0.13808707892894745, 0.021192284300923347, 0.06957601010799408, 0.07106692343950272, 0.014705032110214233, -0.006309763062745333, -0.005040711257606745, 0.027226939797401428, -0.013027752749621868, 0.06368334591388702, 0.08086436241865158, -0.008204467594623566, 0.042775046080350876, -0.004022363107651472, 0.061127495020627975, 0.020908301696181297, -0.0031504444777965546, 0.03157544136047363, -0.012894636020064354, -0.015991833060979843, 0.026410486549139023, -0.05637076869606972, -0.053282447159290314, -0.0083242729306221, 0.06964700669050217, 0.018370196223258972, -0.0024848575703799725, 0.009140726178884506, 0.019470633938908577, -0.015370618551969528, 0.04426596313714981, -0.029498808085918427, -0.0711379200220108, 0.006842232774943113, -0.017420627176761627, -0.05828765779733658, 0.01085350289940834, -0.011891818605363369, 0.011545713059604168, 0.05555431544780731, -0.038302306085824966, 0.030031278729438782, -0.03242739289999008, -0.019275395199656487, 0.018370196223258972, 0.024635586887598038, -0.014190311543643475, 0.0043440633453428745, 0.01625806838274002, 0.03642091155052185, 0.020091848447918892, -0.05015862360596657, -0.02715594321489334, 0.013222992420196533, 0.0384087972342968, 0.00927384290844202, 0.012557405047118664, 0.029410064220428467, -0.00707296933978796, -0.021245531737804413, -0.02007409930229187, 0.0397932194173336, -0.031238209456205368, -0.03652740642428398, 0.03365207090973854, -0.024724332615733147, 0.052820973098278046, -0.001668404322117567, -0.0165864247828722, -0.04053867608308792, 0.042668554931879044, -0.08313623070716858, 0.046324845403432846, -0.014314554631710052, -0.03762784227728844, 0.044017475098371506, 0.015210878103971481, -0.029658550396561623, -0.003645197255536914, -0.014642911031842232, -0.016897032037377357, 0.017970845103263855, 0.05402790382504463, 0.0414971224963665, -0.035906191915273666, 0.04902268946170807, -0.026215247809886932, 0.034450776875019073, 0.05842965096235275, -0.0378408320248127, 0.014083817601203918, -0.018618682399392128, 0.008444078266620636, 0.025540785863995552, -0.015033388510346413, -0.025292299687862396, 0.03212565928697586, -0.01395069994032383, 0.03595943748950958, -0.03911875560879707, -0.02971179597079754, 0.1095467209815979, 0.0275286715477705, 0.011891818605363369, -0.059317100793123245, -0.03594169020652771, 0.01615157350897789, -0.012734894640743732, 0.02580702118575573, 0.06272490322589874, -0.03391830623149872, -0.02685421146452427, -0.0640738233923912, 0.01730525866150856, -0.04838372766971588, 0.04050317779183388, 0.015849841758608818, -0.05150754749774933, 0.00707296933978796, 0.08995184302330017, -0.004015707410871983, 0.019541630521416664, -0.027120444923639297, -0.0032059098593890667, -0.0330486036837101, 0.009664321318268776, -0.00015974084089975804, 0.01046302542090416, 0.013089874759316444, -0.028700103983283043, 0.0004983581602573395, -0.03652740642428398, -0.0059459093026816845, 0.03730836138129234, 0.01931089349091053, -0.012104806490242481, -0.060737017542123795, -0.022718697786331177, 0.01643555797636509, -0.0414971224963665, 0.020216090604662895, -0.006234330125153065, 0.042313575744628906, -0.04767376556992531, 0.013311737217009068, 0.026783214882016182, 0.039615727961063385, 0.034450776875019073, 0.0319126695394516, -0.014687282964587212, 0.03354557603597641, -0.09477956593036652, -0.06449980288743973, 0.0180684644728899, 0.014749404042959213, 0.012885761447250843, 0.02523905225098133, 0.024351604282855988, -0.050052132457494736, -0.03258713334798813, -0.029392315074801445, -0.02046457678079605, 0.05200451985001564, -0.008208904415369034, 0.015548109076917171, -0.032445140182971954, -0.04817073792219162, 0.031965918838977814, -0.02648148126900196, -0.038657285273075104, -0.055589813739061356, 0.055767301470041275, 0.005914848297834396, 0.011714328080415726, -0.014021696522831917, -0.010072547942399979, -0.03086548112332821, -0.01854768581688404, -0.00010892051068367437, 0.03239189460873604, -0.01604508049786091, -0.0032702500466257334, 0.0245645921677351, 0.039722222834825516, -0.01323186606168747, -0.047567274421453476, 0.010959996841847897, 0.048880696296691895, 0.018334699794650078, 0.03926074877381325, -0.016240319237113, -0.001795975142158568, 0.022345969453454018, -0.04465644061565399, -0.03420228883624077, 0.004681294318288565, 0.0307767353951931, -0.00036829139571636915, -0.04359149932861328, -0.044194966554641724, -0.012974506244063377, -0.07703058421611786, 0.026499230414628983, -0.04341401159763336, -0.06520976126194, 0.008492887951433659, 0.0021797968074679375, 0.02761741727590561, -0.0454728938639164, -0.005284759681671858, 0.036456409841775894, -0.009824061766266823, 0.017030147835612297, -0.03285336494445801, -0.005302508361637592, -0.03391830623149872, -0.0038071568123996258, -0.0028109950944781303, 0.013311737217009068, 0.051756031811237335, 0.025576284155249596, 0.004246443975716829, -0.014758278615772724, -0.03887027129530907, 0.01721651293337345, -0.09577351063489914, -0.062369924038648605, 0.03851529210805893, 0.017713485285639763, -0.008031414821743965, -0.008395268581807613, 0.06737513840198517, 0.03887027129530907, 0.04767376556992531, 0.026410486549139023, -0.01634681224822998, 0.012415412813425064, -0.05129455775022507, 0.018103962764143944, 0.011022117920219898, 0.016568675637245178, 0.04217158257961273, -0.010010425932705402, 0.002316242316737771, -0.033794064074754715, 0.0028731166385114193, -0.0020433515310287476, -0.0756816640496254, 0.04131963104009628, -0.04103564843535423, 0.02857586182653904, 0.06119849160313606, 0.035426970571279526, -0.0032613754738122225, 0.011740951798856258, -0.0006655868492089212, 0.05456037074327469, 0.028167635202407837, 0.025398794561624527, 0.013409356586635113, -0.022292722016572952, 0.006984224542975426, -0.021192284300923347, -0.09790338575839996, 0.07880548387765884, 0.021085791289806366, 0.00779180321842432, -0.02016284503042698, -0.020287087187170982, 0.017376253381371498, -0.025736024603247643, 0.004490492399781942, -0.004040112253278494, 0.0006361901178024709, -0.0378408320248127, 0.050336115062236786, -0.05566081032156944, -0.02113903872668743, 0.017997467890381813, 0.06499677151441574, -0.009282717481255531, 0.05189802497625351, -0.032640378922224045, -0.016888156533241272, 0.04948416352272034, 0.05047810450196266, 0.011865194886922836, 0.028735602274537086, 0.0666651800274849, 0.03986421599984169, 0.023552900180220604, 0.04781575873494148, -0.024227360263466835, 0.004752289969474077, -0.03652740642428398, -0.02436935342848301, -0.007312580943107605, -0.056619253009557724, 0.0008469592430628836, -0.011545713059604168, 0.023925628513097763, 0.02266545034945011, 0.009327090345323086, -0.031983666121959686, -0.010418652556836605, 0.028611360117793083, -0.012229048646986485, 0.0019967604894191027, 0.03020876832306385, -0.05377941578626633, -0.049271173775196075, -0.07532668113708496, 0.004667982459068298, -0.03290661424398422, -0.015228627249598503, -0.0017815540777519345, -0.015423865988850594, 0.062085941433906555, 0.008413017727434635, -0.03791182488203049, 0.01592971198260784, 0.0004209836770314723, 0.015352870337665081, -0.03210790827870369, 0.03205466270446777, 0.04039668291807175, -0.06272490322589874, -0.03595943748950958, 0.0073835765942931175, 0.048419225960969925, -0.0020056350622326136, -0.008155657909810543, 0.04479843005537987, -0.032356396317481995, 0.003975772298872471, -0.01538836769759655, -0.021352026611566544, 0.002713375724852085, 0.04359149932861328, -0.004297472536563873, -0.0007066313410177827, 0.07717257738113403, -0.003651853185147047, 0.04625384882092476, -0.008204467594623566, -0.00676236255094409, -0.0350009948015213, -0.01711001992225647, -0.03546246886253357, 0.022984933108091354, 0.009912806563079357, -0.010613891296088696, -0.07355178147554398, -0.05704522877931595, -0.0009928337531164289, 0.03526723012328148, -0.03595943748950958, 0.02266545034945011, -0.041142143309116364, 0.022310471162199974, -0.026073254644870758, 0.03879927471280098, -0.032746873795986176, 0.027315683662891388, -0.011474717408418655, 0.01013466902077198, 0.012388790026307106, 0.03391830623149872, -0.040467679500579834, -0.014314554631710052, 0.01442992314696312, 0.02713819406926632, -0.05512833967804909, -0.022718697786331177, -0.023481903597712517, -0.04100015014410019, -0.0033589948434382677, -0.05349543318152428, 0.030173270031809807, 0.06009805575013161, -0.03381181135773659, 0.035036493092775345, -0.003707318799570203, -0.004390654619783163, 0.011146361008286476, 0.03642091155052185, -0.002065537730231881, -0.005741795990616083, 0.012158052995800972, -0.007086281199008226, -0.06361235678195953, -0.01008142251521349, -0.00623876741155982, -0.02848711609840393, 0.030457254499197006, 0.006070151925086975, -0.0522175058722496, -0.0516495406627655, -0.015139882452785969, -0.04753177613019943, -0.014110441319644451, 0.026144251227378845, -0.01892041601240635, 0.016701793298125267, 0.0036274483427405357, 0.059494588524103165, -0.024990567937493324, 0.027688411995768547, 0.014980141073465347, 0.002444922225549817, -0.03365207090973854, 0.044869426637887955, -0.0034588328562676907, -0.0009573357529006898, -0.03578194975852966, -0.020961549133062363, -0.04394648224115372, 0.0031970355194061995, 0.01745612360537052, 0.09989127516746521, -0.0835622102022171, -0.03327934071421623, -0.022718697786331177, 0.002669003326445818, -0.0015253032324835658, 0.04838372766971588, 0.0460408590734005, -0.06499677151441574, 0.012752643786370754, -0.007738556247204542, -0.024333855137228966, 0.06201494485139847, 0.0491291843354702, -0.02168925665318966, 0.005675237160176039, 0.09130076318979263, 0.02589576505124569, -0.0432010218501091, 0.0097441915422678, 0.03315509855747223, -0.041532620787620544, 0.007556629367172718, -0.0420650877058506, -0.045721378177404404, -0.017642488703131676, -0.034929998219013214, -0.034929998219013214, 0.008572758175432682, -0.03915425390005112, -0.05086858570575714, 0.05487985536456108, 0.028362873941659927, -0.03496549651026726, -0.024866323918104172, -0.0055998037569224834, -0.006513876374810934, 0.00016320744180120528, -0.01300112996250391, 0.04135512933135033, 0.006185520440340042, -0.059885066002607346, -0.03958022966980934, 0.0869700163602829, -0.005249261390417814, -0.036740392446517944, -0.01261065248399973, 0.005626427475363016, -0.0076764351688325405, 0.03642091155052185, -0.03887027129530907, 0.06840457767248154, -0.06432231515645981, -0.0016306877369061112, 0.0293568167835474, 0.0666651800274849, -0.0023961125407367945, -0.06442880630493164, -0.013773210346698761, 0.050336115062236786, 0.0030106711201369762, 0.010445276275277138, -0.006660305894911289, -0.033776313066482544, -0.06176646053791046, 0.04827723279595375, 0.009477956220507622, -0.0739777609705925, 0.024351604282855988, 0.026729967445135117, -0.03038625791668892, 0.02342865616083145, -0.02694295533001423, -0.013391607441008091, -0.092081718146801, 0.0367048941552639, -0.03958022966980934, 0.012051559053361416, -0.014181436970829964, -0.03514298424124718, 0.029853789135813713, -0.06070151925086975, 0.03787633031606674, -0.061233989894390106, 0.017837727442383766, 0.01628469116985798, 0.030155520886182785, -0.022044235840439796, -0.0011703235795721412, 0.013125372119247913, 0.029978031292557716, 0.01695915311574936, -0.03517848253250122, -0.01233554258942604, -0.036562904715538025, -0.06751713156700134, 0.01588534004986286, -0.0037539098411798477, -0.04242006689310074, 0.01900915987789631, 0.005240387283265591, 0.07745655626058578, -0.004497148562222719, -0.011803073808550835, -0.03177068009972572, 0.047567274421453476, 0.005546557251363993, -0.014074943028390408, 0.04454994574189186, -0.0443369597196579, 0.038657285273075104, -0.012628400698304176, 0.007916046306490898, -0.008111285045742989, 0.0032769059762358665, -0.016488805413246155, 0.006052403245121241, 0.01195393968373537, 0.04454994574189186, -0.04004170373082161, 0.0013089874992147088, 0.013986198231577873, 0.05257248505949974, 0.013089874759316444, -0.06286689639091492, -0.0030372946057468653, 0.023659393191337585, -0.034166790544986725, -0.04415946826338768, -0.009575576521456242, -0.00798704195767641, -0.0021764689590781927, -0.010640515014529228, -0.02770616114139557, -0.0539214089512825, 0.017704609781503677 ]
31,968
pingouin.utils
_is_sklearn_installed
Check if sklearn is installed.
def _is_sklearn_installed(raise_error=False): """Check if sklearn is installed.""" try: import sklearn # noqa is_installed = True except OSError: # pragma: no cover is_installed = False # Raise error (if needed) : if raise_error and not is_installed: # pragma: no cover raise OSError("sklearn needs to be installed. Please use `pip " "install scikit-learn`.") return is_installed
(raise_error=False)
[ 0.042723093181848526, 0.03874554857611656, 0.04694923385977745, 0.018680253997445107, 0.04922211542725563, 0.016362980008125305, 0.019568098708987236, 0.04655858129262924, -0.01643400825560093, 0.07116963714361191, 0.04893800616264343, 0.017561569809913635, 0.046025875955820084, -0.0831022709608078, 0.015146632678806782, -0.00019740674179047346, 0.015359715558588505, -0.01070740818977356, 0.04549316689372063, 0.009464425966143608, -0.06204259395599365, 0.04510251805186272, 0.017561569809913635, -0.005975195672363043, 0.0013206691946834326, 0.06090615317225456, 0.05245387181639671, -0.019283989444375038, 0.009482182562351227, 0.030932513996958733, -0.03952684998512268, 0.012190109118819237, -0.02267555706202984, 0.03084372915327549, 0.03249511867761612, 0.03421754017472267, 0.038852088153362274, -0.037467051297426224, 0.07550232112407684, -0.027043752372264862, 0.009233585558831692, 0.049541741609573364, 0.021201733499765396, -0.03585117310285568, -0.02516152150928974, -0.005540151614695787, -0.07876959443092346, 0.0375380776822567, -0.037076398730278015, -0.03760910779237747, 0.061616428196430206, -0.04574176296591759, 0.02251574397087097, 0.019053149968385696, -0.021840982139110565, 0.02883720025420189, 0.05643141642212868, -0.0030430881306529045, -0.03183811530470848, 0.0028943740762770176, 0.03338296338915825, 0.032654933631420135, 0.016149897128343582, -0.0053759003058075905, 0.0011336668394505978, -0.03409324213862419, -0.04918660223484039, -0.008687561377882957, -0.011373291723430157, 0.01409897580742836, -0.030648402869701385, 0.03503435477614403, -0.0692518949508667, -0.0015492892125621438, -0.0031784845050424337, 0.00009669184510130435, 0.005509077105671167, -0.046416524797677994, -0.0019610272720456123, -0.021716684103012085, -0.055685628205537796, -0.013512997888028622, 0.0014738223981112242, -0.012545247562229633, 0.0006547855446115136, -0.02553441748023033, -0.0001496850891271606, 0.01798773556947708, 0.024486759677529335, 0.03615304082632065, -0.02553441748023033, 0.056964121758937836, 0.05515291914343834, 0.006183838937431574, 0.018103156238794327, -0.0012773866765201092, 0.04037918150424957, -0.03221100941300392, -0.027132537215948105, -0.04510251805186272, 0.0008684232016094029, 0.0017823484959080815, 0.07919576019048691, 0.05952111631631851, -0.014587290585041046, 0.02242695912718773, -0.01976342499256134, -0.036827802658081055, 0.0360109843313694, -0.012083567678928375, -0.03604649752378464, -0.030772700905799866, 0.0200120210647583, 0.04421466961503029, -0.05980522558093071, -0.1049787700176239, 0.022444717586040497, 0.005278237164020538, -0.06690798699855804, 0.002672412898391485, 0.02015407755970955, 0.03547827899456024, 0.059379059821367264, -0.02771851420402527, 0.027754029259085655, -0.05426507443189621, 0.0018433877266943455, 0.048298757523298264, 0.03359604626893997, -0.011186844669282436, 0.04812118783593178, -0.04812118783593178, 0.003171825548633933, -0.0029742801561951637, -0.0360109843313694, 0.010414419695734978, -0.015368593856692314, 0.03240633383393288, -0.010938247665762901, -0.02706150896847248, -0.007555559277534485, -0.01926623284816742, -0.00795952882617712, -0.013699444942176342, 0.020242862403392792, 0.09780498594045639, -0.017162039875984192, 0.029511962085962296, -0.025214793160557747, -0.034803517162799835, 0.024220407009124756, -0.03450164943933487, -0.009384519420564175, -0.06101269647479057, -0.058491215109825134, 0.004090745002031326, -0.0014860302908346057, 0.012092445977032185, 0.011284507811069489, -0.07685184478759766, 0.00617052149027586, 0.037467051297426224, -0.026013853028416634, -0.030239993706345558, -0.013237765990197659, 0.028375519439578056, -0.03874554857611656, -0.018538199365139008, -0.012696180492639542, 0.031411949545145035, -0.03098578378558159, 0.02819795161485672, 0.010165822692215443, -0.011240115389227867, 0.01666484773159027, -0.030257750302553177, 0.010947126895189285, 0.02794935368001461, 0.025960581377148628, 0.012367677874863148, -0.013051318936049938, -0.0012651789002120495, -0.07578643411397934, -0.020207347348332405, -0.01234104298055172, 0.011470954865217209, -0.027132537215948105, -0.014702710323035717, 0.004166211932897568, 0.055934224277734756, -0.010254607535898685, 0.011142452247440815, 0.03134092316031456, 0.01591905765235424, 0.012891506776213646, -0.01058311015367508, 0.003649042220786214, -0.016780266538262367, -0.0263157207518816, 0.0002492901694495231, 0.015146632678806782, 0.009846199303865433, 0.03988198935985565, 0.06694349646568298, 0.012429826892912388, -0.013086832128465176, -0.10014889389276505, 0.016398493200540543, -0.06694349646568298, 0.016922321170568466, -0.022355932742357254, -0.09240689128637314, 0.01144431997090578, 0.13232439756393433, 0.05451367050409317, 0.060479987412691116, 0.06889675557613373, -0.037715647369623184, 0.0040419134311378, -0.04169319197535515, 0.05046509951353073, 0.010813949629664421, 0.08317330479621887, 0.056111790239810944, -0.028783928602933884, -0.027913840487599373, -0.004909781739115715, 0.004308267030864954, -0.01144431997090578, -0.013077953830361366, 0.006854162085801363, -0.06179399788379669, -0.005411413963884115, 0.018165305256843567, -0.010964883491396904, -0.04485391825437546, 0.020225103944540024, 0.08551721274852753, 0.0400240421295166, -0.04013058543205261, -0.025765256956219673, 0.04797913506627083, -0.020491458475589752, -0.02770075760781765, -0.03473248705267906, -0.01252749003469944, 0.019710155203938484, -0.008860691450536251, -0.05096229165792465, -0.023083964362740517, 0.02604936622083187, -0.017153162509202957, -0.005278237164020538, -0.06396034359931946, -0.02782505564391613, -0.08487796038389206, 0.007817473262548447, 0.024859653785824776, 0.004581279121339321, 0.004741091281175613, -0.020367160439491272, 0.0535903126001358, 0.004554643761366606, 0.07884062081575394, -0.07351355254650116, -0.0344838909804821, 0.057461317628622055, 0.016425129026174545, -0.00217854930087924, -0.01711764745414257, 0.03810629993677139, 0.004976370371878147, -0.002074227435514331, 0.019461557269096375, -0.004263874609023333, -0.02104192227125168, -0.02871290035545826, -0.00040896350401453674, 0.021840982139110565, 0.07251916080713272, 0.03451940789818764, 0.016984472051262856, -0.04581279307603836, 0.06424444913864136, -0.0468071773648262, 0.0016580502269789577, 0.024380218237638474, -0.05739028751850128, 0.02240920253098011, 0.015723731368780136, 0.0016103285597637296, -0.006410239730030298, 0.04971930757164955, -0.022054065018892288, 0.008825177326798439, 0.04733988642692566, 0.06008933484554291, -0.010148066096007824, 0.041480109095573425, -0.022444717586040497, 0.013433092273771763, 0.05323517322540283, -0.0006231560837477446, -0.0173840019851923, 0.03661471977829933, -0.04794361814856529, 0.025854039937257767, -0.031411949545145035, -0.02807365357875824, 0.061509888619184494, -0.013379821553826332, 0.044143643230199814, -0.016238681972026825, -0.04918660223484039, 0.02317274920642376, -0.03828386962413788, 0.016673725098371506, -0.050429586321115494, -0.045386627316474915, 0.04364645108580589, -0.03320539742708206, -0.025889554992318153, 0.024486759677529335, -0.04520905762910843, -0.0298493430018425, 0.013850378803908825, 0.05579216778278351, -0.06626873463392258, -0.03237082064151764, 0.026848426088690758, -0.010201336815953255, -0.0473753996193409, 0.08551721274852753, -0.007631026208400726, 0.014684952795505524, 0.023510130122303963, -0.0075599984265863895, -0.017783531919121742, -0.017472784966230392, 0.042723093181848526, -0.039597880095243454, 0.024344705045223236, -0.010201336815953255, 0.010094795376062393, -0.01347748376429081, -0.021840982139110565, 0.02491292543709278, 0.05074920877814293, -0.005202770698815584, -0.04105394333600998, -0.02819795161485672, -0.006077297497540712, -0.033152125775814056, 0.07742007076740265, 0.009180315770208836, 0.06119026243686676, -0.03388015925884247, 0.06527435034513474, 0.05348377302289009, -0.0005926364101469517, 0.009446668438613415, -0.039704419672489166, -0.004923099651932716, 0.0347680039703846, -0.07940883934497833, -0.04989687725901604, -0.01265178807079792, 0.026635345071554184, 0.023350318893790245, -0.05472675338387489, 0.037573590874671936, -0.04897351935505867, 0.0024881851859390736, -0.017996614798903465, 0.011426562443375587, 0.02757645957171917, 0.004126258660107851, 0.006694349925965071, 0.02354564517736435, -0.017312973737716675, -0.009979375638067722, 0.0048387544229626656, 0.0002180768788093701, -0.04368196427822113, 0.02718580886721611, -0.0016813561087474227, -0.04229692742228508, -0.044889435172080994, 0.023989567533135414, -0.056964121758937836, -0.01590130105614662, -0.015128875151276588, -0.0360109843313694, -0.016096625477075577, -0.010778435505926609, -0.0023794241715222597, 0.03700537234544754, -0.01322888769209385, 0.008794102817773819, 0.026617586612701416, 0.017375122755765915, 0.0031118961051106453, 0.016940079629421234, 0.014827008359134197, -0.025232549756765366, 0.07919576019048691, -0.028251221403479576, -0.053554799407720566, -0.011568618007004261, -0.007262570317834616, -0.0012463121674954891, -0.028925983235239983, -0.047162316739559174, -0.035300709307193756, -0.060870639979839325, 0.05302209034562111, -0.015830272808670998, 0.023350318893790245, 0.050571639090776443, 0.0037622423842549324, 0.010174701921641827, -0.04201281815767288, -0.02819795161485672, 0.02468208596110344, 0.015404107049107552, 0.024575544521212578, -0.06527435034513474, -0.05756785720586777, 0.04130253940820694, -0.02670637145638466, -0.01239431370049715, -0.00026524363784119487, -0.0016347442287951708, -0.002037603873759508, -0.05685758218169212, -0.014933549799025059, -0.08352843672037125, 0.0319979265332222, -0.07528924196958542, -0.0750761553645134, 0.005340386647731066, -0.029281122609972954, 0.011506468988955021, -0.0027234640438109636, 0.045386627316474915, 0.04648755490779877, 0.023954052478075027, 0.018138669431209564, -0.035069871693849564, -0.048405297100543976, -0.038567978888750076, -0.022746583446860313, -0.039100684225559235, 0.05195667967200279, -0.030648402869701385, 0.010014889761805534, 0.054584700614213943, -0.03235306590795517, 0.02176995389163494, 0.03180260211229324, -0.03760910779237747, -0.011613010428845882, -0.029902612790465355, 0.02871290035545826, 0.04783707857131958, -0.005278237164020538, 0.007284766528755426, 0.006774256005883217, 0.03187362849712372, 0.025392360985279083, 0.03792873024940491, 0.00024679311900399625, 0.029671773314476013, -0.04996790736913681, 0.02567647211253643, 0.0403081551194191, -0.010343392379581928, 0.047268856316804886, -0.013921407051384449, 0.02216060645878315, -0.034199781715869904, -0.019035393372178078, 0.019106419757008553, -0.025765256956219673, 0.01978118158876896, -0.062007080763578415, -0.044108130037784576, -0.039739932864904404, 0.060870639979839325, -0.016300830990076065, 0.0017834582831710577, -0.01693120039999485, 0.04144459590315819, -0.004963052459061146, 0.06736966222524643, -0.03679228946566582, 0.01839614473283291, 0.053945451974868774, 0.018573712557554245, 0.018538199365139008, 0.01691344380378723, 0.0723060816526413, -0.012616274878382683, 0.026919454336166382, 0.03693434223532677, -0.03799975663423538, 0.028109166771173477, -0.001418332103639841, -0.01428542286157608, -0.009016063995659351, -0.011382170021533966, -0.0009327919688075781, 0.011320021003484726, 0.01622980274260044, 0.027647487819194794, 0.008296909742057323, -0.05927252024412155, -0.0213970597833395, 0.022977422922849655, 0.03736050799489021, 0.007395747117698193, 0.023226020857691765, 0.034324079751968384, -0.03842592239379883, -0.016389615833759308, -0.007932893000543118, 0.017810167744755745, -0.009464425966143608, 0.006978460121899843, 0.032654933631420135, 0.05465572699904442, 0.01579475961625576, -0.012962534092366695, 0.027771785855293274, 0.03627733886241913, 0.01322888769209385, 0.015324201434850693, 0.006015148479491472, 0.008128219284117222, -0.08019014447927475, -0.002821126952767372, -0.011781700886785984, 0.030754944309592247, -0.010902734473347664, 0.0018933290848508477, 0.01796109974384308, -0.02819795161485672, -0.06477715820074081, -0.013912527821958065, -0.03325866535305977, 0.0031118961051106453, 0.09872834384441376, -0.016753630712628365, 0.04339785501360893, 0.09020503610372543, -0.01322888769209385, -0.02240920253098011, -0.010911612771451473, 0.013051318936049938, -0.004534667357802391, -0.03760910779237747, -0.03991750255227089, 0.0344838909804821, -0.02027837559580803, 0.029139066115021706, -0.06172297149896622, -0.05504637956619263, -0.00818592868745327, 0.010307878255844116, -0.08416768908500671, 0.03308109939098358, -0.06321454793214798, -0.011879363097250462, -0.004461420234292746, -0.011311142705380917, 0.04577727988362312, -0.0106275025755167, 0.01063638087362051, -0.004408149514347315, 0.027789542451500893, -0.0014050144236534834, -0.03187362849712372, -0.021219490095973015, 0.004940856248140335, -0.0015448499470949173, -0.0637117400765419, -0.022089578211307526, -0.0554015152156353, -0.05071369558572769, -0.02642226219177246, -0.021840982139110565, -0.03210446983575821, 0.03963339328765869, -0.04787259176373482, 0.03483903035521507, 0.0215391144156456, -0.008079388178884983, -0.007648782804608345, 0.05050061270594597, -0.025126008316874504, 0.010947126895189285, 0.005819822661578655, -0.0033382964320480824, -0.07685184478759766, 0.043610937893390656, 0.03157176077365875, -0.03293904289603233, 0.04020161181688309, 0.014374207705259323, -0.009269099682569504, -0.03070167265832424, 0.0012862652074545622, 0.019532585516572, -0.026759643107652664, 0.042865145951509476, 0.020686784759163857, -0.0004011948767583817, -0.055969737470149994, 0.03286801651120186, -0.024859653785824776, 0.03551379218697548, -0.013877014629542828, 0.03739602491259575, 0.014755981042981148, -0.009029381908476353, 0.011852728202939034, -0.01635410077869892, -0.009091530926525593, -0.042723093181848526, -0.038852088153362274, -0.0022995180916041136, -0.020562484860420227, 0.09730779379606247, -0.0961003229022026, -0.0004602920380420983, 0.014729345217347145, 0.05660898610949516, 0.01990548148751259, 0.06807994097471237, 0.0061882780864834785, -0.07212851196527481, 0.00041395763400942087, -0.0006736522191204131, 0.0008606545743532479, 0.01678914576768875, -0.04996790736913681, 0.014480749145150185, 0.017969978973269463, 0.07798828929662704, -0.0004988578148186207, -0.07056590169668198, 0.0016547207487747073, -0.010902734473347664, -0.046523068100214005, 0.0067964522168040276, -0.019852209836244583, 0.0029565233271569014, -0.0065789301879704, -0.013948041945695877, -0.05625384673476219, -0.010920491069555283, -0.0031607274431735277, 0.0021419255062937737, 0.06641079485416412, 0.007085001561790705, 0.014312058687210083, 0.009997132234275341, -0.004621232394129038, 0.0015526185743510723, 0.02906803973019123, -0.023758726194500923, 0.07564438134431839, 0.036188554018735886, -0.05959214270114899, -0.008936158381402493, 0.07621259987354279, -0.0609416663646698, -0.07372663170099258, -0.0011297825258225203, -0.0015626068925485015, 0.04162216559052467, 0.06740517914295197, -0.040840860456228256, 0.03625958040356636, -0.02629796229302883, -0.014658317901194096, 0.028162436559796333, 0.02152135781943798, 0.012838236056268215, -0.10966659337282181, -0.002741220872849226, 0.03874554857611656, 0.024877412244677544, 0.04268757998943329, -0.009837320074439049, 0.0021474745590239763, -0.02782505564391613, 0.04567073658108711, 0.02544563263654709, -0.026511045172810555, 0.047162316739559174, 0.019195204600691795, -0.03625958040356636, 0.023083964362740517, -0.034572675824165344, -0.0007235935190692544, -0.09936758875846863, -0.00024901272263377905, 0.009970497339963913, 0.008669804781675339, -0.002803369890898466, -0.05586319416761398, 0.022853124886751175, -0.03611752763390541, -0.009721900336444378, -0.03503435477614403, -0.0563603900372982, -0.012323286384344101, 0.059343546628952026, -0.012101324275135994, 0.0591304637491703, 0.005256041418761015, 0.005673328414559364, 0.02418489195406437, -0.052702467888593674, -0.015448499470949173, -0.008696439675986767, -0.04442775249481201, 0.0215391144156456, -0.0027856130618602037, 0.0024881851859390736, -0.02141481637954712, -0.02642226219177246, 0.08551721274852753, -0.029689529910683632, -0.004423686768859625, -0.0375380776822567, 0.04733988642692566, 0.03963339328765869, -0.002200745278969407, 0.02755870297551155, -0.0483342707157135, 0.061616428196430206, 0.019976507872343063, 0.010494325309991837, 0.02706150896847248, 0.0006431326037272811, -0.011311142705380917, 0.00783523079007864, 0.009118165820837021, 0.04027264192700386, -0.06534537672996521, -0.015395228751003742, 0.04648755490779877, 0.027629731222987175, 0.00025497793103568256, -0.06903881579637527, -0.00010092298180097714, 0.024113865569233894, -0.05050061270594597, 0.02127276174724102, -0.03237082064151764, -0.03070167265832424, -0.014818130061030388, 0.0176947470754385, -0.021823225542902946, 0.006454631686210632, 0.0283222496509552 ]
31,969
pingouin.utils
_is_statsmodels_installed
Check if statsmodels is installed.
def _is_statsmodels_installed(raise_error=False): """Check if statsmodels is installed.""" try: import statsmodels # noqa is_installed = True except OSError: # pragma: no cover is_installed = False # Raise error (if needed) : if raise_error and not is_installed: # pragma: no cover raise OSError("statsmodels needs to be installed. Please use `pip " "install statsmodels`.") return is_installed
(raise_error=False)
[ 0.041380949318408966, 0.022934019565582275, 0.05049757659435272, -0.0004802033072337508, 0.09437135607004166, 0.0005667289369739592, -0.011974478140473366, 0.003643535543233156, 0.011075279675424099, 0.0507112480700016, 0.040953606367111206, -0.04027698189020157, 0.05430804565548897, -0.06403007358312607, -0.005239390768110752, 0.03205065056681633, 0.01919477805495262, 0.007295974064618349, 0.03678702190518379, -0.036324068903923035, -0.03456128388643265, 0.05897319316864014, -0.04697200655937195, -0.04077554866671562, 0.027332080528140068, 0.08760510385036469, 0.014182412065565586, 0.0010371946264058352, 0.010336333885788918, 0.03814027085900307, 0.015197349712252617, -0.004342417698353529, 0.02127807028591633, 0.012125829234719276, 0.027759423479437828, 0.05345335975289345, 0.04066871106624603, -0.06054011359810829, 0.009392620995640755, -0.0012597686145454645, -0.009748739190399647, 0.06068256124854088, 0.05039074271917343, 0.051993273198604584, -0.03853200376033783, -0.057050153613090515, -0.09743396937847137, 0.022969631478190422, 0.0399564765393734, 0.013265407644212246, 0.07948561012744904, 0.011404689401388168, 0.046687111258506775, 0.006752893794327974, -0.02117123454809189, 0.010825997218489647, 0.022061530500650406, 0.006677218712866306, -0.01522405818104744, 0.004391383845359087, 0.07571075856685638, 0.050889309495687485, 0.03522010147571564, -0.06021960824728012, -0.011564942076802254, -0.023396974429488182, -0.027990899980068207, -0.02665545605123043, -0.014404986053705215, -0.007086754776537418, -0.08233455568552017, 0.036217235028743744, -0.07806113362312317, -0.015419923700392246, -0.009143337607383728, 0.00011052187619498, -0.01085270568728447, -0.02686912752687931, -0.013683846220374107, -0.031587693840265274, -0.04127411171793938, 0.010612325742840767, -0.0056133149191737175, 0.047470573335886, -0.015019290149211884, -0.01878524199128151, -0.01908794231712818, 0.04544069617986679, 0.07756257057189941, 0.039137404412031174, -0.006316648796200752, 0.03570086136460304, 0.027563558891415596, 0.006370066665112972, 0.020423386245965958, 0.006116332020610571, 0.006236521992832422, -0.06552577018737793, -0.02448313497006893, -0.029860520735383034, -0.03053714521229267, 0.005519833881407976, 0.08055396378040314, 0.06342467665672302, 0.00818626955151558, 0.03213967755436897, -0.02277376689016819, -0.06395885348320007, 0.0582965686917305, 0.0007645415025763214, -0.05904441699385643, -0.016265705227851868, -0.010825997218489647, 0.02149173989892006, -0.008164012804627419, -0.09907211363315582, 0.051530320197343826, 0.02859630063176155, -0.04266297444701195, 0.015197349712252617, 0.006423484068363905, 0.025925414636731148, 0.048289645463228226, -0.0038282719906419516, 0.07492729276418686, -0.02503511868417263, 0.024340687319636345, -0.019497478380799294, 0.05537639930844307, -0.004309031646698713, 0.054770998656749725, -0.046473439782857895, 0.03920862823724747, 0.0017160451970994473, -0.021206846460700035, 0.014289247803390026, -0.008747156709432602, 0.016425957903265953, 0.009588485583662987, -0.02937976084649563, -0.024002375081181526, 0.03838955610990524, -0.015963003039360046, -0.004050845745950937, 0.00852903351187706, 0.06203581020236015, -0.04252052679657936, 0.034044910222291946, 0.007295974064618349, -0.03431199863553047, 0.0366801880300045, -0.07385893911123276, -0.014333762228488922, -0.04262736439704895, -0.086323082447052, 0.011199921369552612, 0.000017658112483331934, 0.025889802724123, -0.014600851573050022, -0.03461470082402229, -0.01855376362800598, 0.030893264338374138, -0.04305470362305641, -0.03539816290140152, -0.03607478737831116, -0.02569393627345562, -0.05031951889395714, -0.02569393627345562, 0.023557227104902267, 0.05028390884399414, 0.007104560732841492, 0.03817588463425636, 0.030056387186050415, 0.004669601563364267, 0.011360174044966698, -0.021580770611763, 0.02266693115234375, 0.03831833228468895, 0.0008129513589665294, 0.03682263568043709, 0.011858739890158176, 0.01290038600564003, -0.09337422251701355, 0.010763675905764103, -0.025818578898906708, 0.04433673247694969, -0.030679592862725258, -0.0350954607129097, -0.011021861806511879, 0.018322287127375603, -0.010950637981295586, -0.006414581090211868, 0.0754970833659172, 0.021206846460700035, -0.005226036533713341, -0.012428529560565948, 0.01586507074534893, -0.025409042835235596, -0.04953605681657791, 0.017832625657320023, 0.014075576327741146, -0.011021861806511879, 0.012499753385782242, 0.0669502466917038, -0.02469680644571781, -0.05206449702382088, -0.08326046168804169, -0.03165891766548157, -0.05633791908621788, 0.013416757807135582, -0.007687704171985388, -0.07912949472665787, -0.0014044416602700949, 0.08710654079914093, 0.02742111124098301, 0.08375903218984604, 0.06064695119857788, -0.01396874152123928, 0.0156514011323452, -0.04661588743329048, 0.007785636931657791, -0.047506183385849, 0.06338906288146973, 0.05961420759558678, -0.001603645272552967, 0.006249876692891121, -0.0077722822315990925, 0.0013065091334283352, -0.010443169623613358, 0.02624591998755932, 0.02934414893388748, 0.024963894858956337, -0.015784945338964462, -0.006521416828036308, -0.03767731785774231, -0.05961420759558678, 0.008164012804627419, 0.0799129530787468, 0.025604907423257828, -0.04479968547821045, -0.02149173989892006, 0.0334395095705986, -0.013799585402011871, 0.006321100052446127, -0.03313681110739708, -0.07428628206253052, 0.031017905101180077, -0.0003182807413395494, -0.090667724609375, -0.03064398095011711, 0.032851915806531906, -0.008101691491901875, 0.029433179646730423, -0.029415372759103775, 0.005911563988775015, -0.08504105359315872, 0.028970224782824516, 0.06331783533096313, 0.03764170780777931, -0.008782767690718174, -0.026388367637991905, 0.06865961104631424, 0.01769908145070076, 0.03603917360305786, -0.059080030769109726, -0.02505292370915413, 0.008537936955690384, 0.034365419298410416, -0.0077455732971429825, 0.007425067014992237, 0.07642298936843872, 0.010033633559942245, -0.0188742708414793, -0.0057913740165531635, 0.014609754085540771, -0.0032629340421408415, -0.020441191270947456, -0.02840043604373932, 0.013363339938223362, 0.04579681530594826, -0.01695123128592968, 0.022364230826497078, -0.015829458832740784, 0.05135226249694824, -0.06819666177034378, 0.011048571206629276, -0.010915027000010014, -0.07275497168302536, 0.04999901354312897, 0.02006726711988449, -0.0055376398377120495, -0.012419626116752625, 0.011101989075541496, -0.01965773105621338, -0.012535365298390388, 0.02934414893388748, 0.06816104799509048, -0.014565239660441875, 0.064813531935215, -0.03066178783774376, 0.016256801784038544, 0.05060441419482231, 0.02234642393887043, 0.034721534699201584, -0.013942032121121883, -0.02038777433335781, 0.007999307475984097, -0.030697399750351906, -0.02904144860804081, -0.006196458823978901, -0.024020180106163025, 0.046152934432029724, -0.023272331804037094, -0.020993174985051155, 0.06559699773788452, -0.025711743161082268, -0.019070135429501534, -0.0582609586417675, -0.03614601120352745, 0.06000593677163124, -0.032549213618040085, 0.015491146594285965, 0.054343655705451965, -0.05883074551820755, -0.023486003279685974, 0.0037525969091802835, 0.05224255844950676, -0.05092491954565048, -0.024002375081181526, 0.004244485404342413, -0.005047977436333895, -0.05049757659435272, 0.0809813067317009, 0.030163221061229706, 0.004099812358617783, 0.0013688297476619482, 0.00004788817750522867, -0.016452666372060776, 0.052206944674253464, 0.0324067659676075, -0.003427638905122876, 0.019497478380799294, 0.011306757107377052, 0.0012942674802616239, -0.026513008400797844, -0.033279258757829666, 0.017458701506257057, 0.0003789321635849774, -0.024002375081181526, -0.07393016666173935, -0.027688199654221535, 0.04793352633714676, -0.052385006099939346, 0.055768128484487534, 0.0015101642347872257, 0.03942229971289635, -0.011458107270300388, 0.07300425320863724, 0.018268870189785957, 0.006490256637334824, -0.017983974888920784, 0.028311407193541527, -0.012384014204144478, 0.025871995836496353, -0.08105252683162689, -0.034490060061216354, 0.020031655207276344, 0.03920862823724747, 0.008297557011246681, -0.012918191961944103, -0.003133841324597597, -0.02074389159679413, 0.007407261058688164, -0.00987338088452816, 0.005212681833654642, 0.03607478737831116, 0.005252745468169451, -0.010300722904503345, 0.013140765950083733, -0.03431199863553047, 0.01704026199877262, -0.014039964415133, -0.044407956302165985, -0.0636383444070816, 0.07870215177536011, 0.004731922410428524, -0.019034523516893387, -0.007300425786525011, -0.004133198410272598, -0.05299040675163269, -0.0038861411157995462, -0.052847959101200104, 0.000795145460870117, 0.01306954212486744, 0.011556039564311504, 0.0026775647420436144, 0.017031358554959297, 0.017627857625484467, -0.04871698468923569, 0.018179839476943016, 0.023610644042491913, -0.02019190974533558, 0.01714709773659706, -0.002799980342388153, -0.022862795740365982, 0.04458601400256157, -0.03354634717106819, -0.0464022159576416, -0.0016693046782165766, -0.02352161519229412, 0.003156098537147045, -0.03473934158682823, -0.055768128484487534, -0.047862302511930466, -0.06673657149076462, 0.08760510385036469, -0.015606885775923729, -0.0058982097543776035, 0.06534770876169205, 0.01506380457431078, 0.04077554866671562, -0.02891680784523487, -0.016924522817134857, 0.02731427550315857, 0.008395489305257797, 0.05868829786777496, -0.04287664592266083, 0.001552453264594078, -0.004723019432276487, -0.0008123948937281966, 0.007656543981283903, 0.01878524199128151, 0.0029446533881127834, 0.009054308757185936, -0.03607478737831116, 0.006454644724726677, -0.03817588463425636, -0.003703630529344082, -0.09900089353322983, -0.02783064730465412, 0.002147838706150651, 0.0019820211455225945, -0.010478781536221504, 0.026299338787794113, 0.017983974888920784, 0.042484916746616364, 0.03618162125349045, 0.009374815039336681, 0.0005049646715633571, -0.02827579528093338, -0.043766941875219345, -0.012134731747210026, 0.013149669393897057, 0.017672371119260788, -0.05409437417984009, 0.008373231627047062, 0.011609457433223724, -0.025515878573060036, -0.03960035741329193, 0.027225244790315628, -0.04415867105126381, 0.023806510493159294, -0.04483529552817345, -0.01639924943447113, 0.031676724553108215, 0.018224354833364487, -0.030519340187311172, -0.01908794231712818, 0.02352161519229412, 0.05544762313365936, 0.032976556569337845, 0.0011807548580691218, 0.04348204657435417, -0.016319122165441513, -0.002940201899036765, 0.015811653807759285, -0.059293702244758606, 0.06456425040960312, 0.005185972899198532, -0.008916312828660011, -0.014485112391412258, -0.008448907174170017, -0.0054352558217942715, -0.021562963724136353, 0.051743991672992706, -0.014663171954452991, -0.019924819469451904, -0.050889309495687485, 0.017155999317765236, -0.043197151273489, 0.014333762228488922, -0.025961026549339294, 0.04789791256189346, -0.005809179972857237, 0.08803244680166245, -0.025498071685433388, -0.00042372517054900527, 0.07214957475662231, 0.05039074271917343, 0.030234444886446, 0.03192600607872009, 0.02385992743074894, 0.018838658928871155, -0.007856860756874084, 0.022934019565582275, -0.012918191961944103, 0.009392620995640755, -0.03432980552315712, -0.041630230844020844, -0.01898110657930374, 0.0023815413005650043, 0.021883470937609673, -0.03831833228468895, 0.01425363589078188, 0.02483925223350525, -0.0421287976205349, -0.03692946955561638, -0.022186171263456345, -0.006543674040585756, 0.03721436485648155, 0.010532199405133724, 0.012864774093031883, -0.02330794371664524, -0.06021960824728012, -0.04875259846448898, -0.014547433704137802, -0.02686912752687931, -0.01607874222099781, 0.0052037788555026054, -0.029753684997558594, 0.05441487953066826, 0.018482541665434837, -0.02633495070040226, 0.03386685252189636, 0.062427543103694916, -0.019568702206015587, -0.004315708763897419, 0.03173014149069786, 0.008048273622989655, -0.06427935510873795, -0.03573647513985634, 0.027759423479437828, 0.016256801784038544, 0.013692749664187431, 0.0076209320686757565, -0.009784351103007793, -0.019800178706645966, -0.0253556240350008, -0.04330398887395859, -0.024037986993789673, -0.03281630203127861, 0.05512711778283119, 0.017663469538092613, 0.01624789834022522, 0.028347019106149673, -0.018518153578042984, -0.011493719182908535, -0.006138589698821306, 0.004638440907001495, -0.031801365315914154, -0.013354437425732613, -0.02633495070040226, 0.03529132530093193, -0.015402117744088173, 0.014244732446968555, -0.05815412104129791, -0.005987239070236683, -0.001258655684068799, 0.0003007530467584729, -0.024999506771564484, 0.02407359890639782, -0.025961026549339294, -0.026192503049969673, 0.0002935194061137736, 0.029183896258473396, 0.010069245472550392, 0.03910179063677788, 0.002951330505311489, 0.009401523508131504, 0.014209121465682983, 0.0024638937320560217, -0.06769809126853943, -0.04633099213242531, 0.018179839476943016, -0.0023971213959157467, -0.05039074271917343, -0.00869818963110447, 0.025604907423257828, -0.040633101016283035, 0.0007584207342006266, -0.026637651026248932, -0.0019631022587418556, 0.012499753385782242, -0.04479968547821045, 0.05559007078409195, 0.0016637402586638927, 0.0058982097543776035, -0.006913146935403347, 0.021010981872677803, 0.008951924741268158, -0.021669799461960793, 0.01181422546505928, 0.011645069345831871, -0.08375903218984604, -0.00531506584957242, -0.007714413106441498, -0.01154713612049818, 0.05526956170797348, 0.010701355524361134, -0.020690474659204483, -0.08026906847953796, 0.010238401591777802, 0.0024750223383307457, -0.0016514987219125032, 0.03710752725601196, 0.00993570126593113, -0.0010555569315329194, -0.03368879482150078, 0.06709269434213638, -0.009633000940084457, 0.04077554866671562, -0.0017794787418097258, 0.013674943707883358, -0.00693095289170742, -0.009143337607383728, 0.021331487223505974, 0.004342417698353529, -0.0009659709758125246, -0.04579681530594826, -0.10412899404764175, -0.0030781978275626898, 0.008809477090835571, 0.11467009782791138, -0.08917202800512314, 0.017218321561813354, -0.0015969681553542614, 0.01652389019727707, 0.046580277383327484, 0.05623108148574829, 0.009161143563687801, -0.0339914932847023, 0.007879117503762245, 0.0014044416602700949, 0.020548027008771896, 0.035344742238521576, 0.053275302052497864, 0.01203679945319891, 0.02850727178156376, 0.07214957475662231, 0.011244435794651508, -0.046259768307209015, 0.014627560041844845, -0.014102285727858543, -0.044087447226047516, -0.006303294096142054, -0.021082203835248947, -0.018375705927610397, -0.07635176926851273, -0.010656841099262238, -0.07279058545827866, 0.013950935564935207, -0.005096943583339453, -0.03190820291638374, 0.049251165241003036, 0.04910871759057045, -0.018731823191046715, -0.02578296698629856, -0.013301019556820393, -0.0037904344499111176, 0.023824315518140793, -0.004255613777786493, 0.028631912544369698, 0.027136215940117836, -0.021509546786546707, -0.009517261758446693, 0.07521218806505203, -0.04152339696884155, -0.027225244790315628, -0.015589079819619656, -0.011431397870182991, -0.006574834696948528, 0.0464378297328949, -0.011858739890158176, -0.026726679876446724, -0.06947868317365646, -0.004302354529500008, -0.0076743499375879765, 0.04519141465425491, 0.007785636931657791, -0.09957068413496017, -0.04127411171793938, 0.047506183385849, -0.011075279675424099, 0.02074389159679413, 0.02321891486644745, -0.08169354498386383, -0.02977149188518524, 0.073431596159935, 0.02190127596259117, -0.04896626994013786, 0.03910179063677788, -0.012170343659818172, -0.02085072733461857, 0.011671777814626694, -0.013585913926362991, -0.014155703596770763, -0.08610940724611282, 0.022203978151082993, -0.04380255192518234, 0.03942229971289635, -0.000773444480728358, -0.05879513546824455, 0.021420517936348915, -0.04088238254189491, 0.009463844820857048, -0.062000200152397156, -0.03429419547319412, 0.006913146935403347, 0.03984963893890381, 0.009962409734725952, 0.042021963745355606, -0.00661489786580205, -0.010184983722865582, 0.02829360030591488, -0.046473439782857895, -0.00998911913484335, -0.003472153563052416, -0.0005920467083342373, -0.0007534128380939364, 0.0014244732446968555, -0.0029624593444168568, 0.0017928332090377808, -0.03878128528594971, 0.10199228674173355, 0.002877881284803152, 0.037499260157346725, -0.07628054171800613, 0.06406568735837936, 0.013220892287790775, 0.004406964406371117, 0.05975665524601936, -0.046259768307209015, 0.03119596466422081, -0.018117519095540047, 0.014796716161072254, 0.0022079336922615767, 0.03075081668794155, -0.028685331344604492, 0.01472549233585596, -0.014235829934477806, 0.041808292269706726, -0.06014838442206383, 0.0036101494915783405, 0.01793055795133114, 0.017155999317765236, -0.0038750125095248222, -0.07182906568050385, 0.04148778319358826, 0.021847859025001526, -0.011021861806511879, -0.0034699279349297285, -0.052847959101200104, 0.01290038600564003, -0.019123554229736328, 0.0024104758631438017, -0.03582550212740898, -0.02019190974533558, 0.028560688719153404 ]
31,970
pingouin.utils
_perm_pval
Compute p-values from a permutation test. Parameters ---------- bootstat : 1D array Permutation distribution. estimate : float or int Point estimate. alternative : str Tail for p-value. Can be either `'two-sided'` (default), `'greater'` or `'less'`. Returns ------- p : float P-value.
def _perm_pval(bootstat, estimate, alternative="two-sided"): """ Compute p-values from a permutation test. Parameters ---------- bootstat : 1D array Permutation distribution. estimate : float or int Point estimate. alternative : str Tail for p-value. Can be either `'two-sided'` (default), `'greater'` or `'less'`. Returns ------- p : float P-value. """ assert alternative in ["two-sided", "greater", "less"], "Wrong tail argument." assert isinstance(estimate, (int, float)) bootstat = np.asarray(bootstat) assert bootstat.ndim == 1, "bootstat must be a 1D array." n_boot = bootstat.size assert n_boot >= 1, "bootstat must have at least one value." if alternative == "greater": p = np.greater_equal(bootstat, estimate).sum() / n_boot elif alternative == "less": p = np.less_equal(bootstat, estimate).sum() / n_boot else: p = np.greater_equal(np.fabs(bootstat), abs(estimate)).sum() / n_boot return p
(bootstat, estimate, alternative='two-sided')
[ 0.08246979117393494, 0.0027026860043406487, 0.001735431607812643, 0.038049664348363876, 0.08260827511548996, -0.020375091582536697, 0.027178330346941948, -0.0252394936978817, 0.010100990533828735, 0.03860361501574516, 0.023404523730278015, 0.020825179293751717, 0.0004673980292864144, 0.01162436231970787, -0.07783042639493942, 0.014117151498794556, 0.04971730336546898, -0.002481970237568021, 0.0019474917789921165, 0.10019629448652267, 0.005115411709994078, 0.05335262045264244, -0.007058575749397278, 0.03268324211239815, -0.03131566941738129, -0.008361231535673141, 0.07173694670200348, -0.045147188007831573, 0.014671104960143566, 0.027818838134407997, -0.006959037389606237, 0.011009820736944675, -0.0184535663574934, 0.034535523504018784, 0.009296027943491936, 0.031748443841934204, 0.015519346110522747, 0.04310448467731476, -0.10532035678625107, -0.017847681418061256, 0.011546462774276733, -0.04241204261779785, -0.004795157816261053, -0.01954416185617447, -0.025395292788743973, 0.025793448090553284, 0.02032315917313099, 0.004065930377691984, -0.02297174744307995, 0.0075000072829425335, 0.009131573140621185, 0.018245834857225418, 0.011485873721539974, -0.01628103107213974, -0.0356261171400547, 0.06315066665410995, 0.03481249883770943, -0.006266595795750618, -0.0049379738047719, 0.005643398500978947, 0.032717861235141754, -0.0016845804639160633, 0.003328047227114439, -0.023023681715130806, 0.0229890588670969, -0.027299508452415466, -0.03515871986746788, -0.00391662260517478, -0.02407965436577797, 0.03988463431596756, -0.0061670574359595776, -0.009079639799892902, -0.06058863550424576, 0.014723038300871849, 0.0012204282684251666, 0.0505136102437973, 0.04435088112950325, -0.03159264475107193, 0.018211212009191513, 0.004394839983433485, -0.014982704073190689, -0.02148299850523472, 0.08600123971700668, -0.02783614955842495, 0.02079055644571781, -0.002434364752843976, 0.019838450476527214, -0.04376230388879776, 0.052348580211400986, 0.06914028525352478, -0.0074350908398628235, 0.02466822974383831, 0.10109646618366241, -0.0006810811464674771, 0.029186410829424858, 0.006439706310629845, 0.009668215177953243, 0.05601852014660835, -0.006634455639868975, -0.0055005825124681, 0.012541847303509712, 0.08150036633014679, 0.040888674557209015, -0.03309870511293411, 0.060311656445264816, 0.0005290686385706067, -0.006902776658535004, 0.022642837837338448, 0.012515881098806858, 0.0016185820568352938, -0.034916363656520844, 0.017458181828260422, -0.00431261258199811, -0.012827479280531406, -0.029082544147968292, 0.048713263124227524, -0.01557127945125103, -0.034725941717624664, 0.006794582586735487, 0.02304099313914776, -0.0020654231775552034, 0.07589159160852432, -0.005617431830614805, 0.01686960645020008, -0.042827509343624115, -0.03964227810502052, 0.05054823309183121, -0.0025490503758192062, -0.06505488604307175, 0.05729953572154045, 0.04341608285903931, 0.01637624204158783, -0.014645138755440712, 0.0028108798433095217, -0.027680350467562675, -0.05037512257695198, 0.014930770732462406, 0.0003570401750039309, 0.05193311721086502, -0.00506780669093132, 0.04455861449241638, 0.014264295808970928, -0.01281882356852293, 0.02272939309477806, 0.055914655327796936, -0.04175422340631485, 0.01236008107662201, 0.04750148952007294, 0.05009814724326134, 0.014212362468242645, -0.0036721040960401297, -0.0297749862074852, 0.024564363062381744, -0.020894423127174377, 0.048401664942502975, -0.016809018328785896, 0.07139072567224503, -0.018730543553829193, -0.03515871986746788, -0.07305258512496948, -0.0033150638919323683, -0.039019081741571426, 0.0019074600422754884, 0.06000005826354027, 0.013848830945789814, 0.009261406026780605, 0.0043558902107179165, 0.0333237498998642, 0.0011749867117032409, -0.027368752285838127, 0.031229114159941673, -0.029376832768321037, -0.01588287763297558, -0.035522252321243286, 0.017847681418061256, 0.01466244924813509, 0.04223893582820892, -0.02946338802576065, 0.021517621353268623, -0.025724202394485474, -0.0010981690138578415, -0.013407398946583271, 0.017458181828260422, -0.0333583727478981, 0.013770931400358677, 0.019267186522483826, 0.013485299423336983, 0.023802677169442177, -0.052417825907468796, -0.006106468848884106, -0.1223544180393219, -0.007993372157216072, 0.04390079528093338, 0.037011001259088516, 0.005509238224476576, 0.020496269688010216, -0.028597835451364517, 0.01214369386434555, -0.005362094379961491, -0.02726488560438156, -0.005128395278006792, -0.06321991235017776, 0.004886040464043617, -0.008871907368302345, 0.0262262225151062, 0.010239479131996632, -0.036283936351537704, -0.000931550282984972, 0.036422424018383026, -0.03223315253853798, -0.0039577363058924675, -0.03522796183824539, 0.04718989133834839, 0.002546886447817087, -0.01725045032799244, -0.017518771812319756, 0.07457595318555832, -0.040438584983348846, 0.009373927488923073, -0.012091760523617268, 0.0355914942920208, -0.05511834844946861, 0.0867629274725914, 0.07208316773176193, 0.054737504571676254, -0.006863826885819435, -0.024962518364191055, -0.011892683804035187, -0.01055973395705223, 0.05605314299464226, -0.0013913747388869524, -0.023075614124536514, 0.03140222281217575, -0.04106178507208824, 0.012983279302716255, -0.054737504571676254, -0.03943454474210739, -0.02440856397151947, -0.004868729505687952, 0.049682680517435074, -0.01547606848180294, 0.036422424018383026, 0.020669380202889442, 0.05477212741971016, -0.038811348378658295, 0.016410864889621735, 0.025135627016425133, -0.04168498143553734, 0.010551078245043755, -0.021915774792432785, 0.008019338361918926, -0.010100990533828735, 0.0013957024784758687, -0.015337579883635044, 0.052867911756038666, 0.032856352627277374, 0.026174290105700493, 0.07748420536518097, 0.02402772195637226, 0.036353182047605515, 0.01621178723871708, -0.0751299038529396, -0.022902503609657288, -0.04113102704286575, -0.017285071313381195, -0.01890365406870842, 0.02421814203262329, 0.017475493252277374, 0.010620322078466415, 0.02226199582219124, -0.007880850695073605, 0.005457304883748293, -0.005942014046013355, -0.013424710370600224, -0.003838722826912999, 0.034275855869054794, 0.04376230388879776, 0.052140846848487854, 0.04009236395359039, 0.0018122493056580424, 0.027559174224734306, -0.034085433930158615, -0.012576469220221043, 0.06384310871362686, -0.005833819974213839, 0.04061169549822807, -0.014117151498794556, -0.0030315956100821495, 0.05664171651005745, 0.023473767563700676, -0.014619171619415283, -0.01087133213877678, -0.009105606004595757, -0.024754785001277924, 0.0020199818536639214, 0.031748443841934204, 0.027940016239881516, -0.0498557910323143, 0.017285071313381195, -0.007733706384897232, 0.032665930688381195, -0.05560305714607239, -0.017094651237130165, 0.023075614124536514, -0.007309585809707642, 0.08336996287107468, 0.04947494715452194, -0.05491061508655548, -0.010654943995177746, 0.008149171248078346, 0.015978088602423668, 0.022452417761087418, 0.026589754968881607, 0.04954419285058975, 0.016930196434259415, -0.052660178393125534, 0.01864398829638958, -0.02861514687538147, 0.006682060658931732, -0.017215827479958534, -0.00948644895106554, 0.036941755563020706, 0.07159845530986786, 0.03759957477450371, 0.024754785001277924, 0.020807867869734764, -0.006491639651358128, 0.004989906679838896, 0.01551069039851427, 0.04248128831386566, -0.09694181382656097, 0.011226208880543709, 0.02129257656633854, 0.056364741176366806, 0.014766315929591656, 0.1249164566397667, 0.006045880261808634, -0.008547325618565083, -0.00022017477022018284, -0.0018014298984780908, 0.001445471658371389, -0.08773234486579895, -0.05151765048503876, 0.029428765177726746, 0.055395323783159256, 0.029809609055519104, -0.008482408709824085, 0.06321991235017776, 0.017458181828260422, 0.023214101791381836, 0.009408549405634403, -0.009088295511901379, -0.02278132736682892, 0.03832663968205452, 0.0433814637362957, 0.008465098217129707, 0.0020048345904797316, 0.025429915636777878, 0.0017375955358147621, 0.038880594074726105, 0.04362381622195244, -0.026901353150606155, 0.029359521344304085, -0.0407848060131073, 0.0062189907766878605, -0.022123508155345917, -0.05546456575393677, 0.01757935993373394, -0.0051630171947181225, 0.010230823419988155, 0.05342186614871025, -0.0790075808763504, -0.009477793239057064, -0.03718411177396774, 0.044697102159261703, -0.0004828156961593777, -0.07672252506017685, 0.015450102277100086, 0.0043558902107179165, -0.03399888053536415, -0.014402784407138824, -0.02174266427755356, 0.01755339279770851, 0.052210092544555664, -0.04189271479845047, 0.019371051341295242, -0.006508950609713793, -0.04064631834626198, 0.0074437465518713, 0.0031268063466995955, -0.06013854965567589, 0.026849420741200447, -0.009469138458371162, -0.03252744302153587, 0.052210092544555664, 0.0012539683375507593, 0.019146008417010307, -0.0401269868016243, -0.034466277807950974, -0.02615697868168354, 0.018211212009191513, -0.01614254340529442, -0.05601852014660835, -0.03316795080900192, -0.0010154006304219365, -0.06879406422376633, 0.008521358482539654, 0.010092335753142834, -0.029567254707217216, 0.015562623739242554, -0.010438555851578712, 0.037772685289382935, 0.04068094119429588, -0.05446052551269531, 0.0014995686942711473, 0.05207160487771034, -0.08330071717500687, 0.016055988147854805, 0.005976635962724686, -0.07783042639493942, 0.06855171173810959, -0.06914028525352478, -0.023387212306261063, -0.00928737223148346, 0.007677445653825998, -0.025533782318234444, -0.008300643414258957, -0.0016358931316062808, -0.02648588828742504, 0.051379162818193436, 0.0014508813619613647, -0.018678611144423485, -0.008443458937108517, 0.023941166698932648, 0.039330679923295975, 0.01171957328915596, -0.015268336050212383, 0.057334158569574356, -0.025204872712492943, -0.033964257687330246, 0.014523961581289768, 0.03465669974684715, 0.029809609055519104, 0.05684944987297058, 0.019059453159570694, 0.01833239011466503, -0.01560590136796236, -0.06633590161800385, -0.07976926863193512, -0.06401622295379639, -0.00757357943803072, -0.051240675151348114, 0.08253902941942215, -0.003070545382797718, -0.02129257656633854, -0.01781305857002735, -0.040438584983348846, -0.021725352853536606, -0.03995387628674507, 0.06304680556058884, 0.03074440360069275, -0.010879987850785255, 0.004461920354515314, -0.00718408077955246, -0.019024832174181938, -0.03347954899072647, 0.04102716222405434, -0.008218415081501007, 0.01017023529857397, 0.038949836045503616, 0.008607913739979267, -0.016852296888828278, -0.016358930617570877, 0.016393553465604782, -0.04905948415398598, 0.02304099313914776, -0.028892124071717262, 0.01274957973510027, -0.013537231832742691, 0.02861514687538147, -0.07561461627483368, 0.006266595795750618, 0.06415470689535141, 0.04216969013214111, -0.015173125080764294, -0.10054250806570053, -0.06498564034700394, 0.027922704815864563, 0.014238329604268074, -0.04604736343026161, 0.013485299423336983, -0.0127842016518116, 0.06765154004096985, 0.035833850502967834, -0.09105606377124786, -0.01774381473660469, 0.05452977120876312, -0.018297767266631126, 0.035764604806900024, -0.06785926967859268, 0.009720148518681526, 0.019994249567389488, 0.028632458299398422, -0.0692441537976265, 0.02518756128847599, -0.0440046600997448, 0.003535779658704996, 0.021656109020113945, -0.014671104960143566, 0.04300061985850334, 0.02053089253604412, -0.013459332287311554, -0.03683789074420929, -0.006759960670024157, 0.02577613666653633, 0.04563189670443535, 0.07014432549476624, -0.013848830945789814, 0.015242369845509529, -0.04881712794303894, 0.016644563525915146, -0.025533782318234444, -0.005318816751241684, 0.007560595870018005, 0.022504350170493126, -0.0275245513767004, -0.04407390579581261, -0.04653207212686539, -0.02001156099140644, 0.008114549331367016, -0.01596943289041519, -0.008837285451591015, 0.01107040885835886, -0.011182931251823902, 0.014515305869281292, 0.006465672980993986, -0.04296599701046944, -0.038430504500865936, 0.025343360379338264, 0.023404523730278015, 0.00480814091861248, -0.04435088112950325, 0.04732837900519371, -0.04836704209446907, 0.06633590161800385, -0.004591752775013447, -0.056814827024936676, 0.0003786789602600038, 0.01168495137244463, -0.01573573425412178, 0.036803267896175385, -0.017285071313381195, -0.007828917354345322, 0.013537231832742691, -0.01781305857002735, 0.014411439187824726, -0.027178330346941948, 0.0015493379905819893, -0.010836710222065449, -0.030138518661260605, -0.06688985228538513, -0.05297177657485008, 0.04376230388879776, -0.016263721510767937, 0.015432790853083134, -0.050929076969623566, -0.08240054547786713, 0.0015666489489376545, -0.0275245513767004, -0.04701678082346916, 0.053837329149246216, 0.052660178393125534, -0.029705742374062538, -0.02336990274488926, 0.023214101791381836, -0.0491979718208313, 0.0595499724149704, 0.0006908186478540301, 0.013416054658591747, 0.04390079528093338, -0.044697102159261703, 0.002590164076536894, -0.003139789681881666, -0.008504047989845276, -0.08302374184131622, 0.04552803188562393, 0.025464538484811783, 0.003038087161257863, -0.03593771532177925, -0.026624377816915512, -0.0757531076669693, 0.005167345050722361, -0.00823572650551796, -0.0440046600997448, 0.0036483013536781073, -0.035453006625175476, -0.011433941312134266, 0.010525111109018326, 0.03055398352444172, -0.036041583865880966, -0.03967690095305443, -0.004197926726192236, 0.015285647474229336, -0.027818838134407997, 0.06398160010576248, -0.05937686190009117, -0.01916331984102726, -0.027230262756347656, 0.021534932777285576, 0.03152340278029442, 0.018436256796121597, 0.011996549554169178, -0.029948096722364426, -0.03863823786377907, 0.019197940826416016, 0.014143118634819984, -0.027161018922924995, -0.03225046396255493, 0.026832109317183495, 0.03386039286851883, -0.07139072567224503, 0.06328915804624557, 0.02240048348903656, 0.03481249883770943, -0.03919219225645065, -0.04047320783138275, 0.02169073186814785, -0.05127529427409172, 0.015458757057785988, -0.0751299038529396, -0.007538957055658102, 0.03534914180636406, 0.06197351962327957, -0.014688416384160519, -0.030138518661260605, -0.03867286071181297, 0.012074449099600315, -0.07886908948421478, 0.017094651237130165, -0.02388923242688179, 0.0010803169570863247, -0.026451267302036285, 0.0007524891989305615, -0.030155828222632408, 0.060830987989902496, 0.008720435202121735, -0.022036952897906303, 0.037841930985450745, 0.014394128695130348, -0.02433932013809681, 0.006474328227341175, 0.02407965436577797, -0.010066368617117405, -0.023214101791381836, -0.024616297334432602, -0.05594927817583084, 0.07180618494749069, 0.054875992238521576, -0.03794579580426216, 0.008274676278233528, -0.0160213652998209, 0.002434364752843976, -0.030225073918700218, -0.013701686635613441, 0.048920996487140656, 0.06969424337148666, -0.027489928528666496, 0.07007508724927902, -0.04954419285058975, -0.022435106337070465, 0.037911172956228256, 0.05712642893195152, -0.002689702669158578, -0.059272997081279755, 0.0356261171400547, 0.000546109164133668, -0.05560305714607239, 0.0010213513160124421, -0.02472016215324402, 0.006444034166634083, 0.04899023845791817, -0.022902503609657288, 0.008720435202121735, 0.01757935993373394, -0.0004798403533641249, 0.03386039286851883, 0.017882302403450012, 0.006764288526028395, -0.07783042639493942, -0.031886931508779526, -0.03036356158554554, -0.10255058854818344, 0.01580497808754444, -0.028338169679045677, -0.03891521319746971, 0.000232887570746243, -0.016012711450457573, 0.04255053400993347, 0.007335552480071783, -0.045354921370744705, -0.03328912705183029, -0.03235433250665665, -0.02726488560438156, -0.02349107898771763, -0.06204276159405708, 0.016601286828517914, -0.03572998195886612, 0.00724899722263217, 0.029636498540639877, -0.03891521319746971, -0.040300097316503525, 0.02842472493648529, -0.005825164262205362, -0.09472600370645523, 0.006266595795750618, 0.08475484699010849, -0.014402784407138824, -0.017726503312587738, 0.024373942986130714, -0.024772096425294876, -0.03964227810502052, -0.005946341902017593, 0.024252764880657196, -0.0033020805567502975, -0.03669940307736397, -0.0382227748632431, 0.015242369845509529, -0.03193886578083038, -0.02051358111202717, 0.0026507526636123657, -0.05529145523905754, -0.008586275391280651, -0.016999440267682076, -0.04303524270653725, -0.01064628828316927, 0.013442021794617176, 0.0414426252245903, 0.008711780421435833, 0.016004055738449097, 0.006573867052793503, 0.02111946791410446, 0.03811890631914139, -0.018938276916742325, -0.06003468111157417, 0.018557433038949966, 0.027334129437804222, -0.04296599701046944, -0.043277595192193985, 0.029186410829424858, -0.04452399164438248, 0.02608773484826088, -0.022867882624268532, -0.015000014565885067, 0.049890413880348206, 0.0304328054189682, -0.019474918022751808, 0.04410852491855621, -0.02965380810201168, -0.04120027273893356, -0.02381998859345913, -0.06415470689535141, 0.017830369994044304, -0.008958462625741959, -0.003055398352444172, -0.011416629888117313, -0.0027784216217696667, -0.04646282643079758, -0.0035227963235229254 ]
31,971
pingouin.utils
_postprocess_dataframe
Apply some post-processing to an ouput dataframe (e.g. rounding). Whether and how rounding is applied is governed by options specified in `pingouin.options`. The default rounding (number of decimals) is determined by `pingouin.options['round']`. You can specify rounding for a given column name by the option `'round.column.<colname>'`, e.g. `'round.column.CI95%'`. Analogously, `'round.row.<rowname>'` also works (where `rowname`) refers to the pandas index), as well as `'round.cell.[<rolname>]x[<colname]'`. A cell-based option is used, if available; if not, a column-based option is used, if available; if not, a row-based option is used, if available; if not, the default is used. (Default `pingouin.options['round'] = None`, i.e. no rounding is applied.) If a round option is `callable` instead of `int`, then it will be called, and the return value stored in the cell. Post-processing is applied on a copy of the DataFrame, leaving the original DataFrame untouched. This is an internal function (no public API). Parameters ---------- df : :py:class:`pandas.DataFrame` Dataframe to apply post-processing to (e.g. ANOVA summary) Returns ---------- df : :py:class:`pandas.DataFrame` Dataframe with post-processing applied
def _postprocess_dataframe(df): """Apply some post-processing to an ouput dataframe (e.g. rounding). Whether and how rounding is applied is governed by options specified in `pingouin.options`. The default rounding (number of decimals) is determined by `pingouin.options['round']`. You can specify rounding for a given column name by the option `'round.column.<colname>'`, e.g. `'round.column.CI95%'`. Analogously, `'round.row.<rowname>'` also works (where `rowname`) refers to the pandas index), as well as `'round.cell.[<rolname>]x[<colname]'`. A cell-based option is used, if available; if not, a column-based option is used, if available; if not, a row-based option is used, if available; if not, the default is used. (Default `pingouin.options['round'] = None`, i.e. no rounding is applied.) If a round option is `callable` instead of `int`, then it will be called, and the return value stored in the cell. Post-processing is applied on a copy of the DataFrame, leaving the original DataFrame untouched. This is an internal function (no public API). Parameters ---------- df : :py:class:`pandas.DataFrame` Dataframe to apply post-processing to (e.g. ANOVA summary) Returns ---------- df : :py:class:`pandas.DataFrame` Dataframe with post-processing applied """ df = df.copy() for row, col in it.product(df.index, df.columns): round_option = _get_round_setting_for(row, col) if round_option is None: continue if callable(round_option): newval = round_option(df.at[row, col]) # ensure that dtype changes are processed df[col] = df[col].astype(type(newval)) df.at[row, col] = newval continue if isinstance(df.at[row, col], bool): # No rounding if value is a boolean continue is_number = isinstance(df.at[row, col], numbers.Number) is_array = isinstance(df.at[row, col], np.ndarray) if not any([is_number, is_array]): # No rounding if value is not a Number or an array continue if is_array: is_float_array = issubclass(df.at[row, col].dtype.type, np.floating) if not is_float_array: # No rounding if value is not a float array continue df.at[row, col] = np.round(df.at[row, col], decimals=round_option) return df
(df)
[ -0.002122879261150956, -0.03825632482767105, 0.0467618927359581, 0.029638346284627914, -0.03593321517109871, -0.0499093271791935, -0.014762968756258488, 0.00865076296031475, 0.023699436336755753, -0.040354613214731216, -0.007250341586768627, -0.013582681305706501, -0.02013983763754368, 0.012936332263052464, -0.037001095712184906, 0.041815921664237976, -0.010538286529481411, 0.04230302572250366, 0.06463482975959778, -0.015081459656357765, -0.0033675681333988905, -0.03323541581630707, -0.027090422809123993, -0.01340470090508461, -0.001902746269479394, 0.001902746269479394, -0.014257131144404411, -0.03274831175804138, 0.031155860051512718, 0.008941151201725006, 0.07006789743900299, -0.02122645080089569, -0.023174863308668137, -0.012477331794798374, 0.024392621591687202, -0.07321533560752869, -0.025704052299261093, 0.0114375539124012, -0.0044143712148070335, 0.013976110145449638, -0.04301494359970093, -0.02731524035334587, 0.002906225388869643, -0.003386302851140499, -0.04102906212210655, 0.036382850259542465, -0.04372686520218849, 0.03801277279853821, 0.0467618927359581, -0.025647848844528198, -0.029263650998473167, -0.0030045825988054276, 0.030556349083781242, 0.0627613514661789, -0.02265029214322567, 0.011212737299501896, -0.03746946528553963, 0.007554780691862106, -0.005241041537374258, -0.04904752969741821, 0.027596261352300644, 0.019278040155768394, -0.003817201592028141, -0.02210698463022709, 0.044438786804676056, -0.01694556511938572, 0.006524370517581701, 0.02115151286125183, 0.005849920213222504, -0.030069245025515556, -0.03439696878194809, -0.003590043168514967, 0.033647578209638596, 0.04226555675268173, -0.055754564702510834, 0.013489007018506527, -0.023081190884113312, 0.021076573058962822, 0.013385966420173645, 0.03147435188293457, 0.020514531061053276, 0.021507471799850464, 0.007077045273035765, 0.011503125540912151, -0.013264190405607224, -0.05069618672132492, 0.031024716794490814, 0.06808201968669891, 0.0380689762532711, 0.00964838732033968, 0.05110834911465645, -0.0339660681784153, 0.026378503069281578, -0.0027001432608813047, -0.009400151669979095, 0.007803015876561403, -0.03344149887561798, 0.035183828324079514, -0.02311865985393524, -0.0616372674703598, -0.018706630915403366, 0.05901440605521202, 0.03756313771009445, -0.02804589457809925, 0.03675754368305206, -0.024017926305532455, 0.04908499866724014, -0.015784012153744698, -0.0042199986055493355, 0.010304102674126625, -0.045900095254182816, -0.05388109013438225, -0.07107957452535629, -0.06707034260034561, 0.021432533860206604, -0.05103341117501259, -0.06017595902085304, 0.013170517049729824, -0.023905517533421516, 0.044776011258363724, -0.0025643163826316595, 0.019708938896656036, 0.04724899306893349, -0.009564081206917763, -0.0820581242442131, -0.01725468784570694, 0.039305467158555984, 0.006622727960348129, -0.022013310343027115, 0.01809775084257126, 0.027165362611413002, 0.010350939817726612, 0.005451807286590338, 0.0185286495834589, -0.012880128808319569, 0.012627209536731243, 0.025048337876796722, 0.03632664680480957, 0.035071417689323425, 0.009123814292252064, 0.04792344570159912, -0.022088250145316124, -0.002550265518948436, -0.04942222312092781, 0.07051753252744675, 0.03246729075908661, -0.004027967341244221, 0.05616672709584236, -0.05920175462961197, -0.01587768644094467, 0.015784012153744698, 0.03490280732512474, 0.054180845618247986, -0.019933754578232765, 0.07662505656480789, -0.04087918624281883, 0.044588662683963776, -0.029956836253404617, -0.04256531223654747, -0.017076708376407623, -0.009751427918672562, -0.001191411865875125, 0.009147233329713345, -0.006196512840688229, -0.049159936606884, 0.022519148886203766, -0.005737511906772852, -0.06770732253789902, 0.027521321550011635, -0.0063463905826210976, 0.02589140087366104, 0.02969455160200596, -0.016111869364976883, 0.052757006138563156, -0.013104945421218872, 0.09404835850000381, -0.0070395758375525475, 0.00025657800142653286, -0.03765681013464928, -0.031605493277311325, 0.01034157257527113, 0.004442473407834768, -0.03186777979135513, 0.006889697629958391, -0.05328157916665077, 0.03874342516064644, -0.007404902949929237, -0.08295739442110062, -0.05103341117501259, -0.004318355582654476, 0.033104270696640015, 0.0008424774860031903, 0.02665952406823635, -0.022125719115138054, 0.02907630428671837, -0.0360456258058548, -0.01809775084257126, 0.003646247321739793, 0.03531496971845627, 0.011278308928012848, -0.005226990208029747, -0.044663600623607635, 0.043202292174100876, 0.014079151675105095, -0.03278578072786331, -0.055754564702510834, -0.03186777979135513, 0.013442170806229115, -0.03960522264242172, -0.01107222680002451, 0.022406740114092827, -0.028289446607232094, 0.012449230067431927, 0.049159936606884, -0.0005272070993669331, 0.03810644522309303, 0.048710305243730545, -0.0063463905826210976, -0.00992004107683897, 0.02079555206000805, -0.02546050027012825, -0.0065431054681539536, -0.05901440605521202, 0.010210429318249226, 0.04818573221564293, -0.006252716761082411, -0.007325280457735062, 0.032373618334531784, 0.10708773136138916, -0.05789032205939293, -0.02210698463022709, -0.039342936128377914, -0.06710781157016754, 0.000021094869225635193, 0.046012502163648605, -0.04766115918755531, -0.021938372403383255, -0.023905517533421516, -0.01032283715903759, 0.00028702194686047733, -0.011006655171513557, -0.021825963631272316, -0.011044125072658062, -0.006524370517581701, -0.03177410736680031, -0.04683683067560196, -0.0040045492351055145, 0.019971225410699844, 0.05762803554534912, 0.004332406911998987, 0.030612552538514137, -0.03213006630539894, 0.005681307520717382, 0.018884610384702682, -0.003805492538958788, 0.002545581664890051, -0.027446383610367775, 0.09262451529502869, 0.007564147934317589, 0.01929677464067936, 0.02338094636797905, -0.05039643123745918, 0.05249471962451935, -0.024392621591687202, -0.03035026602447033, 0.0021989892702549696, -0.04541299119591713, -0.022406740114092827, 0.03745073080062866, 0.018650425598025322, -0.003964737523347139, -0.021245187148451805, -0.048148263245821, 0.019671468064188957, 0.01652403362095356, 0.07295304536819458, -0.011690473183989525, 0.013142414391040802, 0.0042387330904603004, -0.02141379937529564, 0.07276570051908493, -0.02589140087366104, 0.013048741035163403, -0.03100598230957985, -0.03866848722100258, 0.007479841820895672, -0.026547115296125412, 0.06006355211138725, 0.04511323571205139, -0.008870895951986313, -0.04117894172668457, -0.009610917419195175, 0.00820581242442131, 0.03267337381839752, -0.02145126834511757, 0.01276772003620863, -0.0408417172729969, -0.06879393756389618, -0.0036368798464536667, -0.021076573058962822, -0.07006789743900299, -0.011830983683466911, 0.04001738876104355, 0.08235788345336914, 0.02523568458855152, 0.06647083163261414, 0.025254419073462486, -0.03016291931271553, -0.009835734032094479, -0.043576985597610474, 0.013517109677195549, -0.002906225388869643, 0.014069783501327038, -0.036963626742362976, 0.004306646529585123, -0.07572578638792038, 0.0006879159482195973, 0.0025643163826316595, 0.029600877314805984, -0.009564081206917763, -0.09292427450418472, 0.00029975571669638157, 0.022444209083914757, -0.011877819895744324, 0.05893946811556816, 0.05908934399485588, 0.00907229445874691, 0.021751023828983307, -0.03450937569141388, 0.001478872960433364, -0.021432533860206604, 0.007456423249095678, 0.032879456877708435, 0.04515070468187332, 0.014491314999759197, -0.05905187502503395, -0.008983303792774677, 0.0035502316895872355, -0.036888688802719116, 0.004423738457262516, -0.012533536180853844, 0.06935597956180573, 0.03389113023877144, -0.03126826882362366, 0.00193553208373487, 0.019652733579277992, -0.026097482070326805, 0.018959548324346542, 0.0037750485353171825, 0.030949776992201805, 0.009442305192351341, -0.007240973878651857, -0.02827071025967598, 0.03675754368305206, 0.019390447065234184, -0.016036931425333023, 0.03542738035321236, -0.02418653853237629, 0.018266363069415092, -0.039155591279268265, 0.04983438923954964, -0.02133885957300663, 0.0422280877828598, -0.00529724545776844, 0.08640458434820175, 0.03355390578508377, -0.06991802155971527, 0.02013983763754368, -0.03272957727313042, 0.020214775577187538, -0.013376599177718163, -0.023755639791488647, 0.027165362611413002, -0.05661636218428612, 0.019540326669812202, 0.02523568458855152, -0.043539516627788544, -0.0014484289567917585, -0.019652733579277992, 0.03317921236157417, 0.036345381289720535, -0.026415972039103508, -0.010482083074748516, 0.028514262288808823, 0.04945969209074974, -0.04230302572250366, -0.004086513537913561, 0.0007125053089112043, -0.013489007018506527, -0.0723535344004631, -0.09959384053945541, 0.01860358938574791, -0.02491719461977482, 0.008135557174682617, -0.017788628116250038, 0.002029205672442913, -0.02141379937529564, 0.03227994218468666, -0.03589574620127678, -0.008969252929091454, -0.018978284671902657, -0.031212063506245613, 0.02761499583721161, -0.012196310795843601, -0.050059203058481216, -0.007662505377084017, 0.006739819888025522, -0.008060618303716183, 0.03477166220545769, -0.018275732174515724, -0.0081449244171381, 0.025216950103640556, 0.02819577232003212, 0.022256862372159958, 0.016261747106909752, 0.05073365569114685, 0.07179149240255356, -0.0023476961068809032, 0.0010930545395240188, -0.020589470863342285, 0.05594190955162048, 0.0010907127289101481, -0.043502047657966614, 0.0620119646191597, 0.026453442871570587, -0.06677058339118958, 0.02180722914636135, -0.01484727580100298, -0.05324411019682884, 0.0768873393535614, -0.014753601513803005, -0.04897259175777435, -0.08977683633565903, 0.07681240141391754, 0.07482652366161346, 0.02487972378730774, 0.015015888027846813, -0.003498711157590151, -0.012261882424354553, 0.04908499866724014, 0.009119130671024323, 0.02688434161245823, -0.01170920766890049, -0.046162381768226624, 0.01303937379270792, -0.014107253402471542, 0.013329762034118176, -0.06092534959316254, -0.0443638451397419, -0.04237796366214752, 0.05890199914574623, -0.026415972039103508, 0.03900571167469025, 0.0042832279577851295, -0.0966712161898613, -0.0010011373087763786, -0.04147869721055031, -0.01138134952634573, -0.0016896387096494436, 0.06545915454626083, 0.009184702299535275, 0.0017680904129520059, -0.06092534959316254, 0.02662205509841442, -0.02487972378730774, 0.062311720103025436, -0.0054330723360180855, -0.030331531539559364, -0.05253218859434128, 0.01170920766890049, 0.05882706120610237, -0.06362315267324448, -0.01867852732539177, -0.026247359812259674, 0.021320125088095665, 0.04372686520218849, -0.06568396836519241, -0.0064447480253875256, -0.06455988436937332, 0.021076573058962822, -0.047511279582977295, -0.0259663388133049, 0.013873069547116756, 0.027633730322122574, 0.022238127887248993, 0.0005977550754323602, 0.02823324128985405, 0.008032516576349735, 0.037919096648693085, -0.05339398607611656, 0.02429894730448723, 0.04245290160179138, 0.04102906212210655, 0.02499213255941868, -0.008538354188203812, 0.0412164106965065, 0.01702050492167473, -0.009348631836473942, 0.030912308022379875, -0.07126691937446594, 0.03851861134171486, 0.014013580046594143, -0.03308553621172905, -0.0025736838579177856, 0.045862626284360886, -0.032991863787174225, -0.014200926758348942, 0.07718709856271744, -0.04807332158088684, -0.01446321327239275, -0.04290253669023514, -0.025591643527150154, -0.0004923722008243203, 0.0011328657856211066, 0.0315118208527565, 0.022313065826892853, -0.002660332014784217, -0.036888688802719116, -0.020008694380521774, -0.031605493277311325, 0.014669295400381088, -0.06283628940582275, 0.0017200825968757272, 0.004945969209074974, 0.002049111295491457, 0.0915004312992096, 0.07051753252744675, 0.07861093431711197, 0.03949281573295593, -0.0471365861594677, -0.024898460134863853, 0.013554578647017479, 0.053056761622428894, 0.027146626263856888, 0.04080424830317497, 0.006327655632048845, 0.0029436948243528605, -0.0415911041200161, 0.050096675753593445, 0.017694953829050064, -0.03177410736680031, 0.020926695317029953, -0.005620419513434172, -0.058265019208192825, -0.009273692034184933, -0.03859354928135872, 0.018472446128726006, 0.005746879149228334, 0.028532996773719788, -0.0367388091981411, 0.007892006076872349, 0.001018701121211052, 0.07490146160125732, 0.06759491562843323, 0.035577256232500076, 0.05219496414065361, -0.007854536175727844, 0.056991055607795715, 0.026453442871570587, -0.03720717877149582, -0.035071417689323425, -0.04945969209074974, 0.09936901926994324, -0.0776367336511612, -0.029020100831985474, 0.029095038771629333, -0.028532996773719788, 0.10438992828130722, -0.06407278776168823, -0.0443638451397419, 0.03597068414092064, -0.03177410736680031, 0.003501053201034665, -0.08955202251672745, -0.024373887106776237, -0.029207447543740273, 0.013207986019551754, 0.0053159804083406925, -0.036345381289720535, -0.044476255774497986, -0.031530555337667465, -0.016055665910243988, -0.014528784900903702, -0.04983438923954964, -0.05114581808447838, -0.033947333693504333, -0.028177037835121155, 0.040429551154375076, 0.052906885743141174, -0.03889330476522446, -0.02965708076953888, -0.006571207195520401, -0.006500951945781708, -0.044888418167829514, -0.002167374361306429, 0.037694282829761505, -0.04634972661733627, -0.011737309396266937, 0.07861093431711197, 0.003304338315501809, -0.005325347650796175, 0.02064567431807518, 0.005011540837585926, -0.05077112466096878, 0.006917799822986126, -0.0033792774192988873, -0.01097855344414711, -0.021713554859161377, 0.018781568855047226, -0.009081661701202393, 0.0412164106965065, 0.09292427450418472, 0.03647652268409729, 0.018125852569937706, 0.0018769860034808517, -0.027259035035967827, -0.048897650092840195, -0.054105907678604126, -0.0015315643977373838, -0.02684687077999115, -0.05073365569114685, 0.01540931686758995, 0.007568832021206617, -0.009760795161128044, 0.001572546549141407, -0.036495257169008255, 0.00720350444316864, -0.06493458151817322, -0.055492278188467026, -0.03400354087352753, 0.0010304102906957269, -0.0014531126944348216, 0.07831118255853653, -0.029132509604096413, -0.0380689762532711, -0.026790667325258255, -0.020327184349298477, -0.028064629063010216, -0.047323934733867645, -0.019615264609456062, 0.11158406734466553, -0.07126691937446594, 0.022519148886203766, -0.002974138827994466, 0.016730116680264473, -0.028907692059874535, -0.011830983683466911, -0.04279012978076935, -0.013048741035163403, 0.02750258706510067, -0.0009607404936105013, 0.007601617835462093, -0.023699436336755753, 0.00041860417695716023, 0.0030818635132163763, 0.0457502156496048, -0.001348900725133717, 0.052906885743141174, 0.010622593574225903, 0.002449566265568137, -0.06006355211138725, -0.02195710688829422, -0.05755309760570526, -0.011297043412923813, 0.04432637616991997, 0.035183828324079514, -0.03126826882362366, 0.06665817648172379, 0.031680431216955185, 0.0009654241730459034, 0.027671199291944504, 0.07572578638792038, -0.06066306307911873, 0.016083767637610435, 0.03201765567064285, -0.02731524035334587, -0.0377504862844944, -0.015765277668833733, -0.04548792913556099, -0.010791205801069736, -0.03833126276731491, 0.024055397137999535, -0.027783608064055443, 0.035764604806900024, 0.010735001415014267, -0.0035595991648733616, 0.07407712936401367, -0.004838244523853064, 0.011503125540912151, -0.022556617856025696, 0.01702050492167473, -0.006664881017059088, -0.019203100353479385, 0.042078208178281784, 0.003950686659663916, -0.044850949198007584, -0.022406740114092827, -0.000680304947309196, 0.00799036305397749, 0.03389113023877144, 0.030181653797626495, -0.02265029214322567, 0.03329161927103996, 0.002127563115209341, 0.06362315267324448, 0.04897259175777435, 0.0023371579591184855, 0.028982629999518394, 0.037001095712184906, -0.00397878885269165, -0.019502855837345123, 0.06223678216338158, 0.011034756898880005, 0.016008827835321426, -0.026865605264902115, 0.08812817931175232, -0.029788224026560783, 0.022238127887248993, -0.0679321363568306, -0.005681307520717382, -0.010126123204827309, 0.0010052354773506522, 0.01741393283009529, -0.03538990765810013, -0.01860358938574791, 0.016121236607432365, -0.001413301331922412, 0.023081190884113312, 0.0308186337351799, 0.0014472580514848232, 0.018734732642769814, 0.020964166149497032, 0.06729515641927719, -0.007184769958257675, -0.026097482070326805, -0.006421329453587532, 0.05223243311047554, -0.01621491089463234, -0.03334782272577286, -0.016111869364976883, -0.03001304157078266, -0.0384436696767807, 0.0022306041792035103, -0.02976948954164982, 0.023868048563599586, 0.026603320613503456, 0.025441765785217285, -0.017086075618863106, 0.03771301731467247, 0.0028312865179032087, 0.05343145504593849, 0.008791273459792137, -0.01652403362095356, -0.01095981802791357, 0.052682068198919296, 0.033797457814216614, 0.02013983763754368, -0.00015382972196675837, -0.008636711165308952, -0.02191963605582714, -0.016823789104819298, -0.024486295878887177, -0.00721287215128541, 0.06808201968669891, 0.06051318347454071, -0.0006200025673024356, -0.017938505858182907, 0.023249803110957146 ]
31,972
pingouin.parametric
ancova
ANCOVA with one or more covariate(s). Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Note that this function can also directly be used as a Pandas method, in which case this argument is no longer needed. dv : string Name of column in data with the dependent variable. between : string Name of column in data with the between factor. covar : string or list Name(s) of column(s) in data with the covariate. effsize : str Effect size. Must be 'np2' (partial eta-squared) or 'n2' (eta-squared). Returns ------- aov : :py:class:`pandas.DataFrame` ANCOVA summary: * ``'Source'``: Names of the factor considered * ``'SS'``: Sums of squares * ``'DF'``: Degrees of freedom * ``'F'``: F-values * ``'p-unc'``: Uncorrected p-values * ``'np2'``: Partial eta-squared Notes ----- Analysis of covariance (ANCOVA) is a general linear model which blends ANOVA and regression. ANCOVA evaluates whether the means of a dependent variable (dv) are equal across levels of a categorical independent variable (between) often called a treatment, while statistically controlling for the effects of other continuous variables that are not of primary interest, known as covariates or nuisance variables (covar). Pingouin uses :py:class:`statsmodels.regression.linear_model.OLS` to compute the ANCOVA. .. important:: Rows with missing values are automatically removed (listwise deletion). See Also -------- anova : One-way and N-way ANOVA Examples -------- 1. Evaluate the reading scores of students with different teaching method and family income as a covariate. >>> from pingouin import ancova, read_dataset >>> df = read_dataset('ancova') >>> ancova(data=df, dv='Scores', covar='Income', between='Method') Source SS DF F p-unc np2 0 Method 571.029883 3 3.336482 0.031940 0.244077 1 Income 1678.352687 1 29.419438 0.000006 0.486920 2 Residual 1768.522313 31 NaN NaN NaN 2. Evaluate the reading scores of students with different teaching method and family income + BMI as a covariate. >>> ancova(data=df, dv='Scores', covar=['Income', 'BMI'], between='Method', ... effsize="n2") Source SS DF F p-unc n2 0 Method 552.284043 3 3.232550 0.036113 0.141802 1 Income 1573.952434 1 27.637304 0.000011 0.404121 2 BMI 60.013656 1 1.053790 0.312842 0.015409 3 Residual 1708.508657 30 NaN NaN NaN
@pf.register_dataframe_method def ancova(data=None, dv=None, between=None, covar=None, effsize="np2"): """ANCOVA with one or more covariate(s). Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Note that this function can also directly be used as a Pandas method, in which case this argument is no longer needed. dv : string Name of column in data with the dependent variable. between : string Name of column in data with the between factor. covar : string or list Name(s) of column(s) in data with the covariate. effsize : str Effect size. Must be 'np2' (partial eta-squared) or 'n2' (eta-squared). Returns ------- aov : :py:class:`pandas.DataFrame` ANCOVA summary: * ``'Source'``: Names of the factor considered * ``'SS'``: Sums of squares * ``'DF'``: Degrees of freedom * ``'F'``: F-values * ``'p-unc'``: Uncorrected p-values * ``'np2'``: Partial eta-squared Notes ----- Analysis of covariance (ANCOVA) is a general linear model which blends ANOVA and regression. ANCOVA evaluates whether the means of a dependent variable (dv) are equal across levels of a categorical independent variable (between) often called a treatment, while statistically controlling for the effects of other continuous variables that are not of primary interest, known as covariates or nuisance variables (covar). Pingouin uses :py:class:`statsmodels.regression.linear_model.OLS` to compute the ANCOVA. .. important:: Rows with missing values are automatically removed (listwise deletion). See Also -------- anova : One-way and N-way ANOVA Examples -------- 1. Evaluate the reading scores of students with different teaching method and family income as a covariate. >>> from pingouin import ancova, read_dataset >>> df = read_dataset('ancova') >>> ancova(data=df, dv='Scores', covar='Income', between='Method') Source SS DF F p-unc np2 0 Method 571.029883 3 3.336482 0.031940 0.244077 1 Income 1678.352687 1 29.419438 0.000006 0.486920 2 Residual 1768.522313 31 NaN NaN NaN 2. Evaluate the reading scores of students with different teaching method and family income + BMI as a covariate. >>> ancova(data=df, dv='Scores', covar=['Income', 'BMI'], between='Method', ... effsize="n2") Source SS DF F p-unc n2 0 Method 552.284043 3 3.232550 0.036113 0.141802 1 Income 1573.952434 1 27.637304 0.000011 0.404121 2 BMI 60.013656 1 1.053790 0.312842 0.015409 3 Residual 1708.508657 30 NaN NaN NaN """ # Import from pingouin.utils import _is_statsmodels_installed _is_statsmodels_installed(raise_error=True) from statsmodels.api import stats from statsmodels.formula.api import ols # Safety checks assert effsize in ["np2", "n2"], "effsize must be 'np2' or 'n2'." assert isinstance(data, pd.DataFrame), "data must be a pandas dataframe." assert isinstance(between, str), ( "between must be a string. Pingouin does not support multiple " "between factors. For more details, please see " "https://github.com/raphaelvallat/pingouin/issues/173." ) assert dv in data.columns, "%s is not in data." % dv assert between in data.columns, "%s is not in data." % between assert isinstance(covar, (str, list)), "covar must be a str or a list." if isinstance(covar, str): covar = [covar] for c in covar: assert c in data.columns, "covariate %s is not in data" % c assert data[c].dtype.kind in "bfi", "covariate %s is not numeric" % c # Drop missing values data = data[_flatten_list([dv, between, covar])].dropna() # Fit ANCOVA model # formula = dv ~ 1 + between + covar1 + covar2 + ... assert dv not in ["C", "Q"], "`dv` must not be 'C' or 'Q'." assert between not in ["C", "Q"], "`between` must not be 'C' or 'Q'." assert all(c not in ["C", "Q"] for c in covar), "`covar` must not contain 'C' or 'Q'." formula = f"Q('{dv}') ~ C(Q('{between}'))" for c in covar: formula += " + Q('%s')" % (c) model = ols(formula, data=data).fit() # Create output dataframe aov = stats.anova_lm(model, typ=2).reset_index() aov.rename( columns={"index": "Source", "sum_sq": "SS", "df": "DF", "PR(>F)": "p-unc"}, inplace=True ) aov.at[0, "Source"] = between for i in range(len(covar)): aov.at[i + 1, "Source"] = covar[i] aov["DF"] = aov["DF"].astype(int) # Add effect sizes if effsize == "n2": all_effsize = (aov["SS"] / aov["SS"].sum()).to_numpy() all_effsize[-1] = np.nan else: ss_resid = aov["SS"].iloc[-1] all_effsize = aov["SS"].apply(lambda x: x / (x + ss_resid)).to_numpy() all_effsize[-1] = np.nan aov[effsize] = all_effsize # Add bw as an attribute (for rm_corr function) aov = _postprocess_dataframe(aov) aov.bw_ = model.params.iloc[-1] return aov
(data=None, dv=None, between=None, covar=None, effsize='np2')
[ -0.03391643241047859, -0.030045079067349434, 0.04877065494656563, -0.06429815292358398, 0.012487223371863365, -0.0048339334316551685, -0.016284937039017677, -0.0810459703207016, 0.05217912793159485, -0.026868043467402458, -0.017957614734768867, -0.014044180512428284, 0.027373002842068672, 0.005341522861272097, -0.038103386759757996, 0.05457768589258194, 0.012287342920899391, -0.024743005633354187, 0.0686744675040245, 0.01353922113776207, -0.02035617269575596, 0.013518181629478931, -0.04359482228755951, -0.06665463000535965, 0.00927862711250782, 0.0477607361972332, -0.04067026451230049, -0.003616244997829199, 0.01399158127605915, -0.009252327494323254, 0.000434278161264956, -0.03793506696820259, -0.057060401886701584, 0.0005421080277301371, 0.06741207093000412, -0.039534106850624084, 0.06118423491716385, -0.01694769598543644, -0.0007646714802831411, 0.06004807725548744, -0.0329696349799633, -0.06072135642170906, -0.01886233501136303, 0.0038792446721345186, -0.07132550328969955, -0.03349563479423523, -0.07389237731695175, 0.06063719838857651, 0.013865341432392597, -0.041091062128543854, 0.010672525502741337, -0.04302674159407616, 0.033727072179317474, 0.01566425897181034, 0.035431310534477234, 0.03915538638830185, -0.021408170461654663, 0.06328823417425156, 0.05562968552112579, -0.0089262081310153, 0.04973849281668663, -0.007621729746460915, 0.01008340623229742, -0.07843701541423798, 0.0006344866123981774, 0.011771864257752895, 0.012213703244924545, 0.02400660701096058, 0.02762548252940178, -0.02327020838856697, -0.027330921962857246, 0.0031218058429658413, 0.03090771846473217, 0.04195370152592659, 0.007737449370324612, -0.031959716230630875, -0.027520282194018364, -0.010609405115246773, -0.005601892247796059, -0.0022197170183062553, 0.027309883385896683, -0.05504056438803673, -0.023080848157405853, -0.034274112433195114, 0.016537416726350784, -0.017294855788350105, -0.04388938099145889, -0.0008363388478755951, 0.040691304951906204, 0.01950405351817608, 0.01934625394642353, -0.0035320851020514965, 0.022807328030467033, 0.012108503840863705, -0.00020694783597718924, 0.025205885991454124, 0.029371799901127815, -0.029918838292360306, 0.0440577007830143, 0.01630597747862339, -0.009730986319482327, 0.023354368284344673, 0.035431310534477234, 0.03867146745324135, -0.022681089118123055, -0.004444694146513939, -0.033600833266973495, 0.050243452191352844, 0.018914934247732162, -0.04965433105826378, -0.09207091480493546, 0.02217612974345684, -0.010982864536345005, -0.08483316749334335, -0.019945893436670303, -0.030592117458581924, -0.028004201129078865, 0.03395851328969002, -0.1299428641796112, 0.01783137582242489, 0.02272316813468933, 0.025290045887231827, 0.0024458966217935085, -0.04031258448958397, 0.03111811727285385, -0.0003589944972191006, -0.0019409373635426164, -0.02151337079703808, -0.021986769512295723, -0.0392395481467247, 0.011919143609702587, -0.05966935679316521, 0.00038299322477541864, 0.03214907646179199, 0.036735787987709045, -0.005480912514030933, 0.03318003565073013, -0.04510969668626785, -0.00847384799271822, -0.02120829187333584, 0.03307483345270157, 0.05053801089525223, -0.05487224459648132, -0.07418693602085114, 0.03513675183057785, 0.012550342828035355, 0.056050483137369156, -0.04578297585248947, -0.06391943246126175, -0.021650129929184914, -0.000967838685028255, 0.02257588878273964, -0.034421391785144806, -0.023985566571354866, 0.04687705636024475, -0.04927561432123184, 0.0005039730458520353, -0.06004807725548744, -0.016537416726350784, -0.05015929043292999, -0.06981062144041061, 0.032443635165691376, -0.0315178781747818, 0.047255776822566986, 0.0012137433513998985, -0.0074744499288499355, -0.029371799901127815, -0.010583105497062206, -0.009352266788482666, -0.04330025985836983, -0.01685301773250103, -0.036251869052648544, -0.031139157712459564, 0.04279530048370361, 0.006632850971072912, 0.014854219742119312, -0.017936576157808304, -0.051000889390707016, 0.018788693472743034, -0.05087465047836304, 0.005807031877338886, 0.021944690495729446, -0.022344449535012245, 0.005707092117518187, -0.03562067076563835, -0.02035617269575596, 0.04027050361037254, -0.030465878546237946, 0.02169221080839634, -0.02305980771780014, -0.028193561360239983, -0.015559058636426926, 0.026152683421969414, 0.018357375636696815, 0.04113314300775528, -0.09038771688938141, 0.01133002433925867, 0.010814545676112175, -0.01333934161812067, -0.04620377719402313, 0.031833477318286896, 0.025416284799575806, 0.0027141564060002565, -0.030129238963127136, -0.004996993113309145, 0.04351066052913666, -0.021881571039557457, -0.0011861283564940095, 0.004294784273952246, -0.019188454374670982, 0.03370603546500206, 0.006154191680252552, 0.03652539104223251, -0.016526896506547928, 0.016568977385759354, 0.008968288078904152, 0.06408775597810745, -0.019114814698696136, -0.00506537314504385, 0.046708736568689346, 0.06261495500802994, -0.057270802557468414, -0.051758330315351486, 0.052221208810806274, 0.05104297026991844, -0.010199125856161118, -0.010062365792691708, 0.07906821370124817, 0.07418693602085114, -0.05739704146981239, -0.02366996742784977, 0.019840693101286888, -0.03583107143640518, -0.03477907180786133, 0.001068436075001955, 0.05558760464191437, 0.010535765439271927, 0.024195967242121696, -0.09956114739179611, -0.00956792663782835, -0.013938981108367443, 0.00045203062472864985, 0.020766451954841614, 0.04746617376804352, -0.03938682749867439, -0.04359482228755951, 0.03008715808391571, 0.0400390662252903, -0.030108198523521423, -0.025963325053453445, 0.020377211272716522, -0.05520888417959213, -0.0414908230304718, 0.0329696349799633, -0.04931769147515297, -0.032654035836458206, 0.015990378335118294, 0.0347369909286499, 0.031412675976753235, -0.04292154312133789, -0.02543732523918152, -0.01743161678314209, 0.034421391785144806, 0.013960020616650581, -0.03587315231561661, 0.01779981516301632, -0.031139157712459564, -0.05036969110369682, 0.01204538345336914, 0.018694015219807625, -0.03545235097408295, 0.04460473731160164, 0.04077546298503876, 0.0070378705859184265, -0.017957614734768867, 0.04107002541422844, -0.013707540929317474, -0.004660353530198336, -0.0119401840493083, 0.00034354327362962067, -0.0031507357489317656, -0.004652463831007481, -0.04115418344736099, -0.033453553915023804, -0.054072726517915726, -0.07570181787014008, 0.0038529448211193085, -0.015317099168896675, 0.02884580008685589, 0.023712048307061195, -0.024469487369060516, -0.00660129077732563, 0.010451605543494225, 0.021944690495729446, 0.048812732100486755, 0.06021639704704285, 0.029014119878411293, 0.01320258155465126, -0.009467987343668938, -0.00021730345906689763, -0.018978053703904152, 0.010767205618321896, 0.032654035836458206, -0.011813944205641747, -0.030444838106632233, -0.002544521586969495, 0.04548841714859009, -0.05764952301979065, 0.008163508959114552, -0.03675682842731476, 0.006480311043560505, 0.03984970599412918, 0.007106250151991844, 0.02865644171833992, -0.004244814161211252, -0.004660353530198336, -0.020124731585383415, -0.030718358233571053, 0.09266003221273422, 0.03629394993185997, -0.05356776714324951, -0.029918838292360306, 0.034821152687072754, -0.051000889390707016, 0.03385331481695175, 0.04658249765634537, 0.027541322633624077, 0.02981363981962204, 0.018778175115585327, -0.00047044060193002224, -0.040144264698028564, 0.005181092768907547, 0.012445143423974514, 0.012466182932257652, -0.03177035599946976, -0.02111361175775528, -0.0243642870336771, 0.006401411257684231, 0.03860834613442421, 0.04742409661412239, 0.03814546763896942, 0.03559963032603264, -0.0028325060848146677, -0.007300870027393103, -0.009851966984570026, -0.05971143767237663, 0.03774570673704147, -0.012119023129343987, 0.0029377059545367956, 0.0020185222383588552, -0.02667868323624134, 0.041238345205783844, 0.026215804740786552, 0.06097383797168732, 0.04283738136291504, 0.029392840340733528, 0.05095881223678589, -0.01740005612373352, 0.023501647636294365, -0.05344152823090553, 0.025773964822292328, 0.023038769140839577, 0.03330627456307411, -0.03395851328969002, 0.04809737578034401, 0.007342949975281954, 0.006706490647047758, -0.0034794851671904325, -0.0009606062085367739, -0.03934474661946297, -0.022344449535012245, -0.004812893457710743, 0.026636604219675064, -0.049570173025131226, 0.012865941971540451, 0.008763148449361324, -0.015317099168896675, -0.040228426456451416, 0.0036372849717736244, 0.029582198709249496, 0.01501201931387186, -0.0031928156968206167, -0.04586713761091232, 0.03029755875468254, 0.005178462713956833, -0.019903812557458878, -0.019903812557458878, 0.044730979949235916, -0.00032677705166861415, 0.012297863140702248, 0.03179139643907547, -0.024890286847949028, 0.0029613759834319353, -0.028277721256017685, 0.023038769140839577, -0.0252479650080204, -0.02406972646713257, -0.005025923252105713, -0.038503147661685944, -0.004807633347809315, -0.01868349500000477, -0.009431167505681515, 0.047382015734910965, 0.010519986040890217, -0.07111510634422302, -0.050580091774463654, 0.007132550235837698, -0.038860827684402466, -0.016263898462057114, 0.030865637585520744, -0.007090470287948847, 0.04334234073758125, -0.0019843322224915028, 0.04330025985836983, 0.0037556348834186792, 0.045067619532346725, -0.0001250892091775313, -0.06488727033138275, 0.011298464611172676, 0.011687704361975193, 0.07511270046234131, -0.03191763535141945, 0.0005049593164585531, 0.05150584876537323, 0.07401861995458603, 0.02442740648984909, -0.016989776864647865, 0.01757889613509178, 0.0009461411973461509, -0.024658845737576485, 0.024785086512565613, 0.012255783192813396, -0.0297505185008049, -0.04043882340192795, -0.024406366050243378, 0.03736699000000954, -0.05020137131214142, 0.0046577234752476215, 0.068169504404068, 0.08415988832712173, 0.017862936481833458, 0.011119624599814415, -0.007684849668294191, 0.023922447115182877, -0.11555152386426926, 0.009226026944816113, 0.021881571039557457, -0.04363689944148064, -0.05150584876537323, -0.06396151334047318, 0.1008235439658165, 0.04292154312133789, 0.020524492487311363, 0.0119401840493083, -0.03471595421433449, 0.01743161678314209, -0.031686197966337204, 0.006680191028863192, -0.016590017825365067, -0.007243010215461254, -0.0037845647893846035, 0.00946272723376751, -0.007716409396380186, -0.0007068115519359708, 0.01320258155465126, 0.042332421988248825, 0.05285240709781647, 0.0006492803804576397, -0.018609855324029922, -0.0005881329416297376, -0.02266004867851734, -0.04919145256280899, -0.028698520734906197, -0.031202277168631554, 0.04788697510957718, 0.04877065494656563, -0.04298466071486473, -0.021797411143779755, 0.007995189167559147, 0.023228127509355545, 0.019388332962989807, -0.006653890945017338, 0.016106098890304565, 0.0328013151884079, 0.053736086934804916, 0.02640516310930252, 0.008678988553583622, 0.012234743684530258, -0.038103386759757996, -0.040628183633089066, -0.007784789428114891, 0.0026589264161884785, -0.022155089303851128, 0.04481513798236847, 0.000728508981410414, 0.04191162437200546, 0.04170122370123863, -0.012792302295565605, 0.00955214723944664, -0.017694616690278053, 0.02211301028728485, -0.0027772760950028896, -0.0882837176322937, -0.029918838292360306, -0.02482716552913189, -0.0283829215914011, -0.03097083792090416, 0.020766451954841614, -0.041511863470077515, -0.012697623111307621, -0.0006877440609969199, -0.026489323005080223, 0.034821152687072754, 0.011729784309864044, 0.06396151334047318, 0.0504959300160408, -0.008405468426644802, 0.017442137002944946, -0.011761344037950039, -0.017873454838991165, -0.00466298358514905, -0.07372406125068665, -0.0016450627008453012, 0.022702129557728767, 0.005188982933759689, 0.08045685291290283, 0.008763148449361324, 0.0003701719979289919, -0.016011418774724007, -0.013886380940675735, -0.016284937039017677, -0.05344152823090553, 0.032717157155275345, 0.09400659054517746, 0.0011361584765836596, -0.0028693261556327343, 0.020219411700963974, -0.0622362345457077, 0.04797113314270973, 0.03313795477151871, -0.025816043838858604, 0.045404259115457535, -0.009625786915421486, 0.006890590768307447, 0.014822660014033318, -0.042058903723955154, 0.023964527994394302, -0.01596933789551258, 0.008147728629410267, 0.01055680587887764, -0.00865268800407648, -0.032843396067619324, 0.04159602150321007, 0.10519985854625702, 0.033116914331912994, 0.03452659398317337, 0.022891487926244736, -0.03166515752673149, -0.0065329112112522125, -0.020482411608099937, 0.0017410576110705733, -0.07330325990915298, 0.03416891396045685, -0.07856325060129166, -0.039071228355169296, 0.077174611389637, 0.05655544251203537, 0.06438231468200684, -0.014822660014033318, -0.07309286296367645, 0.007174630183726549, -0.0064645311795175076, -0.0459933765232563, -0.026720764115452766, -0.06997894495725632, 0.005538772325962782, -0.00148331793025136, -0.008694767951965332, -0.010704085230827332, 0.008326568640768528, -0.05070633068680763, -0.034274112433195114, -0.03833482787013054, -0.025837084278464317, 0.017568375915288925, 0.0324857160449028, -0.0440577007830143, 0.05861736088991165, 0.06093175709247589, 0.016442736610770226, -0.06370903551578522, 0.00394762447103858, -0.06715958565473557, -0.05966935679316521, -0.03860834613442421, 0.05722872167825699, -0.0010296435793861747, 0.006012171972543001, 0.029035160318017006, 0.0029534860514104366, -0.06025847792625427, -0.020303571596741676, 0.01316050160676241, -0.019146373495459557, -0.033663954585790634, 0.015527498908340931, 0.03458971157670021, 0.009373307228088379, 0.043973539024591446, -0.014538620598614216, 0.0487285740673542, 0.06316199153661728, -0.014822660014033318, -0.005188982933759689, -0.018999094143509865, -0.020482411608099937, -0.0776795744895935, -0.010972345247864723, 0.0021658020559698343, 0.06779078394174576, -0.014443940483033657, -0.04094378277659416, -0.0018436274258419871, 0.024890286847949028, -0.06282535195350647, 0.02318604849278927, 0.025605645030736923, -0.07772165536880493, -0.07014726102352142, -0.03029755875468254, 0.04241658374667168, 0.04125938192009926, 0.0034794851671904325, 0.024195967242121696, 0.010856625624001026, -0.015464378520846367, 0.012413582764565945, 0.06349863111972809, -0.029392840340733528, 0.009825666435062885, 0.02381724677979946, -0.04898105189204216, 0.04136458411812782, 0.052431609481573105, 0.04235346242785454, -0.025500444695353508, -0.04330025985836983, -0.059248559176921844, 0.003553125075995922, -0.005670272279530764, 0.05095881223678589, -0.028551241382956505, -0.06791702657938004, 0.02068229205906391, -0.026447243988513947, 0.006059511564671993, 0.031139157712459564, 0.03212803602218628, 0.03785090893507004, -0.008673728443682194, -0.005875411909073591, -0.002440636744722724, -0.007684849668294191, -0.02202885039150715, 0.08761043846607208, -0.0038529448211193085, 0.04313194006681442, 0.010157045908272266, -0.02156597003340721, 0.07490229606628418, 0.04620377719402313, 0.05971143767237663, -0.06661254912614822, 0.024743005633354187, 0.07414485514163971, -0.0360204316675663, 0.017410576343536377, 0.03111811727285385, -0.007369250059127808, 0.01794709637761116, 0.027604442089796066, 0.03766154870390892, 0.07077846676111221, -0.06446646898984909, 0.03652539104223251, -0.051547929644584656, 0.04523593932390213, -0.041091062128543854, 0.01974601298570633, -0.044436417520046234, -0.03648331016302109, 0.005949052050709724, -0.012371502816677094, -0.009362787008285522, 0.024385327473282814, -0.022323409095406532, -0.06993686407804489, -0.028340840712189674, -0.026363084092736244, 0.04043882340192795, 0.031012916937470436, -0.006943190470337868, 0.02318604849278927, 0.012297863140702248, -0.027457162737846375, 0.05062217265367508, 0.04262698069214821, 0.0009244437096640468, 0.00018442849977873266, -0.03124435804784298, -0.007911029271781445, 0.06236247345805168, -0.017873454838991165, -0.0015753678744658828, 0.014180940575897694, 0.06783286482095718, -0.06152087450027466, 0.0292665995657444, -0.042542822659015656, 0.03671475127339363, 0.02598436363041401, 0.015422298572957516, 0.055082645267248154, -0.0243642870336771, 0.0025366314221173525, -0.013118421658873558, 0.015464378520846367, 0.02087165229022503, 0.04877065494656563, -0.04468889907002449, 0.0686744675040245, 0.014349260367453098, 0.019209492951631546, -0.00042277193279005587, -0.034421391785144806, -0.011750823818147182, -0.057270802557468414, -0.04359482228755951, -0.029582198709249496, 0.005964831914752722, -0.044436417520046234, -0.005202132742851973, -0.008510668762028217, -0.03587315231561661, 0.003432145342230797, 0.02175533026456833, 0.047045376151800156, -0.004065974615514278, 0.04414185881614685, -0.02293356880545616, 0.0029508559964597225, 0.008347608149051666, 0.03084459714591503, 0.012487223371863365, 0.0243642870336771, 0.023691007867455482, 0.051211290061473846, -0.005449352785944939, -0.004847083240747452, -0.05116920918226242, -0.02400660701096058, 0.010919745080173016, 0.03820858895778656, 0.04269010201096535, 0.04515177756547928, 0.006901110522449017, 0.005341522861272097, 0.015180339105427265 ]
31,973
pingouin.distribution
anderson
Anderson-Darling test of distribution. The Anderson-Darling test tests the null hypothesis that a sample is drawn from a population that follows a particular distribution. For the Anderson-Darling test, the critical values depend on which distribution is being tested against. This function is a wrapper around :py:func:`scipy.stats.anderson`. Parameters ---------- sample1, sample2,... : array_like Array of sample data. They may be of different lengths. dist : string The type of distribution to test against. The default is 'norm'. Must be one of 'norm', 'expon', 'logistic', 'gumbel'. Returns ------- from_dist : boolean A boolean indicating if the data comes from the tested distribution (True) or not (False). sig_level : float The significance levels for the corresponding critical values, in %. See :py:func:`scipy.stats.anderson` for more details. Examples -------- 1. Test that an array comes from a normal distribution >>> from pingouin import anderson >>> import numpy as np >>> np.random.seed(42) >>> x = np.random.normal(size=100) >>> y = np.random.normal(size=10000) >>> z = np.random.random(1000) >>> anderson(x) (True, 15.0) 2. Test that multiple arrays comes from the normal distribution >>> anderson(x, y, z) (array([ True, True, False]), array([15., 15., 1.])) 3. Test that an array comes from the exponential distribution >>> x = np.random.exponential(size=1000) >>> anderson(x, dist="expon") (True, 15.0)
def anderson(*args, dist="norm"): """Anderson-Darling test of distribution. The Anderson-Darling test tests the null hypothesis that a sample is drawn from a population that follows a particular distribution. For the Anderson-Darling test, the critical values depend on which distribution is being tested against. This function is a wrapper around :py:func:`scipy.stats.anderson`. Parameters ---------- sample1, sample2,... : array_like Array of sample data. They may be of different lengths. dist : string The type of distribution to test against. The default is 'norm'. Must be one of 'norm', 'expon', 'logistic', 'gumbel'. Returns ------- from_dist : boolean A boolean indicating if the data comes from the tested distribution (True) or not (False). sig_level : float The significance levels for the corresponding critical values, in %. See :py:func:`scipy.stats.anderson` for more details. Examples -------- 1. Test that an array comes from a normal distribution >>> from pingouin import anderson >>> import numpy as np >>> np.random.seed(42) >>> x = np.random.normal(size=100) >>> y = np.random.normal(size=10000) >>> z = np.random.random(1000) >>> anderson(x) (True, 15.0) 2. Test that multiple arrays comes from the normal distribution >>> anderson(x, y, z) (array([ True, True, False]), array([15., 15., 1.])) 3. Test that an array comes from the exponential distribution >>> x = np.random.exponential(size=1000) >>> anderson(x, dist="expon") (True, 15.0) """ k = len(args) from_dist = np.zeros(k, dtype="bool") sig_level = np.zeros(k) for j in range(k): st, cr, sig = scipy.stats.anderson(args[j], dist=dist) from_dist[j] = True if (st < cr).any() else False sig_level[j] = sig[np.argmin(np.abs(st - cr))] if k == 1: from_dist = from_dist[0] sig_level = sig_level[0] return from_dist, sig_level
(*args, dist='norm')
[ 0.014988789334893227, 0.06181100383400917, 0.045790135860443115, -0.015670528635382652, 0.053365014493465424, -0.02054685540497303, -0.035829171538352966, 0.027667241171002388, 0.025565212592482567, 0.07090085744857788, -0.012271301820874214, 0.051281921565532684, 0.03747670724987984, 0.014685793779790401, -0.06374259293079376, -0.017204441130161285, 0.006533332169055939, 0.08370240032672882, -0.06968887150287628, 0.012460674159228802, -0.012006181292235851, 0.01863420009613037, 0.016494296491146088, 0.003434733720496297, -0.010311302728950977, 0.07427167892456055, -0.011854683980345726, -0.052683275192976, -0.030148012563586235, 0.01667420007288456, 0.04098008945584297, -0.081505686044693, 0.018501639366149902, 0.04931245371699333, 0.03935148939490318, -0.042532939463853836, -0.0033140089362859726, 0.038063760846853256, -0.10157910734415054, 0.052190907299518585, 0.011759997345507145, -0.03204173222184181, 0.0514712929725647, 0.02022492326796055, -0.048895835876464844, 0.025091782212257385, -0.0058799986727535725, 0.0013871494447812438, -0.08112694323062897, 0.012820480391383171, -0.005572269205003977, -0.04234356805682182, 0.03374607861042023, -0.04491902515292168, 0.03143574297428131, 0.07150684297084808, 0.03904849290847778, 0.05120617523789406, -0.0040880669839680195, -0.01831226609647274, 0.08226317167282104, -0.013085600920021534, 0.03516637161374092, -0.021228594705462456, -0.047721728682518005, -0.006793718319386244, -0.01103091612458229, 0.003690385725349188, -0.01422183308750391, 0.03450356796383858, -0.019154971465468407, 0.04276018589735031, 0.0034560379572212696, 0.013435939326882362, -0.002221569651737809, 0.07090085744857788, -0.007271882612258196, 0.010869949124753475, 0.08021795749664307, -0.014269175939261913, -0.002266545547172427, -0.0072434768080711365, -0.02117178402841091, -0.01937275007367134, -0.031625114381313324, 0.001738671213388443, -0.08286916464567184, -0.0020286468788981438, 0.07241582870483398, -0.021247532218694687, -0.02084985189139843, 0.016636325046420097, 0.0845356360077858, -0.02872772328555584, 0.025053909048438072, 0.05741757154464722, 0.03183342516422272, 0.008905215188860893, 0.03007226437330246, 0.056357089430093765, -0.016323860734701157, 0.0007835263968445361, 0.09006529301404953, 0.06325022876262665, -0.0014628982171416283, 0.010737389326095581, -0.04851709306240082, -0.0321553573012352, -0.015055069699883461, 0.04336617514491081, -0.06109138950705528, -0.003974443767219782, 0.018823571503162384, -0.018274392932653427, -0.03541255369782448, -0.06241699308156967, 0.013587436638772488, 0.019136035814881325, -0.0905955359339714, 0.001343357260338962, 0.07029486447572708, 0.03384076803922653, -0.00629188260063529, 0.006334491539746523, 0.041320957243442535, -0.027591492980718613, -0.013293910771608353, -0.007162993773818016, -0.03168192505836487, -0.036094292998313904, 0.04128308221697807, 0.02439110539853573, -0.009781060740351677, 0.0523802787065506, 0.020471107214689255, -0.010708983056247234, 0.004663283936679363, 0.03022376261651516, 0.0269476268440485, -0.02353893220424652, 0.013379127718508244, -0.02115284651517868, 0.046812742948532104, -0.011883089318871498, -0.00016362919996026903, 0.015500093810260296, 0.011040383949875832, -0.00044028976117260754, 0.025962892919778824, 0.008753717876970768, 0.029958641156554222, -0.029845017939805984, 0.04124521091580391, 0.0005586472107097507, -0.06480307877063751, -0.0440857894718647, -0.0039152647368609905, -0.07116597890853882, 0.018047146499156952, -0.012811011634767056, -0.017034007236361504, -0.07067360728979111, 0.013341253623366356, 0.04268443584442139, 0.026265889406204224, -0.0080388393253088, -0.029845017939805984, 0.007953621447086334, 0.023595744743943214, -0.06010665372014046, 0.003917632158845663, 0.020281735807657242, 0.008602220565080643, -0.00395077234134078, -0.01772521436214447, -0.009350239299237728, 0.0013930673012509942, 0.0018037677509710193, -0.01325603574514389, -0.017043475061655045, 0.0022949513513594866, -0.011419128626585007, 0.000932656810618937, -0.040714967995882034, 0.006566472351551056, 0.004679854027926922, -0.000830869423225522, 0.014127147383987904, -0.004286907147616148, 0.030129076912999153, -0.026682507246732712, 0.010964635759592056, -0.012119804508984089, 0.03558298945426941, 0.004014685284346342, 0.009222413413226604, -0.09574645757675171, -0.05014568939805031, -0.027212748304009438, 0.002989709610119462, -0.006793718319386244, 0.04022260010242462, -0.0327613465487957, 0.01400405541062355, 0.05688733235001564, 0.044464532285928726, -0.038499314337968826, 0.030166950076818466, -0.01859632506966591, -0.053099893033504486, 0.0416618287563324, -0.07404442876577377, -0.002689081709831953, 0.060977764427661896, 0.009274491108953953, -0.01978936791419983, 0.08953505754470825, -0.03198492154479027, 0.023311685770750046, -0.017384344711899757, 0.021039223298430443, -0.04927457869052887, 0.044464532285928726, 0.03562086075544357, 0.03321583941578865, 0.03128424659371376, 0.055751100182533264, -0.0021896131802350283, 0.002310337731614709, -0.013369658961892128, 0.033727142959833145, -0.002352946437895298, 0.02410704828798771, -0.03497699648141861, -0.009771591983735561, -0.029106467962265015, 0.010680577717721462, -0.007593814749270678, -0.007442317437380552, 0.02458047866821289, 0.0051745884120464325, 0.06029602512717247, 0.010917292907834053, -0.01858685538172722, 0.019012942910194397, -0.06343960016965866, -0.010756326839327812, 0.008914683945477009, -0.03634047508239746, -0.046396125108003616, -0.07764250040054321, -0.00887207593768835, -0.012025118805468082, 0.004161448683589697, -0.016276517882943153, -0.03679496794939041, 0.021796710789203644, 0.023027628660202026, 0.026474198326468468, -0.02993970364332199, -0.005411303136497736, -0.05915979668498039, -0.02458047866821289, 0.01131497323513031, -0.05275902524590492, 0.009482800029218197, -0.006173525471240282, -0.004975747782737017, 0.07366568595170975, -0.016778353601694107, -0.06556056439876556, -0.019268594682216644, -0.039957478642463684, -0.013719997368752956, 0.013208692893385887, 0.07090085744857788, 0.0729082003235817, -0.02191033400595188, 0.0028547821566462517, 0.04495690017938614, 0.011352848261594772, 0.009160867892205715, -0.052039410918951035, 0.004971013404428959, 0.005808984395116568, -0.02649313397705555, 0.03249622508883476, 0.009724249131977558, 0.0566222108900547, 0.010680577717721462, 0.014325987547636032, 0.010093525052070618, 0.020963473245501518, -0.04874433949589729, -0.013483282178640366, 0.009582220576703548, -0.0029210622888058424, -0.06730278581380844, 0.009781060740351677, -0.03175767511129379, 0.01406086701899767, -0.005534395109862089, 0.038328882306814194, -0.023349560797214508, -0.024466855451464653, -0.02442898042500019, 0.002994443755596876, -0.01967574469745159, -0.019183378666639328, -0.017535841092467308, 0.03037525899708271, -0.0012877292465418577, -0.023349560797214508, -0.05139554664492607, 0.04033622518181801, -0.030772941187024117, 0.021967144683003426, -0.031000187620520592, -0.003096231259405613, 0.0630987286567688, -0.02533796615898609, 0.052342403680086136, 0.029542023316025734, 0.025697773322463036, 0.026758255437016487, -0.003474975237622857, 0.023425308987498283, 0.06419708579778671, 0.0027269560378044844, 0.07014336436986923, -0.06506820023059845, -0.0058799986727535725, 0.031625114381313324, 0.001032077125273645, -0.0030252167489379644, 0.06109138950705528, 0.0017505069263279438, -0.011400191113352776, 0.0012167147360742092, -0.02827323041856289, -0.018530044704675674, -0.04238143935799599, -0.05196366086602211, 0.03554511442780495, 0.043404050171375275, 0.004066762514412403, 0.01684463396668434, 0.04268443584442139, 0.0569252073764801, -0.03065931797027588, -0.00016732786025386304, 0.03586704656481743, -0.014079803600907326, 0.044578153640031815, 0.057985689491033554, 0.07908172160387039, -0.026606757193803787, -0.0032240573782473803, 0.0009853258961811662, 0.0019410623935982585, 0.010746858082711697, -0.0566222108900547, 0.016295455396175385, -0.022156517952680588, -0.03991960734128952, -0.006263477262109518, 0.019306469708681107, -0.0037495645228773355, 0.036586660891771317, -0.0026843473315238953, -0.003683284390717745, -0.04124521091580391, -0.06044752523303032, -0.007697969675064087, 0.00083323655417189, -0.009317100048065186, 0.009856809861958027, -0.00885313842445612, -0.034768689423799515, -0.004490482155233622, -0.000569595315027982, 0.013909369707107544, 0.039692360907793045, 0.055902596563100815, -0.01251748576760292, -0.03495806083083153, 0.009411785751581192, 0.038821250200271606, -0.03204173222184181, -0.004369757603853941, 0.0084175830706954, -0.012668983079493046, 0.033727142959833145, 0.006277679931372404, -0.04344192519783974, 0.012347050942480564, 0.001136823440901935, 0.0012321012327447534, -0.12521272897720337, 0.012886760756373405, 0.010983572341501713, -0.01122975628823042, 0.005927341990172863, -0.004135409835726023, -0.04306317865848541, -0.009265022352337837, 0.014212364330887794, -0.0643107146024704, -0.011428596451878548, 0.05567535012960434, -0.03961661085486412, -0.0025162796955555677, -0.01711922325193882, -0.006628017872571945, 0.04169970378279686, 0.03391651436686516, -0.07150684297084808, 0.018122894689440727, 0.00577584421262145, 0.013237099163234234, 0.055296607315540314, -0.09506471455097198, -0.026871878653764725, 0.04007110372185707, 0.06287148594856262, 0.01244173664599657, -0.0280081108212471, -0.019921928644180298, -0.015670528635382652, -0.02607651613652706, -0.01235651969909668, 0.008957292884588242, -0.04181332513689995, -0.03278028219938278, 0.051584918051958084, 0.016588982194662094, -0.034162700176239014, 0.04613100364804268, 0.035791296511888504, -0.08385389298200607, -0.026758255437016487, 0.005482317879796028, 0.01122975628823042, -0.02117178402841091, -0.07605177164077759, -0.04124521091580391, 0.053554385900497437, -0.060674771666526794, 0.020603667944669724, -0.09733717888593674, 0.035071682184934616, -0.013426470570266247, 0.016115551814436913, 0.02874666079878807, -0.03919999301433563, -0.015187629498541355, 0.0075796120800077915, -0.00008344201341969892, -0.027345309033989906, 0.04336617514491081, -0.02427748404443264, -0.06499245017766953, -0.0416618287563324, 0.041775450110435486, 0.0181513000279665, -0.0005181098240427673, 0.044578153640031815, -0.008218741975724697, 0.0013350722147151828, 0.011883089318871498, 0.052948396652936935, -0.009051978588104248, 0.03414376080036163, 0.026568884029984474, 0.034768689423799515, 0.012290239334106445, -0.0535922609269619, 0.0036170040257275105, -0.020622605457901955, 0.025394776836037636, -0.03840462863445282, 0.0028666178695857525, 0.07590027153491974, 0.02812173403799534, 0.002071255585178733, -0.08430838584899902, -0.04351767152547836, 0.005449177697300911, 0.029447337612509727, 0.02622801437973976, 0.06419708579778671, -0.03037525899708271, 0.06412134319543839, -0.022592073306441307, -0.020887725055217743, -0.015528499148786068, 0.03777970373630524, 0.0006021435838192701, 0.005283477250486612, 0.003240627469494939, -0.003782704472541809, -0.01952424645423889, -0.03160617873072624, -0.024902410805225372, 0.050410810858011246, 0.020035551860928535, 0.01669313758611679, -0.040563471615314484, -0.04567651450634003, 0.07571090012788773, 0.019713619723916054, -0.014041929505765438, 0.030583569779992104, 0.003486810950562358, 0.050107818096876144, 0.01146647147834301, -0.0037945404183119535, 0.04544926807284355, -0.033878639340400696, -0.03702221438288689, 0.04268443584442139, 0.03285603225231171, -0.03588598221540451, -0.0005142631707713008, -0.008819998241961002, -0.012384925037622452, 0.025584150105714798, 0.011617968790233135, 0.0007894443115219474, 0.007574877701699734, 0.0007799756713211536, -0.02041429467499256, -0.012489079497754574, 0.03232578933238983, 0.011513814330101013, 0.06749215722084045, -0.07090085744857788, -0.038328882306814194, 0.018255455419421196, 0.059046171605587006, 0.019325407221913338, -0.036245789378881454, -0.010519611649215221, -0.03531786799430847, 0.05423612520098686, -0.025640960782766342, -0.053554385900497437, -0.039389364421367645, 0.02384192682802677, -0.00018804041610565037, 0.02961777150630951, -0.0729082003235817, -0.010472268797457218, 0.06120501086115837, -0.018103957176208496, 0.006220868322998285, -0.05048656091094017, -0.03988173231482506, -0.03651091083884239, 0.0214369036257267, -0.0327613465487957, -0.03456037864089012, -0.013028789311647415, -0.01728965900838375, -0.03495806083083153, -0.0066942982375621796, 0.06628017872571945, -0.012044055387377739, -0.05423612520098686, -0.01162743754684925, -0.04783535376191139, 0.07646839320659637, -0.07165834307670593, 0.04722936451435089, -0.05090317875146866, 0.03575342148542404, 0.01832173578441143, -0.09392848610877991, 0.013000383973121643, -0.006168791092932224, -0.0005849817534908652, -0.04404791444540024, -0.06870414316654205, -0.03668134659528732, -0.01004618126899004, 0.0157746821641922, -0.06222762167453766, 0.0026346370577812195, 0.006362897343933582, -0.004322414752095938, -0.029826080426573753, -0.030867626890540123, -0.03664347156882286, -0.03020482510328293, 0.006751109845936298, -0.01235651969909668, -0.0029257964342832565, -0.04601738229393959, 0.05075168237090111, -0.04098008945584297, -0.025849269703030586, 0.02041429467499256, -0.05912192165851593, -0.0554102323949337, 0.03617004305124283, 0.013151881285011768, -0.004114105366170406, -0.07234008610248566, -0.016456421464681625, -0.0008054225472733378, -0.014269175939261913, -0.019581058993935585, 0.007986761629581451, -0.024694101884961128, 0.07544577866792679, -0.0073334285989403725, 0.02920115366578102, -0.01590724289417267, 0.04605525732040405, 0.02384192682802677, 0.017961928620934486, 0.042192067950963974, 0.008161930367350578, 0.00010038192704087123, 0.008322897367179394, -0.10286684334278107, 0.032666660845279694, -0.025546275079250336, 0.043404050171375275, -0.035336803644895554, -0.038821250200271606, 0.026985501870512962, 0.04764598235487938, -0.05866742879152298, -0.006741641089320183, -0.01725178398191929, -0.0005145590985193849, -0.01818917505443096, 0.008095650933682919, -0.0006284781266003847, -0.031075935810804367, 0.01020714733749628, -0.007167728152126074, -0.002599129918962717, -0.02768617868423462, -0.019031880423426628, -0.008024635724723339, -0.028614100068807602, 0.021531589329242706, -0.026133328676223755, 0.021853521466255188, 0.0700676217675209, -0.020433232188224792, 0.049804821610450745, -0.00636763172224164, -0.031662989407777786, -0.017668401822447777, 0.04158607870340347, 0.03740095719695091, 0.014307050034403801, 0.036245789378881454, 0.053062018007040024, 0.022573135793209076, 0.010491205379366875, 0.00974318664520979, 0.03844250366091728, 0.010027244687080383, -0.007626954931765795, 0.005307148676365614, 0.010557485744357109, -0.044313035905361176, 0.04791110008955002, 0.010538548231124878, -0.018425889313220978, 0.059046171605587006, -0.023747241124510765, 0.002255893312394619, -0.004646713845431805, -0.022402700036764145, 0.003995748236775398, -0.033859703689813614, -0.03527999296784401, 0.034030139446258545, -0.04048772156238556, -0.016778353601694107, 0.02768617868423462, 0.04382066801190376, -0.0514712929725647, -0.030640380457043648, -0.03024270012974739, -0.0004790518432855606, -0.06071264669299126, 0.061583757400512695, -0.01580308936536312, 0.04022260010242462, 0.03143574297428131, -0.04866858944296837, 0.0073855058290064335, -0.008895747363567352, -0.048933710902929306, 0.03853718936443329, 0.01458163931965828, -0.004769805818796158, 0.0437827929854393, -0.04749448224902153, -0.028917096555233, -0.03562086075544357, 0.034030139446258545, 0.10680577903985977, -0.013862025924026966, -0.022516323253512383, 0.027326371520757675, 0.03645410016179085, -0.004144878592342138, 0.022156517952680588, -0.014931977726519108, 0.03264772146940231, 0.05749332159757614, 0.03651091083884239, -0.020471107214689255, 0.017895648255944252, -0.021664150059223175, 0.059500664472579956, -0.029560960829257965, -0.040866464376449585, -0.055448103696107864, 0.024353232234716415, 0.005756907165050507, 0.033159028738737106, -0.016910914331674576, -0.07021911442279816, 0.000412771652918309, 0.004076231271028519, 0.07665776461362839, -0.05404675379395485, 0.0010752775706350803, 0.004604105371981859, 0.01935381256043911, 0.01873835362493992, -0.026284825056791306, 0.01547168754041195, 0.03927573934197426, 0.023785116150975227, -0.046699121594429016, 0.10218510031700134, 0.003628839971497655, 0.0033637192100286484, -0.01057642325758934, 0.02280038222670555, -0.08377815037965775, 0.05143342167139053, 0.0017919320380315185, -0.0069594187662005424, 0.015055069699883461, 0.02903071977198124, 0.0068173897452652454, 0.029125405475497246, -0.04677487164735794, 0.031170621514320374, -0.05522085726261139, -0.059917282313108444, 0.017980866134166718, -0.00015223729133140296, -0.012990915216505527, -0.021096033975481987, 0.022686759009957314, -0.0037992745637893677, 0.05779631808400154 ]
31,974
pingouin.parametric
anova
One-way and *N*-way ANOVA. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Note that this function can also directly be used as a Pandas method, in which case this argument is no longer needed. dv : string Name of column in ``data`` containing the dependent variable. between : string or list with *N* elements Name of column(s) in ``data`` containing the between-subject factor(s). If ``between`` is a single string, a one-way ANOVA is computed. If ``between`` is a list with two or more elements, a *N*-way ANOVA is performed. Note that Pingouin will internally call statsmodels to calculate ANOVA with 3 or more factors, or unbalanced two-way ANOVA. ss_type : int Specify how the sums of squares is calculated for *unbalanced* design with 2 or more factors. Can be 1, 2 (default), or 3. This has no impact on one-way design or N-way ANOVA with balanced data. detailed : boolean If True, return a detailed ANOVA table (default True for N-way ANOVA). effsize : str Effect size. Must be 'np2' (partial eta-squared) or 'n2' (eta-squared). Note that for one-way ANOVA partial eta-squared is the same as eta-squared. Returns ------- aov : :py:class:`pandas.DataFrame` ANOVA summary: * ``'Source'``: Factor names * ``'SS'``: Sums of squares * ``'DF'``: Degrees of freedom * ``'MS'``: Mean squares * ``'F'``: F-values * ``'p-unc'``: uncorrected p-values * ``'np2'``: Partial eta-square effect sizes See Also -------- rm_anova : One-way and two-way repeated measures ANOVA mixed_anova : Two way mixed ANOVA welch_anova : One-way Welch ANOVA kruskal : Non-parametric one-way ANOVA Notes ----- The classic ANOVA is very powerful when the groups are normally distributed and have equal variances. However, when the groups have unequal variances, it is best to use the Welch ANOVA (:py:func:`pingouin.welch_anova`) that better controls for type I error (Liu 2015). The homogeneity of variances can be measured with the :py:func:`pingouin.homoscedasticity` function. The main idea of ANOVA is to partition the variance (sums of squares) into several components. For example, in one-way ANOVA: .. math:: SS_{\text{total}} = SS_{\text{effect}} + SS_{\text{error}} SS_{\text{total}} = \sum_i \sum_j (Y_{ij} - \overline{Y})^2 SS_{\text{effect}} = \sum_i n_i (\overline{Y_i} - \overline{Y})^2 SS_{\text{error}} = \sum_i \sum_j (Y_{ij} - \overline{Y}_i)^2 where :math:`i=1,...,r; j=1,...,n_i`, :math:`r` is the number of groups, and :math:`n_i` the number of observations for the :math:`i` th group. The F-statistics is then defined as: .. math:: F^* = \frac{MS_{\text{effect}}}{MS_{\text{error}}} = \frac{SS_{\text{effect}} / (r - 1)}{SS_{\text{error}} / (n_t - r)} and the p-value can be calculated using a F-distribution with :math:`r-1, n_t-1` degrees of freedom. When the groups are balanced and have equal variances, the optimal post-hoc test is the Tukey-HSD test (:py:func:`pingouin.pairwise_tukey`). If the groups have unequal variances, the Games-Howell test is more adequate (:py:func:`pingouin.pairwise_gameshowell`). The default effect size reported in Pingouin is the partial eta-square, which, for one-way ANOVA is the same as eta-square and generalized eta-square. .. math:: \eta_p^2 = \frac{SS_{\text{effect}}}{SS_{\text{effect}} + SS_{\text{error}}} Missing values are automatically removed. Results have been tested against R, Matlab and JASP. Examples -------- One-way ANOVA >>> import pingouin as pg >>> df = pg.read_dataset('anova') >>> aov = pg.anova(dv='Pain threshold', between='Hair color', data=df, ... detailed=True) >>> aov.round(3) Source SS DF MS F p-unc np2 0 Hair color 1360.726 3 453.575 6.791 0.004 0.576 1 Within 1001.800 15 66.787 NaN NaN NaN Same but using a standard eta-squared instead of a partial eta-squared effect size. Also note how here we're using the anova function directly as a method (= built-in function) of our pandas dataframe. In that case, we don't have to specify ``data`` anymore. >>> df.anova(dv='Pain threshold', between='Hair color', detailed=False, ... effsize='n2') Source ddof1 ddof2 F p-unc n2 0 Hair color 3 15 6.791407 0.004114 0.575962 Two-way ANOVA with balanced design >>> data = pg.read_dataset('anova2') >>> data.anova(dv="Yield", between=["Blend", "Crop"]).round(3) Source SS DF MS F p-unc np2 0 Blend 2.042 1 2.042 0.004 0.952 0.000 1 Crop 2736.583 2 1368.292 2.525 0.108 0.219 2 Blend * Crop 2360.083 2 1180.042 2.178 0.142 0.195 3 Residual 9753.250 18 541.847 NaN NaN NaN Two-way ANOVA with unbalanced design (requires statsmodels) >>> data = pg.read_dataset('anova2_unbalanced') >>> data.anova(dv="Scores", between=["Diet", "Exercise"], ... effsize="n2").round(3) Source SS DF MS F p-unc n2 0 Diet 390.625 1.0 390.625 7.423 0.034 0.433 1 Exercise 180.625 1.0 180.625 3.432 0.113 0.200 2 Diet * Exercise 15.625 1.0 15.625 0.297 0.605 0.017 3 Residual 315.750 6.0 52.625 NaN NaN NaN Three-way ANOVA, type 3 sums of squares (requires statsmodels) >>> data = pg.read_dataset('anova3') >>> data.anova(dv='Cholesterol', between=['Sex', 'Risk', 'Drug'], ... ss_type=3).round(3) Source SS DF MS F p-unc np2 0 Sex 2.075 1.0 2.075 2.462 0.123 0.049 1 Risk 11.332 1.0 11.332 13.449 0.001 0.219 2 Drug 0.816 2.0 0.408 0.484 0.619 0.020 3 Sex * Risk 0.117 1.0 0.117 0.139 0.711 0.003 4 Sex * Drug 2.564 2.0 1.282 1.522 0.229 0.060 5 Risk * Drug 2.438 2.0 1.219 1.446 0.245 0.057 6 Sex * Risk * Drug 1.844 2.0 0.922 1.094 0.343 0.044 7 Residual 40.445 48.0 0.843 NaN NaN NaN
@pf.register_dataframe_method def anova(data=None, dv=None, between=None, ss_type=2, detailed=False, effsize="np2"): """One-way and *N*-way ANOVA. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Note that this function can also directly be used as a Pandas method, in which case this argument is no longer needed. dv : string Name of column in ``data`` containing the dependent variable. between : string or list with *N* elements Name of column(s) in ``data`` containing the between-subject factor(s). If ``between`` is a single string, a one-way ANOVA is computed. If ``between`` is a list with two or more elements, a *N*-way ANOVA is performed. Note that Pingouin will internally call statsmodels to calculate ANOVA with 3 or more factors, or unbalanced two-way ANOVA. ss_type : int Specify how the sums of squares is calculated for *unbalanced* design with 2 or more factors. Can be 1, 2 (default), or 3. This has no impact on one-way design or N-way ANOVA with balanced data. detailed : boolean If True, return a detailed ANOVA table (default True for N-way ANOVA). effsize : str Effect size. Must be 'np2' (partial eta-squared) or 'n2' (eta-squared). Note that for one-way ANOVA partial eta-squared is the same as eta-squared. Returns ------- aov : :py:class:`pandas.DataFrame` ANOVA summary: * ``'Source'``: Factor names * ``'SS'``: Sums of squares * ``'DF'``: Degrees of freedom * ``'MS'``: Mean squares * ``'F'``: F-values * ``'p-unc'``: uncorrected p-values * ``'np2'``: Partial eta-square effect sizes See Also -------- rm_anova : One-way and two-way repeated measures ANOVA mixed_anova : Two way mixed ANOVA welch_anova : One-way Welch ANOVA kruskal : Non-parametric one-way ANOVA Notes ----- The classic ANOVA is very powerful when the groups are normally distributed and have equal variances. However, when the groups have unequal variances, it is best to use the Welch ANOVA (:py:func:`pingouin.welch_anova`) that better controls for type I error (Liu 2015). The homogeneity of variances can be measured with the :py:func:`pingouin.homoscedasticity` function. The main idea of ANOVA is to partition the variance (sums of squares) into several components. For example, in one-way ANOVA: .. math:: SS_{\\text{total}} = SS_{\\text{effect}} + SS_{\\text{error}} SS_{\\text{total}} = \\sum_i \\sum_j (Y_{ij} - \\overline{Y})^2 SS_{\\text{effect}} = \\sum_i n_i (\\overline{Y_i} - \\overline{Y})^2 SS_{\\text{error}} = \\sum_i \\sum_j (Y_{ij} - \\overline{Y}_i)^2 where :math:`i=1,...,r; j=1,...,n_i`, :math:`r` is the number of groups, and :math:`n_i` the number of observations for the :math:`i` th group. The F-statistics is then defined as: .. math:: F^* = \\frac{MS_{\\text{effect}}}{MS_{\\text{error}}} = \\frac{SS_{\\text{effect}} / (r - 1)}{SS_{\\text{error}} / (n_t - r)} and the p-value can be calculated using a F-distribution with :math:`r-1, n_t-1` degrees of freedom. When the groups are balanced and have equal variances, the optimal post-hoc test is the Tukey-HSD test (:py:func:`pingouin.pairwise_tukey`). If the groups have unequal variances, the Games-Howell test is more adequate (:py:func:`pingouin.pairwise_gameshowell`). The default effect size reported in Pingouin is the partial eta-square, which, for one-way ANOVA is the same as eta-square and generalized eta-square. .. math:: \\eta_p^2 = \\frac{SS_{\\text{effect}}}{SS_{\\text{effect}} + SS_{\\text{error}}} Missing values are automatically removed. Results have been tested against R, Matlab and JASP. Examples -------- One-way ANOVA >>> import pingouin as pg >>> df = pg.read_dataset('anova') >>> aov = pg.anova(dv='Pain threshold', between='Hair color', data=df, ... detailed=True) >>> aov.round(3) Source SS DF MS F p-unc np2 0 Hair color 1360.726 3 453.575 6.791 0.004 0.576 1 Within 1001.800 15 66.787 NaN NaN NaN Same but using a standard eta-squared instead of a partial eta-squared effect size. Also note how here we're using the anova function directly as a method (= built-in function) of our pandas dataframe. In that case, we don't have to specify ``data`` anymore. >>> df.anova(dv='Pain threshold', between='Hair color', detailed=False, ... effsize='n2') Source ddof1 ddof2 F p-unc n2 0 Hair color 3 15 6.791407 0.004114 0.575962 Two-way ANOVA with balanced design >>> data = pg.read_dataset('anova2') >>> data.anova(dv="Yield", between=["Blend", "Crop"]).round(3) Source SS DF MS F p-unc np2 0 Blend 2.042 1 2.042 0.004 0.952 0.000 1 Crop 2736.583 2 1368.292 2.525 0.108 0.219 2 Blend * Crop 2360.083 2 1180.042 2.178 0.142 0.195 3 Residual 9753.250 18 541.847 NaN NaN NaN Two-way ANOVA with unbalanced design (requires statsmodels) >>> data = pg.read_dataset('anova2_unbalanced') >>> data.anova(dv="Scores", between=["Diet", "Exercise"], ... effsize="n2").round(3) Source SS DF MS F p-unc n2 0 Diet 390.625 1.0 390.625 7.423 0.034 0.433 1 Exercise 180.625 1.0 180.625 3.432 0.113 0.200 2 Diet * Exercise 15.625 1.0 15.625 0.297 0.605 0.017 3 Residual 315.750 6.0 52.625 NaN NaN NaN Three-way ANOVA, type 3 sums of squares (requires statsmodels) >>> data = pg.read_dataset('anova3') >>> data.anova(dv='Cholesterol', between=['Sex', 'Risk', 'Drug'], ... ss_type=3).round(3) Source SS DF MS F p-unc np2 0 Sex 2.075 1.0 2.075 2.462 0.123 0.049 1 Risk 11.332 1.0 11.332 13.449 0.001 0.219 2 Drug 0.816 2.0 0.408 0.484 0.619 0.020 3 Sex * Risk 0.117 1.0 0.117 0.139 0.711 0.003 4 Sex * Drug 2.564 2.0 1.282 1.522 0.229 0.060 5 Risk * Drug 2.438 2.0 1.219 1.446 0.245 0.057 6 Sex * Risk * Drug 1.844 2.0 0.922 1.094 0.343 0.044 7 Residual 40.445 48.0 0.843 NaN NaN NaN """ assert effsize in ["np2", "n2"], "effsize must be 'np2' or 'n2'." if isinstance(between, list): if len(between) == 0: raise ValueError("between is empty.") elif len(between) == 1: between = between[0] elif len(between) == 2: # Two factors with balanced design = Pingouin implementation # Two factors with unbalanced design = statsmodels return anova2(dv=dv, between=between, data=data, ss_type=ss_type, effsize=effsize) else: # 3 or more factors with (un)-balanced design = statsmodels return anovan(dv=dv, between=between, data=data, ss_type=ss_type, effsize=effsize) # Check data data = _check_dataframe(dv=dv, between=between, data=data, effects="between") # Drop missing values data = data[[dv, between]].dropna() # Reset index (avoid duplicate axis error) data = data.reset_index(drop=True) n_groups = data[between].nunique() N = data[dv].size # Calculate sums of squares grp = data.groupby(between, observed=True, group_keys=False)[dv] # Between effect ssbetween = ( (grp.mean(numeric_only=True) - data[dv].mean(numeric_only=True)) ** 2 * grp.count() ).sum() # Within effect (= error between) # = (grp.var(ddof=0) * grp.count()).sum() sserror = grp.transform(lambda x: (x - x.mean()) ** 2).sum
(data=None, dv=None, between=None, ss_type=2, detailed=False, effsize='np2')
[ -0.013966708444058895, -0.012034682556986809, 0.04783651605248451, -0.03104192577302456, 0.02778230793774128, -0.023983018472790718, -0.013632111251354218, -0.0885925367474556, 0.01592032052576542, 0.016146982088685036, -0.02138179913163185, 0.005153866484761238, 0.04095030203461647, 0.017517749220132828, -0.030048929154872894, 0.07961239665746689, 0.008618559688329697, -0.008472848683595657, 0.07741053402423859, 0.023227477446198463, -0.02840832807123661, 0.001959008863195777, -0.03436630591750145, -0.03859733045101166, 0.005356243345886469, 0.032272376120090485, -0.01551016978919506, -0.043929290026426315, 0.015963494777679443, -0.0032110477332025766, -0.008559196256101131, -0.06385397911071777, -0.05111771821975708, 0.016179362311959267, 0.030200038105249405, -0.04913172870874405, 0.008208408951759338, -0.005526239983737469, -0.025666793808341026, 0.07011417299509048, -0.012585148215293884, -0.025299817323684692, 0.0082731693983078, 0.00924997590482235, -0.0405617393553257, -0.011473423801362514, -0.022968435660004616, 0.07071860134601593, -0.01669744774699211, -0.03460375964641571, 0.011279142461717129, 0.010388683527708054, 0.04032428190112114, 0.022256067022681236, 0.05241293087601662, 0.059018515050411224, -0.01853233203291893, 0.03706466406583786, 0.07300680875778198, -0.08962870389223099, 0.047577470541000366, 0.044253092259168625, 0.022040199488401413, -0.06501966714859009, -0.03140890225768089, -0.019849130883812904, -0.01909358985722065, 0.002803595270961523, 0.008650939911603928, -0.017917105928063393, -0.037021491676568985, 0.023529693484306335, 0.01811138726770878, 0.016211742535233498, 0.0024123331531882286, 0.025429338216781616, -0.007863019593060017, -0.021565288305282593, 0.0134917963296175, 0.010140434838831425, 0.04008682817220688, -0.004606099333614111, -0.0037021490279585123, -0.00742048816755414, -0.006557013373821974, -0.015963494777679443, -0.033610764890909195, 0.003796591656282544, 0.08936966210603714, -0.018791373819112778, 0.030415905639529228, -0.002149243140593171, 0.016406025737524033, -0.021176723763346672, -0.02012976072728634, 0.01977357640862465, -0.008915379643440247, -0.0588889941573143, -0.014376858249306679, -0.027803894132375717, -0.026141704991459846, 0.018931688740849495, 0.02745850384235382, 0.06894847750663757, -0.015153986401855946, -0.0035834212321788073, -0.04379976913332939, 0.04515974223613739, 0.02004341408610344, 0.00045332437730394304, -0.06976877897977829, 0.009967739693820477, -0.057032521814107895, -0.06778278946876526, -0.031387314200401306, -0.03039431944489479, -0.025127122178673744, 0.013167993165552616, -0.10422143340110779, 0.007220809813588858, 0.04168425500392914, 0.04351913928985596, -0.03790655359625816, 0.003891034284606576, 0.03389139473438263, -0.023076368495821953, -0.0024406660813838243, -0.0541398823261261, 0.014117816463112831, -0.03263935446739197, -0.019827544689178467, -0.01598508097231388, -0.0306317750364542, 0.03831670433282852, -0.006583996582776308, -0.007188429124653339, 0.06320636719465256, -0.029466083273291588, 0.019741196185350418, -0.043756596744060516, 0.029746713116765022, 0.0378417931497097, -0.039806198328733444, -0.0889379233121872, 0.01793869212269783, -0.014139402657747269, 0.06359492987394333, -0.00008183618047041818, -0.0028332772199064493, 0.011872781440615654, -0.009843614883720875, -0.006395111791789532, 0.004986567888408899, -0.016211742535233498, 0.0818142518401146, -0.009897582232952118, 0.021802743896842003, -0.060529597103595734, 0.009320133365690708, -0.060443248599767685, -0.05677348002791405, -0.010167418047785759, -0.02540775202214718, 0.040669672191143036, 0.006557013373821974, 0.003054542699828744, -0.03078288398683071, 0.00565576134249568, 0.005585603881627321, -0.040669672191143036, -0.01929866522550583, -0.0006637963815592229, -0.04960663989186287, 0.03859733045101166, -0.015413028188049793, 0.045505132526159286, -0.008791254833340645, -0.0038964308332651854, 0.019525328651070595, -0.057593781501054764, -0.010323923081159592, 0.006756691727787256, -0.03007051721215248, -0.010507411323487759, -0.059968337416648865, -0.009886788204312325, 0.04110141098499298, -0.0014840976800769567, -0.017366640269756317, -0.01971960999071598, -0.021565288305282593, -0.04680034518241882, 0.03404249995946884, -0.005075613968074322, 0.007506835740059614, -0.04641178250312805, -0.0018389319302514195, -0.013167993165552616, 0.0610908567905426, -0.05621222034096718, -0.021878298372030258, 0.007976350374519825, -0.015164779499173164, 0.02333541214466095, -0.026983592659235, 0.025861075147986412, -0.025299817323684692, -0.002491934923455119, -0.019913891330361366, 0.0057906792499125, 0.021424973383545876, 0.007938573136925697, 0.03261776641011238, 0.043540727347135544, 0.03514343127608299, -0.02627122588455677, 0.06156576797366142, 0.0030896214302629232, -0.004800381138920784, 0.037582747638225555, 0.004940696060657501, -0.08358437567949295, -0.06268828362226486, 0.061954330652952194, 0.044166747480630875, 0.03745322674512863, 0.018424397334456444, 0.07067542523145676, 0.04770699143409729, -0.023464933037757874, 0.0034080278128385544, 0.021770363673567772, -0.008694114163517952, 0.0025418545119464397, 0.013664491474628448, 0.05357862263917923, -0.024220474064350128, -0.03915859013795853, -0.04546196013689041, -0.027523266151547432, -0.027177875861525536, -0.04358389973640442, 0.0208745077252388, 0.027803894132375717, -0.03048066794872284, -0.047663819044828415, 0.02161925472319126, 0.03279046341776848, -0.008602369576692581, -0.03367552533745766, 0.046066392213106155, -0.02437158115208149, -0.02912069484591484, 0.034258369356393814, -0.05435575172305107, -0.05478748679161072, 0.03412884846329689, 0.022515110671520233, 0.0415763221681118, -0.05526239797472954, 0.006519236136227846, -0.019827544689178467, -0.011138827539980412, -0.004392928909510374, -0.012380072847008705, 0.032250791788101196, -0.021565288305282593, -0.054873835295438766, 0.033459655940532684, 0.005644967779517174, 0.0007980397786013782, 0.046152736991643906, -0.0018240909557789564, 0.025040775537490845, -0.04468483105301857, 0.05388084053993225, 0.008089681155979633, 0.0222344808280468, 0.02128465846180916, -0.022342415526509285, 0.0007386758807115257, 0.005377830006182194, -0.027652787044644356, 0.010728676803410053, -0.010739469900727272, -0.024501102045178413, -0.012488006614148617, -0.05241293087601662, 0.03246666118502617, 0.016740621998906136, 0.004231027327477932, -0.023076368495821953, 0.0062979706563055515, -0.03404249995946884, 0.0049002207815647125, 0.07033003866672516, -0.013901947066187859, 0.023270651698112488, -0.023831909522414207, 0.019827544689178467, -0.017269499599933624, 0.009730284102261066, 0.07460423558950424, 0.018079007044434547, -0.04213757812976837, 0.0208745077252388, 0.05016789585351944, -0.05206754058599472, 0.050685983151197433, -0.06229972094297409, 0.00785762257874012, 0.03160318359732628, -0.010717883706092834, 0.02627122588455677, 0.028429914265871048, -0.03263935446739197, -0.027890242636203766, -0.012088649906218052, 0.06933704018592834, 0.04943394288420677, -0.05526239797472954, -0.015823179855942726, 0.05422623082995415, -0.053708143532276154, 0.04598004370927811, 0.02810611017048359, 0.04943394288420677, -0.01034550927579403, 0.016967283561825752, 0.014884150587022305, -0.05970929563045502, -0.04835459962487221, 0.031624771654605865, 0.03874843940138817, -0.07516549527645111, -0.012013095431029797, -0.007323347497731447, -0.00830015353858471, 0.03324378654360771, 0.0393744595348835, 0.053535450249910355, 0.0709344670176506, 0.0004128489817958325, -0.03402091562747955, 0.0380144864320755, -0.06419936567544937, 0.028840065002441406, -0.004241820890456438, 0.009536001831293106, 0.03548882156610489, -0.0246090367436409, 0.03192698955535889, 0.019385013729333878, 0.022277655079960823, 0.05578048527240753, 0.005628777667880058, 0.0378417931497097, -0.0050405352376401424, 0.02722104825079441, -0.03263935446739197, -0.0008722446509636939, 0.030221624299883842, -0.0022949546109884977, -0.010744866915047169, 0.04818190634250641, -0.026702964678406715, 0.008418881334364414, -0.030286384746432304, 0.012639115564525127, -0.020777367055416107, -0.023616040125489235, -0.035596758127212524, 0.012185790576040745, -0.032186031341552734, 0.026249639689922333, 0.012552767992019653, 0.0011177953565493226, -0.020896093919873238, 0.03350282832980156, 0.011710879392921925, 0.02126307226717472, 0.0014544157311320305, -0.0831526443362236, 0.050513286143541336, 0.04088554158806801, -0.014614313840866089, -0.02618487924337387, 0.030459079891443253, -0.014484792947769165, -0.01690252311527729, 0.047966036945581436, -0.009509018622338772, 0.06588314473628998, -0.015445409342646599, 0.0319054014980793, 0.017506955191493034, -0.062342893332242966, 0.0045575289987027645, -0.06009785830974579, 0.0016338565619662404, -0.02022690139710903, -0.02873213030397892, 0.006486855912953615, -0.012574354186654091, -0.06683296710252762, -0.08168473094701767, -0.0053427512757480145, -0.002369159599766135, -0.024652210995554924, 0.0259690098464489, 0.014247337356209755, 0.037021491676568985, -0.03807924687862396, 0.004649273119866848, -0.0041392832063138485, 0.04269883781671524, 0.017658064141869545, -0.015531755983829498, 0.010502014309167862, 0.0007184381829574704, 0.08405929058790207, -0.045202914625406265, -0.012747049331665039, 0.03622277453541756, 0.07503597438335419, -0.031149860471487045, -0.06640122830867767, 0.024393169209361076, -0.00035618344554677606, 0.0019104384118691087, 0.05470114201307297, 0.006880816537886858, -0.00985980499535799, -0.046152736991643906, -0.031775880604982376, -0.014894943684339523, -0.0514199361205101, 0.00904490053653717, 0.05772330239415169, 0.05970929563045502, 0.01766885630786419, 0.04045380279421806, 0.027501678094267845, 0.043929290026426315, -0.04675716906785965, -0.011419456452131271, 0.03611484169960022, -0.042353447526693344, -0.05815504118800163, -0.0639835000038147, 0.054873835295438766, 0.023767149075865746, 0.04000047966837883, 0.02066943235695362, -0.050685983151197433, 0.021565288305282593, 0.007339537609368563, -0.022191306576132774, -0.059968337416648865, 0.029401322826743126, -0.00728017371147871, 0.0029816869646310806, -0.0682145208120346, 0.03199175000190735, -0.04451213404536247, 0.005747505463659763, 0.05945025384426117, 0.0017903614789247513, 0.002401539823040366, 0.004711335524916649, -0.0417490154504776, -0.06268828362226486, -0.039892543107271194, -0.005056725349277258, 0.03926652669906616, 0.054960183799266815, 0.000685720588080585, -0.032186031341552734, 0.012552767992019653, 0.043756596744060516, 0.031948573887348175, -0.0022598758805543184, 0.02333541214466095, 0.016557132825255394, 0.012218170799314976, 0.01039408054202795, -0.0009511716780252755, -0.005229420494288206, -0.04308740049600601, -0.022428762167692184, 0.014031468890607357, -0.03943921998143196, -0.010966132394969463, 0.0543125756084919, -0.04572100192308426, 0.03348124399781227, 0.01892089657485485, -0.003227237844839692, 0.023875083774328232, -0.06575362384319305, 0.04468483105301857, -0.010825817473232746, -0.0588889941573143, -0.037410054355859756, 0.0017714728601276875, 0.006583996582776308, -0.01059915591031313, 0.019762784242630005, -0.01956850290298462, 0.0023313823621720076, 0.00260931346565485, -0.018640266731381416, 0.0378417931497097, 0.022083373740315437, 0.04284994676709175, 0.033610764890909195, 0.005520843435078859, 0.014884150587022305, 0.013869566842913628, -0.002908831462264061, 0.017604095861315727, -0.08794492483139038, -0.012088649906218052, -0.0003990198893006891, 0.002205908764153719, 0.029401322826743126, -0.012606734409928322, 0.028278805315494537, 0.0044765779748559, -0.038683678954839706, 0.03600690886378288, -0.01719394512474537, 0.0442962683737278, 0.041468385607004166, 0.01687014289200306, -0.006664947606623173, -0.0063735246658325195, -0.047188907861709595, 0.0045143552124500275, 0.03786337748169899, -0.007706514094024897, 0.004236424341797829, -0.05340592935681343, -0.033610764890909195, 0.005323863122612238, -0.008111268281936646, 0.024004604667425156, -0.0632927194237709, 0.008321740664541721, -0.03324378654360771, -0.0030356543138623238, -0.017712030559778214, 0.06976877897977829, 0.0877290591597557, 0.05957977473735809, 0.04144680127501488, 0.01598508097231388, -0.01206706278026104, 0.008947759866714478, -0.033848218619823456, -0.018845342099666595, -0.09230547398328781, 0.01669744774699211, -0.06812817603349686, -0.029336562380194664, 0.04112299531698227, 0.03477645665407181, 0.07011417299509048, -0.04692986607551575, -0.040604911744594574, -0.020777367055416107, 0.03803607448935509, -0.028559435158967972, -0.019859924912452698, -0.06825769692659378, -0.013265134766697884, 0.014139402657747269, -0.0071236686781048775, -0.01915835216641426, 0.042677249759435654, -0.03032955899834633, -0.044101983308792114, -0.018305670469999313, -0.012531180866062641, -0.01675141416490078, 0.05349227413535118, -0.033934567123651505, 0.04857046902179718, -0.003340568859130144, 0.05474431440234184, -0.04783651605248451, -0.043303269892930984, -0.05103137344121933, -0.051074545830488205, -0.03307109326124191, 0.05500335618853569, 0.014711455442011356, -0.02268780581653118, 0.061220377683639526, 0.019460568204522133, -0.02873213030397892, 0.011667706072330475, 0.02069101855158806, -0.04172742739319801, 0.03594214469194412, 0.026055358350276947, 0.051851674914360046, 0.004298486281186342, 0.014787008985877037, -0.00947663839906454, 0.028796890750527382, 0.047577470541000366, -0.0015434615779668093, -0.04054015129804611, -0.013804806396365166, -0.0019158351933583617, -0.060918159782886505, -0.0069725606590509415, -0.0036050081253051758, 0.01607142761349678, -0.030264798551797867, 0.0346253477036953, -0.013340688310563564, 0.03419360890984535, -0.017658064141869545, -0.0033621557522565126, 0.04269883781671524, -0.05785282328724861, -0.07106399536132812, -0.11346061527729034, -0.01270387601107359, 0.06596948951482773, -0.005823059473186731, -0.011840401217341423, -0.01064232923090458, -0.016373643651604652, 0.04658447578549385, 0.04675716906785965, -0.02722104825079441, 0.009832821786403656, 0.011775639839470387, -0.06471744924783707, 0.0141717828810215, 0.06389714777469635, 0.039870958775281906, 0.03611484169960022, -0.04658447578549385, -0.03723735734820366, -0.0008054602658376098, 0.025688381865620613, 0.04895903170108795, -0.019233904778957367, -0.09765902161598206, 0.0009882741142064333, -0.005957977380603552, 0.06031372770667076, 0.04252614453434944, -0.0035942145623266697, 0.00565576134249568, -0.004320073407143354, -0.018424397334456444, -0.024328408762812614, -0.03324378654360771, 0.03015686385333538, 0.1223544031381607, 0.030372733250260353, 0.03738846629858017, 0.03287681192159653, -0.0017849646974354982, 0.08695193380117416, 0.007593183312565088, 0.0344526506960392, -0.02357286773622036, 0.047663819044828415, 0.0402163490653038, -0.032272376120090485, 0.018672646954655647, 0.027717547491192818, -0.0537944920361042, -0.00437404029071331, 0.011279142461717129, 0.04580734670162201, 0.047188907861709595, -0.09446416050195694, 0.03032955899834633, -0.037345293909311295, 0.02540775202214718, -0.02810611017048359, -0.0058014728128910065, -0.049649812281131744, -0.07861939817667007, -0.02493284083902836, -0.012423246167600155, 0.027976589277386665, -0.008440468460321426, -0.057895999401807785, -0.0001281720760744065, 0.008888395503163338, -0.023464933037757874, 0.0022140038199722767, 0.009336323477327824, -0.05150628462433815, 0.02784706838428974, 0.0015353665221482515, -0.019946271553635597, 0.06782595813274384, -0.02245035022497177, -0.006546219810843468, 0.0378417931497097, -0.06065911799669266, -0.04926124960184097, 0.04284994676709175, 0.013167993165552616, 0.021662428975105286, 0.013901947066187859, 0.026487095281481743, -0.022903673350811005, 0.015736831352114677, -0.05534874647855759, 0.04960663989186287, 0.021478939801454544, 0.015974286943674088, 0.014182576909661293, -0.041856952011585236, -0.04397246241569519, 0.029897822067141533, 0.0025175693444907665, 0.0052321190014481544, 0.020410390570759773, -0.05690300092101097, 0.06596948951482773, 0.018791373819112778, 0.01052899844944477, -0.033049505203962326, -0.022558284923434258, 0.024565864354372025, -0.037582747638225555, -0.022882087156176567, -0.012380072847008705, 0.025602033361792564, 0.013114026747643948, -0.016287297010421753, -0.038295116275548935, -0.10560299456119537, -0.018877722322940826, 0.05042693763971329, 0.031236207112669945, 0.03661134093999863, 0.010037897154688835, -0.044080398976802826, 0.03255300596356392, -0.030264798551797867, 0.048225078731775284, 0.04302264004945755, 0.033222198486328125, 0.025040775537490845, 0.05957977473735809, -0.04645495489239693, 0.00012985854118596762, -0.037194184958934784, -0.02484649233520031, -0.011797226965427399, 0.045591481029987335, 0.06260193884372711, 0.03494914993643761, 0.00423912238329649, -0.015024464577436447, 0.029336562380194664 ]
31,975
pingouin.bayesian
bayesfactor_binom
Bayes factor of a binomial test with :math:`k` successes, :math:`n` trials and base probability :math:`p`. This means that the null hypothesis is that the probability is :math:`p`. It is compared against the alternative hypothesis that :math:`p` is from the Beta distribution with parameters :math:`(a, b)`. By default, both :math:`a` and :math:`b` are 1, making the alternative hypothesis equivalent to the uniform distribution, i.e., we are completely uninformed about :math:`p`. Parameters ---------- k : int Number of successes. n : int Number of trials. p : float Base probability of success (range from 0 to 1). a : float The "a" parameter of the Beta distribution. b : float The "b" parameter of the Beta distribution. Returns ------- bf10 : float The Bayes Factor quantifies the evidence in favour of the alternative hypothesis, where the null hypothesis is that the random variable is binomially distributed with base probability :math:`p`. See also -------- bayesfactor_pearson : Bayes Factor of a correlation bayesfactor_ttest : Bayes Factor of a T-test Notes ----- Adapted from a Matlab code found at https://github.com/anne-urai/Tools/blob/master/stats/BayesFactors/binombf.m The Bayes Factor is given by the formula below: .. math:: BF_{10} = \frac{\int_0^1 \binom{n}{k}g^k(1-g)^{n-k}} {\binom{n}{k} p^k (1-p)^{n-k}} References ---------- * http://pcl.missouri.edu/bf-binomial * https://en.wikipedia.org/wiki/Bayes_factor Examples -------- We want to determine if a coin if fair. After tossing the coin 200 times in a row, we report 115 heads (hereafter referred to as "successes") and 85 tails ("failures"). The Bayes Factor can be easily computed using Pingouin: >>> import pingouin as pg >>> bf = float(pg.bayesfactor_binom(k=115, n=200, p=0.5)) >>> # Note that Pingouin returns the BF-alt by default. >>> # BF-null is simply 1 / BF-alt >>> print("BF-null: %.3f, BF-alt: %.3f" % (1 / bf, bf)) BF-null: 1.197, BF-alt: 0.835 Since the Bayes Factor of the null hypothesis ("the coin is fair") is higher than the Bayes Factor of the alternative hypothesis ("the coin is not fair"), we can conclude that there is more evidence to support the fact that the coin is indeed fair. However, the strength of the evidence in favor of the null hypothesis (1.197) is "barely worth mentionning" according to Jeffreys's rule of thumb. Interestingly, a frequentist alternative to this test would give very different results. It can be performed using the :py:func:`scipy.stats.binom_test` function: >>> from scipy.stats import binomtest >>> result = binomtest(k=115, n=200, p=0.5) >>> round(result.pvalue, 5) 0.04004 The binomial test rejects the null hypothesis that the coin is fair at the 5% significance level (p=0.04). Thus, whereas a frequentist hypothesis test would yield significant results at the 5% significance level, the Bayes factor indicates preference of the null hypothesis to the alternative hypothesis that we know nothing about p. We can use a more informed alternative hypothesis too, if desirable. E.g., the original test using Beta(5, 4) as the alternative hypothesis: >>> bf = pg.bayesfactor_binom(k=115, n=200, p=0.5, a=5, b=4) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 1.930 Using a different base probability of successes: >>> bf = pg.bayesfactor_binom(k=100, n=1000, p=0.1) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 0.024
def bayesfactor_binom(k, n, p=0.5, a=1, b=1): """ Bayes factor of a binomial test with :math:`k` successes, :math:`n` trials and base probability :math:`p`. This means that the null hypothesis is that the probability is :math:`p`. It is compared against the alternative hypothesis that :math:`p` is from the Beta distribution with parameters :math:`(a, b)`. By default, both :math:`a` and :math:`b` are 1, making the alternative hypothesis equivalent to the uniform distribution, i.e., we are completely uninformed about :math:`p`. Parameters ---------- k : int Number of successes. n : int Number of trials. p : float Base probability of success (range from 0 to 1). a : float The "a" parameter of the Beta distribution. b : float The "b" parameter of the Beta distribution. Returns ------- bf10 : float The Bayes Factor quantifies the evidence in favour of the alternative hypothesis, where the null hypothesis is that the random variable is binomially distributed with base probability :math:`p`. See also -------- bayesfactor_pearson : Bayes Factor of a correlation bayesfactor_ttest : Bayes Factor of a T-test Notes ----- Adapted from a Matlab code found at https://github.com/anne-urai/Tools/blob/master/stats/BayesFactors/binombf.m The Bayes Factor is given by the formula below: .. math:: BF_{10} = \\frac{\\int_0^1 \\binom{n}{k}g^k(1-g)^{n-k}} {\\binom{n}{k} p^k (1-p)^{n-k}} References ---------- * http://pcl.missouri.edu/bf-binomial * https://en.wikipedia.org/wiki/Bayes_factor Examples -------- We want to determine if a coin if fair. After tossing the coin 200 times in a row, we report 115 heads (hereafter referred to as "successes") and 85 tails ("failures"). The Bayes Factor can be easily computed using Pingouin: >>> import pingouin as pg >>> bf = float(pg.bayesfactor_binom(k=115, n=200, p=0.5)) >>> # Note that Pingouin returns the BF-alt by default. >>> # BF-null is simply 1 / BF-alt >>> print("BF-null: %.3f, BF-alt: %.3f" % (1 / bf, bf)) BF-null: 1.197, BF-alt: 0.835 Since the Bayes Factor of the null hypothesis ("the coin is fair") is higher than the Bayes Factor of the alternative hypothesis ("the coin is not fair"), we can conclude that there is more evidence to support the fact that the coin is indeed fair. However, the strength of the evidence in favor of the null hypothesis (1.197) is "barely worth mentionning" according to Jeffreys's rule of thumb. Interestingly, a frequentist alternative to this test would give very different results. It can be performed using the :py:func:`scipy.stats.binom_test` function: >>> from scipy.stats import binomtest >>> result = binomtest(k=115, n=200, p=0.5) >>> round(result.pvalue, 5) 0.04004 The binomial test rejects the null hypothesis that the coin is fair at the 5% significance level (p=0.04). Thus, whereas a frequentist hypothesis test would yield significant results at the 5% significance level, the Bayes factor indicates preference of the null hypothesis to the alternative hypothesis that we know nothing about p. We can use a more informed alternative hypothesis too, if desirable. E.g., the original test using Beta(5, 4) as the alternative hypothesis: >>> bf = pg.bayesfactor_binom(k=115, n=200, p=0.5, a=5, b=4) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 1.930 Using a different base probability of successes: >>> bf = pg.bayesfactor_binom(k=100, n=1000, p=0.1) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 0.024 """ from scipy.stats import beta, binom assert 0 < p < 1, "p must be between 0 and 1." assert isinstance(k, int), "k must be int." assert isinstance(n, int), "n must be int." assert k <= n, "k (successes) cannot be higher than n (trials)." assert a > 0, "a must be positive." assert b > 0, "b must be positive." def fun(g): return beta.pdf(g, a, b) * binom.pmf(k, n, g) bf10 = quad(fun, 0, 1)[0] / binom.pmf(k, n, p) return bf10
(k, n, p=0.5, a=1, b=1)
[ -0.004185827448964119, -0.030865095555782318, -0.05216258391737938, 0.009816363453865051, 0.018331531435251236, -0.03880620747804642, -0.08120983839035034, -0.04133205488324165, -0.02644486166536808, -0.009797228500247002, 0.0088978735730052, 0.0668201595544815, 0.011375882662832737, 0.034194622188806534, -0.059395693242549896, 0.012763185426592827, 0.07711490243673325, 0.019183048978447914, 0.006941298022866249, 0.03274034708738327, -0.006271565333008766, 0.049177493900060654, 0.012246535159647465, 0.07432115823030472, 0.0007869355613365769, -0.020742569118738174, 0.004503950476646423, 0.00017266538634430617, -0.04064318910241127, 0.0354575477540493, 0.010600906796753407, -0.08404184877872467, 0.04546526074409485, -0.025430696085095406, 0.014169624075293541, 0.0015846346504986286, 0.06008456274867058, 0.05258356034755707, -0.09988579899072647, -0.013212863355875015, 0.10026850551366806, -0.06984352320432663, 0.014303570613265038, 0.018015801906585693, 0.006491620559245348, -0.03473040834069252, 0.014427948743104935, 0.06842751801013947, -0.04293941333889961, 0.025124531239271164, -0.05560692399740219, -0.07160396128892899, 0.05644887313246727, -0.014035677537322044, -0.057405631989240646, 0.011356747709214687, -0.045580074191093445, -0.03348661959171295, -0.0006978372111916542, 0.052698370069265366, -0.00048705091467127204, 0.022196844220161438, 0.030482390895485878, -0.039265453815460205, 0.013155457563698292, 0.01223696768283844, -0.03899756073951721, 0.001917109009809792, 0.027765192091464996, 0.04492947459220886, 0.03503657132387161, 0.046383753418922424, -0.0069173788651824, 0.07788030803203583, -0.0633758157491684, 0.061003051698207855, 0.003104687901213765, 0.03381191939115524, -0.04626893997192383, 0.03995431959629059, 0.06528934091329575, 0.02252214401960373, 0.02455047518014908, -0.10562636703252792, 0.013098051771521568, -0.0276121087372303, 0.03274034708738327, 0.004523085430264473, 0.07064720243215561, 0.02361285127699375, -0.05200950428843498, -0.034960031509399414, 0.10600906610488892, 0.031764451414346695, 0.025373289361596107, -0.06502144783735275, 0.019450942054390907, 0.047914568334817886, -0.01855158619582653, -0.014370543882250786, -0.021393166854977608, -0.0075775436125695705, -0.02958303689956665, 0.038519181311130524, 0.028568869456648827, 0.03469213843345642, -0.04691953584551811, -0.026215238496661186, 0.010773124173283577, -0.02411036565899849, -0.07772722840309143, 0.0019912580028176308, 0.008668250404298306, -0.036529116332530975, -0.0553773008286953, -0.0028224436100572348, -0.024952314794063568, 0.03304651007056236, -0.002626307774335146, 0.025775128975510597, 0.014877626672387123, 0.015958765521645546, 0.006458133924752474, -0.007032189983874559, 0.04711088910698891, -0.015422980301082134, 0.06643745303153992, 0.01241875160485506, -0.001080541405826807, 0.018704669550061226, 0.04492947459220886, 0.016111847013235092, 0.025105396285653114, 0.02045554108917713, -0.03230023756623268, -0.03266380354762077, 0.0036524333991110325, -0.0002001722459681332, 0.0295639019459486, -0.0355914942920208, 0.039303723722696304, -0.04776148498058319, 0.02409123070538044, -0.044738125056028366, 0.020283322781324387, -0.004716829396784306, 0.056334059685468674, -0.06107959523797035, 0.00887395441532135, -0.0015248371055349708, 0.02925773710012436, -0.01784358359873295, -0.009816363453865051, -0.061041321605443954, 0.011605505831539631, -0.01974753849208355, 0.07198666036128998, -0.07275207340717316, -0.04967500641942024, -0.021546248346567154, 0.016685904935002327, 0.022043762728571892, 0.0032194992527365685, 0.006525107193738222, -0.007888490334153175, 0.03406067565083504, -0.02328755147755146, 0.02724854089319706, 0.05457362160086632, -0.06352890282869339, -0.02918119728565216, -0.00891222432255745, -0.0629931166768074, 0.016475416719913483, 0.011318476870656013, -0.0000802781869424507, -0.024722693488001823, -0.04925403371453285, 0.027382487431168556, -0.0020797583274543285, 0.009816363453865051, -0.01889602094888687, -0.044776394963264465, -0.04293941333889961, -0.025430696085095406, 0.01660936325788498, 0.025449831038713455, 0.03270207718014717, -0.015643034130334854, 0.008960062637925148, -0.04925403371453285, -0.018264558166265488, 0.0669349655508995, 0.05373167246580124, -0.034137215465307236, 0.00008797712507657707, 0.014667139388620853, 0.017613962292671204, -0.002977917203679681, -0.018360234797000885, 0.04867997765541077, 0.016733741387724876, 0.0019027575617656112, 0.021201813593506813, 0.0028702816925942898, 0.004506342113018036, -0.0553007610142231, -0.015585629269480705, 0.027899138629436493, -0.049560196697711945, 0.0032123236451298, -0.061003051698207855, -0.023459767922759056, 0.035323601216077805, 0.004535045009106398, -0.042441897094249725, 0.08572574704885483, -0.012189129367470741, -0.052239127457141876, -0.005807536654174328, 0.038500044494867325, 0.01517422217875719, 0.06444738805294037, 0.030310174450278282, 0.029372548684477806, 0.06605474650859833, 0.02640659175813198, 0.036950092762708664, 0.02690410614013672, 0.007118298672139645, -0.00007676508539589122, 0.034500785171985626, 0.005099533591419458, -0.043283846229314804, -0.03754328563809395, -0.034137215465307236, 0.02248387224972248, -0.02994660474359989, -0.06073515862226486, -0.015269898809492588, 0.044814664870500565, -0.023555444553494453, 0.017269527539610863, 0.021240083500742912, -0.024244312196969986, -0.009921606630086899, 0.02206289768218994, -0.02965957671403885, -0.04071972891688347, 0.00032978339004330337, -0.05001944303512573, -0.04933057352900505, 0.06211289390921593, -0.010610474273562431, 0.062495600432157516, -0.01743217743933201, -0.03184099122881889, -0.003365405136719346, 0.0177479088306427, 0.07772722840309143, 0.02876022271811962, 0.018771642819046974, -0.05319588631391525, 0.007945896126329899, -0.0055252923630177975, 0.00011137290857732296, -0.04255671054124832, 0.01974753849208355, 0.033027373254299164, -0.0067116753198206425, 0.09368599206209183, -0.05595135688781738, 0.017518285661935806, -0.0015224452363327146, -0.025583777576684952, -0.004755099769681692, 0.015135952271521091, 0.0296787116676569, 0.0020319202449172735, -0.015566494315862656, -0.0014339449116960168, -0.040490105748176575, 0.008610844612121582, 0.040107402950525284, -0.03115212358534336, 0.01853245124220848, -0.03980123996734619, -0.030654607340693474, 0.045924507081508636, -0.033371809870004654, -0.00925187487155199, -0.027860866859555244, 0.019996294751763344, 0.05652541294693947, -0.018771642819046974, 0.0036093792878091335, 0.03044412098824978, -0.049483656883239746, 0.0593574233353138, -0.032548993825912476, 0.04963673651218414, -0.0028774573002010584, 0.05484151467680931, -0.013184159994125366, -0.004960803315043449, -0.0014937424566596746, 0.07573716342449188, -0.012897131964564323, -0.036490846425294876, 0.012246535159647465, -0.04447023198008537, -0.01573871076107025, 0.048029378056526184, -0.010352149605751038, -0.005654454696923494, -0.11649516224861145, 0.03186012804508209, -0.023153604939579964, -0.0006625566747970879, -0.011404586024582386, -0.002965957624837756, 0.009835498407483101, 0.046039316803216934, 0.040834538638591766, -0.033429212868213654, -0.027937408536672592, 0.029506495222449303, -0.01263880729675293, -0.010323446244001389, -0.036127276718616486, -0.007257028948515654, 0.0315922349691391, 0.025124531239271164, 0.0828937366604805, -0.0909305214881897, 0.05396129563450813, 0.005707076750695705, 0.01784358359873295, -0.02638745680451393, -0.05679330602288246, 0.02883676253259182, -0.014571462757885456, -0.05105274170637131, 0.00583623955026269, 0.020417269319295883, 0.007185271941125393, -0.0177479088306427, 0.008185086771845818, 0.04619240015745163, 0.023096200078725815, 0.05472670495510101, -0.04014567285776138, 0.04182957112789154, 0.029774388298392296, 0.017585258930921555, -0.0034706490114331245, 0.024186907336115837, -0.015346439555287361, 0.005467886570841074, 0.0473022423684597, 0.0065298909321427345, 0.03599333018064499, -0.019575320184230804, 0.014619301073253155, 0.009959877468645573, 0.023364093154668808, 0.0012533563422039151, 0.06077342852950096, 0.023498039692640305, -0.010208634659647942, 0.08174562454223633, -0.03352488949894905, -0.043283846229314804, 0.013145890086889267, 0.038079071789979935, 0.01896299421787262, -0.021393166854977608, -0.030176227912306786, 0.009395388886332512, 0.020206782966852188, 0.01930742710828781, -0.03463473170995712, -0.04646029323339462, 0.02566031739115715, -0.036089006811380386, -0.00969676859676838, 0.013662540353834629, -0.01814018003642559, 0.00930927973240614, -0.03323786333203316, -0.02485664002597332, 0.03358229622244835, 0.029850929975509644, -0.007218758575618267, -0.034577324986457825, 0.009940742515027523, 0.10554982721805573, -0.0513206347823143, -0.01167247910052538, -0.03580198064446449, 0.04856516420841217, 0.03130520507693291, -0.061041321605443954, -0.0037433255929499865, -0.03406067565083504, -0.009108360856771469, -0.042786333709955215, 0.011404586024582386, -0.04060491919517517, 0.03895929083228111, -0.004960803315043449, 0.003492176067084074, -0.040069133043289185, -0.025335019454360008, -0.04370482265949249, -0.0019338522106409073, -0.045924507081508636, -0.08442454785108566, 0.016743309795856476, -0.03348661959171295, 0.05216258391737938, -0.016733741387724876, 0.03658652305603027, -0.004475247580558062, 0.03308477997779846, 0.026196103543043137, 0.025488100945949554, -0.012705780565738678, -0.02361285127699375, 0.010935773141682148, 0.023746797814965248, -0.0669732391834259, -0.08036788552999496, -0.009400172159075737, 0.026751024648547173, -0.017489582300186157, -0.04492947459220886, -0.006161537952721119, -0.0025258478708565235, -0.018264558166265488, 0.007529705762863159, 0.021546248346567154, 0.06502144783735275, 0.000023545278963865712, 0.029066385701298714, 0.00015965942293405533, 0.02962130680680275, -0.007941112853586674, -0.0088978735730052, -0.047952838242053986, 0.01693466119468212, -0.028568869456648827, 0.04064318910241127, 0.04251844063401222, 0.007706706412136555, 0.01744174398481846, -0.01399740669876337, -0.005099533591419458, 0.030137958005070686, 0.030673744156956673, 0.016791148111224174, 0.03987777978181839, -0.04217400401830673, 0.038519181311130524, 0.0177766103297472, -0.00849124975502491, 0.04933057352900505, 0.001808277447707951, 0.062151163816452026, 0.0472257025539875, -0.00602280767634511, 0.04374309256672859, -0.00145308009814471, -0.014724545180797577, -0.0018573114648461342, 0.007969815284013748, -0.061041321605443954, -0.008390789851546288, 0.0061137001030147076, -0.004245624877512455, -0.004293463192880154, 0.03804079815745354, 0.011758587323129177, 0.006161537952721119, 0.006606431677937508, -0.05572173371911049, -0.005702293012291193, 0.04366655275225639, 0.043283846229314804, -0.036433443427085876, -0.005774050019681454, -0.012169994413852692, 0.039686426520347595, 0.048794787377119064, -0.04864170774817467, -0.047149159014225006, 0.009912039153277874, 0.03865312784910202, 0.0036524333991110325, -0.04071972891688347, -0.023057930171489716, 0.026559673249721527, -0.040528375655412674, -0.04462331160902977, -0.048029378056526184, -0.04867997765541077, -0.0158535223454237, -0.021814141422510147, 0.01004598569124937, 0.022675225511193275, -0.001853723544627428, -0.05989320948719978, -0.007668436039239168, -0.0472257025539875, -0.0006446174229495227, 0.010179932229220867, 0.024263447150588036, -0.044393688440322876, -0.04102589190006256, -0.012868429534137249, 0.09330328553915024, 0.02489490993320942, 0.02455047518014908, -0.03075028397142887, 0.013337242417037487, -0.006912595126777887, -0.028626276180148125, -0.009758957661688328, 0.014447084628045559, 0.02246473729610443, -0.03245331719517708, -0.03804079815745354, -0.01538470946252346, 0.027765192091464996, -0.03264467045664787, -0.021182678639888763, -0.048029378056526184, -0.003336702473461628, 0.013260701671242714, 0.022426467388868332, -0.02210116945207119, 0.024990584701299667, 0.0908539816737175, 0.012131723575294018, 0.019651861861348152, 0.07390018552541733, -0.018675966188311577, 0.010993178933858871, 0.005955834407359362, -0.001808277447707951, 0.05292799323797226, -0.028549734503030777, 0.002953998278826475, 0.0157578457146883, 0.04848862439393997, -0.011232368648052216, 0.010514798574149609, 0.017537420615553856, -0.0031238230876624584, -0.026999782770872116, -0.06042899563908577, 0.02566031739115715, 0.029831793159246445, -0.013920865952968597, -0.0007367056095972657, 0.01402611006051302, -0.026368319988250732, -0.015710007399320602, 0.0003351651830598712, 0.0005046912119723856, 0.04649856314063072, 0.02330668643116951, -0.046383753418922424, -0.03584025055170059, -0.009558037854731083, -0.014877626672387123, -0.051129285246133804, -0.048756517469882965, -0.03084596060216427, 0.008754358626902103, -0.044393688440322876, 0.0042671519331634045, -0.0076205977238714695, -0.015585629269480705, -0.005018209107220173, 0.02688497118651867, -0.016714606434106827, -0.012122156098484993, -0.012590968981385231, 0.0394950769841671, -0.07363229244947433, -0.01579611748456955, 0.013576432131230831, -0.07152742147445679, -0.028568869456648827, -0.015002005733549595, -0.011902101337909698, -0.021546248346567154, -0.022770900279283524, -0.02885589748620987, 0.060620348900556564, 0.013853892683982849, -0.000044810778490500525, 0.009988579899072647, 0.0296404417604208, 0.05005771294236183, -0.05384648218750954, -0.018216721713542938, 0.03034844435751438, 0.006620782893151045, -0.026999782770872116, 0.013174592517316341, -0.00925187487155199, 0.054688431322574615, -0.020838245749473572, -0.014255732297897339, -0.011155827902257442, -0.027076324447989464, 0.02847319468855858, 0.017154715955257416, -0.02847319468855858, 0.015882225707173347, 0.02835838310420513, 0.06111786514520645, -0.015107248909771442, -0.09238480031490326, 0.013423350639641285, -0.07324958592653275, 0.02608129195868969, -0.0013538161292672157, 0.017566123977303505, 0.05220085754990578, 0.036089006811380386, -0.03130520507693291, -0.019613591954112053, 0.01438011135905981, 0.00872087199240923, -0.015700440853834152, -0.007414894178509712, 0.05262183025479317, -0.03390759229660034, 0.03976297006011009, -0.008271194994449615, -0.04255671054124832, 0.031075581908226013, 0.0007277359836734831, -0.07363229244947433, 0.00025085065863095224, 0.07837782800197601, -0.03478781506419182, -0.01901083253324032, -0.04182957112789154, -0.0079076262190938, 0.0020522514823824167, -0.0078645721077919, 0.008668250404298306, 0.06624609977006912, 0.06414122879505157, -0.01972840167582035, -0.03482608497142792, -0.0553007610142231, -0.05250702053308487, -0.003992083482444286, 0.017173852771520615, -0.03115212358534336, 0.04986635968089104, 0.017049472779035568, -0.0514354482293129, -0.08182216435670853, -0.017508717253804207, 0.024206042289733887, 0.025392424315214157, -0.029372548684477806, -0.08442454785108566, -0.05553038418292999, 0.03595506027340889, -0.06509798765182495, 0.046001046895980835, -0.001033899374306202, -0.009979012422263622, 0.08840467780828476, -0.02129749022424221, -0.009285361506044865, 0.012409184128046036, 0.0668201595544815, 0.027497299015522003, -0.0028296192176640034, 0.024225177243351936, -0.09896731376647949, -0.027707785367965698, -0.03130520507693291, -0.030214497819542885, 0.028702815994620323, 0.029736118391156197, 0.006855189334601164, 0.05602789670228958, -0.02412950061261654, 0.012284805066883564, 0.023823337629437447, -0.006166321691125631, -0.010629610158503056, -0.018771642819046974, -0.02137403003871441, 0.01814018003642559, -0.06046726554632187, 0.025468965992331505, -0.034921761602163315, -0.01624579355120659, -0.011528965085744858, -0.002036703983321786, -0.0553773008286953, 0.028970709070563316, 0.008553439751267433, -0.08327643573284149, 0.005295669659972191, 0.04458504170179367, -0.04500601813197136, 0.025928210467100143, -0.07171876728534698, -0.019039535894989967, -0.01972840167582035, 0.02686583623290062, 0.05327242612838745, 0.0055061569437384605, 0.00925187487155199, -0.0314965583384037, 0.040069133043289185, -0.038901884108781815, 0.014504490420222282, -0.013021511025726795, 0.033333536237478256, -0.004932100418955088, -0.040834538638591766, -0.047608405351638794, -0.015250762924551964, -0.045273907482624054, -0.004960803315043449, -0.06972870975732803, 0.04504428803920746, -0.028109624981880188, 0.014887194149196148, -0.00016608765872661024, 0.012169994413852692, 0.012055182829499245, 0.042786333709955215, 0.02680843137204647, 0.017853152006864548, -0.014667139388620853, 0.037734635174274445, -0.018455911427736282, 0.0027865651063621044, -0.014265299774706364, 0.0009442030568607152, 0.06222770735621452, 0.03830869123339653, 0.03274034708738327, 0.04806765168905258, -0.039341993629932404, -0.04623067006468773, -0.05889818072319031, -0.05044041574001312, 0.008830900304019451, 0.021240083500742912, 0.00432934146374464, 0.03239591047167778, 0.018379369750618935, 0.03312304988503456, 0.015002005733549595 ]
31,976
pingouin.bayesian
bayesfactor_pearson
Bayes Factor of a Pearson correlation. Parameters ---------- r : float Pearson correlation coefficient. n : int Sample size. alternative : string Defines the alternative hypothesis, or tail of the correlation. Must be one of "two-sided" (default), "greater" or "less". Both "greater" and "less" return a one-sided p-value. "greater" tests against the alternative hypothesis that the correlation is positive (greater than zero), "less" tests against the hypothesis that the correlation is negative. method : str Method to compute the Bayes Factor. Can be "ly" (default) or "wetzels". The former has an exact analytical solution, while the latter requires integral solving (and is therefore slower). "wetzels" was the default in Pingouin <= 0.2.5. See Notes for details. kappa : float Kappa factor. This is sometimes called the *rscale* parameter, and is only used when ``method`` is "ly". Returns ------- bf : float Bayes Factor (BF10). The Bayes Factor quantifies the evidence in favour of the alternative hypothesis. See also -------- corr : (Robust) correlation between two variables pairwise_corr : Pairwise correlation between columns of a pandas DataFrame bayesfactor_ttest : Bayes Factor of a T-test bayesfactor_binom : Bayes Factor of a binomial test Notes ----- To compute the Bayes Factor directly from the raw data, use the :py:func:`pingouin.corr` function. The two-sided **Wetzels Bayes Factor** (also called *JZS Bayes Factor*) is calculated using the equation 13 and associated R code of [1]_: .. math:: \text{BF}_{10}(n, r) = \frac{\sqrt{n/2}}{\gamma(1/2)}* \int_{0}^{\infty}e((n-2)/2)* log(1+g)+(-(n-1)/2)log(1+(1-r^2)*g)+(-3/2)log(g)-n/2g where :math:`n` is the sample size, :math:`r` is the Pearson correlation coefficient and :math:`g` is is an auxiliary variable that is integrated out numerically. Since the Wetzels Bayes Factor requires solving an integral, it is slower than the analytical solution described below. The two-sided **Ly Bayes Factor** (also called *Jeffreys exact Bayes Factor*) is calculated using equation 25 of [2]_: .. math:: \text{BF}_{10;k}(n, r) = \frac{2^{\frac{k-2}{k}}\sqrt{\pi}} {\beta(\frac{1}{k}, \frac{1}{k})} \cdot \frac{\Gamma(\frac{2+k(n-1)}{2k})}{\Gamma(\frac{2+nk}{2k})} \cdot 2F_1(\frac{n-1}{2}, \frac{n-1}{2}, \frac{2+nk}{2k}, r^2) The one-sided version is described in eq. 27 and 28 of Ly et al, 2016. Please take note that the one-sided test requires the `mpmath <http://mpmath.org/>`_ package. Results have been validated against JASP and the BayesFactor R package. References ---------- .. [1] Ly, A., Verhagen, J. & Wagenmakers, E.-J. Harold Jeffreys’s default Bayes factor hypothesis tests: Explanation, extension, and application in psychology. J. Math. Psychol. 72, 19–32 (2016). .. [2] Wetzels, R. & Wagenmakers, E.-J. A default Bayesian hypothesis test for correlations and partial correlations. Psychon. Bull. Rev. 19, 1057–1064 (2012). Examples -------- Bayes Factor of a Pearson correlation >>> from pingouin import bayesfactor_pearson >>> r, n = 0.6, 20 >>> bf = bayesfactor_pearson(r, n) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 10.634 Compare to Wetzels method: >>> bf = bayesfactor_pearson(r, n, method='wetzels') >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 8.221 One-sided test >>> bf10pos = bayesfactor_pearson(r, n, alternative='greater') >>> bf10neg = bayesfactor_pearson(r, n, alternative='less') >>> print("BF-pos: %.3f, BF-neg: %.3f" % (bf10pos, bf10neg)) BF-pos: 21.185, BF-neg: 0.082
def bayesfactor_pearson(r, n, alternative="two-sided", method="ly", kappa=1.0): """ Bayes Factor of a Pearson correlation. Parameters ---------- r : float Pearson correlation coefficient. n : int Sample size. alternative : string Defines the alternative hypothesis, or tail of the correlation. Must be one of "two-sided" (default), "greater" or "less". Both "greater" and "less" return a one-sided p-value. "greater" tests against the alternative hypothesis that the correlation is positive (greater than zero), "less" tests against the hypothesis that the correlation is negative. method : str Method to compute the Bayes Factor. Can be "ly" (default) or "wetzels". The former has an exact analytical solution, while the latter requires integral solving (and is therefore slower). "wetzels" was the default in Pingouin <= 0.2.5. See Notes for details. kappa : float Kappa factor. This is sometimes called the *rscale* parameter, and is only used when ``method`` is "ly". Returns ------- bf : float Bayes Factor (BF10). The Bayes Factor quantifies the evidence in favour of the alternative hypothesis. See also -------- corr : (Robust) correlation between two variables pairwise_corr : Pairwise correlation between columns of a pandas DataFrame bayesfactor_ttest : Bayes Factor of a T-test bayesfactor_binom : Bayes Factor of a binomial test Notes ----- To compute the Bayes Factor directly from the raw data, use the :py:func:`pingouin.corr` function. The two-sided **Wetzels Bayes Factor** (also called *JZS Bayes Factor*) is calculated using the equation 13 and associated R code of [1]_: .. math:: \\text{BF}_{10}(n, r) = \\frac{\\sqrt{n/2}}{\\gamma(1/2)}* \\int_{0}^{\\infty}e((n-2)/2)* log(1+g)+(-(n-1)/2)log(1+(1-r^2)*g)+(-3/2)log(g)-n/2g where :math:`n` is the sample size, :math:`r` is the Pearson correlation coefficient and :math:`g` is is an auxiliary variable that is integrated out numerically. Since the Wetzels Bayes Factor requires solving an integral, it is slower than the analytical solution described below. The two-sided **Ly Bayes Factor** (also called *Jeffreys exact Bayes Factor*) is calculated using equation 25 of [2]_: .. math:: \\text{BF}_{10;k}(n, r) = \\frac{2^{\\frac{k-2}{k}}\\sqrt{\\pi}} {\\beta(\\frac{1}{k}, \\frac{1}{k})} \\cdot \\frac{\\Gamma(\\frac{2+k(n-1)}{2k})}{\\Gamma(\\frac{2+nk}{2k})} \\cdot 2F_1(\\frac{n-1}{2}, \\frac{n-1}{2}, \\frac{2+nk}{2k}, r^2) The one-sided version is described in eq. 27 and 28 of Ly et al, 2016. Please take note that the one-sided test requires the `mpmath <http://mpmath.org/>`_ package. Results have been validated against JASP and the BayesFactor R package. References ---------- .. [1] Ly, A., Verhagen, J. & Wagenmakers, E.-J. Harold Jeffreys’s default Bayes factor hypothesis tests: Explanation, extension, and application in psychology. J. Math. Psychol. 72, 19–32 (2016). .. [2] Wetzels, R. & Wagenmakers, E.-J. A default Bayesian hypothesis test for correlations and partial correlations. Psychon. Bull. Rev. 19, 1057–1064 (2012). Examples -------- Bayes Factor of a Pearson correlation >>> from pingouin import bayesfactor_pearson >>> r, n = 0.6, 20 >>> bf = bayesfactor_pearson(r, n) >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 10.634 Compare to Wetzels method: >>> bf = bayesfactor_pearson(r, n, method='wetzels') >>> print("Bayes Factor: %.3f" % bf) Bayes Factor: 8.221 One-sided test >>> bf10pos = bayesfactor_pearson(r, n, alternative='greater') >>> bf10neg = bayesfactor_pearson(r, n, alternative='less') >>> print("BF-pos: %.3f, BF-neg: %.3f" % (bf10pos, bf10neg)) BF-pos: 21.185, BF-neg: 0.082 """ from scipy.special import gamma, betaln, hyp2f1 assert method.lower() in ["ly", "wetzels"], "Method not recognized." assert alternative in [ "two-sided", "greater", "less", ], "Alternative must be one of 'two-sided' (default), 'greater' or 'less'." # Wrong input if not np.isfinite(r) or n < 2: return np.nan assert -1 <= r <= 1, "r must be between -1 and 1." if alternative != "two-sided" and method.lower() == "wetzels": warnings.warn( "One-sided Bayes Factor are not supported by the " "Wetzels's method. Switching to method='ly'." ) method = "ly" if method.lower() == "wetzels": # Wetzels & Wagenmakers, 2012. Integral solving def fun(g, r, n): return exp( ((n - 2) / 2) * log(1 + g) + (-(n - 1) / 2) * log(1 + (1 - r**2) * g) + (-3 / 2) * log(g) + -n / (2 * g) ) integr = quad(fun, 0, np.inf, args=(r, n))[0] bf10 = np.sqrt(n / 2) / gamma(1 / 2) * integr else: # Ly et al, 2016. Analytical solution. k = kappa lbeta = betaln(1 / k, 1 / k) log_hyperterm = log(hyp2f1(((n - 1) / 2), ((n - 1) / 2), ((n + 2 / k) / 2), r**2)) bf10 = exp( (1 - 2 / k) * log(2) + 0.5 * log(pi) - lbeta + lgamma((n + 2 / k - 1) / 2) - lgamma((n + 2 / k) / 2) + log_hyperterm ) if alternative != "two-sided": # Directional test. # We need mpmath for the generalized hypergeometric function from .utils import _is_mpmath_installed _is_mpmath_installed(raise_error=True) from mpmath import hyp3f2 hyper_term = float(hyp3f2(1, n / 2, n / 2, 3 / 2, (2 + k * (n + 1)) / (2 * k), r**2)) log_term = 2 * (lgamma(n / 2) - lgamma((n - 1) / 2)) - lbeta C = 2 ** ((3 * k - 2) / k) * k * r / (2 + (n - 1) * k) * exp(log_term) * hyper_term bf10neg = bf10 - C bf10pos = 2 * bf10 - bf10neg if alternative == "greater": # We expect the correlation to be positive bf10 = bf10pos else: # We expect the correlation to be negative bf10 = bf10neg return bf10
(r, n, alternative='two-sided', method='ly', kappa=1.0)
[ -0.00010919306077994406, -0.04241064935922623, -0.03148416057229042, 0.013370845466852188, 0.02197832614183426, -0.048761799931526184, -0.08398561924695969, -0.08256497234106064, -0.019941361621022224, 0.0053170002065598965, 0.009798322804272175, 0.052313432097435, 0.004969671368598938, 0.04174210876226425, -0.06869271397590637, 0.018781859427690506, 0.0192728191614151, 0.052146296948194504, -0.009234240278601646, 0.019408617168664932, -0.03572522848844528, 0.00042012397898361087, -0.03367781639099121, 0.09184098988771439, 0.034492600709199905, 0.0016452406998723745, 0.014530348591506481, 0.015627175569534302, -0.05331624671816826, 0.051101699471473694, -0.003120734356343746, -0.07767625153064728, -0.019147468730807304, -0.04633833467960358, 0.01432142872363329, -0.058372095227241516, 0.060210589319467545, 0.008508244529366493, -0.09635365009307861, -0.00808518286794424, 0.04529373720288277, -0.0483439639210701, 0.03221537917852402, -0.024986766278743744, -0.04167943075299263, -0.02392127737402916, 0.007818810641765594, 0.059750963002443314, -0.03438814356923103, -0.005157698877155781, -0.03641466051340103, -0.13412629067897797, 0.046923309564590454, -0.012691857293248177, -0.029979942366480827, 0.0385456383228302, -0.020944176241755486, -0.0014350154669955373, 0.0293531846255064, -0.00817919708788395, 0.026428312063217163, -0.02172762341797352, 0.008889523334801197, -0.009897558949887753, 0.03144237771630287, 0.05586506426334381, 0.003653479041531682, 0.007824033498764038, 0.044834114611148834, 0.007014470640569925, 0.039067938923835754, 0.03900526091456413, 0.0053953449241817, 0.022542409598827362, -0.04984818398952484, 0.04650546982884407, 0.007824033498764038, -0.03378227725625038, -0.015512269921600819, 0.0053640068508684635, 0.022270813584327698, 0.02237527444958687, 0.05118526518344879, -0.09184098988771439, 0.013109696097671986, -0.025676202028989792, 0.03505668416619301, -0.00835677795112133, 0.027075961232185364, 0.00660185469314456, -0.09451515972614288, -0.06660352647304535, 0.10621464997529984, 0.02373325079679489, 0.0012117328587919474, -0.03165129944682121, 0.03453438729047775, -0.002971879206597805, 0.03969469666481018, -0.009986350312829018, -0.007233836222440004, 0.027911638841032982, -0.01581520214676857, 0.026887934654951096, 0.009343923069536686, 0.05252235010266304, -0.05716036260128021, -0.0031364033930003643, 0.00912978034466505, -0.019544415175914764, -0.07203543186187744, 0.05177024006843567, 0.028809992596507072, -0.008205311372876167, -0.06255048513412476, 0.011093623004853725, -0.045586224645376205, 0.04859466478228569, 0.0048939380794763565, 0.043789517134428024, 0.038127802312374115, -0.020484553650021553, -0.021173987537622452, 0.001845019985921681, 0.0482603944838047, 0.011553245596587658, 0.009923674166202545, 0.025488173589110374, 0.0051133036613464355, 0.01905345357954502, 0.04633833467960358, 0.014290090650320053, 0.03430457413196564, -0.013537980616092682, -0.022960247471928596, 0.03094097226858139, -0.028183234855532646, -0.013590211048722267, 0.02492409199476242, -0.04004985839128494, 0.06363686919212341, -0.04809325933456421, 0.027075961232185364, -0.04272402822971344, 0.01721496321260929, 0.03008440136909485, 0.05670074000954628, -0.055029384791851044, 0.009887113235890865, 0.014488564804196358, 0.02367057465016842, 0.013318615034222603, 0.0678570419549942, -0.038524746894836426, 0.007066700607538223, -0.03181843459606171, 0.06213264539837837, -0.04149140417575836, -0.050767429172992706, -0.0008402479579672217, 0.012817208655178547, -0.03183932602405548, -0.0003662619274109602, 0.0114174485206604, 0.013997603207826614, -0.004750306252390146, -0.018416250124573708, 0.02387949451804161, 0.030355997383594513, -0.03202735260128975, -0.05599041283130646, -0.022500624880194664, -0.1018691286444664, 0.0006998801836743951, -0.03332265466451645, 0.041700322180986404, -0.024798739701509476, -0.04592049494385719, 0.05331624671816826, 0.019429508596658707, -0.01156369224190712, -0.06321902573108673, -0.01955486088991165, -0.07249505072832108, -0.0192728191614151, 0.032842136919498444, 0.06280118972063065, -0.0011640731245279312, 0.00963640958070755, 0.028371261432766914, -0.034492600709199905, -0.029436752200126648, 0.0510181300342083, 0.06564249098300934, -0.016327055171132088, -0.0077195740304887295, 0.05298197269439697, 0.02550906501710415, 0.02889356017112732, -0.03516114503145218, 0.028371261432766914, 0.07487673312425613, -0.002439134754240513, -0.0117412731051445, 0.0002835102204699069, -0.0007867123349569738, -0.04067661985754967, -0.02701328508555889, 0.02795342355966568, 0.0008219674928113818, 0.009787876158952713, -0.015230228193104267, -0.02954121120274067, 0.0024234657175838947, -0.018489371985197067, -0.03415833041071892, 0.11465499550104141, -0.0391932912170887, -0.005525919608771801, 0.0019011670956388116, 0.037124987691640854, -0.017476113513112068, 0.019795117899775505, 0.025237470865249634, 0.005713947117328644, 0.046630822122097015, 0.03415833041071892, 0.05206272751092911, 0.010513871908187866, -0.06626924872398376, -0.035286497324705124, 0.045836929231882095, 0.04905428737401962, -0.027493800967931747, -0.05256413668394089, -0.0678570419549942, -0.000021830450350535102, 0.0027263988740742207, -0.05774533748626709, 0.021769408136606216, 0.032110922038555145, -0.029018912464380264, -0.010748906061053276, 0.06292653828859329, -0.02298114076256752, -0.005844521801918745, 0.04529373720288277, 0.021205324679613113, -0.03476419672369957, -0.019429508596658707, -0.05661717429757118, -0.08498843759298325, 0.04600406438112259, -0.002413019770756364, 0.03455527871847153, -0.04222262278199196, 0.0038911248557269573, 0.004807759076356888, 0.055029384791851044, 0.030752943828701973, 0.05465333163738251, 0.02561352588236332, -0.04775898903608322, 0.009103665128350258, -0.042452432215213776, 0.025007659569382668, -0.04746650159358978, -0.0009133697603829205, 0.046380121260881424, 0.0015264177927747369, 0.09752359986305237, 0.010325844399631023, -0.03898436948657036, -0.0009616823517717421, -0.022417057305574417, 0.01502130925655365, 0.0004798618901986629, 0.024234656244516373, -0.004481322132050991, -0.0022994198370724916, -0.007547215558588505, -0.055739711970090866, 0.0057348390109837055, 0.06430540978908539, -0.032507866621017456, 0.052146296948194504, -0.03645644709467888, -0.012691857293248177, 0.06246691942214966, -0.026428312063217163, 0.00590719748288393, -0.04341346397995949, 0.033552464097738266, 0.05908242240548134, 0.05950026214122772, 0.02247973345220089, 0.01937728002667427, -0.05139418691396713, 0.06418005377054214, -0.05281483754515648, 0.026073148474097252, -0.009678194299340248, 0.08732832968235016, -0.02417198196053505, 0.0021845141891390085, -0.01930415816605091, 0.05728571489453316, 0.00601688027381897, -0.031358812004327774, 0.023712357506155968, -0.03411654755473137, 0.006220576819032431, 0.00578184612095356, -0.02903980389237404, -0.008461237885057926, -0.10788600891828537, -0.024485360831022263, -0.026867041364312172, 0.008691049180924892, -0.002483529970049858, 0.004635400604456663, -0.025091227144002914, 0.025926904752850533, 0.021414244547486305, -0.006429496221244335, -0.035140253603458405, -0.0016700498526915908, 0.012973898090422153, -0.022061895579099655, -0.020233849063515663, 0.02132023125886917, 0.014331874437630177, -0.0032539204694330692, 0.04487590119242668, -0.035829685628414154, 0.03202735260128975, 0.019335495308041573, 0.015648066997528076, 0.020035376772284508, -0.03378227725625038, 0.006048218347132206, -0.02949942648410797, -0.06242513284087181, 0.04420735687017441, -0.0127336410805583, -0.005108080804347992, -0.010263168253004551, -0.015616729855537415, 0.024109305813908577, 0.0053848992101848125, 0.024589819833636284, -0.04491768404841423, 0.01761190965771675, 0.056826092302799225, -0.013517089188098907, 0.031003646552562714, -0.033740490674972534, -0.031254351139068604, 0.030251536518335342, 0.003917239606380463, -0.02298114076256752, 0.009338699281215668, -0.041700322180986404, 0.04466697946190834, -0.0056356023997068405, 0.01887587271630764, -0.046839743852615356, 0.09067104756832123, 0.010728013701736927, -0.02143513597548008, 0.07374856621026993, -0.0743335410952568, -0.01287988480180502, 0.016327055171132088, 0.012430707924067974, 0.046380121260881424, -0.00269767246209085, -0.016118135303258896, 0.0036769823636859655, -0.007432309910655022, 0.017497004941105843, -0.02172762341797352, -0.06852558255195618, -0.014457226730883121, -0.015188444405794144, -0.006701091770082712, 0.008424676954746246, -0.00934914592653513, 0.0314214862883091, -0.015585391782224178, -0.028183234855532646, -0.003611695021390915, 0.04002896696329117, -0.006288475822657347, -0.05147775262594223, 0.025676202028989792, 0.08674336224794388, -0.011908409185707569, -0.02456892840564251, 0.011971085332334042, 0.022793112322688103, 0.020766593515872955, -0.005288273561745882, -0.007411417551338673, -0.009014874696731567, -0.03626841679215431, 0.012420261278748512, 0.031713973730802536, -0.026887934654951096, 0.03361514210700989, -0.015209336765110493, 0.024401793256402016, 0.0006342664128169417, -0.024443576112389565, -0.08126966655254364, 0.039820048958063126, -0.06087912991642952, -0.052355214953422546, 0.019795117899775505, -0.02373325079679489, 0.03969469666481018, -0.06748098134994507, 0.03083651140332222, 0.06196551024913788, 0.02989637479186058, 0.04420735687017441, 0.00830454844981432, -0.033552464097738266, -0.022396165877580643, -0.0024783071130514145, 0.026992393657565117, -0.04600406438112259, -0.06860914826393127, -0.0024143254850059748, 0.026302959769964218, -0.028809992596507072, -0.060210589319467545, 0.013934927992522717, -0.002013461198657751, -0.024004844948649406, -0.003601249074563384, 0.008450792171061039, 0.021769408136606216, -0.04147051274776459, -0.03491044044494629, 0.0038180029951035976, 0.03242430090904236, -0.04943034425377846, -0.035390954464673996, -0.07892977446317673, 0.027974314987659454, -0.03518203645944595, 0.026302959769964218, 0.057118579745292664, -0.008330663666129112, 0.024443576112389565, -0.0043768626637756824, -0.025697093456983566, 0.009855775162577629, 0.022354381158947945, 0.0025827668141573668, 0.024401793256402016, -0.00025511023704893887, 0.06555892527103424, 0.010707122273743153, 0.0026650289073586464, 0.046672604978084564, -0.0010942156659439206, 0.010116924531757832, 0.0070249168202281, -0.027744503691792488, 0.03453438729047775, -0.000753415806684643, -0.007714351173490286, -0.016598651185631752, 0.015115322545170784, -0.04174210876226425, 0.006147454958409071, -0.02222903072834015, -0.016118135303258896, -0.03234073147177696, 0.0327167883515358, -0.029060697183012962, -0.01703738234937191, 0.03915150463581085, -0.04959747940301895, -0.009871444664895535, 0.027911638841032982, 0.0652664378285408, -0.04449984431266785, -0.01974288932979107, 0.008090405724942684, 0.03209002688527107, 0.08933395892381668, -0.053901221603155136, -0.01606590673327446, 0.023795926943421364, -0.0028517507016658783, 0.016901584342122078, -0.01915791444480419, 0.012900776229798794, -0.007160714361816645, -0.0732053741812706, -0.023942170664668083, -0.012085990980267525, -0.10044847428798676, -0.03238251432776451, -0.023336302489042282, -0.0033949411008507013, 0.026992393657565117, 0.011250312440097332, -0.04241064935922623, 0.03699963539838791, -0.06418005377054214, -0.0031703526619821787, 0.00453877542167902, -0.011104068718850613, -0.017674585804343224, -0.03662358224391937, 0.016922475770115852, 0.0484275296330452, 0.011918854899704456, 0.015282458625733852, 0.001826739520765841, 0.04487590119242668, 0.016650881618261337, 0.03666536509990692, -0.028830885887145996, 0.014634807594120502, -0.01778949238359928, -0.07308002561330795, -0.05281483754515648, -0.029979942366480827, 0.03689517453312874, -0.0215813796967268, -0.01370511669665575, -0.024339117109775543, -0.031108107417821884, 0.004209727048873901, -0.018040195107460022, -0.020087605342268944, -0.007395748980343342, 0.061547670513391495, -0.00837767031043768, -0.020829269662499428, 0.007709127850830555, -0.022521518170833588, -0.034638844430446625, 0.033197302371263504, -0.013767791911959648, 0.0864090844988823, -0.018938548862934113, 0.030021725222468376, 0.018071532249450684, 0.027117745950818062, 0.002581461099907756, -0.008523914031684399, 0.030773835256695747, 0.011751719750463963, -0.01902211643755436, -0.07136688381433487, -0.01176216546446085, 0.034053873270750046, -0.027222204953432083, 0.0346597395837307, 0.041909243911504745, 0.0130574656650424, 0.0021688451524823904, -0.026532771065831184, -0.02312738448381424, 0.027347557246685028, 0.0888325497508049, -0.000935567426495254, -0.02431822568178177, -0.0037030973471701145, -0.022521518170833588, -0.014916849322617054, -0.06848379969596863, -0.023148275911808014, -0.016577759757637978, -0.003105065319687128, -0.019513078033924103, -0.011584583669900894, -0.02964567020535469, -0.004836485255509615, 0.04109445586800575, -0.054820466786623, 0.022061895579099655, -0.02222903072834015, 0.026929717510938644, -0.04500124976038933, -0.0015982338227331638, -0.00031158377532847226, -0.07801052182912827, -0.039026156067848206, 0.04734114930033684, -0.0006378572434186935, -0.02929050847887993, 0.0013514477759599686, -0.00331920781172812, 0.008059067651629448, 0.00885818526148796, -0.045335523784160614, -0.007390525657683611, 0.017340315505862236, 0.029457643628120422, -0.045084819197654724, -0.022646868601441383, 0.001411512028425932, -0.026490986347198486, -0.00806951429694891, -0.015031754970550537, 0.00015579188766423613, 0.015836095437407494, -0.003893736284226179, -0.00021087807544972748, 0.023837709799408913, 0.001924670534208417, 0.023440763354301453, 0.00936481449753046, -0.01815510168671608, 0.008952198550105095, 0.003520292928442359, 0.07654809206724167, -0.0008043398847803473, -0.05411013960838318, 0.014634807594120502, -0.07633917033672333, 0.011918854899704456, 0.014530348591506481, 0.023002032190561295, 0.024903198704123497, 0.030355997383594513, -0.03158862143754959, -0.0327167883515358, 0.07115796953439713, 0.053190894424915314, 0.024234656244516373, -0.0340120866894722, 0.05599041283130646, -0.04458341374993324, 0.018395358696579933, -0.009098442271351814, 0.0010086892871186137, 0.02759825997054577, 0.016870245337486267, -0.052355214953422546, 0.005703501403331757, 0.06936126202344894, -0.002128367079421878, -0.047132231295108795, -0.008711941540241241, -0.026428312063217163, 0.014467672444880009, -0.02168584056198597, -0.059750963002443314, 0.04888715222477913, 0.09167385846376419, 0.008299325592815876, -0.03094097226858139, -0.015177998691797256, -0.014310983009636402, 0.006716760341078043, -0.02864285744726658, -0.019659321755170822, 0.033907629549503326, 0.0332808680832386, -0.03246608376502991, -0.03576701134443283, 0.004679795820266008, 0.0536087341606617, -0.01043030433356762, -0.015731634572148323, -0.04729936644434929, -0.0484275296330452, 0.0235243309289217, -0.06718849390745163, 0.042598675936460495, 0.02053678222000599, 0.001907695783302188, 0.06250870227813721, -0.005677386187016964, -0.029374076053500175, 0.023607898503541946, 0.06789882481098175, -0.00021267347619868815, 0.02009805105626583, 0.05043315514922142, -0.07086548209190369, -0.032800354063510895, -0.03810690715909004, 0.0045100487768650055, 0.01722540892660618, 0.019836902618408203, 0.05753641948103905, 0.06468146294355392, -0.055280089378356934, -0.020118944346904755, 0.04817682504653931, -0.03455527871847153, 0.026887934654951096, -0.009683417156338692, 0.010325844399631023, 0.046965092420578, -0.03438814356923103, 0.06865093111991882, -0.017455220222473145, -0.007479316554963589, -0.02373325079679489, -0.03108721598982811, -0.03509846702218056, 0.028789101168513298, 0.00005051607149653137, -0.040216997265815735, -0.022020110860466957, 0.053190894424915314, -0.02820412628352642, 0.014843727461993694, -0.05924955755472183, 0.005969873629510403, -0.002563180634751916, 0.019878685474395752, 0.0692359060049057, 0.041951026767492294, 0.03154683858156204, -0.025404606014490128, 0.03649822995066643, -0.028371261432766914, -0.016525529325008392, -0.00438730837777257, 0.04094821214675903, 0.020118944346904755, -0.018437141552567482, -0.0015446982579305768, -0.017841720953583717, -0.05327446013689041, 0.015282458625733852, -0.05703501030802727, 0.03954845294356346, -0.011020501144230366, 0.009458828717470169, -0.0130574656650424, 0.001737948739901185, -0.04729936644434929, 0.026302959769964218, 0.05323267728090286, -0.010059472173452377, -0.02027563378214836, 0.023336302489042282, -0.013193263672292233, 0.00601688027381897, -0.015397364273667336, 0.02870553359389305, 0.08469595015048981, 0.009380483999848366, 0.020871054381132126, 0.03691606968641281, -0.044040221720933914, -0.029854590073227882, -0.048469312489032745, -0.020505445078015327, -0.029311399906873703, 0.029624778777360916, 0.026052257046103477, 0.03438814356923103, 0.011198082938790321, 0.008163527585566044, 0.006930903065949678 ]
31,977
pingouin.bayesian
bayesfactor_ttest
Bayes Factor of a T-test. Parameters ---------- t : float T-value of the T-test nx : int Sample size of first group ny : int Sample size of second group (only needed in case of an independent two-sample T-test) paired : boolean Specify whether the two observations are related (i.e. repeated measures) or independent. alternative : string Defines the alternative hypothesis, or tail of the test. Must be one of "two-sided" (default), "greater" or "less". .. warning:: One-sided Bayes Factor (BF) are simply obtained by doubling the two-sided BF, which is not the same behavior as R or JASP. Be extra careful when interpretating one-sided BF, and if you can, always double-check your results. r : float Cauchy scale factor. Smaller values of ``r`` (e.g. 0.5), may be appropriate when small effect sizes are expected a priori; larger values of ``r`` are appropriate when large effect sizes are expected (Rouder et al 2009). The default is :math:`\sqrt{2} / 2 \approx 0.707`. Returns ------- bf : float Scaled Jeffrey-Zellner-Siow (JZS) Bayes Factor (BF10). The Bayes Factor quantifies the evidence in favour of the alternative hypothesis. See also -------- ttest : T-test pairwise_test : Pairwise T-tests bayesfactor_pearson : Bayes Factor of a correlation bayesfactor_binom : Bayes Factor of a binomial test Notes ----- Adapted from a Matlab code found at https://github.com/anne-urai/Tools/tree/master/stats/BayesFactors If you would like to compute the Bayes Factor directly from the raw data instead of from the T-value, use the :py:func:`pingouin.ttest` function. The JZS Bayes Factor is approximated using the formula described in ref [1]_: .. math:: \text{BF}_{10} = \frac{\int_{0}^{\infty}(1 + Ngr^2)^{-1/2} (1 + \frac{t^2}{v(1 + Ngr^2)})^{-(v+1) / 2}(2\pi)^{-1/2}g^ {-3/2}e^{-1/2g}}{(1 + \frac{t^2}{v})^{-(v+1) / 2}} where :math:`t` is the T-value, :math:`v` the degrees of freedom, :math:`N` the sample size, :math:`r` the Cauchy scale factor (= prior on effect size) and :math:`g` is is an auxiliary variable that is integrated out numerically. Results have been validated against JASP and the BayesFactor R package. References ---------- .. [1] Rouder, J.N., Speckman, P.L., Sun, D., Morey, R.D., Iverson, G., 2009. Bayesian t tests for accepting and rejecting the null hypothesis. Psychon. Bull. Rev. 16, 225–237. https://doi.org/10.3758/PBR.16.2.225 Examples -------- 1. Bayes Factor of an independent two-sample T-test >>> from pingouin import bayesfactor_ttest >>> bf = bayesfactor_ttest(3.5, 20, 20) >>> print("Bayes Factor: %.3f (two-sample independent)" % bf) Bayes Factor: 26.743 (two-sample independent) 2. Bayes Factor of a paired two-sample T-test >>> bf = bayesfactor_ttest(3.5, 20, 20, paired=True) >>> print("Bayes Factor: %.3f (two-sample paired)" % bf) Bayes Factor: 17.185 (two-sample paired) 3. Now specifying the direction of the test >>> tval = -3.5 >>> bf_greater = bayesfactor_ttest(tval, 20, alternative='greater') >>> bf_less = bayesfactor_ttest(tval, 20, alternative='less') >>> print("BF10-greater: %.3f | BF10-less: %.3f" % (bf_greater, bf_less)) BF10-greater: 0.029 | BF10-less: 34.369
def bayesfactor_ttest(t, nx, ny=None, paired=False, alternative="two-sided", r=0.707): """ Bayes Factor of a T-test. Parameters ---------- t : float T-value of the T-test nx : int Sample size of first group ny : int Sample size of second group (only needed in case of an independent two-sample T-test) paired : boolean Specify whether the two observations are related (i.e. repeated measures) or independent. alternative : string Defines the alternative hypothesis, or tail of the test. Must be one of "two-sided" (default), "greater" or "less". .. warning:: One-sided Bayes Factor (BF) are simply obtained by doubling the two-sided BF, which is not the same behavior as R or JASP. Be extra careful when interpretating one-sided BF, and if you can, always double-check your results. r : float Cauchy scale factor. Smaller values of ``r`` (e.g. 0.5), may be appropriate when small effect sizes are expected a priori; larger values of ``r`` are appropriate when large effect sizes are expected (Rouder et al 2009). The default is :math:`\\sqrt{2} / 2 \\approx 0.707`. Returns ------- bf : float Scaled Jeffrey-Zellner-Siow (JZS) Bayes Factor (BF10). The Bayes Factor quantifies the evidence in favour of the alternative hypothesis. See also -------- ttest : T-test pairwise_test : Pairwise T-tests bayesfactor_pearson : Bayes Factor of a correlation bayesfactor_binom : Bayes Factor of a binomial test Notes ----- Adapted from a Matlab code found at https://github.com/anne-urai/Tools/tree/master/stats/BayesFactors If you would like to compute the Bayes Factor directly from the raw data instead of from the T-value, use the :py:func:`pingouin.ttest` function. The JZS Bayes Factor is approximated using the formula described in ref [1]_: .. math:: \\text{BF}_{10} = \\frac{\\int_{0}^{\\infty}(1 + Ngr^2)^{-1/2} (1 + \\frac{t^2}{v(1 + Ngr^2)})^{-(v+1) / 2}(2\\pi)^{-1/2}g^ {-3/2}e^{-1/2g}}{(1 + \\frac{t^2}{v})^{-(v+1) / 2}} where :math:`t` is the T-value, :math:`v` the degrees of freedom, :math:`N` the sample size, :math:`r` the Cauchy scale factor (= prior on effect size) and :math:`g` is is an auxiliary variable that is integrated out numerically. Results have been validated against JASP and the BayesFactor R package. References ---------- .. [1] Rouder, J.N., Speckman, P.L., Sun, D., Morey, R.D., Iverson, G., 2009. Bayesian t tests for accepting and rejecting the null hypothesis. Psychon. Bull. Rev. 16, 225–237. https://doi.org/10.3758/PBR.16.2.225 Examples -------- 1. Bayes Factor of an independent two-sample T-test >>> from pingouin import bayesfactor_ttest >>> bf = bayesfactor_ttest(3.5, 20, 20) >>> print("Bayes Factor: %.3f (two-sample independent)" % bf) Bayes Factor: 26.743 (two-sample independent) 2. Bayes Factor of a paired two-sample T-test >>> bf = bayesfactor_ttest(3.5, 20, 20, paired=True) >>> print("Bayes Factor: %.3f (two-sample paired)" % bf) Bayes Factor: 17.185 (two-sample paired) 3. Now specifying the direction of the test >>> tval = -3.5 >>> bf_greater = bayesfactor_ttest(tval, 20, alternative='greater') >>> bf_less = bayesfactor_ttest(tval, 20, alternative='less') >>> print("BF10-greater: %.3f | BF10-less: %.3f" % (bf_greater, bf_less)) BF10-greater: 0.029 | BF10-less: 34.369 """ # Check tail assert alternative in [ "two-sided", "greater", "less", ], "Alternative must be one of 'two-sided' (default), 'greater' or 'less'." one_sample = True if ny is None or ny == 1 else False # Check T-value assert isinstance(t, (int, float)), "The T-value must be a int or a float." if not np.isfinite(t): return np.nan # Function to be integrated def fun(g, t, n, r, df): return ( (1 + n * g * r**2) ** (-0.5) * (1 + t**2 / ((1 + n * g * r**2) * df)) ** (-(df + 1) / 2) * (2 * pi) ** (-0.5) * g ** (-3.0 / 2) * exp(-1 / (2 * g)) ) # Define n and degrees of freedom if one_sample or paired: n = nx df = n - 1 else: n = nx * ny / (nx + ny) df = nx + ny - 2 # JZS Bayes factor calculation: eq. 1 in Rouder et al. (2009) integr = quad(fun, 0, np.inf, args=(t, n, r, df))[0] bf10 = 1 / ((1 + t**2 / df) ** (-(df + 1) / 2) / integr) # Tail tail_binary = "two-sided" if alternative == "two-sided" else "one-sided" bf10 = bf10 * (1 / 0.5) if tail_binary == "one-sided" else bf10 # Now check the direction of the test if ((alternative == "greater" and t < 0) or (alternative == "less" and t > 0)) and bf10 > 1: bf10 = 1 / bf10 return bf10
(t, nx, ny=None, paired=False, alternative='two-sided', r=0.707)
[ 0.020932089537382126, -0.005312235560268164, -0.0069460077211260796, 0.01976369321346283, 0.012287948280572891, -0.05283520743250847, -0.100204698741436, -0.04142850637435913, -0.010228404775261879, -0.038537222892045975, 0.033427972346544266, 0.08650081604719162, -0.002240248490124941, 0.04186417907476425, -0.0403987318277359, 0.019308218732476234, 0.03317052870988846, 0.0681629627943039, 0.025724487379193306, 0.04297316074371338, -0.037250008434057236, -0.031269412487745285, -0.026080947369337082, 0.08507497608661652, 0.03790351748466492, -0.0025162568781524897, 0.013832605443894863, -0.020912285894155502, -0.03184370696544647, 0.05382537096738815, -0.017525920644402504, -0.11454229056835175, -0.050656843930482864, -0.0366361066699028, 0.003497757948935032, -0.03962640464305878, -0.0016832805704325438, 0.015803033486008644, -0.07263850420713425, 0.014802967198193073, 0.07038093358278275, -0.07137109339237213, 0.028081079944968224, 0.00018550122331362218, -0.03311111778020859, -0.02897222898900509, 0.020912285894155502, 0.019357725977897644, -0.0441613607108593, -0.016199100762605667, -0.01567431166768074, -0.11161140352487564, 0.03760646656155586, 0.010025421157479286, -0.05331048369407654, 0.04237906262278557, -0.00015448121121153235, 0.0013020670739933848, 0.023288682103157043, 0.03534889221191406, 0.027288949117064476, 0.023783763870596886, 0.03176449239253998, 0.009881846606731415, -0.027387965470552444, 0.0613110177218914, -0.03221996873617172, 0.0021041007712483406, 0.009436273016035557, 0.023664943873882294, 0.02386297658085823, 0.03221996873617172, -0.0037923320196568966, 0.02009044773876667, -0.052597567439079285, 0.03871545195579529, -0.00047001897473819554, -0.025348225608468056, -0.05659783259034157, -0.007252959068864584, 0.0523599274456501, 0.0538649782538414, 0.04911218583583832, -0.06479640305042267, -0.008178763091564178, -0.023783763870596886, 0.015555492602288723, -0.0019394857808947563, 0.01033732295036316, 0.016228804364800453, -0.06812335550785065, -0.10281873494386673, 0.11208668351173401, -0.010832405649125576, -0.0010557634523138404, -0.03952738642692566, 0.0192785132676363, 0.0006015252438373864, -0.030556492507457733, -0.012357259169220924, 0.014842573553323746, 0.0039161029271781445, -0.039289750158786774, 0.007074729073792696, 0.012485980987548828, 0.0553700290620327, -0.07505451142787933, -0.008525321260094643, 0.00352746294811368, -0.026675045490264893, -0.0456664115190506, 0.04049775004386902, 0.003886397695168853, 0.008782763965427876, -0.05457789823412895, 0.0041364142671227455, 0.01155522558838129, 0.045111916959285736, -0.060360461473464966, 0.0010204887948930264, 0.07580703496932983, 0.007980730384588242, -0.0157238207757473, 0.03263583779335022, 0.028853408992290497, 0.02192225307226181, 0.05204307287931442, 0.05695429444313049, -0.004777546506375074, 0.010624471120536327, 0.027942456305027008, 0.0010470994748175144, 0.03140803426504135, 0.016605067998170853, -0.03332895413041115, 0.04443860799074173, -0.02004094049334526, 0.004787447862327099, 0.03633905574679375, -0.05176582932472229, 0.05667704716324806, -0.04653775691986084, 0.029922787100076675, -0.06527167558670044, 0.028734588995575905, -0.0027254291344434023, 0.016872411593794823, -0.060360461473464966, 0.03542810305953026, 0.05473632365465164, 0.013426638208329678, 0.012485980987548828, 0.01788238063454628, -0.03685394302010536, -0.0064014168456196785, 0.020437005907297134, 0.055568061769008636, 0.005693448707461357, -0.033091314136981964, 0.025447241961956024, -0.0010730914073064923, -0.018436873331665993, -0.02116972766816616, 0.04067597910761833, 0.01316919457167387, -0.007876763120293617, -0.05596412718296051, 0.05628098174929619, -0.0007933697197586298, -0.048557691276073456, -0.03887387737631798, -0.0019840432796627283, -0.0941844955086708, 0.010515552945435047, -0.007545057684183121, -0.011782963760197163, -0.015199033543467522, -0.03354679048061371, 0.08602553606033325, 0.0168526079505682, -0.011941390112042427, -0.02414022386074066, -0.0329526923596859, -0.02590271644294262, -0.014198966324329376, -0.029447507113218307, 0.04970628395676613, 0.012783030979335308, -0.01610998436808586, 0.020238973200321198, 0.0005133386584930122, -0.0038022336084395647, 0.025328421965241432, 0.05517199635505676, -0.007896565832197666, 0.0254670437425375, 0.04978549852967262, 0.02499176561832428, 0.0352102667093277, 0.01880323328077793, 0.00023856788175180554, 0.034022070467472076, 0.01805070787668228, -0.02138756401836872, 0.02586311101913452, -0.009203583933413029, -0.01567431166768074, -0.035744957625865936, -0.03990365192294121, -0.012426570989191532, -0.0013763293391093612, -0.02144697494804859, -0.0553700290620327, 0.04067597910761833, 0.003901250194758177, -0.05370655283331871, 0.06436073035001755, -0.0019815678242594004, 0.005792465526610613, -0.01410985179245472, -0.01971418596804142, -0.014525720849633217, 0.04033932462334633, 0.04372568801045418, 0.04725067690014839, 0.02849694900214672, 0.04428017884492874, 0.037091583013534546, -0.019585464149713516, -0.02633838914334774, -0.00696085998788476, 0.061865512281656265, 0.06400426477193832, -0.008579780347645283, -0.05212228745222092, -0.05580570176243782, 0.022694582119584084, -0.062182363122701645, -0.06483600288629532, -0.010763093829154968, 0.029863378033041954, -0.02633838914334774, -0.004869136493653059, -0.013753392733633518, -0.008852075785398483, -0.03540830314159393, 0.0337052159011364, 0.026457209140062332, -0.057389963418245316, -0.018110118806362152, -0.057073112577199936, -0.050656843930482864, 0.07038093358278275, -0.012426570989191532, 0.00449782470241189, 0.00029581179842352867, 0.055568061769008636, -0.00988679751753807, 0.027764227241277695, 0.01846657693386078, 0.050934087485075, 0.010436339303851128, -0.05758799985051155, 0.041824571788311005, -0.06796492636203766, 0.024694716557860374, -0.031427837908267975, 0.012575095519423485, 0.03069511614739895, -0.008906534872949123, 0.0538649782538414, -0.008812468498945236, -0.05921186879277229, -0.020120153203606606, -0.033210135996341705, 0.011802767403423786, 0.024734321981668472, 0.024476880207657814, -0.0009425133466720581, -0.06495482474565506, -0.05517199635505676, -0.046022869646549225, 0.01756552793085575, 0.05188464745879173, -0.06190511956810951, -0.003547266125679016, -0.042577095329761505, -0.034774597734212875, 0.03776489570736885, -0.02978416346013546, -0.05505317449569702, -0.038220372051000595, 0.01938743144273758, 0.06428151577711105, 0.04443860799074173, -0.02229851670563221, -0.025704683735966682, -0.0695887953042984, 0.0674104318022728, -0.043171197175979614, 0.032180365175008774, -0.02176382765173912, 0.030081214383244514, 0.0239619929343462, -0.018248742446303368, -0.005124104209244251, 0.03469538316130638, 0.009733322076499462, -0.016397133469581604, 0.03469538316130638, -0.02138756401836872, -0.018110118806362152, 0.02257576212286949, -0.04233945533633232, 0.0003465577610768378, -0.08697609603404999, -0.03776489570736885, -0.025011569261550903, -0.007416335865855217, 0.004237906541675329, 0.01943693868815899, -0.044795066118240356, 0.019030971452593803, 0.03566574305295944, -0.006510335020720959, -0.011505717411637306, 0.0009505584021098912, 0.010297716595232487, -0.06412308663129807, 0.01002047024667263, 0.0004861091438215226, 0.02687307819724083, 0.03160606697201729, 0.0337052159011364, -0.03576476126909256, 0.053785763680934906, 0.0015161902410909534, 0.0310317724943161, 0.0003196376492269337, -0.0325368233025074, 0.013268211856484413, -0.030635705217719078, -0.05208268016576767, 0.03184370696544647, 0.030734723433852196, 0.011040340177714825, -0.034933023154735565, 0.0038319386076182127, 0.08507497608661652, 0.057389963418245316, 0.031328823417425156, -0.039982862770557404, 0.009906601160764694, 0.024813536554574966, -0.025090781971812248, 0.024100616574287415, -0.00700046680867672, -0.02536802738904953, 0.03841840475797653, 0.021328154951334, -0.03249721601605415, 0.03249721601605415, -0.014228671789169312, 0.03505184128880501, 0.016238706186413765, -0.014149458147585392, -0.008342140354216099, 0.1002839133143425, 0.011297782883048058, -0.014268278144299984, 0.09664011001586914, -0.06190511956810951, 0.012594899162650108, 0.030338656157255173, 0.02946731075644493, 0.0015458951238542795, -0.011683947406709194, -0.025783898308873177, 0.03439833223819733, 0.00886197667568922, -0.006584597285836935, 0.0030447575263679028, -0.06994526088237762, 0.001798387267626822, -0.01814972423017025, -0.0018293298780918121, 0.007351975422352552, -0.015288148075342178, 0.031586263328790665, -0.030338656157255173, -0.004807251039892435, -0.02913065440952778, 0.034180495887994766, -0.012565194629132748, -0.04998353123664856, 0.033526986837387085, 0.06333095580339432, -0.026813669130206108, 0.01187207829207182, 0.017407100647687912, 0.010673979297280312, 0.004072053823620081, -0.01316919457167387, -0.004879038315266371, -0.001381280249916017, 0.008386697620153427, 0.023526320233941078, 0.026377996429800987, -0.03717079386115074, 0.012981063686311245, 0.009881846606731415, 0.03386364504694939, -0.04725067690014839, -0.013179096393287182, -0.08151038736104965, 0.031269412487745285, -0.10273952037096024, -0.014961393550038338, 0.01540696807205677, -0.0004935353645123541, 0.03146744519472122, -0.021130122244358063, 0.011466111056506634, 0.0032823970541357994, 0.05437986180186272, 0.03447754681110382, 0.015961460769176483, -0.00917882937937975, -0.05616215988993645, 0.022041073068976402, 0.030952559784054756, -0.06899470090866089, -0.07097502797842026, 0.009555093012750149, 0.024813536554574966, -0.00038090412272140384, -0.06226157769560814, -0.027051309123635292, 0.043012768030166626, -0.014367294497787952, -0.028952425345778465, 0.014555426314473152, 0.01588224619626999, -0.04515152424573898, -0.04253748804330826, -0.024734321981668472, 0.014446508139371872, -0.036814335733652115, -0.052914418280124664, -0.07053935527801514, -0.005822170525789261, -0.026160160079598427, 0.025447241961956024, 0.07347024232149124, -0.04352765530347824, 0.010792799293994904, 0.022813402116298676, -0.04701303690671921, -0.011624537408351898, 0.05188464745879173, -0.030299050733447075, -0.013010768219828606, -0.0050226119346916676, 0.051250942051410675, 0.018327955156564713, -0.031011968851089478, 0.03162587061524391, -0.010208601132035255, 0.02009044773876667, 0.019189398735761642, -0.05457789823412895, 0.040913619101047516, -0.008881780318915844, 0.024417469277977943, 0.009238239377737045, 0.018248742446303368, -0.06059810146689415, -0.003022478660568595, -0.020991498604416847, -0.008386697620153427, -0.0012500833254307508, 0.012208734638988972, -0.01177306193858385, -0.005465711001306772, 0.04772595316171646, 0.005262726917862892, -0.014268278144299984, 0.025506651028990746, 0.0973530262708664, -0.03887387737631798, -0.026457209140062332, -0.02746717818081379, 0.031328823417425156, 0.09014462679624557, -0.09315472841262817, -0.02160540036857128, -0.0027576095890253782, 0.02718993090093136, 0.00043412548257037997, 0.011218570172786713, 0.02903163805603981, 0.0005591338267549872, -0.06012282148003578, -0.04938943311572075, -0.0015075262635946274, -0.07434158772230148, -0.0254670437425375, -0.04293355718255043, -0.013852409087121487, 0.012832539156079292, 0.0054261041805148125, -0.02520960196852684, 0.00534689100459218, -0.029051441699266434, 0.02024887502193451, -0.032338790595531464, -0.004502775613218546, -0.027784030884504318, 0.005282530561089516, 0.005257776472717524, 0.027427570894360542, 0.0006522712064906955, 0.0317842960357666, 0.02515019103884697, 0.04554758965969086, 0.006926204543560743, 0.017852675169706345, 0.040913619101047516, 0.021149925887584686, -0.0033962661400437355, -0.028259310871362686, -0.039032306522130966, -0.004309693351387978, 0.050181563943624496, -0.030615903437137604, -0.0403987318277359, -0.018545791506767273, 0.00829758308827877, 0.042854342609643936, -0.04443860799074173, 0.009317453019320965, -0.023387698456645012, 0.07568821310997009, -0.017763560637831688, -0.032556626945734024, 0.003871545195579529, -0.01954585686326027, -0.015307951718568802, 0.029447507113218307, -0.017001133412122726, 0.0470922477543354, -0.02018946409225464, 0.018773529678583145, 0.014961393550038338, 0.02257576212286949, -0.03037826344370842, -0.02762560360133648, 0.08499576896429062, 0.0034903318155556917, -0.012961260043084621, -0.07311378419399261, 0.022654976695775986, 0.0441613607108593, -0.012357259169220924, 0.04899336397647858, 0.002139994176104665, 0.0069757127203047276, -0.0157238207757473, -0.022338123992085457, -0.01846657693386078, 0.03542810305953026, 0.06301410496234894, 0.011891881935298443, 0.019248807802796364, 0.0005928613245487213, 0.010594765655696392, -0.05659783259034157, -0.03031885251402855, -0.02718993090093136, -0.00046042673056945205, -0.020229071378707886, -0.0007537631317973137, -0.009817486628890038, 0.004319595173001289, -0.014515819028019905, 0.008802566677331924, -0.022219303995370865, 0.021664811298251152, -0.06190511956810951, 0.026477012783288956, -0.021585598587989807, 0.0183576587587595, -0.016278313472867012, -0.024061011150479317, -0.024734321981668472, -0.006782630458474159, -0.011238372884690762, -0.02261536940932274, 0.008658993057906628, -0.02606114372611046, 0.017327887937426567, 0.015971362590789795, -0.029447507113218307, 0.004478021524846554, 0.019892415031790733, 0.0029803968500345945, -0.05402340367436409, -0.015199033543467522, -0.03301210328936577, -0.06305371224880219, 0.024536289274692535, 0.005589481443166733, 0.021466778591275215, 0.016080280765891075, 0.005336989648640156, 0.0011349766282364726, 0.019367627799510956, -0.015545590780675411, 0.0317842960357666, -0.028694981709122658, -0.03990365192294121, 0.03685394302010536, 0.0017315511358901858, 0.08990698307752609, 0.014555426314473152, -0.07236126065254211, 0.021367762237787247, -0.07263850420713425, 0.019308218732476234, -0.04626050963997841, 0.006104367319494486, 0.022872813045978546, 0.019644875079393387, -0.023526320233941078, -0.008084697648882866, 0.02639780007302761, 0.029744558036327362, 0.02665524184703827, 0.004609218332916498, 0.054102618247270584, -0.058419737964868546, 0.04210181534290314, 0.029744558036327362, 0.009456075727939606, 0.03394285589456558, -0.032715052366256714, -0.029902983456850052, 0.021288547664880753, 0.02417982928454876, 0.02617996372282505, -0.04233945533633232, 0.02160540036857128, -0.00641131866723299, -0.007025220897048712, -0.03639846667647362, 0.0060004000551998615, 0.06796492636203766, 0.08650081604719162, 0.00934220664203167, -0.026219569146633148, -0.028734588995575905, -0.0030744625255465508, 0.013802900910377502, 0.015634706243872643, -0.008233222179114819, 0.044517818838357925, 0.01696152612566948, 0.005361743737012148, -0.04875572770833969, -0.00899564940482378, 0.020536022260785103, 0.0035175613593310118, -0.03879466652870178, -0.0659053847193718, -0.051409367471933365, -0.01584264077246189, -0.03861643746495247, 0.04970628395676613, 0.026813669130206108, -0.022377729415893555, 0.0561225526034832, -0.013644474558532238, -0.022437140345573425, 0.02079346589744091, 0.08341149985790253, -0.03657669574022293, -0.008094599470496178, 0.03736882656812668, -0.09529348462820053, -0.04099283367395401, -0.04079480096697807, -0.0008719640900380909, 0.039666011929512024, 0.03534889221191406, 0.024971961975097656, 0.0732722133398056, -0.02865537628531456, 0.03332895413041115, 0.03334875777363777, -0.049587465822696686, 0.0030002000275999308, -0.04037892818450928, -0.02202126942574978, 0.04368608072400093, -0.009817486628890038, 0.0576276034116745, -0.02677406184375286, -0.016515953466296196, -0.002276141894981265, -0.07683680951595306, -0.03461616858839989, 0.006718269549310207, -0.00972342025488615, 0.0024754125624895096, -0.04776556044816971, 0.003247741376981139, -0.03257643058896065, 0.01631791889667511, -0.043171197175979614, 0.04079480096697807, -0.02402140386402607, 0.018228938803076744, 0.07616349309682846, 0.04396332800388336, -0.0063717118464410305, -0.019189398735761642, 0.022219303995370865, -0.0033962661400437355, -0.019466644152998924, -0.012832539156079292, 0.054261043667793274, 0.024041207507252693, -0.005535022355616093, -0.002698199823498726, -0.016991231590509415, -0.0403987318277359, 0.011931488290429115, -0.0411512590944767, 0.07723287492990494, 0.016515953466296196, 0.020456809550523758, -0.022496549412608147, 0.008658993057906628, -0.04178496450185776, 0.026635440066456795, 0.059647541493177414, -0.027784030884504318, 0.0084263039752841, 0.007104434072971344, -0.0183576587587595, 0.04352765530347824, -0.03225957602262497, -0.006926204543560743, 0.03410128504037857, 0.06990565359592438, 0.034814201295375824, 0.03463597223162651, -0.07723287492990494, -0.038695648312568665, -0.02709091454744339, 0.0037106433883309364, -0.02649681642651558, 0.0486765131354332, 0.020456809550523758, 0.02041720226407051, 0.02079346589744091, -0.008574829436838627, 0.04701303690671921 ]
31,979
pingouin.multivariate
box_m
Test equality of covariance matrices using the Box's M test. Parameters ---------- data : :py:class:`pandas.DataFrame` Long-format dataframe. dvs : list Dependent variables. group : str Grouping variable. alpha : float Significance level. Default is 0.001 as recommended in [2]_. A non-significant p-value (higher than alpha) indicates that the covariance matrices are homogenous (= equal). Returns ------- stats : :py:class:`pandas.DataFrame` * ``'Chi2'``: Test statistic * ``'pval'``: p-value * ``'df'``: The Chi-Square statistic's degree of freedom * ``'equal_cov'``: True if ``data`` has equal covariance Notes ----- .. warning:: Box's M test is susceptible to errors if the data does not meet the assumption of multivariate normality or if the sample size is too large or small [3]_. Pingouin uses :py:meth:`pandas.DataFrameGroupBy.cov` to calculate the variance-covariance matrix of each group. Missing values are automatically excluded from the calculation by Pandas. Mathematical expressions can be found in [1]_. This function has been tested against the boxM package of the `biotools` R package [4]_. References ---------- .. [1] Rencher, A. C. (2003). Methods of multivariate analysis (Vol. 492). John Wiley & Sons. .. [2] Hahs-Vaughn, D. (2016). Applied Multivariate Statistical Concepts. Taylor & Francis. .. [3] https://en.wikipedia.org/wiki/Box%27s_M_test .. [4] https://cran.r-project.org/web/packages/biotools/index.html Examples -------- 1. Box M test with 3 dependent variables of 4 groups (equal sample size) >>> import pandas as pd >>> import pingouin as pg >>> from scipy.stats import multivariate_normal as mvn >>> data = pd.DataFrame(mvn.rvs(size=(100, 3), random_state=42), ... columns=['A', 'B', 'C']) >>> data['group'] = [1] * 25 + [2] * 25 + [3] * 25 + [4] * 25 >>> data.head() A B C group 0 0.496714 -0.138264 0.647689 1 1 1.523030 -0.234153 -0.234137 1 2 1.579213 0.767435 -0.469474 1 3 0.542560 -0.463418 -0.465730 1 4 0.241962 -1.913280 -1.724918 1 >>> pg.box_m(data, dvs=['A', 'B', 'C'], group='group') Chi2 df pval equal_cov box 11.634185 18.0 0.865537 True 2. Box M test with 3 dependent variables of 2 groups (unequal sample size) >>> data = pd.DataFrame(mvn.rvs(size=(30, 2), random_state=42), ... columns=['A', 'B']) >>> data['group'] = [1] * 20 + [2] * 10 >>> pg.box_m(data, dvs=['A', 'B'], group='group') Chi2 df pval equal_cov box 0.706709 3.0 0.871625 True
def box_m(data, dvs, group, alpha=0.001): """Test equality of covariance matrices using the Box's M test. Parameters ---------- data : :py:class:`pandas.DataFrame` Long-format dataframe. dvs : list Dependent variables. group : str Grouping variable. alpha : float Significance level. Default is 0.001 as recommended in [2]_. A non-significant p-value (higher than alpha) indicates that the covariance matrices are homogenous (= equal). Returns ------- stats : :py:class:`pandas.DataFrame` * ``'Chi2'``: Test statistic * ``'pval'``: p-value * ``'df'``: The Chi-Square statistic's degree of freedom * ``'equal_cov'``: True if ``data`` has equal covariance Notes ----- .. warning:: Box's M test is susceptible to errors if the data does not meet the assumption of multivariate normality or if the sample size is too large or small [3]_. Pingouin uses :py:meth:`pandas.DataFrameGroupBy.cov` to calculate the variance-covariance matrix of each group. Missing values are automatically excluded from the calculation by Pandas. Mathematical expressions can be found in [1]_. This function has been tested against the boxM package of the `biotools` R package [4]_. References ---------- .. [1] Rencher, A. C. (2003). Methods of multivariate analysis (Vol. 492). John Wiley & Sons. .. [2] Hahs-Vaughn, D. (2016). Applied Multivariate Statistical Concepts. Taylor & Francis. .. [3] https://en.wikipedia.org/wiki/Box%27s_M_test .. [4] https://cran.r-project.org/web/packages/biotools/index.html Examples -------- 1. Box M test with 3 dependent variables of 4 groups (equal sample size) >>> import pandas as pd >>> import pingouin as pg >>> from scipy.stats import multivariate_normal as mvn >>> data = pd.DataFrame(mvn.rvs(size=(100, 3), random_state=42), ... columns=['A', 'B', 'C']) >>> data['group'] = [1] * 25 + [2] * 25 + [3] * 25 + [4] * 25 >>> data.head() A B C group 0 0.496714 -0.138264 0.647689 1 1 1.523030 -0.234153 -0.234137 1 2 1.579213 0.767435 -0.469474 1 3 0.542560 -0.463418 -0.465730 1 4 0.241962 -1.913280 -1.724918 1 >>> pg.box_m(data, dvs=['A', 'B', 'C'], group='group') Chi2 df pval equal_cov box 11.634185 18.0 0.865537 True 2. Box M test with 3 dependent variables of 2 groups (unequal sample size) >>> data = pd.DataFrame(mvn.rvs(size=(30, 2), random_state=42), ... columns=['A', 'B']) >>> data['group'] = [1] * 20 + [2] * 10 >>> pg.box_m(data, dvs=['A', 'B'], group='group') Chi2 df pval equal_cov box 0.706709 3.0 0.871625 True """ # Safety checks from scipy.stats import chi2 assert isinstance(data, pd.DataFrame), "data must be a pandas dataframe." assert group in data.columns, "The grouping variable is not in data." assert set(dvs).issubset(data.columns), "The DVs are not in data." grp = data.groupby(group, observed=True)[dvs] assert grp.ngroups > 1, "Data must have at least two columns." # Calculate covariance matrix and descriptive statistics # - n_covs is the number of covariance matrices # - n_dvs is the number of variables # - n_samp is the number of samples in each covariance matrix # - nobs is the total number of observations covs = grp.cov(numeric_only=True) n_covs, n_dvs = covs.index.levshape n_samp = grp.count().iloc[:, 0].to_numpy() # NaN are excluded by .count nobs = n_samp.sum() v = n_samp - 1 # Calculate pooled covariance matrix (S) and M statistics covs = covs.to_numpy().reshape(n_covs, n_dvs, -1) S = (covs * v[..., None, None]).sum(axis=0) / (nobs - n_covs) # The following lines might raise an error if the covariance matrices are # not invertible (e.g. missing values in input). S_det = np.linalg.det(S) M = ((np.linalg.det(covs) / S_det) ** (v / 2)).prod() # Calculate C in reference [1] (page 257-259) if len(np.unique(n_samp)) == 1: # All groups have same number of samples c = ((n_covs + 1) * (2 * n_dvs**2 + 3 * n_dvs - 1)) / ( 6 * n_covs * (n_dvs + 1) * (nobs / n_covs - 1) ) else: # Unequal sample size c = (2 * n_dvs**2 + 3 * n_dvs - 1) / (6 * (n_dvs + 1) * (n_covs - 1)) c *= (1 / v).sum() - 1 / v.sum() # Calculate U statistics and degree of fredom u = -2 * (1 - c) * np.log(M) df = 0.5 * n_dvs * (n_dvs + 1) * (n_covs - 1) p = chi2.sf(u, df) equal_cov = True if p > alpha else False stats = pd.DataFrame( index=["box"], data={"Chi2": [u], "df": [df], "pval": [p], "equal_cov": [equal_cov]} ) return _postprocess_dataframe(stats)
(data, dvs, group, alpha=0.001)
[ 0.028934545814990997, 0.0006372890784405172, 0.03422745317220688, 0.0030641767662018538, 0.02303970418870449, -0.025385186076164246, -0.015650393441319466, -0.022562304511666298, 0.02644376829266548, 0.02912135422229767, -0.04097330942749977, 0.021794313564896584, -0.022375496104359627, 0.0726892277598381, -0.05774455517530441, 0.023247268050909042, 0.010938670486211777, -0.0407865010201931, 0.08734330534934998, -0.005334417801350355, -0.04715874418616295, 0.027253270149230957, 0.014923916198313236, 0.00832335278391838, -0.001016419380903244, 0.03449728712439537, -0.026941923424601555, -0.03453879803419113, 0.03920900821685791, 0.01898181065917015, -0.04462645202875137, -0.04400375857949257, 0.0001184579377877526, 0.030657336115837097, 0.020694220438599586, -0.02627771534025669, 0.054548054933547974, -0.06251854449510574, -0.08900383114814758, 0.009433824568986893, 0.03314811363816261, -0.011800064705312252, 0.006268459837883711, 0.007176556158810854, 0.014342734590172768, 0.0013413880951702595, -0.012298219837248325, 0.08933593332767487, -0.04537368565797806, 0.008816318586468697, 0.010782996192574501, -0.05214030295610428, 0.024949301034212112, -0.01645989716053009, -0.011384934186935425, 0.020019633695483208, -0.01314923632889986, -0.007788872811943293, 0.057869091629981995, -0.0000907285648281686, 0.03132154420018196, 0.0038918417412787676, -0.009470148012042046, -0.031944237649440765, -0.041554491966962814, -0.03565964847803116, 0.0065798070281744, -0.017580747604370117, 0.0035052523016929626, 0.012609567493200302, -0.04066196456551552, 0.02432660572230816, 0.015764553099870682, 0.023288780823349953, 0.008266272023320198, 0.03748622164130211, -0.0453321747481823, -0.03125927224755287, -0.003079744055867195, 0.034891657531261444, 0.03406139835715294, -0.019967742264270782, -0.010046141222119331, -0.046453025192022324, 0.0034922794438898563, 0.006792561151087284, 0.05035524442791939, 0.054506540298461914, 0.07414218038320541, -0.01869121938943863, 0.006792561151087284, -0.02060081623494625, 0.05571042001247406, 0.02609090693295002, -0.03412367030978203, -0.004587184172123671, 0.006398187950253487, 0.03962413966655731, 0.0027294782921671867, 0.02627771534025669, 0.0014477651566267014, 0.05529528856277466, 0.06285065412521362, 0.08551673591136932, -0.02053854614496231, 0.001291442895308137, -0.035431329160928726, 0.014436138793826103, -0.020735733211040497, -0.022396251559257507, -0.06994937360286713, -0.006844452582299709, -0.02465870976448059, -0.028519416227936745, 0.010679214261472225, -0.06762464344501495, -0.06226946786046028, 0.024098284542560577, -0.07642539590597153, 0.005183933302760124, 0.004771397914737463, 0.02121313288807869, 0.029785562306642532, -0.025281405076384544, -0.011000939644873142, -0.033376436680555344, 0.03592948243021965, -0.027274027466773987, 0.026526793837547302, -0.01645989716053009, 0.02276986837387085, -0.05031372979283333, 0.019500721246004105, 0.030553553253412247, -0.010601377114653587, -0.009413068182766438, 0.0336877815425396, -0.043048959225416183, 0.0586993545293808, -0.028706224635243416, 0.03485014662146568, 0.01552585419267416, -0.06567353010177612, -0.045041583478450775, 0.019282778725028038, 0.02773066982626915, 0.1072695404291153, -0.08211266994476318, -0.0314875952899456, -0.030076153576374054, -0.014436138793826103, -0.0453321747481823, 0.051600635051727295, -0.02133767120540142, 0.024866275489330292, -0.020953675732016563, 0.05683127045631409, -0.0878414660692215, -0.014851268380880356, -0.007389310281723738, -0.03412367030978203, 0.009906034916639328, -0.04296593368053436, 0.0675831288099289, 0.010590998455882072, -0.0008237732108682394, -0.017549611628055573, -0.038254208862781525, -0.04454342648386955, -0.04296593368053436, -0.02440963126718998, 0.017508098855614662, -0.043048959225416183, -0.01614854857325554, -0.028394877910614014, 0.018027011305093765, -0.04259231686592102, -0.03545208275318146, 0.020870650187134743, -0.06816431134939194, -0.04446040093898773, 0.0032198503613471985, -0.002014676807448268, 0.036988064646720886, -0.06488478928804398, 0.05234786868095398, 0.04803051799535751, -0.009418257512152195, 0.006559050641953945, -0.05458956956863403, -0.07397612929344177, -0.06031835824251175, -0.001887543243356049, 0.039976999163627625, 0.01732129044830799, 0.012007629498839378, 0.017757177352905273, 0.012848267331719398, 0.011094343848526478, -0.02310197241604328, 0.01881575770676136, -0.01566077210009098, 0.00948052667081356, -0.011997250840067863, 0.022250957787036896, -0.05288753658533096, -0.05002313852310181, -0.014270086772739887, 0.010793374851346016, 0.016553301364183426, -0.004680588375777006, 0.010155112482607365, 0.02920438162982464, 0.05338568985462189, 0.04030910134315491, -0.01637686975300312, 0.08576581627130508, -0.06081651523709297, -0.009599876590073109, 0.0552537739276886, 0.06608866155147552, -0.03983170539140701, -0.039769433438777924, 0.11158689111471176, -0.025073839351534843, 0.030387500301003456, 0.013637013733386993, 0.041658274829387665, 0.040205322206020355, -0.04724176973104477, 0.01801663264632225, 0.004405565094202757, 0.005687278229743242, -0.03329341113567352, -0.10087653994560242, -0.03767303004860878, -0.00469875056296587, 0.025094596669077873, -0.0673755630850792, 0.01381344348192215, -0.023288780823349953, -0.05351023003458977, 0.024990813806653023, 0.10220495611429214, -0.014778620563447475, -0.06168828904628754, 0.019500721246004105, 0.03140456974506378, 0.03387458994984627, 0.06762464344501495, -0.018597815185785294, -0.06110710650682449, 0.01069997064769268, 0.03464258089661598, -0.0009898251155391335, -0.06459419429302216, 0.005801438819617033, 0.04591335356235504, 0.07252317667007446, -0.030304474756121635, 0.0015969524392858148, -0.03732016682624817, -0.013138857670128345, 0.04757387563586235, -0.020362116396427155, -0.006066083908081055, -0.012578432448208332, 0.00737893208861351, 0.006860019639134407, -0.007845953106880188, 0.05255543068051338, 0.04387921839952469, 0.01953185722231865, -0.0068496414460241795, -0.014301221817731857, 0.0013984685065224767, -0.02773066982626915, 0.010959426872432232, 0.013097344897687435, -0.018234577029943466, 0.012464271858334541, 0.004384808242321014, -0.04425283521413803, -0.02474173530936241, -0.033459462225437164, 0.02467946708202362, -0.0455397367477417, -0.07107022404670715, 0.033438704907894135, -0.004511942155659199, -0.06712649017572403, -0.08643002063035965, -0.029972370713949203, 0.002224836265668273, -0.012038763612508774, 0.004203189164400101, -0.05205727741122246, 0.019033700227737427, -0.018680840730667114, 0.004766209051012993, 0.008359676226973534, 0.014384247362613678, 0.05558587983250618, 0.04201113432645798, 0.006937856785953045, 0.03412367030978203, 0.028394877910614014, -0.06583958864212036, -0.0074204448610544205, -0.0051527987234294415, 0.02636074274778366, 0.04400375857949257, -0.02773066982626915, -0.005401876289397478, 0.07430823147296906, -0.009283339604735374, -0.009257394820451736, -0.019915852695703506, 0.050064653158187866, 0.013917226344347, -0.0012693890603259206, -0.08709423243999481, 0.056208573281764984, 0.015017320401966572, 0.014436138793826103, 0.0054070656187832355, 0.0020017039496451616, 0.016958052292466164, 0.0040838392451405525, -0.008769616484642029, -0.043131984770298004, -0.022437766194343567, 0.040267590433359146, 0.07140232622623444, 0.019874338060617447, -0.013367179781198502, -0.00005322904326021671, -0.03395761549472809, 0.06791523098945618, -0.0016423572087660432, 0.0526384562253952, 0.014415382407605648, -0.02802126109600067, -0.05724639818072319, -0.016034388914704323, -0.019500721246004105, 0.024907788261771202, -0.007529416587203741, -0.04450191557407379, 0.030719604343175888, -0.007596875075250864, 0.029972370713949203, 0.05371779575943947, 0.01023813895881176, 0.021835826337337494, 0.05089491233229637, 0.043131984770298004, -0.04886077716946602, 0.013408692553639412, 0.007576118689030409, 0.039271280169487, 0.09697432070970535, 0.02440963126718998, -0.014633324928581715, 0.018826136365532875, -0.03952035680413246, -0.023766180500388145, 0.00943901389837265, 0.06218644231557846, 0.004719506949186325, 0.03707109019160271, -0.06089954078197479, -0.03223482891917229, -0.004213567357510328, 0.03954111412167549, -0.01311810128390789, -0.07343646138906479, -0.005134636536240578, 0.025219134986400604, -0.002700938144698739, 0.02795899100601673, -0.04450191557407379, -0.01768452860414982, 0.0026179123669862747, -0.012941671535372734, -0.0023688343353569508, 0.012734106741845608, 0.06857944279909134, -0.025156864896416664, -0.012806754559278488, -0.012817132286727428, 0.006875587161630392, 0.06911911070346832, -0.015505097806453705, 0.00577549310401082, 0.014851268380880356, 0.02303970418870449, -0.035016197711229324, -0.05380082130432129, -0.016978807747364044, -0.0017461397219449282, 0.016781622543931007, -0.017539232969284058, -0.01549471914768219, -0.04886077716946602, -0.09772155433893204, -0.022271713241934776, -0.03208953142166138, -0.019345048815011978, 0.02613241970539093, -0.020652707666158676, 0.0379636213183403, 0.025281405076384544, -0.018317602574825287, -0.014249330386519432, 0.011187748052179813, -0.007077963091433048, -0.06521689146757126, 0.04599638283252716, 0.025364430621266365, 0.0688285231590271, -0.06986634433269501, 0.01932429149746895, 0.0016734920209273696, 0.009885278530418873, -0.03916749730706215, -0.04690966755151749, -0.019293157383799553, -0.029951615259051323, -0.04910985380411148, 0.028664711862802505, 0.01633535698056221, -0.01864970661699772, 0.03115549124777317, -0.019749799743294716, -0.030242204666137695, -0.10303521156311035, 0.001665708259679377, -0.006730291992425919, 0.04873623698949814, 0.008645078167319298, 0.013470961712300777, 0.0011902549304068089, -0.04232248291373253, -0.056540679186582565, 0.03557662293314934, 0.0178090687841177, -0.02129615843296051, -0.029806319624185562, -0.01715523935854435, 0.07700657844543457, 0.02939119003713131, 0.0316951610147953, -0.0005224797641858459, 0.008027572184801102, 0.011083965189754963, 0.004159081727266312, -0.012734106741845608, -0.023205755278468132, 0.005884464830160141, -0.04128465801477432, -0.016719352453947067, -0.07480639219284058, 0.0294534582644701, -0.006673211231827736, 0.06762464344501495, 0.029017573222517967, 0.010559864342212677, 0.009579120203852654, 0.01322188414633274, -0.005619819741696119, -0.015754176303744316, -0.04244702309370041, 0.00772141432389617, 0.019666774198412895, 0.008390811271965504, -0.09597800672054291, -0.010762239806354046, -0.017508098855614662, 0.03578418865799904, 0.035057712346315384, 0.026485281065106392, 0.061065591871738434, -0.000739449926186353, -0.022043392062187195, -0.01377193070948124, 0.0633903220295906, 0.03941657394170761, 0.03267071396112442, -0.07667447626590729, 0.008707347325980663, 0.03732016682624817, 0.020154550671577454, 0.039271280169487, -0.004607940558344126, 0.00466242665424943, 0.0030719605274498463, -0.0038088159635663033, 0.054714106023311615, -0.06986634433269501, 0.02142069675028324, 0.08609791845083237, -0.0364483967423439, -0.057869091629981995, 0.00894604716449976, -0.04765690118074417, -0.008157300762832165, -0.010544296354055405, -0.01479937694966793, -0.011924603022634983, -0.010855644010007381, -0.05595949664711952, -0.006097218953073025, -0.023143485188484192, 0.0243888758122921, 0.03908447176218033, -0.025551239028573036, 0.036759741604328156, -0.02318499982357025, -0.01703069917857647, 0.03883539140224457, -0.023932233452796936, -0.02041400782763958, 0.03792210668325424, -0.02912135422229767, 0.041720543056726456, -0.025385186076164246, 0.019334670156240463, 0.0008879886008799076, 0.010393812321126461, -0.04097330942749977, -0.03943733125925064, -0.005728791002184153, 0.051642145961523056, -0.028166556730866432, -0.057910606265068054, 0.010009816847741604, -0.007487903814762831, -0.0006914505502209067, -0.016501409932971, -0.004413348622620106, -0.009906034916639328, 0.04043364152312279, 0.024970056489109993, -0.02121313288807869, 0.05425746366381645, 0.02806277386844158, -0.027336297556757927, 0.02297743409872055, 0.028145799413323402, 0.04367165267467499, -0.013605878688395023, -0.011602877639234066, 0.015058833174407482, 0.03715411573648453, 0.01740431599318981, -0.021856583654880524, -0.05209878832101822, -0.018317602574825287, -0.04690966755151749, -0.0048881531693041325, 0.002092513721436262, 0.052970562130212784, -0.025426700711250305, -0.0006901532760821283, -0.006149109918624163, 0.010897156782448292, -0.0031472027767449617, -0.0004825883952435106, -0.025405943393707275, 0.018701598048210144, 0.012018007226288319, -0.0062788380309939384, 0.009537607431411743, -0.01877424493432045, 0.023413321003317833, -0.015629636123776436, 0.0030719605274498463, 0.005433011334389448, -0.031944237649440765, -0.016055144369602203, -0.033397190272808075, 0.051766686141490936, -0.013657770119607449, -0.03211028873920441, -0.014591812156140804, -0.11299832910299301, -0.023703910410404205, 0.028187312185764313, 0.09166065603494644, -0.038212697952985764, 0.03729941323399544, -0.048113543540239334, -0.054921671748161316, -0.004190216306596994, 0.007653955370187759, 0.008344109170138836, 0.003832167014479637, 0.03404064476490021, -0.022562304511666298, 0.0007400985923595726, 0.04086952656507492, 0.0013121992815285921, 0.0077681164257228374, -0.0338953472673893, -0.00990084558725357, 0.003079744055867195, -0.0008484215359203517, 0.03599175438284874, 0.005510848015546799, -0.027191001921892166, 0.024098284542560577, -0.03445577248930931, 0.0025647238362580538, 0.01132266502827406, -0.039976999163627625, -0.06011079251766205, 0.006356675177812576, 0.018193062394857407, -0.0027554240077733994, -0.01381344348192215, 0.006169866770505905, 0.0031290408223867416, 0.009895656257867813, 0.03437274694442749, -0.025717290118336678, -0.016594814136624336, -0.04749085009098053, -0.053136613219976425, -0.04690966755151749, -0.029681779444217682, 0.046660587191581726, 0.06280913949012756, -0.02096405439078808, 0.015401314944028854, -0.05998625606298447, 0.021161241456866264, 0.011623634025454521, -0.008390811271965504, 0.05234786868095398, 0.025634264573454857, -0.023579372093081474, 0.043422576040029526, 0.012422759085893631, 0.0026347769889980555, 0.010959426872432232, -0.009812630712985992, -0.028519416227936745, 0.0655905082821846, -0.024824760854244232, 0.016553301364183426, -0.02467946708202362, -0.04740782082080841, -0.012775619514286518, 0.020185686647892, -0.021960366517305374, 0.00898755993694067, 0.06098256632685661, 0.013761552982032299, -0.03565964847803116, 0.011644390411674976, -0.0035311977844685316, -0.027170244604349136, -0.0027502349112182856, 0.07837650179862976, 0.012028385885059834, 0.06671135872602463, 0.017445828765630722, -0.027191001921892166, 0.056457653641700745, 0.02459643967449665, 0.0263192281126976, -0.05919750779867172, -0.03412367030978203, -0.06077500060200691, -0.04288290813565254, 0.0061127860099077225, -0.0157437976449728, -0.0712362751364708, 0.06774917989969254, 0.061397697776556015, 0.036967307329177856, 0.006258081644773483, 0.018660083413124084, 0.04095255583524704, 0.0407865010201931, 0.04620394483208656, -0.04612091928720474, -0.0309686828404665, -0.05409141257405281, -0.030574308708310127, -0.0011098235845565796, 0.03485014662146568, 0.003520819591358304, -0.02303970418870449, 0.028768494725227356, -0.0024544550105929375, 0.0065331049263477325, -0.012941671535372734, -0.0131596140563488, -0.020839516073465347, -0.027274027466773987, -0.009605065919458866, 0.0621449314057827, -0.021918853744864464, 0.02770991437137127, -0.015058833174407482, 0.03296130523085594, 0.043339550495147705, -0.06015230715274811, -0.036822013556957245, 0.01381344348192215, 0.025260647758841515, 0.011654769070446491, 0.04201113432645798, 0.043422576040029526, -0.028104286640882492, 0.023558616638183594, -0.006341107655316591, -0.00524101359769702, 0.051600635051727295, 0.027004193514585495, 0.005801438819617033, -0.010284841060638428, -0.03080262988805771, -0.00324839074164629, 0.02619468979537487, -0.019303536042571068, 0.0791652500629425, -0.02026871219277382, 0.07534606009721756, 0.029889345169067383, 0.033210381865501404, 0.033210381865501404, -0.028996815904974937, -0.009874899871647358, -0.03107246570289135, -0.051393069326877594, -0.00887339934706688, 0.04091104120016098, -0.03262920305132866, -0.0023052676115185022, 0.0388561487197876, -0.07717262953519821, -0.035348303616046906, 0.02928740717470646, 0.01461256854236126, 0.0386485829949379, 0.043339550495147705, -0.021524479612708092, 0.016387248411774635, -0.041803568601608276, -0.010611755773425102, 0.0526384562253952, -0.0036142237950116396, 0.03242163732647896, 0.03705033287405968, -0.07119476050138474, 0.02445114403963089, -0.059571124613285065, -0.05002313852310181, -0.008515349589288235, 0.0629751905798912, 0.04466796666383743, -0.012920915149152279, 0.020922541618347168, 0.01479937694966793, 0.06816431134939194 ]
31,980
pingouin.contingency
chi2_independence
Chi-squared independence tests between two categorical variables. The test is computed for different values of :math:`\lambda`: 1, 2/3, 0, -1/2, -1 and -2 (Cressie and Read, 1984). Parameters ---------- data : :py:class:`pandas.DataFrame` The dataframe containing the ocurrences for the test. x, y : string The variables names for the Chi-squared test. Must be names of columns in ``data``. correction : bool Whether to apply Yates' correction when the degree of freedom of the observed contingency table is 1 (Yates 1934). Returns ------- expected : :py:class:`pandas.DataFrame` The expected contingency table of frequencies. observed : :py:class:`pandas.DataFrame` The (corrected or not) observed contingency table of frequencies. stats : :py:class:`pandas.DataFrame` The test summary, containing four columns: * ``'test'``: The statistic name * ``'lambda'``: The :math:`\lambda` value used for the power divergence statistic * ``'chi2'``: The test statistic * ``'pval'``: The p-value of the test * ``'cramer'``: The Cramer's V effect size * ``'power'``: The statistical power of the test Notes ----- From Wikipedia: *The chi-squared test is used to determine whether there is a significant difference between the expected frequencies and the observed frequencies in one or more categories.* As application examples, this test can be used to *i*) evaluate the quality of a categorical variable in a classification problem or to *ii*) check the similarity between two categorical variables. In the first example, a good categorical predictor and the class column should present high :math:`\chi^2` and low p-value. In the second example, similar categorical variables should present low :math:`\chi^2` and high p-value. This function is a wrapper around the :py:func:`scipy.stats.power_divergence` function. .. warning :: As a general guideline for the consistency of this test, the observed and the expected contingency tables should not have cells with frequencies lower than 5. References ---------- * Cressie, N., & Read, T. R. (1984). Multinomial goodness‐of‐fit tests. Journal of the Royal Statistical Society: Series B (Methodological), 46(3), 440-464. * Yates, F. (1934). Contingency Tables Involving Small Numbers and the :math:`\chi^2` Test. Supplement to the Journal of the Royal Statistical Society, 1, 217-235. Examples -------- Let's see if gender is a good categorical predictor for the presence of heart disease. >>> import pingouin as pg >>> data = pg.read_dataset('chi2_independence') >>> data['sex'].value_counts(ascending=True) sex 0 96 1 207 Name: count, dtype: int64 If gender is not a good predictor for heart disease, we should expect the same 96:207 ratio across the target classes. >>> expected, observed, stats = pg.chi2_independence(data, x='sex', ... y='target') >>> expected target 0 1 sex 0 43.722772 52.277228 1 94.277228 112.722772 Let's see what the data tells us. >>> observed target 0 1 sex 0 24.5 71.5 1 113.5 93.5 The proportion is lower on the class 0 and higher on the class 1. The tests should be sensitive to this difference. >>> stats.round(3) test lambda chi2 dof pval cramer power 0 pearson 1.000 22.717 1.0 0.0 0.274 0.997 1 cressie-read 0.667 22.931 1.0 0.0 0.275 0.998 2 log-likelihood 0.000 23.557 1.0 0.0 0.279 0.998 3 freeman-tukey -0.500 24.220 1.0 0.0 0.283 0.998 4 mod-log-likelihood -1.000 25.071 1.0 0.0 0.288 0.999 5 neyman -2.000 27.458 1.0 0.0 0.301 0.999 Very low p-values indeed. The gender qualifies as a good predictor for the presence of heart disease on this dataset.
def chi2_independence(data, x, y, correction=True): """ Chi-squared independence tests between two categorical variables. The test is computed for different values of :math:`\\lambda`: 1, 2/3, 0, -1/2, -1 and -2 (Cressie and Read, 1984). Parameters ---------- data : :py:class:`pandas.DataFrame` The dataframe containing the ocurrences for the test. x, y : string The variables names for the Chi-squared test. Must be names of columns in ``data``. correction : bool Whether to apply Yates' correction when the degree of freedom of the observed contingency table is 1 (Yates 1934). Returns ------- expected : :py:class:`pandas.DataFrame` The expected contingency table of frequencies. observed : :py:class:`pandas.DataFrame` The (corrected or not) observed contingency table of frequencies. stats : :py:class:`pandas.DataFrame` The test summary, containing four columns: * ``'test'``: The statistic name * ``'lambda'``: The :math:`\\lambda` value used for the power\ divergence statistic * ``'chi2'``: The test statistic * ``'pval'``: The p-value of the test * ``'cramer'``: The Cramer's V effect size * ``'power'``: The statistical power of the test Notes ----- From Wikipedia: *The chi-squared test is used to determine whether there is a significant difference between the expected frequencies and the observed frequencies in one or more categories.* As application examples, this test can be used to *i*) evaluate the quality of a categorical variable in a classification problem or to *ii*) check the similarity between two categorical variables. In the first example, a good categorical predictor and the class column should present high :math:`\\chi^2` and low p-value. In the second example, similar categorical variables should present low :math:`\\chi^2` and high p-value. This function is a wrapper around the :py:func:`scipy.stats.power_divergence` function. .. warning :: As a general guideline for the consistency of this test, the observed and the expected contingency tables should not have cells with frequencies lower than 5. References ---------- * Cressie, N., & Read, T. R. (1984). Multinomial goodness‐of‐fit tests. Journal of the Royal Statistical Society: Series B (Methodological), 46(3), 440-464. * Yates, F. (1934). Contingency Tables Involving Small Numbers and the :math:`\\chi^2` Test. Supplement to the Journal of the Royal Statistical Society, 1, 217-235. Examples -------- Let's see if gender is a good categorical predictor for the presence of heart disease. >>> import pingouin as pg >>> data = pg.read_dataset('chi2_independence') >>> data['sex'].value_counts(ascending=True) sex 0 96 1 207 Name: count, dtype: int64 If gender is not a good predictor for heart disease, we should expect the same 96:207 ratio across the target classes. >>> expected, observed, stats = pg.chi2_independence(data, x='sex', ... y='target') >>> expected target 0 1 sex 0 43.722772 52.277228 1 94.277228 112.722772 Let's see what the data tells us. >>> observed target 0 1 sex 0 24.5 71.5 1 113.5 93.5 The proportion is lower on the class 0 and higher on the class 1. The tests should be sensitive to this difference. >>> stats.round(3) test lambda chi2 dof pval cramer power 0 pearson 1.000 22.717 1.0 0.0 0.274 0.997 1 cressie-read 0.667 22.931 1.0 0.0 0.275 0.998 2 log-likelihood 0.000 23.557 1.0 0.0 0.279 0.998 3 freeman-tukey -0.500 24.220 1.0 0.0 0.283 0.998 4 mod-log-likelihood -1.000 25.071 1.0 0.0 0.288 0.999 5 neyman -2.000 27.458 1.0 0.0 0.301 0.999 Very low p-values indeed. The gender qualifies as a good predictor for the presence of heart disease on this dataset. """ # Python code inspired by SciPy's chi2_contingency assert isinstance(data, pd.DataFrame), "data must be a pandas DataFrame." assert isinstance(x, (str, int)), "x must be a string or int." assert isinstance(y, (str, int)), "y must be a string or int." assert all(col in data.columns for col in (x, y)), "columns are not in dataframe." assert isinstance(correction, bool), "correction must be a boolean." observed = pd.crosstab(data[x], data[y]) if observed.size == 0: raise ValueError("No data; observed has size 0.") expected = pd.DataFrame(expected_freq(observed), index=observed.index, columns=observed.columns) # All count frequencies should be at least 5 for df, name in zip([observed, expected], ["observed", "expected"]): if (df < 5).any(axis=None): warnings.warn(f"Low count on {name} frequencies.") dof = float(expected.size - sum(expected.shape) + expected.ndim - 1) if dof == 1 and correction: # Adjust `observed` according to Yates' correction for continuity. observed = observed + 0.5 * np.sign(expected - observed) ddof = observed.size - 1 - dof n = data.shape[0] stats = [] names = [ "pearson", "cressie-read", "log-likelihood", "freeman-tukey", "mod-log-likelihood", "neyman", ] for name, lambda_ in zip(names, [1.0, 2 / 3, 0.0, -1 / 2, -1.0, -2.0]): if dof == 0: chi2, p, cramer, power = 0.0, 1.0, np.nan, np.nan else: chi2, p = power_divergence(observed, expected, ddof=ddof, axis=None, lambda_=lambda_) dof_cramer = min(expected.shape) - 1 cramer = np.sqrt(chi2 / (n * dof_cramer)) power = power_chi2(dof=dof, w=cramer, n=n, alpha=0.05) stats.append( { "test": name, "lambda": lambda_, "chi2": chi2, "dof": dof, "pval": p, "cramer": cramer, "power": power, } ) stats = pd.DataFrame(stats)[["test", "lambda", "chi2", "dof", "pval", "cramer", "power"]] return expected, observed, _postprocess_dataframe(stats)
(data, x, y, correction=True)
[ -0.012666652910411358, 0.0037089181132614613, 0.05513099953532219, -0.03849483281373978, 0.056352391839027405, -0.022848408669233322, 0.005638397764414549, -0.0016675653168931603, 0.05694202706217766, 0.0040090009570121765, -0.004111660644412041, 0.03135601803660393, 0.035483475774526596, 0.025143779814243317, -0.04159042239189148, 0.044349078088998795, 0.024512026458978653, -0.03028203919529915, 0.03584146872162819, 0.015341075137257576, -0.02056356891989708, -0.0004790795501321554, -0.03495701402425766, 0.02665998786687851, -0.0432119220495224, 0.01570959761738777, -0.06949285417795181, -0.028344662860035896, 0.02577553316950798, -0.018394548445940018, -0.07315702736377716, -0.019815994426608086, -0.04062173515558243, 0.009676354005932808, 0.022174539044499397, -0.04649703949689865, 0.03921081870794296, -0.03735767677426338, -0.010713482275605202, 0.03921081870794296, -0.029376525431871414, -0.02326957881450653, -0.03603099286556244, -0.009139363653957844, -0.05150894820690155, 0.03120861016213894, -0.0601850263774395, 0.0729464441537857, -0.009244656190276146, -0.02971346117556095, -0.009449975565075874, -0.08056959509849548, 0.019858110696077347, 0.02484896034002304, 0.021405905485153198, 0.018531428650021553, -0.01917371153831482, -0.03264058381319046, 0.09088823199272156, -0.04192735627293587, 0.05930057168006897, 0.06014290824532509, 0.02025822177529335, -0.02461731806397438, -0.015351603738963604, -0.01560430508106947, 0.028807947412133217, -0.0072862207889556885, -0.00831281952559948, -0.007902179844677448, -0.05378326028585434, 0.025396481156349182, 0.025986116379499435, 0.025396481156349182, -0.013498460873961449, 0.03272482007741928, -0.021942896768450737, -0.06283839046955109, 0.024322500452399254, -0.003927399404346943, 0.0034588491544127464, 0.0026283566839993, 0.022974759340286255, -0.0362626351416111, -0.004272231366485357, 0.0114768510684371, 0.06566022336483002, 0.018773600459098816, 0.03306175395846367, 0.027186447754502296, -0.07513651996850967, -0.02522801235318184, 0.07955878973007202, -0.0005244868225418031, 0.0459074042737484, 0.001356953289359808, -0.04405425861477852, 0.030197804793715477, 0.023564396426081657, -0.007465217728167772, 0.0028560510836541653, 0.0686926394701004, 0.053993843495845795, 0.07568404078483582, -0.022701000794768333, -0.03236682340502739, -0.04780266433954239, 0.04247487708926201, -0.02396450750529766, -0.07778988033533096, -0.13679563999176025, -0.026491519063711166, 0.009418387897312641, -0.056731440126895905, 0.039526693522930145, -0.04409637674689293, -0.025796590372920036, 0.025607064366340637, -0.052098583430051804, 0.024554142728447914, 0.010213344357907772, -0.00025072708376683295, 0.022890526801347733, -0.01655193604528904, 0.016078120097517967, -0.02442779205739498, 0.002553336089476943, 0.005464665591716766, 0.01689939945936203, 0.01082403864711523, 0.038558006286621094, -0.03900023549795151, -0.0272075068205595, 0.04616010561585426, 0.012392892502248287, 0.01219283789396286, 0.04055855795741081, 0.02079521119594574, 0.09349948167800903, -0.04658127203583717, 0.07606308907270432, -0.015035727061331272, -0.03689438849687576, -0.04030585661530495, 0.05508888512849808, 0.03834742307662964, 0.04121137037873268, 0.022237714380025864, -0.018162906169891357, 0.00850761029869318, -0.0028507865499705076, -0.03160871937870979, 0.029334409162402153, -0.06608138978481293, 0.027228565886616707, -0.03508336469531059, 0.0035746705252677202, -0.07703177630901337, 0.007738977205008268, -0.0227641761302948, 0.02345910482108593, -0.04293816164135933, -0.032198358327150345, 0.07201986759901047, 0.016225529834628105, 0.05049814283847809, -0.036789096891880035, -0.025291187688708305, 0.027691850438714027, -0.05715261027216911, -0.03291434422135353, -0.022006072103977203, -0.009270979091525078, -0.005596281029284, -0.020784681662917137, 0.018110260367393494, -0.03135601803660393, -0.03230364993214607, 0.010234402492642403, -0.026807395741343498, -0.00005832201350131072, -0.040411148220300674, -0.07825317233800888, -0.024638377130031586, -0.04001104086637497, 0.04367520660161972, 0.06629197299480438, -0.0006695926422253251, -0.00004152050314587541, 0.022785233333706856, -0.03333551436662674, -0.0651969388127327, 0.03230364993214607, 0.06490211933851242, 0.0802326649427414, -0.03375668078660965, 0.009855350479483604, 0.03339868783950806, 0.02628093585371971, -0.05011909082531929, 0.005822659004479647, 0.028850065544247627, 0.038221072405576706, -0.017731208354234695, -0.010155433788895607, -0.002611246658489108, -0.04333827272057533, 0.0216059610247612, -0.012940412387251854, -0.03769461065530777, 0.02430144138634205, -0.017847029492259026, -0.014372386038303375, 0.006880845874547958, -0.016309762373566628, 0.022448299452662468, 0.08204369246959686, -0.07315702736377716, -0.015330545604228973, -0.0016780946170911193, 0.04380155727267265, -0.022174539044499397, -0.034241024404764175, 0.06616562604904175, 0.03445161134004593, 0.01479355525225401, 0.04087443649768829, 0.055383700877428055, 0.04603375494480133, -0.0424538180232048, 0.020110812038183212, 0.016888869926333427, 0.04451754689216614, -0.07875857502222061, -0.02901853248476982, -0.011003036051988602, -0.015983358025550842, 0.03379879891872406, -0.05087719485163689, 0.06035349518060684, -0.024364616721868515, -0.031461313366889954, 0.034198909997940063, 0.02800772711634636, -0.029144883155822754, -0.061869703233242035, 0.05112989619374275, -0.012066487222909927, 0.0023730231914669275, -0.0012154668802395463, 0.018415607511997223, -0.07235680520534515, -0.006064831279218197, -0.06448094546794891, -0.003240367630496621, -0.05235128477215767, -0.009465769864618778, 0.01462508738040924, 0.05066661164164543, -0.04502294957637787, -0.004559152759611607, 0.03457796201109886, -0.04043220728635788, 0.05188800022006035, -0.08819275349378586, -0.01627817563712597, -0.051298364996910095, -0.01713104173541069, 0.01732056774199009, -0.00879716407507658, -0.02592294104397297, 0.012782474048435688, -0.032703761011362076, 0.018584074452519417, -0.05799494683742523, 0.023543337360024452, 0.03670486435294151, -0.024217208847403526, 0.001505678636021912, 0.00850761029869318, -0.00006794637738494202, -0.012371834367513657, 0.0074178362265229225, 0.007333602290600538, -0.01732056774199009, 0.008744518272578716, -0.05298303812742233, 0.010050141252577305, 0.09240444004535675, 0.0019887066446244717, -0.029186999425292015, -0.03363033011555672, -0.016888869926333427, 0.029734520241618156, 0.042074766010046005, 0.05142471566796303, -0.02581764943897724, -0.031040143221616745, 0.01960540935397148, 0.01767856255173683, -0.006317532621324062, 0.011550555005669594, 0.05841611698269844, 0.015762243419885635, -0.03950563818216324, -0.008075912483036518, 0.05736319348216057, -0.05934268981218338, -0.03773672878742218, -0.03459902107715607, 0.03386197239160538, 0.029418643563985825, 0.00898669008165598, 0.0008502345881424844, 0.017762795090675354, -0.07210410386323929, -0.013498460873961449, -0.005433077923953533, 0.06924015283584595, 0.02920805849134922, -0.010776657611131668, -0.02994510345160961, 0.10512374341487885, -0.007175663951784372, 0.026533637195825577, -0.0006370178889483213, 0.032198358327150345, 0.0037089181132614613, 0.022132422775030136, -0.06035349518060684, -0.01886836439371109, -0.03963198885321617, 0.04194841533899307, -0.00040504595381207764, 0.02099526673555374, 0.027228565886616707, 0.007017725612968206, 0.018836775794625282, 0.05466771498322487, 0.022785233333706856, -0.009555268101394176, 0.005848982371389866, -0.010144904255867004, -0.045233532786369324, 0.01798390969634056, -0.04074808582663536, -0.03596781939268112, 0.0227641761302948, 0.007549451198428869, 0.011150444857776165, 0.013245759531855583, -0.041885241866111755, 0.04561258479952812, 0.0277760848402977, 0.01381433755159378, 0.034704312682151794, -0.009218333289027214, -0.0486028827726841, 0.026533637195825577, 0.015014668926596642, 0.03198777139186859, 0.03950563818216324, -0.009255184791982174, -0.0029955634381622076, 0.02897641621530056, -0.005512047093361616, -0.003806313266977668, 0.07736871391534805, -0.04616010561585426, 0.006528116762638092, -0.0003331511397846043, -0.03611522912979126, -0.019963402301073074, 0.02638622745871544, 0.05066661164164543, -0.001399070257321, -0.008075912483036518, 0.014109156094491482, -0.004817118402570486, -0.006865052040666342, 0.040453266352415085, -0.012645593844354153, -0.12298130244016647, 0.029839811846613884, -0.04881346970796585, -0.045233532786369324, -0.012256013229489326, 0.015351603738963604, 0.0107082175090909, -0.0054962532594799995, 0.00430118665099144, -0.025396481156349182, 0.053530558943748474, -0.0047302525490522385, 0.02010028250515461, 0.024469908326864243, 0.017267921939492226, -0.005225125700235367, -0.03468325361609459, 0.001514891628175974, -0.016541406512260437, 0.013856454752385616, -0.02230088971555233, -0.030618974938988686, -0.03468325361609459, 0.018394548445940018, 0.0038431657012552023, 0.027797143906354904, -0.04070596769452095, 0.013856454752385616, -0.08019054681062698, 0.035715118050575256, -0.007796888239681721, -0.005219861399382353, -0.05243552103638649, 0.020458275452256203, -0.04194841533899307, -0.011866431683301926, 0.03407255932688713, 0.029881928116083145, 0.08082229644060135, -0.0864238440990448, 0.012119133025407791, 0.038642238825559616, 0.0671343132853508, 0.006280680187046528, -0.04544411599636078, -0.00010652610217221081, 0.022785233333706856, 0.0050908783450722694, -0.019005242735147476, 0.03106120228767395, -0.03344080597162247, -0.05508888512849808, -0.023248519748449326, -0.02411191537976265, -0.07551556825637817, 0.06216451898217201, 0.005475194659084082, 0.05184588208794594, -0.04196947440505028, 0.05828976631164551, 0.049445219337940216, 0.0022282463032752275, -0.053993843495845795, 0.038873884826898575, 0.011508438736200333, -0.019415883347392082, -0.05841611698269844, -0.035715118050575256, 0.04085337743163109, -0.0067018489353358746, 0.031082259491086006, 0.024090858176350594, -0.002137431874871254, 0.006996667478233576, -0.0451493002474308, 0.02781820110976696, -0.030576856806874275, 0.005014541558921337, -0.0010937227634713054, 0.0035588766913861036, -0.02095314860343933, 0.002577026840299368, -0.03611522912979126, 0.023058993741869926, 0.0075020696967840195, -0.01832084357738495, 0.0023940815590322018, -0.003027151105925441, -0.00881822220981121, 0.03584146872162819, 0.014677734114229679, 0.008755046874284744, 0.010876685380935669, 0.021469080820679665, -0.08751888573169708, -0.021090028807520866, 0.043885793536901474, -0.0013582694809883833, 0.05155106633901596, 0.013645870611071587, 0.05967962369322777, -0.030766382813453674, -0.0024414630606770515, -0.07206198573112488, 0.004032691475003958, -0.027797143906354904, -0.007802152540534735, -0.06566022336483002, 0.024090858176350594, 0.03996892273426056, 0.011655847541987896, 0.002979769604280591, -0.029692402109503746, 0.032619524747133255, 0.04218005761504173, -0.03005039691925049, 0.01242448017001152, -0.012234954163432121, 0.05045602470636368, 0.03834742307662964, -0.06275415420532227, -0.02731279842555523, 0.00461179856210947, -0.005985862109810114, -0.0015872800722718239, -0.01898418553173542, -0.03078744187951088, -0.011919078417122364, 0.01168743520975113, -0.04367520660161972, 0.04961368814110756, -0.024132974445819855, 0.004896087571978569, -0.04039009287953377, 0.006765024270862341, 0.02600717544555664, -0.0034588491544127464, 0.015330545604228973, 0.009023542515933514, -0.009771117009222507, 0.018268197774887085, 0.030534740537405014, 0.03891599923372269, -0.006338590756058693, 0.010371282696723938, -0.005343579687178135, 0.016141295433044434, -0.03668380528688431, -0.02438567578792572, -0.06254357099533081, 0.0032535293139517307, 0.05508888512849808, -0.02870265580713749, -0.018162906169891357, -0.004116925410926342, -0.041190311312675476, 0.04498083144426346, 0.008154881186783314, -0.0027849788311868906, -0.018152376636862755, -0.0067018489353358746, 0.020226633176207542, 0.04062173515558243, -0.004719723016023636, -0.011297853663563728, -0.011571614071726799, 0.0033693506848067045, 0.011855903081595898, -0.035778291523456573, -0.05112989619374275, 0.035441357642412186, 0.03750508651137352, 0.0037641965318471193, 0.007775829639285803, 0.06688161194324493, 0.041106078773736954, 0.007296749856323004, 0.0015109431697055697, -0.05243552103638649, -0.03992680460214615, 0.044770248234272, -0.09290984272956848, 0.05049814283847809, 0.017794383689761162, 0.02628093585371971, 0.06309109181165695, -0.06578657031059265, -0.064059779047966, 0.004201159346848726, 0.10781922191381454, 0.006170123349875212, 0.04405425861477852, -0.0690716877579689, -0.006917698308825493, 0.0030455770902335644, -0.0273970328271389, 0.03847377374768257, -0.03074532561004162, -0.016541406512260437, -0.00254675536416471, -0.00475657545030117, -0.03287222608923912, -0.007928503677248955, 0.005764748435467482, -0.02889218181371689, 0.051761649549007416, 0.00009361135744256899, -0.0003468062204774469, -0.0547940656542778, -0.03689438849687576, -0.03986363112926483, -0.058163415640592575, 0.02369074709713459, -0.010518691502511501, -0.014088097959756851, -0.004243276081979275, 0.029523935168981552, -0.0057068378664553165, -0.02535436302423477, 0.02350122109055519, -0.0037115502636879683, -0.04910828545689583, 0.006407030858099461, 0.011919078417122364, 0.04843441769480705, -0.009750058874487877, -0.02550177276134491, 0.00862343143671751, -0.014919905923306942, 0.04074808582663536, 0.014930435456335545, -0.02550177276134491, -0.00695455027744174, -0.00404058862477541, -0.03333551436662674, -0.004761840216815472, -0.04813959822058678, 0.009128834120929241, -0.03750508651137352, -0.014867260120809078, 0.01979493536055088, 0.05011909082531929, -0.02916594222187996, -0.0163939967751503, -0.0032430000137537718, -0.034704312682151794, -0.04674974083900452, -0.08469705283641815, 0.00978164654225111, 0.006043772678822279, 0.034093618392944336, -0.01039760559797287, 0.014856730587780476, 0.020942620933055878, 0.018415607511997223, 0.012140192091464996, 0.006291209254413843, 0.06822934746742249, -0.013656399212777615, -0.00764947896823287, 0.04316980391740799, 0.027523383498191833, -0.004198526963591576, 0.0026402021758258343, -0.012529772706329823, -0.016351880505681038, 0.014993610791862011, -0.040411148220300674, 0.03617840260267258, 0.02030033804476261, -0.007549451198428869, 0.024785785004496574, -0.0014609294012188911, -0.04788689687848091, -0.016141295433044434, 0.042264293879270554, 0.00877610594034195, 0.0018978920998051763, 0.031650837510824203, 0.04969792068004608, 0.015383191406726837, 0.021753370761871338, 0.05378326028585434, 0.045359883457422256, 0.10242825746536255, -0.0032482645474374294, -0.04085337743163109, 0.032619524747133255, 0.03826318681240082, 0.04868711903691292, -0.00490135233849287, -0.02828148752450943, -0.018394548445940018, -0.023627571761608124, -0.010155433788895607, 0.05327785760164261, -0.016530876979231834, 0.021921837702393532, 0.021858662366867065, 0.04422272741794586, 0.030155688524246216, -0.03255635127425194, 0.07349396497011185, 0.02406979911029339, 0.018763070926070213, -0.04771842807531357, -0.045781053602695465, -0.08284390717744827, -0.04969792068004608, 0.009270979091525078, -0.01527789980173111, -0.02689163014292717, -0.0047170910984277725, -0.03005039691925049, -0.06620774418115616, -0.013919630087912083, 0.019415883347392082, -0.06149065122008324, 0.048013247549533844, -0.014498736709356308, 0.08115923404693604, 0.00362205202691257, 0.00841284729540348, 0.04144301265478134, -0.029039591550827026, -0.030682150274515152, 0.03129284456372261, -0.05698414146900177, -0.025249071419239044, 0.03508336469531059, -0.04969792068004608, -0.0037510348483920097, -0.005362005904316902, 0.029839811846613884, -0.03579935058951378, 0.030892733484506607, -0.03209306672215462, 0.00420379126444459, 0.07976938039064407, -0.004285392817109823, 0.028997473418712616, 0.0035615088418126106, -0.04005315527319908, 0.03009251318871975, 0.06208028644323349, -0.016225529834628105, 0.023332754150032997, -0.05226705223321915, 0.00900774821639061, -0.007059842348098755, -0.03325127810239792, 0.01101356465369463, -0.03695756569504738, -0.025185896083712578, -0.027944551780819893, -0.06149065122008324, 0.06544964015483856, -0.010887213982641697, -0.030387330800294876, -0.0033825121354311705, 0.04316980391740799, -0.03630475327372551, -0.01682569459080696, 0.015846477821469307, 0.0035272890236228704, -0.01701522059738636, 0.0678924173116684, -0.031124377623200417, 0.031629778444767, -0.036978624761104584, -0.005859511438757181, -0.016646698117256165, 0.021469080820679665, 0.06321743875741959, 0.014425032772123814, -0.03662063181400299, -0.0060016559436917305, -0.011413675732910633, -0.025017429143190384, 0.027228565886616707, 0.0505402609705925, 0.04649703949689865, 0.04159042239189148, 0.048981934785842896, 0.018341902643442154, 0.05193011835217476 ]
31,981
pingouin.contingency
chi2_mcnemar
Performs the exact and approximated versions of McNemar's test. Parameters ---------- data : :py:class:`pandas.DataFrame` The dataframe containing the ocurrences for the test. Each row must represent either a subject or a pair of subjects. x, y : string The variables names for the McNemar's test. Must be names of columns in ``data``. If each row of ``data`` represents a subject, then ``x`` and ``y`` must be columns containing dichotomous measurements in two different contexts. For instance: the presence of pain before and after a certain treatment. If each row of ``data`` represents a pair of subjects, then ``x`` and ``y`` must be columns containing dichotomous measurements for each of the subjects. For instance: a positive response to a certain drug in the control group and in the test group, supposing that each pair contains a subject in each group. The 2x2 crosstab is created using the :py:func:`pingouin.dichotomous_crosstab` function. .. warning:: Missing values are not allowed. correction : bool Whether to apply the correction for continuity (Edwards, A. 1948). Returns ------- observed : :py:class:`pandas.DataFrame` The observed contingency table of frequencies. stats : :py:class:`pandas.DataFrame` The test summary: * ``'chi2'``: The test statistic * ``'dof'``: The degree of freedom * ``'p-approx'``: The approximated p-value * ``'p-exact'``: The exact p-value Notes ----- The McNemar's test is compatible with dichotomous paired data, generally used to assert the effectiveness of a certain procedure, such as a treatment or the use of a drug. "Dichotomous" means that the values of the measurements are binary. "Paired data" means that each measurement is done twice, either on the same subject in two different moments or in two similar (paired) subjects from different groups (e.g.: control/test). In order to better understand the idea behind McNemar's test, let's illustrate it with an example. Suppose that we wanted to compare the effectiveness of two different treatments (X and Y) for athlete's foot on a certain group of `n` people. To achieve this, we measured their responses to such treatments on each foot. The observed data summary was: * Number of people with good responses to X and Y: `a` * Number of people with good response to X and bad response to Y: `b` * Number of people with bad response to X and good response to Y: `c` * Number of people with bad responses to X and Y: `d` Now consider the two groups: 1. The group of people who had good response to X (`a` + `b` subjects) 2. The group of people who had good response to Y (`a` + `c` subjects) If the treatments have the same effectiveness, we should expect the probabilities of having good responses to be the same, regardless of the treatment. Mathematically, such statement can be translated into the following equation: .. math:: \frac{a+b}{n} = \frac{a+c}{n} \Rightarrow b = c Thus, this test should indicate higher statistical significances for higher distances between `b` and `c` (McNemar, Q. 1947): .. math:: \chi^2 = \frac{(b - c)^2}{b + c} References ---------- * Edwards, A. L. (1948). Note on the "correction for continuity" in testing the significance of the difference between correlated proportions. Psychometrika, 13(3), 185-187. * McNemar, Q. (1947). Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2), 153-157. Examples -------- >>> import pingouin as pg >>> data = pg.read_dataset('chi2_mcnemar') >>> observed, stats = pg.chi2_mcnemar(data, 'treatment_X', 'treatment_Y') >>> observed treatment_Y 0 1 treatment_X 0 20 40 1 8 12 In this case, `c` (40) seems to be a significantly greater than `b` (8). The McNemar test should be sensitive to this. >>> stats chi2 dof p-approx p-exact mcnemar 20.020833 1 0.000008 0.000003
def chi2_mcnemar(data, x, y, correction=True): """ Performs the exact and approximated versions of McNemar's test. Parameters ---------- data : :py:class:`pandas.DataFrame` The dataframe containing the ocurrences for the test. Each row must represent either a subject or a pair of subjects. x, y : string The variables names for the McNemar's test. Must be names of columns in ``data``. If each row of ``data`` represents a subject, then ``x`` and ``y`` must be columns containing dichotomous measurements in two different contexts. For instance: the presence of pain before and after a certain treatment. If each row of ``data`` represents a pair of subjects, then ``x`` and ``y`` must be columns containing dichotomous measurements for each of the subjects. For instance: a positive response to a certain drug in the control group and in the test group, supposing that each pair contains a subject in each group. The 2x2 crosstab is created using the :py:func:`pingouin.dichotomous_crosstab` function. .. warning:: Missing values are not allowed. correction : bool Whether to apply the correction for continuity (Edwards, A. 1948). Returns ------- observed : :py:class:`pandas.DataFrame` The observed contingency table of frequencies. stats : :py:class:`pandas.DataFrame` The test summary: * ``'chi2'``: The test statistic * ``'dof'``: The degree of freedom * ``'p-approx'``: The approximated p-value * ``'p-exact'``: The exact p-value Notes ----- The McNemar's test is compatible with dichotomous paired data, generally used to assert the effectiveness of a certain procedure, such as a treatment or the use of a drug. "Dichotomous" means that the values of the measurements are binary. "Paired data" means that each measurement is done twice, either on the same subject in two different moments or in two similar (paired) subjects from different groups (e.g.: control/test). In order to better understand the idea behind McNemar's test, let's illustrate it with an example. Suppose that we wanted to compare the effectiveness of two different treatments (X and Y) for athlete's foot on a certain group of `n` people. To achieve this, we measured their responses to such treatments on each foot. The observed data summary was: * Number of people with good responses to X and Y: `a` * Number of people with good response to X and bad response to Y: `b` * Number of people with bad response to X and good response to Y: `c` * Number of people with bad responses to X and Y: `d` Now consider the two groups: 1. The group of people who had good response to X (`a` + `b` subjects) 2. The group of people who had good response to Y (`a` + `c` subjects) If the treatments have the same effectiveness, we should expect the probabilities of having good responses to be the same, regardless of the treatment. Mathematically, such statement can be translated into the following equation: .. math:: \\frac{a+b}{n} = \\frac{a+c}{n} \\Rightarrow b = c Thus, this test should indicate higher statistical significances for higher distances between `b` and `c` (McNemar, Q. 1947): .. math:: \\chi^2 = \\frac{(b - c)^2}{b + c} References ---------- * Edwards, A. L. (1948). Note on the "correction for continuity" in testing the significance of the difference between correlated proportions. Psychometrika, 13(3), 185-187. * McNemar, Q. (1947). Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2), 153-157. Examples -------- >>> import pingouin as pg >>> data = pg.read_dataset('chi2_mcnemar') >>> observed, stats = pg.chi2_mcnemar(data, 'treatment_X', 'treatment_Y') >>> observed treatment_Y 0 1 treatment_X 0 20 40 1 8 12 In this case, `c` (40) seems to be a significantly greater than `b` (8). The McNemar test should be sensitive to this. >>> stats chi2 dof p-approx p-exact mcnemar 20.020833 1 0.000008 0.000003 """ # Python code initially inspired by statsmodel's mcnemar assert isinstance(data, pd.DataFrame), "data must be a pandas DataFrame." assert all( isinstance(column, (str, int)) for column in (x, y) ), "column names must be string or int." assert all(column in data.columns for column in (x, y)), "columns are not in dataframe." for column in (x, y): if data[column].isna().any(): raise ValueError("Null values are not allowed.") observed = dichotomous_crosstab(data, x, y) # Careful, the order of b and c is inverted compared to wikipedia # because the colums / rows of the crosstab is [0, 1] and not [1, 0]. c, b = observed.at[0, 1], observed.at[1, 0] n_discordants = b + c if (b, c) == (0, 0): raise ValueError( "McNemar's test does not work if the secondary " + "diagonal of the observed data summary does not " + "have values different from 0." ) chi2 = (abs(b - c) - int(correction)) ** 2 / n_discordants pexact = min(1, 2 * binom.cdf(min(b, c), n_discordants, 0.5)) stats = { "chi2": chi2, "dof": 1, "p-approx": sp_chi2.sf(chi2, 1), "p-exact": pexact, # 'p-mid': pexact - binom.pmf(b, n_discordants, 0.5) } stats = pd.DataFrame(stats, index=["mcnemar"]) return observed, _postprocess_dataframe(stats)
(data, x, y, correction=True)
[ 0.02115604095160961, 0.061388514935970306, 0.039732564240694046, -0.042072128504514694, 0.04211211949586868, -0.043071940541267395, -0.009988131001591682, 0.005453979596495628, 0.021875906735658646, 0.005339000839740038, -0.011527842842042446, 0.061028581112623215, 0.02813473530113697, 0.05694934353232384, -0.0265350341796875, 0.016096988692879677, -0.0063838055357337, -0.009868153370916843, 0.026555031538009644, 0.0067137437872588634, -0.017376748844981194, 0.0005008438020013273, -0.03327377513051033, 0.013597455807030201, -0.039232660084962845, 0.01920640654861927, -0.05922891944646835, -0.029714440926909447, -0.0184465479105711, -0.012757613323628902, -0.03997252136468887, -0.034993451088666916, -0.010338065214455128, 0.021376000717282295, 0.01326751708984375, -0.03415361046791077, 0.03929264843463898, -0.06246831268072128, -0.07606576383113861, 0.013327506370842457, -0.021216031163930893, -0.027174916118383408, 0.06266827136278152, 0.016686877235770226, -0.0014384808018803596, 0.017346754670143127, -0.04295196384191513, 0.0831044539809227, -0.028654638677835464, -0.00014684752386528999, -0.008113482035696507, -0.0927826389670372, 0.0327138788998127, 0.03657315671443939, 0.01864651031792164, 0.04899083450436592, -0.013377496972680092, -0.00024386061704717577, 0.06494785100221634, -0.04375181347131729, 0.03033432364463806, 0.0533900111913681, -0.01017309632152319, -0.004191715735942125, -0.02075611613690853, -0.03391365334391594, 0.05402988940477371, -0.01084796991199255, 0.01681685261428356, 0.015947015956044197, 0.010158099234104156, 0.02373555861413479, 0.008908333256840706, -0.012937579303979874, 0.04379180446267128, 0.002704493934288621, -0.051550354808568954, -0.03885272890329361, 0.010098110884428024, 0.07050681114196777, -0.027094930410385132, 0.010937953367829323, 0.041232284158468246, -0.05163034051656723, -0.030454302206635475, 0.014877215959131718, 0.07646569609642029, 0.044671639800071716, 0.027894780039787292, -0.020636139437556267, -0.021116048097610474, -0.024815356358885765, 0.048110999166965485, -0.02269575372338295, -0.003241893369704485, 0.0208560973405838, -0.0013010065304115415, 0.00420421315357089, 0.01381741464138031, -0.014167348854243755, -0.007163659669458866, 0.09206277132034302, 0.05323003977537155, 0.03655315935611725, -0.014877215959131718, 0.02099607139825821, -0.054389823228120804, 0.06590766459703445, -0.012337691150605679, -0.021835913881659508, -0.0904630720615387, 0.0103480638936162, -0.03777293115854263, -0.04759109392762184, 0.03233395144343376, -0.05167033150792122, -0.033093806356191635, 0.02669500559568405, -0.03635319694876671, 0.023755555972456932, 0.03645318001508713, -0.017586709931492805, 0.0103480638936162, -0.06482786685228348, -0.01119790505617857, -0.036393191665410995, 0.02947448566555977, -0.027394874021410942, 0.01516716182231903, -0.023275645449757576, 0.0022783237509429455, -0.04115229845046997, 0.03661314770579338, 0.06394803524017334, -0.04019248113036156, 0.011977759189903736, 0.033953648060560226, -0.04383179917931557, 0.05590954050421715, -0.05323003977537155, 0.06562772393226624, 0.009788168594241142, -0.008398428559303284, -0.03293383866548538, 0.0004333564138505608, 0.0007936015026643872, 0.018586521968245506, -0.009483225643634796, -0.025755180045962334, -0.03709305822849274, -0.02005624771118164, -0.018526533618569374, 0.035993266850709915, -0.04687123000621796, 0.055189672857522964, -0.011877777986228466, 0.04099233075976372, -0.025675196200609207, -0.005194028373807669, 0.01934638060629368, 0.020736120641231537, -0.07458604127168655, 0.02483535371720791, 0.08070489764213562, 0.035833295434713364, 0.011067928746342659, -0.03531339392066002, -0.02987441048026085, -0.0036693133879452944, -0.04403176158666611, -0.05466977134346962, 0.009528216905891895, -0.05362996459007263, -0.07102671265602112, 0.004891584627330303, -0.030614271759986877, -0.05786917358636856, -0.044711634516716, -0.0018771487521007657, -0.03501344844698906, -0.04411174729466438, -0.027714814990758896, -0.002033369615674019, 0.0005789541755802929, -0.05143037810921669, 0.06686748564243317, 0.061188552528619766, -0.00014934706268832088, 0.022335819900035858, -0.0002524527662899345, -0.011777795851230621, -0.04395177587866783, -0.014607266522943974, 0.08670377731323242, 0.040732380002737045, -0.04543149843811989, 0.04675125330686569, 0.016326945275068283, 0.03595327213406563, -0.032693881541490555, -0.027394874021410942, 0.040032509714365005, 0.02165594883263111, 0.014487288892269135, 0.03311380371451378, 0.013897399418056011, -0.053989898413419724, 0.025875158607959747, -0.043271902948617935, 0.008488412015140057, 0.017386747524142265, -0.0002377680066274479, 0.018426552414894104, -0.02423546463251114, 0.01795664057135582, -0.010288074612617493, 0.08782356977462769, -0.026515038684010506, -0.01884647272527218, -0.008988318033516407, 0.04081236198544502, -0.021615955978631973, -0.02099607139825821, 0.08766359835863113, 0.006683749612420797, 0.04415173828601837, -0.005463977809995413, 0.062028393149375916, 0.030454302206635475, -0.026075121015310287, 0.006978694349527359, 0.050110623240470886, 0.005768920760601759, -0.05790916457772255, -0.05846906080842018, -0.054069884121418, -0.00858339387923479, 0.015747053548693657, -0.07114668935537338, 0.04231208190321922, -0.04095233604311943, -0.058788999915122986, 0.004371682181954384, 0.04419173300266266, -0.0017946641892194748, -0.04011249542236328, 0.05970882624387741, 0.01889646425843239, -0.00031915903673507273, 0.020776113495230675, 0.015297138132154942, -0.05990878865122795, 0.014427300542593002, -0.018076617270708084, 0.026615019887685776, -0.04799101874232292, -0.042472053319215775, 0.03729302063584328, 0.08062491565942764, -0.032393939793109894, 0.023675570264458656, 0.011147914454340935, -0.021376000717282295, -0.00701868673786521, -0.049390759319067, -0.006198840215802193, -0.098781518638134, 0.03313380107283592, -0.006218836177140474, -0.02743486687541008, -0.006913706194609404, -0.017666693776845932, -0.036693133413791656, 0.012407678179442883, -0.04223209619522095, 0.04375181347131729, 0.012777608819305897, -0.01915641501545906, -0.028154732659459114, 0.0047191171906888485, -0.03655315935611725, -0.007103670854121447, 0.0024632890708744526, -0.016246959567070007, -0.0144372982904315, -0.01446729339659214, -0.04279199242591858, -0.0151871582493186, 0.06670752167701721, -0.0014159850543364882, -0.08398428559303284, -0.0781053826212883, -0.02817472815513611, -0.002554522128775716, 0.045711446553468704, -0.0065237791277468204, -0.04155222699046135, -0.03117416612803936, -0.012107734568417072, 0.008478413335978985, 0.009113295003771782, 0.028894593939185143, 0.02249579131603241, -0.009648194536566734, -0.0128475958481431, 0.07554586231708527, 0.05103045329451561, -0.01005311869084835, 0.007573582697659731, -0.02669500559568405, 0.05079049617052078, 0.027394874021410942, -0.018626514822244644, 0.0054489802569150925, 0.027194911614060402, -0.0005673938430845737, -0.011957762762904167, 0.013427487574517727, 0.08966322243213654, 0.025155292823910713, 0.010038121603429317, -0.06498783826828003, 0.08374433219432831, 0.026774989441037178, 0.06130852922797203, -0.039472613483667374, -0.013977385126054287, -0.013307509943842888, 0.017496725544333458, -0.05331002548336983, 0.006298821419477463, -0.018626514822244644, -0.03861277550458908, -0.017346754670143127, 0.035593338310718536, 0.0011904023122042418, -0.033593714237213135, -0.01566706784069538, 0.05346999689936638, 0.006688748486340046, 0.01790664903819561, -0.004286698065698147, 0.003071925137192011, -0.00830344669520855, 0.020876094698905945, -0.030114365741610527, -0.032393939793109894, 0.024575401097536087, -0.04049242287874222, 0.004191715735942125, -0.0021983387414366007, 0.03795289993286133, 0.035733312368392944, 0.03859277814626694, 0.033353760838508606, 0.09030310064554214, 0.011527842842042446, -0.050310585647821426, -0.019616330042481422, 0.015177160501480103, 0.000345247914083302, 0.050750505179166794, 0.013007566332817078, -0.021915899589657784, -0.06458791345357895, -0.030214346945285797, -0.005239019636064768, 0.06318818032741547, 0.028854601085186005, -0.006593766156584024, -0.005329003091901541, -0.04519154503941536, -0.006593766156584024, 0.02189590223133564, 0.05259016156196594, 0.008508408442139626, -0.03613324090838432, 0.007203652057796717, -0.017586709931492805, -0.035633333027362823, 0.046671267598867416, -0.012837598100304604, -0.09454230964183807, 0.003711805446073413, -0.009153286926448345, -0.0056189484894275665, 0.02209586650133133, 0.028614645823836327, -0.05131039768457413, 0.005753923207521439, 0.0075935791246593, -0.0231956597417593, 0.07150661945343018, -0.005408987868577242, -0.0075935791246593, 0.030994201079010963, -0.0011360374046489596, 0.0053639961406588554, -0.08822349458932877, -0.013037560507655144, 0.030894219875335693, -0.005329003091901541, -0.008763359859585762, -0.01656690053641796, -0.03515342250466347, -0.030514290556311607, -0.008593392558395863, -0.050110623240470886, -0.02913454920053482, 0.03213398903608322, -0.042432062327861786, 0.01815660297870636, 0.05722929164767265, -0.005329003091901541, -0.08022499084472656, 0.02059614658355713, -0.05358997359871864, -0.07506595551967621, 0.04315192624926567, 0.021036064252257347, 0.014647259376943111, -0.10837972164154053, 0.04483161121606827, 0.009088299237191677, 0.06622760742902756, -0.05614949390292168, -0.04859090968966484, -0.023915525525808334, -0.03697308152914047, -0.0320340059697628, 0.018766488879919052, -0.00013614639465231448, -0.031354133039712906, -0.020276205614209175, -0.008723367936909199, 0.007183656096458435, -0.05111043527722359, 0.03425358980894089, 0.016776861622929573, 0.00729363551363349, -0.061388514935970306, 0.03277386724948883, 0.017666693776845932, -0.01705680787563324, -0.09318256378173828, 0.005209025461226702, 0.019816292449831963, -0.042911969125270844, -0.04563146084547043, -0.013597455807030201, 0.04515155032277107, 0.005538963712751865, 0.01326751708984375, 0.007398615591228008, 0.02669500559568405, 0.013737429864704609, 0.051710326224565506, 0.021116048097610474, -0.03033432364463806, -0.001615947694517672, 0.0017196782864630222, 0.022375812754034996, -0.04085235670208931, 0.008888336829841137, 0.005523966625332832, 0.07386618107557297, 0.0011754051083698869, 0.008338440209627151, 0.012237709946930408, -0.00426420196890831, -0.0067437379620969296, 0.0160170029848814, -0.014997193589806557, 0.02329564094543457, 0.010418050922453403, 0.0009960635798051953, -0.0887833908200264, -0.0198562853038311, -0.008593392558395863, 0.01950635015964508, 0.02383553981781006, 0.006313818506896496, 0.052950091660022736, -0.04435170069336891, 0.01595701463520527, -0.0677473247051239, 0.04131226986646652, -0.08198466151952744, 0.011937766335904598, -0.044911596924066544, 0.015057182870805264, 0.04163220897316933, 0.026255087926983833, -0.0003530589456204325, -0.034193601459264755, 0.034593526273965836, 0.022815730422735214, -0.0352134108543396, 0.022635765373706818, -0.05386992171406746, 0.05926891043782234, 0.03815286234021187, -0.06866715103387833, -0.039732564240694046, 0.009858155623078346, -0.002704493934288621, -0.03435357287526131, -0.009908146224915981, -0.006593766156584024, 0.0201062373816967, 0.014547278173267841, -0.05826909840106964, 0.05546962097287178, -0.01915641501545906, -0.0027144921477884054, -0.011007940396666527, -0.0520702563226223, 0.008823349140584469, 0.024115487933158875, 0.016526907682418823, 0.020736120641231537, 0.0006283199181780219, 0.03827283903956413, 0.027154918760061264, 0.008538402616977692, 0.04391178488731384, -0.0221958477050066, 0.020226215943694115, -0.013157538138329983, -0.02539524808526039, -0.060988590121269226, -0.038432810455560684, -0.004039244260638952, 0.05722929164767265, -0.01516716182231903, -0.014647259376943111, 0.017386747524142265, -0.004586641676723957, 0.0417121946811676, 0.024215469136834145, -0.013327506370842457, -0.02903456799685955, 0.018226590007543564, -0.0433918796479702, 0.026675008237361908, 0.03213398903608322, -0.011147914454340935, -0.008933328092098236, -0.003596826922148466, 0.034733500331640244, 0.008993317373096943, -0.028414683416485786, 0.014527281746268272, 0.022975701838731766, 0.027894780039787292, 0.02593514695763588, 0.03551335632801056, -0.021975887939333916, 0.0027144921477884054, 0.0011110421037301421, -0.006308819632977247, -0.021116048097610474, 0.05331002548336983, -0.06538776308298111, 0.03865276649594307, 0.04423172399401665, -0.0010329317301511765, 0.0035218410193920135, -0.09190280735492706, -0.041472241282463074, -0.01306755468249321, 0.05754923075437546, 0.014187345281243324, 0.026774989441037178, -0.06586767733097076, 0.01705680787563324, -0.022235838696360588, -0.06886711716651917, 0.03551335632801056, -0.023575589060783386, 0.003276886884123087, 0.013947390019893646, 0.031994014978408813, -0.032493919134140015, 0.01286759227514267, 0.008893336169421673, -0.06934702396392822, 0.0036018260288983583, 0.035733312368392944, 0.00005370088911149651, -0.02913454920053482, -0.02473537251353264, -0.023575589060783386, -0.036793116480112076, 0.02733488567173481, 0.015637073665857315, 0.022975701838731766, 0.027974765747785568, 0.042911969125270844, -0.007383618503808975, 0.00389677076600492, 0.015217152424156666, 0.0016059494810178876, -0.06382805854082108, 0.048110999166965485, 0.006783730816096067, 0.024075495079159737, -0.028314702212810516, -0.003714305115863681, 0.00177966698538512, -0.022335819900035858, 0.009408239275217056, -0.007603577338159084, -0.0367131307721138, 0.04045243188738823, -0.037592966109514236, -0.04583142325282097, -0.017176786437630653, -0.044271714985370636, 0.0014047371223568916, 0.02149597741663456, 0.013037560507655144, -0.007608576212078333, 0.020876094698905945, 0.003146911272779107, 0.01468725223094225, -0.01701681688427925, -0.02723490446805954, -0.04963071271777153, -0.019036438316106796, 0.009173283353447914, 0.022415805608034134, 0.05970882624387741, -0.028394687920808792, -0.013787420466542244, -0.005398989655077457, 0.019176412373781204, 0.015977010130882263, 0.0034543536603450775, 0.08558398485183716, -0.013057556934654713, 0.010118106380105019, 0.027054937556385994, 0.026575027033686638, -0.05470976233482361, -0.004126728046685457, -0.003094421001151204, -0.014447296969592571, 0.00852840393781662, -0.00995313748717308, 0.03281386196613312, 0.04107231646776199, -0.019916273653507233, 0.01805662177503109, 0.02075611613690853, -0.053150054067373276, -0.003549335990101099, 0.036493171006441116, -0.010697998106479645, -0.022415805608034134, 0.07526591420173645, 0.04443168640136719, -0.04343187436461449, -0.019016440957784653, 0.09030310064554214, 0.011447858065366745, 0.07298634201288223, 0.019076431170105934, -0.00779354153200984, 0.011207902804017067, 0.07238645851612091, 0.03485347703099251, -0.016036998480558395, -0.032293956726789474, -0.024615393951535225, -0.007343626115471125, -0.016886839643120766, -0.0006829972262494266, -0.048110999166965485, 0.038832735270261765, 0.05243019014596939, 0.039332639425992966, 0.028794612735509872, 0.008893336169421673, 0.03505343943834305, 0.0480710044503212, 0.0741061344742775, -0.02279573492705822, -0.06034870818257332, -0.11069928854703903, 0.03151410445570946, 0.00622383551672101, -0.0005008438020013273, -0.01721677929162979, 0.027094930410385132, 0.06166846305131912, -0.0687471404671669, 0.0034243592526763678, 0.00033337512286379933, -0.036693133413791656, -0.009748175740242004, 0.007978507317602634, 0.04443168640136719, -0.0006786230369471014, -0.040032509714365005, 0.01476723700761795, -0.0367131307721138, -0.000924826948903501, 0.005289010237902403, -0.06718742847442627, -0.024655386805534363, 0.04195215180516243, -0.019046436995267868, -0.020216217264533043, -0.007028684951364994, -0.0012210215209051967, -0.0012497662100940943, 0.03981254994869232, 0.026155106723308563, -0.0036018260288983583, 0.04231208190321922, 0.007893523201346397, 0.0045441496185958385, 0.023475607857108116, -0.02279573492705822, 0.011247895658016205, 0.022955704480409622, -0.055149681866168976, 0.04719116911292076, -0.058629028499126434, 0.011087925173342228, 0.003984254319220781, 0.029754431918263435, 0.034993451088666916, -0.027014944702386856, 0.005768920760601759, -0.014737242832779884, -0.04819098487496376, 0.048950839787721634, 0.04435170069336891, -0.04175218939781189, 0.023555591702461243, 0.030514290556311607, -0.054549794644117355, -0.029554469510912895, 0.050350580364465714, -0.026075121015310287, 0.04135226085782051, 0.04615136608481407, 0.011757800355553627, 0.027514852583408356, -0.061468496918678284, 0.0024632890708744526, 0.03525340557098389, -0.012397680431604385, 0.07998503744602203, 0.007363622076809406, -0.03941262513399124, 0.02559521049261093, -0.02125602215528488, -0.03831283003091812, 0.018766488879919052, 0.004789103753864765, 0.05526965856552124, -0.027174916118383408, 0.042632024735212326, 0.009088299237191677, 0.08622386306524277 ]
31,982
pingouin.circular
circ_axial
Transforms n-axial data to a common scale. Parameters ---------- angles : array Sample of angles in radians n : int Number of modes Returns ------- angles : float Transformed angles Notes ----- Tranform data with multiple modes (known as axial data) to a unimodal sample, for the purpose of certain analysis such as computation of a mean resultant vector (see Berens 2009). Examples -------- Transform degrees to unimodal radians in the Berens 2009 neuro dataset. >>> import numpy as np >>> from pingouin import read_dataset >>> from pingouin.circular import circ_axial >>> df = read_dataset('circular') >>> angles = df['Orientation'].to_numpy() >>> angles = circ_axial(np.deg2rad(angles), 2)
def circ_axial(angles, n): """Transforms n-axial data to a common scale. Parameters ---------- angles : array Sample of angles in radians n : int Number of modes Returns ------- angles : float Transformed angles Notes ----- Tranform data with multiple modes (known as axial data) to a unimodal sample, for the purpose of certain analysis such as computation of a mean resultant vector (see Berens 2009). Examples -------- Transform degrees to unimodal radians in the Berens 2009 neuro dataset. >>> import numpy as np >>> from pingouin import read_dataset >>> from pingouin.circular import circ_axial >>> df = read_dataset('circular') >>> angles = df['Orientation'].to_numpy() >>> angles = circ_axial(np.deg2rad(angles), 2) """ angles = np.asarray(angles) return np.remainder(angles * n, 2 * np.pi)
(angles, n)
[ -0.08517633378505707, 0.00006564663635799661, 0.027673473581671715, -0.010708891786634922, 0.03258613124489784, 0.013536321930587292, -0.01108882762491703, -0.025853315368294716, -0.008093519136309624, -0.014950037002563477, 0.04799562692642212, 0.06322840601205826, 0.021594498306512833, 0.07952147722244263, -0.031172417104244232, -0.021824227645993233, 0.03293956071138382, 0.006326375063508749, -0.01857268251478672, -0.022425055503845215, 0.010019705630838871, 0.014278522692620754, -0.08086450397968292, -0.008654586970806122, -0.018961453810334206, 0.014322700910270214, 0.05828040465712547, 0.030094459652900696, -0.018183911219239235, -0.005650442559272051, -0.009401204995810986, 0.04644054174423218, 0.011963563971221447, -0.0401495099067688, 0.0016036831075325608, -0.028274301439523697, 0.026719214394688606, 0.011415749788284302, -0.053862545639276505, 0.0437898263335228, 0.038629766553640366, -0.005760889034718275, 0.038983192294836044, -0.008102354593575, -0.03368176147341728, -0.004996599163860083, -0.013209400698542595, 0.065667062997818, -0.04294159635901451, -0.015497852116823196, -0.017229652032256126, -0.049621399492025375, -0.005111463833600283, -0.00020639688591472805, 0.017680274322628975, 0.03813496604561806, -0.048525769263505936, 0.04057362303137779, 0.049798112362623215, -0.022212998941540718, -0.016637658700346947, 0.017998360097408295, 0.04530956968665123, -0.03172023221850395, 0.020322155207395554, 0.028945816680788994, 0.02610071562230587, 0.002493881853297353, 0.023715071380138397, -0.00917147658765316, 0.027214014902710915, 0.0707210972905159, 0.015639223158359528, -0.05068168789148331, -0.011945892125368118, 0.0109474565833807, 0.03564329072833061, 0.09959622472524643, -0.03608507663011551, 0.04909125715494156, -0.03657987713813782, 0.0028959070332348347, 0.054003916680812836, -0.013845572248101234, -0.015073737129569054, 0.017830481752753258, -0.03276284784078598, -0.06283963471651077, -0.05757354572415352, 0.0026219997089356184, -0.02111736871302128, -0.05220143124461174, 0.0032051571179181337, -0.03915990889072418, 0.016531631350517273, 0.03043021820485592, 0.0006996785523369908, -0.02422754280269146, 0.04138651117682457, -0.06538432091474533, -0.04672328382730484, -0.0007118276553228498, -0.0725235864520073, -0.05912863463163376, 0.009860662743449211, -0.00996669102460146, -0.018696382641792297, -0.015913130715489388, 0.02558824233710766, 0.030006103217601776, -0.045380253344774246, 0.03043021820485592, 0.06580843776464462, -0.03930127993226051, -0.006485417950898409, 0.04591039940714836, -0.057326145470142365, -0.010328955948352814, -0.015409494750201702, 0.001739532221108675, 0.03778153657913208, -0.015480180270969868, 0.008703183382749557, 0.02592400088906288, 0.03521917760372162, 0.05873986333608627, -0.01574525237083435, -0.014773322269320488, 0.0038678362034261227, 0.037534136325120926, 0.00021219532936811447, -0.01078841369599104, 0.05343842878937721, -0.005884589161723852, -0.01929721049964428, 0.05711409077048302, -0.016999924555420876, -0.044284626841545105, -0.02367972768843174, -0.006189421284943819, -0.0024497031699866056, 0.025888657197356224, 0.06739886850118637, 0.019915711134672165, 0.02800923027098179, 0.06909532845020294, 0.027320044115185738, -0.0048066312447190285, -0.040679652243852615, -0.022919856011867523, 0.019792011007666588, 0.043825168162584305, 0.05506420135498047, -0.015754086896777153, 0.0369686484336853, -0.01915583945810795, 0.014561265707015991, 0.003945148549973965, -0.09019502252340317, 0.011654313653707504, -0.04043225198984146, 0.06916601210832596, -0.03915990889072418, 0.002202303148806095, 0.01828993856906891, -0.035289861261844635, -0.0010277045657858253, -0.08114724606275558, 0.0230435561388731, -0.06220346316695213, -0.04297693818807602, 0.0013816856080666184, -0.024245213717222214, -0.04219939559698105, -0.011530613526701927, -0.016266560181975365, -0.0716046690940857, -0.0038126129657030106, 0.01710595190525055, -0.02901650220155716, -0.01270576473325491, -0.03972539305686951, 0.010143405757844448, -0.06457144021987915, 0.0015738625079393387, 0.05753820389509201, 0.034936435520648956, -0.02527015656232834, 0.059022605419158936, -0.07499758899211884, -0.005694621242582798, 0.05577106028795242, 0.011274377815425396, 0.012785285711288452, 0.028875131160020828, -0.09026570618152618, -0.007744507864117622, 0.046475883573293686, -0.0314905047416687, -0.040538281202316284, 0.00452830595895648, 0.06227415055036545, 0.005305849481374025, -0.0030682035721838474, 0.007691493723541498, -0.005615099798887968, -0.03855907917022705, -0.027496758848428726, 0.09683948755264282, 0.037569478154182434, 0.09500165283679962, 0.026754558086395264, -0.02641880139708519, -0.025393856689333916, -0.1022116020321846, 0.10772509127855301, 0.045875053852796555, -0.02428055740892887, 0.019597625359892845, -0.011866371147334576, 0.008685512468218803, 0.02678990177810192, 0.05043428763747215, -0.038947850465774536, -0.007006725296378136, -0.00512029929086566, 0.005531160160899162, 0.05453405901789665, -0.041633907705545425, -0.05396857485175133, -0.00458573829382658, 0.013041521422564983, -0.01998639665544033, -0.0014601026196032763, 0.014013450592756271, -0.05813903361558914, -0.0070111434906721115, -0.006472164299339056, -0.05280225723981857, 0.049656741321086884, -0.027443744242191315, 0.01938556879758835, -0.024298228323459625, 0.03764016553759575, 0.022566426545381546, 0.019014468416571617, 0.0018146358197554946, 0.019491596147418022, -0.02592400088906288, -0.02811525948345661, -0.033876147121191025, -0.03472437709569931, -0.0424467958509922, -0.04018485173583031, -0.023467671126127243, -0.006794668268412352, -0.08390399068593979, 0.025800300762057304, 0.03703933581709862, -0.02102901227772236, 0.04103308171033859, -0.010920949280261993, -0.03703933581709862, -0.01839596778154373, 0.041139110922813416, -0.005584174767136574, -0.016072172671556473, 0.0022475861478596926, -0.020145440474152565, -0.030765974894165993, 0.03249777480959892, 0.01629306562244892, -0.008583901450037956, 0.00042798015056177974, 0.029087187722325325, 0.04110376536846161, 0.08051107823848724, 0.01510024443268776, -0.0055532497353851795, 0.02514645643532276, 0.0008675571880303323, -0.02742607332766056, -0.004018043167889118, 0.06393526494503021, -0.027267029508948326, -0.021205727010965347, -0.043047625571489334, -0.03463602066040039, 0.036297135055065155, 0.0034172143787145615, 0.05927000567317009, 0.0025005086790770292, -0.04552162438631058, 0.014561265707015991, 0.041457194834947586, -0.009410041384398937, -0.03735741972923279, -0.007806357927620411, -0.01811322383582592, -0.003105755429714918, -0.0018411430064588785, -0.0003020711592398584, 0.013721872121095657, -0.04499148204922676, 0.03431793302297592, -0.07036767154932022, -0.02861005999147892, -0.032603804022073746, 0.02382109872996807, 0.05941137671470642, -0.012219799682497978, -0.021241068840026855, 0.02696661464869976, -0.008504379540681839, -0.0157364159822464, -0.05693737417459488, 0.002332629868760705, -0.00009822834545047954, 0.07082712650299072, 0.00791238620877266, -0.002229914767667651, -0.016390258446335793, -0.036615222692489624, 0.04064431041479111, -0.02956431731581688, 0.050080858170986176, 0.008765033446252346, 0.0419873371720314, -0.01535648014396429, -0.015056065283715725, -0.08383330702781677, 0.02641880139708519, -0.07556307315826416, 0.010187583975493908, -0.07082712650299072, -0.011336227878928185, 0.009348191320896149, -0.04739479720592499, 0.060294948518276215, -0.0141459871083498, -0.010143405757844448, 0.02527015656232834, -0.0023127496242523193, -0.022619441151618958, -0.023750413209199905, 0.04513285309076309, 0.029546644538640976, 0.010002034716308117, 0.008919659070670605, -0.02910485863685608, 0.002482837066054344, -0.032603804022073746, -0.022230669856071472, 0.02733771502971649, -0.017211981117725372, 0.05707874521613121, 0.001711920602247119, -0.00800516176968813, -0.02751442976295948, -0.015939638018608093, 0.007969819009304047, -0.025128785520792007, -0.014852844178676605, -0.024563299492001534, -0.020728597417473793, 0.03525451943278313, -0.006507507059723139, 0.007183440029621124, 0.02933458797633648, 0.021824227645993233, -0.02177121303975582, -0.004815467167645693, -0.009630934335291386, 0.034971777349710464, 0.016213545575737953, 0.05251951515674591, 0.002250899560749531, -0.007775432895869017, 0.0011850908631458879, -0.01077074185013771, -0.06283963471651077, -0.07966284453868866, 0.0010978381615132093, 0.04689999669790268, -0.030730631202459335, 0.019703654572367668, -0.014269686304032803, -0.015126751735806465, -0.05485214665532112, 0.012997343204915524, -0.006352882366627455, -0.04386050999164581, 0.01578059419989586, -0.051494572311639786, -0.031172417104244232, 0.04799562692642212, 0.008168622851371765, 0.025764957070350647, -0.0369686484336853, -0.0016953536542132497, -0.03792290762066841, 0.016893895342946053, 0.041139110922813416, -0.026136057451367378, -0.031737904995679855, 0.05619517341256142, 0.0688832700252533, -0.00028094826848246157, 0.00996669102460146, -0.09740497171878815, -0.013306593522429466, 0.04545094072818756, 0.05548831820487976, -0.008928494527935982, 0.07945078611373901, 0.01883775368332863, -0.019102824851870537, -0.09224490821361542, -0.024245213717222214, -0.014958872459828854, -0.012051921337842941, -0.05679600313305855, -0.06520760804414749, 0.04128048196434975, 0.049020569771528244, 0.009595591574907303, 0.05333240330219269, 0.004837556276470423, -0.012829464860260487, 0.06082509085536003, 0.008729690685868263, 0.028963487595319748, -0.046970684081315994, -0.028451016172766685, 0.0037021664902567863, 0.03435327857732773, 0.022106969729065895, 0.030059117823839188, -0.033964503556489944, -0.019650639966130257, -0.03170255944132805, 0.0542866587638855, -0.0033642002381384373, 0.01120369229465723, -0.00488173495978117, 0.0004550395533442497, 0.028451016172766685, -0.013085700571537018, -0.0027810425963252783, -0.06920135021209717, 0.021152712404727936, 0.013721872121095657, -0.030553918331861496, -0.043330367654561996, 0.013474471867084503, -0.034247249364852905, 0.00017519574612379074, 0.02746141515672207, -0.01061169896274805, 0.04997482895851135, 0.027620458975434303, 0.001726278685964644, -0.013500979170203209, -0.029034173116087914, 0.02113504149019718, -0.0004818228189833462, -0.003130053635686636, 0.015020722523331642, -0.011707328259944916, -0.016999924555420876, 0.019562283530831337, 0.05350911617279053, -0.010620534420013428, 0.028733760118484497, 0.013925093226134777, -0.02500508539378643, 0.019314883276820183, 0.0045238882303237915, -0.01834295317530632, -0.03394683450460434, -0.09478959441184998, 0.03233873099088669, -0.03232106193900108, 0.014322700910270214, -0.030872004106640816, -0.016628824174404144, -0.06404129415750504, -0.04078568145632744, -0.018413638696074486, -0.04640519618988037, 0.013059193268418312, 0.03143749013543129, -0.006931622046977282, 0.05255485698580742, 0.029741032049059868, 0.032639145851135254, 0.007002307567745447, -0.02820361591875553, 0.013094536028802395, 0.02117038331925869, 0.000985734979622066, -0.03809962049126625, 0.010982799343764782, -0.011831028386950493, -0.009348191320896149, 0.021470798179507256, -0.048066314309835434, -0.055134888738393784, -0.020233796909451485, 0.007201111409813166, 0.01286480762064457, 0.025358514860272408, 0.0775422751903534, -0.03703933581709862, 0.03133146092295647, -0.03002377413213253, 0.005690203048288822, -0.050717029720544815, 0.00019190077728126198, 0.007678240071982145, 0.005341192241758108, -0.00755012221634388, 0.007872626185417175, 0.07549238950014114, -0.001958216307684779, 0.013880915008485317, 0.03143749013543129, -0.036756593734025955, -0.06071906164288521, -0.03074830397963524, -0.023750413209199905, 0.007108336314558983, -0.024121513590216637, 0.029122531414031982, -0.030094459652900696, 0.019774340093135834, -0.016531631350517273, 0.01811322383582592, 0.08418673276901245, 0.019509268924593925, -0.03156118839979172, -0.03156118839979172, -0.0006720668752677739, 0.00229286914691329, -0.021294083446264267, -0.041315823793411255, 0.046546570956707, -0.03774619475007057, 0.0848935917019844, 0.05114114284515381, -0.004024669993668795, 0.013545157387852669, -0.016142860054969788, -0.013421457260847092, 0.03262147679924965, 0.006511925254017115, 0.0296526737511158, -0.08567113429307938, -0.029263902455568314, -0.018130896613001823, -0.011459928005933762, -0.00855739414691925, 0.0068167573772370815, -0.05517023056745529, 0.02062256820499897, 0.024580970406532288, 0.08659005165100098, 0.010099227540194988, 0.03824099153280258, -0.016726016998291016, -0.021647512912750244, 0.047112055122852325, 0.002190154045820236, -0.05679600313305855, -0.010258270427584648, -0.03749879449605942, 0.01619587279856205, -0.06683338433504105, -0.028079915791749954, -0.012882478535175323, 0.012670421972870827, -0.03915990889072418, -0.085812509059906, -0.04311830922961235, 0.0679643526673317, 0.0474654845893383, -0.006224764045327902, 0.07287701219320297, 0.06393526494503021, -0.026577843353152275, -0.03154351934790611, -0.06768161058425903, 0.03437094762921333, 0.0035099894739687443, -0.018007196485996246, 0.028963487595319748, -0.03718070685863495, -0.014587773010134697, -0.026206742972135544, -0.016673002392053604, 0.02249574102461338, 0.010461491532623768, -0.03884182125329971, 0.027267029508948326, -0.018873097375035286, 0.05891657620668411, -0.002767789177596569, -0.05828040465712547, -0.019456254318356514, 0.004362636245787144, -0.00887547992169857, 0.045380253344774246, -0.03507780656218529, 0.010797249153256416, -0.007806357927620411, 0.0023591371718794107, -0.03746344894170761, 0.028769101947546005, -0.048985227942466736, 0.07178138196468353, -0.043825168162584305, 0.016664166003465652, -0.0280622448772192, 0.010116898454725742, -0.024209871888160706, -0.006825593300163746, -0.0025844478514045477, 0.010876770131289959, -0.03164954483509064, 0.02025146782398224, 0.04548628255724907, -0.008698766119778156, -0.03774619475007057, -0.021700527518987656, -0.03714536502957344, 0.047889597713947296, -0.011389242485165596, 0.0029621748253703117, 0.0088975690305233, 0.05456940084695816, -0.013633514754474163, -0.013271250762045383, -0.0010591818718239665, -0.010063884779810905, 0.05174197256565094, -0.031737904995679855, -0.02892814576625824, -0.000023280050299945287, -0.0725235864520073, -0.04732411354780197, -0.01633724570274353, 0.041951995342969894, 0.036049734801054, 0.0030019355472177267, 0.043683797121047974, -0.0383116789162159, -0.007130425423383713, 0.062309492379426956, 0.012599735520780087, -0.0442492812871933, 0.018767068162560463, 0.01088560651987791, -0.010585191659629345, 0.07065041363239288, 0.052766915410757065, 0.02185956947505474, -0.0006770369946025312, -0.01633724570274353, -0.0643240362405777, 0.03901853784918785, 0.031013375148177147, -0.004788959864526987, 0.07400798797607422, -0.005425131879746914, 0.04421393945813179, 0.048985227942466736, 0.020375167950987816, 0.02800923027098179, 0.06054234877228737, 0.034971777349710464, -0.04357776790857315, -0.029988432303071022, 0.037534136325120926, 0.023202598094940186, 0.029688017442822456, -0.03472437709569931, 0.06078974902629852, 0.0018499786965548992, -0.0365091934800148, -0.008252562023699284, 0.012555557303130627, 0.057290803641080856, -0.007192275486886501, 0.01238767895847559, 0.08552975952625275, -0.04039691016077995, -0.026224415749311447, 0.06679803878068924, 0.01147759985178709, 0.0333106629550457, 0.11140074580907822, -0.05421597510576248, 0.0019074109150096774, -0.00636613555252552, -0.04089171066880226, 0.011274377815425396, 0.062344834208488464, -0.018148567527532578, -0.05570037290453911, 0.01866103895008564, -0.03414122015237808, 0.0479249432682991, -0.010284777730703354, 0.039760738611221313, -0.038983192294836044, 0.03774619475007057, 0.017945345491170883, 0.02428055740892887, -0.05075237154960632, -0.00006264387047849596, 0.006101064383983612, 0.044284626841545105, 0.07690609991550446, -0.010753070004284382, -0.003523243125528097, 0.008866644464433193, 0.057926975190639496, 0.05813903361558914, -0.05672531947493553, -0.04322433844208717, 0.004758034832775593, -0.02295519970357418, 0.003355364315211773, 0.0007190066389739513, 0.003304559038951993, 0.018767068162560463, 0.016575809568166733, -0.029688017442822456, -0.07358387112617493, -0.04785425588488579, 0.005429549608379602, -0.0068167573772370815, 0.010744234547019005, -0.02405082806944847, -0.020657911896705627, 0.009268669411540031, -0.03806427866220474, -0.0262420866638422, 0.039760738611221313, -0.01247603539377451, 0.0023260030429810286, 0.07103918492794037, -0.012829464860260487, 0.026206742972135544, -0.012025414034724236, -0.0182545967400074, 0.0032736340072005987, 0.06485418230295181, -0.02546454221010208, -0.0036624057684093714, -0.01998639665544033, 0.04018485173583031, 0.02102901227772236, 0.020587226375937462, 0.002540269400924444, -0.0355902761220932, 0.02815060131251812, -0.04502682387828827 ]
31,983
pingouin.circular
circ_corrcc
Correlation coefficient between two circular variables. Parameters ---------- x : 1-D array_like First circular variable (expressed in radians). y : 1-D array_like Second circular variable (expressed in radians). correction_uniform : bool Use correction for uniform marginals. Returns ------- r : float Correlation coefficient. pval : float Uncorrected p-value. Notes ----- Adapted from the CircStats MATLAB toolbox [1]_. The range of ``x`` and ``y`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. Please note that NaN are automatically removed. If the ``correction_uniform`` is True, an alternative equation from [2]_ (p. 177) is used. If the marginal distribution of ``x`` or ``y`` is uniform, the mean is not well defined, which leads to wrong estimates of the circular correlation. The alternative equation corrects for this by choosing the means in a way that maximizes the positive or negative correlation. References ---------- .. [1] Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 .. [2] Jammalamadaka, S. R., & Sengupta, A. (2001). Topics in circular statistics (Vol. 5). world scientific. Examples -------- Compute the r and p-value of two circular variables >>> from pingouin import circ_corrcc >>> x = [0.785, 1.570, 3.141, 3.839, 5.934] >>> y = [0.593, 1.291, 2.879, 3.892, 6.108] >>> r, pval = circ_corrcc(x, y) >>> print(round(r, 3), round(pval, 4)) 0.942 0.0658 With the correction for uniform marginals >>> r, pval = circ_corrcc(x, y, correction_uniform=True) >>> print(round(r, 3), round(pval, 4)) 0.547 0.2859
def circ_corrcc(x, y, correction_uniform=False): """Correlation coefficient between two circular variables. Parameters ---------- x : 1-D array_like First circular variable (expressed in radians). y : 1-D array_like Second circular variable (expressed in radians). correction_uniform : bool Use correction for uniform marginals. Returns ------- r : float Correlation coefficient. pval : float Uncorrected p-value. Notes ----- Adapted from the CircStats MATLAB toolbox [1]_. The range of ``x`` and ``y`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. Please note that NaN are automatically removed. If the ``correction_uniform`` is True, an alternative equation from [2]_ (p. 177) is used. If the marginal distribution of ``x`` or ``y`` is uniform, the mean is not well defined, which leads to wrong estimates of the circular correlation. The alternative equation corrects for this by choosing the means in a way that maximizes the positive or negative correlation. References ---------- .. [1] Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 .. [2] Jammalamadaka, S. R., & Sengupta, A. (2001). Topics in circular statistics (Vol. 5). world scientific. Examples -------- Compute the r and p-value of two circular variables >>> from pingouin import circ_corrcc >>> x = [0.785, 1.570, 3.141, 3.839, 5.934] >>> y = [0.593, 1.291, 2.879, 3.892, 6.108] >>> r, pval = circ_corrcc(x, y) >>> print(round(r, 3), round(pval, 4)) 0.942 0.0658 With the correction for uniform marginals >>> r, pval = circ_corrcc(x, y, correction_uniform=True) >>> print(round(r, 3), round(pval, 4)) 0.547 0.2859 """ x = np.asarray(x) y = np.asarray(y) assert x.size == y.size, "x and y must have the same length." # Remove NA x, y = remove_na(x, y, paired=True) n = x.size # Compute correlation coefficient x_sin = np.sin(x - circ_mean(x)) y_sin = np.sin(y - circ_mean(y)) if not correction_uniform: # Similar to np.corrcoef(x_sin, y_sin)[0][1] r = np.sum(x_sin * y_sin) / np.sqrt(np.sum(x_sin**2) * np.sum(y_sin**2)) else: r_minus = np.abs(np.sum(np.exp((x - y) * 1j))) r_plus = np.abs(np.sum(np.exp((x + y) * 1j))) denom = 2 * np.sqrt(np.sum(x_sin**2) * np.sum(y_sin**2)) r = (r_minus - r_plus) / denom # Compute T- and p-values tval = ( np.sqrt((n * (x_sin**2).mean() * (y_sin**2).mean()) / np.mean(x_sin**2 * y_sin**2)) * r ) # Approximately distributed as a standard normal pval = 2 * norm.sf(abs(tval)) return r, pval
(x, y, correction_uniform=False)
[ -0.01785728521645069, -0.009308378212153912, 0.030573541298508644, 0.011187579482793808, 0.03427352383732796, -0.006582074798643589, -0.02395251952111721, 0.016328608617186546, 0.07532385736703873, -0.0020495958160609007, 0.03183932602405548, -0.011878891848027706, 0.03080722503364086, 0.05359132960438728, -0.0478660948574543, 0.023426733911037445, 0.008631670847535133, -0.03923929110169411, -0.05573342368006706, -0.035422466695308685, -0.006104971747845411, 0.017682023346424103, -0.022608842700719833, 0.02975565195083618, -0.035558782517910004, 0.0038703768514096737, -0.009327851235866547, -0.007804042659699917, -0.03890823945403099, 0.010243110358715057, 0.012239153496921062, -0.018587544560432434, -0.046269260346889496, 0.010058111511170864, -0.01890886016190052, 0.0031717615202069283, 0.07162387669086456, 0.04599662870168686, -0.058264993131160736, -0.000599117309320718, -0.05701868236064911, 0.004999845288693905, 0.010389162227511406, -0.03296879306435585, -0.009834164753556252, 0.010282057337462902, -0.10141847282648087, 0.04175138473510742, -0.07310386747121811, -0.0100775845348835, 0.021284637972712517, -0.04813872277736664, -0.04175138473510742, -0.012200206518173218, 0.030631963163614273, 0.017273077741265297, 0.004766162019222975, 0.06453549116849899, -0.02589987963438034, -0.023173576220870018, 0.034604575484991074, -0.008787458762526512, -0.010243110358715057, -0.0017197617562487721, 0.022180423140525818, 0.010885738767683506, 0.01150889415293932, -0.014449406415224075, 0.061419714242219925, 0.012735730037093163, -0.016630448400974274, 0.06909231096506119, -0.00445215031504631, -0.08506065607070923, 0.034468259662389755, -0.027535662055015564, 0.05386396124958992, 0.0023356140591204166, -0.004649320617318153, -0.0500471368432045, -0.010768896900117397, 0.03966771066188812, 0.06948178261518478, -0.015705453231930733, -0.004306098446249962, -0.0005820778897032142, -0.02993091382086277, -0.006728126667439938, -0.0024670609273016453, -0.006728126667439938, -0.03279353305697441, -0.04397137463092804, 0.031410906463861465, -0.012609152123332024, 0.0009767224546521902, 0.012141785584390163, -0.011294684372842312, -0.002850447315722704, 0.03524720296263695, -0.01596834696829319, -0.02099253423511982, 0.019746223464608192, -0.03684404119849205, 0.015062824822962284, 0.03300774097442627, 0.027574608102440834, -0.010145742446184158, 0.037369824945926666, 0.026425667107105255, 0.016630448400974274, -0.03086564689874649, -0.022589368745684624, 0.027185136452317238, -0.0018463401356711984, -0.018207810819149017, 0.000458542286651209, -0.09627744555473328, 0.031566694378852844, -0.003704851260408759, -0.00575444707646966, 0.016630448400974274, 0.0319756418466568, 0.007156545761972666, 0.002538869855925441, 0.03164459019899368, 0.004532478749752045, -0.002341699553653598, 0.035500362515449524, -0.026406193152070045, 0.010067847557365894, -0.02595829963684082, -0.04381558671593666, 0.052345018833875656, 0.00808640941977501, 0.04529557749629021, 0.018529124557971954, 0.010350215248763561, 0.015043350867927074, 0.03106038272380829, 0.004802674986422062, 0.07902384549379349, 0.056356579065322876, -0.019191225990653038, 0.011129158549010754, 0.012560468167066574, 0.06363970786333084, 0.03294932097196579, -0.013641252182424068, 0.014244933612644672, 0.046463996171951294, -0.005876156967133284, -0.013923619873821735, 0.08147751539945602, 0.03411773592233658, 0.027496714144945145, -0.02595829963684082, 0.03127459064126015, -0.02780829183757305, -0.031430378556251526, 0.010593635030090809, -0.012414416298270226, -0.004593334160745144, 0.04478926584124565, -0.03102143481373787, 0.07458386570215225, -0.0026946584694087505, 0.057486049830913544, -0.056317634880542755, 0.006664837244898081, -0.036415621638298035, -0.042530328035354614, -0.07660911977291107, -0.029346706345677376, -0.044244006276130676, 0.03781772032380104, -0.05904393643140793, -0.05690184235572815, -0.051566075533628464, -0.018743334338068962, -0.01692255213856697, 0.010116531513631344, -0.02404988743364811, 0.02609461545944214, -0.03374773636460304, -0.015179666690528393, 0.083424873650074, 0.07867331802845001, -0.06453549116849899, 0.04685346782207489, -0.020466746762394905, 0.013699673116207123, 0.016387028619647026, -0.019162015989422798, 0.09152588993310928, 0.07139019668102264, -0.06060182303190231, 0.04802188277244568, 0.007643385324627161, 0.04490610584616661, -0.027788817882537842, 0.00794522650539875, 0.010330741293728352, -0.0009761138935573399, 0.024322519078850746, 0.03828508406877518, -0.02307620830833912, -0.02307620830833912, 0.025666195899248123, 0.0025899880565702915, 0.01599755696952343, 0.041245073080062866, 0.02383567951619625, -0.001465387875214219, -0.04907345771789551, -0.042452435940504074, 0.10741634666919708, 0.06558706611394882, -0.0722859799861908, -0.030437227338552475, 0.0036293910816311836, 0.08911116421222687, -0.011265474371612072, 0.021576741710305214, 0.007268518675118685, -0.013524411246180534, 0.007589833345264196, -0.03181985393166542, 0.0599786676466465, 0.03606509417295456, -0.08973432332277298, 0.056317634880542755, 0.02393304742872715, -0.02989196591079235, -0.00853430200368166, -0.021304111927747726, -0.10990896075963974, 0.020661482587456703, 0.04319243133068085, -0.04880082607269287, 0.04081665351986885, -0.04471137002110481, 0.026425667107105255, 0.024673042818903923, 0.05292922630906105, 0.0001260458811884746, -0.02889881283044815, 0.030184069648385048, 0.014614932239055634, -0.014215723611414433, 0.005184844136238098, -0.036376673728227615, -0.030125649645924568, -0.025568827986717224, -0.01252152118831873, 0.024400413036346436, -0.02706829458475113, -0.014079408720135689, 0.005661947187036276, 0.06547021865844727, 0.022745156660676003, 0.023387786000967026, 0.0045957681722939014, -0.014731774106621742, 0.00892377458512783, -0.037311404943466187, -0.056473422795534134, -0.06913125514984131, 0.005540237296372652, -0.003349458100274205, 0.013699673116207123, -0.03400089591741562, 0.013057044707238674, -0.010953896678984165, -0.020291484892368317, -0.014517564326524734, 0.01796439103782177, 0.058420781046152115, 0.028567761182785034, 0.11045422405004501, -0.006333786528557539, -0.007068914361298084, -0.01609492488205433, -0.016455186530947685, -0.02911302261054516, 0.007273387163877487, -0.009590744972229004, -0.029132496565580368, 0.004705307073891163, 0.026328299194574356, 0.020233063027262688, 0.004919516853988171, -0.03464352339506149, -0.022414106875658035, 0.021654635667800903, 0.07719332724809647, 0.04066086560487747, -0.025510407984256744, -0.016601238399744034, 0.0012730861781165004, -0.017341235652565956, -0.0218493714928627, 0.026191983371973038, -0.01987280324101448, -0.021440425887703896, 0.027438294142484665, -0.03581193834543228, 0.08646275848150253, -0.04105033725500107, -0.0031741957645863295, 0.06095234677195549, 0.010866265743970871, -0.033221952617168427, 0.004172217566519976, 0.025237778201699257, 0.015374402515590191, -0.01907438598573208, 0.0010004559298977256, 0.012609152123332024, 0.0577976256608963, -0.007662859279662371, 0.024400413036346436, -0.04681451991200447, 0.05409764498472214, 0.03524720296263695, -0.013456253334879875, -0.004848924931138754, -0.04066086560487747, 0.08093225210905075, 0.008354172110557556, 0.059550248086452484, -0.03213142976164818, 0.02482883259654045, -0.03308563679456711, 0.04198506847023964, 0.06110813841223717, -0.02103148214519024, 0.01997990719974041, -0.03292984887957573, 0.056434474885463715, -0.016747290268540382, 0.00424524350091815, -0.04112822934985161, -0.008334698155522346, -0.031547222286462784, -0.05616184324026108, 0.010846791788935661, 0.06621021777391434, 0.02784723974764347, 0.049501873552799225, -0.05316291004419327, 0.03600667417049408, 0.050514500588178635, 0.011791260913014412, 0.044438742101192474, -0.05877130478620529, 0.09456377476453781, -0.046347152441740036, -0.00853917095810175, 0.05814814940094948, 0.030554069206118584, -0.043542955070734024, 0.03520825877785683, 0.024653568863868713, -0.04868398606777191, -0.07037756592035294, 0.06005656346678734, -0.08879958838224411, 0.03955087065696716, -0.02305673435330391, -0.002524264622479677, -0.016552554443478584, -0.006197471171617508, -0.051527127623558044, -0.033436160534620285, -0.022628316655755043, 0.040427181869745255, -0.004427808336913586, -0.020388852804899216, 0.009225615300238132, -0.06885863095521927, 0.014517564326524734, -0.03871350362896919, -0.08007542043924332, 0.007507070433348417, -0.06881967931985855, 0.019278857856988907, -0.010564425028860569, -0.006129313725978136, -0.0336698442697525, 0.047437675297260284, -0.016133872792124748, -0.07715437561273575, 0.07750490307807922, -0.015277034603059292, -0.03690246120095253, 0.002555909100919962, 0.05417553707957268, 0.037447720766067505, -0.04393242672085762, -0.01782807521522045, 0.03964823856949806, 0.022122003138065338, 0.03801245614886284, -0.024225151166319847, 0.008733906783163548, 0.0003928189107682556, 0.04128401726484299, -0.01442993339151144, 0.008962721563875675, 0.015491243451833725, -0.053552381694316864, -0.009507982060313225, 0.07014388591051102, 0.0019911748822778463, -0.030554069206118584, 0.01904517412185669, -0.11536157131195068, -0.056278686970472336, 0.033494580537080765, 0.03234563767910004, 0.0007850292604416609, -0.10102900117635727, -0.008660880848765373, 0.041439808905124664, -0.004795372486114502, 0.026289351284503937, 0.055460795760154724, 0.004520307760685682, 0.029677756130695343, -0.014390985481441021, -0.010136005468666553, 0.05300712212920189, -0.01781833916902542, -0.04182928055524826, 0.0010473142610862851, -0.0031401170417666435, 0.007370755076408386, 0.045490313321352005, 0.009707586839795113, -0.02288147248327732, -0.012414416298270226, 0.029697230085730553, 0.00239160074852407, -0.06212076544761658, -0.09495324641466141, 0.03600667417049408, -0.002950249472633004, -0.03960929065942764, -0.03283247724175453, -0.011654946021735668, 0.024322519078850746, -0.004031033720821142, 0.027788817882537842, 0.016348082572221756, -0.01102205365896225, -0.02584145963191986, -0.05374711751937866, -0.010691002942621708, -0.037428248673677444, -0.06500285863876343, 0.004471623804420233, 0.020349904894828796, -0.01893807016313076, -0.021420953795313835, -0.013972303830087185, 0.04794398695230484, 0.026425667107105255, -0.005072871223092079, -0.014984930865466595, 0.012093101628124714, -0.001203711493872106, -0.007409702520817518, -0.04887872189283371, 0.020505694672465324, 0.01292072981595993, 0.04128401726484299, -0.019230173900723457, 0.07738806307315826, -0.009040615521371365, -0.04759346321225166, -0.051449235528707504, -0.02504304237663746, -0.047437675297260284, -0.005097213201224804, 0.059277620166540146, -0.04564610496163368, -0.018801754340529442, -0.01540361251682043, 0.02996986173093319, -0.021226217970252037, 0.027263030409812927, 0.028334079310297966, -0.045451369136571884, 0.0002834320766851306, -0.06075761094689369, -0.014702563174068928, 0.0070299673825502396, -0.045412421226501465, 0.010798107832670212, 0.0210509542375803, 0.04669767618179321, -0.02599724754691124, -0.01554966438561678, -0.028295131400227547, 0.025413040071725845, 0.00376327196136117, -0.06161445006728172, -0.01914254203438759, -0.020349904894828796, 0.030125649645924568, 0.022258317098021507, 0.007458386477082968, 0.03668824955821037, -0.010642318986356258, -0.0024220282211899757, -0.01339783240109682, 0.004715044051408768, 0.022394632920622826, -0.007920884527266026, -0.057291314005851746, -0.03306616097688675, 0.06940388679504395, -0.004048073198646307, 0.04521768540143967, 0.015530191361904144, 0.03384510427713394, -0.04416611045598984, -0.04798293486237526, -0.04159559682011604, -0.027671976014971733, -0.030612489208579063, -0.04381558671593666, -0.05775867775082588, -0.03392300009727478, -0.045529261231422424, 0.024439360946416855, -0.03302721679210663, -0.05199449509382248, 0.01599755696952343, 0.014858352020382881, 0.0089870635420084, 0.040232446044683456, 0.04097244143486023, 0.032481953501701355, 0.008763116784393787, 0.007877068594098091, -0.0038387321401387453, -0.023718837648630142, -0.0030524858739227057, 0.02582198567688465, 0.021304111927747726, -0.045373473316431046, -0.0024366334546357393, 0.004191691055893898, -0.0401156023144722, 0.023251470178365707, -0.032520901411771774, -0.04373769089579582, -0.01606571488082409, -0.004581162706017494, 0.027360398322343826, -0.023407259956002235, -0.005988129880279303, -0.06223760545253754, 0.004963332321494818, 0.04358190298080444, 0.03980402648448944, -0.0023149235639721155, -0.008943247608840466, -0.025510407984256744, -0.05682394653558731, 0.08280172199010849, -0.010856528766453266, 0.048333458602428436, 0.034409839659929276, 0.022472526878118515, 0.05803130939602852, -0.07057230174541473, -0.030320385470986366, -0.027671976014971733, 0.004230638034641743, -0.05312396213412285, 0.057563941925764084, -0.09713428467512131, 0.0016041372437030077, 0.01248257327824831, -0.06060182303190231, 0.01349520031362772, 0.052306074649095535, 0.005501290317624807, -0.023679889738559723, 0.033436160534620285, -0.04981345310807228, -0.07415544241666794, -0.00956640299409628, 0.031469326466321945, -0.029677756130695343, 0.05070923641324043, 0.030164597555994987, 0.01993122324347496, -0.0421019084751606, -0.02792513370513916, -0.026639876887202263, -0.015685979276895523, -0.09596586972475052, 0.010720212943851948, 0.005179976113140583, -0.06987125426530838, 0.02198568731546402, -0.030748805031180382, -0.014001513831317425, -0.0376424565911293, -0.027613556012511253, -0.019230173900723457, 0.04521768540143967, -0.030787751078605652, 0.0031036040745675564, 0.033377740532159805, -0.007619043346494436, 0.05861551687121391, -0.0031133408192545176, 0.00601734034717083, -0.0018536427523940802, 0.014322828501462936, -0.0401156023144722, 0.07006599009037018, -0.014069671742618084, -0.03707772120833397, 0.001847557257860899, -0.005978393368422985, 0.005973524879664183, 0.0006261977250687778, -0.010067847557365894, 0.010798107832670212, -0.02586093172430992, 0.018772544339299202, 0.03213142976164818, 0.007088388316333294, -0.005126423668116331, 0.05316291004419327, 0.0019875236321240664, -0.01042810920625925, -0.021752003580331802, 0.06730073690414429, -0.031294066458940506, -0.007458386477082968, -0.0075947013683617115, -0.017643075436353683, 0.04821661859750748, -0.0382266640663147, -0.029463548213243484, 0.03277405723929405, 0.024303045123815536, -0.014449406415224075, -0.015062824822962284, -0.08155541121959686, -0.002441501710563898, 0.019288593903183937, 0.024711990728974342, -0.026153037324547768, 0.04961871728301048, 0.026289351284503937, 0.02901565469801426, 0.009955874644219875, -0.02508198842406273, -0.01999938115477562, 0.02406936138868332, -0.003889850340783596, -0.02897670678794384, 0.01614360883831978, 0.06360075622797012, 0.006504180375486612, 0.005194581113755703, -0.004060244187712669, 0.024595148861408234, 0.0020751547999680042, -0.01198599673807621, 0.010136005468666553, 0.011002580635249615, 0.04365979880094528, 0.055577635765075684, 0.025335146114230156, -0.00956640299409628, 0.006543127354234457, 0.05398080125451088, 0.002918604761362076, 0.053435541689395905, -0.00843693409115076, -0.02182989940047264, 0.018441492691636086, -0.008081541396677494, 0.02099253423511982, -0.007010493893176317, -0.048489250242710114, 0.03324142470955849, 0.0029891966842114925, -0.07512912154197693, 0.00029545094002969563, 0.03394247218966484, -0.002300318330526352, 0.018801754340529442, -0.025646723806858063, 0.014196249656379223, 0.0221414752304554, -0.0722859799861908, 0.040427181869745255, 0.03721403703093529, -0.012540994212031364, 0.017623601481318474, -0.0399208664894104, -0.011158369481563568, 0.022764630615711212, 0.014809668064117432, -0.04977450519800186, -0.022608842700719833, 0.01052547711879015, -0.005048529244959354, 0.004539781715720892, 0.029483020305633545, 0.008991931565105915, 0.03606509417295456, 0.03787614032626152, 0.018607018515467644, 0.021596215665340424, 0.050280820578336716, -0.025783037766814232, 0.07080598920583725, -0.012570205144584179, -0.04771030321717262, -0.015238086692988873, 0.03092406690120697, 0.04584084078669548, 0.002400120487436652, 0.04163454473018646, -0.024478306993842125, -0.0025656460784375668, -0.0033859710674732924, -0.06071866676211357, 0.014585721306502819, 0.014585721306502819, -0.02480935864150524, -0.028236711397767067, 0.021401479840278625, -0.053396593779325485, 0.0016844659112393856, 0.008300619199872017, -0.019590435549616814, -0.03988191857933998, 0.04214085638523102, -0.004568991716951132, 0.01596834696829319, 0.01002890057861805, -0.017691759392619133, -0.030242491513490677, -0.04529557749629021, -0.005043660756200552, -0.0190646480768919, 0.018256494775414467, -0.028139343485236168, 0.0008513611974194646, -0.005515895318239927, 0.02198568731546402, 0.022706210613250732, 0.05588921532034874, 0.011684156022965908, 0.037506140768527985, -0.018207810819149017, 0.07037756592035294 ]
31,984
pingouin.circular
circ_corrcl
Correlation coefficient between one circular and one linear variable random variables. Parameters ---------- x : 1-D array_like First circular variable (expressed in radians). The range of ``x`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. y : 1-D array_like Second circular variable (linear) Returns ------- r : float Correlation coefficient pval : float Uncorrected p-value Notes ----- Please note that NaN are automatically removed from datasets. Examples -------- Compute the r and p-value between one circular and one linear variables. >>> from pingouin import circ_corrcl >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> y = [1.593, 1.291, -0.248, -2.892, 0.102] >>> r, pval = circ_corrcl(x, y) >>> print(round(r, 3), round(pval, 3)) 0.109 0.971
def circ_corrcl(x, y): """Correlation coefficient between one circular and one linear variable random variables. Parameters ---------- x : 1-D array_like First circular variable (expressed in radians). The range of ``x`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. y : 1-D array_like Second circular variable (linear) Returns ------- r : float Correlation coefficient pval : float Uncorrected p-value Notes ----- Please note that NaN are automatically removed from datasets. Examples -------- Compute the r and p-value between one circular and one linear variables. >>> from pingouin import circ_corrcl >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> y = [1.593, 1.291, -0.248, -2.892, 0.102] >>> r, pval = circ_corrcl(x, y) >>> print(round(r, 3), round(pval, 3)) 0.109 0.971 """ from scipy.stats import pearsonr, chi2 x = np.asarray(x) y = np.asarray(y) assert x.size == y.size, "x and y must have the same length." # Remove NA x, y = remove_na(x, y, paired=True) n = x.size # Compute correlation coefficent for sin and cos independently rxs = pearsonr(y, np.sin(x))[0] rxc = pearsonr(y, np.cos(x))[0] rcs = pearsonr(np.sin(x), np.cos(x))[0] # Compute angular-linear correlation (equ. 27.47) r = np.sqrt((rxc**2 + rxs**2 - 2 * rxc * rxs * rcs) / (1 - rcs**2)) # Compute p-value pval = chi2.sf(n * r**2, 2) return r, pval
(x, y)
[ -0.043705426156520844, -0.016254467889666557, 0.0296399537473917, 0.01778210885822773, 0.03258345648646355, 0.0044431984424591064, -0.008443940430879593, 0.02466580644249916, 0.091285839676857, -0.022765571251511574, 0.025783592835068703, -0.008429967798292637, 0.024591287598013878, 0.04456239566206932, -0.03388753905892372, -0.007568341214209795, -0.0056122164241969585, -0.04456239566206932, -0.0454193614423275, -0.03630940988659859, 0.0011614493560045958, 0.04191696643829346, -0.006138507276773453, 0.010516501031816006, -0.028373129665851593, -0.006022071000188589, 0.016179949045181274, 0.028540797531604767, -0.04228956252336502, 0.01451258547604084, 0.02341761253774166, 0.01161565724760294, -0.06740248203277588, -0.01161565724760294, -0.0342973954975605, 0.012919740751385689, 0.07980990409851074, 0.013003574684262276, -0.04620181396603584, -0.005160444416105747, -0.05119458958506584, 0.0025662498082965612, -0.006944244261831045, -0.014605734497308731, -0.039644137024879456, 0.0041404650546610355, -0.09575698524713516, 0.03826553374528885, -0.054771505296230316, -0.010823892429471016, 0.007461220026016235, -0.05641092360019684, -0.05130636692047119, -0.028876133263111115, 0.0572306327521801, 0.03547107055783272, -0.005803171079605818, 0.06799864023923874, -0.026472894474864006, 0.004650454502552748, 0.027721088379621506, -0.02302638813853264, -0.00803874246776104, 0.01564900204539299, 0.03576914593577385, 0.006096590310335159, 0.022858720272779465, 0.00036007838207297027, 0.049182575196027756, -0.011010190472006798, -0.014838606119155884, 0.07317771017551422, 0.004545662086457014, -0.07526424527168274, 0.043183792382478714, -0.0037259527016431093, 0.050971031188964844, 0.022858720272779465, 0.002880627056583762, -0.02023192308843136, -0.03245304897427559, 0.014941070228815079, 0.06390009075403214, -0.014615049585700035, -0.0013564795954152942, -0.008769961073994637, -0.02323131449520588, -0.0002790098078548908, 0.005220991093665361, 0.010730743408203125, -0.03731541708111763, -0.027348492294549942, 0.0035769145470112562, -0.010088017210364342, -0.013823284767568111, 0.008648867718875408, -0.0041451221331954, 0.0250942911952734, 0.04579195752739906, 0.0001912461593747139, -0.014428751543164253, 0.009082010015845299, -0.057901304215192795, 0.0456429198384285, 0.04512128606438637, 0.0056913928128778934, 0.008672154508531094, 0.027013156563043594, 0.01732568070292473, 0.011997567489743233, -0.025112921372056007, -0.029919400811195374, 0.06565128266811371, 0.01466162409633398, -0.02882024459540844, 0.010097331367433071, -0.09672573208808899, 0.032192230224609375, -0.021331079304218292, -0.011168543249368668, 0.013543837703764439, 0.025634555146098137, -0.009100639261305332, 0.01939358375966549, 0.03448369354009628, 0.007545053958892822, -0.0008296066662296653, 0.0008575512911193073, -0.04303475469350815, 0.009217075072228909, 0.01653391495347023, -0.01948673278093338, 0.03994221240282059, 0.0005880019161850214, 0.02477758564054966, 0.028019163757562637, -0.0011859008809551597, -0.0007539232610724866, 0.03183826431632042, -0.03647707775235176, 0.06725344806909561, 0.06561402976512909, -0.007559026591479778, 0.020660407841205597, 0.0324716791510582, 0.08435557037591934, 0.02405102550983429, -0.023659799247980118, 0.016869250684976578, 0.05320660397410393, -0.0013692876091226935, -0.010171851143240929, 0.09463919699192047, -0.0012016197433695197, 0.010740058496594429, -0.04158163070678711, 0.009091324172914028, -0.01724184677004814, -0.031670596450567245, 0.01762375608086586, 0.007815185934305191, 0.004585250746458769, 0.04072466120123863, -0.03658885508775711, 0.06758878380060196, -0.02073492668569088, 0.04363090544939041, -0.06937723606824875, 0.003635132685303688, -0.027627939358353615, -0.04985324665904045, -0.0772017389535904, -0.014624364674091339, -0.06032317504286766, 0.007996825501322746, -0.062446966767311096, -0.06684359163045883, -0.03278838470578194, -0.013394800014793873, -0.0010671361815184355, 0.011159228160977364, -0.01534161064773798, 0.02021329291164875, -0.027218084782361984, -0.014596419408917427, 0.09292525798082352, 0.05808760225772858, -0.0549578033387661, 0.055106841027736664, -0.019505362957715988, -0.016086800023913383, 0.017754165455698967, -0.021927231922745705, 0.07392290234565735, 0.04843738675117493, -0.0597270205616951, 0.03465136140584946, 0.01714869774878025, 0.012966315262019634, -0.028279980644583702, 0.016021596267819405, 0.027516160160303116, -0.009724736213684082, 0.015229831449687481, 0.02269105240702629, -0.00007313637615879998, -0.02229982614517212, 0.0372408963739872, -0.006343434564769268, -0.01114059891551733, 0.07105391472578049, 0.028224091976881027, -0.03252756595611572, -0.03267660364508629, -0.05357920005917549, 0.09940841794013977, 0.03755760192871094, -0.07191088795661926, -0.008201753720641136, -0.002097012707963586, 0.07254429906606674, -0.005994126200675964, 0.015090107917785645, -0.006417953409254551, -0.01569557562470436, -0.0213497094810009, -0.030329255387187004, 0.04076192155480385, 0.03435328230261803, -0.08487720042467117, 0.029900770634412766, 0.013497263193130493, -0.009724736213684082, -0.0224861241877079, -0.011233747005462646, -0.09344689548015594, 0.02984488010406494, 0.05026310309767723, -0.07295415550470352, 0.04396624118089676, -0.03779979050159454, 0.035172995179891586, 0.02092122472822666, 0.021852713078260422, 0.0010543281678110361, 0.0042149838991463184, 0.02239297516644001, 0.008998176082968712, -0.012863852083683014, 0.015406814403831959, -0.048549164086580276, -0.02051137015223503, 0.019877957180142403, -0.026398375630378723, 0.027646569535136223, -0.05887005105614662, -0.0013040833873674273, -0.0030389800667762756, 0.06896738708019257, 0.01605885662138462, 0.013273706659674644, 0.01937495358288288, -0.01571420580148697, 0.004769219551235437, -0.045158546417951584, -0.044525135308504105, -0.06684359163045883, 0.01248194184154272, 0.02269105240702629, 0.0041381362825632095, -0.042028747498989105, -0.01535092480480671, 0.0007579984958283603, -0.027702458202838898, 0.023268574848771095, 0.02177819423377514, 0.03357083350419998, 0.028056424111127853, 0.13502852618694305, 0.016859935596585274, 0.02311953715980053, -0.008518459275364876, -0.028671205043792725, -0.02893202193081379, 0.0056122164241969585, -0.006357406731694937, -0.051157329231500626, -0.018117444589734077, 0.016049541532993317, 0.012575089931488037, -0.0012505229096859694, -0.028671205043792725, -0.013851229101419449, 0.03483765944838524, 0.05693255737423897, 0.06643373519182205, 0.005891662556678057, -0.016822677105665207, 0.005616873502731323, -0.01871359720826149, -0.03398068994283676, 0.027497529983520508, -0.009789940901100636, -0.04448787495493889, 0.0003970468242187053, -0.07518972456455231, 0.06103110685944557, -0.06252148747444153, -0.029919400811195374, 0.059354424476623535, -0.005071952939033508, -0.016291728243231773, 0.0073960162699222565, 0.0030110355000942945, -0.0012225782265886664, -0.012789332307875156, -0.0010584034025669098, 0.006208368577063084, 0.04962968826293945, -0.029099689796566963, 0.04053836688399315, -0.04985324665904045, 0.029490916058421135, 0.06635921448469162, 0.005714680068194866, 0.04236408323049545, -0.020548628643155098, 0.06766330450773239, 0.013739450834691525, 0.04456239566206932, -0.011345526203513145, 0.01223975419998169, -0.04776671528816223, 0.03470724821090698, 0.08137480914592743, -0.014764087274670601, 0.030645960941910744, -0.03856360912322998, 0.0638255700469017, -0.015304350294172764, 0.011820584535598755, -0.08010797947645187, -0.02416280284523964, -0.0173722542822361, -0.05335564166307449, 0.026081668213009834, 0.057491451501846313, 0.005202361382544041, 0.07399742305278778, -0.05108281224966049, 0.017456088215112686, 0.027087675407528877, 0.016617748886346817, 0.024330470710992813, -0.06192533299326897, 0.08927382528781891, -0.04217778518795967, 0.0006392337381839752, 0.044525135308504105, 0.020567258819937706, -0.031447041779756546, 0.0038214302621781826, 0.019877957180142403, -0.04187970981001854, -0.08137480914592743, 0.08547335118055344, -0.0638255700469017, 0.0524614155292511, -0.025951260700821877, 0.001351822167634964, -0.041730668395757675, 0.019449472427368164, -0.04128355532884598, -0.017493348568677902, -0.0238460972905159, 0.03711048886179924, 0.027832865715026855, -0.021200669929385185, 0.00743793323636055, -0.05816212296485901, -0.017698274925351143, -0.05525587871670723, -0.04605277627706528, 0.00022079180052969605, -0.07518972456455231, 0.030198846012353897, -0.011168543249368668, -0.03381302207708359, -0.035210251808166504, 0.04895901679992676, -0.0100507577881217, -0.07217170298099518, 0.08211999386548996, -0.012426052242517471, -0.03258345648646355, -0.017865942791104317, 0.05786404386162758, 0.02446088008582592, -0.008304216898977757, -0.020995743572711945, 0.033552203327417374, 0.016710897907614708, 0.036868300288915634, -0.017381569370627403, -0.005071952939033508, 0.02818683162331581, 0.0549578033387661, -0.020883964374661446, 0.00047389461542479694, -0.019356323406100273, -0.056969817727804184, 0.017605125904083252, 0.09463919699192047, -0.021591896191239357, -0.016655009239912033, 0.026100298389792442, -0.08502624183893204, -0.03908524289727211, 0.038414571434259415, 0.04050110653042793, 0.005733309779316187, -0.09739640355110168, 0.0011387442937120795, 0.03090677782893181, -0.014810661785304546, 0.03319823741912842, 0.07042050361633301, -0.00911926943808794, 0.030869517475366592, -0.0296399537473917, -0.024404989555478096, 0.04508402571082115, -0.03867539018392563, -0.04184244945645332, -0.008551061153411865, -0.00013266429596114904, 0.013050149194896221, 0.06490609794855118, -0.011364155448973179, -0.022113529965281487, -0.007568341214209795, 0.04735685884952545, -0.0004928154521621764, -0.024218693375587463, -0.10373052209615707, 0.025839481502771378, -0.006953559350222349, -0.055404916405677795, -0.06509239226579666, -0.005253593437373638, 0.01124306209385395, 0.0003137950843665749, 0.04217778518795967, 0.015518592670559883, -0.009855144657194614, -0.011121968738734722, -0.04392898082733154, -0.00856037624180317, -0.0340738371014595, -0.05637366324663162, -0.009477891959249973, 0.02416280284523964, 0.023603910580277443, -0.030347885563969612, -0.024796215817332268, -0.006911642383784056, 0.004669084679335356, 0.00756368413567543, -0.017288420349359512, 0.008914342150092125, -0.00022777797130402178, 0.011289636604487896, -0.031353890895843506, 0.01675747148692608, 0.021945862099528313, 0.03779979050159454, -0.015062163583934307, 0.0688183456659317, -0.0012353862402960658, -0.048474643379449844, -0.07526424527168274, -0.023063646629452705, -0.030459662899374962, -0.01279864739626646, 0.0649433583021164, -0.048996277153491974, -0.029807621613144875, -0.021796822547912598, 0.009715422056615353, -0.013348225504159927, 0.015201887115836143, 0.053430162370204926, -0.05480876564979553, 0.009300909005105495, -0.03651433810591698, -0.0212379302829504, 0.00759628601372242, -0.03390616923570633, 0.007177116349339485, 0.03370124101638794, 0.024200063198804855, -0.0044501847587525845, 0.0005000926903448999, -0.01642213575541973, 0.047841232270002365, -0.01279864739626646, -0.05335564166307449, -0.02800053358078003, -0.028484908863902092, 0.028130942955613136, -0.009734051302075386, 0.01088909711688757, 0.04243860021233559, -0.007824501022696495, -0.02207626961171627, 0.003779513295739889, 0.010013497434556484, 0.03616037219762802, -0.02591400034725666, -0.03960687667131424, -0.03204319253563881, 0.05398905277252197, 0.023790208622813225, 0.05320660397410393, 0.0005542354774661362, 0.047133300453424454, -0.04717056080698967, -0.06192533299326897, -0.04426431655883789, -0.0005792691954411566, -0.0474686361849308, -0.025783592835068703, -0.06855753064155579, -0.016953084617853165, -0.0520142987370491, 0.025653183460235596, -0.05588928982615471, -0.03668200597167015, 0.02414417266845703, 0.011271006427705288, 0.006315489765256643, 0.0402030311524868, 0.038824427872896194, 0.04806479066610336, 0.0073867011815309525, -0.015537222847342491, 0.009417345747351646, -0.006958216428756714, -0.015304350294172764, 0.04728233814239502, 0.028373129665851593, -0.045158546417951584, -0.006208368577063084, -0.014093415811657906, -0.04880997911095619, 0.008076002821326256, -0.037669382989406586, -0.04094821959733963, -0.015006273984909058, -0.009985553100705147, 0.03599270433187485, -0.02051137015223503, 0.015621056780219078, -0.047133300453424454, 0.005779884289950132, 0.04288571700453758, 0.07384838163852692, -0.01644076593220234, 0.0106189651414752, -0.033645354211330414, -0.02354802004992962, 0.06196259334683418, -0.022355716675519943, 0.021312449127435684, 0.04012851044535637, 0.016859935596585274, 0.018219908699393272, -0.07001065462827682, -0.05719337239861488, -0.011038134805858135, -0.015071478672325611, -0.051157329231500626, 0.03807923570275307, -0.10231465846300125, 0.004173066932708025, 0.03336590528488159, -0.05190252140164375, 0.008662840351462364, 0.05164170265197754, 0.03211771324276924, -0.0402030311524868, 0.030627330765128136, -0.04512128606438637, -0.03444643318653107, 0.0032904818654060364, 0.04228956252336502, -0.03794882819056511, 0.044748689979314804, 0.035172995179891586, 0.0029644612222909927, -0.038936205208301544, -0.026715081185102463, -0.021405598148703575, -0.009771310724318027, -0.07980990409851074, -0.00008587156480643898, -0.024442249909043312, -0.05961524322628975, 0.031558819115161896, -0.053951796144247055, -0.019859327003359795, -0.016887880861759186, -0.014521900564432144, -0.009640902280807495, 0.04012851044535637, -0.016002966091036797, -0.0006607744144275784, 0.010181165300309658, -0.01621720939874649, 0.0402030311524868, 0.0033836308866739273, 0.002561592496931553, 0.012714813463389874, 0.007447247859090567, -0.026975898072123528, 0.07600943744182587, -0.015397499315440655, -0.025522775948047638, 0.012100031599402428, 0.01394437812268734, 0.014698883518576622, -0.0045945653691887856, -0.0008668662048876286, 0.008248327299952507, -0.0006386516033671796, 0.018993044272065163, 0.039457838982343674, -0.004247586242854595, -0.0031321290880441666, 0.034781768918037415, -0.03211771324276924, -0.0015078465221449733, -0.02591400034725666, 0.03800471872091293, -0.01404684130102396, -0.012556460686028004, -0.03848909214138985, -0.020045625045895576, 0.05484602227807045, -0.05741693079471588, -0.01877880096435547, 0.039234280586242676, 0.028633946552872658, -0.0009774804348126054, 0.012323588132858276, -0.0801825001835823, 0.012966315262019634, 0.009426659904420376, 0.02695726789534092, -0.026677820831537247, 0.040799181908369064, 0.030105696991086006, 0.043183792382478714, 0.022243937477469444, -0.0061571369878947735, -0.0037049942184239626, 0.033757131546735764, -0.014018896967172623, -0.03215496987104416, 0.014847921207547188, 0.06725344806909561, -0.009258992038667202, 0.017763478681445122, 0.021219300106167793, 0.024852104485034943, -0.014372862875461578, -0.02613755874335766, 0.0027269315905869007, 0.014969014562666416, 0.04605277627706528, 0.03791156783699989, 0.016617748886346817, 0.005537697114050388, 0.0017977721290662885, 0.02852216735482216, -0.0014298342866823077, 0.06624744087457657, 0.005737967323511839, -0.0028247379232198, 0.013590412214398384, -0.0024894021917134523, 0.05257319286465645, 0.014251768589019775, -0.03979317471385002, 0.022448865696787834, -0.009519808925688267, -0.07399742305278778, -0.011159228160977364, 0.01937495358288288, 0.010097331367433071, 0.012351533398032188, -0.003572257235646248, 0.016068171709775925, 0.05000228434801102, -0.06818493455648422, 0.028019163757562637, 0.0551813580095768, -0.025448257103562355, -0.0009675833280198276, -0.04530758410692215, -0.017996352165937424, 0.013497263193130493, 0.027348492294549942, -0.03262071684002876, -0.021219300106167793, 0.029062431305646896, -0.007102597504854202, -0.014596419408917427, 0.011820584535598755, 0.013180557638406754, 0.03874990716576576, 0.033757131546735764, 0.034781768918037415, 0.012556460686028004, 0.0545106865465641, -0.037594862282276154, 0.11051175743341446, -0.0013564795954152942, -0.04966694861650467, -0.014801346696913242, 0.02468443661928177, 0.03304919973015785, 0.01535092480480671, 0.039644137024879456, -0.01712075248360634, 0.006813835818320513, 0.005551669280976057, -0.049182575196027756, 0.009449947625398636, -0.021088892593979836, -0.02116341143846512, -0.04456239566206932, 0.0345209501683712, -0.044748689979314804, -0.009198445826768875, 0.019617140293121338, -0.037483084946870804, -0.0249825119972229, 0.017223216593265533, -0.007181773893535137, -0.017111437395215034, 0.017903203144669533, -0.013562467880547047, -0.03327275812625885, -0.07287963479757309, -0.017977721989154816, -0.0336080938577652, 0.018434150144457817, -0.029081061482429504, 0.00920776091516018, -0.0186204481869936, 0.031875524669885635, 0.02861531637609005, 0.06013687700033188, 0.022411605343222618, 0.01591913215816021, -0.005202361382544041, 0.06073302775621414 ]
31,985
pingouin.circular
circ_mean
Mean direction for (binned) circular data. Parameters ---------- angles : array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. axis : int or None Compute along this dimension. Default is the first axis (0). Returns ------- mu : float Circular mean, in radians. See also -------- scipy.stats.circmean, scipy.stats.circstd, pingouin.circ_r Notes ----- From Wikipedia: *In mathematics, a mean of circular quantities is a mean which is sometimes better-suited for quantities like angles, daytimes, and fractional parts of real numbers. This is necessary since most of the usual means may not be appropriate on circular quantities. For example, the arithmetic mean of 0° and 360° is 180°, which is misleading because for most purposes 360° is the same thing as 0°. As another example, the "average time" between 11 PM and 1 AM is either midnight or noon, depending on whether the two times are part of a single night or part of a single calendar day.* The circular mean of a set of angles :math:`\alpha` is defined by: .. math:: \bar{\alpha} = \text{angle} \left ( \sum_{j=1}^n \exp(i \cdot \alpha_j) \right ) For binned angles with weights :math:`w`, this becomes: .. math:: \bar{\alpha} = \text{angle} \left ( \sum_{j=1}^n w \cdot \exp(i \cdot \alpha_j) \right ) Missing values in ``angles`` are omitted from the calculations. References ---------- * https://en.wikipedia.org/wiki/Mean_of_circular_quantities * Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 Examples -------- 1. Circular mean of a 1-D array of angles, in radians >>> import pingouin as pg >>> angles = [0.785, 1.570, 3.141, 0.839, 5.934] >>> round(pg.circ_mean(angles), 4) 1.013 Compare with SciPy: >>> from scipy.stats import circmean >>> import numpy as np >>> round(circmean(angles, low=0, high=2*np.pi), 4) 1.013 2. Using a 2-D array of angles in degrees >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 5)) >>> deg array([[322, 98, 230, 17, 83], [106, 123, 57, 214, 225], [ 96, 113, 126, 47, 73]]) We first need to convert from degrees to radians: >>> rad = np.round(pg.convert_angles(deg, low=0, high=360), 4) >>> rad array([[-0.6632, 1.7104, -2.2689, 0.2967, 1.4486], [ 1.85 , 2.1468, 0.9948, -2.5482, -2.3562], [ 1.6755, 1.9722, 2.1991, 0.8203, 1.2741]]) >>> pg.circ_mean(rad) # On the first axis (default) array([1.27532162, 1.94336576, 2.23195927, 0.52110503, 1.80240563]) >>> pg.circ_mean(rad, axis=-1) # On the last axis (default) array([0.68920819, 2.49334852, 1.5954149 ]) >>> round(pg.circ_mean(rad, axis=None), 4) # Across the entire array 1.6954 Missing values are omitted from the calculations: >>> rad[0, 0] = np.nan >>> pg.circ_mean(rad) array([1.76275 , 1.94336576, 2.23195927, 0.52110503, 1.80240563]) 3. Using binned angles >>> np.random.seed(123) >>> nbins = 18 # Number of bins to divide the unit circle >>> angles_bins = np.linspace(0, 2 * np.pi, nbins) >>> # w represents the number of incidences per bins, or "weights". >>> w = np.random.randint(low=0, high=5, size=angles_bins.size) >>> round(pg.circ_mean(angles_bins, w), 4) 0.606
def circ_mean(angles, w=None, axis=0): """Mean direction for (binned) circular data. Parameters ---------- angles : array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. axis : int or None Compute along this dimension. Default is the first axis (0). Returns ------- mu : float Circular mean, in radians. See also -------- scipy.stats.circmean, scipy.stats.circstd, pingouin.circ_r Notes ----- From Wikipedia: *In mathematics, a mean of circular quantities is a mean which is sometimes better-suited for quantities like angles, daytimes, and fractional parts of real numbers. This is necessary since most of the usual means may not be appropriate on circular quantities. For example, the arithmetic mean of 0° and 360° is 180°, which is misleading because for most purposes 360° is the same thing as 0°. As another example, the "average time" between 11 PM and 1 AM is either midnight or noon, depending on whether the two times are part of a single night or part of a single calendar day.* The circular mean of a set of angles :math:`\\alpha` is defined by: .. math:: \\bar{\\alpha} = \\text{angle} \\left ( \\sum_{j=1}^n \\exp(i \\cdot \\alpha_j) \\right ) For binned angles with weights :math:`w`, this becomes: .. math:: \\bar{\\alpha} = \\text{angle} \\left ( \\sum_{j=1}^n w \\cdot \\exp(i \\cdot \\alpha_j) \\right ) Missing values in ``angles`` are omitted from the calculations. References ---------- * https://en.wikipedia.org/wiki/Mean_of_circular_quantities * Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 Examples -------- 1. Circular mean of a 1-D array of angles, in radians >>> import pingouin as pg >>> angles = [0.785, 1.570, 3.141, 0.839, 5.934] >>> round(pg.circ_mean(angles), 4) 1.013 Compare with SciPy: >>> from scipy.stats import circmean >>> import numpy as np >>> round(circmean(angles, low=0, high=2*np.pi), 4) 1.013 2. Using a 2-D array of angles in degrees >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 5)) >>> deg array([[322, 98, 230, 17, 83], [106, 123, 57, 214, 225], [ 96, 113, 126, 47, 73]]) We first need to convert from degrees to radians: >>> rad = np.round(pg.convert_angles(deg, low=0, high=360), 4) >>> rad array([[-0.6632, 1.7104, -2.2689, 0.2967, 1.4486], [ 1.85 , 2.1468, 0.9948, -2.5482, -2.3562], [ 1.6755, 1.9722, 2.1991, 0.8203, 1.2741]]) >>> pg.circ_mean(rad) # On the first axis (default) array([1.27532162, 1.94336576, 2.23195927, 0.52110503, 1.80240563]) >>> pg.circ_mean(rad, axis=-1) # On the last axis (default) array([0.68920819, 2.49334852, 1.5954149 ]) >>> round(pg.circ_mean(rad, axis=None), 4) # Across the entire array 1.6954 Missing values are omitted from the calculations: >>> rad[0, 0] = np.nan >>> pg.circ_mean(rad) array([1.76275 , 1.94336576, 2.23195927, 0.52110503, 1.80240563]) 3. Using binned angles >>> np.random.seed(123) >>> nbins = 18 # Number of bins to divide the unit circle >>> angles_bins = np.linspace(0, 2 * np.pi, nbins) >>> # w represents the number of incidences per bins, or "weights". >>> w = np.random.randint(low=0, high=5, size=angles_bins.size) >>> round(pg.circ_mean(angles_bins, w), 4) 0.606 """ angles = np.asarray(angles) _checkangles(angles) # Check that angles is in radians w = np.asarray(w) if w is not None else np.ones(angles.shape) assert angles.shape == w.shape, "Input dimensions do not match" return np.angle(np.nansum(np.multiply(w, np.exp(1j * angles)), axis=axis))
(angles, w=None, axis=0)
[ -0.044127847999334335, -0.03175782784819603, 0.00927751511335373, 0.001343906274996698, 0.055131737142801285, -0.0124448761343956, -0.010255326516926289, -0.008313738740980625, 0.07137557864189148, 0.0018035713583230972, 0.018049748614430428, -0.008093847893178463, 0.05000407621264458, 0.0332549549639225, -0.042630720883607864, 0.016786547377705574, 0.021390216425061226, 0.02511432208120823, -0.04453955963253975, -0.05180062726140022, -0.025657031685113907, -0.025151750072836876, -0.06527478247880936, -0.02202649600803852, -0.02245691977441311, 0.0057873353362083435, 0.027079302817583084, -0.018395960330963135, -0.05105206370353699, -0.010638966225087643, 0.042181581258773804, -0.01897609792649746, -0.0038948720321059227, -0.0890791192650795, 0.025133036077022552, -0.06542449444532394, 0.07740151882171631, 0.015251991339027882, -0.0751558244228363, 0.013492866419255733, -0.012510376051068306, -0.014260143972933292, -0.01081675011664629, -0.013258939608931541, 0.009038910269737244, 0.029586993157863617, 0.005384982097893953, 0.07261070609092712, -0.03138354420661926, 0.006676255259662867, -0.025600889697670937, -0.029343709349632263, -0.016973689198493958, 0.007396748289465904, 0.017469612881541252, 0.06954159587621689, -0.023991476744413376, 0.004149851854890585, -0.01452214177697897, 0.015495275147259235, 0.03413451835513115, 0.0038200155831873417, 0.09274707734584808, -0.030728552490472794, 0.004512437153607607, 0.04588697478175163, 0.0067557902075350285, 0.02445932850241661, 0.022606633603572845, -0.042181581258773804, 0.019135167822241783, 0.03885047137737274, 0.01566370204091072, -0.055917732417583466, 0.0025451176334172487, -0.023224197328090668, 0.029905131086707115, 0.04248100891709328, 0.00410774489864707, 0.012472948059439659, 0.006615434307605028, 0.015850841999053955, 0.0410587340593338, 0.0012515054550021887, 0.02672373503446579, 0.0008544156444258988, -0.0890042632818222, -0.010236612521111965, -0.0549820251762867, -0.02483361028134823, 0.030784694477915764, -0.03712877631187439, 0.022120065987110138, -0.009202659130096436, -0.009174587205052376, 0.02677987702190876, -0.022662775591015816, -0.028539001941680908, 0.026349453255534172, -0.00776167307049036, -0.01829303242266178, -0.025413747876882553, -0.02245691977441311, -0.016889475286006927, 0.005066842772066593, 0.002860917942598462, 0.007312534376978874, -0.04405299201607704, 0.0094740130007267, 0.05797628313302994, -0.019387807697057724, -0.027678154408931732, 0.03226310759782791, -0.010601537302136421, 0.010030757635831833, 0.020323513075709343, -0.026536593213677406, 0.060783397406339645, -0.03456494212150574, 0.012978228740394115, 0.027472298592329025, 0.01371743530035019, 0.03336723893880844, -0.005773299839347601, 0.06954159587621689, 0.01985565945506096, -0.012370020151138306, -0.048282377421855927, -0.024609042331576347, 0.064825639128685, 0.013258939608931541, -0.023448767140507698, 0.05494459718465805, -0.0774763748049736, 0.01665554940700531, 0.035219937562942505, 0.008968732319772243, -0.051650915294885635, 0.0049405223689973354, 0.003153325757011771, 0.04349156841635704, -0.02013637125492096, 0.014447284862399101, -0.0029381136409938335, 0.012706873938441277, 0.07687751948833466, 0.01115360390394926, -0.026967018842697144, 0.02661145105957985, 0.007139428984373808, 0.01612219773232937, -0.031346116214990616, 0.034602370113134384, 0.08623456954956055, 0.04255586490035057, -0.022157493978738785, -0.003094844287261367, -0.002863257424905896, -0.12635760009288788, 0.007986241951584816, -0.030279414728283882, 0.025862885639071465, 0.016505835577845573, 0.001481922809034586, 0.008238882757723331, 0.02008022926747799, 0.014175930991768837, -0.025544745847582817, -0.04349156841635704, -0.0716375783085823, -0.014063646085560322, -0.025301463901996613, -0.02921270951628685, -0.0006473909015767276, 0.02262534759938717, 0.009062303230166435, -0.06781990081071854, 0.01790003664791584, -0.03907503932714462, -0.05647915229201317, 0.01615026779472828, 0.01552334614098072, 0.0428178608417511, -0.05973540619015694, -0.03319881483912468, 0.05079006776213646, 0.08728256076574326, -0.054645173251628876, 0.05999740585684776, -0.03563164547085762, -0.04918065667152405, -0.002421136712655425, -0.01623448170721531, 0.06516249477863312, 0.06437650322914124, -0.07687751948833466, 0.007251713890582323, 0.044015564024448395, -0.004297225270420313, -0.03542578965425491, -0.025769315659999847, 0.021015934646129608, 0.010975820012390614, -0.02064165286719799, 0.041470445692539215, -0.04113359376788139, -0.01846146024763584, -0.004524133633822203, 0.025526031851768494, 0.011031961999833584, 0.04236872121691704, 0.007368676830083132, -0.011846025474369526, 0.0004965084954164922, -0.018882526084780693, 0.10741893202066422, 0.08518658578395844, -0.02816472016274929, -0.02794015221297741, 0.029848989099264145, -0.037877339869737625, 0.02999870292842388, 0.017039187252521515, -0.035987213253974915, -0.008870483376085758, -0.019818231463432312, 0.0080330278724432, 0.019687233492732048, 0.01903223991394043, -0.023654622957110405, 0.04221900925040245, -0.010199184529483318, -0.06209338456392288, 0.011237816885113716, -0.021895496174693108, -0.04382842406630516, 0.006592041812837124, 0.009862330742180347, -0.02140893042087555, 0.02234463579952717, 0.0005538203986361623, -0.017609968781471252, -0.014877709560096264, 0.035444505512714386, -0.0031884147319942713, -0.018910598009824753, 0.029512135311961174, 0.01721697300672531, 0.004060959909111261, 0.02683601900935173, -0.060446541756391525, 0.011789883486926556, -0.008444737643003464, -0.03907503932714462, -0.029923846945166588, -0.022269779816269875, -0.04607411473989487, 0.06755790114402771, 0.023373911157250404, 0.00903423223644495, 0.042518436908721924, -0.03362923860549927, 0.05913655459880829, -0.004542847629636526, 0.023430053144693375, 0.029418565332889557, 0.02500203810632229, -0.03308652713894844, 0.01377357728779316, 0.009993329644203186, -0.047608669847249985, 0.027921438217163086, 0.025189178064465523, -0.04839466139674187, 0.017329256981611252, 0.006942931097000837, 0.07481896877288818, 0.0660233423113823, 0.04940522462129593, -0.00655461335554719, 0.010788679122924805, -0.015280062332749367, -0.04293014481663704, 0.0031977719627320766, -0.028033722192049026, -0.011546599678695202, -0.012753658927977085, -0.03712877631187439, 0.03147711604833603, 0.030522696673870087, 0.046111542731523514, -0.0343778021633625, -0.038588475435972214, -0.040759310126304626, 0.029792847111821175, 0.01603798381984234, -0.038588475435972214, -0.025526031851768494, -0.037765052169561386, 0.017057903110980988, 0.0012093987315893173, 0.047945525497198105, 0.006465721409767866, -0.030410412698984146, 0.014409856870770454, -0.040534742176532745, 0.015027422457933426, -0.03087826445698738, 0.025657031685113907, 0.02180192619562149, -0.011322030797600746, -0.0642642229795456, 0.025657031685113907, 0.010245969519019127, -0.007186214439570904, 0.016103483736515045, 0.05251176655292511, -0.023280341178178787, 0.10607151687145233, 0.0013263617875054479, -0.002364994492381811, -0.03396609053015709, 0.005006021820008755, 0.050378356128931046, -0.06126996502280235, 0.01974337548017502, -0.005525337997823954, 0.0809197723865509, -0.008828376419842243, 0.004491384141147137, -0.04884380102157593, -0.016889475286006927, -0.07567982375621796, 0.021277932450175285, -0.01006818562746048, -0.03514508157968521, 0.03138354420661926, -0.04128330573439598, 0.029119139537215233, -0.04113359376788139, 0.0022585580591112375, -0.005043449811637402, 0.035500649362802505, 0.04420270398259163, -0.022980915382504463, -0.016328051686286926, 0.08833055198192596, 0.016299981623888016, 0.021558642387390137, -0.029923846945166588, 0.0694667398929596, 0.036997776478528976, -0.02468389831483364, 0.004800166469067335, -0.012716230936348438, 0.05711543187499046, 0.006114832125604153, -0.01657133549451828, 0.016505835577845573, -0.027734296396374702, -0.001230452093295753, 0.02058551087975502, 0.041245877742767334, -0.004327635746449232, -0.06737075746059418, 0.09334593266248703, -0.05157605931162834, 0.007555817719548941, -0.00291939964517951, 0.002278441796079278, -0.020941078662872314, -0.010545395314693451, -0.03989846259355545, 0.0019556235056370497, -0.024552898481488228, 0.04753381386399269, 0.019331665709614754, -0.06213081255555153, 0.0011088104220107198, -0.05734000355005264, -0.04906836897134781, -0.03110283426940441, -0.024945896118879318, 0.006685612257570028, -0.04364128038287163, 0.026592737063765526, -0.016019269824028015, -0.004086691420525312, -0.07949749380350113, 0.025469889864325523, -0.03164554387331009, -0.05127663537859917, 0.027266444638371468, -0.05150120332837105, -0.11063776165246964, 0.05595516040921211, 0.03172039985656738, -0.005717157386243343, -0.06639762967824936, -0.015991197898983955, 0.031215118244290352, -0.03812062367796898, 0.05101463571190834, 0.003616499947384, -0.04607411473989487, 0.0035042152740061283, -0.02794015221297741, -0.06317880004644394, 0.03456494212150574, -0.007335927337408066, -0.04427755996584892, 0.053484898060560226, 0.06505021452903748, 0.06617305427789688, 0.045175839215517044, 0.022101351991295815, -0.07530553638935089, -0.1064458042383194, -0.01134074479341507, 0.020379655063152313, -0.014625068753957748, -0.056404296308755875, 0.005796692334115505, 0.04618639871478081, 0.05344747006893158, -0.007083286996930838, 0.0845128744840622, -0.06673447787761688, -0.007780387066304684, 0.0004149266751483083, 0.0073780338279902935, 0.07100129872560501, -0.08615971356630325, -0.024777468293905258, -0.039636462926864624, 0.030784694477915764, 0.013361867517232895, 0.010835464112460613, 0.029586993157863617, -0.02610616944730282, -0.031289976090192795, 0.08615971356630325, 0.005745228845626116, -0.02539503388106823, -0.03329238295555115, 0.01563563011586666, -0.017067259177565575, -0.05771428346633911, 0.013839077204465866, -0.002687812549993396, 0.010217898525297642, -0.021277932450175285, 0.03286195918917656, 0.01739475689828396, -0.016215767711400986, -0.021203074604272842, -0.01623448170721531, 0.014840281568467617, 0.02185806818306446, -0.022980915382504463, -0.004620043560862541, 0.017797108739614487, -0.021989068016409874, -0.05019121617078781, -0.013745506294071674, 0.05580544471740723, 0.05539373680949211, 0.007925420999526978, -0.018227534368634224, 0.033067815005779266, 0.07055215537548065, -0.0016386533388867974, -0.01026468351483345, 0.015710486099123955, 0.003050398314371705, 0.014073003083467484, -0.020229943096637726, 0.0225692056119442, 0.01603798381984234, -0.027921438217163086, -0.08975282311439514, -0.014681211672723293, -0.028539001941680908, 0.023280341178178787, -0.0009649457642808557, 0.045288123190402985, -0.020791364833712578, -0.04173244163393974, 0.06912988424301147, -0.073396697640419, -0.0020608901977539062, 0.05468260124325752, 0.006746433209627867, 0.01324958261102438, -0.0031392902601510286, 0.00790202897042036, 0.004140494856983423, 0.016075411811470985, 0.05359718203544617, 0.025432461872696877, 0.04375356435775757, 0.008940661326050758, -0.013848434202373028, -0.05318547412753105, -0.009296229109168053, -0.030241984874010086, -0.064825639128685, -0.04742152988910675, -0.0242909025400877, 0.014737353660166264, 0.007808458060026169, 0.04206929728388786, 0.06198110058903694, -0.0160660557448864, 0.0005014794296585023, -0.01985565945506096, 0.0024585649371147156, 0.03127126023173332, 0.023935334756970406, -0.03896275535225868, -0.0022959860507398844, -0.015149064362049103, -0.05520659685134888, 0.12201593071222305, -0.03443394601345062, 0.027584584429860115, 0.017881322652101517, -0.046560682356357574, -0.0774763748049736, -0.015308134257793427, -0.016870761290192604, 0.011350101791322231, -0.05150120332837105, -0.019107095897197723, -0.04117102175951004, 0.01931295171380043, 0.02174578420817852, -0.02174578420817852, 0.01278172992169857, 0.06048396974802017, -0.02341133914887905, -0.00960033293813467, 0.08690828084945679, 0.016590049490332603, 0.0378960520029068, 0.04349156841635704, 0.02107207663357258, -0.06486307084560394, 0.027902722358703613, 0.010601537302136421, 0.08009634912014008, -0.027921438217163086, -0.02822086215019226, 0.013277653604745865, 0.03684806451201439, -0.00024649978149682283, -0.018854456022381783, -0.08518658578395844, -0.035706501454114914, 0.00006897169078001752, 0.029287567362189293, -0.04087159410119057, -0.030896978452801704, -0.03982360661029816, -0.02743487060070038, 0.05000407621264458, 0.03956160694360733, 0.0015696451300755143, -0.005038771312683821, -0.0007210776675492525, -0.06815674901008606, 0.06725847721099854, 0.026686307042837143, -0.03467722609639168, 0.03565036132931709, 0.028707429766654968, 0.03209468349814415, 0.0076774596236646175, -0.058500275015830994, -0.05239947885274887, -0.002924078144133091, -0.09521733969449997, -0.030953122302889824, -0.07197442650794983, 0.04184472933411598, 0.03624921292066574, -0.03866333141922951, 0.017553826794028282, 0.03280581906437874, 0.04079673811793327, 0.001539234770461917, -0.04532555118203163, 0.012126737274229527, 0.008093847893178463, 0.004573258105665445, 0.04895608499646187, -0.06134482100605965, -0.0061616175808012486, -0.006512506864964962, 0.04109616205096245, 0.00795817095786333, -0.015205206349492073, -0.006652862764894962, 0.0358562171459198, -0.0399358905851841, 0.08009634912014008, -0.020548081025481224, -0.05168834328651428, -0.010975820012390614, -0.024534184485673904, -0.03559421747922897, 0.01820881851017475, -0.046111542731523514, 0.03454622998833656, 0.056179728358983994, -0.012931442819535732, -0.017413470894098282, 0.006769825704395771, 0.01804039254784584, 0.10030757635831833, 0.034883081912994385, -0.011509171687066555, -0.024945896118879318, -0.012744301930069923, -0.0321321114897728, -0.03651120886206627, -0.017301185056567192, 0.027210300788283348, -0.04165758565068245, -0.009539512917399406, 0.0028585786931216717, 0.004931165371090174, -0.04016045853495598, -0.021334074437618256, -0.024758754298090935, 0.042518436908721924, 0.01313729863613844, -0.02013637125492096, -0.026405595242977142, 0.012070594355463982, -0.0124448761343956, -0.04753381386399269, 0.002797757973894477, 0.019836945459246635, 0.03153325989842415, -0.020791364833712578, -0.03739077225327492, 0.01713275909423828, -0.016889475286006927, -0.0004815956635866314, -0.013015656732022762, -0.000798273307736963, 0.015906985849142075, 0.004505419638007879, 0.017694180831313133, 0.003941657487303019, -0.002879632171243429, 0.022045210003852844, 0.020173799246549606, -0.0347333699464798, -0.03087826445698738, -0.012510376051068306, -0.013708078302443027, 0.03989846259355545, -0.01594441384077072, -0.025582175701856613, -0.0428178608417511, 0.01006818562746048, 0.0031322725117206573, 0.033947378396987915, 0.011265887878835201, 0.022775059565901756, 0.040759310126304626, 0.02180192619562149, -0.008940661326050758, 0.024777468293905258, 0.028857141733169556, -0.0042785112746059895, 0.005726514849811792, 0.02008022926747799, 0.035931073129177094, 0.014952565543353558, 0.014709282666444778, -0.00676514720544219, 0.04278043285012245, 0.00025673405616544187, 0.04884380102157593, -0.021427644416689873, 0.020435797050595284, -0.016861403360962868, -0.021951640024781227, 0.05625458434224129, 0.034714654088020325, -0.0011719705071300268, 0.012416805140674114, 0.017488326877355576, -0.015710486099123955, 0.03175782784819603, 0.015607559122145176, 0.033554382622241974, 0.041582729667425156, -0.0066481842659413815, -0.02341133914887905, -0.027753010392189026, -0.024702612310647964, 0.01654326356947422, 0.04255586490035057, 0.029250137507915497, 0.021390216425061226, 0.02822086215019226, -0.031289976090192795, 0.055244024842977524, 0.005600194446742535, 0.035332221537828445, 0.01020854152739048, -0.009305586107075214, -0.012070594355463982, -0.02163350023329258, 0.018704742193222046, -0.013782934285700321, 0.011162960901856422, 0.04966722056269646, 0.033778950572013855, 0.030896978452801704, -0.00039065684541128576, -0.04607411473989487, 0.01942523568868637, -0.01714211516082287, -0.07425755262374878, -0.00041668114135973155, 0.03183268383145332, 0.026686307042837143, 0.014428570866584778, 0.05981026217341423, 0.02412247471511364, 0.021652214229106903, -0.0073031773790717125, -0.05217491090297699, -0.04072188213467598, 0.020735222846269608, -0.03944932296872139, -0.035444505512714386, -0.012847229838371277, -0.054420601576566696, 0.009862330742180347, -0.06179395690560341, 0.00002222299372078851, -0.035500649362802505, 0.05726514756679535, 0.0012210949789732695, -0.0029381136409938335, 0.04341671243309975, -0.008814341388642788, 0.04940522462129593, -0.025133036077022552, 0.0040890309028327465, -0.047720953822135925, 0.023280341178178787, -0.021951640024781227, -0.016917547211050987, -0.005207198206335306, 0.01637483760714531, 0.006133546121418476, 0.048768945038318634, -0.02251306176185608, 0.011789883486926556, -0.050266072154045105, -0.022550489753484726 ]
31,986
pingouin.circular
circ_r
Mean resultant vector length for circular data. Parameters ---------- angles : array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. axis : int or None Compute along this dimension. Default is the first axis (0). Returns ------- r : float Circular mean vector length. See also -------- pingouin.circ_mean Notes ----- The length of the mean resultant vector is a crucial quantity for the measurement of circular spread or hypothesis testing in directional statistics. The closer it is to one, the more concentrated the data sample is around the mean direction (Berens 2009). The circular vector length of a set of angles :math:`\alpha` is defined by: .. math:: \bar{\alpha} = \frac{1}{N}\left \| \sum_{j=1}^n \exp(i \cdot \alpha_j) \right \| Missing values in ``angles`` are omitted from the calculations. References ---------- * https://en.wikipedia.org/wiki/Mean_of_circular_quantities * Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 Examples -------- 1. Mean resultant vector length of a 1-D array of angles, in radians >>> import pingouin as pg >>> angles = [0.785, 1.570, 3.141, 0.839, 5.934] >>> r = pg.circ_r(angles) >>> round(r, 4) 0.4972 Note that there is a close relationship between the vector length and the circular standard deviation, i.e. :math:`\sigma = \sqrt{-2 \ln R}`: >>> import numpy as np >>> round(np.sqrt(-2 * np.log(r)), 4) 1.1821 which gives similar result as SciPy built-in function: >>> from scipy.stats import circstd >>> round(circstd(angles), 4) 1.1821 Sanity check: if all angles are the same, the vector length should be one: >>> angles = [3.14, 3.14, 3.14, 3.14] >>> round(pg.circ_r(angles), 4) 1.0 2. Using a 2-D array of angles in degrees >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 5)) >>> deg array([[322, 98, 230, 17, 83], [106, 123, 57, 214, 225], [ 96, 113, 126, 47, 73]]) We first need to convert from degrees to radians: >>> rad = np.round(pg.convert_angles(deg, low=0, high=360), 4) >>> rad array([[-0.6632, 1.7104, -2.2689, 0.2967, 1.4486], [ 1.85 , 2.1468, 0.9948, -2.5482, -2.3562], [ 1.6755, 1.9722, 2.1991, 0.8203, 1.2741]]) >>> pg.circ_r(rad) # On the first axis (default) array([0.46695499, 0.98398294, 0.3723287 , 0.31103746, 0.42527149]) >>> pg.circ_r(rad, axis=-1) # On the last axis (default) array([0.28099998, 0.45456096, 0.88261161]) >>> round(pg.circ_r(rad, axis=None), 4) # Across the entire array 0.4486 Missing values are omitted from the calculations: >>> rad[0, 0] = np.nan >>> pg.circ_r(rad) array([0.99619613, 0.98398294, 0.3723287 , 0.31103746, 0.42527149]) 3. Using binned angles >>> np.random.seed(123) >>> nbins = 18 # Number of bins to divide the unit circle >>> angles_bins = np.linspace(0, 2 * np.pi, nbins) >>> # w represents the number of incidences per bins, or "weights". >>> w = np.random.randint(low=0, high=5, size=angles_bins.size) >>> round(pg.circ_r(angles_bins, w), 4) 0.3642
def circ_r(angles, w=None, d=None, axis=0): """Mean resultant vector length for circular data. Parameters ---------- angles : array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. axis : int or None Compute along this dimension. Default is the first axis (0). Returns ------- r : float Circular mean vector length. See also -------- pingouin.circ_mean Notes ----- The length of the mean resultant vector is a crucial quantity for the measurement of circular spread or hypothesis testing in directional statistics. The closer it is to one, the more concentrated the data sample is around the mean direction (Berens 2009). The circular vector length of a set of angles :math:`\\alpha` is defined by: .. math:: \\bar{\\alpha} = \\frac{1}{N}\\left \\| \\sum_{j=1}^n \\exp(i \\cdot \\alpha_j) \\right \\| Missing values in ``angles`` are omitted from the calculations. References ---------- * https://en.wikipedia.org/wiki/Mean_of_circular_quantities * Berens, P. (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software, Articles, 31(10), 1–21. https://doi.org/10.18637/jss.v031.i10 Examples -------- 1. Mean resultant vector length of a 1-D array of angles, in radians >>> import pingouin as pg >>> angles = [0.785, 1.570, 3.141, 0.839, 5.934] >>> r = pg.circ_r(angles) >>> round(r, 4) 0.4972 Note that there is a close relationship between the vector length and the circular standard deviation, i.e. :math:`\\sigma = \\sqrt{-2 \\ln R}`: >>> import numpy as np >>> round(np.sqrt(-2 * np.log(r)), 4) 1.1821 which gives similar result as SciPy built-in function: >>> from scipy.stats import circstd >>> round(circstd(angles), 4) 1.1821 Sanity check: if all angles are the same, the vector length should be one: >>> angles = [3.14, 3.14, 3.14, 3.14] >>> round(pg.circ_r(angles), 4) 1.0 2. Using a 2-D array of angles in degrees >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 5)) >>> deg array([[322, 98, 230, 17, 83], [106, 123, 57, 214, 225], [ 96, 113, 126, 47, 73]]) We first need to convert from degrees to radians: >>> rad = np.round(pg.convert_angles(deg, low=0, high=360), 4) >>> rad array([[-0.6632, 1.7104, -2.2689, 0.2967, 1.4486], [ 1.85 , 2.1468, 0.9948, -2.5482, -2.3562], [ 1.6755, 1.9722, 2.1991, 0.8203, 1.2741]]) >>> pg.circ_r(rad) # On the first axis (default) array([0.46695499, 0.98398294, 0.3723287 , 0.31103746, 0.42527149]) >>> pg.circ_r(rad, axis=-1) # On the last axis (default) array([0.28099998, 0.45456096, 0.88261161]) >>> round(pg.circ_r(rad, axis=None), 4) # Across the entire array 0.4486 Missing values are omitted from the calculations: >>> rad[0, 0] = np.nan >>> pg.circ_r(rad) array([0.99619613, 0.98398294, 0.3723287 , 0.31103746, 0.42527149]) 3. Using binned angles >>> np.random.seed(123) >>> nbins = 18 # Number of bins to divide the unit circle >>> angles_bins = np.linspace(0, 2 * np.pi, nbins) >>> # w represents the number of incidences per bins, or "weights". >>> w = np.random.randint(low=0, high=5, size=angles_bins.size) >>> round(pg.circ_r(angles_bins, w), 4) 0.3642 """ angles = np.asarray(angles) _checkangles(angles) # Check that angles is in radians w = np.asarray(w) if w is not None else np.ones(angles.shape) assert angles.shape == w.shape, "Input dimensions do not match." # Add np.nan in weight vector (otherwise nansum(w) is wrong) w = w.astype(float) w[np.isnan(angles)] = np.nan # Compute weighted sum of cos and sin of angles: r = np.nansum(np.multiply(w, np.exp(1j * angles)), axis=axis) # Calculate vector length: r = np.abs(r) / np.nansum(w, axis=axis) # For data with known spacing, apply correction factor if d is not None: c = d / 2 / np.sin(d / 2) r = c * r return r
(angles, w=None, d=None, axis=0)
[ -0.02683410979807377, -0.03256054222583771, -0.015645086765289307, -0.03207194060087204, 0.026795020326972008, 0.00021635978191625327, -0.020892689004540443, 0.0025553968735039234, 0.05347277596592903, 0.022436676546931267, 0.02921849489212036, 0.019378017634153366, 0.05609169229865074, 0.05691254511475563, -0.05022845044732094, 0.01618255116045475, 0.053277336061000824, 0.0016636952059343457, -0.06734912097454071, -0.04049546644091606, -0.004402318503707647, 0.015136939473450184, -0.028436729684472084, -0.002100995508953929, -0.04252805560827255, -0.008472385816276073, 0.0245278999209404, 0.0028045845683664083, -0.04299711436033249, -0.0035936792846769094, 0.002306208945810795, 0.008389323949813843, -0.03271689638495445, -0.0654337927699089, -0.008921901695430279, -0.003955245949327946, 0.07669121772050858, 0.0060195960104465485, -0.03693843260407448, 0.04581147059798241, -0.03087974712252617, 0.02859308198094368, 0.006610806565731764, -0.033381398767232895, -0.008159680292010307, -0.0017614159733057022, -0.04131631925702095, 0.038580138236284256, -0.05659984052181244, 0.009552200324833393, 0.017110897228121758, -0.02052135020494461, -0.027948124334216118, -0.012176001444458961, 0.02546601928770542, 0.03547262027859688, -0.03215011581778526, 0.056208956986665726, -0.0029316216241568327, -0.004908022936433554, 0.047531358897686005, -0.011873067356646061, 0.05929693207144737, -0.007773682940751314, -0.0011243990156799555, 0.059961430728435516, 0.04960303753614426, -0.00479564443230629, 0.04628053307533264, -0.02310117706656456, 0.0163095872849226, 0.04843038693070412, 0.01993502676486969, -0.06484746932983398, 0.01823468506336212, -0.016084829345345497, 0.07031983137130737, -0.0034226682037115097, -0.005193856079131365, -0.026931829750537872, 0.029843907803297043, 0.01257665641605854, 0.06410478800535202, -0.023882944136857986, 0.0352967232465744, 0.01460924744606018, -0.06457384675741196, -0.01909462735056877, -0.07450227439403534, -0.03981142118573189, -0.002770382445305586, -0.05624804645776749, 0.011306286789476871, -0.010905631817877293, 0.005403955467045307, 0.035961225628852844, -0.0023440758232027292, -0.02226077951490879, 0.02429337054491043, -0.002697091782465577, -0.009713439270853996, -0.006395820993930101, -0.04889944568276405, -0.004959326237440109, 0.015586454421281815, 0.012928451411426067, -0.018224913626909256, -0.01399360690265894, -0.0030879746191203594, 0.024957871064543724, -0.012195545248687267, 0.03457358852028847, 0.06598103046417236, -0.0073241679929196835, -0.020345453172922134, 0.027322713285684586, -0.07121885567903519, 0.03871694952249527, -0.02370704524219036, 0.01949528232216835, 0.039459627121686935, -0.004671050235629082, 0.015136939473450184, 0.011804662644863129, 0.04929032921791077, 0.016006654128432274, -0.046671416610479355, -0.0008202432654798031, -0.018410583958029747, 0.06754455715417862, 0.02515331283211708, -0.04100361466407776, 0.07653486728668213, -0.03760293126106262, 0.04850856587290764, 0.058476079255342484, 0.014404034242033958, -0.025329209864139557, -0.0010682096472010016, 0.01819559745490551, 0.05929693207144737, 0.007983782328665257, 0.006366504821926355, 0.04108178988099098, 0.027557242661714554, 0.08974670618772507, 0.024176105856895447, 0.0015110066160559654, 0.03533581271767616, 0.028436729684472084, 0.02599371038377285, -0.02421519346535206, 0.08544699847698212, 0.06684096902608871, 0.06430023163557053, -0.039166465401649475, 0.012244406156241894, -0.022123970091342926, -0.09826795011758804, 0.01938779093325138, -0.015244431793689728, -0.009122229181230068, -0.014794916845858097, -0.006684096995741129, 0.031387895345687866, -0.006532629951834679, 0.0416681133210659, -0.03689934313297272, -0.03152470290660858, -0.027830859646201134, 0.00041928296559490263, -0.028534449636936188, -0.033029600977897644, 0.0023636198602616787, -0.018684200942516327, -0.01157013326883316, -0.06175949424505234, 0.009083140641450882, -0.031114276498556137, -0.0929519459605217, 0.015518049709498882, -0.023316163569688797, 0.04862583056092262, -0.026814565062522888, -0.012361670844256878, 0.09131024032831192, 0.04092543572187424, -0.06238490715622902, 0.07192245125770569, -0.03807199001312256, -0.042293526232242584, 0.005262260790914297, -0.025778725743293762, 0.06555105745792389, 0.03730976954102516, -0.05140109732747078, 0.005188969895243645, 0.053042806684970856, -0.013221613131463528, -0.04882127046585083, -0.008560335263609886, 0.013749305158853531, 0.005833927076309919, -0.02310117706656456, 0.00306598749011755, -0.019104400649666786, -0.020638614892959595, -0.014052239246666431, 0.07770751416683197, 0.011814435012638569, 0.03871694952249527, 0.044365204870700836, -0.015625542029738426, -0.026716845110058784, -0.04772679880261421, 0.11804662644863129, 0.03087974712252617, -0.04178537800908089, -0.02829992026090622, -0.011189022101461887, 0.024195650592446327, 0.02888624370098114, 0.05202651023864746, -0.01830309070646763, -0.04069090634584427, -0.05523175001144409, -0.00022124580573290586, 0.03861922770738602, 0.011873067356646061, -0.04643688350915909, 0.03760293126106262, -0.00985024869441986, -0.0034861864987760782, -0.025309665128588676, -0.011325831525027752, -0.08943399786949158, -0.007031005807220936, 0.034749485552310944, -0.0333227664232254, 0.033342309296131134, -0.04737500473856926, 0.009625490754842758, -0.026091432198882103, 0.05288645252585411, 0.025817813351750374, -0.0011653195833787322, 0.036547549068927765, 0.024781974032521248, 0.014423578046262264, 0.0049837566912174225, -0.06559014320373535, -0.04448246955871582, -0.03299051523208618, -0.02949211187660694, 0.00938118901103735, -0.025544196367263794, -0.026404138654470444, 0.04960303753614426, 0.03891238942742348, 0.015957793220877647, 0.04886035993695259, -0.0345931351184845, 0.019905710592865944, -0.004194661974906921, 0.014912181533873081, -0.008316033519804478, 0.004390103276818991, -0.018830781802535057, -0.010329079814255238, -0.0001490240974817425, 0.011149933561682701, 0.01614346168935299, 0.012615744955837727, -0.040612731128931046, 0.0023941576946526766, 0.02398066408932209, 0.0728214755654335, 0.061329521238803864, 0.069186270236969, 0.00187501625623554, 0.0075098369270563126, -0.014374717138707638, -0.03033251129090786, 0.025641916319727898, -0.030664760619401932, -0.00021941354498267174, -0.03668435662984848, -0.007636873982846737, 0.033948175609111786, 0.05136200785636902, 0.0338309109210968, -0.018136965110898018, -0.022084882482886314, 0.00408228300511837, 0.07528404146432877, 0.035413987934589386, -0.0038672974333167076, -0.034260883927345276, 0.0068013621494174, 0.0027874833904206753, -0.007568469736725092, 0.02056043967604637, 0.012918679043650627, -0.03136834874749184, -0.025016503408551216, -0.041159965097904205, 0.04178537800908089, -0.061642229557037354, 0.005594511050730944, 0.02831946313381195, -0.01662229374051094, -0.050111185759305954, 0.013553863391280174, 0.04182446748018265, 0.026697300374507904, -0.00664500892162323, 0.006332302466034889, -0.030821114778518677, 0.08411799371242523, 0.002877875231206417, 0.009356758557260036, -0.017980612814426422, 0.004744340665638447, 0.029570288956165314, -0.05464542657136917, 0.012742782011628151, -0.012605972588062286, 0.07325144857168198, -0.0006773267523385584, 0.03689934313297272, -0.01568417437374592, -0.011667854152619839, -0.01888941414654255, 0.029863450676202774, 0.029902540147304535, -0.02486015111207962, 0.06441749632358551, -0.03633256256580353, 0.026130519807338715, -0.046397797763347626, 0.04483426362276077, -0.027322713285684586, 0.02769405208528042, 0.03324458748102188, -0.06234581768512726, 0.015957793220877647, 0.09623536467552185, 0.005750864278525114, 0.06187675893306732, -0.04565512016415596, 0.07207880169153214, 0.03834560886025429, -0.010104321874678135, 0.04182446748018265, -0.06555105745792389, 0.046945031732320786, -0.0036156666465103626, 0.014912181533873081, 0.021283572539687157, -0.010504976846277714, -0.028436729684472084, 0.0384824201464653, 0.020130468532443047, -0.005340437404811382, -0.06508199870586395, 0.05632622167468071, -0.0625021681189537, 0.009312784299254417, -0.002831457881256938, 0.022338956594467163, -0.014980586245656013, -0.0003624827950261533, -0.024918783456087112, 0.0010114094475284219, -0.00598539412021637, 0.05312098190188408, -0.0009607168030925095, -0.05093203857541084, 0.008213425986468792, -0.06539470702409744, -0.10217678546905518, -0.034221794456243515, -0.01792198047041893, 0.01444312185049057, -0.037720195949077606, 0.03730976954102516, -0.02429337054491043, 0.011198794469237328, -0.05581807345151901, 0.0122639499604702, -0.0595705509185791, -0.0617985837161541, 0.04092543572187424, 0.008789978921413422, -0.11820297688245773, 0.03951825946569443, 0.042293526232242584, 0.018166281282901764, -0.07082797586917877, 0.0073095099069178104, 0.03920555114746094, -0.016387764364480972, 0.03215011581778526, 0.0007805442437529564, -0.013690672814846039, 0.005946305580437183, 0.03732931241393089, -0.021733088418841362, 0.014228136278688908, -0.020951321348547935, -0.05179198086261749, 0.04026093706488609, 0.05929693207144737, 0.036801621317863464, -0.005760636180639267, -0.0026115861255675554, -0.08990305662155151, -0.06488655507564545, 0.021146763116121292, 0.021224940195679665, -0.014843776822090149, -0.06738820672035217, 0.01982753351330757, 0.07153156399726868, 0.00911734253168106, 0.03617620840668678, 0.11343421041965485, -0.012283493764698505, 0.007910491898655891, 0.00953754223883152, -0.015596226789057255, 0.04862583056092262, -0.0666455328464508, -0.04757044464349747, -0.03500356152653694, 0.02364841289818287, -0.00012696058547589928, 0.020169556140899658, 0.0029438366182148457, 0.0169154554605484, -0.03463222086429596, 0.06089955195784569, -0.009000077843666077, -0.04248896986246109, -0.043192557990550995, 0.007289965637028217, -0.0010224030120298266, -0.058202460408210754, -0.018273774534463882, -0.044326119124889374, 0.05945328623056412, -0.01486332155764103, 0.03269735351204872, 0.009434935636818409, -0.041394494473934174, -0.01880146563053131, -0.03850196301937103, 0.005325779318809509, -0.022338956594467163, -0.06203311309218407, 0.0014658108120784163, 0.0074951788410544395, -0.02626732923090458, -0.047492269426584244, -0.02634550631046295, 0.0340849868953228, 0.008965875953435898, -0.010182498954236507, -0.0370166078209877, 0.003872183384373784, 0.05624804645776749, 0.01991548202931881, -0.006620578467845917, 0.012635288760066032, 0.01878192275762558, 0.022143514826893806, -0.04237170144915581, 0.0024796631187200546, -0.03697751834988594, -0.054449982941150665, -0.08794864267110825, -0.027615875005722046, -0.055622633546590805, 0.026208696886897087, -0.006073342636227608, -0.015088078565895557, -0.03209148347377777, -0.015860073268413544, 0.03125108405947685, -0.04471699893474579, -0.004321698565036058, 0.05394183471798897, -0.023550692945718765, -0.005799724720418453, 0.005833927076309919, 0.014364945702254772, 0.014990357682108879, 0.0014914624625816941, 0.026501858606934547, 0.02536829747259617, 0.032208748161792755, -0.024039296433329582, 0.023765679448843002, -0.0438961461186409, -0.008540790528059006, -0.02310117706656456, -0.05452816188335419, -0.04182446748018265, -0.029081685468554497, 0.01530306413769722, 0.002424695296213031, 0.02683410979807377, 0.05237830430269241, -0.016778647899627686, 0.01714998669922352, -0.007177586667239666, 0.008423525840044022, 0.030567040666937828, -0.03488629683852196, -0.04643688350915909, -0.01634867675602436, 0.021244484931230545, -0.044638823717832565, 0.09357736259698868, -0.03611757606267929, 0.027381345629692078, -0.02224123477935791, -0.06445658206939697, -0.03983096405863762, 0.00044004860683344305, -0.028788523748517036, 0.005320893134921789, -0.07082797586917877, -0.01618255116045475, -0.04022184759378433, 0.02921849489212036, -0.0017113341018557549, -0.012615744955837727, 0.013485458679497242, 0.0333227664232254, -0.016387764364480972, 0.02142038196325302, 0.0870887041091919, 0.013465914875268936, 0.011198794469237328, 0.026814565062522888, 0.05941419675946236, -0.06387025862932205, 0.04702321067452431, 0.006601034663617611, 0.017951296642422676, -0.016465941444039345, -0.030449775978922844, -0.002383163897320628, 0.026052342727780342, -0.018645113334059715, 0.013895886018872261, -0.11108890920877457, -0.030391143634915352, 0.003109961748123169, 0.015332380309700966, -0.033400941640138626, -0.007197130937129259, -0.0652383491396904, 0.018273774534463882, 0.05722525343298912, 0.08560334891080856, -0.030801570042967796, -0.010114094242453575, 0.0050521609373390675, -0.056756194680929184, 0.07024165242910385, -0.008052187040448189, -0.024039296433329582, 0.052143774926662445, -0.025524651631712914, 0.028788523748517036, -0.015283520333468914, -0.06191584840416908, -0.06668461859226227, -0.002726407954469323, -0.0802091658115387, -0.020443174988031387, -0.0798964574933052, 0.016377992928028107, 0.028729891404509544, -0.06273669749498367, 0.03457358852028847, 0.028475817292928696, 0.0578506663441658, 0.01951482705771923, -0.02370704524219036, -0.011130389757454395, -0.013094576075673103, -0.00015360474935732782, 0.013192296959459782, -0.050384800881147385, 0.02747906558215618, -0.0007200795225799084, 0.03314686566591263, -0.013798165135085583, -0.043466176837682724, -0.0038819555193185806, 0.05855425447225571, -0.08693235367536545, 0.05073659494519234, -0.01257665641605854, -0.03779837489128113, -0.013710216619074345, -0.052730098366737366, -0.021830808371305466, 0.012244406156241894, -0.01890895888209343, 0.014716739766299725, 0.03256054222583771, -0.028710346668958664, -0.03732931241393089, 0.03940099477767944, 0.02978527545928955, 0.0698898583650589, 0.010739507153630257, -0.01819559745490551, -0.010866544209420681, -0.02568100392818451, -0.05081477388739586, 0.0030879746191203594, -0.021537646651268005, 0.03000026009976864, -0.0073241679929196835, 0.00820854026824236, 0.02595462277531624, -0.001833484973758459, -0.04190264269709587, -0.019378017634153366, -0.016905684024095535, 0.0703980028629303, 0.00016734673408791423, -0.00578018045052886, 0.008975648321211338, 0.0519874207675457, 0.03760293126106262, -0.017394287511706352, -0.007221560925245285, 0.03207194060087204, 0.017863348126411438, -0.030273878946900368, -0.02257348597049713, -0.015693947672843933, 0.013202069327235222, 0.004277724307030439, -0.048039503395557404, 0.031915586441755295, 0.0360589437186718, -0.028397640213370323, 0.019465966150164604, -0.03666481375694275, -0.005340437404811382, 0.009434935636818409, -0.0017174415988847613, -0.0348472073674202, 0.001666138181462884, 0.0016917899483814836, 0.005000857636332512, 0.001041947165504098, -0.041394494473934174, -0.036840710788965225, 0.004463393706828356, 0.00405540969222784, -0.01649525761604309, 0.006767159793525934, 0.03375273570418358, -0.005731320008635521, 0.04135540872812271, 0.03471039980649948, -0.003622995689511299, 0.016270499676465988, 0.03242373466491699, -0.008526132442057133, 0.03523809090256691, 0.03514036908745766, 0.012058736756443977, 0.00765641825273633, 0.006732957437634468, 0.004639291204512119, 0.054684512317180634, -0.02972664311528206, 0.05366821959614754, -0.03902965411543846, 0.01766790635883808, 0.004507367964833975, -0.015654858201742172, 0.05855425447225571, 0.029062140733003616, -0.017325883731245995, 0.03486675024032593, -0.01444312185049057, -0.026091432198882103, 0.035355355590581894, 0.03263872116804123, 0.030137069523334503, 0.047844063490629196, -0.02423473820090294, 0.007250877097249031, -0.013417054899036884, -0.046671416610479355, 0.016319360584020615, 0.07031983137130737, 0.006219923496246338, 0.022299867123365402, -0.016377992928028107, -0.006239467766135931, 0.06414388120174408, 0.013348650187253952, -0.011677625589072704, -0.038306523114442825, -0.007822543382644653, -0.015693947672843933, -0.002797255525365472, 0.0007286301115527749, -0.009576630778610706, 0.0024002650752663612, 0.024156561121344566, 0.030684305354952812, 0.02798721380531788, -0.00426062336191535, -0.04960303753614426, 0.04213717207312584, 0.00443896371871233, -0.06793544441461563, -0.007915378548204899, -0.013641811907291412, 0.022651663050055504, 0.010348623618483543, 0.017824258655309677, -0.009601060301065445, 0.008975648321211338, -0.0032076826319098473, -0.06234581768512726, -0.04334891214966774, 0.019338930025696754, -0.04745317995548248, -0.008350235410034657, -0.012342127040028572, -0.08341440558433533, 0.011384463869035244, -0.014189048670232296, -0.034221794456243515, -0.04874309524893761, 0.04334891214966774, -0.01706203818321228, 0.02829992026090622, 0.030664760619401932, -0.03271689638495445, -0.011687397956848145, -0.058749694377183914, -0.00887792743742466, -0.04014367237687111, 0.03345957398414612, -0.03926418349146843, 0.009307898581027985, 0.020931778475642204, 0.017267251387238503, 0.013241156935691833, 0.04620235413312912, 0.0042972685769200325, 0.02831946313381195, -0.018312862142920494, -0.005838812794536352 ]
31,987
pingouin.circular
circ_rayleigh
Rayleigh test for non-uniformity of circular data. Parameters ---------- angles : 1-D array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. Returns ------- z : float Z-statistic pval : float P-value Notes ----- The Rayleigh test asks how large the resultant vector length R must be to indicate a non-uniform distribution (Fisher 1995). H0: the population is uniformly distributed around the circle HA: the populatoin is not distributed uniformly around the circle The assumptions for the Rayleigh test are that (1) the distribution has only one mode and (2) the data is sampled from a von Mises distribution. Examples -------- 1. Simple Rayleigh test for non-uniformity of circular data. >>> from pingouin import circ_rayleigh >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> z, pval = circ_rayleigh(x) >>> print(round(z, 3), round(pval, 6)) 1.236 0.304844 2. Specifying w and d >>> z, pval = circ_rayleigh(x, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(z, 3), round(pval, 6)) 0.278 0.806997
def circ_rayleigh(angles, w=None, d=None): """Rayleigh test for non-uniformity of circular data. Parameters ---------- angles : 1-D array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. Returns ------- z : float Z-statistic pval : float P-value Notes ----- The Rayleigh test asks how large the resultant vector length R must be to indicate a non-uniform distribution (Fisher 1995). H0: the population is uniformly distributed around the circle HA: the populatoin is not distributed uniformly around the circle The assumptions for the Rayleigh test are that (1) the distribution has only one mode and (2) the data is sampled from a von Mises distribution. Examples -------- 1. Simple Rayleigh test for non-uniformity of circular data. >>> from pingouin import circ_rayleigh >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> z, pval = circ_rayleigh(x) >>> print(round(z, 3), round(pval, 6)) 1.236 0.304844 2. Specifying w and d >>> z, pval = circ_rayleigh(x, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(z, 3), round(pval, 6)) 0.278 0.806997 """ angles = np.asarray(angles) _checkangles(angles) # Check that angles is in radians if w is None: r = circ_r(angles) n = len(angles) else: assert len(angles) == len(w), "Input dimensions do not match" r = circ_r(angles, w, d) n = np.sum(w) # Compute Rayleigh's statistic R = n * r z = (R**2) / n # Compute p value using approxation in Zar (1999), p. 617 pval = np.exp(np.sqrt(1 + 4 * n + 4 * (n**2 - R**2)) - (1 + 2 * n)) return z, pval
(angles, w=None, d=None)
[ -0.03373599052429199, -0.04709300026297569, -0.03736146539449692, -0.01911960542201996, 0.02570270374417305, -0.008610500954091549, -0.013433336280286312, 0.017955638468265533, -0.0014406489208340645, -0.0011621791636571288, 0.0163432564586401, 0.0592288002371788, 0.022974057123064995, 0.03572046011686325, -0.07147908955812454, 0.000635650590993464, 0.011983145959675312, 0.039880216121673584, -0.060488175600767136, -0.05319906398653984, -0.013089870102703571, -0.004510376136749983, -0.02158111147582531, 0.04465057700872421, -0.01980653777718544, -0.014520978555083275, 0.0019474998116493225, 0.02894654870033264, -0.02570270374417305, 0.04075796157121658, -0.04659688472747803, -0.014998014084994793, -0.05728249251842499, -0.07105929404497147, -0.029957866296172142, -0.0054525225423276424, 0.06480058282613754, 0.0010536534246057272, -0.03274375572800636, 0.007179392967373133, 0.0034632820170372725, 0.025397401303052902, 0.02848859503865242, -0.020111840218305588, -0.02736278995871544, -0.016867995262145996, -0.038563597947359085, -0.00018753480981104076, -0.050794802606105804, -0.012841811403632164, 0.0007250948692671955, -0.07201336324214935, 0.013242521323263645, 0.010208572261035442, 0.02659953199326992, -0.015608620829880238, -0.005209234077483416, 0.020207248628139496, 0.03346884995698929, -0.026408717036247253, 0.010332601144909859, -0.011172184720635414, 0.07682189345359802, 0.0325147807598114, 0.00967429205775261, 0.03205682337284088, 0.028126047924160957, -0.014883525669574738, 0.02581719309091568, -0.009488247334957123, 0.04098694026470184, 0.06354120373725891, 0.031770601868629456, -0.04781809821724892, 0.026179740205407143, 0.019291339442133904, 0.056824538856744766, -0.01536056213080883, -0.029881540685892105, 0.005891395732760429, 0.05274111032485962, 0.01468317024409771, 0.05270294472575188, -0.0017292557749897242, 0.006697586737573147, 0.013795883394777775, 0.005910477135330439, -0.028889305889606476, -0.009545492008328438, -0.011859117075800896, 0.012049931101500988, -0.026981160044670105, 0.009211566299200058, -0.05022235959768295, 0.02738187089562416, 0.014406489208340645, 0.015665864571928978, 0.02558821439743042, 0.03352609649300575, 0.036560043692588806, 0.009044604375958443, -0.015398724935948849, -0.03718973323702812, 0.02448149211704731, -0.005271248519420624, 0.008777463808655739, -0.006206239573657513, -0.021981822326779366, -0.02501577138900757, 0.011639680713415146, 0.016200145706534386, -0.01747860200703144, 0.016085656359791756, 0.015284235589206219, -0.0003959399473387748, 0.03730422258377075, -0.06460976600646973, 0.024519653990864754, -0.017888853326439857, 0.009445314295589924, 0.06911298632621765, -0.007518088445067406, -0.000279215193586424, 0.009230648167431355, 0.011859117075800896, 0.00512336753308773, -0.016429122537374496, -0.019539397209882736, -0.025511888787150383, 0.06109878048300743, 0.014034401625394821, 0.01701110601425171, 0.019558480009436607, -0.04995521903038025, -0.009140010923147202, 0.0801420584321022, 0.04049082100391388, 0.0020083219278603792, 0.022974057123064995, -0.050565823912620544, 0.04373466596007347, 0.007365437224507332, 0.018089208751916885, 0.033564258366823196, 0.043467529118061066, 0.08311876654624939, 0.013795883394777775, 0.01759309135377407, 0.0929647907614708, 0.09685740619897842, 0.02501577138900757, -0.06857870519161224, 0.07021971046924591, 0.08121062070131302, 0.053809668868780136, -0.05304641276597977, 0.011467947624623775, -0.009669520892202854, -0.08288978785276413, 0.018404051661491394, 0.02558821439743042, -0.029003793373703957, -0.0030601865146309137, -0.007308192551136017, 0.02102775126695633, -0.023298442363739014, 0.02635147236287594, 0.00312935677357018, -0.002048869850113988, -0.01637187786400318, -0.0034632820170372725, -0.0006761986296623945, -0.08311876654624939, 0.017173299565911293, -0.04442159831523895, -0.021542949602007866, -0.08327142149209976, 0.007608725689351559, 0.014864443801343441, -0.09784963726997375, -0.014368326403200626, -0.007198474369943142, 0.03406037762761116, -0.0505276620388031, -0.025206586346030235, 0.07823392003774643, 0.02436700277030468, -0.05564148724079132, 0.020054597407579422, 0.023641908541321754, -0.08991175889968872, -0.0031961416825652122, 0.0011693347478285432, 0.06556383520364761, 0.01667718216776848, -0.0194630715996027, -0.023966291919350624, 0.07025787234306335, -0.0038806884549558163, -0.03869716823101044, 0.008724990300834179, 0.024328840896487236, 0.00044155653449706733, -0.03820104897022247, -0.006726208608597517, -0.028240535408258438, -0.007007659878581762, -0.04716932773590088, 0.10639812797307968, 0.02837410569190979, 0.05976308137178421, 0.04362018033862114, -0.06266345828771591, -0.002537831896916032, -0.06335039436817169, 0.08433997631072998, 0.018518541008234024, -0.01580897532403469, -0.01385312806814909, -0.027343707159161568, 0.004746508784592152, 0.02625606581568718, -0.0013273529475554824, 0.010552038438618183, -0.03274375572800636, -0.02614157646894455, 0.044230785220861435, 0.030740205198526382, -0.004961175378412008, -0.08456895500421524, 0.03373599052429199, 0.0013893676223233342, -0.009798320941627026, -0.03862084075808525, -0.059266962110996246, -0.07602047175168991, -0.021542949602007866, 0.007274799980223179, -0.015723109245300293, 0.028431350365281105, 0.021065913140773773, 0.019291339442133904, -0.00968860276043415, 0.05220682919025421, 0.03972756490111351, -0.049115635454654694, -0.033106304705142975, -0.0020906105637550354, 0.01969204843044281, 0.03780033811926842, -0.07201336324214935, -0.07334906607866287, -0.0017674186965450644, -0.02015000395476818, 0.006907482631504536, 0.0022396843414753675, 0.023451093584299088, -0.005877084564417601, 0.07449395209550858, -0.024004455655813217, 0.02182917110621929, -0.018613947555422783, 0.04205550253391266, 0.005862773396074772, -0.02570270374417305, -0.01451143715530634, 0.004381576552987099, -0.029633481055498123, 0.018060585483908653, -0.02915644459426403, -0.0534280426800251, -0.0246913880109787, -0.012116716243326664, -0.04785626009106636, -0.01615244150161743, 0.07010522484779358, 0.0947202816605568, 0.034308433532714844, 0.06121326982975006, 0.04552832245826721, -0.0030697272159159184, -0.030453983694314957, -0.03329711779952049, 0.054038647562265396, -0.049802567809820175, 0.03274375572800636, -0.07773780077695847, 0.02883206121623516, 0.03402221202850342, -0.03686534985899925, 0.028736652806401253, -0.02514934167265892, -0.01637187786400318, -0.01881430298089981, 0.12647180259227753, 0.03938409686088562, -0.018184615299105644, -0.01859486661851406, 0.04541383311152458, -0.00628733541816473, 0.012555589899420738, 0.029843376949429512, 0.07590597867965698, -0.058694519102573395, -0.020188167691230774, -0.013938994146883488, 0.014005779288709164, -0.07262397557497025, -0.02169560082256794, 0.016429122537374496, -0.005166300572454929, -0.033335279673337936, 0.023756396025419235, -0.02238253317773342, 0.028774816542863846, -0.0572061650454998, -0.002914690412580967, -0.03703708201646805, 0.009450084529817104, 0.0046677980571985245, 0.043124061077833176, -0.019749293103814125, -0.042780596762895584, 0.048008911311626434, -0.033774156123399734, -0.039460424333810806, 0.005934328772127628, 0.046024441719055176, 0.010885963216423988, 0.00044364354107528925, -0.014969391748309135, -0.048352375626564026, 0.0008049983880482614, 0.0008699945756234229, 0.05667188763618469, 0.015331939794123173, 0.04720748960971832, 0.00009645073441788554, 0.007904487662017345, -0.0364646390080452, -0.015427347272634506, -0.01767895743250847, -0.021848252043128014, 0.020856017246842384, -0.01859486661851406, 0.031007345765829086, 0.044116295874118805, 0.03930777311325073, 0.04136857017874718, -0.004183606244623661, 0.062358155846595764, -0.013814965263009071, 0.00723663717508316, 0.044116295874118805, -0.029633481055498123, -0.0015181673225015402, 0.002735801972448826, -0.02215355634689331, 0.04060531035065651, 0.008057139813899994, -0.03904063254594803, 0.005409589037299156, -0.01012270525097847, 0.02604616992175579, -0.06022103503346443, 0.0011538310209289193, -0.06613628566265106, 0.01915776915848255, -0.025511888787150383, 0.031446218490600586, -0.014234757050871849, -0.036674533039331436, -0.08456895500421524, 0.01926271617412567, 0.04037633538246155, 0.0389261431992054, 0.016839373856782913, 0.002544987481087446, 0.028469514101743698, 0.02169560082256794, -0.06445711851119995, 0.008667745627462864, 0.02282140590250492, -0.009392840787768364, -0.020054597407579422, 0.011420243419706821, -0.026866672560572624, 0.03371690958738327, -0.02482495829463005, -0.001905759098008275, -0.025664541870355606, -0.0420936644077301, 0.04442159831523895, 0.05174887552857399, -0.0825081616640091, 0.04484139010310173, 0.022000903263688087, 0.03661729022860527, -0.07727984338998795, 0.017096973955631256, 0.03774309530854225, 0.020092759281396866, 0.008276576176285744, -0.053466204553842545, -0.011391622014343739, 0.02238253317773342, 0.01759309135377407, 0.009836483746767044, 0.006835926789790392, -0.026122495532035828, -0.04159754514694214, 0.023756396025419235, 0.07937880605459213, 0.02726738154888153, 0.004772746004164219, 0.01157289557158947, -0.007608725689351559, 0.017526306211948395, -0.022516103461384773, -0.005151989869773388, 0.04617709293961525, -0.12418203055858612, 0.017058810219168663, 0.06056449934840202, 0.007947420701384544, 0.028622165322303772, 0.05006970837712288, -0.0325147807598114, 0.02549280785024166, -0.01028489787131548, 0.015455968677997589, -0.01636233739554882, -0.04381099343299866, -0.020550714805722237, 0.013633690774440765, 0.04163571074604988, -0.0024495802354067564, 0.03902155160903931, 0.007250948343425989, -0.005590863060206175, -0.05999205633997917, 0.03138897567987442, 0.0015384414000436664, -0.042551618069410324, -0.06045001372694969, 0.006502001546323299, 0.028202373534440994, -0.0682734027504921, 0.036674533039331436, -0.05121459439396858, 0.062358155846595764, -0.01368139497935772, 0.011362999677658081, 0.03358333930373192, -0.04228447750210762, -0.040338169783353806, -0.0638846680521965, 0.04659688472747803, -0.009354677982628345, -0.037571363151073456, 0.026675857603549957, -0.04075796157121658, -0.08212652802467346, -0.03961307555437088, -0.044230785220861435, -0.013166195712983608, -0.02379455976188183, -0.023565582931041718, -0.041444893926382065, -0.0583510547876358, 0.07094480842351913, 0.03551056608557701, 0.025740867480635643, 0.04854319244623184, 0.051672548055648804, 0.02858400158584118, -0.021199483424425125, -0.003141282591968775, -0.0650295615196228, -0.04797074943780899, -0.04037633538246155, 0.001450189738534391, -0.033106304705142975, 0.014568681828677654, -0.009154322557151318, -0.0362929031252861, -0.060602664947509766, 0.04793258383870125, 0.04060531035065651, -0.03881165385246277, 0.020169084891676903, 0.024061700329184532, -0.017287787050008774, 0.026179740205407143, 0.01815599389374256, -0.021008668467402458, 0.03528158739209175, -0.009254500269889832, 0.030568471178412437, -0.002168128965422511, 0.03157978877425194, -0.06949461251497269, 0.04091061279177666, -0.05129091814160347, 0.018613947555422783, 0.00023359860642813146, 0.045337509363889694, -0.029957866296172142, 0.004038110375404358, 0.05651923641562462, -0.004259932320564985, 0.019749293103814125, 0.055030882358551025, -0.01645774394273758, 0.008472160436213017, 0.006559246219694614, 0.034117620438337326, 0.04171203449368477, -0.031446218490600586, -0.015150666236877441, 0.011944983154535294, 0.03562505543231964, -0.018556702882051468, 0.05976308137178421, -0.013042166829109192, 0.037113405764102936, -0.0016839373856782913, -0.039880216121673584, -0.01911960542201996, 0.03961307555437088, -0.03060663491487503, -0.014454193413257599, -0.09006441384553909, -0.026332391425967216, -0.009979594498872757, 0.048772167414426804, -0.02390904910862446, 0.0019486923702061176, 0.012030850164592266, -0.0039331624284386635, 0.023107627406716347, -0.028183290734887123, 0.012259826995432377, -0.02015000395476818, -0.03346884995698929, 0.023432012647390366, 0.02270691655576229, 0.003875918220728636, 0.031331729143857956, 0.003372645005583763, 0.03329711779952049, -0.02390904910862446, -0.017116054892539978, -0.015427347272634506, 0.019520316272974014, 0.020436225458979607, -0.0026642465963959694, -0.09647578001022339, 0.0018031963845714927, 0.012307531200349331, -0.011553813703358173, -0.01815599389374256, -0.02169560082256794, -0.07037236541509628, -0.0010077387560158968, 0.0358540304005146, 0.07518088817596436, -0.01502663642168045, -0.01948215439915657, 0.0004242639697622508, -0.0360257662832737, 0.0912092998623848, -0.037895746529102325, -0.02669493854045868, 0.03417486324906349, -0.0017817297484725714, 0.02570270374417305, -0.021657437086105347, -0.03890706226229668, -0.05419129878282547, -0.001451382297091186, -0.06655607372522354, -0.029576236382126808, -0.08502691239118576, -0.014482815749943256, 0.008686826564371586, -0.06086980551481247, 0.02949991077184677, 0.020951423794031143, 0.07628761231899261, -0.003651711158454418, -0.010981370694935322, -0.024653224274516106, -0.02348925732076168, 0.023164872080087662, 0.00801420584321022, -0.00742745166644454, 0.052244991064071655, 0.02503485418856144, 0.009278351441025734, -0.0038186737801879644, -0.04140673205256462, -0.05453476309776306, -0.007017200812697411, -0.08426365256309509, 0.033793237060308456, 0.013700475916266441, -0.0291755273938179, -0.045337509363889694, -0.07689821720123291, -0.01622876711189747, 0.00818593893200159, -0.011820954270660877, 0.059037983417510986, 0.049573589116334915, -0.00929743330925703, 0.0002045292203547433, 0.04041449725627899, 0.020512551069259644, 0.06667055934667587, 0.029633481055498123, -0.029633481055498123, 0.023107627406716347, -0.022611510008573532, 0.02680942788720131, -0.04682585969567299, 0.018318185582756996, 0.00950732920318842, 0.020646121352910995, 0.02291681244969368, 0.026065250858664513, 0.0300532728433609, -0.03230488300323486, -0.0326865129172802, -0.03480455279350281, 0.05854186788201332, 0.030110517516732216, -0.023203035816550255, 0.0204743891954422, -0.006716668140143156, -0.0031532084103673697, 0.016734424978494644, -0.00247581722214818, 0.002311239717528224, 0.033564258366823196, -0.013585987500846386, -0.010943207889795303, 0.017621712759137154, 0.0007274800445884466, -0.013557365164160728, -0.009970054030418396, 0.01180187240242958, -0.030854694545269012, -0.00013520992069970816, 0.017392735928297043, -0.01600933074951172, -0.012765485793352127, 0.05071847513318062, 0.017068350687623024, -0.038563597947359085, -0.01837543025612831, 0.026847589761018753, -0.03301089629530907, -0.015398724935948849, -0.01682029291987419, 0.027229219675064087, 0.020054597407579422, 0.009593195281922817, -0.004851456731557846, -0.014616385102272034, 0.024672305211424828, -0.025664541870355606, 0.02782074362039566, -0.011429784819483757, 0.01891924999654293, -0.05728249251842499, -0.006611720193177462, 0.02415710687637329, 0.013585987500846386, -0.00955980271100998, -0.023641908541321754, 0.02547372691333294, -0.00891103409230709, 0.037113405764102936, 0.07976043224334717, 0.017116054892539978, 0.03606392815709114, -0.022401614114642143, 0.0012474493123590946, 0.04430711269378662, -0.031560707837343216, 0.024500573053956032, 0.03619749844074249, -0.020092759281396866, 0.01062836404889822, -0.034308433532714844, -0.03949858620762825, -0.020073678344488144, 0.02203906700015068, -0.03795298933982849, 0.05850370600819588, -0.02602708898484707, 0.0019105294486507773, 0.026675857603549957, -0.05709167942404747, 0.006225320976227522, 0.08846157044172287, 0.018823843449354172, 0.04617709293961525, -0.059572264552116394, -0.03507169336080551, 0.021008668467402458, -0.0030077125411480665, -0.03829645738005638, -0.024977609515190125, -0.024424247443675995, 0.005557470489293337, 0.0047178869135677814, -0.004465057514607906, 0.0023207804188132286, 0.011305755004286766, 0.06342671811580658, 0.010323060676455498, -0.0008288501994684339, -0.029347259551286697, -0.04781809821724892, 0.0824318379163742, -0.040223680436611176, -0.04258977994322777, -0.012422019615769386, 0.0045914724469184875, 0.02049347013235092, 0.04430711269378662, 0.05308457463979721, 0.00008415214688284323, 0.02892746776342392, -0.0021633587311953306, -0.048695843666791916, 0.02902287431061268, 0.02680942788720131, -0.015255614183843136, -0.0027572684921324253, -0.019997352734208107, -0.10914585739374161, 0.011305755004286766, -0.02425251342356205, -0.004403043072670698, -0.003763814689591527, 0.01636233739554882, -0.04755095764994621, 0.012593752704560757, 0.005271248519420624, -0.003437045030295849, 0.0003610566782299429, -0.037342384457588196, 0.06075531616806984, -0.024977609515190125, -0.03457557410001755, -0.014120267704129219, -0.001516974763944745, 0.03371690958738327, 0.013671853579580784, -0.02970980666577816, 0.017841149121522903, -0.02436700277030468, 0.027992477640509605, -0.013147114776074886, 0.035453323274850845 ]
31,988
pingouin.circular
circ_vtest
V test for non-uniformity of circular data with a specified mean direction. Parameters ---------- angles : 1-D array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\pi]` or :math:`[-\pi, \pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. dir : float Suspected mean direction (angle in radians). w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. Returns ------- V : float V-statistic pval : float P-value Notes ----- H0: the population is uniformly distributed around the circle. HA: the population is not distributed uniformly around the circle but has a mean of dir. Note: Not rejecting H0 may mean that the population is uniformly distributed around the circle OR that it has a mode but that this mode is not centered at dir. The V test has more power than the Rayleigh test and is preferred if there is reason to believe in a specific mean direction. Adapted from the Matlab Circular Statistics Toolbox. Examples -------- 1. V-test for non-uniformity of circular data. >>> from pingouin import circ_vtest >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> v, pval = circ_vtest(x, dir=1) >>> print(round(v, 3), pval) 2.486 0.05794648732225438 2. Specifying w and d >>> v, pval = circ_vtest(x, dir=0.5, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(v, 3), round(pval, 5)) 0.637 0.23086
def circ_vtest(angles, dir=0.0, w=None, d=None): """V test for non-uniformity of circular data with a specified mean direction. Parameters ---------- angles : 1-D array_like Samples of angles in radians. The range of ``angles`` must be either :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not expressed in radians (e.g. degrees or 24-hours), please use the :py:func:`pingouin.convert_angles` function prior to using the present function. dir : float Suspected mean direction (angle in radians). w : array_like Number of incidences per bins (i.e. "weights"), in case of binned angle data. d : float Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r. Returns ------- V : float V-statistic pval : float P-value Notes ----- H0: the population is uniformly distributed around the circle. HA: the population is not distributed uniformly around the circle but has a mean of dir. Note: Not rejecting H0 may mean that the population is uniformly distributed around the circle OR that it has a mode but that this mode is not centered at dir. The V test has more power than the Rayleigh test and is preferred if there is reason to believe in a specific mean direction. Adapted from the Matlab Circular Statistics Toolbox. Examples -------- 1. V-test for non-uniformity of circular data. >>> from pingouin import circ_vtest >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> v, pval = circ_vtest(x, dir=1) >>> print(round(v, 3), pval) 2.486 0.05794648732225438 2. Specifying w and d >>> v, pval = circ_vtest(x, dir=0.5, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(v, 3), round(pval, 5)) 0.637 0.23086 """ angles = np.asarray(angles) if w is None: r = circ_r(angles) mu = circ_mean(angles) n = len(angles) else: assert len(angles) == len(w), "Input dimensions do not match" r = circ_r(angles, w, d) mu = circ_mean(angles, w) n = np.sum(w) # Compute Rayleigh and V statistics R = n * r v = R * np.cos(mu - dir) # Compute p value u = v * np.sqrt(2 / n) pval = 1 - norm.cdf(u) return v, pval
(angles, dir=0.0, w=None, d=None)
[ 0.0003219523641746491, -0.060674358159303665, -0.017516110092401505, -0.02351321466267109, 0.03436692804098129, 0.006367766298353672, 0.009456608444452286, 0.005008676089346409, 0.020034704357385635, 0.04124791920185089, -0.01578635722398758, 0.029177675023674965, 0.03837767243385315, 0.02822726219892502, -0.06082642450928688, 0.043642960488796234, 0.047292545437812805, -0.003250411944463849, -0.04071568697690964, -0.019283877685666084, -0.04352891072630882, 0.049649570137262344, -0.004139048047363758, 0.030660320073366165, 0.014959498308598995, 0.013552887365221977, -0.004820969421416521, -0.015178093686699867, -0.02134627290070057, -0.02056693471968174, -0.03181982412934303, 0.028797511011362076, -0.03780742362141609, 0.0058402870781719685, -0.013172722421586514, -0.02125123143196106, 0.0757289007306099, -0.012526441365480423, -0.07040658593177795, 0.04801485687494278, -0.0022085218224674463, 0.0069665261544287205, 0.013068176805973053, -0.014142143540084362, -0.021023131906986237, -0.004908882547169924, -0.004628510680049658, 0.051436346024274826, -0.04193221777677536, -0.0147599121555686, 0.010349996387958527, -0.03406279906630516, -0.0006124223000369966, 0.01604297012090683, 0.009580161422491074, 0.006714667193591595, -0.0035545441787689924, 0.036971062421798706, 0.028911558911204338, 0.02184048853814602, 0.0087295426055789, -0.008639252744615078, 0.04212229698896408, 0.0003855112299788743, -0.005845039151608944, 0.022657843306660652, 0.02645949460566044, 0.0006035121623426676, 0.010321483947336674, -0.0009426907636225224, 0.003359709633514285, 0.03750329092144966, 0.024083461612462997, -0.022866934537887573, 0.0403735376894474, 0.0216694138944149, 0.05596030876040459, -0.006367766298353672, -0.02874048613011837, 0.017421068623661995, 0.06645286828279495, -0.01117685530334711, 0.06538840383291245, -0.05786113440990448, -0.005864047445356846, 0.04907932132482529, -0.049269404262304306, -0.053983449935913086, 0.036952052265405655, 0.022410735487937927, 0.008140286430716515, -0.02587023936212063, -0.013923549093306065, -0.032314036041498184, -0.012707020156085491, 0.04736857861280441, 0.04094378650188446, -0.007698344066739082, 0.00000873377484822413, 0.021517347544431686, -0.007522517815232277, 0.045923952013254166, -0.03149668127298355, 0.012412392534315586, -0.008601236157119274, -0.0056787170469760895, -0.03719915822148323, -0.0012676131445914507, -0.02077602595090866, -0.0029557840898633003, 0.016099995002150536, 0.03651486337184906, 0.03288428485393524, 0.042844612151384354, 0.00008895270730135962, 0.014683878980576992, -0.06812559813261032, 0.011861152946949005, -0.04653221368789673, -0.0036282010842114687, 0.07899831980466843, 0.008016732521355152, -0.004319626372307539, -0.02155536413192749, -0.005350824445486069, -0.045505769550800323, -0.006077890284359455, 0.003008056664839387, -0.04383304342627525, 0.06850575655698776, 0.034804120659828186, -0.016157018020749092, 0.03225701302289963, -0.04858510568737984, 0.013505366630852222, 0.05421154946088791, 0.031078500673174858, -0.009451855905354023, 0.037636350840330124, -0.014332226477563381, 0.07512063533067703, 0.028968583792448044, -0.006329749710857868, 0.023285115137696266, 0.05288097262382507, 0.10621814429759979, 0.03189585730433464, 0.008235327899456024, 0.03564048185944557, 0.059305764734745026, -0.017487596720457077, -0.035982631146907806, 0.062157001346349716, 0.058317333459854126, 0.04516362026333809, -0.07401815801858902, 0.02497684955596924, -0.06995038688182831, -0.0709007978439331, -0.0201867688447237, 0.0295388326048851, -0.04090576991438866, 0.026421478018164635, 0.04459337145090103, 0.04755866155028343, 0.030774369835853577, 0.009912806563079357, -0.022771893069148064, -0.03421486169099808, -0.023361148312687874, 0.00580702256411314, -0.005355576518923044, -0.08584129065275192, 0.00674317916855216, -0.01048305444419384, -0.05957188084721565, -0.05945783108472824, -0.03856775537133217, 0.04288262873888016, -0.10758673399686813, -0.02695370838046074, 0.010540078394114971, 0.05075204744935036, -0.06417188048362732, -0.026307428255677223, 0.06907600909471512, 0.04349089413881302, -0.029405774548649788, 0.0038539241068065166, -0.044441305100917816, -0.08348426967859268, -0.02469172701239586, -0.005697725340723991, 0.06417188048362732, 0.048965271562337875, -0.015938423573970795, 0.0015776853542774916, 0.03946114331483841, 0.01303016021847725, -0.04638014733791351, 0.05748097226023674, -0.02028181031346321, 0.004127168096601963, -0.034994203597307205, -0.009195244871079922, 0.015472721308469772, -0.03206693008542061, -0.03995535895228386, 0.12188094854354858, 0.007688840385526419, 0.04991568252444267, 0.030546270310878754, -0.022581810131669044, 0.0002322571526747197, -0.08918674290180206, 0.05656857416033745, 0.08196360617876053, -0.014959498308598995, -0.03718015179038048, 0.03159172460436821, 0.052614856511354446, -0.008263840340077877, -0.008682021871209145, 0.017145447432994843, -0.024254536256194115, -0.012440904974937439, -0.004626134876161814, 0.017354538664221764, -0.02697271667420864, -0.07751567661762238, 0.04736857861280441, 0.013286772184073925, 0.005906816106289625, -0.029785940423607826, -0.08470079302787781, -0.057823117822408676, 0.004060639068484306, 0.03529833257198334, -0.051512379199266434, 0.034899160265922546, -0.007736360654234886, 0.012906607240438461, 0.014085118658840656, 0.06554047018289566, 0.047786761075258255, -0.05687270686030388, -0.01766817457973957, 0.010682640597224236, 0.02961486577987671, 0.02834131196141243, -0.06478013843297958, -0.03908097743988037, -0.05333717167377472, 0.012203301303088665, 0.013857020065188408, 0.01486445777118206, 0.0014909602468833327, 0.031629741191864014, 0.08895864337682724, -0.001189204165711999, -0.006809708196669817, -0.03915701061487198, 0.03090742602944374, 0.016014456748962402, -0.023152057081460953, -0.04212229698896408, -0.0018758773803710938, -0.007004542741924524, 0.020414868369698524, -0.015567762777209282, -0.07527270168066025, 0.008244832046329975, -0.011034293100237846, -0.047292545437812805, -0.01908428966999054, 0.05721485614776611, 0.050029732286930084, 0.015596275217831135, 0.06451402604579926, 0.010863219387829304, -0.0017808361444622278, -0.0005349042476154864, -0.04094378650188446, 0.05835535004734993, -0.021498339250683784, 0.02528098225593567, -0.025661148130893707, -0.015387184917926788, 0.03573552519083023, -0.013828507624566555, 0.0034595029428601265, -0.05455369874835014, -0.01446528360247612, -0.009513633325695992, 0.05656857416033745, 0.04200825095176697, -0.015168589539825916, -0.04238841310143471, 0.0015254126628860831, -0.02461569383740425, -0.02697271667420864, -0.0033169409725815058, 0.01856156438589096, -0.024672718718647957, -0.005222518928349018, -0.009437600150704384, 0.0097274761646986, -0.09625781327486038, 0.008230575360357761, -0.022752884775400162, -0.005878303665667772, -0.003699482185766101, 0.026896683499217033, 0.005293799564242363, 0.04117188602685928, -0.020034704357385635, -0.036267753690481186, -0.0580512173473835, 0.0639057606458664, -0.01519710198044777, 0.022410735487937927, 0.02193553000688553, -0.031629741191864014, 0.054857831448316574, -0.050637997686862946, 0.0003970943798776716, 0.012136772274971008, 0.06120659038424492, -0.04223634675145149, 0.02254379354417324, -0.02989998832345009, -0.02706775814294815, 0.00421745702624321, 0.025471065193414688, 0.02028181031346321, 0.008943385444581509, 0.04292064532637596, -0.0019626026041805744, 0.07550080120563507, 0.02176445536315441, 0.044517338275909424, -0.0201867688447237, -0.03640081360936165, -0.03069833666086197, -0.01696486957371235, 0.025509081780910492, 0.05672064051032066, 0.025547098368406296, 0.040107421576976776, -0.023266106843948364, 0.03337850049138069, 0.00024280078650917858, 0.004127168096601963, 0.02058594301342964, -0.04569585248827934, 0.012241317890584469, 0.026896683499217033, -0.020319826900959015, 0.06576856970787048, 0.00481146527454257, -0.03227601945400238, 0.05345122143626213, -0.023171065375208855, -0.029367757961153984, -0.05649254098534584, -0.007522517815232277, -0.019540488719940186, -0.02087106741964817, -0.02862643636763096, 0.026649577543139458, -0.011842144653201103, -0.01905577816069126, -0.02568015642464161, -0.03332147374749184, 0.061168573796749115, 0.018666109070181847, -0.010901235975325108, -0.005013427697122097, 0.034480977803468704, -0.004523965064436197, -0.04497353732585907, 0.0008939821273088455, 0.011576028540730476, -0.00671941926702857, -0.02569916471838951, 0.022486768662929535, -0.015814870595932007, 0.08432062715291977, -0.025623131543397903, 0.014883466064929962, -0.06021815910935402, -0.01465536653995514, 0.031268585473299026, 0.0413239523768425, -0.03299833461642265, 0.027314865961670876, 0.02393139712512493, -0.025338007137179375, -0.051322296261787415, -0.0329793281853199, 0.042464446276426315, 0.04383304342627525, -0.008168798871338367, -0.025128915905952454, -0.012079747393727303, -0.007598550990223885, 0.015966936945915222, -0.007056815549731255, -0.009865285828709602, -0.06082642450928688, -0.031648747622966766, 0.058811549097299576, 0.056834690272808075, 0.043300811201334, -0.016404125839471817, 0.05272890627384186, -0.06869584321975708, -0.026554536074399948, -0.002670660149306059, 0.00504194013774395, 0.023969411849975586, -0.1250743418931961, 0.01792478747665882, 0.02744792401790619, 0.015577266924083233, 0.03041321225464344, 0.07983468472957611, -0.045011553913354874, 0.027599990367889404, -0.013324788771569729, 0.01402809377759695, 0.023589247837662697, -0.03569750860333443, -0.013895036652684212, -0.006182435899972916, 0.01588139869272709, -0.0236082561314106, 0.02596527896821499, -0.0018687492702156305, 0.03816857933998108, -0.07641319185495377, 0.03347354009747505, -0.00475919246673584, -0.016195034608244896, -0.08470079302787781, 0.0378834567964077, -0.02087106741964817, -0.04546775296330452, -0.005526650696992874, -0.06512229144573212, 0.038814861327409744, 0.007907435297966003, 0.0003397726104594767, 0.004649894777685404, -0.03277023509144783, -0.01604297012090683, -0.055352047085762024, 0.02991899661719799, -0.015225614421069622, -0.048280972987413406, 0.02638346143066883, -0.01520660612732172, -0.10203632712364197, -0.04995369911193848, -0.059191714972257614, 0.023266106843948364, 0.02560412324965, -0.03870081156492233, -0.035773541778326035, -0.028873542323708534, 0.021403297781944275, 0.027714040130376816, 0.005507642403244972, 0.048775188624858856, 0.03554544225335121, 0.023741314187645912, -0.03332147374749184, -0.025128915905952454, -0.04056362062692642, -0.027733048424124718, -0.04805287346243858, -0.01342933438718319, -0.006695658899843693, 0.04105783626437187, -0.006329749710857868, -0.01465536653995514, -0.046304114162921906, 0.0462280809879303, 0.020319826900959015, -0.0777057558298111, 0.04162808507680893, -0.0007235017837956548, -0.03305536136031151, 0.01764916628599167, -0.006196692120283842, -0.018409498035907745, 0.03752230107784271, -0.008268591947853565, 0.05797518417239189, -0.01854255609214306, 0.08880657702684402, -0.02843635343015194, 0.021498339250683784, -0.06801154464483261, 0.011652061715722084, -0.014702887274324894, 0.02902560867369175, -0.037446267902851105, -0.012317351065576077, 0.023171065375208855, 0.029291724786162376, 0.007874170318245888, 0.036971062421798706, -0.021479330956935883, 0.0462660975754261, 0.015320655889809132, -0.012925615534186363, -0.0055694193579256535, -0.01421817671507597, -0.03976527601480484, -0.01844751462340355, -0.023760322481393814, -0.01476941630244255, 0.07808592170476913, -0.008605988696217537, 0.06170080229640007, -0.06858178973197937, -0.0295388326048851, -0.014398755505681038, 0.03168676421046257, -0.03565949201583862, -0.030755361542105675, -0.0590396486222744, -0.00029774653376080096, -0.02520494908094406, 0.018856192007660866, 0.004008366260677576, -0.018380984663963318, -0.031648747622966766, 0.015083052217960358, 0.021327264606952667, -0.0029629122000187635, 0.03343552350997925, 0.0029106393922120333, 0.03176279738545418, -0.002941527869552374, 0.02735288254916668, -0.03602064773440361, 0.04888923838734627, 0.0027015486266463995, 0.06219501793384552, -0.03335949033498764, -0.0369330458343029, -0.015054539777338505, 0.025623131543397903, -0.004771072417497635, -0.0110628055408597, -0.06637683510780334, -0.03552643209695816, -0.026402469724416733, -0.007707848213613033, -0.018076853826642036, -0.0009076442802324891, -0.07230741530656815, -0.012317351065576077, 0.03799750655889511, 0.05291898921132088, -0.03189585730433464, -0.0013555263867601752, -0.025433048605918884, -0.03227601945400238, 0.06995038688182831, -0.041285935789346695, -0.021099165081977844, -0.0040226224809885025, 0.015083052217960358, 0.027638006955385208, 0.015026027336716652, -0.021308256313204765, -0.047672711312770844, -0.04991568252444267, -0.07854212075471878, 0.033112384378910065, -0.06763137876987457, -0.040791720151901245, 0.02393139712512493, -0.03387271612882614, 0.02628841996192932, 0.05379336699843407, 0.10294872522354126, -0.020528918132185936, -0.022714868187904358, -0.011851648800075054, -0.019844621419906616, 0.017487596720457077, -0.0014066110597923398, -0.029861971735954285, 0.04516362026333809, 0.05481981486082077, -0.002386724343523383, -0.021916521713137627, -0.008216319605708122, -0.03286527842283249, -0.0035070234443992376, -0.09314046055078506, 0.00035699884756468236, -0.004485948942601681, -0.017297513782978058, -0.009480368345975876, -0.025927262380719185, 0.01667974516749382, 0.018380984663963318, -0.0015860014827921987, 0.03465205430984497, 0.08013881742954254, 0.015178093686699867, -0.025357015430927277, 0.04782477766275406, 0.025128915905952454, 0.07816195487976074, -0.005602683871984482, -0.006324997637420893, 0.008477683179080486, -0.01828594319522381, -0.004196072928607464, -0.042350396513938904, 0.005835535004734993, -0.015567762777209282, -0.01934090256690979, -0.009884294122457504, 0.010910740122199059, -0.005692973267287016, -0.028588419780135155, 0.04691237956285477, -0.044821470975875854, -0.013258259743452072, 0.01988263800740242, -0.04101981967687607, 0.03845370560884476, 0.0349181704223156, 0.026991724967956543, -0.01825743168592453, 0.04398510977625847, 0.05539006367325783, 0.039917342364788055, -0.020319826900959015, -0.03446197137236595, 0.019093794748187065, 0.025147924199700356, 0.004374275449663401, 0.03258015215396881, 0.002452065236866474, 0.01214627642184496, -0.01289710309356451, 0.005726237781345844, -0.020129743963479996, 0.01814338192343712, 0.033131394535303116, 0.024919826537370682, -0.0036400812678039074, -0.043947093188762665, 0.052614856511354446, -0.02452065236866474, 0.0027870857156813145, -0.0056787170469760895, 0.0157578457146883, 0.031135525554418564, 0.04185618460178375, -0.04793882369995117, -0.0030674575828015804, 0.059115681797266006, 0.022296685725450516, -0.007741112727671862, 0.018875200301408768, 0.007864666171371937, -0.04299667850136757, 0.0006967714289203286, 0.0017677679425105453, -0.007389460224658251, 0.015605779364705086, 0.04341486096382141, 0.025433048605918884, 0.03535535931587219, -0.025566106662154198, 0.0540974996984005, 0.004516837187111378, 0.01009338442236185, -0.03946114331483841, 0.01854255609214306, -0.007451237179338932, -0.08097517490386963, 0.006553096696734428, 0.01903676986694336, -0.054667748510837555, -0.008453922346234322, -0.012564457952976227, 0.0041628084145486355, -0.02735288254916668, 0.011233880184590816, -0.011281400918960571, 0.018200406804680824, -0.04124791920185089, -0.034480977803468704, 0.03307436779141426, -0.047482628375291824, 0.004687911365181208, 0.09488922357559204, -0.01806734874844551, 0.031933873891830444, -0.0796826183795929, 0.0035735524725168943, 0.013201234862208366, -0.01347685419023037, -0.07253550738096237, 0.011823136359453201, 0.05637849122285843, -0.025338007137179375, -0.023247098550200462, 0.027504948899149895, 0.0006047001807019114, -0.00930454209446907, 0.013961564749479294, 0.010977269150316715, -0.006239460315555334, -0.004649894777685404, -0.05656857416033745, 0.0482049398124218, -0.010464046150445938, -0.013990077190101147, -0.004885122179985046, 0.017278505489230156, 0.04166610166430473, 0.00398698216304183, 0.013448341749608517, -0.03157271444797516, 0.019065281376242638, -0.030052054673433304, -0.03622973710298538, -0.015919415280222893, 0.059115681797266006, -0.048661138862371445, 0.03976527601480484, -0.004257849883288145, -0.11237681657075882, 0.003699482185766101, -0.004880370106548071, 0.0018200406339019537, 0.01421817671507597, 0.013049168512225151, -0.03356858342885971, 0.008929128758609295, -0.00994131900370121, -0.0359065979719162, 0.027504948899149895, 0.006928510032594204, 0.035944614559412, -0.02077602595090866, 0.016071481630206108, 0.0036139448639005423, -0.028379328548908234, -0.0043243784457445145, 0.018228918313980103, 0.025128915905952454, 0.0590776652097702, -0.0699123740196228, 0.06021815910935402, -0.009893798269331455, 0.05618840828537941 ]
31,990
pingouin.nonparametric
cochran
Cochran Q test. A special case of the Friedman test when the dependent variable is binary. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Both wide and long-format dataframe are supported for this test. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within-subject factor (only required if ``data`` is in long format). Two or more within-factor are not currently supported. subject : string Name of column containing the subject/rater identifier (only required if ``data`` is in long format). Returns ------- stats : :py:class:`pandas.DataFrame` * ``'Q'``: The Cochran Q statistic * ``'p-unc'``: Uncorrected p-value * ``'dof'``: degrees of freedom Notes ----- The Cochran Q test [1]_ is a non-parametric test for ANOVA with repeated measures where the dependent variable is binary. The Q statistics is defined as: .. math:: Q = \frac{(r-1)(r\sum_j^rx_j^2-N^2)}{rN-\sum_i^nx_i^2} where :math:`N` is the total sum of all observations, :math:`j=1,...,r` where :math:`r` is the number of repeated measures, :math:`i=1,...,n` where :math:`n` is the number of observations per condition. The p-value is then approximated using a chi-square distribution with :math:`r-1` degrees of freedom: .. math:: Q \sim \chi^2(r-1) Data are expected to be in long-format. Missing values are automatically removed using a strict listwise approach (= complete-case analysis). In other words, any subject with one or more missing value(s) is completely removed from the dataframe prior to running the test. References ---------- .. [1] Cochran, W.G., 1950. The comparison of percentages in matched samples. Biometrika 37, 256–266. https://doi.org/10.1093/biomet/37.3-4.256 Examples -------- Compute the Cochran Q test for repeated measurements. >>> from pingouin import cochran, read_dataset >>> df = read_dataset('cochran') >>> cochran(data=df, dv='Energetic', within='Time', subject='Subject') Source dof Q p-unc cochran Time 2 6.705882 0.034981 Same but using a wide-format dataframe >>> df_wide = df.pivot_table(index="Subject", columns="Time", values="Energetic") >>> cochran(df_wide) Source dof Q p-unc cochran Within 2 6.705882 0.034981
def cochran(data=None, dv=None, within=None, subject=None): """Cochran Q test. A special case of the Friedman test when the dependent variable is binary. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Both wide and long-format dataframe are supported for this test. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within-subject factor (only required if ``data`` is in long format). Two or more within-factor are not currently supported. subject : string Name of column containing the subject/rater identifier (only required if ``data`` is in long format). Returns ------- stats : :py:class:`pandas.DataFrame` * ``'Q'``: The Cochran Q statistic * ``'p-unc'``: Uncorrected p-value * ``'dof'``: degrees of freedom Notes ----- The Cochran Q test [1]_ is a non-parametric test for ANOVA with repeated measures where the dependent variable is binary. The Q statistics is defined as: .. math:: Q = \\frac{(r-1)(r\\sum_j^rx_j^2-N^2)}{rN-\\sum_i^nx_i^2} where :math:`N` is the total sum of all observations, :math:`j=1,...,r` where :math:`r` is the number of repeated measures, :math:`i=1,...,n` where :math:`n` is the number of observations per condition. The p-value is then approximated using a chi-square distribution with :math:`r-1` degrees of freedom: .. math:: Q \\sim \\chi^2(r-1) Data are expected to be in long-format. Missing values are automatically removed using a strict listwise approach (= complete-case analysis). In other words, any subject with one or more missing value(s) is completely removed from the dataframe prior to running the test. References ---------- .. [1] Cochran, W.G., 1950. The comparison of percentages in matched samples. Biometrika 37, 256–266. https://doi.org/10.1093/biomet/37.3-4.256 Examples -------- Compute the Cochran Q test for repeated measurements. >>> from pingouin import cochran, read_dataset >>> df = read_dataset('cochran') >>> cochran(data=df, dv='Energetic', within='Time', subject='Subject') Source dof Q p-unc cochran Time 2 6.705882 0.034981 Same but using a wide-format dataframe >>> df_wide = df.pivot_table(index="Subject", columns="Time", values="Energetic") >>> cochran(df_wide) Source dof Q p-unc cochran Within 2 6.705882 0.034981 """ # Convert from wide to long-format, if needed if all([v is None for v in [dv, within, subject]]): assert isinstance(data, pd.DataFrame) data = data._get_numeric_data().dropna() # Listwise deletion of missing values assert data.shape[0] > 2, "Data must have at least 3 non-missing rows." assert data.shape[1] > 1, "Data must contain at least two columns." data["Subj"] = np.arange(data.shape[0]) data = data.melt(id_vars="Subj", var_name="Within", value_name="DV") subject, within, dv = "Subj", "Within", "DV" # Check data data = _check_dataframe(dv=dv, within=within, data=data, subject=subject, effects="within") assert not data[within].isnull().any(), "Cannot have missing values in `within`." assert not data[subject].isnull().any(), "Cannot have missing values in `subject`." # Pivot and melt the table. This has several effects: # 1) Force missing values to be explicit (a NaN cell is created) # 2) Automatic collapsing to the mean if multiple within factors are present # 3) If using dropna, remove rows with missing values (listwise deletion). # The latter is the same behavior as JASP (= strict complete-case analysis). data_piv = data.pivot_table(index=subject, columns=within, values=dv, observed=True) data_piv = data_piv.dropna() data = data_piv.melt(ignore_index=False, value_name=dv).reset_index() # Groupby and extract size grp = data.groupby(within, observed=True)[dv] grp_s = data.groupby(subject, observed=True)[dv] k = data[within].nunique() dof = k - 1 # n = grp.count().unique()[0] # Q statistic and p-value q = (dof * (k * np.sum(grp.sum() ** 2) - grp.sum().sum() ** 2)) / ( k * grp.sum().sum() - np.sum(grp_s.sum() ** 2) ) p_unc = scipy.stats.chi2.sf(q, dof) # Create output dataframe stats = pd.DataFrame({"Source": within, "dof": dof, "Q": q, "p-unc": p_unc}, index=["cochran"]) return _postprocess_dataframe(stats)
(data=None, dv=None, within=None, subject=None)
[ -0.01862603984773159, 0.032714542001485825, 0.027756450697779655, -0.05493740737438202, 0.017807068303227425, 0.011742262169718742, 0.02107188291847706, -0.04482201859354973, 0.059320006519556046, -0.03258173540234566, -0.02286476269364357, 0.030279764905571938, 0.007060851436108351, 0.05887731909751892, -0.058434631675481796, 0.03592401742935181, 0.03495010733604431, -0.008826063945889473, 0.005165599286556244, 0.010436336509883404, -0.033444974571466446, 0.014652926474809647, -0.009977049194276333, 0.06219746917486191, -0.03373271971940994, 0.0517500638961792, -0.044600676745176315, -0.06666859984397888, 0.004000780172646046, -0.002513629850000143, -0.016080591827630997, 0.01701023243367672, -0.07662905007600784, 0.0016379404114559293, -0.0008120532729662955, 0.007071918807923794, 0.01454225555062294, -0.051528722047805786, -0.01364581473171711, 0.06241881102323532, -0.008117766119539738, -0.02751297317445278, 0.023108240216970444, -0.020086904987692833, -0.00717705674469471, 0.02266555465757847, -0.0019492044812068343, 0.04665916785597801, -0.009019739925861359, -0.025675823912024498, 0.034839436411857605, -0.05498167872428894, -0.013922493904829025, -0.02691534534096718, -0.035724811255931854, -0.004902753978967667, -0.03426394239068031, 0.03669872134923935, 0.07366304844617844, -0.023528793826699257, 0.037650495767593384, 0.05794767662882805, 0.003082205541431904, -0.006529627367854118, -0.022931165993213654, -0.0315856896340847, 0.045463915914297104, 0.006717769429087639, 0.03862440586090088, -0.04066076502203941, -0.018360426649451256, 0.06759824603796005, 0.023174643516540527, 0.0065240939147770405, 0.023108240216970444, -0.022931165993213654, -0.03154142200946808, -0.08388911187648773, -0.029372256249189377, -0.003671532031148672, 0.07724881172180176, -0.013037120923399925, 0.003466789610683918, -0.06219746917486191, -0.024037882685661316, -0.009357288479804993, 0.04927102103829384, -0.0008424879633821547, 0.052945319563150406, 0.01772959902882576, 0.004399198107421398, -0.03320149704813957, 0.06742116808891296, -0.0442686602473259, 0.02214539796113968, -0.019898762926459312, -0.026450524106621742, 0.018515367060899734, -0.018825247883796692, 0.004047815687954426, -0.006573895923793316, 0.08105591684579849, 0.03627816587686539, 0.0355256013572216, -0.01738651655614376, 0.0446670800447464, -0.031120868399739265, 0.013358068652451038, -0.007780217099934816, -0.07530099153518677, -0.09269857406616211, 0.003879041410982609, -0.026007838547229767, -0.051307376474142075, 0.052369825541973114, -0.03700860217213631, -0.07096266001462936, 0.0333564355969429, -0.09526615589857101, 0.01629086770117283, 0.05971842259168625, 0.04294060170650482, 0.0075422730296850204, -0.03939910978078842, -0.01231775525957346, -0.024569107219576836, 0.003721334272995591, 0.010026851668953896, -0.01427664328366518, -0.02870822697877884, 0.051174573600292206, 0.007027649786323309, 0.018725642934441566, 0.016545411199331284, 0.009794441051781178, 0.03970899060368538, 0.06343699246644974, -0.01739758439362049, -0.01579284481704235, -0.04214376583695412, 0.07685039192438126, 0.006490892264991999, -0.053299468010663986, -0.03138647973537445, 0.05321092903614044, 0.039111360907554626, 0.042453646659851074, -0.03789397329092026, -0.028331942856311798, -0.012826844118535519, 0.009396023117005825, -0.03528212383389473, 0.015405493788421154, -0.028110599145293236, 0.052546899765729904, -0.05232555791735649, 0.04541964456439018, -0.041191987693309784, -0.026826808229088783, -0.002782008610665798, 0.005126864183694124, 0.036588046699762344, -0.06157770752906799, 0.061090752482414246, -0.014509053900837898, -0.004216589964926243, -0.031054465100169182, -0.08769621700048447, -0.03880148008465767, -0.07981639355421066, -0.0032399126794189215, 0.015527232550084591, -0.023263180628418922, 0.016711419448256493, -0.031629957258701324, -0.032869480550289154, -0.06219746917486191, 0.0065130265429615974, -0.009019739925861359, -0.09677129238843918, -0.010613411664962769, -0.012384157627820969, -0.025233136489987373, 0.018482165411114693, -0.019433941692113876, 0.003381018992513418, 0.035193584859371185, -0.01948927715420723, 0.04508763179183006, -0.02000943385064602, -0.05387496203184128, -0.040173809975385666, -0.01241735927760601, 0.027933524921536446, 0.016943829134106636, -0.06113502010703087, 0.02217859961092472, -0.0064078886061906815, -0.00585453025996685, -0.033400703221559525, 0.0013667949242517352, 0.02266555465757847, 0.038380928337574005, -0.02625131607055664, -0.03437461704015732, -0.015206284821033478, -0.029173048213124275, 0.03585761412978172, 0.0047505805268883705, 0.01019285898655653, 0.0289295706897974, -0.023639464750885963, 0.0022936700843274593, 0.01632406935095787, -0.04473348334431648, -0.03450741991400719, 0.02961573377251625, -0.09269857406616211, 0.01506241224706173, -0.002025291323661804, 0.06857215613126755, 0.009838709607720375, 0.0023296382278203964, 0.03869080916047096, -0.0036770657170563936, -0.018847381696105003, 0.01249482948333025, 0.07720454782247543, 0.0016891261329874396, -0.08982111513614655, 0.014497986063361168, 0.005182200111448765, 0.035901885479688644, -0.07007729262113571, -0.07800137996673584, -0.0032620469573885202, -0.020629195496439934, 0.025078196078538895, -0.022444210946559906, 0.01757465861737728, -0.010226060636341572, -0.03603468835353851, 0.04021807760000229, 0.015560434199869633, -0.003165209200233221, -0.06082513928413391, 0.007996026426553726, 0.04807576537132263, 0.0018053313251584768, -0.021702710539102554, -0.022444210946559906, -0.09880764782428741, -0.05515875294804573, -0.0336441807448864, 0.0008231204119510949, -0.005226468667387962, 0.0333564355969429, 0.02662760019302368, 0.04190028831362724, -0.009329620748758316, -0.00849958322942257, -0.010779418982565403, 0.029726406559348106, 0.03461809456348419, -0.06773105263710022, -0.004501569550484419, -0.0773373544216156, -0.02910664491355419, -0.017309047281742096, -0.021769113838672638, -0.022056860849261284, 0.020352516323328018, 0.012439494021236897, -0.009473493322730064, -0.04750027507543564, 0.019400740042328835, -0.031275808811187744, 0.019622083753347397, 0.00015079013246577233, -0.01828295737504959, -0.0019602717366069555, -0.006363620050251484, 0.023816538974642754, -0.05927573889493942, -0.029018107801675797, -0.012550164945423603, -0.02906237542629242, -0.00029310694662854075, 0.03523785248398781, 0.0006315201171673834, -0.06883776932954788, -0.08030334860086441, -0.022411009296774864, 0.03450741991400719, 0.05657535046339035, 0.0019768723286688328, -0.009069541469216347, -0.025388076901435852, 0.04046155512332916, 0.061931855976581573, -0.02270982228219509, -0.016423672437667847, -0.01823868788778782, 0.01789560541510582, -0.0706527829170227, 0.04621648043394089, 0.016534345224499702, -0.0344410166144371, -0.0019671886693686247, -0.06325991451740265, 0.008471914567053318, 0.03244892880320549, -0.003939910791814327, 0.0005917474627494812, 0.019777024164795876, -0.042453646659851074, -0.024037882685661316, -0.041191987693309784, 0.050776153802871704, 0.01577071100473404, -0.028619689866900444, -0.039111360907554626, 0.0946463942527771, -0.02642839029431343, 0.011100366711616516, 0.008222904056310654, -0.019577816128730774, 0.01595885306596756, 0.01753038913011551, -0.012483762577176094, -0.0044130319729447365, 0.01915726251900196, 0.03193983808159828, 0.0028663957491517067, 0.01964421756565571, 0.02443630062043667, 0.027003882452845573, -0.004235957283526659, 0.0028165935073047876, 0.006136743351817131, 0.06569468975067139, 0.02288689836859703, -0.008914601989090443, -0.02780071832239628, -0.03585761412978172, -0.03207264468073845, -0.005113030318170786, 0.007165989372879267, 0.03576907888054848, 0.0070940530858933926, -0.02448057010769844, 0.020695598796010017, 0.04803149774670601, 0.0032426794059574604, 0.04021807760000229, 0.02165844291448593, 0.03528212383389473, -0.05073188617825508, 0.016390472650527954, 0.0014318145113065839, 0.07919663190841675, 0.06472077965736389, 0.02662760019302368, -0.022931165993213654, -0.019931964576244354, -0.03171849623322487, -0.01596991904079914, 0.046172212809324265, -0.010419735684990883, 0.01611379347741604, 0.006983381230384111, -0.013490874320268631, -0.014309844933450222, 0.005871131084859371, 0.03143075108528137, 0.0007525672554038465, -0.02782285399734974, -0.011105900630354881, -0.02214539796113968, -0.04807576537132263, 0.026893211528658867, -0.011941471137106419, -0.07795710861682892, 0.006286149844527245, -0.04063862934708595, -0.0641452893614769, -0.05692949891090393, 0.06303857266902924, -0.00859365426003933, 0.009003139100968838, -0.015870314091444016, -0.020640263333916664, 0.03793824091553688, 0.003959278576076031, -0.004728446248918772, 0.038048915565013885, 0.009147011674940586, -0.02481258474290371, -0.048606988042593, 0.04170107841491699, 0.0015660038916394114, -0.004208289552479982, -0.012505896389484406, 0.0023047372233122587, 0.02428136020898819, -0.009003139100968838, 0.022477412596344948, -0.05232555791735649, 0.006037138868123293, 0.021868718788027763, -0.024901121854782104, 0.04526470601558685, 0.0109952287748456, 0.054140571504831314, -0.08782902359962463, -0.039598315954208374, -0.00021529094374272972, -0.06029391661286354, 0.062108930200338364, 0.04108131676912308, 0.07043144106864929, -0.06401248276233673, 0.008621321991086006, 0.029859211295843124, 0.05405203625559807, 0.03986392915248871, -0.00966716930270195, 0.0025551316794008017, 0.005777060054242611, 0.0008293457212857902, -0.025299539789557457, 0.018205486238002777, -0.02658333070576191, 0.015826046466827393, -0.001581221236847341, 0.02963786944746971, -0.04984651133418083, 0.060028303414583206, 0.0048142168670892715, 0.061799049377441406, -0.0010264795273542404, 0.016788890585303307, -0.00775254936888814, -0.04922674968838692, -0.07463696599006653, 0.0623745433986187, 0.03461809456348419, -0.045463915914297104, -0.08003773540258408, -0.05728364735841751, 0.07862114161252975, 0.016589680686593056, -0.010547008365392685, 0.012815777212381363, -0.039775390177965164, 0.023373853415250778, 0.0120521429926157, 0.01985449530184269, -0.0686606913805008, -0.02197938971221447, 0.01753038913011551, 0.0336441807448864, -0.02216753177344799, 0.02662760019302368, -0.030567510053515434, 0.10341159254312515, 0.025299539789557457, -0.0054422784596681595, -0.00843871384859085, 0.000760867609642446, 0.027955658733844757, 0.04395877942442894, -0.07277768105268478, 0.010452937334775925, 0.05383069068193436, 0.013789688237011433, -0.08955550193786621, 0.009683769196271896, -0.021038681268692017, 0.033400703221559525, 0.03459595888853073, 0.03769476339221001, 0.050776153802871704, 0.00032423334778286517, 0.04305127263069153, -0.061799049377441406, 0.002394657814875245, 0.028796764090657234, -0.015139882452785969, -0.0018108648946508765, 0.003773903241381049, 0.04077143594622612, 0.015206284821033478, 0.0189359188079834, -0.019954098388552666, 0.026649734005331993, 0.018227621912956238, -0.010829221457242966, 0.017807068303227425, -0.012406292371451855, 0.05989549681544304, 0.013236329890787601, -0.08096738159656525, 0.009346220642328262, -0.009396023117005825, -0.022599151358008385, 0.012428426183760166, 0.02180231548845768, -0.01823868788778782, 0.0005647712969221175, 0.008792863227427006, -0.03576907888054848, 0.037141405045986176, -0.0219904575496912, 0.051130302250385284, -0.004952556453645229, -0.023108240216970444, 0.03683152422308922, -0.007376265712082386, 0.01650114357471466, 0.017286911606788635, 0.01561577059328556, 0.03293588384985924, 0.053476542234420776, -0.004664810374379158, 0.05462752655148506, 0.017131971195340157, 0.031475018709897995, 0.014055299572646618, -0.000018621802155394107, -0.051528722047805786, -0.040705032646656036, 0.0033644181676208973, 0.07180377095937729, 0.018327224999666214, -0.0010638312669470906, -0.024901121854782104, -0.01647900976240635, 0.04586233198642731, 0.040705032646656036, -0.03450741991400719, 0.00877072848379612, 0.06250734627246857, -0.01009878795593977, 0.015438695438206196, 0.0038181720301508904, 0.039244167506694794, -0.01967741921544075, 0.051130302250385284, 0.02483471855521202, -0.02288689836859703, -0.07144962251186371, 0.036588046699762344, 0.06264015287160873, 0.0050881290808320045, 0.05480460077524185, 0.031120868399739265, 0.01667821779847145, 0.021381763741374016, -0.009927247650921345, 0.005552950315177441, -0.025631554424762726, 0.04267498850822449, -0.046172212809324265, 0.025631554424762726, 0.014022097922861576, 0.04869552701711655, 0.030965927988290787, -0.02201259136199951, -0.05245836451649666, -0.02766791358590126, 0.05980696156620979, -0.019887695088982582, 0.019245799630880356, -0.01615806110203266, -0.014863203279674053, -0.03390979394316673, -0.03842519596219063, 0.00669563515111804, 0.022300338372588158, -0.028132734820246696, -0.020330382511019707, -0.00535650784149766, 0.014387315139174461, -0.023285316303372383, 0.0013702533906325698, -0.016700351610779762, 0.018360426649451256, -0.014730396680533886, -0.004952556453645229, -0.048828333616256714, -0.007708280812948942, -0.03813745081424713, -0.02057386003434658, 0.03331216797232628, 0.012638702988624573, 0.006358086597174406, -0.035038646310567856, 0.05777060240507126, -0.02284262888133526, -0.024856852367520332, -0.01580391265451908, -0.03470662981271744, -0.003862440586090088, -0.014188106171786785, 0.01197467278689146, 0.008754127658903599, 0.0020695598796010017, 0.01611379347741604, -0.029372256249189377, 0.019090859219431877, 0.004324494861066341, -0.013634747825562954, 0.011941471137106419, 0.00416678749024868, -0.06396821141242981, -0.07751442492008209, -0.07038716971874237, -0.020507456734776497, 0.007846619933843613, -0.019068725407123566, 0.010624478571116924, 0.008195236325263977, 0.027225226163864136, -0.023329583927989006, 0.030899524688720703, 0.008665590547025204, -0.05533582717180252, -0.06343699246644974, -0.015372292138636112, 0.04980224370956421, 0.046526361256837845, 0.04380384087562561, 0.013037120923399925, -0.03776116669178009, -0.015394426882266998, -0.011100366711616516, 0.03751768916845322, -0.012516964226961136, 0.044954825192689896, 0.0006647215923294425, 0.01632406935095787, 0.03789397329092026, 0.01038100104779005, 0.006147810257971287, -0.01686635985970497, -0.023285316303372383, -0.09473493695259094, -0.052945319563150406, -0.03559200465679169, 0.020795203745365143, 0.03065604716539383, 0.009744638577103615, 0.02301970310509205, 0.011642658151686192, -0.03047897294163704, 0.02357306145131588, 0.046703435480594635, 0.039421241730451584, -0.005671922117471695, 0.03576907888054848, 0.02414855547249317, 0.011908269487321377, -0.05374215543270111, 0.04276352748274803, 0.02111615054309368, 0.09588591754436493, 0.009163612499833107, -0.06724409759044647, 0.010674281045794487, 0.028243405744433403, 0.05604412406682968, -0.053299468010663986, -0.049979317933321, 0.009268750436604023, 0.0006903144530951977, -0.03355564549565315, 0.010176258161664009, -0.038181718438863754, -0.015471897087991238, 0.04305127263069153, 0.030456839129328728, 0.0057161906734108925, 0.03632243722677231, 0.07769150286912918, -0.015128814615309238, 0.02766791358590126, -0.08021481335163116, -0.03421967476606369, -0.058611705899238586, -0.010746217332780361, 0.03213904798030853, -0.011697993613779545, -0.01948927715420723, 0.03399833291769028, 0.010796019807457924, -0.06241881102323532, -0.007996026426553726, -0.005677455570548773, -0.001438731444068253, 0.036410972476005554, -0.01383395679295063, 0.0920788124203682, 0.02286476269364357, -0.036588046699762344, 0.05285678058862686, 0.02232247218489647, 0.03399833291769028, 0.08052469789981842, -0.02465764433145523, 0.006618164945393801, 0.026184912770986557, -0.0482085719704628, 0.018537500873208046, -0.02713668905198574, 0.02589716576039791, -0.02372800186276436, 0.07760296016931534, -0.006894844118505716, -0.02002050168812275, 0.06538481265306473, 0.021580971777439117, 0.028265539556741714, -0.005118563771247864, 0.027734316885471344, 0.007558873854577541, 0.052015677094459534, 0.017984144389629364, 0.04090424254536629, -0.04108131676912308, 0.02731376327574253, 0.011321710422635078, 0.000043555348383961245, -0.02959359996020794, -0.011205504648387432, -0.01629086770117283, -0.007204724475741386, -0.027690047398209572, -0.019400740042328835, 0.02301970310509205, -0.017829203978180885, 0.03579121083021164, 0.028597554191946983, -0.04572952538728714, 0.05728364735841751, 0.02910664491355419, -0.0026146178133785725, -0.0025717325042933226, 0.06861642748117447, -0.07844406366348267, -0.005196033976972103, -0.05303385481238365, -0.003879041410982609, -0.02979280799627304, -0.04367103427648544, 0.05644254386425018, -0.011587321758270264, -0.01490747183561325, -0.01615806110203266, -0.013612613081932068, -0.03860227391123772, -0.01454225555062294, 0.05020065978169441, 0.05998403578996658, 0.025476614013314247, 0.04187815263867378, 0.017486121505498886, 0.03523785248398781 ]
31,991
pingouin.effsize
compute_bootci
Bootstrapped confidence intervals of univariate and bivariate functions. Parameters ---------- x : 1D-array or list First sample. Required for both bivariate and univariate functions. y : 1D-array, list, or None Second sample. Required only for bivariate functions. func : str or custom function Function to compute the bootstrapped statistic. Accepted string values are: * ``'pearson'``: Pearson correlation (bivariate, paired x and y) * ``'spearman'``: Spearman correlation (bivariate, paired x and y) * ``'cohen'``: Cohen d effect size (bivariate, paired or unpaired x and y) * ``'hedges'``: Hedges g effect size (bivariate, paired or unpaired x and y) * ``'mean'``: Mean (univariate = only x) * ``'std'``: Standard deviation (univariate) * ``'var'``: Variance (univariate) method : str Method to compute the confidence intervals (see Notes): * ``'cper'``: Bias-corrected percentile method (default) * ``'norm'``: Normal approximation with bootstrapped bias and standard error * ``'per'``: Simple percentile paired : boolean Indicates whether x and y are paired or not. For example, for correlation functions or paired T-test, x and y are assumed to be paired. Pingouin will resample the pairs (x_i, y_i) when paired=True, and resample x and y separately when paired=False. If paired=True, x and y must have the same number of elements. confidence : float Confidence level (0.95 = 95%) n_boot : int Number of bootstrap iterations. The higher, the better, the slower. decimals : int Number of rounded decimals. seed : int or None Random seed for generating bootstrap samples. return_dist : boolean If True, return the confidence intervals and the bootstrapped distribution (e.g. for plotting purposes). Returns ------- ci : array Bootstrapped confidence intervals. Notes ----- Results have been tested against the `bootci <https://www.mathworks.com/help/stats/bootci.html>`_ Matlab function. Since version 1.7, SciPy also includes a built-in bootstrap function :py:func:`scipy.stats.bootstrap`. The SciPy implementation has two advantages over Pingouin: it is faster when using ``vectorized=True``, and it supports the bias-corrected and accelerated (BCa) confidence intervals for univariate functions. However, unlike Pingouin, it does not return the bootstrap distribution. The percentile bootstrap method (``per``) is defined as the :math:`100 \times \frac{\alpha}{2}` and :math:`100 \times \frac{1 - \alpha}{2}` percentiles of the distribution of :math:`\theta` estimates obtained from resampling, where :math:`\alpha` is the level of significance (1 - confidence, default = 0.05 for 95% CIs). The bias-corrected percentile method (``cper``) corrects for bias of the bootstrap distribution. This method is different from the BCa method — the default in Matlab and SciPy — which corrects for both bias and skewness of the bootstrap distribution using jackknife resampling. The normal approximation method (``norm``) calculates the confidence intervals with the standard normal distribution using bootstrapped bias and standard error. References ---------- * DiCiccio, T. J., & Efron, B. (1996). Bootstrap confidence intervals. Statistical science, 189-212. * Davison, A. C., & Hinkley, D. V. (1997). Bootstrap methods and their application (Vol. 1). Cambridge university press. * Jung, Lee, Gupta, & Cho (2019). Comparison of bootstrap confidence interval methods for GSCA using a Monte Carlo simulation. Frontiers in psychology, 10, 2215. Examples -------- 1. Bootstrapped 95% confidence interval of a Pearson correlation >>> import pingouin as pg >>> import numpy as np >>> rng = np.random.default_rng(42) >>> x = rng.normal(loc=4, scale=2, size=100) >>> y = rng.normal(loc=3, scale=1, size=100) >>> stat = np.corrcoef(x, y)[0][1] >>> ci = pg.compute_bootci(x, y, func='pearson', paired=True, seed=42, decimals=4) >>> print(round(stat, 4), ci) 0.0945 [-0.098 0.2738] Let's compare to SciPy's built-in bootstrap function >>> from scipy.stats import bootstrap >>> bt_scipy = bootstrap( ... data=(x, y), statistic=lambda x, y: np.corrcoef(x, y)[0][1], ... method="basic", vectorized=False, n_resamples=2000, paired=True, random_state=42) >>> np.round(bt_scipy.confidence_interval, 4) array([-0.0952, 0.2883]) 2. Bootstrapped 95% confidence interval of a Cohen d >>> stat = pg.compute_effsize(x, y, eftype='cohen') >>> ci = pg.compute_bootci(x, y, func='cohen', seed=42, decimals=3) >>> print(round(stat, 4), ci) 0.7009 [0.403 1.009] 3. Bootstrapped confidence interval of a standard deviation (univariate) >>> import numpy as np >>> stat = np.std(x, ddof=1) >>> ci = pg.compute_bootci(x, func='std', seed=123) >>> print(round(stat, 4), ci) 1.5534 [1.38 1.8 ] Compare to SciPy's built-in bootstrap function, which returns the bias-corrected and accelerated CIs (see Notes). >>> def std(x, axis): ... return np.std(x, ddof=1, axis=axis) >>> bt_scipy = bootstrap(data=(x, ), statistic=std, n_resamples=2000, random_state=123) >>> np.round(bt_scipy.confidence_interval, 2) array([1.39, 1.81]) Changing the confidence intervals type in Pingouin >>> pg.compute_bootci(x, func='std', seed=123, method="norm") array([1.37, 1.76]) >>> pg.compute_bootci(x, func='std', seed=123, method="percentile") array([1.35, 1.75]) 4. Bootstrapped confidence interval using a custom univariate function >>> from scipy.stats import skew >>> round(skew(x), 4), pg.compute_bootci(x, func=skew, n_boot=10000, seed=123) (-0.137, array([-0.55, 0.32])) 5. Bootstrapped confidence interval using a custom bivariate function. Here, x and y are not paired and can therefore have different sizes. >>> def mean_diff(x, y): ... return np.mean(x) - np.mean(y) >>> y2 = rng.normal(loc=3, scale=1, size=200) # y2 has 200 samples, x has 100 >>> ci = pg.compute_bootci(x, y2, func=mean_diff, n_boot=10000, seed=123) >>> print(round(mean_diff(x, y2), 2), ci) 0.88 [0.54 1.21] We can also get the bootstrapped distribution >>> ci, bt = pg.compute_bootci(x, y2, func=mean_diff, n_boot=10000, return_dist=True, seed=9) >>> print(f"The bootstrap distribution has {bt.size} samples. The mean and standard " ... f"{bt.mean():.4f} ± {bt.std():.4f}") The bootstrap distribution has 10000 samples. The mean and standard 0.8807 ± 0.1704
def compute_bootci( x, y=None, func=None, method="cper", paired=False, confidence=0.95, n_boot=2000, decimals=2, seed=None, return_dist=False, ): """Bootstrapped confidence intervals of univariate and bivariate functions. Parameters ---------- x : 1D-array or list First sample. Required for both bivariate and univariate functions. y : 1D-array, list, or None Second sample. Required only for bivariate functions. func : str or custom function Function to compute the bootstrapped statistic. Accepted string values are: * ``'pearson'``: Pearson correlation (bivariate, paired x and y) * ``'spearman'``: Spearman correlation (bivariate, paired x and y) * ``'cohen'``: Cohen d effect size (bivariate, paired or unpaired x and y) * ``'hedges'``: Hedges g effect size (bivariate, paired or unpaired x and y) * ``'mean'``: Mean (univariate = only x) * ``'std'``: Standard deviation (univariate) * ``'var'``: Variance (univariate) method : str Method to compute the confidence intervals (see Notes): * ``'cper'``: Bias-corrected percentile method (default) * ``'norm'``: Normal approximation with bootstrapped bias and standard error * ``'per'``: Simple percentile paired : boolean Indicates whether x and y are paired or not. For example, for correlation functions or paired T-test, x and y are assumed to be paired. Pingouin will resample the pairs (x_i, y_i) when paired=True, and resample x and y separately when paired=False. If paired=True, x and y must have the same number of elements. confidence : float Confidence level (0.95 = 95%) n_boot : int Number of bootstrap iterations. The higher, the better, the slower. decimals : int Number of rounded decimals. seed : int or None Random seed for generating bootstrap samples. return_dist : boolean If True, return the confidence intervals and the bootstrapped distribution (e.g. for plotting purposes). Returns ------- ci : array Bootstrapped confidence intervals. Notes ----- Results have been tested against the `bootci <https://www.mathworks.com/help/stats/bootci.html>`_ Matlab function. Since version 1.7, SciPy also includes a built-in bootstrap function :py:func:`scipy.stats.bootstrap`. The SciPy implementation has two advantages over Pingouin: it is faster when using ``vectorized=True``, and it supports the bias-corrected and accelerated (BCa) confidence intervals for univariate functions. However, unlike Pingouin, it does not return the bootstrap distribution. The percentile bootstrap method (``per``) is defined as the :math:`100 \\times \\frac{\\alpha}{2}` and :math:`100 \\times \\frac{1 - \\alpha}{2}` percentiles of the distribution of :math:`\\theta` estimates obtained from resampling, where :math:`\\alpha` is the level of significance (1 - confidence, default = 0.05 for 95% CIs). The bias-corrected percentile method (``cper``) corrects for bias of the bootstrap distribution. This method is different from the BCa method — the default in Matlab and SciPy — which corrects for both bias and skewness of the bootstrap distribution using jackknife resampling. The normal approximation method (``norm``) calculates the confidence intervals with the standard normal distribution using bootstrapped bias and standard error. References ---------- * DiCiccio, T. J., & Efron, B. (1996). Bootstrap confidence intervals. Statistical science, 189-212. * Davison, A. C., & Hinkley, D. V. (1997). Bootstrap methods and their application (Vol. 1). Cambridge university press. * Jung, Lee, Gupta, & Cho (2019). Comparison of bootstrap confidence interval methods for GSCA using a Monte Carlo simulation. Frontiers in psychology, 10, 2215. Examples -------- 1. Bootstrapped 95% confidence interval of a Pearson correlation >>> import pingouin as pg >>> import numpy as np >>> rng = np.random.default_rng(42) >>> x = rng.normal(loc=4, scale=2, size=100) >>> y = rng.normal(loc=3, scale=1, size=100) >>> stat = np.corrcoef(x, y)[0][1] >>> ci = pg.compute_bootci(x, y, func='pearson', paired=True, seed=42, decimals=4) >>> print(round(stat, 4), ci) 0.0945 [-0.098 0.2738] Let's compare to SciPy's built-in bootstrap function >>> from scipy.stats import bootstrap >>> bt_scipy = bootstrap( ... data=(x, y), statistic=lambda x, y: np.corrcoef(x, y)[0][1], ... method="basic", vectorized=False, n_resamples=2000, paired=True, random_state=42) >>> np.round(bt_scipy.confidence_interval, 4) array([-0.0952, 0.2883]) 2. Bootstrapped 95% confidence interval of a Cohen d >>> stat = pg.compute_effsize(x, y, eftype='cohen') >>> ci = pg.compute_bootci(x, y, func='cohen', seed=42, decimals=3) >>> print(round(stat, 4), ci) 0.7009 [0.403 1.009] 3. Bootstrapped confidence interval of a standard deviation (univariate) >>> import numpy as np >>> stat = np.std(x, ddof=1) >>> ci = pg.compute_bootci(x, func='std', seed=123) >>> print(round(stat, 4), ci) 1.5534 [1.38 1.8 ] Compare to SciPy's built-in bootstrap function, which returns the bias-corrected and accelerated CIs (see Notes). >>> def std(x, axis): ... return np.std(x, ddof=1, axis=axis) >>> bt_scipy = bootstrap(data=(x, ), statistic=std, n_resamples=2000, random_state=123) >>> np.round(bt_scipy.confidence_interval, 2) array([1.39, 1.81]) Changing the confidence intervals type in Pingouin >>> pg.compute_bootci(x, func='std', seed=123, method="norm") array([1.37, 1.76]) >>> pg.compute_bootci(x, func='std', seed=123, method="percentile") array([1.35, 1.75]) 4. Bootstrapped confidence interval using a custom univariate function >>> from scipy.stats import skew >>> round(skew(x), 4), pg.compute_bootci(x, func=skew, n_boot=10000, seed=123) (-0.137, array([-0.55, 0.32])) 5. Bootstrapped confidence interval using a custom bivariate function. Here, x and y are not paired and can therefore have different sizes. >>> def mean_diff(x, y): ... return np.mean(x) - np.mean(y) >>> y2 = rng.normal(loc=3, scale=1, size=200) # y2 has 200 samples, x has 100 >>> ci = pg.compute_bootci(x, y2, func=mean_diff, n_boot=10000, seed=123) >>> print(round(mean_diff(x, y2), 2), ci) 0.88 [0.54 1.21] We can also get the bootstrapped distribution >>> ci, bt = pg.compute_bootci(x, y2, func=mean_diff, n_boot=10000, return_dist=True, seed=9) >>> print(f"The bootstrap distribution has {bt.size} samples. The mean and standard " ... f"{bt.mean():.4f} ± {bt.std():.4f}") The bootstrap distribution has 10000 samples. The mean and standard 0.8807 ± 0.1704 """ from inspect import isfunction, isroutine from scipy.stats import norm # Check other arguments assert isinstance(confidence, float) assert 0 < confidence < 1, "confidence must be between 0 and 1." assert method in ["norm", "normal", "percentile", "per", "cpercentile", "cper"] assert isfunction(func) or isinstance(func, str) or isroutine(func), ( "func must be a function (e.g. np.mean, custom function) or a string (e.g. 'pearson'). " "See documentation for more details." ) vectorizable = False # Check x x = np.asarray(x) nx = x.size assert x.ndim == 1, "x must be one-dimensional." assert nx > 1, "x must have more than one element." # Check y if y is not None: y = np.asarray(y) ny = y.size assert y.ndim == 1, "y must be one-dimensional." assert ny > 1, "y must have more than one element." if paired: assert nx == ny, "x and y must have the same number of elements when paired=True." # Check string functions if isinstance(func, str): func_str = "%s" % func
(x, y=None, func=None, method='cper', paired=False, confidence=0.95, n_boot=2000, decimals=2, seed=None, return_dist=False)
[ 0.016469132155179977, -0.043263990432024, 0.04734625667333603, -0.002909113187342882, 0.025654226541519165, -0.05302940681576729, -0.025874348357319832, -0.016689253970980644, 0.028775956481695175, 0.011506380513310432, -0.030476899817585945, -0.00014406426635105163, 0.053629741072654724, 0.0011350044514983892, -0.03231792151927948, 0.04186321422457695, 0.03023676760494709, 0.0010837259469553828, -0.017079470679163933, -0.011596431024372578, 0.03678039461374283, 0.020811541005969048, -0.01747969351708889, 0.019160624593496323, 0.011556408368051052, 0.009220113046467304, -0.029616422951221466, -0.03365866467356682, 0.04470479115843773, -0.014848234131932259, -0.02513393759727478, -0.018120048567652702, 0.004384931642562151, -0.05330956354737282, 0.021672017872333527, -0.022512484341859818, 0.10125614702701569, 0.008119502104818821, -0.0052529131062328815, -0.02787545695900917, -0.010030562058091164, -0.058272313326597214, -0.04774647578597069, -0.010795986279845238, 0.022072238847613335, 0.040202293545007706, 0.0027690355200320482, 0.03846132755279541, -0.06451577693223953, 0.0332784540951252, 0.01777985878288746, -0.048066653311252594, 0.04686598852276802, -0.031517475843429565, 0.0029566395096480846, 0.053629741072654724, -0.00921510998159647, -0.013477473519742489, -0.017029443755745888, -0.051748696714639664, 0.05711166933178902, 0.03393882140517235, -0.005272923968732357, 0.04254359006881714, 0.03125733137130737, 0.03668034076690674, -0.05463029444217682, 0.010876030661165714, -0.016098927706480026, 0.006588653661310673, 0.04614558815956116, -0.007459136191755533, -0.03521953150629997, 0.023673128336668015, -0.006473589688539505, 0.024613648653030396, 0.001017439179122448, -0.042463548481464386, 0.00954529270529747, -0.013997762463986874, -0.04250356927514076, 0.03177762031555176, -0.010235675610601902, -0.006073367781937122, 0.05170867592096329, 0.005272923968732357, -0.03467923030257225, 0.018840447068214417, 0.01567869447171688, 0.04394437000155449, -0.07780314236879349, 0.01644912175834179, 0.07636234164237976, 0.058632515370845795, 0.04054248332977295, 0.032658111304044724, 0.027175068855285645, 0.057511892169713974, 0.05547076091170311, -0.0010906048119068146, 0.008184538222849369, -0.03764087334275246, 0.054670315235853195, 0.012717052362859249, -0.029896577820181847, 0.011436342261731625, -0.03714059665799141, 0.05959304794669151, -0.03289824351668358, -0.045225080102682114, -0.026534713804721832, -0.04282374680042267, -0.030176734551787376, -0.055030517280101776, -0.039661992341279984, -0.03692047297954559, 0.0014520551776513457, 0.09525281935930252, -0.019500814378261566, -0.022852672263979912, 0.0078093307092785835, -0.028936045244336128, -0.020931607112288475, -0.05062807351350784, 0.012627001851797104, -0.01388770155608654, -0.010375753976404667, 0.03563976287841797, -0.006153412163257599, 0.057231735438108444, 0.018860459327697754, -0.03858139365911484, -0.06287486851215363, -0.000508719589561224, 0.02475372701883316, -0.073640838265419, 0.0078093307092785835, 0.005728176329284906, 0.0160589050501585, 0.0182501208037138, 0.043704234063625336, -0.00793940294533968, 0.02145189605653286, -0.008249574340879917, 0.026674792170524597, 0.01841020956635475, 0.1045379713177681, -0.05663140490651131, 0.04206332564353943, 0.03531958535313606, 0.017899926751852036, -0.011516386643052101, -0.019130608066916466, -0.04222341254353523, -0.015408544801175594, -0.05190878361463547, 0.048146698623895645, -0.05659138038754463, -0.00586325116455555, -0.09077033400535583, -0.03423898667097092, -0.004372424446046352, 0.01101610902696848, -0.038221195340156555, 0.009960523806512356, 0.055230628699064255, -0.0615941546857357, 0.060433510690927505, 0.058432403951883316, -0.0510282963514328, -0.04878705367445946, -0.00526792136952281, -0.0075141666457057, 0.00042586115887388587, -0.02183210663497448, -0.0022462455090135336, -0.026714814826846123, -0.04526510089635849, -0.0065486314706504345, -0.016679249703884125, 0.033438540995121, -0.010475808754563332, -0.0150283332914114, 0.00623845960944891, -0.05923284590244293, 0.024253448471426964, 0.01882043667137623, 0.010575864464044571, 0.006853800732642412, 0.017039448022842407, -0.021191751584410667, -0.03259807825088501, 0.01738964393734932, 0.07724283635616302, 0.027575291693210602, 0.034359052777290344, 0.0003827122272923589, 0.012336840853095055, 0.024613648653030396, -0.03754081577062607, 0.025914371013641357, -0.004555026069283485, 0.032638099044561386, -0.02919618971645832, 0.03155750036239624, -0.016769299283623695, -0.056751471012830734, -0.011516386643052101, 0.008154521696269512, -0.05030789598822594, 0.012576973997056484, -0.0027715368196368217, 0.0017234557308256626, 0.00642856489866972, 0.03307834267616272, 0.0074991583824157715, 0.1045379713177681, -0.05158860608935356, -0.007163972593843937, 0.01246691308915615, 0.047386277467012405, -0.0004758888971991837, 0.025354059413075447, 0.07436123490333557, -0.03886155039072037, 0.058832623064517975, 0.015368522144854069, 0.010906048119068146, 0.10093597322702408, -0.023212872445583344, 0.015998871996998787, -0.007028897758573294, 0.029076123610138893, -0.07456135004758835, 0.007454133592545986, -0.06227453425526619, 0.0019823492038995028, 0.005978315137326717, -0.028976067900657654, 0.0003808361943811178, 0.015088367275893688, 0.04630567878484726, 0.02219230681657791, 0.012036674655973911, 0.022852672263979912, -0.05559082701802254, -0.0030016645323485136, 0.018480248749256134, -0.013197318650782108, -0.028275679796934128, -0.0018935500411316752, -0.03692047297954559, 0.04278372600674629, -0.02515394799411297, 0.029056113213300705, -0.052869316190481186, 0.02795550227165222, 0.01929069682955742, 0.035199519246816635, 0.06983872503042221, 0.03159752115607262, -0.005748187657445669, -0.05727175995707512, 0.026114480569958687, -0.06723728775978088, 0.019410764798521996, -0.026674792170524597, 0.01995106413960457, 0.019810985773801804, 0.044664766639471054, 0.006813778541982174, 0.013907711952924728, -0.03053693287074566, 0.01105613075196743, -0.04094270244240761, 0.00017994354129768908, -0.00921510998159647, -0.022252339869737625, 0.051748696714639664, -0.03379874303936958, 0.02087157405912876, -0.024073349311947823, -0.062234509736299515, 0.028575846925377846, 0.028976067900657654, -0.06403551250696182, -0.05839237943291664, -0.02011115290224552, 0.037560828030109406, 0.019590863958001137, -0.00788937509059906, -0.01929069682955742, 0.00022793890093453228, -0.00715896999463439, 0.002288769232109189, 0.02683488093316555, 0.01691938191652298, -0.038141150027513504, 0.02693493664264679, -0.03347856551408768, 0.012917162850499153, -0.002002360299229622, 0.0008711080299690366, -0.011506380513310432, 0.009170085191726685, -0.024633660912513733, 0.0696786418557167, -0.05727175995707512, -0.06623672693967819, 0.048907119780778885, 0.011116163805127144, 0.0018110042437911034, 0.04318394511938095, -0.01889047585427761, -0.04334403574466705, -0.05435013771057129, 0.0576319582760334, 0.022912705317139626, 0.006733734160661697, 0.03163754567503929, -0.02229236252605915, -0.038221195340156555, 0.05242907255887985, 0.08196545392274857, 0.054950471967458725, 0.049187276512384415, 0.05190878361463547, 0.027935491874814034, 0.004177316557615995, 0.022852672263979912, -0.02013116329908371, -0.008744848892092705, 0.015188422054052353, 0.032738152891397476, -0.006683706305921078, 0.04016227275133133, -0.034739263355731964, -0.04726621136069298, 0.030356833711266518, -0.05971311405301094, 0.026974959298968315, -0.015048344619572163, -0.06267475336790085, -0.00892494898289442, -0.005387987941503525, -0.022632550448179245, 0.05603107064962387, 0.02967645600438118, -0.04066254943609238, 0.03089713305234909, 0.05619116127490997, 0.007454133592545986, -0.001012436463497579, 0.061394043266773224, 0.01383767370134592, -0.0006409804336726665, -0.013007213361561298, -0.018160071223974228, 0.0691983699798584, -0.01043578702956438, -0.0046875993721187115, -0.005938292946666479, 0.010405770502984524, -0.034899353981018066, 0.012016663327813148, 0.03790101781487465, -0.066877081990242, 0.04750634357333183, -0.02845577895641327, -0.01653917133808136, 0.012787090614438057, -0.044264547526836395, -0.060993824154138565, -0.009230118244886398, 0.010375753976404667, -0.03503942862153053, -0.0444246344268322, -0.051748696714639664, 0.0018097535939887166, 0.027715368196368217, -0.045585278421640396, -0.06287486851215363, -0.022332383319735527, 0.003304332261905074, -0.03986210376024246, 0.0029441325459629297, 0.03688045218586922, -0.054750360548496246, 0.002794049447402358, -0.016769299283623695, 0.00040928946691565216, -0.01426791213452816, -0.0023775685112923384, 0.02863587997853756, -0.029976623132824898, 0.015528610907495022, 0.08796878159046173, 0.008434677496552467, 0.04622563347220421, -0.013877695426344872, -0.02351303957402706, 0.028415758162736893, 0.049187276512384415, 0.0014858238864690065, 0.016839338466525078, -0.062234509736299515, -0.02589435875415802, 0.014878250658512115, -0.03573982045054436, 0.014628111384809017, -0.03630013018846512, 0.027835436165332794, -0.02211226150393486, -0.03976204991340637, 0.007329064421355724, 0.030316811054944992, -0.045785389840602875, 0.024173405021429062, -0.01871037483215332, -0.07800325751304626, 0.04222341254353523, -0.06351522356271744, 0.034078896045684814, 0.027055002748966217, 0.032558053731918335, 0.02097162976861, 0.017999982461333275, -0.04374425858259201, 0.008314610458910465, -0.028275679796934128, 0.009004993364214897, -0.024613648653030396, -0.10846014320850372, -0.015668688341975212, -0.014187867753207684, -0.022512484341859818, -0.021892139688134193, 0.048707008361816406, 0.04666587710380554, -0.022852672263979912, -0.04778650030493736, 0.04906721040606499, 0.03341853246092796, -0.0028866007924079895, -0.03193771094083786, 0.02371314913034439, -0.02597440406680107, -0.004034737590700388, -0.003394382307305932, -0.023212872445583344, 0.02901609055697918, -0.05927287042140961, 0.06799770891666412, 0.061754245311021805, -0.023092806339263916, -0.01918063685297966, -0.03894159570336342, -0.015898816287517548, 0.00921510998159647, -0.007469141855835915, -0.04582541063427925, -0.018860459327697754, -0.020711485296487808, -0.012106713838875294, 0.01909058541059494, -0.0010593374026939273, 0.0033243433572351933, 0.0033843766432255507, 0.037100572139024734, 0.018870463594794273, 0.0006062737083993852, 0.004920228384435177, 0.003809612477198243, 0.029916590079665184, 0.0683579072356224, 0.02711503580212593, -0.042943812906742096, -0.012827113270759583, 0.027075013145804405, -0.003234293544664979, -0.05971311405301094, 0.002355055883526802, -0.017059460282325745, 0.025954391807317734, -0.008464694023132324, -0.12606990337371826, -0.010475808754563332, -0.02701498009264469, 0.008689818903803825, -0.04254359006881714, -0.04358416795730591, 0.09493264555931091, 0.037180617451667786, 0.02439352683722973, -0.06559637188911438, 0.007028897758573294, 0.015608655288815498, -0.017159515991806984, 0.05130845308303833, -0.036520250141620636, 0.040122248232364655, 0.04262363538146019, 0.008339624851942062, -0.03183765336871147, -0.04090268164873123, -0.014197872951626778, -0.04346410185098648, -0.01909058541059494, -0.008894932456314564, 0.020441334694623947, 0.01175651978701353, -0.021491918712854385, 0.0391417071223259, 0.006468587089329958, -0.04450467973947525, -0.01251694094389677, 0.026294581592082977, 0.015758737921714783, 0.018009986728429794, -0.004192324820905924, 0.03864142671227455, 0.01607891544699669, 0.01284712366759777, 0.028095580637454987, 0.05318949371576309, 0.0417831689119339, 0.06411555409431458, -0.04642574489116669, -0.028315702453255653, 0.07224006205797195, -0.024313483387231827, -0.020171185955405235, 0.020011097192764282, 0.011966635473072529, -0.021972185000777245, 0.0034794295206665993, -0.04642574489116669, -0.013397429138422012, 0.021311817690730095, -0.04866698756814003, -0.020751507952809334, -0.0018372688209638, 0.07896378636360168, 0.05270922929048538, -0.0005768823903053999, 0.039441872388124466, -0.07087930291891098, -0.01294717937707901, -0.05791211500763893, 0.0023863231763243675, 0.03551969677209854, -0.01862032525241375, 0.022652560845017433, 0.024513592943549156, -0.03984209522604942, -0.07123950123786926, 0.015158405527472496, -0.01633905991911888, -0.03778095170855522, 0.021792083978652954, -0.03097717836499214, 0.030456889420747757, 0.057311780750751495, -0.06007331237196922, -0.013787645846605301, 0.060153357684612274, 0.04202330484986305, 0.04394437000155449, -0.0019773466046899557, -0.055430736392736435, -0.0019198146183043718, 0.08740846812725067, -0.010415775701403618, -0.017879914492368698, -0.032738152891397476, 0.0614340677857399, 0.03589990735054016, -0.03531958535313606, -0.05130845308303833, -0.020081136375665665, 0.01440798956900835, -0.03299829736351967, 0.042943812906742096, -0.03487934172153473, -0.017649786546826363, -0.016779305413365364, -0.06731732934713364, 0.014177861623466015, -0.06763751059770584, 0.020551396533846855, -0.031117254868149757, 0.012647013179957867, -0.03299829736351967, -0.035759828984737396, 0.014728167094290257, 0.017999982461333275, 0.015898816287517548, -0.008554743602871895, -0.004284875933080912, -0.0719999298453331, 0.02475372701883316, 0.02723510190844536, 0.011826558038592339, 0.05859249085187912, 0.009570307098329067, 0.023653116077184677, -0.024993859231472015, -0.060993824154138565, -0.01043578702956438, 0.01841020956635475, 0.0068037728779017925, -0.01507836114615202, -0.008484705351293087, -0.025734269991517067, 0.00616341782733798, -0.008809885010123253, -0.011336286552250385, -0.013787645846605301, 0.032097797840833664, -0.024233438074588776, 0.013037229888141155, -0.0018372688209638, 0.02855583466589451, 0.06359526515007019, -0.040302347391843796, -0.007123950403183699, -0.03167756646871567, -0.001348247635178268, 0.029236212372779846, -0.004022230394184589, 0.0319577232003212, 0.025274015963077545, 0.07620225846767426, -0.06295491009950638, 0.02477373741567135, 0.06891822069883347, 0.061754245311021805, 0.004444964695721865, -0.012887146323919296, 0.06303495168685913, 0.031617533415555954, -0.061834290623664856, 0.055030517280101776, 0.02495383843779564, 0.01247691921889782, -0.06491599977016449, -0.02465367130935192, 0.04206332564353943, 0.019830996170639992, -0.020551396533846855, -0.003977205604314804, -0.07472143322229385, -0.02957640029489994, -0.0019523326773196459, -0.03760085254907608, -0.05527064949274063, 0.024833770468831062, 0.047946587204933167, 0.006623673252761364, -0.01576874405145645, -0.02949635684490204, 0.025213981047272682, -0.05026787519454956, 0.012827113270759583, 0.016949398443102837, -0.01412783470004797, 0.007604216691106558, -0.03183765336871147, -0.019310709089040756, -0.005232901778072119, 0.05511055886745453, 0.0249338261783123, 0.015458572655916214, -0.03950190544128418, -0.014097817242145538, -0.04386432468891144, -0.07191988080739975, 0.006228453945368528, 0.03099718876183033, 0.03882152959704399, 0.07968419045209885, 0.01862032525241375, -0.004312391392886639, -0.02589435875415802, 0.03706055134534836, -0.02787545695900917, 0.07968419045209885, -0.01474817842245102, -0.03696049749851227, 0.00359199196100235, -0.000832336547318846, 0.009805437177419662, 0.027335157617926598, -0.012987202033400536, 0.006268476136028767, -0.018680358305573463, -0.04950745403766632, -0.010575864464044571, 0.0015145898796617985, -0.021631995216012, 0.02965644560754299, 0.007033900357782841, -0.036140039563179016, 0.024593638256192207, -0.030476899817585945, 0.058912668377161026, -0.07232010364532471, -0.009240124374628067, 0.037100572139024734, -0.005042796488851309, 0.008774866349995136, 0.01478820014744997, 0.04022230580449104, -0.06847797334194183, -0.022332383319735527, 0.008759857155382633, -0.03764087334275246, -0.020291252061724663, 0.011976641602814198, 0.06395546346902847, -0.0018772910116240382, 0.016389088705182076, 0.03589990735054016, -0.03559974208474159, -0.03243798762559891, 0.01880042627453804, 0.054670315235853195, 0.006613667588680983, -0.014668134041130543, 0.01062589231878519, 0.00026092593907378614, -0.033398520201444626, -0.033878788352012634, 0.06867808103561401, 0.02022121287882328, -0.03543965145945549, -0.031337376683950424, -0.07059914618730545, -0.016118938103318214, -0.07111943513154984, 0.008514721877872944, -0.08204549551010132, 0.028575846925377846, 0.03846132755279541, -0.04242352396249771, -0.007509164046496153, 0.01579876057803631, -0.02795550227165222, 0.057872090488672256, -0.010896041989326477, -0.0014357961481437087, -0.011496375314891338, -0.01493828371167183, -0.014578084461390972, -0.01053584273904562, 0.0077492971904575825, 0.02391326054930687, 0.008999991230666637, -0.03159752115607262, -0.009030007757246494, 0.04072258248925209, -0.015858793631196022, 0.022552506998181343, 0.018360180780291557, 0.09805437177419662, 0.03223787620663643, -0.026494693011045456, 0.025774292647838593 ]
31,992
pingouin.effsize
compute_effsize
Calculate effect size between two set of observations. Parameters ---------- x : np.array or list First set of observations. y : np.array or list Second set of observations. paired : boolean If True, uses Cohen d-avg formula to correct for repeated measurements (see Notes). eftype : string Desired output effect size. Available methods are: * ``'none'``: no effect size * ``'cohen'``: Unbiased Cohen d * ``'hedges'``: Hedges g * ``'r'``: Pearson correlation coefficient * ``'pointbiserialr'``: Point-biserial correlation * ``'eta-square'``: Eta-square * ``'odds-ratio'``: Odds ratio * ``'AUC'``: Area Under the Curve * ``'CLES'``: Common Language Effect Size Returns ------- ef : float Effect size See Also -------- convert_effsize : Conversion between effect sizes. compute_effsize_from_t : Convert a T-statistic to an effect size. Notes ----- Missing values are automatically removed from the data. If ``x`` and ``y`` are paired, the entire row is removed. If ``x`` and ``y`` are independent, the Cohen :math:`d` is: .. math:: d = \frac{\overline{X} - \overline{Y}} {\sqrt{\frac{(n_{1} - 1)\sigma_{1}^{2} + (n_{2} - 1) \sigma_{2}^{2}}{n1 + n2 - 2}}} If ``x`` and ``y`` are paired, the Cohen :math:`d_{avg}` is computed: .. math:: d_{avg} = \frac{\overline{X} - \overline{Y}} {\sqrt{\frac{(\sigma_1^2 + \sigma_2^2)}{2}}} The Cohen's d is a biased estimate of the population effect size, especially for small samples (n < 20). It is often preferable to use the corrected Hedges :math:`g` instead: .. math:: g = d \times (1 - \frac{3}{4(n_1 + n_2) - 9}) The common language effect size is the proportion of pairs where ``x`` is higher than ``y`` (calculated with a brute-force approach where each observation of ``x`` is paired to each observation of ``y``, see :py:func:`pingouin.wilcoxon` for more details): .. math:: \text{CL} = P(X > Y) + .5 \times P(X = Y) For other effect sizes, Pingouin will first calculate a Cohen :math:`d` and then use the :py:func:`pingouin.convert_effsize` to convert to the desired effect size. References ---------- * Lakens, D., 2013. Calculating and reporting effect sizes to facilitate cumulative science: a practical primer for t-tests and ANOVAs. Front. Psychol. 4, 863. https://doi.org/10.3389/fpsyg.2013.00863 * Cumming, Geoff. Understanding the new statistics: Effect sizes, confidence intervals, and meta-analysis. Routledge, 2013. * https://osf.io/vbdah/ Examples -------- 1. Cohen d from two independent samples. >>> import numpy as np >>> import pingouin as pg >>> x = [1, 2, 3, 4] >>> y = [3, 4, 5, 6, 7] >>> pg.compute_effsize(x, y, paired=False, eftype='cohen') -1.707825127659933 The sign of the Cohen d will be opposite if we reverse the order of ``x`` and ``y``: >>> pg.compute_effsize(y, x, paired=False, eftype='cohen') 1.707825127659933 2. Hedges g from two paired samples. >>> x = [1, 2, 3, 4, 5, 6, 7] >>> y = [1, 3, 5, 7, 9, 11, 13] >>> pg.compute_effsize(x, y, paired=True, eftype='hedges') -0.8222477210374874 3. Common Language Effect Size. >>> pg.compute_effsize(x, y, eftype='cles') 0.2857142857142857 In other words, there are ~29% of pairs where ``x`` is higher than ``y``, which means that there are ~71% of pairs where ``x`` is *lower* than ``y``. This can be easily verified by changing the order of ``x`` and ``y``: >>> pg.compute_effsize(y, x, eftype='cles') 0.7142857142857143
def compute_effsize(x, y, paired=False, eftype="cohen"): """Calculate effect size between two set of observations. Parameters ---------- x : np.array or list First set of observations. y : np.array or list Second set of observations. paired : boolean If True, uses Cohen d-avg formula to correct for repeated measurements (see Notes). eftype : string Desired output effect size. Available methods are: * ``'none'``: no effect size * ``'cohen'``: Unbiased Cohen d * ``'hedges'``: Hedges g * ``'r'``: Pearson correlation coefficient * ``'pointbiserialr'``: Point-biserial correlation * ``'eta-square'``: Eta-square * ``'odds-ratio'``: Odds ratio * ``'AUC'``: Area Under the Curve * ``'CLES'``: Common Language Effect Size Returns ------- ef : float Effect size See Also -------- convert_effsize : Conversion between effect sizes. compute_effsize_from_t : Convert a T-statistic to an effect size. Notes ----- Missing values are automatically removed from the data. If ``x`` and ``y`` are paired, the entire row is removed. If ``x`` and ``y`` are independent, the Cohen :math:`d` is: .. math:: d = \\frac{\\overline{X} - \\overline{Y}} {\\sqrt{\\frac{(n_{1} - 1)\\sigma_{1}^{2} + (n_{2} - 1) \\sigma_{2}^{2}}{n1 + n2 - 2}}} If ``x`` and ``y`` are paired, the Cohen :math:`d_{avg}` is computed: .. math:: d_{avg} = \\frac{\\overline{X} - \\overline{Y}} {\\sqrt{\\frac{(\\sigma_1^2 + \\sigma_2^2)}{2}}} The Cohen's d is a biased estimate of the population effect size, especially for small samples (n < 20). It is often preferable to use the corrected Hedges :math:`g` instead: .. math:: g = d \\times (1 - \\frac{3}{4(n_1 + n_2) - 9}) The common language effect size is the proportion of pairs where ``x`` is higher than ``y`` (calculated with a brute-force approach where each observation of ``x`` is paired to each observation of ``y``, see :py:func:`pingouin.wilcoxon` for more details): .. math:: \\text{CL} = P(X > Y) + .5 \\times P(X = Y) For other effect sizes, Pingouin will first calculate a Cohen :math:`d` and then use the :py:func:`pingouin.convert_effsize` to convert to the desired effect size. References ---------- * Lakens, D., 2013. Calculating and reporting effect sizes to facilitate cumulative science: a practical primer for t-tests and ANOVAs. Front. Psychol. 4, 863. https://doi.org/10.3389/fpsyg.2013.00863 * Cumming, Geoff. Understanding the new statistics: Effect sizes, confidence intervals, and meta-analysis. Routledge, 2013. * https://osf.io/vbdah/ Examples -------- 1. Cohen d from two independent samples. >>> import numpy as np >>> import pingouin as pg >>> x = [1, 2, 3, 4] >>> y = [3, 4, 5, 6, 7] >>> pg.compute_effsize(x, y, paired=False, eftype='cohen') -1.707825127659933 The sign of the Cohen d will be opposite if we reverse the order of ``x`` and ``y``: >>> pg.compute_effsize(y, x, paired=False, eftype='cohen') 1.707825127659933 2. Hedges g from two paired samples. >>> x = [1, 2, 3, 4, 5, 6, 7] >>> y = [1, 3, 5, 7, 9, 11, 13] >>> pg.compute_effsize(x, y, paired=True, eftype='hedges') -0.8222477210374874 3. Common Language Effect Size. >>> pg.compute_effsize(x, y, eftype='cles') 0.2857142857142857 In other words, there are ~29% of pairs where ``x`` is higher than ``y``, which means that there are ~71% of pairs where ``x`` is *lower* than ``y``. This can be easily verified by changing the order of ``x`` and ``y``: >>> pg.compute_effsize(y, x, eftype='cles') 0.7142857142857143 """ # Check arguments if not _check_eftype(eftype): err = f"Could not interpret input '{eftype}'" raise ValueError(err) x = np.asarray(x) y = np.asarray(y) if x.size != y.size and paired: warnings.warn("x and y have unequal sizes. Switching to " "paired == False.") paired = False # Remove rows with missing values x, y = remove_na(x, y, paired=paired) nx, ny = x.size, y.size if ny == 1: # Case 1: One-sample Test d = (x.mean() - y) / x.std(ddof=1) return d if eftype.lower() == "r": # Return correlation coefficient (useful for CI bootstrapping) r, _ = pearsonr(x, y) return r elif eftype.lower() == "cles": # Compute exact CLES (see pingouin.wilcoxon) diff = x[:, None] - y return np.where(diff == 0, 0.5, diff > 0).mean() else: # Compute unbiased Cohen's d effect size if not paired: # https://en.wikipedia.org/wiki/Effect_size dof = nx + ny - 2 poolsd = np.sqrt(((nx - 1) * x.var(ddof=1) + (ny - 1) * y.var(ddof=1)) / dof) d = (x.mean() - y.mean()) / poolsd else: # Report Cohen d-avg (Cumming 2012; Lakens 2013) # Careful, the formula in Lakens 2013 is wrong. Updated in Pingouin # v0.3.4 to use the formula provided by Cummings 2012. # Before that the denominator was just (SD1 + SD2) / 2 d = (x.mean() - y.mean()) / np.sqrt((x.var(ddof=1) + y.var(ddof=1)) / 2) return convert_effsize(d, "cohen", eftype, nx=nx, ny=ny)
(x, y, paired=False, eftype='cohen')
[ -0.03024221956729889, -0.03176877275109291, 0.012532161548733711, -0.0033341736998409033, 0.06960248947143555, 0.0032929156441241503, -0.019958628341555595, 0.022279398515820503, -0.03599772974848747, 0.012006119824945927, 0.02240317314863205, -0.0028648623265326023, 0.012594048865139484, 0.008298044092953205, -0.010809633880853653, 0.010278435423970222, -0.010190761648118496, -0.014440350234508514, 0.04497137665748596, -0.05074751749634743, 0.0021686311811208725, -0.011253158561885357, -0.006178406998515129, -0.05561598017811775, -0.012191781774163246, -0.0005892178742215037, 0.012274297885596752, -0.026302067562937737, 0.018741512671113014, 0.003468262730166316, -0.040928080677986145, -0.004306318704038858, -0.08424913138151169, 0.04270217940211296, 0.027189116925001144, -0.005770983174443245, 0.0425371453166008, 0.02118605747818947, -0.013058202341198921, 0.010288749821484089, -0.10116496682167053, -0.007060300093144178, 0.0920056626200676, 0.03401733934879303, 0.00462091201916337, 0.06456899642944336, -0.06782838702201843, 0.04103122651576996, -0.0505412258207798, -0.029932783916592598, 0.002374921925365925, -0.07529611140489578, 0.02291889861226082, 0.012924114242196083, 0.050665002316236496, 0.043197277933359146, 0.045383960008621216, 0.009685349650681019, -0.01274876669049263, -0.01916440762579441, 0.06192847341299057, 0.02912824973464012, 0.04125814512372017, -0.03900957480072975, -0.06465151160955429, 0.020340265706181526, 0.0009605411905795336, 0.010175289586186409, -0.03294462710618973, 0.008272257633507252, 0.006745706778019667, 0.01557494979351759, 0.02949957363307476, -0.0012332317419350147, 0.04699302837252617, -0.00795766431838274, 0.03999977186322212, -0.02473425678908825, 0.06258860230445862, -0.004778208676725626, 0.008200055919587612, 0.03160373866558075, 0.029169507324695587, -0.030592914670705795, 0.029169507324695587, -0.004999971482902765, 0.03129430115222931, 0.04381614923477173, -0.004138707648962736, -0.01388336531817913, 0.002124794526025653, 0.00480657396838069, 0.0458790585398674, -0.014223745092749596, 0.00871578324586153, 0.0021686311811208725, -0.04583779722452164, -0.0379987508058548, 0.056771207600831985, -0.004574496764689684, 0.00795766431838274, 0.026363953948020935, 0.07570869475603104, 0.016616716980934143, -0.022341284900903702, 0.008839557878673077, 0.00731816329061985, 0.014718842692673206, -0.03674037754535675, -0.005740039516240358, 0.01014434639364481, -0.03267645090818405, -0.027106601744890213, -0.051490165293216705, -0.015182997100055218, -0.07608001679182053, -0.026735277846455574, 0.024940548464655876, -0.03940152749419212, -0.01199580542743206, -0.013491413556039333, -0.0031020967289805412, -0.03199569135904312, -0.02112416923046112, 0.050665002316236496, -0.011954547837376595, 0.0014324311632663012, 0.006900424603372812, -0.017668800428509712, -0.03401733934879303, -0.0016013317508623004, 0.006229979917407036, -0.002631495939567685, 0.05243910104036331, 0.02850937843322754, -0.014574439264833927, -0.012624992057681084, -0.0032619719859212637, 0.10017477720975876, -0.03855573758482933, 0.050582483410835266, 0.040763046592473984, 0.02919013798236847, 0.004917454905807972, -0.018452705815434456, 0.00036971166264265776, 0.06506409496068954, -0.07075771689414978, -0.00863842386752367, 0.0733569785952568, -0.0481482557952404, 0.022671351209282875, 0.03748302534222603, -0.057431336492300034, 0.012315556406974792, -0.0013976196059957147, -0.013274808414280415, -0.038885802030563354, -0.01659608818590641, -0.03917460888624191, -0.038968317210674286, -0.020051458850502968, 0.0389476902782917, 0.01218146737664938, 0.001241612248122692, 0.012119580060243607, 0.011036553420126438, 0.018514592200517654, 0.0030556812416762114, -0.010536299087107182, -0.023558400571346283, -0.03750365227460861, -0.035048794001340866, -0.011820458807051182, 0.048478320240974426, 0.027519183233380318, -0.011119069531559944, -0.061969734728336334, 0.004930348135530949, -0.017978236079216003, 0.03343972563743591, -0.04045360907912254, 0.012655936181545258, 0.023331480100750923, -0.007942193187773228, 0.030118444934487343, 0.05644114315509796, 0.017318105325102806, 0.0379987508058548, 0.0009244402754120529, -0.029582088813185692, -0.08771481364965439, -0.04105185344815254, 0.06716825813055038, 0.045383960008621216, -0.012521847151219845, 0.027869876474142075, -0.010778690688312054, 0.02980900928378105, -0.03240827098488808, -0.060608215630054474, 0.007127344608306885, 0.00665803300216794, -0.010623971931636333, 0.03310966119170189, 0.025600679218769073, 0.029066363349556923, -0.000627897388767451, -0.07393459230661392, 0.00020645189215429127, -0.01908189244568348, -0.01637948304414749, -0.0230014156550169, 0.00010669098264770582, 0.06522912532091141, 0.0019636298529803753, 0.03211946412920952, -0.03876202553510666, -0.038431961089372635, -0.0395459309220314, -0.015471803955733776, 0.0344092920422554, -0.037235476076602936, 0.08837494254112244, 0.01854553632438183, -0.01644137129187584, -0.007658543065190315, 0.07447095215320587, 0.0677458718419075, -0.05417194217443466, -0.007710115984082222, 0.059494245797395706, 0.026962198317050934, 0.008468233980238438, 0.024651741608977318, 0.014646640978753567, -0.004396570846438408, 0.001603910350240767, -0.03071668930351734, 0.009891640394926071, -0.030819833278656006, -0.02399161085486412, 0.010448625311255455, -0.04270217940211296, -0.03900957480072975, -0.047776930034160614, 0.06027814745903015, 0.060154374688863754, -0.053057972341775894, 0.03240827098488808, -0.007359421346336603, -0.06477528810501099, -0.014698213897645473, -0.04806573688983917, -0.010799319483339787, 0.005600793287158012, 0.03626590967178345, -0.001924950280226767, 0.01772037334740162, -0.052232809364795685, 0.022733237594366074, -0.0007639203104190528, 0.04851957783102989, 0.025703823193907738, -0.08441416174173355, -0.0037673842161893845, 0.005863813683390617, -0.004958713427186012, -0.04724057391285896, 0.018081381916999817, -0.020990081131458282, -0.008163955062627792, -0.007034513633698225, -0.03754490986466408, -0.0666731595993042, 0.033522240817546844, 0.035791441798210144, 0.01146976463496685, 0.061515893787145615, 0.04752938076853752, -0.016998356208205223, -0.059700533747673035, -0.02640521340072155, 0.0034992063883692026, -0.023187076672911644, 0.0020139131229370832, -0.03401733934879303, -0.0175656545907259, 0.04290847107768059, 0.03845259174704552, -0.04579653963446617, 0.033460356295108795, -0.02910762093961239, -0.03370790556073189, 0.0006710895104333758, 0.021072598174214363, 0.007715273182839155, -0.02873629704117775, 0.033233433961868286, 0.061227086931467056, -0.03987599536776543, 0.026879681274294853, -0.010572399944067001, -0.031418077647686005, -0.046745479106903076, -0.021000396460294724, 0.13738961517810822, -0.08449667692184448, 0.008736412040889263, 0.0013615187490358949, 0.022898269817233086, 0.04971606284379959, -0.06601303070783615, 0.03294462710618973, 0.025518162176012993, 0.04125814512372017, 0.003305808873847127, 0.02504369430243969, 0.015265513211488724, 0.04497137665748596, 0.02068064548075199, -0.016049418598413467, 0.054213203489780426, 0.04154695197939873, 0.05792643502354622, -0.017245903611183167, 0.005987588316202164, 0.03997914120554924, 0.059164177626371384, -0.037916235625743866, -0.0664256140589714, -0.048767127096652985, 0.01645168475806713, 0.00999478530138731, 0.03422363102436066, -0.027416037395596504, 0.05008738860487938, 0.005399659741669893, 0.010912778787314892, -0.00267920084297657, 0.0020332529675215483, 0.02578634023666382, -0.035028163343667984, 0.025662565603852272, 0.024651741608977318, -0.06795216351747513, 0.0379987508058548, -0.06283615529537201, 0.049963612109422684, 0.02028869278728962, 0.0004654434451367706, -0.005894757341593504, 0.05000486969947815, 0.014419721439480782, 0.0069468398578464985, 0.005064437165856361, -0.016018474474549294, -0.08049464225769043, 0.021846188232302666, 0.03810189664363861, -0.02353777177631855, 0.0081845847889781, 0.00961314793676138, 0.01531708613038063, -0.05396565422415733, 0.01758628338575363, -0.02180492877960205, -0.02475488744676113, -0.0436098575592041, 0.0032387643586844206, -0.02118605747818947, -0.007457409519702196, -0.06102079525589943, -0.035048794001340866, 0.03696729615330696, 0.004203173331916332, -0.05755511298775673, 0.021000396460294724, 0.00006535225838888437, 0.043114762753248215, 0.003514678217470646, 0.03773057460784912, -0.12352688610553741, 0.015585264191031456, -0.028921959921717644, 0.014419721439480782, -0.000588895520195365, -0.03376979008316994, -0.011160328052937984, 0.022279398515820503, 0.060525696724653244, -0.02390909567475319, 0.035048794001340866, -0.027787359431385994, -0.03302714601159096, -0.002287248382344842, -0.030737318098545074, 0.03583269938826561, -0.056317366659641266, 0.06461025774478912, 0.0016567723359912634, 0.03531697019934654, 0.07459472864866257, 0.015750296413898468, -0.054502010345458984, -0.060236889868974686, -0.010654916055500507, 0.03568829596042633, -0.01924692466855049, 0.04055675491690636, 0.01033000834286213, 0.014399092644453049, -0.06890109926462173, 0.03915397822856903, -0.046662960201501846, -0.0034734199289232492, -0.0574725940823555, -0.0550796240568161, 0.0146363265812397, 0.02291889861226082, 0.028777556493878365, -0.03717358782887459, 0.02580696903169155, 0.020402152091264725, 0.009128364734351635, -0.012552790343761444, -0.061680927872657776, 0.02972649224102497, -0.0019971521105617285, -0.04633289575576782, -0.019411956891417503, 0.04177387058734894, -0.02166052535176277, -0.023744061589241028, 0.00041483776294626296, -0.011511022225022316, 0.00864358153194189, 0.022444430738687515, 0.03471872955560684, -0.01992768421769142, -0.07381082326173782, 0.03244953230023384, 0.01078900508582592, 0.02782861888408661, -0.025621308013796806, -0.016173193231225014, 0.000011402396921766922, -0.030304107815027237, -0.03455369547009468, -0.03486313298344612, 0.027436666190624237, -0.014440350234508514, 0.048230770975351334, 0.00607010442763567, -0.029623348265886307, -0.022877641022205353, 0.016090676188468933, 0.0037828560452908278, -0.020917879417538643, -0.021062282845377922, -0.03310966119170189, -0.00845276191830635, 0.007519296836107969, -0.023744061589241028, -0.03125304356217384, -0.03861762210726738, 0.01954604685306549, -0.006673505064100027, 0.035110682249069214, 0.014574439264833927, 0.03713233023881912, 0.00804018136113882, -0.0009250849834643304, 0.044765084981918335, 0.04637415334582329, 0.0408661924302578, -0.014409407041966915, 0.04901467636227608, 0.025972001254558563, -0.005770983174443245, 0.08490926027297974, 0.021908074617385864, -0.006993255577981472, -0.021062282845377922, 0.06011311709880829, -0.029829638078808784, -0.003878265619277954, -0.0252706129103899, 0.04177387058734894, 0.006523943971842527, 0.009592518210411072, -0.023929724469780922, 0.00543060339987278, -0.03160373866558075, -0.013274808414280415, -0.02836497500538826, 0.03886517137289047, -0.047034285962581635, -0.020990081131458282, -0.0004718900308944285, 0.019329439848661423, -0.0009863275336101651, -0.005108274053782225, -0.06362006068229675, -0.021247943863272667, 0.02745729498565197, -0.023785321041941643, 0.020546555519104004, -0.016544515267014503, 0.031191157177090645, -0.022279398515820503, -0.009597675874829292, 0.06869480758905411, -0.008849872276186943, 0.05248035863041878, 0.00540997413918376, 0.00020145578309893608, 0.09184063225984573, 0.026982827112078667, -0.014326890930533409, 0.013656445778906345, -0.007178917061537504, 0.01892717368900776, 0.03143870458006859, 0.006395012605935335, 0.029520202428102493, -0.01421343069523573, 0.01467758510261774, 0.023929724469780922, 0.005007707513868809, -0.04699302837252617, -0.003798327874392271, -0.0020113345235586166, 0.030077187344431877, -0.011273788288235664, 0.012913798913359642, -0.0504174530506134, -0.050046131014823914, 0.007560554891824722, -0.007065457291901112, 0.011325360275804996, -0.021062282845377922, 0.016554830595850945, 0.02157801017165184, -0.03636905550956726, 0.020268063992261887, 0.03628653660416603, -0.028777556493878365, 0.020092716440558434, -0.02578634023666382, -0.032325755804777145, 0.0078854626044631, 0.02776673063635826, -0.00011378222552593797, 0.0596180185675621, 0.008138168603181839, 0.053594328463077545, -0.0721604973077774, -0.041980162262916565, 0.010061830282211304, -0.03694666922092438, -0.047034285962581635, 0.03762742877006531, -0.060236889868974686, 0.013986511155962944, 0.03997914120554924, 0.031562481075525284, 0.017153073102235794, -0.07793663442134857, -0.06898361444473267, -0.07773034274578094, 0.1514999121427536, 0.009659563191235065, 0.05309923365712166, -0.020773475989699364, 0.017070557922124863, 0.0043295263312757015, -0.06601303070783615, 0.018989061936736107, -0.02512620948255062, -0.04488886147737503, -0.053511813282966614, 0.011737941764295101, -0.0015458910493180156, -0.0008232289110310376, 0.034347403794527054, -0.0770702138543129, 0.029025103896856308, -0.014925133436918259, 0.0858994573354721, -0.054048169404268265, -0.04583779722452164, -0.057678885757923126, -0.050128646194934845, -0.005523433908820152, 0.030964236706495285, 0.0028803341556340456, 0.005286199972033501, 0.010737432166934013, -0.012480588629841805, -0.026590874418616295, -0.021557381376624107, 0.017297476530075073, -0.018679624423384666, 0.02850937843322754, -0.04868461191654205, 0.05070625990629196, -0.03581206873059273, -0.019195351749658585, -0.10157755017280579, 0.006188721861690283, 0.014698213897645473, -0.02188744582235813, -0.06551793217658997, -0.004404306877404451, -0.009087106212973595, 0.02578634023666382, -0.005234627053141594, 0.027663586661219597, 0.01010824553668499, -0.009659563191235065, 0.04041235148906708, 0.047488123178482056, 0.014326890930533409, 0.016709549352526665, 0.003133040387183428, -0.00807112455368042, -0.02028869278728962, -0.05528591200709343, -0.07711147516965866, 0.000049799869884736836, 0.021928703412413597, 0.041608840227127075, -0.03709107264876366, 0.06238231435418129, 0.001250637462362647, 0.02578634023666382, 0.03634842485189438, -0.020494982600212097, 0.025394387543201447, 0.03478061407804489, 0.014553810469806194, -0.023661546409130096, 0.028942588716745377, -0.03478061407804489, 0.005987588316202164, 0.0163691695779562, -0.03457432612776756, 0.004489401821047068, -0.03750365227460861, 0.0448063462972641, -0.02203184925019741, -0.036389682441949844, -0.030427882447838783, 0.0040690843015909195, -0.012490903027355671, 0.01924692466855049, -0.011686369776725769, -0.041134368628263474, -0.04472382739186287, 0.0552033968269825, 0.03317154943943024, 0.0004190280451439321, 0.03162436932325363, 0.09456367045640945, 0.0016051996499300003, 0.03238764405250549, -0.008370245806872845, 0.0010121138766407967, 0.019803909584879875, 0.0389476902782917, 0.012274297885596752, -0.046209122985601425, -0.01282096840441227, -0.031170528382062912, -0.06003060191869736, 0.009752393700182438, 0.05425446107983589, 0.03197506070137024, 0.03306840360164642, 0.044393762946128845, 0.024342305958271027, 0.03471872955560684, -0.005569849628955126, 0.09918458014726639, -0.021619267761707306, 0.030510397627949715, -0.05718378722667694, -0.030489768832921982, 0.0045074522495269775, -0.028550636023283005, 0.0020422781817615032, -0.02285701222717762, -0.0641564130783081, 0.0011339542688801885, -0.046662960201501846, -0.030654801055788994, 0.012944743037223816, 0.019102521240711212, 0.003785434877499938, -0.0013460469199344516, 0.019814223051071167, -0.010778690688312054, 0.022361913695931435, -0.04501263424754143, 0.05821524187922478, -0.06184595823287964, 0.00239426176995039, 0.012913798913359642, -0.043032243847846985, -0.05219155177474022, 0.0041490220464766026, -0.0043037403374910355, -0.0046879565343260765, -0.005796769168227911, 0.009680191986262798, -0.004796259105205536, 0.00467764213681221, 0.002548979828134179, 0.05693623796105385, 0.0030659958720207214, 0.03401733934879303, 0.030489768832921982, -0.00802986603230238, -0.10091742128133774, -0.007395522203296423, 0.10892149806022644, -0.01210926566272974, 0.005683309398591518, -0.026900310069322586, 0.015059222467243671, -0.0005711674457415938, 0.006900424603372812, 0.0368022657930851, -0.019937997683882713, -0.005239784251898527, -0.012150523252785206, -0.0574725940823555, 0.06753958016633987, -0.05821524187922478, -0.001734131365083158, -0.03568829596042633, -0.007761688437312841, -0.07154162228107452, 0.031046753749251366, 0.03725610300898552, -0.0106033431366086, -0.00807112455368042, 0.024775516241788864, 0.00460286159068346, 0.01007214467972517, 0.023496514186263084, -0.008978803642094135, -0.03839070349931717, 0.0458790585398674, -0.002645678585395217, 0.0016464578220620751, -0.08936513960361481, -0.004368206020444632, 0.021557381376624107, 0.009143835864961147, -0.04398118332028389, 0.03876202553510666, 0.02353777177631855, 0.02624017931520939, 0.04856083542108536, 0.005064437165856361, 0.0408661924302578 ]
31,993
pingouin.effsize
compute_effsize_from_t
Compute effect size from a T-value. Parameters ---------- tval : float T-value nx, ny : int, optional Group sample sizes. N : int, optional Total sample size (will not be used if nx and ny are specified) eftype : string, optional Desired output effect size. Returns ------- ef : float Effect size See Also -------- compute_effsize : Calculate effect size between two set of observations. convert_effsize : Conversion between effect sizes. Notes ----- If both nx and ny are specified, the formula to convert from *t* to *d* is: .. math:: d = t * \sqrt{\frac{1}{n_x} + \frac{1}{n_y}} If only N (total sample size) is specified, the formula is: .. math:: d = \frac{2t}{\sqrt{N}} Examples -------- 1. Compute effect size from a T-value when both sample sizes are known. >>> from pingouin import compute_effsize_from_t >>> tval, nx, ny = 2.90, 35, 25 >>> d = compute_effsize_from_t(tval, nx=nx, ny=ny, eftype='cohen') >>> print(d) 0.7593982580212534 2. Compute effect size when only total sample size is known (nx+ny) >>> tval, N = 2.90, 60 >>> d = compute_effsize_from_t(tval, N=N, eftype='cohen') >>> print(d) 0.7487767802667672
def compute_effsize_from_t(tval, nx=None, ny=None, N=None, eftype="cohen"): """Compute effect size from a T-value. Parameters ---------- tval : float T-value nx, ny : int, optional Group sample sizes. N : int, optional Total sample size (will not be used if nx and ny are specified) eftype : string, optional Desired output effect size. Returns ------- ef : float Effect size See Also -------- compute_effsize : Calculate effect size between two set of observations. convert_effsize : Conversion between effect sizes. Notes ----- If both nx and ny are specified, the formula to convert from *t* to *d* is: .. math:: d = t * \\sqrt{\\frac{1}{n_x} + \\frac{1}{n_y}} If only N (total sample size) is specified, the formula is: .. math:: d = \\frac{2t}{\\sqrt{N}} Examples -------- 1. Compute effect size from a T-value when both sample sizes are known. >>> from pingouin import compute_effsize_from_t >>> tval, nx, ny = 2.90, 35, 25 >>> d = compute_effsize_from_t(tval, nx=nx, ny=ny, eftype='cohen') >>> print(d) 0.7593982580212534 2. Compute effect size when only total sample size is known (nx+ny) >>> tval, N = 2.90, 60 >>> d = compute_effsize_from_t(tval, N=N, eftype='cohen') >>> print(d) 0.7487767802667672 """ if not _check_eftype(eftype): err = f"Could not interpret input '{eftype}'" raise ValueError(err) if not isinstance(tval, float): err = "T-value must be float" raise ValueError(err) # Compute Cohen d (Lakens, 2013) if nx is not None and ny is not None: d = tval * np.sqrt(1 / nx + 1 / ny) elif N is not None: d = 2 * tval / np.sqrt(N) else: raise ValueError("You must specify either nx + ny, or just N") return convert_effsize(d, "cohen", eftype, nx=nx, ny=ny)
(tval, nx=None, ny=None, N=None, eftype='cohen')
[ 0.009035991504788399, 0.006368222646415234, 0.03126739710569382, -0.047044526785612106, 0.058289315551519394, 0.018511829897761345, -0.018272781744599342, -0.034556690603494644, -0.04371698573231697, -0.012784254737198353, 0.021265655755996704, 0.006033556070178747, -0.008514868095517159, -0.008514868095517159, 0.040351200848817825, 0.02459319494664669, -0.05595621466636658, 0.00933241005986929, 0.028016354888677597, -0.025664128363132477, 0.039031658321619034, -0.04130738973617554, -0.027882488444447517, -0.06586233526468277, 0.003143473295494914, -0.03340926393866539, 0.047809477895498276, -0.03132477030158043, 0.021303903311491013, 0.040886666625738144, -0.026295213028788567, -0.0056941090151667595, -0.04723576456308365, 0.018884744495153427, -0.0004075758042745292, -0.03235745429992676, -0.02725140191614628, -0.005751480348408222, 0.03518777713179588, 0.014505395665764809, -0.04302852973341942, 0.011675074696540833, 0.08039642125368118, 0.055267754942178726, 0.0058566611260175705, 0.007042336277663708, 0.006176984403282404, 0.013472710736095905, -0.0823087990283966, -0.008949934504926205, -0.03629695624113083, 0.0029211591463536024, -0.012889435514807701, -0.029259400442242622, -0.00048287573736160994, 0.032892920076847076, 0.02803547866642475, -0.021915864199399948, -0.025874489918351173, 0.012009740807116032, 0.01862657256424427, 0.03675592690706253, 0.03545551002025604, -0.03629695624113083, -0.1211683377623558, 0.012105359695851803, 0.002423940459266305, 0.025797994807362556, -0.023350149393081665, 0.01799548789858818, 0.011923683807253838, -0.0325486920773983, 0.01238265447318554, -0.044826164841651917, 0.07037555426359177, 0.014208977110683918, 0.032931167632341385, -0.0026605974417179823, 0.048612676560878754, 0.025568509474396706, 0.007420030888170004, 0.0366029366850853, 0.05886302888393402, -0.012267911806702614, 0.010030428878962994, 0.023809120059013367, -0.005837537348270416, -0.01181850302964449, 0.006525993812829256, 0.005789727903902531, 0.01907598227262497, -0.04823020100593567, -0.0017677554860711098, -0.08689850568771362, -0.014208977110683918, -0.011455151252448559, 0.0007816849392838776, -0.038993410766124725, -0.0068463170900940895, -0.009734009392559528, 0.052322693169116974, -0.03354312852025032, 0.052513930946588516, -0.015939680859446526, -0.014562766999006271, 0.031707245856523514, 0.006129174958914518, 0.022776436060667038, 0.01680981181561947, 0.031248275190591812, 0.011330846697092056, 0.030139094218611717, -0.0030000447295606136, -0.03381086140871048, -0.03811371698975563, -0.010890998877584934, -0.00219206465408206, 0.028494449332356453, -0.030674561858177185, -0.04119264706969261, 0.0221453495323658, 0.04670029878616333, -0.0682719349861145, 0.0064447177574038506, 0.02518603391945362, 0.06230531260371208, 0.025874489918351173, -0.03633520379662514, 0.03147776052355766, -0.02260432206094265, -0.0033849109895527363, 0.021437769755721092, 0.04199584573507309, 0.060966648161411285, 0.03023471310734749, 0.04524689167737961, -0.058480553328990936, -0.02382824383676052, 0.0686926543712616, -0.048344943672418594, 0.024382833391427994, 0.03732964023947716, 0.057983335107564926, -0.024880051612854004, -0.021323027089238167, -0.008940372616052628, -0.002787292469292879, -0.06590058654546738, 0.0030000447295606136, 0.1152782142162323, -0.05580322444438934, 0.011531646363437176, 0.03658381104469299, -0.01862657256424427, 0.043602243065834045, 0.04126914218068123, 0.05167248472571373, -0.04241656884551048, -0.025052165612578392, -0.004692500457167625, -0.0434110052883625, 0.04146037995815277, 0.03178374096751213, 0.02853269688785076, 0.018071983009576797, 0.0035857108887284994, 0.016503831371665, 0.03694716468453407, -0.02562588080763817, -0.05136650428175926, -0.029316771775484085, -0.0064351558685302734, 0.03235745429992676, -0.006827193312346935, 0.0714464858174324, -0.020175600424408913, 0.001976921921595931, -0.06448542326688766, -0.02097879908978939, 0.003219968406483531, -0.03585710749030113, -0.04819195345044136, 0.011531646363437176, 0.03337101638317108, 0.01110136043280363, 0.0148018142208457, 0.001614765147678554, 0.02857094444334507, -0.03490091860294342, -0.01636996492743492, 0.007420030888170004, -0.06069891154766083, -0.08162034302949905, 0.06494439393281937, 0.032395701855421066, 0.01569106988608837, 0.033524006605148315, 0.010910122655332088, 0.04379348084330559, 0.03453756868839264, -0.04146037995815277, 0.02535814791917801, 0.02581711858510971, 0.008897343650460243, 0.03333276882767677, 0.012363530695438385, 0.06517387926578522, -0.030349455773830414, -0.06414119899272919, 0.03882129490375519, -0.04402296617627144, -0.00202831719070673, -0.00881128665059805, -0.004563414491713047, 0.05568848177790642, -0.03721489757299423, -0.04444368928670883, 0.0051490808837115765, -0.02183936908841133, -0.036507315933704376, -0.028551820665597916, 0.012631264515221119, 0.03361962363123894, 0.09485400468111038, 0.03593360260128975, -0.005937937181442976, 0.020290343090891838, 0.038171086460351944, 0.019018610939383507, 0.010231228545308113, -0.028188468888401985, 0.09324760735034943, 0.0067602600902318954, 0.03958624601364136, 0.013214539736509323, 0.032701682299375534, 0.006325194146484137, -0.010632827877998352, -0.05067804828286171, 0.007152297999709845, -0.04517039656639099, -0.008572239428758621, -0.02654382213950157, -0.03472880646586418, -0.03361962363123894, -0.025262529030442238, 0.04796246811747551, 0.06846316903829575, -0.07163771986961365, 0.03715752810239792, -0.02929764799773693, -0.04524689167737961, 0.028092849999666214, 0.002443064237013459, -0.03249132260680199, 0.05997220799326897, 0.04050419107079506, 0.008266258984804153, 0.008591363206505775, -0.05958973243832588, -0.003468577517196536, -0.019544513896107674, 0.04329626262187958, 0.05270516872406006, -0.044634927064180374, -0.043869975954294205, -0.0214760173112154, -0.042875539511442184, -0.09187069535255432, 0.03859180957078934, -0.0026438641361892223, 0.05840405821800232, 0.008801724761724472, -0.052552178502082825, -0.05450280383229256, 0.0009221252985298634, 0.03247219696640968, 0.0009376633679494262, 0.030942294746637344, 0.010326847434043884, -0.050257325172424316, -0.08307375013828278, -0.023388396948575974, -0.001915964880026877, -0.04471142217516899, 0.004611223936080933, -0.0065977079793810844, -0.029986103996634483, 0.050295572727918625, 0.03738701343536377, -0.023904738947749138, 0.02011822909116745, -0.05037206783890724, -0.031171780079603195, 0.01854051649570465, -0.01866482011973858, -0.027385268360376358, -0.026333460584282875, 0.03184111416339874, 0.0664742961525917, -0.0008838777430355549, -0.0214760173112154, -0.06570934504270554, -0.019735751673579216, 0.01466794777661562, 0.016465583816170692, 0.08422117680311203, -0.023809120059013367, 0.06452367454767227, 0.05450280383229256, 0.013606577180325985, -0.004223967436701059, -0.09187069535255432, -0.011961931362748146, 0.05584147199988365, 0.04551462456583977, 0.0017139697447419167, -0.011799379251897335, -0.01713491603732109, 0.017842497676610947, 0.03851531445980072, -0.013453586958348751, 0.04100140929222107, 0.028628315776586533, 0.04819195345044136, -0.060737159103155136, 0.0038056345656514168, 0.05125176161527634, 0.016035299748182297, -0.03023471310734749, -0.05239918828010559, -0.03719577565789223, 0.03784598410129547, -0.0023928643204271793, 0.003078930312767625, 0.020596323534846306, 0.0524374358355999, 0.037540003657341, -0.0075873639434576035, -0.012191416695713997, -0.007018431555479765, 0.03893603757023811, -0.04130738973617554, -0.004324367269873619, -0.009690981358289719, -0.009542771615087986, 0.05075454339385033, -0.053011149168014526, 0.07894300669431686, 0.039395008236169815, -0.014314157888293266, -0.059245504438877106, 0.05905426666140556, -0.029622752219438553, -0.0085865817964077, 0.05297290161252022, 0.020730189979076385, -0.09745483845472336, -0.00811804924160242, -0.029144657775759697, -0.05190197005867958, 0.018406648188829422, 0.018999487161636353, -0.005125176161527634, -0.03314153105020523, 0.00012415523815434426, -0.0033514443784952164, 0.0018657648470252752, 0.021303903311491013, 0.034747928380966187, 0.014572328887879848, -0.015012175776064396, -0.04073367640376091, -0.011875874362885952, 0.05565023422241211, -0.028417954221367836, -0.0556119866669178, -0.02816934511065483, -0.008715667761862278, 0.058977771550416946, -0.02183936908841133, 0.035551127046346664, -0.08483313769102097, 0.021954111754894257, -0.015232100151479244, 0.021686378866434097, 0.03838144987821579, -0.0029307210352271795, 0.004910033196210861, 0.021055294200778008, 0.03241482749581337, -0.02748088724911213, 0.035053908824920654, -0.03444194793701172, 0.017928553745150566, 0.05737137421965599, -0.03224271163344383, 0.0090407719835639, 0.016130918636918068, 0.05909251421689987, -0.0411543995141983, 0.028379706665873528, 0.07293813675642014, 0.07010781764984131, 0.0004117591306567192, -0.013482272624969482, -0.0023008310236036777, 0.0010595775675028563, 0.006081365514546633, -0.021915864199399948, 0.018865620717406273, -0.004149862565100193, -0.029316771775484085, 0.015356404706835747, -0.003939501009881496, -0.018071983009576797, -0.11466625332832336, -0.036545563489198685, -0.001372131984680891, -0.007520430721342564, -0.026524698361754417, -0.03285467252135277, 0.02436370961368084, 0.009690981358289719, 0.04207234084606171, -0.007816849276423454, 0.017756439745426178, 0.010747570544481277, -0.012009740807116032, 0.0038630058988928795, -0.01238265447318554, 0.006951498333364725, -0.057524364441633224, 0.016800250858068466, 0.016436899080872536, -0.028513573110103607, -0.02545376680791378, -0.01541377604007721, 0.018750878050923347, -0.029756618663668633, -0.07737486064434052, 0.044596679508686066, 0.02820759266614914, -0.007797725964337587, -0.026658564805984497, -0.014448024332523346, 0.03685154393315315, -0.022298339754343033, -0.04142213240265846, -0.05817457288503647, 0.011655950918793678, -0.0035713680554181337, 0.01975487545132637, 0.020806685090065002, -0.029622752219438553, -0.028264963999390602, -0.03260606527328491, -0.027423515915870667, -0.03191760927438736, 0.0074678403325378895, -0.057294879108667374, 0.004474967252463102, -0.010154733434319496, -0.058289315551519394, 0.01204798836261034, -0.09408905357122421, 0.02250870317220688, 0.013778691180050373, 0.032070599496364594, -0.04367873817682266, -0.0420340932905674, 0.010202542878687382, -0.0087061058729887, 0.06437068432569504, 0.028284087777137756, 0.03602922335267067, 0.015270347706973553, 0.016695069149136543, 0.03132477030158043, -0.011388218030333519, 0.08796943724155426, 0.012908559292554855, -0.0006191327120177448, -0.005483746994286776, 0.04922463744878769, 0.0393185131251812, -0.012468711473047733, 0.01641777530312538, 0.05637693777680397, 0.039395008236169815, -0.01890386827290058, -0.021915864199399948, 0.004011215176433325, -0.013482272624969482, -0.04046594351530075, -0.031573377549648285, 0.01884649693965912, -0.006430374924093485, -0.04803896322846413, 0.05568848177790642, 0.02774862013757229, 0.005861442070454359, 0.03633520379662514, 0.001139060826972127, -0.03128652274608612, 0.04448193684220314, -0.05117526650428772, 0.018597887828946114, 0.011359532363712788, -0.009408905170857906, -0.007257478777319193, 0.038993410766124725, 0.048612676560878754, -0.0048096333630383015, 0.03620133548974991, -0.0452086441218853, -0.0160448607057333, 0.060775406658649445, 0.0379798486828804, 0.014715757220983505, -0.0009113681735470891, 0.009915685281157494, 0.008538772352039814, 0.009953933767974377, 0.016216974705457687, 0.009657514281570911, -0.007482183165848255, 0.03769299387931824, 0.041116151958703995, 0.008218449540436268, -0.014275910332798958, -0.02880042977631092, 0.031210027635097504, -0.006669422145932913, 0.015518956817686558, -0.05144299939274788, -0.04945412278175354, 0.0034398918505758047, 0.011828064918518066, -0.04306677728891373, -0.011082236655056477, -0.04998958855867386, 0.03382998704910278, 0.02233658730983734, -0.011808941140770912, -0.002054612385109067, 0.029718371108174324, -0.028398830443620682, 0.03245307505130768, -0.025128662586212158, 0.0239621102809906, 0.014247224666178226, 0.06429418921470642, -0.01667594537138939, -0.04299028217792511, 0.032204464077949524, 0.025893613696098328, -0.027997231110930443, -0.022317463532090187, -0.014878309331834316, -0.043831728398799896, -0.03317977860569954, 0.030387703329324722, 0.025339024141430855, 0.039624493569135666, 0.00808936357498169, -0.006162641569972038, -0.0029498448129743338, -0.06287902593612671, -0.0737030878663063, -0.07014606893062592, 0.12315721809864044, 0.029412390664219856, 0.04417595639824867, 0.026773307472467422, 0.036373451352119446, -0.023311901837587357, -0.06291726976633072, 0.02482268027961254, -0.03115265630185604, -0.031898483633995056, -0.058021582663059235, -0.019697504118084908, 0.04321976751089096, 0.008801724761724472, 0.03623958304524422, -0.08437416702508926, 0.000032159343390958384, -0.060507673770189285, 0.062228817492723465, -0.006664641201496124, 0.0018777172081172466, -0.042875539511442184, -0.0011091799242421985, 0.012736445292830467, -0.03138213977217674, -0.017603449523448944, 0.02734702080488205, -0.006918031256645918, -0.023158911615610123, -0.06563284993171692, -0.03993047773838043, -0.0026390831917524338, 0.010699761100113392, -0.0043626148253679276, -0.05488527938723564, 0.045552872121334076, 0.006148298736661673, -0.017775563523173332, -0.09485400468111038, 0.05683590844273567, -0.01623609848320484, -0.0024287214037030935, -0.026256965473294258, 0.00939934328198433, -0.0038701773155480623, 0.0483831912279129, -0.011531646363437176, -0.010527647100389004, -0.05048681050539017, 0.0015561984619125724, 0.025339024141430855, 0.021055294200778008, 0.0006442327285185456, 0.03759737312793732, 0.003877348732203245, 0.016130918636918068, -0.049071647226810455, -0.065977081656456, -0.10334496945142746, -0.003929939121007919, 0.017507830634713173, -0.049109894782304764, -0.01736440323293209, 0.04547637701034546, 0.0052686044946312904, 0.020672818645834923, 0.028743058443069458, -0.01704885996878147, 0.016016175970435143, 0.0034040347672998905, 0.04268430173397064, -0.01007823832333088, -0.0062678223475813866, -0.018205849453806877, -0.020271219313144684, 0.031133532524108887, -0.039165522903203964, 0.0076877642422914505, -0.003418377600610256, 0.03908902779221535, -0.008720449171960354, 0.015270347706973553, -0.03191760927438736, 0.01685762219130993, 0.05247568339109421, 0.021227408200502396, -0.04130738973617554, -0.02183936908841133, -0.00013356772251427174, 0.03159250319004059, -0.000287155678961426, 0.012258349917829037, 0.023847367614507675, 0.08483313769102097, 0.0185309536755085, -0.0012585845543071628, -0.0025506357196718454, -0.03566586971282959, -0.004551462363451719, -0.00043297457159496844, -0.024899175390601158, -0.031802866607904434, -0.008256697095930576, -0.013683072291314602, -0.05614745244383812, 0.017641697078943253, 0.043143272399902344, 0.01591099426150322, 0.013051987625658512, 0.028953419998288155, 0.018387524411082268, 0.027633877471089363, 0.06314675509929657, 0.08896387368440628, -0.08085539191961288, 0.012688635848462582, -0.016159603372216225, -0.0447496697306633, 0.02088318020105362, -0.01953495293855667, 0.006392127368599176, -0.07924898713827133, -0.009375439025461674, 0.0000026005741347034927, -0.05415857583284378, -0.0062582604587078094, 0.0316307507455349, 0.017574764788150787, 0.012736445292830467, -0.03228095918893814, -0.0007763063767924905, -0.023923862725496292, 0.020060857757925987, -0.02051982842385769, 0.03029208444058895, -0.026505574584007263, -0.03421246260404587, -0.022814683616161346, -0.015452023595571518, -0.07083452492952347, -0.033696118742227554, 0.00681285047903657, 0.0042741671204566956, -0.031535129994153976, 0.0028853020630776882, 0.013109358958899975, -0.0020151694770902395, -0.03105703741312027, 0.023158911615610123, 0.030540695413947105, -0.02313978783786297, 0.031095284968614578, 0.03732964023947716, -0.024210719391703606, -0.009724447503685951, 0.054541051387786865, 0.02969924733042717, -0.0178616214543581, -0.021361274644732475, 0.030865799635648727, -0.017928553745150566, 0.03882129490375519, -0.009150734171271324, 0.008878219872713089, -0.005125176161527634, -0.0180815439671278, -0.02562588080763817, 0.008510086685419083, -0.02966099977493286, 0.01844489574432373, 0.0028064162470400333, -0.036775048822164536, -0.06888389587402344, 0.005961841903626919, 0.04272254928946495, -0.0042646052315831184, -0.03264431282877922, 0.013338844291865826, -0.025262529030442238, -0.003884520148858428, 0.0077642593532800674, -0.029144657775759697, -0.04218708351254463, 0.09569545090198517, -0.05002783611416817, 0.02803547866642475, -0.10135609656572342, -0.019515829160809517, 0.06704801321029663, 0.059742722660303116, -0.058021582663059235, 0.013807376846671104, 0.03411684185266495, -0.034422826021909714, 0.0271175354719162, 0.044864412397146225, 0.009858313947916031 ]
31,994
pingouin.effsize
compute_esci
Parametric confidence intervals around a Cohen d or a correlation coefficient. Parameters ---------- stat : float Original effect size. Must be either a correlation coefficient or a Cohen-type effect size (Cohen d or Hedges g). nx, ny : int Length of vector x and y. paired : bool Indicates if the effect size was estimated from a paired sample. This is only relevant for cohen or hedges effect size. eftype : string Effect size type. Must be "r" (correlation) or "cohen" (Cohen d or Hedges g). confidence : float Confidence level (0.95 = 95%) decimals : int Number of rounded decimals. alternative : string Defines the alternative hypothesis, or tail for the correlation coefficient. Must be one of "two-sided" (default), "greater" or "less". This parameter only has an effect if ``eftype`` is "r". Returns ------- ci : array Desired converted effect size Notes ----- To compute the parametric confidence interval around a **Pearson r correlation** coefficient, one must first apply a Fisher's r-to-z transformation: .. math:: z = 0.5 \cdot \ln \frac{1 + r}{1 - r} = \text{arctanh}(r) and compute the standard error: .. math:: \text{SE} = \frac{1}{\sqrt{n - 3}} where :math:`n` is the sample size. The lower and upper confidence intervals - *in z-space* - are then given by: .. math:: \text{ci}_z = z \pm \text{crit} \cdot \text{SE} where :math:`\text{crit}` is the critical value of the normal distribution corresponding to the desired confidence level (e.g. 1.96 in case of a 95% confidence interval). These confidence intervals can then be easily converted back to *r-space*: .. math:: \text{ci}_r = \frac{\exp(2 \cdot \text{ci}_z) - 1} {\exp(2 \cdot \text{ci}_z) + 1} = \text{tanh}(\text{ci}_z) A formula for calculating the confidence interval for a **Cohen d effect size** is given by Hedges and Olkin (1985, p86). If the effect size estimate from the sample is :math:`d`, then it follows a T distribution with standard error: .. math:: \text{SE} = \sqrt{\frac{n_x + n_y}{n_x \cdot n_y} + \frac{d^2}{2 (n_x + n_y)}} where :math:`n_x` and :math:`n_y` are the sample sizes of the two groups. In one-sample test or paired test, this becomes: .. math:: \text{SE} = \sqrt{\frac{1}{n_x} + \frac{d^2}{2 n_x}} The lower and upper confidence intervals are then given by: .. math:: \text{ci}_d = d \pm \text{crit} \cdot \text{SE} where :math:`\text{crit}` is the critical value of the T distribution corresponding to the desired confidence level. References ---------- * https://en.wikipedia.org/wiki/Fisher_transformation * Hedges, L., and Ingram Olkin. "Statistical models for meta-analysis." (1985). * http://www.leeds.ac.uk/educol/documents/00002182.htm * https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5133225/ Examples -------- 1. Confidence interval of a Pearson correlation coefficient >>> import pingouin as pg >>> x = [3, 4, 6, 7, 5, 6, 7, 3, 5, 4, 2] >>> y = [4, 6, 6, 7, 6, 5, 5, 2, 3, 4, 1] >>> nx, ny = len(x), len(y) >>> stat = pg.compute_effsize(x, y, eftype='r') >>> ci = pg.compute_esci(stat=stat, nx=nx, ny=ny, eftype='r') >>> print(round(stat, 4), ci) 0.7468 [0.27 0.93] 2. Confidence interval of a Cohen d >>> stat = pg.compute_effsize(x, y, eftype='cohen') >>> ci = pg.compute_esci(stat, nx=nx, ny=ny, eftype='cohen', decimals=3) >>> print(round(stat, 4), ci) 0.1538 [-0.737 1.045]
def compute_esci( stat=None, nx=None, ny=None, paired=False, eftype="cohen", confidence=0.95, decimals=2, alternative="two-sided", ): """Parametric confidence intervals around a Cohen d or a correlation coefficient. Parameters ---------- stat : float Original effect size. Must be either a correlation coefficient or a Cohen-type effect size (Cohen d or Hedges g). nx, ny : int Length of vector x and y. paired : bool Indicates if the effect size was estimated from a paired sample. This is only relevant for cohen or hedges effect size. eftype : string Effect size type. Must be "r" (correlation) or "cohen" (Cohen d or Hedges g). confidence : float Confidence level (0.95 = 95%) decimals : int Number of rounded decimals. alternative : string Defines the alternative hypothesis, or tail for the correlation coefficient. Must be one of "two-sided" (default), "greater" or "less". This parameter only has an effect if ``eftype`` is "r". Returns ------- ci : array Desired converted effect size Notes ----- To compute the parametric confidence interval around a **Pearson r correlation** coefficient, one must first apply a Fisher's r-to-z transformation: .. math:: z = 0.5 \\cdot \\ln \\frac{1 + r}{1 - r} = \\text{arctanh}(r) and compute the standard error: .. math:: \\text{SE} = \\frac{1}{\\sqrt{n - 3}} where :math:`n` is the sample size. The lower and upper confidence intervals - *in z-space* - are then given by: .. math:: \\text{ci}_z = z \\pm \\text{crit} \\cdot \\text{SE} where :math:`\\text{crit}` is the critical value of the normal distribution corresponding to the desired confidence level (e.g. 1.96 in case of a 95% confidence interval). These confidence intervals can then be easily converted back to *r-space*: .. math:: \\text{ci}_r = \\frac{\\exp(2 \\cdot \\text{ci}_z) - 1} {\\exp(2 \\cdot \\text{ci}_z) + 1} = \\text{tanh}(\\text{ci}_z) A formula for calculating the confidence interval for a **Cohen d effect size** is given by Hedges and Olkin (1985, p86). If the effect size estimate from the sample is :math:`d`, then it follows a T distribution with standard error: .. math:: \\text{SE} = \\sqrt{\\frac{n_x + n_y}{n_x \\cdot n_y} + \\frac{d^2}{2 (n_x + n_y)}} where :math:`n_x` and :math:`n_y` are the sample sizes of the two groups. In one-sample test or paired test, this becomes: .. math:: \\text{SE} = \\sqrt{\\frac{1}{n_x} + \\frac{d^2}{2 n_x}} The lower and upper confidence intervals are then given by: .. math:: \\text{ci}_d = d \\pm \\text{crit} \\cdot \\text{SE} where :math:`\\text{crit}` is the critical value of the T distribution corresponding to the desired confidence level. References ---------- * https://en.wikipedia.org/wiki/Fisher_transformation * Hedges, L., and Ingram Olkin. "Statistical models for meta-analysis." (1985). * http://www.leeds.ac.uk/educol/documents/00002182.htm * https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5133225/ Examples -------- 1. Confidence interval of a Pearson correlation coefficient >>> import pingouin as pg >>> x = [3, 4, 6, 7, 5, 6, 7, 3, 5, 4, 2] >>> y = [4, 6, 6, 7, 6, 5, 5, 2, 3, 4, 1] >>> nx, ny = len(x), len(y) >>> stat = pg.compute_effsize(x, y, eftype='r') >>> ci = pg.compute_esci(stat=stat, nx=nx, ny=ny, eftype='r') >>> print(round(stat, 4), ci) 0.7468 [0.27 0.93] 2. Confidence interval of a Cohen d >>> stat = pg.compute_effsize(x, y, eftype='cohen') >>> ci = pg.compute_esci(stat, nx=nx, ny=ny, eftype='cohen', decimals=3) >>> print(round(stat, 4), ci) 0.1538 [-0.737 1.045] """ from scipy.stats import norm, t assert eftype.lower() in ["r", "pearson", "spearman", "cohen", "d", "g", "hedges"] assert alternative in [ "two-sided", "greater", "less", ], "Alternative must be one of 'two-sided' (default), 'greater' or 'less'." assert stat is not None and nx is not None assert isinstance(confidence, float) assert 0 < confidence < 1, "confidence must be between 0 and 1." if eftype.lower() in ["r", "pearson", "spearman"]: z = np.arctanh(stat) # R-to-z transform se = 1 / np.sqrt(nx - 3) # See https://github.com/SurajGupta/r-source/blob/master/src/library/stats/R/cor.test.R if alternative == "two-sided": crit = np.abs(norm.ppf((1 - confidence) / 2)) ci_z = np.array([z - crit * se, z + crit * se]) elif alternative == "greater": crit = norm.ppf(confidence) ci_z = np.array([z - crit * se, np.inf]) else: # alternative = "less" crit = norm.ppf(confidence) ci_z = np.array([-np.inf, z + crit * se]) ci = np.tanh(ci_z) # Transform back to r else: # Cohen d. Results are different than JASP which uses a non-central T # distribution. See github.com/jasp-stats/jasp-issues/issues/525 if ny == 1 or paired: # One-sample or paired. Results vary slightly from the cohen.d R # function which uses instead: # >>> sqrt((n / (n / 2)^2) + .5*(dd^2 / n)) -- one-sample # >>> sqrt( (1/n1 + dd^2/(2*n1))*(2-2*r)); -- paired # where r is the correlation between samples # https://github.com/mtorchiano/effsize/blob/master/R/CohenD.R # However, Pingouin uses the formulas on www.real-statistics.com se = np.sqrt(1 / nx + stat**2 / (2 * nx)) dof = nx - 1 else: # Independent two-samples: give same results as R: # >>> cohen.d(..., paired = FALSE, noncentral=FALSE) se = np.sqrt(((nx + ny) / (nx * ny)) + (stat**2) / (2 * (nx + ny))) dof = nx + ny - 2 crit = np.abs(t.ppf((1 - confidence) / 2, dof)) ci = np.array([stat - crit * se, stat + crit * se]) return np.round(ci, decimals)
(stat=None, nx=None, ny=None, paired=False, eftype='cohen', confidence=0.95, decimals=2, alternative='two-sided')
[ -0.0031935470178723335, -0.04163672402501106, 0.029575707390904427, -0.025170814245939255, 0.10261301696300507, 0.0057578240521252155, -0.01575273461639881, -0.02311519719660282, 0.015700295567512512, -0.0084427110850811, 0.043293800204992294, 0.026869844645261765, 0.026869844645261765, -0.014599072746932507, -0.04463624581694603, 0.004158428404480219, 0.013162238523364067, -0.02831716649234295, -0.020566653460264206, -0.05252309888601303, -0.01267979759722948, -0.019087867811322212, -0.04130111262202263, -0.06456314027309418, 0.01046686340123415, -0.00048407932627014816, 0.01273223664611578, -0.011494671925902367, 0.020105188712477684, -0.03551182523369789, -0.07467341423034668, -0.007813440635800362, -0.0770646408200264, -0.009103444404900074, 0.02605179324746132, -0.012606383301317692, 0.04736308380961418, 0.018741769716143608, -0.004147940315306187, 0.048831380903720856, -0.0805046558380127, -0.01525980606675148, 0.030855223536491394, -0.010461620055139065, -0.009769422002136707, 0.05889970436692238, -0.025065936148166656, 0.04459429159760475, -0.015112976543605328, -0.015375172719359398, 0.023031296208500862, -0.10236131399869919, 0.014231998473405838, -0.016172248870134354, 0.008474173955619335, 0.033141572028398514, 0.03670743852853775, 0.047824546694755554, 0.025003008544445038, -0.07081389427185059, 0.07945587486028671, -0.005351420026272535, 0.012826627120375633, 0.023492760956287384, -0.048789430409669876, 0.05483042448759079, 0.010886377654969692, -0.015092001296579838, -0.013267116621136665, -0.009155883453786373, 0.02600984089076519, -0.0005994455423206091, 0.0049974555149674416, -0.017315423116087914, 0.035931337624788284, -0.011096133850514889, 0.01700078696012497, -0.04757284000515938, 0.035364992916584015, 0.020671531558036804, -0.0017514692153781652, 0.031924981623888016, 0.06439533084630966, -0.0009130975231528282, 0.04136404022574425, 0.0012703395914286375, 0.02494008280336857, -0.004029952455312014, -0.02368154190480709, 0.03616207093000412, -0.024143006652593613, -0.008898931555449963, 0.03765134513378143, -0.02489813044667244, 0.049418698996305466, 0.06708022207021713, 0.0060514830984175205, -0.017934205010533333, 0.09011151641607285, -0.034819625318050385, -0.002860558219254017, 0.03442109003663063, 0.04564307630062103, -0.02544349804520607, -0.03209278732538223, 0.020105188712477684, 0.009344665333628654, 0.08520320802927017, -0.02550642564892769, -0.056214820593595505, 0.01241760142147541, 0.00034708192106336355, 0.007761001121252775, -0.05373968929052353, -0.01015747245401144, -0.06519240885972977, -0.05747336149215698, 0.03656060993671417, -0.03677036613225937, 0.0013739069690927863, -0.018511036410927773, -0.03270108252763748, -0.02487715519964695, 0.026219598948955536, 0.03567963093519211, 0.013948826119303703, -0.02196153625845909, 0.04178355261683464, -0.01099125575274229, -0.02487715519964695, 0.002359763951972127, -0.05361383408308029, 0.03402255102992058, -0.012354674749076366, 0.00932368915528059, -0.015563953667879105, -0.03823866322636604, -0.035364992916584015, 0.024184957146644592, -0.036980122327804565, 0.07710659503936768, 0.024415690451860428, -0.019423479214310646, 0.015448587015271187, 0.005443188827484846, 0.008867467753589153, 0.07719049602746964, -0.08658760040998459, 0.026324477046728134, 0.04222404211759567, -0.012270771898329258, 0.0031227541621774435, 0.01975908875465393, -0.020524701103568077, 0.008914663456380367, -0.05751531198620796, 0.0350923091173172, -0.03968598321080208, -0.044258683919906616, -0.04597868770360947, -0.05273285508155823, -0.021583974361419678, 0.03614109382033348, -0.0005152150988578796, 0.03970696032047272, 0.02210836485028267, -0.02322007715702057, -0.008584296330809593, 0.01099125575274229, -0.010980768129229546, -0.04451039060950279, -0.023031296208500862, -0.032575227320194244, -0.004598917439579964, 0.004837515763938427, 0.006476240698248148, -0.015511514618992805, -0.02269568480551243, 0.003547511762008071, -0.030184002593159676, 0.02261178195476532, -0.028652777895331383, 0.013466386124491692, 0.033603038638830185, -0.04459429159760475, 0.04062988981604576, 0.10865401476621628, 0.006554899737238884, 0.05860604718327522, -0.012333699502050877, -0.010015886276960373, -0.036413777619600296, -0.02653423324227333, 0.06527630984783173, 0.04694356769323349, -0.016109321266412735, 0.03385474532842636, 0.014536145143210888, 0.022423001006245613, -0.0045150150544941425, -0.039329398423433304, 0.017808351665735245, -0.00006767933518858626, -0.018259327858686447, 0.0329737663269043, 0.034253284335136414, -0.016780542209744453, -0.025758134201169014, -0.020514214411377907, 0.009129663929343224, -0.014609560370445251, 0.018364205956459045, -0.010566498152911663, -0.005175748839974403, 0.02210836485028267, 0.04811820760369301, 0.05160016939043999, -0.01579468697309494, -0.01697981171309948, -0.026995697990059853, 0.011064670979976654, 0.01416907086968422, 0.03320449963212013, 0.056298721581697464, -0.0002299131010659039, -0.01803908310830593, 0.011452720500528812, 0.03939232602715492, 0.06296898424625397, -0.034882552921772, -0.00958588533103466, 0.03903573751449585, 0.048789430409669876, -0.02827521413564682, -0.008248685859143734, -0.031484492123126984, -0.013665654696524143, 0.01858445070683956, -0.053991395980119705, 0.048915281891822815, -0.0405459888279438, -0.006853803060948849, -0.012774188071489334, 0.011242963373661041, -0.025632278993725777, -0.06347240507602692, 0.05470456928014755, 0.0588577538728714, -0.023576663807034492, 0.02372349239885807, -0.01861591450870037, -0.10345204919576645, -0.03100205399096012, -0.05495627969503403, 0.0009779910324141383, 0.01636102981865406, 0.0225488543510437, 0.017147617414593697, 0.05831238627433777, -0.03349816054105759, 0.006575875449925661, 0.015668831765651703, 0.016633713617920876, 0.010566498152911663, -0.054536763578653336, -0.00033151404932141304, -0.0019651588518172503, -0.011819794774055481, -0.006675509735941887, 0.024059103801846504, -0.023597639054059982, 0.0531943216919899, -0.0315474197268486, -0.005731604062020779, -0.08033684641122818, 0.04757284000515938, 0.008264417760074139, -0.025191789492964745, 0.04849576950073242, 0.036476705223321915, 0.005160016939043999, -0.037043049931526184, -0.05294261500239372, 0.01813347451388836, -0.0065916068851947784, 0.007561732083559036, -0.04234989359974861, -0.008888443931937218, 0.04295818880200386, 0.04107037931680679, -0.05709579586982727, 0.00422135554254055, -0.041615746915340424, -0.04421672970056534, 0.06317874789237976, -0.008788809180259705, 0.002013665158301592, -0.030813273042440414, 0.04000062122941017, 0.02031494490802288, 0.02035689540207386, -0.02081836201250553, -0.016759566962718964, -0.052229441702365875, -0.03282693773508072, -0.004606783390045166, 0.08398661762475967, -0.05206163600087166, -0.05726360157132149, 0.04857967048883438, 0.006408069748431444, 0.04062988981604576, -0.01813347451388836, 0.022297145798802376, -0.005873190239071846, -0.007698073983192444, 0.0017593350494280457, -0.018385183066129684, 0.04016842320561409, 0.06313679367303848, -0.006932461634278297, -0.06280118227005005, 0.07026852667331696, -0.008385027758777142, 0.035364992916584015, -0.008683931082487106, -0.025086911395192146, 0.04142696410417557, 0.04790845140814781, -0.019517868757247925, -0.033582061529159546, -0.017892254516482353, 0.0027766553685069084, -0.003474096767604351, 0.03956013172864914, 0.0046356250531971455, 0.03893085941672325, -0.007079291623085737, 0.022255195304751396, -0.04130111262202263, 0.017986644059419632, 0.007687586359679699, -0.03844841942191124, 0.041489891707897186, -0.0657377764582634, -0.05579530447721481, 0.038763053715229034, -0.029114242643117905, 0.002965436549857259, 0.009155883453786373, -0.008070392534136772, -0.0035370239056646824, 0.03725280612707138, 0.05260700359940529, -0.018972501158714294, 0.039811838418245316, 0.004661844577640295, -0.0311488825827837, 0.05709579586982727, -0.021877633407711983, 0.025107886642217636, 0.007026852574199438, 0.03102302923798561, -0.011400281451642513, -0.06586363166570663, 0.011819794774055481, -0.014546633698046207, 0.027583017945289612, -0.003329888917505741, -0.015018586069345474, -0.006528680212795734, -0.013351019471883774, -0.04862162470817566, -0.04816015809774399, 0.021028118208050728, -0.02483520284295082, -0.06586363166570663, -0.02986936643719673, -0.026114720851182938, -0.017367862164974213, 0.003348242724314332, 0.004517636727541685, -0.09380323439836502, -0.005658189300447702, -0.055124085396528244, -0.010330521501600742, 0.0019192745676264167, -0.010372472926974297, -0.021216899156570435, 0.03158937394618988, 0.004281660541892052, -0.05931922048330307, 0.029617657884955406, -0.02819131314754486, -0.03060351498425007, 0.018941037356853485, 0.06426948308944702, 0.024541543796658516, -0.050006017088890076, 0.048831380903720856, -0.00579453120008111, 0.015448587015271187, 0.13214677572250366, -0.0021041228901594877, 0.003146351780742407, -0.0980822741985321, 0.012249796651303768, 0.04293721541762352, -0.024059103801846504, -0.0063608745113015175, -0.0242688599973917, 0.042559653520584106, -0.040755745023489, 0.0406508669257164, -0.07811342924833298, -0.0001345393102383241, -0.07324706763029099, -0.01862640306353569, -0.04451039060950279, 0.0006364807486534119, 0.00961210485547781, -0.0861680880188942, 0.03182010352611542, 0.06615728884935379, -0.006014775950461626, 0.024415690451860428, -0.006817095447331667, 0.01164150144904852, -0.020786898210644722, -0.024667399004101753, -0.024499593302607536, 0.035826459527015686, -0.060787517577409744, -0.020671531558036804, -0.00019763023010455072, -0.007598439697176218, -0.030981076881289482, 0.04904113709926605, 0.03603621572256088, -0.0071212430484592915, -0.072198286652565, 0.07903635501861572, 0.02657618559896946, 0.0008095300872810185, -0.020063236355781555, 0.014263461343944073, 0.012061015702784061, -0.018993476405739784, -0.04027330502867699, -0.05889970436692238, 0.05038357898592949, -0.008673443458974361, 0.034232307225465775, 0.03857427462935448, -0.026785941794514656, -0.01973811350762844, 0.019056404009461403, 0.040315255522727966, -0.015050049871206284, -0.03467279672622681, -0.0473211295902729, -0.005023675039410591, -0.018878111615777016, -0.04121720790863037, -0.020493237301707268, -0.029764488339424133, 0.03452596813440323, -0.018269816413521767, -0.007178925909101963, 0.011169549077749252, 0.027834726497530937, 0.006460509262979031, -0.005726360250264406, 0.03834354132413864, 0.03406450152397156, 0.04870552569627762, -0.009449543431401253, 0.02928204834461212, 0.013739069923758507, 0.024038128554821014, 0.03291083872318268, 0.00218015955761075, -0.03729475662112236, -0.01632956601679325, 0.04925089329481125, -0.06984900683164597, -0.010524546727538109, -0.04807625710964203, 0.008694418705999851, -0.025044960901141167, 0.013351019471883774, 0.02491910569369793, -0.004494039341807365, 0.013917363248765469, 0.03062449023127556, -0.008919907733798027, 0.017441276460886, -0.03217669203877449, -0.009806130081415176, -0.0294288769364357, 0.04916699230670929, -0.026240574195981026, 0.003943427465856075, -0.05264895409345627, -0.014599072746932507, -0.030792295932769775, 0.0031017784494906664, 0.005120687652379274, 0.015333221293985844, 0.029701560735702515, 0.007220877334475517, -0.0024213800206780434, 0.0630948394536972, -0.04971235990524292, 0.016088346019387245, -0.037567440420389175, 0.013151750899851322, 0.06322069466114044, -0.001565310056321323, -0.017231520265340805, 0.02833814173936844, -0.03127473592758179, 0.007095023524016142, 0.09044712781906128, 0.019947869703173637, 0.03171522542834282, 0.005065626464784145, -0.009543933905661106, 0.005904653575271368, 0.020220553502440453, -0.05617286637425423, -0.050551384687423706, -0.0203254334628582, 0.01869981735944748, -0.02712155319750309, -0.00026350695407018065, -0.022800562903285027, -0.01630859076976776, 0.0018563475459814072, -0.01581566222012043, -0.024394715204834938, 0.0011726715601980686, 0.04748893529176712, 0.030414734035730362, 0.015112976543605328, 0.032428398728370667, 0.0136027280241251, -0.059570927172899246, -0.02491910569369793, -0.021793730556964874, 0.0020975677762180567, 0.0035003162920475006, -0.0009616037714295089, 0.018248841166496277, 0.04476209729909897, -0.004994833376258612, 0.028526922687888145, -0.09288030862808228, -0.06519240885972977, 0.03993769362568855, -0.009239786304533482, -0.019412990659475327, 0.05164211988449097, -0.07677098363637924, 0.015060537494719028, 0.0497543103992939, 0.08142758160829544, -0.0008875334169715643, -0.07551244646310806, -0.02649228274822235, -0.035364992916584015, 0.14288632571697235, 0.014294925145804882, 0.035889387130737305, -0.02150007151067257, 0.01703225076198578, 0.020115675404667854, -0.0521874874830246, 0.006822339724749327, -0.0013208122691139579, -0.004365562926977873, -0.060200199484825134, 0.04117525741457939, -0.0430840440094471, 0.024982033297419548, 0.06619924306869507, -0.07026852667331696, 0.08490955084562302, -0.01078149862587452, 0.05373968929052353, -0.01635054126381874, -0.01469346322119236, -0.037630368024110794, -0.051684074103832245, 0.02086031250655651, 0.01979055255651474, 0.023324955254793167, -0.006911486387252808, -0.022464951500296593, -0.025632278993725777, -0.0450977087020874, -0.03679133951663971, 0.012983945198357105, 0.0028710460755974054, 0.005815506912767887, -0.04258062690496445, 0.05831238627433777, -0.02928204834461212, -0.031862057745456696, -0.06200410798192024, 0.025821059942245483, -0.0034452553372830153, -0.006685997825115919, -0.031987909227609634, 0.012092478573322296, 0.017294447869062424, -0.012459552846848965, 0.027813749387860298, 0.03356108441948891, 0.009989666752517223, 0.03410645201802254, 0.028505947440862656, 0.0072628287598490715, 0.020776409655809402, 0.00005071853593108244, 0.00579453120008111, -0.0029811684507876635, -0.0408606231212616, -0.02368154190480709, -0.028568875044584274, 0.030750345438718796, 0.05080309510231018, 0.0311488825827837, -0.04237087070941925, 0.005590018350630999, 0.03846939653158188, 0.05201968178153038, 0.051767975091934204, -0.017892254516482353, 0.06040995568037033, 0.03580548241734505, -0.017713960260152817, 0.021290313452482224, 0.020765921100974083, -0.0038778786547482014, -0.012218332849442959, 0.007755757309496403, -0.015679320320487022, 0.009890032932162285, -0.013969802297651768, 0.03450499102473259, 0.024457640945911407, -0.03526011481881142, -0.024688374251127243, -0.019968846812844276, -0.05667628347873688, 0.016717616468667984, 0.01550102699548006, -0.014315900392830372, -0.011683452874422073, 0.026723014190793037, 0.046649910509586334, -0.029114242643117905, 0.028128385543823242, 0.05164211988449097, -0.011924673803150654, 0.024646421894431114, -0.00020484061678871512, -0.008285393007099628, -0.004889955278486013, 0.062423620373010635, 0.012585407122969627, -0.026219598948955536, -0.014515169896185398, -0.03259620442986488, -0.037609390914440155, -0.017357373610138893, 0.05252309888601303, 0.05046748369932175, 0.05831238627433777, 0.07475732266902924, 0.020755434408783913, 0.036980122327804565, -0.017787376418709755, 0.10991255939006805, -0.05617286637425423, 0.0497543103992939, -0.0703943744301796, -0.07228218764066696, -0.017713960260152817, -0.03316254913806915, 0.024982033297419548, -0.025569353252649307, -0.08033684641122818, 0.05529189109802246, -0.03890988230705261, -0.06640899926424026, 0.025149838998913765, 0.02309422194957733, -0.014231998473405838, 0.018490061163902283, -0.012837115675210953, -0.007315267808735371, 0.0067803882993757725, -0.0259888656437397, 0.06305289268493652, -0.016497371718287468, -0.03326742723584175, 0.04134306311607361, -0.055669452995061874, -0.04526551440358162, 0.04199330881237984, 0.00422135554254055, -0.011693940497934818, -0.05436895787715912, 0.028086433187127113, -0.0007951093139126897, 0.020556164905428886, 0.010771011002361774, 0.03624597191810608, 0.024604471400380135, 0.02029396966099739, 0.032470349222421646, 0.025003008544445038, -0.06292703747749329, 0.003280071774497628, 0.11637306958436966, 0.004478307440876961, 0.001708206837065518, -0.03614109382033348, -0.014127119444310665, -0.01155759859830141, -0.047866497188806534, 0.01638200506567955, -0.03861622512340546, -0.015217854641377926, -0.01748322881758213, -0.05432700738310814, 0.011693940497934818, -0.044887952506542206, 0.0032853155862540007, -0.03047766163945198, 0.0004650701303035021, -0.07072998583316803, 0.003544889623299241, 0.008951370604336262, -0.007792464457452297, -0.01757761836051941, 0.04000062122941017, 0.007383438758552074, 0.026408379897475243, 0.04134306311607361, -0.0034819627180695534, -0.04513965919613838, 0.016528835520148277, -0.005199346225708723, -0.005983312148600817, 0.014473218470811844, -0.01692737266421318, 0.04522356390953064, 0.0169903002679348, -0.027247406542301178, 0.027855701744556427, 0.018542500212788582, 0.02653423324227333, 0.04518161341547966, -0.015333221293985844, 0.0073729511350393295 ]
31,997
pingouin.circular
convert_angles
Element-wise conversion of arbitrary-unit circular quantities to radians. .. versionadded:: 0.3.4 Parameters ---------- angles : array_like Circular data. low : float or int, optional Low boundary for ``angles`` range. Default is 0. high : float or int, optional High boundary for ``angles`` range. Default is 360 (for degrees to radians conversion). positive : boolean If True, radians are mapped on the :math:`[0, 2\pi]`. Otherwise, the resulting angles are mapped from :math:`[-\pi, \pi)` (default). Returns ------- radians : array_like Circular data in radians. Notes ----- The formula to convert a set of angles :math:`\alpha` from an arbitrary range :math:`[\text{high},\text{low}]` to radians :math:`[0, 2\pi]` is: .. math:: \alpha_r = \frac{2\pi\alpha}{\text{high} - \text{low}} If ``positive=False`` (default), the resulting angles in radians :math:`\alpha_r` are then wrapped to the :math:`[-\pi, \pi)` range: .. math:: (\text{angle} + \pi) \mod 2 \pi - \pi Examples -------- 1. Convert degrees to radians >>> from pingouin import convert_angles >>> a = [0, 360, 180, 90, 45, 270] >>> convert_angles(a, low=0, high=360) array([ 0. , 0. , -3.14159265, 1.57079633, 0.78539816, -1.57079633]) with ``positive=True``: >>> convert_angles(a, low=0, high=360, positive=True) array([0. , 6.28318531, 3.14159265, 1.57079633, 0.78539816, 4.71238898]) 2. Convert hours (24h-format) to radians >>> sleep_onset = [22.5, 23.25, 24, 0.5, 1] >>> convert_angles(sleep_onset, low=0, high=24) array([-0.39269908, -0.19634954, 0. , 0.13089969, 0.26179939]) 3. Convert radians from :math:`[0, 2\pi]` to :math:`[-\pi, \pi)`: >>> import numpy as np >>> rad = [0.1, 3.14, 5, 2, 6] >>> convert_angles(rad, low=0, high=2*np.pi) array([ 0.1 , 3.14 , -1.28318531, 2. , -0.28318531]) 4. Convert degrees from a 2-D array >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 4)) >>> convert_angles(deg) array([[-0.66322512, 1.71042267, -2.26892803, 0.29670597], [ 1.44862328, 1.85004901, 2.14675498, 0.99483767], [-2.54818071, -2.35619449, 1.67551608, 1.97222205]])
def convert_angles(angles, low=0, high=360, positive=False): """Element-wise conversion of arbitrary-unit circular quantities to radians. .. versionadded:: 0.3.4 Parameters ---------- angles : array_like Circular data. low : float or int, optional Low boundary for ``angles`` range. Default is 0. high : float or int, optional High boundary for ``angles`` range. Default is 360 (for degrees to radians conversion). positive : boolean If True, radians are mapped on the :math:`[0, 2\\pi]`. Otherwise, the resulting angles are mapped from :math:`[-\\pi, \\pi)` (default). Returns ------- radians : array_like Circular data in radians. Notes ----- The formula to convert a set of angles :math:`\\alpha` from an arbitrary range :math:`[\\text{high},\\text{low}]` to radians :math:`[0, 2\\pi]` is: .. math:: \\alpha_r = \\frac{2\\pi\\alpha}{\\text{high} - \\text{low}} If ``positive=False`` (default), the resulting angles in radians :math:`\\alpha_r` are then wrapped to the :math:`[-\\pi, \\pi)` range: .. math:: (\\text{angle} + \\pi) \\mod 2 \\pi - \\pi Examples -------- 1. Convert degrees to radians >>> from pingouin import convert_angles >>> a = [0, 360, 180, 90, 45, 270] >>> convert_angles(a, low=0, high=360) array([ 0. , 0. , -3.14159265, 1.57079633, 0.78539816, -1.57079633]) with ``positive=True``: >>> convert_angles(a, low=0, high=360, positive=True) array([0. , 6.28318531, 3.14159265, 1.57079633, 0.78539816, 4.71238898]) 2. Convert hours (24h-format) to radians >>> sleep_onset = [22.5, 23.25, 24, 0.5, 1] >>> convert_angles(sleep_onset, low=0, high=24) array([-0.39269908, -0.19634954, 0. , 0.13089969, 0.26179939]) 3. Convert radians from :math:`[0, 2\\pi]` to :math:`[-\\pi, \\pi)`: >>> import numpy as np >>> rad = [0.1, 3.14, 5, 2, 6] >>> convert_angles(rad, low=0, high=2*np.pi) array([ 0.1 , 3.14 , -1.28318531, 2. , -0.28318531]) 4. Convert degrees from a 2-D array >>> np.random.seed(123) >>> deg = np.random.randint(low=0, high=360, size=(3, 4)) >>> convert_angles(deg) array([[-0.66322512, 1.71042267, -2.26892803, 0.29670597], [ 1.44862328, 1.85004901, 2.14675498, 0.99483767], [-2.54818071, -2.35619449, 1.67551608, 1.97222205]]) """ assert isinstance(positive, bool) assert isinstance(high, (int, float)), "high must be numeric" assert isinstance(low, (int, float)), "low must be numeric" ptp = high - low assert ptp > 0, "high - low must be strictly positive." angles = np.asarray(angles) assert np.nanmin(angles) >= low, "angles cannot be >= low." assert np.nanmax(angles) <= high, "angles cannot be <= high." # Map to [0, 2pi] range rad = angles * (2 * np.pi) / ptp if not positive: # https://stackoverflow.com/a/29237626/10581531 # Map to [-pi, pi) range: rad = (rad + np.pi) % (2 * np.pi) - np.pi # [-pi, pi) # Map to (-pi, pi] range: # rad = np.angle(np.exp(1j * rad)) # rad = -1 * ((-rad + np.pi) % (2 * np.pi) - np.pi) return rad
(angles, low=0, high=360, positive=False)
[ -0.03774978220462799, -0.03933783620595932, 0.014254225417971611, -0.0020209429785609245, -0.009332212619483471, 0.009968391619622707, -0.021084774285554886, 0.035740796476602554, -0.008901716209948063, -0.016712840646505356, 0.04105982184410095, 0.015373516827821732, 0.0708693340420723, 0.03545380011200905, -0.04986108839511871, 0.04155728593468666, 0.015612682327628136, 0.024834878742694855, -0.030440904200077057, -0.003974920138716698, 0.004876571707427502, 0.001992243342101574, -0.03371267765760422, -0.005252060480415821, -0.042896609753370285, 0.022137099876999855, 0.05284586921334267, 0.022041434422135353, -0.043470606207847595, -0.029082447290420532, -0.0011754953302443027, 0.047297243028879166, 0.002465789671987295, -0.040103163570165634, -0.015583982691168785, -0.008829966187477112, 0.03407621011137962, 0.04756510630249977, -0.0873238742351532, 0.06187673285603523, -0.030880967155098915, -0.011546879075467587, 0.03426754102110863, 0.014024627394974232, -0.04852176830172539, 0.01751643419265747, -0.08020632714033127, -0.014761255122721195, -0.019305387511849403, 0.013469764962792397, 0.039643965661525726, -0.02575327269732952, 0.008294237777590752, 0.013890694826841354, -0.007012313697487116, 0.05747609958052635, -0.03486067056655884, 0.02956077642738819, 0.008088555186986923, 0.0218309685587883, -0.0031306680757552385, 0.021199572831392288, 0.03114883229136467, -0.025944603607058525, 0.03876383975148201, 0.07343317568302155, 0.026097670197486877, -0.016253644600510597, 0.033521346747875214, 0.040715426206588745, -0.016138844192028046, 0.023208558559417725, 0.03566426411271095, -0.04163381829857826, 0.06245072931051254, 0.039146505296230316, 0.03610432893037796, 0.06264206022024155, -0.020989108830690384, -0.040753692388534546, 0.001541417557746172, 0.01525871828198433, 0.05200400575995445, 0.03503286838531494, 0.008877799846231937, 0.02617420256137848, -0.0657799020409584, -0.007351927924901247, -0.01645454205572605, -0.012962735258042812, 0.01797563023865223, -0.042322613298892975, 0.004876571707427502, -0.003996444866061211, 0.008810833096504211, 0.017210302874445915, -0.0437002032995224, 0.019525419920682907, -0.007452377118170261, -0.03597039356827736, 0.013986361213028431, 0.0054864417761564255, -0.065282441675663, 0.004147118888795376, 0.05074121803045273, -0.037979379296302795, -0.01963065192103386, -0.00642875162884593, 0.07928793132305145, 0.026021135970950127, -0.06333085149526596, 0.0022565205581486225, 0.0218118354678154, 0.014416857622563839, -0.061455801129341125, 0.019936783239245415, -0.005017678719013929, -0.002185966819524765, -0.03975876793265343, -0.04304967448115349, 0.01314450055360794, 0.01805216446518898, 0.028757182881236076, 0.010771985165774822, 0.053764261305332184, -0.03227768838405609, 0.013833295553922653, -0.0031808926723897457, -0.03771151602268219, 0.03556859865784645, 0.009734009392559528, -0.01793736405670643, 0.03499460220336914, -0.02024291455745697, -0.03063223510980606, -0.007983323186635971, 0.0035037652123719454, 0.012905335985124111, -0.023055491968989372, 0.009021298959851265, 0.03495633602142334, -0.013230600394308567, 0.03480327129364014, 0.0040992856957018375, 0.03243075683712959, 0.05736130103468895, 0.023801686242222786, 0.016062311828136444, 0.015985779464244843, 0.04262874647974968, -0.03153149411082268, -0.021084774285554886, 0.05364946275949478, 0.029866907745599747, 0.05093254894018173, -0.07274438440799713, -0.0028915032744407654, 0.005070295184850693, -0.0713285282254219, 0.04324100539088249, 0.005333376582711935, 0.036965321749448776, -0.031933292746543884, 0.009360912255942822, 0.02410781756043434, 0.01795649714767933, -0.01312536746263504, -0.04706764593720436, -0.03864904120564461, -0.06765495240688324, -0.010255388915538788, -0.004608707036823034, -0.019324520602822304, -0.03369354456663132, 0.0012041950831189752, -0.07297398149967194, -0.009360912255942822, 0.034210141748189926, -0.05242493748664856, 0.015660515055060387, -0.00465175649151206, 0.04526912420988083, 0.0029752107802778482, -0.027704857289791107, -0.008619501255452633, 0.06646870076656342, 0.023935619741678238, -0.040141429752111435, 0.009743576869368553, -0.05135347694158554, -0.04657018184661865, 0.051583077758550644, 0.007600659038871527, 0.06321605294942856, 0.016741540282964706, -0.053190264850854874, -0.036754854023456573, 0.09375262260437012, -0.056557707488536835, 0.017650365829467773, -0.008911282755434513, 0.014531657099723816, 0.05590717867016792, -0.04105982184410095, -0.014694289304316044, 0.012159141711890697, -0.04442726448178291, -0.029905173927545547, 0.08954332023859024, -0.0067444490268826485, 0.032469023019075394, 0.005032028537243605, -0.060422610491514206, -0.021601369604468346, -0.04588138684630394, 0.1473255604505539, 0.06229766458272934, -0.02670993097126484, -0.027226528152823448, 0.037367116659879684, 0.008901716209948063, 0.028661517426371574, -0.0061274035833776, -0.054261721670627594, 0.006806632038205862, 0.0028364951722323895, -0.003388965968042612, 0.004412591457366943, 0.001969522563740611, 0.010561520233750343, 0.04136595502495766, -0.03375094383955002, -0.03861077502369881, -0.0020855176262557507, -0.0004006011295132339, 0.016598042100667953, 0.02617420256137848, -0.01742076873779297, -0.04404459893703461, 0.04324100539088249, -0.03334914892911911, 0.028699783608317375, -0.016540640965104103, 0.04538392275571823, 0.028776315972208977, -0.007007530424743891, -0.020625578239560127, 0.00021704210666939616, -0.016559774056077003, -0.008829966187477112, -0.05139174684882164, -0.004376716911792755, 0.016722407191991806, -0.030153905972838402, -0.017679067328572273, -0.03893603757023811, -0.014799521304666996, -0.022749360650777817, 0.013565430417656898, 0.0024897062685340643, 0.09099744260311127, -0.025887204334139824, -0.021697036921977997, 0.003326783189550042, -0.006352218799293041, -0.022213632240891457, -0.0013991143787279725, -0.018157396465539932, -0.00929394643753767, -0.013230600394308567, -0.04523085802793503, -0.01693287119269371, -0.04304967448115349, -0.03560686483979225, 0.09627820551395416, 0.06183846667408943, 0.11816657334566116, -0.00655311718583107, 0.04687631130218506, 0.05284586921334267, -0.02739872597157955, -0.02341902256011963, -0.04274354502558708, 0.05058814957737923, -0.01855919323861599, -0.033062148839235306, -0.04163381829857826, -0.007983323186635971, 0.033578746020793915, 0.0218692347407341, 0.050549883395433426, -0.029331179335713387, -0.03998836502432823, 0.00035844833473674953, 0.06727229058742523, 0.06061394140124321, -0.02682473137974739, -0.0600782111287117, 0.05181267485022545, -0.04266701266169548, -0.000412260415032506, 0.021467437967658043, 0.0327177532017231, -0.016215378418564796, -0.02133350633084774, -0.09474755078554153, -0.03321521729230881, -0.08839533478021622, 0.02399301901459694, 0.007658058777451515, -0.028259720653295517, -0.04966975748538971, 0.06972134113311768, -0.009662260301411152, 0.02248149737715721, -0.022003166377544403, 0.016157977283000946, -0.0218692347407341, 0.11181435734033585, -0.000662486650981009, -0.00211900076828897, 0.03503286838531494, -0.012589638121426105, 0.03065136820077896, -0.032545555382966995, 0.06061394140124321, -0.008260753937065601, 0.0872473418712616, 0.04259047657251358, -0.0005560583085753024, -0.04105982184410095, -0.0012089783558622003, -0.0022385830525308847, -0.02401215210556984, -0.028068387880921364, -0.009241330437362194, 0.02131437323987484, -0.06489977985620499, -0.0038816456217318773, -0.004603923764079809, 0.0038696874398738146, -0.019525419920682907, 0.018453961238265038, 0.01751643419265747, 0.03700358793139458, 0.05074121803045273, 0.05058814957737923, -0.005098994821310043, 0.025906337425112724, -0.009743576869368553, 0.04492472857236862, 0.04695284366607666, -0.03310041502118111, 0.003941436763852835, -0.06290992349386215, -0.004350408911705017, 0.0040131863206624985, 0.0017662325408309698, 0.009078698232769966, -0.051697876304388046, -0.005089428275823593, -0.02012811414897442, 0.006510067265480757, -0.041748616844415665, -0.052616268396377563, 0.030766166746616364, -0.03512853384017944, -0.04580485448241234, -0.0028030122630298138, 0.008638634346425533, 0.04213128238916397, 0.02565760537981987, 0.004295400809496641, 0.012924469076097012, -0.018453961238265038, 0.036372192203998566, -0.005252060480415821, 0.011824310757219791, -0.040141429752111435, 0.021448304876685143, -0.04040929302573204, -0.02345728874206543, -0.02123783901333809, 0.0492105633020401, 0.010025790892541409, -0.011326847597956657, 0.0034559322521090508, -0.03153149411082268, -0.04148075357079506, 0.017774732783436775, -0.058126628398895264, -0.013230600394308567, 0.018243495374917984, -0.010427587665617466, -0.053190264850854874, 0.019783716648817062, 0.01694243960082531, 0.02519840933382511, -0.012532238848507404, -0.05181267485022545, -0.005692123901098967, -0.04197821766138077, 0.014378591440618038, -0.01204434223473072, -0.023706020787358284, 0.05211880803108215, 0.06447884440422058, -0.002551889047026634, 0.022519763559103012, -0.02026204764842987, -0.05502705276012421, 0.03499460220336914, 0.06666003167629242, 0.0005766862886957824, 0.02290242724120617, 0.03449713811278343, -0.061991531401872635, -0.029158979654312134, -0.005362076219171286, -0.031014898791909218, -0.00871516764163971, -0.0708693340420723, -0.021754436194896698, -0.006887948140501976, 0.043508872389793396, -0.016779806464910507, 0.056634239852428436, 0.004027536138892174, -0.014091593213379383, 0.033043015748262405, 0.05032028630375862, 0.03105316497385502, -0.05839449167251587, -0.09888032078742981, -0.010504120960831642, 0.07224692404270172, 0.008150738663971424, 0.02626986801624298, 0.0016251251799985766, -0.022194499149918556, 0.048368699848651886, 0.04037102684378624, 0.00600303802639246, 0.00897346530109644, -0.010264955461025238, -0.03313868120312691, -0.04794777184724808, -0.0218501016497612, 0.016004912555217743, -0.04875136539340019, 0.026480333879590034, -0.012580071575939655, 0.03774978220462799, -0.0016729581402614713, -0.017105070874094963, -0.033617012202739716, -0.022577162832021713, 0.020032448694109917, -0.02070211060345173, -0.017650365829467773, 0.055409714579582214, 0.004472382832318544, -0.00849513616412878, -0.008911282755434513, 0.02127610519528389, 0.08502788841724396, 0.01647367514669895, -0.022749360650777817, -0.03595126047730446, -0.008552535437047482, 0.0768006220459938, -0.02026204764842987, 0.022577162832021713, 0.0163301769644022, 0.019238421693444252, 0.0245670136064291, 0.001266377978026867, -0.0031258848030120134, -0.05751436576247215, -0.02623160183429718, -0.06899427622556686, -0.06225939467549324, -0.008925632573664188, 0.04492472857236862, 0.0075384764932096004, 0.01752600073814392, -0.059312883764505386, -0.010264955461025238, -0.039108239114284515, -0.05200400575995445, -0.05035855248570442, -0.002506447723135352, 0.0009883487364277244, 0.018702691420912743, -0.017143337056040764, -0.007165379356592894, 0.04316447302699089, -0.008676901459693909, -0.005959988106042147, -0.002304353518411517, 0.04324100539088249, -0.006471801083534956, 0.025447141379117966, -0.0059025888331234455, 0.013450631871819496, 0.016617175191640854, -0.017181603237986565, -0.044580329209566116, -0.06520590931177139, 0.024758346378803253, -0.0300582405179739, 0.09160970896482468, 0.07041013240814209, -0.017344236373901367, -0.020529910922050476, 0.05020548775792122, 0.032985616475343704, 0.007151029538363218, -0.03375094383955002, -0.02347642183303833, -0.030747033655643463, -0.008035939186811447, -0.021180439740419388, 0.05935114994645119, -0.0217927023768425, 0.011575579643249512, -0.037979379296302795, -0.02294069342315197, -0.030900100246071815, -0.04304967448115349, -0.010877218097448349, -0.0021572669502347708, -0.03625739365816116, -0.02286416105926037, -0.045154325664043427, 0.03983530029654503, 0.019305387511849403, -0.04442726448178291, 0.04653191566467285, 0.06623909622430801, -0.016167543828487396, 0.060269545763731, 0.01201564259827137, 0.017181603237986565, 0.0245096143335104, -0.033023882657289505, 0.003353091422468424, -0.02294069342315197, 0.07167292386293411, 0.03346394747495651, 0.058241426944732666, -0.023112891241908073, -0.001902556512504816, 0.021486571058630943, 0.006715749390423298, -0.020376846194267273, 0.019305387511849403, -0.050052423030138016, -0.02950337715446949, -0.006490934174507856, -0.0006559096509590745, 0.009600077755749226, -0.058164894580841064, -0.03987356647849083, -0.028010988608002663, 0.02791532315313816, 0.07213212549686432, 0.029235512018203735, 0.035205066204071045, -0.04324100539088249, 0.005940855015069246, 0.006787498947232962, -0.03229682147502899, -0.06612429767847061, 0.008858666755259037, -0.0030182604677975178, 0.011872143484652042, -0.056634239852428436, -0.05120041221380234, -0.040217962116003036, 0.01093461737036705, -0.036754854023456573, -0.10148243606090546, -0.05697863548994064, 0.024299150332808495, 0.006859248038381338, -0.004701981320977211, 0.06666003167629242, 0.029197245836257935, -0.021716170012950897, -0.0003892407985404134, -0.0657799020409584, 0.018320027738809586, 0.0027169128879904747, -0.053840793669223785, 0.008490352891385555, -0.00932264607399702, 0.009289163164794445, -0.008112472482025623, 0.003951003309339285, -0.017879964783787727, 0.02357208915054798, -0.018846191465854645, -0.003592256223782897, -0.02887198142707348, 0.07373931258916855, 0.01179561112076044, -0.10484987497329712, -0.040638893842697144, -0.00023228887584991753, -0.015182184986770153, 0.02294069342315197, 0.006840114947408438, 0.0023641446605324745, 0.07155812531709671, -0.0005614394904114306, -0.027436992153525352, -0.017162470147013664, 0.015182184986770153, 0.09765579551458359, 0.0019994182512164116, -0.029656441882252693, -0.00979619286954403, 0.007811124436557293, -0.037328850477933884, -0.004338450729846954, -0.006467017810791731, 0.0016036003362387419, 0.016224944964051247, -0.002348599024116993, 0.00873430073261261, -0.01226437371224165, 0.0004059823404531926, 0.001997026614844799, -0.03595126047730446, 0.03531986474990845, 0.022156232967972755, -0.03394227847456932, 0.04745030775666237, 0.006974047515541315, -0.02083604224026203, -0.022558029741048813, 0.00018759493832476437, 0.035166800022125244, 0.06256552785634995, -0.06329258531332016, -0.04220781475305557, 0.033004749566316605, -0.011145082302391529, 0.008083771914243698, 0.02131437323987484, 0.09199237078428268, -0.005204227287322283, -0.025351475924253464, -0.004041885957121849, 0.023227691650390625, -0.017899097874760628, 0.035740796476602554, 0.009695743210613728, 0.002633205149322748, -0.019286254420876503, 0.015076952986419201, 0.012340907007455826, 0.03861077502369881, 0.0005467906594276428, 0.01575618050992489, 0.0022780452854931355, 0.05617504194378853, -0.008643417619168758, 0.031895026564598083, 0.0023103326093405485, -0.024949677288532257, 0.08143085241317749, 0.03872557356953621, 0.061570603400468826, 0.03554946556687355, 0.05850929021835327, -0.0326220877468586, 0.019955916330218315, 0.04163381829857826, -0.08954332023859024, 0.03618086129426956, -0.035147666931152344, 0.05058814957737923, 0.013249733485281467, 0.04136595502495766, 0.06424924731254578, 0.0006236223853193223, -0.019448885694146156, 0.018683558329939842, 0.06983613967895508, 0.028125787153840065, 0.0006415597163140774, -0.01695200614631176, 0.02301722578704357, 0.016129277646541595, -0.06401965022087097, 0.024911411106586456, -0.018894024193286896, 0.01445512380450964, 0.09750273078680038, -0.051621343940496445, -0.02079777605831623, 0.020376846194267273, -0.00764370895922184, -0.04572832211852074, 0.03679312393069267, 0.0301347728818655, -0.00789244007319212, -0.03642959147691727, -0.010733718983829021, 0.03118709847331047, 0.004034711048007011, -0.039720501750707626, 0.009059565141797066, -0.07431330531835556, -0.021410038694739342, 0.02736045978963375, 0.0069118645042181015, -0.005156394559890032, -0.00545295886695385, -0.029866907745599747, 0.07289744913578033, -0.04630231857299805, -0.03130189701914787, -0.017181603237986565, 0.03543466702103615, 0.02891024760901928, -0.0707928016781807, -0.04002663120627403, -0.017659932374954224, 0.01800432987511158, 0.01741120219230652, 0.03983530029654503, -0.030727900564670563, -0.03897430747747421, -0.022577162832021713, -0.021658768877387047, -0.03377007693052292, -0.005371642764657736, 0.02626986801624298, -0.006720532663166523, -0.032411620020866394, -0.009384829550981522, -0.062068063765764236, -0.03105316497385502, -0.013766329735517502, -0.028030121698975563, 0.020032448694109917, -0.007710675243288279, -0.013201899826526642, -0.006074787583202124, -0.021601369604468346, 0.02730306051671505, -0.042858343571424484, 0.0070457966066896915, -0.03371267765760422, 0.0380367785692215, -0.029771242290735245, -0.03679312393069267, -0.019994182512164116, 0.0547591857612133, -0.016502374783158302, 0.05077948421239853, -0.017325103282928467, 0.02397388592362404, -0.03987356647849083, -0.014866488054394722 ]
31,998
pingouin.effsize
convert_effsize
Conversion between effect sizes. Parameters ---------- ef : float Original effect size. input_type : string Effect size type of ef. Must be ``'cohen'`` or ``'pointbiserialr'``. output_type : string Desired effect size type. Available methods are: * ``'cohen'``: Unbiased Cohen d * ``'hedges'``: Hedges g * ``'pointbiserialr'``: Point-biserial correlation * ``'eta-square'``: Eta-square * ``'odds-ratio'``: Odds ratio * ``'AUC'``: Area Under the Curve * ``'none'``: pass-through (return ``ef``) nx, ny : int, optional Length of vector x and y. Required to convert to Hedges g. Returns ------- ef : float Desired converted effect size See Also -------- compute_effsize : Calculate effect size between two set of observations. compute_effsize_from_t : Convert a T-statistic to an effect size. Notes ----- The formula to convert from a`point-biserial correlation <https://en.wikipedia.org/wiki/Point-biserial_correlation_coefficient>`_ **r** to **d** is given in [1]_: .. math:: d = \frac{2r_{pb}}{\sqrt{1 - r_{pb}^2}} The formula to convert **d** to a point-biserial correlation **r** is given in [2]_: .. math:: r_{pb} = \frac{d}{\sqrt{d^2 + \frac{(n_x + n_y)^2 - 2(n_x + n_y)} {n_xn_y}}} The formula to convert **d** to :math:`\eta^2` is given in [3]_: .. math:: \eta^2 = \frac{(0.5 d)^2}{1 + (0.5 d)^2} The formula to convert **d** to an odds-ratio is given in [4]_: .. math:: \text{OR} = \exp (\frac{d \pi}{\sqrt{3}}) The formula to convert **d** to area under the curve is given in [5]_: .. math:: \text{AUC} = \mathcal{N}_{cdf}(\frac{d}{\sqrt{2}}) References ---------- .. [1] Rosenthal, Robert. "Parametric measures of effect size." The handbook of research synthesis 621 (1994): 231-244. .. [2] McGrath, Robert E., and Gregory J. Meyer. "When effect sizes disagree: the case of r and d." Psychological methods 11.4 (2006): 386. .. [3] Cohen, Jacob. "Statistical power analysis for the behavioral sciences. 2nd." (1988). .. [4] Borenstein, Michael, et al. "Effect sizes for continuous data." The handbook of research synthesis and meta-analysis 2 (2009): 221-235. .. [5] Ruscio, John. "A probability-based measure of effect size: Robustness to base rates and other factors." Psychological methods 1 3.1 (2008): 19. Examples -------- 1. Convert from Cohen d to eta-square >>> import pingouin as pg >>> d = .45 >>> eta = pg.convert_effsize(d, 'cohen', 'eta-square') >>> print(eta) 0.048185603807257595 2. Convert from Cohen d to Hegdes g (requires the sample sizes of each group) >>> pg.convert_effsize(.45, 'cohen', 'hedges', nx=10, ny=10) 0.4309859154929578 3. Convert a point-biserial correlation to Cohen d >>> rpb = 0.40 >>> d = pg.convert_effsize(rpb, 'pointbiserialr', 'cohen') >>> print(d) 0.8728715609439696 4. Reverse operation: convert Cohen d to a point-biserial correlation >>> pg.convert_effsize(d, 'cohen', 'pointbiserialr') 0.4000000000000001
def convert_effsize(ef, input_type, output_type, nx=None, ny=None): """Conversion between effect sizes. Parameters ---------- ef : float Original effect size. input_type : string Effect size type of ef. Must be ``'cohen'`` or ``'pointbiserialr'``. output_type : string Desired effect size type. Available methods are: * ``'cohen'``: Unbiased Cohen d * ``'hedges'``: Hedges g * ``'pointbiserialr'``: Point-biserial correlation * ``'eta-square'``: Eta-square * ``'odds-ratio'``: Odds ratio * ``'AUC'``: Area Under the Curve * ``'none'``: pass-through (return ``ef``) nx, ny : int, optional Length of vector x and y. Required to convert to Hedges g. Returns ------- ef : float Desired converted effect size See Also -------- compute_effsize : Calculate effect size between two set of observations. compute_effsize_from_t : Convert a T-statistic to an effect size. Notes ----- The formula to convert from a`point-biserial correlation <https://en.wikipedia.org/wiki/Point-biserial_correlation_coefficient>`_ **r** to **d** is given in [1]_: .. math:: d = \\frac{2r_{pb}}{\\sqrt{1 - r_{pb}^2}} The formula to convert **d** to a point-biserial correlation **r** is given in [2]_: .. math:: r_{pb} = \\frac{d}{\\sqrt{d^2 + \\frac{(n_x + n_y)^2 - 2(n_x + n_y)} {n_xn_y}}} The formula to convert **d** to :math:`\\eta^2` is given in [3]_: .. math:: \\eta^2 = \\frac{(0.5 d)^2}{1 + (0.5 d)^2} The formula to convert **d** to an odds-ratio is given in [4]_: .. math:: \\text{OR} = \\exp (\\frac{d \\pi}{\\sqrt{3}}) The formula to convert **d** to area under the curve is given in [5]_: .. math:: \\text{AUC} = \\mathcal{N}_{cdf}(\\frac{d}{\\sqrt{2}}) References ---------- .. [1] Rosenthal, Robert. "Parametric measures of effect size." The handbook of research synthesis 621 (1994): 231-244. .. [2] McGrath, Robert E., and Gregory J. Meyer. "When effect sizes disagree: the case of r and d." Psychological methods 11.4 (2006): 386. .. [3] Cohen, Jacob. "Statistical power analysis for the behavioral sciences. 2nd." (1988). .. [4] Borenstein, Michael, et al. "Effect sizes for continuous data." The handbook of research synthesis and meta-analysis 2 (2009): 221-235. .. [5] Ruscio, John. "A probability-based measure of effect size: Robustness to base rates and other factors." Psychological methods 1 3.1 (2008): 19. Examples -------- 1. Convert from Cohen d to eta-square >>> import pingouin as pg >>> d = .45 >>> eta = pg.convert_effsize(d, 'cohen', 'eta-square') >>> print(eta) 0.048185603807257595 2. Convert from Cohen d to Hegdes g (requires the sample sizes of each group) >>> pg.convert_effsize(.45, 'cohen', 'hedges', nx=10, ny=10) 0.4309859154929578 3. Convert a point-biserial correlation to Cohen d >>> rpb = 0.40 >>> d = pg.convert_effsize(rpb, 'pointbiserialr', 'cohen') >>> print(d) 0.8728715609439696 4. Reverse operation: convert Cohen d to a point-biserial correlation >>> pg.convert_effsize(d, 'cohen', 'pointbiserialr') 0.4000000000000001 """ it = input_type.lower() ot = output_type.lower() # Check input and output type for inp in [it, ot]: if not _check_eftype(inp): err = f"Could not interpret input '{inp}'" raise ValueError(err) if it not in ["pointbiserialr", "cohen"]: raise ValueError("Input type must be 'cohen' or 'pointbiserialr'") # Pass-through option if it == ot or ot == "none": return ef # Convert point-biserial r to Cohen d (Rosenthal 1994) d = (2 * ef) / np.sqrt(1 - ef**2) if it == "pointbiserialr" else ef # Then convert to the desired output type if ot == "cohen": return d elif ot == "hedges": if all(v is not None for v in [nx, ny]): return d * (1 - (3 / (4 * (nx + ny) - 9))) else: # If shapes of x and y are not known, return cohen's d warnings.warn( "You need to pass nx and ny arguments to compute " "Hedges g. Returning Cohen's d instead" ) return d elif ot == "pointbiserialr": # McGrath and Meyer 2006 if all(v is not None for v in [nx, ny]): a = ((nx + ny) ** 2 - 2 * (nx + ny)) / (nx * ny) else: a = 4 return d / np.sqrt(d**2 + a) elif ot == "eta-square": # Cohen 1988 return (d / 2) ** 2 / (1 + (d / 2) ** 2) elif ot == "odds-ratio": # Borenstein et al. 2009 return np.exp(d * np.pi / np.sqrt(3)) elif ot == "r": # https://github.com/raphaelvallat/pingouin/issues/302 raise ValueError( "Using effect size 'r' in `pingouin.convert_effsize` has been deprecated. " "Please use 'pointbiserialr' instead." ) else: # ['auc'] # Ruscio 2008 from scipy.stats import norm return norm.cdf(d / np.sqrt(2))
(ef, input_type, output_type, nx=None, ny=None)
[ -0.022166060283780098, -0.04788529872894287, -0.005732601508498192, -0.07536046952009201, 0.05230611562728882, -0.00647112587466836, 0.006579580716788769, -0.027599120512604713, -0.06622962653636932, -0.009760916233062744, 0.015917006880044937, 0.012921594083309174, 0.013964824378490448, 0.03509798273444176, -0.02061670832335949, 0.040303803980350494, -0.012890607118606567, -0.017714256420731544, 0.02799162268638611, -0.019129330292344093, 0.0035738381557166576, -0.042679477483034134, 0.025698581710457802, -0.03763892129063606, -0.02330225147306919, -0.011000397615134716, 0.05639640614390373, -0.023467514663934708, -0.009507855400443077, -0.020296508446335793, -0.03509798273444176, -0.006502113305032253, -0.05590061470866203, 0.032660335302352905, 0.026380296796560287, -0.006445303559303284, 0.04069630801677704, 0.03573838248848915, -0.0023976219817996025, 0.035077325999736786, -0.08411947637796402, 0.02171158418059349, 0.05643772333860397, 0.04441475123167038, -0.0019263607682660222, 0.0346435084939003, -0.07432757318019867, 0.0341477133333683, -0.034808769822120667, -0.028962550684809685, -0.011991983279585838, -0.09320900589227676, 0.026834772899746895, 0.014047456905245781, 0.008030806668102741, 0.02857004664838314, 0.028198203071951866, 0.029272420331835747, 0.005613818299025297, -0.011134674772620201, 0.030202031135559082, 0.0024311912711709738, 0.002693289890885353, -0.06052801012992859, -0.039312221109867096, 0.027144644409418106, 0.011733757331967354, -0.006997905671596527, -0.035056665539741516, 0.01205395720899105, 0.017487017437815666, 0.0010922930669039488, 0.03544916957616806, -0.004815902095288038, 0.06003221869468689, 0.012270865961909294, 0.05474376305937767, -0.011930009350180626, 0.0624285489320755, 0.027578461915254593, 0.041687894612550735, 0.04053104296326637, 0.029561633244156837, -0.0661056786775589, 0.019666438922286034, -0.014811803586781025, 0.03524259105324745, -0.0001668781042098999, -0.04445606842637062, -0.012353498488664627, 0.009921016171574593, -0.0501989983022213, 0.0093322629109025, -0.028921233490109444, 0.02722727507352829, 0.017404384911060333, -0.03127624839544296, -0.054371919482946396, 0.05263664573431015, -0.020492760464549065, -0.022620536386966705, 0.041150785982608795, 0.03299086540937424, 0.01178540289402008, -0.019934993237257004, 0.01135158445686102, 0.02483094483613968, 0.03631680831313133, -0.014718842692673206, 0.0017636788543313742, -0.0009670537547208369, 0.020492760464549065, -0.03776286914944649, -0.0682954266667366, -0.017218463122844696, -0.053834810853004456, -0.03604825213551521, 0.03226783499121666, -0.025967136025428772, 0.029210446402430534, -0.007591824047267437, 0.004036061465740204, -0.03654404357075691, -0.004777167923748493, 0.04788529872894287, 0.007638304494321346, -0.014698184095323086, -0.02489291876554489, -0.02433515340089798, -0.04635660722851753, -0.02538871206343174, 0.01736306957900524, -0.024789629504084587, 0.041915129870176315, 0.004110946785658598, 0.006083788350224495, -0.05689219757914543, -0.012239878997206688, 0.06255249679088593, -0.02433515340089798, 0.04623265936970711, 0.057264044880867004, 0.06903911381959915, -0.039312221109867096, -0.0059133595786988735, -0.004733270034193993, 0.10403381288051605, -0.05879273638129234, -0.019511504098773003, 0.06614699214696884, -0.04842240735888481, 0.028508072718977928, 0.02937570959329605, -0.006336848717182875, 0.03825866058468819, -0.04263816028833389, 0.0023446858394891024, -0.07081570476293564, -0.04212171211838722, -0.011744086630642414, -0.03067716583609581, 0.0071683344431221485, 0.06218065321445465, 0.002326610032469034, 0.01768326945602894, 0.003953429404646158, 0.02034815400838852, 0.018788473680615425, 0.019170645624399185, -0.027330566197633743, -0.03311481326818466, -0.013913179747760296, -0.04631529003381729, -0.007798403967171907, 0.07804601639509201, 0.052554015070199966, 0.0041677565313875675, -0.040076568722724915, -0.03144151344895363, -0.0014563907170668244, 0.04288605973124504, -0.04891820251941681, 0.008020478300750256, 0.037948790937662125, -0.010354834608733654, 0.033734552562236786, 0.04129539057612419, 0.030491244047880173, -0.00379849411547184, -0.04131604731082916, 0.018612880259752274, -0.04780266806483269, -0.04094420373439789, 0.053008489310741425, 0.024521075189113617, -0.03226783499121666, -0.002314989920705557, 0.0013556828489527106, 0.02885925956070423, -0.002850807271897793, -0.05263664573431015, 0.01613391749560833, 0.009487197734415531, 0.009564665146172047, 0.013789230957627296, 0.0063058617524802685, 0.02350883185863495, -0.024397127330303192, -0.011062371544539928, 0.009507855400443077, -0.054371919482946396, -0.017115173861384392, -0.02247592993080616, -0.012467117980122566, 0.025326738134026527, -0.025285420939326286, -0.015545163303613663, -0.005182581953704357, -0.01440897211432457, -0.011713099665939808, -0.01940821297466755, 0.03734970837831497, 0.01006045751273632, 0.07610416412353516, 0.031854674220085144, 0.0019715502858161926, -0.018292680382728577, 0.05689219757914543, 0.06395724415779114, -0.015359240584075451, -0.02276514284312725, 0.02724793367087841, 0.01189902238547802, 0.015317925252020359, 0.031110985204577446, 0.060197483748197556, -0.0324537567794323, 0.023446857929229736, -0.07432757318019867, 0.03282560035586357, -0.029169131070375443, -0.006300697568804026, -0.02962360717356205, -0.03580035641789436, -0.0401591993868351, -0.013159161433577538, 0.07391440868377686, 0.04160526022315025, -0.08684633672237396, 0.017497345805168152, -0.023942649364471436, -0.06738647818565369, -0.0010206354781985283, 0.004939849954098463, -0.010277367196977139, 0.03908498212695122, -0.009874535724520683, -0.03989064320921898, 0.015410886146128178, -0.04203907772898674, 0.009786739014089108, -0.016144245862960815, 0.07560836523771286, 0.024934235960245132, -0.040345121175050735, -0.048794254660606384, -0.03491206094622612, -0.016350826248526573, -0.026793457567691803, 0.005391744431108236, 0.043464481830596924, 0.03121427446603775, -0.011392900720238686, -0.0037959120236337185, -0.03885774314403534, 0.03571772575378418, 0.037122469395399094, 0.021505003795027733, 0.041935790330171585, 0.07011333107948303, -0.0054227313958108425, -0.0533803328871727, -0.053834810853004456, 0.017404384911060333, -0.051479797810316086, 0.00561898248270154, -0.003047058591619134, 0.007028892636299133, 0.06453566998243332, 0.010287696495652199, -0.0328049436211586, 0.02908649854362011, -0.04177052527666092, -0.03261902183294296, 0.017662610858678818, 0.018478602170944214, 0.02755780518054962, -0.06329618394374847, 0.06722120940685272, 0.05292585864663124, -0.01636115461587906, -0.002192332874983549, 0.035139299929142, -0.05585929751396179, -0.037700895220041275, 0.002018030732870102, 0.08907739818096161, -0.09163899719715118, 0.008753838017582893, 0.015958324074745178, -0.007111524697393179, 0.022661851719021797, -0.07961602509021759, 0.012818303890526295, 0.02615305781364441, 0.01770392619073391, 0.025244105607271194, 0.011537506245076656, 0.034788113087415695, 0.03834129124879837, -0.031379539519548416, 0.017641952261328697, 0.05664430186152458, 0.02487226203083992, 0.019211962819099426, -0.04474528133869171, -0.021628951653838158, 0.06821279972791672, 0.07036123424768448, -0.07118754833936691, -0.06635357439517975, -0.04875293746590614, 0.027599120512604713, -0.03462284803390503, -0.03708115220069885, -0.05445455014705658, 0.06722120940685272, 0.025822529569268227, -0.015803389251232147, -0.006698364391922951, 0.03218520060181618, 0.059660375118255615, -0.000338597921654582, 0.04780266806483269, 0.02021387591958046, -0.03722576051950455, 0.03805208206176758, -0.07759153842926025, 0.021876847371459007, 0.020244862884283066, -0.04813319817185402, -0.040613677352666855, 0.04362974688410759, -0.016051284968852997, 0.0075505077838897705, 0.005815234035253525, 0.004064466338604689, -0.09015161544084549, 0.015338582918047905, -0.009642132557928562, -0.0038966198917478323, -0.033734552562236786, -0.022889090701937675, -0.014470946043729782, -0.04470396414399147, -0.005094785243272781, 0.0052290624007582664, -0.01879880204796791, 0.04924872890114784, 0.02985084429383278, 0.011310268193483353, -0.0028895412106066942, -0.07577363401651382, -0.05420665442943573, 0.0002209440281149, 0.022620536386966705, -0.056726936250925064, 0.03369323909282684, -0.03257770463824272, 0.04174986854195595, 0.029437685385346413, 0.032102569937705994, -0.11775074154138565, 0.045323703438043594, 0.0030393118504434824, 0.004183250013738871, 0.026648851111531258, -0.010514934547245502, -0.029024524614214897, 0.025843188166618347, 0.024190546944737434, 0.006811983417719603, 0.07490599900484085, -0.020399799570441246, 0.00407221307978034, 0.02776438370347023, -0.035531800240278244, 0.036337465047836304, -0.06424645334482193, 0.06523804366588593, -0.022434614598751068, 0.05073610693216324, 0.07540179044008255, 0.034829430282115936, -0.04075828194618225, -0.07267493009567261, 0.013706599362194538, 0.08230157196521759, -0.000015443083611899056, 0.010876449756324291, 0.00861439574509859, 0.015008054673671722, -0.08027708530426025, 0.027165301144123077, -0.06275907903909683, 0.012498104944825172, -0.02561594918370247, -0.07197255641222, -0.0450344942510128, 0.0029979958198964596, -0.0022543068043887615, -0.01324179396033287, 0.03809339553117752, 0.05730535835027695, 0.04846372455358505, -0.02460370771586895, -0.018788473680615425, 0.03297020494937897, -0.0014150746865198016, 0.01935656927525997, -0.015514176338911057, 0.014316011220216751, -0.048505041748285294, -0.05073610693216324, 0.0406549908220768, 0.014770487323403358, 0.030904404819011688, 0.03949814289808273, 0.02222803421318531, -0.0039740875363349915, -0.043299220502376556, 0.0629243403673172, 0.0035841672215610743, 0.002343394560739398, 0.0028972879517823458, -0.01241547241806984, 0.009099859744310379, -0.029479000717401505, -0.06081722304224968, -0.04681108146905899, 0.05284322425723076, -0.007937845773994923, 0.03666799142956734, -0.021525660529732704, -0.006073459051549435, -0.02115381695330143, 0.006610567681491375, 0.032164543867111206, -0.019129330292344093, -0.01707385666668415, -0.019129330292344093, 0.011021056212484837, 0.02052374742925167, 0.01151684857904911, -0.011568493209779263, -0.02778504230082035, 0.05590061470866203, -0.012529091909527779, 0.021381055936217308, 0.028962550684809685, 0.009001733735203743, -0.012890607118606567, 0.03803142160177231, 0.03470548242330551, 0.05693351477384567, 0.026524903252720833, 0.012136588804423809, 0.01626819372177124, 0.016371484845876694, 0.0009347755694761872, 0.07358388602733612, 0.009507855400443077, -0.009745422750711441, 0.013334754854440689, 0.03780418261885643, 0.006775831803679466, -0.00013024239160586149, 0.015359240584075451, 0.016454115509986877, 0.014161075465381145, -0.0497032068669796, -0.01099006924778223, -0.01839597150683403, -0.012849290855228901, -0.004327856004238129, -0.016257865354418755, 0.03652338683605194, -0.03786616027355194, -0.044001590460538864, 0.0020670935045927763, 0.03993196040391922, -0.007509191986173391, -0.008820976130664349, -0.06222197040915489, -0.021587634459137917, 0.03224717453122139, -0.019263608381152153, 0.03803142160177231, -0.012766659259796143, 0.049331363290548325, -0.0475134551525116, 0.03749431297183037, 0.05598324537277222, -0.02854938991367817, 0.032123226672410965, 0.0396634079515934, 0.028218861669301987, 0.09064740687608719, 0.00219362392090261, -0.02563660778105259, 0.03786616027355194, -0.025016866624355316, 0.011062371544539928, -0.006130268797278404, 0.006362671498209238, 0.05747062340378761, 0.011733757331967354, -0.002380837220698595, 0.056974831968545914, -0.010065622627735138, -0.03724641725420952, -0.008609231561422348, 0.0036590525414794683, 0.0492074154317379, 0.0028611363377422094, -0.021794214844703674, -0.05106663703918457, -0.04924872890114784, -0.02303369715809822, -0.018747156485915184, -0.03257770463824272, -0.016082271933555603, -0.02429383620619774, 0.0071580056101083755, -0.0024169888347387314, 0.03255704790353775, 0.06705594807863235, -0.028508072718977928, 0.0072819534689188, -0.0587514191865921, -0.019253278151154518, 0.009988154284656048, 0.029479000717401505, 0.04020051658153534, 0.052182167768478394, 0.040593016892671585, 0.03491206094622612, -0.06949359178543091, -0.03658536076545715, -0.02433515340089798, -0.034251004457473755, -0.0497032068669796, 0.023426199331879616, -0.025719240307807922, -0.022124743089079857, 0.03889906033873558, 0.0020851693116128445, 0.03761826083064079, -0.08242551982402802, -0.05371086299419403, -0.04011788219213486, 0.1312197744846344, 0.021814873442053795, -0.02330225147306919, -0.0314621701836586, -0.03730839118361473, -0.00024273178132716566, -0.0724683478474617, 0.05424797162413597, 0.013820217922329903, -0.03749431297183037, -0.0405103862285614, -0.03856853023171425, 0.0016745910979807377, 0.025698581710457802, 0.035862330347299576, -0.06437040120363235, 0.03551114350557327, -0.006078623700886965, 0.05970168858766556, -0.04251421242952347, -0.025471344590187073, -0.02222803421318531, -0.042720794677734375, -0.023075012490153313, -0.014615552499890327, 0.032391782850027084, 0.004676460288465023, -0.0005306529928930104, -0.01613391749560833, -0.046687133610248566, -0.033961791545152664, 0.01189902238547802, 0.0021006627939641476, 0.04362974688410759, -0.04263816028833389, 0.07598021626472473, -0.0318133570253849, 0.00673968018963933, -0.0861852765083313, 0.03989064320921898, 0.02619437500834465, -0.033197443932294846, -0.04656318575143814, -0.02429383620619774, -0.03757694736123085, 0.016278523951768875, -0.0423489511013031, 0.0041884141974151134, -0.0026196956168860197, -0.014873777516186237, 0.052182167768478394, 0.03040861152112484, 0.009946838952600956, 0.011661455035209656, -0.006037307437509298, -0.006445303559303284, -0.05846220999956131, -0.022413956001400948, -0.08907739818096161, 0.016278523951768875, 0.007235473021864891, -0.00006326520087895915, -0.04953794181346893, 0.042183686047792435, 0.021732240915298462, 0.022537903860211372, 0.031854674220085144, -0.023136986419558525, 0.006223229691386223, 0.04470396414399147, 0.01509068626910448, -0.01684661954641342, -0.016216548159718513, 0.01969742588698864, 0.0020670935045927763, 0.010246380232274532, -0.04239026457071304, -0.006775831803679466, -0.016412800177931786, 0.061519596725702286, 0.02355014719069004, -0.009342591278254986, -0.001329860300756991, 0.00147317536175251, 0.03784549981355667, 0.023075012490153313, -0.01906735636293888, -0.028941892087459564, -0.02619437500834465, -0.0015764654381200671, 0.018344325944781303, 0.006254216656088829, 0.03470548242330551, 0.04759608954191208, -0.00023191860236693174, 0.008325183764100075, -0.005252302624285221, -0.06585778295993805, 0.017714256420731544, 0.007163169793784618, -0.017765900120139122, -0.01642312854528427, -0.029809528961777687, -0.02536805346608162, -0.0383206345140934, 0.006522770971059799, 0.05742930620908737, 0.03815536946058273, 0.018158404156565666, 0.02726859226822853, 0.01981104537844658, 0.018840117380023003, 0.009921016171574593, 0.10370328277349472, -0.056726936250925064, 0.027454514056444168, -0.052760593593120575, -0.052554015070199966, 0.008092780597507954, 0.004622233100235462, -0.0010651793563738465, -0.05528087168931961, -0.062263283878564835, 0.03509798273444176, -0.03949814289808273, -0.06255249679088593, 0.011847376823425293, 0.00508703850209713, 0.005107696633785963, 0.04648055508732796, -0.0024880007840692997, -0.0280329380184412, 0.004606739617884159, -0.010210228152573109, 0.04148131236433983, -0.05209953710436821, -0.004294286947697401, 0.008521434850990772, -0.016278523951768875, -0.049042150378227234, 0.01718747615814209, 0.009316768497228622, -0.02198013849556446, 0.004475044552236795, 0.013665283098816872, -0.01868518255650997, 0.06813016533851624, -0.04842240735888481, 0.04092354699969292, -0.013128174468874931, -0.018168732523918152, 0.06726253032684326, -0.003860468277707696, -0.07267493009567261, -0.024975551292300224, 0.0433405339717865, 0.014316011220216751, -0.01929459534585476, -0.011485861614346504, -0.0015093268593773246, 0.007653797976672649, 0.001464137458242476, 0.0009399401023983955, -0.032908231019973755, -0.00979190319776535, -0.01728043705224991, -0.027867674827575684, 0.03127624839544296, -0.06308960914611816, 0.013892521150410175, -0.0004489892453420907, -0.0282808355987072, -0.08209498971700668, 0.02565726637840271, 0.027847016230225563, 0.03809339553117752, -0.01348968967795372, 0.014522590674459934, 0.004704865161329508, 0.015039041638374329, 0.006987576838582754, -0.0004079959762748331, -0.03879576921463013, 0.07139413058757782, -0.05073610693216324, 0.025223447009921074, -0.023963307961821556, -0.021319080144166946, 0.011837047524750233, -0.00433560274541378, -0.046687133610248566, 0.025595292448997498, 0.029272420331835747, 0.013623966835439205, 0.02964426390826702, 0.015452202409505844, -0.013634296134114265 ]
31,999
pingouin.correlation
corr
(Robust) correlation between two variables. Parameters ---------- x, y : array_like First and second set of observations. ``x`` and ``y`` must be independent. alternative : string Defines the alternative hypothesis, or tail of the correlation. Must be one of "two-sided" (default), "greater" or "less". Both "greater" and "less" return a one-sided p-value. "greater" tests against the alternative hypothesis that the correlation is positive (greater than zero), "less" tests against the hypothesis that the correlation is negative. method : string Correlation type: * ``'pearson'``: Pearson :math:`r` product-moment correlation * ``'spearman'``: Spearman :math:`\rho` rank-order correlation * ``'kendall'``: Kendall's :math:`\tau_B` correlation (for ordinal data) * ``'bicor'``: Biweight midcorrelation (robust) * ``'percbend'``: Percentage bend correlation (robust) * ``'shepherd'``: Shepherd's pi correlation (robust) * ``'skipped'``: Skipped correlation (robust) **kwargs : optional Optional argument(s) passed to the lower-level correlation functions. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'n'``: Sample size (after removal of missing values) * ``'outliers'``: number of outliers, only if a robust method was used * ``'r'``: Correlation coefficient * ``'CI95%'``: 95% parametric confidence intervals around :math:`r` * ``'p-val'``: p-value * ``'BF10'``: Bayes Factor of the alternative hypothesis (only for Pearson correlation) * ``'power'``: achieved power of the test with an alpha of 0.05. See also -------- pairwise_corr : Pairwise correlation between columns of a pandas DataFrame partial_corr : Partial correlation rm_corr : Repeated measures correlation Notes ----- The `Pearson correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_ measures the linear relationship between two datasets. Strictly speaking, Pearson's correlation requires that each dataset be normally distributed. Correlations of -1 or +1 imply a perfect negative and positive linear relationship, respectively, with 0 indicating the absence of association. .. math:: r_{xy} = \frac{\sum_i(x_i - \bar{x})(y_i - \bar{y})} {\sqrt{\sum_i(x_i - \bar{x})^2} \sqrt{\sum_i(y_i - \bar{y})^2}} = \frac{\text{cov}(x, y)}{\sigma_x \sigma_y} where :math:`\text{cov}` is the sample covariance and :math:`\sigma` is the sample standard deviation. If ``method='pearson'``, The Bayes Factor is calculated using the :py:func:`pingouin.bayesfactor_pearson` function. The `Spearman correlation coefficient <https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient>`_ is a non-parametric measure of the monotonicity of the relationship between two datasets. Unlike the Pearson correlation, the Spearman correlation does not assume that both datasets are normally distributed. Correlations of -1 or +1 imply an exact negative and positive monotonic relationship, respectively. Mathematically, the Spearman correlation coefficient is defined as the Pearson correlation coefficient between the `rank variables <https://en.wikipedia.org/wiki/Ranking>`_. The `Kendall correlation coefficient <https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient>`_ is a measure of the correspondence between two rankings. Values also range from -1 (perfect disagreement) to 1 (perfect agreement), with 0 indicating the absence of association. Consistent with :py:func:`scipy.stats.kendalltau`, Pingouin returns the Tau-b coefficient, which adjusts for ties: .. math:: \tau_B = \frac{(P - Q)}{\sqrt{(P + Q + T) (P + Q + U)}} where :math:`P` is the number of concordant pairs, :math:`Q` the number of discordand pairs, :math:`T` the number of ties in x, and :math:`U` the number of ties in y. The `biweight midcorrelation <https://en.wikipedia.org/wiki/Biweight_midcorrelation>`_ and percentage bend correlation [1]_ are both robust methods that protects against *univariate* outliers by down-weighting observations that deviate too much from the median. The Shepherd pi [2]_ correlation and skipped [3]_, [4]_ correlation are both robust methods that returns the Spearman correlation coefficient after removing *bivariate* outliers. Briefly, the Shepherd pi uses a bootstrapping of the Mahalanobis distance to identify outliers, while the skipped correlation is based on the minimum covariance determinant (which requires scikit-learn). Note that these two methods are significantly slower than the previous ones. The confidence intervals for the correlation coefficient are estimated using the Fisher transformation. .. important:: Rows with missing values (NaN) are automatically removed. References ---------- .. [1] Wilcox, R.R., 1994. The percentage bend correlation coefficient. Psychometrika 59, 601–616. https://doi.org/10.1007/BF02294395 .. [2] Schwarzkopf, D.S., De Haas, B., Rees, G., 2012. Better ways to improve standards in brain-behavior correlation analysis. Front. Hum. Neurosci. 6, 200. https://doi.org/10.3389/fnhum.2012.00200 .. [3] Rousselet, G.A., Pernet, C.R., 2012. Improving standards in brain-behavior correlation analyses. Front. Hum. Neurosci. 6, 119. https://doi.org/10.3389/fnhum.2012.00119 .. [4] Pernet, C.R., Wilcox, R., Rousselet, G.A., 2012. Robust correlation analyses: false positive and power validation using a new open source matlab toolbox. Front. Psychol. 3, 606. https://doi.org/10.3389/fpsyg.2012.00606 Examples -------- 1. Pearson correlation >>> import numpy as np >>> import pingouin as pg >>> # Generate random correlated samples >>> np.random.seed(123) >>> mean, cov = [4, 6], [(1, .5), (.5, 1)] >>> x, y = np.random.multivariate_normal(mean, cov, 30).T >>> # Compute Pearson correlation >>> pg.corr(x, y).round(3) n r CI95% p-val BF10 power pearson 30 0.491 [0.16, 0.72] 0.006 8.55 0.809 2. Pearson correlation with two outliers >>> x[3], y[5] = 12, -8 >>> pg.corr(x, y).round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-0.23, 0.48] 0.439 0.302 0.121 3. Spearman correlation (robust to outliers) >>> pg.corr(x, y, method="spearman").round(3) n r CI95% p-val power spearman 30 0.401 [0.05, 0.67] 0.028 0.61 4. Biweight midcorrelation (robust) >>> pg.corr(x, y, method="bicor").round(3) n r CI95% p-val power bicor 30 0.393 [0.04, 0.66] 0.031 0.592 5. Percentage bend correlation (robust) >>> pg.corr(x, y, method='percbend').round(3) n r CI95% p-val power percbend 30 0.389 [0.03, 0.66] 0.034 0.581 6. Shepherd's pi correlation (robust) >>> pg.corr(x, y, method='shepherd').round(3) n outliers r CI95% p-val power shepherd 30 2 0.437 [0.08, 0.7] 0.02 0.662 7. Skipped spearman correlation (robust) >>> pg.corr(x, y, method='skipped').round(3) n outliers r CI95% p-val power skipped 30 2 0.437 [0.08, 0.7] 0.02 0.662 8. One-tailed Pearson correlation >>> pg.corr(x, y, alternative="greater", method='pearson').round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-0.17, 1.0] 0.22 0.467 0.194 >>> pg.corr(x, y, alternative="less", method='pearson').round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-1.0, 0.43] 0.78 0.137 0.008 9. Perfect correlation >>> pg.corr(x, -x).round(3) n r CI95% p-val BF10 power pearson 30 -1.0 [-1.0, -1.0] 0.0 inf 1 10. Using columns of a pandas dataframe >>> import pandas as pd >>> data = pd.DataFrame({'x': x, 'y': y}) >>> pg.corr(data['x'], data['y']).round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-0.23, 0.48] 0.439 0.302 0.121
def corr(x, y, alternative="two-sided", method="pearson", **kwargs): """(Robust) correlation between two variables. Parameters ---------- x, y : array_like First and second set of observations. ``x`` and ``y`` must be independent. alternative : string Defines the alternative hypothesis, or tail of the correlation. Must be one of "two-sided" (default), "greater" or "less". Both "greater" and "less" return a one-sided p-value. "greater" tests against the alternative hypothesis that the correlation is positive (greater than zero), "less" tests against the hypothesis that the correlation is negative. method : string Correlation type: * ``'pearson'``: Pearson :math:`r` product-moment correlation * ``'spearman'``: Spearman :math:`\\rho` rank-order correlation * ``'kendall'``: Kendall's :math:`\\tau_B` correlation (for ordinal data) * ``'bicor'``: Biweight midcorrelation (robust) * ``'percbend'``: Percentage bend correlation (robust) * ``'shepherd'``: Shepherd's pi correlation (robust) * ``'skipped'``: Skipped correlation (robust) **kwargs : optional Optional argument(s) passed to the lower-level correlation functions. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'n'``: Sample size (after removal of missing values) * ``'outliers'``: number of outliers, only if a robust method was used * ``'r'``: Correlation coefficient * ``'CI95%'``: 95% parametric confidence intervals around :math:`r` * ``'p-val'``: p-value * ``'BF10'``: Bayes Factor of the alternative hypothesis (only for Pearson correlation) * ``'power'``: achieved power of the test with an alpha of 0.05. See also -------- pairwise_corr : Pairwise correlation between columns of a pandas DataFrame partial_corr : Partial correlation rm_corr : Repeated measures correlation Notes ----- The `Pearson correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_ measures the linear relationship between two datasets. Strictly speaking, Pearson's correlation requires that each dataset be normally distributed. Correlations of -1 or +1 imply a perfect negative and positive linear relationship, respectively, with 0 indicating the absence of association. .. math:: r_{xy} = \\frac{\\sum_i(x_i - \\bar{x})(y_i - \\bar{y})} {\\sqrt{\\sum_i(x_i - \\bar{x})^2} \\sqrt{\\sum_i(y_i - \\bar{y})^2}} = \\frac{\\text{cov}(x, y)}{\\sigma_x \\sigma_y} where :math:`\\text{cov}` is the sample covariance and :math:`\\sigma` is the sample standard deviation. If ``method='pearson'``, The Bayes Factor is calculated using the :py:func:`pingouin.bayesfactor_pearson` function. The `Spearman correlation coefficient <https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient>`_ is a non-parametric measure of the monotonicity of the relationship between two datasets. Unlike the Pearson correlation, the Spearman correlation does not assume that both datasets are normally distributed. Correlations of -1 or +1 imply an exact negative and positive monotonic relationship, respectively. Mathematically, the Spearman correlation coefficient is defined as the Pearson correlation coefficient between the `rank variables <https://en.wikipedia.org/wiki/Ranking>`_. The `Kendall correlation coefficient <https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient>`_ is a measure of the correspondence between two rankings. Values also range from -1 (perfect disagreement) to 1 (perfect agreement), with 0 indicating the absence of association. Consistent with :py:func:`scipy.stats.kendalltau`, Pingouin returns the Tau-b coefficient, which adjusts for ties: .. math:: \\tau_B = \\frac{(P - Q)}{\\sqrt{(P + Q + T) (P + Q + U)}} where :math:`P` is the number of concordant pairs, :math:`Q` the number of discordand pairs, :math:`T` the number of ties in x, and :math:`U` the number of ties in y. The `biweight midcorrelation <https://en.wikipedia.org/wiki/Biweight_midcorrelation>`_ and percentage bend correlation [1]_ are both robust methods that protects against *univariate* outliers by down-weighting observations that deviate too much from the median. The Shepherd pi [2]_ correlation and skipped [3]_, [4]_ correlation are both robust methods that returns the Spearman correlation coefficient after removing *bivariate* outliers. Briefly, the Shepherd pi uses a bootstrapping of the Mahalanobis distance to identify outliers, while the skipped correlation is based on the minimum covariance determinant (which requires scikit-learn). Note that these two methods are significantly slower than the previous ones. The confidence intervals for the correlation coefficient are estimated using the Fisher transformation. .. important:: Rows with missing values (NaN) are automatically removed. References ---------- .. [1] Wilcox, R.R., 1994. The percentage bend correlation coefficient. Psychometrika 59, 601–616. https://doi.org/10.1007/BF02294395 .. [2] Schwarzkopf, D.S., De Haas, B., Rees, G., 2012. Better ways to improve standards in brain-behavior correlation analysis. Front. Hum. Neurosci. 6, 200. https://doi.org/10.3389/fnhum.2012.00200 .. [3] Rousselet, G.A., Pernet, C.R., 2012. Improving standards in brain-behavior correlation analyses. Front. Hum. Neurosci. 6, 119. https://doi.org/10.3389/fnhum.2012.00119 .. [4] Pernet, C.R., Wilcox, R., Rousselet, G.A., 2012. Robust correlation analyses: false positive and power validation using a new open source matlab toolbox. Front. Psychol. 3, 606. https://doi.org/10.3389/fpsyg.2012.00606 Examples -------- 1. Pearson correlation >>> import numpy as np >>> import pingouin as pg >>> # Generate random correlated samples >>> np.random.seed(123) >>> mean, cov = [4, 6], [(1, .5), (.5, 1)] >>> x, y = np.random.multivariate_normal(mean, cov, 30).T >>> # Compute Pearson correlation >>> pg.corr(x, y).round(3) n r CI95% p-val BF10 power pearson 30 0.491 [0.16, 0.72] 0.006 8.55 0.809 2. Pearson correlation with two outliers >>> x[3], y[5] = 12, -8 >>> pg.corr(x, y).round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-0.23, 0.48] 0.439 0.302 0.121 3. Spearman correlation (robust to outliers) >>> pg.corr(x, y, method="spearman").round(3) n r CI95% p-val power spearman 30 0.401 [0.05, 0.67] 0.028 0.61 4. Biweight midcorrelation (robust) >>> pg.corr(x, y, method="bicor").round(3) n r CI95% p-val power bicor 30 0.393 [0.04, 0.66] 0.031 0.592 5. Percentage bend correlation (robust) >>> pg.corr(x, y, method='percbend').round(3) n r CI95% p-val power percbend 30 0.389 [0.03, 0.66] 0.034 0.581 6. Shepherd's pi correlation (robust) >>> pg.corr(x, y, method='shepherd').round(3) n outliers r CI95% p-val power shepherd 30 2 0.437 [0.08, 0.7] 0.02 0.662 7. Skipped spearman correlation (robust) >>> pg.corr(x, y, method='skipped').round(3) n outliers r CI95% p-val power skipped 30 2 0.437 [0.08, 0.7] 0.02 0.662 8. One-tailed Pearson correlation >>> pg.corr(x, y, alternative="greater", method='pearson').round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-0.17, 1.0] 0.22 0.467 0.194 >>> pg.corr(x, y, alternative="less", method='pearson').round(3) n r CI95% p-val BF10 power pearson 30 0.147 [-1.0, 0.43] 0.78 0.137 0.008 9. Perfect correlation
(x, y, alternative='two-sided', method='pearson', **kwargs)
[ -0.02443242445588112, -0.014524444937705994, 0.06436920166015625, -0.021002739667892456, 0.0243888720870018, -0.04638240858912468, -0.04117799922823906, 0.04106912016868591, 0.09302613139152527, -0.015743888914585114, -0.016005197539925575, 0.009554123505949974, 0.019151797518134117, 0.04747119918465614, -0.06040601059794426, 0.00790460780262947, -0.04842933267354965, -0.003949582111090422, -0.026370467618107796, -0.027894772589206696, 0.010555808432400227, 0.01817188784480095, -0.05526692792773247, 0.028286736458539963, -0.0076432982459664345, 0.0062060970813035965, -0.016919780522584915, -0.0050710346549749374, -0.0070934598334133625, 0.05923011898994446, 0.009554123505949974, -0.044379036873579025, -0.030594969168305397, 0.007033576723188162, 0.010969548486173153, -0.028852907940745354, 0.0658935084939003, -0.004355155862867832, -0.04233211278915405, 0.029135992750525475, -0.04113444685935974, -0.010038633830845356, 0.018215438351035118, -0.021939096972346306, -0.027328602969646454, 0.04122155159711838, -0.025151025503873825, 0.04668727144598961, -0.040677156299352646, 0.03349114954471588, 0.02441064827144146, -0.08906293660402298, -0.010310831479728222, 0.0041237883269786835, -0.009162158705294132, 0.044988758862018585, -0.013838507235050201, 0.08135431259870529, -0.008318347856402397, -0.04122155159711838, 0.03747611492872238, 0.00610810611397028, -0.02804720401763916, -0.004257164895534515, 0.03344759717583656, -0.011258077807724476, 0.002493326785042882, -0.01062113605439663, 0.03573405370116234, -0.043159592896699905, -0.012314203195273876, 0.07778308540582657, -0.009298257529735565, -0.019761519506573677, 0.009956974536180496, -0.018444085493683815, 0.007866499945521355, 0.0026580060366541147, 0.02377915009856224, 0.002712445566430688, -0.038325369358062744, 0.026022056117653847, 0.06689519435167313, -0.04082958400249481, 0.014861969277262688, -0.02658822573721409, -0.011018544435501099, 0.020251475274562836, 0.03749789297580719, -0.030028799548745155, -0.044640347361564636, -0.018792496994137764, 0.07425540685653687, 0.005076478701084852, -0.012259763665497303, -0.011944014579057693, 0.01297836471349001, 0.010958660393953323, 0.05217476561665535, -0.024497751146554947, -0.041635289788246155, 0.030594969168305397, 0.013381216675043106, 0.041330426931381226, 0.01936955563724041, 0.043812867254018784, -0.020948300138115883, 0.025390557944774628, -0.02032768912613392, -0.012107333168387413, -0.057488057762384415, -0.04424838349223137, 0.06463051587343216, -0.029135992750525475, 0.010321719571948051, -0.028439167886972427, -0.07630232721567154, 0.0351678840816021, -0.005375895649194717, 0.016288282349705696, 0.016397161409258842, 0.0018822439014911652, -0.021111616864800453, -0.027089068666100502, 0.022472603246569633, -0.020175259560346603, 0.0066633885726332664, 0.01873805746436119, -0.016331834718585014, 0.036735739558935165, 0.04124332591891289, -0.02347428910434246, 0.0026022056117653847, -0.009532347321510315, -0.004379653371870518, 0.03839069977402687, 0.028787579387426376, 0.002097279764711857, 0.05086822062730789, -0.03815116360783577, 0.0888887271285057, 0.031291794031858444, -0.00201425957493484, 0.02347428910434246, 0.0026539231184870005, 0.06950828433036804, 0.03407909348607063, -0.024563079699873924, 0.021732227876782417, 0.002112250542268157, 0.015787439420819283, -0.03569050133228302, 0.08566591143608093, -0.02258148230612278, 0.016124963760375977, -0.06841950118541718, -0.012139996513724327, -0.024323545396327972, -0.04969232901930809, -0.011100203730165958, 0.02593495324254036, -0.04903905466198921, 0.06275779753923416, -0.0013181151589378715, 0.04278940707445145, -0.016288282349705696, 0.026980189606547356, -0.04335557669401169, 0.006440186873078346, -0.04453146830201149, -0.05051980912685394, -0.04309426620602608, -0.05396037921309471, -0.04248454421758652, -0.006325863767415285, 0.03268544375896454, -0.034035541117191315, -0.055354028940200806, -0.017551278695464134, 0.008459890261292458, 0.007665074430406094, -0.03721480816602707, 0.011356068775057793, -0.02560831606388092, -0.044379036873579025, 0.07717335969209671, 0.08266085386276245, -0.04248454421758652, 0.06593705713748932, 0.006815819069743156, -0.01462243590503931, 0.0071533434092998505, -0.010724571533501148, 0.09337454289197922, 0.05496206507086754, -0.07686849683523178, 0.06153834983706474, -0.010321719571948051, 0.01906469464302063, -0.033142734318971634, 0.013903834857046604, 0.02077409252524376, 0.0314224474132061, -0.011203638277947903, 0.06676454097032547, 0.005754249636083841, -0.021089842543005943, 0.009499683976173401, 0.0018972147954627872, 0.00040863611502572894, 0.052610281854867935, -0.010789898224174976, -0.005797801073640585, -0.028482718393206596, -0.035538069903850555, 0.0476018525660038, 0.07577971369028091, -0.09110985696315765, -0.0053160120733082294, 0.029789265245199203, 0.059273671358823776, -0.00490227248519659, -0.015635009855031967, 0.01857473887503147, -0.030246557667851448, 0.015907207503914833, -0.022733913734555244, 0.04065537825226784, 0.0766942948102951, -0.11445349454879761, 0.003922362346202135, 0.019097357988357544, -0.00022201087267603725, -0.030007023364305496, -0.0316619835793972, -0.10548187047243118, -0.009559567086398602, 0.042223233729600906, -0.028308512642979622, 0.0513472855091095, -0.011181862093508244, 0.013827620074152946, 0.011802472174167633, 0.03442750498652458, -0.04842933267354965, -0.0029860036447644234, 0.024933267384767532, 0.008601432666182518, 0.03296852856874466, -0.005661702714860439, -0.01782347448170185, -0.0719907283782959, 0.014295798726379871, -0.014067153446376324, 0.02985459379851818, -0.04581623896956444, -0.002723333425819874, -0.010849782265722752, 0.041330426931381226, 0.01780170015990734, 0.00406934879720211, 0.009842651896178722, -0.05548468604683876, 0.04305071383714676, -0.014437341131269932, -0.03137889876961708, -0.07142455875873566, 0.009684777818620205, 0.0253252312541008, -0.011388732120394707, 0.010544921271502972, -0.008879073895514011, -0.04093846306204796, 0.006521845702081919, -0.04490165784955025, 0.027981875464320183, 0.016070524230599403, -0.01092599704861641, 0.0426805280148983, -0.015722112730145454, 0.009341808967292309, 0.009412580169737339, 0.002474272856488824, -0.022429052740335464, 0.02382270246744156, 0.007213226985186338, -0.04886484891176224, -0.015863655135035515, 0.037062376737594604, 0.02469373308122158, 0.014078041538596153, -0.07956869900226593, -0.005218021105974913, 0.03275077044963837, 0.0469050295650959, 0.048037368804216385, -0.018073895946145058, -0.0665903314948082, -0.009292813949286938, -0.03268544375896454, 0.024018684402108192, 0.004390541464090347, 0.04411773011088371, -0.0005974729428999126, 0.0332951657474041, -0.00813869759440422, 0.08766928315162659, -0.05957853049039841, -0.03022478148341179, 0.034623488783836365, 0.0006655222387053072, -0.028243185952305794, -0.000395706738345325, -0.016266506165266037, -0.004973043687641621, -0.043769314885139465, 0.012270651757717133, -0.009472464211285114, 0.041352204978466034, -0.010991324670612812, -0.0164189375936985, -0.051434390246868134, 0.06210452318191528, 0.04638240858912468, 0.004624631255865097, 0.016636695712804794, -0.05517982318997383, 0.053568415343761444, -0.019913949072360992, 0.019097357988357544, -0.012847709469497204, 0.002739665098488331, -0.02957150712609291, 0.04673082008957863, 0.041918374598026276, 0.00437420979142189, 0.03921817988157272, -0.03749789297580719, 0.054134584963321686, -0.018063008785247803, 0.035777606070041656, -0.026022056117653847, 0.022733913734555244, -0.010958660393953323, -0.03144422546029091, 0.035799380391836166, 0.007311217952519655, 0.006211541127413511, 0.030965158715844154, -0.046513065695762634, 0.0029397301841527224, 0.009385360404849052, 0.012629952281713486, 0.056268613785505295, -0.029223095625638962, 0.06071087345480919, -0.033055633306503296, 0.02436709590256214, 0.05400393158197403, 0.03804228454828262, -0.0426805280148983, 0.005933899898082018, 0.01784525066614151, 0.019685303792357445, -0.04847288504242897, 0.07447316497564316, -0.0874515250325203, 0.05622506141662598, -0.05796712264418602, -0.01892315223813057, -0.008274796418845654, -0.04629530757665634, -0.01772548444569111, 0.0066633885726332664, -0.011410508304834366, 0.02229839749634266, 0.0034487389493733644, -0.014001825824379921, 0.01310901902616024, -0.020131707191467285, 0.010490481741726398, -0.016527816653251648, -0.07007445394992828, 0.01707221008837223, -0.06297555565834045, 0.007033576723188162, -0.03512433171272278, -0.017747260630130768, -0.06985669583082199, -0.016495153307914734, -0.012325091287493706, -0.06785332411527634, 0.052915144711732864, -0.014208695851266384, -0.06789688020944595, 0.0006474891561083496, 0.016549592837691307, 0.04154818505048752, -0.021470917388796806, -0.008699423633515835, 0.030355436727404594, -0.014099816791713238, 0.013305000960826874, -0.01749683916568756, 0.006968249101191759, -0.008160472847521305, 0.04882129654288292, -0.039827898144721985, 0.01751861348748207, 0.0016726520843803883, -0.07186006754636765, 0.031901516020298004, 0.03721480816602707, -0.024279993027448654, -0.024824388325214386, 0.07586681097745895, -0.04799381643533707, 0.001209236215800047, 0.07355858385562897, 0.009869871661067009, 0.03390488773584366, -0.0733843743801117, 0.015286596491932869, 0.033665355294942856, 0.015798328444361687, 0.0019979276694357395, 0.015210381709039211, -0.031030485406517982, 0.013043691404163837, -0.021187832579016685, 0.005147249903529882, 0.0007301690638996661, -0.04233211278915405, -0.0065871733240783215, 0.00753986369818449, -0.021089842543005943, -0.024889715015888214, 0.05117307975888252, -0.005155415739864111, -0.02040390484035015, -0.019924838095903397, 0.02898356132209301, -0.01672379858791828, -0.07965579628944397, -0.09494239836931229, -0.006494625937193632, 0.018367869779467583, -0.0879305973649025, -0.025804297998547554, -0.011682705022394657, 0.049518123269081116, -0.014883744530379772, 0.03242413327097893, 0.06837594509124756, -0.0368228405714035, 0.005841352511197329, -0.012379530817270279, 0.007354769390076399, -0.04664371907711029, -0.05426524206995964, -0.015656786039471626, 0.01016384456306696, -0.0396319180727005, -0.005419447086751461, -0.017126649618148804, 0.08662404865026474, 0.008285683579742908, 0.013522759079933167, -0.036104243248701096, 0.034950125962495804, -0.007871944457292557, -0.033077407628297806, -0.058446191251277924, 0.021917320787906647, 0.01282593421638012, 0.05117307975888252, -0.03508077934384346, 0.05848974362015724, -0.020251475274562836, -0.012303315103054047, -0.05391683056950569, -0.0008710311376489699, -0.036452654749155045, -0.026348693296313286, 0.05191345885396004, -0.07935094088315964, -0.024454200640320778, -0.026152711361646652, 0.013207009993493557, -0.012466633692383766, 0.07133745402097702, 0.05757515877485275, -0.034601714462041855, 0.043399129062891006, -0.024171113967895508, 0.04106912016868591, 0.008481665514409542, -0.07769598066806793, 0.027524584904313087, -0.009423468261957169, 0.035538069903850555, -0.008323791436851025, -0.06136414408683777, -0.019924838095903397, 0.03651798143982887, -0.0689421147108078, -0.03571227937936783, 0.02567364275455475, -0.015798328444361687, 0.021884657442569733, -0.029157768934965134, -0.022243957966566086, 0.06654678285121918, -0.022200407460331917, -0.010229172185063362, 0.010708238929510117, 0.0056399269960820675, 0.012466633692383766, -0.031030485406517982, 0.0004936977638863027, 0.02209152840077877, 0.03575582802295685, -0.005522882100194693, 0.07564905285835266, 0.01568944938480854, 0.017159314826130867, 0.04331202432513237, -0.04494520649313927, 0.010425154119729996, -0.004469478502869606, -0.047688957303762436, -0.013522759079933167, -0.03392666205763817, 0.008193137124180794, -0.022058865055441856, 0.012564624659717083, -0.07913318276405334, -0.051739249378442764, 0.032837875187397, -0.00556915532797575, -0.001491640810854733, 0.01448089350014925, 0.01896670274436474, 0.00837278738617897, 0.03865200653672218, -0.0073819891549646854, 0.00008051084296312183, -0.04969232901930809, -0.011802472174167633, 0.03044253960251808, 0.06201741844415665, -0.056529924273490906, 0.03052964247763157, 0.023016998544335365, -0.032837875187397, -0.005419447086751461, -0.0022007147781550884, -0.007534419652074575, 0.0008152307127602398, -0.004572913516312838, -0.012586399912834167, -0.03806406259536743, 0.015384587459266186, -0.07212138175964355, 0.035821154713630676, 0.09128406643867493, 0.050171393901109695, 0.029941696673631668, -0.034884799271821976, -0.05243607610464096, -0.029527956619858742, 0.06933408230543137, -0.01751861348748207, 0.03998032957315445, 0.004744397941976786, 0.04422660544514656, 0.008443558588624, -0.06632902473211288, -0.03943593427538872, -0.06650322675704956, 0.002483799820765853, -0.013588085770606995, 0.05404748395085335, -0.04329025000333786, -0.014513556845486164, 0.03388311341404915, -0.08658050000667572, 0.038847990334033966, 0.04274585470557213, -0.01634272187948227, -0.03786807879805565, -0.007964490912854671, -0.03020300529897213, -0.09511660039424896, 0.03806406259536743, 0.0658935084939003, -0.007365657482296228, 0.021656012162566185, 0.06859370321035385, 0.014426453970372677, 0.0065109580755233765, 0.010931440629065037, 0.007877388037741184, -0.023888029158115387, -0.02030591480433941, 0.01666935905814171, -0.015395475551486015, -0.05496206507086754, 0.04603399708867073, -0.017856139689683914, -0.04485810548067093, -0.011867799796164036, -0.018955815583467484, -0.04599044471979141, 0.022265734151005745, -0.03397021442651749, -0.018019456416368484, -0.009036947973072529, -0.02471550926566124, 0.015025287866592407, 0.013500982895493507, -0.01660403236746788, 0.018868712708353996, 0.05448300018906593, -0.023060550913214684, 0.05953497812151909, -0.020175259560346603, -0.04170061647891998, -0.031836189329624176, -0.02040390484035015, 0.012760606594383717, -0.03416619822382927, 0.056050855666399, -0.007115236017853022, -0.026653554290533066, 0.0012269290164113045, 0.0567476786673069, 0.023038774728775024, -0.027938324958086014, 0.03956659138202667, -0.013664301484823227, -0.003680106718093157, -0.003465070854872465, 0.0469050295650959, -0.027568135410547256, -0.018215438351035118, -0.03603891283273697, -0.040132761001586914, 0.057923574000597, -0.04664371907711029, 0.006075442302972078, 0.027023741975426674, -0.013381216675043106, -0.0032282592728734016, -0.022951671853661537, -0.0384560264647007, 0.03394844010472298, 0.02180844359099865, 0.015036175027489662, -0.0038978643715381622, 0.0363437756896019, 0.029745714738965034, 0.0059175677597522736, 0.0004763451579492539, 0.023343635722994804, 0.027872996404767036, 0.020229699090123177, -0.01866184175014496, 0.005237075034528971, -0.005000263452529907, 0.06254003942012787, 0.04357333481311798, -0.016310058534145355, -0.012989251874387264, -0.0015243045054376125, -0.02178666740655899, -0.04812447354197502, 0.009750105440616608, -0.018139224499464035, 0.012433969415724277, 0.057923574000597, 0.021732227876782417, -0.006962805520743132, -0.031574878841638565, 0.027960101142525673, 0.024149339646100998, 0.03159665688872337, 0.0035712276585400105, -0.02436709590256214, -0.04638240858912468, 0.02804720401763916, 0.00254096114076674, 0.018650954589247704, -0.003375245723873377, 0.02809075452387333, 0.005049258936196566, -0.07146810740232468, -0.01650604046881199, 0.018226327374577522, -0.020741429179906845, 0.034884799271821976, -0.0014412844320759177, 0.039827898144721985, 0.04298538714647293, -0.04607754945755005, 0.05056335777044296, 0.00015727896243333817, -0.017170201987028122, 0.022363724187016487, -0.03079095110297203, -0.028243185952305794, 0.056529924273490906, 0.02343073859810829, -0.03902219608426094, -0.01601608470082283, 0.017061322927474976, -0.023888029158115387, 0.0023994187358766794, -0.02441064827144146, -0.03209749981760979, 0.023408962413668633, 0.04485810548067093, 0.0029587838798761368, 0.013544534333050251, 0.07708625495433807, -0.01678912527859211, 0.12577690184116364, -0.018444085493683815, -0.031030485406517982, -0.02075231820344925, 0.03220637887716293, -0.004572913516312838, 0.014905520714819431, 0.038238268345594406, -0.01697422005236149, -0.0025259903632104397, 0.029419077560305595, -0.05422168970108032, 0.05983984097838402, 0.01855296455323696, -0.04372576251626015, -0.027045518159866333, 0.01309813093394041, -0.0715116560459137, 0.01705043576657772, 0.03956659138202667, 0.003617501351982355, -0.02898356132209301, 0.03288142755627632, -0.01922801323235035, 0.005062868818640709, 0.006456518545746803, -0.004877774510532618, -0.004926769994199276, -0.03900042176246643, 0.015025287866592407, -0.0026797817554324865, 0.006690608337521553, 0.0042163352482020855, -0.03625667095184326, -0.02989814430475235, -0.003720936132594943, 0.012771494686603546, 0.045903343707323074, 0.03416619822382927, 0.027655240148305893, 0.02774234302341938, 0.08000421524047852 ]
32,001
pingouin.reliability
cronbach_alpha
Cronbach's alpha reliability measure. Parameters ---------- data : :py:class:`pandas.DataFrame` Wide or long-format dataframe. items : str Column in ``data`` with the items names (long-format only). scores : str Column in ``data`` with the scores (long-format only). subject : str Column in ``data`` with the subject identifier (long-format only). nan_policy : bool If `'listwise'`, remove the entire rows that contain missing values (= listwise deletion). If `'pairwise'` (default), only pairwise missing values are removed when computing the covariance matrix. For more details, please refer to the :py:meth:`pandas.DataFrame.cov` method. ci : float Confidence interval (.95 = 95%) Returns ------- alpha : float Cronbach's alpha Notes ----- This function works with both wide and long format dataframe. If you pass a long-format dataframe, you must also pass the ``items``, ``scores`` and ``subj`` columns (in which case the data will be converted into wide format using the :py:meth:`pandas.DataFrame.pivot` method). Internal consistency is usually measured with Cronbach's alpha [1]_, a statistic calculated from the pairwise correlations between items. Internal consistency ranges between negative infinity and one. Coefficient alpha will be negative whenever there is greater within-subject variability than between-subject variability. Cronbach's :math:`\alpha` is defined as .. math:: \alpha ={k \over k-1}\left(1-{\sum_{{i=1}}^{k}\sigma_{{y_{i}}}^{2} \over\sigma_{x}^{2}}\right) where :math:`k` refers to the number of items, :math:`\sigma_{x}^{2}` is the variance of the observed total scores, and :math:`\sigma_{{y_{i}}}^{2}` the variance of component :math:`i` for the current sample of subjects. Another formula for Cronbach's :math:`\alpha` is .. math:: \alpha = \frac{k \times \bar c}{\bar v + (k - 1) \times \bar c} where :math:`\bar c` refers to the average of all covariances between items and :math:`\bar v` to the average variance of each item. 95% confidence intervals are calculated using Feldt's method [2]_: .. math:: c_L = 1 - (1 - \alpha) \cdot F_{(0.025, n-1, (n-1)(k-1))} c_U = 1 - (1 - \alpha) \cdot F_{(0.975, n-1, (n-1)(k-1))} where :math:`n` is the number of subjects and :math:`k` the number of items. Results have been tested against the `psych <https://cran.r-project.org/web/packages/psych/psych.pdf>`_ R package. References ---------- .. [1] http://www.real-statistics.com/reliability/cronbachs-alpha/ .. [2] Feldt, Leonard S., Woodruff, David J., & Salih, Fathi A. (1987). Statistical inference for coefficient alpha. Applied Psychological Measurement, 11(1):93-103. Examples -------- Binary wide-format dataframe (with missing values) >>> import pingouin as pg >>> data = pg.read_dataset('cronbach_wide_missing') >>> # In R: psych:alpha(data, use="pairwise") >>> pg.cronbach_alpha(data=data) (0.732660835214447, array([0.435, 0.909])) After listwise deletion of missing values (remove the entire rows) >>> # In R: psych:alpha(data, use="complete.obs") >>> pg.cronbach_alpha(data=data, nan_policy='listwise') (0.8016949152542373, array([0.581, 0.933])) After imputing the missing values with the median of each column >>> pg.cronbach_alpha(data=data.fillna(data.median())) (0.7380191693290734, array([0.447, 0.911])) Likert-type long-format dataframe >>> data = pg.read_dataset('cronbach_alpha') >>> pg.cronbach_alpha(data=data, items='Items', scores='Scores', ... subject='Subj') (0.5917188485995826, array([0.195, 0.84 ]))
def cronbach_alpha( data=None, items=None, scores=None, subject=None, nan_policy="pairwise", ci=0.95 ): """Cronbach's alpha reliability measure. Parameters ---------- data : :py:class:`pandas.DataFrame` Wide or long-format dataframe. items : str Column in ``data`` with the items names (long-format only). scores : str Column in ``data`` with the scores (long-format only). subject : str Column in ``data`` with the subject identifier (long-format only). nan_policy : bool If `'listwise'`, remove the entire rows that contain missing values (= listwise deletion). If `'pairwise'` (default), only pairwise missing values are removed when computing the covariance matrix. For more details, please refer to the :py:meth:`pandas.DataFrame.cov` method. ci : float Confidence interval (.95 = 95%) Returns ------- alpha : float Cronbach's alpha Notes ----- This function works with both wide and long format dataframe. If you pass a long-format dataframe, you must also pass the ``items``, ``scores`` and ``subj`` columns (in which case the data will be converted into wide format using the :py:meth:`pandas.DataFrame.pivot` method). Internal consistency is usually measured with Cronbach's alpha [1]_, a statistic calculated from the pairwise correlations between items. Internal consistency ranges between negative infinity and one. Coefficient alpha will be negative whenever there is greater within-subject variability than between-subject variability. Cronbach's :math:`\\alpha` is defined as .. math:: \\alpha ={k \\over k-1}\\left(1-{\\sum_{{i=1}}^{k}\\sigma_{{y_{i}}}^{2} \\over\\sigma_{x}^{2}}\\right) where :math:`k` refers to the number of items, :math:`\\sigma_{x}^{2}` is the variance of the observed total scores, and :math:`\\sigma_{{y_{i}}}^{2}` the variance of component :math:`i` for the current sample of subjects. Another formula for Cronbach's :math:`\\alpha` is .. math:: \\alpha = \\frac{k \\times \\bar c}{\\bar v + (k - 1) \\times \\bar c} where :math:`\\bar c` refers to the average of all covariances between items and :math:`\\bar v` to the average variance of each item. 95% confidence intervals are calculated using Feldt's method [2]_: .. math:: c_L = 1 - (1 - \\alpha) \\cdot F_{(0.025, n-1, (n-1)(k-1))} c_U = 1 - (1 - \\alpha) \\cdot F_{(0.975, n-1, (n-1)(k-1))} where :math:`n` is the number of subjects and :math:`k` the number of items. Results have been tested against the `psych <https://cran.r-project.org/web/packages/psych/psych.pdf>`_ R package. References ---------- .. [1] http://www.real-statistics.com/reliability/cronbachs-alpha/ .. [2] Feldt, Leonard S., Woodruff, David J., & Salih, Fathi A. (1987). Statistical inference for coefficient alpha. Applied Psychological Measurement, 11(1):93-103. Examples -------- Binary wide-format dataframe (with missing values) >>> import pingouin as pg >>> data = pg.read_dataset('cronbach_wide_missing') >>> # In R: psych:alpha(data, use="pairwise") >>> pg.cronbach_alpha(data=data) (0.732660835214447, array([0.435, 0.909])) After listwise deletion of missing values (remove the entire rows) >>> # In R: psych:alpha(data, use="complete.obs") >>> pg.cronbach_alpha(data=data, nan_policy='listwise') (0.8016949152542373, array([0.581, 0.933])) After imputing the missing values with the median of each column >>> pg.cronbach_alpha(data=data.fillna(data.median())) (0.7380191693290734, array([0.447, 0.911])) Likert-type long-format dataframe >>> data = pg.read_dataset('cronbach_alpha') >>> pg.cronbach_alpha(data=data, items='Items', scores='Scores', ... subject='Subj') (0.5917188485995826, array([0.195, 0.84 ])) """ # Safety check assert isinstance(data, pd.DataFrame), "data must be a dataframe." assert nan_policy in ["pairwise", "listwise"] if all([v is not None for v in [items, scores, subject]]): # Data in long-format: we first convert to a wide format data = data.pivot(index=subject, values=scores, columns=items) # From now we assume that data is in wide format n, k = data.shape assert k >= 2, "At least two items are required." assert n >= 2, "At least two raters/subjects are required." err = "All columns must be numeric." assert all([data[c].dtype.kind in "bfiu" for c in data.columns]), err if data.isna().any().any() and nan_policy == "listwise": # In R = psych:alpha(data, use="complete.obs") data = data.dropna(axis=0, how="any") # Compute covariance matrix and Cronbach's alpha C = data.cov(numeric_only=True) cronbach = (k / (k - 1)) * (1 - np.trace(C) / C.sum().sum()) # which is equivalent to # v = np.diag(C).mean() # c = C.to_numpy()[np.tril_indices_from(C, k=-1)].mean() # cronbach = (k * c) / (v + (k - 1) * c) # Confidence intervals alpha = 1 - ci df1 = n - 1 df2 = df1 * (k - 1) lower = 1 - (1 - cronbach) * f.isf(alpha / 2, df1, df2) upper = 1 - (1 - cronbach) * f.isf(1 - alpha / 2, df1, df2) return cronbach, np.round([lower, upper], 3)
(data=None, items=None, scores=None, subject=None, nan_policy='pairwise', ci=0.95)
[ 0.010612637735903263, 0.03520142659544945, -0.0009864632738754153, -0.007791302632540464, 0.027229398488998413, -0.08012190461158752, -0.02536189556121826, -0.07317398488521576, 0.04815346375107765, -0.002159927738830447, -0.018654949963092804, 0.036687396466732025, 0.043093133717775345, 0.0027485426981002092, -0.08867627382278442, 0.02823343314230442, 0.026968348771333694, 0.04662733152508736, 0.0017884352710098028, 0.005271177738904953, -0.0220485832542181, -0.04907717555761337, -0.035241588950157166, 0.04180797189474106, 0.003393634455278516, 0.02947843447327614, 0.01982966810464859, -0.019508378580212593, -0.03148650377988815, 0.03724965453147888, 0.06120590493083, -0.001458359183743596, 0.008594529703259468, -0.04747072234749794, 0.012811471708118916, -0.008875659666955471, 0.012168890796601772, -0.08570433408021927, -0.027851900085806847, 0.050241854041814804, 0.02184777706861496, -0.002127296756953001, 0.07847528904676437, -0.06915785372257233, 0.0027711335569620132, 0.007304346188902855, 0.06807349622249603, 0.07602544128894806, 0.006320393178611994, -0.04313329607248306, -0.012650826945900917, -0.054458796977996826, 0.05241056904196739, -0.00352666899561882, -0.05859541520476341, 0.08682885020971298, -0.02132567949593067, 0.026406090706586838, 0.026265526190400124, -0.0717281773686409, 0.04486023262143135, -0.022128906100988388, 0.02536189556121826, -0.0002227700169896707, 0.03423755615949631, -0.008850558660924435, 0.0031526663806289434, -0.03558295965194702, -0.014508289285004139, -0.029398111626505852, 0.02281164936721325, 0.03222948685288429, -0.02996036969125271, -0.03042222559452057, -0.050241854041814804, 0.012058447115123272, -0.03140617907047272, -0.039518773555755615, 0.002861496526747942, 0.030241500586271286, 0.05413750559091568, 0.014628773555159569, 0.030201338231563568, -0.019909990951418877, 0.05570380017161369, -0.023434150964021683, -0.00014181977894622833, 0.0057129524648189545, -0.004360016901046038, 0.07377640902996063, -0.014377765357494354, -0.03319336101412773, 0.06642688065767288, -0.0007975794142112136, 0.030201338231563568, 0.004053786862641573, 0.02020116150379181, -0.005918779410421848, 0.02086382359266281, -0.001055490574799478, 0.026968348771333694, 0.02353455312550068, 0.03847457841038704, 0.0023845804389566183, -0.02349439263343811, -0.0067169866524636745, -0.027952302247285843, -0.0025653066113591194, -0.0049599274061620235, -0.047792013734579086, -0.09188918024301529, 0.023896006867289543, -0.001371761318296194, -0.04578394442796707, -0.015763331204652786, -0.03084392100572586, -0.06847511231899261, 0.028835851699113846, -0.04791249707341194, 0.021084710955619812, 0.028775610029697418, 0.007073418702930212, 0.021546566858887672, 0.018444102257490158, 0.03319336101412773, -0.04417749121785164, -0.009297353215515614, 0.004455400165170431, 0.009417837485671043, -0.0220485832542181, 0.02919730544090271, -0.03297247365117073, 0.019729265943169594, 0.0005371581064537168, 0.007710980251431465, -0.026225363835692406, 0.09662821888923645, -0.013433973304927349, 0.023855844512581825, -0.04843459278345108, 0.0517679862678051, -0.03066319413483143, -0.02016099914908409, -0.030482467263936996, 0.04598475247621536, -0.0423300676047802, 0.052571214735507965, -0.04875588417053223, -0.030763598158955574, -0.009417837485671043, 0.040683452039957047, 0.0003426265611778945, -0.07080446928739548, -0.06831446290016174, 0.1035359725356102, -0.04012119397521019, 0.0071236202493309975, -0.024357860907912254, -0.011747196316719055, -0.011707034893333912, -0.01426732074469328, 0.0019101743819192052, -0.03634602576494217, 0.034759651869535446, 0.0024837288074195385, 0.02234979346394539, -0.025020522996783257, 0.0006316000362858176, -0.0053063188679516315, -0.04445862025022507, -0.0002579111896920949, 0.011064453050494194, -0.058997031301259995, -0.001816046191379428, -0.022490357980132103, -0.013785384595394135, -0.06333445757627487, 0.005903718993067741, 0.05935848131775856, 0.00032442843075841665, -0.03560303896665573, -0.0456232987344265, -0.014086594805121422, -0.008735094219446182, -0.014417925849556923, 0.013092601671814919, 0.016415953636169434, 0.04823378846049309, 0.006621603388339281, 0.01605450175702572, -0.021185114979743958, -0.04514136165380478, 0.003993544727563858, 0.021667050197720528, -0.033333923667669296, -0.03702876716852188, -0.014468127861618996, 0.029578838497400284, -0.017118778079748154, -0.026867946609854698, -0.0030497529078274965, -0.0019578661303967237, 0.03303271532058716, -0.0037676370702683926, 0.058796223253011703, -0.024638991802930832, -0.06478026509284973, -0.022490357980132103, -0.005170774180442095, -0.02003047615289688, -0.035040780901908875, -0.0014169428031891584, -0.06196897104382515, -0.002344419015571475, -0.05180814862251282, -0.06682849675416946, 0.07642705738544464, -0.015783412382006645, 0.0498000793159008, 0.03712917119264603, 0.006395695731043816, -0.030341902747750282, 0.028594885021448135, 0.026867946609854698, 0.0522097609937191, 0.03988022357225418, 0.08433884382247925, 0.093013696372509, 0.00699811615049839, 0.002497534267604351, -0.022932132706046104, -0.0344383604824543, -0.007013176567852497, -0.05722992867231369, -0.014247240498661995, 0.005908739287406206, -0.03851474076509476, 0.04959927126765251, -0.06827430427074432, 0.05823396518826485, 0.03769143298268318, 0.016114743426442146, 0.027671173214912415, 0.05253105238080025, -0.012209052219986916, -0.05642670392990112, 0.01331348903477192, 0.047591205686330795, -0.041687484830617905, -0.018353739753365517, -0.05277201905846596, -0.021526485681533813, -0.004618555773049593, 0.007163781672716141, -0.0513262115418911, -0.03184795379638672, -0.02279156818985939, -0.005557327531278133, 0.03823360800743103, -0.006857551168650389, 0.03212908282876015, 0.006144687067717314, 0.004252083599567413, 0.055181700736284256, 0.002976960502564907, 0.03730989992618561, -0.06658752262592316, 0.015191032551229, 0.05317363515496254, 0.01461873296648264, -0.04482007026672363, 0.007394709624350071, 0.05907735228538513, 0.008539307862520218, -0.03939829021692276, 0.037591028958559036, -0.0031049747485667467, -0.0018210663693025708, -0.004877094645053148, -0.0275306086987257, -0.010331508703529835, 0.009141728281974792, -0.040462564677000046, -0.030201338231563568, 0.02090398594737053, -0.05951912701129913, -0.026406090706586838, -0.040221597999334335, -0.0033810839522629976, 0.029498515650629997, -0.006069384515285492, -0.05393669754266739, 0.031245533376932144, -0.017249301075935364, 0.10329500585794449, 0.014417925849556923, -0.020080678164958954, -0.06939882040023804, 0.10048370808362961, 0.02871536836028099, 0.03088408149778843, 0.006666784640401602, 0.06702929735183716, -0.047792013734579086, -0.06739075481891632, 0.007831464521586895, -0.03423755615949631, 0.04678797721862793, -0.02803262509405613, 0.001371761318296194, 0.03841433674097061, -0.014146837405860424, -0.020000355318188667, 0.011476106941699982, 0.0006883906899020076, -0.08747143298387527, 0.0043926481157541275, -0.01873527280986309, 0.05622589588165283, 0.011556429788470268, -0.02562294341623783, -0.02540205605328083, 0.06875623762607574, -0.004821872804313898, 0.008870638906955719, -0.023574715480208397, 0.030060773715376854, 0.017932044342160225, -0.013152843341231346, -0.004899685271084309, 0.02353455312550068, 0.044057004153728485, -0.01996019296348095, -0.000262460729572922, -0.07682867348194122, 0.04208910092711449, -0.013805465772747993, -0.007982069626450539, 0.021968260407447815, -0.03612513840198517, -0.0005726130912080407, 0.03945853188633919, 0.024257458746433258, 0.03779183328151703, 0.0004831913101952523, -0.026988429948687553, 0.0427718423306942, 0.02279156818985939, -0.015442040748894215, -0.005873598158359528, -0.002049484057351947, -0.0124500198289752, -0.0071085598319768906, 0.05630622059106827, 0.037390220910310745, 0.0033108016941696405, 0.02062285505235195, -0.09943951666355133, 0.05172782391309738, -0.02044213004410267, 0.07911787182092667, 0.0275306086987257, -0.025964315980672836, 0.024598829448223114, -0.03437811881303787, -0.01399623230099678, -0.030522629618644714, 0.011696994304656982, 0.014478168450295925, -0.018353739753365517, 0.035984572023153305, -0.009457998909056187, 0.03249053657054901, -0.018122810870409012, 0.016415953636169434, -0.005276198033243418, 0.031707391142845154, -0.025522541254758835, -0.0029518594965338707, 0.013835586607456207, 0.0124500198289752, -0.026426171883940697, -0.048314109444618225, 0.006350514013320208, -0.02371527999639511, 0.0213859211653471, -0.028876014053821564, -0.019779467955231667, 0.0013993722386658192, -0.02184777706861496, -0.0075151934288442135, -0.004116538912057877, 0.05955928936600685, -0.042370229959487915, -0.05321379378437996, 0.03805288299918175, 0.08192916214466095, -0.04417749121785164, -0.0020331686828285456, -0.012540383264422417, 0.013253247365355492, -0.011335542425513268, 0.022510439157485962, -0.015120750293135643, 0.010411831550300121, 0.022128906100988388, 0.030683275312185287, -0.039016757160425186, -0.040020789951086044, 0.051406532526016235, -0.017379825934767723, 0.04204893857240677, -0.04775185137987137, -0.00801721028983593, -0.021446162834763527, -0.010055399499833584, -0.013253247365355492, -0.08690916746854782, -0.02586391195654869, 0.027430204674601555, 0.007163781672716141, -0.07192898541688919, -0.0006507394718937576, 0.040763773024082184, 0.035502638667821884, 0.00938771665096283, 0.017118778079748154, -0.01353437639772892, -0.014176958240568638, -0.05016153305768967, -0.003350963117554784, -0.04931814223527908, -0.05558331310749054, -0.00574809405952692, -0.00648103840649128, 0.0024448223412036896, -0.03821352869272232, 0.03259094059467316, 0.04967959597706795, -0.01642599329352379, -0.017259342595934868, 0.055864445865154266, 0.049237821251153946, -0.04086417704820633, -0.06594494730234146, 0.02186785824596882, 0.04771168902516365, -0.034056827425956726, -0.04445862025022507, -0.017189059406518936, 0.02443818375468254, 0.04373571649193764, 0.0353219099342823, 0.05249089002609253, -0.04706910625100136, -0.0012337066000327468, 0.020472250878810883, -0.014397845603525639, 0.013052440248429775, 0.010532314889132977, 0.02112487331032753, 0.040703531354665756, -0.03042222559452057, 0.01091384794563055, 0.01520107313990593, 0.05670783296227455, 0.027410125359892845, 0.00032129083410836756, 0.010211024433374405, -0.0026857906486839056, 0.0240164902061224, -0.0027259518392384052, -0.010130701586604118, -0.0188657958060503, 0.04301280900835991, 0.04421764984726906, -0.009533301927149296, -0.010592557489871979, 0.015291435644030571, 0.01365486066788435, -0.001044822740368545, -0.0005926937446929514, 0.017158938571810722, 0.015713129192590714, 0.04032199829816818, -0.04180797189474106, -0.03913724049925804, -0.006531240418553352, -0.004922275897115469, -0.0216068085283041, -0.032249566167593, 0.0335548110306263, 0.049478787928819656, 0.11502212285995483, -0.023795602843165398, 0.004319855477660894, 0.059037189930677414, -0.004289734642952681, 0.042611196637153625, -0.05204911530017853, 0.04510119929909706, 0.026747461408376694, -0.07594512403011322, -0.0187553521245718, 0.0043499767780303955, -0.06124606728553772, -0.015191032551229, -0.034117069095373154, -0.004553293343633413, -0.04771168902516365, -0.008197936229407787, -0.05196879431605339, 0.06502123177051544, -0.050924599170684814, -0.030964404344558716, -0.016707124188542366, -0.02588399313390255, -0.026506494730710983, 0.005128102842718363, 0.010954009369015694, 0.04658717289566994, -0.023193182423710823, 0.032028678804636, 0.03841433674097061, -0.00687763188034296, 0.027851900085806847, 0.08112593740224838, -0.0037350058555603027, 0.011516268365085125, 0.04542249068617821, -0.050201691687107086, -0.007264184765517712, 0.045261844992637634, 0.03134593740105629, -0.014518329873681068, 0.01594405807554722, -0.036888204514980316, 0.00480932230129838, -0.026888025924563408, -0.007143700961023569, 0.000030160235837684013, 0.049518950283527374, 0.08289303630590439, -0.06903737038373947, 0.025502460077404976, 0.013012278825044632, -0.03843441605567932, -0.005948900710791349, 0.002981980564072728, 0.02895633690059185, 0.022410035133361816, -0.044057004153728485, -0.0041767810471355915, 0.03851474076509476, -0.024859879165887833, 0.04433813691139221, 0.03297247365117073, -0.0150805888697505, 0.024980362504720688, 0.00019390403758734465, -0.011897801421582699, -0.023896006867289543, 0.04859523847699165, -0.06714978814125061, -0.008388702757656574, -0.0059338402934372425, 0.05337443947792053, 0.04461926594376564, 0.005005108658224344, -0.017249301075935364, -0.034036748111248016, 0.012319495901465416, 0.03323351964354515, -0.010622678324580193, -0.06377623230218887, -0.02323334291577339, -0.0394786112010479, -0.06457945704460144, -0.07048317790031433, -0.03678780049085617, 0.019026441499590874, -0.06445897370576859, -0.01342393271625042, -0.04634620249271393, 0.014518329873681068, -0.024538587778806686, -0.04253087565302849, 0.03540223464369774, -0.052370406687259674, -0.010266246274113655, -0.036948446184396744, 0.03371545672416687, -0.023132940754294395, -0.008032270707190037, 0.03843441605567932, 0.013976151123642921, 0.010672880336642265, 0.007188882678747177, -0.014026353135704994, 0.013805465772747993, 0.01969914510846138, -0.004337426275014877, -0.021245356649160385, 0.005984041839838028, 0.03371545672416687, 0.016265349462628365, 0.029337869957089424, -0.04469958692789078, 0.01126526016741991, -0.02823343314230442, 0.0033810839522629976, 0.04341442510485649, 0.02112487331032753, 0.035944413393735886, 0.05429815128445625, -0.030060773715376854, -0.05120572820305824, -0.056587349623441696, 0.03321344032883644, 0.006792289204895496, 0.014347643591463566, -0.0027334822807461023, -0.00005565328319789842, 0.02923746593296528, 0.023855844512581825, -0.014648853801190853, 0.04269152134656906, -0.0440971665084362, -0.02253052033483982, -0.017058534547686577, 0.05465960502624512, 0.04815346375107765, 0.005768174771219492, 0.019277449697256088, -0.048073142766952515, 0.029839886352419853, 0.031928278505802155, 0.007761181797832251, -0.015432000160217285, 0.029317788779735565, -0.047149430960416794, -0.016074582934379578, 0.02919730544090271, 0.003361003240570426, 0.044980715960264206, -0.025341814383864403, -0.07068398594856262, -0.06393687427043915, 0.022148987278342247, 0.005492065101861954, -0.015432000160217285, -0.01770111732184887, -0.02518116869032383, 0.041928455233573914, -0.05682831630110741, 0.06168784201145172, 0.04963943362236023, 0.027932222932577133, -0.02090398594737053, -0.024578748270869255, -0.030321823433041573, -0.020432088524103165, -0.06084445118904114, -0.024618910625576973, 0.049237821251153946, -0.03449860215187073, 0.027851900085806847, -0.01653643697500229, -0.05317363515496254, 0.029759563505649567, 0.0023494393099099398, 0.05433831363916397, -0.03012101538479328, -0.0040035848505795, 0.006144687067717314, 0.02588399313390255, -0.06682849675416946, 0.008087492547929287, 0.004824382718652487, 0.002959389705210924, 0.08658788353204727, -0.018173012882471085, -0.020723259076476097, -0.003868040395900607, 0.024076731875538826, -0.04100474342703819, 0.04220958426594734, -0.022209228947758675, -0.06024203076958656, -0.09285305440425873, 0.007495112717151642, 0.04702894762158394, -0.0033158217556774616, -0.004867054056376219, 0.02206866443157196, 0.0012757505755871534, -0.091246597468853, 0.06939882040023804, 0.020482290536165237, 0.00898108258843422, -0.009709007106721401, 0.021406002342700958, 0.025743428617715836, 0.028153110295534134, -0.007710980251431465, 0.03447852283716202, -0.020843742415308952, -0.0018248315900564194, 0.012721109203994274, -0.06313364952802658, -0.011205017566680908, 0.06542284786701202, -0.008077452890574932, 0.021064629778265953, -0.02068309672176838, 0.012560463510453701, -0.03319336101412773, -0.022912053391337395, -0.015120750293135643, 0.022450197488069534, 0.03271142393350601, 0.035984572023153305, 0.03419739380478859, -0.029880046844482422, 0.001729448325932026, -0.013474134728312492, -0.011285340413451195, -0.03638618811964989, 0.04397668316960335, -0.02066301740705967, 0.03963925689458847, 0.016446074470877647, 0.016395872458815575, 0.06333445757627487, 0.029398111626505852, -0.029357949271798134, -0.018594706431031227, -0.08449949324131012, 0.030703354626893997, 0.07478044182062149, 0.0009199460037052631, -0.016215147450566292, 0.025944234803318977, -0.055944766849279404, 0.005612549372017384, 0.037611108273267746, -0.03494037687778473, 0.03220940753817558, 0.08586497604846954, -0.045221686363220215, -0.009473059326410294, -0.022891972213983536, -0.035984572023153305, 0.015492242760956287, 0.028293674811720848, 0.044538941234350204, 0.03253069892525673, 0.03086400032043457, -0.010753202252089977, -0.03538215160369873, -0.007329447194933891, 0.005833436734974384, -0.017751319333910942, 0.08594530075788498, -0.0120082451030612, -0.013564497232437134, -0.002013087971135974, 0.05321379378437996 ]
32,003
pingouin.contingency
dichotomous_crosstab
Generates a 2x2 contingency table from a :py:class:`pandas.DataFrame` that contains only dichotomous entries, which are converted to 0 or 1. Parameters ---------- data : :py:class:`pandas.DataFrame` Pandas dataframe x, y : string Column names in ``data``. Currently, Pingouin recognizes the following values as dichotomous measurements: * ``0``, ``0.0``, ``False``, ``'No'``, ``'N'``, ``'Absent'``, ``'False'``, ``'F'`` or ``'Negative'`` for negative cases; * ``1``, ``1.0``, ``True``, ``'Yes'``, ``'Y'``, ``'Present'``, ``'True'``, ``'T'``, ``'Positive'`` or ``'P'``, for positive cases; If strings are used, Pingouin will recognize them regardless of their uppercase/lowercase combinations. Returns ------- crosstab : :py:class:`pandas.DataFrame` The 2x2 crosstab. See :py:func:`pandas.crosstab` for more details. Examples -------- >>> import pandas as pd >>> import pingouin as pg >>> df = pd.DataFrame({'A': ['Yes', 'No', 'No'], 'B': [0., 1., 0.]}) >>> pg.dichotomous_crosstab(data=df, x='A', y='B') B 0 1 A 0 1 1 1 1 0
def dichotomous_crosstab(data, x, y): """ Generates a 2x2 contingency table from a :py:class:`pandas.DataFrame` that contains only dichotomous entries, which are converted to 0 or 1. Parameters ---------- data : :py:class:`pandas.DataFrame` Pandas dataframe x, y : string Column names in ``data``. Currently, Pingouin recognizes the following values as dichotomous measurements: * ``0``, ``0.0``, ``False``, ``'No'``, ``'N'``, ``'Absent'``,\ ``'False'``, ``'F'`` or ``'Negative'`` for negative cases; * ``1``, ``1.0``, ``True``, ``'Yes'``, ``'Y'``, ``'Present'``,\ ``'True'``, ``'T'``, ``'Positive'`` or ``'P'``, for positive cases; If strings are used, Pingouin will recognize them regardless of their uppercase/lowercase combinations. Returns ------- crosstab : :py:class:`pandas.DataFrame` The 2x2 crosstab. See :py:func:`pandas.crosstab` for more details. Examples -------- >>> import pandas as pd >>> import pingouin as pg >>> df = pd.DataFrame({'A': ['Yes', 'No', 'No'], 'B': [0., 1., 0.]}) >>> pg.dichotomous_crosstab(data=df, x='A', y='B') B 0 1 A 0 1 1 1 1 0 """ crosstab = pd.crosstab(_dichotomize_series(data, x), _dichotomize_series(data, y)) shape = crosstab.shape if shape != (2, 2): if shape == (2, 1): crosstab.loc[:, int(not bool(crosstab.columns[0]))] = [0, 0] elif shape == (1, 2): crosstab.loc[int(not bool(crosstab.index[0])), :] = [0, 0] else: # shape = (1, 1) or shape = (>2, >2) raise ValueError( "Both series contain only one unique value. " "Cannot build 2x2 contingency table." ) crosstab = crosstab.sort_index(axis=0).sort_index(axis=1) return crosstab
(data, x, y)
[ -0.06125257909297943, 0.04342002421617508, 0.046529483050107956, -0.05477141961455345, 0.018675480037927628, -0.02431371435523033, -0.00017458507500123233, 0.05619502440094948, -0.014704365283250809, -0.03712617978453636, 0.0037650668527930975, 0.08226951956748962, 0.0213166456669569, -0.026711368933320045, -0.0012386320158839226, -0.03371701389551163, 0.02305869199335575, -0.03315506502985954, 0.05874253436923027, -0.014273536391556263, 0.03748208284378052, 0.017635872587561607, 0.02107313461601734, -0.015912558883428574, -0.03587115928530693, -0.0049311136826872826, -0.09425778687000275, -0.004235700238496065, -0.04105983301997185, -0.03173145651817322, -0.03278043121099472, 0.020286403596401215, -0.025062981992959976, 0.021728742867708206, 0.052973177284002304, 0.01019939687103033, 0.03165652975440025, 0.0013053636066615582, -0.011135981418192387, 0.05357259139418602, -0.018001139163970947, -0.07646270096302032, -0.06357530504465103, 0.0213728416711092, -0.029333803802728653, -0.007497353013604879, -0.0014528755564242601, 0.029558584094047546, -0.07080573588609695, -0.06616027653217316, -0.03017672896385193, -0.04364480450749397, 0.021297914907336235, 0.03557145223021507, 0.01702709309756756, 0.03963622450828552, -0.008274717256426811, 0.006265745498239994, 0.014938510954380035, 0.055333368480205536, -0.024782005697488785, 0.048365186899900436, -0.001425948808901012, -0.009965251199901104, -0.0011812662705779076, -0.03308013826608658, 0.032461993396282196, 0.01041481178253889, -0.02523156628012657, -0.006073745898902416, -0.052673470228910446, 0.030401509255170822, 0.02118552476167679, 0.04724128544330597, 0.029614778235554695, -0.020267672836780548, 0.02180366963148117, 0.003388091688975692, 0.021335378289222717, 0.049676403403282166, -0.009674910455942154, -0.009777934290468693, -0.006055014207959175, -0.04113475978374481, -0.007483304478228092, 0.027835270389914513, 0.07679986953735352, 0.05758117139339447, -0.0004668284673243761, 0.03929905593395233, -0.043195243924856186, -0.02910902351140976, 0.036339450627565384, -0.01365539152175188, 0.016802312806248665, 0.015378705225884914, -0.04705396667122841, 0.04458138719201088, -0.0066356961615383625, -0.028415951877832413, 0.0345599427819252, 0.035702574998140335, -0.00443472433835268, 0.039186663925647736, -0.0026013613678514957, -0.021578889340162277, -0.02513790875673294, 0.04937669634819031, -0.05701921880245209, -0.07264143973588943, -0.0857161432504654, -0.0633130595088005, 0.04139700159430504, -0.06724671274423599, 0.01963079534471035, -0.07623791694641113, -0.005549259018152952, -0.010302421636879444, -0.06994407624006271, -0.027198392897844315, -0.04177163541316986, -0.009155106730759144, 0.054471712559461594, -0.04986371845006943, -0.037013791501522064, -0.008878814056515694, 0.01358983013778925, -0.006574817933142185, -0.026186881586909294, 0.06484905630350113, 0.02277771756052971, -0.03414784371852875, 0.01890026032924652, 0.08661526441574097, -0.005427503027021885, -0.04371973127126694, 0.042033880949020386, 0.01755158044397831, 0.05671951174736023, -0.00341384788043797, 0.03497203812003136, -0.02465088479220867, -0.03896188363432884, 0.014835487119853497, 0.07335323840379715, 0.04911445453763008, 0.030307849869132042, 0.025456346571445465, 0.01223178394138813, 0.019349820911884308, -0.031974971294403076, -0.0025194103363901377, 0.054808881133794785, -0.052298836410045624, 0.04087251424789429, -0.005507112480700016, -0.01874104142189026, -0.06454935669898987, 0.03017672896385193, 0.006350038107484579, 0.005567990709096193, -0.0004264382878318429, -0.040647733956575394, 0.03941144421696663, 0.005703795235604048, 0.041359540075063705, 0.024538494646549225, -0.02495059184730053, 0.09133564680814743, -0.0657481774687767, -0.03139428794384003, 0.015566022135317326, 0.007188280578702688, 0.03854978829622269, 0.053160496056079865, -0.026149418205022812, -0.029708437621593475, -0.013121538795530796, 0.013936366885900497, -0.034634869545698166, 0.023864153772592545, 0.003608189057558775, -0.06765881180763245, 0.01530377846211195, -0.0370512530207634, 0.05169942229986191, 0.0716673880815506, -0.034204039722681046, 0.014189244247972965, 0.008068669587373734, -0.06263872236013412, -0.04626723751425743, 0.015500461682677269, 0.07020632177591324, 0.1097676157951355, -0.05555814877152443, 0.005390039645135403, 0.003444286761805415, -0.023864153772592545, -0.051324792206287384, 0.04360733926296234, 0.031356822699308395, 0.03373574838042259, 0.07129275798797607, 0.033866867423057556, 0.021148061379790306, -0.011960174888372421, 0.02847214601933956, -0.04323270544409752, -0.042670756578445435, 0.07095558941364288, -0.0590047761797905, -0.013720951974391937, 0.03574003651738167, -0.022065913304686546, -0.009464179165661335, 0.06125257909297943, -0.02755429409444332, -0.059454336762428284, -0.04656694456934929, 0.05623248964548111, 0.03819388523697853, 0.0265989787876606, 0.050313279032707214, 0.043682266026735306, -0.017354896292090416, -0.00341384788043797, 0.040048323571681976, 0.02644912526011467, 0.011885248124599457, -0.008710228838026524, -0.0259621012955904, -0.01296231895685196, -0.009407984092831612, -0.0005578527343459427, -0.005146527662873268, 0.022908838465809822, -0.002114337868988514, -0.007834522984921932, 0.011135981418192387, -0.01818845607340336, -0.05818058177828789, 0.018357042223215103, -0.026748832315206528, 0.010602128691971302, -0.039373982697725296, 0.013046612031757832, -0.023433325812220573, -0.01776699349284172, 0.01007764134556055, -0.04072266072034836, -0.06102779880166054, 0.009684275835752487, -0.10549679398536682, 0.027160929515957832, -0.055146053433418274, -0.07395265251398087, 0.023508252575993538, 0.047316212207078934, -0.0019480942282825708, -0.01363665983080864, 0.042670756578445435, -0.025793517008423805, 0.021578889340162277, -0.030195459723472595, -0.08054620027542114, -0.025849711149930954, 0.01666182465851307, 0.004851503763347864, -0.006883890833705664, -0.09575632214546204, -0.07080573588609695, 0.029521120712161064, 0.01382397674024105, 0.002106142695993185, 0.011810321360826492, 0.07384026050567627, -0.018001139163970947, 0.0622640885412693, 0.02247801050543785, -0.016062412410974503, 0.006523306015878916, -0.01296231895685196, 0.0013240952976047993, -0.004598626401275396, -0.03645183891057968, -0.015669045969843864, -0.01859118789434433, 0.02736697718501091, -0.01467626728117466, -0.03418530896306038, -0.011014224961400032, 0.00993715412914753, 0.052486155182123184, -0.02510044537484646, 0.030064338818192482, -0.008935009129345417, -0.009272179566323757, -0.011229638941586018, -0.051811814308166504, 0.007295987568795681, 0.015163291245698929, -0.0003643896197900176, 0.016989629715681076, -0.008068669587373734, -0.026093224063515663, 0.03645183891057968, -0.035178087651729584, 0.007384962867945433, -0.033623356372117996, 0.027235856279730797, -0.0207921601831913, 0.01706455647945404, 0.04087251424789429, -0.03347350284457207, -0.009127008728682995, -0.01810416392982006, 0.0012257540365681052, 0.03742588683962822, 0.05327288433909416, 0.0000021173743789404398, -0.006003501825034618, 0.04293299838900566, 0.0588923878967762, 0.017448555678129196, 0.05357259139418602, 0.0599413625895977, -0.03418530896306038, 0.022122109308838844, -0.002330922754481435, -0.030008144676685333, 0.03070121631026268, -0.002704385668039322, 0.02804131805896759, -0.003491115989163518, 0.000573657569475472, 0.004699308890849352, 0.006012867670506239, -0.0370512530207634, -0.009824763983488083, -0.007740864995867014, 0.018169725313782692, 0.016099875792860985, -0.08069605380296707, 0.05263600870966911, -0.03738842532038689, -0.08271908015012741, 0.011519980616867542, 0.05124986544251442, 0.028884243220090866, 0.0381002277135849, 0.011173444800078869, 0.04139700159430504, 0.0242200568318367, 0.031000923365354538, -0.002239605877548456, 0.05870506912469864, -0.041846562176942825, -0.003062628908082843, 0.014582608826458454, 0.06087794527411461, 0.0032171651255339384, 0.038849495351314545, -0.04079758748412132, -0.0041771638207137585, -0.0086399856954813, 0.007656572386622429, 0.04289553686976433, -0.06810837239027023, 0.0014107292518019676, -0.00851354654878378, 0.02451976388692856, 0.0323496051132679, -0.03388560190796852, 0.041209686547517776, 0.02030513621866703, 0.03171272575855255, -0.042333588004112244, -0.005563307553529739, -0.03128189966082573, 0.01334631908684969, 0.010798810981214046, -0.0658605694770813, 0.08017157018184662, -0.05188674107193947, -0.01360856182873249, -0.027535563334822655, 0.02219703607261181, 0.005994135979562998, 0.009164472110569477, -0.004865552764385939, -0.002868287730962038, 0.06758388131856918, 0.018169725313782692, 0.050762839615345, -0.025456346571445465, -0.000020597526599885896, -0.029483657330274582, 0.03176892176270485, 0.0049123819917440414, -0.0035309207160025835, 0.0016612655017524958, 0.03369828313589096, -0.016305923461914062, -0.08788902312517166, 0.05439678579568863, 0.01923743076622486, -0.05709414556622505, -0.004085846710950136, -0.008817936293780804, -0.00711803650483489, 0.05450917407870293, 0.04443153366446495, -0.029820827767252922, 0.020717233419418335, 0.001655411790125072, -0.03617086634039879, -0.009084862656891346, 0.014901047572493553, 0.03587115928530693, 0.04072266072034836, -0.05012596398591995, 0.002270044991746545, 0.00891159474849701, 0.039336517453193665, -0.0034653600305318832, 0.007946913130581379, 0.0022489717230200768, 0.017298702150583267, 0.01856308989226818, -0.03128189966082573, 0.04113475978374481, -0.02571859024465084, -0.07679986953735352, 0.00868213176727295, -0.01189461350440979, -0.01816035993397236, 0.04896460101008415, 0.005127795971930027, 0.041996415704488754, -0.02620561420917511, 0.003708871779963374, 0.017907481640577316, 0.04240851476788521, -0.012999782338738441, 0.003406823379918933, -0.03755700960755348, -0.015912558883428574, -0.0854913666844368, -0.034634869545698166, 0.056644584983587265, -0.000521852751262486, -0.0013662416022270918, -0.024014007300138474, -0.0324057973921299, 0.043682266026735306, -0.03557145223021507, 0.039523836225271225, -0.024632152169942856, 0.03055136278271675, 0.022328156977891922, 0.02571859024465084, 0.007628474850207567, 0.0034349209163337946, -0.027160929515957832, -0.027104733511805534, -0.024632152169942856, -0.005923892371356487, 0.016980264335870743, -0.012156857177615166, -0.005685063544660807, 0.01782318949699402, 0.006738719996064901, -0.020717233419418335, 0.014919779263436794, 0.03188131004571915, -0.07679986953735352, -0.012494027614593506, 0.008007790893316269, -0.02983955852687359, 0.0008001937530934811, 0.049826256930828094, 0.046342164278030396, -0.04012325033545494, 0.01702709309756756, -0.015359973534941673, 0.006265745498239994, -0.02534395642578602, 0.017785726115107536, -0.04162178188562393, 0.05402215197682381, 0.020717233419418335, -0.02746063657104969, -0.026411661878228188, 0.02039879374206066, 0.011566809378564358, 0.010986127890646458, -0.025119176134467125, -0.02094201371073723, 0.009295593947172165, 0.011594907380640507, 0.024051470682024956, -0.035515256226062775, -0.034260235726833344, -0.01721441000699997, 0.036920130252838135, 0.0358336940407753, 0.038025300949811935, -0.013102807104587555, -0.04461885243654251, 0.005713161081075668, -0.04930176958441734, -0.0014271194813773036, 0.018394505605101585, 0.03540286794304848, -0.011819686740636826, -0.01822591945528984, -0.05409707874059677, -0.03253692016005516, 0.0048936503008008, -0.007010329514741898, 0.0015371680492535233, 0.07777391374111176, 0.08122054487466812, -0.02877185307443142, 0.043832119554281235, -0.011107883416116238, 0.010171299800276756, -0.01718631200492382, -0.014479584991931915, -0.025269029662013054, -0.030232923105359077, -0.0024842885322868824, 0.051137473434209824, -0.03654550015926361, -0.0016355094267055392, -0.05690683051943779, -0.01654006913304329, 0.07687479257583618, 0.00824193749576807, 0.018759772181510925, 0.0016753142699599266, 0.01782318949699402, 0.029427461326122284, 0.026243077591061592, 0.004720382392406464, 0.009407984092831612, -0.0052916985005140305, -0.01626846008002758, 0.022346889600157738, -0.09126072376966476, -0.02112933062016964, 0.030345313251018524, -0.02577478438615799, -0.03746335208415985, -0.0052870153449475765, 0.023526983335614204, 0.004949845373630524, -0.019218698143959045, 0.03122570365667343, -0.0565696582198143, -0.07425235956907272, 0.0752638727426529, -0.055670540779829025, -0.03308013826608658, 0.0306075569242239, 0.0006983403000049293, -0.008101449348032475, -0.034840915352106094, -0.02654278464615345, 0.041322074830532074, -0.02097947709262371, -0.030869800597429276, -0.011201541870832443, -0.030645020306110382, 0.033529698848724365, -0.025081712752580643, -0.0086399856954813, 0.026767564937472343, -0.03519681841135025, -0.10991746932268143, 0.02219703607261181, -0.04345748573541641, -0.013814610429108143, -0.006439013406634331, -0.0032757017761468887, -0.009806032292544842, 0.020473720505833626, 0.05375990644097328, -0.01865674927830696, -0.03982354328036308, -0.02268405817449093, 0.03422277048230171, -0.02054864726960659, -0.019424747675657272, -0.004069456364959478, -0.013252660632133484, 0.013374416157603264, 0.057506244629621506, -0.014826120808720589, 0.007356865331530571, 0.03617086634039879, -0.0019878989551216364, -0.026898685842752457, 0.038268812000751495, 0.013917635194957256, 0.01377714704722166, 0.0080733522772789, -0.012447197921574116, -0.055520687252283096, -0.007975011132657528, 0.04458138719201088, -0.020230209454894066, 0.02373303286731243, 0.02296503446996212, 0.009211301803588867, -0.03823135048151016, -0.08122054487466812, -0.04990118369460106, -0.008143595419824123, -0.01981811225414276, -0.03637691214680672, 0.03272423520684242, 0.03405418619513512, -0.04862742871046066, 0.00255687371827662, 0.02523156628012657, 0.04270821809768677, -0.04154685512185097, -0.012775002978742123, 0.011201541870832443, 0.01648387499153614, 0.004842137917876244, 0.002800385467708111, -0.026673905551433563, 0.010330518707633018, -0.03407291695475578, -0.019593331962823868, 0.011323297396302223, 0.05776848644018173, -0.023077424615621567, 0.005919209215790033, 0.09238462150096893, 0.012990416958928108, -0.029989412054419518, -0.051025085151195526, -0.00937052071094513, -0.03287408873438835, -0.02959604747593403, -0.05570800229907036, 0.03306140750646591, -0.0008060474065132439, 0.0069869146682322025, -0.01948094181716442, 0.023508252575993538, 0.01626846008002758, 0.033679552376270294, -0.01816035993397236, -0.03139428794384003, -0.017785726115107536, 0.05409707874059677, 0.025849711149930954, 0.030645020306110382, 0.051474642008543015, 0.06867032498121262, 0.0588923878967762, 0.0728287547826767, 0.013795878738164902, -0.031206971034407616, -0.009581252001225948, 0.09006189554929733, 0.08384297788143158, -0.02905282936990261, -0.027086002752184868, 0.0029759949538856745, -0.03255565091967583, -0.01733616553246975, 0.01919996738433838, -0.031937506049871445, 0.001485656015574932, 0.01864738203585148, -0.01586572825908661, 0.02476327493786812, -0.010452275164425373, 0.0189939197152853, -0.03697632625699043, 0.06290096789598465, -0.08167010545730591, -0.07095558941364288, -0.09410793334245682, -0.00352389644831419, 0.00905208196491003, -0.0016156069468706846, 0.02021147683262825, 0.001193558913655579, 0.001376778120175004, -0.047653380781412125, 0.02247801050543785, 0.0611027255654335, 0.040048323571681976, 0.019743185490369797, -0.062001846730709076, 0.03266804292798042, 0.052186448127031326, -0.0173642635345459, 0.02214084006845951, 0.014104951173067093, -0.034934572875499725, 0.06533608585596085, -0.012391002848744392, -0.018207188695669174, 0.04061027243733406, -0.03079487383365631, 0.0034630184527486563, 0.00109287619125098, 0.011416955851018429, -0.0852665826678276, 0.028940439224243164, 0.018759772181510925, -0.03204989805817604, 0.0774742066860199, -0.010358616709709167, 0.003144579939544201, 0.01131393201649189, -0.013692854903638363, 0.021354109048843384, 0.051025085151195526, -0.005221454426646233, 0.014816755428910255, -0.09785427153110504, 0.01702709309756756, -0.021447768434882164, -0.011978906579315662, 0.03544032946228981, -0.007253841497004032, 0.02103567123413086, 0.017176946625113487, -0.033098869025707245, 0.004605650901794434, -0.0092206671833992, -0.03819388523697853, -0.017654603347182274, 0.056007709354162216, -0.00574125861749053, -0.0288655124604702, 0.03729476407170296, 0.03131936118006706, -0.01255022268742323, 0.02663644216954708, 0.02219703607261181, 0.0021237037144601345, -0.02626180835068226, -0.053647518157958984, -0.07035617530345917, 0.018506895750761032, 0.031244434416294098, -0.033005211502313614, -0.03731349855661392, -0.03414784371852875, -0.015116461552679539, -0.03581496328115463, 0.036826472729444504, -0.007103987969458103, 0.029146486893296242, 0.029802095144987106, 0.04439407214522362, 0.05158703401684761, 0.071554996073246 ]
32,004
pingouin.correlation
distance_corr
Distance correlation between two arrays. Statistical significance (p-value) is evaluated with a permutation test. Parameters ---------- x, y : array_like 1D or 2D input arrays, shape (n_samples, n_features). ``x`` and ``y`` must have the same number of samples and must not contain missing values. alternative : str Alternative of the test. Can be either "two-sided", "greater" (default) or "less". To be consistent with the original R implementation, the default is to calculate the one-sided "greater" p-value. n_boot : int or None Number of bootstrap to perform. If None, no bootstrapping is performed and the function only returns the distance correlation (no p-value). Default is 1000 (thus giving a precision of 0.001). seed : int or None Random state seed. Returns ------- dcor : float Sample distance correlation (range from 0 to 1). pval : float P-value. Notes ----- From Wikipedia: *Distance correlation is a measure of dependence between two paired random vectors of arbitrary, not necessarily equal, dimension. The distance correlation coefficient is zero if and only if the random vectors are independent. Thus, distance correlation measures both linear and nonlinear association between two random variables or random vectors. This is in contrast to Pearson's correlation, which can only detect linear association between two random variables.* The distance correlation of two random variables is obtained by dividing their distance covariance by the product of their distance standard deviations: .. math:: \text{dCor}(X, Y) = \frac{\text{dCov}(X, Y)} {\sqrt{\text{dVar}(X) \cdot \text{dVar}(Y)}} where :math:`\text{dCov}(X, Y)` is the square root of the arithmetic average of the product of the double-centered pairwise Euclidean distance matrices. Note that by contrast to Pearson's correlation, the distance correlation cannot be negative, i.e :math:`0 \leq \text{dCor} \leq 1`. Results have been tested against the `energy <https://cran.r-project.org/web/packages/energy/energy.pdf>`_ R package. References ---------- * https://en.wikipedia.org/wiki/Distance_correlation * Székely, G. J., Rizzo, M. L., & Bakirov, N. K. (2007). Measuring and testing dependence by correlation of distances. The annals of statistics, 35(6), 2769-2794. * https://gist.github.com/satra/aa3d19a12b74e9ab7941 * https://gist.github.com/wladston/c931b1495184fbb99bec Examples -------- 1. With two 1D vectors >>> from pingouin import distance_corr >>> a = [1, 2, 3, 4, 5] >>> b = [1, 2, 9, 4, 4] >>> dcor, pval = distance_corr(a, b, seed=9) >>> print(round(dcor, 3), pval) 0.763 0.312 2. With two 2D arrays and no p-value >>> import numpy as np >>> np.random.seed(123) >>> from pingouin import distance_corr >>> a = np.random.random((10, 10)) >>> b = np.random.random((10, 10)) >>> round(distance_corr(a, b, n_boot=None), 3) 0.88
def distance_corr(x, y, alternative="greater", n_boot=1000, seed=None): """Distance correlation between two arrays. Statistical significance (p-value) is evaluated with a permutation test. Parameters ---------- x, y : array_like 1D or 2D input arrays, shape (n_samples, n_features). ``x`` and ``y`` must have the same number of samples and must not contain missing values. alternative : str Alternative of the test. Can be either "two-sided", "greater" (default) or "less". To be consistent with the original R implementation, the default is to calculate the one-sided "greater" p-value. n_boot : int or None Number of bootstrap to perform. If None, no bootstrapping is performed and the function only returns the distance correlation (no p-value). Default is 1000 (thus giving a precision of 0.001). seed : int or None Random state seed. Returns ------- dcor : float Sample distance correlation (range from 0 to 1). pval : float P-value. Notes ----- From Wikipedia: *Distance correlation is a measure of dependence between two paired random vectors of arbitrary, not necessarily equal, dimension. The distance correlation coefficient is zero if and only if the random vectors are independent. Thus, distance correlation measures both linear and nonlinear association between two random variables or random vectors. This is in contrast to Pearson's correlation, which can only detect linear association between two random variables.* The distance correlation of two random variables is obtained by dividing their distance covariance by the product of their distance standard deviations: .. math:: \\text{dCor}(X, Y) = \\frac{\\text{dCov}(X, Y)} {\\sqrt{\\text{dVar}(X) \\cdot \\text{dVar}(Y)}} where :math:`\\text{dCov}(X, Y)` is the square root of the arithmetic average of the product of the double-centered pairwise Euclidean distance matrices. Note that by contrast to Pearson's correlation, the distance correlation cannot be negative, i.e :math:`0 \\leq \\text{dCor} \\leq 1`. Results have been tested against the `energy <https://cran.r-project.org/web/packages/energy/energy.pdf>`_ R package. References ---------- * https://en.wikipedia.org/wiki/Distance_correlation * Székely, G. J., Rizzo, M. L., & Bakirov, N. K. (2007). Measuring and testing dependence by correlation of distances. The annals of statistics, 35(6), 2769-2794. * https://gist.github.com/satra/aa3d19a12b74e9ab7941 * https://gist.github.com/wladston/c931b1495184fbb99bec Examples -------- 1. With two 1D vectors >>> from pingouin import distance_corr >>> a = [1, 2, 3, 4, 5] >>> b = [1, 2, 9, 4, 4] >>> dcor, pval = distance_corr(a, b, seed=9) >>> print(round(dcor, 3), pval) 0.763 0.312 2. With two 2D arrays and no p-value >>> import numpy as np >>> np.random.seed(123) >>> from pingouin import distance_corr >>> a = np.random.random((10, 10)) >>> b = np.random.random((10, 10)) >>> round(distance_corr(a, b, n_boot=None), 3) 0.88 """ assert alternative in [ "two-sided", "greater", "less", ], "Alternative must be one of 'two-sided' (default), 'greater' or 'less'." x = np.asarray(x) y = np.asarray(y) # Check for NaN values if any([np.isnan(np.min(x)), np.isnan(np.min(y))]): raise ValueError("Input arrays must not contain NaN values.") if x.ndim == 1: x = x[:, None] if y.ndim == 1: y = y[:, None] assert x.shape[0] == y.shape[0], "x and y must have same number of samples" # Extract number of samples n = x.shape[0] n2 = n**2 # Process first array to avoid redundancy when performing bootstrap a = squareform(pdist(x, metric="euclidean")) A = a - a.mean(axis=0)[None, :] - a.mean(axis=1)[:, None] + a.mean() dcov2_xx = np.vdot(A, A) / n2 # Process second array and compute final distance correlation dcor = _dcorr(y, n2, A, dcov2_xx) # Compute one-sided p-value using a bootstrap procedure if n_boot is not None and n_boot > 1: # Define random seed and permutation rng = np.random.RandomState(seed) bootsam = rng.random_sample((n_boot, n)).argsort(axis=1) bootstat = np.empty(n_boot) for i in range(n_boot): bootstat[i] = _dcorr(y[bootsam[i, :]], n2, A, dcov2_xx) pval = _perm_pval(bootstat, dcor, alternative=alternative) return dcor, pval else: return dcor
(x, y, alternative='greater', n_boot=1000, seed=None)
[ -0.004022928420454264, 0.014017936773598194, 0.053280122578144073, -0.014636081643402576, 0.047976039350032806, -0.011116642504930496, -0.0369890071451664, 0.026440659537911415, 0.04713854938745499, 0.025942156091332436, -0.035672955214977264, 0.00790129043161869, 0.04231303185224533, 0.04937184974551201, -0.042791593819856644, 0.009521429426968098, -0.01983049511909485, 0.011455625295639038, -0.026440659537911415, -0.000967098050750792, 0.005538381170481443, 0.0311265978962183, -0.04027913510799408, 0.010024918243288994, -0.03184444457292557, 0.02010965719819069, -0.012901287525892258, -0.017238272354006767, -0.023768676444888115, 0.05276167765259743, 0.031146539375185966, -0.04187434911727905, -0.01947157084941864, 0.02303089201450348, -0.021854421123862267, -0.009885337203741074, 0.0691126137971878, -0.007896305993199348, -0.06033894047141075, -0.007422726601362228, -0.019850434735417366, -0.02576269395649433, -0.01052840705960989, -0.027158506214618683, -0.006859417073428631, 0.052083712071180344, -0.0796809047460556, 0.022412745282053947, -0.10839474201202393, 0.05260215699672699, 0.03920236602425575, -0.05216347426176071, 0.008668987080454826, 0.009287131950259209, -0.018095700070261955, 0.09850441664457321, 0.020368879660964012, 0.04757723584771156, -0.03788631409406662, -0.05774671956896782, 0.02350945584475994, 0.008584241382777691, -0.028993001207709312, 0.02336987480521202, 0.016251234337687492, -0.023928198963403702, -0.030927196145057678, -0.004446656908839941, 0.043629083782434464, 0.020757712423801422, -0.001559071708470583, 0.03234294801950455, -0.00016824514023028314, -0.042911235243082047, 0.063409723341465, 0.05335988104343414, 0.030867375433444977, -0.022093703970313072, 0.0383249968290329, -0.02935192361474037, -0.06859417259693146, -0.010777659714221954, 0.06113654747605324, -0.029172461479902267, 0.03730804845690727, 0.03026917204260826, -0.03254235163331032, 0.05698899179697037, 0.01514455582946539, -0.022233285009860992, -0.03302091360092163, 0.011425714939832687, 0.036430682986974716, 0.02219340391457081, -0.005523425992578268, 0.02197406254708767, 0.0370488278567791, 0.04817543923854828, 0.061495471745729446, 0.026420719921588898, 0.03808571770787239, 0.024207361042499542, 0.0675971582531929, 0.040458597242832184, 0.013250240124762058, -0.0009907769272103906, -0.03593217954039574, 0.04311063885688782, -0.001855681650340557, 0.013848445378243923, -0.03816547617316246, -0.019571272656321526, 0.07589226961135864, -0.03557325527071953, -0.0464605838060379, -0.007612158078700304, -0.03232300654053688, 0.06636086851358414, 0.004391821566969156, 0.004229807760566473, 0.040737759321928024, 0.03519439324736595, -0.017098691314458847, -0.04929208755493164, 0.003065800527110696, -0.0383848175406456, 0.005702887196093798, 0.011286133900284767, -0.022971071302890778, 0.06915249675512314, 0.05216347426176071, -0.018604174256324768, -0.001134720048867166, 0.03266198933124542, 0.02979060634970665, -0.01630108617246151, 0.022293105721473694, 0.029890308156609535, 0.029810547828674316, -0.024685924872756004, 0.05204383283853531, 0.010538377799093723, 0.02225322462618351, 0.015792611986398697, 0.0132402703166008, 0.047497473657131195, 0.04450644925236702, -0.012362902984023094, 0.013040868565440178, 0.026221318170428276, -0.007666993420571089, -0.0037387809716165066, 0.0632900819182396, -0.03142569959163666, 0.024167479947209358, -0.05994013696908951, 0.014396799728274345, -0.053399764001369476, -0.03519439324736595, -0.02111663483083248, 0.017058812081813812, -0.03748751059174538, 0.04203386977314949, 0.008519435301423073, 0.0271186251193285, -0.0057776630856096745, 0.01911264844238758, 0.01978064328432083, 0.0008543114527128637, -0.03479558974504471, -0.03294115513563156, -0.03916248679161072, -0.028534376993775368, -0.09387829899787903, -0.021016934886574745, 0.0008150542853400111, -0.011116642504930496, -0.0795612633228302, 0.002154784044250846, -0.012981047853827477, -0.0060518402606248856, -0.02225322462618351, 0.017896298319101334, -0.027477547526359558, -0.01888333633542061, 0.05758719891309738, 0.030009949579834938, -0.021794600412249565, 0.06077762320637703, 0.03076767548918724, -0.03794613480567932, -0.04027913510799408, -0.045662980526685715, 0.10281149297952652, 0.04191422834992409, 0.01041873637586832, -0.008898299187421799, -0.022711848840117455, 0.03290127217769623, -0.024586224928498268, 0.01682949997484684, 0.004516447428613901, 0.011176463216543198, -0.03631104156374931, 0.048973046243190765, -0.013459611684083939, -0.01517446618527174, 0.027836471796035767, 0.010129604488611221, -0.04139578342437744, 0.03629110008478165, -0.020049836486577988, 0.021515438333153725, -0.024386823177337646, 0.024805566295981407, 0.021495498716831207, 0.054955095052719116, -0.11294109374284744, 0.007866395637392998, 0.003893317421898246, 0.07577262818813324, -0.03674972429871559, 0.02442670240998268, 0.07633095234632492, -0.038484521210193634, 0.03463606908917427, -0.03062809444963932, 0.02773676998913288, 0.04231303185224533, -0.07058818638324738, 0.020229298621416092, -0.006171481218189001, 0.024067780002951622, -0.04881352558732033, -0.0033823505509644747, -0.10903282463550568, -0.005089727230370045, 0.06456625461578369, -0.02378861792385578, 0.04466596990823746, -0.0450647734105587, 0.02689928375184536, 0.0272382665425539, 0.020049836486577988, 0.006600194610655308, -0.00820537842810154, 0.0072432649321854115, -0.014436679892241955, 0.02239280566573143, -0.01165502704679966, -0.007018938194960356, -0.07812556624412537, 0.028155513107776642, -0.01365901343524456, 0.016839468851685524, -0.04550345614552498, 0.030368871986865997, 0.018404772505164146, 0.020458608865737915, 0.000537761312443763, 0.00337985809892416, -0.027018923312425613, -0.10400789976119995, 0.04011961445212364, -0.0832701325416565, -0.031006956472992897, -0.030448632314801216, 0.015154525637626648, -0.002198403235524893, 0.003943167626857758, -0.010229304432868958, 0.02247256599366665, -0.03324025496840477, -0.007986036129295826, -0.03906278312206268, 0.02027914859354496, 0.026420719921588898, -0.049531370401382446, 0.06564302742481232, 0.007163504604250193, -0.0009103931952267885, -0.017627106979489326, -0.04985041543841362, -0.00023367381072603166, 0.006729805842041969, -0.0024501478765159845, -0.037427689880132675, -0.023469574749469757, 0.03668990358710289, 0.01682949997484684, 0.011994009837508202, -0.03674972429871559, 0.028474556282162666, 0.023290112614631653, 0.011545355431735516, 0.0449451319873333, -0.024107659235596657, -0.03371882066130638, -0.013260209932923317, -0.013788624666631222, -0.0032726796343922615, -0.002020187908783555, 0.03210366517305374, 0.019351931288838387, -0.026301078498363495, -0.009720830246806145, 0.08207371830940247, -0.03337983787059784, -0.016669977456331253, 0.03948152810335159, -0.003624125150963664, 0.002756727859377861, 0.01355931255966425, 0.02295112982392311, 0.0034297085367143154, -0.008359914645552635, 0.0245064627379179, 0.018624113872647285, 0.03479558974504471, 0.015124615281820297, -0.0049501461908221245, 0.024885326623916626, 0.02999000810086727, 0.06512457877397537, 0.019212350249290466, 0.030089709907770157, 0.006849446799606085, 0.016231294721364975, 0.05479557439684868, 0.04438680782914162, 0.00043806052417494357, 0.0025461099576205015, 0.002007725415751338, 0.03842470049858093, 0.08295109122991562, 0.012901287525892258, 0.022711848840117455, -0.08709864318370819, 0.04175470769405365, -0.015014944598078728, -0.018683934584259987, 0.02219340391457081, -0.05248251557350159, -0.039042845368385315, -0.009187431074678898, 0.003985540475696325, 0.04701891168951988, 0.03128612041473389, -0.0049651013687253, -0.06117642670869827, 0.029411744326353073, 0.030448632314801216, 0.012452633120119572, 0.06995010375976562, 0.01182451844215393, 0.055593181401491165, -0.02985042706131935, 0.021635079756379128, 0.047417715191841125, 0.02971084602177143, -0.08709864318370819, 0.03254235163331032, 0.02021932788193226, -0.040518417954444885, -0.025264190509915352, 0.017238272354006767, -0.058544326573610306, 0.009591219946742058, -0.055034857243299484, -0.024905266240239143, -0.017427705228328705, -0.06636086851358414, -0.0271186251193285, -0.005712857469916344, 0.0055732764303684235, -0.06057822331786156, -0.053559284657239914, 0.003262709593400359, 0.011405774392187595, 0.008334988728165627, -0.027138564735651016, -0.016669977456331253, -0.04590225964784622, 0.005373874679207802, -0.035314034670591354, 0.005952139385044575, 0.04067793861031532, -0.00593219930306077, -0.06576266884803772, 0.011565295979380608, -0.019012948498129845, -0.037148527801036835, 0.011206372641026974, -0.0003773053176701069, -0.02683946304023266, -0.005473575554788113, 0.0030932181980460882, 0.027357907965779305, -0.06388828903436661, -0.012452633120119572, 0.03718840703368187, 0.03501493111252785, -0.019980045035481453, -0.011545355431735516, 0.007756724487990141, -0.03226318955421448, 0.024526404216885567, -0.039621107280254364, -0.03371882066130638, 0.06297104060649872, -0.07425717264413834, 0.017168482765555382, 0.06424721330404282, -0.034396786242723465, -0.03914254531264305, 0.03668990358710289, -0.08526414632797241, 0.013469581492245197, 0.0476171150803566, -0.01344964187592268, 0.033918220549821854, -0.10153532028198242, 0.02133597619831562, -0.011405774392187595, 0.03268193081021309, -0.01630108617246151, 0.01927216909825802, -0.008798598311841488, 0.01713857240974903, -0.04614154249429703, -0.0002844589180313051, 0.005672977305948734, -0.056590188294649124, -0.00017665739869698882, 0.018683934584259987, 0.00397058529779315, 0.009730800986289978, 0.05204383283853531, -0.0006455628317780793, -0.03339977562427521, -0.02428712137043476, -0.002041374333202839, 0.035034872591495514, -0.043828483670949936, -0.10033891350030899, -0.004229807760566473, 0.04295111820101738, -0.08486534655094147, -0.03282151371240616, -0.04885340481996536, 0.043629083782434464, -0.03104683756828308, 0.08933193981647491, 0.04402788355946541, -0.034456606954336166, -0.008659017272293568, -0.03218342736363411, -0.023868378251791, -0.0725822001695633, -0.04131602123379707, 0.006226316560059786, -0.027058804407715797, -0.049252208322286606, -0.01566299982368946, -0.0132402703166008, 0.09124619513750076, 0.0025373860262334347, 0.02542371116578579, 0.006161510944366455, 0.024825505912303925, 0.02331005409359932, 0.010329005308449268, -0.03810565546154976, 0.03479558974504471, 0.0013621625257655978, 0.0238085575401783, -0.04438680782914162, 0.03373875841498375, -0.011804577894508839, -0.012342962436378002, -0.04825520142912865, -0.01874375529587269, -0.0027318026404827833, -0.00996011309325695, 0.02358921617269516, -0.1059221625328064, 0.012033890001475811, -0.01602192223072052, 0.05603186413645744, 0.0021635079756379128, 0.045463576912879944, 0.02935192361474037, 0.01608174294233322, -0.009436683729290962, -0.030109649524092674, -0.021734779700636864, 0.046301063150167465, -0.03808571770787239, 0.09044858813285828, -0.01520437654107809, 0.013170478865504265, 0.014955123886466026, -0.006784641183912754, -0.023848438635468483, 0.04733795300126076, -0.029052821919322014, -0.04267195239663124, 0.017477555200457573, -0.03822529688477516, 0.04885340481996536, -0.02197406254708767, -0.03758721053600311, 0.06524422019720078, -0.002873876364901662, 0.005583246238529682, 0.03625122085213661, 0.017657017335295677, 0.023549335077404976, 0.00969590526074171, -0.010124619118869305, 0.008589225821197033, 0.09379854053258896, -0.023928198963403702, 0.015503478236496449, -0.005692917387932539, 0.02047855034470558, -0.0066301049664616585, -0.043629083782434464, 0.0004402414779178798, 0.028693897649645805, -0.053280122578144073, -0.03290127217769623, -0.015054824762046337, -0.009760711342096329, -0.01874375529587269, 0.007532397285103798, -0.0784047320485115, -0.018065789714455605, -0.009157520718872547, -0.0035294091794639826, 0.030588213354349136, 0.005832498427480459, 0.04394812509417534, -0.029870368540287018, 0.009381847456097603, 0.019012948498129845, -0.0318843238055706, 0.0022594700567424297, -0.01922231912612915, 0.03216348588466644, 0.056590188294649124, -0.04083745926618576, 0.008863403461873531, 0.019491512328386307, -0.057706840336322784, -0.028534376993775368, -0.03427714481949806, -0.031784623861312866, 0.016869379207491875, 0.003624125150963664, -0.0021896795369684696, -0.02147555910050869, 0.0004206128651276231, -0.05722827464342117, 0.031365878880023956, 0.07481550425291061, 0.04781651496887207, -0.020578250288963318, -0.03653038293123245, -0.05300096049904823, -0.05938181281089783, 0.06979057937860489, -0.0663209930062294, 0.061495471745729446, -0.0068344916217029095, 0.04709867015480995, 0.03754733130335808, -0.07641071081161499, -0.010299095883965492, -0.04043865576386452, 0.008310063742101192, -0.02323029190301895, 0.054117608815431595, -0.04586238041520119, -0.013010958209633827, 0.0011552833020687103, -0.05399796739220619, -0.008659017272293568, 0.033559300005435944, -0.02683946304023266, -0.08390821516513824, 0.0037387809716165066, -0.04219339042901993, -0.05870384722948074, 0.007318040821701288, 0.03483546897768974, 0.006031900178641081, 0.04338980093598366, 0.06823524832725525, -0.000044164349674247205, -0.007332995999604464, 0.0045314026065170765, 0.012891316786408424, -0.03232300654053688, 0.006056825164705515, -0.018574263900518417, -0.026321018114686012, -0.09922226518392563, 0.025802575051784515, -0.015812551602721214, -0.019411752000451088, -0.041794586926698685, -0.035672955214977264, -0.0515652671456337, 0.03906278312206268, -0.04590225964784622, -0.0015054824762046337, -0.04135590419173241, 0.000899176811799407, 0.02534395083785057, 0.01908273808658123, 0.017477555200457573, 0.03405780345201492, 0.00005023986886953935, -0.030667973682284355, 0.05730803683400154, -0.03012958914041519, -0.002609669230878353, -0.015124615281820297, 0.026360899209976196, 0.02907276153564453, -0.002289380179718137, 0.06380853056907654, -0.014825512655079365, -0.009302087128162384, 0.01225323136895895, 0.04267195239663124, -0.020717831328511238, 0.008918238803744316, 0.04259219393134117, 0.016809560358524323, -0.004446656908839941, -0.0205583106726408, 0.017208361998200417, -0.038205355405807495, -0.026919223368167877, -0.023070771247148514, -0.004538880195468664, 0.06520434468984604, -0.011485535651445389, -0.02400795929133892, -0.004992519039660692, -0.027577249333262444, 0.00035674203536473215, -0.02289130911231041, -0.06951141357421875, 0.005234293639659882, 0.05280155688524246, 0.021096695214509964, 0.002033896977081895, 0.04017943516373634, 0.06508470326662064, 0.001985292648896575, -0.04937184974551201, 0.004194912500679493, -0.0005838729557581246, 0.06273175776004791, -0.024406762793660164, -0.050528381019830704, 0.009705876000225544, 0.02323029190301895, 0.04021931439638138, -0.00043463328620418906, 0.003776168916374445, 0.0132402703166008, -0.03928212448954582, -0.05359916388988495, -0.001876868074759841, 0.0038559294771403074, 0.012033890001475811, 0.038504458963871, 0.037986014038324356, 0.019152529537677765, -0.02133597619831562, -0.005797603167593479, -0.0031256210058927536, 0.06125618889927864, 0.003898302325978875, -0.0030333977192640305, -0.0018257714109495282, 0.05096706375479698, -0.004892818164080381, 0.01190427877008915, -0.044107645750045776, 0.0007876365561969578, -0.009147550910711288, -0.051924191415309906, -0.050887301564216614, -0.02845461666584015, -0.016839468851685524, 0.015184435993432999, 0.02259220741689205, -0.01052840705960989, 0.02486538700759411, -0.046659987419843674, 0.02725820615887642, -0.04422728717327118, 0.021914241835474968, 0.03563307598233223, -0.02197406254708767, -0.0035244242753833532, 0.010378856211900711, 0.056311026215553284, -0.0450647734105587, -0.055872343480587006, 0.008798598311841488, -0.006575269624590874, 0.024247242137789726, 0.017397794872522354, 0.018733784556388855, -0.006919237319380045, 0.017726806923747063, 0.043908245861530304, -0.01168493740260601, 0.039621107280254364, -0.01400796603411436, 0.07461609691381454, -0.03056827373802662, 0.005483545362949371, 0.016699887812137604, -0.024207361042499542, -0.010777659714221954, 0.03870386257767677, 0.03569289669394493, -0.031784623861312866, 0.011306073516607285, 0.017786627635359764, -0.04402788355946541, 0.03920236602425575, -0.005119637586176395, -0.03379857912659645, -0.012811556458473206, 0.03519439324736595, -0.03535391390323639, 0.010717839002609253, 0.03888332098722458, -0.02259220741689205, -0.028993001207709312, 0.02556329220533371, -0.05934193357825279, -0.011425714939832687, -0.02921234257519245, -0.03914254531264305, 0.010867389850318432, -0.05922229215502739, 0.006744761019945145, 0.030388811603188515, -0.04610166326165199, -0.03575271740555763, -0.04083745926618576, 0.006465598475188017, 0.01630108617246151, -0.016869379207491875, 0.05938181281089783, 0.03268193081021309, 0.04406776651740074, 0.01852441392838955, 0.07385837286710739 ]
32,007
pingouin.distribution
epsilon
Epsilon adjustement factor for repeated measures. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame containing the repeated measurements. Both wide and long-format dataframe are supported for this function. To test for an interaction term between two repeated measures factors with a wide-format dataframe, ``data`` must have a two-levels :py:class:`pandas.MultiIndex` columns. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within factor (only required if ``data`` is in long format). If ``within`` is a list with two strings, this function computes the epsilon factor for the interaction between the two within-subject factor. subject : string Name of column containing the subject identifier (only required if ``data`` is in long format). correction : string Specify the epsilon version: * ``'gg'``: Greenhouse-Geisser * ``'hf'``: Huynh-Feldt * ``'lb'``: Lower bound Returns ------- eps : float Epsilon adjustement factor. See Also -------- sphericity : Mauchly and JNS test for sphericity. homoscedasticity : Test equality of variance. Notes ----- The lower bound epsilon is: .. math:: lb = \frac{1}{\text{dof}}, where the degrees of freedom :math:`\text{dof}` is the number of groups :math:`k` minus 1 for one-way design and :math:`(k_1 - 1)(k_2 - 1)` for two-way design The Greenhouse-Geisser epsilon is given by: .. math:: \epsilon_{GG} = \frac{k^2(\overline{\text{diag}(S)} - \overline{S})^2}{(k-1)(\sum_{i=1}^{k}\sum_{j=1}^{k}s_{ij}^2 - 2k\sum_{j=1}^{k}\overline{s_i}^2 + k^2\overline{S}^2)} where :math:`S` is the covariance matrix, :math:`\overline{S}` the grandmean of S and :math:`\overline{\text{diag}(S)}` the mean of all the elements on the diagonal of S (i.e. mean of the variances). The Huynh-Feldt epsilon is given by: .. math:: \epsilon_{HF} = \frac{n(k-1)\epsilon_{GG}-2}{(k-1) (n-1-(k-1)\epsilon_{GG})} where :math:`n` is the number of observations. Missing values are automatically removed from data (listwise deletion). Examples -------- Using a wide-format dataframe >>> import pandas as pd >>> import pingouin as pg >>> data = pd.DataFrame({'A': [2.2, 3.1, 4.3, 4.1, 7.2], ... 'B': [1.1, 2.5, 4.1, 5.2, 6.4], ... 'C': [8.2, 4.5, 3.4, 6.2, 7.2]}) >>> gg = pg.epsilon(data, correction='gg') >>> hf = pg.epsilon(data, correction='hf') >>> lb = pg.epsilon(data, correction='lb') >>> print("%.2f %.2f %.2f" % (lb, gg, hf)) 0.50 0.56 0.62 Now using a long-format dataframe >>> data = pg.read_dataset('rm_anova2') >>> data.head() Subject Time Metric Performance 0 1 Pre Product 13 1 2 Pre Product 12 2 3 Pre Product 17 3 4 Pre Product 12 4 5 Pre Product 19 Let's first calculate the epsilon of the *Time* within-subject factor >>> pg.epsilon(data, dv='Performance', subject='Subject', ... within='Time') 1.0 Since *Time* has only two levels (Pre and Post), the sphericity assumption is necessarily met, and therefore the epsilon adjustement factor is 1. The *Metric* factor, however, has three levels: >>> round(pg.epsilon(data, dv='Performance', subject='Subject', ... within=['Metric']), 3) 0.969 The epsilon value is very close to 1, meaning that there is no major violation of sphericity. Now, let's calculate the epsilon for the interaction between the two repeated measures factor: >>> round(pg.epsilon(data, dv='Performance', subject='Subject', ... within=['Time', 'Metric']), 3) 0.727 Alternatively, we could use a wide-format dataframe with two column levels: >>> # Pivot from long-format to wide-format >>> piv = data.pivot(index='Subject', columns=['Time', 'Metric'], values='Performance') >>> piv.head() Time Pre Post Metric Product Client Action Product Client Action Subject 1 13 12 17 18 30 34 2 12 19 18 6 18 30 3 17 19 24 21 31 32 4 12 25 25 18 39 40 5 19 27 19 18 28 27 >>> round(pg.epsilon(piv), 3) 0.727 which gives the same epsilon value as the long-format dataframe.
def epsilon(data, dv=None, within=None, subject=None, correction="gg"): """Epsilon adjustement factor for repeated measures. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame containing the repeated measurements. Both wide and long-format dataframe are supported for this function. To test for an interaction term between two repeated measures factors with a wide-format dataframe, ``data`` must have a two-levels :py:class:`pandas.MultiIndex` columns. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within factor (only required if ``data`` is in long format). If ``within`` is a list with two strings, this function computes the epsilon factor for the interaction between the two within-subject factor. subject : string Name of column containing the subject identifier (only required if ``data`` is in long format). correction : string Specify the epsilon version: * ``'gg'``: Greenhouse-Geisser * ``'hf'``: Huynh-Feldt * ``'lb'``: Lower bound Returns ------- eps : float Epsilon adjustement factor. See Also -------- sphericity : Mauchly and JNS test for sphericity. homoscedasticity : Test equality of variance. Notes ----- The lower bound epsilon is: .. math:: lb = \\frac{1}{\\text{dof}}, where the degrees of freedom :math:`\\text{dof}` is the number of groups :math:`k` minus 1 for one-way design and :math:`(k_1 - 1)(k_2 - 1)` for two-way design The Greenhouse-Geisser epsilon is given by: .. math:: \\epsilon_{GG} = \\frac{k^2(\\overline{\\text{diag}(S)} - \\overline{S})^2}{(k-1)(\\sum_{i=1}^{k}\\sum_{j=1}^{k}s_{ij}^2 - 2k\\sum_{j=1}^{k}\\overline{s_i}^2 + k^2\\overline{S}^2)} where :math:`S` is the covariance matrix, :math:`\\overline{S}` the grandmean of S and :math:`\\overline{\\text{diag}(S)}` the mean of all the elements on the diagonal of S (i.e. mean of the variances). The Huynh-Feldt epsilon is given by: .. math:: \\epsilon_{HF} = \\frac{n(k-1)\\epsilon_{GG}-2}{(k-1) (n-1-(k-1)\\epsilon_{GG})} where :math:`n` is the number of observations. Missing values are automatically removed from data (listwise deletion). Examples -------- Using a wide-format dataframe >>> import pandas as pd >>> import pingouin as pg >>> data = pd.DataFrame({'A': [2.2, 3.1, 4.3, 4.1, 7.2], ... 'B': [1.1, 2.5, 4.1, 5.2, 6.4], ... 'C': [8.2, 4.5, 3.4, 6.2, 7.2]}) >>> gg = pg.epsilon(data, correction='gg') >>> hf = pg.epsilon(data, correction='hf') >>> lb = pg.epsilon(data, correction='lb') >>> print("%.2f %.2f %.2f" % (lb, gg, hf)) 0.50 0.56 0.62 Now using a long-format dataframe >>> data = pg.read_dataset('rm_anova2') >>> data.head() Subject Time Metric Performance 0 1 Pre Product 13 1 2 Pre Product 12 2 3 Pre Product 17 3 4 Pre Product 12 4 5 Pre Product 19 Let's first calculate the epsilon of the *Time* within-subject factor >>> pg.epsilon(data, dv='Performance', subject='Subject', ... within='Time') 1.0 Since *Time* has only two levels (Pre and Post), the sphericity assumption is necessarily met, and therefore the epsilon adjustement factor is 1. The *Metric* factor, however, has three levels: >>> round(pg.epsilon(data, dv='Performance', subject='Subject', ... within=['Metric']), 3) 0.969 The epsilon value is very close to 1, meaning that there is no major violation of sphericity. Now, let's calculate the epsilon for the interaction between the two repeated measures factor: >>> round(pg.epsilon(data, dv='Performance', subject='Subject', ... within=['Time', 'Metric']), 3) 0.727 Alternatively, we could use a wide-format dataframe with two column levels: >>> # Pivot from long-format to wide-format >>> piv = data.pivot(index='Subject', columns=['Time', 'Metric'], values='Performance') >>> piv.head() Time Pre Post Metric Product Client Action Product Client Action Subject 1 13 12 17 18 30 34 2 12 19 18 6 18 30 3 17 19 24 21 31 32 4 12 25 25 18 39 40 5 19 27 19 18 28 27 >>> round(pg.epsilon(piv), 3) 0.727 which gives the same epsilon value as the long-format dataframe. """ assert isinstance(data, pd.DataFrame), "Data must be a pandas Dataframe." # If data is in long-format, convert to wide-format if all([v is not None for v in [dv, within, subject]]): data = _long_to_wide_rm(data, dv=dv, within=within, subject=subject) # From now on we assume that data is in wide-format and contains only # the relevant columns. # Drop rows with missing values data = data.dropna() # Support for two-way factor of shape (2, N) data = _check_multilevel_rm(data, func="epsilon") # Covariance matrix S = data.cov(numeric_only=True) n, k = data.shape # Epsilon is always 1 with only two repeated measures. if k <= 2: return 1.0 # Degrees of freedom if S.columns.nlevels == 1: # One-way design dof = k - 1 else: # Two-way design (>2, >2) ka, kb = S.columns.levshape dof = (ka - 1) * (kb - 1) # Lower bound if correction == "lb": return 1 / dof # Greenhouse-Geisser # Method 1. Sums of squares. (see real-statistics.com) mean_var = np.diag(S).mean() S_mean = S.mean().mean() ss_mat = (S**2).sum().sum() ss_rows = (S.mean(1) ** 2).sum().sum() num = (k * (mean_var - S_mean)) ** 2 den = (k - 1) * (ss_mat - 2 * k * ss_rows + k**2 * S_mean**2) eps = np.min([num / den, 1]) # Method 2. Eigenvalues. # Sv = S.to_numpy() # S_pop = Sv - Sv.mean(0)[:, None] - Sv.mean(1)[None, :] + Sv.mean() # eig = np.linalg.eigvalsh(S_pop) # eig = eig[eig > 0.1] # V = eig.sum()**2 / np.sum(eig**2) # eps = np.min([V / dof, 1]) # Huynh-Feldt if correction == "hf": num = n * dof * eps - 2 den = dof * (n - 1 - dof * eps) eps = np.min([num / den, 1]) return eps
(data, dv=None, within=None, subject=None, correction='gg')
[ 0.050988927483558655, 0.0019546118564903736, 0.0306631438434124, 0.024840200319886208, 0.030030688270926476, -0.03805632144212723, 0.004179107490926981, -0.08788938075304031, 0.060192231088876724, 0.05905817449092865, -0.026410432532429695, -0.020478444173932076, 0.02488381788134575, 0.0452314093708992, -0.04248350113630295, 0.040738798677921295, -0.033192962408065796, 0.013390590436756611, 0.02562531642615795, 0.005643021780997515, -0.035352032631635666, -0.03208071365952492, -0.025210948660969734, 0.028765778988599777, -0.017054464668035507, 0.020314877852797508, 0.007066044490784407, -0.006275476422160864, -0.02673756331205368, 0.029223764315247536, -0.01930077001452446, -0.0266285203397274, -0.06817424297332764, -0.023706143721938133, 0.03373818099498749, -0.025167331099510193, 0.010419144295156002, -0.04191647469997406, -0.035700973123311996, -0.00015615427400916815, -0.06751997768878937, 0.011515035293996334, 0.016879994422197342, -0.011209712363779545, -0.005411303136497736, -0.002697473391890526, 0.056223031133413315, 0.03988825902342796, -0.02357529103755951, -0.0023185459431260824, -0.013259737752377987, -0.02723916620016098, 0.0567900612950325, 0.005059636663645506, -0.03428339958190918, 0.030924849212169647, -0.008450902067124844, -0.01839570514857769, 0.0064990161918103695, -0.07018065452575684, 0.04414096847176552, 0.00513869384303689, 0.031797200441360474, -0.007164184004068375, -0.004552582744508982, 0.004416277632117271, -0.005261368118226528, -0.018253948539495468, 0.002292647957801819, -0.02427317202091217, -0.03884143754839897, -0.047368668019771576, 0.02904929406940937, -0.025472654029726982, 0.025407228618860245, 0.023640716448426247, -0.02569074183702469, -0.043704792857170105, -0.016607385128736496, 0.005040554329752922, 0.010522736236453056, 0.018831880763173103, -0.006226406432688236, -0.004996936768293381, 0.0668657198548317, 0.03142645210027695, -0.0011429163860157132, 0.044402673840522766, 0.10590343177318573, -0.0008471347973681986, 0.020020458847284317, -0.027326401323080063, 0.06198054924607277, 0.009268730878829956, 0.032800402492284775, 0.03271316736936569, -0.004817014094442129, -0.00798746570944786, 0.03936484828591347, -0.04348670691251755, 0.04920060560107231, 0.06725827604532242, 0.03393445909023285, 0.020980045199394226, -0.013357877731323242, -0.027173738926649094, 0.0010195603827014565, -0.0053704120218753815, 0.059189025312662125, -0.02201596274971962, -0.08736597001552582, 0.03447968140244484, -0.07393176108598709, -0.01629115827381611, -0.0076603335328400135, -0.04213456064462662, -0.02900567650794983, 0.04030262306332588, -0.041349444538354874, 0.00834731012582779, 0.010315552353858948, 0.0396919772028923, -0.06642954051494598, 0.036725983023643494, -0.0008798479102551937, -0.07619987428188324, 0.051992129534482956, 0.0022313108202069998, -0.04645270109176636, -0.03343285992741585, 0.055874090641736984, 0.021579787135124207, 0.01612759195268154, -0.004476252011954784, -0.0021018211264163256, 0.013325164094567299, 0.08147759735584259, 0.004934236407279968, 0.047717608511447906, -0.06909020990133286, 0.030226968228816986, 0.010926198214292526, -0.05508897826075554, -0.003873784327879548, 0.005708448123186827, -0.011340565048158169, 0.00018827110761776567, -0.009841212071478367, -0.025647124275565147, 0.04387926310300827, -0.029027484357357025, -0.012878084555268288, 0.07144556194543839, -0.06110819801688194, 0.06494654715061188, -0.05408577248454094, 0.04610376060009003, -0.042090944945812225, -0.01000477746129036, -0.02115451544523239, -0.0396919772028923, -0.017152605578303337, 0.00399373285472393, 0.0734083503484726, 0.016422010958194733, 0.006711652036756277, -0.039430271834135056, -0.0076221683993935585, -0.009737620130181313, -0.0032140689436346292, 0.031099319458007812, 0.02145983837544918, -0.05159957334399223, -0.010822606272995472, -0.061239052563905716, 0.0034948568791151047, 0.028133325278759003, 0.021525265648961067, 0.03548288345336914, -0.031099319458007812, -0.00404552835971117, -0.021285368129611015, 0.003579365788027644, 0.012223821133375168, -0.019180821254849434, 0.03308391943573952, 0.02627957984805107, 0.01033190917223692, -0.038470685482025146, -0.03397807851433754, -0.03986644744873047, -0.06311460584402084, 0.006389972288161516, 0.07763925194740295, 0.008843460120260715, 0.005768422037363052, 0.06237310916185379, 0.03967016935348511, 0.003661148715764284, 0.017774155363440514, -0.04047709330916405, -0.004792479332536459, 0.00037892753607593477, -0.0648593083024025, -0.008952504023909569, -0.057182617485523224, -0.08274251222610474, -0.04915698990225792, 0.0050432803109288216, 0.023248158395290375, -0.00827097985893488, 0.010604518465697765, -0.0009132426348514855, 0.04060794785618782, 0.013554156757891178, -0.031142937019467354, 0.08540318161249161, -0.023182732984423637, 0.049636781215667725, 0.018679220229387283, -0.03338924050331116, -0.07314664870500565, -0.022681130096316338, 0.051643189042806625, 0.04972401633858681, -0.008412736468017101, 0.02669394575059414, 0.11567376554012299, 0.020173121243715286, -0.06629868596792221, 0.01779596321284771, 0.013532347977161407, -0.026366814970970154, -0.07292855530977249, 0.02900567650794983, 0.013085267506539822, -0.05949435010552406, 0.016803665086627007, -0.005741161294281483, 0.01040823943912983, -0.002859676256775856, -0.038165364414453506, -0.019442526623606682, 0.07602540403604507, 0.0012206101091578603, -0.055612385272979736, 0.04030262306332588, 0.02981260046362877, 0.038078129291534424, 0.01106250286102295, -0.014284750446677208, -0.05936349555850029, 0.010904389433562756, 0.025494463741779327, 0.00839637964963913, -0.004522595554590225, 0.0042472598142921925, 0.07528390735387802, 0.06560080498456955, -0.023989656940102577, 0.023509863764047623, 0.010500927455723286, 0.02880939655005932, 0.021481648087501526, -0.043857455253601074, 0.06259119510650635, -0.05103254318237305, -0.013336068950593472, 0.038928672671318054, 0.009012478403747082, 0.014590073376893997, 0.042156368494033813, -0.006160980090498924, 0.0002581273438408971, -0.03112112730741501, 0.033498283475637436, -0.0381871722638607, 0.02974717505276203, -0.02638862282037735, 0.0037947276141494513, -0.03482862189412117, -0.03916856646537781, -0.0012696798657998443, 0.018014051020145416, -0.06852318346500397, 0.028831206262111664, -0.06529548764228821, -0.03290944918990135, 0.06747636198997498, -0.0002463710552547127, -0.05085807293653488, -0.052341070026159286, -0.008325501345098019, -0.011602270416915417, 0.05644112080335617, 0.038623347878456116, -0.03397807851433754, -0.001650652033276856, 0.01604035682976246, 0.059843290597200394, 0.03304030001163483, 0.03775099664926529, 0.044359058141708374, 0.021328985691070557, -0.06651677936315536, 0.08409465104341507, 0.008543589152395725, 0.0005503309075720608, 0.06529548764228821, -0.06110819801688194, -0.01895182952284813, 0.02066381834447384, -0.033759988844394684, 0.06110819801688194, 0.010217413306236267, -0.04117497429251671, 0.0013030745321884751, -0.0698317140340805, 0.05072722211480141, 0.0019832358229905367, 0.008816199377179146, 0.02981260046362877, 0.027675339952111244, -0.019682424142956734, 0.009475914761424065, -0.0497676357626915, 0.009492271579802036, 0.008870720863342285, 0.026563093066215515, -0.01909358613193035, -0.017119891941547394, -0.03637704253196716, -0.008707155473530293, 0.028024280443787575, -0.02569074183702469, -0.02558169886469841, 0.028569500893354416, -0.0002458599046804011, 0.02769714966416359, -0.0008369119022972882, 0.04697611182928085, 0.04377022013068199, -0.05081445723772049, -0.04680164158344269, -0.004942414816468954, -0.049244225025177, -0.008080152794718742, -0.02422955445945263, 0.008101961575448513, 0.05107616260647774, -0.023509863764047623, 0.030728569254279137, 0.029987070709466934, 0.011776740662753582, 0.06922106444835663, -0.01025557890534401, -0.007845708169043064, -0.06904659420251846, 0.02166702225804329, 0.0004307233903091401, 0.016476532444357872, 0.064335897564888, 0.008123770356178284, 0.0049260579980909824, 0.010282839648425579, -0.042090944945812225, -0.027173738926649094, -0.0010113820899277925, -0.009426845237612724, 0.024098701775074005, -0.005204119719564915, -0.06629868596792221, 0.008630824275314808, -0.057924117892980576, 0.03144825994968414, 0.010931650176644325, -0.01228924747556448, 0.02106728032231331, -0.027108313515782356, 0.005553060211241245, 0.03181900829076767, -0.030248776078224182, -0.08121589571237564, 0.010168343782424927, 0.03251688927412033, -0.022026866674423218, 0.03679141029715538, 0.02728278376162052, 0.06459760665893555, -0.005018745549023151, -0.010413692332804203, -0.007196897175163031, 0.06926468014717102, 0.04110955074429512, 0.00866898987442255, 0.026519475504755974, -0.032102521508932114, -0.01467730849981308, -0.08928514271974564, 0.03960474207997322, -0.024164127185940742, 0.000379949837224558, -0.0019995924085378647, -0.000719008210580796, -0.01728345826268196, -0.06437951326370239, -0.013183407485485077, -0.0015020796563476324, 0.006215502042323351, 0.06878489255905151, -0.009383227676153183, 0.021786971017718315, -0.006182788871228695, 0.03373818099498749, -0.02131808176636696, 0.013030746020376682, -0.0075567420572042465, -0.06821785867214203, -0.0003061748284380883, 0.0002693725109566003, 0.030248776078224182, -0.10895666480064392, -0.009443201124668121, 0.06102096289396286, 0.044511716812849045, 0.004269068595021963, -0.0593198798596859, -0.029921645298600197, -0.03738024830818176, -0.018362991511821747, -0.007049687672406435, -0.018570175394415855, 0.016400201246142387, -0.001777415513060987, 0.021896013990044594, 0.013554156757891178, -0.04780484363436699, 0.02272474765777588, -0.009541341103613377, -0.00876712892204523, -0.0040509807877242565, 0.0015920408768579364, 0.00007364722841884941, -0.018112191930413246, -0.016094878315925598, 0.009781237691640854, 0.03938665613532066, -0.047412287443876266, -0.06490292400121689, -0.005498538259416819, 0.06289651989936829, -0.019180821254849434, 0.06045393645763397, -0.03312753513455391, -0.017621492967009544, 0.005964701063930988, -0.027675339952111244, -0.04989848658442497, -0.02723916620016098, 0.014317463152110577, 0.010719015263020992, 0.018820976838469505, -0.04213456064462662, 0.02111089788377285, -0.052646394819021225, 0.04549311473965645, 0.03051048144698143, 0.006984261330217123, -0.018820976838469505, -0.03945208340883255, 0.0074640545062720776, -0.005013293121010065, -0.02669394575059414, -0.00078852369915694, -0.00020871683955192566, 0.01588769629597664, -0.058491144329309464, -0.0012281069066375494, 0.019311673939228058, 0.007971108891069889, 0.028831206262111664, -0.013728627003729343, 0.06045393645763397, 0.005997414235025644, 0.04462076351046562, 0.010577257722616196, -0.005503990687429905, -0.004645269829779863, -0.03805632144212723, -0.05399853736162186, -0.029572704806923866, 0.023749761283397675, 0.01563689485192299, 0.09622033685445786, -0.010086560621857643, -0.013325164094567299, 0.03513394296169281, -0.02221224084496498, 0.05146871879696846, -0.06289651989936829, 0.05600494518876076, 0.010697206482291222, -0.04885166510939598, -0.010697206482291222, 0.038318026810884476, -0.029616322368383408, -0.017054464668035507, 0.03386903554201126, -0.00809105671942234, 0.026214152574539185, 0.004075515549629927, -0.043203189969062805, 0.057182617485523224, 0.015309763140976429, 0.022790174931287766, 0.0015756842913106084, -0.004778848960995674, -0.012180203571915627, 0.01768692024052143, 0.01899544708430767, -0.0005949707701802254, -0.04217818006873131, -0.000296122336294502, 0.023858804255723953, 0.00217406265437603, 0.06594974547624588, -0.023139115422964096, 0.009879376739263535, 0.020696531981229782, 0.008358214981853962, -0.023684334009885788, -0.049680400639772415, 0.04496970400214195, 0.04510055482387543, -0.04531864449381828, -0.029768982902169228, -0.0009507264476269484, -0.03290944918990135, 0.020685628056526184, -0.0042799729853868484, -0.000833504309412092, -0.0027233713772147894, 0.008838008157908916, -0.009661288931965828, -0.002450761618092656, 0.014241132885217667, 0.013107076287269592, 0.02015131153166294, -0.0035275700502097607, -0.011078859679400921, 0.0406951829791069, -0.023400820791721344, 0.02985621802508831, 0.04363936558365822, 0.02623596228659153, 0.05290810018777847, 0.04411916062235832, 0.01769782416522503, 0.02207048423588276, -0.037576526403427124, -0.04640908166766167, -0.11392906308174133, 0.08479253202676773, -0.043748412281274796, -0.01070265844464302, -0.025821594521403313, -0.005484907887876034, 0.0024166854564100504, -0.04267977923154831, 0.006897026672959328, -0.01226743869483471, 0.04429363086819649, 0.03081580437719822, -0.022593894973397255, -0.07798819243907928, -0.024185936897993088, -0.03823079168796539, -0.008576302789151669, -0.04911337047815323, -0.04148029908537865, -0.014982631430029869, -0.061849698424339294, -0.007742116693407297, -0.003936484456062317, -0.02542903646826744, 0.021601594984531403, -0.018112191930413246, 0.030793996527791023, -0.032102521508932114, 0.03040143847465515, -0.04001910984516144, 0.010849867947399616, -0.025254566222429276, -0.029681747779250145, -0.019420718774199486, 0.024185936897993088, 0.038885053247213364, 0.0020854645408689976, 0.05338789150118828, -0.014710021205246449, -0.027937045320868492, 0.03144825994968414, 0.006449946667999029, -0.020293070003390312, 0.007584002800285816, -0.020129503682255745, 0.01693451777100563, -0.012540047988295555, 0.027828002348542213, -0.0683487132191658, 0.014459220692515373, 0.02734820917248726, -0.036660559475421906, -0.02784981019794941, -0.007256871089339256, 0.009715811349451542, -0.043704792857170105, 0.011471417732536793, -0.022190432995557785, 0.002738364739343524, -0.03151368722319603, 0.012223821133375168, 0.013401495292782784, 0.006379067897796631, 0.03648608922958374, -0.04510055482387543, 0.0213616993278265, -0.0809105709195137, -0.05971243605017662, -0.08583935350179672, 0.023182732984423637, 0.06368163228034973, -0.016094878315925598, -0.003999184817075729, -0.02965993992984295, 0.01073537115007639, 0.02562531642615795, -0.018057668581604958, -0.05539429932832718, 0.03724939376115799, -0.020990949124097824, 0.0032086167484521866, 0.005018745549023151, 0.047063346952199936, 0.03722758591175079, 0.04353032261133194, 0.007420436944812536, -0.04588567093014717, 0.00198596203699708, 0.011089764535427094, 0.04152391478419304, 0.008614467456936836, -0.014306559227406979, -0.03389084339141846, -0.012452812865376472, 0.019278960302472115, -0.00301506370306015, 0.043813835829496384, -0.031491875648498535, -0.008287335745990276, 0.02634500525891781, -0.008123770356178284, -0.08125951141119003, -0.028678543865680695, 0.10564173012971878, 0.03967016935348511, 0.038972288370132446, 0.0273918267339468, -0.013946713879704475, 0.05914540961384773, -0.02654128521680832, 0.01824304461479187, -0.00535132922232151, -0.0010774900438264012, 0.012627283111214638, -0.05242830514907837, -0.005446742754429579, -0.023379011079669, -0.05535067990422249, 0.0023717046715319157, -0.003393991384655237, 0.05343151092529297, 0.006984261330217123, -0.029921645298600197, -0.0019028160022571683, -0.04954954609274864, 0.04972401633858681, -0.006160980090498924, 0.02171063981950283, -0.045754820108413696, -0.09674374759197235, 0.029790792614221573, 0.021176325157284737, 0.030575908720493317, -0.016978135332465172, -0.056920912116765976, -0.040084537118673325, 0.024862008169293404, 0.012605474330484867, -0.04132763668894768, 0.024098701775074005, 0.026454050093889236, -0.0029687201604247093, 0.02935461699962616, 0.043050531297922134, 0.08453083038330078, 0.009339610114693642, 0.017556067556142807, -0.0010768084321171045, -0.04889528453350067, -0.030619526281952858, 0.044402673840522766, 0.006122814957052469, -0.05452194809913635, 0.017359787598252296, 0.038078129291534424, 0.05609218031167984, -0.01562599092721939, -0.03504670783877373, 0.04065156355500221, 0.00864718109369278, 0.0037620144430547953, 0.03905952349305153, -0.040782418102025986, -0.08405103534460068, 0.03306210786104202, 0.002818784676492214, -0.06110819801688194, 0.04012815281748772, -0.015255240723490715, 0.01885369047522545, 0.06708380579948425, 0.04052071273326874, 0.04496970400214195, -0.0462346114218235, -0.008794390596449375, -0.028918441385030746, -0.02946365997195244, -0.004274520557373762, 0.03441425412893295, -0.012103872373700142, 0.018014051020145416, -0.012921702116727829, -0.0909862294793129, -0.0015920408768579364, 0.014622786082327366, -0.004882440436631441, 0.031339216977357864, 0.037969086319208145, -0.049680400639772415, 0.01955157145857811, -0.04442448168992996, 0.020140407606959343, 0.0035084872506558895, -0.007360463030636311, 0.05338789150118828, 0.04793569818139076, -0.042701590806245804, -0.0046916138380765915, -0.03528660535812378, -0.024491259828209877, -0.03081580437719822, 0.04065156355500221, 0.08863087743520737, -0.055917710065841675, 0.02931099943816662, 0.004759766161441803, 0.04850272461771965 ]
32,009
pingouin.nonparametric
friedman
Friedman test for repeated measurements. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Both wide and long-format dataframe are supported for this test. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within-subject factor (only required if ``data`` is in long format). Two or more within-factor are not currently supported. subject : string Name of column containing the subject/rater identifier (only required if ``data`` is in long format). method : string Statistical test to perform. Must be ``'chisq'`` (chi-square test) or ``'f'`` (F test). See notes below for explanation. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'W'``: Kendall's coefficient of concordance, corrected for ties If ``method='chisq'`` * ``'Q'``: The Friedman chi-square statistic, corrected for ties * ``'dof'``: degrees of freedom * ``'p-unc'``: Uncorrected p-value of the chi squared test If ``method='f'`` * ``'F'``: The Friedman F statistic, corrected for ties * ``'dof1'``: degrees of freedom of the numerator * ``'dof2'``: degrees of freedom of the denominator * ``'p-unc'``: Uncorrected p-value of the F test Notes ----- The Friedman test is used for non-parametric (rank-based) one-way repeated measures ANOVA. It is equivalent to the test of significance of Kendalls's coefficient of concordance (Kendall's W). Most commonly a Q statistic, which has asymptotical chi-squared distribution, is computed and used for testing. However, the chi-squared test tend to be overly conservative for small numbers of samples and/or repeated measures, in which case a F-test is more adequate [1]_. Data can be in wide or long format. Missing values are automatically removed using a strict listwise approach (= complete-case analysis). In other words, any subject with one or more missing value(s) is completely removed from the dataframe prior to running the test. References ---------- .. [1] Marozzi, M. (2014). Testing for concordance between several criteria. Journal of Statistical Computation and Simulation, 84(9), 1843–1850. https://doi.org/10.1080/00949655.2013.766189 .. [2] https://www.real-statistics.com/anova-repeated-measures/friedman-test/ Examples -------- Compute the Friedman test for repeated measurements, using a wide-format dataframe >>> import pandas as pd >>> import pingouin as pg >>> df = pd.DataFrame({ ... 'white': {0: 10, 1: 8, 2: 7, 3: 9, 4: 7, 5: 4, 6: 5, 7: 6, 8: 5, 9: 10, 10: 4, 11: 7}, ... 'red': {0: 7, 1: 5, 2: 8, 3: 6, 4: 5, 5: 7, 6: 9, 7: 6, 8: 4, 9: 6, 10: 7, 11: 3}, ... 'rose': {0: 8, 1: 5, 2: 6, 3: 4, 4: 7, 5: 5, 6: 3, 7: 7, 8: 6, 9: 4, 10: 4, 11: 3}}) >>> pg.friedman(df) Source W ddof1 Q p-unc Friedman Within 0.083333 2 2.0 0.367879 Compare with SciPy >>> from scipy.stats import friedmanchisquare >>> friedmanchisquare(*df.to_numpy().T) FriedmanchisquareResult(statistic=1.9999999999999893, pvalue=0.3678794411714444) Using a long-format dataframe >>> df_long = df.melt(ignore_index=False).reset_index() >>> pg.friedman(data=df_long, dv="value", within="variable", subject="index") Source W ddof1 Q p-unc Friedman variable 0.083333 2 2.0 0.367879 Using the F-test method >>> pg.friedman(df, method="f") Source W ddof1 ddof2 F p-unc Friedman Within 0.083333 1.833333 20.166667 1.0 0.378959
def friedman(data=None, dv=None, within=None, subject=None, method="chisq"): """Friedman test for repeated measurements. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame. Both wide and long-format dataframe are supported for this test. dv : string Name of column containing the dependent variable (only required if ``data`` is in long format). within : string Name of column containing the within-subject factor (only required if ``data`` is in long format). Two or more within-factor are not currently supported. subject : string Name of column containing the subject/rater identifier (only required if ``data`` is in long format). method : string Statistical test to perform. Must be ``'chisq'`` (chi-square test) or ``'f'`` (F test). See notes below for explanation. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'W'``: Kendall's coefficient of concordance, corrected for ties If ``method='chisq'`` * ``'Q'``: The Friedman chi-square statistic, corrected for ties * ``'dof'``: degrees of freedom * ``'p-unc'``: Uncorrected p-value of the chi squared test If ``method='f'`` * ``'F'``: The Friedman F statistic, corrected for ties * ``'dof1'``: degrees of freedom of the numerator * ``'dof2'``: degrees of freedom of the denominator * ``'p-unc'``: Uncorrected p-value of the F test Notes ----- The Friedman test is used for non-parametric (rank-based) one-way repeated measures ANOVA. It is equivalent to the test of significance of Kendalls's coefficient of concordance (Kendall's W). Most commonly a Q statistic, which has asymptotical chi-squared distribution, is computed and used for testing. However, the chi-squared test tend to be overly conservative for small numbers of samples and/or repeated measures, in which case a F-test is more adequate [1]_. Data can be in wide or long format. Missing values are automatically removed using a strict listwise approach (= complete-case analysis). In other words, any subject with one or more missing value(s) is completely removed from the dataframe prior to running the test. References ---------- .. [1] Marozzi, M. (2014). Testing for concordance between several criteria. Journal of Statistical Computation and Simulation, 84(9), 1843–1850. https://doi.org/10.1080/00949655.2013.766189 .. [2] https://www.real-statistics.com/anova-repeated-measures/friedman-test/ Examples -------- Compute the Friedman test for repeated measurements, using a wide-format dataframe >>> import pandas as pd >>> import pingouin as pg >>> df = pd.DataFrame({ ... 'white': {0: 10, 1: 8, 2: 7, 3: 9, 4: 7, 5: 4, 6: 5, 7: 6, 8: 5, 9: 10, 10: 4, 11: 7}, ... 'red': {0: 7, 1: 5, 2: 8, 3: 6, 4: 5, 5: 7, 6: 9, 7: 6, 8: 4, 9: 6, 10: 7, 11: 3}, ... 'rose': {0: 8, 1: 5, 2: 6, 3: 4, 4: 7, 5: 5, 6: 3, 7: 7, 8: 6, 9: 4, 10: 4, 11: 3}}) >>> pg.friedman(df) Source W ddof1 Q p-unc Friedman Within 0.083333 2 2.0 0.367879 Compare with SciPy >>> from scipy.stats import friedmanchisquare >>> friedmanchisquare(*df.to_numpy().T) FriedmanchisquareResult(statistic=1.9999999999999893, pvalue=0.3678794411714444) Using a long-format dataframe >>> df_long = df.melt(ignore_index=False).reset_index() >>> pg.friedman(data=df_long, dv="value", within="variable", subject="index") Source W ddof1 Q p-unc Friedman variable 0.083333 2 2.0 0.367879 Using the F-test method >>> pg.friedman(df, method="f") Source W ddof1 ddof2 F p-unc Friedman Within 0.083333 1.833333 20.166667 1.0 0.378959 """ # Convert from wide to long-format, if needed if all([v is None for v in [dv, within, subject]]): assert isinstance(data, pd.DataFrame) data = data._get_numeric_data().dropna() # Listwise deletion of missing values assert data.shape[0] > 2, "Data must have at least 3 non-missing rows." assert data.shape[1] > 1, "Data must contain at least two columns." data["Subj"] = np.arange(data.shape[0]) data = data.melt(id_vars="Subj", var_name="Within", value_name="DV") subject, within, dv = "Subj", "Within", "DV" # Check dataframe data = _check_dataframe(dv=dv, within=within, data=data, subject=subject, effects="within") assert not data[within].isnull().any(), "Cannot have missing values in `within`." assert not data[subject].isnull().any(), "Cannot have missing values in `subject`." # Pivot the table to a wide-format dataframe. This has several effects: # 1) Force missing values to be explicit (a NaN cell is created) # 2) Automatic collapsing to the mean if multiple within factors are present # 3) If using dropna, remove rows with missing values (listwise deletion). # The latter is the same behavior as JASP (= strict complete-case analysis). data_piv = data.pivot_table(index=subject, columns=within, values=dv, observed=True) data_piv = data_piv.dropna() # Extract data in numpy array and calculate ranks X = data_piv.to_numpy() n, k = X.shape ranked = scipy.stats.rankdata(X, axis=1) ssbn = (ranked.sum(axis=0) ** 2).sum() # Correction for ties ties = 0 for i in range(n): replist, repnum = scipy.stats.find_repeats(X[i]) for t in repnum: ties += t * (t * t - 1) # Compute Kendall's W corrected for ties W = (12 * ssbn - 3 * n**2 * k * (k + 1) ** 2) / (n**2 * k * (k - 1) * (k + 1) - n * ties) if method == "chisq": # Compute the Q statistic Q = n * (k - 1) * W # Approximate the p-value ddof1 = k - 1 p_unc = scipy.stats.chi2.sf(Q, ddof1) # Create output dataframe stats = pd.DataFrame( {"Source": within, "W": W, "ddof1": ddof1, "Q": Q, "p-unc": p_unc}, index=["Friedman"] ) elif method == "f": # Compute the F statistic F = W * (n - 1) / (1 - W) # Approximate the p-value ddof1 = k - 1 - 2 / n ddof2 = (n - 1) * ddof1 p_unc = scipy.stats.f.sf(F, ddof1, ddof2) # Create output dataframe stats = pd.DataFrame( {"Source": within, "W": W, "ddof1": ddof1, "ddof2": ddof2, "F": F, "p-unc": p_unc}, index=["Friedman"], ) return _postprocess_dataframe(stats)
(data=None, dv=None, within=None, subject=None, method='chisq')
[ 0.054267242550849915, 0.008676448836922646, 0.04127705097198486, -0.02524057775735855, 0.010830601677298546, -0.0463034063577652, -0.009350981563329697, -0.02116074413061142, 0.04713025316596031, 0.04095066338777542, -0.06149126961827278, 0.02336929365992546, 0.020736441016197205, 0.07141342759132385, -0.0463034063577652, 0.043822865933179855, 0.006816043984144926, 0.07785412669181824, -0.018571408465504646, 0.026176219806075096, -0.030441008508205414, -0.023129943758249283, 0.013719124719500542, 0.07985597103834152, -0.014535091817378998, 0.018854277208447456, -0.019137145951390266, -0.03949280083179474, 0.034509964287281036, 0.006261186674237251, -0.0037697674706578255, -0.002079355763271451, -0.007316503673791885, -0.02354336716234684, -0.005766166839748621, -0.022390134632587433, 0.0058260043151676655, -0.04713025316596031, -0.041951581835746765, 0.06431995332241058, 0.03727336972951889, 0.00137626426294446, 0.045476559549570084, -0.008888600394129753, -0.015753602609038353, 0.044453881680965424, 0.023064667358994484, 0.051133930683135986, -0.0021351135801523924, 0.02042093314230442, -0.030332213267683983, -0.045128412544727325, -0.0009716806816868484, -0.004901241511106491, 0.026959549635648727, 0.02474011853337288, -0.05888017639517784, -0.005635611712932587, 0.05696537345647812, -0.08390316367149353, 0.05996813252568245, 0.022052867338061333, 0.025088265538215637, 0.021128104999661446, -0.031463686376810074, -0.04134232550859451, 0.04184278845787048, -0.0007404900388792157, -0.0038704033941030502, -0.006631091702729464, -0.004294706042855978, 0.06458106637001038, 0.0012763083213940263, 0.02211814559996128, -0.018734602257609367, 0.03331321105360985, 0.009628410451114178, -0.1080993041396141, -0.02637205272912979, -0.025262337177991867, 0.07167454063892365, 0.03561967983841896, -0.026567885652184486, -0.033770155161619186, -0.020725561305880547, -0.0013749044155701995, 0.04652099683880806, 0.032421089708805084, 0.05683482065796852, -0.04686914384365082, 0.011945756152272224, -0.00588584179058671, 0.06144775450229645, -0.05444131791591644, -0.005450659431517124, -0.01815798506140709, -0.019311217591166496, -0.004351824056357145, -0.03011462092399597, 0.011543212458491325, -0.012185106985270977, 0.06971621513366699, 0.059141285717487335, 0.0882985070347786, -0.0010457977186888456, 0.04086362570524216, -0.034596998244524, -0.027155380696058273, -0.04012381657958031, -0.026633162051439285, -0.07263194024562836, -0.004795165732502937, -0.003612013766542077, 0.00435454398393631, 0.024413732811808586, -0.05422372370958328, -0.049219127744436264, 0.053701505064964294, -0.045694150030612946, 0.024718359112739563, 0.06358014792203903, 0.007800644263625145, -0.011336500756442547, -0.06349311023950577, 0.004387182649224997, -0.06880233436822891, -0.0004256627871654928, -0.025175301358103752, 0.05287466198205948, -0.007702728267759085, 0.013914956711232662, 0.054484836757183075, -0.0018821638077497482, 0.03964511677622795, -0.031246095895767212, 0.0006313544581644237, 0.06001165136694908, -0.03564143925905228, 0.03925345093011856, -0.03046276792883873, 0.08438186347484589, 0.023042907938361168, -0.018136225640773773, -0.00785504188388586, -0.011521453969180584, 0.03873123228549957, 0.017048269510269165, 0.02258596569299698, 0.0013259463012218475, 0.0046945298090577126, -0.016199665144085884, -0.058009810745716095, 0.03703401982784271, -0.029113702476024628, 0.06775789707899094, -0.05309225246310234, 0.028852593153715134, -0.00676708621904254, -0.007517775986343622, -0.02070380188524723, 0.01361032947897911, -0.06675697863101959, -0.04974134638905525, 0.04434508457779884, -0.03152896463871002, 0.015699204057455063, -0.02035565674304962, -0.03340024873614311, 0.016863318160176277, -0.04647747799754143, 0.012000154703855515, 0.0253058560192585, -0.050916340202093124, 0.01888691633939743, -0.029287774115800858, 0.01787511631846428, -0.03046276792883873, -0.026633162051439285, 0.002071196213364601, -0.06001165136694908, -0.014545971527695656, -0.04821820929646492, -0.018756361678242683, -0.035140976309776306, -0.036054860800504684, 0.03466227650642395, -0.0015897756675258279, -0.001924322103150189, 0.032638680189847946, -0.0004474218876566738, -0.061926454305648804, -0.046433959156274796, -0.008747166022658348, 0.01782071962952614, -0.02082347683608532, -0.029592402279376984, -0.0018821638077497482, -0.020856115967035294, 0.013055471703410149, -0.06758382171392441, -0.01856052875518799, 0.03398774564266205, 0.014730923809111118, 0.005282026249915361, -0.031180817633867264, 0.023521607741713524, -0.06109960749745369, 0.0016876916633918881, -0.014089030213654041, -0.0043763029389083385, 0.017657525837421417, -0.02024686150252819, -0.014382777735590935, 0.0410594567656517, 0.006892201025038958, -0.08499111980199814, 0.07311064004898071, -0.049219127744436264, 0.006462458521127701, -0.008290224708616734, -0.015916796401143074, -0.017842477187514305, -0.025566965341567993, 0.01021046657115221, -0.009024594910442829, -0.005766166839748621, 0.04686914384365082, 0.046042297035455704, 0.02286883443593979, -0.07058658450841904, 0.01037910021841526, -0.015100829303264618, 0.029461847618222237, -0.06262274831533432, -0.08094392716884613, -0.03307386115193367, -0.04023260995745659, -0.0013993834145367146, 0.006848682649433613, 0.022052867338061333, -0.00475164782255888, -0.05827092006802559, 0.03681642934679985, 0.023042907938361168, -0.0063482229597866535, -0.018538769334554672, 0.024130864068865776, 0.0391664132475853, -0.010433497838675976, -0.014730923809111118, -0.013425376266241074, -0.062100525945425034, -0.0018536050338298082, 0.014067270793020725, -0.006718127988278866, -0.05831443890929222, -0.02024686150252819, 0.04021085426211357, 0.018636684864759445, -0.011467056348919868, 0.043257128447294235, -0.015459854155778885, -0.0020575968082994223, 0.01918066293001175, -0.05435428023338318, 0.010520534589886665, -0.07963837683200836, 0.009095312096178532, 0.005116112995892763, -0.0245660450309515, 0.02190055325627327, -0.04726080596446991, -0.001381704118102789, 0.004585734568536282, -0.022259579971432686, 0.057270001620054245, -0.014665646478533745, 0.035206254571676254, -0.0008798844064585865, -0.05143855884671211, 0.008148790337145329, -0.031855352222919464, 0.017200583592057228, 0.014556851238012314, 0.0004552415630314499, 0.02155240811407566, -0.03940576687455177, 0.0094216987490654, 0.06270977854728699, -0.016134386882185936, -0.031746555119752884, -0.10104934871196747, 0.016428135335445404, 0.024304935708642006, 0.030593322589993477, 0.025741038843989372, 0.006712688133120537, -0.07589580863714218, 0.02428317815065384, -0.00203583762049675, -0.0060979933477938175, 0.015253142453730106, 0.05735703930258751, 0.04227796941995621, -0.061578307300806046, -0.00047292085946537554, 0.014078150503337383, -0.03853540122509003, -0.0029456408228725195, -0.07428563386201859, 0.0063536628149449825, 0.047521915286779404, -0.04188630357384682, -0.009835122153162956, 0.03712105751037598, -0.08690592646598816, -0.045650631189346313, -0.04016733542084694, 0.05217836797237396, 0.03705577924847603, 0.002124234102666378, -0.024479009211063385, 0.09095311909914017, 0.008627491071820259, 0.0324428454041481, 0.03300858289003372, 0.020725561305880547, 0.0044334204867482185, 0.013545052148401737, 0.00969912763684988, -0.03973215073347092, -0.021759118884801865, 0.04599877819418907, 0.0016496132593601942, -0.024892432615160942, 0.02661140263080597, 0.03501042351126671, -0.026285016909241676, 0.01449157390743494, -0.019789919257164, 0.040754832327365875, -0.003223069477826357, -0.010857800953090191, -0.021813517436385155, 0.0194526519626379, -0.0033073860686272383, -0.006837803404778242, 0.005842323414981365, 0.07811523973941803, 0.015209624543786049, -0.005260267294943333, -0.007909439504146576, 0.02513178251683712, 0.012642048299312592, 0.0636671856045723, -0.005613852757960558, -0.04673858731985092, 0.0009560413309372962, 0.006375421769917011, 0.008638370782136917, -0.007844162173569202, 0.034466445446014404, -0.02802574634552002, 0.022738279774785042, -0.016993872821331024, -0.03137664869427681, -0.032138220965862274, 0.013708245009183884, 0.013632087968289852, -0.008877720683813095, 0.023869754746556282, -0.033204417675733566, -0.042060378938913345, 0.007588492706418037, 0.026589643210172653, 0.015035551972687244, 0.030441008508205414, 0.00588584179058671, 0.02502298727631569, 0.003976479172706604, 0.024152621626853943, -0.023347534239292145, -0.04373582825064659, 0.026176219806075096, 0.013381858356297016, -0.03870947286486626, -0.04031964763998985, 0.009149709716439247, -0.020954031497240067, -0.04521545022726059, -0.02365216240286827, -0.0016210543690249324, 0.08481704443693161, 0.05888017639517784, -0.000189032347407192, 0.044388603419065475, -0.03046276792883873, -0.020235981792211533, -0.07676617056131363, 0.034466445446014404, 0.012489734217524529, -0.0433441661298275, -0.032769232988357544, 0.01256589125841856, -0.025458170101046562, -0.049132090061903, 0.01432838011533022, -0.036555320024490356, -0.009916719049215317, 0.058009810745716095, -0.017113547772169113, 0.04390990361571312, -0.04639044404029846, -0.0006038155406713486, -0.028286855667829514, 0.04101594164967537, -0.0029945988208055496, 0.0055594551376998425, 0.07680968940258026, 0.05452835187315941, 0.06897640973329544, -0.06880233436822891, 0.00020909153681714088, 0.0550505705177784, -0.011282103136181831, 0.0033536243718117476, -0.033095620572566986, 0.0059565589763224125, -0.03844836354255676, 0.009856880642473698, -0.004447020124644041, -0.016808919608592987, -0.04303953796625137, -0.0009438018314540386, -0.0014551411150023341, -0.03239933028817177, -0.06536439806222916, 0.03538032993674278, 0.00441166153177619, 0.004942039959132671, -0.0011335141025483608, 0.001274268375709653, -0.0005045395810157061, -0.033204417675733566, -0.05496353656053543, -0.011369139887392521, 0.04834876209497452, -0.05513760820031166, -0.07863745838403702, -0.04153816029429436, 0.08490408211946487, -0.007316503673791885, 0.012674687430262566, 0.03786086663603783, -0.05270058661699295, 0.024587804451584816, 0.04451915994286537, 0.0011335141025483608, -0.04142936319112778, 0.0037017702125012875, 0.025044746696949005, 0.003949280362576246, -0.0735023021697998, 0.05779222026467323, -0.0562690831720829, 0.08629667013883591, -0.0043083056807518005, -0.006794285029172897, 0.0062394277192652225, 0.00970456749200821, 0.005907600745558739, 0.007506896276026964, -0.0434747189283371, -0.04464971274137497, 0.04073307290673256, 0.026589643210172653, -0.09817714989185333, -0.010596690699458122, -0.012968434952199459, 0.026676680892705917, -0.009797043167054653, -0.011445296928286552, 0.047347843647003174, -0.027547044679522514, 0.04243028163909912, -0.09130126237869263, -0.004936600103974342, 0.006924839690327644, -0.005371782463043928, -0.0015394577058032155, 0.04134232550859451, 0.024196140468120575, 0.06170886382460594, 0.022542446851730347, -0.047521915286779404, 0.045868225395679474, 0.019811678677797318, -0.002991878893226385, 0.04045020416378975, -0.03109378181397915, 0.04179926961660385, -0.0374256856739521, -0.10757708549499512, 0.017907755449414253, 0.006418940145522356, -0.05378854274749756, 0.013479774817824364, 0.01616702601313591, 0.005143311806023121, 0.0005613173125311732, 0.0058314441703259945, -0.041494641453027725, 0.03137664869427681, -0.011358260177075863, 0.029483607038855553, 0.006146951112896204, 0.00011253544653300196, 0.046216368675231934, -0.016156146302819252, 0.005994637496769428, -0.00524666765704751, -0.016471654176712036, -0.0022235100623220205, 0.0476524718105793, -0.026480847969651222, 0.06823659688234329, 0.025958629325032234, 0.036729395389556885, 0.04578118771314621, -0.0010736765107139945, -0.03437940776348114, 0.02343457192182541, 0.025501687079668045, 0.03712105751037598, 0.015264022164046764, -0.016362857073545456, -0.015035551972687244, -0.05069874972105026, -0.01010167133063078, 0.014709164388477802, -0.00475164782255888, 0.019311217591166496, -0.009867760352790356, -0.06497272849082947, 0.014165186323225498, -0.027438249439001083, -0.009111631661653519, -0.06270977854728699, 0.04158167541027069, -0.04375758767127991, 0.004882202483713627, -0.06096905097365379, 0.051133930683135986, 0.03603310137987137, -0.010477015748620033, 0.028547964990139008, 0.04713025316596031, 0.034684035927057266, -0.011271223425865173, -0.009807922877371311, -0.053745023906230927, -0.051308002322912216, 0.07424211502075195, -0.032703954726457596, 0.033334970474243164, 0.0137626426294446, 0.0519607774913311, 0.013425376266241074, -0.09173645079135895, -0.0448237843811512, -0.03925345093011856, 0.06545142829418182, 0.01021590642631054, -0.00016208844317588955, -0.01907186768949032, -0.017962154000997543, -0.0010933957528322935, -0.06323200464248657, 0.004321905318647623, -0.03590254858136177, -0.021465370431542397, -0.038383085280656815, 0.00272396975196898, -0.018070949241518974, -0.03864419460296631, 0.017113547772169113, -0.017287621274590492, 0.018745481967926025, -0.04358351603150368, 0.02188967354595661, -0.05213484913110733, -0.03696874529123306, -0.01911538653075695, -0.04686914384365082, 0.021933192387223244, 0.05104689300060272, 0.00981336273252964, -0.010525974445044994, 0.10044009238481522, 0.0038676834665238857, -0.018908673897385597, 0.006386301480233669, -0.04005853831768036, -0.02922249771654606, 0.01560128852725029, 0.01984431780874729, 0.013077231124043465, 0.0038704033941030502, 0.020323017612099648, -0.017711922526359558, -0.014426296576857567, 0.010944836772978306, 0.03666411712765694, -0.012391818687319756, 0.04377934709191322, -0.019953113049268723, 0.009367301128804684, -0.05892369523644447, 0.00822494737803936, -0.023456331342458725, -0.015525131486356258, 0.0133600989356637, -0.00044912181328982115, 0.02382623590528965, 0.05679130181670189, 0.0059402394108474255, 0.023347534239292145, -0.007670089602470398, -0.04197334125638008, -0.0562690831720829, -0.013283942826092243, 0.06519032269716263, 0.03842660412192345, 0.0008166469633579254, -0.04974134638905525, 0.036076620221138, 0.0026314936112612486, -0.0011994714150205255, -0.026067424565553665, 0.018538769334554672, 0.01639549620449543, 0.03028869442641735, 0.0550505705177784, 0.02389151230454445, -0.02393503114581108, 0.015742722898721695, -0.002899402752518654, -0.10479191690683365, -0.009486976079642773, 0.008110711351037025, -0.01877811923623085, 0.021878793835639954, -0.04800061881542206, 0.023869754746556282, 0.07063010334968567, -0.013066351413726807, 0.015155226923525333, 0.0014265822246670723, 0.03424885496497154, 0.003122433554381132, 0.04652099683880806, -0.006021836306899786, 0.017516091465950012, -0.05692185461521149, 0.01185872033238411, 0.0403849259018898, 0.07698376476764679, -0.0004834604333154857, -0.004596613813191652, -0.0014891397440806031, 0.005706328898668289, 0.05383206158876419, -0.01939825527369976, -0.046651553362607956, -0.007120671682059765, -0.0010852360865101218, -0.045476559549570084, -0.0137626426294446, -0.022041987627744675, -0.007354582194238901, 0.014850598759949207, 0.047347843647003174, -0.002472379943355918, 0.030419249087572098, 0.0477830246090889, 0.006533175706863403, 0.023565126582980156, -0.06588661670684814, -0.060272760689258575, -0.05948943272233009, -0.031920626759529114, -0.05300521478056908, 0.029875271022319794, 0.021465370431542397, 0.010248545557260513, 0.006919399835169315, -0.011467056348919868, -0.016079988330602646, 0.008589412085711956, -0.030049344524741173, -0.008660129271447659, 0.017548730596899986, 0.10165860503911972, 0.012108949944376945, 0.007180509623140097, 0.03716457635164261, -0.0028586043044924736, 0.033552560955286026, 0.07981245219707489, -0.040820106863975525, -0.0046999696642160416, 0.034466445446014404, -0.00953593384474516, 0.030484525486826897, 0.0021269540302455425, 0.015916796401143074, -0.01962672546505928, 0.01364296767860651, 0.004996437579393387, -0.007566733751446009, 0.06362366676330566, 0.03218173608183861, 0.015274901874363422, 0.009710007347166538, 0.00005779766070190817, -0.02654612623155117, 0.026241498067975044, 0.003636492881923914, 0.012174227274954319, -0.03385718911886215, 0.03629421070218086, 0.012794362381100655, -0.0032257894054055214, 0.046782106161117554, 0.004215829540044069, -0.035249773412942886, 0.031072022393345833, 0.008948437869548798, -0.0003889442596118897, 0.08203188329935074, -0.026459088549017906, 0.027982227504253387, -0.040754832327365875, -0.06854122877120972, 0.05069874972105026, 0.07476433366537094, 0.017146186903119087, -0.013120749033987522, 0.025458170101046562, -0.048870980739593506, 0.04464971274137497, -0.0534403957426548, -0.032486364245414734, 0.04599877819418907, -0.024587804451584816, 0.06980325281620026, -0.0033563440665602684, -0.0432136096060276, 0.017222343012690544, -0.054484836757183075, -0.04856635630130768, -0.0022534288000315428, 0.05435428023338318, 0.06423292309045792, -0.013860559090971947, 0.03884002938866615, 0.003712649689987302, 0.044497400522232056 ]
32,010
pingouin.distribution
gzscore
Geometric standard (Z) score. Parameters ---------- x : array_like Array of raw values. axis : int or None, optional Axis along which to operate. Default is 0. If None, compute over the whole array `x`. ddof : int, optional Degrees of freedom correction in the calculation of the standard deviation. Default is 1. nan_policy : {'propagate', 'raise', 'omit'}, optional Defines how to handle when input contains nan. 'propagate' returns nan, 'raise' throws an error, 'omit' performs the calculations ignoring nan values. Default is 'propagate'. Note that when the value is 'omit', nans in the input also propagate to the output, but they do not affect the geometric z scores computed for the non-nan values. Returns ------- gzscore : array_like Array of geometric z-scores (same shape as x). Notes ----- Geometric Z-scores are better measures of dispersion than arithmetic z-scores when the sample data come from a log-normally distributed population [1]_. Given the raw scores :math:`x`, the geometric mean :math:`\mu_g` and the geometric standard deviation :math:`\sigma_g`, the standard score is given by the formula: .. math:: z = \frac{log(x) - log(\mu_g)}{log(\sigma_g)} References ---------- .. [1] https://en.wikipedia.org/wiki/Geometric_standard_deviation Examples -------- Standardize a lognormal-distributed vector: >>> import numpy as np >>> from pingouin import gzscore >>> np.random.seed(123) >>> raw = np.random.lognormal(size=100) >>> z = gzscore(raw) >>> print(round(z.mean(), 3), round(z.std(), 3)) -0.0 0.995
def gzscore(x, *, axis=0, ddof=1, nan_policy="propagate"): """Geometric standard (Z) score. Parameters ---------- x : array_like Array of raw values. axis : int or None, optional Axis along which to operate. Default is 0. If None, compute over the whole array `x`. ddof : int, optional Degrees of freedom correction in the calculation of the standard deviation. Default is 1. nan_policy : {'propagate', 'raise', 'omit'}, optional Defines how to handle when input contains nan. 'propagate' returns nan, 'raise' throws an error, 'omit' performs the calculations ignoring nan values. Default is 'propagate'. Note that when the value is 'omit', nans in the input also propagate to the output, but they do not affect the geometric z scores computed for the non-nan values. Returns ------- gzscore : array_like Array of geometric z-scores (same shape as x). Notes ----- Geometric Z-scores are better measures of dispersion than arithmetic z-scores when the sample data come from a log-normally distributed population [1]_. Given the raw scores :math:`x`, the geometric mean :math:`\\mu_g` and the geometric standard deviation :math:`\\sigma_g`, the standard score is given by the formula: .. math:: z = \\frac{log(x) - log(\\mu_g)}{log(\\sigma_g)} References ---------- .. [1] https://en.wikipedia.org/wiki/Geometric_standard_deviation Examples -------- Standardize a lognormal-distributed vector: >>> import numpy as np >>> from pingouin import gzscore >>> np.random.seed(123) >>> raw = np.random.lognormal(size=100) >>> z = gzscore(raw) >>> print(round(z.mean(), 3), round(z.std(), 3)) -0.0 0.995 """ warnings.warn( "gzscore is deprecated and will be removed in pingouin 0.7.0;" " use scipy.stats.gzscore instead." ) x = np.asanyarray(x) log = np.ma.log if isinstance(x, np.ma.MaskedArray) else np.log z = scipy.stats.zscore(log(x), axis=axis, ddof=ddof, nan_policy=nan_policy) return z
(x, *, axis=0, ddof=1, nan_policy='propagate')
[ -0.021217893809080124, 0.053035199642181396, -0.016766520217061043, 0.003962865564972162, 0.10507909208536148, -0.01553691178560257, -0.058830562978982925, 0.013945093378424644, 0.0980636477470398, 0.0007542074308730662, -0.005380728282034397, 0.029910938814282417, -0.027013257145881653, 0.0006356550729833543, -0.022018568590283394, 0.06775237619876862, -0.006943950895220041, 0.05600913614034653, 0.016728393733501434, 0.028557416051626205, -0.0019850071985274553, -0.02089381031692028, 0.008540535345673561, 0.003238445380702615, 0.0005465918802656233, -0.03259892016649246, 0.05078568309545517, 0.011352431029081345, -0.024058382958173752, -0.006133744027465582, -0.00827364344149828, -0.03805113583803177, -0.01830114796757698, 0.0025450033135712147, 0.004308395087718964, -0.015193765051662922, 0.004503798205405474, -0.021427594125270844, -0.053263965994119644, -0.0185108482837677, 0.003564910963177681, -0.00844521727412939, -0.06447342038154602, 0.00202909205108881, 0.0340668223798275, 0.04762111231684685, -0.025735989212989807, 0.04418964684009552, -0.056428540498018265, -0.015698952600359917, -0.025926625356078148, -0.033533040434122086, 0.015803802758455276, -0.027337338775396347, -0.0317029245197773, 0.03326614946126938, 0.06615102291107178, 0.026384154334664345, 0.023200517520308495, -0.02962498366832733, 0.01857757195830345, 0.010580350644886494, -0.03025408461689949, -0.03446716070175171, 0.004482351243495941, 0.01619460992515087, -0.04880306124687195, -0.0745009258389473, 0.016919029876589775, 0.018453657627105713, -0.021827930584549904, 0.009441295638680458, 0.05440778657793999, -0.0262888353317976, 0.02869086153805256, 0.1113319844007492, 0.027318276464939117, -0.023048007860779762, -0.020741300657391548, -0.018882591277360916, 0.02966311015188694, 0.0007363352342508733, 0.036735739558935165, -0.00641493359580636, -0.004155885428190231, -0.03345678746700287, 0.007477734703570604, 0.005890681874006987, 0.04723983630537987, 0.05688606575131416, 0.0022626223508268595, 0.0028452565893530846, 0.0650453269481659, 0.0005784640088677406, -0.025430969893932343, -0.021827930584549904, -0.03486749902367592, 0.020169390365481377, 0.04453279450535774, 0.02571692503988743, 0.032732363790273666, 0.10119009763002396, 0.017843618988990784, 0.03980499505996704, -0.029567791149020195, 0.05619977414608002, 0.05799176171422005, -0.015803802758455276, 0.006648463662713766, -0.006348210386931896, 0.020207516849040985, -0.03086412325501442, 0.04357960820198059, -0.06904870271682739, 0.02630789950489998, -0.06596038490533829, -0.002826192881911993, 0.0674092248082161, -0.03267517313361168, -0.016957156360149384, -0.006186169106513262, 0.013792583718895912, 0.014354962855577469, 0.024058382958173752, 0.001844412530772388, -0.02809988707304001, 0.010770987719297409, -0.014088070951402187, -0.04041503369808197, 0.05082381144165993, 0.05589475482702255, 0.03439090773463249, -0.026708237826824188, -0.0863204151391983, 0.03805113583803177, -0.019473565742373466, 0.1046978160738945, -0.01353522390127182, 0.04937497153878212, -0.07354773581027985, 0.0672185868024826, -0.03345678746700287, 0.0002412749017821625, -0.016585415229201317, 0.034162141382694244, 0.03326614946126938, 0.09829241782426834, 0.036735739558935165, 0.0947846919298172, -0.023200517520308495, 0.02148478478193283, 0.044075265526771545, 0.05440778657793999, -0.0039056746754795313, -0.027813931927084923, -0.04964186251163483, 0.0002695725706871599, -0.05459842458367348, -0.025145014747977257, 0.03368555009365082, -0.018644293770194054, 0.06474030762910843, -0.0573054701089859, -0.016795115545392036, 0.0016644989373162389, -0.023581791669130325, -0.012429529801011086, 0.014364494942128658, 0.0027928315103054047, -0.04140634834766388, -0.003888993989676237, -0.01682371087372303, -0.072861447930336, -0.0010568436700850725, 0.04194013029336929, 0.02009313553571701, -0.07983876019716263, 0.08944685757160187, -0.026975128799676895, 0.002444918965920806, 0.04979437217116356, -0.02668917365372181, -0.002359132282435894, -0.005976468324661255, -0.0405675433576107, -0.013487564399838448, 0.01635665073990822, -0.017681578174233437, -0.017595790326595306, 0.009365040808916092, -0.0370216965675354, -0.04426589980721474, -0.01954028755426407, -0.027165766805410385, 0.034524351358413696, 0.010999752208590508, -0.04872680455446243, 0.028709925711154938, 0.037936754524707794, 0.0124390609562397, -0.03166479989886284, 0.030292212963104248, -0.018062852323055267, -0.08937060832977295, -0.03517251834273338, 0.0037984412629157305, -0.02705138362944126, -0.05120508745312691, -0.06851492077112198, -0.007797051686793566, 0.0038103561382740736, 0.016938094049692154, -0.08578663319349289, -0.001710966695100069, 0.011076007038354874, -0.038146454840898514, 0.036430723965168, -0.042092639952898026, 0.04674418270587921, -0.002093432005494833, -0.0035315495915710926, -0.06470218300819397, -0.036125704646110535, 0.046324778348207474, 0.061003826558589935, 0.012429529801011086, 0.07629290968179703, 0.02747078612446785, 0.021179765462875366, -0.02049347199499607, 0.023048007860779762, -0.008111602626740932, 0.024420594796538353, -0.045676615089178085, 0.010389714501798153, -0.03845147415995598, 0.022247333079576492, 0.004067716188728809, 0.009426997043192387, 0.0278329961001873, -0.0017943703569471836, -0.02268579788506031, -0.015231892466545105, -0.014583727344870567, -0.015393934212625027, 0.007787519600242376, -0.04083443433046341, 0.08380400389432907, 0.05391212925314903, 0.06077506020665169, -0.04117758199572563, -0.02905307151377201, -0.02766142226755619, -0.04544784873723984, -0.013954625464975834, -0.015107979066669941, 0.014269175939261913, 0.016156481578946114, 0.03915683180093765, -0.0319698192179203, -0.04815489426255226, -0.01579427160322666, -0.015555975958704948, -0.024363402277231216, -0.05051879212260246, 0.02186605893075466, 0.05669543147087097, -0.044723428785800934, 0.05334021896123886, 0.05536097288131714, -0.02106538414955139, -0.002535471459850669, -0.016871370375156403, -0.0806775614619255, -0.0019671351183205843, 0.02091287449002266, 0.033513978123664856, 0.005695279221981764, 0.08388026058673859, 0.05635228380560875, 0.03915683180093765, -0.024229956790804863, -0.003981929272413254, 0.033533040434122086, -0.039728742092847824, 0.021179765462875366, -0.021942313760519028, -0.05478906258940697, -0.017185920849442482, 0.011504940688610077, -0.009117212146520615, 0.04258829727768898, -0.05650479346513748, 0.010180013254284859, 0.048879314213991165, -0.030215958133339882, 0.012925185263156891, -0.028519287705421448, 0.02308613620698452, 0.060050640255212784, 0.05513220652937889, 0.03797488287091255, 0.05600913614034653, -0.013058631680905819, -0.011342898942530155, 0.0019540288485586643, -0.0334758497774601, -0.05074755847454071, -0.02571692503988743, 0.041291963309049606, -0.016938094049692154, -0.00017827533883973956, -0.02625070884823799, -0.028423970565199852, 0.006386337801814079, 0.02466842159628868, 0.050251901149749756, -0.0347912460565567, 0.03746016323566437, 0.004515713080763817, -0.01629946008324623, 0.010084695182740688, 0.03338053077459335, 0.047049202024936676, -0.03961436077952385, -0.0072156088426709175, -0.08365149796009064, 0.03749828785657883, 0.003817504970356822, -0.010751924477517605, -0.022152014076709747, -0.0225142240524292, 0.0019456883892416954, 0.045485977083444595, -0.004815965890884399, 0.026193518191576004, 0.056047264486551285, 0.022342652082443237, -0.062376413494348526, -0.04819302260875702, -0.07328084856271744, 0.05909745767712593, -0.005690513178706169, -0.005652385763823986, -0.05398838594555855, -0.045295339077711105, -0.058258652687072754, -0.06027940660715103, -0.013887901790440083, 0.04537159577012062, 0.0025140249636024237, -0.05917371064424515, 0.029968129470944405, 0.004346522502601147, 0.018253488466143608, -0.06580787897109985, 0.04243578761816025, -0.032160453498363495, 0.04247391223907471, 0.01694762520492077, -0.00511860242113471, -0.039690613746643066, 0.008035347796976566, -0.023829620331525803, -0.011657449416816235, -0.010399245657026768, 0.02451591193675995, -0.005809661000967026, -0.0015334360068663955, 0.017004815861582756, -0.01585146225988865, -0.05890681967139244, -0.08937060832977295, -0.031321652233600616, -0.042092639952898026, -0.009913121350109577, 0.006700889207422733, -0.034714989364147186, -0.022190142422914505, -0.025945689529180527, 0.03582068532705307, 0.017367025837302208, 0.0041439710184931755, -0.023848682641983032, -0.014850619249045849, 0.014278708025813103, -0.04571474343538284, 0.04155885800719261, -0.016747456043958664, -0.05867805331945419, 0.018015192821621895, 0.0031860200688242912, 0.072594553232193, -0.0012617782922461629, -0.046858564019203186, 0.030520977452397346, 0.014564663171768188, 0.0019290077034384012, -0.013735393062233925, 0.02388681098818779, -0.0485742948949337, 0.020188452675938606, -0.015012660063803196, -0.010780519805848598, -0.021141638979315758, -0.062185775488615036, -0.011476344428956509, 0.026727301999926567, 0.03008251078426838, 0.0709550753235817, 0.011981532908976078, 0.003991461358964443, -0.008411855436861515, -0.019845306873321533, 0.02604100853204727, -0.01522236131131649, 0.00008243558841058984, 0.04064380005002022, -0.054636552929878235, 0.028500225394964218, 0.0154415937140584, -0.04197825863957405, 0.029777493327856064, 0.02865273505449295, 0.0037889094091951847, -0.056581050157547, -0.05273018032312393, -0.062376413494348526, -0.049908753484487534, 0.02506875991821289, -0.011476344428956509, -0.008859852328896523, -0.023848682641983032, 0.01445028092712164, -0.003619719296693802, 0.012925185263156891, -0.00014014795306138694, 0.08105883002281189, -0.014545599929988384, 0.025183141231536865, 0.03210326284170151, 0.058411162346601486, -0.01066613756120205, -0.0056333220563828945, 0.011571663431823254, 0.06592226028442383, 0.0756828710436821, -0.055818501859903336, 0.018730081617832184, -0.030997568741440773, -0.028576480224728584, -0.022247333079576492, 0.016013504937291145, 0.0438464991748333, -0.06687544286251068, -0.03685012459754944, -0.03359023109078407, -0.01272501703351736, -0.034905627369880676, 0.017633918672800064, -0.023219581693410873, -0.008902746252715588, 0.012801271863281727, -0.03364742174744606, -0.06153760850429535, 0.026193518191576004, 0.0072156088426709175, 0.049489352852106094, 0.015022192150354385, -0.04438028484582901, 0.04518095776438713, 0.07370024919509888, -0.014269175939261913, -0.026822619140148163, -0.008144963532686234, 0.026002880185842514, -0.021351339295506477, -0.006005064118653536, 0.06111820787191391, 0.05677168443799019, -0.009169637225568295, -0.0009508018265478313, 0.015403466299176216, -0.0054140896536409855, 0.06283394247293472, -0.006948716938495636, -0.01054222323000431, 0.0012123319320380688, 0.07354773581027985, -0.04441840946674347, 0.012877526693046093, 0.0251068864017725, -0.010704264976084232, 0.036163829267024994, -0.01659494638442993, -0.04262642189860344, 0.024801867082715034, -0.028233332559466362, 0.009441295638680458, -0.04403713718056679, -0.03122633323073387, -0.006576974876224995, -0.11567850410938263, 0.019454501569271088, -0.0022578565403819084, -0.025640670210123062, 0.03048284910619259, 0.05780112370848656, 0.04140634834766388, -0.002728491323068738, -0.07526347041130066, 0.024839995428919792, 0.030730677768588066, 0.012543912045657635, -0.02748984843492508, 0.012572507373988628, 0.005113836377859116, 0.044113390147686005, -0.04182574898004532, 0.035305965691804886, 0.02268579788506031, -0.017719704657793045, -0.036506976932287216, 0.0001551903988001868, -0.02468748576939106, 0.030406594276428223, -0.0007899518823251128, 0.029167454689741135, 0.013058631680905819, 0.04316020756959915, -0.017109666019678116, -0.019092291593551636, -0.007482500281184912, 0.04392275586724281, -0.02569786086678505, 0.04891744256019592, 0.006643698085099459, -0.046896692365407944, -0.019454501569271088, -0.000979993143118918, 0.04643916338682175, -0.004055801313370466, 0.0561235211789608, -0.0016525840619578958, -0.0009835675591602921, 0.009808271192014217, 0.0010103759123012424, 0.007220374885946512, 0.019826242700219154, -0.03467686101794243, 0.03210326284170151, -0.02987281046807766, 0.012477188371121883, 0.026117263361811638, 0.029701238498091698, 0.030387530103325844, -0.04842178523540497, 0.04361773654818535, -0.009836866520345211, -0.02445872128009796, 0.009393636137247086, 0.012372338213026524, 0.05398838594555855, -0.013030036352574825, -0.09966500103473663, 0.018558507785201073, -0.02028377167880535, 0.008121134713292122, -0.006105148699134588, 0.013802115805447102, -0.0330183207988739, 0.012848930433392525, -0.02108444646000862, 0.0225142240524292, 0.017166858538985252, 0.03107382357120514, 0.002654619514942169, -0.07328084856271744, 0.015613166615366936, -0.012181701138615608, -0.004070098977535963, -0.10035129636526108, -0.006495954468846321, -0.01103787962347269, -0.026231644675135612, 0.029358090832829475, -0.04682043567299843, 0.03603038564324379, 0.04418964684009552, 0.03599225729703903, -0.03961436077952385, 0.03227483481168747, 0.022628607228398323, -0.02968217432498932, -0.02272392436861992, -0.026155389845371246, -0.0061623393557965755, -0.013973688706755638, 0.00646735867485404, -0.014602790586650372, 0.027928313240408897, 0.056657303124666214, -0.04098694398999214, -0.023048007860779762, 0.05238703638315201, 0.01705247536301613, -0.00038603984285146, -0.06550285965204239, -0.022952688857913017, -0.04258829727768898, -0.0513957217335701, 0.003400486661121249, -0.08151636272668839, 0.022152014076709747, -0.009817803278565407, 0.04178762063384056, 0.012629698030650616, 0.020588790997862816, -0.0015286700800061226, -0.02129414863884449, 0.04094881936907768, -0.016242269426584244, 0.020016880705952644, -0.021580103784799576, 0.0450284481048584, -0.021846994757652283, 0.0037579310592263937, 0.014107135124504566, -0.041101329028606415, 0.02106538414955139, -0.007492032367736101, 0.011466813273727894, -0.0035434644669294357, -0.0330183207988739, -0.028118951246142387, -0.0032646579202264547, -0.043122079223394394, 0.004286948591470718, -0.03883274644613266, -0.000541230256203562, -0.02508782409131527, 0.03263704851269722, 0.053263965994119644, -0.030749740079045296, -0.024439657106995583, 0.013192077167332172, 0.03749828785657883, 0.06660855561494827, 0.012095915153622627, -0.045295339077711105, 0.04136822000145912, -0.02548816055059433, -0.013687733560800552, 0.03107382357120514, 0.007029737811535597, 0.0294724740087986, 0.007730328477919102, 0.043312717229127884, 0.0009335253271274269, -0.05456029623746872, 0.01705247536301613, -0.050861939787864685, -0.027928313240408897, 0.06828615814447403, -0.059440601617097855, 0.008583429269492626, 0.028176141902804375, -0.019454501569271088, -0.06146135553717613, -0.007091694511473179, 0.009650995954871178, 0.043083950877189636, -0.0009192275465466082, -0.006691357120871544, 0.010084695182740688, -0.09425090998411179, 0.035134389996528625, 0.0773223489522934, -0.030158765614032745, -0.017338430508971214, 0.02707044780254364, 0.07312833517789841, 0.026631982997059822, 0.0278329961001873, 0.05871618166565895, -0.045867253094911575, 0.0016132652526721358, -0.02848116122186184, -0.016366181895136833, 0.048841189593076706, 0.010132353752851486, 0.00025646627182140946, 0.08525284379720688, -0.007596882525831461, -0.008745470084249973, 0.030768804252147675, 0.005113836377859116, 0.08593913912773132, 0.03023502044379711, -0.032770492136478424, -0.01391649805009365, 0.019559351727366447, 0.006424465216696262, 0.06546472758054733, -0.01094256155192852, -0.0026689174119383097, -0.0037769947666674852, -0.013582883402705193, 0.04872680455446243, -0.019559351727366447, -0.020417217165231705, -0.01990249752998352, -0.017567194998264313, 0.012372338213026524, -0.01504125539213419, -0.001887305872514844, 0.06111820787191391, 0.030978504568338394, 0.007982922717928886, -0.000021595593352685682, -0.01185761857777834, 0.004408479668200016, 0.04018627107143402, -0.02268579788506031, 0.006433997303247452, -0.031359780579805374, 0.028328651562333107, -0.022933626547455788, -0.010141885839402676, -0.00018810505571309477, 0.005800129380077124, 0.009126744233071804, 0.00005745172165916301, -0.0280617605894804, 0.020779429003596306, 0.0036721443757414818, -0.001123566529713571, -0.019159013405442238, 0.04022439941763878, 0.01343037374317646, 0.009998908266425133, -0.0029524897690862417, -0.0027332573663443327, -0.0834989845752716, 0.0669516995549202, 0.0147362370043993, -0.02150384895503521, -0.001166459871456027, -0.04434215649962425, 0.0370216965675354, 0.024935314431786537, -0.05162448808550835, -0.009674825705587864, -0.011724173091351986, -0.0028452565893530846, 0.03894713148474693, -0.06759986281394958, -0.05192950740456581, 0.00646735867485404, -0.012010128237307072, -0.05158635973930359, -0.024573104456067085, -0.060241278260946274, 0.005028049927204847, 0.007844710722565651, -0.0011426302371546626, -0.020169390365481377, 0.0003036787093151361 ]
32,011
pingouin.nonparametric
harrelldavis
Harrell-Davis robust estimate of the :math:`q^{th}` quantile(s) of the data. .. versionadded:: 0.2.9 Parameters ---------- x : array_like Data, must be a one or two-dimensional vector. quantile : float or array_like Quantile or sequence of quantiles to compute, must be between 0 and 1. Default is ``0.5``. axis : int Axis along which the MAD is computed. Default is the last axis (-1). Can be either 0, 1 or -1. Returns ------- y : float or array_like The estimated quantile(s). If ``quantile`` is a single quantile, will return a float, otherwise will compute each quantile separately and returns an array of floats. Notes ----- The Harrell-Davis method [1]_ estimates the :math:`q^{th}` quantile by a linear combination of the order statistics. Results have been tested against a Matlab implementation [2]_. Note that this method is also used to measure the confidence intervals of the difference between quantiles of two groups, as implemented in the shift function [3]_. See Also -------- plot_shift References ---------- .. [1] Frank E. Harrell, C. E. Davis, A new distribution-free quantile estimator, Biometrika, Volume 69, Issue 3, December 1982, Pages 635–640, https://doi.org/10.1093/biomet/69.3.635 .. [2] https://github.com/GRousselet/matlab_stats/blob/master/hd.m .. [3] Rousselet, G. A., Pernet, C. R. and Wilcox, R. R. (2017). Beyond differences in means: robust graphical methods to compare two groups in neuroscience. Eur J Neurosci, 46: 1738-1748. https://doi.org/doi:10.1111/ejn.13610 Examples -------- Estimate the 0.5 quantile (i.e median) of 100 observation picked from a normal distribution with zero mean and unit variance. >>> import numpy as np >>> import pingouin as pg >>> np.random.seed(123) >>> x = np.random.normal(0, 1, 100) >>> round(pg.harrelldavis(x, quantile=0.5), 4) -0.0499 Several quantiles at once >>> pg.harrelldavis(x, quantile=[0.25, 0.5, 0.75]) array([-0.84133224, -0.04991657, 0.95897233]) On the last axis of a 2D vector (default) >>> np.random.seed(123) >>> x = np.random.normal(0, 1, (10, 100)) >>> pg.harrelldavis(x, quantile=[0.25, 0.5, 0.75]) array([[-0.84133224, -0.52346777, -0.81801193, -0.74611216, -0.64928321, -0.48565262, -0.64332799, -0.8178394 , -0.70058282, -0.73088088], [-0.04991657, 0.02932655, -0.08905073, -0.1860034 , 0.06970415, 0.15129817, 0.00430958, -0.13784786, -0.08648077, -0.14407123], [ 0.95897233, 0.49543002, 0.57712236, 0.48620599, 0.85899005, 0.7903462 , 0.76558585, 0.62528436, 0.60421847, 0.52620286]]) On the first axis >>> pg.harrelldavis(x, quantile=[0.5], axis=0).shape (100,)
def harrelldavis(x, quantile=0.5, axis=-1): """Harrell-Davis robust estimate of the :math:`q^{th}` quantile(s) of the data. .. versionadded:: 0.2.9 Parameters ---------- x : array_like Data, must be a one or two-dimensional vector. quantile : float or array_like Quantile or sequence of quantiles to compute, must be between 0 and 1. Default is ``0.5``. axis : int Axis along which the MAD is computed. Default is the last axis (-1). Can be either 0, 1 or -1. Returns ------- y : float or array_like The estimated quantile(s). If ``quantile`` is a single quantile, will return a float, otherwise will compute each quantile separately and returns an array of floats. Notes ----- The Harrell-Davis method [1]_ estimates the :math:`q^{th}` quantile by a linear combination of the order statistics. Results have been tested against a Matlab implementation [2]_. Note that this method is also used to measure the confidence intervals of the difference between quantiles of two groups, as implemented in the shift function [3]_. See Also -------- plot_shift References ---------- .. [1] Frank E. Harrell, C. E. Davis, A new distribution-free quantile estimator, Biometrika, Volume 69, Issue 3, December 1982, Pages 635–640, https://doi.org/10.1093/biomet/69.3.635 .. [2] https://github.com/GRousselet/matlab_stats/blob/master/hd.m .. [3] Rousselet, G. A., Pernet, C. R. and Wilcox, R. R. (2017). Beyond differences in means: robust graphical methods to compare two groups in neuroscience. Eur J Neurosci, 46: 1738-1748. https://doi.org/doi:10.1111/ejn.13610 Examples -------- Estimate the 0.5 quantile (i.e median) of 100 observation picked from a normal distribution with zero mean and unit variance. >>> import numpy as np >>> import pingouin as pg >>> np.random.seed(123) >>> x = np.random.normal(0, 1, 100) >>> round(pg.harrelldavis(x, quantile=0.5), 4) -0.0499 Several quantiles at once >>> pg.harrelldavis(x, quantile=[0.25, 0.5, 0.75]) array([-0.84133224, -0.04991657, 0.95897233]) On the last axis of a 2D vector (default) >>> np.random.seed(123) >>> x = np.random.normal(0, 1, (10, 100)) >>> pg.harrelldavis(x, quantile=[0.25, 0.5, 0.75]) array([[-0.84133224, -0.52346777, -0.81801193, -0.74611216, -0.64928321, -0.48565262, -0.64332799, -0.8178394 , -0.70058282, -0.73088088], [-0.04991657, 0.02932655, -0.08905073, -0.1860034 , 0.06970415, 0.15129817, 0.00430958, -0.13784786, -0.08648077, -0.14407123], [ 0.95897233, 0.49543002, 0.57712236, 0.48620599, 0.85899005, 0.7903462 , 0.76558585, 0.62528436, 0.60421847, 0.52620286]]) On the first axis >>> pg.harrelldavis(x, quantile=[0.5], axis=0).shape (100,) """ x = np.asarray(x) assert x.ndim <= 2, "Only 1D or 2D array are supported for this function." assert axis in [0, 1, -1], "Axis must be 0, 1 or -1." # Sort the input array x = np.sort(x, axis=axis) n = x.shape[axis] vec = np.arange(n) if isinstance(quantile, float): quantile = [quantile] y = [] for q in quantile: # Harrell-Davis estimate of the qth quantile m1 = (n + 1) * q m2 = (n + 1) * (1 - q) w = scipy.stats.beta.cdf((vec + 1) / n, m1, m2) - scipy.stats.beta.cdf((vec) / n, m1, m2) if axis != 0: y.append((w * x).sum(axis)) else: y.append((w[..., None] * x).sum(axis)) # Store results if len(y) == 1: y = y[0] # Return a float instead of a list if n quantile is 1 else: y = np.array(y) return y
(x, quantile=0.5, axis=-1)
[ -0.04254083335399628, 0.012711790390312672, -0.02255130000412464, 0.02262892760336399, 0.06874071061611176, 0.000018497596101951785, 0.00814621988683939, -0.017088139429688454, 0.02538476698100567, 0.07634837180376053, 0.014788373373448849, 0.010538171976804733, 0.03838766738772392, 0.036854490637779236, -0.05515558645129204, 0.026801500469446182, 0.0005491663469001651, 0.07413593679666519, -0.035146646201610565, -0.002440469805151224, -0.018533984199166298, -0.0036898155231028795, -0.02111515775322914, 0.050575461238622665, -0.030217187479138374, 0.02311411127448082, 0.06326784193515778, 0.001143818604759872, -0.06590723991394043, 0.011925794184207916, 0.01148912962526083, -0.02963496930897236, -0.041104692965745926, -0.03669923171401024, 0.006297673564404249, 0.008655661717057228, 0.021716784685850143, -0.03832944482564926, -0.04215268790721893, 0.026296911761164665, -0.028955712914466858, 0.01645740307867527, 0.03483612835407257, 0.005123530980199575, -0.02852875180542469, 0.02668505720794201, 0.011042761616408825, 0.00556989898905158, -0.03832944482564926, 0.016418587416410446, 0.0016508346889168024, 0.013226084411144257, 0.06602368503808975, 0.017951766029000282, 0.03052770532667637, 0.01718517765402794, 0.039396848529577255, 0.040638916194438934, 0.09020520001649857, -0.0010740736033767462, 0.016117773950099945, 0.017738284543156624, 0.051739901304244995, 0.006287969648838043, 0.02755838632583618, 0.03310887888073921, -0.029537932947278023, -0.002342220162972808, -0.0309352595359087, -0.004029443487524986, -0.03730085864663124, 0.036252863705158234, 0.010402320884168148, 0.0150503721088171, 0.07460171729326248, 0.04867354407906532, -0.023638108745217323, -0.03175036609172821, -0.018068209290504456, 0.018145838752388954, 0.11124272644519806, 0.02359929494559765, 0.007753222249448299, -0.009897730313241482, -0.04316186532378197, -0.07704703509807587, 0.01193549856543541, -0.018233172595500946, 0.08492640405893326, 0.014895114116370678, -0.03149807080626488, -0.020416494458913803, 0.04712095856666565, 0.05080834776163101, -0.03361346945166588, -0.00022394221741706133, -0.020125385373830795, 0.0030299669597297907, 0.03163392096757889, -0.025675876066088676, -0.020901678130030632, 0.06846900284290314, 0.04510260000824928, 0.06528620421886444, -0.041997428983449936, 0.06319021433591843, -0.01446815300732851, -0.03120696172118187, -0.01702991873025894, -0.026044616475701332, -0.040561288595199585, -0.0016023163916543126, -0.059968601912260056, -0.005084716249257326, -0.027053795754909515, -0.030294816941022873, -0.007869665510952473, 0.04137639328837395, 0.00489306915551424, 0.0002642730250954628, 0.0004469747073017061, -0.016505921259522438, -0.05488388612866402, -0.004177424591034651, 0.006574227940291166, -0.054689813405275345, 0.016981400549411774, -0.000206657568924129, -0.058726534247398376, 0.02455025166273117, 0.029867855831980705, 0.023094704374670982, -0.05193397402763367, 0.0191356111317873, -0.008097701705992222, -0.03772781789302826, 0.061560001224279404, 0.00025229508173651993, 0.0706426203250885, -0.054689813405275345, -0.02538476698100567, -0.004301146138459444, 0.015584073029458523, 0.01927146315574646, 0.04793606698513031, 0.03194443881511688, 0.04230794683098793, 0.000939435325562954, 0.05573780834674835, -0.02208552323281765, -0.006321932654827833, -0.034467391669750214, 0.06132711470127106, -0.019358795136213303, 0.02200789377093315, -0.0694393739104271, -0.038639962673187256, 0.007452408783137798, 0.0029644672758877277, 0.023812774568796158, -0.011615277267992496, -0.019038574770092964, 0.01769947074353695, 0.030877036973834038, -0.06699404865503311, -0.016961991786956787, -0.012255718931555748, 0.027383720502257347, 0.0014191598165780306, 0.04312305152416229, 0.031575702130794525, 0.0010504209203645587, -0.10363505780696869, 0.010344098322093487, -0.05247737839818001, 0.008873994462192059, -0.017951766029000282, 0.05810549855232239, 0.014477856457233429, -0.016855252906680107, -0.021833227947354317, -0.01840783841907978, -0.003699519205838442, -0.06070607900619507, -0.04580126330256462, 0.02819882705807686, 0.03402102366089821, -0.018776576966047287, -0.01350749097764492, 0.021619748324155807, -0.03565123677253723, -0.04106587544083595, -0.03149807080626488, -0.020338864997029305, -0.0029960041865706444, -0.030896443873643875, -0.05313722789287567, 0.03128458932042122, 0.0030178374145179987, -0.05857127532362938, 0.031245775520801544, 0.03986262530088425, -0.010965132154524326, -0.038931071758270264, -0.041725724935531616, -0.003864481346681714, -0.050070870667696, -0.016331255435943604, -0.0012457070406526327, 0.03361346945166588, 0.012847642414271832, 0.022454261779785156, -0.09563924372196198, -0.009994766674935818, -0.04393815994262695, 0.008349996991455555, -0.01645740307867527, -0.012643865309655666, 0.08112257719039917, -0.007583408150821924, 0.019989533349871635, -0.052011601626873016, -0.06924529373645782, 0.08989468216896057, 0.027791274711489677, 0.0039712218567729, 0.04490852355957031, 0.04203624278306961, 0.017738284543156624, -0.045296672731637955, -0.007651333697140217, 0.057018689811229706, 0.015011557377874851, -0.053176041692495346, -0.06124948337674141, 0.025947578251361847, 0.02627750299870968, 0.06109422445297241, -0.0025278027169406414, 0.033361174166202545, -0.008112257346510887, -0.03730085864663124, -0.010538171976804733, 0.028955712914466858, -0.037475522607564926, -0.01881539076566696, -0.058726534247398376, 0.09563924372196198, -0.028295863419771194, 0.018019691109657288, -0.07161299139261246, -0.02722846157848835, 0.024394994601607323, -0.008442182093858719, 0.035282496362924576, 0.038174185901880264, -0.020261235535144806, 0.015215334482491016, 0.011159205809235573, -0.08391723036766052, 0.05080834776163101, -0.0909038633108139, 0.013002900406718254, -0.009732767939567566, -0.08810921013355255, 0.026316318660974503, 0.01412852481007576, 0.0008963753352873027, 0.11310582607984543, -0.017359843477606773, -0.016331255435943604, 0.04766436293721199, -0.04374408721923828, -0.07708585262298584, 0.01834961585700512, 0.08888550102710724, 0.020882269367575645, -0.03943566232919693, 0.0064480802975595, 0.05639765411615372, -0.011673499830067158, -0.04176453873515129, 0.027597200125455856, 0.07211758196353912, -0.038581740111112595, 0.029518524184823036, -0.051739901304244995, 0.018883317708969116, -0.012983493506908417, 0.003515149699524045, 0.00028110280982218683, 0.02619987353682518, -0.02880045399069786, -0.008786661550402641, 0.09664842486381531, 0.04731503129005432, -0.07809503376483917, -0.006826522760093212, 0.04032839834690094, 0.035981159657239914, -0.009490177035331726, 0.02194967307150364, -0.022396041080355644, -0.03792189061641693, -0.029732005670666695, -0.01872805878520012, -0.012905864045023918, -0.047082144767045975, 0.0030493743252009153, -0.033904578536748886, 0.01827198639512062, 0.019009463489055634, -0.02977081947028637, -0.004386052954941988, 0.05930875241756439, -0.06711049377918243, -0.007602815516293049, 0.003857203759253025, -0.009077771566808224, -0.010897207073867321, 0.007035151589661837, -0.001883722492493689, 0.021580932661890984, 0.029848448932170868, -0.018941538408398628, -0.015855776146054268, -0.030081337317824364, 0.01960138790309429, -0.019067686051130295, -0.03167273849248886, 0.011479426175355911, -0.023890404030680656, -0.011013651266694069, 0.028101790696382523, 0.03440916910767555, 0.0013366787461563945, 0.05639765411615372, 0.0204941239207983, -0.0027825236320495605, -0.04580126330256462, -0.06233629211783409, 0.008558625355362892, 0.0054000853560864925, 0.044132232666015625, 0.023638108745217323, -0.047974880784749985, -0.022745372727513313, -0.01984397880733013, 0.012226607650518417, 0.06765389442443848, 0.012459496036171913, -0.06571316719055176, 0.01875717006623745, 0.031012888997793198, 0.051196493208408356, 0.02447262406349182, 0.004977975971996784, -0.04750910401344299, -0.02468610368669033, 0.02138685993850231, 0.03964914381504059, 0.016874659806489944, -0.059425197541713715, -0.0006355895311571658, -0.010703133419156075, -0.0384264811873436, -0.03209969773888588, -0.0003311373002361506, 0.004747514147311449, 0.06497568637132645, 0.006287969648838043, -0.015584073029458523, -0.07339846342802048, 0.024278549477458, 0.006802263669669628, 0.0006683393730781972, 0.035573605448007584, 0.030411262065172195, -0.06284088641405106, 0.010780762881040573, 0.02276477962732315, 0.009368880651891232, -0.014681633561849594, -0.029945485293865204, -0.014594300650060177, 0.022376634180545807, 0.02860638126730919, 0.01905798353254795, -0.018990056589245796, -0.027868904173374176, -0.0050992718897759914, -0.047082144767045975, 0.04203624278306961, 0.03704856336116791, -0.06893478333950043, -0.027946531772613525, 0.006030823104083538, 0.04820776730775833, -0.014875706285238266, -0.024744326248764992, 0.021716784685850143, -0.008097701705992222, -0.04595651850104332, -0.00238831271417439, -0.036252863705158234, -0.05333130061626434, -0.02612224407494068, 0.01152794435620308, -0.00229370198212564, 0.028276456519961357, 0.03780544921755791, 0.03710678592324257, -0.007738666608929634, -0.0003711648751050234, 0.0063850064761936665, 0.049760352820158005, 0.04696569964289665, -0.026995575055480003, -0.02585054188966751, 0.062181033194065094, 0.016661180183291435, -0.07277742773294449, -0.04397697374224663, 0.028431715443730354, -0.0023676923010498285, -0.0036049087066203356, -0.021425675600767136, -0.002037768019363284, -0.04347238317131996, -0.026976166293025017, 0.014720448292791843, 0.03402102366089821, -0.03355524688959122, -0.048440657556056976, -0.014419634826481342, 0.02113456465303898, -0.04195861518383026, 0.032002661377191544, -0.007083669770509005, 0.002305831527337432, -0.04273490607738495, 0.03968795761466026, 0.00045212978147901595, -0.03351643308997154, -0.015710221603512764, -0.007932739332318306, -0.025481803342700005, 0.00510897533968091, 0.04312305152416229, -0.05053664743900299, -0.008010368794202805, -0.007442704867571592, 0.03669923171401024, 0.019310276955366135, 0.016418587416410446, -0.06617894023656845, -0.06326784193515778, 0.008975883014500141, 0.033574651926755905, 0.002085073385387659, 0.016602957621216774, 0.057833798229694366, -0.04017313942313194, -0.05453455448150635, 0.018116727471351624, 0.05507795885205269, 0.022609520703554153, -0.018019691109657288, 0.007442704867571592, -0.04044484347105026, 0.046538740396499634, 0.06253036856651306, 0.0079424437135458, 0.01032469142228365, 0.05895942077040672, -0.024724917486310005, -0.026219282299280167, 0.03908633068203926, -0.0012905864277854562, -0.02963496930897236, 0.007918184623122215, -0.007825999520719051, 0.029305044561624527, 0.019873090088367462, 0.04630585014820099, -0.016496216878294945, -0.007195261772722006, 0.005084716249257326, 0.00368738966062665, -0.024220328778028488, 0.019009463489055634, 0.0024986916687339544, 0.005395233165472746, 0.020901678130030632, 0.016069255769252777, -0.05061427503824234, 0.08329619467258453, 0.006341340020298958, 0.06967225670814514, -0.025908764451742172, 0.05232211947441101, -0.03722322732210159, -0.031245775520801544, 0.00703029939904809, 0.029382674023509026, 0.030780000612139702, 0.05480625480413437, -0.0035879272036254406, -0.05911467969417572, -0.008786661550402641, -0.0309352595359087, -0.022648336365818977, 0.016903771087527275, -0.04032839834690094, 0.02860638126730919, 0.06734338402748108, -0.03937743976712227, 0.08026865124702454, -0.00814621988683939, 0.06482043117284775, -0.004466108046472073, 0.018883317708969116, 0.0076852962374687195, 0.03149807080626488, 0.001653260551393032, 0.03512723743915558, -0.012440088205039501, 0.003010559594258666, 0.00920391920953989, 0.048246584832668304, -0.05577662214636803, -0.02538476698100567, -0.024375585839152336, 0.025966987013816833, -0.0003335632209200412, 0.08415011316537857, -0.03832944482564926, -0.013041715137660503, 0.020668789744377136, -0.027053795754909515, -0.004725681152194738, 0.002455025212839246, 0.002826190087944269, 0.018475763499736786, -0.0358453094959259, 0.010004470124840736, -0.010062692686915398, 0.08741054683923721, 0.020474717020988464, -0.01471074391156435, -0.014477856457233429, -0.05938638001680374, 0.02847052924335003, -0.03559301421046257, 0.018776576966047287, -0.025287730619311333, -0.011654091998934746, 0.011314463801681995, -0.026917945593595505, 0.013264899142086506, -0.014342005364596844, -0.03374931961297989, 0.039338625967502594, -0.005526232533156872, -0.054068777710199356, 0.002738857176154852, 0.0390281081199646, -0.02365751564502716, 0.008480995893478394, -0.04661636799573898, -0.023075297474861145, 0.057989053428173065, -0.05628121271729469, 0.021658562123775482, -0.07145772874355316, 0.018931835889816284, 0.016253625974059105, -0.10642971098423004, -0.02947971038520336, -0.053525373339653015, -0.012915567494928837, -0.028101790696382523, -0.008437329903244972, -0.026626834645867348, -0.08019102364778519, -0.01097483653575182, -0.00629282183945179, 0.047082144767045975, -0.05166226997971535, 0.10868096351623535, 0.03959092125296593, -0.02257070690393448, -0.05375825986266136, -0.01502126082777977, 0.05492269992828369, -0.034525610506534576, 0.010693429969251156, -0.04964391142129898, 0.0076852962374687195, 0.012527421116828918, 0.011353278532624245, -0.01629243977367878, -0.006132711190730333, -0.03155629336833954, 0.01964990608394146, -0.006865337491035461, -0.003219188190996647, -0.05123531073331833, -0.031226368620991707, -0.0909038633108139, -0.044753268361091614, 0.0382712222635746, 0.023890404030680656, 0.08042391389608383, -0.002132378751412034, 0.019116204231977463, 0.04514141380786896, -0.012469199486076832, 0.03386576473712921, 0.03339998796582222, -0.009621175937354565, -0.00821414589881897, 0.05302078276872635, -0.04160928353667259, 0.03776663541793823, -0.11729780584573746, 0.08748817443847656, -0.01875717006623745, 0.026801500469446182, 0.01964990608394146, -0.002281572436913848, 0.040561288595199585, 0.0011092493077740073, -0.012304237112402916, 0.012420681305229664, 0.010518764145672321, -0.03605879098176956, 0.03291480615735054, -0.019417017698287964, -0.004029443487524986, -0.011663795448839664, 0.02701498195528984, 0.0026151356287300587, -0.006613042205572128, 0.06284088641405106, 0.0014967891620472074, -0.013953858986496925, 0.019417017698287964, 0.014342005364596844, -0.05426285043358803, 0.038174185901880264, 0.00018997941515408456, -0.038931071758270264, 0.043511196970939636, -0.04347238317131996, 0.021425675600767136, -0.002031703246757388, 0.029809635132551193, -0.01867954060435295, -0.023152925074100494, 0.04739266261458397, -0.025540025904774666, -0.013284306973218918, -0.025831134989857674, 0.021483896300196648, 0.06780915707349777, 0.005060457158833742, -0.00687504094094038, -0.06408295035362244, -0.008044331334531307, -0.003335632150992751, -0.007442704867571592, -0.007379631046205759, -0.005235122982412577, 0.00007019989425316453, -0.05472862720489502, -0.026646243408322334, -0.016661180183291435, -0.06742101162672043, 0.04397697374224663, -0.03050829842686653, -0.0005221780738793314, -0.02359929494559765, -0.02847052924335003, 0.018068209290504456, 0.014390523545444012, 0.007200113497674465, -0.022881222888827324, -0.0096066202968359, -0.006802263669669628, -0.026995575055480003, -0.010819577611982822, 0.020591160282492638, -0.03442857414484024, 0.02860638126730919, 0.002714598085731268, -0.011033058166503906, 0.025035435333848, 0.023094704374670982, -0.033497024327516556, 0.05337011441588402, 0.009994766674935818, 0.008340293541550636, 0.08973941951990128, -0.01984397880733013, -0.00020226060587447137, -0.01800028420984745, 0.04424867779016495, -0.004359367769211531, -0.0015986774815246463, -0.002777671907097101, -0.0027048944029957056, -0.0006307376897893846, -0.0072049652226269245, 0.047431476414203644, -0.023968033492565155, -0.021775007247924805, -0.006967226043343544, 0.010644911788403988, 0.045646004378795624, 0.055233217775821686, -0.04665518179535866, 0.010615800507366657, 0.004291442222893238, -0.07289387285709381, -0.02119278721511364, 0.04781962186098099, 0.000029641640139743686, 0.02160034142434597, -0.03031422570347786, -0.000011409378203097731, 0.035282496362924576, 0.015875183045864105, 0.028509344905614853, 0.01155705563724041, -0.033768728375434875, -0.037960708141326904, 0.026374539360404015, 0.028004754334688187, 0.01377919316291809, 0.02914978563785553, -0.010887503623962402, 0.018902724608778954, -0.08345144987106323, 0.039396848529577255, -0.016195403411984444, 0.0035369829274713993, 0.047082144767045975, 0.015302667394280434, -0.06090015172958374, -0.005671787541359663, -0.028218235820531845, -0.03437035530805588, 0.052632637321949005, 0.03283717483282089, 0.018116727471351624, -0.02524891495704651, 0.012934975326061249, 0.004779051057994366, -0.047431476414203644, -0.0013827711809426546, -0.006894448306411505, -0.007825999520719051, 0.011062169447541237, -0.036311086267232895, 0.017573323100805283, -0.014021784998476505, 0.03671863675117493 ]
32,012
pingouin.distribution
homoscedasticity
Test equality of variance. Parameters ---------- data : :py:class:`pandas.DataFrame`, list or dict Iterable. Can be either a list / dictionnary of iterables or a wide- or long-format pandas dataframe. dv : str Dependent variable (only when ``data`` is a long-format dataframe). group : str Grouping variable (only when ``data`` is a long-format dataframe). method : str Statistical test. `'levene'` (default) performs the Levene test using :py:func:`scipy.stats.levene`, and `'bartlett'` performs the Bartlett test using :py:func:`scipy.stats.bartlett`. The former is more robust to departure from normality. alpha : float Significance level. **kwargs : optional Optional argument(s) passed to the lower-level :py:func:`scipy.stats.levene` function. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'W/T'``: Test statistic ('W' for Levene, 'T' for Bartlett) * ``'pval'``: p-value * ``'equal_var'``: True if ``data`` has equal variance See Also -------- normality : Univariate normality test. sphericity : Mauchly's test for sphericity. Notes ----- The **Bartlett** :math:`T` statistic [1]_ is defined as: .. math:: T = \frac{(N-k) \ln{s^{2}_{p}} - \sum_{i=1}^{k}(N_{i} - 1) \ln{s^{2}_{i}}}{1 + (1/(3(k-1)))((\sum_{i=1}^{k}{1/(N_{i} - 1))} - 1/(N-k))} where :math:`s_i^2` is the variance of the :math:`i^{th}` group, :math:`N` is the total sample size, :math:`N_i` is the sample size of the :math:`i^{th}` group, :math:`k` is the number of groups, and :math:`s_p^2` is the pooled variance. The pooled variance is a weighted average of the group variances and is defined as: .. math:: s^{2}_{p} = \sum_{i=1}^{k}(N_{i} - 1)s^{2}_{i}/(N-k) The p-value is then computed using a chi-square distribution: .. math:: T \sim \chi^2(k-1) The **Levene** :math:`W` statistic [2]_ is defined as: .. math:: W = \frac{(N-k)} {(k-1)} \frac{\sum_{i=1}^{k}N_{i}(\overline{Z}_{i.}-\overline{Z})^{2} } {\sum_{i=1}^{k}\sum_{j=1}^{N_i}(Z_{ij}-\overline{Z}_{i.})^{2} } where :math:`Z_{ij} = |Y_{ij} - \text{median}({Y}_{i.})|`, :math:`\overline{Z}_{i.}` are the group means of :math:`Z_{ij}` and :math:`\overline{Z}` is the grand mean of :math:`Z_{ij}`. The p-value is then computed using a F-distribution: .. math:: W \sim F(k-1, N-k) .. warning:: Missing values are not supported for this function. Make sure to remove them before using the :py:meth:`pandas.DataFrame.dropna` or :py:func:`pingouin.remove_na` functions. References ---------- .. [1] Bartlett, M. S. (1937). Properties of sufficiency and statistical tests. Proc. R. Soc. Lond. A, 160(901), 268-282. .. [2] Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364-367. Examples -------- 1. Levene test on a wide-format dataframe >>> import numpy as np >>> import pingouin as pg >>> data = pg.read_dataset('mediation') >>> pg.homoscedasticity(data[['X', 'Y', 'M']]) W pval equal_var levene 1.173518 0.310707 True 2. Same data but using a long-format dataframe >>> data_long = data[['X', 'Y', 'M']].melt() >>> pg.homoscedasticity(data_long, dv="value", group="variable") W pval equal_var levene 1.173518 0.310707 True 3. Same but using a mean center >>> pg.homoscedasticity(data_long, dv="value", group="variable", center="mean") W pval equal_var levene 1.572239 0.209303 True 4. Bartlett test using a list of iterables >>> data = [[4, 8, 9, 20, 14], np.array([5, 8, 15, 45, 12])] >>> pg.homoscedasticity(data, method="bartlett", alpha=.05) T pval equal_var bartlett 2.873569 0.090045 True
def homoscedasticity(data, dv=None, group=None, method="levene", alpha=0.05, **kwargs): """Test equality of variance. Parameters ---------- data : :py:class:`pandas.DataFrame`, list or dict Iterable. Can be either a list / dictionnary of iterables or a wide- or long-format pandas dataframe. dv : str Dependent variable (only when ``data`` is a long-format dataframe). group : str Grouping variable (only when ``data`` is a long-format dataframe). method : str Statistical test. `'levene'` (default) performs the Levene test using :py:func:`scipy.stats.levene`, and `'bartlett'` performs the Bartlett test using :py:func:`scipy.stats.bartlett`. The former is more robust to departure from normality. alpha : float Significance level. **kwargs : optional Optional argument(s) passed to the lower-level :py:func:`scipy.stats.levene` function. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'W/T'``: Test statistic ('W' for Levene, 'T' for Bartlett) * ``'pval'``: p-value * ``'equal_var'``: True if ``data`` has equal variance See Also -------- normality : Univariate normality test. sphericity : Mauchly's test for sphericity. Notes ----- The **Bartlett** :math:`T` statistic [1]_ is defined as: .. math:: T = \\frac{(N-k) \\ln{s^{2}_{p}} - \\sum_{i=1}^{k}(N_{i} - 1) \\ln{s^{2}_{i}}}{1 + (1/(3(k-1)))((\\sum_{i=1}^{k}{1/(N_{i} - 1))} - 1/(N-k))} where :math:`s_i^2` is the variance of the :math:`i^{th}` group, :math:`N` is the total sample size, :math:`N_i` is the sample size of the :math:`i^{th}` group, :math:`k` is the number of groups, and :math:`s_p^2` is the pooled variance. The pooled variance is a weighted average of the group variances and is defined as: .. math:: s^{2}_{p} = \\sum_{i=1}^{k}(N_{i} - 1)s^{2}_{i}/(N-k) The p-value is then computed using a chi-square distribution: .. math:: T \\sim \\chi^2(k-1) The **Levene** :math:`W` statistic [2]_ is defined as: .. math:: W = \\frac{(N-k)} {(k-1)} \\frac{\\sum_{i=1}^{k}N_{i}(\\overline{Z}_{i.}-\\overline{Z})^{2} } {\\sum_{i=1}^{k}\\sum_{j=1}^{N_i}(Z_{ij}-\\overline{Z}_{i.})^{2} } where :math:`Z_{ij} = |Y_{ij} - \\text{median}({Y}_{i.})|`, :math:`\\overline{Z}_{i.}` are the group means of :math:`Z_{ij}` and :math:`\\overline{Z}` is the grand mean of :math:`Z_{ij}`. The p-value is then computed using a F-distribution: .. math:: W \\sim F(k-1, N-k) .. warning:: Missing values are not supported for this function. Make sure to remove them before using the :py:meth:`pandas.DataFrame.dropna` or :py:func:`pingouin.remove_na` functions. References ---------- .. [1] Bartlett, M. S. (1937). Properties of sufficiency and statistical tests. Proc. R. Soc. Lond. A, 160(901), 268-282. .. [2] Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364-367. Examples -------- 1. Levene test on a wide-format dataframe >>> import numpy as np >>> import pingouin as pg >>> data = pg.read_dataset('mediation') >>> pg.homoscedasticity(data[['X', 'Y', 'M']]) W pval equal_var levene 1.173518 0.310707 True 2. Same data but using a long-format dataframe >>> data_long = data[['X', 'Y', 'M']].melt() >>> pg.homoscedasticity(data_long, dv="value", group="variable") W pval equal_var levene 1.173518 0.310707 True 3. Same but using a mean center >>> pg.homoscedasticity(data_long, dv="value", group="variable", center="mean") W pval equal_var levene 1.572239 0.209303 True 4. Bartlett test using a list of iterables >>> data = [[4, 8, 9, 20, 14], np.array([5, 8, 15, 45, 12])] >>> pg.homoscedasticity(data, method="bartlett", alpha=.05) T pval equal_var bartlett 2.873569 0.090045 True """ assert isinstance(data, (pd.DataFrame, list, dict)) assert method.lower() in ["levene", "bartlett"] func = getattr(scipy.stats, method) if isinstance(data, pd.DataFrame): # Data is a Pandas DataFrame if dv is None and group is None: # Wide-format # Get numeric data only numdata = data._get_numeric_data() assert numdata.shape[1] > 1, "Data must have at least two columns." statistic, p = func(*numdata.to_numpy().T, **kwargs) else: # Long-format assert group in data.columns assert dv in data.columns grp = data.groupby(group, observed=True)[dv] assert grp.ngroups > 1, "Data must have at least two columns." statistic, p = func(*grp.apply(list), **kwargs) elif isinstance(data, list): # Check that list contains other list or np.ndarray assert all(isinstance(el, (list, np.ndarray)) for el in data) assert len(data) > 1, "Data must have at least two iterables." statistic, p = func(*data, **kwargs) else: # Data is a dict assert all(isinstance(el, (list, np.ndarray)) for el in data.values()) assert len(data) > 1, "Data must have at least two iterables." statistic, p = func(*data.values(), **kwargs) equal_var = True if p > alpha else False stat_name = "W" if method.lower() == "levene" else "T" stats = pd.DataFrame({stat_name: statistic, "pval": p, "equal_var": equal_var}, index=[method]) return _postprocess_dataframe(stats)
(data, dv=None, group=None, method='levene', alpha=0.05, **kwargs)
[ 0.05878151208162308, 0.010888999328017235, 0.02557377517223358, -0.02720659412443638, 0.07379497587680817, -0.023262381553649902, -0.008121687918901443, -0.04597342014312744, -0.0031198521610349417, 0.09313434362411499, 0.0041986797004938126, 0.0015002856962382793, 0.013009544461965561, 0.007538538426160812, -0.05954490974545479, 0.02784275822341442, -0.03787293657660484, 0.035837214440107346, -0.009733302518725395, -0.0056300475262105465, -0.03570998087525368, -0.020283015444874763, -0.01648723892867565, 0.007798304781317711, 0.01697496511042118, 0.004378926008939743, -0.014642364345490932, -0.02690971828997135, -0.030366206541657448, 0.03838186711072922, -0.015384555794298649, -0.0313628651201725, -0.034458860754966736, 0.0031861192546784878, 0.055473461747169495, -0.029072673991322517, 0.00574667751789093, -0.013868365436792374, -0.080156609416008, 0.016222171485424042, -0.0009966562502086163, -0.028584949672222137, 0.014960446394979954, 0.015119487419724464, -0.026273556053638458, 0.0046095349825918674, 0.038551513105630875, 0.07744231075048447, -0.024068187922239304, -0.023453230038285255, -0.017526306211948395, -0.022605011239647865, 0.05670337751507759, 0.00370300211943686, -0.001074851374141872, 0.05165648087859154, 0.021343287080526352, -0.02145991660654545, 0.05076585337519646, -0.04699128121137619, 0.059841785579919815, 0.0027805648278445005, 0.018597181886434555, -0.0062980190850794315, -0.028436511754989624, -0.033292558044195175, 0.0015360699035227299, 0.019890714436769485, -0.015957102179527283, 0.007655168417841196, -0.03411957249045372, 0.01249001082032919, 0.019837699830532074, 0.03598565235733986, -0.02035723440349102, 0.076085165143013, 0.004339165519922972, -0.05148683860898018, 0.021884026005864143, 0.024873996153473854, 0.01879863254725933, 0.015755651518702507, 0.0011696132132783532, -0.02756708860397339, -0.04236849397420883, -0.02444988675415516, 0.03318653255701065, 0.04881495237350464, 0.08609413355588913, -0.011641792953014374, -0.03125683590769768, 0.013486667536199093, 0.06611859798431396, -0.01282929815351963, 0.0042914533987641335, 0.005150274373590946, -0.00034127524122595787, 0.00023806432727724314, 0.02302912063896656, -0.02760949917137623, 0.01374113280326128, 0.09779954701662064, 0.07756954431533813, 0.0813441127538681, -0.03221108019351959, -0.007909633219242096, -0.03144768625497818, -0.01523611694574356, -0.027058156207203865, -0.014663570560514927, -0.0995808020234108, 0.03566757217049599, -0.036727841943502426, -0.022880682721734047, 0.01982709765434265, -0.04610065370798111, -0.04889977350831032, 0.03751244395971298, -0.03282603994011879, 0.0013902824139222503, 0.003013824811205268, 0.062725730240345, -0.021088821813464165, -0.041308220475912094, 0.00026407415862195194, -0.02404698356986046, 0.03702471777796745, -0.04635511711239815, -0.05076585337519646, 0.015087679028511047, 0.010867794044315815, 0.044064927846193314, 0.012140121310949326, 0.05526140704751015, -0.02739744447171688, -0.027376238256692886, 0.032232288271188736, -0.008826769888401031, 0.06654270738363266, -0.05835740268230438, 0.03144768625497818, -0.008407961577177048, -0.03059946745634079, -0.01607373356819153, 0.04711851477622986, 0.011281300336122513, 0.023750105872750282, -0.032677602022886276, -0.0068864705972373486, 0.01369872223585844, -0.0001472784933866933, -0.05742436274886131, 0.09092897921800613, -0.050002455711364746, 0.052038177847862244, -0.032847244292497635, 0.03301689028739929, -0.08796021342277527, -0.0175050999969244, -0.04610065370798111, -0.021502329036593437, -0.023813722655177116, 0.013327626511454582, 0.056152038276195526, -0.0031490095425397158, 0.02930593490600586, -0.010141507722437382, -0.028266867622733116, -0.019212139770388603, -0.032232288271188736, 0.013613900169730186, 0.029836071655154228, -0.056364092975854874, 0.013295818120241165, -0.02582824043929577, -0.006976593751460314, 0.03095996007323265, -0.014377296902239323, 0.011546368710696697, -0.044701091945171356, -0.05258952081203461, -0.04495555907487869, -0.043937698006629944, -0.018141264095902443, -0.04618547484278679, 0.02338961325585842, 0.04686404764652252, -0.020017946138978004, -0.01896827667951584, 0.0026917671784758568, -0.1007683053612709, -0.09788436442613602, -0.0022477780003100634, 0.02338961325585842, 0.044828325510025024, 0.00830723624676466, -0.001237868214957416, 0.0027169485110789537, 0.008317838422954082, -0.0396541953086853, 0.031065987423062325, 0.03269880637526512, -0.0004993221373297274, -0.0027673114091157913, -0.02913629077374935, -0.005698965396732092, -0.06505832821130753, -0.01630699262022972, 0.023665284737944603, -0.015024063177406788, 0.016540253534913063, -0.02404698356986046, 0.006170786451548338, 0.06187750771641731, 0.03153250738978386, -0.06022348254919052, 0.09135308861732483, -0.04143545404076576, 0.06018107384443283, 0.010708753019571304, 0.0016341451555490494, -0.05441318824887276, -0.014578748494386673, 0.10195581614971161, -0.0014181146398186684, 0.012765682302415371, 0.03176576644182205, 0.03999348357319832, 0.017271840944886208, -0.03942093625664711, 0.0038063786923885345, 0.04294104129076004, 0.008794961497187614, -0.06374359130859375, -0.043407559394836426, 0.004750021267682314, -0.05042656511068344, 0.015999512746930122, -0.07222577184438705, 0.03679145872592926, 0.007188648451119661, -0.06238643825054169, 0.01674170419573784, 0.05839981511235237, -0.03691869229078293, -0.09211648255586624, 0.04796673357486725, 0.033610641956329346, 0.03218987584114075, 0.0031834684778004885, -0.06501591950654984, -0.06726369261741638, 0.01471658330410719, -0.0023962161503732204, 0.04402251914143562, -0.030217768624424934, 0.019583234563469887, 0.04792432114481926, 0.07354050874710083, -0.04711851477622986, 0.005224493332207203, -0.06942664831876755, 0.01523611694574356, 0.06459181010723114, -0.03872115537524223, -0.022286931052803993, -0.026930924504995346, 0.0015267925336956978, 0.04306827485561371, -0.015522390604019165, -0.009388714097440243, -0.006351032759994268, -0.01764293573796749, -0.03265639767050743, 0.00042245237273164093, 0.013783544301986694, 0.04132942482829094, -0.021523533388972282, 0.0081959068775177, 0.03055705688893795, -0.01481200847774744, -0.04431939497590065, -0.047330569475889206, -0.02290188893675804, -0.024068187922239304, 0.09058969467878342, -0.058951158076524734, -0.058951158076524734, 0.08567002415657043, -0.007278771605342627, -0.02476796880364418, -0.054625242948532104, -0.07841776311397552, 0.0009575586882419884, 0.033122915774583817, 0.011429738253355026, -0.019477207213640213, -0.011641792953014374, 0.04953593760728836, -0.039845045655965805, 0.03978142887353897, 0.013136778026819229, 0.09364327788352966, 0.0033425092697143555, -0.04120219498872757, 0.019678659737110138, 0.04584618657827377, -0.02521328255534172, 0.007872523739933968, -0.056152038276195526, 0.05199576914310455, 0.07103826105594635, -0.052631933242082596, 0.012193134985864162, 0.04940870404243469, -0.06382840871810913, 0.007517332676798105, -0.047585032880306244, 0.016338801011443138, 0.034268010407686234, -0.006801648531109095, -0.008068674243986607, 0.07905392348766327, -0.011185876093804836, 0.001631494495086372, -0.057339541614055634, 0.025722213089466095, -0.025001227855682373, 0.04217764362692833, 0.0029714140109717846, -0.04241090267896652, -0.03208385035395622, 0.07604274898767471, 0.04323791712522507, -0.006091265939176083, 0.024386269971728325, 0.029814865440130234, -0.0065683890134096146, 0.044658683240413666, -0.018724413588643074, 0.010215726681053638, 0.00685996375977993, -0.02610391192138195, -0.03185058757662773, -0.012299162335693836, -0.03091754950582981, -0.009632576256990433, 0.017006773501634598, 0.02387733943760395, 0.02338961325585842, 0.00037573411827906966, 0.020367836579680443, 0.010973821394145489, 0.016243375837802887, 0.03831825032830238, -0.023198764771223068, -0.0009045450715348125, -0.043810464441776276, -0.032762423157691956, -0.0012822671560570598, 0.004312658682465553, 0.0469488725066185, -0.02423783205449581, 0.02534051612019539, -0.013136778026819229, -0.07600034028291702, -0.010417178273200989, 0.025404131039977074, 0.03015415370464325, -0.003769269213080406, 0.004630740731954575, -0.06535520404577255, -0.02226572483778, -0.025043638423085213, 0.05326809734106064, 0.03149009495973587, -0.006414649076759815, 0.001616915687918663, 0.008058072067797184, -0.013624503277242184, 0.06624583154916763, -0.0045565213076770306, -0.031235631555318832, -0.010268740355968475, 0.02703695185482502, -0.010507301427423954, 0.03469211980700493, 0.0009158104658126831, -0.004495556000620127, -0.01091020554304123, -0.029963303357362747, -0.004691706504672766, 0.04711851477622986, 0.009298590943217278, -0.0011199129512533545, 0.0765092745423317, -0.02057989127933979, -0.028966646641492844, -0.07544899731874466, 0.004259645007550716, 0.02864856645464897, -0.024259036406874657, -0.006515375338494778, -0.013401845470070839, -0.05042656511068344, -0.07795124500989914, -0.01129190344363451, -0.009537152014672756, -0.023707695305347443, 0.013645708560943604, -0.021406903862953186, 0.0370459258556366, -0.059884198009967804, 0.01278688758611679, 0.024661941453814507, 0.04601583257317543, 0.021523533388972282, -0.023792516440153122, 0.03403475135564804, 0.02534051612019539, 0.0704445093870163, -0.08948700875043869, 0.008058072067797184, 0.03802137449383736, 0.023580463603138924, -0.023198764771223068, -0.04966316744685173, -0.014027406461536884, -0.0418807677924633, -0.010820082388818264, 0.04264416545629501, -0.012288559228181839, -0.02351684682071209, -0.007183346897363663, 0.00966438464820385, -0.03132045269012451, -0.06679717451334, 0.03537069261074066, 0.014112228527665138, 0.007040210068225861, -0.002385613275691867, 0.034586090594530106, 0.029539193958044052, -0.021491724997758865, -0.019053097814321518, 0.02659163624048233, 0.03967539966106415, -0.01349727064371109, -0.016550855711102486, -0.05199576914310455, 0.06081723794341087, 0.020590493455529213, 0.04877253994345665, 0.02578582987189293, -0.009510645642876625, 0.0050840070471167564, -0.01262784656137228, -0.024831583723425865, -0.007846017368137836, 0.021756794303655624, 0.0002514834050089121, 0.009876439347863197, -0.07956285774707794, 0.02650681510567665, -0.04703369364142418, -0.0012199761113151908, 0.013327626511454582, -0.041499070823192596, 0.033737875521183014, -0.014059214852750301, 0.035837214440107346, 0.008651824668049812, -0.014271269552409649, 0.01503466535359621, -0.016953758895397186, 0.03064187802374363, -0.059078387916088104, -0.048221196979284286, -0.0021907882764935493, -0.007087922189384699, 0.017526306211948395, 0.03140527382493019, 0.04605824127793312, -0.03291086107492447, 0.006769840605556965, -0.05878151208162308, 0.015384555794298649, 0.02436506375670433, 0.06115652248263359, -0.04181715101003647, 0.0186183862388134, 0.0018687304109334946, 0.04953593760728836, 0.05114755034446716, -0.021141836419701576, 0.013963790610432625, 0.03821222484111786, 0.001977408304810524, 0.048263609409332275, -0.06785744428634644, 0.03768208995461464, 0.03282603994011879, -0.017027977854013443, -0.041583891957998276, 0.03751244395971298, 0.000873399549163878, 0.05763641744852066, 0.00526690436527133, -0.01964685134589672, 0.034183189272880554, 0.001631494495086372, -0.08248920738697052, 0.04137183725833893, -0.02400457113981247, 0.02383492887020111, 0.0012577483430504799, -0.03112960420548916, 0.016010116785764694, -0.004649295471608639, 0.002025120658800006, 0.020876767113804817, -0.02145991660654545, 0.007347689010202885, 0.03990866243839264, -0.016932552680373192, 0.015299733728170395, -0.04610065370798111, 0.00007086431287461892, 0.01585107482969761, 0.005964033305644989, -0.028881825506687164, -0.05475247651338577, -0.01278688758611679, 0.03246554732322693, -0.02610391192138195, -0.0070932237431406975, -0.0550493523478508, -0.012277957051992416, -0.019265152513980865, 0.013836557045578957, 0.0008164098835550249, -0.009378110989928246, 0.007220456376671791, -0.038551513105630875, 0.05670337751507759, 0.002997920848429203, 0.014886227436363697, -0.0014273920096457005, 0.024471091106534004, 0.016200965270400047, 0.03477694094181061, -0.02097219228744507, -0.003997227642685175, -0.004715562332421541, 0.02298671007156372, -0.01004078146070242, 0.0074855247512459755, 0.004005179740488529, 0.0035386597737669945, -0.02262621745467186, -0.02699454128742218, -0.0461430624127388, 0.0040847002528607845, -0.025997884571552277, 0.012574832886457443, 0.0029343045316636562, 0.03149009495973587, -0.01004078146070242, -0.06255608052015305, -0.027142979204654694, 0.005730773322284222, 0.07913874834775925, 0.034055955708026886, -0.02841530553996563, 0.023665284737944603, 0.033165328204631805, -0.01626458205282688, -0.03165974095463753, -0.007045511621981859, -0.01630699262022972, -0.028394101187586784, -0.07091103494167328, -0.010168014094233513, -0.01777016930282116, -0.0370459258556366, 0.02943316660821438, -0.04529484733939171, 0.03931490704417229, 0.026019088923931122, 0.08346465975046158, -0.05225023254752159, -0.03869995102286339, 0.00464399391785264, -0.04504038020968437, 0.02695212885737419, 0.019943727180361748, 0.0011974453227594495, -0.028669770807027817, 0.04703369364142418, 0.01652964949607849, -0.02650681510567665, 0.01799282617866993, -0.03598565235733986, -0.0558551624417305, 0.026167528703808784, -0.03554033860564232, 0.032232288271188736, 0.010252836160361767, 0.02805481292307377, -0.03274121880531311, -0.001237868214957416, 0.004058193415403366, -0.02650681510567665, -0.014557543210685253, 0.080156609416008, 0.020378438755869865, 0.005518719088286161, -0.04953593760728836, 0.019880112260580063, -0.02966642752289772, -0.0009469559881836176, 0.034225597977638245, 0.0370459258556366, -0.009584864601492882, 0.025955474004149437, -0.07311639934778214, 0.027270210906863213, -0.06955388188362122, -0.04351358860731125, -0.11069245636463165, -0.053437739610672, 0.025807036086916924, -0.0012796164955943823, 0.0031675645150244236, -0.008439769968390465, -0.017293045297265053, 0.027736730873584747, -0.033610641956329346, 0.002740804571658373, 0.004596281796693802, -0.021014602854847908, 0.017759565263986588, 0.05212300270795822, 0.011631190776824951, 0.01634940318763256, 0.028203250840306282, 0.005364979151636362, -0.0056300475262105465, 0.02205367013812065, -0.02177799865603447, 0.01803523674607277, -0.029963303357362747, -0.052547112107276917, -0.004256994463503361, 0.028712181374430656, 0.007140935864299536, 0.030175358057022095, 0.008943399414420128, 0.014377296902239323, 0.002572486409917474, 0.0159889105707407, 0.021640164777636528, -0.08019901812076569, 0.019392386078834534, 0.05619444698095322, 0.03350461274385452, 0.027991196140646935, 0.03047223389148712, -0.005608842242509127, 0.012998942285776138, -0.008317838422954082, 0.056236859411001205, 0.001823668833822012, -0.012118916027247906, -0.010093795135617256, -0.006409347988665104, -0.03269880637526512, 0.03327135369181633, -0.06255608052015305, 0.0416899174451828, 0.028584949672222137, 0.060774825513362885, 0.014769596979022026, 0.005425944924354553, 0.04414975270628929, 0.03995107114315033, 0.01369872223585844, -0.03564636409282684, -0.0036340842489153147, -0.060732413083314896, -0.08796021342277527, -0.023198764771223068, -0.0074855247512459755, -0.03441644832491875, 0.013242804445326328, -0.012680860236287117, -0.013232202269136906, -0.007936140522360802, 0.0023352503776550293, -0.019742276519536972, -0.007633962668478489, -0.00462278863415122, 0.028712181374430656, 0.04355599731206894, 0.012924723327159882, 0.019678659737110138, -0.01839572936296463, 0.03246554732322693, 0.04754262417554855, -0.05610962584614754, -0.05700025334954262, 0.0001959847577381879, 0.008673029951751232, -0.009722699411213398, 0.0342043936252594, 0.0700203999876976, 0.018194278702139854, 0.015246720053255558, -0.0043762749992311, -0.002314044861122966, 0.05199576914310455, -0.015586007386446, 0.0582725815474987, -0.01772775873541832, -0.05471006780862808, -0.006213197484612465, 0.06018107384443283, -0.013083764351904392, 0.04179594665765762, -0.029009059071540833, 0.005460403859615326, 0.022732244804501534, 0.0064941695891320705, 0.033292558044195175, -0.013126174919307232, -0.027948785573244095, -0.00926148146390915, 0.012871709652245045, -0.00611247168853879, 0.03638855740427971, 0.009510645642876625, 0.027291417121887207, -0.017112798988819122, -0.10212545841932297, 0.06891772150993347, 0.01015741191804409, -0.0024823632556945086, 0.020558685064315796, 0.023368408903479576, -0.05602480471134186, 0.004410733934491873, -0.06094446778297424, -0.002369709312915802, 0.0655672550201416, 0.011800833977758884, 0.07604274898767471, 0.055346228182315826, -0.04487073794007301, -0.0011875053169205785, -0.05738195404410362, -0.043980106711387634, -0.0010085842804983258, 0.04669440537691116, 0.06264090538024902, -0.047372978180646896, 0.02792758122086525, 0.02642199397087097, 0.03388631343841553 ]
32,013
pingouin.reliability
intraclass_corr
Intraclass correlation. Parameters ---------- data : :py:class:`pandas.DataFrame` Long-format dataframe. Data must be fully balanced. targets : string Name of column in ``data`` containing the targets. raters : string Name of column in ``data`` containing the raters. ratings : string Name of column in ``data`` containing the ratings. nan_policy : str Defines how to handle when input contains missing values (nan). `'raise'` (default) throws an error, `'omit'` performs the calculations after deleting target(s) with one or more missing values (= listwise deletion). .. versionadded:: 0.3.0 Returns ------- stats : :py:class:`pandas.DataFrame` Output dataframe: * ``'Type'``: ICC type * ``'Description'``: description of the ICC * ``'ICC'``: intraclass correlation * ``'F'``: F statistic * ``'df1'``: numerator degree of freedom * ``'df2'``: denominator degree of freedom * ``'pval'``: p-value * ``'CI95%'``: 95% confidence intervals around the ICC Notes ----- The intraclass correlation (ICC, [1]_) assesses the reliability of ratings by comparing the variability of different ratings of the same subject to the total variation across all ratings and all subjects. Shrout and Fleiss (1979) [2]_ describe six cases of reliability of ratings done by :math:`k` raters on :math:`n` targets. Pingouin returns all six cases with corresponding F and p-values, as well as 95% confidence intervals. From the documentation of the ICC function in the `psych <https://cran.r-project.org/web/packages/psych/psych.pdf>`_ R package: - **ICC1**: Each target is rated by a different rater and the raters are selected at random. This is a one-way ANOVA fixed effects model. - **ICC2**: A random sample of :math:`k` raters rate each target. The measure is one of absolute agreement in the ratings. ICC1 is sensitive to differences in means between raters and is a measure of absolute agreement. - **ICC3**: A fixed set of :math:`k` raters rate each target. There is no generalization to a larger population of raters. ICC2 and ICC3 remove mean differences between raters, but are sensitive to interactions. The difference between ICC2 and ICC3 is whether raters are seen as fixed or random effects. Then, for each of these cases, the reliability can either be estimated for a single rating or for the average of :math:`k` ratings. The 1 rating case is equivalent to the average intercorrelation, while the :math:`k` rating case is equivalent to the Spearman Brown adjusted reliability. **ICC1k**, **ICC2k**, **ICC3K** reflect the means of :math:`k` raters. This function has been tested against the ICC function of the R psych package. Note however that contrarily to the R implementation, the current implementation does not use linear mixed effect but regular ANOVA, which means that it only works with complete-case data (no missing values). References ---------- .. [1] http://www.real-statistics.com/reliability/intraclass-correlation/ .. [2] Shrout, P. E., & Fleiss, J. L. (1979). Intraclass correlations: uses in assessing rater reliability. Psychological bulletin, 86(2), 420. Examples -------- ICCs of wine quality assessed by 4 judges. >>> import pingouin as pg >>> data = pg.read_dataset('icc') >>> icc = pg.intraclass_corr(data=data, targets='Wine', raters='Judge', ... ratings='Scores').round(3) >>> icc.set_index("Type") Description ICC F df1 df2 pval CI95% Type ICC1 Single raters absolute 0.728 11.680 7 24 0.0 [0.43, 0.93] ICC2 Single random raters 0.728 11.787 7 21 0.0 [0.43, 0.93] ICC3 Single fixed raters 0.729 11.787 7 21 0.0 [0.43, 0.93] ICC1k Average raters absolute 0.914 11.680 7 24 0.0 [0.75, 0.98] ICC2k Average random raters 0.914 11.787 7 21 0.0 [0.75, 0.98] ICC3k Average fixed raters 0.915 11.787 7 21 0.0 [0.75, 0.98]
def intraclass_corr(data=None, targets=None, raters=None, ratings=None, nan_policy="raise"): """Intraclass correlation. Parameters ---------- data : :py:class:`pandas.DataFrame` Long-format dataframe. Data must be fully balanced. targets : string Name of column in ``data`` containing the targets. raters : string Name of column in ``data`` containing the raters. ratings : string Name of column in ``data`` containing the ratings. nan_policy : str Defines how to handle when input contains missing values (nan). `'raise'` (default) throws an error, `'omit'` performs the calculations after deleting target(s) with one or more missing values (= listwise deletion). .. versionadded:: 0.3.0 Returns ------- stats : :py:class:`pandas.DataFrame` Output dataframe: * ``'Type'``: ICC type * ``'Description'``: description of the ICC * ``'ICC'``: intraclass correlation * ``'F'``: F statistic * ``'df1'``: numerator degree of freedom * ``'df2'``: denominator degree of freedom * ``'pval'``: p-value * ``'CI95%'``: 95% confidence intervals around the ICC Notes ----- The intraclass correlation (ICC, [1]_) assesses the reliability of ratings by comparing the variability of different ratings of the same subject to the total variation across all ratings and all subjects. Shrout and Fleiss (1979) [2]_ describe six cases of reliability of ratings done by :math:`k` raters on :math:`n` targets. Pingouin returns all six cases with corresponding F and p-values, as well as 95% confidence intervals. From the documentation of the ICC function in the `psych <https://cran.r-project.org/web/packages/psych/psych.pdf>`_ R package: - **ICC1**: Each target is rated by a different rater and the raters are selected at random. This is a one-way ANOVA fixed effects model. - **ICC2**: A random sample of :math:`k` raters rate each target. The measure is one of absolute agreement in the ratings. ICC1 is sensitive to differences in means between raters and is a measure of absolute agreement. - **ICC3**: A fixed set of :math:`k` raters rate each target. There is no generalization to a larger population of raters. ICC2 and ICC3 remove mean differences between raters, but are sensitive to interactions. The difference between ICC2 and ICC3 is whether raters are seen as fixed or random effects. Then, for each of these cases, the reliability can either be estimated for a single rating or for the average of :math:`k` ratings. The 1 rating case is equivalent to the average intercorrelation, while the :math:`k` rating case is equivalent to the Spearman Brown adjusted reliability. **ICC1k**, **ICC2k**, **ICC3K** reflect the means of :math:`k` raters. This function has been tested against the ICC function of the R psych package. Note however that contrarily to the R implementation, the current implementation does not use linear mixed effect but regular ANOVA, which means that it only works with complete-case data (no missing values). References ---------- .. [1] http://www.real-statistics.com/reliability/intraclass-correlation/ .. [2] Shrout, P. E., & Fleiss, J. L. (1979). Intraclass correlations: uses in assessing rater reliability. Psychological bulletin, 86(2), 420. Examples -------- ICCs of wine quality assessed by 4 judges. >>> import pingouin as pg >>> data = pg.read_dataset('icc') >>> icc = pg.intraclass_corr(data=data, targets='Wine', raters='Judge', ... ratings='Scores').round(3) >>> icc.set_index("Type") Description ICC F df1 df2 pval CI95% Type ICC1 Single raters absolute 0.728 11.680 7 24 0.0 [0.43, 0.93] ICC2 Single random raters 0.728 11.787 7 21 0.0 [0.43, 0.93] ICC3 Single fixed raters 0.729 11.787 7 21 0.0 [0.43, 0.93] ICC1k Average raters absolute 0.914 11.680 7 24 0.0 [0.75, 0.98] ICC2k Average random raters 0.914 11.787 7 21 0.0 [0.75, 0.98] ICC3k Average fixed raters 0.915 11.787 7 21 0.0 [0.75, 0.98] """ from pingouin import anova # Safety check assert isinstance(data, pd.DataFrame), "data must be a dataframe." assert all([v is not None for v in [targets, raters, ratings]]) assert all([v in data.columns for v in [targets, raters, ratings]]) assert nan_policy in ["omit", "raise"] # Convert data to wide-format data = data.pivot_table(index=targets, columns=raters, values=ratings, observed=True) # Listwise deletion of missing values nan_present = data.isna().any().any() if nan_present: if nan_policy == "omit": data = data.dropna(axis=0, how="any") else: raise ValueError( "Either missing values are present in data or " "data are unbalanced. Please remove them " "manually or use nan_policy='omit'." ) # Back to long-format # data_wide = data.copy() # Optional, for PCA data = data.reset_index().melt(id_vars=targets, value_name=ratings) # Check that ratings is a numeric variable assert data[ratings].dtype.kind in "bfiu", "Ratings must be numeric." # Check that data are fully balanced # This behavior is ensured by the long-to-wide-to-long transformation # Unbalanced data will result in rows with missing values. # assert data.groupby(raters)[ratings].count().nunique() == 1 # Extract sizes k = data[raters].nunique() n = data[targets].nunique() # Two-way ANOVA with np.errstate(invalid="ignore"): # For max precision, make sure rounding is disabled old_options = options.copy() options["round"] = None aov = anova(data=data, dv=ratings, between=[targets, raters], ss_type=2) options.update(old_options) # restore options # Extract mean squares msb = aov.at[0, "MS"] msw = (aov.at[1, "SS"] + aov.at[2, "SS"]) / (aov.at[1, "DF"] + aov.at[2, "DF"]) msj = aov.at[1, "MS"] mse = aov.at[2, "MS"] # Calculate ICCs icc1 = (msb - msw) / (msb + (k - 1) * msw) icc2 = (msb - mse) / (msb + (k - 1) * mse + k * (msj - mse) / n) icc3 = (msb - mse) / (msb + (k - 1) * mse) icc1k = (msb - msw) / msb icc2k = (msb - mse) / (msb + (msj - mse) / n) icc3k = (msb - mse) / msb # Calculate F, df, and p-values f1k = msb / msw df1 = n - 1 df1kd = n * (k - 1) p1k = f.sf(f1k, df1, df1kd) f2k = f3k = msb / mse df2kd = (n - 1) * (k - 1) p2k = f.sf(f2k, df1, df2kd) # Create output dataframe stats = { "Type": ["ICC1", "ICC2", "ICC3", "ICC1k", "ICC2k", "ICC3k"], "Description": [ "Single raters absolute", "Single random raters", "Single fixed raters", "Average raters absolute", "Average random raters", "Average fixed raters", ], "ICC": [icc1, icc2, icc3, icc1k, icc2k, icc3k], "F": [f1k, f2k, f2k, f1k, f2k, f2k], "df1": n - 1, "df2": [df1kd, df2kd, df2kd, df1kd, df2kd, df2kd], "pval": [p1k, p2k, p2k, p1k, p2k, p2k], } stats = pd.DataFrame(stats) # Calculate confidence intervals alpha = 0.05 # Case 1 and 3 f1l = f1k / f.ppf(1 - alpha / 2, df1, df1kd) f1u = f1k * f.ppf(1 - alpha / 2, df1kd, df1) l1 = (f1l - 1) / (f1l + (k - 1)) u1 = (f1u - 1) / (f1u + (k - 1)) f3l = f3k / f.ppf(1 - alpha / 2, df1, df2kd) f3u = f3k * f.ppf(1 - alpha / 2, df2kd, df1) l3 = (f3l - 1) / (f3l + (k - 1)) u3 = (f3u - 1) / (f3u + (k - 1)) # Case 2 fj = msj / mse vn = df2kd * (k * icc2 * fj + n * (1 + (k - 1) * icc2) - k * icc2) ** 2 vd = df1 * k**2 * icc2**2 * fj**2 + (n * (1 + (k - 1) * icc2) - k * icc2) ** 2 v = vn / vd f2u = f.ppf
(data=None, targets=None, raters=None, ratings=None, nan_policy='raise')
[ -0.03133612871170044, -0.022672610357403755, 0.06640494614839554, -0.01767265610396862, 0.0158754363656044, -0.0645616427063942, 0.005575987510383129, -0.09027570486068726, 0.03928536921739578, 0.01695837639272213, -0.0420503206551075, 0.02896287851035595, 0.015092032961547375, 0.046819861978292465, -0.051059458404779434, -0.0002295126614626497, -0.018398454412817955, -0.005921606905758381, 0.03324855491518974, -0.03599046543240547, -0.04755718261003494, -0.014815537258982658, -0.042741559445858, 0.01671644300222397, 0.005933127366006374, 0.03990748152136803, -0.002050673123449087, 0.004112867172807455, 0.023686427623033524, 0.007586338557302952, -0.04096737876534462, 0.0025330998469144106, -0.05778750777244568, -0.02679699845612049, -0.008721121586859226, -0.05317925289273262, 0.040276143699884415, -0.06741876155138016, 0.006993026006966829, 0.08340940624475479, -0.03449278324842453, -0.011163496412336826, -0.00690086092799902, -0.0765891894698143, -0.059538643807172775, 0.05718843638896942, -0.01824868656694889, 0.014596645720303059, 0.015621981583535671, -0.029999734833836555, -0.0025518208276480436, -0.08363981544971466, -0.01558742020279169, 0.005967689212411642, -0.01732703670859337, 0.0748380497097969, -0.01577175036072731, 0.011670404113829136, 0.03529922664165497, -0.09686550498008728, 0.021612713113427162, -0.0032257779967039824, 0.025529729202389717, 0.012384683825075626, 0.004470006562769413, -0.006359390914440155, -0.0070218276232481, 0.005829441826790571, -0.03145133703947067, -0.016912292689085007, 0.003594438312575221, -0.012154270894825459, -0.009383557364344597, -0.0070967115461826324, 0.013456102460622787, -0.013363937847316265, 0.012246435508131981, -0.03357113152742386, 0.005334054119884968, -0.03052968531847, 0.017280953004956245, 0.016946855932474136, 0.05032213777303696, -0.030575767159461975, 0.05281059443950653, 0.0079377181828022, 0.027419112622737885, 0.00986742414534092, -0.022568926215171814, 0.02065650001168251, -0.038478922098875046, -0.033087264746427536, 0.048755329102277756, -0.022672610357403755, 0.00042230330291204154, 0.07907764613628387, -0.004300077445805073, -0.07907764613628387, 0.03622087836265564, -0.012488368898630142, 0.017753299325704575, 0.0016949735581874847, 0.035253144800662994, 0.015103553421795368, -0.017476804554462433, 0.005550066474825144, -0.03946969658136368, 0.08953838050365448, -0.020437607541680336, -0.04262635111808777, -0.03880150243639946, -0.011797131039202213, 0.02940066158771515, -0.048617083579301834, 0.029654115438461304, -0.06562153995037079, -0.06271833926439285, 0.04612862691283226, -0.058524828404188156, 0.03520706295967102, 0.0026051036547869444, -0.013133524917066097, -0.010178481228649616, 0.036174796521663666, -0.007586338557302952, -0.043294548988342285, -0.02946978621184826, 0.034538865089416504, 0.03011494129896164, -0.025852305814623833, -0.03679690882563591, -0.0530410073697567, -0.007540256250649691, 0.037119489163160324, 0.012442286126315594, -0.012085147202014923, -0.00034561907523311675, -0.030345354229211807, 0.032580357044935226, -0.022200265899300575, 0.04575996473431587, 0.006048333831131458, -0.017407679930329323, -0.013997572474181652, 0.045944295823574066, 0.014884660951793194, 0.07377815246582031, -0.005348455160856247, -0.021520547568798065, -0.04700419306755066, 0.0047263409942388535, -0.0016445707296952605, 0.026174884289503098, -0.014573603868484497, 0.05516080558300018, -0.07133577764034271, 0.010086316615343094, -0.04700419306755066, -0.025552770122885704, -0.06239576265215874, -0.03995356336236, -0.04497656226158142, -0.011468793265521526, 0.003326583653688431, 0.010253366082906723, -0.0109906867146492, 0.008813286200165749, -0.020195674151182175, 0.013386978767812252, 0.00028981600189581513, -0.022937586531043053, -0.060828957706689835, -0.023075833916664124, -0.024239417165517807, -0.061335865408182144, 0.02866334095597267, -0.04398578777909279, -0.015564379282295704, 0.01393996924161911, 0.04096737876534462, 0.0004824266070500016, -0.01638234406709671, -0.02069106139242649, 0.02817947417497635, -0.039838358759880066, 0.017684176564216614, 0.07612836360931396, -0.031796954572200775, 0.06847865879535675, -0.02580622397363186, 0.007482653018087149, -0.01732703670859337, -0.01804131641983986, 0.03181999549269676, 0.04306413605809212, -0.0628105029463768, 0.019078172743320465, -0.0005245489301159978, -0.03580613434314728, -0.02695828676223755, -0.0012550292303785682, 0.03414716571569443, 0.018905363976955414, 0.002929121721535921, 0.012073625810444355, 0.00043742413981817663, -0.03393979370594025, -0.002841276815161109, 0.03089834563434124, 0.009585169143974781, 0.0106853898614645, 0.019665725529193878, 0.014585125260055065, 0.003905495395883918, -0.01879015751183033, 0.03859413042664528, 0.032879892736673355, -0.021923769265413284, -0.01100796740502119, 0.020909953862428665, 0.013133524917066097, 0.010178481228649616, -0.07612836360931396, 0.011687684804201126, -0.018836239352822304, 0.017269432544708252, 0.008133568800985813, 0.07202701270580292, 0.06622061133384705, -0.02838684618473053, 0.004173350054770708, -0.046059500426054, -0.004873228725045919, -0.012062105350196362, -0.030990509316325188, -0.017995232716202736, -0.04046047106385231, 0.025829264894127846, -0.0514741986989975, 0.017419200390577316, -0.002135637914761901, -0.029723240062594414, -0.001964268274605274, 0.024631118401885033, -0.033525049686431885, -0.048386670649051666, 0.02838684618473053, 0.04043743014335632, -0.013732598163187504, -0.004873228725045919, 0.027718650177121162, -0.10617417842149734, -0.03612871468067169, -0.02580622397363186, -0.04652032628655434, -0.060322050005197525, -0.015760229900479317, 0.007989561185240746, 0.07193484902381897, -0.06336349993944168, 0.007540256250649691, 0.025990555062890053, 0.0097694993019104, 0.034884486347436905, -0.05368616059422493, 0.022799337282776833, -0.013640432618558407, -0.005676793400198221, -0.016232576221227646, -0.043594084680080414, 0.01641690544784069, 0.07456155121326447, -0.02794906310737133, 0.06419298052787781, -0.042856764048337936, 0.023824675008654594, 0.004498808179050684, 0.0072580003179609776, -0.02573709934949875, -0.026405297219753265, 0.03571397066116333, 0.006054094061255455, -0.025207150727510452, -0.021578149870038033, 0.02499977871775627, -0.04527609795331955, -0.00259502325206995, -0.03271860629320145, 0.04025310277938843, 0.038617171347141266, -0.0004889069823548198, -0.012787905521690845, 0.011301743797957897, 0.006860538385808468, 0.06852474063634872, 0.03324855491518974, 0.009216508828103542, -0.06179669126868248, 0.0016647318843752146, 0.009700375609099865, -0.02346753515303135, 0.014297109097242355, 0.08299466222524643, -0.04764935001730919, -0.013087442144751549, -0.014723372645676136, 0.04615166783332825, -0.007891635410487652, -0.019481394439935684, 0.04663553461432457, 0.061335865408182144, 0.0314052514731884, -0.02638225629925728, -0.01781090348958969, 0.025414522737264633, -0.07672743499279022, 0.013352416455745697, -0.0056134299375116825, 0.07377815246582031, 0.05857091024518013, -0.017223350703716278, -0.020564334467053413, 0.04076001048088074, 0.0047551426105201244, 0.004360560793429613, -0.04907790943980217, 0.03571397066116333, 0.029377620667219162, -0.0021097164135426283, -0.03278772905468941, -0.05087512731552124, -0.010501059703528881, -0.007338644936680794, -0.008145089261233807, 0.02143990248441696, 0.06529895961284637, -0.00000355519614458899, -0.042741559445858, 0.03082922101020813, 0.03693515807390213, 0.036612581461668015, 0.009187706746160984, -0.0163132194429636, 0.03329463675618172, -0.01804131641983986, -0.03483840078115463, 0.045091766864061356, 0.01314504537731409, -0.05714235454797745, 0.009838622994720936, -0.03836371749639511, -0.011301743797957897, 0.0512898713350296, 0.05815616995096207, 0.02391684055328369, 0.020598895847797394, -0.00326033984310925, -0.05110554024577141, 0.06202710419893265, 0.0024754966143518686, 0.07124361395835876, 0.029561951756477356, 0.032741647213697433, -0.0157026257365942, -0.022396115586161613, 0.027349989861249924, -0.007770668715238571, 0.0013997572241351008, 0.02034544199705124, -0.019239461049437523, 0.006284506991505623, -0.018744073808193207, -0.009809820912778378, -0.015357007272541523, 0.007690024562180042, 0.025045862421393394, -0.012050584889948368, -0.03198128566145897, -0.008421584963798523, 0.044239241629838943, 0.01634778268635273, 0.004778183531016111, -0.02034544199705124, 0.048893578350543976, -0.04096737876534462, -0.02170487679541111, -0.013456102460622787, 0.006261465605348349, 0.003931417129933834, 0.004398002754896879, 0.00801836233586073, 0.0005155484541319311, 0.052349768579006195, -0.06843257695436478, -0.001995950238779187, 0.03753422945737839, 0.008974575437605381, 0.014942264184355736, -0.0006552361301146448, -0.026750916615128517, -0.04223465174436569, -0.042741559445858, 0.07036804407835007, -0.0007063589873723686, 0.014181902632117271, 0.0019095453899353743, 0.04700419306755066, -0.03917016088962555, -0.01088700070977211, -0.025552770122885704, -0.0293084979057312, 0.04138212278485298, 0.020195674151182175, 0.011532156728208065, -0.03292597830295563, 0.00690086092799902, -0.021797042340040207, -0.018870800733566284, -0.006169300526380539, 0.015679584816098213, 0.05110554024577141, -0.031082674860954285, -0.014377753250300884, 0.04479223117232323, -0.016935333609580994, -0.00862895604223013, -0.021244052797555923, 0.01076603401452303, 0.014999867416918278, -0.04347888007760048, -0.02910112589597702, 0.06405473500490189, -0.017384639009833336, -0.028432928025722504, -0.0248615313321352, -0.034031957387924194, -0.07050628960132599, 0.04986131191253662, 0.009792540222406387, -0.02112884633243084, -0.014815537258982658, 0.03421628847718239, 0.000005709689958166564, -0.04057567939162254, -0.04368625208735466, -0.004236713983118534, -0.008790245279669762, 0.02021871507167816, -0.08340940624475479, -0.062119267880916595, 0.04820233955979347, -0.030345354229211807, 0.021889207884669304, 0.06875515729188919, -0.03787985071539879, 0.04161253571510315, 0.013018318451941013, 0.021935289725661278, 0.0015264842659235, -0.0013205528957769275, -0.05271843075752258, -0.00804140418767929, -0.02357122115790844, -0.001445119734853506, 0.03156654164195061, 0.10792531818151474, 0.05340966582298279, -0.0005101481219753623, -0.007275281473994255, 0.03211953118443489, 0.025967512279748917, -0.01828324794769287, 0.011307504028081894, 0.012499889358878136, 0.02173944003880024, 0.06469988822937012, 0.014170382171869278, 0.016509070992469788, 0.010408894158899784, 0.04377841576933861, 0.04589821398258209, -0.005535665433853865, -0.016497550532221794, -0.01624409668147564, 0.009400838986039162, -0.05769534409046173, -0.0378568097949028, 0.0066186049953103065, -0.024608077481389046, -0.061704523861408234, -0.03241907060146332, 0.048617083579301834, -0.0026065439451485872, 0.08299466222524643, 0.02967715822160244, 0.05271843075752258, 0.013824762776494026, -0.03511489927768707, 0.02781081385910511, -0.02309887483716011, 0.04304109513759613, 0.02184312604367733, -0.07230351120233536, -0.018939925357699394, 0.052165437489748, 0.003090410493314266, -0.03534531220793724, -0.003983259666711092, 0.014481439255177975, -0.03343288600444794, -0.005241889040917158, -0.028548134490847588, 0.09686550498008728, -0.015264842659235, -0.03370938077569008, -0.019711807370185852, 0.004637056030333042, 0.0058841644786298275, -0.03753422945737839, 0.02248828113079071, 0.039423614740371704, -0.05161244794726372, -0.005567347165197134, 0.04967698082327843, 0.026197925209999084, 0.07488413155078888, 0.08285640925168991, 0.006255705375224352, 0.00795499887317419, -0.007690024562180042, -0.07359381765127182, -0.031151799485087395, 0.009291392751038074, 0.032810769975185394, -0.040207017213106155, -0.02635921537876129, 0.01071995124220848, -0.056312866508960724, 0.044515736401081085, -0.010449216701090336, -0.029216332361102104, -0.0023098874371498823, 0.011612800881266594, -0.034815359860658646, 0.04995347559452057, -0.007943478412926197, -0.03177391365170479, -0.04225769266486168, -0.03781072795391083, 0.02529931627213955, 0.024538954719901085, -0.02635921537876129, 0.04608254134654999, 0.017488325014710426, 0.018767114728689194, 0.0612436980009079, 0.0699533000588417, -0.0236403439193964, -0.003793169278651476, 0.005521264858543873, -0.027004370465874672, -0.061704523861408234, 0.05456173047423363, -0.1158515140414238, 0.01854822412133217, -0.00045722522190771997, 0.03707340732216835, 0.060322050005197525, -0.06488422304391861, -0.035391394048929214, -0.0436171256005764, 0.015518296509981155, 0.023594262078404427, 0.02845597080886364, -0.09594385325908661, 0.014815537258982658, -0.0074308100156486034, -0.027557360008358955, -0.007453851401805878, -0.05935431644320488, 0.012499889358878136, 0.013674994930624962, 0.033594172447919846, -0.07211917638778687, 0.06179669126868248, -0.0009029298089444637, -0.07165835052728653, 0.0457138828933239, -0.02513802796602249, -0.006330589298158884, -0.04428532347083092, 0.002600783482193947, -0.05271843075752258, -0.04596733674407005, 0.02346753515303135, 0.08138176798820496, 0.019850054755806923, 0.0027980743907392025, 0.01332937553524971, 0.0056047891266644, -0.02343297377228737, -0.0017900187522172928, -0.032580357044935226, -0.021370779722929, 0.01997678168118, 0.0023199680726975203, 0.0675109252333641, 0.0039688590914011, 0.01957355998456478, -0.006843257695436478, 0.04009181261062622, 0.07359381765127182, 0.021428382024168968, -0.02594447135925293, 0.021520547568798065, -0.016474509611725807, -0.05179677903652191, 0.02794906310737133, 0.008784485049545765, -0.0010462177451699972, -0.022234827280044556, 0.0029579231049865484, 0.006451555993407965, 0.03336375951766968, -0.014158861711621284, 0.045944295823574066, -0.048478834331035614, -0.03910103812813759, 0.006843257695436478, -0.012315559200942516, 0.0703219622373581, 0.010454976931214333, 0.05483822524547577, -0.012442286126315594, -0.011704965494573116, 0.05281059443950653, 0.05345575138926506, 0.04642816260457039, -0.026750916615128517, 0.0635017454624176, -0.007914676330983639, -0.04714244231581688, 0.008381262421607971, 0.03260339796543121, 0.025460604578256607, -0.036635622382164, -0.03357113152742386, -0.0725800022482872, -0.01229251828044653, 0.020472168922424316, -0.0069527034647762775, 0.028801588341593742, -0.04820233955979347, -0.03806418180465698, -0.037257734686136246, -0.017269432544708252, 0.0017093743663281202, 0.05751101300120354, -0.02248828113079071, -0.0016100088832899928, 0.009003376588225365, -0.00032221779110841453, 0.005325413774698973, 0.02889375388622284, 0.06304091960191727, 0.020068947225809097, 0.06050637736916542, -0.015472213737666607, 0.01444687694311142, 0.04670465737581253, 0.03670474514365196, 0.08769507706165314, 0.003136493032798171, 0.01558742020279169, 0.0042482344433665276, -0.01896296627819538, -0.02946978621184826, 0.0009173306170850992, -0.01695837639272213, 0.019827013835310936, 0.029907571151852608, 0.051566366106271744, 0.03168174996972084, -0.055944208055734634, 0.04686594754457474, -0.06419298052787781, 0.04870924726128578, -0.048893578350543976, -0.047465018928050995, -0.0694463923573494, -0.011503354646265507, 0.038709335029125214, 0.028271639719605446, -0.024538954719901085, 0.040207017213106155, -0.008669278584420681, -0.038548048585653305, 0.03364025801420212, 0.003346744691953063, -0.02008046768605709, -0.002085234969854355, -0.03562180697917938, 0.015610461123287678, -0.004147429019212723, -0.019492914900183678, 0.09078261256217957, -0.019389230757951736, 0.0018577025039121509, 0.030207106843590736, -0.05718843638896942, -0.01412429939955473, 0.07990712672472, -0.02529931627213955, 0.029561951756477356, -0.029561951756477356, 0.02384771592915058, -0.03234994411468506, 0.013548268005251884, -0.01229251828044653, -0.02631313167512417, 0.07469980418682098, 0.061105452477931976, 0.02214266173541546, 0.025783183053135872, -0.04002268984913826, 0.0579257570207119, 0.06479205191135406, 0.010529860854148865, 0.01912425458431244, -0.03953882306814194, 0.07686568051576614, 0.006699249614030123, -0.04981523007154465, 0.00314513361081481, -0.02580622397363186, -0.06820216029882431, -0.011866254732012749, -0.05345575138926506, -0.009602449834346771, 0.03880150243639946, -0.015092032961547375, -0.06520679593086243, -0.026267049834132195, 0.002419333439320326, -0.049400486052036285, 0.0539165735244751, 0.005383017007261515, -0.012234915047883987, 0.06105937063694, -0.009573648683726788, 0.018271727487444878, -0.017730258405208588, -0.020668020471930504, -0.03914711996912956, 0.01505747064948082, 0.031589582562446594, 0.029561951756477356, -0.023352328687906265, 0.0038651733193546534, -0.04578300565481186, 0.001572566805407405, -0.04232681542634964, 0.045091766864061356, 0.016739483922719955, 0.026543544605374336, 0.023006709292531013, -0.03585221990942955, -0.007033348083496094 ]
32,014
pingouin.nonparametric
kruskal
Kruskal-Wallis H-test for independent samples. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame dv : string Name of column containing the dependent variable. between : string Name of column containing the between factor. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'H'``: The Kruskal-Wallis H statistic, corrected for ties * ``'p-unc'``: Uncorrected p-value * ``'dof'``: degrees of freedom Notes ----- The Kruskal-Wallis H-test tests the null hypothesis that the population median of all of the groups are equal. It is a non-parametric version of ANOVA. The test works on 2 or more independent samples, which may have different sizes. Due to the assumption that H has a chi square distribution, the number of samples in each group must not be too small. A typical rule is that each sample must have at least 5 measurements. NaN values are automatically removed. Examples -------- Compute the Kruskal-Wallis H-test for independent samples. >>> from pingouin import kruskal, read_dataset >>> df = read_dataset('anova') >>> kruskal(data=df, dv='Pain threshold', between='Hair color') Source ddof1 H p-unc Kruskal Hair color 3 10.58863 0.014172
def kruskal(data=None, dv=None, between=None, detailed=False): """Kruskal-Wallis H-test for independent samples. Parameters ---------- data : :py:class:`pandas.DataFrame` DataFrame dv : string Name of column containing the dependent variable. between : string Name of column containing the between factor. Returns ------- stats : :py:class:`pandas.DataFrame` * ``'H'``: The Kruskal-Wallis H statistic, corrected for ties * ``'p-unc'``: Uncorrected p-value * ``'dof'``: degrees of freedom Notes ----- The Kruskal-Wallis H-test tests the null hypothesis that the population median of all of the groups are equal. It is a non-parametric version of ANOVA. The test works on 2 or more independent samples, which may have different sizes. Due to the assumption that H has a chi square distribution, the number of samples in each group must not be too small. A typical rule is that each sample must have at least 5 measurements. NaN values are automatically removed. Examples -------- Compute the Kruskal-Wallis H-test for independent samples. >>> from pingouin import kruskal, read_dataset >>> df = read_dataset('anova') >>> kruskal(data=df, dv='Pain threshold', between='Hair color') Source ddof1 H p-unc Kruskal Hair color 3 10.58863 0.014172 """ # Check data data = _check_dataframe(dv=dv, between=between, data=data, effects="between") # Remove NaN values data = data[[dv, between]].dropna() # Reset index (avoid duplicate axis error) data = data.reset_index(drop=True) # Extract number of groups and total sample size n_groups = data[between].nunique() n = data[dv].size # Rank data, dealing with ties appropriately data["rank"] = scipy.stats.rankdata(data[dv]) # Find the total of rank per groups grp = data.groupby(between, observed=True)["rank"] sum_rk_grp = grp.sum().to_numpy() n_per_grp = grp.count().to_numpy() # Calculate chi-square statistic (H) H = (12 / (n * (n + 1)) * np.sum(sum_rk_grp**2 / n_per_grp)) - 3 * (n + 1) # Correct for ties H /= scipy.stats.tiecorrect(data["rank"].to_numpy()) # Calculate DOF and p-value ddof1 = n_groups - 1 p_unc = scipy.stats.chi2.sf(H, ddof1) # Create output dataframe stats = pd.DataFrame( { "Source": between, "ddof1": ddof1, "H": H, "p-unc": p_unc, }, index=["Kruskal"], ) return _postprocess_dataframe(stats)
(data=None, dv=None, between=None, detailed=False)
[ -0.0313236303627491, -0.013073503971099854, 0.04596026986837387, -0.0026162234134972095, -0.006551977246999741, 0.01114495936781168, 0.011408865451812744, -0.005846536252647638, 0.01305320393294096, 0.036987461149692535, -0.041575368493795395, 0.009926931001245975, 0.03235895186662674, 0.009074310772120953, -0.029313882812857628, 0.056719519197940826, -0.011287062428891659, 0.011408865451812744, -0.001705239643342793, -0.017986219376325607, -0.026654521003365517, -0.036723554134368896, 0.025537993758916855, 0.09890390187501907, -0.05006096512079239, -0.0029613315127789974, -0.040824249386787415, -0.00021949886286165565, 0.011632170528173447, -0.010596846230328083, -0.060820214450359344, 0.025497393682599068, -0.05996759608387947, 0.023406444117426872, 0.018108021467924118, 0.011622020043432713, 0.06211944669485092, -0.06455550342798233, -0.0552578866481781, 0.0359521359205246, 0.015387757681310177, 0.01482949499040842, 0.03678445518016815, -0.013256208039820194, 0.016636237502098083, 0.044661037623882294, 0.04445803537964821, 0.02025987207889557, 0.007739555090665817, -0.00834856927394867, -0.02139669843018055, 0.001771216164343059, -0.028116153553128242, 0.005278122611343861, -0.0020922173280268908, -0.055339086800813675, -0.015824217349290848, -0.018493730574846268, 0.0855867937207222, -0.040316738188266754, 0.010343090631067753, 0.05732853338122368, 0.05818115547299385, 0.008719053119421005, -0.03950471803545952, -0.02279742993414402, -0.003879927797242999, 0.004280861932784319, 0.009470170363783836, -0.029252979904413223, 0.01138856541365385, 0.05984579399228096, 0.02596430480480194, 0.041697170585393906, 0.029252979904413223, 0.029638689011335373, -0.0018536868738010526, -0.03499801456928253, -0.057490937411785126, -0.010150236077606678, 0.06987422704696655, -0.013662218116223812, -0.00620686961337924, 0.005405000876635313, 0.0018460742430761456, -0.001705239643342793, 0.035201020538806915, 0.032298050820827484, 0.08794164657592773, -0.008318118751049042, 0.007815681397914886, -0.008632776327431202, 0.025274088606238365, -0.011276911944150925, 0.01936664991080761, -0.00398143008351326, -0.030856717377901077, 0.017905017361044884, -0.03327247500419617, -0.02775074541568756, 0.02241172082722187, 0.025659797713160515, 0.05809995159506798, 0.06268785893917084, -0.027913149446249008, 0.015134002082049847, 0.0030298454221338034, 0.029841694980859756, -0.05330904200673103, 0.001260532415471971, -0.0630938708782196, -0.031019121408462524, -0.0194681528955698, -0.0066078039817512035, 0.025131985545158386, -0.014321982860565186, 0.0003298826632089913, -0.0005366937257349491, -0.09183933585882187, -0.01158141903579235, -0.02838006056845188, 0.008744428865611553, -0.031526632606983185, -0.03895660489797592, -0.04173777252435684, -0.07344710826873779, 0.03499801456928253, -0.018544482067227364, -0.043889619410037994, 0.020970387384295464, 0.07178246974945068, 0.057490937411785126, -0.02764924429357052, -0.027202632278203964, -0.015235504135489464, 0.0008944895816966891, 0.07442153245210648, 0.0018917502602562308, 0.06739756464958191, -0.037779178470373154, 0.06406828761100769, -0.013520115055143833, -0.04660988599061966, 0.005557254422456026, 0.03850999474525452, 0.0028750544879585505, 0.01656518504023552, -0.015621213242411613, 0.03428749740123749, 0.05026397109031677, -0.017600510269403458, -0.03666265308856964, 0.08290713280439377, -0.015347156673669815, 0.046041470021009445, -0.10385721921920776, 0.013449062593281269, -0.06488031148910522, -0.005399925634264946, 0.01618962734937668, 0.019782809540629387, -0.03885510563850403, 0.004435653332620859, 0.01185547560453415, -0.06739756464958191, 0.02164030261337757, -0.028359759598970413, -0.02904997579753399, 0.020168518647551537, -0.02904997579753399, -0.0030019322875887156, 0.023122237995266914, -0.08615520596504211, 0.032785262912511826, -0.01393627468496561, -0.07044263929128647, -0.035079214721918106, 0.010799851268529892, 0.02115309238433838, -0.09638664126396179, -0.03769797831773758, 0.004397589713335037, -0.030613113194704056, -0.03120182640850544, -0.05221281573176384, -0.027831947430968285, 0.02596430480480194, -0.02890787273645401, -0.009054010733962059, -0.0034257047809660435, -0.023629749193787575, -0.030004099011421204, 0.00326330098323524, 0.04811212047934532, 0.060820214450359344, -0.01860538311302662, 0.05221281573176384, 0.03256195783615112, -0.008977883495390415, -0.029740191996097565, 0.013631767593324184, 0.027953749522566795, 0.01191637758165598, -0.006318522151559591, -0.011997579596936703, 0.032785262912511826, -0.019965514540672302, 0.0328664630651474, -0.020341074094176292, 0.01908244378864765, 0.032419852912425995, -0.03262285888195038, -0.030755216255784035, 0.050751179456710815, -0.016453532502055168, -0.039910729974508286, -0.019275298342108727, -0.044011425226926804, -0.001281467266380787, -0.021741805598139763, -0.04129116237163544, -0.00566383171826601, -0.019295599311590195, 0.060333002358675, 0.01305320393294096, -0.016585486009716988, 0.025497393682599068, 0.031120624393224716, 0.006739757023751736, -0.07592376321554184, 0.052903030067682266, -0.02458387240767479, 0.030471008270978928, -0.0435648150742054, -0.10410082340240479, -0.01641293242573738, -0.0637434795498848, -0.04340241104364395, 0.012880649417638779, -0.008805329911410809, -0.009130137041211128, -0.07848162949085236, 0.054851874709129333, -0.03792128339409828, -0.01857493259012699, -0.05221281573176384, -0.023629749193787575, 0.03881450369954109, 0.0351807177066803, 0.010749099776148796, -0.009713776409626007, -0.04563546180725098, 0.022959833964705467, 0.011510367505252361, 0.022959833964705467, -0.03258225694298744, 0.02675602212548256, 0.016971195116639137, 0.036865659058094025, -0.025152284651994705, -0.02253352478146553, 0.026309411972761154, -0.000961734855081886, 0.08737323433160782, -0.052903030067682266, -0.023650050163269043, -0.026715422049164772, -0.004598056897521019, -0.022858330979943275, -0.03256195783615112, -0.10994736105203629, -0.02190420962870121, -0.009505696594715118, -0.027425937354564667, -0.010104560293257236, 0.027994351461529732, -0.010799851268529892, -0.03174993768334389, 0.009211339056491852, 0.016209926456212997, -0.007292944472283125, -0.03574913367629051, -0.013956574723124504, 0.01794561743736267, -0.042874597012996674, 0.047300100326538086, -0.01298215240240097, -0.08347554504871368, 0.03134392946958542, -0.034043893218040466, -0.037393469363451004, -0.07917184382677078, -0.07917184382677078, 0.020168518647551537, -0.016494134441018105, 0.002844603732228279, -0.05769394338130951, -0.029983798041939735, 0.03576943278312683, 0.010617147199809551, -0.03402359038591385, -0.05615110695362091, 0.027669543400406837, 0.008368869312107563, -0.026451515033841133, 0.019183946773409843, 0.005973414052277803, -0.049086540937423706, 0.020330922678112984, -0.09045890718698502, -0.041209958493709564, 0.02608610689640045, 0.04673168808221817, -0.016727589070796967, 0.00004694484232459217, -0.09744226932525635, -0.026268811896443367, -0.019437702372670174, 0.03250105679035187, 0.05716612935066223, -0.012850198894739151, -0.01759035885334015, -0.011733672581613064, -0.00994215626269579, 0.059561584144830704, 0.025558294728398323, 0.0387130007147789, -0.029070276767015457, 0.04066184535622597, -0.016362180933356285, -0.054851874709129333, -0.037494972348213196, 0.07316290587186813, 0.0012706826673820615, -0.027283834293484688, 0.024807177484035492, 0.021985411643981934, 0.045797865837812424, -0.012779147364199162, 0.01241373922675848, 0.03221685066819191, 0.004095620475709438, -0.02306133694946766, -0.04652868211269379, 0.028116153553128242, 0.019813261926174164, 0.006942761596292257, -0.00841454602777958, 0.019397100433707237, 0.060942016541957855, -0.022188415750861168, 0.0614292286336422, 0.026065805926918983, -0.011906227096915245, 0.08907847106456757, -0.0030729840509593487, 0.03345517814159393, 0.0007955247419886291, 0.014200180768966675, 0.0016633699415251613, 0.0855867937207222, 0.045270051807165146, -0.04088515043258667, -0.00534409936517477, -0.0040448689833283424, -0.025822201743721962, 0.0070797898806631565, 0.03410479426383972, -0.008125264197587967, 0.03706866130232811, -0.013570865616202354, -0.08229811489582062, -0.006445399951189756, 0.025558294728398323, 0.04007313400506973, 0.060170598328113556, 0.015753166750073433, -0.010165461339056492, 0.016352031379938126, 0.010277113877236843, 0.02815675549209118, 0.03105972334742546, -0.037007760256528854, 0.0011317513417452574, 0.012911100871860981, -0.03796188160777092, -0.049857959151268005, 0.030410107225179672, 0.00047198598622344434, -0.031039422377943993, -0.013784021139144897, 0.00063692731782794, 0.07730419933795929, 0.04957375302910805, 0.001518729142844677, 0.05769394338130951, 0.007277719210833311, -0.007358921226114035, -0.021823007613420486, 0.041981376707553864, 0.025822201743721962, -0.08891607075929642, -0.016006922349333763, -0.028623666614294052, 0.0028775918763130903, -0.025822201743721962, 0.010200987569987774, -0.03568822890520096, -0.017499007284641266, -0.005496352910995483, 0.032034143805503845, 0.0217824075371027, -0.019813261926174164, 0.035830333828926086, -0.005389775615185499, -0.014941147528588772, 0.024766575545072556, 0.02762894332408905, 0.034713808447122574, 0.018158772960305214, 0.06613893806934357, -0.06345927715301514, -0.007465498521924019, 0.07344710826873779, 0.08323193341493607, 0.02685752511024475, -0.04417382925748825, -0.03798218443989754, 0.009678250178694725, 0.009460019879043102, 0.012829898856580257, -0.017265552654862404, -0.00187144975643605, 0.006039390340447426, -0.018564781174063683, 0.02842066064476967, -0.035708531737327576, 0.054851874709129333, 0.014930997043848038, 0.022086914628744125, -0.013499814085662365, 0.016524584963917732, -0.025822201743721962, -0.01909259334206581, -0.026207908987998962, 0.022838031873106956, 0.043483611196279526, -0.050223369151353836, -0.03666265308856964, -0.047868512570858, 0.05732853338122368, -0.040052831172943115, -0.028501862660050392, -0.017123447731137276, -0.04644748196005821, 0.0007669772021472454, -0.051888007670640945, 0.0077040293253958225, -0.03359728306531906, 0.03118152543902397, 0.038672398775815964, 0.021051589399576187, -0.024096660315990448, 0.05339024215936661, -0.019183946773409843, 0.020300472155213356, 0.04013403505086899, -0.03850999474525452, 0.011997579596936703, -0.04054004326462746, 0.019194096326828003, 0.029232680797576904, -0.06179463863372803, 0.06224124878644943, 0.026289111003279686, 0.005770409479737282, -0.04977675899863243, -0.011063757352530956, -0.04254978895187378, 0.0075517757795751095, -0.006562127731740475, 0.03741377219557762, 0.047056496143341064, -0.005070042796432972, 0.006166268605738878, -0.03359728306531906, -0.018666284158825874, 0.01793546788394451, -0.0046792589128017426, -0.05935858190059662, 0.01241373922675848, 0.010840452276170254, -0.03134392946958542, 0.039017509669065475, -0.01719450019299984, 0.00891698244959116, 0.03922051191329956, -0.02074708230793476, 0.011266762390732765, -0.0326431579887867, 0.054811276495456696, 0.021620003506541252, -0.0066027287393808365, -0.008820555172860622, 0.025822201743721962, -0.00034923155908472836, 0.0991475060582161, 0.027913149446249008, 0.002144237281754613, 0.046041470021009445, 0.0404791422188282, -0.014890396036207676, 0.04108815640211105, 0.0377182774245739, 0.03199354559183121, 0.02139669843018055, -0.07340651005506516, 0.0427933968603611, -0.029861994087696075, 0.02253352478146553, 0.011510367505252361, -0.008510973304510117, 0.06597653776407242, 0.04660988599061966, 0.017468556761741638, 0.043849021196365356, -0.015590762719511986, 0.04701589420437813, 0.00010887714597629383, 0.05948038399219513, -0.06098261848092079, -0.02027002163231373, -0.036500249058008194, 0.06845319271087646, -0.01521520409733057, -0.03781978040933609, -0.045879065990448, 0.0005221027531661093, -0.0075213247910141945, -0.034835610538721085, 0.018402379006147385, -0.017915166914463043, 0.019914763048291206, -0.059561584144830704, 0.0179760679602623, -0.014565588906407356, 0.011825025081634521, -0.009886329993605614, -0.022086914628744125, -0.031039422377943993, -0.00789688341319561, -0.052903030067682266, 0.05233461782336235, 0.07360951602458954, 0.0018486117478460073, 0.02482747845351696, 0.007176217157393694, 0.03313037008047104, 0.022838031873106956, -0.01101300586014986, -0.032013844698667526, -0.028684567660093307, 0.04066184535622597, 0.006831109058111906, 0.00042472395580261946, -0.01057654619216919, -0.008927132934331894, 0.009145363233983517, -0.06938701122999191, -0.02584250085055828, -0.03719046711921692, 0.0641900971531868, 0.01793546788394451, 0.01490054652094841, -0.08083648234605789, 0.011023156344890594, 0.011774273589253426, 0.024928979575634003, 0.008729202672839165, -0.013723119162023067, -0.022716227918863297, 0.006069841329008341, 0.02153880149126053, 0.029577787965536118, -0.031404830515384674, 0.028075553476810455, 0.0008342225337401032, 0.018564781174063683, -0.06946821510791779, 0.06134802848100662, -0.028116153553128242, -0.06975242495536804, -0.030268004164099693, -0.017468556761741638, 0.014098677784204483, 0.0026745873037725687, 0.024482369422912598, -0.04123025760054588, 0.13804320991039276, 0.02890787273645401, -0.022878631949424744, 0.0004564434348139912, -0.04803091660141945, -0.022574124857783318, 0.02243202179670334, 0.03727166727185249, 0.027080830186605453, 0.032927367836236954, -0.05298423394560814, -0.010353241115808487, 0.03313037008047104, 0.030085299164056778, 0.013956574723124504, 0.03536342456936836, 0.04185957461595535, 0.005973414052277803, 0.027080830186605453, -0.10864812880754471, 0.03199354559183121, 0.0043798270635306835, -0.012697945348918438, -0.0014565589372068644, 0.039159610867500305, 0.024380866438150406, -0.010008133016526699, -0.024888379499316216, 0.03233865275979042, -0.012525391764938831, -0.029090577736496925, -0.03526192158460617, 0.01629112847149372, 0.009591973386704922, 0.021823007613420486, 0.01145961694419384, -0.03708896413445473, 0.008074512705206871, 0.01669713854789734, -0.01871703565120697, 0.0160475242882967, 0.017143748700618744, -0.01998581551015377, -0.019133195281028748, 0.0326431579887867, 0.033800285309553146, 0.0451076477766037, 0.0197422094643116, 0.01732645370066166, -0.01682909205555916, -0.03755587339401245, 0.00936866831034422, 0.013844922184944153, -0.019183946773409843, -0.01870688609778881, -0.002839528489857912, 0.0301665011793375, -0.0020401973742991686, 0.06776297837495804, 0.022086914628744125, 0.0053237988613545895, -0.01552986167371273, -0.028217656537890434, 0.020686181262135506, -0.006414949428290129, -0.0053237988613545895, 0.06500211358070374, 0.06337807327508926, 0.036500249058008194, 0.012718246318399906, -0.06488031148910522, 0.021213993430137634, 0.03345517814159393, 0.010941954329609871, -0.01490054652094841, -0.020716631785035133, 0.0013943887315690517, -0.04506704956293106, -0.022980134934186935, -0.007780156098306179, -0.06488031148910522, -0.04535125568509102, 0.0031262726988643408, 0.08583039790391922, -0.039159610867500305, 0.02062528021633625, 0.07762900739908218, 0.03587093576788902, -0.012180283665657043, -0.043889619410037994, 0.0016988958232104778, -0.018422678112983704, -0.027222933247685432, -0.03400329127907753, -0.010221287608146667, 0.04344300925731659, -0.03936261683702469, -0.039565619081258774, -0.021031290292739868, -0.017915166914463043, 0.01541820913553238, -0.015732865780591965, 0.034043893218040466, 0.02561919577419758, 0.031506333500146866, 0.017539607360959053, -0.007435047999024391, 0.03798218443989754, 0.026167308911681175, 0.018057269975543022, 0.09443780034780502, -0.043483611196279526, -0.028846971690654755, 0.0029943196568638086, -0.011733672581613064, -0.031262725591659546, -0.006029240321367979, 0.007617752067744732, -0.026390613988041878, 0.021883908659219742, -0.009663024917244911, -0.0010803657351061702, 0.040803950279951096, -0.006105367094278336, 0.026593618094921112, -0.03144543245434761, -0.005075118038803339, 0.02507108263671398, 0.04904594272375107, -0.04839632660150528, 0.0017674098489806056, -0.0068970853462815285, -0.02381245419383049, 0.00238911178894341, -0.01985386200249195, -0.021051589399576187, 0.01387537270784378, -0.005963263567537069, -0.02610640786588192, 0.009267165325582027, 0.02902967482805252, 0.06459610164165497, -0.013672368600964546, 0.02050347626209259, -0.028867270797491074, -0.08688601851463318, 0.0852619856595993, -0.009718851186335087, 0.0420219786465168, 0.028501862660050392, 0.03810398653149605, -0.03083641827106476, 0.014179879799485207, -0.05809995159506798, -0.02902967482805252, -0.013266358524560928, -0.025944003835320473, 0.054567668586969376, -0.05286243185400963, -0.040682148188352585, 0.004783298820257187, -0.03542432561516762, -0.011094207875430584, -0.024807177484035492, 0.046812888234853745, 0.051888007670640945, -0.00012576776498463005, 0.04778731241822243, 0.0313236303627491, 0.02596430480480194 ]
32,015
pingouin.regression
linear_regression
(Multiple) Linear regression. Parameters ---------- X : array_like Predictor(s), of shape *(n_samples, n_features)* or *(n_samples)*. y : array_like Dependent variable, of shape *(n_samples)*. add_intercept : bool If False, assume that the data are already centered. If True, add a constant term to the model. In this case, the first value in the output dict is the intercept of the model. .. note:: It is generally recommended to include a constant term (intercept) to the model to limit the bias and force the residual mean to equal zero. The intercept coefficient and p-values are however rarely meaningful. weights : array_like An optional vector of sample weights to be used in the fitting process, of shape *(n_samples)*. Missing or negative weights are not allowed. If not null, a weighted least squares is calculated. .. versionadded:: 0.3.5 coef_only : bool If True, return only the regression coefficients. alpha : float Alpha value used for the confidence intervals. :math:`\text{CI} = [\alpha / 2 ; 1 - \alpha / 2]` as_dataframe : bool If True, returns a pandas DataFrame. If False, returns a dictionnary. remove_na : bool If True, apply a listwise deletion of missing values (i.e. the entire row is removed). Default is False, which will raise an error if missing values are present in either the predictor(s) or dependent variable. relimp : bool If True, returns the relative importance (= contribution) of predictors. This is irrelevant when the predictors are uncorrelated: the total :math:`R^2` of the model is simply the sum of each univariate regression :math:`R^2`-values. However, this does not apply when predictors are correlated. Instead, the total :math:`R^2` of the model is partitioned by averaging over all combinations of predictors, as done in the `relaimpo <https://cran.r-project.org/web/packages/relaimpo/relaimpo.pdf>`_ R package (``calc.relimp(type="lmg")``). .. warning:: The computation time roughly doubles for each additional predictor and therefore this can be extremely slow for models with more than 12-15 predictors. .. versionadded:: 0.3.0 Returns ------- stats : :py:class:`pandas.DataFrame` or dict Linear regression summary: * ``'names'``: name of variable(s) in the model (e.g. x1, x2...) * ``'coef'``: regression coefficients * ``'se'``: standard errors * ``'T'``: T-values * ``'pval'``: p-values * ``'r2'``: coefficient of determination (:math:`R^2`) * ``'adj_r2'``: adjusted :math:`R^2` * ``'CI[2.5%]'``: lower confidence intervals * ``'CI[97.5%]'``: upper confidence intervals * ``'relimp'``: relative contribution of each predictor to the final :math:`R^2` (only if ``relimp=True``). * ``'relimp_perc'``: percent relative contribution In addition, the output dataframe comes with hidden attributes such as the residuals, and degrees of freedom of the model and residuals, which can be accessed as follow, respectively: >>> lm = pg.linear_regression() # doctest: +SKIP >>> lm.residuals_, lm.df_model_, lm.df_resid_ # doctest: +SKIP Note that to follow scikit-learn convention, these hidden atributes end with an "_". When ``as_dataframe=False`` however, these attributes are no longer hidden and can be accessed as any other keys in the output dictionary. >>> lm = pg.linear_regression() # doctest: +SKIP >>> lm['residuals'], lm['df_model'], lm['df_resid'] # doctest: +SKIP When ``as_dataframe=False`` the dictionary also contains the processed ``X`` and ``y`` arrays (i.e, with NaNs removed if ``remove_na=True``) and the model's predicted values ``pred``. >>> lm['X'], lm['y'], lm['pred'] # doctest: +SKIP For a weighted least squares fit, the weighted ``Xw`` and ``yw`` arrays are included in the dictionary. >>> lm['Xw'], lm['yw'] # doctest: +SKIP See also -------- logistic_regression, mediation_analysis, corr Notes ----- The :math:`\beta` coefficients are estimated using an ordinary least squares (OLS) regression, as implemented in the :py:func:`scipy.linalg.lstsq` function. The OLS method minimizes the sum of squared residuals, and leads to a closed-form expression for the estimated :math:`\beta`: .. math:: \hat{\beta} = (X^TX)^{-1} X^Ty It is generally recommended to include a constant term (intercept) to the model to limit the bias and force the residual mean to equal zero. Note that intercept coefficient and p-values are however rarely meaningful. The standard error of the estimates is a measure of the accuracy of the prediction defined as: .. math:: \sigma = \sqrt{\text{MSE} \cdot (X^TX)^{-1}} where :math:`\text{MSE}` is the mean squared error, .. math:: \text{MSE} = \frac{SS_{\text{resid}}}{n - p - 1} = \frac{\sum{(\text{true} - \text{pred})^2}}{n - p - 1} :math:`p` is the total number of predictor variables in the model (excluding the intercept) and :math:`n` is the sample size. Using the :math:`\beta` coefficients and the standard errors, the T-values can be obtained: .. math:: T = \frac{\beta}{\sigma} and the p-values approximated using a T-distribution with :math:`n - p - 1` degrees of freedom. The coefficient of determination (:math:`R^2`) is defined as: .. math:: R^2 = 1 - (\frac{SS_{\text{resid}}}{SS_{\text{total}}}) The adjusted :math:`R^2` is defined as: .. math:: \overline{R}^2 = 1 - (1 - R^2) \frac{n - 1}{n - p - 1} The relative importance (``relimp``) column is a partitioning of the total :math:`R^2` of the model into individual :math:`R^2` contribution. This is calculated by taking the average over average contributions in models of different sizes. For more details, please refer to `Groemping et al. 2006 <http://dx.doi.org/10.18637/jss.v017.i01>`_ and the R package `relaimpo <https://cran.r-project.org/web/packages/relaimpo/relaimpo.pdf>`_. Note that Pingouin will automatically remove any duplicate columns from :math:`X`, as well as any column with only one unique value (constant), excluding the intercept. Results have been compared against sklearn, R, statsmodels and JASP. Examples -------- 1. Simple linear regression using columns of a pandas dataframe In this first example, we'll use the tips dataset to see how well we can predict the waiter's tip (in dollars) based on the total bill (also in dollars). >>> import numpy as np >>> import pingouin as pg >>> df = pg.read_dataset('tips') >>> # Let's predict the tip ($) based on the total bill (also in $) >>> lm = pg.linear_regression(df['total_bill'], df['tip']) >>> lm.round(2) names coef se T pval r2 adj_r2 CI[2.5%] CI[97.5%] 0 Intercept 0.92 0.16 5.76 0.0 0.46 0.45 0.61 1.23 1 total_bill 0.11 0.01 14.26 0.0 0.46 0.45 0.09 0.12 It comes as no surprise that total bill is indeed a significant predictor of the waiter's tip (T=14.26, p<0.05). The :math:`R^2` of the model is 0.46 and the adjusted :math:`R^2` is 0.45, which means that our model roughly explains ~45% of the total variance in the tip amount. 2. Multiple linear regression We can also have more than one predictor and run a multiple linear regression. Below, we add the party size as a second predictor of tip. >>> # We'll add a second predictor: the party size >>> lm = pg.linear_regression(df[['total_bill', 'size']], df['tip']) >>> lm.round(2) names coef se T pval r2 adj_r2 CI[2.5%] CI[97.5%] 0 Intercept 0.67 0.19 3.46 0.00 0.47 0.46 0.29 1.05 1 total_bill 0.09 0.01 10.17 0.00 0.47 0.46 0.07 0.11 2 size 0.19 0.09 2.26 0.02 0.47 0.46 0.02 0.36 The party size is also a significant predictor of tip (T=2.26, p=0.02). Note that adding this new predictor however only improved the :math:`R^2` of our model by ~1%. This function also works with numpy arrays: >>> X = df[['total_bill', 'size']].to_numpy() >>> y = df['tip'].to_numpy() >>> pg.linear_regression(X, y).round(2) names coef se T pval r2 adj_r2 CI[2.5%] CI[97.5%] 0 Intercept 0.67 0.19 3.46 0.00 0.47 0.46 0.29 1.05 1 x1 0.09 0.01 10.17 0.00 0.47 0.46 0.07 0.11 2 x2 0.19 0.09 2.26 0.02 0.47 0.46 0.02 0.36 3. Get the residuals >>> # For clarity, only display the first 9 values >>> np.round(lm.residuals_, 2)[:9] array([-1.62, -0.55, 0.31, 0.06, -0.11, 0.93, 0.13, -0.81, -0.49]) Using pandas, we can show a summary of the distribution of the residuals: >>> import pandas as pd >>> pd.Series(lm.residuals_).describe().round(2) count 244.00 mean -0.00 std 1.01 min -2.93 25% -0.55 50% -0.09 75% 0.51 max 4.04 dtype: float64 5. No intercept and return only the regression coefficients Sometimes it may be useful to remove the constant term from the regression, or to only return the regression coefficients without calculating the standard errors or p-values. This latter can potentially save you a lot of time if you need to calculate hundreds of regression and only care about the coefficients! >>> pg.linear_regression(X, y, add_intercept=False, coef_only=True) array([0.1007119 , 0.36209717]) 6. Return a dictionnary instead of a dataframe >>> lm_dict = pg.linear_regression(X, y, as_dataframe=False) >>> lm_dict.keys() dict_keys(['names', 'coef', 'se', 'T', 'pval', 'r2', 'adj_r2', 'CI[2.5%]', 'CI[97.5%]', 'df_model', 'df_resid', 'residuals', 'X', 'y', 'pred']) 7. Remove missing values >>> X[4, 1] = np.nan >>> y[7] = np.nan >>> pg.linear_regression(X, y, remove_na=True, coef_only=True) array([0.65749955, 0.09262059, 0.19927529]) 8. Get the relative importance of predictors >>> lm = pg.linear_regression(X, y, remove_na=True, relimp=True) >>> lm[['names', 'relimp', 'relimp_perc']] names relimp relimp_perc 0 Intercept NaN NaN 1 x1 0.342503 73.045583 2 x2 0.126386 26.954417 The ``relimp`` column is a partitioning of the total :math:`R^2` of the model into individual contribution. Therefore, it sums to the :math:`R^2` of the full model. The ``relimp_perc`` is normalized to sum to 100%. See `Groemping 2006 <https://www.jstatsoft.org/article/view/v017i01>`_ for more details. >>> lm[['relimp', 'relimp_perc']].sum() relimp 0.468889 relimp_perc 100.000000 dtype: float64 9. Weighted linear regression >>> X = [1, 2, 3, 4, 5, 6] >>> y = [10, 22, 11, 13, 13, 16] >>> w = [1, 0.1, 1, 1, 0.5, 1] # Array of weights. Must be >= 0. >>> lm = pg.linear_regression(X, y, weights=w) >>> lm.round(2) names coef se T pval r2 adj_r2 CI[2.5%] CI[97.5%] 0 Intercept 9.00 2.03 4.42 0.01 0.51 0.39 3.35 14.64 1 x1 1.04 0.50 2.06 0.11 0.51 0.39 -0.36 2.44
def linear_regression( X, y, add_intercept=True, weights=None, coef_only=False, alpha=0.05, as_dataframe=True, remove_na=False, relimp=False, ): """(Multiple) Linear regression. Parameters ---------- X : array_like Predictor(s), of shape *(n_samples, n_features)* or *(n_samples)*. y : array_like Dependent variable, of shape *(n_samples)*. add_intercept : bool If False, assume that the data are already centered. If True, add a constant term to the model. In this case, the first value in the output dict is the intercept of the model. .. note:: It is generally recommended to include a constant term (intercept) to the model to limit the bias and force the residual mean to equal zero. The intercept coefficient and p-values are however rarely meaningful. weights : array_like An optional vector of sample weights to be used in the fitting process, of shape *(n_samples)*. Missing or negative weights are not allowed. If not null, a weighted least squares is calculated. .. versionadded:: 0.3.5 coef_only : bool If True, return only the regression coefficients. alpha : float Alpha value used for the confidence intervals. :math:`\\text{CI} = [\\alpha / 2 ; 1 - \\alpha / 2]` as_dataframe : bool If True, returns a pandas DataFrame. If False, returns a dictionnary. remove_na : bool If True, apply a listwise deletion of missing values (i.e. the entire row is removed). Default is False, which will raise an error if missing values are present in either the predictor(s) or dependent variable. relimp : bool If True, returns the relative importance (= contribution) of predictors. This is irrelevant when the predictors are uncorrelated: the total :math:`R^2` of the model is simply the sum of each univariate regression :math:`R^2`-values. However, this does not apply when predictors are correlated. Instead, the total :math:`R^2` of the model is partitioned by averaging over all combinations of predictors, as done in the `relaimpo <https://cran.r-project.org/web/packages/relaimpo/relaimpo.pdf>`_ R package (``calc.relimp(type="lmg")``). .. warning:: The computation time roughly doubles for each additional predictor and therefore this can be extremely slow for models with more than 12-15 predictors. .. versionadded:: 0.3.0 Returns ------- stats : :py:class:`pandas.DataFrame` or dict Linear regression summary: * ``'names'``: name of variable(s) in the model (e.g. x1, x2...) * ``'coef'``: regression coefficients * ``'se'``: standard errors * ``'T'``: T-values * ``'pval'``: p-values * ``'r2'``: coefficient of determination (:math:`R^2`) * ``'adj_r2'``: adjusted :math:`R^2` * ``'CI[2.5%]'``: lower confidence intervals * ``'CI[97.5%]'``: upper confidence intervals * ``'relimp'``: relative contribution of each predictor to the final\ :math:`R^2` (only if ``relimp=True``). * ``'relimp_perc'``: percent relative contribution In addition, the output dataframe comes with hidden attributes such as the residuals, and degrees of freedom of the model and residuals, which can be accessed as follow, respectively: >>> lm = pg.linear_regression() # doctest: +SKIP >>> lm.residuals_, lm.df_model_, lm.df_resid_ # doctest: +SKIP Note that to follow scikit-learn convention, these hidden atributes end with an "_". When ``as_dataframe=False`` however, these attributes are no longer hidden and can be accessed as any other keys in the output dictionary. >>> lm = pg.linear_regression() # doctest: +SKIP >>> lm['residuals'], lm['df_model'], lm['df_resid'] # doctest: +SKIP When ``as_dataframe=False`` the dictionary also contains the processed ``X`` and ``y`` arrays (i.e, with NaNs removed if ``remove_na=True``) and the model's predicted values ``pred``. >>> lm['X'], lm['y'], lm['pred'] # doctest: +SKIP For a weighted least squares fit, the weighted ``Xw`` and ``yw`` arrays are included in the dictionary. >>> lm['Xw'], lm['yw'] # doctest: +SKIP See also -------- logistic_regression, mediation_analysis, corr Notes ----- The :math:`\\beta` coefficients are estimated using an ordinary least squares (OLS) regression, as implemented in the :py:func:`scipy.linalg.lstsq` function. The OLS method minimizes the sum of squared residuals, and leads to a closed-form expression for the estimated :math:`\\beta`: .. math:: \\hat{\\beta} = (X^TX)^{-1} X^Ty It is generally recommended to include a constant term (intercept) to the model to limit the bias and force the residual mean to equal zero. Note that intercept coefficient and p-values are however rarely meaningful. The standard error of the estimates is a measure of the accuracy of the prediction defined as: .. math:: \\sigma = \\sqrt{\\text{MSE} \\cdot (X^TX)^{-1}} where :math:`\\text{MSE}` is the mean squared error, .. math:: \\text{MSE} = \\frac{SS_{\\text{resid}}}{n - p - 1} = \\frac{\\sum{(\\text{true} - \\text{pred})^2}}{n - p - 1} :math:`p` is the total number of predictor variables in the model (excluding the intercept) and :math:`n` is the sample size. Using the :math:`\\beta` coefficients and the standard errors, the T-values can be obtained: .. math:: T = \\frac{\\beta}{\\sigma} and the p-values approximated using a T-distribution with :math:`n - p - 1` degrees of freedom. The coefficient of determination (:math:`R^2`) is defined as: .. math:: R^2 = 1 - (\\frac{SS_{\\text{resid}}}{SS_{\\text{total}}}) The adjusted :math:`R^2` is defined as: .. math:: \\overline{R}^2 = 1 - (1 - R^2) \\frac{n - 1}{n - p - 1} The relative importance (``relimp``) column is a partitioning of the total :math:`R^2` of the model into individual :math:`R^2` contribution. This is calculated by taking the average over average contributions in models of different sizes. For more details, please refer to `Groemping et al. 2006 <http://dx.doi.org/10.18637/jss.v017.i01>`_ and the R package `relaimpo <https://cran.r-project.org/web/packages/relaimpo/relaimpo.pdf>`_. Note that Pingouin will automatically remove any duplicate columns from :math:`X`, as well as any column with only one unique value (constant), excluding the intercept. Results have been compared against sklearn, R, statsmodels and JASP. Examples -------- 1. Simple linear regression using columns of a pandas dataframe In this first example, we'll use the tips dataset to see how well we can predict the waiter's tip (in dollars) based on the total bill (also in dollars). >>> import numpy as np >>> import pingouin as pg >>> df = pg.read_dataset('tips') >>> # Let's predict the tip ($) based on the total bill (also in $) >>> lm = pg.linear_regression(df['total_bill'], df['tip']) >>> lm.round(2) names coef se T pval r2 adj_r2 CI[2.5%] CI[97.5%] 0 Intercept 0.92 0.16 5.76 0.0 0.46 0.45 0.61 1.23 1 total_bill 0.11 0.01 14.26 0.0 0.46 0.45 0.09 0.12 It comes as no surprise that total bill is indeed a significant predictor of the waiter's tip (T=14.26, p<0.05). The :math:`R^2` of the model is 0.46 and the adjusted :math:`R^2` is 0.45, which means that our model roughly explains ~45% of the total variance in the tip amount. 2. Multiple linear regression We can also have more than one predictor and run a multiple linear regression. Below, we add the party size as a second predictor of tip. >>> # We'll add a second
(X, y, add_intercept=True, weights=None, coef_only=False, alpha=0.05, as_dataframe=True, remove_na=False, relimp=False)
[ 0.019824685528874397, -0.010798078030347824, 0.05357290804386139, -0.03646748885512352, 0.03687368705868721, -0.04204142093658447, -0.028975406661629677, -0.032811716198921204, 0.06639069318771362, -0.01774856448173523, -0.0093538211658597, -0.01088270265609026, 0.0236271433532238, 0.02538732998073101, -0.043914441019296646, 0.034188270568847656, -0.030555063858628273, -0.04648702219128609, -0.057634882628917694, -0.025996627286076546, -0.018617376685142517, 0.01486005075275898, -0.015198548324406147, 0.05506230145692825, -0.012276184745132923, -0.009686676785349846, 0.006098601035773754, -0.02344661019742489, 0.0560552254319191, 0.012637249194085598, -0.0026713113766163588, -0.04562949761748314, -0.0588083416223526, -0.07988546788692474, -0.054836634546518326, -0.04276354983448982, -0.0020126511808484793, -0.019215388223528862, 0.017647014930844307, -0.012039236724376678, -0.0062791332602500916, 0.002832097699865699, 0.021596156060695648, -0.003274965798482299, -0.03978476673364639, -0.030667895451188087, -0.010352388955652714, 0.028230711817741394, 0.013675308786332607, -0.04321487993001938, 0.01168945524841547, -0.0052777440287172794, 0.007909564301371574, 0.002829276956617832, 0.01929437182843685, -0.0016177371144294739, -0.013088579289615154, 0.07740315049886703, 0.035948459059000015, -0.09225191920995712, 0.050819795578718185, 0.00988413393497467, -0.04766048118472099, 0.03263118118047714, -0.00022443105990532786, -0.04386930912733078, 0.012479283846914768, -0.018854323774576187, 0.025567863136529922, -0.022532666102051735, -0.02200235426425934, -0.008135229349136353, -0.0035796137526631355, 0.02385280840098858, -0.02257779985666275, 0.041093625128269196, 0.020953010767698288, -0.0719420537352562, -0.04377904161810875, 0.020614512264728546, -0.037550684064626694, 0.01410407293587923, 0.013946106657385826, -0.0007263597217388451, -0.050097666680812836, -0.07212258875370026, -0.00113960902672261, -0.0014054708881303668, 0.04177062213420868, 0.009940550662577152, -0.07275445014238358, 0.04271841421723366, 0.023401478305459023, 0.003585255239158869, 0.000050862810894614086, -0.0661650225520134, -0.0037121919449418783, 0.02248753421008587, 0.003951961174607277, -0.024890867993235588, -0.01623660884797573, 0.008451160043478012, -0.06553316116333008, 0.11508923023939133, -0.03134489059448242, -0.0045668985694646835, -0.014814917929470539, 0.021426906809210777, 0.03556482866406441, -0.023762540891766548, -0.06860221177339554, 0.04587772861123085, -0.011791004799306393, -0.02529706433415413, -0.03831794485449791, 0.010555488057434559, -0.106333427131176, 0.01840299367904663, -0.0816456526517868, 0.025567863136529922, 0.02328864485025406, 0.035722795873880386, -0.0473896861076355, -0.0029618553817272186, -0.005224148742854595, 0.005489305127412081, 0.032089587301015854, -0.00923534668982029, 0.055874694138765335, -0.05095519497990608, -0.009743093512952328, -0.015243682079017162, -0.001684026326984167, 0.04851800948381424, -0.013867123983800411, 0.005573929753154516, 0.03946883603930473, 0.020106766372919083, 0.043575942516326904, -0.042221952229738235, 0.05799594521522522, 0.060297731310129166, -0.04080026224255562, -0.008710674941539764, 0.0051536280661821365, -0.012061802670359612, 0.025996627286076546, 0.03962680324912071, -0.01546934712678194, -0.009466653689742088, 0.0010451117996126413, -0.08475983887910843, 0.0035514056216925383, -0.0645853728055954, 0.024710334837436676, 0.014171772636473179, 0.009376387111842632, -0.014758502133190632, 0.009382029063999653, -0.03669315576553345, -0.004431499633938074, -0.033624108880758286, 0.019497470930218697, -0.012975746765732765, 0.015063149854540825, 0.030916128307580948, -0.009252271614968777, -0.0322926864027977, 0.00012332249025348574, 0.005066182930022478, 0.011384807527065277, -0.0007531574810855091, 0.04113876074552536, -0.0008236778667196631, -0.02015189826488495, 0.0272377859801054, 0.046306490898132324, -0.025725828483700752, -0.021088410168886185, 0.06386324018239975, 0.07672615349292755, -0.02337891049683094, -0.051541924476623535, -0.028411244973540306, -0.03992016613483429, 0.0012884070165455341, -0.03549712896347046, -0.01993751712143421, 0.0020126511808484793, 0.031277190893888474, 0.03012629970908165, -0.003382156603038311, 0.05091005936264992, -0.030351964756846428, -0.05858267471194267, -0.0021960041485726833, -0.004829234443604946, -0.026651056483387947, 0.05023306608200073, -0.027847081422805786, -0.018098346889019012, 0.0168007705360651, -0.003949140198528767, 0.036760855466127396, -0.04113876074552536, -0.000508451834321022, -0.055784426629543304, -0.05808621272444725, -0.04901447519659996, -0.017793698236346245, 0.03894980624318123, 0.014634385704994202, 0.0020352175924926996, 0.052489716559648514, 0.05127112567424774, 0.04481710121035576, -0.0215284563601017, -0.006301699671894312, 0.024800602346658707, -0.03100639395415783, 0.025522729381918907, -0.09184572100639343, -0.03069046139717102, 0.006076034624129534, 0.009314329363405704, -0.04693835228681564, 0.06016233190894127, 0.036851122975349426, 0.05655169114470482, -0.043417979031801224, 0.04933040589094162, -0.040777694433927536, 0.0403037965297699, -0.07189691811800003, -0.013923540711402893, -0.008987114764750004, -0.04411754012107849, 0.004423037171363831, 0.02153974026441574, -0.01993751712143421, -0.004713580943644047, 0.01104066800326109, -0.006329908035695553, 0.013528626412153244, -0.015390364453196526, 0.0473896861076355, 0.038859542459249496, 0.02009548246860504, -0.024800602346658707, -0.06828627735376358, 0.013348094187676907, 0.042786113917827606, 0.031277190893888474, 0.027260351926088333, -0.02240855060517788, -0.0890023410320282, 0.06305084377527237, 0.012005386874079704, 0.009793868288397789, -0.019158972427248955, -0.014341020956635475, -0.017579317092895508, -0.04102592542767525, 0.008146512322127819, 0.00590678583830595, -0.0050577204674482346, -0.0560552254319191, -0.008005471900105476, 0.05397910624742508, 0.006538648158311844, 0.044072408229112625, 0.02707981877028942, -0.04059716314077377, 0.002829276956617832, 0.027215218171477318, 0.027598848566412926, 0.03278914839029312, -0.017703432589769363, 0.032179851084947586, 0.0026120743714272976, -0.007367967627942562, -0.04874367639422417, 0.010510355234146118, -0.009500503540039062, 0.003971707075834274, -0.037889182567596436, -0.029923200607299805, 0.012479283846914768, 0.012389017269015312, 0.00884043239057064, 0.043011780828237534, -0.03660288825631142, 0.015638595446944237, 0.009991325438022614, 0.02739575132727623, 0.04860827699303627, 0.017714714631438255, -0.015841694548726082, 0.03211215138435364, 0.011847421526908875, -0.01760188303887844, 0.05632602423429489, 0.073250912129879, -0.03680598735809326, -0.03687368705868721, -0.03069046139717102, 0.058447279036045074, -0.04996226727962494, -0.06991107016801834, 0.01695873774588108, 0.027779381722211838, 0.06675175577402115, -0.00021579231543000787, -0.03260861709713936, -0.06377297639846802, -0.07090399414300919, 0.008721958845853806, 0.005712149664759636, 0.04131929203867912, 0.009579486213624477, -0.012930613942444324, -0.03287941589951515, 0.056190624833106995, -0.06124552711844444, 0.0819164514541626, 0.026402823626995087, 0.03655775636434555, -0.010600620880723, 0.04919500648975372, 0.009274838492274284, 0.02410103939473629, -0.06151632219552994, 0.03581305965781212, 0.0040732561610639095, -0.0100082503631711, -0.004425858147442341, 0.014070223085582256, -0.01531138177961111, 0.0118135716766119, 0.0003166364331264049, 0.020772477611899376, -0.031525421887636185, -0.009963116608560085, 0.018222462385892868, -0.017308518290519714, -0.03384977579116821, 0.03680598735809326, 0.04707375168800354, 0.05199325457215309, 0.014995450153946877, -0.06783495098352432, 0.04204142093658447, 0.022611649706959724, 0.0733863115310669, -0.019723135977983475, 0.004950529430061579, -0.036986518651247025, 0.032337818294763565, 0.0729801133275032, -0.04522329941391945, -0.06778981536626816, 0.04055203124880791, -0.020230881869792938, 0.01654125563800335, 0.003667058888822794, -0.03545199707150459, -0.022916296496987343, 0.04996226727962494, 0.05086492747068405, -0.04098079353570938, 0.016326874494552612, -0.013799424283206463, -0.0472542867064476, 0.07510136812925339, -0.027689116075634956, -0.014070223085582256, 0.03423340618610382, -0.03276658058166504, 0.019068706780672073, -0.009805151261389256, -0.021009426563978195, -0.05059412866830826, -0.010470863431692123, -0.0041014645248651505, 0.051767587661743164, 0.011892554350197315, 0.0036952670197933912, -0.06657122075557709, -0.007260776590555906, -0.041499823331832886, 0.00007541271043010056, -0.041409555822610855, 0.013190128840506077, 0.032969679683446884, -0.032901979982852936, -0.02522936463356018, 0.02965240180492401, 0.010408805683255196, -0.0843987688422203, 0.0336015410721302, -0.018425561487674713, -0.002995704999193549, -0.015401647426187992, -0.044636569917201996, -0.06711281836032867, 0.007909564301371574, 0.006267849821597338, -0.01711670309305191, -0.01180228777229786, 0.02184438705444336, -0.06345704197883606, 0.051361389458179474, -0.00423404248431325, -0.05614549294114113, -0.01831272803246975, 0.10263251513242722, 0.029449304565787315, 0.04402727261185646, 0.04603569209575653, 0.0067248218692839146, 0.07144559174776077, -0.037325017154216766, -0.012546983547508717, 0.03335331007838249, -0.0007658511749468744, 0.023830240592360497, -0.04242505133152008, -0.016496123746037483, 0.01888817362487316, 0.01136224064975977, -0.01984725147485733, -0.06530749797821045, -0.026899287477135658, -0.046712689101696014, -0.010713453404605389, -0.030735595151782036, -0.01920410618185997, 0.009060456417500973, -0.048653408885002136, -0.010690887458622456, 0.016913603991270065, 0.013032163493335247, 0.03689625486731529, 0.0168007705360651, -0.06016233190894127, -0.01792909763753414, 0.017647014930844307, -0.04107106104493141, -0.06296057999134064, -0.055558763444423676, 0.1219494566321373, 0.027576282620429993, 0.09324484318494797, 0.06318624317646027, -0.0502781979739666, -0.054430436342954636, 0.017816264182329178, -0.04617109149694443, 0.003683983813971281, 0.012490566819906235, -0.032992247492074966, 0.027124952524900436, 0.010978610254824162, -0.00348370592109859, -0.019079988822340965, -0.004812309518456459, 0.030803294852375984, -0.019147688522934914, -0.030013466253876686, 0.007762881461530924, -0.0029110806062817574, -0.014679518528282642, -0.014476420357823372, -0.0400330014526844, -0.020219597965478897, 0.10849981009960175, -0.004304563160985708, -0.007085886318236589, 0.01806449703872204, -0.023006564006209373, 0.03398517519235611, -0.05420477315783501, 0.016033509746193886, 0.021009426563978195, 0.026086892932653427, 0.006995620205998421, -0.01863994263112545, -0.012389017269015312, -0.019260521978139877, 0.031051525846123695, -0.015638595446944237, 0.05163218826055527, 0.03847591206431389, 0.07063319534063339, -0.06819601356983185, 0.01502930000424385, 0.01887689158320427, 0.0005232610856182873, 0.022036204114556313, 0.006019618362188339, 0.031457722187042236, -0.05276051536202431, 0.002913901349529624, -0.02491343393921852, 0.007514650002121925, -0.00302109238691628, -0.05456583574414253, 0.03863387554883957, -0.03576792776584625, -0.0007189551251940429, -0.06043313071131706, 0.00028930979897268116, 0.05822161212563515, 0.04183832183480263, -0.010736020281910896, 0.02972010150551796, 0.032901979982852936, 0.05519769713282585, 0.02144947461783886, -0.023807674646377563, 0.050187934190034866, 0.0517224557697773, 0.05068439617753029, -0.0236271433532238, 0.028727175667881966, 0.040281232446432114, 0.003204445354640484, -0.014498986303806305, 0.03621925786137581, 0.0408228263258934, 0.03705421835184097, -0.008372177369892597, -0.024213872849941254, -0.04267328232526779, 0.0091225141659379, -0.03658032417297363, -0.0028941556811332703, -0.09902187436819077, 0.029787801206111908, -0.02908824011683464, 0.0017982692224904895, 0.029787801206111908, 0.008276269771158695, -0.019384637475013733, -0.020219597965478897, -0.001078256405889988, -0.01229875162243843, 0.04675782099366188, -0.05822161212563515, -0.021889520809054375, 0.0025754037778824568, -0.04267328232526779, 0.02554529719054699, 0.026786454021930695, 0.007621841039508581, 0.0031931621488183737, -0.005384935066103935, 0.041590090841054916, -0.017545467242598534, 0.013144996017217636, -0.0035090933088213205, -0.06408890336751938, 0.0689181387424469, -0.016744354739785194, 0.008744524791836739, 0.07081373035907745, 0.03179622069001198, 0.05862781032919884, -0.08773861825466156, -0.05569416284561157, -0.009867209009826183, 0.01076422818005085, 0.029945766553282738, 0.016168909147381783, -0.0037601457443088293, 0.01686847023665905, 0.02545502968132496, -0.014431287534534931, -0.07018186897039413, 0.051541924476623535, 0.013393227010965347, -0.009618978016078472, -0.0294041708111763, -0.055468495935201645, 0.05325697734951973, 0.03982990235090256, -0.03416570648550987, 0.059575602412223816, -0.05086492747068405, 0.0018857144750654697, -0.02097557671368122, 0.024236438795924187, 0.0076444074511528015, -0.058041080832481384, 0.03725731745362282, 0.033375877887010574, -0.05781541392207146, -0.004485094919800758, 0.02730548568069935, 0.04443347081542015, -0.02956213615834713, -0.01583041064441204, 0.019316937774419785, -0.060703929513692856, -0.03470730036497116, 0.013630175963044167, 0.007091527804732323, -0.031074093654751778, 0.02378510870039463, -0.06268978118896484, -0.02416873909533024, -0.03382720798254013, -0.02153974026441574, -0.03953653573989868, 0.004033764824271202, 0.01421690545976162, -0.024349270388484, 0.031141793355345726, 0.0072494931519031525, -0.03800201416015625, 0.03287941589951515, 0.0014936212683096528, 0.03310507908463478, 0.05637115612626076, -0.0002233732520835474, 0.0546109713613987, 0.0018307085847482085, -0.037144485861063004, -0.00035947756259702146, -0.03800201416015625, -0.023717408999800682, 0.07252878695726395, 0.05276051536202431, 0.009596411138772964, 0.07302524894475937, 0.022848598659038544, 0.03335331007838249, 0.01695873774588108, 0.013314244337379932, 0.010736020281910896, -0.046712689101696014, -0.00791520532220602, 0.02692185342311859, 0.018098346889019012, 0.001451309071853757, 0.039717067033052444, -0.00017489050514996052, -0.04892420768737793, 0.10759714990854263, 0.00030041675199754536, -0.021404340863227844, 0.0067248218692839146, -0.050323329865932465, -0.015728861093521118, 0.01656382344663143, 0.025680694729089737, -0.04120646044611931, -0.011458148248493671, 0.01702643744647503, -0.004973095841705799, 0.0118135716766119, -0.0674738809466362, 0.024687768891453743, 0.008236778900027275, 0.03502323478460312, 0.04617109149694443, -0.0374152846634388, 0.013799424283206463, 0.03533916547894478, -0.0037657874636352062, -0.0422670841217041, 0.03075816109776497, -0.0034921683836728334, 0.01631559059023857, 0.023424044251441956, 0.00867682509124279, -0.04321487993001938, -0.03148028999567032, -0.009432803839445114, 0.014239471405744553, 0.03238295018672943, 0.061696857213974, 0.03445906937122345, -0.030148865655064583, 0.031683389097452164, -0.012242334894835949, -0.007119735702872276, 0.03856617584824562, -0.008671184070408344, -0.030193999409675598, -0.008975831791758537, -0.016044793650507927, 0.024935999885201454, 0.011836137622594833, 0.002736190101131797, -0.01574014499783516, -0.03926573693752289, -0.011655605398118496, 0.018594808876514435, -0.0182450283318758, -0.014927750453352928, -0.006792521569877863, 0.03220241889357567, 0.07433410733938217, 0.002699519507586956, 0.059079140424728394, -0.03502323478460312, -0.03326304629445076, 0.0182450283318758, -0.11770694702863693, -0.03432366997003555, 0.031277190893888474, 0.07067833095788956, -0.012343884445726871, 0.018414277583360672, -0.028569210320711136, -0.020129332318902016, -0.03003603406250477, -0.05610036104917526, 0.0416126549243927, 0.0690535381436348, -0.006877145729959011, 0.04274098202586174, -0.0011473663616925478, -0.02924620546400547, -0.018527109175920486, 0.03709935396909714, -0.027982480823993683, -0.00896454881876707, -0.003162133041769266, 0.04820207878947258, 0.04443347081542015, 0.0012030773796141148, 0.040371496230363846, 0.015040582977235317, -0.024710334837436676, -0.05758975073695183, -0.016214042901992798, 0.030803294852375984, 0.013066013343632221, 0.00016457689343951643, -0.02225058525800705, -0.00006791992200305685, -0.037167053669691086, -0.007091527804732323, 0.0771774873137474, -0.013133712112903595, 0.03195418789982796, 0.018425561487674713, -0.03536172956228256, 0.027779381722211838, -0.0315028578042984, -0.019418487325310707, 0.022871164605021477, 0.029629835858941078, 0.040371496230363846, 0.016281740739941597, -0.021077126264572144, 0.002248189179226756, -0.009647185914218426, 0.018120912835001945, -0.0157514289021492, 0.016405858099460602, 0.019023573026061058, 0.008648617193102837, -0.01421690545976162, -0.01790652982890606, 0.03445906937122345 ]
32,016
pingouin.datasets
list_dataset
List available example datasets. Returns ------- datasets : :py:class:`pandas.DataFrame` A dataframe with the name, description and reference of all the datasets included in Pingouin. Examples -------- >>> import pingouin as pg >>> all_datasets = pg.list_dataset() >>> all_datasets.index.tolist() ['ancova', 'anova', 'anova2', 'anova2_unbalanced', 'anova3', 'anova3_unbalanced', 'blandaltman', 'chi2_independence', 'chi2_mcnemar', 'circular', 'cochran', 'cronbach_alpha', 'cronbach_wide_missing', 'icc', 'mediation', 'mixed_anova', 'mixed_anova_unbalanced', 'multivariate', 'pairwise_corr', 'pairwise_tests', 'pairwise_tests_missing', 'partial_corr', 'penguins', 'rm_anova', 'rm_anova_wide', 'rm_anova2', 'rm_corr', 'rm_missing', 'tips']
def list_dataset(): """List available example datasets. Returns ------- datasets : :py:class:`pandas.DataFrame` A dataframe with the name, description and reference of all the datasets included in Pingouin. Examples -------- >>> import pingouin as pg >>> all_datasets = pg.list_dataset() >>> all_datasets.index.tolist() ['ancova', 'anova', 'anova2', 'anova2_unbalanced', 'anova3', 'anova3_unbalanced', 'blandaltman', 'chi2_independence', 'chi2_mcnemar', 'circular', 'cochran', 'cronbach_alpha', 'cronbach_wide_missing', 'icc', 'mediation', 'mixed_anova', 'mixed_anova_unbalanced', 'multivariate', 'pairwise_corr', 'pairwise_tests', 'pairwise_tests_missing', 'partial_corr', 'penguins', 'rm_anova', 'rm_anova_wide', 'rm_anova2', 'rm_corr', 'rm_missing', 'tips'] """ return dts.set_index("dataset")
()
[ -0.043162841349840164, -0.030573679134249687, 0.014000946655869484, -0.05812596157193184, 0.018667928874492645, 0.08675730973482132, -0.010206213220953941, -0.019297387450933456, 0.049169670790433884, 0.038091208785772324, -0.046184241771698, -0.012786991894245148, -0.05456502363085747, -0.0064564417116343975, 0.025412123650312424, -0.04550082981586456, 0.0037655082996934652, 0.03845089673995972, 0.03359507769346237, -0.01521490141749382, -0.020772118121385574, 0.07711760699748993, -0.0014207768253982067, -0.010844663716852665, -0.040321286767721176, 0.05906115472316742, -0.002083956031128764, -0.048702072352170944, 0.04140035808086395, 0.06215449050068855, -0.05711882561445236, -0.009387917816638947, -0.051004089415073395, 0.0109795480966568, -0.03354112431406975, -0.016662655398249626, 0.05168750137090683, 0.01631195656955242, -0.008857375010848045, 0.06118332967162132, -0.014963118359446526, -0.08337622135877609, 0.048666104674339294, -0.03303755819797516, 0.007674892898648977, 0.0062676044180989265, 0.014486528933048248, -0.07330489158630371, -0.014216761104762554, -0.0437023788690567, 0.029080964624881744, 0.028181739151477814, 0.0024099252186715603, 0.0033158953301608562, -0.01818234659731388, -0.0241532064974308, -0.02266049198806286, 0.08668537437915802, 0.02328995056450367, 0.045824550092220306, -0.003776748664677143, -0.012733038514852524, -0.027102667838335037, -0.035213686525821686, -0.0018524052575230598, 0.052874479442834854, -0.0007109504658728838, 0.005835975985974073, -0.036184847354888916, -0.03827105462551117, -0.026419255882501602, 0.008771948516368866, -0.006501403171569109, 0.03436841070652008, -0.012760015204548836, -0.045824550092220306, -0.01466637384146452, -0.03677833825349808, -0.07031946629285812, 0.01688746176660061, -0.018245292827486992, -0.053234171122312546, -0.02098793163895607, 0.028577398508787155, 0.028973057866096497, -0.010449004359543324, -0.0002443365228828043, 0.005368378479033709, 0.05060843005776405, -0.007252256385982037, 0.01115939300507307, 0.02632933296263218, 0.013695210218429565, 0.02048436552286148, -0.0369042307138443, -0.03769554942846298, -0.06751387566328049, 0.02125769853591919, -0.007602954749017954, 0.007202798966318369, -0.031347014009952545, 0.0007019581971690059, 0.05039261654019356, 0.06093154475092888, -0.03490794822573662, -0.037156011909246445, -0.011950711719691753, -0.004819850437343121, 0.003783492837101221, -0.01775071769952774, -0.11747486889362335, 0.04255136847496033, 0.07229775935411453, -0.023074135184288025, 0.04273121431469917, 0.01584435999393463, 0.022714445367455482, 0.0038734155241400003, -0.057874176651239395, -0.035051822662353516, -0.04798269271850586, 0.124380923807621, -0.04528501629829407, -0.07100287079811096, 0.04568067565560341, 0.019405294209718704, 0.019099557772278786, -0.010637842118740082, -0.050428587943315506, -0.002148025669157505, 0.043126873672008514, 0.011060478165745735, -0.019459247589111328, 0.04388222098350525, 0.07298117130994797, -0.051004089415073395, 0.11164788156747818, -0.0017085291910916567, -0.01728312112390995, -0.0018962424946948886, -0.05909712240099907, -0.0009357568924315274, 0.004774889443069696, 0.04485338553786278, 0.0020648473873734474, -0.017543897032737732, 0.03787539526820183, -0.07438396662473679, -0.011483114212751389, -0.0063215577974915504, 0.0694202333688736, -0.017525911331176758, -0.05636347830295563, -0.09294398874044418, -0.04208377003669739, -0.03312747925519943, -0.030681585893034935, -0.055536188185214996, 0.006164193153381348, -0.03059166483581066, -0.006375511176884174, 0.03427848964929581, -0.0438462533056736, 0.03573523461818695, -0.08848382532596588, 0.046292148530483246, -0.04848625883460045, -0.028109800070524216, -0.03355911001563072, -0.027066698297858238, 0.009729623794555664, 0.04985308274626732, 0.044457726180553436, 0.005035664886236191, 0.00025220474344678223, -0.0029584530275315046, -0.02828964591026306, 0.0020569791086018085, 0.04827044531702995, -0.015727460384368896, -0.05492471531033516, 0.00852466095238924, -0.027606233954429626, -0.004613028839230537, 0.00181643629912287, -0.028145769611001015, -0.017543897032737732, 0.034746088087558746, 0.01570947654545307, 0.015961259603500366, -0.02578979730606079, -0.008920320309698582, -0.016905445605516434, 0.03537554666399956, -0.00013755346299149096, -0.09337561577558517, -0.0052739595994353294, -0.026041580364108086, 0.014117846265435219, -0.02933274768292904, 0.016204049810767174, 0.07035543024539948, 0.08129002153873444, -0.058809369802474976, 0.05855758860707283, 0.035213686525821686, -0.07567884773015976, -0.055068593472242355, -0.046400055289268494, 0.005049153231084347, 0.07941962778568268, -0.027983909472823143, -0.02122173085808754, -0.006168689578771591, 0.006771170534193516, -0.0020491108298301697, -0.006357526872307062, 0.001364575233310461, 0.017642810940742493, -0.03596903383731842, 0.035717252641916275, -0.061543017625808716, 0.008493187837302685, 0.05496068671345711, -0.03469213470816612, 0.0000016070149513325305, 0.06265805661678314, 0.01651877909898758, 0.005750549491494894, -0.06539170444011688, -0.019135527312755585, -0.011635982431471348, 0.013155674561858177, -0.04244346171617508, 0.015277847647666931, 0.03863074257969856, 0.044529665261507034, 0.025286231189966202, 0.0577303022146225, -0.015799397602677345, -0.04535695165395737, 0.008587607182562351, 0.06478022783994675, 0.014243737794458866, -0.056507352739572525, 0.007022954057902098, -0.0483064129948616, -0.03194050118327141, -0.0032731820829212666, -0.034656163305044174, 0.0011481990804895759, -0.03978175297379494, 0.029836313799023628, 0.0032551975455135107, 0.0219590961933136, -0.04291105642914772, -0.021581420674920082, -0.032480038702487946, -0.0075040399096906185, -0.03273181989789009, -0.05168750137090683, -0.02235475555062294, -0.05528440698981285, 0.051435720175504684, -0.026311349123716354, 0.015772420912981033, -0.028253676369786263, -0.025106385350227356, 0.006519387476146221, -0.015169939957559109, 0.06308968365192413, 0.09294398874044418, 0.012364355847239494, -0.06388100236654282, -0.024710725992918015, 0.0335051566362381, 0.016159089282155037, -0.02649119310081005, -0.04211973771452904, 0.0018096920102834702, -0.01884777471423149, -0.017561880871653557, -0.0390983410179615, -0.02105986885726452, 0.030411818996071815, -0.0391702800989151, -0.01396497804671526, 0.03256995975971222, -0.023775530979037285, -0.023631656542420387, 0.04478144645690918, 0.012867921963334084, -0.012562185525894165, -0.06172286346554756, -0.053306110203266144, 0.04416997358202934, -0.003675585612654686, -0.016033196821808815, 0.025843750685453415, 0.06506798416376114, -0.03381089121103287, -0.04006950557231903, 0.0665786862373352, 0.04107663780450821, -0.020862039178609848, -0.007715357933193445, 0.008421250618994236, -0.047299280762672424, 0.002553801517933607, -0.05909712240099907, 0.014477536082267761, 0.04485338553786278, 0.03967384621500969, 0.01568249985575676, -0.032749805599451065, -0.04381028562784195, -0.022516615688800812, 0.005291944369673729, 0.006550860591232777, 0.004716439638286829, -0.019279401749372482, 0.021041885018348694, 0.03694019839167595, -0.02472871169447899, 0.03636469319462776, 0.09423886984586716, 0.03019600361585617, -0.007557993289083242, 0.020736148580908775, -0.026239410042762756, 0.018595991656184196, -0.04064501076936722, 0.017867617309093475, 0.0103770662099123, 0.010161252692341805, 0.008250397630035877, 0.033685002475976944, 0.028469491750001907, 0.032516006380319595, 0.03643663227558136, 0.010152259841561317, -0.028721274808049202, -0.00042404120904393494, -0.009167607873678207, 0.02625739574432373, -0.0390983410179615, 0.05488874763250351, -0.025717860087752342, -0.029368717223405838, 0.03042980283498764, 0.027444373816251755, 0.05121990665793419, -0.027750110253691673, 0.066866435110569, 0.09416693449020386, 0.04690362140536308, -0.00076434196671471, -0.0017433741595596075, -0.024279098957777023, 0.02679693140089512, 0.014711335301399231, -0.032444071024656296, 0.04006950557231903, -0.011959703639149666, -0.014720327220857143, -0.027480343356728554, 0.06305371969938278, -0.02769615687429905, 0.009522802196443081, -0.010143267922103405, -0.04021338000893593, 0.018991651013493538, 0.015799397602677345, 0.005871945060789585, 0.02145552821457386, -0.05657929182052612, -0.027642203494906425, -0.02496251091361046, -0.020772118121385574, 0.05348595604300499, -0.0460403636097908, -0.05769433081150055, 0.07920381426811218, -0.025951659306883812, 0.010188229382038116, -0.010646834038197994, -0.033685002475976944, 0.03240809962153435, -0.04697556048631668, 0.017435990273952484, 0.011617998592555523, -0.041724078357219696, 0.018326222896575928, 0.044493697583675385, -0.026707008481025696, -0.034152597188949585, -0.06071573123335838, -0.039314154535532, 0.03312747925519943, -0.02855941280722618, 0.004842331167310476, 0.00037317874375730753, -0.022966228425502777, 0.015071025118231773, -0.026167472824454308, 0.007782799657434225, 0.030142050236463547, -0.06143511086702347, -0.037659578025341034, -0.037156011909246445, 0.04431385174393654, 0.020268550142645836, 0.015808390453457832, 0.023074135184288025, 0.07136256247758865, 0.0332893431186676, -0.0016399631276726723, 0.05942084640264511, 0.08409560471773148, 0.0716143473982811, 0.03440438210964203, -0.0690605491399765, 0.03744376450777054, 0.0438462533056736, 0.06434860080480576, 0.05301835760474205, -0.023613670840859413, -0.012220479547977448, -0.010754741728305817, -0.014009938575327396, -0.02879321202635765, 0.003940857481211424, -0.030987324193120003, -0.062046583741903305, -0.001065582619048655, -0.023649640381336212, -0.015421723946928978, -0.03269585222005844, 0.01246327068656683, 0.051903318613767624, 0.036112911999225616, -0.0132276127114892, 0.020538318902254105, 0.0029719413723796606, -0.04420594498515129, 0.029512593522667885, -0.018595991656184196, 0.029188871383666992, 0.02278638258576393, -0.010781718418002129, -0.013272574171423912, -0.01654575578868389, 0.06963605433702469, -0.06862891465425491, -0.01634792611002922, 0.025142354890704155, 0.005507758352905512, -0.022732429206371307, -0.048666104674339294, -0.005139075685292482, 0.059780534356832504, 0.015205909498035908, 0.05157959461212158, -0.02722855843603611, 0.06316162645816803, 0.012553192675113678, 0.05244285240769386, -0.029836313799023628, 0.03517771512269974, -0.0289011187851429, -0.016941415145993233, 0.017759710550308228, -0.01231040246784687, -0.05550022050738335, 0.06564348936080933, 0.01429769117385149, -0.015898313373327255, 0.0011723657371476293, -0.0012566681252792478, -0.03816314414143562, -0.029512593522667885, -0.014387614093720913, 0.07093093544244766, 0.022516615688800812, -0.021131807938218117, -0.02582576684653759, -0.015925290063023567, -0.011051486246287823, -0.0115460604429245, -0.05848564952611923, 0.006977992597967386, -0.007917683571577072, -0.01688746176660061, -0.037623610347509384, 0.045033231377601624, 0.0739523321390152, 0.05452905595302582, 0.031239107251167297, -0.006240627728402615, 0.029710423201322556, 0.06222642958164215, -0.05445711687207222, -0.05114796757698059, -0.0011689936509355903, -0.00014141731662675738, 0.027066698297858238, 0.06470829248428345, -0.03539352864027023, -0.0022963981609791517, -0.03593306615948677, -0.004008299205452204, 0.03409864380955696, -0.009226057678461075, 0.012166526168584824, 0.015763429924845695, 0.05488874763250351, -0.0714704692363739, 0.059276968240737915, 0.05488874763250351, 0.08423947542905807, -0.021743280813097954, 0.03287569805979729, 0.0022120955400168896, 0.023829486221075058, -0.016941415145993233, -0.02391940727829933, -0.007126364856958389, -0.015970250591635704, -0.04190392419695854, 0.10373469442129135, -0.00641597667708993, -0.026850884780287743, -0.0010071329306811094, 0.0355553925037384, 0.020808085799217224, -0.01336249615997076, -0.027336467057466507, 0.007787296082824469, 0.0920807272195816, 0.007661404553800821, -0.0038689193315804005, 0.013497380539774895, 0.00165345158893615, -0.0322282537817955, 0.012049626559019089, -0.03062763251364231, -0.049169670790433884, 0.03623880073428154, 0.04294702783226967, 0.04186795651912689, 0.06470829248428345, -0.06305371969938278, 0.014189784415066242, -0.016195056959986687, 0.011671951971948147, 0.026311349123716354, 0.010934586636722088, 0.02102390117943287, -0.023667624220252037, -0.012328386306762695, -0.0031315539963543415, -0.061650924384593964, 0.006789155304431915, -0.04571664333343506, 0.031778641045093536, 0.0009323848062194884, 0.01521490141749382, -0.006402488332241774, -0.04064501076936722, -0.08913126587867737, -0.0009739740053191781, 0.003484500339254737, 0.08265683799982071, -0.00034648296423256397, -0.006258612032979727, 0.021905142813920975, -0.03240809962153435, -0.0054223318584263325, 0.019477231428027153, -0.006087759044021368, -0.027804063633084297, 0.025142354890704155, 0.020466379821300507, 0.05211913213133812, 0.005449308548122644, 0.06316162645816803, 0.007697373628616333, 0.0002804460527841002, 0.010655826888978481, -0.008012102916836739, -0.02636530250310898, 0.0017591106006875634, 0.01357831060886383, 0.024764681234955788, 0.0008952917414717376, 0.0009200204513035715, -0.039314154535532, -0.0712546557188034, 0.0462561771273613, -0.0027988404035568237, 0.015053041279315948, 0.036148879677057266, -0.006362022832036018, -0.014990095049142838, 0.03740779682993889, 0.0044961292296648026, 0.0012409316841512918, -0.017310097813606262, -0.008709002286195755, 0.0015860096318647265, -0.0016545755788683891, 0.019998783245682716, -0.009648693725466728, -0.07229775935411453, -0.016069166362285614, -0.027768094092607498, -0.002000777516514063, -0.01938731037080288, 0.011042493395507336, -0.024908555671572685, 0.03970981389284134, -0.021977080032229424, 0.04801866039633751, -0.020178629085421562, -0.07240566611289978, -0.003183259628713131, -0.002394188893958926, 0.032983604818582535, -0.03593306615948677, -0.003675585612654686, 0.027012744918465614, -0.02602359652519226, -0.017525911331176758, 0.04373834654688835, 0.015178932808339596, 0.008385281078517437, 0.008012102916836739, -0.01671660877764225, 0.01568249985575676, -0.004932254087179899, 0.012733038514852524, 0.0031338022090494633, 0.010161252692341805, 0.013857070356607437, 0.024333052337169647, -0.031005308032035828, -0.034350428730249405, -0.023074135184288025, -0.004792873747646809, -0.04524904489517212, 0.022930258885025978, 0.005750549491494894, -0.05445711687207222, 0.04114857688546181, -0.03179662674665451, 0.05981650575995445, -0.009405902586877346, 0.00201089377515018, 0.02552003040909767, -0.06805341690778732, -0.01246327068656683, -0.027947939932346344, 0.0438462533056736, -0.006834116764366627, 0.038882527500391006, -0.014639397151768208, 0.018811805173754692, 0.015475677326321602, -0.04841431975364685, 0.012535208836197853, 0.015071025118231773, 0.0735926479101181, -0.011698928661644459, -0.018811805173754692, 0.04373834654688835, 0.007409621030092239, -0.06470829248428345, -0.01222947146743536, -0.01287691481411457, -0.013668233528733253, 0.000528857228346169, 0.016968391835689545, 0.039026401937007904, -0.013299550861120224, -0.03019600361585617, 0.005516750738024712, 0.04478144645690918, -0.044421758502721786, 0.022246848791837692, 0.012912883423268795, -0.05032068118453026, 0.005912410095334053, 0.029386701062321663, 0.02145552821457386, -0.017993509769439697, 0.024117236956954002, -0.0060383016243577, -0.022642508149147034, -0.032947637140750885, 0.02492654137313366, -0.029872283339500427, 0.01117737777531147, 0.021437544375658035, 0.036184847354888916, 0.036490585654973984, 0.0020569791086018085, -0.0008441482787020504, 0.016842501237988472, -0.030213989317417145, 0.01102450955659151, 0.051939286291599274, -0.0032349650282412767, 0.0033900814596563578, 0.006384503562003374, 0.04071694612503052, -0.06179480254650116, -0.04834238067269325, -0.01651877909898758, -0.033415231853723526, 0.023865453898906708, 0.08193746209144592, -0.024530882015824318, 0.04888191819190979, 0.06215449050068855, 0.016968391835689545, -0.02231878601014614, -0.010386059060692787, 0.04229958355426788, 0.015970250591635704, 0.014945133589208126, -0.033756937831640244, 0.024710725992918015, -0.014981103129684925, -0.050572462379932404, 0.022804368287324905, -0.004514113999903202, 0.020160643383860588, -0.029386701062321663, -0.004770393017679453, -0.003331631887704134, -0.023200027644634247, -0.0015972499968484044, -0.009432879276573658, 0.01722017489373684, 0.013038774952292442, -0.03970981389284134, 0.05258672684431076, -0.015133971348404884, 0.048702072352170944, -0.00397907430306077, 0.007782799657434225, -0.032947637140750885, -0.07769311219453812, -0.04470951110124588, -0.02855941280722618, 0.02102390117943287, 0.03217430040240288, 0.028037862852215767, 0.00302814319729805, -0.044062066823244095, -0.0098105538636446, 0.0370481051504612, -0.0007879466866143048, 0.019045604392886162, -0.014423582702875137, -0.007427605800330639, 0.020376458764076233, -0.00947784073650837 ]
32,017
pingouin.regression
logistic_regression
(Multiple) Binary logistic regression. Parameters ---------- X : array_like Predictor(s), of shape *(n_samples, n_features)* or *(n_samples)*. y : array_like Dependent variable, of shape *(n_samples)*. ``y`` must be binary, i.e. only contains 0 or 1. Multinomial logistic regression is not supported. coef_only : bool If True, return only the regression coefficients. alpha : float Alpha value used for the confidence intervals. :math:`\text{CI} = [\alpha / 2 ; 1 - \alpha / 2]` as_dataframe : bool If True, returns a pandas DataFrame. If False, returns a dictionnary. remove_na : bool If True, apply a listwise deletion of missing values (i.e. the entire row is removed). Default is False, which will raise an error if missing values are present in either the predictor(s) or dependent variable. **kwargs : optional Optional arguments passed to :py:class:`sklearn.linear_model.LogisticRegression` (see Notes). Returns ------- stats : :py:class:`pandas.DataFrame` or dict Logistic regression summary: * ``'names'``: name of variable(s) in the model (e.g. x1, x2...) * ``'coef'``: regression coefficients (log-odds) * ``'se'``: standard error * ``'z'``: z-scores * ``'pval'``: two-tailed p-values * ``'CI[2.5%]'``: lower confidence interval * ``'CI[97.5%]'``: upper confidence interval See also -------- linear_regression Notes ----- .. caution:: This function is a wrapper around the :py:class:`sklearn.linear_model.LogisticRegression` class. However, Pingouin internally disables the L2 regularization and changes the default solver to 'newton-cg' to obtain results that are similar to R and statsmodels. Logistic regression assumes that the log-odds (the logarithm of the odds) for the value labeled "1" in the response variable is a linear combination of the predictor variables. The log-odds are given by the `logit <https://en.wikipedia.org/wiki/Logit>`_ function, which map a probability :math:`p` of the response variable being "1" from :math:`[0, 1)` to :math:`(-\infty, +\infty)`. .. math:: \text{logit}(p) = \ln \frac{p}{1 - p} = \beta_0 + \beta X The odds of the response variable being "1" can be obtained by exponentiating the log-odds: .. math:: \frac{p}{1 - p} = e^{\beta_0 + \beta X} and the probability of the response variable being "1" is given by the `logistic function <https://en.wikipedia.org/wiki/Logistic_function>`_: .. math:: p = \frac{1}{1 + e^{-(\beta_0 + \beta X})} The first coefficient is always the constant term (intercept) of the model. Pingouin will automatically add the intercept to your predictor(s) matrix, therefore, :math:`X` should not include a constant term. Pingouin will remove any constant term (e.g column with only one unique value), or duplicate columns from :math:`X`. The calculation of the p-values and confidence interval is adapted from a `code by Rob Speare <https://gist.github.com/rspeare/77061e6e317896be29c6de9a85db301d>`_. Results have been compared against statsmodels, R, and JASP. Examples -------- 1. Simple binary logistic regression. In this first example, we'll use the `penguins dataset <https://github.com/allisonhorst/palmerpenguins>`_ to see how well we can predict the sex of penguins based on their bodies mass. >>> import numpy as np >>> import pandas as pd >>> import pingouin as pg >>> df = pg.read_dataset('penguins') >>> # Let's first convert the target variable from string to boolean: >>> df['male'] = (df['sex'] == 'male').astype(int) # male: 1, female: 0 >>> # Since there are missing values in our outcome variable, we need to >>> # set `remove_na=True` otherwise regression will fail. >>> lom = pg.logistic_regression(df['body_mass_g'], df['male'], ... remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -5.16 0.71 -7.24 0.0 -6.56 -3.77 1 body_mass_g 0.00 0.00 7.24 0.0 0.00 0.00 Body mass is a significant predictor of sex (p<0.001). Here, it could be useful to rescale our predictor variable from *g* to *kg* (e.g divide by 1000) in order to get more intuitive coefficients and confidence intervals: >>> df['body_mass_kg'] = df['body_mass_g'] / 1000 >>> lom = pg.logistic_regression(df['body_mass_kg'], df['male'], ... remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -5.16 0.71 -7.24 0.0 -6.56 -3.77 1 body_mass_kg 1.23 0.17 7.24 0.0 0.89 1.56 2. Multiple binary logistic regression We'll now add the species as a categorical predictor in our model. To do so, we first need to dummy-code our categorical variable, dropping the first level of our categorical variable (species = Adelie) which will be used as the reference level: >>> df = pd.get_dummies(df, columns=['species'], dtype=float, drop_first=True) >>> X = df[['body_mass_kg', 'species_Chinstrap', 'species_Gentoo']] >>> y = df['male'] >>> lom = pg.logistic_regression(X, y, remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -26.24 2.84 -9.24 0.00 -31.81 -20.67 1 body_mass_kg 7.10 0.77 9.23 0.00 5.59 8.61 2 species_Chinstrap -0.13 0.42 -0.31 0.75 -0.96 0.69 3 species_Gentoo -9.72 1.12 -8.65 0.00 -11.92 -7.52 3. Using NumPy aray and returning only the coefficients >>> pg.logistic_regression(X.to_numpy(), y.to_numpy(), coef_only=True, ... remove_na=True) array([-26.23906892, 7.09826571, -0.13180626, -9.71718529]) 4. Passing custom parameters to sklearn >>> lom = pg.logistic_regression(X, y, solver='sag', max_iter=10000, ... random_state=42, remove_na=True) >>> print(lom['coef'].to_numpy()) [-25.98248153 7.02881472 -0.13119779 -9.62247569] **How to interpret the log-odds coefficients?** We'll use the `Wikipedia example <https://en.wikipedia.org/wiki/Logistic_regression#Probability_of_passing_an_exam_versus_hours_of_study>`_ of the probability of passing an exam versus the hours of study: *A group of 20 students spends between 0 and 6 hours studying for an exam. How does the number of hours spent studying affect the probability of the student passing the exam?* >>> # First, let's create the dataframe >>> Hours = [0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 1.75, 2.00, 2.25, 2.50, ... 2.75, 3.00, 3.25, 3.50, 4.00, 4.25, 4.50, 4.75, 5.00, 5.50] >>> Pass = [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1] >>> df = pd.DataFrame({'HoursStudy': Hours, 'PassExam': Pass}) >>> # And then run the logistic regression >>> lr = pg.logistic_regression(df['HoursStudy'], df['PassExam']).round(3) >>> lr names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -4.078 1.761 -2.316 0.021 -7.529 -0.626 1 HoursStudy 1.505 0.629 2.393 0.017 0.272 2.737 The ``Intercept`` coefficient (-4.078) is the log-odds of ``PassExam=1`` when ``HoursStudy=0``. The odds ratio can be obtained by exponentiating the log-odds: >>> np.exp(-4.078) 0.016941314421496552 i.e. :math:`0.017:1`. Conversely the odds of failing the exam are :math:`(1/0.017) \approx 59:1`. The probability can then be obtained with the following equation .. math:: p = \frac{1}{1 + e^{-(-4.078 + 0 * 1.505)}} >>> 1 / (1 + np.exp(-(-4.078))) 0.016659087580814722 The ``HoursStudy`` coefficient (1.505) means that for each additional hour of study, the log-odds of passing the exam increase by 1.505, and the odds are multipled by :math:`e^{1.505} \approx 4.50`. For example, a student who studies 2 hours has a probability of passing the exam of 25%: >>> 1 / (1 + np.exp(-(-4.078 + 2 * 1.505))) 0.2557836148964987 The table below shows the probability of passing the exam for several values of ``HoursStudy``: +----------------+----------+----------------+------------------+ | Hours of Study | Log-odds | Odds | Probability | +================+==========+================+==================+ | 0 | −4.08 | 0.017 ≈ 1:59 | 0.017 | +----------------+----------+----------------+------------------+ | 1 | −2.57 | 0.076 ≈ 1:13 | 0.07 | +----------------+----------+----------------+------------------+ | 2 | −1.07 | 0.34 ≈ 1:3 | 0.26 | +----------------+----------+----------------+------------------+ | 3 | 0.44 | 1.55 | 0.61 | +----------------+----------+----------------+------------------+ | 4 | 1.94 | 6.96 | 0.87 | +----------------+----------+----------------+------------------+ | 5 | 3.45 | 31.4 | 0.97 | +----------------+----------+----------------+------------------+ | 6 | 4.96 | 141.4 | 0.99 | +----------------+----------+----------------+------------------+
def logistic_regression( X, y, coef_only=False, alpha=0.05, as_dataframe=True, remove_na=False, **kwargs ): """(Multiple) Binary logistic regression. Parameters ---------- X : array_like Predictor(s), of shape *(n_samples, n_features)* or *(n_samples)*. y : array_like Dependent variable, of shape *(n_samples)*. ``y`` must be binary, i.e. only contains 0 or 1. Multinomial logistic regression is not supported. coef_only : bool If True, return only the regression coefficients. alpha : float Alpha value used for the confidence intervals. :math:`\\text{CI} = [\\alpha / 2 ; 1 - \\alpha / 2]` as_dataframe : bool If True, returns a pandas DataFrame. If False, returns a dictionnary. remove_na : bool If True, apply a listwise deletion of missing values (i.e. the entire row is removed). Default is False, which will raise an error if missing values are present in either the predictor(s) or dependent variable. **kwargs : optional Optional arguments passed to :py:class:`sklearn.linear_model.LogisticRegression` (see Notes). Returns ------- stats : :py:class:`pandas.DataFrame` or dict Logistic regression summary: * ``'names'``: name of variable(s) in the model (e.g. x1, x2...) * ``'coef'``: regression coefficients (log-odds) * ``'se'``: standard error * ``'z'``: z-scores * ``'pval'``: two-tailed p-values * ``'CI[2.5%]'``: lower confidence interval * ``'CI[97.5%]'``: upper confidence interval See also -------- linear_regression Notes ----- .. caution:: This function is a wrapper around the :py:class:`sklearn.linear_model.LogisticRegression` class. However, Pingouin internally disables the L2 regularization and changes the default solver to 'newton-cg' to obtain results that are similar to R and statsmodels. Logistic regression assumes that the log-odds (the logarithm of the odds) for the value labeled "1" in the response variable is a linear combination of the predictor variables. The log-odds are given by the `logit <https://en.wikipedia.org/wiki/Logit>`_ function, which map a probability :math:`p` of the response variable being "1" from :math:`[0, 1)` to :math:`(-\\infty, +\\infty)`. .. math:: \\text{logit}(p) = \\ln \\frac{p}{1 - p} = \\beta_0 + \\beta X The odds of the response variable being "1" can be obtained by exponentiating the log-odds: .. math:: \\frac{p}{1 - p} = e^{\\beta_0 + \\beta X} and the probability of the response variable being "1" is given by the `logistic function <https://en.wikipedia.org/wiki/Logistic_function>`_: .. math:: p = \\frac{1}{1 + e^{-(\\beta_0 + \\beta X})} The first coefficient is always the constant term (intercept) of the model. Pingouin will automatically add the intercept to your predictor(s) matrix, therefore, :math:`X` should not include a constant term. Pingouin will remove any constant term (e.g column with only one unique value), or duplicate columns from :math:`X`. The calculation of the p-values and confidence interval is adapted from a `code by Rob Speare <https://gist.github.com/rspeare/77061e6e317896be29c6de9a85db301d>`_. Results have been compared against statsmodels, R, and JASP. Examples -------- 1. Simple binary logistic regression. In this first example, we'll use the `penguins dataset <https://github.com/allisonhorst/palmerpenguins>`_ to see how well we can predict the sex of penguins based on their bodies mass. >>> import numpy as np >>> import pandas as pd >>> import pingouin as pg >>> df = pg.read_dataset('penguins') >>> # Let's first convert the target variable from string to boolean: >>> df['male'] = (df['sex'] == 'male').astype(int) # male: 1, female: 0 >>> # Since there are missing values in our outcome variable, we need to >>> # set `remove_na=True` otherwise regression will fail. >>> lom = pg.logistic_regression(df['body_mass_g'], df['male'], ... remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -5.16 0.71 -7.24 0.0 -6.56 -3.77 1 body_mass_g 0.00 0.00 7.24 0.0 0.00 0.00 Body mass is a significant predictor of sex (p<0.001). Here, it could be useful to rescale our predictor variable from *g* to *kg* (e.g divide by 1000) in order to get more intuitive coefficients and confidence intervals: >>> df['body_mass_kg'] = df['body_mass_g'] / 1000 >>> lom = pg.logistic_regression(df['body_mass_kg'], df['male'], ... remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -5.16 0.71 -7.24 0.0 -6.56 -3.77 1 body_mass_kg 1.23 0.17 7.24 0.0 0.89 1.56 2. Multiple binary logistic regression We'll now add the species as a categorical predictor in our model. To do so, we first need to dummy-code our categorical variable, dropping the first level of our categorical variable (species = Adelie) which will be used as the reference level: >>> df = pd.get_dummies(df, columns=['species'], dtype=float, drop_first=True) >>> X = df[['body_mass_kg', 'species_Chinstrap', 'species_Gentoo']] >>> y = df['male'] >>> lom = pg.logistic_regression(X, y, remove_na=True) >>> lom.round(2) names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -26.24 2.84 -9.24 0.00 -31.81 -20.67 1 body_mass_kg 7.10 0.77 9.23 0.00 5.59 8.61 2 species_Chinstrap -0.13 0.42 -0.31 0.75 -0.96 0.69 3 species_Gentoo -9.72 1.12 -8.65 0.00 -11.92 -7.52 3. Using NumPy aray and returning only the coefficients >>> pg.logistic_regression(X.to_numpy(), y.to_numpy(), coef_only=True, ... remove_na=True) array([-26.23906892, 7.09826571, -0.13180626, -9.71718529]) 4. Passing custom parameters to sklearn >>> lom = pg.logistic_regression(X, y, solver='sag', max_iter=10000, ... random_state=42, remove_na=True) >>> print(lom['coef'].to_numpy()) [-25.98248153 7.02881472 -0.13119779 -9.62247569] **How to interpret the log-odds coefficients?** We'll use the `Wikipedia example <https://en.wikipedia.org/wiki/Logistic_regression#Probability_of_passing_an_exam_versus_hours_of_study>`_ of the probability of passing an exam versus the hours of study: *A group of 20 students spends between 0 and 6 hours studying for an exam. How does the number of hours spent studying affect the probability of the student passing the exam?* >>> # First, let's create the dataframe >>> Hours = [0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 1.75, 2.00, 2.25, 2.50, ... 2.75, 3.00, 3.25, 3.50, 4.00, 4.25, 4.50, 4.75, 5.00, 5.50] >>> Pass = [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1] >>> df = pd.DataFrame({'HoursStudy': Hours, 'PassExam': Pass}) >>> # And then run the logistic regression >>> lr = pg.logistic_regression(df['HoursStudy'], df['PassExam']).round(3) >>> lr names coef se z pval CI[2.5%] CI[97.5%] 0 Intercept -4.078 1.761 -2.316 0.021 -7.529 -0.626 1 HoursStudy 1.505 0.629 2.393 0.017 0.272 2.737 The ``Intercept`` coefficient (-4.078) is the log-odds of ``PassExam=1`` when ``HoursStudy=0``. The odds ratio can be obtained by exponentiating the log-odds: >>> np.exp(-4.078) 0.016941314421496552 i.e. :math:`0.017:1`. Conversely the odds of failing the exam are :math:`(1/0.017) \\approx 59:1`. The probability can then be obtained with the following equation .. math:: p = \\frac{1}{1 + e^{-(-4.078 + 0 * 1.505)}} >>> 1 / (1 +
(X, y, coef_only=False, alpha=0.05, as_dataframe=True, remove_na=False, **kwargs)
[ -0.010167480446398258, 0.031836431473493576, 0.0718785896897316, 0.009702264331281185, 0.047620128840208054, -0.0822366401553154, -0.07429995387792587, -0.025558825582265854, 0.015111095272004604, 0.03589445725083351, 0.018631039187312126, -0.001894491957500577, 0.026096906512975693, 0.05466001480817795, -0.04649912565946579, 0.0004119679215364158, -0.02356344275176525, -0.06636326760053635, -0.013765893876552582, -0.024527505040168762, 0.0015119502786546946, 0.04486246407032013, 0.016041526570916176, 0.05488421395421028, -0.040131840854883194, -0.05291125178337097, -0.02198283188045025, -0.002083660801872611, 0.024280885234475136, -0.0018678681226447225, 0.02477412484586239, -0.08510640263557434, -0.054435815662145615, -0.06093762069940567, -0.06304510682821274, -0.027733568102121353, 0.02015559934079647, 0.015548286028206348, -0.02309262380003929, -0.005400422960519791, -0.04448132589459419, -0.0004515532637014985, -0.0250655859708786, 0.010520595125854015, -0.07833556085824966, -0.038158878684043884, -0.019370898604393005, 0.06936755031347275, 0.016859857365489006, -0.02614174596965313, -0.0018804793944582343, -0.021198131144046783, 0.029504749923944473, -0.008530818857252598, 0.016927117481827736, 0.004671772010624409, 0.016254516318440437, 0.03129835054278374, 0.06676682829856873, -0.0651974231004715, 0.025648506358265877, 0.016994377598166466, 0.0065802764147520065, 0.0020332157146185637, 0.04623008519411087, -0.01928121969103813, -0.017207367345690727, 0.027823247015476227, 0.047082047909498215, -0.04226174205541611, -0.027419688180088997, -0.015290454961359501, 0.022789953276515007, 0.04008699953556061, -0.057978179305791855, 0.04488488659262657, -0.01790238730609417, 0.004223371855914593, -0.002794095315039158, 0.04441406577825546, -0.014797214418649673, -0.005459275562316179, 0.004750242456793785, -0.007297717500478029, -0.029728949069976807, -0.07026434689760208, -0.02185952104628086, -0.01467390451580286, 0.028204388916492462, 0.032172732055187225, -0.07815619558095932, 0.015884585678577423, 0.05398741364479065, -0.001872071879915893, 0.028563108295202255, -0.0184628888964653, -0.02055916003882885, 0.08918684720993042, 0.022846002131700516, 0.011277271434664726, -0.04515392705798149, 0.04371904209256172, -0.04726140573620796, 0.09008365124464035, -0.070533387362957, -0.029325390234589577, -0.05174541100859642, 0.022588172927498817, 0.07573483884334564, -0.03880905732512474, -0.13254716992378235, -0.01736430823802948, 0.017924807965755463, -0.07631775736808777, 0.010442125611007214, -0.007174407131969929, -0.06322446465492249, 0.023608284071087837, -0.08627224713563919, 0.036387696862220764, 0.03833824023604393, 0.00029829138657078147, -0.0381140373647213, 0.0026539701502770185, 0.020323749631643295, 0.0017697805305942893, -0.007695672567933798, -0.03723965585231781, 0.015043835155665874, -0.04001973941922188, -0.02369796298444271, 0.00011052370246034116, 0.024213625118136406, 0.06569066643714905, 0.02008833922445774, -0.01640024594962597, -0.02620900608599186, 0.001596025307662785, 0.0769006758928299, -0.0053555830381810665, 0.013765893876552582, -0.0014559002593159676, -0.025379465892910957, -0.024729285389184952, 0.07515191286802292, 0.025693345814943314, 0.07362735271453857, 0.017992068082094193, -0.02717306651175022, -0.029392650350928307, 0.04569200426340103, -0.09169789403676987, -0.003536758478730917, -0.07864943891763687, 0.010599065572023392, -0.007398607209324837, -0.020985141396522522, -0.03430263325572014, 0.033742133527994156, -0.0412752628326416, -0.0018384418217465281, -0.04775464907288551, 0.008979219011962414, 0.03179159015417099, 0.005666660610586405, 0.007919873110949993, 0.005778760649263859, 0.0198865607380867, 0.010206715203821659, -0.022319132462143898, -0.017790287733078003, 0.003632043721154332, 0.017992068082094193, 0.012891513295471668, -0.001907103112898767, 0.011927451938390732, -0.007987133227288723, 0.003424658440053463, -0.01092976052314043, 0.01310450304299593, 0.03916778042912483, 0.023204723373055458, -0.05309061333537102, 0.03219515085220337, -0.02083941176533699, 0.010912945494055748, 0.012600052170455456, -0.01494294498115778, -0.06004082038998604, 0.0387866385281086, -0.014931734651327133, -0.023608284071087837, 0.04526602476835251, -0.051924772560596466, 0.0250655859708786, 0.02831648848950863, 0.012869092635810375, -0.03560299426317215, -0.0031303956639021635, -0.02123176120221615, 0.03331615403294563, 0.04452616348862648, -0.00014240217569749802, -0.011019441299140453, -0.05959241837263107, 0.026253845542669296, -0.04860660806298256, 0.03167949244379997, -0.051924772560596466, -0.06699102371931076, 0.040759600698947906, 0.004385916981846094, -0.03764321655035019, 0.05887497961521149, 0.009001638740301132, -0.012555212713778019, 0.0260744858533144, -0.009382779709994793, -0.012566423043608665, -0.025513986125588417, 0.01783512718975544, -0.061116982251405716, -0.05959241837263107, 0.005268705077469349, 0.04167882353067398, 0.0020514321513473988, 0.03239693120121956, 0.028921829536557198, 0.028563108295202255, -0.041297681629657745, 0.028787309303879738, -0.0016380628803744912, 0.05335965380072594, -0.05519809573888779, -0.024258464574813843, 0.03188127279281616, 0.013003612868487835, 0.020525529980659485, -0.01803690753877163, 0.021478381007909775, 0.009769524447619915, -0.01089052576571703, 0.004573684651404619, 0.04555748403072357, 0.006406521424651146, -0.010638300329446793, 0.020873041823506355, 0.013709844090044498, -0.008323433808982372, -0.038921158760786057, -0.0157164353877306, 0.019830510020256042, 0.0009682647068984807, -0.01784633845090866, 0.003217273158952594, -0.08035335689783096, 0.040266361087560654, 0.018496518954634666, 0.013810734264552593, -0.06273122131824493, -0.03569267690181732, -0.03867453709244728, -0.059144020080566406, -0.02035737968981266, -0.015099884942173958, 0.0007559751393273473, -0.024975905194878578, -0.016579607501626015, 0.08376120030879974, 0.02300294302403927, 0.010133850388228893, 0.04506424441933632, -0.01626572571694851, -0.02620900608599186, 0.027733568102121353, -0.009068898856639862, 0.05241801217198372, -0.03199337050318718, 0.027800828218460083, 0.0775732770562172, -0.029504749923944473, -0.038091618567705154, 0.029302969574928284, 0.0038842689245939255, -0.0019183132098987699, -0.0024115536361932755, -0.037441436201334, 0.025155264884233475, 0.023810064420104027, -0.005369595251977444, 0.022083722054958344, 0.03315921500325203, 0.017263418063521385, 0.04418986290693283, 0.02600722573697567, 0.0330919548869133, 0.014427284710109234, -0.014079773798584938, 0.032979853451251984, -0.02941506914794445, 0.015951845794916153, 0.04100622236728668, 0.07815619558095932, -0.09757193922996521, -0.043943244963884354, -0.03235209360718727, 0.04663364589214325, -0.06869494915008545, -0.03988521918654442, 0.028787309303879738, 0.03365245461463928, 0.09362601488828659, -0.0036404512356966734, -0.0033994358964264393, -0.03914535790681839, -0.05537745729088783, 0.03800193965435028, 0.0095677450299263, 0.03990764170885086, 0.019830510020256042, -0.00682689668610692, 0.00028708137688227, 0.07770779728889465, -0.04336032271385193, 0.057709138840436935, 0.001872071879915893, 0.069188192486763, -0.00028025027131661773, 0.0172185767441988, 0.012005922384560108, -0.0282492283731699, -0.0051033576019108295, 0.046409446746110916, 0.005958120804280043, 0.0018902882002294064, 0.012756993062794209, -0.015850955620408058, -0.031836431473493576, -0.0009577553137205541, -0.0322624109685421, -0.037284497171640396, -0.0568123385310173, -0.007101542316377163, 0.02560366503894329, 0.04174608364701271, -0.053000934422016144, 0.010991415940225124, 0.05398741364479065, 0.009618189185857773, 0.03921261802315712, 0.012689732946455479, 0.017106477171182632, 0.04569200426340103, 0.04699236527085304, -0.032778073102235794, -0.003811403876170516, 0.01756608672440052, -0.0130372429266572, 0.047082047909498215, 0.004013183992356062, -0.03228483349084854, -0.001594624132849276, -0.004674574825912714, -0.008116047829389572, 0.020783361047506332, 0.029504749923944473, 0.01270094234496355, 0.04066992178559303, 0.06143086031079292, -0.005529338028281927, 0.02329440414905548, 0.0036993036046624184, -0.06237250193953514, 0.08882813155651093, -0.024348143488168716, 0.02560366503894329, 0.035446055233478546, -0.04717172682285309, -0.043270643800497055, 0.015850955620408058, -0.0302446112036705, -0.04445890337228775, -0.04445890337228775, 0.026298686861991882, -0.01323902327567339, 0.017061637714505196, 0.05524293705821037, -0.03880905732512474, -0.004046814050525427, -0.03098447062075138, 0.02717306651175022, -0.05869561806321144, 0.00041091698221862316, -0.006854922045022249, -0.020413430407643318, -0.01564917527139187, 0.0297513697296381, 0.03522185608744621, -0.040131840854883194, -0.015245615504682064, -0.00881106872111559, 0.007342557422816753, -0.019494209438562393, -0.05999597907066345, -0.10340114682912827, 0.052328333258628845, -0.024392984807491302, -0.02553640492260456, -0.04383114352822304, 0.00010272924555465579, -0.010049775242805481, 0.0905768871307373, -0.007264087442308664, -0.06537678837776184, -0.0070510972291231155, 0.02015559934079647, 0.03717239573597908, -0.006260791327804327, 0.016792597249150276, 0.03147771209478378, 0.07645227760076523, -0.030468810349702835, -0.01143981609493494, 0.055601656436920166, 0.02281237207353115, 0.04860660806298256, -0.030177351087331772, -0.009831179864704609, 0.008726993575692177, 0.011322110891342163, -0.026657406240701675, -0.006115061230957508, -0.035446055233478546, 0.002361108548939228, 0.012801832519471645, -0.051297012716531754, -0.026859186589717865, 0.04540054500102997, -0.057978179305791855, 0.03479587659239769, 0.011030650697648525, 0.012869092635810375, 0.0788736417889595, 0.04499698430299759, -0.0010558429639786482, -0.017453987151384354, -0.018743138760328293, -0.031096572056412697, -0.040759600698947906, -0.034078434109687805, 0.09900681674480438, 0.030491231009364128, 0.08017399907112122, 0.08595836907625198, -0.04389840364456177, 0.018877658993005753, -0.03423537313938141, -0.043068863451480865, 0.03439231589436531, 0.019774459302425385, -0.003180840751156211, 0.03818129748106003, -0.03495281562209129, 0.022296711802482605, -0.014864474534988403, -0.037441436201334, 0.044974565505981445, -0.03737417608499527, -0.007914267480373383, 0.027890507131814957, 0.06268638372421265, -0.012846672907471657, 0.00582360103726387, -0.05040020868182182, -0.02430330403149128, 0.06591486930847168, 0.0017978055402636528, 0.016579607501626015, 0.01430397480726242, 0.0005184630281291902, -0.005484498105943203, -0.0427774041891098, 0.03228483349084854, 0.007505102548748255, 0.018294738605618477, -0.022576963528990746, -0.004856737330555916, -0.0075331274420022964, 0.002404547296464443, -0.0076059927232563496, -0.02104119025170803, 0.012409482151269913, 0.003937516361474991, 0.04309128224849701, -0.05721589922904968, 0.009758315049111843, 0.021680161356925964, -0.05847141891717911, -0.01487568486481905, 0.001384436385706067, -0.00665314169600606, 0.0054368553683161736, -0.03647737577557564, -0.04726140573620796, 0.009831179864704609, -0.00841311365365982, 0.04416744410991669, 0.025491565465927124, -0.03914535790681839, -0.009113739244639874, -0.041633982211351395, 0.005125777795910835, -0.008054393343627453, -0.014516964554786682, -0.019920190796256065, 0.0369257777929306, 0.03786741942167282, 0.02437056414783001, 0.016321776434779167, -0.010683140717446804, 0.05084861069917679, 0.030827531591057777, 0.05201445147395134, -0.01994260959327221, 0.032912593334913254, 0.007465867325663567, 0.020267700776457787, -0.018339578062295914, 0.00015387492021545768, 0.01633298583328724, 0.002150920918211341, -0.03313679248094559, -0.0198865607380867, 0.0406026616692543, -0.023047782480716705, -0.013474433682858944, -0.02050311118364334, -0.07358251512050629, 0.00645136134698987, -0.029302969574928284, -0.03098447062075138, -0.01310450304299593, -0.004156111739575863, 0.019774459302425385, -0.00777974771335721, -0.014528174884617329, 0.004509226884692907, 0.03199337050318718, -0.03228483349084854, -0.017039217054843903, -0.009270679205656052, -0.028720049187541008, -0.05367353558540344, -0.0005135586252436042, 0.04488488659262657, 0.019774459302425385, 0.010526200756430626, 0.06039953976869583, -0.041163161396980286, 0.021949201822280884, -0.015279245562851429, -0.08196759968996048, 0.043674204498529434, -0.060085661709308624, 0.0008491583284921944, 0.017891177907586098, 0.0213887020945549, 0.08394056558609009, -0.06847074627876282, -0.01823868788778782, -0.00969665963202715, 0.036387696862220764, -0.02211735211312771, 0.027890507131814957, 0.009410804137587547, 0.030177351087331772, 0.007073516957461834, 0.007841402664780617, -0.03423537313938141, 0.04901016876101494, -0.025020744651556015, 0.01994260959327221, -0.034011173993349075, -0.04405534267425537, 0.031208671629428864, 0.045848947018384933, -0.01925879903137684, 0.06291058659553528, -0.01859740912914276, 0.03921261802315712, -0.05017600953578949, 0.01933726854622364, -0.0041364943608641624, -0.046543966978788376, -0.004699797369539738, 0.05353901535272598, 0.017061637714505196, 0.0027576626744121313, 0.03315921500325203, 0.06968142837285995, -0.009108134545385838, -0.020178020000457764, -0.0026960077229887247, -0.047216568142175674, -0.009847994893789291, -0.00974150002002716, 0.025379465892910957, 0.006776451598852873, 0.014797214418649673, -0.05461517348885536, -0.010122640058398247, 0.007465867325663567, -0.034818295389413834, 0.021568061783909798, -0.013743474148213863, -0.007353767286986113, -0.02470686472952366, 0.02771114744246006, 0.04459342360496521, 0.002483017509803176, -0.010711166076362133, -0.030536070466041565, 0.005658253096044064, 0.03943682089447975, -0.016736546531319618, -0.04587136581540108, -0.013003612868487835, -0.046409446746110916, -0.0011875606141984463, 0.019314849749207497, -0.008755018934607506, 0.07147502899169922, -0.008244963362812996, 0.01777907833456993, 0.025424305349588394, 0.002195760840550065, 0.004610117059201002, -0.047485608607530594, 0.02593996562063694, 0.03253145143389702, -0.09882745891809464, 0.0010264166630804539, 0.006950207054615021, -0.04349484294652939, 0.015312875621020794, 0.01879918947815895, -0.01960630901157856, -0.01069435104727745, 0.07048854976892471, -0.046947527676820755, 0.00665314169600606, -0.003124790731817484, -0.016512347385287285, -0.021803472191095352, -0.03201579302549362, 0.010716770775616169, -0.03369729220867157, 0.06672198325395584, -0.01000493485480547, -0.008844698779284954, -0.003270520828664303, -0.03259871155023575, 0.08802101016044617, 0.02934780903160572, 0.02724032662808895, 0.03730691596865654, -0.0012562219053506851, -0.013597743585705757, 0.03235209360718727, -0.0076396227814257145, -0.001575006521306932, 0.003136000595986843, 0.029302969574928284, 0.037284497171640396, 0.04423470422625542, 0.005773155950009823, -0.006972626782953739, 0.04896532744169235, -0.014147033914923668, 0.006042195949703455, 0.06120666116476059, 0.07515191286802292, 0.0352666936814785, -0.05125217139720917, 0.059323377907276154, -0.008071208372712135, 0.019438158720731735, -0.012656102888286114, -0.0005062020500190556, -0.034481994807720184, -0.04140978306531906, -0.02840616926550865, -0.016187256202101707, 0.02954958938062191, 0.03694819658994675, -0.03533395379781723, -0.07098179310560226, 0.025110425427556038, 0.004032801371067762, 0.006002961192280054, -0.02981862984597683, -0.012061972171068192, 0.01246553286910057, 0.11084458976984024, -0.030110090970993042, -0.0081048384308815, 0.003867453895509243, 0.0017557679675519466, 0.007488287519663572, -0.10761610418558121, -0.027868088334798813, 0.052193813025951385, 0.044974565505981445, -0.010223530232906342, 0.01898975856602192, 0.018541358411312103, -0.04757528752088547, -0.00682689668610692, -0.07725939899682999, 0.004705402068793774, 0.05367353558540344, -0.009859205223619938, 0.04631976783275604, -0.004265409428626299, -0.01221891213208437, -0.07573483884334564, 0.02573818527162075, -0.021545641124248505, 0.02470686472952366, -0.041633982211351395, 0.009859205223619938, 0.021220551803708076, -0.04999665170907974, -0.016176046803593636, -0.021825890988111496, -0.04950340837240219, -0.08317828178405762, -0.05847141891717911, 0.009948885068297386, 0.0008274389547295868, -0.03286775201559067, -0.0073873973451554775, 0.03313679248094559, -0.022633012384176254, 0.00619913637638092, 0.03847275674343109, 0.025244945660233498, 0.005392015445977449, 0.0042177666909992695, -0.04071475937962532, 0.020245280116796494, -0.05398741364479065, -0.0011455230414867401, 0.00148532644379884, 0.07833556085824966, 0.03365245461463928, 0.01953904889523983, 0.009595769457519054, -0.01599668525159359, -0.003458288498222828, 0.015682805329561234, -0.027666307985782623, 0.015167145058512688, 0.0033966333139687777, 0.0025558825582265854, 0.014281554147601128, -0.03719481825828552, 0.03887631744146347 ]
32,018
pingouin.nonparametric
mad
Median Absolute Deviation (MAD) along given axis of an array. Parameters ---------- a : array-like Input array. normalize : boolean. If True, scale by a normalization constant :math:`c \approx 0.67` to ensure consistency with the standard deviation for normally distributed data. axis : int or None, optional Axis along which the MAD is computed. Default is 0. Can also be None to compute the MAD over the entire array. Returns ------- mad : float mad = median(abs(a - median(a))) / c See also -------- madmedianrule, numpy.std Notes ----- The `median absolute deviation <https://en.wikipedia.org/wiki/Median_absolute_deviation>`_ (MAD) computes the median over the absolute deviations from the median. It is a measure of dispersion similar to the standard deviation, but is more robust to outliers. SciPy 1.3 and higher includes a similar function: :py:func:`scipy.stats.median_abs_deviation`. Please note that missing values are automatically removed. Examples -------- >>> from pingouin import mad >>> a = [1.2, 5.4, 3.2, 7.8, 2.5] >>> mad(a) 2.965204437011204 >>> mad(a, normalize=False) 2.0 2D arrays with missing values (axis handling example) >>> import numpy as np >>> np.random.seed(123) >>> w = np.random.normal(size=(5, 10)) >>> w[3, 2] = np.nan >>> mad(w) # Axis = 0 (default) = iterate over the columns array([0.60304023, 2.35057834, 0.90350696, 1.28599837, 1.16024152, 0.38653752, 1.92564066, 1.2480913 , 0.42580373, 1.69814622]) >>> mad(w, axis=1) # Axis = 1 = iterate over the rows array([1.32639022, 1.19295036, 1.41198672, 0.78020689, 1.01531254]) >>> mad(w, axis=None) # Axis = None = over the entire array 1.1607762457644006 Compare with Scipy >= 1.3 >>> from scipy.stats import median_abs_deviation >>> median_abs_deviation(w, scale='normal', axis=None, nan_policy='omit') 1.1607762457644006
def mad(a, normalize=True, axis=0): """ Median Absolute Deviation (MAD) along given axis of an array. Parameters ---------- a : array-like Input array. normalize : boolean. If True, scale by a normalization constant :math:`c \\approx 0.67` to ensure consistency with the standard deviation for normally distributed data. axis : int or None, optional Axis along which the MAD is computed. Default is 0. Can also be None to compute the MAD over the entire array. Returns ------- mad : float mad = median(abs(a - median(a))) / c See also -------- madmedianrule, numpy.std Notes ----- The `median absolute deviation <https://en.wikipedia.org/wiki/Median_absolute_deviation>`_ (MAD) computes the median over the absolute deviations from the median. It is a measure of dispersion similar to the standard deviation, but is more robust to outliers. SciPy 1.3 and higher includes a similar function: :py:func:`scipy.stats.median_abs_deviation`. Please note that missing values are automatically removed. Examples -------- >>> from pingouin import mad >>> a = [1.2, 5.4, 3.2, 7.8, 2.5] >>> mad(a) 2.965204437011204 >>> mad(a, normalize=False) 2.0 2D arrays with missing values (axis handling example) >>> import numpy as np >>> np.random.seed(123) >>> w = np.random.normal(size=(5, 10)) >>> w[3, 2] = np.nan >>> mad(w) # Axis = 0 (default) = iterate over the columns array([0.60304023, 2.35057834, 0.90350696, 1.28599837, 1.16024152, 0.38653752, 1.92564066, 1.2480913 , 0.42580373, 1.69814622]) >>> mad(w, axis=1) # Axis = 1 = iterate over the rows array([1.32639022, 1.19295036, 1.41198672, 0.78020689, 1.01531254]) >>> mad(w, axis=None) # Axis = None = over the entire array 1.1607762457644006 Compare with Scipy >= 1.3 >>> from scipy.stats import median_abs_deviation >>> median_abs_deviation(w, scale='normal', axis=None, nan_policy='omit') 1.1607762457644006 """ a = np.asarray(a) if axis is None: # Calculate the MAD over the entire array a = np.ravel(a) axis = 0 c = scipy.stats.norm.ppf(3 / 4.0) if normalize else 1 center = np.apply_over_axes(np.nanmedian, a, axis) return np.nanmedian((np.fabs(a - center)) / c, axis=axis)
(a, normalize=True, axis=0)
[ -0.024505946785211563, 0.06081105396151543, 0.02781500667333603, 0.006707936059683561, 0.06081105396151543, -0.01012572180479765, 0.02193433605134487, -0.0289684496819973, -0.012735150754451752, 0.05566783249378204, -0.04428466781973839, 0.03367676958441734, 0.020270351320505142, -0.01837000623345375, -0.01772710308432579, 0.06481974571943283, 0.01762310415506363, 0.13289181888103485, -0.012413699179887772, 0.027682645246386528, 0.01845509558916092, -0.004762681666761637, -0.05392821133136749, -0.008797370828688145, -0.030405526980757713, 0.01683838479220867, 0.019967809319496155, -0.028609180822968483, -0.010201357305049896, -0.012328609824180603, 0.04973043501377106, -0.015401307493448257, 0.02923317439854145, -0.005450493190437555, 0.02148052118718624, -0.014975856989622116, 0.03414949029684067, -0.020024536177515984, -0.17547468841075897, 0.008565736003220081, 0.018388915807008743, -0.007776289246976376, 0.04341485723853111, 0.02051616832613945, 0.03639965131878853, 0.05249113589525223, 0.05948743224143982, 0.032788049429655075, -0.059638701379299164, 0.026510292664170265, -0.016129299998283386, 0.004727227613329887, 0.04065415635704994, 0.01496640220284462, 0.004219050519168377, 0.0530962198972702, 0.006263576447963715, -0.05332312732934952, 0.010617353022098541, -0.02751246467232704, 0.018039099872112274, 0.009081004187464714, 0.06160522997379303, -0.0525667704641819, -0.012451517395675182, 0.03532184287905693, -0.010853714309632778, -0.002331705065444112, -0.03813927248120308, 0.007918106392025948, -0.020667439326643944, -0.03806363418698311, 0.022331422194838524, 0.010447172448039055, 0.058617621660232544, 0.016904566437005997, 0.03910362720489502, -0.02832554653286934, -0.005199950188398361, -0.011524980887770653, 0.006079214625060558, 0.039254896342754364, -0.008215920999646187, 0.0023352503776550293, -0.006509392522275448, -0.02327686920762062, -0.04107015207409859, 0.0260186605155468, 0.020610712468624115, 0.0075352005660533905, 0.022217968478798866, -0.04723445698618889, 0.06595427542924881, 0.0981750637292862, -0.07684580981731415, 0.034527670592069626, -0.03556765988469124, 0.017178744077682495, 0.02537575736641884, -0.0038408723194152117, -0.00817810371518135, 0.05377693846821785, 0.08214030414819717, 0.031502243131399155, -0.009289002045989037, 0.002342341234907508, 0.02134815976023674, -0.029894987121224403, -0.0023482502438127995, 0.03129424527287483, -0.04065415635704994, -0.05441984161734581, -0.03917926177382469, -0.011090075597167015, 0.010333719663321972, -0.027966277673840523, 0.028665907680988312, 0.04401994124054909, -0.03615383431315422, -0.002933244686573744, -0.013604960404336452, -0.025470301508903503, -0.012300246395170689, -0.09620853513479233, 0.020686347037553787, -0.04481411725282669, 0.04352831095457077, -0.048368990421295166, -0.0346033051609993, 0.03795018419623375, -0.03588911145925522, -0.006268303841352463, 0.016110392287373543, 0.004807590506970882, -0.002376613672822714, -0.004124505911022425, 0.08440937101840973, -0.005507220048457384, -0.02904408611357212, -0.019457267597317696, -0.012290791608393192, 0.00953481812030077, -0.007388656493276358, 0.010399900376796722, 0.00161434814799577, 0.023409230634570122, 0.005634855013340712, -0.001408713753335178, 0.03787454590201378, -0.013406417332589626, -0.07177822291851044, -0.04299886152148247, 0.04390648752450943, 0.002068161964416504, 0.05513838306069374, -0.029762623831629753, 0.014228954911231995, 0.0012538970913738012, -0.08766170591115952, 0.012356972321867943, -0.023560501635074615, -0.011865341104567051, -0.025678299367427826, 0.023957589641213417, -0.03148333355784416, 0.020667439326643944, -0.0014985310845077038, 0.04432248696684837, -0.02505430579185486, -0.004783954471349716, 0.005563946906477213, 0.01992999203503132, -0.036059290170669556, 0.007294111885130405, -0.019759811460971832, 0.03065134398639202, -0.009128276258707047, 0.02789064310491085, 0.0005161541630513966, -0.04825553670525551, 0.0033350589219480753, 0.05377693846821785, -0.01797291822731495, -0.04802863299846649, -0.050222065299749374, 0.02756919153034687, -0.0007563563995063305, -0.0045074112713336945, -0.013746777549386024, 0.02276632748544216, 0.006296667270362377, -0.01901290938258171, 0.007922833785414696, -0.01458822377026081, 0.015259490348398685, -0.01275405939668417, -0.022993234917521477, 0.0203838050365448, 0.11073058098554611, -0.055100563913583755, -0.007691198959946632, 0.03070807084441185, 0.024789581075310707, 0.011610071174800396, 0.03186151385307312, 0.046818461269140244, -0.032788049429655075, 0.010551171377301216, -0.08410683274269104, -0.0012680788058787584, -0.017708193510770798, -0.021764155477285385, 0.016299480572342873, 0.0101919025182724, 0.024316858500242233, 0.018199825659394264, 0.08032505214214325, -0.05071369558572769, 0.07412292808294296, 0.02859027124941349, -0.029819350689649582, -0.01906963624060154, 0.0005716990563087165, 0.06122704967856407, 0.02781500667333603, 0.015647122636437416, 0.012858059257268906, -0.004219050519168377, 0.047461364418268204, -0.02577284537255764, -0.006358121056109667, -0.0028387000784277916, -0.03518948331475258, -0.036002565175294876, 0.03373349457979202, -0.02564048208296299, -0.0071995677426457405, -0.021631794050335884, 0.04057852178812027, -0.022671783342957497, -0.0022017061710357666, -0.02717210352420807, -0.019381633028388023, 0.06788298487663269, -0.02711537666618824, -0.06058414652943611, -0.05324748903512955, 0.04269631952047348, 0.03252332657575607, -0.016743840649724007, -0.06186995282769203, 0.00480049941688776, 0.05600818991661072, -0.0001882027427200228, 0.01695183850824833, 0.03821490705013275, -0.006017760839313269, 0.06689972430467606, 0.023125596344470978, -0.042734138667583466, 0.06557609885931015, -0.08872060477733612, 0.03380913287401199, 0.0016698931576684117, -0.058693256229162216, 0.008821006864309311, 0.047083187848329544, -0.02301214449107647, 0.03607819974422455, 0.013803504407405853, 0.017906738445162773, 0.025224486365914345, -0.02070525661110878, -0.10936913639307022, 0.023730682209134102, 0.039897799491882324, 0.06043287739157677, -0.03263678029179573, -0.005474129691720009, 0.03524620831012726, -0.010012268088757992, -0.0764298141002655, -0.03706146404147148, 0.05585692077875137, -0.030934976413846016, 0.001387441297993064, 0.00857046339660883, -0.008230103179812431, 0.020156897604465485, 0.07071932405233383, 0.011874795891344547, -0.02172633819282055, -0.02998953126370907, -0.012035521678626537, -0.059903427958488464, 0.002741792006418109, -0.0552518367767334, -0.042280323803424835, -0.047801725566387177, -0.03492475673556328, -0.028703724965453148, 0.013604960404336452, -0.03936835005879402, 0.0410323366522789, -0.005261404439806938, 0.02435467578470707, -0.004512138664722443, -0.037647638469934464, 0.05585692077875137, -0.023239050060510635, -0.03051898069679737, 0.004145778715610504, -0.05615946277976036, 0.029838260263204575, 0.025281213223934174, 0.0008526736637577415, 0.020799800753593445, -0.014266773127019405, 0.04031379520893097, 0.05389039218425751, 0.02641574665904045, 0.019107453525066376, 0.0008042195695452392, 0.0055450377985835075, 0.003902326337993145, -0.005748308729380369, -0.018653640523552895, 0.008310466073453426, 0.06633245944976807, -0.013548234477639198, -0.05483584105968475, -0.052339863032102585, -0.005701036192476749, 0.004762681666761637, 0.031766969710588455, -0.05128096416592598, 0.015996938571333885, -0.03199387714266777, 0.012451517395675182, -0.02647247351706028, -0.04095669835805893, 0.016970746219158173, 0.024562673643231392, 0.004372685682028532, 0.021707428619265556, -0.014124955981969833, 0.03148333355784416, -0.016318390145897865, 0.029308810830116272, 0.0359458364546299, 0.04549483582377434, 0.0027228831313550472, -0.00298051699064672, 0.016583114862442017, 0.04436030238866806, -0.005771944765001535, 0.0005770171992480755, 0.020743073895573616, -0.034716758877038956, -0.03239096328616142, -0.0313887894153595, 0.025924116373062134, -0.012224609963595867, -0.025148849934339523, 0.03978434577584267, -0.01888054609298706, -0.07083277404308319, -0.03422512859106064, -0.023768499493598938, 0.004892680328339338, 0.0087831886485219, -0.05680236592888832, -0.013349690474569798, -0.007440655957907438, -0.007279930170625448, 0.011430435813963413, 0.022860871627926826, -0.01458822377026081, -0.00894391443580389, 0.05071369558572769, -0.0035099664237350225, -0.010664625093340874, -0.03691019117832184, -0.0042521413415670395, 0.01551476027816534, 0.0055450377985835075, -0.005871216766536236, 0.012933694757521152, -0.07090841233730316, -0.006547210272401571, -0.016450751572847366, -0.029516808688640594, -0.058693256229162216, 0.023995406925678253, -0.08826678991317749, 0.026132114231586456, -0.010040631517767906, -0.022009970620274544, -0.0769592672586441, -0.03006516769528389, 0.0025645210407674313, -0.020345987752079964, 0.01448422484099865, 0.03583238646388054, -0.06398775428533554, -0.04091888293623924, -0.07382038235664368, 0.0033988766372203827, 0.01912636309862137, 0.0831235721707344, 0.03787454590201378, -0.0038739629089832306, 0.026075387373566628, 0.0277582798153162, 0.08486318588256836, 0.034338582307100296, -0.03312841057777405, -0.02148052118718624, -0.04069197550415993, -0.03089715912938118, 0.029838260263204575, -0.08229157328605652, -0.0035123301204293966, 0.023579411208629608, 0.005233041010797024, -0.07593818008899689, -0.032788049429655075, -0.06557609885931015, -0.055743467062711716, -0.047726087272167206, 0.02634011209011078, 0.017424561083316803, -0.07090841233730316, -0.033241864293813705, -0.008102468214929104, 0.02095107175409794, -0.06043287739157677, 0.03188042342662811, 0.022917598485946655, -0.027020832523703575, -0.024279041215777397, 0.04088106378912926, 0.015136582776904106, -0.023182323202490807, -0.03840399533510208, 0.006126486696302891, 0.033884767442941666, -0.003944871481508017, 0.02539466693997383, -0.045873016119003296, 0.034262944012880325, -0.030348800122737885, 0.07253457605838776, -0.018842728808522224, 0.023881953209638596, -0.07586254924535751, -0.016100937500596046, -0.022350331768393517, 0.061189234256744385, 0.04538138583302498, -0.029497899115085602, 0.02550811879336834, -0.0761650875210762, -0.07828288525342941, -0.007984287105500698, 0.14310263097286224, 0.02410886064171791, 0.031048430129885674, 0.022936508059501648, 0.01375623233616352, 0.08645153790712357, 0.03303386643528938, -0.015524215064942837, 0.0025550664868205786, 0.009676634334027767, -0.025224486365914345, -0.019835446029901505, -0.008485373109579086, 0.04409557953476906, 0.04148614779114723, 0.025791753083467484, -0.03524620831012726, 0.013661687262356281, 0.0005947442841716111, 0.006027215160429478, 0.019911082461476326, -0.03575674816966057, -0.02891172282397747, 0.06338267028331757, -0.023863043636083603, 0.05744526907801628, 0.024921944364905357, 0.05320967361330986, -0.029951713979244232, -0.04886062443256378, -0.057483088225126266, 0.06145395711064339, 0.0076770177111029625, 0.07994687557220459, -0.07385820150375366, -0.005559219513088465, -0.0439821258187294, -0.023125596344470978, -0.0415617860853672, -0.00671739038079977, 0.01343478076159954, -0.04980606958270073, 0.016233298927545547, -0.02947899140417576, -0.02057289332151413, -0.03180478513240814, 0.009879905730485916, -0.006528301164507866, 0.04927662014961243, 0.02083761803805828, 0.012196247465908527, -0.07310184836387634, 0.00537013029679656, 0.03358222544193268, -0.01992999203503132, 0.016261663287878036, -0.01551476027816534, -0.06440375000238419, 0.046629372984170914, -0.02800409495830536, -0.000927127490285784, -0.059260524809360504, 0.02371177263557911, -0.035284027457237244, 0.02397649735212326, 0.001364986994303763, 0.01512712799012661, 0.0015765303978696465, 0.01400204747915268, -0.007506837137043476, 0.015354035422205925, 0.003060879884287715, -0.027323374524712563, -0.0012042612070217729, 0.04761263728141785, 0.013132237829267979, -0.02794736996293068, 0.003992143552750349, -0.017169291153550148, 0.023768499493598938, 0.013321327045559883, -0.03959525749087334, 0.012640606611967087, 0.050675880163908005, -0.0018152553820982575, 0.0248084906488657, -0.030802614986896515, -0.01560930535197258, 0.017746012657880783, 0.015675486996769905, -0.015174400061368942, 0.0019972536247223616, -0.0008698098827153444, -0.03757200390100479, -0.03390367701649666, -0.017935100942850113, -0.0156849417835474, 0.05120532959699631, -0.014049320481717587, -0.022293604910373688, 0.03524620831012726, -0.0021910700015723705, -0.02749355509877205, -0.03252332657575607, -0.013151147402822971, -0.06349612027406693, 0.016753293573856354, -0.017689285799860954, 0.00012253860768396407, -0.00927954725921154, 0.07552218437194824, 0.04322576895356178, -0.022009970620274544, -0.01327405497431755, -0.04942788928747177, 0.018871093168854713, -0.06107578054070473, -0.01941945031285286, 0.005880671087652445, -0.03787454590201378, -0.021253615617752075, -0.02486521750688553, -0.03006516769528389, -0.0037345096934586763, 0.011619525030255318, -0.023636138066649437, -0.05207514017820358, -0.024600492790341377, -0.015675486996769905, 0.024279041215777397, 0.01683838479220867, -0.043944306671619415, -0.023938680067658424, 0.030140802264213562, 0.021442703902721405, -0.030859341844916344, -0.0032712414395064116, 0.008423919789493084, 0.003720327978953719, 0.02834445610642433, 0.03899017348885536, -0.000807174073997885, -0.09378819167613983, -0.005771944765001535, -0.06788298487663269, -0.07703489810228348, 0.0012219883501529694, -0.05165914073586464, 0.030481163412332535, 0.05396603047847748, -0.013141692616045475, 0.03709928318858147, -0.028571363538503647, 0.06323139369487762, 0.03846072405576706, 0.03225859999656677, -0.030802614986896515, 0.01272569689899683, -0.047536998987197876, 0.04417121410369873, -0.051054056733846664, 0.013084965758025646, 0.0065803006291389465, -0.030613524839282036, 0.01381295919418335, -0.023579411208629608, 0.05978997424244881, -0.018682003021240234, -0.0362105630338192, -0.039330534636974335, 0.04768827185034752, 0.010730806738138199, -0.048747170716524124, -0.007265748921781778, 0.027266647666692734, 0.029668079689145088, 0.009246457368135452, 0.05029769986867905, 0.0047461362555623055, 0.04515447840094566, 0.004479048307985067, -0.02685065194964409, 0.01904127188026905, 0.007232658099383116, 0.024316858500242233, -0.02673719823360443, 0.013935866765677929, -0.04107015207409859, -0.012962058186531067, 0.08894751220941544, -0.04428466781973839, 0.012271882966160774, 0.047158822417259216, -0.009137731045484543, -0.01115625724196434, 0.036645468324422836, -0.06285321712493896, -0.025735026225447655, -0.02231251448392868, 0.07045459747314453, 0.03025425598025322, -0.03358222544193268, 0.026831744238734245, -0.035813476890325546, -0.02454376593232155, 0.00042722318903543055, 0.04946570843458176, 0.0073744747787714005, 0.004226141609251499, -0.0001856914022937417, 0.017452923581004143, 0.05018424615263939, -0.022671783342957497, -0.01947617717087269, 0.04175087437033653, 0.030783705413341522, 0.0362105630338192, 0.03518948331475258, 0.02044053189456463, -0.017367834225296974, -0.024146677926182747, 0.048558082431554794, -0.03116188384592533, -0.007691198959946632, -0.007941742427647114, 0.0032121511176228523, -0.0697360634803772, 0.02628338523209095, 0.00515740504488349, -0.0050581335090100765, 0.02269069291651249, 0.007355566136538982, 0.056953638792037964, 0.039254896342754364, 0.011449345387518406, 0.03316622972488403, 0.0407676100730896, -0.012177337892353535, 0.025678299367427826, 0.00889191497117281, -0.0221234243363142, -0.00014085660222917795, 0.052982766181230545, 0.05320967361330986, -0.009662453085184097, 0.006306121591478586, 0.02346595749258995, 0.03254223242402077, 0.018786001950502396, 0.07775343954563141, -0.05373912304639816, -0.006126486696302891, 0.006811934988945723, 0.06077323853969574, 0.03660764917731285, 0.02134815976023674, -0.015495851635932922, 0.0364752858877182, -0.007393383886665106, -0.02634011209011078, -0.027417920529842377, -0.02526230365037918, 0.011884249746799469, 0.005686854477971792, -0.03732618689537048, -0.03167242556810379, 0.006169031839817762, 0.014191136695444584, 0.06879061460494995, -0.02558375522494316, 0.018596913665533066, 0.036380741745233536, 0.0378178209066391, 0.02622665837407112, -0.008806824684143066, -0.031124066561460495, 0.0037817819975316525, 0.05128096416592598, -0.016318390145897865, 0.026321202516555786, -0.003127061063423753, -0.02512994222342968, 0.0007918106275610626, 0.009038458578288555, -0.0006742208497598767, 0.028420092537999153, -0.06996297091245651, -0.04500320553779602, 0.07140004634857178, -0.007998469285666943, 0.011392618529498577, 0.0010086721740663052, -0.03902798891067505, 0.010749715380370617, -0.058693256229162216, -0.001888527418486774, -0.02089434489607811, 0.020818710327148438, 0.0293655376881361, -0.03902798891067505, 0.02507321536540985, -0.023560501635074615, 0.012413699179887772 ]
32,019
pingouin.nonparametric
madmedianrule
Robust outlier detection based on the MAD-median rule. Parameters ---------- a : array-like Input array. Must be one-dimensional. Returns ------- outliers: boolean (same shape as a) Boolean array indicating whether each sample is an outlier (True) or not (False). See also -------- mad Notes ----- The MAD-median-rule ([1]_, [2]_) will refer to declaring :math:`X_i` an outlier if .. math:: \frac{\left | X_i - M \right |}{\text{MAD}_{\text{norm}}} > K, where :math:`M` is the median of :math:`X`, :math:`\text{MAD}_{\text{norm}}` the normalized median absolute deviation of :math:`X`, and :math:`K` is the square root of the .975 quantile of a :math:`X^2` distribution with one degree of freedom, which is roughly equal to 2.24. References ---------- .. [1] Hall, P., Welsh, A.H., 1985. Limit theorems for the median deviation. Ann. Inst. Stat. Math. 37, 27–36. https://doi.org/10.1007/BF02481078 .. [2] Wilcox, R. R. Introduction to Robust Estimation and Hypothesis Testing. (Academic Press, 2011). Examples -------- >>> import pingouin as pg >>> a = [-1.09, 1., 0.28, -1.51, -0.58, 6.61, -2.43, -0.43] >>> pg.madmedianrule(a) array([False, False, False, False, False, True, False, False])
def madmedianrule(a): """Robust outlier detection based on the MAD-median rule. Parameters ---------- a : array-like Input array. Must be one-dimensional. Returns ------- outliers: boolean (same shape as a) Boolean array indicating whether each sample is an outlier (True) or not (False). See also -------- mad Notes ----- The MAD-median-rule ([1]_, [2]_) will refer to declaring :math:`X_i` an outlier if .. math:: \\frac{\\left | X_i - M \\right |}{\\text{MAD}_{\\text{norm}}} > K, where :math:`M` is the median of :math:`X`, :math:`\\text{MAD}_{\\text{norm}}` the normalized median absolute deviation of :math:`X`, and :math:`K` is the square root of the .975 quantile of a :math:`X^2` distribution with one degree of freedom, which is roughly equal to 2.24. References ---------- .. [1] Hall, P., Welsh, A.H., 1985. Limit theorems for the median deviation. Ann. Inst. Stat. Math. 37, 27–36. https://doi.org/10.1007/BF02481078 .. [2] Wilcox, R. R. Introduction to Robust Estimation and Hypothesis Testing. (Academic Press, 2011). Examples -------- >>> import pingouin as pg >>> a = [-1.09, 1., 0.28, -1.51, -0.58, 6.61, -2.43, -0.43] >>> pg.madmedianrule(a) array([False, False, False, False, False, True, False, False]) """ a = np.asarray(a) assert a.ndim == 1, "Only 1D array / list are supported for this function." k = np.sqrt(scipy.stats.chi2.ppf(0.975, 1)) return (np.fabs(a - np.median(a)) / mad(a)) > k
(a)
[ -0.03660168871283531, 0.048802249133586884, 0.0026815435849130154, -0.0009428021730855107, 0.050350356847047806, -0.013241848908364773, -0.015195413492619991, -0.00254792720079422, -0.06000760197639465, 0.013232634402811527, -0.04360503330826759, 0.0752306580543518, 0.025949232280254364, -0.0005828440771438181, -0.0358276329934597, 0.02983793243765831, 0.018199479207396507, 0.09819425642490387, 0.01630120538175106, 0.01875237561762333, -0.011232995428144932, 0.02018068917095661, -0.03326588496565819, -0.00018833005742635578, 0.00391173642128706, 0.032712988555431366, 0.04227808117866516, -0.03356076031923294, -0.0487653911113739, 0.012338786385953426, -0.02655741758644581, 0.008408620022237301, 0.027921227738261223, -0.007215287536382675, 0.051824744790792465, -0.03628838062286377, 0.06719524413347244, -0.00014081559493206441, -0.12392233312129974, 0.0011829661671072245, -0.01043129712343216, -0.00015406205784529448, 0.02961677312850952, 0.030427686870098114, 0.010412867181003094, 0.03862897306680679, 0.018208693712949753, 0.04275725781917572, -0.037891779094934464, 0.017471499741077423, -0.015729879960417747, 0.012384860776364803, 0.03855525329709053, 0.031975794583559036, -0.001830314751714468, 0.019848952069878578, -0.0002449154562782496, -0.03885012865066528, 0.020696723833680153, -0.03160719946026802, -0.0007256754324771464, 0.022576570510864258, 0.09804681688547134, -0.06682664901018143, 0.03110959194600582, 0.02335062436759472, -0.029524624347686768, -0.00018113089026883245, -0.012762673199176788, 0.03274985030293465, -0.04375246912240982, -0.02465914376080036, 0.05820147693157196, 0.025764934718608856, 0.058791231364011765, -0.0184114221483469, 0.06019189953804016, -0.017665013670921326, -0.03234439343214035, -0.01294697169214487, 0.042609818279743195, 0.04327329620718956, 0.03984534367918968, -0.0008235840359702706, -0.024198396131396294, -0.04050881788134575, -0.004342534113675356, -0.015213843435049057, 0.027497339993715286, -0.01866944134235382, 0.02410624735057354, -0.0447845421731472, 0.04128286987543106, 0.021581357344985008, -0.07169212400913239, 0.03709929436445236, -0.024419555440545082, 0.008514592424035072, -0.00702177407220006, -0.05750114098191261, 0.00909513235092163, 0.04371561110019684, 0.04345759376883507, 0.007123138289898634, 0.036140941083431244, 0.023553352802991867, -0.006187823135405779, 0.01616298034787178, -0.027497339993715286, 0.02539633773267269, -0.02908230759203434, -0.04924456775188446, -0.07091807574033737, -0.01707525923848152, 0.00376199372112751, -0.01255994476377964, -0.019203906878829002, 0.00449918769299984, -0.008666638284921646, -0.026170391589403152, 0.0016529273707419634, -0.06870649009943008, -0.019185476005077362, -0.06660548597574234, 0.038407813757658005, -0.06623689085245132, 0.060818515717983246, -0.027534199878573418, -0.0447845421731472, 0.01986738108098507, -0.06623689085245132, 0.03350547328591347, 0.025009309872984886, 0.005229470785707235, -0.039403025060892105, -0.02408781833946705, 0.0356249064207077, -0.021747225895524025, 0.022558139637112617, -0.026207251474261284, 0.007800435181707144, 0.04231494292616844, -0.026151960715651512, -0.028031805530190468, 0.01959093287587166, -0.023221613839268684, 0.005934412591159344, 0.009666457772254944, 0.05352029204368591, -0.01279953308403492, -0.07335081696510315, -0.057279981672763824, 0.06712152063846588, 0.0087081054225564, 0.06789557635784149, -0.01391453854739666, 0.014633303508162498, -0.01761893928050995, -0.06704780459403992, -0.02659427747130394, 0.01791381649672985, 0.0003274178598076105, -0.05742742121219635, 0.032418109476566315, -0.02410624735057354, -0.01863258145749569, 0.018623366951942444, 0.04032451659440994, -0.015858888626098633, 0.01823633909225464, -0.019038038328289986, -0.0165223628282547, -0.03157033771276474, 0.05322541669011116, -0.04931828752160072, 0.038886990398168564, -0.046148352324962616, 0.06133455038070679, -0.016513148322701454, -0.0067268963903188705, -0.01628277450799942, 0.03873955085873604, -0.024327406659722328, -0.04526371881365776, -0.06855905055999756, 0.020014820620417595, 0.009813896380364895, -0.005860693287104368, 0.00031647513969801366, 0.03177306801080704, -0.04209378361701965, -0.01837456412613392, 0.026889154687523842, -0.022558139637112617, -0.027202462777495384, -0.052340783178806305, -0.03606722131371498, 0.048323072493076324, 0.09613011032342911, -0.059528425335884094, -0.000012967489055881742, 0.03877640888094902, -0.00911816954612732, 0.021470777690410614, 0.03011437878012657, 0.04401049017906189, -0.0640990287065506, -0.005750114098191261, -0.03346861153841019, 0.022429130971431732, -0.012624449096620083, -0.020493997260928154, 0.008698890917003155, 0.0744566023349762, 0.02065986581146717, 0.04448966309428215, 0.05399946868419647, -0.001298152725212276, -0.008016985841095448, -0.004671967588365078, -0.04176204651594162, -0.001367264660075307, -0.01241250615566969, 0.0730559378862381, 0.02659427747130394, 0.060818515717983246, 0.0016702053835615516, 0.032196953892707825, 0.0561373308300972, -0.007187642622739077, 0.010974977165460587, -0.005616497714072466, 0.010587950237095356, -0.00027745566330850124, -0.003211401868611574, -0.020272837951779366, -0.014218631200492382, -0.01443057507276535, 0.0037067041266709566, 0.002987939864397049, -0.004971452988684177, -0.03028024733066559, -0.01600632630288601, 0.0437893308699131, 0.001100607798434794, -0.025949232280254364, -0.051124412566423416, 0.05097697302699089, 0.0402139388024807, -0.008574488572776318, -0.04183576628565788, 0.0032943361438810825, 0.03322902321815491, -0.006948054302483797, 0.01490053627640009, 0.013131270185112953, -0.03291571885347366, 0.0009399225236847997, 0.02241070196032524, -0.019498784095048904, 0.09148579090833664, -0.06693722307682037, 0.0561373308300972, 0.00882789958268404, -0.05289367586374283, 0.017406996339559555, 0.010790678672492504, 0.003559265285730362, 0.06973856687545776, -0.0280686654150486, 0.026926014572381973, -0.03529316931962967, -0.04552173614501953, -0.08735750615596771, -0.0017934550996869802, 0.059344127774238586, 0.06726896017789841, -0.012762673199176788, 0.014412145130336285, 0.037891779094934464, -0.02779221720993519, -0.06339869648218155, -0.010274643078446388, 0.04095113277435303, 0.0015769043238833547, 0.008155209943652153, -0.007132353261113167, -0.0007625351427122951, 0.025930803269147873, 0.06288265436887741, -0.011960974894464016, -0.0561373308300972, -0.022945167496800423, -0.0342426672577858, -0.010081129148602486, 0.04795447736978531, -0.047622740268707275, -0.06266149878501892, 0.0028543234802782536, -0.05289367586374283, -0.030409257858991623, 0.010117989033460617, -0.028455693274736404, 0.002042258158326149, -0.0368228442966938, 0.04246238246560097, -0.03527473658323288, -0.06752698123455048, 0.03549589589238167, -0.02631782926619053, 0.011684526689350605, -0.00339109287597239, -0.019074898213148117, -0.006284579634666443, 0.053077977150678635, -0.026428408920764923, 0.016715876758098602, -0.04084055498242378, 0.039661042392253876, 0.0312570296227932, 0.032436542212963104, -0.009555879049003124, 0.0382235161960125, -0.008136780001223087, 0.0255806352943182, -0.03785491734743118, -0.015296777710318565, -0.032160092145204544, 0.01205312367528677, -0.03322902321815491, -0.05388889089226723, -0.060265619307756424, 0.011389649473130703, 0.005252507980912924, 0.03361605107784271, -0.03859211131930351, 0.019793661311268806, -0.03223381191492081, -0.0004869512631557882, -0.010283857583999634, -0.02537790685892105, 0.013665735721588135, 0.01992267183959484, 0.019793661311268806, 0.04622207209467888, 0.017102902755141258, -0.033634480088949203, -0.007284399121999741, 0.02382979914546013, 0.06417274475097656, 0.05223020166158676, 0.01419098675251007, 0.04574289545416832, 0.03306315466761589, 0.051087550818920135, -0.006796008441597223, 0.00024318766372743994, 0.01555479597300291, -0.029764212667942047, 0.009145814925432205, 0.0372283011674881, -0.010440511628985405, -0.0068236528895795345, -0.00862056389451027, 0.02758949063718319, 0.02112061157822609, -0.050092339515686035, -0.009403832256793976, -0.016669802367687225, 0.007183035369962454, -0.026299400255084038, -0.018181050196290016, 0.006616317201405764, -0.02261342853307724, 0.023811370134353638, -0.016568437218666077, 0.03560647740960121, -0.006653177086263895, -0.01602475717663765, 0.06498365849256516, -0.03131232038140297, 0.028418833389878273, -0.033450182527303696, 0.021931525319814682, 0.007063241209834814, 0.03223381191492081, -0.04353131353855133, -0.0024235255550593138, -0.05761171877384186, -0.022797727957367897, -0.01889059878885746, -0.009813896380364895, -0.026778576895594597, 0.03555118665099144, -0.08669402450323105, 0.02084416337311268, -0.014633303508162498, -0.002826678566634655, -0.052082765847444534, -0.04552173614501953, 0.004146717023104429, -0.033487044274806976, -0.008242751471698284, 0.02583865448832512, -0.054146908223629, -0.0220973938703537, -0.050571516156196594, 0.058054037392139435, 0.009620383381843567, 0.06605259329080582, 0.04375246912240982, -0.03925558552145958, 0.018945889547467232, -0.009998194873332977, 0.042867839336395264, 0.056063611060380936, 0.004245777148753405, -0.04496883973479271, -0.028050236403942108, -0.021968385204672813, 0.05746428295969963, -0.10379692912101746, 0.002688454696908593, -0.026667997241020203, -0.030648846179246902, -0.06579457223415375, 0.00391173642128706, -0.02961677312850952, -0.08580939471721649, -0.01356437150388956, 0.025193609297275543, 0.00927482359111309, -0.03031710721552372, -0.06597886979579926, -0.028639990836381912, 0.015241487883031368, -0.05786973610520363, 0.025930803269147873, 0.012403290718793869, -0.03536688908934593, 0.0010545331751927733, 0.07390370965003967, -0.002699973527342081, 0.00862056389451027, -0.01588653400540352, -0.0036237698514014482, 0.036914996802806854, -0.014144912362098694, -0.007570061832666397, -0.034168947488069534, -0.008288825862109661, -0.040177080780267715, 0.003061659401282668, -0.026465268805623055, 0.035403747111558914, -0.058533214032649994, -0.012900897301733494, -0.011131631210446358, 0.04231494292616844, 0.04721728339791298, 0.018835309892892838, 0.026889154687523842, -0.07080749422311783, -0.03759690001606941, -0.013840819709002972, 0.12642879784107208, 0.017978321760892868, 0.016577651724219322, 0.044637102633714676, 0.004833228886127472, 0.025304187089204788, 0.019332915544509888, -0.012218992225825787, 0.022429130971431732, 0.014218631200492382, 0.01570223458111286, -0.04253610223531723, 0.06159256771206856, 0.024235256016254425, 0.07777398079633713, -0.004363267682492733, -0.055289559066295624, -0.017066042870283127, 0.0031054301653057337, 0.0007757816347293556, -0.024806581437587738, -0.048101916909217834, -0.03361605107784271, 0.025212038308382034, -0.07718422263860703, 0.0398084819316864, -0.022558139637112617, 0.04740158095955849, -0.011960974894464016, -0.012900897301733494, -0.019517214968800545, 0.04168832674622536, 0.019719943404197693, 0.059491563588380814, -0.048323072493076324, 0.016725091263651848, -0.020567715167999268, -0.06240348145365715, -0.03855525329709053, 0.01936977542936802, 0.020807303488254547, -0.03803921490907669, -0.027736928313970566, -0.04375246912240982, -0.008652815595269203, -0.013831604272127151, 0.014052762649953365, 0.0036928816698491573, 0.038923848420381546, 0.015066404826939106, 0.017471499741077423, -0.03547746688127518, -0.012771887704730034, -0.007528594695031643, -0.0165223628282547, 0.013112840242683887, -0.049760602414608, -0.0312570296227932, 0.001438680337741971, -0.018439067527651787, 0.018263984471559525, -0.021544497460126877, 0.023313764482736588, -0.016116905957460403, -0.025175178423523903, 0.0005212192772887647, 0.01568380557000637, -0.01578516885638237, 0.02134176902472973, -0.030630415305495262, 0.030685704201459885, -0.00769907096400857, -0.015324423089623451, 0.021673506125807762, 0.04998176172375679, -0.01092890277504921, -0.008187462575733662, 0.032897286117076874, 0.003591517684981227, 0.0196093637496233, 0.05901239067316055, -0.04028765857219696, 0.012311141937971115, -0.0037297415547072887, -0.01578516885638237, 0.04530057683587074, 0.0020203725434839725, -0.0015250702854245901, -0.030169669538736343, 0.08588311076164246, 0.015794383361935616, 0.048875968903303146, -0.026409979909658432, -0.030464546754956245, -0.016890959814190865, -0.04242552071809769, -0.00782347284257412, 0.043383873999118805, -0.011924115009605885, -0.02685229480266571, 0.0062154680490493774, -0.0111961355432868, -0.02036498673260212, -0.05849635228514671, -0.017591293901205063, -0.0006991825648583472, 0.010855183005332947, -0.017112119123339653, -0.003112341510131955, -0.041430309414863586, 0.05834891274571419, 0.07397742569446564, -0.016494717448949814, -0.017480716109275818, -0.023461202159523964, 0.032436542212963104, -0.00639515882357955, -0.04769646003842354, -0.014329210855066776, -0.03885012865066528, -0.027681639418005943, -0.049060266464948654, 0.021784085780382156, -0.023000456392765045, 0.02585708349943161, 0.02513831853866577, -0.013352428562939167, -0.04272039979696274, -0.05639534816145897, 0.0037136152386665344, 0.03426109626889229, 0.020973172038793564, -0.004231954924762249, 0.061297692358493805, 0.03385563939809799, -0.0026101279072463512, -0.03158876672387123, -0.006169393192976713, -0.030925292521715164, 0.026428408920764923, 0.05860693380236626, -0.02631782926619053, -0.08249202370643616, -0.003879484022036195, -0.04799133539199829, -0.07747910171747208, 0.04301527515053749, -0.009173459373414516, 0.0065149529837071896, 0.05223020166158676, 0.005763936322182417, -0.00752398744225502, -0.03029867820441723, 0.04010336101055145, 0.031975794583559036, 0.031846784055233, -0.0011685678036883473, 0.07858489453792572, -0.026889154687523842, 0.06513109803199768, -0.08492476493120193, 0.003934773616492748, -0.04272039979696274, -0.025488486513495445, -0.012338786385953426, -0.027442051097750664, 0.044415947049856186, 0.03208637237548828, -0.041430309414863586, -0.07453032582998276, 0.057796020060777664, 0.004245777148753405, -0.01317734457552433, -0.005492096301168203, -0.010744604282081127, -0.03586449474096298, -0.006602494977414608, 0.02910073846578598, 0.004985275212675333, 0.05499467998743057, -0.019517214968800545, 0.008348722942173481, 0.050313498824834824, 0.007648388855159283, -0.011362004093825817, 0.0018867561593651772, 0.0696648433804512, -0.014918966218829155, -0.0010003953939303756, 0.08131250739097595, -0.003112341510131955, 0.052045904099941254, 0.04780703783035278, -0.02585708349943161, -0.02012539841234684, 0.031128020957112312, -0.06870649009943008, -0.0531516969203949, -0.03527473658323288, 0.085588239133358, 0.035403747111558914, 0.005201825872063637, 0.05344657227396965, -0.041135430335998535, 0.03031710721552372, 0.023203184828162193, 0.04692240431904793, 0.013380073010921478, -0.01586810313165188, 0.02283458784222603, -0.02685229480266571, 0.022576570510864258, -0.029174456372857094, -0.06999658048152924, 0.02091788314282894, -0.004416253417730331, 0.019038038328289986, 0.013002261519432068, 0.0511612705886364, 0.03079628385603428, 0.07910092920064926, 0.040914274752140045, -0.022576570510864258, -0.058017175644636154, 0.002033043187111616, 0.009049057960510254, -0.05429434776306152, 0.052045904099941254, -0.002332528354600072, 0.023958807811141014, 0.037652190774679184, -0.0009646876133047044, 0.10851497203111649, 0.026151960715651512, -0.03310001641511917, 0.03746788948774338, 0.006178608164191246, 0.008279611356556416, 0.017508359625935555, -0.032473400235176086, -0.015011114999651909, 0.012578374706208706, -0.00020733584824483842, 0.05709568411111832, -0.03372662886977196, -0.030704135075211525, 0.039624184370040894, 0.05963900312781334, -0.02655741758644581, 0.04047195613384247, -0.09133835136890411, -0.019775232300162315, -0.016236700117588043, 0.05451550334692001, 0.0031561122741550207, 0.04666438698768616, -0.019480355083942413, 0.03059355542063713, -0.003370359307155013, -0.07770025730133057, -0.011804320849478245, 0.0015792080666869879, -0.01751757599413395, -0.0001938014174811542, -0.07080749422311783, -0.01719505339860916, 0.04297841712832451, -0.00033951245131902397, 0.043899908661842346, -0.025728074833750725, 0.007533202413469553, 0.01775716245174408, -0.027534199878573418, 0.030999012291431427, 0.016310419887304306, -0.00016428486560471356, -0.01914861798286438, 0.04765959829092026, -0.025175178423523903, 0.021784085780382156, 0.013075980357825756, -0.018346918746829033, 0.032712988555431366, 0.03407679870724678, -0.008698890917003155, 0.028750570490956306, -0.06712152063846588, -0.04058253765106201, 0.02607824094593525, 0.026741717010736465, 0.029745781794190407, -0.016135336831212044, -0.049097128212451935, 0.006086458917707205, -0.07077063620090485, -0.025986092165112495, 0.02484344132244587, 0.035643335431814194, 0.015001900494098663, -0.03251026198267937, 0.04445280507206917, -0.043125856667757034, 0.000774629763327539 ]