text
stringlengths
25
2.19k
embedding
listlengths
768
768
def from _ dict ( self, seed ) : for k, v in seed. iteritems ( ) : self. set _ attribute ( k, v )
[ -0.605177640914917, -0.4704994857311249, 0.08623527735471725, -0.26481205224990845, -0.6833515763282776, 0.5209541320800781, -0.48518359661102295, 0.7160900235176086, 0.07080704718828201, 0.6953122019767761, -0.32765957713127136, -0.3698424696922302, 0.8930900692939758, 0.7544495463371277,...
def toggle _ id _ warnings _ collapse ( n, is _ open ) : if n : return not is _ open return is _ open
[ -1.3721458911895752, 0.5414168834686279, 0.353066623210907, 0.8960381746292114, 0.3386590778827667, 0.3321846127510071, -0.022543663159012794, -0.4886457622051239, 0.05330832675099373, 0.4912390410900116, -0.1401425302028656, -0.017191870138049126, -0.8460513949394226, -0.30610302090644836...
def get _ plane ( point1, point2 ) : y1 = point1 [ 0 ] z1 = point1 [ 1 ] y2 = point2 [ 0 ] z2 = point2 [ 1 ] k = float ( y2 - y1 ) / float ( z2 - z1 ) b = y1 - k * z1 return k, b
[ 0.5705322623252869, -0.715302586555481, 0.7116134166717529, 1.7277752161026, -0.13746029138565063, 0.5931321978569031, 0.057854387909173965, -0.14146588742733002, -1.1325531005859375, 0.7982832193374634, -0.5817750692367554, -0.1274113655090332, -0.30898550152778625, 0.23601971566677094, ...
def testwithfiltering ( self ) - > none : self. _ local _ mock. return _ value = {'testexpectations': test _ expectation _ file _ contents, } query _ results = [ # expected to be removed. {'name': ('conformance / textures / misc / video - rotation. html'),'id':'build - 1111 ','typ _ tags': ['win'], }, # expected to be ...
[ -0.24059128761291504, 0.18566842377185822, 0.622361958026886, -0.25221723318099976, 0.5273709893226624, -0.1662420779466629, 0.5973780751228333, -0.30893027782440186, -0.35439735651016235, 0.4891528785228729, -0.0891541987657547, -0.13362769782543182, -0.5586494207382202, 0.388638079166412...
def show3d ( capacity, value, weight, table, maxitems ) : # initialization - the number of items is taken from the length of any array # which shall have the same length nbitems = len ( value ) # show the header print print " overall capacity : % i " % capacity print " # of items : % i " % nbitems print " maximum numbe...
[ 0.5860382318496704, -0.056768447160720825, 0.923561692237854, 0.40952569246292114, -0.8453267216682434, 0.17720092833042145, -0.12297973781824112, 0.4335358440876007, -0.47499358654022217, 0.29480037093162537, 0.386412650346756, 0.28930941224098206, 0.23655346035957336, -0.272077351808548,...
def reanalyze _ functions ( functions, levels ) : # reset instruction and function's states for a, f in functions. iteritems ( ) : if f. level = = - 1 : continue # re - init functions that were reordered if hasattr ( f,'code') : code = f. code was _ reordered = [ ins _ a! = f. code [ ins _ a ]. addr for ins _ a in f. c...
[ -0.274922639131546, -0.3003027141094208, 0.8390039801597595, -0.25711309909820557, -0.4782618582248688, -0.5863616466522217, 0.3890490233898163, -0.3072539269924164, 0.007856674492359161, -0.4110305905342102, -0.5241135358810425, 0.21142610907554626, -0.20190517604351044, 0.045694164931774...
def handshake ( protocol, container ) :
[ 0.5132172703742981, 0.5263801217079163, -0.013941431418061256, 1.165230393409729, 1.1372554302215576, -0.2794274687767029, -0.33533817529678345, -0.49938392639160156, -0.5225156545639038, -0.42394429445266724, 0.29624006152153015, -0.7238279581069946, -0.7020089626312256, -0.49958190321922...
def lqr ( a, b, q, r ) : # ref bertsekas, p. 151 # first, try to solve the ricatti equation x = np. matrix ( scipy. linalg. solve _ continuous _ are ( a, b, q, r ) ) # compute the lqr gain k = np. matrix ( scipy. linalg. inv ( r ) * ( b. t * x ) ) eigvals, eigvecs = scipy. linalg. eig ( a - b * k ) return k, x, eigvals
[ 1.05323326587677, -0.8449429869651794, 0.5398174524307251, -0.2772618532180786, -0.1536259651184082, -0.02981501817703247, -1.1268242597579956, 0.30092018842697144, -0.03480662405490875, 0.4923231303691864, -0.04147660732269287, -0.3359081745147705, 0.004574294202029705, -0.445411264896392...
def venus _ location ( grid _ b, figsize = ( 10, 10 ) ) : lats = grid _ b. variables [ " nav _ lat " ] [ : ] lons = grid _ b. variables [ " nav _ lon " ] [ : ] bathy = grid _ b. variables [ " bathymetry " ] [ : ] levels = np. arange ( 0, 470, 50 ) fig, ax = plt. subplots ( 1, 1, figsize = figsize ) fig. patch. set _ fa...
[ 0.5171118378639221, -0.46867430210113525, 0.8212738633155823, -0.34599074721336365, 0.19060246646404266, 0.21204215288162231, 1.1015177965164185, 0.7894117832183838, 0.2296787053346634, -0.20527052879333496, -0.451179563999176, 1.6406848430633545, 0.9653341770172119, -0.10201321542263031, ...
def alive ( self ) : return self. _ _ manager is not none
[ 0.01210334338247776, -1.5822491645812988, 0.7487021088600159, -0.1801759898662567, 0.7964943051338196, 0.8694943785667419, -1.166327953338623, 0.13384801149368286, -0.27098506689071655, -0.7107679843902588, -0.8835496306419373, -0.6094933748245239, -0.8972731828689575, -0.02634517289698124...
def test _ map _ userinfo _ to _ existing _ user ( self ) - > none : store = self. hs. get _ datastores ( ). main user = userid. from _ string ( " @ test _ user : test " ) self. get _ success ( store. register _ user ( user _ id = user. to _ string ( ), password _ hash = none ) ) # map a user via sso. userinfo = { " su...
[ 0.2664947807788849, 0.4566779136657715, 0.904935359954834, 0.48659956455230713, -0.33727893233299255, 0.8030999898910522, 0.636863648891449, -0.2021597921848297, 1.1160316467285156, -0.47801339626312256, -1.3156696557998657, 0.4530973434448242, 0.6593508124351501, -0.2821882665157318, 0....
def ssf ( x, size, q, pbc = false ) : natoms = np. shape ( x ) [ 0 ] sf = 0. 0 for i in range ( natoms ) : x1 = x [ i ] for j in range ( i + 1, natoms ) : x2 = x [ j ] dx = x2 - x1 if pbc : for i in range ( 3 ) : if dx [ i ] > size / 2 : dx [ i ] - = size if dx [ i ] < - size / 2 : dx [ i ] + = size r = np. linalg. nor...
[ 0.7304031252861023, 0.6855447292327881, 0.4235444962978363, -0.5552124977111816, -0.6302708387374878, -0.1771000176668167, -0.20546303689479828, -0.2483571618795395, 1.0732489824295044, -0.4675408601760864, -0.8758664727210999, 0.1991465538740158, -0.6267451047897339, 0.06169835478067398, ...
def most _ recent ( n ) : return compose ( query. takes ( n ), sort _ by _ created )
[ -0.5132073760032654, 1.178377389907837, 0.2541689872741699, -0.02093593217432499, 0.26318275928497314, -0.9583624005317688, 0.1429678350687027, -0.9423311352729797, -0.6858634948730469, -0.7527449727058411, 0.30260834097862244, -0.8682653307914734, 0.5666139125823975, -0.056459855288267136...
def collision ( self, x, y ) : for i in range ( len ( self. fruits _ coords ) ) : if self. fruits _ coords [ i ] = = ( x, y ) : del self. fruits _ coords [ i ] del self. fruits _ image [ i ] return true
[ -0.2873907685279846, -0.3876612186431885, 0.8422055244445801, -0.23765401542186737, -0.30761241912841797, 0.1606336236000061, -0.1871585100889206, -0.5053366422653198, -0.39279231429100037, 0.8678122162818909, -0.19180825352668762, -0.08555286377668381, -0.5565204620361328, -0.609279870986...
def get _ cifar10 _ data ( num _ training = 49000, num _ val = 1000, num _ test = 10000, show _ sample = true ) : cifar10 _ dir = '.. /.. / datasets / cifar - 10 - batches - py'x _ train, y _ train, x _ test, y _ test = load _ cifar10 ( cifar10 _ dir ) # subsample the data for validation set mask = range ( num _ traini...
[ 0.7552316188812256, 0.06565742194652557, 0.6403763890266418, 0.13127249479293823, -0.15436379611492157, -0.22566959261894226, 0.19119864702224731, 1.0407166481018066, 0.06695566326379776, 0.05484990403056145, 0.047569625079631805, 0.6457841992378235, 0.3664158582687378, -0.911803126335144,...
def create _ feed _ dict ( self, inputs _ batch, mask _ batch, labels _ batch = none, dropout = 1 ) : # # # your code ( ~ 6 - 10 lines ) feed _ dict = { } feed _ dict [ self. input _ placeholder ] = inputs _ batch if labels _ batch is not none : feed _ dict [ self. labels _ placeholder ] = labels _ batch feed _ dict [ ...
[ -0.010867662727832794, -0.03613893315196037, 0.4845442473888397, -0.2488299310207367, -0.12781009078025818, 0.30334001779556274, 0.04280852526426315, -0.5025317668914795, -0.8487899303436279, -0.3861979842185974, -0.4077478051185608, 0.2240954041481018, -0.2196662873029709, 0.1411984711885...
def query _ entry ( ) : allowed _ str _ args = ['name ','symbol ','status ','uuid ','locus _ group ','locus _ type ','date _ name _ changed ','date _ modified ','date _ symbol _ changed ','date _ approved _ reserved ','ensembl _ gene ','vega ','lncrnadb ','horde ','mirbase ','iuphar ','ucsc ','snornabase ','pseudogeneo...
[ -0.09075350314378738, -0.16783860325813293, 0.3959968686103821, -0.40734779834747314, 0.2305276244878769, -0.4291170537471771, -0.5759934186935425, -0.5225697159767151, -0.8175603151321411, 0.49618080258369446, 0.334381639957428, 0.8731660842895508, -0.21777722239494324, 0.4154325723648071...
def amat _ entry ( amat, r, c, val ) : amat [ r - 1 ] [ c - 1 ] = amat [ c - 1 ] [ r - 1 ] = val return
[ 0.25288957357406616, -0.5492528080940247, 0.325713187456131, -0.8952780365943909, -0.4349779784679413, 0.41850176453590393, -0.11154372245073318, -0.6267191171646118, -0.19337721168994904, 0.9208226799964905, 0.34927433729171753, 0.7691476941108704, 0.6586134433746338, -0.41987144947052, ...
def prelabel _ accuracy _ threshold ( self ) - > optional [ float ] : return pulumi. get ( self, " prelabel _ accuracy _ threshold " )
[ 0.30117863416671753, 0.06299159675836563, 0.5414198040962219, 0.14598771929740906, -0.13850611448287964, 0.8852077126502991, 0.8775893449783325, -0.06899252533912659, 0.640828013420105, -0.0689915344119072, -0.2852589786052704, 1.3618831634521484, 0.015781022608280182, -0.3605406880378723,...
def autoroc ( self, iatarget = 0. 024 ) : # set iana roc print " starting roc configuration " ia = self. getia ( ) print " ia = ", ia, " a " if abs ( ia - iatarget ) > 0. 001 : self. setdac ( 2, 0 ) time. sleep ( 0. 2 ) imin = ( 0, self. getia ( ) ) imin = ( 0, self. getia ( ) ) print imin self. setdac ( 2, 255 ) time....
[ 0.46714159846305847, -0.27251091599464417, 0.7810665965080261, -0.13049963116645813, 0.6945981979370117, -0.5315703749656677, 1.315603494644165, -0.03039686009287834, 0.4249713122844696, -0.014119785279035568, -0.2376193255186081, 0.13233649730682373, -0.6455354690551758, 0.020453834906220...
def last _ two _ lines _ blank ( source ) : if len ( source ) < 3 : return false return ( not _ blank _ line. match ( source [ - 3 ] ) and _ blank _ line. match ( source [ - 2 ] ) and _ blank _ line. match ( source [ - 1 ] ) )
[ -0.5594890117645264, 0.02002158761024475, 0.8272849917411804, 0.06873622536659241, 0.5161123871803284, -0.06648761034011841, -0.483794242143631, 0.2759875953197479, -0.23202306032180786, 0.4940893352031708, -0.5117707252502441, -0.8827687501907349, 0.2688625454902649, 0.02937377616763115, ...
def setup _ standard _ frame ( self, title ='', x _ title = none, y _ title = none, num _ x _ labels = 4, num _ y _ labels = 4, warn _ y = none, alert _ y = none ) : from ginga. canvas. types import plots as gplots self. titles = [ x _ title, y _ title ] p _ bg = gplots. plotbg ( linewidth = 2, warn _ y = warn _ y, ale...
[ 0.5053964853286743, 0.715680718421936, 0.7168400883674622, 0.6093280911445618, 0.1306452602148056, -0.2662663757801056, 0.0017163715092465281, -0.10671034455299377, 0.19260475039482117, -0.7039245963096619, 0.1801629513502121, 1.073644995689392, 0.245088130235672, 0.0005346517427824438, ...
def prepare _ loadflow ( self, ldf _ mode ='balanced') : modes = {'balanced': 0,'unbalanced': 1,'dc': 2 } # get load flow object self. ldf = self. app. getfromstudycase ('comldf') # set load flow mode self. ldf. iopt _ net = modes [ ldf _ mode ]
[ 0.3745141625404358, -0.6864340305328369, 0.4382553994655609, -0.8640655279159546, 1.0260051488876343, 0.7925177812576294, -0.6441981196403503, -0.5260186195373535, 0.3454868793487549, -0.489316463470459, 0.031908296048641205, -0.044455982744693756, -0.139749675989151, -0.45970582962036133,...
def test _ destroy _ alumno _ curso _ admin _ incorrecto ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) response = self. client. delete ( f " / api / alumnos / curso / { self. alumno _ curso _ 7. id } / " ) self. assertequal ( response. status _ code, status. http _ 404 _ not _ found ) resp...
[ 0.5455616116523743, -0.5264168381690979, 0.5928574204444885, 0.3348534405231476, 0.8609052896499634, 1.4252115488052368, 0.28584805130958557, 0.6582288146018982, 0.17297761142253876, 0.5851395130157471, -0.4888871908187866, 1.343808650970459, 0.36910051107406616, 0.496185839176178, 1.663...
def count _ public _ posts _ for _ user ( self, user ) : post = get _ post _ model ( ) circle = get _ circle _ model ( ) moderatedobject = get _ moderated _ object _ model ( ) world _ circle _ id = circle. get _ world _ circle _ id ( ) posts _ prefetch _ related ='circles'posts _ only ='id'user _ query = q ( creator _ ...
[ 0.6137171983718872, 0.1644195318222046, 0.7100800275802612, 0.05609968304634094, -0.41276130080223083, 0.5847308039665222, 1.1099597215652466, -0.5175287127494812, -0.4470613896846771, -0.1814497411251068, -0.8945053815841675, 0.22995956242084503, -0.17072147130966187, 1.0044453144073486, ...
def comparisons _ to _ ref ( self, k, l ) : if self. similarities is none : self. similarities = self. metric ( self. x, self. x ) if k > l : k, l = l, k if ( k, l ) in self. references : comparisons _ array = ( self. similarities > self. similarities [ k, l ] ) * 1 - ( self. similarities < self. similarities [ k, l ] ...
[ -0.1284443438053131, 0.3364780843257904, 0.7786920666694641, -0.604962170124054, 0.44391360878944397, 0.11408601701259613, -0.08936768025159836, -0.5092669725418091, 0.33886829018592834, 0.5551930665969849, 0.020881356671452522, 0.6961209774017334, -0.9361793398857117, 0.7252228856086731, ...
def calcular _ serie _ agregada ( self, variable ) : # # toma las series de cada uno de los puntos y las mete en una lista series _ iterable = [ ] for p in self. pixeles _ modis : series _ iterable. append ( getattr ( p, variable ) ) # # concatena las listas y las agrupa por el indice unido = pd. concat ( series _ iter...
[ -1.0200729370117188, 0.6157770156860352, 0.5490751266479492, -0.5245084166526794, 0.2532692551612854, -0.5735316872596741, -0.3437296152114868, -0.5998173356056213, 1.2772257328033447, 0.9040910005569458, 1.0281095504760742, 0.798140823841095, -0.540732741355896, 0.7666643857955933, 0.14...
def validate ( self ) - > bool : file _ validators = [ fileexists ( self. path, f " { self. path } : file doesn't exist " ), extension ( self. path, f " { self. path } : " " file extension validation failed " ), canopenfile ( self. path, f " { self. path } : file can not be openned " ), jsonformat ( self. path, f " { s...
[ -0.6943179368972778, -0.7653828859329224, 0.8402357697486877, 0.16874723136425018, 0.30507346987724304, 0.6893063187599182, 0.20781025290489197, 0.006100253667682409, -1.0214182138442993, -0.5997126698493958, 0.34405654668807983, -0.49225836992263794, -0.35013166069984436, -0.1520328074693...
def test _ should _ abort _ when _ cannot _ connect ( self ) : with hide ('everything') : execute ( parallel _ subtask, hosts = ['nope. nonexistent. com'] )
[ 0.5640769004821777, 0.5601222515106201, 0.49265360832214355, 1.3077799081802368, 0.3755972385406494, 1.3483251333236694, 0.010792280547320843, 0.14687444269657135, -0.8286595344543457, 0.029917845502495766, 0.026194823905825615, 0.6674494743347168, -0.4106818735599518, 0.05510096624493599,...
def run ( self ) : self. listener. start ( )
[ 0.8772813081741333, -1.6265326738357544, 0.11821777373552322, 0.03153431788086891, 1.0716217756271362, 1.151511788368225, 0.6701168417930603, 1.085378646850586, -0.23225204646587372, -0.4160107970237732, -0.1755731999874115, 0.5603957772254944, -0.4315323531627655, 0.2932623028755188, 0....
def send _ to _ self ( self, amount, payment _ id = none ) : if self. address and amount < = self. unlocked _ balance : dest = transaction. txdestination ( amount, self. address ) try : fee, txid, tx _ key, tx _ blob = self. basic _ transfer ( dest, payment _ id ) print ( " fee : % s \ ntxid : % s \ ntx _ key : % s \ n...
[ 0.003618610091507435, 0.020208299160003662, 0.6840478777885437, -0.4752308428287506, -0.20696207880973816, -0.3691937327384949, -0.4975872337818146, -1.1168941259384155, 0.14698943495750427, 0.5049696564674377, -0.2915063798427582, 0.731540858745575, -0.25684693455696106, -0.12686052918434...
def _ get _ all _ pairs _ routings ( self, start _ nodes, end _ nodes = none, end _ speed = 10. 0 ) : end _ speed = end _ speed * 1000. 0 / 3600. 0 # km / h - > m / s if end _ nodes is not none : node _ set = set ( start _ nodes ) | set ( end _ nodes ) else : node _ set = set ( start _ nodes ) end _ nodes = start _ nod...
[ -0.6339640617370605, 0.35186824202537537, 0.9678370356559753, -0.01637663133442402, -0.7861819267272949, -0.4809417724609375, -0.1121605709195137, 0.4016084671020508, -0.6480926871299744, 1.1572800874710083, -0.6338446140289307, 0.23403529822826385, -0.2130768746137619, 0.5214813947677612,...
def getcondorjobs ( self, constraint, attr _ list ) : try : jobs = self. schedd. query ( constraint, attr _ list ) return jobs except exception : # if there is an error, try to recreate the schedd instance logging. info ( " recreating schedd instance due to query error... " ) self. schedd = htcondor. schedd ( ) try : j...
[ 0.01866704411804676, 0.004187092185020447, 0.5246067047119141, 0.475478857755661, -0.4314461350440979, 0.19417619705200195, -0.7032220959663391, 0.44430074095726013, -0.2999708950519562, 0.1299046277999878, 0.24080832302570343, -0.08179591596126556, -0.8946363925933838, -0.5089635252952576...
def get _ cluster ( cluster _ name : optional [ str ] = none, resource _ group _ name : optional [ str ] = none, opts : optional [ pulumi. invokeoptions ] = none ) - > awaitablegetclusterresult : _ _ args _ _ = dict ( ) _ _ args _ _ ['clustername'] = cluster _ name _ _ args _ _ ['resourcegroupname'] = resource _ group ...
[ -0.025898199528455734, 0.4104153513908386, 0.6679551005363464, 0.7215545773506165, 0.139087975025177, -0.0042162262834608555, -0.7521541118621826, 0.13589614629745483, 0.920464277267456, 0.4779863655567169, 0.4152226448059082, 1.6052258014678955, -0.5840396285057068, -1.2344759702682495, ...
def get _ dev _ examples ( self, data _ dir ) : raise notimplementederror ( )
[ -0.8022551536560059, 0.8125898241996765, 0.4199434220790863, 0.5393200516700745, 0.2015364021062851, 0.6669936180114746, 0.2391391545534134, -0.08008125424385071, 0.48438549041748047, -0.8082809448242188, -0.7334494590759277, 0.7935665249824524, 0.8092639446258545, 0.6454565525054932, -0...
def _ log _ record _ cancelled ( self ) : logger. info ( " recording cancelled ", extra = dict ( event ='record _ cancel') )
[ 1.420926809310913, -0.5473368763923645, 0.4916810095310211, 0.2698155641555786, -0.5127918124198914, 0.08573596179485321, -0.42606714367866516, 1.3649307489395142, -0.2614687979221344, 1.0497316122055054, -0.22053173184394836, 0.8321678042411804, 1.5534698963165283, -0.08033812791109085, ...
def validate _ form _ data ( src, dest, date, time ) : if not util. is _ toc _ format _ valid ( src ) or not util. is _ toc _ format _ valid ( dest ) : raise valueerror ( " invalid station code " ) now = datetime. datetime. now ( ) currday = now. day currtime = [ now. hour, now. minute ] if date [ 2 ]! = 2020 or not 1 ...
[ -0.8993604183197021, 0.15278202295303345, 1.2447504997253418, -0.15810556709766388, -1.0395928621292114, 0.8855892419815063, -0.4381279945373535, -0.5923929214477539, -0.6318461894989014, -0.15945595502853394, 0.3661493957042694, -0.15171866118907928, 0.11037977039813995, 0.710629820823669...
def decompose _ non _ zero _ eigenvectors ( self ) : non _ zero _ eigenvalues, non _ zero _ eigenvectors = self. get _ non _ zero _ prob _ eigenvectors ( ) decomposed _ eigenvectors = [ ] for eigenvector in non _ zero _ eigenvectors : # find all the values and indices of the non - zero elements in the eigenvector. each...
[ -1.179978370666504, -0.3828463554382324, 0.6549685001373291, 0.21209067106246948, -0.00868434552103281, -0.23755039274692535, 0.5519163608551025, -0.07045900076627731, 0.41672950983047485, 0.15939204394817352, -0.26527151465415955, -0.6674419045448303, -0.17383025586605072, 1.3456349372863...
def rows _ update ( x : dataframe, y : dataframe, by : stringoriter = none, copy : bool = true, ) - > dataframe : key = _ rows _ check _ key ( by, x, y ) _ rows _ check _ key _ df ( x, key, df _ name = " x " ) _ rows _ check _ key _ df ( y, key, df _ name = " y " ) idx = _ rows _ match ( y [ key ], x [ key ] ) bad = is...
[ -0.6390084624290466, 0.40043866634368896, 0.5439407825469971, 0.13704781234264374, -1.3385899066925049, -0.9345378875732422, -0.3393222391605377, 0.3278604745864868, -0.02993270568549633, 0.6519365906715393, 0.6884059906005859, 0.30912452936172485, 0.6198849081993103, -0.714688241481781, ...
def edge2node ( self, x, rel _ rec, rel _ send ) : incoming = torch. matmul ( rel _ rec. t ( ), x ) return incoming / incoming. size ( 1 )
[ -0.014132971875369549, 0.21235236525535583, 0.4923883080482483, -1.298941969871521, 0.07730665057897568, 0.20907504856586456, 0.642217218875885, 0.040262360125780106, -0.3141278326511383, 1.5091683864593506, -0.42752763628959656, 0.20567449927330017, -0.10153719782829285, -0.96598875522613...
def hosting _ events ( ) : # user login required if'username'not in flask. session : response = flask. make _ response ( json. dumps ('user login required'), 401 ) response. headers ['content - type'] ='application / json'return response try : with db _ session ( ) as db : hosted _ events = db. query ( models. hosting ...
[ 0.5059698224067688, -0.21834854781627655, 0.7815398573875427, 1.0171877145767212, 0.17084002494812012, 0.0860515832901001, 0.156268909573555, 0.5827040076255798, -0.4682489037513733, 0.4796326756477356, -0.03682989999651909, 0.13831622898578644, -0.416261225938797, 0.05967368930578232, 0...
def contour ( a, f ) : try : # on the assumption flat lines common in forecasts, # but exceedingly rare in real world contour _ result = np. sum ( ( np. nan _ to _ num ( np. diff ( a, axis = 0 ) ) > = 0 ) = = ( np. nan _ to _ num ( np. diff ( f, axis = 0 ) ) > 0 ), axis = 0, ) / ( f. shape [ 0 ] - 1 ) except exception ...
[ 0.3911535441875458, 0.3826756477355957, 0.5401602983474731, 0.6882330179214478, -0.5411763787269592, -0.1531379669904709, 0.8629243969917297, 0.8923371434211731, 0.11123310774564743, 0.36594799160957336, 0.5968959927558899, -0.04433932527899742, 0.8601456880569458, 0.5268759727478027, -0...
def children ( self ) - > iterable [ e ] : yield from [ ]
[ 0.4098726511001587, -0.29038652777671814, 0.43581801652908325, 0.2911017835140228, -0.0007036824827082455, 0.9046313166618347, -0.2857306897640228, -0.07849976420402527, -0.06301339715719223, -0.8768311738967896, -0.5466160178184509, 0.5050719380378723, 0.46236658096313477, 0.2976208925247...
def restart _ samba _ services ( ) : try : client = salt. client. localclient ( ) rc = client. cmd ('* ','service. reload ', ['smbd'] ) # print rc rc = client. cmd ('* ','service. restart ', ['winbind'] ) # print rc except exception, e : return false,'error restarting smb services : % s'% str ( e ) else : return true, ...
[ -0.3658885061740875, 0.14104534685611725, 0.7823066115379333, 0.9105672836303711, -0.5933609008789062, 0.8389720320701599, -0.060143619775772095, -0.04325029253959656, 0.2942388355731964, 0.2166292667388916, -0.8312004208564758, 1.2270992994308472, -1.4779976606369019, 0.3575259745121002, ...
def print _ total ( player _ posn, hand _ num = 0 ) : print ( " \ nhand { } total : { } \ n ". format ( hand _ num + 1, sum _ cards ( player _ posn, hand _ num ) ) )
[ 0.34237948060035706, -0.7111399173736572, 0.579423189163208, -0.10771103948354721, 0.5003536939620972, -0.4316801428794861, 0.10108281672000885, 0.3687370717525482, 0.03308083489537239, -0.1484510451555252, -0.6271028518676758, 0.46277788281440735, 0.3588360548019409, -0.5618119835853577, ...
def not _ in _ place ( sorting _ algorithm ) : @ wraps ( sorting _ algorithm ) def wrapper ( arr, * args, * * kwargs ) : copy = arr. copy ( ) sorting _ algorithm ( copy, * args, * * kwargs ) return copy return wrapper
[ -0.3987140357494354, -0.7451068758964539, 0.4873570501804352, 0.0957651436328888, -1.2618584632873535, 1.2517892122268677, 0.053519755601882935, -0.05796310305595398, 0.806857705116272, 1.3022183179855347, 0.8551579117774963, 0.5859010219573975, -0.19944600760936737, 0.937765896320343, 0...
def vec _ rotate ( vec, theta ) : rot _ m = np. array ( [ [ cos ( theta ), - sin ( theta ) ], [ sin ( theta ), cos ( theta ) ] ] ) return np. matmul ( rot _ m, vec )
[ -0.22004945576190948, 0.2811204791069031, 0.1847580522298813, -0.21886225044727325, 1.0124726295471191, -0.3515329658985138, -0.19753119349479675, 0.1840459704399109, -0.29725006222724915, 0.2806020975112915, -0.26241928339004517, 0.19676543772220612, -0.24915637075901031, -0.8130374550819...
def is _ source ( seq ) : # otherwise lambdas would be counted as source, # but they must be converted to sequences. # moreover : this makes source elements explicit and visible in code. from. import source return isinstance ( seq, source. source )
[ -1.1204028129577637, 0.3829285800457001, 0.19593600928783417, 0.18830445408821106, -0.6574275493621826, -0.0462518073618412, 0.6563310027122498, 0.15347756445407867, 1.6850889921188354, 1.0936287641525269, -1.3678337335586548, 0.04806910827755928, -0.3845938742160797, 0.7287389636039734, ...
def _ _ str _ _ ( self ) : return f " { self. x, self. y } "
[ -0.6658920645713806, -2.005160093307495, 0.4997492730617523, -2.1490819454193115, -0.44317731261253357, 0.6850705146789551, -0.38005295395851135, -0.6233767867088318, -0.5328375697135925, -0.42873528599739075, 0.8722829818725586, 0.6063799262046814, 0.728807270526886, -0.814464807510376, ...
def indexbams ( bucketpath, cores = 4 ) : files = gcp. lsfiles ( [ bucketpath ] ) bams = [ val for val in files if '. bam'in val [ - 4 : ] ] unindexed = [ val for val in bams if val [ : - 4 ] + '. bai'not in files and val [ : 4 ] + '. bam. bai'not in files ] print ( " found " + str ( len ( unindexed ) ) + " files to re...
[ 0.04113178327679634, -0.5236818790435791, 0.6102140545845032, 0.3143305778503418, 0.34762611985206604, 0.38596341013908386, 0.6966272592544556, -0.5069939494132996, -0.6679121255874634, 0.15510280430316925, -0.37515994906425476, 0.339842289686203, -0.49445071816444397, 0.15278440713882446,...
def _ _ disjoint _ match ( self, spans1, spans2 ) : i = j = cmp _ status = 0 while i < len ( spans1 ) and j < len ( spans2 ) : s1, e1 = spans1 [ i ] s2, e2 = spans2 [ j ] # if s1 or s2 are less than 0, it means, that these groups # didn't contribute to match. # if the 1 - st group ended before start of the 2 - nd. if s...
[ -0.5742017030715942, -0.2120341807603836, 0.6913654804229736, -0.36524543166160583, -1.4410204887390137, 1.0738859176635742, 0.4165211319923401, -0.06145724654197693, -0.3630395233631134, -0.35006681084632874, -0.10886039584875107, -0.5179996490478516, -1.2022730112075806, 0.56486052274703...
def get ( self, request, pk ) : info = get _ object _ or _ 404 ( rater, id = pk ) movies = get _ list _ or _ 404 ( review, reviewer = pk ) print ( movies ) return render ( request,'movieratings / user _ detail. html ', {'info': info,'movies': movies } )
[ -0.5386495590209961, 0.11224918812513351, 0.4240204989910126, -0.06575809419155121, 0.18657103180885315, 0.7919585704803467, -0.8294886946678162, 0.3703199625015259, -0.22847427427768707, 0.20486092567443848, 0.8978378176689148, 0.01713888719677925, -0.46259552240371704, 1.059759259223938,...
def print _ result ( self ) : if not self. possible _ moves ( ) : print ( " draw " ) else : print ( f " player { self. nopponent } [ value of negamax : { self. values _ for _ negamax [ self. nopponent - 1 ] }, char : { self. available _ chars [ self. nopponent ] } ] won " )
[ -0.25891080498695374, -0.1253637969493866, 0.5622350573539734, 0.0776902437210083, -0.053559884428977966, 0.18170849978923798, 0.1371636688709259, -0.4343876242637634, -0.5842983722686768, -0.20213569700717926, -0.04951721802353859, 0.8219081163406372, -0.4702415466308594, -0.1499190181493...
def _ persistentvarexists ( self, svar ) : return os. path. exists ( self. _ _ persistentvarcalcname ( svar ) ) ;
[ -0.14753390848636627, -0.8825364112854004, 0.3952580690383911, 0.3801935911178589, -0.3424013555049896, 0.5668800473213196, 0.3328399658203125, -0.4293738901615143, 0.17096160352230072, -0.006440731231123209, 0.21510042250156403, -0.2377016395330429, -0.30503377318382263, -0.38334867358207...
def raw _ disk ( self ) - > pulumi. output [ optional ['outputs. imagerawdisk'] ] : return pulumi. get ( self, " raw _ disk " )
[ -0.12919531762599945, 0.5994992852210999, 0.4434833824634552, -0.1293450891971588, -0.39435723423957825, 0.6104465126991272, 0.973156750202179, -0.39229485392570496, 0.812500536441803, -0.9304117560386658, 0.3112030029296875, 0.6348918676376343, 1.0812081098556519, -0.26790499687194824, ...
def write _ html _ table ( f, row _ values, border = 1, width = none, css _ id = none ) : f. write ('< p >') args ='' if css _ id is not none : args + = f ', id = " { css _ id } "'if width is not none : args + = f ', width = " { width } "'f. write ( f'< table border = " { border } " { args } >') for row in row _ values...
[ 0.33180302381515503, 0.6924567818641663, 0.6036287546157837, 1.0652379989624023, 0.5895037651062012, 0.36639872193336487, -0.21108126640319824, 0.4960276484489441, -0.595653772354126, -0.5142435431480408, 0.24056197702884674, -0.5351622104644775, 0.8718873858451843, 0.9009506106376648, -...
def get _ api _ key ( ) : try : return os. environ ['geolocation _ api _ key'] except keyerror : logger. error ( " geolocation _ api _ key environment variable not set " ) abort ( response ( status = 500, mimetype ='application / json ', response = json. dumps ( {'code': 500,'message':'server configuration error ', } )...
[ -0.38747331500053406, -0.756243109703064, 0.46265920996665955, 0.47849899530410767, 0.41996175050735474, 0.5236935615539551, 0.3930746018886566, -0.24982206523418427, -0.6717342138290405, 1.6758993864059448, 0.5320529937744141, 0.5468692779541016, -0.6907075643539429, 0.359835684299469, ...
def make _ updated _ node ( self, friend _ transition, enemy _ transition, parent = none ) : friend _ index = enemy _ index = - 1 if parent is none : # find new root, parent will be none in this case for i, curr _ friend _ transition in enumerate ( self. friend _ transitions ) : if curr _ friend _ transition = = friend...
[ -0.5331590175628662, -0.9987887740135193, 0.7156869173049927, -0.03474245220422745, -0.1692720502614975, -0.13422977924346924, 0.1384618878364563, -0.18534639477729797, -0.4374997317790985, 0.8639747500419617, 0.640296995639801, -0.5291617512702942, -0.015671348199248314, -0.82093983888626...
def get _ state ( self, duration ) : raise runtimeerror, " implement me! "
[ -0.6758309602737427, -0.4530586898326874, 0.36938396096229553, 0.8742499351501465, -0.6142457127571106, -0.024242931976914406, 0.2683963179588318, -0.4031152129173279, -0.04023318365216255, -0.06680198013782501, -0.26145291328430176, 0.34885066747665405, -0.046331267803907394, 0.0032027731...
def printitems ( self, zeroonelist ) : totalweight = totalvalue = 0 for i in range ( len ( zeroonelist ) ) : item, weight, value = self. items [ i ] if totalweight + weight < = self. maxcapacity : if zeroonelist [ i ] > 0 : totalweight + = weight totalvalue + = value # print ( " - adding { } : weight = { }, value = { }...
[ -0.5094379186630249, -1.2923067808151245, 0.6822381615638733, 0.41705238819122314, 0.3081390857696533, 0.09222538769245148, 0.2077963650226593, -0.29729118943214417, 0.016782667487859726, -0.06733749806880951, -0.5574491620063782, -0.6134489178657532, -0.6252201199531555, 1.357286691665649...
def islicensed ( self ) : return true
[ 1.691400170326233, -0.7890327572822571, 0.47407951951026917, 1.2398014068603516, 0.1485494077205658, 0.6698654890060425, -0.07171747833490372, 0.6869485974311829, 1.922116994857788, -1.413377285003662, -0.47138500213623047, 0.20550993084907532, -1.0401276350021362, 0.4226303994655609, -2...
def find _ schema _ warnings ( self ) : if self. _ schema _ warnings is not none : return self. _ schema _ warnings self. _ schema _ warnings = [ * self. find _ all _ row _ schema _ warnings ( ), * self. find _ all _ table _ schema _ warnings ( ), ] return self. _ schema _ warnings
[ -0.41975897550582886, -0.03017367795109749, 0.5089519619941711, 1.007330298423767, 0.5270611047744751, -0.26410815119743347, 0.190519317984581, -0.6811664700508118, 0.32379087805747986, 0.14693351089954376, -0.4160423278808594, 0.608120858669281, 0.7293282747268677, 1.1832787990570068, -...
def center ( self ) : return ( self. pt1 + self. pt2 ) * fraction ( 1, 2 )
[ 0.8708822727203369, -0.27500399947166443, 0.3796902894973755, 0.6939234137535095, 0.16633641719818115, 0.42130929231643677, 0.07746107876300812, -0.5658513903617859, 0.22637048363685608, 0.3457847833633423, 0.6897274851799011, 0.32380324602127075, -0.31807810068130493, -0.07081443071365356...
def execute _ request ( self, method, url, connect _ timeout = none, read _ timeout = none, retries = none ) : # make a request if not connect _ timeout : conn _ timeout = int ( self. auth _ config ['conn _ timeout'] ) if not read _ timeout : read _ timeout = int ( self. auth _ config ['read _ timeout'] ) if not retrie...
[ -1.3625057935714722, -0.16183790564537048, 0.8287504315376282, 0.5193204879760742, 0.05104221776127815, -0.27132004499435425, -0.7593965530395508, -0.014734008349478245, -0.06911010295152664, 0.5369529724121094, 0.20340420305728912, 0.4448750615119934, -0.02963133342564106, -0.222933351993...
def remove _ file ( self, filename : str ) - > none : # unlike os. remove, if the file does not exist, # then this method does nothing. try : os. remove ( filename ) except oserror : pass
[ -0.26136428117752075, 0.10614021122455597, 0.20690885186195374, -0.02803928032517433, 0.9775782227516174, 0.5761992335319519, 0.10160807520151138, 0.9696678519248962, -0.7794009447097778, -0.25479769706726074, 0.423194944858551, -0.8583660125732422, -0.04584888741374016, 0.4277712404727936...
def verify _ newp _ info ( in _ dict ) : for key in ( " patient _ id ", " attending _ email ", " patient _ age " ) : if key not in in _ dict. keys ( ) : return " key { } not found ". format ( key ) if key = = " attending _ email " : if type ( in _ dict [ key ] ) is not str : return " key attending _ email not correct t...
[ -0.5568828582763672, -0.3767749071121216, 0.6296536922454834, -0.5679923295974731, -0.3156426250934601, 1.5583832263946533, -0.7311638593673706, -0.47554734349250793, -0.5768744349479675, 1.1440507173538208, 0.5975155830383301, 0.01986665092408657, -0.648525595664978, 0.43138542771339417, ...
def hybrid ( n _ nodes, fovea, foveal _ density, verbose = true ) : retina = fibonacci _ retina ( n _ nodes / / 4, fovea, foveal _ density ) # small randomization and barycentre generation to help # promote pseudo uniform tessellation shake = retina shake = randomize ( shake, 0. 23 ) shake = point _ gen ( shake, mode =...
[ 1.0394798517227173, 0.1579379439353943, 0.44956129789352417, 0.9017078280448914, -0.2794513404369354, -0.5621989965438843, 0.3709438145160675, 0.7056313157081604, 0.8274658918380737, -0.013374422676861286, 0.4279525876045227, 0.07569802552461624, 0.28960636258125305, 0.42893630266189575, ...
def plotinmultiplefigure ( time, data, result, options ) : # first compute how many plots are needed numofplots = options. plotfiltereddata + options. plotpredicteddata + \ options. plotsmootheddata size = ( numofplots, 1 ) location = 1 # plot all needed results # plot fitered results if needed if options. plotfiltered...
[ 0.34424909949302673, 0.48096606135368347, 0.7620100975036621, 0.2915183901786804, -0.4569943845272064, 0.8653322458267212, 0.2326354682445526, 0.19392697513103485, -0.23461779952049255, -0.45661523938179016, 0.10321010649204254, 0.9335140585899353, 0.18110764026641846, 0.7393395304679871, ...
def paragraph ( self ) : return self. pb. paragraph
[ 0.8018425703048706, -0.5613036751747131, 0.4048869013786316, 0.9507567882537842, 0.1034957617521286, 1.3455535173416138, 0.5810105800628662, -0.07397283613681793, 0.9777079224586487, -0.10061245411634445, 0.6475512385368347, 0.20643901824951172, -2.0697553157806396, -1.3526071310043335, ...
def test _ ens _ lookup ( ethereum _ inquirer, call _ order, ethereum _ manager _ connect _ at _ start ) : wait _ until _ all _ nodes _ connected ( ethereum _ manager _ connect _ at _ start, ethereum _ inquirer ) result = ethereum _ inquirer. ens _ lookup ('api. zerion. eth ', call _ order = call _ order ) assert resul...
[ -0.6493164896965027, -0.18675431609153748, 0.7054048776626587, -0.2031257152557373, -0.0684497132897377, 0.4806336760520935, -0.1984592229127884, -0.47948160767555237, 0.6315881013870239, 0.20078906416893005, -0.5575934648513794, -0.31288570165634155, 0.09606900066137314, -0.04809635877609...
def segment2points ( anno ) : x _ points = [ ] y _ points = [ ] for i, v in enumerate ( anno ['segmentation'] [ 0 ] ) : if i % 2 = = 0 : x _ points. append ( v ) else : y _ points. append ( v ) return x _ points, y _ points
[ -0.8347679972648621, -0.8723917007446289, 0.31702926754951477, 0.07226910442113876, 1.6669015884399414, 0.16820350289344788, -0.07519400119781494, 0.6037135720252991, -0.2911091446876526, 0.8339563012123108, -0.35228216648101807, -0.22307664155960083, 1.0337603092193604, -0.015006795525550...
def get _ trace _ settings ( self, model _ name : str =..., headers : dict [ str, t. any ] =..., as _ json : t. literal [ false ] =..., ) - > service _ pb2. tracesettingresponse :
[ -0.637052059173584, 0.5133118033409119, 0.6141865253448486, 0.4821654260158539, 0.12230537831783295, -0.708530843257904, 0.013003900647163391, -1.8296055793762207, -0.04608388617634773, 0.4807053804397583, -1.0130949020385742, -0.016957750543951988, -0.456606924533844, -0.15562386810779572...
def environment _ created ( self ) : db, handle _ ta = self. get _ db _ for _ write ( ) self. set _ db _ version ( db ) if handle _ ta : db. commit ( )
[ 0.3392442464828491, -0.1773756444454193, 0.26803991198539734, 0.07849808037281036, 1.6957144737243652, 0.6508822441101074, 0.44505399465560913, 0.19507773220539093, -0.8590686321258545, 0.5735729932785034, 0.06503637880086899, -0.35339993238449097, 0.5552728176116943, 1.0558549165725708, ...
def search _ kepler _ products ( target, filetype ='target pixel ', cadence ='long ', quarter = none, campaign = none, radius = 1, targetlimit = 1 ) : if filetype not in ['target pixel ','lightcurve'] : raise valueerror ( " choose a filetype of'target pixel'or'lightcurve'" ) # value for the quarter or campaign qoc = ca...
[ 0.08319848030805588, -0.35039767622947693, 0.564267098903656, 0.058650244027376175, -0.1228392943739891, -0.23809459805488586, -0.6614614725112915, -0.4913344979286194, 0.4238335192203522, 0.35040298104286194, 0.6759700775146484, 0.9755367636680603, -0.1314772665500641, 0.31700336933135986...
def items ( self ) : return self. flatten ( ). items ( )
[ -1.0935125350952148, -0.37584829330444336, 0.26770877838134766, 0.11605527997016907, -0.23881830275058746, 0.10328158736228943, -0.7648108005523682, -0.11619043350219727, -0.2093634456396103, -0.5747402310371399, -0.5341472625732422, -0.0031878422014415264, -0.4799506366252899, -0.37277939...
def crazyhorse ( shooter ) : i = len ( shooter ) - 1 hit = 0 miss = 0 total = 0 while i > 0 : print " shooter : " + ` shooter [ i ] ` + " i : " + ` i ` for score in shooter [ i ] [ 2 ] : if score = = 1 : hit = hit + 1 else : miss = miss + 1 total = total + 1 i = i - 1 return ( hit, miss, total, ( float ( hit ) / ( floa...
[ -0.3203205466270447, -0.13632981479167938, 0.5563539862632751, 0.6401615142822266, 0.17600394785404205, -0.20944853127002716, 0.7112053036689758, -0.4115335941314697, -0.3641618490219116, 1.2317460775375366, -0.918509840965271, -0.331893652677536, -0.21306709945201874, 0.4413130581378937, ...
def find _ 95 _ percentile ( array ) : array [ : : - 1 ]. sort ( ) return array [ : math. ceil ( 0. 05 * len ( array ) ) ]
[ 0.31047025322914124, -0.38742658495903015, 0.4295210540294647, 0.5169779062271118, -0.773675799369812, 0.19749930500984192, 0.7319347858428955, -1.2777742147445679, -0.4429636299610138, 0.27855053544044495, 0.6430891752243042, -0.3418380618095398, -1.2162694931030273, 0.34414294362068176, ...
def test _ incorrect _ dependency ( self ) : manifest ( stringio ( manifest _ incorrect _ dependency ) )
[ 0.9042431116104126, -0.867484450340271, 0.2460775375366211, 0.5312334895133972, -0.5318769812583923, 1.076473355293274, 0.1158125102519989, 0.2100716084241867, 0.1364290565252304, -0.44264280796051025, -0.06831662356853485, 0.5709742903709412, 0.9076629877090454, 0.38430720567703247, 0.8...
def build _ embed _ layer ( self ) : # retrieve pretrained word embeddings if self. pretrained _ embed : # retrieve pretrained word embeddings embed _ index = { } with open ( self. pretrained _ embed ) as file : for line in file : word, coefs = line. split ( maxsplit = 1 ) coefs = np. fromstring ( coefs,'f ', sep ='' )...
[ 0.25509828329086304, -0.30976155400276184, 0.567874550819397, 0.670638918876648, -0.4259459674358368, 0.2746572494506836, 0.8972436189651489, 0.20841751992702484, -0.12362482398748398, -0.2616165578365326, -0.14978905022144318, -0.3094109296798706, -0.3170567750930786, -0.3896389603614807,...
def query _ database ( query : str ) : conn = sqlite3. connect ( database _ path ) cursor = conn. cursor ( ) results = cursor. execute ( query ) return results. fetchall ( )
[ 0.06359537690877914, 0.1837310492992401, 0.49643218517303467, 0.06755536794662476, 0.03780324012041092, -0.05566509813070297, -1.2637754678726196, -0.014082960784435272, 0.3582422435283661, 0.42016658186912537, 0.608707070350647, -0.8672603368759155, -0.8830958008766174, -0.100795924663543...
def get _ obstime _ duration ( obsid, fdir = ". " ) : # metafits file will already have been downloaded f = fits. open ('{ 0 } / { 1 } _ metafits _ ppds. fits '. format ( obsid, fdir ) ) return [ f [ 0 ]. header ['date - obs'], f [ 0 ]. header ['exposure'] ]
[ -0.7504026889801025, -0.5199020504951477, 0.6631684303283691, -0.2324465960264206, -0.7476462125778198, 0.0758083164691925, -0.156711608171463, 0.09083003550767899, 0.7295622825622559, 0.9329177141189575, 0.14535243809223175, 0.4811616837978363, 0.9546887874603271, 1.1062822341918945, 0....
def sm _ backend _ conf _ delete ( context, sm _ backend _ conf _ id ) : return impl. sm _ backend _ conf _ delete ( context, sm _ backend _ conf _ id )
[ 0.41717010736465454, -0.25846871733665466, 0.30616989731788635, -0.11524642258882523, -0.35940125584602356, -1.0229848623275757, 0.4906272888183594, 0.38780367374420166, 0.06637818366289139, 1.135959506034851, -0.8684809803962708, 0.5502410531044006, -0.749107301235199, -0.1900426745414734...
def _ run _ dry ( ) : _ print _ section ( " \ ndry run : just printing, no doing " ) for name, runs in _ state. runs _ by _ name. items ( ) : if len ( runs ) = = 0 : continue # print the runs _ print _ section ( " \ ncommands for experiment " + name ) for run in runs : print ( run. command )
[ -0.4157901108264923, -0.14379355311393738, 0.6101464629173279, -0.7660108804702759, 0.5740559697151184, 0.2985575795173645, 0.26522600650787354, -0.5699297189712524, -0.6698141098022461, -0.5258410573005676, 1.0470589399337769, 1.0857951641082764, 0.14393079280853271, 0.5369046330451965, ...
def _ _ init _ _ ( self, main, ty ) : self. ty = ty self. main = main self. funcs = set ( ) self. main. add _ instance ( self )
[ -0.09556125104427338, 0.03169439733028412, 0.7539494633674622, 0.05908083915710449, 0.10786794126033783, 0.11012452095746994, -0.18689759075641632, -0.39190930128097534, 0.051404498517513275, -0.21840614080429077, -0.20360791683197021, 0.8875242471694946, -0.42776405811309814, 0.1628209352...
def selectsla ( vegsla, gensla, famsla, gfsla ) : if vegsla > 0 : selectsla _ out = vegsla elif gensla > 0 : selectsla _ out = gensla elif famsla > 0 : selectsla _ out = famsla else : selectsla _ out = gfsla return selectsla _ out
[ 0.45517703890800476, -0.3471202552318573, 0.27205362915992737, 0.43868374824523926, -0.22809909284114838, 0.10980226844549179, 0.32932737469673157, -0.5082948803901672, 0.31783732771873474, -0.11960279941558838, 0.582068681716919, 0.5275530815124512, 0.4924905598163605, 0.4413977861404419,...
def test _ model _ save _ and _ load ( self ) : tm0 = testmodel. create ( count = 8, text ='123456789') tm1 = testmodel. create ( count = 9, text ='456789') tms = testmodel. all ( [ tm0. vid, tm1. vid ] ) assert len ( tms ) = = 2 for cname in tm0. _ columns. keys ( ) : self. assertequals ( getattr ( tm0, cname ), getat...
[ -0.5259089469909668, -0.5822156071662903, 0.5289511680603027, -0.4330730438232422, 0.34660854935646057, 0.05185209959745407, 0.25828784704208374, -0.0965801328420639, -0.6606997847557068, 0.11511002480983734, -1.400674819946289, -0.6403794884681702, 0.526439368724823, 0.5521391034126282, ...
def writebatchscript ( self ) : print " batch submission : write batch scripts " lxbatch _ template = self. lxbatch _ template % {'basedir': self. basedir,'cfg _ filename': self. cfg _ filename,'executable': self. executable,'ntuple': self. tmp _ ntuple,'unique _ id': self. unique _ id _ path } slurm _ template = self....
[ 0.4208546578884125, -0.8324746489524841, 0.6639495491981506, 0.31591910123825073, 0.5685836672782898, 0.5732382535934448, 0.038459621369838715, 0.9567744135856628, -1.3071664571762085, -0.6013684272766113, -0.5737674236297607, 0.6602110266685486, -0.387034147977829, 0.4649435579776764, 0...
def test _ running _ norm _ matches _ dist ( batch _ size : int ) - > none : mean = th. tensor ( [ - 1. 3, 0. 0, 42 ] ) var = th. tensor ( [ 0. 1, 1. 0, 42 ] ) sd = th. sqrt ( var ) num _ dims = len ( mean ) running _ norm = networks. runningnorm ( num _ dims ) running _ norm. train ( ) num _ samples = 256 with th. ran...
[ 0.11503839492797852, -0.16471633315086365, 0.5848751068115234, 0.09920622408390045, -0.19045168161392212, 1.0417860746383667, 0.892535388469696, -0.15514159202575684, -0.2819684147834778, -0.3480132520198822, -0.42691802978515625, 0.2629717290401459, -0.08501964062452316, -0.00561499642208...
def pdf ( self, x ) : if x < 0 : return 0 return self. lambtha * ( self. euler _ number * * ( - self. lambtha * x ) )
[ 0.37069088220596313, 0.06694883108139038, 0.46658405661582947, 0.118597112596035, -0.1559489667415619, 0.5726291537284851, -0.2146134078502655, 0.1486293226480484, 0.5823289752006531, -1.0101159811019897, 0.30385199189186096, 0.32255280017852783, 0.0199036356061697, 1.0794756412506104, 0...
def received _ messages ( conn : sqlite3. connection ) : with conn : return conn. execute ('select received _ timestamp, sender _ contact, content, sent _ timestamp from receivedmessage order by received _ timestamp desc'). fetchall ( )
[ 0.26523953676223755, -0.037644218653440475, 0.5126655101776123, -0.1953720897436142, 0.551579475402832, -0.8309388160705566, -0.7346998453140259, -0.4094462990760803, -0.31192445755004883, -0.18021926283836365, -0.13366451859474182, -0.6959211826324463, 0.1445065438747406, 0.14586603641510...
def append _ val ( self, key, val ) : raise notimplementederror
[ -0.5327001214027405, 0.3019142746925354, 0.4647344946861267, 0.5891966223716736, -1.1988754272460938, 0.920805811882019, -1.601081132888794, -0.13501444458961487, -0.17605994641780853, 0.01574251987040043, 0.4109136462211609, 0.397686630487442, 0.6728558540344238, 1.030549168586731, -0.3...
def _ check _ type ( self, value ) : try : if not value. startswith ( ('true ','false ','function ','{ ','[') ) : return "'{ 0 }'". format ( value ) except attributeerror : return value return value
[ 0.09996035695075989, 0.1742919236421585, 0.5136188268661499, -0.09530884772539139, -0.12720252573490143, 0.23258733749389648, -0.06357981264591217, -1.4195458889007568, 0.17686788737773895, 1.3567804098129272, 1.3383911848068237, 1.0833144187927246, -0.45469096302986145, 1.1335026025772095...
def movezeroes ( self, nums : list [ int ] ) - > none : slow = fast = 0 while fast < len ( nums ) : if nums [ fast ]! = 0 : nums [ fast ], nums [ slow ] = nums [ slow ], nums [ fast ] slow + = 1 fast + = 1 return nums
[ -1.1801668405532837, -0.233381986618042, 0.26424649357795715, 0.3068431615829468, 0.3145696222782135, -0.387417197227478, 0.9125373959541321, 0.4449754059314728, 0.5010327696800232, 0.00589560205116868, -0.3796093463897705, 0.0036826443392783403, -0.6233872175216675, 1.3266324996948242, ...
def h ( self, x ) : return 1 / ( 1 + np. exp ( - x ) )
[ 0.21651491522789001, 0.8180480599403381, 0.38449862599372864, 0.7633413076400757, -0.28847330808639526, 1.8607574701309204, -0.4097691476345062, 0.5213720202445984, 0.29404765367507935, 0.09084216505289078, 0.00952439196407795, 0.39892885088920593, -0.22761386632919312, -0.4608191251754761...
def attribute _ binary _ gen ( tweet _ dic, path _ list ) : for path in path _ list : yield int ( bool ( dic _ path _ recurse ( tweet _ dic, path ) ) )
[ -0.13100950419902802, -0.1966138780117035, 0.2794423997402191, 0.3230069577693939, 0.5690465569496155, 0.2426563948392868, 1.0355067253112793, 1.2260698080062866, -1.141649603843689, 0.11970619112253189, -0.5042935609817505, -0.484491229057312, 0.447223037481308, 1.0164774656295776, -0.5...
def home ( ) : return render _ template ( " home. html " )
[ 1.0281386375427246, 0.038084954023361206, 0.22671952843666077, 1.1674294471740723, 0.09609875828027725, 0.356410950422287, 0.05415542423725128, 0.8317540884017944, -0.253158837556839, 0.7272830009460449, 0.09363633394241333, -0.3123719096183777, -0.39385396242141724, -0.06576025485992432, ...
def naivebayespxy ( x, y ) : # add one positive and negative example to avoid division by zero ( " plus - one smoothing " ) n, d = x. shape x = np. concatenate ( [ x, np. ones ( ( 2, d ) ), np. zeros ( ( 2, d ) ) ] ) y = np. concatenate ( [ y, [ - 1, 1, - 1, 1 ] ] ) n, d = x. shape posprob = np. mean ( x [ y = = 1 ], a...
[ -0.40620818734169006, 0.49066224694252014, 0.9055323600769043, 0.08557460457086563, -0.6367010474205017, 0.6471895575523376, -1.1760886907577515, -0.6367477774620056, 0.03221554681658745, 1.2513315677642822, 0.012814962305128574, 0.07870931178331375, -0.19931066036224365, 0.198314175009727...
def gethandle ( self ) : return _ topods. topods _ tshell _ gethandle ( self )
[ 0.4968489706516266, 0.7099865674972534, 0.4369809627532959, 0.18407325446605682, 0.9889044165611267, 1.0718207359313965, 0.7482800483703613, -0.5415456295013428, -0.13154944777488708, -1.1565889120101929, -0.19082407653331757, -0.5410760045051575, -0.7218083143234253, 0.2604479193687439, ...
def calc _ loss ( output, labels, gpu ) : loss = 0 criterion = nn. crossentropyloss ( ). cuda ( ) for i in range ( len ( output ) ) : label = labels [ i ]. squeeze ( 0 ) label = variable ( label. long ( ) ). cuda ( gpu ) loss + = criterion ( output [ i ], label ) return loss
[ -0.2172059714794159, -0.4745755195617676, 0.21861082315444946, 0.8907086849212646, -0.45219096541404724, -0.6306338310241699, 0.006521373055875301, -0.08948107808828354, -0.40922483801841736, 0.23558008670806885, 0.46683269739151, -0.5508675575256348, -0.2560657262802124, 0.478674381971359...
def combinedpvalue ( pvalues : list [ float ] ) - > float : if not pvalues : raise valueerror ( " empty sample " ) elif len ( pvalues ) = = 1 : return pvalues [ 0 ] elif min ( pvalues ) = = 0 : return 0 else : s = sum ( - math. log ( p ) for p in pvalues ) return igamc ( len ( pvalues ), s )
[ 0.2716693580150604, 0.11490606516599655, 0.5196744799613953, 0.5067245364189148, 0.19367797672748566, 0.6197375655174255, -0.42573294043540955, 0.23216187953948975, 0.2352016717195511, 0.27365049719810486, 0.8759035468101501, 0.21780700981616974, -1.0289942026138306, -0.1293414980173111, ...