text
stringlengths
25
2.19k
embedding
listlengths
768
768
def fromrelax ( self, baseschema, schemaout ) : verbose = self. verbose mydir = self. mydir trang = f " { mydir } / trang / trang. jar " ( good, stdout, stderr ) = run ( f'''java - jar { trang } " { baseschema } " " { schemaout } "'' ', workdir = none, ) if verbose > = 0 : console ( stdout ) if stderr : if verbose > = ...
[ 0.6414706110954285, -0.04264532029628754, 0.3612731397151947, -0.43245068192481995, -0.3254896402359009, -0.5051926374435425, -0.17464226484298706, 0.7425928711891174, -0.17877891659736633, -0.18591080605983734, -0.1930227279663086, 0.9129015207290649, -0.8891109228134155, -0.3920985460281...
def retry _ count ( self ) : return self. _ _ retry _ count
[ 1.1823314428329468, -0.12878331542015076, 0.2099081128835678, 0.030924472957849503, 0.4991317391395569, 0.6069510579109192, 0.5346730351448059, 0.49157747626304626, -0.24720565974712372, -0.9908847808837891, -1.1347910165786743, 0.5527267456054688, -0.10337060689926147, -0.7396500706672668...
def test _ fformat _ message _ flows _ good _ status ( self ) : input _ data _ msgflow = [ " bip1277i : message flow'test. running'on execution group'test'is running. ( application'test ', library'' ) ", " bip1278i : message flow'test. stopped'on execution group'test'is stopped. ( application'test ', library'' ) " ] ch...
[ -0.016245637089014053, -1.0708926916122437, 0.7015829682350159, 0.20187439024448395, 0.3308355510234833, 0.16396638751029968, 0.44356441497802734, -0.05768657475709915, -0.5607231259346008, 0.3148444592952728, -0.09193111956119537, 0.15559354424476624, -0.6734452247619629, 0.88662326335906...
def embedded _ overview ( self ) : emb = embeddedstand ( self. group, target _ width = self. window _ size [ 0 ] ) menubutton. buttonize ( emb. widgets [ 0 ], controlpv = self. group. pv ) return emb
[ 0.11500504612922668, 0.22781366109848022, 0.41103455424308777, -0.3432140350341797, -1.2224102020263672, 0.7878995537757874, 0.40391603112220764, 0.24746949970722198, 0.22906480729579926, -0.45315197110176086, 0.15383045375347137, -0.18734827637672424, -1.0205079317092896, 0.41308611631393...
def create _ tls ( cls, hostname, keyfile, certfile, ca _ certs, port = leap _ port ) : ssl _ context = ssl. sslcontext ( ssl. protocol _ tls _ client ) ssl _ context. minimum _ version = ssl. tlsversion. tlsv1 _ 2 ssl _ context. load _ verify _ locations ( ca _ certs ) ssl _ context. load _ cert _ chain ( certfile, ke...
[ 0.7722407579421997, -0.10162453353404999, 0.4562348425388336, 0.22663143277168274, -0.39347177743911743, 0.735322117805481, -0.43958625197410583, -0.023101946339011192, -0.992281973361969, -0.05230738967657089, -0.22421807050704956, -0.4983639717102051, -0.11493668705224991, -0.50096976757...
def test _ filter _ status ( self ) : t1 = taskfactory ( name = " new _ task ", creator = self. user, status = task. status. new ) t2 = taskfactory ( name = " assigned _ task ", creator = self. user, status = task. status. assigned ) t3 = taskfactory ( name = " completed _ task ", creator = self. user, status = task. s...
[ -0.20951393246650696, -0.15729384124279022, 0.5344089865684509, 0.021080520004034042, -0.4830778241157532, 0.985720157623291, 0.7455810308456421, -0.1778012216091156, -0.617364764213562, -0.528033435344696, -0.8330091834068298, -0.734182596206665, 0.3259294331073761, 0.8453264832496643, ...
def test _ event _ hover _ jquery ( self ) : js = " " " $ ('# button'). hover ( function ( ) { console. log ('test : hover in') ; }, function ( ) { console. log ('test : hover out') ; } ) ; " " " html _ code = f " " " < html > < head > < script src = " https : / / ajax. googleapis. com / ajax / libs / jquery / 3. 2. 1 ...
[ 0.3409443795681, 0.0032332786358892918, 0.944420576095581, 0.2887739837169647, -0.28166112303733826, 0.30823370814323425, 0.4431013762950897, 0.4391140341758728, 0.281375914812088, 0.025933602824807167, -1.0439342260360718, 0.3271859288215637, 0.5699986815452576, 1.2460761070251465, 1.10...
def test _ nologin ( ) : import aberbase. files try : e = " " with open ( aberbase. files. config ( ). nologin, " r " ) as f : for s in f : e + = s raise exception ( e ) except oserror : pass return true
[ -0.16320030391216278, 0.26542675495147705, 0.5527026653289795, -0.13673719763755798, 0.1510017216205597, 0.8813656568527222, 0.7555011510848999, 0.051470257341861725, -0.5135773420333862, -0.33065733313560486, -0.492352694272995, 0.06272877007722855, -0.5986824631690979, 0.3138278722763061...
def test _ mlb _ signal _ usr1 ( self ) : d = self. cleanup _ d ( self. client. mlb _ signal _ usr1 ( ) ) for lb in ['lb1 ','lb2'] : request = yield self. requests. get ( ) self. assertthat ( request, hasrequestproperties ( method ='post ', url ='http : / / % s : 9090 / _ mlb _ signal / usr1'% ( lb, ) ) ) request. setr...
[ -0.896609365940094, -0.04499369487166405, 0.5741012096405029, 0.8558487296104431, 0.1796373575925827, 0.6172327399253845, -0.13114143908023834, -0.08052529394626617, -0.898308515548706, -0.20685721933841705, -1.0295201539993286, 0.11249528080224991, 0.2252311110496521, 0.5551331043243408, ...
def parameters _ analysis ( i _ change _ question, track _ variables, context _ variables, survey ) : items = track _ variables ['items'] [ 0 ] ev = track _ variables ['events'] [ 0 ] t = track _ variables ['t'] [ 0 ] items = array ( items ) # time per question end = 0 # for the first question n _ quest = len ( i _ cha...
[ -0.21105244755744934, -0.31856396794319153, 0.8154790997505188, -0.3983655273914337, -0.5766164064407349, 0.37081220746040344, -0.0189075767993927, -0.556024432182312, -0.5027419328689575, 1.4374005794525146, 0.041594214737415314, 0.016072602942585945, 0.45439159870147705, 0.49281060695648...
def dump _ vocabulary ( vocabulary, f ) : with codecs. open ( f,'w ','utf - 8') as f : _ dump _ vocabulary ( vocabulary, f )
[ -0.16077229380607605, -0.2544212341308594, 0.25977805256843567, 0.21233977377414703, 0.07587382942438126, 0.083231121301651, -0.07703917473554611, 0.1633470058441162, -0.21756884455680847, 0.4965609908103943, -0.19399476051330566, 0.29307445883750916, 0.4540298879146576, 0.0321975611150264...
def get _ range _ list _ at _ offset ( self, offset, cu = none ) : if cu is none : raise dwarferror ( " for this binary, \ " cu \ " needs to be provided " ) section = self. _ rnglists if cu. header. version > = 5 else self. _ ranges return section. get _ range _ list _ at _ offset ( offset, cu )
[ -1.5129117965698242, -0.2265007495880127, 0.4529094099998474, 0.3702740967273712, -0.3073047399520874, 0.4468978941440582, -0.44105449318885803, 0.17053715884685516, 0.10503740608692169, 0.09039356559515, -1.0787180662155151, 0.2177387923002243, -0.5683059692382812, 0.7463680505752563, -...
def validate _ transaction _ event _ sample _ data ( required _ attrs, required _ user _ attrs = true ) : @ transient _ function _ wrapper ('newrelic. core. stats _ engine ','sampleddataset. add') def _ validate _ transaction _ event _ sample _ data ( wrapped, instance, args, kwargs ) : def _ bind _ params ( sample, * ...
[ 0.09057225286960602, -0.21772052347660065, 0.5908622145652771, -0.3287319540977478, -1.2766817808151245, 0.44725608825683594, 0.010406318120658398, -0.5988532304763794, 0.08754531294107437, 0.8041080236434937, 0.45336708426475525, -0.19927893579006195, 0.18078094720840454, -0.4128584265708...
def is _ server _ ready ( self, headers : dict [ str, t. any ] =... ) - > bool :
[ -1.9366906881332397, -0.5330416560173035, 0.7033023238182068, -0.3791155517101288, -0.07481450587511063, -0.14298675954341888, -1.015344262123108, -0.2570856213569641, -0.28369784355163574, 0.3326348662376404, -1.2290611267089844, 0.19008663296699524, -0.44083768129348755, 0.28460115194320...
def register _ type ( self, _ type : str, *, create _ instance _ func : callable [..., union [ basenode, automljob ] ] = none, load _ from _ rest _ object _ func : callable [ [ any ], union [ basenode, automljob ] ] = none, nested _ schema : union [ nestedfield, list [ nestedfield ] ] = none, ) : # pylint : disable = n...
[ -0.7334847450256348, 0.6643906235694885, 0.8494337201118469, -0.3657470941543579, 0.9134856462478638, -0.11664105951786041, 0.6655895709991455, -0.2175193727016449, -0.9484226107597351, -0.7295902967453003, -1.3823270797729492, 0.9032493233680725, 0.146310493350029, -0.2653655707836151, ...
def resize ( d, xf, yf ) : x, y = d [ " size " ] x * = xf y * = yf d [ " size " ] = ( x, y )
[ -0.7300774455070496, 1.0775110721588135, 0.34319254755973816, -1.0830364227294922, 0.6755355596542358, -0.6368614435195923, -0.5104166269302368, 0.0042305574752390385, -0.6257396936416626, -0.34115660190582275, -0.3221917748451233, -0.294434517621994, 0.7656322121620178, -0.461201310157775...
def _ restore ( self, filename ) : save _ file = np. load ( filename ) self. _ train _ filenames = save _ file ['train _ filenames']. tolist ( ) self. _ train _ pos = np. asscalar ( save _ file ['train _ pos'] ) self. _ train _ size = np. asscalar ( save _ file ['train _ size'] ) self. _ validation _ filenames = save _...
[ -0.5169112682342529, -1.0142698287963867, 0.5219875574111938, -1.1465508937835693, 0.28404146432876587, 0.008111587725579739, 0.7309098839759827, 0.5378182530403137, -0.788796067237854, 0.2878285050392151, -0.4440670311450958, 0.030974004417657852, -0.11469165235757828, -0.5068863034248352...
def test _ neg _ metagraph _ split _ neg ( ) : from wbia. algo. graph import demo from wbia. algo. graph. state import incmp, negtv, postv, unkwn, unrev # noqa # create a graph with 4 ccs, with 3 - pos - redun, and no negative edges infr = demo. demodata _ infr ( num _ pccs = 4, pcc _ size = 5, pos _ redun = 3, ignore ...
[ -0.2135157734155655, 0.4792881906032562, 0.5993185043334961, 0.3451201617717743, -0.3446500301361084, 0.8789396286010742, 0.13053986430168152, 0.47556954622268677, 0.9926536083221436, 0.2794434726238251, -0.3782930076122284, -0.3750564157962799, -0.9794232845306396, -0.22538359463214874, ...
def metrics _ to _ df ( metric _ logs : list [ logtype ], group _ metrics : callable [ [ list [ logtype ] ], dict [ str, list [ logtype ] ] ] = group _ metrics, aggregate _ metrics : callable [ [ list [ logtype ] ], list [ logtype ] ] = aggregate _ metrics, ) - > dict [ str, pd. dataframe ] : grouped _ metrics : dict [...
[ -0.18097293376922607, 0.8735427260398865, 0.5690399408340454, 0.13155312836170197, -0.11776101589202881, -0.4453164339065552, 0.7642788290977478, -0.49958568811416626, -0.5026858448982239, 0.2568340599536896, 0.4462655484676361, 0.8857253789901733, 0.33535146713256836, -0.02750156819820404...
def _ generate _ possible _ fields ( self, square, direction, speed ) : square _ cn = [ 0, 0 ] square _ tl = [ 0, 0 ] square _ tr = [ 0, 0 ] square _ su = [ 0, 0 ] square _ sd = [ 0, 0 ] # right and down are positive directions, left and up are negative dir _ factor = 1 if direction = = directions. down or direction = ...
[ -0.3802291750907898, 0.13749271631240845, 0.6965252757072449, -0.7572251558303833, -0.41524064540863037, -0.20132313668727875, 0.30310505628585815, 0.05279003083705902, 0.44391849637031555, 0.4525468647480011, -1.2100008726119995, -0.405887246131897, 0.43899989128112793, 0.3023639619350433...
def to _ dict ( self ) : d = self. _ _ dict _ _. copy ( ) d ['metric'] = d ['metric']. _ _ name _ _ if hasattr ( d ['aggregation _ type'],'_ _ call _ _') : d ['aggregation _ type'] = d ['aggregation _ type']. _ _ name _ _ return d
[ -0.4732808470726013, 0.2228257954120636, 0.7547850012779236, -0.7472944259643555, -0.47123685479164124, 0.35703086853027344, -0.009703991003334522, -1.0612459182739258, -0.13441616296768188, 0.7802497148513794, 0.38647282123565674, 0.4957631826400757, 0.7150810956954956, 0.5401216149330139...
def plot _ rho _ delta ( x, y ) : plt. plot ( x, y,'k.') plt. title ('delta on rho') plt. xlabel ('rho') plt. ylabel ('delta') plt. xlim ( - 0. 5, max ( x ) + 1 ) plt. ylim ( 0, max ( y ) + 1 )
[ 0.6078113317489624, -0.29552584886550903, 0.8807743191719055, 0.32475680112838745, -0.7388103008270264, 1.5005128383636475, 0.05087529122829437, -0.6026924252510071, -0.6101393699645996, 0.19018734991550446, -0.4118106961250305, 1.007736325263977, -0.1826253980398178, 0.2876879572868347, ...
def kelvin _ converter ( value, convert _ to ) : if convert _ to = = " °c " : return f " { str ( round ( value - 273. 15, 2 ) ) } { convert _ to } " elif convert _ to = = " °f " : return f " { str ( round ( ( value - 273. 15 ) * 9 / 5 + 32, 2 ) ) } { convert _ to } "
[ -0.22353723645210266, -0.5031306147575378, 0.567176878452301, -0.7111362218856812, -0.8912464380264282, -0.5457265377044678, -0.3807702660560608, -0.1434408277273178, -0.5489665269851685, 0.45674580335617065, 0.31944963335990906, 0.18709801137447357, 0.6591033339500427, 0.4588819146156311,...
def searchform _ factory ( model, form = searchform ) : # build up a list of attributes that the meta object will have. attrs = {'model': model } # if parent form class already has an inner meta, the meta we're # creating needs to inherit from the parent's inner meta. parent = ( object, ) if hasattr ( form,'meta') : pa...
[ -0.121992327272892, 0.08502993732690811, 0.6430830955505371, 0.2982519865036011, -0.678798496723175, -0.4531691074371338, -0.8360185623168945, -0.2663190960884094, -0.16369636356830597, -0.9926417469978333, -0.8001168370246887, -0.3136496841907501, 0.6171722412109375, -0.3141773045063019, ...
def run ( self, logger : logging. logger, command : str, cpu : int ) - > none : # container - specific logic should be in _ run ( ). this wrapper traps signals assert not self. _ running if command. strip ( ) : # if the command is empty then don't bother with any of this with terminationsignalflag ( logger ) as termina...
[ -0.3329503834247589, 0.3720095455646515, 0.5057910084724426, 0.5396431684494019, -0.12372012436389923, 0.2730381190776825, -0.5639054775238037, -0.12256557494401932, -0.20854100584983826, -0.343191921710968, -0.35047540068626404, 0.37040457129478455, -0.1756189614534378, 0.4595975279808044...
def getarandomfreesample ( self, num ) : failtime = 0 ; while ( failtime < num ) : rnd1 = randrange ( 0, self. mworld. mwidth ) ; rnd2 = randrange ( 0, self. mworld. mheight ) ; if ( self. mobstmgr. isconfiginobstacle ( ( rnd1, rnd2 ) ) ) : continue ; newsamp = true ; for sample in self. mdistsamples : if sample. withi...
[ -0.6358234882354736, -0.4831255078315735, 0.6203649640083313, -0.04288502782583237, -1.3318102359771729, 0.013692102394998074, 0.1667403280735016, -1.3766614198684692, 0.6805679202079773, 0.006814912892878056, 0.35811299085617065, 0.4508827328681946, -0.7007363438606262, 0.4713716804981231...
def ipv4 _ cidr _ to _ netmask ( bits ) : netmask ='' for i in range ( 4 ) : if i : netmask + = '.'if bits > = 8 : netmask + ='% d'% ( 2 * * 8 - 1 ) bits - = 8 else : netmask + ='% d'% ( 256 - 2 * * ( 8 - bits ) ) bits = 0 return netmask
[ -0.6663907766342163, -0.3229936361312866, 0.3788568377494812, -0.0009510068339295685, 0.6934831142425537, -0.00269356113858521, 0.2117493748664856, -1.160652995109558, 0.5366058349609375, -0.30419492721557617, -1.0347415208816528, -0.7458692789077759, -0.03250155597925186, 0.02171342261135...
def randomlayer ( layer _ a, layer _ b, prob _ a ) : condition = tl. serial ( tl. randomuniform ( ), tl. fn ('smallerthan ', lambda x : x < prob _ a ) ) return tl. cond ( condition, layer _ a, layer _ b )
[ 1.2033624649047852, -0.7034856677055359, 0.2902301549911499, -0.3001237213611603, -0.07750379294157028, 0.7261052131652832, 0.25490713119506836, -0.3833322525024414, 0.08134688436985016, -0.3594381511211395, 0.44290003180503845, 0.34584328532218933, -0.5151102542877197, 0.19477713108062744...
def deeplabv3 _ resnetd101b _ voc ( pretrained _ backbone = false, classes = 21, aux = true, * * kwargs ) : backbone = resnetd101b ( pretrained = pretrained _ backbone, ordinary _ init = false, bends = ( 3, ) ). features del backbone. final _ pool return get _ deeplabv3 ( backbone = backbone, classes = classes, aux = a...
[ -0.340907484292984, 1.1135549545288086, 0.7469987869262695, 0.1247059777379036, 0.9933176040649414, 0.45617759227752686, 0.3587161898612976, 0.3855138421058655, 0.0016960009234026074, 0.08331248909235, -0.0439574234187603, 0.7589412927627563, -0.5870645046234131, -0.9307976961135864, -1....
def _ _ validate _ http _ response _ code ( http _ response _ code : int ) : if http _ response _ code = = 200 : return true # i assume that only 200 is acceptable response ( not generally 2 * * ) # else : raise valueerror ('http reponse code is not valid.')
[ 0.007017823401838541, -0.27494508028030396, 0.4755040109157562, -0.5019224286079407, 0.16548334062099457, 0.360828697681427, -0.08773495256900787, 0.26186877489089966, -0.0001325356715824455, 0.31460413336753845, 0.4852336347103119, -0.320753276348114, 0.03463117033243179, -0.1501189470291...
def die ( self ) : # play dying animation self. dyingcounter = int ( round ( dying _ duration * framerate ) ) self. subframecounter = 0 self. imagecounter = 0
[ -0.38870951533317566, -0.5582992434501648, 0.31324225664138794, 0.6360688805580139, 0.7846985459327698, 0.3119919002056122, 0.6755224466323853, 0.24876683950424194, -0.6353464722633362, -0.37330275774002075, 0.017776019871234894, 0.19091345369815826, 0.5996246933937073, 1.1465768814086914,...
def is _ hash256 ( s ) : if not s or not isinstance ( s, str ) : return false return re. match ('^ [ 0 - 9a - f ] { 64 } $ ', s. strip ( ), re. ignorecase )
[ -0.020570605993270874, -0.29394853115081787, 0.4478083550930023, 0.5934504866600037, -0.5062803626060486, -0.14255812764167786, -0.3961299955844879, 0.2147684246301651, 0.5380579233169556, 0.29333242774009705, -0.35375329852104187, 0.596416175365448, -0.2463599443435669, 0.0558687113225460...
def html ( self ) : html = render ( self. html _ template, self. adict ) return premailer. transform ( html ) # inline css styles
[ -0.6680027842521667, 0.8425977230072021, 0.1562667191028595, -0.5580739974975586, -0.9486702084541321, -0.19286540150642395, -0.5252730846405029, 1.3324114084243774, 0.1548343151807785, -0.03327444940805435, 0.7361603379249573, -0.3082965612411499, 0.07609789818525314, -0.05067990347743034...
def handle _ request ( self, * * data ) : # get the class from the request type request _ class = request _ classes. get ( data ['type'], request _ classes ['default'] ) # create instance request = request _ class ( * * data ) # process the request and return the result try : response = request. do _ process ( ) except...
[ -1.2542847394943237, -0.23692633211612701, 0.6657813787460327, 0.15344847738742828, 0.9024536609649658, -0.3128833472728729, -0.6038727164268494, -0.27775052189826965, 0.9075453877449036, -0.3066694438457489, 0.8805856108665466, -0.7957521677017212, -0.3418278098106384, -0.3746107220649719...
def find _ matching _ file _ in _ course ( self, course _ id, file _ ids ) : # find the files in the current course. we call this for the side effect of storing the files in the db _ = self. _ api. list _ files ( course _ id ) for file _ id in file _ ids : file = self. _ file _ service. get ( file _ id, type _ = " canv...
[ 0.9377272129058838, -0.9505409002304077, 0.5083096623420715, -0.36070138216018677, 0.41241148114204407, 0.0749911516904831, -0.2807002067565918, -0.38930410146713257, -0.5472378730773926, 0.1287560760974884, 0.7360979318618774, -0.05092174559831619, -1.03231680393219, 0.767135500907898, ...
def _ getosfamilyinfo ( self, session, osfamilyname, osfamilyversion, osfamilyarch ) : try : return session. query ( operatingsystemsfamilies ). filter ( and _ ( operatingsystemsfamilies. name = = osfamilyname, operatingsystemsfamilies. version = = osfamilyversion, operatingsystemsfamilies. arch = = osfamilyarch ) ). o...
[ -0.037103813141584396, 0.14083272218704224, 0.39957860112190247, 0.26294252276420593, -0.5164427757263184, -0.5699412822723389, -0.1965290904045105, -0.9796804189682007, -0.1104392483830452, -0.20830988883972168, 0.1659955531358719, -0.4958198368549347, 0.13546699285507202, -0.587067186832...
def _ _ get _ vulns _ counter ( self, vuln ) : m _ counter = counter ( ) m _ counter ['critical'] = 0 m _ counter ['high'] = 0 m _ counter ['middle'] = 0 m _ counter ['low'] = 0 m _ counter ['informational'] = 0 m _ total = 0 for l _ v in vuln : if not l _ v. false _ positive : m _ total + = 1 m _ counter [ l _ v. leve...
[ -0.5102138519287109, -1.2330034971237183, 0.48599153757095337, -0.5833084583282471, -0.0405486524105072, -0.08068326115608215, -0.4915781021118164, 0.5449512004852295, -0.1311163753271103, 0.29232853651046753, -1.2602466344833374, -0.21018864214420319, -0.10920161008834839, 0.8229823112487...
def prep _ wikidata ( wikidata _ df, category, rating, year ) : columns = [ category,'label ','publication _ date ','wikidata _ id ','rotten _ tomatoes _ id'] if rating = ='return': columns + = ['return'] wikidata _ df = wikidata _ df [ columns ] wikidata _ df = wikidata _ df. dropna ( subset = [ category ] ) if rating...
[ -0.4542204439640045, 0.41185659170150757, 0.6691452264785767, -0.5726732015609741, -0.26842769980430603, 0.6499531269073486, -1.1259210109710693, 0.6209836602210999, -0.28816986083984375, 0.7271010279655457, 0.7561290264129639, 0.36193186044692993, 0.2638378441333771, -0.40793943405151367,...
def set _ esn ( self, esn ) : if not self. get _ esn ( ) and esn : self. addon. setsetting ('esn ', esn ) return true return false
[ -0.89942866563797, 0.2690643072128296, 0.5641991496086121, 0.2588525116443634, 0.3111301064491272, -0.4728042781352997, -0.9156432747840881, -0.15390066802501678, 0.9490159749984741, 0.4641965627670288, -1.5834237337112427, -0.48273369669914246, -0.3728800117969513, 0.05559392273426056, ...
def test _ submit _ jobs ( self ) : body = jobparams ( ) response = self. client. open ('/ cpsc490 / cplex _ server / 1. 0. 0 / submitjobs ', method ='get ', data = json. dumps ( body ), content _ type ='application / json') self. assert200 ( response,'response body is :'+ response. data. decode ('utf - 8') )
[ -0.7508225440979004, 0.25708410143852234, 0.5730434060096741, 0.16923987865447998, 0.07836595922708511, 0.5714048147201538, 0.510959267616272, -0.6956198215484619, -0.6302865743637085, -0.7573515176773071, -1.5890722274780273, 0.6131117939949036, -1.5299216508865356, 0.5044929385185242, ...
def users _ post ( ) : obj = request. get _ json ( silent = true ) if obj is none : return " not a json ", 400 if " email " not in obj : return " missing email ", 400 if " password " not in obj : return " missing password ", 400 obj = user ( * * obj ) obj. save ( ) return jsonify ( obj. to _ dict ( ) ), 201
[ -1.1441553831100464, -0.41934114694595337, 1.0452266931533813, 0.5886724591255188, -0.12131757289171219, 0.11050541698932648, -0.5191010236740112, -0.28878411650657654, 0.021273992955684662, 0.19610388576984406, -1.1878383159637451, -0.5320528149604797, -0.35380667448043823, 0.227722182869...
def test _ cancelled _ events _ shown _ in _ booking _ list ( self ) : booking. objects. all ( ). delete ( ) ev = baker. make _ recipe ('booking. future _ ev ', name = " future event ", cancelled = true ) baker. make _ recipe ('booking. booking ', user = self. user, event = ev, status ='cancelled') # check there are no...
[ 0.12545375525951385, 0.904348611831665, 0.38215136528015137, 1.1899925470352173, -0.9101802706718445, 0.3156405985355377, -0.21560415625572205, 1.9823980331420898, 0.03566116467118263, 0.05916246399283409, -0.6605914235115051, -0.8200669288635254, 0.3755088746547699, 0.3934464454650879, ...
def contribute _ to _ class ( self, process, fields, name ) : super ( ). contribute _ to _ class ( process, fields, name ) self. inner. name = name self. inner. process = process
[ -0.5868245959281921, -0.6753003597259521, 0.4892815351486206, -0.9576960802078247, 0.03671012818813324, 0.6375575065612793, -0.482403963804245, 0.4729028642177582, -0.15839561820030212, -0.6815524101257324, -1.2924152612686157, 0.3935794532299042, -0.10797315090894699, 0.920821487903595, ...
def check _ view _ permissions ( self ) : if self. action in ( " create ", " partial _ update ", " update ", " destroy " ) : result = has _ perm ( self. request. user, " core. can _ manage _ projector " ) else : result = false return result
[ -0.5109636783599854, 0.7930209040641785, 0.6776289939880371, 0.9898104071617126, -0.767792284488678, 0.38846173882484436, 0.49359506368637085, -0.2829625904560089, 0.12432357668876648, -0.549761950969696, 0.7029142379760742, -0.06539830565452576, -1.1328985691070557, 0.6170443296432495, ...
def run ( self ) : try : while true : self. printmenu ( ) choice = self. getmenuchoice ( 8 ) if choice = = 1 : self. listallcontacts ( ) elif choice = = 2 : self. createmenu ( ) elif choice = = 3 : self. querymenu ( ) elif choice = = 4 : self. updatecontactmenu ( ) elif choice = = 5 : self. deletecontactmenu ( ) elif c...
[ -1.0740022659301758, -0.24829241633415222, 0.706881046295166, 0.8624346852302551, 0.7536181807518005, 0.2430209219455719, 1.0455362796783447, -0.6255221962928772, 0.14419704675674438, -0.6892564296722412, -0.2010108381509781, -0.5801165699958801, -1.119457483291626, 0.08333558589220047, ...
def calc _ torsion ( vec _ 1, vec _ 2, vec _ 3, vec _ 4 ) : # create vectors between the four atoms line _ 1 = subtract ( vec _ 1, vec _ 2 ) line _ 2 = subtract ( vec _ 2, vec _ 3 ) line _ 3 = subtract ( vec _ 3, vec _ 4 ) # normal vectors between two intersecting planes created by new vectors plane _ 1 = normalize ( c...
[ 0.870551586151123, -0.025607574731111526, 0.9923938512802124, -0.033006057143211365, 0.019513286650180817, 0.558075487613678, 0.7546889781951904, 0.08811352401971817, -1.7521252632141113, 0.6523124575614929, -0.29609352350234985, -0.46928438544273376, -0.5403323769569397, -0.63315862417221...
def get _ category ( id _, session ) - > database. category : return session. query ( database. category ). get ( id _ )
[ -0.11313863098621368, 0.20439501106739044, 0.09189955145120621, 0.26128607988357544, 0.28569942712783813, -0.8226449489593506, -0.656665563583374, -0.5900048613548279, 0.30017027258872986, -0.6233182549476624, 0.6326032876968384, 0.3402329683303833, 1.0104868412017822, 0.05183899402618408,...
def testresolvequerywithwrongencoding ( self ) : with login ( u'username ', uuid4 ( ), self. transact ) as session : deferred = self. facade. resolvequery ( session,'fluiddb / about = = " \ xff "') yield self. assertfailure ( deferred, tbadrequest )
[ 0.28674423694610596, 0.6556662321090698, 0.5978535413742065, 0.5580005049705505, 0.4122486412525177, -0.2081492692232132, -0.884408712387085, -0.6624246835708618, -0.44520702958106995, -0.47081854939460754, -0.08310773968696594, -0.6201633214950562, -0.11455731093883514, 1.161626935005188,...
def slow _ chaffling ( self ) : chaff _ txt = const. tls _ uni _ chaff _ url _ path chaff _ msg = ccpmessage. chaff _ msg ( len ( chaff _ txt ), buf = chaff _ txt ) msg _ buf = chaff _ msg. pack ( ) cnt = 1 if self. num _ chaff _ received < 5 : cnt + = 1 if self. num _ data _ received > 0 : cnt + = 2 if self. num _ dat...
[ 0.24445950984954834, 0.9176802635192871, 0.5530024170875549, -1.4059929847717285, 0.34269657731056213, 0.1241263896226883, 1.2794994115829468, -0.30477961897850037, -0.1292092204093933, -1.0590766668319702, -0.7076927423477173, 0.08565405011177063, -0.9333103895187378, 0.3063623905181885, ...
def by _ type ( objects, t ) : return filter ( lambda x : x. type = = t, objects )
[ -0.4761236608028412, -1.2562785148620605, 0.53089439868927, 0.4231394827365875, 0.5262736082077026, 0.039462171494960785, 0.17933064699172974, -0.6933586001396179, -1.1131175756454468, 1.7880127429962158, -0.9122408032417297, 0.4391169250011444, 0.6005716919898987, -0.5907738208770752, -...
def _ _ config ( self ) : self. config = conf. confobject ( ) self. config. optparser. set _ conflict _ handler ( " resolve " ) registry. register _ global _ options ( self. config, commands. command ) base _ conf = { " profile " : " winxpsp3x86 ", " use _ old _ as " : none, " kdbg " : none, " help " : false, " kpcr " ...
[ 0.5637701153755188, -0.2517564594745636, 0.5367655754089355, -0.3649846017360687, 0.2595539689064026, -0.6494119167327881, 0.22851140797138214, 0.23219887912273407, -0.12248788774013519, 0.00661092484369874, -0.596301794052124, -0.3887259066104889, -0.396842896938324, 0.9933516383171082, ...
def solve _ mod _ eq ( a : int, m : int, b : int, n : int ) - > int : u, v, d = ext _ gcd ( m, n ) assert ( d = = 1 ) mn = m * n x = ( a * n * v + b * m * u ) % mn if x < 0 : x + = mn return x
[ -0.26957738399505615, 0.7919079065322876, 0.3950745761394501, 0.14937686920166016, -0.029909536242485046, -0.17590630054473877, -0.4185272753238678, -0.1945236325263977, 0.5869342088699341, 0.2683456838130951, 0.31728142499923706, 0.12992528080940247, -1.003395438194275, -0.335078328847885...
def uploadfile ( self ) : if not self. existingfilemd5 : self. fileobj. save ( os. path. join ( upload _ folder, self. filename ) ) else : print " # # # file present not uploading # # # "
[ -0.29057344794273376, -0.4716404676437378, 0.6312494874000549, -0.05439724773168564, 0.8402383327484131, 1.2728184461593628, 1.346412181854248, 0.5097830295562744, -1.5001637935638428, 0.08878891915082932, -0.4761356711387634, -0.9960952997207642, -0.8491217494010925, 0.8982733488082886, ...
def test _ index _ view _ with _ no _ projects ( self ) : response = self. client. get ( reverse ('projects : index') ) self. assertequal ( response. status _ code, 200 ) self. assertcontains ( response, " no projects are available. " ) self. assertquerysetequal ( response. context ['latest _ project _ list'], [ ] )
[ -0.14340849220752716, 0.7997809052467346, 0.038606300950050354, -0.6883602738380432, 0.7980995774269104, 1.0615214109420776, 0.5778976082801819, -0.2667042911052704, 0.5812791585922241, -0.577048122882843, -0.08431283384561539, -0.07368505746126175, -0.0014854426262900233, -0.1259150356054...
def get _ lat _ long ( city ) : url ='https : / / maps. googleapis. com / maps / api / geocode / json'params = dict ( address = city, key = google _ maps _ api _ key ) try : resp = requests. get ( url = url, params = params ) location = json. loads ( resp. text ) ['results'] [ 0 ] ['geometry'] ['location'] return locat...
[ 0.06637240946292877, -0.6916789412498474, 0.6880051493644714, -0.875012993812561, -0.7718106508255005, -0.041052259504795074, -1.1958198547363281, 0.14864003658294678, 0.3956393599510193, 1.0078024864196777, -0.5246090292930603, 0.2963373363018036, -0.46436381340026855, 0.08627615123987198...
def enter ( self, e ) : string = self. terminal. get ( 1. 0, tk. end ) [ self. line _ start : ] self. line _ start + = len ( string ) self. p. stdin. write ( string. encode ( ) ) self. p. stdin. flush ( )
[ 0.227067768573761, -0.14464306831359863, 0.5534207820892334, 0.13200980424880981, 0.513374388217926, 0.6161568760871887, 0.5871556997299194, -0.08956003934144974, -0.5782504677772522, 0.15483585000038147, -0.40218958258628845, 0.7267311215400696, -0.439522922039032, 0.2046058177947998, 0...
def _ compute ( accum, linear, base _ lr, lr _ power, l1, l2 ) : with ops. name _ scope ( " compute _ " + accum. op. name ) : one _ t = constant _ op. constant ( 1. 0, dtype = types. float32 ) two _ t = constant _ op. constant ( 2. 0, dtype = types. float32 ) learning _ rate = math _ ops. pow ( accum, lr _ power ) * ba...
[ 0.41805872321128845, -0.2391054332256317, 0.6154589653015137, 0.36847957968711853, -0.11961700022220612, -0.707245409488678, -0.41966527700424194, -0.517521321773529, -0.9757150411605835, 0.3721260726451874, 0.6370102167129517, 0.6036760807037354, 1.0495213270187378, -0.4255668818950653, ...
def run _ client ( ) : ec2 _ async _ result = start _ ec2 ( ) new _ session = session ( ) try : # client fetches the server ip address asynchronously new _ session. start _ client ( ec2 _ async _ result ) except keyboardinterrupt : lambda _ proxy ('stop _ instance') exit ( 0 )
[ -0.9865179061889648, -0.10155759006738663, 0.40554893016815186, -0.5157446265220642, -0.11246425658464432, 0.311942994594574, 0.22896477580070496, -0.18400713801383972, -0.6315914392471313, -0.04075086489319801, -0.23405671119689941, 0.4037282168865204, 0.03623625636100769, -1.434041142463...
def get _ message ( self ) : pass
[ -0.4314052164554596, 0.01562337763607502, 0.28463637828826904, 0.7046055197715759, 1.070294737815857, 0.10174479335546494, -0.3326311409473419, -0.7295514345169067, -0.8238279819488525, -1.2831419706344604, 0.22650650143623352, 1.245921015739441, -0.5363543629646301, 0.670623779296875, -...
def match _ cribbed _ to _ words ( string : str ) - > [ [ str ] ] : total = 0 multi _ word _ matches = [ ] # todo implement allowing common punctuation to appear # reject results that if contains _ illegal _ symbols ( string ) : return [ ] crib _ split = convert _ cribbed _ to _ regex ( string ) # check that each segme...
[ -0.0622873455286026, 0.1539289802312851, 0.6068863272666931, 0.6165465116500854, 0.179432675242424, 0.18031379580497742, 0.7979912161827087, 0.33551645278930664, 0.09488355368375778, 0.49465101957321167, -0.3781949579715729, -0.7192866802215576, -1.029665231704712, 0.8374726176261902, -1...
async def get _ reverse _ objects _ topranked _ for _ lst ( entities ) : # run the query res = await runquerysinglekey ( cachereverseobjecttop, entities, " " " select? base? prop? parent where { values? base { % s }? parent? prop? base. filter (? prop not in ( " " " + ex _ cls + " " " ) ) # exclude wikilinks and redire...
[ -1.262681245803833, 0.23744575679302216, 0.692499041557312, -0.32210397720336914, 0.3040023744106293, -0.05378077179193497, -0.5210362672805786, 0.25885680317878723, -0.2612749934196472, 0.04998934641480446, -0.11135625839233398, 0.27408283948898315, -0.3135305345058441, 0.0936355367302894...
def retrieve ( self, request, pk = none ) : try : user = user. objects. get ( pk = pk ) serializer = profileuserserializer ( user, context = {'request': request } ) return response ( serializer. data ) except exception as ex : return httpresponseservererror ( ex )
[ -0.3990788161754608, 0.2272847443819046, 0.5567770004272461, 0.7278914451599121, -0.056433603167533875, -0.3244628310203552, 0.2709622085094452, -0.7144842147827148, 0.7969592213630676, -0.9036645293235779, 0.039212845265865326, -0.3931949734687805, -0.4521235525608063, -0.402738094329834,...
def _ log _ user ( self, user : user ) - > str : return f " { user. first _ name } ( id = { user. id } ) "
[ -0.119328573346138, -0.5125799179077148, 0.2959776520729065, -0.29781943559646606, -0.8241841793060303, 0.3884749412536621, -0.841434895992279, -0.7723381519317627, 0.1215074360370636, -0.5005861520767212, -0.5871523022651672, 0.08087269961833954, 0.7975056767463684, -0.022542186081409454,...
def test _ log _ vectorization ( self ) : n _ points = 10 base _ points = self. beta. random _ point ( n _ samples = n _ points ) point = self. beta. random _ point ( ) tangent _ vecs = self. metric. log ( base _ point = base _ points, point = point ) result = tangent _ vecs. shape expected = ( n _ points, 2 ) self. as...
[ 0.6843659281730652, 0.6782519221305847, 0.5000485777854919, -0.008789789862930775, 1.358144760131836, 0.21683183312416077, 0.006836578715592623, -0.650331974029541, -0.504056453704834, -0.29397574067115784, -0.5500640869140625, -0.3760010898113251, 0.38811632990837097, -0.16170570254325867...
def _ weight _ trend ( self, series ) : today = get _ now ( ). date ( ) trend = [ ('a year ago ', today - datetime. timedelta ( days = 365 ) ), ('six months ago ', today - datetime. timedelta ( days = 183 ) ), ('a month ago ', today - datetime. timedelta ( days = 30 ) ), ('a week ago ', today - datetime. timedelta ( da...
[ -0.035378530621528625, 0.29512688517570496, 0.72978675365448, -0.475936621427536, -0.4348854422569275, -0.1633044183254242, 0.25386640429496765, -1.637341856956482, -0.3134750425815582, -0.21408534049987793, -0.1459292471408844, -0.3892674446105957, 0.9461029767990112, 0.8310754895210266, ...
def _ check _ referenced _ hash ( transaction, blockchain ) : for tx _ in in transaction. inputs : tx = blockchain. get _ transaction ( tx _ in. tx _ hash ) if tx : # todo : implement check if outout is already spent. ( ti ) < 2017 - 05 - 22 13 : 32 > pass else : # transaction not found. return false return true
[ 0.4464482367038727, -0.33511418104171753, 0.7237432599067688, 0.11192202568054199, 0.4798215329647064, -0.19747059047222137, 0.5147197842597961, -0.9711790680885315, -0.7118576169013977, 1.2459746599197388, 0.42095938324928284, -0.2790754735469818, -0.476089209318161, 0.7601600885391235, ...
def getprocessor ( self, arg1, arg2 = none, direction = none, context = none ) : pass
[ -1.0345805883407593, 0.10608703643083572, 0.47837918996810913, -0.11858370155096054, 0.24129091203212738, -0.7128170728683472, -0.24345993995666504, 0.06791023910045624, -0.4515934884548187, 0.1861913651227951, 0.18344415724277496, 1.2642651796340942, -0.5067062973976135, -0.09828748553991...
def retry ( iterations : int = 3 ) : def decorator ( func ) : @ functools. wraps ( func ) def wrapper ( * args, * * kwargs ) : count = 0 while count < iterations : try : result = func ( * args, * * kwargs ) return result except exception : print ( sys. exc _ info ( ) ) count + = 1 else : msg = f'function { func. _ _ na...
[ -0.23555967211723328, 0.46906253695487976, 0.5975444316864014, -0.6362515091896057, -1.078908085823059, -0.12717069685459137, -0.3130268156528473, -0.11939862370491028, 0.18639230728149414, -0.07490883022546768, 0.5075750350952148, 0.28387004137039185, -0.3713570535182953, -0.4188259243965...
def password ( self, value ) : self. _ update _ values ('password ', value, parent _ attribute ='inputs')
[ -0.7404161691665649, 0.16297975182533264, 0.5471503138542175, 0.2638210952281952, 0.15973421931266785, 0.8603377938270569, 0.9597033858299255, -0.45744192600250244, 0.4485495686531067, 0.02634155936539173, -0.5950070023536682, -0.5948962569236755, 0.18643198907375336, 0.4913666248321533, ...
def reset _ particles ( x, boxsize ) : x [ x < 0 ] + = boxsize x [ x > boxsize ] - = boxsize return x
[ -0.5234658122062683, 0.011969898827373981, 0.4418516755104065, -0.7562971115112305, -0.18020713329315186, 0.16035504639148712, -1.0677260160446167, -0.6486563086509705, 0.07915816456079483, 0.14603270590305328, -0.9250423908233643, 1.0515263080596924, -0.5476272106170654, -1.17090833187103...
def getimportsinfo ( self ) : modinfos = [ ] for row in self. tablerows : if row ['abs _ tfilepath'] = ='' : modinfo = moduleinfo ( filename ='', iristr = row ['iri'] ) else : modinfo = moduleinfo ( filename = self. mbuilder. getmodulepath ( row ['iri'] ), iristr = self. mbuilder. getmoduleiristr ( row ['iri'] ) ) modi...
[ -0.3616923987865448, -0.6889194846153259, 0.295865535736084, 0.15731532871723175, 0.49917665123939514, 0.33133548498153687, -0.1513417512178421, -0.28424960374832153, -0.1971314698457718, 0.40006202459335327, -0.016430484130978584, -0.2495710253715515, 0.059970274567604065, 1.0514760017395...
def swerve _ solver ( module _ speeds, module _ angles, modules _ alpha, modules _ l ) : module _ x _ offsets = np. multiply ( modules _ l, np. cos ( modules _ alpha ) ) module _ y _ offsets = np. multiply ( modules _ l, np. sin ( modules _ alpha ) ) a = np. array ( [ [ 1, 0, 1 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 0, 1, 1 ],...
[ 0.11381629854440689, -0.6509249806404114, 0.889028787612915, -0.8896650671958923, -0.04766206815838814, -0.06738598644733429, 0.0031408467330038548, 0.20400914549827576, 0.14926348626613617, 0.636355996131897, -0.3559954762458801, -0.06747370213270187, -0.5058793425559998, 0.22643427550792...
def great _ circle _ distance ( self, * * kwargs ) : other _ latitude, other _ longitude = parse _ lat _ lng ( kwargs ) if other _ latitude is none or other _ longitude is none : return none return func. earth _ distance ( func. ll _ to _ earth ( self. latitude, self. longitude ), func. ll _ to _ earth ( other _ latitu...
[ 0.0025361075531691313, -0.16331425309181213, 0.676655113697052, -0.618547797203064, 0.19321578741073608, 0.42904284596443176, -0.6652878522872925, -0.6721752882003784, -0.11332275718450546, -0.0014059371314942837, -0.38675814867019653, 0.06695196032524109, -0.7368783354759216, 0.4223410189...
def testbatchnormkeepdims ( self ) : x _ shape = ( 3, 5, 4, 2 ) param _ shape = ( 2 ) keep _ dims _ param _ shape = ( 1, 1, 1, 2 ) x _ val = np. random. random _ sample ( x _ shape ). astype ( np. float32 ) m _ val = np. random. random _ sample ( param _ shape ). astype ( np. float32 ) v _ val = np. random. random _ sa...
[ 0.3516165316104889, 0.11014367640018463, 1.197356104850769, 0.7293635606765747, -0.5028368234634399, 0.36670663952827454, 0.1581472009420395, -0.6194795370101929, -0.6170734763145447, 0.6718111634254456, -0.7010907530784607, -0.1772533804178238, -0.05777997896075249, -0.19836267828941345, ...
def change _ head ( self, node ) : self. head = node
[ -0.8730146288871765, 0.17053021490573883, 0.3201959729194641, -0.3279126286506653, 0.307696670293808, 0.27488142251968384, -0.6427842378616333, -0.10855694115161896, 0.19392000138759613, 0.8694056272506714, -0.5480627417564392, 2.678691864013672, 0.2419479340314865, 0.22578461468219757, ...
def inputs ( self ) : return self. _ data. get ('inputs')
[ -0.7572696208953857, 0.562096893787384, 0.30458831787109375, 0.10932490229606628, 0.7790573835372925, 0.8506011366844177, 0.2746046781539917, -0.7340312004089355, 0.7361205220222473, -0.7386756539344788, -0.31024885177612305, 0.2699602544307709, -0.25983062386512756, -0.31371229887008667, ...
def data _ collection ( self ) : t = threading. currentthread ( ) while getattr ( t, " do _ run ", true ) : device _ bus = 1 device _ addr = 0x17 temp _ reg = 0x01 light _ reg _ l = 0x02 light _ reg _ h = 0x03 status _ reg = 0x04 on _ board _ temp _ reg = 0x05 on _ board _ humidity _ reg = 0x06 on _ board _ sensor _ er...
[ -0.5380532741546631, -0.44392451643943787, 0.8032696843147278, 0.03782277554273605, 0.16729868948459625, 0.7470238208770752, 0.07554615288972855, -0.22336380183696747, -0.23578664660453796, 0.3938121199607849, -0.31082242727279663, 0.3582432270050049, -0.6320212483406067, 1.373413562774658...
def add _ click ( self, x : int, y : int ) : self. data = self. data. append ( dict ( x = x, y = y, cl = 3 ), ignore _ index = true ) self. train _ algorithm ( ) self. render ( )
[ -0.6186252236366272, 0.9489662051200867, 0.5782728791236877, -0.5320006012916565, -0.1783626675605774, 0.38013961911201477, -0.5902547240257263, 0.1522449254989624, -0.12175998836755753, -0.5565506815910339, -0.3976065516471863, 0.3806527853012085, 0.5696619749069214, -0.4315822720527649, ...
def size ( self, value ) : if type ( value )! = int : raise typeerror ( " size must be an integer " ) else : if value > = 0 : self. _ _ size = value else : raise valueerror ( " size must be > = 0 " )
[ -0.7189888954162598, 0.46958088874816895, 0.6817731857299805, -0.1979648619890213, -0.293029248714447, 1.360428810119629, 0.7096163034439087, -0.492387592792511, -0.02328365296125412, -0.04816404730081558, 0.5382605791091919, -0.555014431476593, -0.6797930598258972, 0.926354169845581, 1....
def test _ info _ demo _ flight ( c, users : list [ user ], flights : list [ flight ] ) : httpretty. register _ uri ( httpretty. get, f " http : / / container - nodeodm : 3000 / task / { flights [ 1 ]. uuid } / info ", body = json. dumps ( { } ) ) _ auth ( c, users [ 1 ] ) resp = c. get ( reverse ('nodeodm _ proxy _ ta...
[ -0.029031164944171906, 0.9602152705192566, 0.8031059503555298, 0.028118882328271866, 0.5471519827842712, 0.8141404390335083, -0.2804635167121887, 0.19557301700115204, -0.8184274435043335, -0.6210147738456726, 0.20844724774360657, -0.0029680978041142225, 0.3308521807193756, -0.0350020043551...
def select _ from _ genes ( self, key, * confidence _ levels ) : genes _ to _ return = [ ] if confidence _ levels : genes = [ ] for level in confidence _ levels : assert level in [ 0, 1, 2, 3 ], ( " choose among the following levels : 3 ( green ), 2 ( amber ), " " 1 ( red ), 0 ( the rest ) " ) if str ( level ) in self....
[ -0.5085667967796326, -1.0209622383117676, 0.4255368709564209, 0.9013309478759766, 0.04517393186688423, -0.3468479514122009, -1.3089004755020142, 0.2664838135242462, -0.760948121547699, 0.6151790022850037, 0.3458458185195923, 0.6378569006919861, -0.9038918018341064, 0.9540340304374695, -0...
def do _ final _ plots ( self, make _ plots ) : # gather all populations s _ pop = [ ] p _ pop = [ ] t _ pop = [ ] for isle in self. isles : s _ pop _ i, p _ pop _ i, t _ pop _ i = isle. dump _ populations ( ) s _ pop = s _ pop + s _ pop _ i p _ pop = p _ pop + p _ pop _ i t _ pop = t _ pop + t _ pop _ i s _ pop = s _ ...
[ 0.31608617305755615, -0.252462774515152, 0.7134648561477661, 0.24826739728450775, 0.26357871294021606, 0.7857334613800049, 0.9714632630348206, 0.27829214930534363, -0.4901897609233856, -0.3599795997142792, 0.0042228419333696365, 0.38315099477767944, 0.5883253216743469, 0.11001156270503998,...
def restore _ previous _ signals _ handlers ( signals : iterable [ signaltype ], ) - > mapping [ signal. signals, signalhandlertype ] : replacing _ handlers = { } for sig in signals _ from _ names ( signals ) : previous _ handlers = signal _ handlers _ history. get ( sig, [ ] ) if not previous _ handlers : raise indexe...
[ 0.1805928349494934, -0.08560962975025177, 0.48688167333602905, 0.20343482494354248, 0.10118571668863297, -0.13380244374275208, 0.6185281872749329, -0.27530351281166077, 0.5787036418914795, 0.019787516444921494, -0.8173487782478333, 0.38432881236076355, -0.2322743833065033, 0.73255223035812...
def get _ output _ for ( self, inputs, * * kwargs ) : apow = inputs [ 0 ] x = inputs [ 1 ] def compute _ output ( i, w, a, x, h ) : " " " : param i : index : param w : weight vector ( n _ features, ) : param x : feature vector ( n _ nodes, n _ features ) : param h : n _ hops : param a : adjacency matrix ( n _ nodes, n ...
[ -0.5507543087005615, 0.47131115198135376, 0.6442188024520874, 0.7110205292701721, -0.5486083030700684, -0.7359591722488403, 0.41222915053367615, -0.3643837869167328, -0.5160995125770569, 0.47856780886650085, 0.4643392860889435, -0.3636090159416199, -0.5545324683189392, 0.5787679553031921, ...
def output _ measurements ( self, product _ definitions : dict [ str, datasettype ] ) - > dict [ str, measurement ] : raise notimplementederror
[ -1.1345247030258179, -0.04158758744597435, 0.2815054953098297, -0.26888298988342285, -0.5791178941726685, -0.07992536574602127, 0.1135629415512085, -0.7834069132804871, -0.15253710746765137, 0.4090075194835663, 0.18196997046470642, 0.14766094088554382, 0.5679146647453308, 0.906475901603698...
def _ _ filltaskqueueretryparameters ( self, retry _ options, retry _ retry _ parameters ) : if retry _ options. min _ backoff _ seconds is not none : retry _ retry _ parameters. min _ backoff _ sec = retry _ options. min _ backoff _ seconds if retry _ options. max _ backoff _ seconds is not none : retry _ retry _ para...
[ 0.24184614419937134, -0.37917983531951904, 0.611784040927887, 0.04331076517701149, 0.49031445384025574, -0.18190471827983856, -0.3071379065513611, -0.635248601436615, -0.3523060381412506, 0.9757571816444397, -0.5383680462837219, 0.7703859210014343, 0.03273269534111023, 0.047051865607500076...
def _ retrywhilenetworkerror ( func : callable ) - > callable : def _ func ( * args, * * kwargs ) : retrycount = 0 ret = none lasterror : exception = none while retrycount < define. waittaskretrytimes : try : ret = func ( * args, * * kwargs ) lasterror = none break except ( error. networkerror, requests. requestexcepti...
[ -0.1297866404056549, -0.23849573731422424, 0.6458085179328918, -0.7714548110961914, -0.4930061101913452, -0.42150333523750305, 0.2600330114364624, -0.6636723279953003, -0.2797269821166992, 0.036025356501340866, 0.2214016169309616, -0.12812106311321259, -0.4012267589569092, -0.7092766165733...
def disconnect ( self ) : # update the reconnect status to indicate that we shouldn't attempt to automatically reconnect self. _ reconnect _ status = ( 0, none ) # disconnect from the currently connected echo device self. _ bluetooth. disconnect ( )
[ -0.23091688752174377, -0.8601719737052917, 0.5039365291595459, 0.7571303844451904, 0.0141451396048069, 0.058939117938280106, -0.004024621099233627, 0.163809671998024, -0.4837326109409332, -0.4392005205154419, 0.19804103672504425, 0.4766581058502197, -0.3767852783203125, 0.2430478036403656,...
def info ( ) : global _ lutbl if _ lutbl is none : _ lutbl = _ load _ data ( ) return _ lutbl
[ 0.22562426328659058, -0.6364255547523499, 0.5237507820129395, 0.11935639381408691, -0.7769122123718262, 0.4041398763656616, -0.37402209639549255, -0.46919459104537964, -0.6405147910118103, -0.4083825647830963, -0.3097634017467499, -0.6321188807487488, -0.3528749644756317, -0.59977793693542...
def tick ( self, time ) : # time is received as time in milliseconds, convert to h m s h, m, s = self. mstohms ( time ) self. timelabel. settext ('% 02d : % 02d : % 02d'% ( h, m, s ) )
[ -0.25045517086982727, -0.30047711730003357, 0.7309168577194214, -0.7666963338851929, -0.02969294600188732, 1.0179436206817627, -0.20448262989521027, -0.14545166492462158, 0.08629348874092102, 0.9606624245643616, -0.7382259368896484, -0.20510253310203552, 0.10408098250627518, 0.771126091480...
def new ( * args, * * kargs ) : obj = itkimageserieswriterius3ius2. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ -0.392602801322937, -0.9223626852035522, -0.15646377205848694, -0.2710277736186981, -0.15978945791721344, -0.9881894588470459, -0.7174500823020935, -0.3440287709236145, -0.6067267656326294, 0.8388516902923584, -0.1842002272605896, 0.26086777448654175, 0.16467857360839844, 0.164211601018905...
def polylst _ parse ( polylst ) : polylst = [ float ( x ) for x in polylst ] polylsttup = [ ] for i in range ( 0, len ( polylst ), 2 ) : polylsttup. append ( tuple ( polylst [ i : i + 2 ] ) ) return polylsttup
[ -0.6188601851463318, -0.6897894740104675, 0.5810880064964294, -0.16457507014274597, -0.5370081067085266, 0.7144945859909058, -0.5174676179885864, -0.001566374790854752, 0.24170665442943573, 0.8471086025238037, -1.6561763286590576, -0.9118900299072266, 0.2539231777191162, 0.0434748232364654...
def generate _ config ( environment ) : if environment is none : raise valueerror ( " environment is none. is ` deployment _ env ` env var set? " ) print ( f " deploying to { environment } " ) environment = environment. lower ( ) if environment = = " local " : return localconfig ( ). build _ config _ dictionary ( ) eli...
[ -0.9769676923751831, -0.18430940806865692, 0.5750165581703186, -0.3290272355079651, -0.13163013756275177, 0.36856722831726074, -0.10924581438302994, 0.31616005301475525, -0.6449976563453674, 0.9965869784355164, -0.1918765753507614, -0.036834966391325, 0.1559419482946396, 0.6425138115882874...
def validate _ non _ transaction _ error _ event ( required _ intrinsics = { }, num _ errors = 1, required _ user = { }, forgone _ user = [ ] ) : @ function _ wrapper def _ validate _ non _ transaction _ error _ event ( wrapped, instace, args, kwargs ) : try : result = wrapped ( * args, * * kwargs ) except : raise else...
[ -0.2495334893465042, 0.16678021848201752, 0.6125388145446777, -0.13260222971439362, -0.8318558931350708, 0.5858177542686462, -0.012745087035000324, -0.4886471629142761, -0.31002962589263916, 0.9778854846954346, 0.5348178744316101, 0.17555879056453705, -0.00926639698445797, 0.31533667445182...
def labels _ to _ colors ( labels, palette = none ) : categories = sorted ( np. unique ( labels ) ) rgb = sns. color _ palette ( palette, n _ colors = len ( categories ) ) colors = map ( rgb2hex, rgb ) colormap = dict ( zip ( categories, colors ) ) return [ colormap [ x ] for x in labels ]
[ -1.1526517868041992, 0.30669400095939636, 0.32406795024871826, -0.4523150324821472, 0.354720801115036, 0.31958529353141785, -0.8725440502166748, 0.1384740024805069, 0.45430129766464233, 0.13179391622543335, -0.6999197602272034, 0.20451372861862183, 0.7715056538581848, -0.1591484248638153, ...
def scale _ features ( self ) : self. scaled _ train _ features = ( self. train _ features - self. features _ mean ) / self. features _ standard _ deviation self. scaled _ validation _ features = ( self. validation _ features - self. features _ mean ) / self. features _ standard _ deviation self. scaled _ test _ featur...
[ -0.5636765956878662, 0.030721483752131462, 0.38811126351356506, -0.016275642439723015, 0.48590755462646484, 0.6849842071533203, 0.1586083024740219, 0.13433676958084106, -1.1791043281555176, 0.586331844329834, -0.9889675974845886, 0.3602922260761261, -0.16488529741764069, 0.1451761573553085...
def aggregate _ recent _ history ( self, look _ back, prev _ glucose, prev _ insulin, prev _ carbs, prev _ activity, cur _ time ) : features = list ( ) for k in range ( 1, look _ back + 1 ) : delta = datetime. timedelta ( hours = k ) # sum of activity in last k hours sum _ ac = sum ( [ a ['value'] for a in prev _ activ...
[ 0.22553974390029907, 0.41104236245155334, 0.8331310749053955, 0.09730605036020279, 0.16261808574199677, -0.256447970867157, 0.5802035331726074, 0.19168485701084137, -1.0390691757202148, 0.061533376574516296, 0.0891285315155983, 0.4608753025531769, 0.1632409244775772, 0.32105937600135803, ...
def create _ data ( self ) : args = self. args files = os. listdir ( args. data _ dir ) task _ id = args. task _ id files = [ args. data _ dir + f for f in files if'task { } '. format ( task _ id ) in f ] # print ('files : { } '. format ( files ) ) trn _ file = [ f for f in files if self. args. target _ file in f ] [ 0...
[ -0.5390866994857788, -0.08044011890888214, 1.0141154527664185, -0.236937016248703, 0.5927119255065918, -0.22871056199073792, 0.534023106098175, -0.2967045307159424, -0.191724956035614, 0.11810570955276489, -0.3366478383541107, 0.7629273533821106, 1.106217384338379, -0.24543026089668274, ...
def test _ create _ profit _ stage ( self ) : profit _ stage = self. long _ future. create _ profit _ stage ( ) self. method _ test _ create _ stage ( stage = profit _ stage, name ='profit ', expression ='{ price _ a } < { current _ price } ', detail = {'price _ a': 480. 00,'amount _ a': 0. 0,'price _ b': 0. 0,'amount ...
[ -0.2088986337184906, -0.7358471751213074, 0.7455203533172607, 0.3639073073863983, 0.14316511154174805, 0.5338965654373169, -0.10611366480588913, -0.4366397261619568, -0.2810424864292145, 0.08889136463403702, -0.5209262371063232, 0.29548129439353943, 0.3897039592266083, 0.8483787178993225, ...
def dictionary _ encode _ column _ ( self, column : str ) : if column not in self. _ data. column _ names : raise valueerror ( f " column ( { column } ) not in table columns ( { self. _ data. column _ names } ). " ) casted _ schema : pa. schema = self. _ data. schema field _ index = casted _ schema. get _ field _ index...
[ -0.6150582432746887, -0.1250452846288681, 0.34504568576812744, -0.7469528913497925, 0.057987429201602936, 0.2246115803718567, 0.08367292582988739, 0.07431147992610931, -0.039725568145513535, 0.19929519295692444, -1.0919100046157837, 0.6808930039405823, 0.5498651266098022, -0.00363813224248...