text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def handle _ data ( self, data ) : if self. is _ th _ tag : self. cur _ th _ data = data if self. is _ td _ tag and self. cur _ th _ data not in ['pos. ','driver ','points'] : # exclude these columns if data = ='ret'and self. cur _ td _ color. lower ( ) in'# efcfff': self. ret + = 1 elif data = ='nc': self. nc + = 1 el... | [
-0.49037933349609375,
0.23604387044906616,
0.8085334300994873,
0.09962178021669388,
-0.23347108066082,
0.06408847868442535,
0.5385794639587402,
-0.7860049605369568,
-0.38891565799713135,
-0.4084746539592743,
-0.13167804479599,
-0.34017351269721985,
0.21776284277439117,
1.019558310508728,
... |
def fcngetricker ( fc, t ) : a = ( 1 - 2 * ( np. pi * fc * t ) * * 2 ) * np. exp ( - ( ( np. pi * fc * t ) * * 2 ) ) return a | [
0.05324345454573631,
-0.19086244702339172,
0.2494182139635086,
-0.2495165318250656,
-0.011005242355167866,
-0.7510550022125244,
0.560217559337616,
0.4523870050907135,
-0.9143630862236023,
0.3628927767276764,
0.05397265776991844,
-0.768578290939331,
0.3155858814716339,
-0.35778599977493286,... |
def update _ todo _ by _ id ( list _ id ) : for id in list _ id : todo = todo. query. filter _ by ( id = int ( id ) ). first ( ) todo. complete = true db. session. commit ( ) | [
-0.6714708805084229,
-0.4178393483161926,
0.8627495765686035,
0.4885167181491852,
0.2638811469078064,
-0.6024516820907593,
0.09838324040174484,
0.5526331067085266,
0.05773604288697243,
1.7241592407226562,
-1.7893898487091064,
-0.5498908758163452,
0.10927250236272812,
0.7562637329101562,
... |
def hosted _ checkout _ specific _ output ( self ) : return self. _ _ hosted _ checkout _ specific _ output | [
0.7633458375930786,
-0.6825994253158569,
0.3158620595932007,
1.0160969495773315,
-0.06134627014398575,
0.9280094504356384,
0.5434349775314331,
0.3378688395023346,
-0.10607977956533432,
0.15210768580436707,
-0.14515602588653564,
0.41862407326698303,
0.14111904799938202,
-0.11645811051130295... |
def process _ post _ result ( resp ) : resp _ json = resp. json ( ) if'message'in resp _ json : message = resp _ json ['message'] print _ info ( f'{ message }.') return raise exception ( f'{ response _ message ( resp _ json ) }') | [
0.6182026863098145,
-0.19702108204364777,
0.728039562702179,
0.24415238201618195,
-0.19445692002773285,
-0.46135440468788147,
0.029134459793567657,
-0.606465756893158,
0.038312070071697235,
-0.19323141872882843,
-0.15163752436637878,
-0.48978665471076965,
-0.3092704117298126,
0.68379706144... |
def parse _ oakland _ excel ( excel _ file : union [ bytes, pathlike ], is _ contents = false ) - > pd. dataframe : if is _ contents : wb = secure _ open _ workbook ( file _ contents = excel _ file ) else : wb = secure _ open _ workbook ( excel _ file ) if len ( wb. sheets ( ) )! = 1 : raise excelparsingerror ('oakland... | [
0.31589213013648987,
0.35256490111351013,
0.37914276123046875,
1.1177101135253906,
0.0487358383834362,
0.5499041676521301,
0.45120537281036377,
-0.03993799537420273,
0.37108150124549866,
-0.42705225944519043,
0.8893914818763733,
-0.04529077187180519,
-0.36772868037223816,
-0.34110146760940... |
def show _ msg ( title : str, message : str, button : str ='press enter key ', exit _ : bool = false ) - > none : print ('[ { } ] \ n { } '. format ( title, message ) ) getpass. getpass ('[ { } ] '. format ( button ) ) if exit _ : exit ( 1 ) | [
0.4337892532348633,
0.02512584626674652,
0.7573800683021545,
0.40401360392570496,
-0.09836361557245255,
0.4222266376018524,
-0.5547333359718323,
0.4019385278224945,
-1.105723261833191,
0.8828955888748169,
0.6710256338119507,
0.9484913349151611,
-0.10473798960447311,
0.7866313457489014,
0... |
def start _ game ( first _ player _ type, second _ player _ type, first _ player _ value, second _ player _ value ) : game = tictactoe ( ) if first _ player _ type = = " ai " : game. add _ ai _ player ( first _ player _ value ) else : game. add _ human _ player ( ) if second _ player _ type = = " ai " : game. add _ ai ... | [
0.016157424077391624,
0.06972257047891617,
0.9578266739845276,
0.722621500492096,
1.366467833518982,
0.14035576581954956,
-0.09851439297199249,
-0.5613643527030945,
-0.9359191060066223,
0.9889613389968872,
0.4274887442588806,
0.3694915473461151,
0.2014981508255005,
0.054803743958473206,
... |
def html _ report ( request ) : try : snapshots = parse _ snapshots ( request ) except objectdoesnotexist : return httpresponse ( " wrong or missing snapshot ", status = 400 ) plotter = plotter ( ) plotter. plot ( snapshots ) id _ from _ url = lambda url : url. split ( " / " ) [ 2 ]. split ( ". " ) [ 0 ] urls = [ ( id ... | [
-0.11931107938289642,
1.167675256729126,
0.7635857462882996,
0.06206356734037399,
-0.11220090091228485,
-0.1779862344264984,
0.27858588099479675,
0.41256624460220337,
0.490061491727829,
-0.3675103485584259,
0.38753849267959595,
-1.0316156148910522,
0.2604639232158661,
0.41315945982933044,
... |
def icnvct ( self ) : return self. _ _ icnvct | [
1.2503409385681152,
-0.05926956236362457,
0.21864944696426392,
-0.27803778648376465,
-0.6190589070320129,
0.0767708495259285,
0.4075072705745697,
-0.5130691528320312,
-0.4793393909931183,
0.7276551127433777,
-0.4240806996822357,
0.17141546308994293,
-0.754258394241333,
-1.2871508598327637,... |
def _ plot _ topo ( self, topodata, annotation = none, figsize = ( 5, 5 ), cmap ='blues ', channels = none, vmin = none, vmax = none, ax = none ) : # get the montage pos = mne. channels. layout. _ auto _ topomap _ coords ( self. info, mne. pick _ types ( self. info, meg = true, eeg = true ) ) if type ( topodata ) is no... | [
-0.39310088753700256,
0.3013511300086975,
0.7909645438194275,
-0.3358050286769867,
-0.665613055229187,
0.24023368954658508,
-0.02767901122570038,
0.21675068140029907,
0.498855322599411,
0.08346252143383026,
0.4574839770793915,
0.17799422144889832,
0.5959998965263367,
-0.10296138375997543,
... |
def draw _ residuals ( self ) : if self. _ fitdict [ " coeff " ] is none : nid = np. where ( ( self. _ lineflg = = 1 ) | ( self. _ lineflg = = 2 ) ) [ 0 ]. size msg = " cannot plot residuals until more lines have been identified \ n " + \ " polynomial order = { 0 : d }, number of line ids = { 1 : d } ". format ( self. ... | [
0.647456169128418,
-0.489665150642395,
0.6088466644287109,
-1.1346617937088013,
0.04792650789022446,
0.367753267288208,
0.37028616666793823,
-0.27081099152565,
0.3816728889942169,
-0.9194450974464417,
-0.286678284406662,
0.39209887385368347,
-0.2891886532306671,
0.4682139754295349,
0.106... |
def bestseq ( self ) : return self. preferred _ actions ( self. current, max _ depth = none ) | [
-1.2655242681503296,
-0.7639776468276978,
0.5364235043525696,
1.1105170249938965,
0.451953649520874,
-0.2699905335903168,
0.06716959923505783,
-0.46254104375839233,
-0.14817798137664795,
0.1343657523393631,
0.030447207391262054,
0.7824329137802124,
0.09093861281871796,
0.5313498973846436,
... |
async def _ bulk _ execute ( self, tasks : tuple [ t,... ], futures : " list [ asyncio. future [ r ] ] " ) - > none : try : results = await self. _ command ( * tasks ) # make sure we can cleanly match input to output results = [ none ] * len ( futures ) if results is none else list ( results ) if len ( results )! = len... | [
-0.5061823725700378,
1.0206471681594849,
0.4572509825229645,
0.4741479158401489,
0.7993403673171997,
-0.9309331178665161,
-0.3072267770767212,
0.17088265717029572,
-0.3751707375049591,
-0.3732793629169464,
-0.16288545727729797,
-0.3561650216579437,
0.26491236686706543,
0.6103324294090271,
... |
def combine _ fires ( self, event _ id _ merge = none, remove _ rest = false, probabilistic = false ) : if probabilistic is false : if event _ id _ merge is not none : # get index of events to merge evt _ idx _ merge = [ ] for i in event _ id _ merge : evt _ idx _ merge. append ( np. argwhere ( self. event _ id = = i )... | [
0.08962693810462952,
-0.37521427869796753,
1.025658369064331,
0.6020177006721497,
0.3973526358604431,
0.05766283720731735,
-0.035867251455783844,
0.9845291376113892,
0.01286307629197836,
-0.4687982201576233,
0.6628109216690063,
-0.4350171387195587,
-0.7741991281509399,
0.6729372143745422,
... |
def test _ valid _ read ( self ) : valid1 ='r000100000019 { " message " : " hello world " }'message = read _ message ( valid1, _ proto _ version ) self. assertisinstance ( message, singleresultmessage ) self. assertequal ( message. request _ id, " 0001 " ) self. assertequal ( message. payload,'{ " message " : " hello w... | [
-0.20451194047927856,
0.3465210497379303,
0.5132601857185364,
0.3938024938106537,
0.048810090869665146,
0.5413489937782288,
-0.34314674139022827,
-0.2621561586856842,
0.23711006343364716,
-1.3915470838546753,
0.4990527331829071,
-0.14283733069896698,
-1.0849485397338867,
-0.651761770248413... |
def report ( self ) : print ( " { : < 25. 25 } | { : < 20. 20 } | { : ^ 15. 15 } | { } ". format ( self. book _ id, self. author, self. status, self. due _ date ) ) | [
1.3047932386398315,
-0.44097092747688293,
0.6716660857200623,
-0.3223963975906372,
0.5618665218353271,
0.9390929937362671,
-0.22662019729614258,
-0.07688601315021515,
-1.2160289287567139,
-0.412801057100296,
0.13777102530002594,
0.44439512491226196,
-0.9249715209007263,
0.32942885160446167... |
def get _ errcode ( exc ) - > int : return getattr ( exc, " errcode ", sugar. utils. exitcodes. ex _ generic ) | [
-0.6205520629882812,
0.3000487685203552,
0.5882406234741211,
-0.25398343801498413,
0.12244315445423126,
-0.4455265402793884,
0.05101659893989563,
1.039036750793457,
-0.25638559460639954,
0.6866166591644287,
1.207782506942749,
0.14125826954841614,
0.8655611276626587,
0.24738025665283203,
... |
def _ centroids _ resolution ( centroids ) : if centroids. meta : res _ centr = abs ( centroids. meta ['transform'] [ 4 ] ), \ centroids. meta ['transform'] [ 0 ] else : res _ centr, _ = u _ coord. get _ resolution ( centroids. lat, centroids. lon ) if abs ( abs ( res _ centr [ 0 ] ) - abs ( res _ centr [ 1 ] ) ) > 1. ... | [
0.1811574101448059,
-0.681696355342865,
0.37469354271888733,
0.14367200434207916,
0.2613387703895569,
-0.6286464929580688,
-0.036918412894010544,
-0.09325874596834183,
0.30430811643600464,
0.2813296914100647,
0.9573758840560913,
-0.6639875173568726,
-0.2614392042160034,
-0.684036910533905,... |
def getexperimentsdescriptionstable ( self ) : return pandas. json _ normalize ( self. getexperimentsdescriptionslist ( ) ) | [
-0.22631369531154633,
0.6458266377449036,
0.2695017457008362,
-0.32829928398132324,
0.3574853539466858,
-0.36606115102767944,
-0.03330135717988014,
-0.5694066882133484,
-0.6073043942451477,
0.3324488699436188,
0.7141537070274353,
1.2144514322280884,
-0.09399629384279251,
0.4868629872798919... |
def main ( ) : # wxui. drawui ( client. client ( ) ) ui. startui ( client. client ( ) ) | [
0.6857752203941345,
-0.19280624389648438,
0.46499598026275635,
0.03936300799250603,
-0.3753105700016022,
1.2231669425964355,
-0.0022265235893428326,
0.007944440469145775,
0.0534406378865242,
-1.4753590822219849,
0.08910681307315826,
1.0639351606369019,
-0.7079120874404907,
0.22131468355655... |
def tracer ( self, frame, event, arg = none ) : line _ no = frame. f _ lineno # utiliser la synchronisation basee sur sigalrm s'est averee peu fiable sur diverses installations python et est inutilisable sur windows, # une autre solution enviseagable serait d'appeler la fonction dans un thread avec un timeout defini. i... | [
1.2289284467697144,
0.18043789267539978,
0.6415769457817078,
0.04561443254351616,
0.4779525399208069,
-0.3521067500114441,
-0.23992425203323364,
0.1560535579919815,
-0.44969817996025085,
0.179040789604187,
-0.2036714106798172,
-0.07182870805263519,
-0.13202941417694092,
0.6638991832733154,... |
def print _ backwards ( lst ) : if not lst : return print _ backwards ( lst [ 1 : ] ) print lst [ 0 ] | [
-0.30100876092910767,
0.07518014311790466,
0.5829687118530273,
0.8044636249542236,
0.8939778208732605,
0.28938019275665283,
-0.4220163822174072,
0.15470576286315918,
-0.5394943356513977,
0.2433755099773407,
-0.5793454647064209,
1.244888186454773,
-1.21638822555542,
0.7670024037361145,
-0... |
def te _ calc ( x _ pred, x _ hist, y _ hist, mcsamples ) : # first do an example for the case of k = l = 1 # todo : sum loops to allow for a general case # divide the range of each variable into amplitude bins to sum over # todo : will make this general x _ pred _ min = x _ pred. min ( ) x _ pred _ max = x _ pred. max... | [
0.46922069787979126,
0.1286151111125946,
0.6595227718353271,
-0.33157145977020264,
-0.27717679738998413,
-0.34955450892448425,
0.009393484331667423,
0.3779313564300537,
0.04654017835855484,
0.17025862634181976,
-0.6691901683807373,
-0.28798553347587585,
0.3007940351963043,
0.10096404701471... |
def test _ sprint _ view ( self ) : target = sprint. objects. create ( project = self. project, number = 1 ) response = self. client. get ('/ backlog / sprint / % d / view /'% target. id ) self. failunlessequal ( 200, response. status _ code ) self. asserttemplateused ( response,'sprint. html') self. failunlessequal ( ... | [
0.24560154974460602,
0.7501243948936462,
0.5441766381263733,
0.15250834822654724,
0.2126302719116211,
0.19840167462825775,
-0.02013721689581871,
0.0647626668214798,
0.30399805307388306,
-1.3095371723175049,
0.7130937576293945,
0.7393326163291931,
0.0579989030957222,
0.03637407720088959,
... |
def _ float _ to _ python ( self, v, desc = none ) : return float ( v ) | [
-0.22554290294647217,
0.21011234819889069,
0.203748419880867,
-0.8557513952255249,
0.7212305665016174,
-0.33266088366508484,
-0.5352463722229004,
0.4644225537776947,
-0.18122652173042297,
-0.47329181432724,
-0.3425302803516388,
0.8239519000053406,
0.26484641432762146,
0.017615584656596184,... |
def create _ btc _ connection ( ) : access = authserviceproxy ( " http : / / exmr : mkdndksjfdnsjkn @ 35. 185. 10. 253 : 8332 " ) return access | [
-0.10134481638669968,
-0.16342636942863464,
0.3721429705619812,
-1.000305414199829,
0.031110573559999466,
-0.7526825666427612,
-0.02600463293492794,
0.2246895134449005,
-0.29739075899124146,
-0.43967318534851074,
0.8336735963821411,
0.9727389216423035,
-1.7391306161880493,
-0.7821180820465... |
def forward _ pass ( image, net, transformer ) : image _ data = transformer. preprocess ('data ', image ) net. blobs ['data']. data [... ] = image _ data output = net. forward ( ) [ net. outputs [ - 1 ] ] return output | [
-0.22114251554012299,
-0.05889110639691353,
0.383864164352417,
-0.6829233169555664,
0.3638750910758972,
-0.09636306762695312,
-0.3128759264945984,
-0.7260464429855347,
-0.649296760559082,
-0.3266654908657074,
-0.2920643091201782,
-0.6841267943382263,
0.09397992491722107,
0.3769003450870514... |
def get _ doi ( dl ) : regex _ doi = r'\ b10 \. \ d { 4, 9 } / [ -. ; ( ) / : \ w ] +'dl = list ( filter ( lambda x : x is not none, dl ) ) return list ( set ( re. findall ( regex _ doi, ', '. join ( dl ) ) ) ) | [
-0.07576358318328857,
-0.13444609940052032,
0.49095284938812256,
-0.1992110013961792,
0.6799517273902893,
-0.4593712389469147,
-0.31592485308647156,
0.49500831961631775,
0.262078195810318,
0.6568654179573059,
-0.9287220239639282,
0.0013140497030690312,
-0.4357988238334656,
-0.3820823431015... |
def mean _ absolute _ error ( a, f ) : mae _ result = abs ( a - f ) with warnings. catch _ warnings ( ) : warnings. simplefilter ( " ignore ", category = runtimewarning ) mae _ result = np. nanmean ( mae _ result, axis = 0 ) return mae _ result | [
-0.30603164434432983,
0.21107988059520721,
0.6726319193840027,
-0.3151240050792694,
-0.4919791519641876,
0.20677320659160614,
-0.2670542001724243,
0.0762844905257225,
-0.1835649162530899,
0.865621030330658,
1.0429508686065674,
0.9962719678878784,
0.9907805323600769,
0.2024058699607849,
0... |
def decode _ cpu4 ( self, cpu4 ) : cpu4 _ reshaped = cpu4. reshape ( 2, - 1 ) cpu4 _ shifted = np. vstack ( [ np. roll ( cpu4 _ reshaped [ 0 ], 1 ), np. roll ( cpu4 _ reshaped [ 1 ], - 1 ) ] ) return decode _ position ( cpu4 _ shifted, self. cpu4 _ mem _ gain * 2. 0 ) | [
-0.14672048389911652,
-0.430317759513855,
0.5321367979049683,
0.1723252385854721,
-0.4264600872993469,
-0.5387333035469055,
0.48722589015960693,
0.20036154985427856,
-0.07742144167423248,
-0.1580677330493927,
-0.8401771187782288,
-0.11869829893112183,
-1.0153026580810547,
-0.11257982999086... |
def reply ( r ) : dunno ='i dont know how to answer that'# print ( " reply type : ", type ( r ) ) if isinstance ( r, dict ) : if r ['type'] = ='text': replies = r ['replies'] return '. '. join ( replies ) elif isinstance ( r, list ) and not isinstance ( r, str ) : if len ( r ) = = 0 : r = [ dunno ] return '. '. join ( ... | [
-0.08499441295862198,
-0.12782767415046692,
0.7997267246246338,
-0.19222776591777802,
0.05332614853978157,
-0.04089271277189255,
-0.4670570194721222,
-0.32767564058303833,
1.6351346969604492,
0.25504806637763977,
0.3696117401123047,
0.4637508690357208,
-0.3910174071788788,
0.26192995905876... |
def hseq _ profile ( w, z, temperature, mstar, mu = 2. 279 ) : from hyperion. util. constants import g, m _ h, k from hyperion. util. integrate import integrate, integrate _ subset # compute the integrand integrand = z / temperature / ( w * * 2 + z * * 2 ) * * 1. 5 # compute the integral for all cells # todo - ineffici... | [
0.6763435006141663,
0.16186940670013428,
0.503257691860199,
0.20587794482707977,
-0.7581755518913269,
-0.580033004283905,
0.4821023643016815,
0.3736778795719147,
-0.36452290415763855,
0.31490272283554077,
-0.3514319956302643,
-0.046082478016614914,
-0.6742386817932129,
0.16579850018024445,... |
def xgboost _ gridsearch _ classifier ( numeric _ features, categoric _ features, learning _ rate = 0. 08, use _ dask = false, n _ iter = 100, scoring ='roc _ auc ', ) : return _ xgboost _ gridsearch _ model ('classification ', numeric _ features, categoric _ features, learning _ rate, use _ dask, n _ iter, scoring, ) | [
0.18907134234905243,
0.6692860722541809,
0.31197383999824524,
0.5798282623291016,
0.9836586117744446,
-0.12138150632381439,
-0.2613948881626129,
0.10736175626516342,
-1.5614091157913208,
0.41534027457237244,
0.1419670134782791,
0.5986828804016113,
0.5756368637084961,
-0.7741919159889221,
... |
def remove ( self, val ) : if val not in self. _ element _ to _ indicies : return false val _ ind = self. _ element _ to _ indicies [ val ]. pop ( ) self. _ element _ list [ val _ ind ] = self. _ element _ list [ - 1 ] self. _ element _ to _ indicies [ self. _ element _ list [ - 1 ] ]. add ( val _ ind ) self. _ element... | [
-1.5368173122406006,
1.039860486984253,
0.8043529987335205,
-0.6308016180992126,
-0.9705721139907837,
0.01968732289969921,
0.7162654399871826,
0.5117515921592712,
0.47648507356643677,
0.7458086609840393,
-0.986172080039978,
-0.558243453502655,
-0.9965555667877197,
0.09820004552602768,
0.... |
def _ _ getitem _ _ ( self, index ) : image, label = self. images [ index ], self. labels [ index ] return image, label | [
-1.6182841062545776,
-1.3608548641204834,
0.43532195687294006,
-1.3443431854248047,
-0.35183414816856384,
0.1806875467300415,
-0.4832223057746887,
-0.8706353306770325,
0.21598471701145172,
0.19561885297298431,
0.812457263469696,
0.5530318021774292,
0.0628887265920639,
-0.6303278207778931,
... |
def solve _ literal ( expr, vars ) : _ = vars return result ( expr. value, ( ) ) | [
-0.058137230575084686,
0.06348118185997009,
0.3389091491699219,
-0.6470324397087097,
-0.28818708658218384,
-1.0609887838363647,
-0.9592366814613342,
0.6447298526763916,
-0.3501582741737366,
-0.3726291060447693,
-0.4065611660480499,
-0.20447789132595062,
0.12753607332706451,
-0.648047983646... |
def parse _ data ( ) : data = [ ] for line in sys. stdin : split = line. strip ( ). split ( ',') x = int ( split [ 0 ]. split ('<') [ 1 ] ) y = int ( split [ 1 ]. split ('>') [ 0 ] ) vx = int ( split [ 1 ]. split ('<') [ 1 ] ) vy = int ( split [ 2 ] [ : - 1 ] ) data. append ( [ x, y, vx, vy ] ) return data | [
-0.1844440996646881,
-0.1942014992237091,
0.6231977939605713,
-0.06993342190980911,
-0.09188157320022583,
0.36966079473495483,
-0.6260652542114258,
-0.0649651363492012,
-0.3962833881378174,
0.13051632046699524,
-0.6398505568504333,
-0.09822675585746765,
-0.2863454222679138,
-0.274031341075... |
def rightrotate ( self, t ) : node = t. left t. left = node. right if node. right! = none : node. right. parent = t node. parent = t. parent if t. isroot ( ) : self. root = node else : if t. isleft ( ) : t. parent. left = node else : t. parent. right = node node. size = t. size if t. left : lsize = t. left. size else :... | [
0.39569786190986633,
1.1740857362747192,
0.7567148804664612,
-0.6347792148590088,
-0.21171380579471588,
0.06704553961753845,
0.2906778156757355,
-0.6102840304374695,
-0.08613061159849167,
0.47757411003112793,
-1.0654813051223755,
-0.0991528183221817,
-0.8734526038169861,
1.0893834829330444... |
def save ( self, session ) : connection = self. _ db _ pool. connect ( ) cursor = connection. cursor ( ) cursor. execute ( " update sessions set data = % s, expires = % s where id = % s ", ( json. dumps ( session. _ data ), session. expires, session. id ) ) connection. commit ( ) | [
-1.4044468402862549,
-0.7736408710479736,
0.516145646572113,
-1.1030973196029663,
0.05196039378643036,
0.1070932075381279,
-0.6318247318267822,
-0.6527402400970459,
0.8037437796592712,
0.979459822177887,
-1.890489101409912,
-0.3328797519207001,
-0.2621851861476898,
-0.11160755902528763,
... |
def get _ pattern _ activations ( self, model, update _ num, filename _ prefix = " ", verbose = false, minibatch _ size = 2000 ) : activations _ filename = self. working _ dir + " / embeddings / " + filename _ prefix + " _ pattern _ activations. csv " output = open ( activations _ filename, " w " ) batch _ order = np. ... | [
-0.3122256398200989,
-0.3807857930660248,
0.7371295690536499,
0.30685585737228394,
-0.6079246997833252,
-0.07986726611852646,
0.5446274876594543,
0.759087860584259,
0.4384499192237854,
0.5628642439842224,
-0.6048802137374878,
0.7464776635169983,
0.5188273787498474,
-0.1667550653219223,
-... |
def get _ area ( self ) : semiperimeter = self. _ get _ semiperimeter ( ) diff _ a = ( semiperimeter - self. _ get _ edge ( a ) ) diff _ b = ( semiperimeter - self. _ get _ edge ( b ) ) diff _ c = ( semiperimeter - self. _ get _ edge ( c ) ) area = ( semiperimeter * diff _ a * diff _ b * diff _ c ) * * 0. 5 return area | [
0.6456228494644165,
-0.684985876083374,
0.7696408629417419,
-0.6106624007225037,
-0.7163221836090088,
0.5881008505821228,
0.9993375539779663,
-0.1563442051410675,
0.6959102153778076,
-0.41621920466423035,
0.8809917569160461,
0.04585104435682297,
-0.9323998689651489,
-0.13107819855213165,
... |
def get _ start _ point ( self ) - > point : curr _ point : point = self. get _ bottom _ left _ corner ( ) while not any ( [ wall. contains _ point ( curr _ point ) for wall in self. walls ] ) : curr _ point. x + = 1 # now we have a bottom corner return point ( curr _ point. x + 1, curr _ point. y + 1 ) | [
0.8841095566749573,
-0.4504013955593109,
0.5026266574859619,
0.2225932478904724,
0.9687168002128601,
-0.38239189982414246,
0.6646451950073242,
-0.3591168224811554,
-0.0649678036570549,
-0.04762750491499901,
0.16014130413532257,
0.710159957408905,
-0.8968433737754822,
0.15342466533184052,
... |
def getreleasebasedir ( ) : basedir = os. environ. get ('cmssw _ release _ base') if not len ( basedir ) : basedir = os. environ. get ('cmssw _ base') return basedir | [
-0.1151241883635521,
-0.8842397928237915,
0.5975193977355957,
0.6278569102287292,
-0.1794813722372055,
0.6581026315689087,
0.6135136485099792,
-0.06227492168545723,
-0.29159849882125854,
-0.189553365111351,
0.2148669809103012,
0.7013435363769531,
-0.9641776084899902,
1.1966674327850342,
... |
def valid _ status _ type ( status ) : return status in status _ priority. iterkeys ( ) | [
-0.09956442564725876,
-0.24815388023853302,
0.2681884169578552,
0.2142430543899536,
-0.7609873414039612,
0.44902172684669495,
-1.4400813579559326,
0.1592855304479599,
0.5654241442680359,
-0.32324108481407166,
-0.01985877938568592,
-0.8940014839172363,
-0.13797713816165924,
0.56589657068252... |
def test _ register _ input _ and _ post ( self, * _ ) : self. open ( base _ url +'/ logout') # go to main page self. open ( base _ url +'/ register') # validate that the user is taken to / login assert self. get _ current _ url ( ) = = base _ url +'/ register'self. type ('# email ','2542568test _ frontend @ test. com'... | [
-0.9921806454658508,
0.8607417941093445,
0.5951916575431824,
0.7950308322906494,
0.4916386008262634,
0.48368972539901733,
0.13112382590770721,
-0.1256384700536728,
-0.1716141402721405,
-0.7100226879119873,
-0.5293815732002258,
0.674755871295929,
-0.3129119575023651,
0.7115059494972229,
0... |
def visit _ asyncfunctiondef ( self, node : asyncfunctiondef ) : self. _ visit _ helper ( node ) | [
-0.2107354998588562,
0.25456276535987854,
0.5617571473121643,
-0.4573286175727844,
0.037639204412698746,
-0.7575505971908569,
0.669992208480835,
-0.2143874168395996,
-0.7212236523628235,
0.869883120059967,
0.25115612149238586,
1.6852760314941406,
0.8924295902252197,
0.38942375779151917,
... |
def get _ output _ shape _ for ( self, input _ shape ) : return tuple ( [ - 1 if input _ shape [ 0 ] is none else input _ shape [ 0 ], np. prod ( self. input _ layer. get _ shape ( ) [ 1 : ]. as _ list ( ) ) ] ) | [
-1.1410290002822876,
-0.019540026783943176,
0.27468034625053406,
0.07535785436630249,
0.7045723795890808,
-0.4366181194782257,
0.20155520737171173,
0.18887872993946075,
-0.337325781583786,
0.24662697315216064,
-0.44508782029151917,
-0.07214391231536865,
-0.16705797612667084,
0.377562850713... |
def compute _ regime _ cost ( self ) - > none : self. total _ cost = sum ( [ abs ( self. control _ regime [ x ] * self. maximum _ power ) * self. energy _ cost [ x ] for x in range ( self. num _ steps ) ] ) | [
-0.13208314776420593,
-0.27466338872909546,
0.21041534841060638,
-0.2670132517814636,
0.363674521446228,
-0.39235472679138184,
0.1275123953819275,
1.122165322303772,
-0.2902619540691376,
0.9135381579399109,
-0.0832594558596611,
-0.19226209819316864,
0.14821842312812805,
-0.0061831609345972... |
def _ _ init _ _ ( self, asyncsocketspool, udpsocket, recvbufslot ) :... | [
-0.28193938732147217,
0.9678483009338379,
0.45971593260765076,
0.04412630945444107,
-0.3813127875328064,
-0.45024213194847107,
0.6845519542694092,
-0.8352718353271484,
0.211658775806427,
-0.6451069116592407,
0.22529849410057068,
0.6319122910499573,
0.14665520191192627,
-0.7321568727493286,... |
def test _ on _ random _ graphs ( ) : # we use 25 randomly generated graphs for testing the algorithm with open ( random _ graph _ pkl,'rb') as f : rg _ dict = pickle. load ( f ) min _ depth = 5 max _ depth = 10 for i in range ( 1 ) : edges, source, target = rg _ dict [ i ] g _ i = nx. digraph ( ) g _ i. add _ edges _ ... | [
0.08163092285394669,
1.0188374519348145,
0.7728492617607117,
0.15161581337451935,
0.028208309784531593,
0.33821260929107666,
1.1558496952056885,
-0.01711966097354889,
-0.5132234692573547,
-0.33796578645706177,
-0.2652164697647095,
-0.4972148835659027,
-0.29472967982292175,
-1.0069299936294... |
def connection ( use _ db = true ) : # todo : use the connection pool # todo : get params from a function host = database. get ('host ','localhost') port = database. get ('port ', 5432 ) user = database. get ('user') password = database. get ('password') db _ name = database. get ('db _ name ','writer') if not use _ db... | [
-0.10437346994876862,
-0.33820462226867676,
0.7366101145744324,
0.43121710419654846,
0.09981232136487961,
-0.89434814453125,
0.16213461756706238,
0.5509201884269714,
-1.1597141027450562,
0.13458874821662903,
0.7636956572532654,
-0.5528756380081177,
-0.967983067035675,
-0.1164403110742569,
... |
def tagstoxml ( ) : things = thingsapp ( ) xml = xml ( ) with xml. things ( xmlns ='http : / / things. ivonet. nl') : _ _ printtags ( things. tags ( ), xml ) return str ( xml ) | [
-0.22030892968177795,
0.10637734085321426,
0.28356119990348816,
-0.3492223918437958,
-0.0013929468113929033,
-0.15221154689788818,
-1.857344388961792,
-1.184477686882019,
-0.39847347140312195,
-0.5472040772438049,
-0.18227721750736237,
0.01994779147207737,
0.16032865643501282,
-0.006337748... |
def _ _ mul _ _ ( self, other ) : return self. _ mathematical _ operator ( self, other, operator. mul ) | [
0.23454631865024567,
0.32740890979766846,
0.6764408349990845,
0.9892646670341492,
-0.8409044742584229,
0.2094540297985077,
-0.5977745056152344,
-1.1290991306304932,
0.8284914493560791,
-0.5509434342384338,
-0.22796493768692017,
-1.051453948020935,
0.5478950142860413,
-0.6362637281417847,
... |
def _ _ contextmenuprintfile ( self ) : if self. contextmenueditor : self. vm. printeditor ( self. contextmenueditor ) | [
0.14197322726249695,
-0.33336010575294495,
0.5129485130310059,
0.09582646191120148,
0.12256035953760147,
-0.20148436725139618,
-0.10271503776311874,
0.5335837006568909,
-1.035719871520996,
-0.09358427673578262,
1.5097596645355225,
0.3976609408855438,
-0.7268001437187195,
-0.465412646532058... |
def runface ( image _ path ) : process _ path ( image _ path ) | [
-0.36158522963523865,
-0.6228196620941162,
0.3653073012828827,
0.565981388092041,
0.823726236820221,
-0.1651478111743927,
1.7926021814346313,
-0.2983745038509369,
-0.6732208132743835,
0.062280088663101196,
0.17676229774951935,
0.07549500465393066,
0.5187209844589233,
0.5063858032226562,
... |
def main ( ) : # sites to process site _ names = ['geocenter ','palomar'] # db table schema ='ks'table ='statevectors _ topos'columns = ['observatoryid ','timeid ','mjd ','qx ','qy ','qz ','vx ','vy ','vz'] # process the requested site names for site _ name in site _ names : df = make _ topos _ df ( site _ name = site ... | [
-0.44670024514198303,
1.312976598739624,
0.5635533928871155,
0.46101459860801697,
0.16349440813064575,
0.41591909527778625,
0.2900868356227875,
0.33719590306282043,
-0.10391826182603836,
0.16346362233161926,
0.19134914875030518,
-0.13100174069404602,
0.6085113286972046,
-0.4567260146141052... |
def feat _ normalize ( x ) : mins = x. min ( axis = 0 ) maxs = x. max ( axis = 0 ) res = ( x - mins ) / ( maxs - mins ) return res, mins, maxs | [
-0.12330708652734756,
-0.19288133084774017,
0.32164764404296875,
0.795512318611145,
-0.5623711943626404,
-0.6838721632957458,
0.013614455237984657,
0.06424856930971146,
0.388853520154953,
-0.5389086008071899,
-1.4090532064437866,
0.0674714595079422,
0.33099454641342163,
-1.2415844202041626... |
def flush ( ) : cv2. destroyallwindows ( ) cv2. waitkey ( 10 ) | [
-0.06716527044773102,
0.0029432312585413456,
0.2654206156730652,
0.8621132373809814,
1.128105640411377,
0.21107777953147888,
0.8210351467132568,
-0.2911253273487091,
-0.2766968905925751,
0.38112783432006836,
-0.41217759251594543,
0.9231896996498108,
0.038596924394369125,
1.5835038423538208... |
def edit _ distance ( sequences ) : distances = np. zeros ( 2 * [ len ( sequences ) ] ) for i, a in enumerate ( sequences ) : for j, b in enumerate ( sequences [ : i ] ) : distances [ i, j ] = levenshtein. distance ( a, b ) return distances | [
-0.7135733366012573,
-1.4308457374572754,
0.5348527431488037,
-0.8597068786621094,
0.4540416896343231,
-0.4926775395870209,
0.26740869879722595,
0.1672775000333786,
0.8765111565589905,
1.1727339029312134,
-0.5471326112747192,
0.8509061336517334,
-0.152517631649971,
0.23789316415786743,
0... |
def friends _ of _ friends ( user ) : friends _ list = friends ( user ) result _ set = set ( ) for friend in friends _ list : result _ set. update ( friends ( friend ) ) friends _ list. add ( user ) result _ set = result _ set. difference ( friends _ list ) return result _ set | [
-0.623144805431366,
0.7648465633392334,
0.6666486859321594,
1.032749891281128,
-0.13866937160491943,
-0.33332690596580505,
0.4526422619819641,
-0.8042094111442566,
-0.5526032447814941,
-0.6414622068405151,
-0.7609115839004517,
-0.5394603610038757,
-0.40072548389434814,
-0.4075475335121155,... |
def is _ valid ( self ) : while self. d _ city not in cities. keys ( ) : print ('iata code from where you will fly is not correct') self. d _ city = input ('input iata code from where you will fly :') while self. a _ city not in cities. keys ( ) : print ('iata code where you will fly is not correct') self. a _ city = i... | [
-0.6966036558151245,
-0.27498629689216614,
1.0456714630126953,
0.18982410430908203,
-0.48732584714889526,
1.361009955406189,
0.5802028179168701,
-0.10823418945074081,
-0.6149648427963257,
-0.35287097096443176,
0.17211072146892548,
0.3923359513282776,
-0.5629411935806274,
0.6332891583442688... |
def previous ( values, elements, scope = none, strict = true ) : # init iterator on elements elem _ indexes = enumerate ( elements ) index, elem = next ( elem _ indexes ) try : nindex, nelem = next ( elem _ indexes ) except stopiteration : nindex, nelem = none, none # build results res = [ ] for val in values : # no pr... | [
-0.7757951021194458,
0.028194719925522804,
0.8805443644523621,
-0.21117353439331055,
-0.6312482953071594,
-0.0046237134374678135,
0.5351264476776123,
-0.4869202673435211,
0.14777277410030365,
0.49693799018859863,
-0.0680115818977356,
-0.11950713396072388,
-0.2637278735637665,
0.89191132783... |
def _ hk _ numba ( k, a, l, maxitr = 100, tol = 1e - 5, debug = false ) : p = a. shape [ 0 ] xold = np. zeros ( p ) xold [ k ] = 1 xnew = np. copy ( xold ) r = 1 converged = false while ( converged is false ) : # if ( debug ) : # print ('iter : { } '. format ( r ) ) for j in range ( k ) : xnew [ j ] = _ tj _ numba ( j,... | [
0.10299335420131683,
0.051001694053411484,
0.7396085262298584,
-0.06681903451681137,
-0.6315093636512756,
0.048523224890232086,
0.6699882745742798,
0.4672350585460663,
-0.34000149369239807,
1.3007285594940186,
0.552692711353302,
-0.37735599279403687,
-0.3846849501132965,
-0.083571523427963... |
def close _ connection ( self ) : self. server. unbind ( ) | [
-0.19115778803825378,
-1.3375508785247803,
0.5422710180282593,
-0.2724244296550751,
-0.5684571266174316,
1.4642974138259888,
0.44786155223846436,
0.5544211268424988,
-0.48930683732032776,
-0.7078342437744141,
0.5958014726638794,
0.725505530834198,
-1.217818260192871,
1.166159749031067,
1... |
def is _ accessible ( self ) : return security. current _ user. has _ role ( " admin " ) | [
-0.15029118955135345,
0.05593373253941536,
0.36524924635887146,
0.4987134039402008,
-0.0850207582116127,
0.33774206042289734,
0.009992321021854877,
-0.28275176882743835,
0.12515795230865479,
0.43054696917533875,
0.05500265955924988,
1.015939712524414,
0.13027936220169067,
0.680944919586181... |
def loop _ read ( self, max _ packets = 1 ) : print ( " loop _ read " ) if self. _ sock is none and self. _ ssl is none : return mqtt _ err _ no _ conn max _ packets = len ( self. _ out _ messages ) + len ( self. _ in _ messages ) if max _ packets < 1 : max _ packets = 1 for i in range ( 0, max _ packets ) : rc = self.... | [
-0.3922837972640991,
-0.17861656844615936,
0.6661016941070557,
-0.3052729368209839,
-0.8117889165878296,
0.6601554751396179,
-0.13261841237545013,
-0.2827974557876587,
0.05120864138007164,
-0.44637033343315125,
0.7227945327758789,
0.14935435354709625,
-0.7124449610710144,
-0.34941166639328... |
def _ _ call _ _ ( self, context, callback ) : del context # unused callback ( ( ('x - api - key ', self. _ api _ key ), ), none ) | [
-0.5473204851150513,
0.49227648973464966,
0.3593621551990509,
-0.5125299692153931,
-0.17266418039798737,
-1.085516095161438,
-1.3042901754379272,
-0.30457407236099243,
1.167385458946228,
0.8590818643569946,
-0.5038497447967529,
-0.02381359413266182,
-0.6581321358680725,
0.02948244661092758... |
def _ _ init _ _ ( self, config ) : raise notimplementederror | [
0.16628949344158173,
-0.4077144265174866,
0.23808644711971283,
0.5005646347999573,
-0.37031838297843933,
0.6340124607086182,
0.6029631495475769,
0.3876384198665619,
0.5237898826599121,
0.24040094017982483,
-0.9064058065414429,
-0.559475839138031,
0.4120909571647644,
0.7588567137718201,
0... |
def onchange _ product _ qty ( self, cr, uid, ids, product _ qty, product _ id, bom _ id, context = none ) : if not product _ id : return { } valid = self. validate _ product _ pack ( cr, uid, bom _ id, product _ qty, context ) if not valid : raise orm. except _ orm ( " error ", " check that the desired amount is a mul... | [
-0.30767107009887695,
-0.5799736976623535,
0.4469950795173645,
0.9780483245849609,
0.2949419915676117,
-1.2805536985397339,
-0.60515296459198,
-1.4719550609588623,
0.3428841829299927,
0.027219606563448906,
-0.5404461026191711,
0.4682152271270752,
-0.25921329855918884,
-0.06936405599117279,... |
def state _ function ( trmtx = none, name = none ) : return cpostatefunction ( trmtx, name ) | [
0.4744809865951538,
0.03587845340371132,
0.31892693042755127,
-0.14707797765731812,
-1.4276572465896606,
-1.1369489431381226,
0.32077065110206604,
0.05871499702334404,
-0.1716126799583435,
0.16961680352687836,
-0.8509531617164612,
-0.14058206975460052,
-0.5124245882034302,
-1.5779342651367... |
def df _ 2 _ sequence ( df _ in ) : # select row with max frequency for each position if'freq'in df _ in. columns : max _ freq _ idx = df _ in. groupby ( ['pos'] ) ['freq']. transform ( max ) = = df _ in ['freq'] df _ in = df _ in [ max _ freq _ idx ] # this is needed for positions where frequency is 0. 5 / 0. 5 df _ i... | [
-0.9063653349876404,
0.16164398193359375,
0.6459137201309204,
0.22016644477844238,
0.29091742634773254,
-1.0315253734588623,
0.2489604502916336,
0.3373332619667053,
0.12149818241596222,
0.5622425079345703,
0.1898709088563919,
-0.3246760070323944,
1.1349118947982788,
0.07352621108293533,
... |
def mocked _ methods ( self, mocker, iter _ commits ) : mocker. patch. object ( target = commithistorymirror, attribute = " _ set _ active _ dest _ branch " ) mocker. patch. object ( target = commithistorymirror, attribute = " _ check _ mirror _ state " ) mocker. patch. object ( target = repo, attribute = " iter _ comm... | [
-0.732151985168457,
0.2399393916130066,
0.5070120096206665,
-0.5808181762695312,
0.5236546397209167,
-0.004088862799108028,
0.9502264857292175,
0.6660424470901489,
0.175045445561409,
0.39474838972091675,
0.14246074855327606,
0.5103448033332825,
0.23106500506401062,
0.02166007272899151,
0... |
def pp ( self ) : return self. current. pp | [
0.09800145030021667,
-0.7029832005500793,
0.7655912041664124,
0.047181636095047,
-0.9346292018890381,
0.3945692479610443,
-0.00834528636187315,
-0.4083532392978668,
0.38963937759399414,
0.4635193347930908,
1.190890908241272,
-0.16596455872058868,
-1.8848762512207031,
-1.0779651403427124,
... |
def aton _ update ( self ) : if self. session. isinteractiverender ( ) : options _ node = aiuniversegetoptions ( self. session. universe ) if ainodelookupuserparameter ( options _ node, " aton _ enable " ) : if ainodegetbool ( options _ node, " aton _ enable " ) : driver = " driver _ aton " if not ( ainodeentrylookup (... | [
-0.6317959427833557,
-1.2494146823883057,
0.8383393883705139,
-0.29092156887054443,
-0.46045976877212524,
-0.8409773111343384,
-0.32840192317962646,
0.30884596705436707,
0.30026760697364807,
1.113341212272644,
0.3921504020690918,
0.21944677829742432,
-0.46324965357780457,
-0.13896217942237... |
def create _ observation ( * * params ) - > listresponse : photos, sounds, _, params, kwargs = convert _ observation _ params ( params ) response = post ( url = f'{ api _ v0 } / observations. json ', json = {'observation': params }, * * kwargs, ) response _ json = response. json ( ) observation _ id = response _ json [... | [
-1.0727192163467407,
-0.15403592586517334,
0.6489055752754211,
-0.1398411989212036,
1.1867161989212036,
-0.27779310941696167,
-0.11059346795082092,
-0.8375303149223328,
0.5227752923965454,
1.0591243505477905,
-1.04334557056427,
-0.2415931075811386,
-0.6102897524833679,
0.8916227221488953,
... |
def _ approach ( self, result _ xyh ) : if self. stopped : return if self. _ actions. ismotioninprogress ( ) : self. log ( " warning : motion still in progress, waiting for original ondone " ) return if result _ xyh is none : self. log ( " done " ) self. stop ( ) return x, y, h = result _ xyh # todo - take heading into... | [
-0.33044546842575073,
-0.4518430829048157,
0.7081476449966431,
-0.447182834148407,
-0.23051922023296356,
-0.34982240200042725,
0.21214815974235535,
-0.9376430511474609,
-0.5672921538352966,
-0.23743486404418945,
-0.010012179613113403,
-0.7913960218429565,
-0.19434238970279694,
0.5792757868... |
def getcamerahandle ( cameraindex ) : andor _ solis. getcamerahandle. restype = ctypes. c _ uint camerahandle = ctypes. c _ long ( ) result = andor _ solis. getcamerahandle ( ctypes. c _ long ( cameraindex ), ctypes. byref ( camerahandle ) ) check _ status ( result ) return int ( camerahandle. value ) | [
-0.6047247052192688,
0.42141833901405334,
0.3935714364051819,
0.23605294525623322,
0.025184456259012222,
-0.24874059855937958,
0.9627874493598938,
-1.003958821296692,
1.3541688919067383,
-0.5203333497047424,
0.3126833140850067,
0.08636000752449036,
-1.3970838785171509,
-0.21673983335494995... |
def build _ duel ( dense2, num _ actions, hidden _ size, init ) : # todo : 7 lines missing. raise notimplementederror ( " implement function body " ) | [
-0.6344190835952759,
-0.3518499433994293,
0.41252681612968445,
0.8835969567298889,
0.034058451652526855,
-0.5153635144233704,
0.25777721405029297,
0.7189058661460876,
0.1036926805973053,
-0.008186990395188332,
-0.34815189242362976,
0.763648271560669,
0.9586374163627625,
-0.2780891656875610... |
def template _ path ( self ) : return super ( mailexporter, self ). template _ path + [ os. path. join ( os. path. dirname ( _ _ file _ _ ), " templates " ) ] | [
0.5551236867904663,
0.08968611061573029,
0.5619169473648071,
0.10895521193742752,
-0.264038622379303,
0.6622377634048462,
0.5397537350654602,
0.6617592573165894,
0.658251941204071,
-0.010884867049753666,
-0.5867934823036194,
-0.1982555389404297,
-0.39306870102882385,
0.4952150583267212,
... |
def bssc _ init _ influxdb _ up ( self, log ) : if not self. bssc _ is _ up ( log ) : self. bssc _ running _ influxdb = - 1 return self. bssc _ running _ influxdb = \ self. bssc _ server. bes _ influxdb _ running ( log ) if self. bssc _ running _ influxdb < 0 : self. bssc _ failed = true | [
-0.4600510895252228,
-0.6025955677032471,
0.7503990530967712,
1.37912917137146,
0.4189493656158447,
0.19459931552410126,
0.026865733787417412,
-0.10042852908372879,
-0.31385400891304016,
-0.042261794209480286,
-0.5380544066429138,
0.7218613028526306,
-0.3757361173629761,
-0.143562778830528... |
def load _ all _ subclasses ( package, subclass ) : if type ( package ) = = str : package = importlib. import _ module ( package ) path = package. _ _ path _ _ prefix = package. _ _ name _ _ + '.'modules = [ m [ 1 ] for m in pkgutil. iter _ modules ( path, prefix ) ] # pyinstaller workaround from # https : / / github. ... | [
-0.22596122324466705,
0.5101429224014282,
0.7880268692970276,
0.6692456007003784,
0.15666256844997406,
-0.024366263300180435,
-0.5025858879089355,
-0.6209374666213989,
0.2628554105758667,
0.48020002245903015,
-0.2128862887620926,
-0.07029332965612411,
-0.09583566337823868,
0.13141492009162... |
async def test _ text _ default ( hass ) : text = mocktextentity ( ) text. hass = hass assert text. capability _ attributes = = { attr _ min : 0, attr _ max : max _ length _ state _ state, attr _ mode : textmode. text, attr _ pattern : none, } assert text. pattern is none assert text. state = = " test " | [
0.02760178968310356,
0.35497739911079407,
0.414960116147995,
-0.2585643231868744,
1.0748366117477417,
-0.05207705497741699,
-0.21086247265338898,
1.0430408716201782,
0.6543750166893005,
-0.2378094345331192,
-0.9191094040870667,
-0.7541201114654541,
0.12928423285484314,
0.25296443700790405,... |
def _ async _ raise ( tid, exctype ) : tid = ctypes. c _ long ( tid ) if not inspect. isclass ( exctype ) : exctype = type ( exctype ) res = ctypes. pythonapi. pythreadstate _ setasyncexc ( tid, ctypes. py _ object ( exctype ) ) if res = = 0 : raise valueerror ( " invalid thread id " ) elif res! = 1 : # " " " if it ret... | [
0.5024509429931641,
0.16386936604976654,
0.831602931022644,
-0.06566198915243149,
-0.14201459288597107,
-0.5329571962356567,
-0.49895763397216797,
-0.20570456981658936,
0.889974057674408,
0.8150594830513,
0.6808274984359741,
0.3407071530818939,
-0.4885084629058838,
0.09636309742927551,
0... |
def submit _ comment ( ) : thread _ id = int ( request. form ['thread _ id'] ) comment _ text = request. form ['comment _ text'] comment _ parent _ id = request. form ['parent _ id'] # empty means none if not comment _ text : abort ( 404 ) thread = thread. query. get _ or _ 404 ( int ( thread _ id ) ) comment = thread.... | [
-0.36515021324157715,
-1.0453109741210938,
0.7880019545555115,
0.10297904163599014,
0.892986536026001,
-0.2378966063261032,
-0.07312856614589691,
-0.6525487899780273,
-0.5248785614967346,
0.3559300899505615,
-0.4237423837184906,
-0.17174096405506134,
-0.6741241812705994,
0.5261783003807068... |
def register _ templates ( ) : event _ templates = [ event [ " templates " ] for event in current _ stats. events _ config. values ( ) ] aggregation _ templates = [ agg [ " templates " ] for agg in current _ stats. aggregations _ config. values ( ) ] return event _ templates + aggregation _ templates | [
-0.10058054327964783,
0.723731517791748,
0.5233867764472961,
-0.3293914496898651,
0.626052975654602,
-0.22702054679393768,
-0.16070377826690674,
0.006883904337882996,
0.30484554171562195,
0.5118117928504944,
-0.3320777714252472,
0.08619678020477295,
1.0795903205871582,
0.9259421229362488,
... |
def reset ( self ) : self. meta _ estimator = self. meta _ estimator. reset ( ) self. base _ estimators = [ be. reset ( ) for be in self. base _ estimators ] self. leader _ index = 0 self. w = 0 self. i = - 1 self. x _ window = none self. y _ window = none return self | [
-0.6290183663368225,
-0.3651030659675598,
0.3165321946144104,
0.8014447093009949,
0.8516578674316406,
-0.0760880559682846,
0.5288538336753845,
-0.4269646108150482,
-0.49034857749938965,
0.4629988968372345,
0.010129679925739765,
1.6731196641921997,
-0.33618345856666565,
0.1103009283542633,
... |
def get _ all _ unique _ proteins _ in _ db ( self ) - > list [ str ] : return list ( set ( self. _ database. iloc [ :, 1 ] ) ) | [
-0.4859203100204468,
-0.11053353548049927,
0.47405362129211426,
0.9075099229812622,
1.1387200355529785,
1.1326817274093628,
-0.8439194560050964,
0.18009717762470245,
0.4066442847251892,
0.0898457020521164,
-1.0507210493087769,
0.6227483153343201,
-0.6866907477378845,
-0.26518163084983826,
... |
def delete _ amenitie ( amenity _ id ) : amenitie = storage. get ( amenity, amenity _ id ) if amenitie is none : abort ( 404 ) storage. delete ( amenitie ) storage. save ( ) return make _ response ( jsonify ( { } ), 200 ) | [
-0.43606024980545044,
-0.750111997127533,
0.5220461487770081,
0.026831187307834625,
-0.18309687077999115,
-0.6724584102630615,
-0.6440821290016174,
0.2677185833454132,
0.8959482908248901,
0.846102774143219,
-0.23674876987934113,
0.39559969305992126,
-0.329900324344635,
0.24282382428646088,... |
def _ run _ command ( self, command, cache, stdout _ arg = none ) : if " args " in cache : t _ command = self. template. from _ string ( command ) command = t _ command. render ( * * cache [ " args " ] ) info, success = utils. run _ command ( command = command ) if stdout _ arg : clean _ info = info. decode ( ). strip ... | [
-1.229748249053955,
0.11863492429256439,
0.6439945697784424,
-0.6386744379997253,
-0.6301252245903015,
-0.35519593954086304,
-0.8482410311698914,
0.191383495926857,
-0.1437407284975052,
0.18816494941711426,
0.0023011842276901007,
-0.2269018143415451,
0.1895454376935959,
0.7645525932312012,... |
def num _ compositions ( m, n ) : # docs. scipy. org / doc / scipy / reference / generated / scipy. special. comb. html return scipy. special. comb ( n + m - 1, m - 1, exact = true ) | [
-0.020227137953042984,
0.6024346947669983,
0.4632793366909027,
-0.004914534278213978,
-0.17545515298843384,
-0.49198248982429504,
0.31864625215530396,
0.44252052903175354,
-0.32124534249305725,
0.10059329122304916,
0.11041869223117828,
-0.3498561680316925,
0.18863578140735626,
-0.122481279... |
def draw _ pdf _ heatmap ( axis, distribution, rangemu, rangevar, numgrid, title ) : # クラフタイトル axis. set _ title ( title ) # 示 axis. set _ xlim ( - rangemu, rangemu ) axis. set _ ylim ( rangevar / numgrid, rangevar ) # ( x, y ) x, y = np. meshgrid ( np. linspace ( - rangemu, rangemu, numgrid ), np. linspace ( rangevar ... | [
0.023730332031846046,
-0.507705569267273,
0.6283444762229919,
-0.1598806381225586,
0.15001048147678375,
0.4542529582977295,
0.07804747670888901,
0.2387779951095581,
0.050928354263305664,
-0.7596990466117859,
0.787105143070221,
1.2434958219528198,
-0.1412123143672943,
-0.1955888569355011,
... |
def longest _ string ( strings : list [ str ] ) - > str : index, value = max ( enumerate ( strings ), key = lambda x : len ( x [ 1 ] ) ) return value | [
-0.21061789989471436,
-0.4688715636730194,
0.2680385112762451,
-0.20552614331245422,
0.2916949987411499,
0.039920926094055176,
-0.44488200545310974,
0.5413116216659546,
-0.1097063273191452,
0.21132777631282806,
0.007465549279004335,
0.3583860397338867,
0.5665097236633301,
-0.44132170081138... |
def max _ cosine ( start, end ) : assert start < = end if start < = 0. 0 < = end : return + 1 return max ( np. cos ( start ), np. cos ( end ) ) | [
0.31599482893943787,
-0.5294898152351379,
0.5433651208877563,
0.7315605282783508,
-0.3678876459598541,
-0.24031610786914825,
-0.8825628757476807,
0.3430820107460022,
-0.9278371334075928,
0.24590930342674255,
0.5747228264808655,
0.2180166095495224,
-0.30146899819374084,
-0.7703108191490173,... |
def test _ valid _ data ( self ) : # send all valid project data form = self. form _ data ( name = " kabeltown ", short _ name = " k - town ", note = " this is a test note ", ) self. asserttrue ( form. is _ valid ( ) ) | [
0.5586045980453491,
0.5395357608795166,
0.40564829111099243,
0.32034245133399963,
0.1011493131518364,
1.7878341674804688,
-0.8641340136528015,
0.7664902806282043,
-0.14741024374961853,
-0.9956527352333069,
-0.7833691239356995,
-0.03683249652385712,
-0.3647349774837494,
-0.5265646576881409,... |
def fit _ transform ( self, y ) : y = column _ or _ 1d ( y, warn = true ) self. classes _, y = unique ( y, return _ inverse = true ) return y | [
-1.2314571142196655,
-0.20479674637317657,
0.5240587592124939,
0.5153094530105591,
0.5919166207313538,
-0.05519530922174454,
0.6337896585464478,
-0.5341783165931702,
0.7581803798675537,
-0.5376348495483398,
-0.7340199947357178,
0.6956804990768433,
0.43038704991340637,
0.12121712416410446,
... |
def _ transformation ( self, x : np. ndarray ) - > np. ndarray : | [
-1.2185994386672974,
0.4512138366699219,
0.20100688934326172,
-0.8778619766235352,
0.16466577351093292,
-0.34449532628059387,
-0.4136345684528351,
-0.3950861990451813,
0.45186692476272583,
0.5521256923675537,
-0.9550028443336487,
0.5519532561302185,
0.8455143570899963,
-0.19874611496925354... |
def connect _ to _ db ( app ) : # configure to use our database. app. config ['sqlalchemy _ database _ uri'] ='postgres : / / / live _ tweets'app. config ['sqlalchemy _ echo'] = false app. config ['sqlalchemy _ track _ modifications'] = false db. app = app db. init _ app ( app ) | [
0.9419177770614624,
0.016304953023791313,
0.5130229592323303,
0.445552259683609,
0.9191349148750305,
0.1810000091791153,
0.024301394820213318,
0.3333147168159485,
-0.4938245713710785,
0.2699337303638458,
-0.41499844193458557,
-0.5713257789611816,
0.7094231843948364,
0.950558066368103,
0.... |
def tokenize ( document ) : text = [ ] text = nltk. word _ tokenize ( document. lower ( ) ) copytext = copy. deepcopy ( text ) for word in copytext : if ( word in string. punctuation ) or ( word in nltk. corpus. stopwords. words ( " english " ) ) : text. remove ( word ) return text # raise notimplementederror | [
-0.5288707613945007,
-0.691643238067627,
0.5468745827674866,
0.27979955077171326,
-1.2849723100662231,
0.3200387954711914,
-0.2608228027820587,
0.8438093662261963,
0.08379676938056946,
0.9207927584648132,
-0.27977854013442993,
-0.249937504529953,
-0.7211668491363525,
0.6352016925811768,
... |
def test _ initiallist ( ) : l = initiallist ( 10 ) assert l [ 0 ] > = l [ 1 ] | [
-0.1986667364835739,
-0.02047751285135746,
0.10995611548423767,
0.6313594579696655,
0.7952110767364502,
1.0827133655548096,
0.046468932181596756,
0.7423678040504456,
0.7441827058792114,
-0.549005925655365,
-1.5755112171173096,
-0.3248121440410614,
-0.0141516188159585,
0.5133944749832153,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.