text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def get _ field _ type ( self ) : return " basic : url : { } ". format ( self. url _ type ) | [
0.06009013578295708,
0.010121307335793972,
0.4861840605735779,
-0.6262175440788269,
1.176673412322998,
0.9359432458877563,
-0.4342750608921051,
0.02031848207116127,
-0.14543962478637695,
-0.6770088076591492,
-0.656628429889679,
0.1704704314470291,
-0.39378219842910767,
0.03691496700048447,... |
def _ _ region _ r _ update _ ui ( self ) : if self. _ _ ui _ update : for output in self. selected _ outputs : output. ui. region _ r = self. _ _ render _ region _ r _ spin _ box. value ( ) | [
-0.4691055715084076,
-1.192839503288269,
0.30637896060943604,
-0.2445225566625595,
-0.48333826661109924,
-0.553350031375885,
0.8953094482421875,
-0.3459680676460266,
0.3020954132080078,
-0.17759551107883453,
0.055119868367910385,
0.2209748923778534,
-0.8488991260528564,
0.8368319869041443,... |
def gettimewidgets ( self, page, type ) : if type = = " ampm " : data = self. getcurrentampm ( ) else : data = getattr ( self. partytime, type ) if data = = 0 and type = = " minute " : data = " 00 " else : if type = = " hour " : data = data % 12 if data = = 0 : data = 12 data = " % d " % data label = directlabel ( pare... | [
-0.4996922016143799,
-1.1081691980361938,
0.8617698550224304,
-0.8190678358078003,
-0.6971271634101868,
0.28465256094932556,
-0.5164095163345337,
0.09991978853940964,
0.08290116488933563,
0.9282317161560059,
0.03765144571661949,
-0.3794333338737488,
-0.008403847925364971,
1.526011943817138... |
def test _ available _ languages _ required _ for _ create ( self, mock _ sync ) : self. data. pop ('available _ languages') form = self. form _ class ( data = self. data, instance = none ) self. assertfalse ( form. is _ valid ( ) ) self. assertequal ( form. errors. keys ( ), ['available _ languages'] ) self. assertequ... | [
-0.3644128143787384,
0.4112657308578491,
0.21362799406051636,
-0.8171933889389038,
0.3640577793121338,
1.5650546550750732,
-0.306869775056839,
0.7003627419471741,
-0.3725302219390869,
0.055574215948581696,
-1.1884456872940063,
-0.5480879545211792,
0.20662054419517517,
0.7767236232757568,
... |
def test _ packages ( self ) : self. asserttrue ( self. check _ package _ output ( " ruby - - version ", " ruby 2. 7. " ) ) self. asserttrue ( self. is _ package _ present ( " bundler " ) ) self. asserttrue ( self. is _ package _ present ( " gem " ) ) | [
0.09820616245269775,
0.21197308599948883,
0.5061519742012024,
0.9168099761009216,
0.8282620310783386,
0.9685410261154175,
0.2053326666355133,
0.17052911221981049,
-0.04555607587099075,
-0.025749295949935913,
-0.4175758957862854,
-0.444815456867218,
0.3280978798866272,
0.9122066497802734,
... |
async def download _ deviation ( self, deviation, full _ path ) : if not type ( deviation ) is deviation : raise daexplorerexception ( " argument'deviation'must be type deviation. " ) try : url _ targ = " " if deviation. is _ downloadable : deviation _ raw = self. _ download _ deviation ( deviation. deviationid ) url _... | [
-0.2305685579776764,
-0.11185742169618607,
0.8719431757926941,
0.3261774778366089,
-0.8919985294342041,
-0.3900122046470642,
0.4474242627620697,
-0.07052024453878403,
1.0380113124847412,
-0.47689053416252136,
0.4377439618110657,
-0.13825030624866486,
0.2483281046152115,
0.07411707937717438... |
def get _ confidence ( model, likelihood, x, y ) : with gpytorch. settings. fast _ pred _ var ( ) : f _ preds = likelihood ( model ( x ) ) mu = f _ preds. mean sigma _ sq = f _ preds. variance sigma _ sq = torch. sqrt ( sigma _ sq ) res _ normed = ( y - mu ) / sigma _ sq res _ normed = res _ normed. cpu ( ). detach ( )... | [
0.06759530305862427,
-0.7383052110671997,
0.41843917965888977,
0.6772070527076721,
-0.4627796709537506,
-0.040318235754966736,
-0.2705327272415161,
-0.40104585886001587,
-0.9642749428749084,
0.3274648189544678,
-0.15013597905635834,
0.6315268278121948,
0.254427433013916,
0.1366153210401535... |
def test _ desire _ months ( ) : # define values on parameters choice _ month _ start1 = 2 choice _ month _ end1 = 10 choice _ month _ start2 = 2 choice _ month _ end2 = 2 # define the output for assert comparsion output1 = 1911 output2 = 196 df1 = weather _ anaylsis. desire _ months ( choice _ month _ start1, choice _... | [
0.5245101451873779,
-0.11883419752120972,
0.7037424445152283,
0.17399847507476807,
0.5554146766662598,
0.45234718918800354,
0.16745081543922424,
-0.20875191688537598,
-0.9695762991905212,
-0.8443396687507629,
-0.2726304531097412,
0.5294579863548279,
-0.34722986817359924,
0.1316769272089004... |
def add _ from _ stack ( self, y _ st = 0, x _ st = 0, y _ pos = none, x _ pos = none, mode = true, spacing = 10 ) : if not self. note _ stack. exists ( ) : return false popped = self. note _ stack. pop ( ) if isinstance ( popped, ( list, tuple ) ) : popped = tuple ( popped ) + ( none, none, none ) index, note1, note2,... | [
-0.5870354771614075,
0.2528935372829437,
1.1249676942825317,
-0.44591888785362244,
0.12370810657739639,
0.618374764919281,
0.00833054631948471,
-0.6872760653495789,
0.2637045681476593,
1.0853179693222046,
-1.0726099014282227,
0.12295085191726685,
-0.014739101752638817,
-0.5197587013244629,... |
def get _ input _ shape _ and _ dtype ( layer ) : def _ is _ graph _ model ( layer ) : return ( ( hasattr ( layer,'_ is _ graph _ network') and layer. _ is _ graph _ network ) or layer. _ _ class _ _. _ _ name _ _ = ='sequential') # in case of nested models : recover the first layer # of the deepest model to infer inpu... | [
-0.3928685188293457,
-0.24890796840190887,
0.6734002828598022,
0.13035832345485687,
0.06053152307868004,
-0.05340882018208504,
1.1363426446914673,
-0.23884008824825287,
-0.2969813942909241,
-0.45742401480674744,
-1.04506516456604,
0.8949238061904907,
-0.13169053196907043,
0.779946804046630... |
def _ _ set _ progressive ( self, value ) : self. ipr. setpreview ( value ) | [
-0.6194043159484863,
0.494849294424057,
0.519605815410614,
-1.1522120237350464,
-1.6172276735305786,
0.7339003086090088,
-0.12266772985458374,
-0.28881341218948364,
-0.4162512719631195,
-0.2404126226902008,
0.7690330147743225,
0.13719423115253448,
-0.6640514135360718,
0.07561716437339783,
... |
def eigen ( x ) : raise notimplementederror | [
-0.824829638004303,
0.4659452438354492,
0.4444255828857422,
0.5004509687423706,
-0.15153364837169647,
1.108105182647705,
0.5149086713790894,
0.21062687039375305,
0.4107728898525238,
-0.08737511932849884,
-1.0841858386993408,
0.23036040365695953,
0.8759987950325012,
0.37508901953697205,
-... |
def findconfig ( ) : configpath = os. path. dirname ( _ _ file _ _ ) + os. path. sep + ".. " + os. path. sep + " configs " + os. path. sep home = str ( path. home ( ) ) + os. path. sep defaultconfig = " doof. yml " robotconfigfile = home + " robotconfig " if not os. path. isfile ( robotconfigfile ) : log. error ( " cou... | [
0.262580007314682,
-0.646268367767334,
0.82811039686203,
0.33612799644470215,
0.6320169568061829,
-0.2902970016002655,
0.6111365556716919,
0.17815664410591125,
-0.7228196859359741,
0.6079696416854858,
-0.11393243074417114,
-0.6099940538406372,
-0.12017683684825897,
1.5378228425979614,
0.... |
def _ get _ all _ flows ( self ) : flows = dict ( ) r = requests. get ( urljoin ( self. _ ofctl _ url,'/ stats / switches') ) dps = r. json ( ) for dp in dps : r = requests. get ( urljoin ( self. _ ofctl _ url,'/ stats / flow / { } '. format ( dp ) ) ) return flows | [
-0.1538897454738617,
-0.028881538659334183,
0.5588945746421814,
0.06691476702690125,
0.008798680268228054,
0.2558637857437134,
-0.7590996026992798,
-1.3712345361709595,
0.7535781860351562,
-1.0555791854858398,
-0.08283612132072449,
-0.19914881885051727,
0.43824502825737,
0.668968677520752,... |
def loop _ over _ gff ( directory ) : files = glob. glob ( directory +'*. gff') gffhash = { } for f in files : tmp = process _ gff _ file ( f ) gffhash [ tmp ['genome'] ] = tmp return ( gffhash ) | [
0.4428592920303345,
0.10294680297374725,
0.4347323775291443,
-0.09231730550527573,
-0.13534632325172424,
0.24257370829582214,
-0.03443806990981102,
-0.7704026699066162,
-1.1190063953399658,
0.1825016587972641,
-0.7041439414024353,
0.41802912950515747,
0.1390221118927002,
1.20925772190094,
... |
def distance _ expected _ value ( self, another ) : return mpmath. absmax ( self. expected _ value ( ) - another. expected _ value ( ) ) | [
0.05304036661982536,
-0.5097911357879639,
0.6250278949737549,
0.4350827932357788,
-0.7190281748771667,
1.1138653755187988,
-0.005192379001528025,
0.4347979426383972,
0.38669052720069885,
-0.36937814950942993,
0.4924773573875427,
0.20750561356544495,
0.10610926151275635,
0.6541897654533386,... |
def get _ normalized _ probs _ cif ( self, net _ output, log _ probs ) : logits = self. get _ logits _ cif ( net _ output ) if log _ probs : return utils. log _ softmax ( logits. float ( ), dim = - 1 ) else : return utils. softmax ( logits. float ( ), dim = - 1 ) | [
1.5003058910369873,
-0.6516724228858948,
0.36413702368736267,
0.5134420990943909,
-0.19096845388412476,
-0.7902089953422546,
-0.11526814848184586,
0.4989030957221985,
-0.07603642344474792,
0.4102756083011627,
0.5845562219619751,
-0.09034765511751175,
-1.190989375114441,
-1.1423389911651611... |
def _ grow _ tree ( self, tree _ node, * * kwargs ) : # skip this if not a root or if already grown if self. is _ grown ( tree _ node ) : return self. _ setup _ tree ( tree _ node, * * kwargs ) nhalos = tree _ node. uids. size nodes = np. empty ( nhalos, dtype = np. object ) nodes [ 0 ] = tree _ node for i in range ( 1... | [
-0.03734288737177849,
0.23917652666568756,
0.7161840200424194,
-0.12798389792442322,
0.5736433267593384,
0.5015820264816284,
-0.27748581767082214,
0.15747062861919403,
0.367687851190567,
-0.5231020450592041,
0.32878440618515015,
0.7227100729942322,
0.5076231360435486,
1.0105189085006714,
... |
def items ( self ) : return [ self. browser. text ( el ) for el in self. browser. elements ( self. items _ locator, parent = self ) ] | [
-0.7150571942329407,
-1.3942464590072632,
0.3184814453125,
0.6958574056625366,
0.08256908506155014,
0.29426008462905884,
-0.11113159358501434,
-0.06501919031143188,
0.7243866920471191,
0.10644006729125977,
-0.17533372342586517,
-0.5245290398597717,
0.36885011196136475,
0.3888775110244751,
... |
def addtile ( self, tile, row ) : assert 5 > row > = 0, " row must be from 0 - 4 " assert none in self. placements [ row ], " there must be an empty spot for the tile to be placed! " # if there are some other tiles in the row : empty = true for t in self. placements [ row ] : if t! = none : empty = false if empty : sel... | [
-0.22716398537158966,
0.35701432824134827,
0.49953213334083557,
-0.9799208641052246,
0.40692338347435,
0.656380295753479,
0.5859863758087158,
0.22677499055862427,
0.35281506180763245,
-0.12226272374391556,
0.3937297761440277,
-0.3914510905742645,
-0.7638561129570007,
0.04622410610318184,
... |
def test _ cancel _ direct _ paid _ cl _ creates _ transfer _ block ( self ) : event = baker. make _ recipe ('booking. future _ pc ', cost = 10, max _ participants = 3 ) booking = baker. make _ recipe ('booking. booking ', user = self. user, event = event, paid = true, payment _ confirmed = true ) self. assertfalse ( b... | [
0.600723385810852,
0.49902379512786865,
0.6353296637535095,
0.8934445977210999,
-0.42000290751457214,
1.9440665245056152,
0.1922646313905716,
0.0018330663442611694,
-0.48221540451049805,
-0.5322076678276062,
-0.34312430024147034,
-0.03429470956325531,
0.3578519821166992,
0.4872866570949554... |
def test _ stat _ osx _ 10 _ 14 _ 6 ( self ) : self. assertequal ( jc. parsers. stat. parse ( self. osx _ 10 _ 14 _ 6 _ stat, quiet = true ), self. osx _ 10 _ 14 _ 6 _ stat _ json ) | [
1.097868800163269,
-0.8075438141822815,
0.33314916491508484,
-0.35057350993156433,
0.3284359574317932,
-0.21732507646083832,
-0.20018237829208374,
-0.8679916858673096,
0.31867191195487976,
-0.8465383052825928,
-0.9159597754478455,
-0.3190009295940399,
0.19412745535373688,
0.196171924471855... |
def temps ( start ) : session = session ( engine ) results = session. query ( measurement. date, func. min ( measurement. tobs ), func. avg ( measurement. tobs ), func. max ( measurement. tobs ) ). filter ( measurement. date > start ). group _ by ( measurement. date ). all ( ) # create a dictionary from the row data an... | [
-0.9157955050468445,
-0.04620053246617317,
0.7173859477043152,
-0.47132837772369385,
-0.6769136190414429,
-0.150778666138649,
-0.41658660769462585,
-0.13100214302539825,
-0.5763126611709595,
1.1474754810333252,
-0.2768530249595642,
-0.34839552640914917,
1.189201831817627,
0.864535748958587... |
def _ check _ if _ every _ in _ array _ is _ not _ empty ( writer, parameters ) : # first, get a list of array in parameters : array _ in _ params = [ param. name for param in parameters if param. is _ array and param. is _ in ] # then, for every such parameter, add a checking procedure to the wrapper : if array _ in _... | [
-0.7053552865982056,
-0.7840071320533752,
0.675761878490448,
0.147866889834404,
0.9019654989242554,
-0.07626894116401672,
-0.29651933908462524,
0.3056195378303528,
-0.539577841758728,
1.0777801275253296,
0.19487428665161133,
0.8001480102539062,
0.03071446716785431,
0.9196631908416748,
-1... |
def test _ 506 _ kruskal _ matched _ at _ min _ size ( self ) : np. random. seed ( 987654321 ) x _ parms = [ 1. 7 ] x _ input _ array = st. weibull _ min. rvs ( * x _ parms, size = 2 ) y _ input _ array = st. weibull _ min. rvs ( * x _ parms, size = 2 ) z _ input _ array = st. weibull _ min. rvs ( * x _ parms, size = 2... | [
0.3587723970413208,
-0.2585105895996094,
0.5242922902107239,
-0.5934074521064758,
-0.8151747584342957,
0.36903828382492065,
0.4109307527542114,
-0.798011839389801,
-0.00877345260232687,
-0.041561760008335114,
-0.28990840911865234,
0.07434245944023132,
-0.6484102606773376,
1.087025046348571... |
def data ( self, key = none ) : # add expected values to data parent _ data = super ( expectedvaluesmixin, self ). data ( key = key ) if key is none : return self. _ add _ expected _ value _ global ( parent _ data ) elif key = = - 1 : global _ data = self. _ add _ expected _ value _ global ( parent _ data ) specific = ... | [
-0.37046799063682556,
-0.19876904785633087,
0.7194854021072388,
-1.0289896726608276,
-0.32715266942977905,
0.5736063122749329,
0.08279533684253693,
1.4788800477981567,
-0.08286569267511368,
-0.28726664185523987,
0.3958223760128021,
0.43748122453689575,
-0.28980275988578796,
0.9904887676239... |
def url ( self ) : return self. _ _ relative _ url | [
0.5161107778549194,
-0.3789480924606323,
0.19486016035079956,
0.8679941892623901,
-0.103983573615551,
1.7517627477645874,
0.7017638683319092,
0.2663869261741638,
-0.03327852487564087,
-0.3584218919277191,
0.2044924795627594,
-0.031135786324739456,
-0.4323159456253052,
0.008073143661022186,... |
def get _ all _ groups ( self ) : return { group : {'name': group. objectname ( ). replace ('_ group ','' ) } for group in self. children ( ) if type ( group ) = = qtwidgets. qbuttongroup } | [
-0.1667051911354065,
0.1372574269771576,
0.5199282169342041,
-0.3952462077140808,
-1.1651177406311035,
-0.275367796421051,
-0.5097898840904236,
-1.4065037965774536,
-0.23791220784187317,
-0.4199531078338623,
-1.0382062196731567,
-0.29152679443359375,
0.12439937144517899,
0.6662648320198059... |
def _ _ init _ _ ( self, score = none, team _ keys = none, surrogate _ team _ keys = none, dq _ team _ keys = none ) : # noqa : e501 # noqa : e501 self. _ score = none self. _ team _ keys = none self. _ surrogate _ team _ keys = none self. _ dq _ team _ keys = none self. discriminator = none self. score = score self. t... | [
0.20036116242408752,
0.9009800553321838,
0.4123128056526184,
0.1606450229883194,
-0.34363502264022827,
-0.33878007531166077,
-0.5021507740020752,
-0.16440439224243164,
-0.3439503610134125,
-0.11759490519762039,
-0.21405792236328125,
0.7193362712860107,
0.04001081362366676,
-0.7166812419891... |
def align ( inp, ref, xfm = none, out = none, dof = 12, searchrad = true, bins = 256, interp = none, cost = " mutualinfo ", sch = none, wmseg = none, init = none, finesearch = none, ) : cmd = f " flirt - in { inp } - ref { ref } " if xfm is not none : cmd + = f " - omat { xfm } " if out is not none : cmd + = f " - out ... | [
0.057151153683662415,
-0.1699078232049942,
0.9514296054840088,
-0.02599908784031868,
-0.32026463747024536,
0.1759868860244751,
0.14603084325790405,
0.16520097851753235,
-0.06614983081817627,
-0.29823216795921326,
0.19656875729560852,
0.5490822196006775,
-0.4898074269294739,
0.6138862967491... |
def wait _ for _ connection ( self ) : try : self. connection, self. client _ address = self. sock. accept ( ) self. _ handshake ( ) except exception as e : raise udsexception ( str ( e ) ) | [
-0.0479571558535099,
0.523257315158844,
0.45866698026657104,
-0.5111865401268005,
0.1342272311449051,
0.07011986523866653,
-0.20232656598091125,
0.49016472697257996,
-0.813677966594696,
-1.1255648136138916,
0.49089229106903076,
-0.25542548298835754,
0.28061527013778687,
-0.6136406660079956... |
def translate _ version _ str2int ( version _ str ) : import math parts = version _ str. split ( '.') i, v, l = 0, 0, len ( parts ) if not l : return v while i < 3 : try : v + = int ( parts [ i ] ) * int ( math. pow ( 10, ( 2 - i ) * 2 ) ) l - = 1 i + = 1 except valueerror : return v if not l : return v return v try : ... | [
0.2741570472717285,
-0.48907750844955444,
0.590526282787323,
0.021969590336084366,
-0.5165322422981262,
-0.6033617258071899,
0.43416091799736023,
0.26890110969543457,
0.35298559069633484,
0.3846661150455475,
-0.405877023935318,
-0.2437768280506134,
-0.5011296272277832,
-1.099570631980896,
... |
def kl _ divergence _ ( self, val ) : raise attributeerror ( \ " attribute'kl _ divergence _'of tsne is not writable " ) | [
0.716886043548584,
0.4053424298763275,
0.38113677501678467,
0.494907021522522,
-0.2823944389820099,
1.1217836141586304,
0.4302001893520355,
0.8149063587188721,
-0.04380154237151146,
-0.16116835176944733,
-0.17844216525554657,
-1.0616904497146606,
1.0268192291259766,
0.6827523112297058,
-... |
def test _ wd _ mix _ args _ kwargs ( self ) : r = rectangle ( 1, 1, 0, 0, 1 ) r. update ( 2, 2, 2, 2, 2, width = 3, height = 3, x = 3, y = 3, id = 3 ) self. assertequal ( str ( r ), " [ rectangle ] ( 2 ) 2 / 2 - 2 / 2 " ) | [
-0.3261919617652893,
-0.9057703018188477,
0.63668292760849,
-0.1403113156557083,
-0.4071246385574341,
0.1572313755750656,
0.21514414250850677,
-0.7832568287849426,
0.33548569679260254,
0.19095604121685028,
0.13439109921455383,
-0.694930374622345,
-0.877763569355011,
0.506333589553833,
-0... |
def getadjustedringexposuretimes ( inumtimes ) : andor _ solis. getadjustedringexposuretimes. restype = ctypes. c _ uint fptimes = ctypes. c _ float ( ) result = andor _ solis. getadjustedringexposuretimes ( ctypes. c _ int ( inumtimes ), ctypes. byref ( fptimes ) ) check _ status ( result ) return float ( fptimes. val... | [
-0.5752212405204773,
-0.1910308450460434,
0.379287451505661,
-0.5943114757537842,
-0.16504646837711334,
-0.5426541566848755,
0.6199904680252075,
-0.6494383811950684,
0.6291074752807617,
1.0975618362426758,
-0.1664372980594635,
0.07034221291542053,
-0.7634122371673584,
0.9382704496383667,
... |
def _ isrightcolor ( pixelcolor, hsvrange ) : c1, c2, c3 = pixelcolor hl1, hl2, hl3 = hsvrange [ 0 ] hh1, hh2, hh3 = hsvrange [ 1 ] return c1 > = hl1 and c1 < hh1 \ and c2 > = hl2 and c2 < hh2 \ and c3 > = hl3 and c3 < hh3 | [
0.04440933093428612,
-0.028245817869901657,
1.0921112298965454,
0.4352279305458069,
-0.11143205314874649,
0.6373446583747864,
-0.9935944676399231,
-0.8471320867538452,
-0.5425822138786316,
0.06482629477977753,
-0.18371672928333282,
0.03758738934993744,
-1.1480910778045654,
0.44205543398857... |
def wrap _ up ( initdir, mainworkdir, args ) : exit _ code = 0 # cleanup pilot workdir if created if initdir! = mainworkdir and args. cleanup : chdir ( initdir ) try : rmtree ( mainworkdir ) except exception as e : logging. warning ( " failed to remove % s : % s ", mainworkdir, e ) else : logging. info ( " removed % s ... | [
-0.08794202655553818,
-0.17263951897621155,
1.0132064819335938,
-0.7450660467147827,
0.13401727378368378,
-0.14313842356204987,
0.4220631420612335,
-0.2923002541065216,
0.1837502121925354,
0.6242614984512329,
0.8276341557502747,
-0.3004002869129181,
-0.2396019697189331,
0.3299500048160553,... |
def get _ event _ exchange ( service _ name ) : exchange _ name = " { }. events ". format ( service _ name ) exchange = exchange ( exchange _ name, type ='topic ', durable = true, auto _ delete = true, delivery _ mode = persistent ) return exchange | [
1.0792189836502075,
-0.10146020352840424,
0.4364880323410034,
-0.2556130290031433,
-0.19869573414325714,
0.03338601440191269,
-0.629299521446228,
0.1917150765657425,
0.6480905413627625,
0.006412988528609276,
0.5576316118240356,
0.4637894332408905,
-0.36851194500923157,
-0.42961254715919495... |
def make _ dir ( self, path, permission ) : pass | [
-0.3741450607776642,
0.2085210382938385,
0.2910303473472595,
0.8767433762550354,
-0.5808074474334717,
0.7637442946434021,
0.595032811164856,
0.11511063575744629,
-0.186363086104393,
-1.0779974460601807,
0.6543269753456116,
0.10191686451435089,
0.07123848795890808,
-1.4236737489700317,
0.... |
def set _ write _ ready ( fileobj, loop ) : loop. call _ soon _ threadsafe ( _ set _ event _ ready, fileobj, loop, selectors. event _ write ) | [
-0.5572421550750732,
-0.746760904788971,
0.4340212047100067,
0.11301352828741074,
0.7070980072021484,
-0.3714939057826996,
0.9008991122245789,
-0.33698102831840515,
-0.7923217415809631,
0.26688435673713684,
-0.8007861971855164,
0.17678390443325043,
0.1217065304517746,
0.44169971346855164,
... |
def get _ all _ teams ( self ) : # send request url = self. base _ url + " / league / " + str ( self. game ) + ". l. " + str ( self. league ) + " / teams / " response = self. get ( url, format ='xml') return et. fromstring ( response ) \. find ('yahoo : league ', self. _ ns ) \. find ('yahoo : teams ', self. _ ns ) | [
0.38498610258102417,
-0.15558071434497833,
0.651909589767456,
0.07150919735431671,
0.39474397897720337,
-0.25051602721214294,
-1.69907808303833,
-0.346127986907959,
0.7356904745101929,
-0.8061017394065857,
0.20382846891880035,
0.6089311242103577,
0.3637691140174866,
0.272586852312088,
0.... |
async def get _ stages ( tournament _ id : int, tournament : tournament = depends ( visible _ tournament ), ) : if not tournament : raise httpexception ( status _ code = status. http _ 404 _ not _ found, detail = f'no tournament found with id { tournament _ id } ', ) else : return tournament. stages | [
-0.7266854643821716,
0.024086423218250275,
0.5951275825500488,
0.11503788083791733,
0.3466644287109375,
-0.2052769809961319,
-0.7093834280967712,
-0.5205330848693848,
-0.005813872907310724,
1.0151619911193848,
-0.09837672114372253,
-0.10724074393510818,
0.587615966796875,
0.217258870601654... |
def _ calc _ total _ dict _ amt ( cls, * charges ) : amt = 0. 0 for charge in charges : amt + = charge ['amt'] return helper. round _ off ( amt ) | [
0.45062127709388733,
-0.5084705948829651,
0.6225268244743347,
-1.1622289419174194,
-0.4316512644290924,
-0.17573173344135284,
-0.2097788006067276,
0.2857648432254791,
0.03842013329267502,
0.9370353817939758,
0.11226411908864975,
-1.0370656251907349,
0.4943401515483856,
0.300342321395874,
... |
def showmenuitemxml ( rest _ id, menu _ id ) : menuitem = session. query ( menuitem ). filter _ by ( restaurant _ id = rest _ id, id = menu _ id ). one ( ) menuitem. price = sub ('\ $ ','', menuitem. price ) m = {'menu _ item': menuitem. serialize } return response ( xmlify ( m, wrap ='menuitem'), mimetype ='text / xml... | [
0.14212985336780548,
-0.5267251133918762,
0.41568100452423096,
0.9319241642951965,
-1.1365151405334473,
-0.276590496301651,
-1.4337635040283203,
0.4427359104156494,
-0.03069233149290085,
-0.06782278418540955,
0.193848118185997,
-0.03920164331793785,
-1.0740708112716675,
-0.1246487796306610... |
def _ _ mode _ update _ ui ( self, value ) : self. _ _ output _ list _ box. set _ multi _ selection ( value ) self. _ _ cpu _ combo _ box. set _ enabled ( value ) self. _ _ ram _ combo _ box. set _ enabled ( value ) self. _ _ distribute _ combo _ box. set _ enabled ( value ) self. _ _ ipr _ update _ check _ box. set _ ... | [
-1.5594370365142822,
-0.740754246711731,
0.8498312830924988,
-0.05599149689078331,
-0.6146769523620605,
0.14805276691913605,
0.8115005493164062,
-0.11154906451702118,
0.24905432760715485,
0.40839865803718567,
-0.548904538154602,
-0.6360423564910889,
-1.0540332794189453,
0.6768501996994019,... |
def receive ( self ) : try : return self. codec. receive ( lambda : self. sock. recv ( self. buffer _ size ) ) except exception as e : raise udsexception ( str ( e ) ) | [
-0.18543589115142822,
0.5038486123085022,
0.6486096382141113,
-0.5994855761528015,
-0.1271105259656906,
0.16640616953372955,
-0.6881841421127319,
-0.39158982038497925,
-0.23844704031944275,
-1.5188581943511963,
-0.1487734466791153,
0.916884183883667,
-0.3713264763355255,
-0.463467538356781... |
def generate _ new _ referal _ code ( self ) : def _ passcode ( ) : return str ( uuid. uuid4 ( ). hex ) [ 0 : 8 ] passcode = _ passcode ( ) while userprofile. objects. filter ( referral _ code = passcode ). exists ( ) : passcode = _ passcode ( ) return passcode | [
0.09885204583406448,
-0.2674974501132965,
0.5886496901512146,
0.015197799541056156,
0.029586749151349068,
0.20594388246536255,
0.11666916310787201,
-0.14739596843719482,
0.21690009534358978,
0.7092880010604858,
0.21966049075126648,
0.1282181292772293,
-0.6123359203338623,
0.429576456546783... |
def _ input ( self ) - >'virtualproduct': return from _ validated _ recipe ( self ['input'] ) | [
0.36701685190200806,
-0.3115081489086151,
0.04335051029920578,
0.5321231484413147,
-0.7184120416641235,
0.9134452939033508,
0.021429654210805893,
-0.1832159161567688,
1.3055483102798462,
0.3537602722644806,
0.1449412703514099,
0.3983331620693207,
-0.017720278352499008,
-1.273535966873169,
... |
def months _ to _ years ( n _ months, df, rounding = false ) : if rounding : df [ " tenure _ years " ] = np. round ( n _ months / 12 ) return df else : df [ " tenure _ years " ] = n _ months / / 12 return df | [
0.5156667232513428,
0.40886276960372925,
0.535458505153656,
-0.7714575529098511,
0.31678876280784607,
0.3351346254348755,
-0.5792005062103271,
0.049696046859025955,
-0.3885860741138458,
0.6038787364959717,
0.5730926990509033,
0.34639012813568115,
0.0917636975646019,
0.08097433298826218,
... |
def z _ score ( data _ df, window = 14 ) : if window > data _ df. shape [ 0 ] : print ('window too small') return np. nan data _ sub _ df = data _ df. iloc [ - window : ] close = data _ sub _ df ['close'] if close. std ( ) = = 0 : print ( close ) return ( close [ - 1 ] - close. mean ( ) ) / close. std ( ) | [
-0.4565480649471283,
0.3551231026649475,
0.7259162664413452,
0.37037473917007446,
-0.5533755421638489,
0.4233996868133545,
1.2442622184753418,
-0.7699722647666931,
-0.031168052926659584,
0.33976638317108154,
1.0002284049987793,
1.2178856134414673,
-0.7952207922935486,
0.027150079607963562,... |
def make _ projection _ matrix ( x ) : return np. eye ( x. shape [ 0 ] ) - np. einsum ('ij, jk ', x, olsmatrix _ ulen ( x ) ) | [
-0.7325863838195801,
0.08736145496368408,
0.46846380829811096,
0.0642680823802948,
-0.08382996916770935,
0.6150109171867371,
0.10693284869194031,
0.0014047598233446479,
1.0550984144210815,
0.7042263150215149,
0.23103435337543488,
-0.1403295248746872,
0.12437870353460312,
-1.837280154228210... |
def evaluate _ model ( model, x _ test, y _ test, category _ names ) : # get results and add them to a dataframe. y _ pred = model. predict ( x _ test ) print ( classification _ report ( y _ test, y _ pred, target _ names = category _ names ) ) # results = pd. dataframe ( columns = ['category ','f _ score ','precision ... | [
-0.031169414520263672,
0.4382752776145935,
0.3792704641819,
-0.20446261763572693,
0.6573210954666138,
-0.2668240964412689,
-0.5205631256103516,
0.2731933891773224,
-1.1979849338531494,
-0.9750866293907166,
0.056352682411670685,
0.12068808078765869,
0.719973087310791,
-0.04794813692569733,
... |
def test _ get _ settings _ file ( self ) : pass | [
0.05890868231654167,
0.9193477034568787,
0.22885960340499878,
0.8520344495773315,
1.7241965532302856,
0.09610819816589355,
1.551615834236145,
-0.617304265499115,
-1.528217077255249,
-0.07586216181516647,
-0.3189280927181244,
-0.19325245916843414,
-0.4800761938095093,
-0.34915274381637573,
... |
def get _ train _ test _ vec ( x _ train, x _ test, train _ model, test _ model ) : train _ vec = np. concatenate ( [ get _ sent _ vec ( 300, sent, train _ model ) for sent in x _ train ] ) test _ vec = np. concatenate ( [ get _ sent _ vec ( 300, sent, test _ model ) for sent in x _ test ] ) # 保 # np. save ( path +'tra... | [
-0.42901551723480225,
-0.4935833811759949,
0.7801501750946045,
-0.08466605842113495,
1.1372588872909546,
0.26853272318840027,
0.8990365266799927,
-0.4690381586551666,
-0.4395555853843689,
0.5851995348930359,
-0.7172110080718994,
0.6671176552772522,
0.109367236495018,
-0.5206592082977295,
... |
def timestamp ( as _ path = false ) : _ now = time. time ( ) _ msec = ( _ now - long ( _ now ) ) * 1000 fmt ='% a - % d - % h % m % s'if as _ path else'% a - % d - % h : % m : % s'return time. strftime ( fmt ) + '. { : 03d } '. format ( int ( _ msec ) ) | [
0.15596406161785126,
-0.13875725865364075,
0.8324442505836487,
-0.16588111221790314,
-0.33045318722724915,
0.1299140900373459,
-0.6292397379875183,
0.6574701070785522,
0.17889897525310516,
0.8126220107078552,
0.27916377782821655,
-0.32148468494415283,
0.8004868626594543,
0.0528411306440830... |
def to _ dict ( self ) : result = { } for attr, _ in iteritems ( self. swagger _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ attr ] =... | [
-0.7244135737419128,
-0.29116374254226685,
0.7715178728103638,
-0.8901128768920898,
-0.702923059463501,
-0.6153578758239746,
0.5321179628372192,
-0.4623629152774811,
-0.09173503518104553,
0.1691913902759552,
-0.6271624565124512,
-0.11386758089065552,
0.06181638687849045,
0.9606802463531494... |
def retr ( self, filename, openfile ) : self. initialize _ file _ channel ( ) if not self. file _ channel : print ('no available file _ channel.') return false cmd ='retr'+ filename self. send _ cmd ( cmd ) if openfile : data = self. file _ channel. recv ( 4096 ) openfile. write ( data ) while data : data = self. file ... | [
-0.10694462060928345,
-0.49265605211257935,
0.9910668134689331,
-0.375949501991272,
0.4391842186450958,
0.2704371213912964,
0.21598421037197113,
-0.08631488680839539,
-1.0842205286026,
-0.4794560670852661,
0.3070998787879944,
0.20921899378299713,
-1.4582914113998413,
-0.8799241185188293,
... |
def training ( env : unityagents. unityenvironment, output _ dir : typing. union [ pathlib. path, str ], agent _ type : str = " ddpg ", buffer _ size : int = 100 _ 000, batch _ size : int = 128, gamma _ discount _ factor : float = 0. 95, tau _ soft _ update : float = 1e - 3, learning _ rate _ actor : float = 2e - 3, le... | [
-0.6037958860397339,
0.18976426124572754,
1.1330610513687134,
-0.2615284025669098,
0.4732047915458679,
-0.37341201305389404,
0.6858457326889038,
-0.055268049240112305,
-0.0782812163233757,
0.2926534116268158,
0.1347014456987381,
0.8374276161193848,
0.21750828623771667,
-0.18453583121299744... |
def right ( cls, array _ electrons, exposure _ info = none ) : array _ electrons = layout _ util. rotate _ array _ from _ roe _ corner ( array = array _ electrons, roe _ corner = ( 1, 1 ) ) return cls. manual ( array = array _ electrons, exposure _ info = exposure _ info, pixel _ scales = 0. 05 ) | [
-0.026788508519530296,
0.05384395271539688,
0.832125186920166,
-0.08090485632419586,
-0.25214534997940063,
-0.020309263840317726,
-0.3774329721927643,
-0.36158138513565063,
0.15128012001514435,
0.4188169836997986,
0.7215919494628906,
0.49426546692848206,
0.10628888756036758,
0.437010854482... |
def test _ unit _ register _ with _ post ( self ) : with patch ('user _ auth. views. registerform') as form : with patch ('user _ auth. views. httpresponseredirect') as redir : request = magicmock ( ) request. method = " post " # # this will pass if request. post = = " post " part. request. post = " some _ input " form... | [
-0.7132852673530579,
0.9745054244995117,
0.6074827909469604,
0.38414430618286133,
0.8379320502281189,
0.2672993540763855,
-0.3635520040988922,
-0.27344128489494324,
0.3114720284938812,
-1.3147951364517212,
-0.47342029213905334,
0.025297313928604126,
0.2525235414505005,
0.2360798865556717,
... |
def silhouette _ coefficient ( self ) : return self. _ _ silhouette _ coef | [
0.6343522071838379,
-0.507136881351471,
0.3214167356491089,
-0.1621427983045578,
-0.3846012055873871,
0.3580182194709778,
1.7763140201568604,
0.046043332666158676,
0.4220818877220154,
-0.27904829382896423,
-0.36607813835144043,
1.8699636459350586,
0.1262054145336151,
-0.655756950378418,
... |
def _ make _ tarfile ( output _ filename, source _ dir ) : with tarfile. open ( output _ filename, " w : gz " ) as tar : for f in os. listdir ( source _ dir ) : tar. add ( os. path. join ( source _ dir, f ), arcname = f ) | [
0.5680853724479675,
0.3167940378189087,
0.34940123558044434,
-0.7489966750144958,
0.4185206890106201,
0.5005315542221069,
0.9291763305664062,
0.8685320615768433,
-1.0719175338745117,
-0.22252358496189117,
-0.05169535428285599,
0.0480339415371418,
1.1225107908248901,
-0.8093062043190002,
... |
def test _ validated _ no _ conflict ( self ) : work _ entry _ 1 = self. create _ work _ entry ( datetime ( 2018, 10, 10, 9, 0 ), datetime ( 2018, 10, 10, 12, 0 ) ) work _ entry _ 1. state ='validated'work _ entry _ 2 = self. create _ work _ entry ( datetime ( 2018, 10, 10, 10, 0 ), datetime ( 2018, 10, 10, 18, 0 ) ) s... | [
0.1463109850883484,
-0.4491758644580841,
0.7135866284370422,
0.5469156503677368,
1.3351805210113525,
1.1362391710281372,
0.3971957266330719,
-0.21359755098819733,
0.06557787209749222,
-0.6962341070175171,
-0.9348505735397339,
-0.3975442945957184,
-0.7663606405258179,
-0.3454866111278534,
... |
def get _ input _ coordinates _ of _ anchor _ points ( feature _ map _ shape, feature _ to _ input ) : assert len ( feature _ map _ shape ) in [ 3, 4 ] # either a 4d array with [ :, height, width, channels ] or just a single feature map [ height, width, channels ] if len ( feature _ map _ shape ) = = 3 : features _ hei... | [
-0.9096378087997437,
-1.0760163068771362,
0.7547386288642883,
-0.5968434810638428,
-0.42940834164619446,
0.13203978538513184,
0.008762133307754993,
0.28638795018196106,
-0.3962927460670471,
0.4246053993701935,
0.036392807960510254,
0.5724024772644043,
0.659960150718689,
-0.3615132570266723... |
def create _ project _ and _ milestones ( title, num _ ms ) : project = project. objects. create ( name = title ) for i in range ( num _ ms ) : milestone. objects. create ( name = ( title + " " + str ( i ) ), project = project ) return project | [
0.31960564851760864,
0.9301890134811401,
0.3894816040992737,
0.397786021232605,
-0.14095906913280487,
0.9035341143608093,
-0.24102509021759033,
-0.21483948826789856,
0.03725338727235794,
0.5193502902984619,
0.016179751604795456,
-1.0646768808364868,
-0.7937525510787964,
0.03792932629585266... |
def tmp _ cwd ( monkeypatch : monkeypatch, tmp _ path : path ) - > path : monkeypatch. chdir ( tmp _ path ) return tmp _ path | [
0.5771874785423279,
-0.9294076561927795,
0.3890025019645691,
-0.44965460896492004,
-0.4360038638114929,
0.952005922794342,
0.8271610736846924,
0.11935994774103165,
0.16646422445774078,
0.020389679819345474,
0.22845658659934998,
0.3713027834892273,
-0.02290891855955124,
-0.22447334229946136... |
def test _ get _ alumno _ admin ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) id _ alumno = alumno. objects. get ( dni = 1 ). id response = self. client. get ( f " / api / alumnos / { id _ alumno } / " ) self. assertequal ( response. status _ code, status. http _ 200 _ ok ) | [
0.41905948519706726,
0.4091503918170929,
0.3758416175842285,
0.42225247621536255,
0.6146589517593384,
1.0625250339508057,
-0.6477292776107788,
-0.6185011267662048,
0.3227841258049011,
-0.36777353286743164,
-0.4319867491722107,
2.0226333141326904,
0.984456479549408,
-0.5733693242073059,
0... |
def rhs ( y, t ) : ydot = y [ 1 ] ydotdot = 0. 5 * y [ 0 ] / ( y [ 0 ] * * 2 + t * * 2 ) * * 1. 5 return ydot, ydotdot | [
0.2227727323770523,
-1.1019407510757446,
0.3843529522418976,
-0.4754789173603058,
-0.05044536665081978,
0.6781613230705261,
-0.18295760452747345,
-0.6939375400543213,
-0.21278627216815948,
0.6077744960784912,
-0.37949585914611816,
0.3704816699028015,
0.4124463200569153,
-0.0076840575784444... |
def path _ to _ subdirectory ( subdirectory ) : runpath = os. path. dirname ( os. path. realpath ( _ _ file _ _ ) ) pathdirs = runpath. split ( os. sep ) assembled _ path = " " i = 0 while i < len ( pathdirs ) : if i = = 0 : assembled _ path = pathdirs [ i ] else : assembled _ path = assembled _ path + os. sep + pathdi... | [
0.04340118169784546,
-0.5173057317733765,
0.9938467741012573,
-0.14485350251197815,
-0.09415019303560257,
-0.1961449831724167,
1.296447515487671,
-0.728766143321991,
0.37928828597068787,
-0.6189247965812683,
0.33912500739097595,
0.9601965546607971,
-0.08402614295482635,
-0.0505289323627948... |
async def post ( self, body : optional [ calendarpermission ] = none, request _ configuration : optional [ calendarpermissionsrequestbuilderpostrequestconfiguration ] = none ) - > optional [ calendarpermission ] : if not body : raise typeerror ( " body cannot be null. " ) request _ info = self. to _ post _ request _ in... | [
-0.7691890001296997,
0.7466202974319458,
0.7558388113975525,
0.5364977717399597,
-0.3412838876247406,
0.14757166802883148,
-0.013407640159130096,
-0.2157847136259079,
0.35773882269859314,
0.08451096713542938,
-0.1520848125219345,
0.02842758409678936,
-0.3651160001754761,
-0.327080786228179... |
def rescale _ image ( image ) : return 2. * ( image / 255. ) - 1 | [
-0.71535325050354,
-0.4673750102519989,
0.42892616987228394,
0.8367851376533508,
0.22355322539806366,
-0.6479717493057251,
-0.4412951171398163,
-0.2930898368358612,
-0.7090022563934326,
0.43235138058662415,
0.6031919121742249,
-0.19164671003818512,
-0.24941326677799225,
0.9388421773910522,... |
def trigger ( self, trigger = none, options = triggeroptions ( 0 ) ) : def decorator ( func ) : name = trigger or func. _ _ name _ _ self. triggers. append ( trigger ( name, func, options ) ) return decorator | [
-0.4910871088504791,
0.6042470335960388,
0.2514176070690155,
0.3321807384490967,
0.43702980875968933,
-1.2031646966934204,
0.08340905606746674,
0.673326849937439,
1.2387361526489258,
-1.0700260400772095,
-0.8263162970542908,
0.27985143661499023,
0.2720526456832886,
-0.13334530591964722,
... |
def get _ self ( self ) : return self. get _ user ('self') | [
-0.8772584795951843,
-0.6358687877655029,
0.3805742859840393,
1.2112646102905273,
0.20269811153411865,
-0.2016793042421341,
0.8470761179924011,
-0.9955432415008545,
-0.10888228565454483,
-1.502732753753662,
-0.7441986203193665,
0.8971812725067139,
0.13591007888317108,
-0.7457091212272644,
... |
def handle _ events ( self, action ) : if action = = actions. jump : if self. _ player _ dino. rect. bottom = = int ( 0. 98 * height ) : self. _ player _ dino. is _ jumping = true self. jump _ sound. play ( ) self. _ player _ dino. movement [ 1 ] = - 1 * self. _ player _ dino. jump _ speed if action = = actions. duck :... | [
-0.5463904142379761,
-0.20279289782047272,
0.7948786020278931,
0.7242305278778076,
0.6082861423492432,
-0.09507522732019424,
0.9831441640853882,
-0.8565472960472107,
0.4727144241333008,
0.2902732789516449,
0.13450510799884796,
0.05968783050775528,
0.515206515789032,
0.4638352394104004,
1... |
def register _ blueprints ( app ) : app. register _ blueprint ( assistant. webhook. blueprint ) app. register _ blueprint ( web. views. blueprint ) return none | [
0.7155763506889343,
0.25237149000167847,
0.5433284044265747,
0.9368845820426941,
1.3698467016220093,
0.02555694989860058,
-0.3515845835208893,
-0.752332329750061,
0.7512452006340027,
-0.17390456795692444,
-0.7503209710121155,
1.0863218307495117,
-0.014190398156642914,
1.1401057243347168,
... |
def start _ with _ ui ( self ) : self. incoming. start ( ) print " welcome to quilt " while true : user _ in = raw _ input ( " > > " ). split ( " " ) cmd = user _ in [ 0 ] if cmd = = " / connect " : if len ( user _ in )! = 3 : print " / connect < address > < port > " continue self. protocol. connect _ to _ server ( use... | [
0.03279385715723038,
0.4426412582397461,
0.7638373374938965,
0.4348657727241516,
-0.362846314907074,
0.7096806764602661,
0.5103334188461304,
-0.7721993923187256,
-0.017952008172869682,
-0.6691372990608215,
0.06586999446153641,
0.731364369392395,
-0.7208818197250366,
0.30483266711235046,
... |
def featurize _ w _ centroids ( data, centroids ) : xhat = none for sample in data ['x'] : x = np. array ( [ sample. dot ( centroid ) for centroid in centroids ] ) xhat = x if xhat is none else np. vstack ( ( xhat, x ) ) data ['x'] = xhat return data | [
0.2216382622718811,
-0.40771356225013733,
0.2689259648323059,
-0.1000732034444809,
0.20463429391384125,
-0.5501311421394348,
-0.20909065008163452,
0.3181600868701935,
0.575377345085144,
0.48421788215637207,
-0.4679688811302185,
0.20003367960453033,
0.3540138602256775,
-0.2665868103504181,
... |
def start ( self ) : self. _ stop _ me = false threading. thread. start ( self ) | [
0.1982317566871643,
-0.34790197014808655,
0.2206593006849289,
0.5472213625907898,
0.8396803140640259,
0.49968060851097107,
0.3082740604877472,
1.0423537492752075,
-0.6317502856254578,
-1.467002511024475,
-0.1347474902868271,
0.22510161995887756,
-0.23750923573970795,
-0.2592450976371765,
... |
def geom _ x _ sec ( self ) : return pi * self. r * * 2 | [
1.4135825634002686,
-0.1330316960811615,
0.18188388645648956,
-0.2373712956905365,
-0.17190495133399963,
0.8374810218811035,
-0.5063772797584534,
-1.3869524002075195,
-0.283921480178833,
0.31376999616622925,
-0.6640365719795227,
-0.03424913063645363,
0.6187534332275391,
-0.7323945164680481... |
def set _ user _ relationship ( self, user _ id, action ) : params = {'action': action } url = self. client. users +'/ { } / relationship '. format ( user _ id ) return self. client. post ( url, params = params, bucket = _ func _ ( ) ) | [
-0.5454761385917664,
-0.2180255949497223,
0.41639217734336853,
0.8204823136329651,
0.3391284942626953,
0.578856885433197,
-0.049598563462495804,
-0.9855030179023743,
0.4659072160720825,
0.1357833743095398,
-0.8423098921775818,
1.1594743728637695,
-0.5405786037445068,
-0.16656769812107086,
... |
def testpep8 ( self ) : pep8style = pep8. styleguide ( quiet = true ) result = pep8style. checkfile ( ['models / state. py'] ) self. assertequal ( result. total _ errors, 0,'found code style errors ( and warning ).') | [
-0.12815073132514954,
0.3580573499202728,
0.25497713685035706,
-0.015254910103976727,
1.3936017751693726,
0.8968285322189331,
0.029057694599032402,
0.1900552362203598,
0.03411293402314186,
0.4732314348220825,
-0.2322767823934555,
-0.34606173634529114,
0.3079705238342285,
0.3434377312660217... |
def essfunction ( weights ) : norm _ weights = weights / sum ( weights ) sqweights = power ( norm _ weights, 2 ) return 1 / sum ( sqweights ) | [
0.28485825657844543,
0.8127269744873047,
0.3389386236667633,
0.10212328284978867,
-0.155643031001091,
-0.7436250448226929,
0.19731158018112183,
0.3717510998249054,
0.5377320647239685,
0.5255381464958191,
0.21661706268787384,
0.3006037771701813,
0.23609957098960876,
0.5881394743919373,
-0... |
def test _ comment _ to _ activity ( self, * _ ) : status = models. comment. objects. create ( content = " test content ", user = self. local _ user, book = self. book ) activity = status. to _ activity ( ) self. assertequal ( activity [ " id " ], status. remote _ id ) self. assertequal ( activity [ " type " ], " comme... | [
0.18909050524234772,
-1.076985239982605,
0.3066961467266083,
-0.33338889479637146,
1.2705013751983643,
0.44692447781562805,
0.883534848690033,
-0.25950607657432556,
0.28329306840896606,
0.3487115502357483,
-0.5659682750701904,
-0.19219334423542023,
-0.5215462446212769,
-0.74222731590271,
... |
def is _ sleeper ( row : list ) - > int : if " sleeper " in row [ name _ col _ idx ]. lower ( ) : return 1 return 0 | [
-0.647984504699707,
1.0313271284103394,
0.4433146119117737,
0.8829314708709717,
-0.3307834267616272,
-0.30973049998283386,
-0.3274947702884674,
-0.07620934396982193,
0.2304989993572235,
0.6211532950401306,
-0.7084362506866455,
-0.09634819626808167,
-0.04440204054117203,
0.2962631583213806,... |
def is _ topological _ sort ( graph, sequence ) : if set ( sequence )! = set ( graph. get _ nodes ( ) ) : return false index = { v : i for ( i, v ) in enumerate ( sequence ) } return all ( index [ u ] < index [ v ] for ( u, v ) in graph. get _ edges ( ) ) | [
-0.912591278553009,
-0.11947791278362274,
0.31203702092170715,
0.24049629271030426,
-0.39522698521614075,
-0.36343255639076233,
-0.5281893610954285,
-0.5575023889541626,
0.5617138147354126,
0.6440943479537964,
-0.4664458632469177,
0.014468373730778694,
-0.20209689438343048,
-0.608547031879... |
def prepend ( self, resource _ name, value ) : raise notimplementederror | [
0.35648149251937866,
-0.7382500171661377,
0.6285616159439087,
-0.4692917764186859,
-0.5078622102737427,
1.255288004875183,
-0.6877985000610352,
-0.3961966931819916,
0.4408431351184845,
0.2579819858074188,
0.5079061388969421,
0.10331866890192032,
0.8400034308433533,
0.7741277813911438,
-0... |
def test _ get _ list ( self ) : xmlns ='http : / / xmlns1'received _ on = datetime ( 2019, 1, 2 ) self. _ send _ forms ( [ ( xmlns, received _ on ) ] ) response = self. _ assert _ auth _ get _ resource ( self. list _ endpoint ) self. assertequal ( response. status _ code, 200 ) api _ forms = json. loads ( response. co... | [
-0.6798169612884521,
0.01296690758317709,
0.5314825177192688,
-0.45833712816238403,
1.0606474876403809,
-0.197954922914505,
-1.1324857473373413,
0.23117977380752563,
0.8129450678825378,
-0.7107099890708923,
-1.0467309951782227,
0.334610253572464,
0.6629300117492676,
-0.20454272627830505,
... |
def request ( self, method, path, body = none ) : body = json. dumps ( body ) if body is not none else none resp = self. _ request ( method, path, body ) code, msg, data = _ read _ response ( resp ) if code < 200 or code > = 300 : raise error ( code, msg ) return code, msg, data | [
-0.8943531513214111,
0.2724497318267822,
0.7580326795578003,
-0.16576522588729858,
0.5152525305747986,
-0.6748327612876892,
-0.7758274674415588,
-0.5120406150817871,
0.1705935299396515,
0.06097140535712242,
0.2598244249820709,
0.7412029504776001,
-0.3449593782424927,
-0.5050482153892517,
... |
def _ committransaction ( self, conn, callback, thread _ state = none ) : conn. commit ( ) self. _ ioloop. add _ callback ( partial ( self. _ releaseconnectioninvokecallback, conn, callback ) ) | [
0.36681443452835083,
-0.7215845584869385,
0.6671587228775024,
-0.06824467331171036,
0.12444041669368744,
-0.11334078013896942,
-0.3620251417160034,
0.41388291120529175,
-0.28216904401779175,
1.3498252630233765,
-0.19595122337341309,
-0.9644429087638855,
-0.7375783920288086,
-0.507555246353... |
def _ create _ workspace _ deployment ( self, metadata : client. v1objectmeta, username, password ) - > none : body = client. v1deployment ( ) body. metadata = metadata template = self. _ create _ spec _ template _ code _ server ( username, password ) selector = client. v1labelselector ( match _ labels = { " app " : se... | [
-0.6986263990402222,
0.38340017199516296,
0.45244139432907104,
-0.1558515429496765,
-0.08992309868335724,
0.5160071849822998,
-0.04252605885267258,
-0.30431699752807617,
0.3747149109840393,
1.2577507495880127,
-0.13781338930130005,
1.198425531387329,
-0.595053493976593,
0.441607266664505,
... |
def on _ signup ( self, data ) : try : safe _ data = t. dict ( { t. key ( u " username " ) > > " username " : t. string, t. key ( u " password " ) > > " password " : t. string, } ). check ( data ) except t. dataerror : self. emit ( " signupfailed ", { " reason " : " invalidrequest " } ) logging. exception ( " received ... | [
-0.8492950797080994,
0.06767906993627548,
0.6816492676734924,
0.389028936624527,
-0.20593957602977753,
0.07971248030662537,
-0.5466940999031067,
0.47071030735969543,
0.6116764545440674,
0.3059863746166229,
-0.6638189554214478,
-0.13180279731750488,
-0.31039854884147644,
-0.4898639023303985... |
def _ conv _ layers ( self ) : layers, activations = [ ], [ ] act = get _ activation ( self. hparams. activation ) # the first out _ channels should be the second to last filter size tmp = self. hparams. filters. pop ( ) # self. output _ shape [ 0 ] needs to be the last out _ channels to match the input matrix for i, (... | [
-0.7870976328849792,
-0.9239624738693237,
0.581233561038971,
0.2900627553462982,
-0.0669122040271759,
-0.695458710193634,
0.610653817653656,
-0.04338376969099045,
-0.20151349902153015,
0.9133623838424683,
-0.2203119397163391,
0.017235737293958664,
0.2640664875507355,
0.37590545415878296,
... |
def add _ field ( self, name, datatype, role, field _ type, caption, hidden ) : # todo : a better approach would be to create an empty column and then # use the input validation from its " field " - object - representation to set values. # however, creating an empty column causes errors : ( # if no caption is specified... | [
-0.035996872931718826,
0.3894158899784088,
0.4590110182762146,
-0.5467140674591064,
-0.2674177289009094,
0.43833693861961365,
-0.47192445397377014,
-0.147593691945076,
0.38964778184890747,
-1.018876314163208,
-0.6625049710273743,
-0.17791949212551117,
-0.2506755292415619,
-0.50777673721313... |
def do _ update _ all ( self, * * kwargs ) : # pylint : disable = unused - argument _ error _ code = 0 _ msg ='' for _ node in self. tree. all _ nodes ( ) : try : _ error _ code, _ debug _ msg = self. do _ update ( _ node. identifier ) _ msg = _ msg + _ debug _ msg +'\ n'except attributeerror : _ error _ code = 1 _ msg... | [
-0.3991958796977997,
-0.1571483016014099,
0.7156391739845276,
0.1798463761806488,
0.3793734610080719,
-0.05845876410603523,
-0.4254577159881592,
-0.1176840290427208,
-1.082288146018982,
0.3162747621536255,
0.059524375945329666,
0.500332772731781,
0.21357490122318268,
0.8471325635910034,
... |
def test _ more _ hof ( a, b ) : def f ( g, h, x ) : return g ( x ) * h ( x ) * g ( x + 10. 0 ) def g ( x ) : return x * b def h ( x ) : return x * a return scala _ add ( f ( g, h, a ), f ( g, h, b ) ) | [
0.8909351229667664,
1.1173584461212158,
0.35105976462364197,
0.33719515800476074,
1.0141208171844482,
-0.3005349636077881,
-0.22610092163085938,
-0.8597003817558289,
0.18589484691619873,
-0.3000960946083069,
-0.31880098581314087,
0.12745124101638794,
0.3668177127838135,
-0.6561720371246338... |
def init _ value ( self ) : return [ self. get _ random _ gene ( ) for _ in range ( self. _ _ size ) ] | [
-0.7219362258911133,
-0.225490540266037,
0.5985903739929199,
0.2519257664680481,
0.6208693385124207,
-0.13320128619670868,
-0.666806697845459,
0.41102930903434753,
-0.3816385567188263,
-0.5825055837631226,
-1.1078767776489258,
1.0236985683441162,
0.10980399698019028,
0.7081987261772156,
... |
def get _ phix _ error _ rate ( self, name, lane, avg = true ) : fc = self. get _ entry ( name ) phix _ r1 = float ( fc ['illumina'] ['summary'] ['read1'] [ lane ] ['errratephix'] ) phix _ r2 = float ( fc ['illumina'] ['summary'] ['read3'] [ lane ] ['errratephix'] ) if avg : return ( phix _ r1 + phix _ r2 ) / 2 else : ... | [
-0.6108174920082092,
-0.012423811480402946,
0.6303622722625732,
-0.8544195294380188,
0.2619009017944336,
0.10941945761442184,
-1.1388522386550903,
0.6872861981391907,
-0.1731370985507965,
0.7870401740074158,
0.35530486702919006,
0.08501791954040527,
-1.200954556465149,
-0.0716259554028511,... |
def _ constructfromfetchqueuestatsresponse ( cls, queue, response ) : args = {'queue': queue,'tasks': response. num _ tasks } if response. oldest _ eta _ usec > = 0 : args ['oldest _ eta _ usec'] = response. oldest _ eta _ usec else : args ['oldest _ eta _ usec'] = none if response. hasfield ('scanner _ info') : scanne... | [
0.7182052731513977,
-0.9434021711349487,
0.5026759505271912,
-1.2861307859420776,
-0.5451855063438416,
-0.26266977190971375,
-0.44183626770973206,
-1.047399640083313,
0.011218936182558537,
-1.131478190422058,
0.24949198961257935,
-1.0146185159683228,
1.1376856565475464,
-0.0335910022258758... |
def z _ min ( self ) - > float : return 0 | [
0.5861188173294067,
-0.8448971509933472,
0.1298466920852661,
1.389219045639038,
0.03620803356170654,
0.48371732234954834,
0.5719414353370667,
-1.1853182315826416,
0.6323800683021545,
-0.736152708530426,
0.0009790521580725908,
-0.384054034948349,
-0.6740509867668152,
0.12589548528194427,
... |
def applyinpandaswithstate ( self, func : " pandasgroupedmapfunctionwithstate ", outputstructtype : union [ structtype, str ], statestructtype : union [ structtype, str ], outputmode : str, timeoutconf : str, ) - > dataframe : from pyspark. sql import groupeddata from pyspark. sql. functions import pandas _ udf assert ... | [
-1.0933451652526855,
-0.020793110132217407,
0.5227767825126648,
-0.09030108153820038,
-1.1930046081542969,
-0.588631272315979,
0.6970805525779724,
-0.3967265486717224,
0.3947277367115021,
-0.7014215588569641,
0.21129779517650604,
0.7663078308105469,
0.3473605811595917,
-0.4785686731338501,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.