text
stringlengths
25
2.19k
embedding
listlengths
768
768
def remove _ all _ media ( self ) : self. m ['media']. clear ( )
[ -0.35718536376953125, -0.49666067957878113, 0.25311657786369324, 0.01481933519244194, 0.12652896344661713, 0.4218534529209137, -0.4057072699069977, 0.17293618619441986, -0.3373943567276001, 0.2058613896369934, -0.11307349056005478, 0.5289044976234436, -0.49414241313934326, 0.98642420768737...
def sigmoid2 ( temperature, b, c ) : return 1 / ( 1 + np. exp ( b * ( temperature - c ) ) )
[ 0.5471339225769043, -0.7657966017723083, 0.348488986492157, 0.1405351758003235, 0.035698290914297104, 0.34567952156066895, -0.21599151194095612, 0.47459107637405396, -0.6604355573654175, 0.9549598693847656, -0.7585091590881348, -0.0686466321349144, -1.1714948415756226, -0.7240322828292847,...
def find _ twins ( a ) : return [ item for item, count in collections. counter ( a ). items ( ) if count > 1 and len ( item ) = = 2 ]
[ -0.12096802145242691, 0.27422770857810974, 0.5232502818107605, 0.4563750624656677, -0.23011992871761322, -0.4035918414592743, 1.0057203769683838, 0.238978311419487, 0.2768578827381134, 0.6801857352256775, -1.0188684463500977, -0.5615755915641785, 0.8419455289840698, 0.29665520787239075, ...
def _ download _ file ( self, url, filename, attempts = 1 ) : return util. download _ file ( url, filename, attempts )
[ -0.7512198090553284, 0.044945128262043, 0.33471107482910156, 0.22314782440662384, 0.1915755569934845, -0.3235529363155365, -0.2936529815196991, 0.5371459722518921, -1.4573625326156616, -0.5141230821609497, 0.6272528767585754, -1.0789668560028076, -0.08497925847768784, -0.7198395729064941, ...
def test _ abstract _ the _ dynamics ( ) : dom = pc. box2poly ( [ [ 0. 0, 10. 0 ], [ 0. 0, 20. 0 ] ] ) ppp = define _ partition ( dom ) sys = define _ dynamics ( dom ) logger. info ( sys ) disc _ options = {'n': 3,'trans _ length': 2,'min _ cell _ volume': 1. 5 } ab = abstract. discretize ( ppp, sys, plotit = false, sa...
[ 0.260713666677475, 0.5522410869598389, 0.7566987872123718, 0.09647813439369202, 0.42544227838516235, -0.126468688249588, -0.04112419858574867, -0.37477338314056396, 0.22254101932048798, -1.1139785051345825, 0.18661734461784363, 0.37228065729141235, 0.9000060558319092, 0.8422774076461792, ...
def setdata ( self, index, value, role = qt. editrole ) : if role! = qt. editrole : return false a = index. isvalid ( ) row = index. row ( ) length = len ( self. cars ) if index. isvalid ( ) and index. row ( ) < len ( self. cars ) : acar = self. cars [ index. row ( ) ] if index. column ( ) = = 0 : acar [ " carid " ] = ...
[ -1.2711858749389648, 0.41928452253341675, 0.7248320579528809, -1.1396244764328003, -0.4786553680896759, 0.36036592721939087, -0.5182211995124817, -0.619881272315979, -0.1827944666147232, 0.043138593435287476, -0.4864135980606079, 0.26992887258529663, 0.0993599221110344, -0.2626254558563232...
def sort2 ( self, how = " ilabel ", new _ fst _ base = false, in _ place = false ) : print " sorting ", new _ fst _ base if new _ fst _ base = = false : return self. sort ( new _ fst _ base = self. base, in _ place = true ) call = " fstarcsort - - sort _ type = % s % s % s " % ( how, self. fst _ fn, new _ fst _ base ) ...
[ -0.6806772351264954, -0.5731412768363953, 0.6237200498580933, 0.2752556800842285, -0.9490820169448853, -0.6978577375411987, -0.4934789836406708, -0.4429134726524353, -0.24254891276359558, -0.8552154302597046, -0.697901725769043, 0.5813228487968445, -0.8134325742721558, 0.6023913025856018, ...
def test _ update _ env _ initialized ( env _ vars ) : sample _ exe = " python " cmd = " echo " orig _ env = { " key " : " value " } rs = runsettings ( sample _ exe, run _ command = cmd, env _ vars = orig _ env ) rs. update _ env ( env _ vars ) combined _ keys = { k for k in env _ vars. keys ( ) } combined _ keys. upda...
[ -1.0002497434616089, -1.2349947690963745, 0.5977839231491089, -0.00834143441170454, 0.42136454582214355, 0.4528833329677582, -0.11112011224031448, 0.026971986517310143, -0.46869713068008423, 0.36643609404563904, -0.6031893491744995, 0.6204083561897278, -0.28963080048561096, 0.5592431426048...
def main ( ) : life = n _ turns ans = random _ word ( ) dashed _ ans ='' for i in range ( len ( ans ) ) : dashed _ ans + ='-'# the loop will stop either life = = 0 or ans being solved. while life > 0 and ans! = dashed _ ans : print ('the word looks like :'+ str ( dashed _ ans ) ) print ('you have'+ str ( life ) +'guess...
[ -0.02416590228676796, 0.05120926350355148, 1.002445936203003, 0.8920081257820129, -0.580289900302887, 0.861035943031311, 0.6645681858062744, 0.05895617604255676, 0.012278257869184017, 0.08964245766401291, 0.17287950217723846, 0.6269144415855408, 0.08194410055875778, 0.21365927159786224, ...
def paths ( m, n ) : assert ( m > 0 and n > 0 ) count _ paths = 1 if m = = 1 or n = = 1 : return count _ paths else : counter = 0 if m > 1 : counter + = paths ( m - 1, n ) if n > 1 : counter + = paths ( m, n - 1 ) return counter
[ -0.2822827398777008, 0.817459225654602, 0.42029234766960144, 1.395931601524353, -0.01732133887708187, 0.17747309803962708, 0.9121043086051941, 0.3214794993400574, 0.08142734318971634, -0.39584800601005554, 0.21731428802013397, -0.3929794132709503, -0.34000536799430847, 0.9972912669181824, ...
def test _ rent ( ) : accuracy = score _ rent ( ) assert accuracy > = 0. 42
[ 0.939734160900116, -0.18848660588264465, 0.5156360268592834, 0.06653641164302826, 1.5230538845062256, 1.4776902198791504, 0.4690704345703125, -0.3815891742706299, -0.5545320510864258, 0.0319628082215786, 0.0590701624751091, 0.6061925292015076, -0.259164959192276, -0.3259032964706421, 0.1...
def rho _ sampling ( self ) : logger. debug ('rho sampling') # self. _ mallow. rho = [ ] mallow _ rho = [ ] inv _ pdf = lambda x : - 1. / self. _ mallow. logpdf ( x ) for k in range ( self. _ k - 1 ) : # logger. debug ('rho sampling k : % d'% k ) self. _ mallow. set _ sample _ params ( sum _ inv _ vals = self. _ inv _ ...
[ -0.41926008462905884, -0.16240909695625305, 0.630419135093689, 0.5935606360435486, -0.20385123789310455, -0.04724014922976494, 0.3558202087879181, -0.3204812705516815, 0.22387263178825378, 1.1199252605438232, -0.23110659420490265, 0.47613203525543213, -0.12611746788024902, 1.05319011211395...
def power _ down ( self ) : self. left _ wheel. power _ down ( ) self. right _ wheel. power _ down ( ) if self. _ debug : print ( self. _ debug _ info,'down has motor power')
[ 0.8140906691551208, -0.552009642124176, 0.5858883261680603, -0.20270828902721405, 1.292260766029358, 0.6225800514221191, -0.05041154846549034, 1.07877779006958, -0.9613380432128906, -0.43028703331947327, 0.7352240681648254, 0.018955912441015244, -0.6604186296463013, 1.4257543087005615, 0...
def test _ atomic _ base64 _ binary _ enumeration _ 1 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ enumeration _ 2 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - enumeration - 2. xsd ...
[ -0.644314169883728, -1.2338788509368896, 0.5980406403541565, 1.2301881313323975, -0.11841489374637604, -0.08631544560194016, 0.254901647567749, -0.2757379412651062, -0.5897824168205261, 0.4087982773780823, -0.580267071723938, 0.629712700843811, 0.1352735012769699, 0.417105495929718, 0.13...
def test _ atomic _ any _ uri _ max _ length _ 4 _ nistxml _ sv _ iv _ atomic _ any _ uri _ max _ length _ 5 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - maxlength - 5. xsd ", instance = " nistdata...
[ 0.028039144352078438, 0.0636255294084549, 0.32623496651649475, 0.7566795349121094, -0.5616661310195923, -0.08115991204977036, -0.36948132514953613, -0.32075268030166626, 0.20879292488098145, 0.013488704338669777, -0.11376415193080902, -0.4812362492084503, -0.7154585123062134, 0.19976566731...
def test _ atomic _ base64 _ binary _ min _ length _ 3 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ min _ length _ 4 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - minlength - 4. xsd ...
[ 0.4397660791873932, -0.46145564317703247, 0.34657159447669983, 0.7436293959617615, -0.26946020126342773, -0.08034633845090866, -0.30157214403152466, -0.48753806948661804, -0.030579296872019768, 0.2148025780916214, -0.6146565079689026, -0.06264280527830124, -0.7827366590499878, -0.073140405...
def employee _ delete ( id ) : employee = user. query. get _ or _ 404 ( id ) if current _ user = = employee : try : db. session. delete ( employee ) db. session. commit ( ) return redirect ('/ logout') except : return " error occurred " else : flash ( " you can't do it ", category ='error') return render _ template ('e...
[ -0.3289676308631897, -0.05154548957943916, 0.641300618648529, 0.6991692781448364, -0.2200995832681656, 0.5751599669456482, 0.2630106210708618, 0.15570911765098572, 0.19187258183956146, 0.36274150013923645, 0.5713422298431396, -0.10213800519704819, 0.22222237288951874, 0.2261938899755478, ...
def test _ list _ integer _ enumeration _ 2 _ nistxml _ sv _ iv _ list _ integer _ enumeration _ 3 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - enumeration - 3. xsd ", instance = " nistdata / list / ...
[ -1.0479176044464111, -0.4440099895000458, 0.5886722207069397, 0.736452579498291, -0.2836906313896179, 0.4895447790622711, -0.49065500497817993, 0.8011656999588013, 1.5808466672897339, 1.237186312675476, -0.7199216485023499, -0.002914589364081621, -0.15950588881969452, 0.18819016218185425, ...
def test _ list _ integer _ pattern _ 2 _ nistxml _ sv _ iv _ list _ integer _ pattern _ 3 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - pattern - 3. xsd ", instance = " nistdata / list / integer / sc...
[ -0.6844618320465088, -0.19819135963916779, 0.555061936378479, 0.2961735725402832, -0.35272645950317383, 0.3471371829509735, -0.800828754901886, 0.6261756420135498, 1.2419638633728027, 1.0066709518432617, -0.8208001255989075, -0.03185921907424927, -0.07728365808725357, 0.3043029010295868, ...
def teardown ( self ) : self. _ env = none
[ 0.21971702575683594, -0.7971724271774292, 0.045004986226558685, -1.1879898309707642, 0.949881374835968, 0.44650110602378845, 1.6061172485351562, -0.2901485562324524, -0.09170426428318024, -0.9738683104515076, 0.049290988594293594, 1.2856509685516357, -0.6755406260490417, 0.3823941349983215...
def on _ train _ batch _ end ( self, trainer, pl _ module, outputs, batch, batch _ idx, dataloader _ idx ) - > none : # type : ignore ids _ linear _ head = tuple ( batch [ ssldatamoduletype. linear _ head ] [ 0 ]. tolist ( ) ) if ids _ linear _ head not in self. visited _ ids : self. visited _ ids. add ( ids _ linear _...
[ -0.0006752289482392371, -0.1831851601600647, 0.66947340965271, 0.21129155158996582, 0.44577446579933167, 0.9305290579795837, 0.49679556488990784, 0.5731685161590576, -0.9910491108894348, 0.2359381914138794, -0.9209598898887634, 0.48053982853889465, -0.06266891211271286, 0.22669894993305206...
def snapshot ( self, snapshot _ name ) : memsum = self. _ tracker. create _ summary ( ) last _ snapshot _ name = self. _ current _ snapshot _ name self. _ current _ snapshot _ name = snapshot _ name if self. _ diff _ snapshot : yield ( ('- - - - - - - - diff between current snapshot ( % s ) and last snapshot ( % s )'' ...
[ -0.3220372200012207, 0.18018320202827454, 1.1059961318969727, -0.394884318113327, -0.9737401008605957, -0.2796008884906769, 0.4121861159801483, -0.260336697101593, 0.5290799736976624, -0.1025143414735794, 0.181661456823349, -0.36703139543533325, 0.4475322961807251, 0.7622022032737732, -0...
def test _ neutral _ mtdna ( self ) : from cogent3. app. composable import notcompleted opt = dict ( max _ evaluations = 2, limit _ action = " ignore " ) aln = load _ aligned _ seqs ( " data / ensg00000198712. fa ", moltype = " dna " ) neutral = evo _ app. natsel _ neutral ( " mg94hky ", opt _ args = opt, gc = 2 ) resu...
[ -0.520766019821167, -0.2902427911758423, 0.4233447015285492, -0.7306517958641052, 0.40827926993370056, 0.42863157391548157, -0.30837228894233704, 0.2790627181529999, -0.4519549608230591, 0.2856818735599518, 0.01274983398616314, 0.1369340717792511, -0.21120737493038177, 0.3560166358947754, ...
def recurse ( directory ) : if not directory. is _ dir ( ) : raise valueerror ('error : tried to recurse ( ) a path that is not a directory') directories _ to _ explore = [ directory. iterdir ( ) ] while directories _ to _ explore : try : next _ path = next ( directories _ to _ explore [ - 1 ] ) if next _ path. is _ di...
[ -0.6255255937576294, 1.3440946340560913, 0.5686030983924866, 0.7703858613967896, -0.034736890345811844, -0.21318118274211884, 0.6586136817932129, -0.5304073691368103, 1.2401049137115479, -0.24170169234275818, 0.7217397093772888, 0.27103614807128906, -0.4094003140926361, 0.720767080783844, ...
def _ make _ request ( self, url, parameters = none ) : headers = {'authorization':'bearer'+ self. token } data = requests. get ( url, headers = headers, params = parameters ) if data. ok : return data print ( f " request failed to { url }. error type : { data. status _ code } " ) return none
[ -0.8119654059410095, 0.1856953352689743, 0.5811712741851807, -0.22974444925785065, 0.5070338249206543, -0.31065791845321655, -1.2832258939743042, -0.6179768443107605, -0.24372150003910065, -0.03121976926922798, 0.14892320334911346, 0.8068091869354248, -0.4102723002433777, -1.28066027164459...
def reviewbelow ( self, inputevent ) : context = self. getflatreviewcontext ( ) moved = context. gobelow ( flat _ review. context. char, flat _ review. context. wrap _ line ) if moved : self. _ reviewcurrentitem ( inputevent, self. targetcursorcell ) return true
[ 0.13057556748390198, -0.6774768829345703, 0.51335608959198, 0.14469385147094727, -0.6453879475593567, 1.1124560832977295, 0.012596536427736282, -0.8430665135383606, 0.0035899304784834385, -0.5001268982887268, -0.3544231653213501, 1.113008737564087, -0.771845281124115, -0.22896739840507507,...
def test _ skips _ deleting _ if _ no _ matching _ indices ( mock _ es _ client ) : mock _ es _ client. return _ value. cat. indices. return _ value = [ ] management. call _ command ( delete _ all _ es _ indices. command ( ) ) mock _ es _ client. return _ value. indices. delete. assert _ not _ called ( )
[ -0.39181509613990784, 0.908117949962616, 0.29046398401260376, 0.33922111988067627, 0.9475558996200562, 0.44746387004852295, 0.37504133582115173, -0.09113356471061707, 0.499812513589859, -0.6994612812995911, 0.3137214779853821, 0.04105761647224426, -0.28509512543678284, -0.14668063819408417...
def compute _ d _ lissage _ 3d ( mat3x3 _ gauche, mat3x3 _ centre, mat3x3 _ droite, vector = [ 0. 4, 0. 3, 0. 2, 0. 1 ] ) : if np. _ _ name _ _! = type ( mat3x3 _ gauche ). _ _ module _ _ or np. _ _ name _ _! = type ( mat3x3 _ centre ). _ _ module _ _ or np. _ _ name _ _! = type ( mat3x3 _ droite ). _ _ module _ _ : # ...
[ 0.6040902137756348, -0.5043153166770935, 1.0295629501342773, -0.8781177997589111, 0.2683468759059906, 0.5554620623588562, -0.520780622959137, 0.35562923550605774, 0.22651244699954987, 1.067533016204834, -0.197923481464386, -0.4283226430416107, -0.9333503842353821, -0.6129892468452454, 0....
def on _ pushbutton _ local _ browse _ clicked ( self ) : # todo : not implemented yet self. selectfolder = qfiledialog. getexistingdirectory ( self,'select folder : ', path. dirname ( _ _ file _ _ ) ) self. lineedit _ localfolder. settext ( self. selectfolder )
[ 0.36210739612579346, -1.210774302482605, 0.36811766028404236, -0.2778642177581787, 0.4942138195037842, -0.11599011719226837, 0.7864845991134644, 0.34769147634506226, 0.23412387073040009, -0.3645683825016022, -0.137213796377182, 1.315566062927246, 0.39740005135536194, 0.46257469058036804, ...
def get _ userid _ by _ name ( self, name ) : users = get _ objref _ by _ val _ and _ attribute ( name, self,'user _ name') if len ( users ) < 1 : print _ error ( " user % s not found " % name ) self. _ _ logger. error ( " user % s not found " % name ) return none if len ( users ) > 1 : print _ error ( " user name % s ...
[ -0.019968928769230843, -0.5176646113395691, 0.6567597389221191, 0.47580114006996155, -0.46167445182800293, 0.4454987645149231, 1.0787537097930908, -1.0787858963012695, 0.5520508289337158, 0.708256721496582, 0.0864744633436203, 0.3929956257343292, -0.8162538409233093, 0.31783223152160645, ...
def test _ list _ decimal _ enumeration _ 4 _ nistxml _ sv _ iv _ list _ decimal _ enumeration _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - enumeration - 5. xsd ", instance = " nistdata / list / ...
[ -0.8911285996437073, -1.0163778066635132, 0.517997682094574, 0.5184886455535889, -0.3851759731769562, -0.4556441009044647, 0.1979508399963379, -0.23882277309894562, 0.1366831213235855, 0.2754567563533783, -1.4012497663497925, -0.3935152590274811, -0.08271969854831696, 0.839972198009491, ...
def is _ free _ answer ( self ) : if len ( self. _ valid _ answers ) = = 0 : return true return next ( iter ( self. _ valid _ answers. keys ( ) ) ) = = self. free _ answer _ key
[ -0.36650556325912476, -0.08268411457538605, 0.3394624888896942, 0.20539739727973938, -1.2419211864471436, -0.15658996999263763, 0.3168071508407593, -0.8443254232406616, 0.7972769737243652, 0.310467004776001, -0.3109928369522095, -0.21112561225891113, -0.9948256611824036, 0.0804410800337791...
def rownormcmatrix ( partition ) : ret = [ ] rows = list ( partition ) # dalia for row in rows : label = row [ 0 ] xi = row [ 1 ] ki = xi. shape [ 0 ] ci = np. zeros ( ( ki, r ) ) zitzic = tensorops. ztz ( a, b ) xizic = np. dot ( unfold ( xi, 0 ), khatri _ rao ( [ ci, a, b ], skip _ matrix = 0 ) ) if regularization > ...
[ -0.24165157973766327, -0.9040265679359436, 0.6684824228286743, 0.4085507392883301, -0.4360964596271515, -0.6091903448104858, 0.35090476274490356, 1.1127811670303345, 0.3339097797870636, 0.8844773173332214, 0.14403359591960907, -0.8009851574897766, -0.32129400968551636, -0.38085347414016724...
def subdivision _ solve _ 1d ( f, a, b, cheb _ approx _ tol = 1. e - 3, max _ degree = 128 ) : cur _ deg = 2 initial _ approx = interval _ approximate _ 1d ( f, a, b, deg = cur _ deg ) while cur _ deg < = max _ degree : coeffsn = np. zeros ( 2 * cur _ deg + 1 ) coeffsn [ : cur _ deg + 1 ] = initial _ approx coeffs2n = ...
[ 0.28581616282463074, 0.36270371079444885, 0.8236873745918274, 0.2431536316871643, -0.27742448449134827, 0.06400204449892044, 0.07416839152574539, -0.16065837442874908, -0.5157105922698975, -0.21446023881435394, 0.018398365005850792, 0.17600809037685394, 0.10882201790809631, -0.451923936605...
def _ _ iter _ _ ( self ) : for subdir in self. _ directories : logfiles = _ listdir _ filter _ hidden _ files ( path. join ( self. _ sourcedir, subdir ) ) if len ( logfiles )! = 1 : raise exception ( f'wrong number of logfile was found in { subdir }') filename = path. join ( self. _ sourcedir, subdir, logfiles [ 0 ] )...
[ -0.5117174983024597, 0.23140887916088104, 0.6144829988479614, -0.41832658648490906, 0.11901436001062393, -0.12056392431259155, 1.0252392292022705, 0.00021147116785869002, -0.7354243397712708, -0.0871935486793518, 0.4613746106624603, 0.15768630802631378, 0.22163783013820648, -0.407054454088...
def successes _ to _ class ( self, successes ) : if successes ['robots'] : return'robots'if successes ['pdf'] : return'pdf'elif successes ['absft'] : return'absft'elif successes ['abs'] : return'abs'elif successes ['abs'] = = false : return'noabs'elif successes ['pdf'] = = false : return'nopdf'return none
[ -1.2321215867996216, -1.1323108673095703, 0.6423627138137817, -0.8957157731056213, -0.16269263625144958, 0.5147587656974792, -1.1288917064666748, -0.8339800238609314, 0.3316071033477783, -0.1378517597913742, 0.4370180666446686, -0.354880154132843, 1.3931151628494263, 0.3183915317058563, ...
def read _ feature _ and _ label _ vectors ( features _ file _ path, number _ of _ labels = 14 ) : logging. info ('loading feature and label vectors from { }... '. format ( features _ file _ path ) ) feature _ vectors, label _ vectors = [ ], [ ] with open ( features _ file _ path,'r') as features _ file : # each line i...
[ -0.6095471382141113, -0.7959334254264832, 0.2602062225341797, -0.39989882707595825, 0.3774852752685547, 0.4210100471973419, 0.1200704574584961, 0.3273273706436157, 0.05811496824026108, 0.04635952413082123, 0.12174581736326218, 0.37819570302963257, 0.8177319765090942, 0.387137770652771, 0...
def validate _ input ( helper, definition ) : # this example accesses the modular input variable # api _ uri _ base = definition. parameters. get ('api _ uri _ base ', none ) # api _ version = definition. parameters. get ('api _ version ', none ) # username = definition. parameters. get ('username ', none ) # password ...
[ -0.29530274868011475, -0.49939557909965515, 0.3951379358768463, 0.541066586971283, 0.5310195088386536, 0.15900813043117523, 0.39146143198013306, 0.04215235635638237, -0.47501319646835327, -0.22707697749137878, 0.3808060586452484, 0.276040643453598, -0.593523383140564, 1.0219908952713013, ...
def test _ update _ env _ null _ valued ( env _ vars ) : sample _ exe = " python " cmd = " echo " orig _ env = { } with pytest. raises ( typeerror ) as ex : rs = runsettings ( sample _ exe, run _ command = cmd, env _ vars = orig _ env ) rs. update _ env ( env _ vars )
[ -0.5213350653648376, -0.726104736328125, 0.6845748424530029, 0.4338514506816864, 0.09728260338306427, 0.3337382972240448, -0.2290704846382141, -0.2329477220773697, -0.19601182639598846, 0.18765047192573547, -0.16735824942588806, 1.0647242069244385, -0.09500417113304138, 0.9925650954246521,...
async def test _ set _ export _ rule ( monkeypatch ) : teslamock ( monkeypatch ) _ controller = controller ( none ) await _ controller. connect ( ) await _ controller. generate _ energysite _ objects ( ) _ energysite = _ controller. energysites [ 67890 ] assert await _ energysite. set _ export _ rule ( " pv _ only " ) ...
[ 0.5720043182373047, 0.8300403952598572, 0.324952632188797, 0.18018899857997894, 0.8240305781364441, 0.40610504150390625, -0.032793447375297546, 0.954032301902771, 0.20568221807479858, 0.37033140659332275, 0.12849865853786469, 0.4181211590766907, -0.19089826941490173, 0.792646586894989, 0...
def breadthfirst ( self, node, node2 ) : queue = queue ( maxsize = len ( self. nodes ) ) queue. put ( self. nodes [ node ] ) self. nodes [ node ]. visited = true path = [ ] prev = { } prev [ node ] = none if node = = node2 : return while not queue. empty ( ) : node = queue. get ( ) # print ( node. id ) for neighbour in...
[ 0.2847212255001068, -0.036356765776872635, 1.0620232820510864, -0.055195942521095276, 0.4064059853553772, -0.5555028915405273, -0.42964276671409607, -0.28799495100975037, -0.32551732659339905, 0.7853061556816101, -0.26149219274520874, 1.229789137840271, -0.4093576669692993, 0.7332752346992...
def dataset _ to _ torch ( self ) : assert self. dataset _ name in self. hyper ['available _ datasets'],'dataset given is not valid.'# initial load of the spacy english tokenizer spacy. load ('en') if self. dataset _ name = ='imdb': text = data. field ( tokenize ='spacy ', preprocessing = dataset. generate _ bigrams ) ...
[ -0.20470520853996277, 0.010092909447848797, 0.585889458656311, -0.655931830406189, 0.12482348829507828, 0.08663003146648407, -0.11502514779567719, 0.7619756460189819, -0.3422982692718506, -0.009541567414999008, -0.4464271068572998, 0.7656867504119873, -0.04711933806538582, -0.3468937873840...
def cast ( * args ) : return _ itksubtractconstantfromimagefilterpython. itksubtractconstantfromimagefilteriul3diul3 _ superclass _ cast ( * args )
[ 0.9330533146858215, 0.16213257610797882, 0.5526575446128845, -0.03859807923436165, -0.5488837361335754, 1.5685884952545166, -0.16456842422485352, 0.5460368990898132, 0.7168377637863159, -0.34237581491470337, -0.6740060448646545, 0.2754881680011749, 0.0008896418730728328, -0.722898662090301...
def forward ( self, features, vs, meshes ) : x = torch. transpose ( features, 1, 2 ) for i, mesh in enumerate ( meshes ) : self. rate = mesh. min _ edge _ length # cpt = torch. ones ( ( len ( vs [ i ] ), 1 ), device = features. device ) _ sum = torch. zeros ( vs [ i ]. shape, device = features. device ) for j, face in ...
[ 0.20632363855838776, 0.6629699468612671, 0.43886005878448486, 0.024777472019195557, 0.1540038287639618, 0.2810709476470947, 1.062862515449524, 0.298976331949234, 0.02861202321946621, 0.3852604031562805, -0.6025898456573486, -0.1428808718919754, 0.10463352501392365, -0.21531572937965393, ...
def tokenize ( text ) : # normalize text text = re. sub ( r " [ ^ a - za - z0 - 9 ] ", " ", text. lower ( ) ) # tokenizing the text words = word _ tokenize ( text ) # lemmatizing the words stop _ words = stopwords. words ( " english " ) words _ lemmed = [ wordnetlemmatizer ( ). lemmatize ( w ) for w in words if w not i...
[ -0.49375972151756287, -0.6084050536155701, 0.38211774826049805, -0.4779060482978821, 0.07346952706575394, 0.15906481444835663, -1.339676856994629, 1.3395582437515259, 0.49033263325691223, 0.5183523297309875, -0.7544124722480774, -0.17384576797485352, -0.8378590941429138, 1.1548932790756226...
def test _ hunt _ command ( mocker ) : from crowdstrikemalquery import hunt _ command args = { " yara _ rule " : " yara ", " limit " : " 5 ", " filter _ meta " :'sha256, type, size'} hunt _ raw _ response = util _ load _ json ('test _ data / hunt _ raw _ response. json') mocker. patch. object ( client, " hunt ", return...
[ 0.5030679702758789, -0.3850494921207428, 0.60341477394104, -0.11379935592412949, 1.3179011344909668, 0.3004232347011566, 0.2819107174873352, -0.5648293495178223, -0.39101848006248474, -0.6399493217468262, -0.5629500150680542, 0.7641613483428955, 0.03620828315615654, -0.09189275652170181, ...
def getcomsgeneral ( self, compairs, atype, snapshot, molno ) : tind = snapshot. particles. types. index ( atype ) types = snapshot. particles. typeid ats = self. ats abeads = snapshot. particles. position [ np. where ( types = = tind ) [ 0 ] ] pairshape = np. shape ( compairs ) npairs = pairshape [ 0 ] aromsize = pair...
[ -0.37725698947906494, -0.023652566596865654, 0.7722744941711426, -1.4290764331817627, -0.15635569393634796, 0.19113662838935852, 0.5107907056808472, -0.0757397711277008, 0.35548126697540283, 1.3431063890457153, 0.15198545157909393, 0.5021851658821106, -0.3734663724899292, 0.170052498579025...
def get _ currencies ( self ) : return self. get _ request ('/ api / v1 / currencies')
[ -1.3450803756713867, 0.8640169501304626, 0.17843341827392578, 0.7114931344985962, 0.8786965608596802, -1.3657647371292114, -0.7482673525810242, -0.31938400864601135, -0.1958252191543579, 0.5077978372573853, -0.5859679579734802, 0.5953785181045532, -0.855729877948761, 0.04183223471045494, ...
def test _ example _ input _ one _ default _ value _ limit ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) default _ limit = " 1000 " input _ page. create _ new _ input. select ( " example input one " ...
[ 0.3070966303348541, 0.8805646896362305, 0.4361855685710907, 1.0996778011322021, 1.5300973653793335, 0.8560471534729004, -0.1449815034866333, 0.268655389547348, 0.7597039341926575, 0.028408823534846306, -0.47816571593284607, -0.17315585911273956, -0.12581023573875427, 0.18223990499973297, ...
def test _ update _ nonexistent _ cve _ id ( ) : with open ( '. / src / test / cve _ tests / cve _ record _ fixtures / cve - 3000 - 0001 _ nonexistent. json') as json _ file : data = json. load ( json _ file ) res = requests. put ( f'{ env. awg _ base _ url } { cve _ url } / { cve _ id _ dne } ', headers = utils. base ...
[ -0.37901294231414795, -0.3822909891605377, 0.6737070679664612, -0.5108386874198914, 0.6908953189849854, 0.5319439768791199, -0.2812748849391937, -0.023031562566757202, -0.15099076926708221, 0.8259745240211487, -0.8707830905914307, 0.45124807953834534, -0.32618337869644165, -0.5986911058425...
def ms _ perplexities ( n, k _ star = 2 ) : # defining l _ min and l _ max l _ min, l _ max = 1, int ( round ( np. log2 ( np. float64 ( n ) / np. float64 ( k _ star ) ) ) ) # number of considered perplexities l = l _ max - l _ min + 1 # array with the considered perplexities. k _ h = ( np. float64 ( 2. 0 ) * * ( np. li...
[ 0.09371376037597656, -0.5653511881828308, 0.6026161909103394, -0.34120887517929077, -1.1556147336959839, 0.21289314329624176, -0.8012815117835999, 0.8306739330291748, 0.2177131474018097, -0.6520700454711914, -0.5011781454086304, 0.5308325290679932, 0.14134971797466278, 0.6661053895950317, ...
def count ( self, count ) : self. _ count = count
[ 0.13051632046699524, 0.38002559542655945, 0.08393897116184235, 0.3689388632774353, 0.3027328848838806, 0.9674021005630493, -0.14083704352378845, 0.46501630544662476, -1.6759636402130127, -0.07178646326065063, -1.2710436582565308, -1.4048868417739868, 0.06060340628027916, 0.6466816067695618...
def test _ get _ cve _ by _ count _ only _ false ( ) : res = requests. get ( f'{ env. awg _ base _ url } { cve _ url } / ', headers = utils. base _ headers, params = {'count _ only': 0 } ) assert len ( json. loads ( res. content. decode ( ) ) ['cverecords'] ) = = 114 # all records are returned assert res. status _ code...
[ -0.01919289119541645, -0.021200992166996002, 0.48568639159202576, 0.4972314238548279, 1.4059150218963623, 0.6321632862091064, -0.4299642741680145, 0.6996771693229675, -0.5183233618736267, -0.35850250720977783, 0.253169983625412, -0.014378586784005165, -0.042258404195308685, 0.3804367780685...
def model _ flatten ( model, scale, distance ) - > list : d = copy. deepcopy ( model ) for x in range ( len ( d ) ) : p1, p2 = d [ x ] n = ( flatten ( p1 [ 0 ], p1 [ 1 ], p1 [ 2 ], scale, distance ), flatten ( p2 [ 0 ], p2 [ 1 ], p2 [ 2 ], scale, distance ), ) d [ x ] = n return d
[ -1.2770473957061768, -0.11324584484100342, 0.5720778703689575, 0.3408523201942444, -0.7378412485122681, 0.9480888247489929, -0.6254542469978333, 0.03212539479136467, 0.044930875301361084, 0.9320560097694397, -1.4995460510253906, -0.6789724826812744, 0.3093397915363312, -0.4086221158504486,...
def _ _ init _ _ ( self, * args, matchcase = true ) : self. matchcase = matchcase if not matchcase : self. vals = [ x. upper ( ) for x in args if isinstance ( x, str ) ] else : self. vals = args
[ -0.8978038430213928, -0.041463058441877365, 0.47042855620384216, 0.7417649626731873, 0.5257794857025146, 0.2944355607032776, -0.3391649127006531, 0.60469651222229, -0.3158048689365387, -0.09255267679691315, 0.22621576488018036, -0.2545759975910187, -0.3660643994808197, 1.2430429458618164, ...
def img _ downloader ( ) : from bs4 import beautifulsoup import requests import time import json import os import sys sys. path. append ( ".. " ) base _ url ='http : / / numismatics. org / search / results? q = department _ facet % 3a % 22roman % 22 % 20and % 20year _ num % 3a % 5b - 30 % 20to % 20 % 2a % 5d % 20and % ...
[ -1.234604835510254, 0.15186597406864166, 0.8618001341819763, -0.5432428121566772, 0.9317259788513184, -0.11050254851579666, 0.04102142155170441, 0.5888453125953674, -0.2909718155860901, 0.4773309528827667, -0.2546887695789337, 0.5809527039527893, 1.0721704959869385, 0.6603675484657288, 0...
def ascon _ process _ plaintext ( s, b, rate, plaintext ) : p _ lastlen = len ( plaintext ) % rate p _ padding = to _ bytes ( [ 0x80 ] + ( rate - p _ lastlen - 1 ) * [ 0x00 ] ) p _ padded = plaintext + p _ padding # first t - 1 blocks ciphertext = to _ bytes ( [ ] ) for block in range ( 0, len ( p _ padded ) - rate, ra...
[ 0.1755763292312622, 0.18911541998386383, 0.9121163487434387, -0.5982789397239685, -0.7140419483184814, -0.4962829053401947, 0.09887310117483139, -0.6342247724533081, 0.6559169292449951, 1.1194101572036743, -0.31618067622184753, 0.12814465165138245, -0.6693425178527832, -0.7714561223983765,...
def class _ to _ json ( obj ) : return ( obj. _ _ dict _ _ )
[ -1.7078547477722168, -1.804735541343689, 0.5962218046188354, -0.8063351511955261, -0.9449090957641602, -0.0418814979493618, 0.4346536099910736, -0.6976087093353271, 0.6984777450561523, -0.008171622641384602, -1.4237117767333984, 0.4316915273666382, 0.7377331852912903, -0.12765920162200928,...
def _ can _ handle _ query ( cls, * query ) : required = { a. time } optional = { a. instrument, a. level, a. provider, product, identifier, soop } if not cls. check _ attr _ types _ in _ query ( query, required, optional ) : return false # check to make sure the instrument attr passed is one provided by the soar. # al...
[ -0.9049892425537109, 0.5159004926681519, 0.42518582940101624, 0.13109442591667175, -0.3215787708759308, 1.2476071119308472, 0.2785969376564026, -0.3960863947868347, -0.05174260586500168, 0.2370350956916809, 0.9991559386253357, -0.31378501653671265, -0.7756061553955078, 0.6873696446418762, ...
def sync ( self, syncer ) : me = self. make _ event ( syncer ) thrift _ client = syncer. client res = thrift _ client. storemetricevent ( me ) self. associate ( res, syncer )
[ 1.3104233741760254, 0.5112236738204956, 0.22055895626544952, 0.4381905198097229, 0.18501748144626617, 0.9269580245018005, 0.9033146500587463, -0.6919735670089722, -0.1601111739873886, 0.43414589762687683, -0.4588489532470703, 0.3823295831680298, 0.2228243201971054, 0.18096381425857544, 0...
def process _ image ( obj, view, idx ) : intrinsics _ path = os. path. join ('img ', obj, f'calib _ data _ { view }. json') color _ path = os. path. join ('img ', obj, f'{ view } _ color _ { idx }. jpg') depth _ path = os. path. join ('img ', obj, f'{ view } _ depth _ { idx }. png') mask _ path = os. path. join ('img '...
[ -0.4487166106700897, -0.4429422616958618, 0.8677617311477661, -0.3801049292087555, 0.4696851670742035, 0.3275449872016907, 0.42798179388046265, -0.9075632095336914, -0.10425830632448196, -0.1477670520544052, -0.17815080285072327, -0.06282497197389603, 0.89374840259552, -0.5851776003837585,...
def to _ device ( tensor, gpu = false ) : return tensor. cuda ( ) if gpu else tensor. cpu ( )
[ -0.5541669726371765, 0.840029776096344, 0.22979336977005005, 0.5064297318458557, 0.23394349217414856, 0.3184658885002136, 0.45682257413864136, -0.6262124180793762, 0.09946426749229431, 0.1658305823802948, 0.2675049901008606, 0.5050257444381714, 0.09723720699548721, -1.0090144872665405, 0...
def follow _ the _ path ( file _ name ) : # calculate cube distance as per : https : / / www. redblobgames. com / grids / hexagons / distances path = open _ file ( file _ name ) max _ distance = 0 # set starting position position = ( 0, 0 ) directions = { " n " : ( 0, 1 ), " s " : ( 0, - 1 ), " ne " : ( 1, 0 ), " sw " ...
[ 0.3147050738334656, -0.582179069519043, 0.8262916803359985, 0.4998072385787964, -0.13017208874225616, 0.1863252967596054, 0.7727927565574646, 0.4560191333293915, -0.46867021918296814, 0.4774329662322998, -0.9988501071929932, -0.4986162781715393, 0.2816930115222931, 0.4223567843437195, 0....
def cli ( ctx : context, previous _ version : str, current _ version : str ) - > none : previous _ logs = gitlogs ( previous _ version ) current _ logs = gitlogs ( current _ version ) previous _ logs. fetch ( ) current _ logs. fetch ( ) base _ parameters = baseparameters ( previous _ logs, current _ logs ) ctx. obj = b...
[ 0.9175416827201843, -0.30359891057014465, 0.5362227559089661, -0.15761758387088776, 0.543159544467926, -0.11166536808013916, -0.22522838413715363, -0.6047126054763794, -1.0039535760879517, 0.6064288020133972, 0.003369490383192897, 1.6644914150238037, -0.003993180580437183, -0.3100652098655...
def parse _ response ( self, parsed _ class, response ) : try : result = [ ] parsed _ response = json. loads ( response. text ) if isinstance ( parsed _ response, list ) : for class _ dict in parsed _ response : result. append ( self. parse ( parsed _ class, class _ dict ) ) else : result = self. parse ( parsed _ class...
[ -0.5785920023918152, -0.847981870174408, 0.5724889039993286, 0.31788861751556396, 0.3147771656513214, -0.531022846698761, -0.5635321140289307, 0.058946989476680756, 1.198327660560608, -0.38277122378349304, -0.49126389622688293, -0.7303728461265564, -0.47150343656539917, 0.5371604561805725,...
def nbpixels ( ) : return jsonify ( arraytolist ( np. arange ( 4, 10, 2 ) ) )
[ -0.3703426122665405, 0.0724426880478859, 0.4193153381347656, -0.8887179493904114, -0.1060231551527977, -1.2185041904449463, -0.8591805696487427, -0.6259580850601196, 0.5846854448318481, 0.8148265480995178, -1.0992827415466309, -0.46022531390190125, 0.3795824944972992, 0.2953336834907532, ...
def copy ( ctx, # mandatory main parameter volumeid, # mandatory main parameter dstvolumeid, # optional main parameter snapshotid = none ) : " " " snapshot ). attributes of the destination volume such as iqn, qos settings, size, account, and volume access group membership are " " " " " " not changed. the destination vo...
[ -0.8665133118629456, -0.26949769258499146, 0.992919921875, 0.1540214866399765, -0.6321319937705994, 0.12674985826015472, 0.2512572705745697, -0.5556561946868896, 0.023894933983683586, 0.8799792528152466, -0.04785780981183052, 0.9805148839950562, -0.08902626484632492, -0.6467801928520203, ...
def rules ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input [ union ['firewallpolicyfilterruleargs ','firewallpolicynatruleargs'] ] ] ] ] : return pulumi. get ( self, " rules " )
[ 0.3311983644962311, 0.5571486949920654, 0.33504506945610046, 0.2592329978942871, 1.4569288492202759, 0.9487391114234924, 0.2179078757762909, -0.06884249299764633, 0.7650368809700012, -0.04949682950973511, -0.2917688488960266, 0.33341559767723083, -0.3156275451183319, 0.08394835144281387, ...
def hinton ( matrix, max _ weight = none, ax = none ) : ax = ax if ax is not none else plt. gca ( ) if not max _ weight : max _ weight = 2 * * np. ceil ( np. log ( np. abs ( matrix ). max ( ) ) / np. log ( 2 ) ) ax. patch. set _ facecolor ('gray') ax. set _ aspect ('equal ','box') ax. xaxis. set _ major _ locator ( plt...
[ 0.7134585976600647, 0.5024321675300598, 1.0386953353881836, -0.20066390931606293, -1.2461692094802856, 0.6147851943969727, 0.4704548418521881, 0.22419193387031555, 0.6460164189338684, 0.1429554969072342, 0.7658471465110779, 0.6943066716194153, 0.1396230012178421, 0.3749264180660248, 0.20...
def on _ status ( self, tweet ) : # try to reply to mention or catch error try : api = self. api keywords = [ " ztmbot ", " ztmbot ", " @ ztmbot " ] if tweet. user. id = = api. me ( ). id or tweet. in _ reply _ to _ status _ id : return none text = tweet. text. lower ( ) print ( f'checking tweet { tweet. id } by @ { tw...
[ 0.9988163113594055, -0.9731132984161377, 0.7446957230567932, 0.06726192682981491, 0.6787508130073547, -0.37519970536231995, -0.14797870814800262, -0.06918717175722122, 0.5131310820579529, 0.44032320380210876, -0.691606342792511, 1.0605981349945068, -0.711381196975708, 0.9881278276443481, ...
def get _ block _ mask ( img _ integral, radius = block _ radius ) : [ height, width ] = img _ integral. shape block _ mask = np. zeros ( ( height, width ), np. float32 ) for i in range ( radius, height - radius ) : for j in range ( radius, width - radius ) : block _ mask [ i, j ] = img _ integral [ i + radius, j + rad...
[ 0.11270099878311157, -0.23817217350006104, 0.8028463125228882, 0.15414413809776306, -0.25071194767951965, -0.5869233012199402, 0.603334903717041, -0.9174749851226807, -0.11510361731052399, 0.5703219771385193, -0.26149430871009827, 0.47145262360572815, -0.003777511650696397, 0.5776398181915...
def param _ init _ gru ( options, params, prefix ='gru ', nin = none, dim = none ) : if nin = = none : nin = options ['dim _ proj'] if dim = = none : dim = options ['dim _ proj'] w = numpy. concatenate ( [ norm _ weight ( nin, dim ), norm _ weight ( nin, dim ) ], axis = 1 ) params [ _ p ( prefix,'w') ] = w params [ _ p...
[ 0.08552365750074387, 0.2961673140525818, 0.7507917284965515, -0.26029062271118164, 0.4401099681854248, -0.08889967948198318, 0.17618730664253235, 0.4138510525226593, -0.41792747378349304, 0.6442532539367676, 0.33680155873298645, 1.2414100170135498, -0.16310234367847443, 0.7373371124267578,...
def get _ ar _ marker _ poses ( rgb, depth ) : if rospy. get _ name ( ) = ='/ unnamed': rospy. init _ node ('keypoints') getmarkers = rospy. serviceproxy ( " getmarkers ", markerpositions ) # xyz = svi. transform _ pointclouds ( depth, tfm ) xyz = clouds. depth _ to _ xyz ( depth, asus _ xtion _ pro _ f ) pc = ru. xyzr...
[ -0.9895555377006531, -0.6423130631446838, 0.45486319065093994, 0.06273198127746582, 0.15898455679416656, -0.45729953050613403, -0.10270380973815918, -0.664813756942749, -0.007964631542563438, 0.31696006655693054, -0.5064529776573181, -0.40872886776924133, -0.11704224348068237, 0.4483190774...
def test _ discrete _ time _ model ( self ) : from cogent3. app. composable import notcompleted _ data = { " human " : " atgcggctcgcggaggccgcgctcgcggag ", " mouse " : " atgcccggcgccaaggcagcgctggcggag ", " opossum " : " atgccagtgaaagtggcggcggtggctgag ", } aln = make _ aligned _ seqs ( data = _ data, moltype = " dna " ) ...
[ -0.11082020401954651, 0.38827213644981384, 0.5500571727752686, -0.5393781661987305, 0.7338144183158875, 1.015933632850647, 0.06164269894361496, 0.1938735842704773, 0.3325503468513489, 0.27586743235588074, -0.852451503276825, -0.6114611625671387, 0.2102004885673523, 0.2281375676393509, 0....
def command _ outage ( self, brain, args ) : wurl = " http : / / ems. ynoc. yahoo. com / ops _ ems / incident. php? action = view & id = " api _ url = " http : / / api. ems. ynoc. yahoo. com : 4080 / rest / v1 / incident. search " x = " " " < request > < criteria > < incident _ id > { 0 } < / incident _ id > < / criter...
[ -0.5922091603279114, -0.2889733910560608, 0.9241952896118164, -0.9807999730110168, 0.4504164159297943, -0.3166154623031616, -0.5656865835189819, 0.3313971161842346, -0.010506830178201199, 0.3773982524871826, 0.8730521202087402, 0.25534379482269287, -0.4066632091999054, -0.5482082366943359,...
def constant _ record _ and _ copy ( callback ) : while true : # these lines record the audio, and copy it onto our computer subprocess. call ('ssh pi @ 192. 168. 17. 201 / home / pi / use _ case _ scripts / ride - of - the - neatos / record _ from _ linein _ micbias _ modified. sh > / dev / null ', shell = true ) subp...
[ 1.083357572555542, -0.3813721537590027, 0.5306437015533447, 0.22081662714481354, 0.1408945918083191, 0.6017451286315918, 0.3156830966472626, 0.27759528160095215, -0.19102323055267334, 0.01115619670599699, -0.17532478272914886, 1.104759693145752, 0.2406482994556427, 0.08000151813030243, 0...
def _ resize _ all ( self ) : dir _ src _ base = self. dir _ base _ orig log. info ('computing total folders') total _ folders = self. _ compute _ total _ folders ( dir _ src _ base ) if self. max _ it is none else none count _ imgs = 0 for dirname, subdirlist, filelist in tqdm ( os. walk ( dir _ src _ base ), total = ...
[ -1.4405792951583862, 0.8111808896064758, 1.1550087928771973, 0.4226420223712921, -0.08212152123451233, -0.7587279677391052, 0.9864160418510437, 0.7387906312942505, -0.019577478989958763, 0.30088403820991516, -0.1356634497642517, -1.2917827367782593, -0.16824865341186523, 0.9166498184204102...
def do _ mousemove ( client, right, down, wy, wx ) : ret = client. mousemove ( right, down, wy, wx ) if'result'not in ret : logging. error ( " mousemove ( { }, { } ) response error : { } ". format ( right, down, ret. get ( " error ", " undefined " ) ) ) raise commanderrorresponse ( ) else : logging. info ( " mousemove ...
[ -0.9215990304946899, -0.18508245050907135, 0.522304356098175, 0.005179210100322962, 0.08872397243976593, -0.3665752708911896, -0.6697806119918823, -0.47799399495124817, -0.007596771698445082, 0.44790881872177124, 0.3850918114185333, 0.3337075412273407, -0.7509616613388062, 0.16407087445259...
def _ eval _ blocks ( expression, vars, vlen, typesize, vm, out _ flavor, * * kwargs ) : # compute the optimal block size ( in elements ) # the next is based on experiments with bench / ctable - query. py # and the'movielens - bench'repository if vm = = " numexpr " : bsize = 2 * * 24 else : bsize = 2 * * 22 bsize / / =...
[ 0.01912032626569271, 0.10068713873624802, 0.9421567320823669, -0.3514988124370575, -0.7162110805511475, -1.125937581062317, -0.08859564363956451, 0.05806554853916168, -0.5054644346237183, 1.1004468202590942, -0.28819918632507324, 0.6911484003067017, -0.4200272858142853, 0.25532692670822144...
def _ check _ end _ of _ queue ( self, item ) : if item is self. _ end _ of _ queue : raise endofqueueerror return item
[ 0.1674802303314209, -0.660493016242981, 0.5235999822616577, 0.15353937447071075, -0.06910058110952377, 0.2583919167518616, -0.6366955041885376, -1.3674248456954956, 0.5641553401947021, 0.7753750681877136, 0.7744760513305664, 0.4620920717716217, -0.596598744392395, 0.07608923316001892, 0....
def test _ atomic _ any _ uri _ length _ 2 _ nistxml _ sv _ iv _ atomic _ any _ uri _ length _ 3 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - length - 3. xsd ", instance = " nistdata / atomic / any...
[ 0.09915003180503845, -0.34413671493530273, 0.40668150782585144, 0.7620253562927246, -0.3187676966190338, 0.01589682698249817, -0.6388545036315918, 0.05303644761443138, -0.06951658427715302, 0.22916074097156525, 0.016453659161925316, -0.13852936029434204, -0.03903088718652725, 0.02618576027...
def generate _ weblog ( task, dictionary, show _ passed = true ) : weblog ( task, dictionary ). generate _ weblog ( show _ passed = show _ passed )
[ -0.017132071778178215, 0.5626914501190186, 0.33293747901916504, 0.7458533048629761, -1.2013756036758423, 0.9607036113739014, 1.0616018772125244, 1.18866765499115, -0.3762752115726471, 0.4860402047634125, -0.7518686056137085, 0.39024248719215393, 1.326859712600708, 1.0956273078918457, -0....
def save ( filename, image, mask _ nz = none, rescale = false, srgb = true ) : dirname = os. path. dirname ( filename ) if dirname and not os. path. exists ( dirname ) : os. makedirs ( dirname ) if rescale : image = rescale _ for _ display ( image, mask _ nz = mask _ nz ) if mask _ nz is not none : image2 = np. zeros _...
[ -1.004067301750183, -0.3794342279434204, 0.6007301807403564, 0.7995092868804932, -0.3018873929977417, -0.06479654461145401, 0.18341036140918732, -0.45863375067710876, 0.42568692564964294, 0.4221826493740082, 0.03877010568976402, -0.24428384006023407, 0.1488880217075348, 1.2879055738449097,...
def test _ right _ channel _ 1 ( ) : assert numpy. array _ equal ( mono _ 22050 _ 16bits. right _ channel ( ), mono _ 22050 _ 16bits. data )
[ 0.5227107405662537, -0.2172689288854599, 0.4281945526599884, -0.1081433892250061, 1.338558316230774, 0.40151143074035645, 0.1475384384393692, -1.3398326635360718, 0.43692547082901, -0.2860949635505676, -0.5767948031425476, 1.53860342502594, -0.4531177878379822, 0.23830674588680267, 0.609...
def call _ method ( self, element _ id, method _ name, kwargs = none ) : return self. _ request ('post ','/ elements / { } / call / { } '. format ( element _ id, method _ name ), body = {'kwargs': kwargs } )
[ -0.6552863121032715, 0.8000208139419556, 0.5809157490730286, 0.3683047294616699, -0.08708134293556213, -0.07361574470996857, -1.709964394569397, -0.9937806129455566, 0.3719174265861511, 0.5905534625053406, -0.16759172081947327, 0.860802948474884, -1.3345931768417358, 0.7837474346160889, ...
def inplace _ reuse ( cls, op, input _ idx, start _ axis = 0 ) : if cls. dtype _ bytes ( op. output. dtype ) > cls. dtype _ bytes ( op. inputs [ input _ idx ]. dtype ) : return false _, elem _ relation = cls. get _ prim ( op ). relation _ func ( op, input _ idx ) for i in range ( start _ axis, len ( elem _ relation ) )...
[ -0.2654792070388794, 0.781549870967865, 0.6844131946563721, 0.4316338002681732, 0.20440992712974548, -0.21957989037036896, 1.379179835319519, -0.659186601638794, 0.31426700949668884, 0.011973652057349682, -0.24681814014911652, 0.7642595171928406, -1.0758442878723145, -0.7299544215202332, ...
def test _ remove _ animals ( self ) : self. cell. animals. append ( self. herbivore ) self. cell. remove _ animals ( [ self. herbivore ] ) assert self. cell. total _ herbivores = = 0
[ -0.025644171983003616, 0.503084659576416, 0.4208132326602936, 0.021382246166467667, 0.9126657843589783, -0.26120686531066895, -0.29962578415870667, -0.067421093583107, -0.36380812525749207, 0.6611065864562988, -0.3929367661476135, -0.3772739768028259, -0.528592050075531, -0.546489000320434...
def get _ elements ( self, include _ data = false, include _ props = false ) : return self. _ request ('get ','/ elements ', query = {'include _ data': str ( include _ data ). lower ( ),'include _ props': str ( include _ props ). lower ( ) } ) ['elements']
[ -0.3211544156074524, 0.4164172112941742, 0.575645923614502, 0.11699855327606201, -0.09375600516796112, 0.7750305533409119, -0.6702821850776672, 0.9968599081039429, 0.9312089681625366, -0.4919310510158539, 0.27341601252555847, 1.213279128074646, -0.8645029067993164, 0.18916042149066925, -...
def get _ likes ( user ) - > queryset : return get _ user _ likes ( user = user )
[ 0.20422351360321045, 0.7031601667404175, 0.47938793897628784, 1.284365177154541, -0.564982533454895, 0.6338160037994385, -0.7433961033821106, -0.8289145827293396, -0.8399714827537537, -0.7613434791564941, -0.021035464480519295, 1.2941596508026123, -0.09171906858682632, 0.013317082077264786...
def best _ guess ( self ) : return self. _ best _ guess
[ -0.001246162224560976, -0.37330347299575806, 0.12363697588443756, 1.1255778074264526, 0.7161360383033752, 0.6223999857902527, -0.17947110533714294, 0.350507915019989, -0.636497437953949, -1.2343801259994507, 0.21461674571037292, 0.40087470412254333, -0.10684121400117874, -0.476098686456680...
def embedding _ density ( adata : anndata, basis : str = " umap ", groupby = none, key _ added = none, components = none, ) - > none : # to ensure that newly created covariates are categorical # to test for category numbers adata. _ sanitize ( ) # test user inputs basis = basis. lower ( ) if basis = = " fa " : basis = ...
[ -0.8962714672088623, 0.5645925402641296, 0.7553888559341431, -0.03317227214574814, -0.18272311985492706, -0.4237319529056549, 0.11619913578033447, -0.0153056550770998, -0.39949795603752136, 0.003137215506285429, 0.5486841797828674, 0.11627496778964996, 0.5914925932884216, -0.28568676114082...
def setupinitialresourcestructure ( kind : str, verbose : bool = false ) - > bool : if not runscript ( f'notebooksprepareresources { kind }') : if verbose : printmd ('* * error during resource > paration * * ', c ='red') return false if verbose : printmd ('* * resources prepared * * ', c ='green') return false
[ -0.3673846125602722, -0.014167546294629574, 0.6557570099830627, -0.2997843027114868, 0.16178707778453827, 0.22697585821151733, 0.4466209411621094, -0.25016725063323975, 0.0834750384092331, 0.4065358340740204, 0.32504165172576904, 0.11541203409433365, -0.4429164230823517, 0.9360482096672058...
def update ( self, params ) : self. render ( ) for event in params : if event. type = = pygame. keydown : if event. key = = pygame. k _ space : self. speed = - 8 self. bird. flap = true self. bird. make _ flap ( ) if event. key = = pygame. k _ p : self. paused = not self. paused if self. paused : font = pygame. font. s...
[ -0.6307611465454102, -0.415531724691391, 0.9919645190238953, -0.5119867324829102, 0.3486468195915222, 0.3575476109981537, 0.3412989675998688, -0.32764965295791626, -0.3445029556751251, 0.8948308229446411, -0.4571322202682495, 0.1486160308122635, -1.3661410808563232, 0.35868439078330994, ...
def _ _ setitem _ _ ( self, index, data ) : # todo for data objects with only one property, allow setting like : # a [ 5 ] = " steve " array _ index = self. _ get _ array _ index ( index ) relative _ index = self. _ get _ relative _ index ( index, array _ index ) if array _ index < len ( self. collections ) : self. col...
[ -0.2328944355249405, -0.0894564688205719, 0.6260160803794861, -0.4084003269672394, 0.08107270300388336, 0.5475484728813171, 0.15004341304302216, -1.3192797899246216, 0.30695441365242004, -0.43486112356185913, -0.4924091100692749, 0.47827446460723877, -0.26251259446144104, -0.60393399000167...
def handle _ extra _ type ( self, objtype, obj ) : person = self. dbstate. db. get _ person _ from _ handle ( obj ) self. new _ child _ added ( person )
[ 0.347340852022171, 0.15535223484039307, 0.6200082898139954, 0.1584986299276352, -0.19537003338336945, 1.0649014711380005, 0.020962247624993324, -0.4700941741466522, 0.7195003032684326, -0.5121837258338928, -1.2776004076004028, -0.36416420340538025, -0.26764988899230957, 0.26248034834861755...
def _ group _ swap _ helper ( target _ func, groups ) : n = groups. shape [ 0 ] zero _ group _ index = int ( target _ func ( np. argmin ( groups ), n ) ) within _ group _ zero _ index = np. argmin ( groups [ zero _ group _ index ] ) previous _ move = 0 # which tile was swapped in the previous move steps = 0 while not _...
[ -1.3251848220825195, 0.5961900353431702, 0.8321294188499451, 0.12045380473136902, 0.13806287944316864, -1.3363494873046875, 0.9225113987922668, -0.17908696830272675, -0.4914494454860687, -0.5153520703315735, 0.3760474622249603, 0.7784842848777771, 0.3654065728187561, 0.17925524711608887, ...
def binary _ values ( self, command, header _ bytes = 0, dtype = np. float32 ) : warn ( " ` adapter. binary _ values ` is deprecated, call ` instrument. binary _ values ` instead. ", futurewarning ) self. connection. write ( command ) binary = self. connection. read _ raw ( ) # header = binary [ : header _ bytes ] data...
[ -0.4568485617637634, -0.015720020979642868, 0.8448057770729065, 0.1993202269077301, 0.06103583797812462, -0.19084759056568146, -1.1617881059646606, -0.8814162611961365, -0.8650914430618286, -0.39890241622924805, -0.6537410616874695, 1.0494545698165894, -0.6664376854896545, 0.25852149724960...
def testgotomyaccountfunction ( self ) : self. utils. account. login _ as ( self. username, self. password ) self. po. goto _ page ( ) startpageurl = self. po. current _ url ( ) self. po. set _ page _ load _ marker ( ) self. po. goto _ myaccount ( ) self. po. wait _ for _ page _ to _ load ( ) endpageurl = self. po. cur...
[ -0.23307879269123077, 0.182655930519104, 0.4230647087097168, 0.07481397688388824, 0.2647866904735565, 0.031814176589250565, 1.2859103679656982, 0.12535667419433594, 0.7557043433189392, -0.7519567608833313, -0.5516698360443115, 0.6548041105270386, 0.19410686194896698, -0.1370362788438797, ...
def new ( * args, * * kargs ) : obj = itksubtractconstantfromimagefilterif3dif3 _ superclass. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ 1.4983524084091187, 1.110998272895813, 0.45493417978286743, -0.3543665409088135, -0.6362754106521606, 0.557096540927887, -0.06780440360307693, 1.114241600036621, 0.22721298038959503, -0.7007381319999695, -0.8644813895225525, -0.5686646699905396, 0.14714165031909943, 0.12545740604400635, ...
def get _ images ( ) : all _ images = [ ] images = os. listdir ('data /') all _ images + = [ i for i in images if i [ - 4 : ] = = '. pgm'] filtered = [ ] # for some reason some of th pgm files can't be read, so filter them out for images in all _ images : try : filtered. append ( [ images, read _ image ('data / { } '. ...
[ -0.8993330597877502, 0.018700258806347847, 0.7721518874168396, 0.32184308767318726, 0.26529067754745483, 0.1883096694946289, -0.4157034754753113, -0.08019709587097168, -0.763012170791626, 0.24151085317134857, 0.6608493328094482, 0.20009727776050568, -0.1899043172597885, 0.7729360461235046,...