text
stringlengths
25
2.19k
embedding
listlengths
768
768
def file _ path ( dir, filename, name, ext ) : return'% s / % s _ % s. % s'% ( dir, filename, name, ext )
[ 0.16670626401901245, -0.515398383140564, 0.3731541037559509, 0.12643133103847504, -0.6942664980888367, 0.43189874291419983, -0.07236606627702713, 0.22983914613723755, -1.4144277572631836, 0.4075733423233032, 0.785078227519989, -0.19551093876361847, 0.46435868740081787, -0.57012939453125, ...
def test _ register _ input _ and _ user _ name _ empty ( 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 ','test _ frontend @ te...
[ -0.5736121535301208, 0.6816088557243347, 0.531097948551178, 0.5296431183815002, 0.27217423915863037, 0.46898379921913147, 0.47257569432258606, 0.06294956803321838, -0.32760488986968994, -0.43974512815475464, -1.0280367136001587, 0.6902720928192139, -0.08784155547618866, 1.0543397665023804,...
def iscoroutinefunction _ or _ partial ( obj : typing. any ) - > bool : # pragma : no cover warnings. warn ( " iscoroutinefunction _ or _ partial is deprecated, " " and will be removed in a future release. ", deprecationwarning, ) while isinstance ( obj, functools. partial ) : obj = obj. func return inspect. iscoroutin...
[ 0.015745557844638824, -0.3421824872493744, 0.6340591907501221, 0.4330388307571411, -0.1934119164943695, -0.43455880880355835, 0.4564695358276367, -1.0642136335372925, -0.19082525372505188, 0.1933632642030716, -0.4420323669910431, -0.09312845021486282, -0.3721767067909241, 0.136815130710601...
def run _ query ( query, client, table ) : print ('{ : - ^ 80 } '. format ( " creating table { } ". format ( table ) ) ) query _ job = client. query ( query ) rows = query _ job. result ( ) # wait for query to finish print ('{ : = ^ 80 } '. format ( " success " ) )
[ 0.3577296733856201, 0.552475094795227, 0.419836163520813, 0.6214398741722107, -0.33213868737220764, 0.6678179502487183, -0.32427874207496643, 0.08457248657941818, -1.2242612838745117, -0.2957705557346344, 0.2168295532464981, 0.4965386986732483, -0.26637715101242065, 0.030230887234210968, ...
def data _ writer ( dirname, n _ files = - 1 ) : path ( dirname. replace ('gt ','partial _ sub _ group') ). mkdir ( parents = true, exist _ ok = true ) path ( dirname. replace ('gt ','diff') ). mkdir ( parents = true, exist _ ok = true ) path ( dirname. replace ('gt ','hist _ labels') ). mkdir ( parents = true, exist _...
[ -0.3579842448234558, 0.44150933623313904, 0.7637085914611816, -0.023274792358279228, 0.745793879032135, 0.0657363161444664, 1.0864890813827515, 0.18589705228805542, -0.8390383720397949, -0.23108473420143127, -0.5437129139900208, -0.4794628620147705, 0.022572239860892296, 0.2455390542745590...
def launch _ template _ specification ( self ) - > pulumi. input ['spotfleetrequestlaunchtemplateconfiglaunchtemplatespecificationargs'] : return pulumi. get ( self, " launch _ template _ specification " )
[ -0.22244276106357574, -0.5818876028060913, 0.38957279920578003, -0.07820294052362442, -0.022125715389847755, 0.16996926069259644, -0.4084784984588623, 1.1666191816329956, 0.9885284900665283, 0.34912142157554626, -0.3195948004722595, 1.0916173458099365, 1.09841787815094, -0.4399382472038269...
def _ _ init _ _ ( self, masterdir = direction. out, multipliedby = none, alternativenames = none, loadconfig = true ) : self. _ setattrlistener = none self. _ associatedclk = none self. _ associatedrst = none self. _ parent = none super ( ). _ _ init _ _ ( ) if multipliedby is not none : multipliedby = tohval ( multip...
[ 0.22921600937843323, 0.433226078748703, 0.7752007246017456, -0.39835846424102783, -1.0109754800796509, -0.15002532303333282, 0.40136513113975525, 0.38486015796661377, 0.3788212537765503, -0.4795394241809845, -1.1918283700942993, -0.49680307507514954, 0.46780988574028015, 0.8818525671958923...
def push ( self, thing ) : if thing in self : self. remove ( thing ) self. append ( thing )
[ -0.19834676384925842, 0.7327257990837097, 0.714191734790802, -0.07233060151338577, -0.12687121331691742, 0.2728543281555176, -1.7012320756912231, -0.7161332368850708, -0.01704273745417595, 0.4059223532676697, -0.6494284272193909, 0.5839003920555115, -0.6968737244606018, 0.24101337790489197...
def callback _ query _ next ( self, bot : bot, update : update ) - > none : self. logger. info ( " callback query'next'from % s ", self. _ log _ user ( update. callback _ query. from _ user ) ) bot. answer _ callback _ query ( callback _ query _ id = update. callback _ query. id, ) with self. db _ session ( ) as sessio...
[ -0.0610421821475029, -0.23285624384880066, 0.446832537651062, 0.5065144300460815, -1.0771383047103882, 0.03904275596141815, 0.47189563512802124, -0.696130633354187, 0.8734906315803528, -0.04721163213253021, 0.6154758930206299, 0.35403209924697876, -0.7100717425346375, -0.5666939616203308, ...
def smoothdata ( data, r, d _ r ) : smooth _ data = [ ] r + = 1 # # comment out for smoothing smooth _ data = [ ] for i in range ( len ( data ) ) : smooth _ data. append ( data [ i ] ) # # adds + and - bins final _ smooth _ data = [ ] for i in range ( int ( r / d _ r ) ) : final _ smooth _ data. append ( smooth _ data ...
[ -0.5280196666717529, 0.21204140782356262, 0.8741622567176819, 0.7892283797264099, -0.44354259967803955, 0.9917043447494507, 0.11407212913036346, -0.15937210619449615, 0.08411309123039246, 0.08459175378084183, -0.018083173781633377, 0.7284379005432129, 0.15815313160419464, 0.513726592063903...
def _ _ init _ _ ( self ) : super ( xlsxoutputmodule, self ). _ _ init _ _ ( ) self. _ column _ widths = [ ] self. _ current _ row = 0 self. _ custom _ fields = { } self. _ field _ formatting _ helper = dynamic. dynamicfieldformattinghelper ( ) self. _ field _ names = self. _ default _ fields self. _ sheet = none self....
[ 0.11859922856092453, -0.17777606844902039, 0.3070192039012909, 0.3353356122970581, 0.21635013818740845, -0.43974700570106506, 0.5585716366767883, -0.3155674934387207, -0.6154890060424805, -0.40051209926605225, -0.3243720531463623, -0.2114647775888443, 0.20270195603370667, 0.805388867855072...
def test _ packages ( self ) : self. asserttrue ( self. check _ package _ output ( " python - - version ", " python 3. 6. " ) ) self. asserttrue ( self. is _ package _ present ( " pip " ) )
[ -0.07680699229240417, 0.2929307222366333, 0.41674280166625977, 0.4312135875225067, 0.9047901034355164, 1.1456122398376465, -0.40394189953804016, 0.5448901057243347, 0.5415677428245544, -0.25060901045799255, -0.691558837890625, -0.40486466884613037, 0.4279686510562897, 0.5457688570022583, ...
def calculate _ loss ( y, tx, w, pred ) : loss = y. t. dot ( np. log ( pred ) ) + ( 1 - y ). t. dot ( np. log ( 1 - pred ) ) print loss return np. squeeze ( - loss )
[ -0.0790933147072792, -0.26562413573265076, 0.24513256549835205, -0.29046711325645447, -1.308457374572754, 0.0834842100739479, 0.7700077295303345, -0.47276848554611206, 0.10825030505657196, 0.21686509251594543, -0.05295034125447273, 0.8096712231636047, 0.3292185962200165, 0.3384612202644348...
def interval _ scheduling _ greedy ( requests ) : optimal _ subset = [ ] while ( len ( requests ) > 0 ) : job = earliest _ finish ( requests ) compatible _ list = compatibles ( job [ 1 ], requests ) optimal _ subset. append ( job ) requests = compatible _ list return optimal _ subset
[ -0.6905010938644409, -0.3377130627632141, 0.4451230764389038, 1.149125576019287, -0.12774470448493958, 0.8645345568656921, -1.252377986907959, -0.2019616961479187, -0.8311607837677002, 0.16410459578037262, -0.09341708570718765, -0.39662259817123413, -0.49602556228637695, 0.0800610929727554...
def set _ activity _ fields ( activity ) : valid = true messages = dict ( ) if flask. request. form ['name'] : activity. name = flask. request. form ['name'] else : messages ['name'] = " name is required " valid = false if flask. request. form ['icon'] : # verify valid icon selection if flask. request. form ['icon'] = ...
[ -0.9662660360336304, -0.31292924284935, 0.6626119613647461, 0.08348314464092255, -0.012529440224170685, 0.3302977681159973, 0.7327224612236023, -0.8275076746940613, 0.11099361628293991, 0.29096174240112305, -1.0841362476348877, -0.43286028504371643, -0.1559745818376541, -0.1270752102136612...
def time _ stats ( df ) : print ('\ ncalculating the most frequent times of travel... \ n') start _ time = time. time ( ) # to do : display the most common month frequent _ month = df ['month']. mode ( ) [ 0 ] print ( " \ n \ t most popular month of travel : ", frequent _ month ) # to do : display the most common day o...
[ -0.1409534513950348, 0.4858799874782562, 0.9349127411842346, -0.11589360237121582, 0.32590097188949585, -0.5064427256584167, 0.4756738543510437, -0.5791783928871155, -0.16879701614379883, 0.1083754450082779, -0.10397037863731384, -0.15828436613082886, 0.7650884985923767, 1.205766201019287,...
def search ( self, txt ) : n = len ( txt ) m = len ( self. pat ) j = 0 i = 0 while ( i < n and j < m ) : j = self. dfa [ ord ( txt [ i ] ) ] [ j ] i + = 1 if ( j = = m ) : # found ( hit end of pattern ) return i - m else : # not found ( hit end of text ) return n
[ -0.765602707862854, 0.4942203462123871, 0.6811096668243408, -0.6189092993736267, -1.0180349349975586, 0.05289069563150406, 1.3573004007339478, 0.35475486516952515, -0.16842922568321228, -0.16362175345420837, -0.3980627954006195, -0.20843224227428436, -1.4390976428985596, -0.243813499808311...
def get _ name ( self ) : return " main "
[ -0.12020643800497055, -0.6302642822265625, 0.6005091071128845, 0.23718476295471191, -0.4417347013950348, 1.0764662027359009, -0.2161850929260254, -0.07792142778635025, -0.10928338021039963, 0.5540418028831482, 0.03844472020864487, 0.1284225732088089, -0.024486085399985313, 0.56065267324447...
def _ gethierarchyrootjoint ( joint = " " ) : # search through the rootjoint's top most joint parent node rootjoint = joint while ( true ) : parent = cmds. listrelatives ( rootjoint, parent = true, type ='joint') if not parent : break rootjoint = parent [ 0 ] return rootjoint
[ 0.8615113496780396, -0.5960445404052734, 0.6323273181915283, 0.5949966907501221, -0.8833091259002686, 0.019103849306702614, 0.4294873774051666, -0.4473849833011627, -1.0151407718658447, -1.1493611335754395, 1.0525809526443481, 0.29213401675224304, -2.258300542831421, 0.0186168123036623, ...
def _ equals ( self, other ) : # call super if not super ( cpointervalvar, self ). _ equals ( other ) : return false # check same attributes ( intensity processed as a children ) return self. start = = other. start and \ self. end = = other. end and \ self. length = = other. length and \ self. size = = other. size and ...
[ -0.40802860260009766, -1.05685293674469, 0.5518325567245483, -0.423861026763916, -0.2514265477657318, 1.0963457822799683, 0.3179294764995575, -0.8265577554702759, -0.21762974560260773, 0.38071367144584656, -1.0362282991409302, 0.08918212354183197, -0.6454722881317139, 0.28806063532829285, ...
def single _ mutant _ matrix ( self, model, n _ pred _ iterations = 10, \ minibatch _ size = 2000, filename _ prefix = " " ) : # get the start and end index from the sequence name start _ idx, end _ idx = self. focus _ seq _ name. split ( " / " ) [ - 1 ]. split ( " - " ) start _ idx = int ( start _ idx ) wt _ pos _ foc...
[ -0.8515715003013611, -0.718971312046051, 0.6718973517417908, -0.4710533916950226, -0.4960331916809082, -0.25127363204956055, 0.10174145549535751, 0.3381674289703369, 0.7993520498275757, 0.9196416735649109, 0.16686639189720154, 0.7347754240036011, 0.5110030770301819, 0.4699728190898895, 0...
def samples ( self, gp, y _ metadata = none ) : orig _ shape = gp. shape gp = gp. flatten ( ) # ysim = np. random. poisson ( self. gp _ link. transf ( gp ), [ samples, gp. size ] ). t # return ysim. reshape ( orig _ shape + ( samples, ) ) ysim = np. random. poisson ( self. gp _ link. transf ( gp ) ) return ysim. reshap...
[ -0.23325549066066742, -0.2818313539028168, 0.5264774560928345, -0.47725072503089905, 0.1269530951976776, -0.10961724817752838, 0.09146123379468918, 0.5267078280448914, 0.44813624024391174, -0.5045936107635498, 0.314510315656662, 0.7244997620582581, 0.04954081028699875, -0.8174629807472229,...
def connect ( self ) : if self. state is disconnected : self. _ connect _ deferred = defer. deferred ( ) self. _ attempt _ to _ connect ( ) else : if self. state is connected : log. debug ( " already connected to amqp " ) else : log. debug ('connection to amqp is already in progress') return self. _ connect _ deferred
[ -0.47418057918548584, -0.4560277760028839, 0.6523316502571106, 0.03917500376701355, -0.27752289175987244, -0.19930915534496307, -0.950780987739563, -0.6403350830078125, 0.6388968825340271, 0.09451443701982498, 0.21332097053527832, -0.6145431995391846, -0.5204668045043945, 0.113417953252792...
def flatten ( self, new _ fingerprint, max _ depth = 16 ) - > " dataset " : dataset = copy. deepcopy ( self ) for depth in range ( 1, max _ depth ) : if any ( isinstance ( field. type, pa. structtype ) for field in dataset. _ data. schema ) : dataset. _ data = dataset. _ data. flatten ( ) else : break if dataset. info ...
[ -0.7050667405128479, 0.6742472052574158, 0.4699503779411316, 0.03309778496623039, -0.24057330191135406, 0.23421350121498108, 0.5945402979850769, 0.25097957253456116, 0.4964821934700012, -1.2447983026504517, -0.1227341964840889, 0.545687735080719, -0.5354955792427063, -0.5528904795646667, ...
def validate ( self, responses, field = none ) : raise notimplemented ( )
[ -0.176900252699852, -0.7889312505722046, 0.4681202173233032, -0.059713102877140045, 0.27008742094039917, 0.8887702226638794, 0.5996958613395691, -0.6476393342018127, 0.6245871782302856, -1.2290204763412476, 0.05985051020979881, -0.5574777126312256, -0.40276750922203064, 0.15055452287197113...
def load _ lazy ( path ) : res = aln ( [ ], [ ] ) res. f = h5py. file ( path, " r " ) res. data = res. f [ " alns " ] res. labels = res. f [ " labels " ] res. dist = res. f [ " dist " ] return res
[ -0.13894861936569214, -1.2584623098373413, 0.3640285134315491, -1.394649863243103, -1.0682992935180664, -0.20607320964336395, 0.2965342402458191, -1.1109809875488281, 0.08941774815320969, -0.43947893381118774, -0.512404203414917, 0.36883506178855896, 0.6287972331047058, -1.0787345170974731...
def get _ cannabis _ data _ ok ( ) : return { }
[ -0.2960982918739319, -1.0939655303955078, 0.09887482970952988, 0.543747067451477, -0.3866300582885742, -0.12021400034427643, -0.019078748300671577, -0.40417447686195374, -0.552578330039978, -0.1544608771800995, -1.2423627376556396, 0.2818675637245178, -0.40752920508384705, -1.0035235881805...
def _ _ init _ _ ( self, name, race, symbol, health, level, exp ) : nullbag = inv. inventory ( " null ", 0 ) self. name = name self. race = race self. symbol = symbol self. bag = nullbag self. health = health self. level = level self. exp = exp
[ 0.03336447849869728, -0.9894130229949951, 0.615494966506958, 0.0016869369428604841, 0.345211386680603, -0.2562848925590515, -0.682604968547821, 0.32519710063934326, -0.46798333525657654, -0.11845746636390686, -0.8368417620658875, 0.08475062996149063, -0.30005255341529846, 0.361993879079818...
def show _ navigation _ menu ( context, menu, root = none, template ='navigation / menu. html ', request _ path = none ) : # get the menu try : data = get _ navigation _ menu ( menu, root ) except objectdoesnotexist : return show _ missing _ menu ( context, menu,'navigation / menu - missing. html') if isinstance ( cont...
[ -0.7824397683143616, 0.23593750596046448, 0.8980478644371033, 0.37099510431289673, -0.644135057926178, -0.14619266986846924, -0.35059022903442383, 0.9873477220535278, 0.2194736897945404, 0.10946866124868393, 0.697611927986145, -0.03137991577386856, -0.29034948348999023, 0.10380687564611435...
def delete ( org _ id ) : try : response, status = orgservice. delete _ contact ( org _ id ). as _ dict ( ), http _ status. http _ 200 _ ok except businessexception as exception : response, status = {'code': exception. code,'message': exception. message }, exception. status _ code return response, status
[ -0.27397194504737854, -0.6081178784370422, 0.7561618089675903, 0.6915915608406067, 0.3377659320831299, -0.28029513359069824, 0.47522544860839844, 0.37193554639816284, 0.32191672921180725, 0.6706562638282776, -0.19449728727340698, 0.31885018944740295, -0.7181089520454407, 0.1864886581897735...
def angle _ between ( v1, v2 ) : v1 _ u = unit _ vector ( v1 ) v2 _ u = unit _ vector ( v2 ) return np. arccos ( np. clip ( np. dot ( v1 _ u, v2 _ u ), - 1. 0, 1. 0 ) )
[ -0.008441307581961155, -0.7387819886207581, 0.5240650773048401, -0.18215838074684143, 0.2759621739387512, -0.01578180491924286, -1.3290598392486572, 0.012535609304904938, -0.3381200432777405, 1.112258791923523, 1.0164532661437988, 1.486994743347168, -0.5555946826934814, -1.2086424827575684...
def form _ json ( self, sensor _ type ) : this _ year _ measures = bdhandler. get _ this _ year _ measures ( sensor _ type ) obj _ list = [ ] for sensor _ obj in this _ year _ measures : obj = { } obj ['tipo'] ='% s'% ( sensor _ obj. type ) obj ['valor'] ='% s'% ( sensor _ obj. value ) obj ['ubicacion'] ='% s'% ( senso...
[ -0.9096869230270386, -1.1851308345794678, 0.9958361387252808, -0.6883449554443359, -0.05892958119511604, 0.07041612267494202, -0.5854979157447815, -1.2129685878753662, 0.2542499899864197, 0.5841284990310669, -0.6951471567153931, 0.2421974092721939, 0.5553301572799683, 1.3758937120437622, ...
def _ _ call _ _ ( self, * args, * * kwargs ) : self. simplug _ hooks. _ sort _ registry ( ) results = [ ] for plugin in self. simplug _ hooks. _ registry. values ( ) : if not plugin. enabled : continue hook = plugin. hook ( self. name ) if hook is not none : plugin _ args = ( plugin. plugin, * args ) if hook. has _ se...
[ -0.5375143885612488, -0.2695087194442749, 0.7198340892791748, 0.47003281116485596, 0.9167935848236084, -0.7267804145812988, 0.29392310976982117, 0.1385650932788849, 0.7194344997406006, 0.13438324630260468, -0.830929160118103, 0.0794978141784668, -0.7163392305374146, 0.17226828634738922, ...
def _ _ or _ _ ( self, other ) : # if other is false : # do not use = = because it is overloaded # return self # if other is true : # do not use = = because it is overloaded # return true other = build _ cpo _ expr ( other ) assert self. is _ kind _ of ( type _ boolexpr ) and other. is _ kind _ of ( type _ boolexpr ), ...
[ -0.633548378944397, -0.9657539129257202, 0.7837557792663574, 0.5824024081230164, -0.6492313742637634, 0.3980478346347809, 0.08319800347089767, -0.07157678157091141, -0.11689367145299911, 0.3792755901813507, 0.0645061507821083, -0.3783104419708252, -0.1981046199798584, -0.6597153544425964, ...
def tel ( self, zorg _ vraag _ attribuut _ code, subtraject ) : return subtraject. get _ zorg _ vraag _ attribuut _ telling ( zorg _ vraag _ attribuut _ code )
[ 0.12369120121002197, -0.3101199269294739, 0.2758162319660187, -1.477416753768921, -0.6695940494537354, -0.4254763126373291, 0.32156261801719666, -0.007889590226113796, 0.2191651612520218, 0.6643174886703491, 0.6960465908050537, 0.5246298313140869, 0.2247546911239624, -0.4916522800922394, ...
def create _ placeholders ( self ) - > none : self. users = tf. placeholder ( tf. int32, [ none ], name ='user _ placeholder') self. items = tf. placeholder ( tf. int32, [ none ], name ='item _ placeholder') self. scores = tf. placeholder ( tf. float32, [ none, 1 ], name ='score _ placeholder') self. labels = tf. place...
[ -0.09108567982912064, 0.7059816122055054, 0.32744428515434265, -0.9900079369544983, 0.99604332447052, 1.287155032157898, 0.5728723406791687, -0.5041302442550659, -0.4664668142795563, 0.3447204828262329, -0.7612255215644836, -1.1411490440368652, 0.037970636039972305, 0.06612831354141235, ...
def get ( self ) : self. method = " get " entity = fileattachment ( json. loads ( self. send ( ). content ) ) self. _ initialize _ collection _ properties ( entity ) return entity
[ -0.7853994965553284, -1.2338303327560425, 0.43343210220336914, -0.33248281478881836, 0.23273694515228271, 0.07643689960241318, -0.14449895918369293, -0.38870319724082947, -0.5395959615707397, -1.0862311124801636, 0.7077280879020691, 0.8780897259712219, -0.5134004950523376, 0.37013819813728...
def run _ ggn _ gram _ evals ( architecture _ fn, param _ groups _ fn, computations _ fn, n, device ) : model, loss _ func, x, y = architecture _ fn ( n ) model = extend ( model. to ( device ) ) loss _ func = extend ( loss _ func. to ( device ) ) x = x. to ( device ) y = y. to ( device ) param _ groups = param _ groups...
[ -0.13399654626846313, 0.481281042098999, 0.6771899461746216, -0.2807551920413971, -0.18133631348609924, -0.22075599431991577, 0.13762731850147247, -0.2034379094839096, -0.8209612369537354, 0.275949090719223, -0.03360811993479729, 1.4599580764770508, 0.48953303694725037, 0.6421704888343811,...
def write _ metadata ( t _ df, phase, out _ dir ) : output _ path = os. path. join ( out _ dir,'cst _ audio _ text _'+ phase +'_ filelist. txt') with open ( output _ path,'w ', encoding ='utf - 8') as f : for index, trow in t _ df. iterrows ( ) : str _ line = " | ". join ( [ trow ['text'], trow ['audio _ path'], trow [...
[ -0.35352009534835815, -0.7182145714759827, 0.4383145272731781, -0.35118135809898376, 0.7055304050445557, 0.26036161184310913, -0.2137073427438736, 1.1773817539215088, -1.1149230003356934, 1.2913801670074463, -0.4107552468776703, -0.26674243807792664, 0.7052285671234131, 0.4710099697113037,...
def make _ hmac ( self, msg ) : return hmac. new ( self. hmackey, msg, sha256 ). digest ( )
[ 0.09239266067743301, -0.05513062700629234, 0.1923367977142334, -0.4520210921764374, -0.030371570959687233, -0.38277292251586914, 0.22784587740898132, -0.1430850476026535, 0.2022581696510315, -0.20839448273181915, 0.7402222752571106, -0.23603755235671997, -0.3470636010169983, 0.228784561157...
def generate _ freecad _ trajectory ( self ) : doc = freecad. activedocument ( ) traj = doc. addobject ( " robot : : trajectoryobject ", " trajectory " ). trajectory frame _ curr = pose ( ) for target in self. _ path : command = target [ 0 ] if command = ='target': pose = frame _ curr * target [ 1 ] pos = pose. pos rot...
[ -0.402569979429245, 0.21059691905975342, 0.5877092480659485, -0.49595385789871216, 0.07083171606063843, 0.3097689747810364, 0.688605546951294, -0.2807050347328186, 0.21600474417209625, -0.22386369109153748, -0.8494428396224976, -0.5574802160263062, -0.13347524404525757, 0.2085505574941635,...
def bayesian _ quad _ normal ( f, n _ dim, sample _ size, mu, sigma, verbose = true ) : start = datetime. datetime. now ( ) if verbose : print start kernel = gpy. kern. rbf ( n _ dim, ard = true ) mu = np. atleast _ 1d ( mu ) sigma = np. atleast _ 2d ( sigma ) # generate sample points if verbose : print " sampling " x ...
[ 0.4958912134170532, 0.23106755316257477, 1.0650526285171509, 0.8482688665390015, -0.45547690987586975, -0.6118962168693542, -0.3375352919101715, 0.1772816926240921, -1.2064430713653564, 0.2021036148071289, -0.3374629318714142, 0.27171191573143005, -0.7192301154136658, 0.3033633232116699, ...
def _ c _ zero _ lsb ( index : int, start : int = 2 ) - > _ gen : while index & 1 = = 0 : yield start / / 2 start < < = 1 index > > = 1
[ -0.1092148870229721, -0.6871508359909058, 0.6267307996749878, 0.4349370002746582, -0.31377357244491577, 0.6809046864509583, 0.7264025807380676, -0.6122923493385315, 0.049501582980155945, -0.42531701922416687, -0.5566600561141968, 0.5834473371505737, -0.4037025272846222, 0.07752148061990738...
def get _ catalog _ levels ( item : str ) - > list [ str ] : levels = [ ] levels. append ( " / ". join ( item. split ( " / " ) [ : - 1 ] ) ) levels. append ( " / ". join ( item. split ( " / " ) [ : - 2 ] ) ) levels. append ( " / ". join ( item. split ( " / " ) [ : - 3 ] ) ) return levels
[ -0.6163737773895264, -0.0878414660692215, 0.6576530933380127, 0.8300885558128357, 0.6462072134017944, 0.6424425840377808, -0.4763842225074768, -0.12471483647823334, -0.47687798738479614, 0.9632879495620728, -0.8823164701461792, -0.25339680910110474, -0.12972716987133026, -0.610239624977111...
def store _ instance ( self, name : str, metadata : dict, for _ update : bool = false ) - > dict : pass
[ -1.1044433116912842, -0.00024069100618362427, 0.485740065574646, -0.7681360840797424, -0.823959231376648, 0.705443263053894, -0.6235857605934143, 0.455769807100296, -0.7259184122085571, 0.5165482759475708, -0.802098274230957, 0.3859431743621826, -0.6033403277397156, -0.739469587802887, -...
def _ _ init _ _ ( self, aln, transform = none, pre _ transform = none ) : super ( aligndataset, self ). _ _ init _ _ ( ". / ", transform, pre _ transform ) if not isinstance ( aln, aln ) : raise typeerror ( " aln dataset was expected " ) self. aln = aln self. data = none self. process ( )
[ 0.4969092905521393, -0.31658968329429626, 0.344388484954834, -0.13478638231754303, -0.5535373091697693, -0.011440116912126541, 0.38760554790496826, 0.9054808020591736, 0.8122941851615906, -1.4041255712509155, 0.11571701616048813, 0.5700855255126953, 0.4798068106174469, 0.2966477572917938, ...
def dns _ a ( self, domainname ) : if not domainname : return [ ] if self. strict > 1 : alist = self. dns ( domainname,'a') if len ( alist ) = = 0 : raise ambiguitywarning ('no a records found for ', domainname ) else : return alist return self. dns ( domainname,'a')
[ -0.9207898378372192, 0.7833760380744934, 0.6845515966415405, 0.04114784300327301, 0.5653372406959534, -0.46113279461860657, -0.21254488825798035, -0.024832792580127716, 1.005346417427063, 0.27628669142723083, 0.5294305086135864, 0.3061460256576538, 0.2358669638633728, 0.32225003838539124, ...
def isclose ( a, b, rel _ tol = 1e - 9, abs _ tol = 0. 0 ) : return abs ( a - b ) < = max ( rel _ tol * max ( abs ( a ), abs ( b ) ), abs _ tol )
[ 0.5094448328018188, -0.49135929346084595, 1.0992748737335205, 0.6140968799591064, -0.8323603272438049, 0.8251280784606934, -0.6164360642433167, 0.0302302073687315, -0.1999897062778473, 0.45452094078063965, 0.9452078342437744, 0.04773399233818054, 0.0451565682888031, -1.1277670860290527, ...
def _ encode _ status ( status ) : if not isinstance ( status, str ) : raise typeerror ('wsgi response status is not of type str.') return status. encode ('iso - 8859 - 1')
[ -0.40154528617858887, -1.0670533180236816, -0.08593455702066422, 0.5852785706520081, -0.47520819306373596, 0.5069946050643921, -0.34873151779174805, -0.7008373141288757, 0.9653065800666809, 0.7374616265296936, -0.5062157511711121, 0.3108762204647064, -0.2403094619512558, -0.622867405414581...
def get _ all _ users ( self ) : users _ response = [ ] all _ available _ users = self. database. get _ all _ documents ( ) for user in all _ available _ users : users _ response. append ( user ( * * user ). client _ response ( ) ) return users _ response
[ -0.6040972471237183, -0.7609034180641174, 0.49082136154174805, 0.730726420879364, 0.7410709857940674, 0.22281768918037415, -0.6494688987731934, -0.1893317699432373, 0.23975509405136108, 0.07034897059202194, -0.1475772261619568, 0.39158400893211365, -0.963019609451294, 0.5753328800201416, ...
def _ _ rdiv _ _ ( self, other ) : if isinstance ( other, array ) : result = self. _ new _ like _ me ( _ get _ common _ dtype ( self, other, self. queue ) ) other. _ div ( result, self ) else : # create a new array for the result common _ dtype = _ get _ common _ dtype ( self, other, self. queue ) result = self. _ new ...
[ -0.4846409261226654, 0.6482092142105103, 1.0161219835281372, 0.45827174186706543, -0.3098642826080322, -0.37631329894065857, -0.05836807191371918, -0.9559599161148071, 0.5682634711265564, -0.5105079412460327, -0.17886200547218323, 0.8600125908851624, -0.5828607678413391, 0.4712400436401367...
def _ extract _ sum _ scalars ( v1, v2 ) : def chk ( c ) : " " " helper to check if we have a primitive or tensor " " " return not isinstance ( c, ( int, float, np. int32, np. int64, np. float32, np. float64 ) ) v1 _ detached = v1. detach ( ) if chk ( v1 ) else v1 v2 _ detached = v2. detach ( ) if chk ( v2 ) else v2 re...
[ 0.021794209256768227, -0.18841736018657684, 0.6907335519790649, -0.1589587926864624, -0.010528948158025742, -0.4243236780166626, -0.18580809235572815, -1.4212772846221924, 0.2328082174062729, 0.7051441669464111, 0.011201789602637291, 0.6540554761886597, -0.3576886057853699, -0.147790938615...
def signup ( ) : return render _ template ('register. html')
[ -0.23649680614471436, 1.0227692127227783, 0.23759908974170685, 0.5103729367256165, 0.333594411611557, -0.2866761088371277, 0.23664483428001404, 1.5901389122009277, -1.0936613082885742, 0.4960646331310272, -0.0827220156788826, -0.6716513633728027, 0.044009510427713394, -0.034355275332927704...
def partition _ datetime _ from _ spec ( spec, regex ) : if isinstance ( regex, basestring ) : regex = re. compile ( regex ) match = regex. search ( spec ) return datetime. datetime ( int ( match. groupdict ( ). get ('year') ), int ( match. groupdict ( ). get ('month ', 1 ) ), int ( match. groupdict ( ). get ('day ', 1...
[ 0.3923760652542114, -0.37233853340148926, 0.8236661553382874, -0.35716670751571655, -0.6585861444473267, -0.5732969045639038, -0.4181579053401947, 1.2229083776474, -0.3158501386642456, 0.7234956622123718, 0.3547807037830353, -0.3332390785217285, -0.03009974956512451, -0.8087429404258728, ...
def _ tokenise _ files _ expression ( self, s ) : if s is none : return [ ] # for debugging purposes, keep the original string orig = s # list of tokens tokens = [ ] while s : # if the first character is a white space, ignore it if s [ 0 ]. isspace ( ) : s = s [ 1 : ] continue # if the first character is a operator, ad...
[ 0.5895644426345825, -0.9367342591285706, 0.7469506859779358, -0.24064405262470245, -0.3939211070537567, -0.8023885488510132, -0.02226346917450428, 0.8628653883934021, -0.26053333282470703, 0.00917387567460537, 0.5049067735671997, 0.5895729064941406, -0.46366339921951294, 0.2203239351511001...
def test _ get _ parameter _ value _ long ( self ) : pass
[ -0.4285580813884735, 1.0140937566757202, 0.5386491417884827, 0.9979349374771118, 0.7170804142951965, 0.26031070947647095, 0.26246964931488037, 0.18052886426448822, -0.4293158948421478, -0.4026940166950226, -0.5820288062095642, 0.7918068170547485, 0.10247822850942612, 0.5948766469955444, ...
def get _ group _ entities ( self, uuid, cache = false, * * kwargs ) : if cache : return self. get _ cached _ inventory ('_ _ group _ entities ', uuid = uuid, * * kwargs ) return self. request ( f'groups / { uuid } / entities ', * * kwargs )
[ -2.033235549926758, 0.2693460285663605, 0.30597755312919617, 0.1306684911251068, 0.27192196249961853, -0.40179651975631714, 0.17971155047416687, -0.3168836236000061, -0.8216170072555542, -0.12282803654670715, 0.337775319814682, 0.5451402068138123, -0.8707476258277893, 0.31974491477012634, ...
def remove _ tabs ( df ) : df. title = df. title. str. replace ( " \ t ",'' ) df. abstract = df. abstract. str. replace ( " \ t ",'' ) return df
[ 0.22161811590194702, -0.3813225328922272, 0.6128695011138916, -0.8303898572921753, -0.9171653985977173, 0.8334341645240784, -1.014540433883667, 0.5247660279273987, -1.6390513181686401, 0.29880020022392273, 0.7185349464416504, 0.08172684907913208, 1.0458272695541382, -0.8000375032424927, ...
def test _ out _ of _ order _ finish ( self ) - > none : # prefill table with 7 rows written by'master'self. _ insert _ rows ( " master ", 7 ) id _ gen = self. _ create _ id _ generator ( ) self. assertequal ( id _ gen. get _ positions ( ), { " master " : 7 } ) self. assertequal ( id _ gen. get _ current _ token _ for ...
[ -0.31781095266342163, 0.29477041959762573, 0.7212891578674316, 0.1343827247619629, 0.7160782217979431, -0.3999764323234558, 0.8892502188682556, -0.18589773774147034, -0.2749728262424469, -0.3196694254875183, -0.8783578872680664, -0.7372379302978516, 0.2481916844844818, 0.07848122715950012,...
def plot _ tads ( mtx, tads, bgn = 0, end = 250, fname = none, plot _ size = none ) : tads _ color ='blue'# plot tuning if plot _ size : plt. figure ( figsize = plot _ size ) sns. heatmap ( mtx [ bgn : end, bgn : end ], cmap ='reds') plt. xticks ( [ ] ) plt. yticks ( [ ] ) for i in tads : tad _ bgn = i [ 0 ] - bgn tad ...
[ -0.08537772297859192, 0.41409537196159363, 0.7119951248168945, -0.9844234585762024, -0.27271002531051636, 0.32488247752189636, -0.3320516049861908, -0.2699611783027649, 0.30980822443962097, -0.06602413952350616, -0.2036275863647461, 1.5782835483551025, 0.6052259802818298, 0.366393566131591...
def sequence _ var ( vars, types = none, name = none ) : return cposequencevar ( vars, types, name )
[ -0.7552725076675415, -0.5770085453987122, 0.2704465091228485, 0.6171479821205139, -0.5523220896720886, -0.7037760615348816, 0.1372678130865097, -0.36382630467414856, -0.019273672252893448, 0.22632548213005066, -1.0939271450042725, 0.6375890970230103, -0.5170852541923523, -0.021536512300372...
def output ( self ) : item = self. _ _ output _ list _ box. current _ item ( ) if item is not none : return item else : return outputitem ( )
[ -0.3275660574436188, -0.778199315071106, 0.638933539390564, 0.5980850458145142, -0.8066123127937317, -0.5723391771316528, 0.7223642468452454, -0.7610223293304443, 0.16308826208114624, -0.4101217985153198, 0.38822507858276367, 0.0933336615562439, -0.9423550367355347, -0.08136657625436783, ...
def getor ( subject, predicate, * args, * * kwargs ) : if ( subject, predicate, none ) in get _ graph ( ) : return metadata ( node = get _ graph ( ). objects ( subject, predicate ). _ _ next _ _ ( ) ) return metadata ( * args, * * kwargs )
[ 0.30781230330467224, 0.4537546634674072, 0.6270193457603455, 0.2201516479253769, 0.35571157932281494, -0.37987127900123596, -1.2085462808609009, -0.05900605022907257, -1.027510643005371, 0.016415558755397797, 1.131807804107666, 1.6283173561096191, 0.47518694400787354, -1.0159101486206055, ...
def set _ backend ( self, backend ='zbar') : self. backend = backend if backend = ='zbar': self. decode = self. decode _ zbar elif backend = ='libdmtx': self. decode = self. decode _ libdmtx
[ 0.3273800015449524, -0.32128310203552246, 0.46651560068130493, -0.035043925046920776, -0.1021067202091217, -0.25730979442596436, -0.3738603889942169, -0.37827107310295105, 0.16021041572093964, -0.3401327431201935, -0.7042272686958313, 0.48682495951652527, -0.7292394042015076, 0.23599840700...
def build _ model ( cls, cfg : wav2vec2ctcconfig, task : fairseqtask ) : w2v _ encoder = wav2vecencoder ( cfg, none ) # len ( task. target _ dictionary ) return cls ( cfg, w2v _ encoder, task )
[ -0.321665495634079, -0.11722458153963089, 0.3567422032356262, 0.24818436801433563, -0.41910722851753235, -0.09187152981758118, 0.21815557777881622, 0.4401257634162903, -0.3860873281955719, -0.059296850115060806, -0.7896479368209839, 0.07442678511142731, 0.7060068845748901, 0.46112030744552...
def output ( self ) : return impcconfig ( ). get _ target ( f " { self. output _ path } { self. specimen _ type } _ specimen _ cross _ ref _ parquet " )
[ 0.906342625617981, -0.7943931818008423, 0.4984210431575775, -0.155914768576622, 0.4559606611728668, 0.27396947145462036, 1.7690430879592896, 0.07246611267328262, -0.3107669949531555, 0.4437738358974457, 1.3365274667739868, 1.158725380897522, -0.653997540473938, -0.35712164640426636, -0.5...
async def gather _ task _ responses ( self, task _ id, timeout = none ) - > list : if timeout is none : timeout = self. global _ timeout url = " { } { } : { } / ws / responses / by _ task / { } ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port, str ( task _ id ) ) headers = self. get _ headers ( ) resp...
[ -0.23909586668014526, -0.1609468013048172, 0.8987253904342651, -0.028617626056075096, -0.09507294744253159, -0.2681373357772827, 0.041441064327955246, -0.9949332475662231, 0.3183414936065674, 0.6845039129257202, -0.08376607298851013, 0.48002639412879944, 0.07166808098554611, 0.953277051448...
def _ c _ one _ lsb ( index : int, stop : int = 0 ) - > _ gen : while index > stop : yield index index & = index - 1
[ -0.7886267304420471, -0.019007116556167603, 0.7242449522018433, -0.02761095017194748, -0.3607887029647827, 0.991237223148346, 0.9281816482543945, -0.7670431137084961, 0.034264177083969116, -0.24191062152385712, -0.3975142538547516, 0.12486714124679565, -0.6500869989395142, -0.4347271323204...
def random _ pixel _ locations ( dimensions, npixels = 100 ) : if len ( dimensions )! = 2 : raise typeerror ( " 2 dimensions must be specified. " ) cols = dimensions [ 1 ] rows = dimensions [ 0 ] x = numpy. random. randint ( 0, cols, npixels ) y = numpy. random. randint ( 0, rows, npixels ) index = ( y, x ) return inde...
[ -1.4698480367660522, -0.17228461802005768, 0.5029300451278687, -0.7333409190177917, -1.1124207973480225, 0.44074371457099915, 0.6956511735916138, -0.5186669230461121, 0.5651254057884216, -0.08299507200717926, 0.35014715790748596, 0.09024237841367722, 0.16516360640525818, 0.0394624955952167...
def find _ by _ id ( cls, _ id ) : return cls. query. filter _ by ( id = _ id ). first ( )
[ 0.5203557014465332, -0.2334967702627182, 0.008990378119051456, -0.44872617721557617, 0.7350687980651855, -0.38806357979774475, -0.29890111088752747, -1.0129634141921997, -0.33475780487060547, 0.10093871504068375, 0.26460200548171997, -0.026002923026680946, 0.02570520155131817, 0.6111431717...
def containsany ( str, set ) : return 1 in [ i in str for i in set ]
[ -0.5001458525657654, -0.7548353672027588, 0.22293566167354584, -0.10905975848436356, -0.8641614317893982, -0.6121200323104858, -1.6291910409927368, -0.3773064911365509, -1.053877830505371, -0.1557270586490631, 0.08660171926021576, -0.13117754459381104, -1.058993935585022, 0.076643884181976...
def state ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " state " )
[ 0.5414900183677673, 0.0015558939194306731, 0.43401214480400085, 0.16405640542507172, 0.7161188125610352, 1.03315269947052, 0.3625587522983551, -0.045137833803892136, 0.987585723400116, 0.016273515298962593, 0.2493973970413208, 0.41008031368255615, 0.0967065766453743, -0.9142460227012634, ...
def cursor _ set ( self, new _ cursor : xy ) - > none : self. cursor = new _ cursor self. _ cursor _ set _ implementation ( )
[ -0.6829948425292969, -0.7786878943443298, 0.04407459869980812, -0.28453999757766724, 0.051859527826309204, -0.24367879331111908, 0.15960080921649933, -0.32376036047935486, -0.17938795685768127, 0.7124497890472412, -0.6851300001144409, 1.2930551767349243, 0.3372199237346649, 0.2400085926055...
def correlate _ lights _ and _ stop _ positions ( self ) : for light in self. lights : # reset the minimum distance and the index we search for min _ dist = float ('inf') matching _ index = 0 for i, stop _ line _ position in enumerate ( self. stop _ line _ positions ) : # calculate the euclidean distance dx = light. po...
[ -1.1362278461456299, -0.993692934513092, 0.37863340973854065, -0.7674993872642517, -0.0001250830537173897, 0.14309576153755188, -0.017924051731824875, -0.2863500416278839, -0.720472514629364, 0.10796920210123062, -0.23005421459674835, -0.9779825210571289, 0.16544149816036224, -0.0902152657...
def test _ 2d _ subbox ( ) : topo, cub = check _ subset ( discr2d, xdef [ : 2 ], ldef [ : 2 ] ) velo = field ( domain = topo. domain, is _ vector = true, formula = v2d, name ='velo') vd = velo. discretize ( topo ) velo. initialize ( topo = topo ) i0 = cub. integrate _ field _ allc ( velo, topo ) vref = np. prod ( cub. ...
[ 0.8921998739242554, 0.9994590878486633, 0.5652317404747009, 0.4208965301513672, 0.49709340929985046, 0.7069909572601318, 0.3861721158027649, 0.1164017915725708, -0.257420152425766, -1.0868359804153442, -0.8137590289115906, 0.4016832411289215, 0.06919687986373901, 0.2229563593864441, -0.1...
def encode _ multipart _ formdata ( fields, files ) : boundary ='- - - - - - - - - - this _ is _ the _ boundary _ $'l = [ ] for ( key, value ) in fields : l. append ('- -'+ boundary ) l. append ('content - disposition : form - data ; name = " % s "'% key ) l. append ('' ) l. append ( value ) for ( key, filename, value ...
[ 0.40113797783851624, -0.7806233763694763, 0.6650146245956421, -0.43865540623664856, -0.17229659855365753, 0.6191800236701965, -0.7293327450752258, 0.3152058720588684, -1.067294955253601, 0.1591133326292038, -0.46477940678596497, 0.17218933999538422, -0.3475853502750397, 0.7217152118682861,...
def fitting _ curve ( mask, margin = ( 60, 60 ) ) : # 1. find boundary bound = find _ boundaries ( mask > 127, mode ='outer') # 2. crop marginal parts ( may be noise ) lhs, rhs = margin bound [ :, : lhs ] = 0 # left hand side bound [ :, - rhs : ] = 0 # right hand side # 3. process upper and lower boundary respectively ...
[ 0.23447872698307037, -0.9383003115653992, 0.934299647808075, -0.16838747262954712, -0.05705421045422554, 0.493912011384964, 0.015731872990727425, -0.2333637923002243, 0.5725488662719727, 0.11088420450687408, 0.3403063118457794, 0.4812650680541992, 0.19682089984416962, -0.840776801109314, ...
def form _ star ( self, time, sf _ mode ='sim ', mass = none ) : new _ star = [ time, mass, mass, self. z ] new _ star. extend ( self. abunds. values ( ) ) self. stars = np. append ( self. stars, np. array ( [ tuple ( new _ star ) ], dtype = star _ type ) )
[ -1.0336706638336182, -0.2128225564956665, 0.36915624141693115, -0.23316718637943268, 0.2719041407108307, 0.4892810583114624, -0.32165613770484924, -0.015579703263938427, -0.09941838681697845, -0.4998593330383301, -0.699144721031189, 0.8180171251296997, 0.12428918480873108, 1.46113288402557...
def demo _ ward _ msb ( n = 30, d = 30, niter = 1000 ) : from numpy. random import randn x = randn ( n, d ) x [ : np. ceil ( n / 3 ) ] + = 1. 0 niter = 1000 t, cpval, upval = ward _ msb ( x, niter ) t. plot ( ) import matplotlib. pylab as mp mp. figure ( ) mp. plot ( upval,'o') mp. plot ( cpval,'o')
[ 0.6684743165969849, 0.9544686079025269, 0.5599729418754578, 0.26969394087791443, -0.8856990933418274, 0.9886655211448669, 0.6881983876228333, -0.45354965329170227, 1.4267374277114868, -1.0621603727340698, 0.11419711261987686, 0.851725161075592, 0.601026713848114, 1.1535059213638306, -0.6...
def next _ file ( filename, base _ dir = " saves " ) : plot _ save _ location = base _ dir + os. sep + filename i = 0 while os. path. exists ( plot _ save _ location % i ) : i + = 1 return plot _ save _ location % i
[ -0.8306559324264526, 0.14494922757148743, 0.5455502867698669, -0.07164827734231949, 0.07803448289632797, 0.3957350254058838, 1.4893338680267334, 0.03937342390418053, -0.8590297698974609, -0.4868146777153015, 0.10433605313301086, 0.13246825337409973, 0.05603396147489548, -0.3635334968566894...
def _ _ init _ _ ( self, value ='', sequencenumber = 0, name ='', propertyassets = none, transaction = none, ratingassets = none, * args, * * kw _ args ) : # : value of an attribute, including unit information. self. value = value # : sequence number for this attribute in a list of attributes. self. sequencenumber = se...
[ -0.004590019583702087, -0.29653945565223694, 0.6351775527000427, 0.17206351459026337, -0.2419203817844391, -0.03913966938853264, 0.7975704073905945, 0.23335987329483032, 0.10790279507637024, -0.16442489624023438, -0.2033112496137619, -0.2699296474456787, 0.2805778384208679, -0.469027966260...
def build _ cpo _ tupleset ( val ) : def normalize _ value ( val ) : assert not is _ string ( val ), " impossible to build a tuple set expression from a string " assert not isinstance ( val, dict ), " impossible to build a tuple set expression from a dictionary. select values ( ) or keys ( ). " try : return tuple ( tup...
[ -0.7703024744987488, 0.6311708092689514, 0.35027793049812317, -0.07206497341394424, -1.187879204750061, -0.1839018017053604, 0.8003185391426086, -0.4640505015850067, -0.0870361328125, 0.2577572166919708, 0.505384087562561, 0.16069769859313965, -0.53095942735672, -0.5836291313171387, -0.0...
def solve _ select ( expr, vars ) : data, _ = _ _ solve _ for _ repeated ( expr. lhs, vars ) key = solve ( expr. rhs, vars ). value try : results = [ associative. select ( d, key ) for d in repeated. getvalues ( data ) ] except ( keyerror, attributeerror ) : # raise a better exception for accessing a non - existent key...
[ -0.9301653504371643, 0.3003498613834381, 0.5102301836013794, -0.15776844322681427, -0.4138849973678589, -1.4245848655700684, -0.5032228231430054, -0.4338960349559784, -0.06518387049436569, 0.6220883727073669, -0.11647219955921173, -0.0433238185942173, 0.3308722674846649, -0.377124905586242...
def register _ athlete _ team ( self, strava _ athlete : sm. athlete, athlete _ model : athlete ) - > team : all _ teams = config. competition _ teams self. logger. info ( " checking { 0! r } against { 1! r } ". format ( strava _ athlete. clubs, all _ teams ) ) try : if strava _ athlete. clubs is none : raise noteamser...
[ 0.7727194428443909, 0.906152069568634, 0.7788139581680298, 0.31300804018974304, 0.4311557412147522, -0.34568139910697937, -0.08677593618631363, -0.13549543917179108, -0.47344210743904114, 0.05325237289071083, 0.12478667497634888, 0.10386860370635986, 0.08308010548353195, -0.584034860134124...
def notify ( self, instance, notification ) : if instance = = self. gplane and notification = = " deleted " : self. lives - = 1 self. widget _ lives. message = f " lives : { self. lives } " if self. lives = = 0 : sys. exit ( 0 ) else : self. gplane = gameplayer ( self. plane _ img, 32, height - self. plane _ img. get _...
[ 0.258436381816864, 0.125712588429451, 0.6997742056846619, -0.49046590924263, 0.6122222542762756, 1.2111842632293701, -0.13340306282043457, 0.05031393840909004, 0.26940539479255676, 0.203804612159729, -0.26276761293411255, -0.33931273221969604, 0.2881052792072296, 0.48276492953300476, 0.7...
def total _ annual ( self ) : return self. total _ income + self. total _ gifts + self. total _ expenses + self. total _ donations
[ 0.6185358762741089, -0.773969829082489, 0.4676426351070404, -0.6941536664962769, -0.2428133338689804, 0.5402030944824219, 0.46212127804756165, 0.24779021739959717, 0.5924833416938782, 0.5628064870834351, 0.36776238679885864, 0.5689668655395508, 0.43116629123687744, -0.1385176181793213, 0...
def _ _ init _ _ ( self, params, name = none ) : super ( fashionencoder, self ). _ _ init _ _ ( name = name ) self. params = params self. encoder _ stack = encoderstack ( params ) self. activity _ regularizer = tf. keras. regularizers. l2 ( self. params [ " enc _ regularization " ] )
[ 0.3672805726528168, 0.22608034312725067, 0.28627172112464905, 1.0892125368118286, 0.14507536590099335, -0.8581271171569824, 0.5026698708534241, 0.6188605427742004, 0.17220686376094818, 0.09197811037302017, -0.49562719464302063, 0.5993724465370178, 0.21401965618133545, 0.9618580937385559, ...
def test _ getitem ( self ) : self. assertequals ( 3, self. vector [ 2 ] )
[ -0.030874503776431084, -0.12551841139793396, 0.18287931382656097, 0.8278188109397888, 1.3233691453933716, 1.154860019683838, 0.2457602620124817, -0.25694578886032104, -0.08039265125989914, -1.1302634477615356, -0.3322140574455261, 0.47848325967788696, -0.010578745976090431, -1.258484959602...
def test _ serve _ builds ( self ) : pass
[ 0.1382465958595276, 0.10955221205949783, 0.3108202815055847, 1.5334477424621582, 0.8385530114173889, 1.544463038444519, 1.9192076921463013, -0.2322305291891098, -0.4027854800224304, -1.3800638914108276, -0.6368882656097412, 0.9143104553222656, -0.9771440625190735, 0.33569929003715515, -0...
def put ( self, key, value ) : # key exists - - > update value if key in self. hash _ map : node = self. hash _ map [ key ] node. value = value return key, value # return key value for consistency # create and insert node at the front ( mru position ) else : new _ node = node ( key, value ) # deal with over capacity is...
[ -0.6649351716041565, 0.09167396277189255, 0.7023612260818481, -1.059420108795166, -0.28668302297592163, 0.19399462640285492, -0.15945355594158173, 0.36119988560676575, -0.29798635840415955, 0.5866725444793701, 0.027789220213890076, 0.015044924803078175, -1.0583341121673584, 0.3173132240772...
def timeit ( func ) : @ functools. wraps ( func ) def wrapper ( class _ instance, * args, * * kwargs ) : ts = time. time ( ) result = func ( class _ instance, * args, * * kwargs ) te = time. time ( ) class _ instance. time _ log. append ( { func. _ _ name _ _ : te - ts } ) return result return wrapper
[ -0.7800803184509277, 0.008974328637123108, 0.7816931009292603, -1.2183499336242676, 0.27215123176574707, 0.14948585629463196, 0.056991539895534515, 0.14577826857566833, 0.2964377701282501, 1.1988595724105835, -0.3599439263343811, -0.23905234038829803, 1.241935133934021, 0.41200944781303406...
def _ _ init _ _ ( self, data ) : if not isinstance ( data, np. ndarray ) : raise typeerror ( " data must be a 2d numpy. ndarray " ) if len ( data. shape )! = 2 : raise typeerror ( " data must be a 2d numpy. ndarray " ) if data. shape [ 1 ] < 2 : raise valueerror ( " data must contain multiple data points " ) def mean ...
[ -0.12913373112678528, -0.39777281880378723, 0.8367266654968262, -0.04295927286148071, -0.21529239416122437, 0.040387529879808426, 0.061629801988601685, 0.13817919790744781, -0.0494224838912487, 0.7091125249862671, -0.28525570034980774, 0.63124018907547, 0.26758038997650146, 0.8510291576385...
def save ( self, path ) : with open ( path,'wb') as f : torch. save ( self. data, f )
[ 0.025944629684090614, -0.7898537516593933, -0.010934858582913876, -0.6188929080963135, 0.3480782210826874, 1.1380068063735962, 0.18172259628772736, 0.11419679969549179, -1.2591707706451416, 0.002172797918319702, -1.5620684623718262, -0.10445068776607513, -0.3414178788661957, -0.53375893831...
def test _ nfc _ wps _ er _ handover _ pk _ hash _ mismatch _ er ( dev, apdev ) : try : _ test _ nfc _ wps _ er _ handover _ pk _ hash _ mismatch _ er ( dev, apdev ) finally : dev [ 0 ]. request ( " wps _ er _ stop " ) dev [ 1 ]. request ( " set ignore _ old _ scan _ res 0 " )
[ -0.04906470328569412, 0.39214423298835754, 0.6176051497459412, 0.7886112928390503, 0.3047015964984894, 0.9361676573753357, 0.027528101578354836, -0.4933645725250244, 0.741041362285614, -0.8655664324760437, 0.32932227849960327, -1.396286964416504, 0.3196958303451538, 0.07844666391611099, ...
def clean _ str ( string ) : # remove all the words that more than 20 characters ( like website, some numbers combination, etc ) # only keep one obj _ num for continuously words string = re. sub ( r " [ ^ a - za - z _ ] ", " ", string ) string = re. sub ( r " \ s { 2, } ", " ", string ) string = re. sub ( r " [ \ w ] +...
[ 0.3797583281993866, -1.0040193796157837, 0.6956859230995178, -0.5321328043937683, -1.050796627998352, 0.30188602209091187, 1.1145421266555786, 0.18824942409992218, 0.18148282170295715, 0.42321208119392395, -0.11664360016584396, 0.6293365955352783, -0.005304072517901659, 0.08323206007480621...
def register ( app ) : @ app. errorhandler ( 400 ) def bad _ request ( e ) : # todo : possible webpage for error return jsonify ( { " error " : { " message " : " 400 : bad request ", " route " : request. path, " method " : request. method, " error " : e. description, } } ) @ app. errorhandler ( 401 ) def missing _ argu...
[ -0.8070698380470276, -0.09029898047447205, 1.1551235914230347, 0.2806793749332428, 0.13617578148841858, 0.0756945088505745, 0.24106602370738983, -0.27963560819625854, -0.194022998213768, 0.5968455672264099, -0.7425591349601746, 0.5126399397850037, 0.6349310874938965, 0.46187451481819153, ...
def test _ inner _ product ( self ) : self. assertequals ( 27, self. vector. innerproduct ( vector ( [ 8, 5, 3 ] ) ) ) self. assertequals ( 27, self. vector. innerproduct ( [ 8, 5, 3 ] ) ) self. assertraises ( differentdimensionerror, self. vector. innerproduct, [ 1, 2 ] ) self. assertraises ( nonvectorerror, self. vec...
[ -0.37108370661735535, 0.4925447404384613, 0.49698367714881897, 0.11010345071554184, -0.05314953252673149, 1.0403729677200317, 0.2876778841018677, -0.26765474677085876, 0.39081963896751404, -0.6553322672843933, -0.43908318877220154, 0.2969454526901245, -1.3015433549880981, -0.51030641794204...
def parse _ time ( str _ input ) : # patterns = [ # hh : mm : ss ( + / - ) tt : tt, # hh : mm : ss ( am / pm ), # hh : mm ( am / pm ), # hh : mm : ss ( 24 - hour notation ), # hh : mm ( 24 - hour notation ) # ] patterns = [ r'(? p < hours > [ \ d ] { 1, 2 } ) [ : ] { 1 }'r'(? p < minutes > [ \ d ] { 2 } ) [ : ] { 1 }'r...
[ 0.19184310734272003, -0.766513466835022, 1.064935564994812, -0.047072481364011765, -0.9127389192581177, 0.11674715578556061, 0.06916366517543793, -0.8546846508979797, -0.10396675020456314, 0.5671771168708801, -0.5007144808769226, -1.0741647481918335, -0.6774650812149048, 0.2589592933654785...
def get _ stretched _ cpr _ grids ( cl, angle, size, rot _ axis = none, pivot _ axis = ( 1, 0, 0 ), voxel _ spacing = none, sample _ spacing = 0. 0, as _ torch = true, return _ pts2d = false ) : assert ( sample _ spacing = = 0. 0 ) or ( voxel _ spacing is not none ), \ " have to set voxel _ spacing when sample _ spacin...
[ 0.47066566348075867, -0.3545359671115875, 0.8150070309638977, -0.11824659258127213, -0.38628795742988586, -0.3454304039478302, 0.09793305397033691, 0.1250111609697342, 0.15439918637275696, 0.7191634178161621, 0.30079641938209534, 0.10566543787717819, -0.37359756231307983, 0.359805136919021...
def galaxy _ int _ dz _ vs _ prop ( properties, snaps, labels = none, foutname ='gal _ int _ dz _ vs _ param. png ', style ='color ', include _ obs = true, criteria ='all') : # also allow groupings of plots # get plot stylization linewidths, colors, linestyles = plt _ set. setup _ plot _ style ( len ( snaps ), style = ...
[ -0.31646081805229187, 0.1971769481897354, 0.8560532331466675, 0.00018008830375038087, -0.1305641531944275, 0.5591719150543213, 0.7071273326873779, -0.41528576612472534, 0.29582661390304565, -0.21773661673069, 0.7913221120834351, 0.23819150030612946, 0.47582969069480896, 0.14076915383338928...