text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def scooting _ player _ id ( player _ to _ scoot ) : listing = db. table ( " players " ). all ( ) for i in range ( len ( listing ) ) : if listing [ i ] [ " lastname " ] = = player _ to _ scoot. lastname and listing [ i ] [ " firstname " ] = = player _ to _ scoot. firstname : return listing [ i ] [ " identity " ] | [
-0.12952399253845215,
-0.6569331884384155,
0.6467559337615967,
0.4424765706062317,
0.20243076980113983,
0.03053220734000206,
0.22434014081954956,
0.27842751145362854,
0.921367347240448,
0.9180324673652649,
0.10751577466726303,
-0.2856126129627228,
-1.2245558500289917,
0.41407036781311035,
... |
def normalize ( data, vmin = none, vmax = none ) : if vmin is none : vmin = data. min ( ) if vmax is none : vmax = data. max ( ) if vmin = = vmax : return np. zeros _ like ( data ) else : return ( data - vmin ) / ( vmax - vmin ) | [
0.49088940024375916,
-0.2946596145629883,
0.5156875848770142,
0.5253345370292664,
-0.1707575023174286,
-0.08738157898187637,
-1.2495230436325073,
-0.09161616861820221,
1.0146918296813965,
0.11137555539608002,
-0.009200796484947205,
1.0092179775238037,
-0.9965943098068237,
-0.28848415613174... |
def _ is _ equal _ expressions ( v1, v2 ) : # initialize expression stack estack = [ [ v1, v2, - 1 ] ] # [ expr1, expr2, child index ] # loop while expression stack is not empty while estack : # get expressions to compare edscr = estack [ - 1 ] v1, v2, cx = edscr # print ( " compare { } ( type { } ) with { } ( type { }... | [
-0.45135512948036194,
-0.36334002017974854,
1.0519834756851196,
0.016018016263842583,
0.25790995359420776,
0.006033472716808319,
0.544340968132019,
-0.20624379813671112,
-0.19433535635471344,
1.3395617008209229,
-0.6949007511138916,
0.39478248357772827,
-0.35148829221725464,
-0.59286373853... |
def encode _ for _ env _ var ( value ) - > str : if isinstance ( value, str ) : return value elif isinstance ( value, bytes ) : return value. decode ( ) return str ( value ) | [
-0.38641032576560974,
-0.5945534706115723,
0.31094884872436523,
-0.24482394754886627,
-0.5374056696891785,
0.734280526638031,
-0.7376783490180969,
-1.2401256561279297,
0.14387530088424683,
0.24650061130523682,
0.7969841957092285,
1.1415408849716187,
-0.4840952157974243,
0.7716602683067322,... |
def translate _ text ( target _ language, text, model = " nmt " ) : from google. cloud import translate _ v2 as translate translate _ client = translate. client. from _ service _ account _ json ( translation _ key _ path + " / knowledge - bot - development - b8ed9d8c16cb. json " ) if isinstance ( text, six. binary _ ty... | [
-0.9993466138839722,
0.17009256780147552,
0.31881293654441833,
0.5795413851737976,
-0.5280702114105225,
-0.3295234143733978,
-1.0545713901519775,
-0.3573867678642273,
-0.6061132550239563,
-0.01924455165863037,
-1.227447271347046,
0.015674784779548645,
-0.719295859336853,
-0.271493256092071... |
def get _ platform _ state ( self ) : p = self. platform return fighterstate ( p. x, p. y, p. z, p. vx, p. vy, p. vz, p. ax, p. ay, p. az, p. z _ c, p. psi, p. psi _ c, p. theta, p. theta _ c, p. phi, p. phi _ c, p. v, p. v _ c, p. gload ) | [
0.5093482732772827,
-1.059317946434021,
0.5590494275093079,
-0.26724812388420105,
-0.15743669867515564,
0.43543267250061035,
-0.22187261283397675,
-0.4018538296222687,
-0.28634876012802124,
-0.2957606315612793,
-0.3438893258571625,
-0.42022788524627686,
-0.806512176990509,
0.16238407790660... |
def print _ versions ( ) : # from pkg _ resources import parse _ version from numexpr. cpuinfo import cpu import platform print ('- ='* 38 ) print ('numexpr version : % s'% numexpr. _ _ version _ _ ) print ('numpy version : % s'% np. _ _ version _ _ ) print ('python version : % s'% sys. version ) ( sysname, nodename, r... | [
0.5073254108428955,
-0.2928316295146942,
0.6740477085113525,
0.03319503739476204,
0.06175002083182335,
0.30808812379837036,
-0.10737844556570053,
-0.20642448961734772,
-1.0719292163848877,
0.25455135107040405,
-0.6712101697921753,
0.792032778263092,
-0.5312243103981018,
0.6893681883811951,... |
def decoder _ unit ( data, num _ filter, stride, dim _ match, name, bottle _ neck = 0, kernel = 3, dilation = 1, pad = 1, useup = false, irv2 = false, sqex = 1, bn _ mom = 0. 9, unitbatchnorm = false, workspace = 256, memonger = false ) : # # if 0 : use conventional conv3, 3 - conv3, 3 if bottle _ neck = = 0 : conv1 = ... | [
-0.19443556666374207,
0.2885272204875946,
0.8699918985366821,
0.6213563084602356,
-0.8038166761398315,
-0.21563373506069183,
0.7495940327644348,
0.5135737657546997,
0.49472710490226746,
0.1376328468322754,
-0.4515066146850586,
0.5105943083763123,
0.007803286891430616,
-0.4333549439907074,
... |
def login _ splash _ page ( *, picture ) : return ('< img src = " { } " id = " login - image " > '. format ( flask. session ['picture'] ) ) | [
-1.2034196853637695,
0.597966730594635,
0.3613191246986389,
0.0006593227153643966,
-0.5900528430938721,
0.49286139011383057,
-0.502373218536377,
-0.07250051200389862,
1.4846904277801514,
0.18253737688064575,
0.3473590910434723,
0.14239555597305298,
0.5171457529067993,
-0.4007839560508728,
... |
def _ compute _ loss ( x _ train, y _ train, x _ test, y _ test ) : num _ factors = y _ train. shape [ 0 ] train _ loss = [ ] test _ loss = [ ] for i in range ( num _ factors - 1 ) : prediction _ model = _ get _ prediction _ model ( args. prediction _ model ) prediction _ model. fit ( x _ train, y _ train [ i + 1, : ] ... | [
-1.5914970636367798,
-0.24249345064163208,
0.5754599571228027,
0.03791910782456398,
0.4170950949192047,
0.01120067946612835,
0.5011333227157593,
0.5847566723823547,
-1.012374997138977,
1.0214084386825562,
0.035553522408008575,
0.35215550661087036,
0.41058024764060974,
0.23550929129123688,
... |
def logging ( self ) : print ( " wait untill login... " ) # check if os is windows or linux and write proper path if os. name = = " nt " : chrome _ path = os. environ [ " userprofile " ] + " \ \ ch " + " \ \ chromedriver " else : chrome _ path = os. path. expanduser ( " ~ " ) + " / ch " + " / chromedriver " # setting u... | [
-0.33884164690971375,
-1.1715227365493774,
0.9831482172012329,
0.5439285635948181,
0.1431354284286499,
0.5872293710708618,
0.6956482529640198,
0.33060115575790405,
-0.18594114482402802,
0.2433110624551773,
-0.4391077160835266,
-0.08166047185659409,
-0.6564907431602478,
0.512143611907959,
... |
def get _ series _ data ( series _ name ) : series _ search _ url = api _ url +'/ singlesearch / shows? q ='+ series _ name logger. info ( " beginning a new search for'< % s >'", series _ name ) series _ data = requests. get ( series _ search _ url ) status _ code = series _ data. status _ code if status _ code = = 404... | [
-1.0750023126602173,
0.18722592294216156,
0.42910704016685486,
-0.09805172681808472,
-0.26346614956855774,
-0.059232357889413834,
-0.3564503788948059,
-0.9012205600738525,
0.4866255223751068,
0.008251811377704144,
-0.2080717384815216,
1.2000283002853394,
-0.0785563737154007,
-0.26297053694... |
def loop _ write ( self, max _ packets = 1 ) : print ( " loop _ write " ) if self. _ sock is none and self. _ ssl is none : return mqtt _ err _ no _ conn max _ packets = len ( self. _ out _ packet ) + 1 if max _ packets < 1 : max _ packets = 1 for i in range ( 0, max _ packets ) : rc = self. _ packet _ write ( ) if rc ... | [
-0.8404927849769592,
-0.1400579959154129,
0.5787964463233948,
0.014185311272740364,
-0.27607297897338867,
0.1468597948551178,
-0.1254306435585022,
-0.01578533835709095,
0.17705082893371582,
-0.2850760817527771,
0.12961755692958832,
-0.10086449980735779,
-0.7220929265022278,
0.0025435718707... |
def itkimageserieswriterirgbus3irgbus2 _ cast ( * args ) : return _ itkimageserieswriterpython. itkimageserieswriterirgbus3irgbus2 _ cast ( * args ) | [
-0.8183658719062805,
-0.38920578360557556,
0.12665605545043945,
-0.26353541016578674,
0.8611658811569214,
0.07484691590070724,
-0.42315226793289185,
0.12610924243927002,
0.1975831389427185,
0.701871395111084,
0.08417800813913345,
1.1950284242630005,
-0.9129959940910339,
-0.8292039036750793... |
def bbox ( self ) : return self. _ bbox | [
-0.340982586145401,
-0.40500324964523315,
0.5583539605140686,
-0.02667720429599285,
0.7099844217300415,
0.056494854390621185,
0.8028849363327026,
0.4602920711040497,
0.5763362646102905,
-1.7776559591293335,
0.19991570711135864,
1.2952384948730469,
-0.025346526876091957,
-0.5607749223709106... |
def _ _ init _ _ ( self, target _ area, area _ damping _ strength =. 8 ) : self. area _ damping _ strength = area _ damping _ strength self. target _ area = target _ area self. current _ state = st. sphere ( ) self. current _ sweep = 0 | [
-0.44098833203315735,
-0.6981254816055298,
0.4133126139640808,
-0.33143672347068787,
-0.45818859338760376,
0.2483387291431427,
0.5949955582618713,
0.7683303952217102,
1.3838136196136475,
0.16339026391506195,
0.0528898760676384,
0.34796610474586487,
0.4839327335357666,
0.68061763048172,
1... |
def modifier ( self, modifier ) : self. _ modifier = modifier | [
-1.7428631782531738,
-0.016316691413521767,
0.06432908773422241,
-0.1735140085220337,
-0.12916341423988342,
1.0563760995864868,
0.32069018483161926,
1.1011204719543457,
0.5467976331710815,
-0.7906695008277893,
-1.2238271236419678,
0.1238010972738266,
-0.1562374234199524,
1.1065491437911987... |
def execute _ grasp ( t _ grasp _ world, planner, gripper ) : def close _ gripper ( ) : " " " closes the gripper " " " gripper. close ( block = true ) rospy. sleep ( 1 ) def open _ gripper ( ) : " " " opens the gripper " " " gripper. open ( block = true ) rospy. sleep ( 1 ) # final _ position = np. asarray ( t _ grasp ... | [
-0.23392723500728607,
-1.018860936164856,
0.8301803469657898,
0.05126791074872017,
0.3600047826766968,
0.18039053678512573,
0.4451082646846771,
0.2650350034236908,
-0.26041296124458313,
-0.02511235885322094,
-0.10855119675397873,
-1.1579575538635254,
0.27197718620300293,
-0.268166691064834... |
def reg _ logistic _ regression ( y, tx, lambda _, initial _ w, max _ iters, gamma ) : w = initial _ w losses = [ ] threshold = 1e - 8 for i in range ( max _ iters ) : # compute gradient and normalize it grad = compute _ lg _ grad ( y, tx, w ) grad = grad + 2 * lambda _ * w grad = grad / np. linalg. norm ( grad ) w = w... | [
-0.15155836939811707,
0.052271198481321335,
0.6905207633972168,
-0.3973870873451233,
-0.15433964133262634,
-0.9773086905479431,
-0.3577319383621216,
0.16817167401313782,
-0.8203603625297546,
0.6237384080886841,
0.19640953838825226,
0.7366183996200562,
-0.5960614085197449,
0.082108370959758... |
def reset ( self ) : self. game _ mat = [ [ self. empty for _ in range ( self. mat _ size ) ] for _ in range ( self. mat _ size ) ] self. clear _ sums ( ) | [
0.40197107195854187,
0.40639159083366394,
0.5805601477622986,
-0.3239857852458954,
0.7992901802062988,
0.5380620360374451,
0.8206785321235657,
-0.9241096377372742,
-0.5409172177314758,
0.20925818383693695,
-0.20758908987045288,
0.5032217502593994,
0.26294687390327454,
-0.312566876411438,
... |
def unitvector ( x ) : xnorm = norm ( x ) if xnorm = = 0 : raise valueerror ( " can't normalise vector with length 0 " ) return x / norm ( x ) | [
-0.1622915267944336,
-0.09180053323507309,
0.41143378615379333,
-0.25766614079475403,
-0.029398789629340172,
0.6881764531135559,
0.4712885320186615,
0.29807403683662415,
1.1826601028442383,
-0.05373239517211914,
0.3163812756538391,
0.2376091033220291,
-0.3618490397930145,
-0.17658628523349... |
def plot _ maps ( self, time, radius, * * kwargs ) : defaults = dict ( deriv = 0, nmax = self. nmax ) kwargs = defaultkeys ( defaults, kwargs ) # remove keywords that are not intended for pcolormesh nmax = kwargs. pop ('nmax') deriv = kwargs. pop ('deriv') titles = [ f'$ b _ r $ ( $ n \ \ leq { nmax } $, deriv = { deri... | [
-0.07647977024316788,
0.27928122878074646,
0.8846684694290161,
-0.34126946330070496,
-0.5015369057655334,
0.1493052989244461,
-0.15663135051727295,
-0.6440140604972839,
-0.5234823226928711,
-0.18164785206317902,
-0.4355680048465729,
0.7131938338279724,
0.2991151809692383,
1.050502657890319... |
def test _ set _ item _ other _ value _ error ( self, monkeypatch ) : monkeypatch. setattr ( pennylane. data. base. mapper, " match _ obj _ type ", magicmock ( side _ effect = valueerror ( " something " ) ), ) with pytest. raises ( valueerror, match = " something " ) : attributetypemapper ( create _ group ( ) ). set _ ... | [
-0.5589959025382996,
0.3297821581363678,
0.4353821277618408,
0.2833438813686371,
0.1958225965499878,
0.33078306913375854,
-0.12141487002372742,
-0.7830061912536621,
0.10713506489992142,
0.20481298863887787,
-0.6768977046012878,
0.10307935625314713,
0.19436956942081451,
0.2051243931055069,
... |
def getlnpdf ( self, x ) : # - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | return binomialdistbase. getlnpdf ( self, x ) | [
-0.07943883538246155,
-0.7855629920959473,
0.4431852698326111,
-1.0968972444534302,
-0.6376163959503174,
-0.3577665388584137,
-1.2981640100479126,
-0.6873422265052795,
0.21310602128505707,
-0.6306875944137573,
-0.8293205499649048,
0.28576189279556274,
-0.6645296812057495,
-0.43767058849334... |
def get _ points _ on _ ellipse ( params _ ellipse, params _ points ) : x = params _ ellipse [ 0 ] * tf. cos ( params _ points ) \ + params _ ellipse [ 1 ] * tf. sin ( params _ points ) \ + params _ ellipse [ 2 ] y = params _ ellipse [ 3 ] * tf. cos ( params _ points ) \ + params _ ellipse [ 4 ] * tf. sin ( params _ po... | [
-0.15121027827262878,
0.11163787543773651,
0.39294755458831787,
-0.19834497570991516,
1.0052980184555054,
0.11759190261363983,
-0.3671843111515045,
1.4997724294662476,
-0.20974567532539368,
1.7088466882705688,
-0.5117626190185547,
0.09221296012401581,
0.5229066014289856,
-0.322954833507537... |
def get _ top ( subreddits, sort ='day') : # temp ='https : / / us6. proxysite. com / process. php? d = q9dy % 2bjkzhkqpxas9pb4rsgz % 2byceziwn6hmvdrd9dolran1gbfajfnttsfqyi1an0ln4vgwswh8q % 3d & b = 1 & f = norefer'subr _ dict = { } # populate dictionary for sr in subreddits : soup = bs ( rq. get ( base + sr + suffix +... | [
-0.3832562267780304,
0.31611698865890503,
0.93001788854599,
-0.7558971643447876,
-0.9667450189590454,
0.04928288236260414,
-0.5428102016448975,
-0.6532009840011597,
-0.6079555749893188,
0.09994610399007797,
-0.4744357466697693,
0.39719095826148987,
-0.2609524726867676,
0.4053814113140106,
... |
def test _ access _ token _ expiration ( self ) : response = self. _ auth _ request ('post ', self. data, is _ user _ authenticated = true ) self. assertin ('expires _ in = 36000 ', response ['location'] ) | [
0.5567442774772644,
-0.2108442634344101,
0.2858293652534485,
0.3230851888656616,
0.6109920740127563,
0.6065813899040222,
-0.8152162432670593,
0.6984531283378601,
0.5049311518669128,
-0.271931916475296,
-0.6671938896179199,
0.5798416137695312,
0.5364313125610352,
-0.3454091548919678,
-0.1... |
def options _ posed ( self ) - > list [ optionresults ] : return self. _ options _ posed | [
-0.43765807151794434,
-0.05487451329827309,
0.32127293944358826,
0.5911934971809387,
1.6429001092910767,
0.3989444673061371,
0.2651202380657196,
-1.1963545083999634,
0.5291650295257568,
-0.1929280012845993,
-0.9331573843955994,
0.039896607398986816,
-0.0850217342376709,
0.15438677370548248... |
def get ( self, post _ id ) : if self. user : post = post. get _ by _ id ( int ( post _ id ) ) if not post : self. error ( 404 ) if post. user. key ( ). id ( ) = = int ( self. user ) : self. render ( " edit _ blog. html ", post = post ) else : error = " you cannot edit this post. " self. render ( " edit _ blog. html ",... | [
0.41390860080718994,
0.3271997272968292,
0.5940045714378357,
1.3068112134933472,
0.16144947707653046,
-0.2885349988937378,
-0.03230161964893341,
0.5015857815742493,
0.39292290806770325,
0.34401199221611023,
0.8480358123779297,
0.8563647270202637,
-0.11786118894815445,
0.04700499773025513,
... |
def test _ post _ _ not _ author ( self ) - > none : self. client. force _ login ( self. other _ user ) response = self. client. post ( reverse ('question - update ', kwargs = dict ( pk = self. question. pk ) ), data = dict ( title ='this is a title updated ', body ='this is an updated body ', ) ) assert httpstatus. fo... | [
-0.17674417793750763,
-0.024289220571517944,
0.7211834788322449,
1.296437382698059,
-0.4923083484172821,
1.6732466220855713,
-0.17841796576976776,
-0.8003243207931519,
0.00819094106554985,
-0.3333992063999176,
-0.1913437694311142,
0.07999956607818604,
-0.5361605286598206,
0.099285088479518... |
def get _ path _ up ( self, lowest _ node, ancestor _ node ) : intermediate _ level = [ ] for tax in lowest _ node. iter _ ancestors ( ) : if tax = = ancestor _ node : break intermediate _ level. append ( tax ) return intermediate _ level | [
0.3502737581729889,
-0.4425627887248993,
0.6470653414726257,
-0.010217376984655857,
0.8550648093223572,
0.2284800261259079,
0.12231580168008804,
-0.029535911977291107,
-1.4901682138442993,
1.1731674671173096,
0.3631358742713928,
1.1627540588378906,
-0.1438910961151123,
-0.5810850262641907,... |
def spl ( precomputed _ spl, scaler ) : return np. nanmean ( precomputed _ spl, axis = 0 ) / scaler | [
0.1817697435617447,
-0.2061314433813095,
0.175052672624588,
0.04611961171030998,
-1.3418645858764648,
0.3696468770503998,
0.73762446641922,
-0.06539487838745117,
0.3422960042953491,
0.3010616898536682,
-0.3684142529964447,
0.3247015178203583,
0.36406198143959045,
0.8654453158378601,
0.42... |
def write _ my _ text ( my _ text ) : # write in a1 active _ sheet. getcellrangebyname ( " a1 " ). string = my _ text | [
-0.4768907129764557,
-1.5387377738952637,
0.29617545008659363,
0.11029797792434692,
-0.3306826055049896,
0.7470598220825195,
0.2424524426460266,
0.7411506175994873,
0.0355212464928627,
0.5336980223655701,
-0.4849454462528229,
0.0623333640396595,
-0.6238697171211243,
-0.1754305064678192,
... |
def openofdviewer ( self ) : self. dir = str ( self. ui. dirstring. text ( ) ) self. currentframe = int ( self. ui. input _ singleframe. toplaintext ( ) ) self. state = str ( self. ui. statestring. text ( ) ) self. data = load ( directory = self. dir ) self. processer = post ( ) self. directorychosen = 1 viewer = ofdvi... | [
-0.7832713723182678,
0.13563673198223114,
0.5343340039253235,
-0.4379429519176483,
-0.8864162564277649,
-0.3725503385066986,
0.8145712614059448,
0.3814493715763092,
0.24665096402168274,
-1.7451492547988892,
0.575706958770752,
0.7575761079788208,
0.3354142904281616,
0.8603280186653137,
0.... |
def translate ( text, comment ='' ) : try : frame = sys. _ getframe ( 1 ) filename = frame. f _ code. co _ filename finally : del frame context = os. path. basename ( os. path. splitext ( filename ) [ 0 ] ) return unicode ( qtcore. qcoreapplication. translate ( context, text, comment ) ) | [
0.4899032413959503,
-0.6132599115371704,
0.585666835308075,
0.18939347565174103,
-0.8381665349006653,
-0.1657707393169403,
0.45313456654548645,
0.2731373608112335,
0.38073691725730896,
-0.01991618610918522,
-0.7181913256645203,
-0.28220608830451965,
-0.7692676186561584,
-0.9280140995979309... |
def opensimpointfile ( sp _ file, type _ str ) : fp = openfile ( sp _ file, type _ str ) line = ensure _ string ( fp. readline ( ) ) field = line. split ( ) if not util. isint ( field [ 0 ] ) : err _ msg ( type _ str + sp _ file ) fp. seek ( 0, 0 ) return fp | [
0.5154979228973389,
-0.6879627704620361,
0.5426919460296631,
0.19264794886112213,
-0.5975984334945679,
0.6950454115867615,
0.7721414566040039,
0.277435302734375,
0.09971453994512558,
0.21170522272586823,
0.7079045176506042,
-0.15707044303417206,
-0.6024405360221863,
-1.184520959854126,
0... |
def nt _ freq _ 2 _ aa _ freq ( df _ nt, frame, bam _ file = none ) : from itertools import product df _ nt = df _ nt. sort _ values ( by = ['pos ','freq'], ascending = [ true, false ] ) min _ pos, max _ pos = min ( df _ nt. pos ), max ( df _ nt. pos ) assert max _ pos - min _ pos = = 2, df _ nt codon _ number = 1 + in... | [
-0.3532956540584564,
0.00373645662330091,
0.7257270216941833,
0.05880722403526306,
0.0024785238783806562,
-1.274651050567627,
0.41358494758605957,
-0.4169071316719055,
0.543370246887207,
0.4524818956851959,
-0.6894904375076294,
-0.4639109969139099,
0.9281507730484009,
0.020618027076125145,... |
def _ _ str _ _ ( self ) : rstring ='|'for down in range ( self. n ) : if down > 0 : rstring + = " \ n " + " | " for along in range ( self. m ) : rstring + = ( str ( self. from _ grid [ down ] [ along ] ) + " | " ) return rstring | [
0.20702220499515533,
-0.6405842304229736,
0.7760236859321594,
0.027912696823477745,
-1.0228859186172485,
0.6790264248847961,
-0.3309648334980011,
-0.6162970662117004,
-0.8951472640037537,
-0.0247962586581707,
1.5836595296859741,
-0.04992173612117767,
-0.1664917767047882,
0.316249281167984,... |
def set _ if _ branch ( self, flag ) : self. if _ stack [ - 1 ]. in _ true = flag self. if _ stack [ - 1 ]. seen _ true | = flag | [
0.006869049742817879,
0.7551892399787903,
0.6145692467689514,
0.551026463508606,
0.49630656838417053,
0.5910707712173462,
0.5223564505577087,
0.2392807900905609,
-1.02544105052948,
0.2551247775554657,
-0.9696449637413025,
0.729864239692688,
-0.9415455460548401,
0.7720736265182495,
-0.006... |
def _ get _ short _ name ( self, volume _ name ) : return volume _ name [ : 32 ] | [
0.7541991472244263,
-0.6316841244697571,
0.6453350782394409,
-0.7214767336845398,
-0.6249166131019592,
0.5144079327583313,
-0.7264518737792969,
-1.0061523914337158,
0.149447962641716,
0.3168780207633972,
0.5004533529281616,
0.09268151223659515,
0.38833481073379517,
-0.8316131234169006,
1... |
def _ retries ( func ) : def dec ( func ) : def f2 ( * args, * * kwargs ) : mydelay = retries _ delay for tries in range ( max _ retries ) : try : return func ( * args, * * kwargs ) except servererror as e : if tries > = max _ retries - 1 : raise else : time. sleep ( mydelay ) mydelay = mydelay * retries _ backoff else... | [
0.6130396723747253,
0.6801759600639343,
0.6175143122673035,
-0.5030441880226135,
-0.619130551815033,
-0.2537936866283417,
-0.0012431686045601964,
0.2807604968547821,
-0.5126627683639526,
-0.6980270147323608,
0.526651918888092,
0.39478856325149536,
0.16474054753780365,
-0.41831180453300476,... |
def sent _ email ( name, to, subject ) : try : host = config. get ('default ','host') from = config. get ('default ','email') password = config. get ('default ','password') msg = mimemultipart ('alternative') msg ['subject'] = subject msg ['from'] = from msg ['to'] = to message = " " " добрыи день, % s! прошу ознакомит... | [
-0.516816258430481,
-0.5015996694564819,
0.6756364703178406,
-0.07773466408252716,
-0.42538103461265564,
0.2372073233127594,
-0.3949618935585022,
-0.41641250252723694,
-1.0027858018875122,
1.4123402833938599,
-1.363181710243225,
0.6058812141418457,
-0.04074213281273842,
-0.1523187011480331... |
def column _ names ( self ) - > list [ str ] : return self. _ data. column _ names | [
-0.5335037112236023,
-0.40488147735595703,
0.12516598403453827,
0.4295734167098999,
0.9154806733131409,
0.5614933967590332,
-0.7998887896537781,
-0.19421982765197754,
0.031196342781186104,
0.007818515412509441,
-1.4070686101913452,
0.5513484477996826,
0.8163268566131592,
-0.427278906106948... |
def load _ data ( self ) : with open ( self. file _ name ) as f : lines = f. readlines ( ) labels = list ( ) all _ dat = list ( ) for i, l in enumerate ( lines ) : labels. append ( int ( l [ 0 ] ) ) l = gensim. utils. any2unicode ( l ) all _ dat. append ( labeledsentence ( l. split ( " \ t " ) [ - 1 ], [ i ] ) ) return... | [
-0.5757565498352051,
-1.2423630952835083,
0.557897686958313,
-0.9699124693870544,
0.2670139670372009,
0.5018275380134583,
-0.9179796576499939,
0.8200490474700928,
-0.5345165729522705,
0.624904453754425,
-0.028512274846434593,
0.23647256195545197,
-0.15854313969612122,
0.5456697940826416,
... |
def following _ count ( self, following _ count ) : self. _ following _ count = following _ count | [
0.29731616377830505,
-0.2551261782646179,
0.041050318628549576,
0.9044029712677002,
-0.8931577801704407,
1.3000309467315674,
0.7125066518783569,
-0.05270824581384659,
-1.2006605863571167,
-0.45945170521736145,
-0.6384767293930054,
-0.5888738632202148,
-0.15115971863269806,
0.75328725576400... |
def ordered _ predictions ( xs, ys, preds, reverse = false ) : assert len ( xs ) = = len ( ys ) = = len ( preds ) return list ( zip ( * [ ( x, y, z ) for x, y, z in sorted ( zip ( xs, ys, preds ), key = lambda pair : pair [ 2 ], reverse = reverse ) ] ) ) | [
-0.8402590751647949,
-0.547247052192688,
0.6143608093261719,
0.5275245308876038,
-0.08644970506429672,
-0.14848579466342926,
-0.773061990737915,
0.49792999029159546,
-1.0407063961029053,
0.7036796808242798,
-0.47914937138557434,
0.6756398677825928,
0.6560713648796082,
-0.18852709233760834,... |
def train _ agent ( env : unityagents. unityenvironment, agent : agents. ddpgagent, n _ episodes : int = 200, mean _ score _ threshold : float = 30. 0, max _ t : int = 1000, has _ ou _ noise : bool = true, logging _ freq : int = 10, scores _ maxlen : int = 100 ) - > typing. list [ float ] : logger = logging. getlogger ... | [
-0.984046220779419,
0.21035416424274445,
0.8434953093528748,
-0.008463302627205849,
0.5339593291282654,
-0.6104090809822083,
-0.11309462040662766,
-0.19317160546779633,
-0.07746019214391708,
1.4450923204421997,
-0.32200154662132263,
0.3868449628353119,
0.3546982705593109,
0.616023421287536... |
def recursive _ bfs ( self, node ) : self. nodes [ - 1 ]. append ( self. format _ node ( node ) ) if'children'in node : for child in node ['children'] : self. recursive _ bfs ( child ) | [
-0.3541775643825531,
0.9020918607711792,
0.7266308665275574,
0.47896844148635864,
0.5539119243621826,
-0.16047337651252747,
-0.47545260190963745,
-0.6781277060508728,
0.8092628717422485,
-0.5682913064956665,
-0.3026752173900604,
0.20541125535964966,
-0.04604574665427208,
1.2804572582244873... |
def test _ vasp _ calc _ error _ suppress ( run _ vasp _ process ) : results, node = run _ vasp _ process ( test _ case ='exit _ codes / converged - with - error ', settings = {'parser _ settings': {'critical _ notifications': {'add _ brmix': false } }, }, ) # check that the standard output is there assert'retrieved'in... | [
1.0241576433181763,
0.15483231842517853,
0.42761847376823425,
0.24244646728038788,
0.49938973784446716,
0.7891911268234253,
-0.29173481464385986,
0.3724460303783417,
0.10196185111999512,
-0.3657694160938263,
-0.993158221244812,
-0.5760669708251953,
-0.1382482945919037,
-0.02489811740815639... |
def json _ exists ( file _ name ) : if os. path. exists ( file _ name ) : return file _ name else : raise filenotfounderror ( " file with name { } doesn't exist ". format ( file _ name ) ) | [
-0.21592962741851807,
-1.3217952251434326,
0.8661035895347595,
-0.8207200765609741,
0.06063564494252205,
0.9547428488731384,
-0.3185133934020996,
0.04747995734214783,
-1.020463228225708,
1.3980146646499634,
0.35707640647888184,
-0.15621644258499146,
0.961965024471283,
0.12827034294605255,
... |
def pack ( self, x ) : return np. dstack ( ( np. zeros ( ( x. shape [ 0 ], 4, 3 ) ), x ) ) | [
-0.4010620713233948,
1.6443067789077759,
0.5009889006614685,
0.3968331813812256,
0.25596141815185547,
0.5186073184013367,
-0.7211501598358154,
-0.8458830118179321,
1.0949032306671143,
0.19619856774806976,
-0.9894997477531433,
-0.3238658308982849,
-0.2978746294975281,
-0.3702126145362854,
... |
def run _ basic _ tests ( ) : load _ data ( ) show _ hash _ functions ( ) show _ set _ functions ( ) show _ geo _ functions ( ) | [
0.17928194999694824,
0.8437685370445251,
0.2800139784812927,
0.14724718034267426,
0.6747182011604309,
0.43853700160980225,
0.28292834758758545,
-0.7849161624908447,
-0.012750064954161644,
-0.9787747859954834,
-0.5879126191139221,
0.2332713007926941,
0.2355465143918991,
-0.23027580976486206... |
def cube _ points ( c, wid ) : p = [ ] # bottom p. append ( [ c [ 0 ] - wid, c [ 1 ] - wid, c [ 2 ] - wid ] ) p. append ( [ c [ 0 ] - wid, c [ 1 ] + wid, c [ 2 ] - wid ] ) p. append ( [ c [ 0 ] + wid, c [ 1 ] + wid, c [ 2 ] - wid ] ) p. append ( [ c [ 0 ] + wid, c [ 1 ] - wid, c [ 2 ] - wid ] ) p. append ( [ c [ 0 ] - ... | [
0.3904339373111725,
-0.17715510725975037,
1.0972068309783936,
-1.0883780717849731,
-0.413971483707428,
0.7655708193778992,
0.5386708974838257,
0.06923053413629532,
-0.18381503224372864,
1.0769212245941162,
-0.3216244578361511,
0.5354312658309937,
-0.5389964580535889,
0.11072459071874619,
... |
def getstartindex ( self ) : return _ itkimageserieswriterpython. itkimageserieswriterid3id2 _ getstartindex ( self ) | [
0.03382717818021774,
-0.789915919303894,
0.22598862648010254,
-0.16883309185504913,
0.005555498413741589,
0.30608001351356506,
-0.30534887313842773,
0.2579362690448761,
0.20872828364372253,
0.5482393503189087,
-1.091422438621521,
0.9599957466125488,
-0.5990641117095947,
-0.5378468632698059... |
def haseditors ( self ) : return len ( self. editors ) > 0 | [
-0.9766137599945068,
-0.5891293883323669,
0.24455299973487854,
-0.4833076596260071,
0.5145725607872009,
-0.6232419013977051,
-1.1223915815353394,
1.0096888542175293,
-0.3868319094181061,
-0.7727131247520447,
-0.11523585021495819,
-0.059095047414302826,
-0.4837017059326172,
1.14438724517822... |
def binarize _ data ( self, x ) : x _ data _ copy = none if np. any ( x. data! = 1. 0 ) : x _ data _ copy = x. data x. data = np. ones ( x _ data _ copy. shape ) return x, x _ data _ copy | [
-0.26328060030937195,
-0.1193271055817604,
0.5581064224243164,
0.41035768389701843,
0.5187375545501709,
0.6722103357315063,
0.03425159305334091,
0.030903784558176994,
0.61810702085495,
0.044272564351558685,
-0.35066547989845276,
0.6458095908164978,
-0.421404093503952,
0.6001505851745605,
... |
def timestamp _ gen ( file _ ext = false ) : current _ time = datetime. datetime. now ( ) if file _ ext : return current _ time. isoformat ('_') else : return current _ time. ctime ( ) | [
-0.8620975017547607,
-0.024346228688955307,
0.7887470722198486,
-0.11764925718307495,
-0.48352017998695374,
1.1869888305664062,
-0.7905963659286499,
0.8317087292671204,
-1.0553745031356812,
1.190983772277832,
0.10954724997282028,
-0.7943984270095825,
0.3793743848800659,
0.19516882300376892... |
def cb _ norminvgam ( val ) : alpha = salpha. val beta = sbeta. val gamma = sgamma. val delta = sdelta. val global priornorminvgam global maxmp _ x global maxmp _ y global normml global normmap global posteriornorminvgam global x _ cat global mu _ ml global var _ ml global num _ samples mu = smu. val var = svar. val # ... | [
0.4153750240802765,
-0.10224452614784241,
0.6500979661941528,
0.1524915099143982,
-0.719172477722168,
0.32386383414268494,
0.41669902205467224,
-0.009462576359510422,
0.1324354112148285,
-0.18100455403327942,
0.5849680304527283,
1.1377049684524536,
-0.7502785325050354,
0.6138690710067749,
... |
def wtf _ exit _ json ( self, * * kwargs ) : self. add _ path _ info ( kwargs ) kwargs. setdefault ('changed ', false ) kwargs. setdefault ('invocation ', {'module _ args': self. params } ) kwargs = ansible. module _ utils. basic. remove _ values ( kwargs, self. no _ log _ values ) self. do _ cleanup _ files ( ) raise ... | [
-0.5221441984176636,
-0.374843567609787,
0.7241845726966858,
-0.3152698576450348,
0.19361943006515503,
-0.019930876791477203,
-0.03993229940533638,
-0.012627976946532726,
-0.9791133999824524,
0.9230198860168457,
-0.39641138911247253,
0.3726131021976471,
0.07172110676765442,
1.1025252342224... |
def _ validate ( self ) : if len ( self. _ ndarray ) and not lib. is _ string _ array ( self. _ ndarray, skipna = true ) : raise valueerror ( " stringarray requires a sequence of strings or pandas. na " ) if self. _ ndarray. dtype! = " object " : raise valueerror ( " stringarray requires a sequence of strings or pandas... | [
-0.8683843016624451,
-0.5530663728713989,
0.6544951796531677,
-0.4877704977989197,
0.19752532243728638,
0.1282716989517212,
0.6464463472366333,
-0.20115743577480316,
-0.21983768045902252,
-0.13355252146720886,
0.8999356627464294,
0.4596899151802063,
0.33525368571281433,
0.41854503750801086... |
def _ show _ selection ( self, text, bbox ) : x, y, width, height = bbox textw = self. _ font. measure ( text ) canvas = self. _ canvas canvas. configure ( width = width, height = height ) canvas. coords ( canvas. text, width - textw, height / 2 - 1 ) canvas. itemconfigure ( canvas. text, text = text ) canvas. place ( ... | [
0.6075087189674377,
-0.053269580006599426,
0.5110219717025757,
-1.6088193655014038,
-0.6591913104057312,
0.13130377233028412,
0.38101693987846375,
-0.0773012787103653,
0.7201056480407715,
0.3400591015815735,
0.8299244046211243,
0.29367882013320923,
0.17392899096012115,
-0.6694255471229553,... |
def multi ( a, x ) : c = [ ] for i in range ( len ( a ) ) : c. append ( sum ( a [ i ] [ j ] * x [ j ] for j in range ( len ( a [ 0 ] ) ) ) ) return c | [
0.10245662927627563,
0.465896338224411,
0.8846473097801208,
0.24532774090766907,
0.07732534408569336,
-0.6254727840423584,
-0.2186550498008728,
0.3229067027568817,
0.8290791511535645,
0.7614017128944397,
-0.947910726070404,
-0.38807207345962524,
0.8418898582458496,
0.4969448447227478,
-0... |
def test _ counttestcases ( self ) : self. assertequal ( self. holder. counttestcases ( ), 0 ) | [
0.4535749554634094,
-0.08908812701702118,
0.15479514002799988,
1.0979962348937988,
1.5975573062896729,
1.5176022052764893,
0.9622494578361511,
-0.007063950877636671,
0.9548399448394775,
-1.1059881448745728,
0.09501110762357712,
-1.0633108615875244,
-0.43572762608528137,
0.6754796504974365,... |
def scan _ xml ( input _ path, file _ name ) : rooms = [ ] # os. path. walk is deprecated and removed in python3, use os. walk ( ) instead for absolute _ path, folders, files in os. walk ( input _ path ) : if file _ name in files : with open ( os. path. join ( absolute _ path, file _ name ), " r " ) as f _ handle : roo... | [
-0.7076758146286011,
-0.6441525816917419,
0.5643845200538635,
0.45746952295303345,
-1.2038631439208984,
0.3611844480037689,
-0.17740900814533234,
0.005649768281728029,
-0.7964096665382385,
0.162760928273201,
-0.32976290583610535,
-0.6661516427993774,
-0.24738359451293945,
0.553138375282287... |
def blood _ sugar ( self ) : text _ from _ xml, ids, eng _ list = self. util. get _ text _ from _ xml ( self. string _ xml, " testmyblood ", " trans - unit ", config. selected _ language. strip ( ) ) xpath = self. util. read _ xpath _ list _ from _ xml ( self. object _ repo, " testmybloodsugar ", self. my _ object ) xp... | [
-0.25066491961479187,
0.04421178624033928,
0.8137630820274353,
0.13187327980995178,
-0.06256644427776337,
0.22306877374649048,
0.5637646317481995,
-0.4320531487464905,
0.08888790011405945,
-0.23762552440166473,
0.3352935314178467,
0.18733163177967072,
-1.0204249620437622,
0.280170261859893... |
def comments _ count ( content _ object ) : return get _ comments _ for _ model ( content _ object ). count ( ) | [
0.21774938702583313,
-1.2156264781951904,
0.43882089853286743,
-0.6901026368141174,
0.9257578253746033,
-0.07057930529117584,
0.5952067971229553,
-0.853301465511322,
-1.09029221534729,
0.29394418001174927,
-1.1255279779434204,
-0.8554534912109375,
0.15802030265331268,
-0.22797128558158875,... |
def test _ get _ register _ classification _ description ( self ) : description = self. strategy. get _ register _ classification _ description ( ) assert type ( description ) = = description assert description. data _ model is agent _ personality _ model assert description. values. get ( " piece ", " " ) = = " classif... | [
-0.42913028597831726,
0.9471801519393921,
0.21212154626846313,
0.01165740005671978,
1.2056965827941895,
0.21546372771263123,
-0.24601197242736816,
0.12267779558897018,
-0.30365580320358276,
0.25164926052093506,
-0.2596285939216614,
1.4362386465072632,
0.3702406585216522,
0.2343311905860901... |
def generate _ textbox _ keystroke _ template ( specifics : dict, placeholders : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders, meta = {'key - id':'{ { key - id } }'} ) template ['action - type'] ='keystroke'return template | [
-0.5732832551002502,
0.44704315066337585,
0.2042318731546402,
-1.2425858974456787,
-0.02812708541750908,
-0.17998634278774261,
-1.213954210281372,
0.7704911828041077,
-0.26732757687568665,
1.1238933801651,
-0.4506431818008423,
-0.01598493568599224,
0.36944177746772766,
-0.2627353072166443,... |
def score _ table ( df ) : df = df. assign ( homepoints = np. select ( [ df [ " score1 " ] > df [ " score2 " ], df [ " score1 " ] < df [ " score2 " ] ], [ 3, 0 ], default = 1, ), awaypoints = np. select ( [ df [ " score2 " ] > df [ " score1 " ], df [ " score2 " ] < df [ " score1 " ] ], [ 3, 0 ], default = 1, ), homegd ... | [
0.2858418822288513,
0.4835037589073181,
1.1269302368164062,
-0.27505558729171753,
-0.024382615461945534,
0.680533230304718,
0.7107630372047424,
-0.8153998255729675,
-0.6682062745094299,
1.4617565870285034,
0.42100393772125244,
-0.046873558312654495,
0.4592888653278351,
-0.747841477394104,
... |
def update ( self, request, slug ) : user = request. user try : article = article. objects. get ( slug = slug ) except exception : raise notfound ('an article with this slug does not exist.') # removes the user from the list of liking users, # nothing changes if the user does not exist in the list of liking # users art... | [
-0.4801580011844635,
-0.7270306944847107,
0.5854864716529846,
0.08301208913326263,
-0.2248075157403946,
0.04290979728102684,
0.12510457634925842,
0.7276015877723694,
0.14491486549377441,
0.3560328185558319,
-0.2695711851119995,
0.40632927417755127,
-0.7516518831253052,
0.13246501982212067,... |
def _ update _ dvpg ( gt, dvs, pg _ ref, config _ version, port _ config ) : dvs. update _ dvportgroup ( pg _ ref, config _ version, port _ config ) | [
-1.7491580247879028,
0.4329812824726105,
0.4342394769191742,
-0.28597331047058105,
-0.21233275532722473,
0.15862233936786652,
-0.3736547827720642,
-0.08715678751468658,
-0.7180532813072205,
1.4962514638900757,
0.4384390413761139,
0.5441785454750061,
-0.3267201781272888,
-0.2430299371480941... |
def elapsed _ milliseconds ( self ) - > int : if self. _ elapsed _ time is none : raise timererror ( f " timer is not running. use. start ( ) to start it " ) return int ( self. _ elapsed _ time * 1000 ) | [
0.6188125014305115,
-0.24878479540348053,
0.40791040658950806,
-0.11676235496997833,
0.3397805392742157,
0.1747952103614807,
0.27895689010620117,
1.191377878189087,
0.2978722155094147,
-0.7256965637207031,
0.013744480907917023,
0.13565516471862793,
-0.2783967852592468,
1.6143571138381958,
... |
def invert ( image ) : lut = [ ] for i in range ( 256 ) : lut. append ( 255 - i ) return _ lut ( image, lut ) | [
-1.3959581851959229,
-0.3642285466194153,
0.4377095699310303,
0.18158580362796783,
-0.6235543489456177,
-0.3830459713935852,
-0.2489343136548996,
-0.023397888988256454,
-0.09372992068529129,
0.06613321602344513,
-0.8866747617721558,
-0.3856359124183655,
-1.0798003673553467,
0.3131778836250... |
def discrim _ report _ func ( epoch, batch, num _ batches, start _ time, lr, report _ stats ) : if batch % opt. report _ every = = - 1 % opt. report _ every : report _ stats. output _ loss ( epoch, batch + 1, num _ batches, start _ time ) if opt. exp _ host : report _ stats. log ( " progress ", experiment, lr ) report ... | [
0.7001366019248962,
0.5232751965522766,
0.4149205684661865,
0.47988635301589966,
-0.0829286053776741,
-0.4490906894207001,
0.14118008315563202,
0.1497698873281479,
-0.22140145301818848,
-0.5625674724578857,
0.9977736473083496,
-0.3822564482688904,
-0.373849481344223,
0.09307687729597092,
... |
def _ _ set _ font ( self, widget, fuente ) : if self. fuente! = fuente : self. fuente = fuente self. preview. modify _ font ( pango. fontdescription ( " % s % s " % ( self. fuente, self. tamanio ) ) ) | [
0.24705304205417633,
0.49338841438293457,
0.41242125630378723,
-0.06336700916290283,
0.03274340555071831,
-0.9075105786323547,
-1.579292893409729,
0.4757581353187561,
0.29715490341186523,
-0.5748955607414246,
-0.04644538462162018,
0.6223770380020142,
0.26647260785102844,
0.8828859329223633... |
def negation ( dnf _ clause ) : return [ [ - x ] for x in dnf _ clause ] | [
-1.8913118839263916,
-0.029232166707515717,
0.42174074053764343,
0.1304294615983963,
0.5757051706314087,
-0.24557147920131683,
-1.5093095302581787,
0.6294785737991333,
-0.6042630672454834,
0.6991838216781616,
-1.0323761701583862,
0.04915117844939232,
-0.08466364443302155,
-0.47084742784500... |
def multi _ formatter ( self, list _ text, filler = " ", centered = true, indented = false ) : output = " " for line in list _ text : output + = self. formatter ( line, filler = filler, centered = centered, indented = indented ) + " \ n " return output | [
-0.1235506683588028,
-1.0172735452651978,
0.6082794070243835,
0.5277416706085205,
-0.45899561047554016,
-1.033435583114624,
-1.5813164710998535,
0.989094078540802,
0.6105301976203918,
-0.2334754765033722,
-0.3712172210216522,
-0.6651187539100647,
-0.4265923500061035,
2.434414863586426,
-... |
async def set _ or _ create _ apitoken ( self, token _ type = " user " ) : resp = await self. get _ apitokens ( ) if resp. status = = " success " : for x in resp. response : if x. token _ type = = token _ type : self. _ apitoken = x resp. response = x return resp # if we get here, then we don't have a token of the righ... | [
-1.0021814107894897,
-0.48690173029899597,
0.45733869075775146,
-0.21813030540943146,
1.0991907119750977,
-0.6258448362350464,
-0.5816149115562439,
0.07468942552804947,
1.0133620500564575,
-0.513627290725708,
-0.37334057688713074,
0.0638747587800026,
-0.5389754772186279,
0.0410842224955558... |
def print _ close _ matches ( self ) : print ( " occurences of " + str ( self. pattern ) + " or similar : " ) for match in self. matches : print ( " pattern " + str ( match. pattern ) + " appears in " + str ( match. first _ note. metadata. title ) + " part " + str ( match. first _ note. part ) + " beginning in measure ... | [
0.4600590169429779,
-0.9494993686676025,
1.1949621438980103,
-1.0255504846572876,
0.5814104676246643,
1.2004624605178833,
1.0377832651138306,
-0.3834879398345947,
-0.6848657727241516,
-0.5432629585266113,
0.47974908351898193,
0.6855520606040955,
-0.8108770847320557,
0.03006354346871376,
... |
def schedule _ job ( self, image : image, command : list [ str ], name : jobname, resources _ dict : resources, env : list [ str ], uid : optional [ int ], gid : optional [ int ], mountdir : optional [ str ] = none ) - > j :... | [
-0.19008034467697144,
-0.2581968307495117,
0.34281858801841736,
0.10175538063049316,
-0.20684804022312164,
-0.6227734684944153,
-0.6624416708946228,
0.2040967494249344,
-0.3935435116291046,
-0.1110973134636879,
0.19306625425815582,
0.1696457415819168,
-0.35046547651290894,
0.42585316300392... |
def _ _ len _ _ ( self ) : return self. n | [
-0.395052969455719,
-0.5643819570541382,
0.3115909695625305,
-1.099969744682312,
0.5524385571479797,
0.3297126591205597,
0.3887478709220886,
0.22880376875400543,
0.8127983212471008,
-1.2851135730743408,
-1.2337777614593506,
-0.22478923201560974,
0.801773726940155,
-0.2225557118654251,
0.... |
def test _ setup _ template _ with _ opts ( self ) : self. render _ config ( ) exit _ code = self. run _ beat ( logging _ args = [ " - v ", " - d ", " * " ], extra _ args = [ " setup ", self. cmd, " - e ", " setup. ilm. enabled = false ", " - e ", " setup. template. settings. index. number _ of _ shards = 2 " ] ) asser... | [
-1.0851075649261475,
0.7383015155792236,
0.6775428056716919,
-0.5141294002532959,
0.7129344344139099,
-0.49599605798721313,
0.30189672112464905,
-0.11826339364051819,
-0.1739245355129242,
0.5830590724945068,
-0.31719306111335754,
-0.3420787751674652,
-0.5634905099868774,
-0.771606564521789... |
def test _ area _ events ( self ) : events = events ( bot ( ) ) # action counts say = say ( text ='hi') events ( say ) self. asserttrue ( events ['counts. action. say. n'] = = 1 ) events ( say ) self. asserttrue ( events ['counts. action. say. n'] = = 2 ) # intent counts intent = echo ( message = message ( text ='hi') ... | [
0.27561044692993164,
-0.08229563385248184,
0.768264889717102,
-0.1488058865070343,
0.7825381755828857,
0.5211416482925415,
0.7309616804122925,
-0.4253891706466675,
0.4420200288295746,
-0.49785682559013367,
-0.08212952315807343,
0.022356003522872925,
0.3725161552429199,
0.8429337739944458,
... |
def get _ plant _ id _ for _ resources ( resources, grid ) : resources = _ check _ resources _ are _ in _ grid _ and _ format ( resources, grid ) plant = grid. plant plant _ id = plant [ ( plant. type. isin ( resources ) ) ]. index return set ( plant _ id ) | [
0.20367802679538727,
-0.4005871117115021,
0.2250092476606369,
-0.2811989486217499,
0.44166839122772217,
-0.3299115002155304,
0.07146992534399033,
-0.5212269425392151,
-0.35062429308891296,
0.5610688328742981,
0.343974232673645,
-0.016996221616864204,
0.19648480415344238,
-0.933848083019256... |
def hps ( ) : condition _ type = [ [ " h - h ", " p - p ", " s - s " ], [ " h - s ", " p - h ", " s - p " ] ] a _ win, b _ win, draw, round _ att = 0, 0, 0, 1 while true : atttempt = raw _ input ( ) if atttempt in condition _ type [ 0 ] : draw + = 1 if draw = = 5 : return " none \ n " + str ( round _ att ) elif atttemp... | [
-0.14240582287311554,
-0.4029289484024048,
0.7440342307090759,
-0.5942083597183228,
-0.3598472774028778,
-0.014224352315068245,
0.6231865286827087,
-1.2503858804702759,
-0.28805840015411377,
-0.6562312841415405,
0.8258941173553467,
0.1948881894350052,
-0.1878625750541687,
-0.04766183719038... |
def spawn _ single _ thread _ controller ( call _ function, * args, * * kwargs ) : thread _ object = actionhandlerthread ( lambda r : call _ function ( * args, * * kwargs ) ) if six. py2 : thread _ object. setdaemon ( false ) thread _ object. start ( ) return thread _ object | [
0.4600294530391693,
-0.1896827220916748,
0.4499928057193756,
1.1209344863891602,
0.7300003170967102,
0.7650834321975708,
-0.14358831942081451,
0.3768288195133209,
0.19672417640686035,
-0.8336805105209351,
-0.0922834724187851,
-0.06746965646743774,
-0.3752293288707733,
-0.05075792595744133,... |
def _ hk _ par ( k, a, p, l, maxitr = 100, tol = 1e - 5, debug = false ) : xold = np. zeros ( p ) xold [ k ] = 1 xnew = np. copy ( xold ) r = 1 converged = false while ( converged is false ) : if ( debug ) : print ('iter : { } '. format ( r ) ) for j in range ( k ) : xnew [ j ] = _ tj ( j, a, xnew [ 0 : ( k + 1 ) ], l ... | [
0.2595278024673462,
0.20964635908603668,
0.675855278968811,
-0.40574243664741516,
-1.0258185863494873,
0.4635559916496277,
0.10269219428300858,
0.6652476787567139,
-0.5483748316764832,
1.3607399463653564,
0.9147526621818542,
-0.2585310935974121,
-0.563341498374939,
-0.3331667184829712,
0... |
def _ receiver _ organisation ( element, trans ) : org = trans. receiver _ organisation receiver _ org _ element = etree. subelement ( element, " receiver - org " ) if trans. receiver _ organisation _ activity : receiver _ org _ element. attrib ['receiver - activity - id'] = trans. receiver _ organisation _ activity if... | [
0.17099988460540771,
0.36114171147346497,
0.6107959747314453,
-1.6850115060806274,
-0.22880230844020844,
-0.07413197308778763,
-0.23381435871124268,
0.8568625450134277,
0.5633999109268188,
0.677142322063446,
0.5356994271278381,
-0.15440814197063446,
0.8801136612892151,
-0.7842584848403931,... |
def tick ( self, millis ) : # millis is ignored if len ( self. objects ) > 0 : # move the horse toward the first object in the queue, at full speed ( target _ image, target _ loc ) = self. objects [ 0 ] horse _ speed = self. horse _ speed else : # the horse might feel inclined to wander slowly toward a random target # ... | [
-0.12340590357780457,
-0.5143723487854004,
0.9926542639732361,
-0.33626478910446167,
-0.24754270911216736,
0.24872656166553497,
0.16736635565757751,
-0.433745801448822,
0.050375670194625854,
0.2966449558734894,
0.4027007222175598,
0.49813950061798096,
0.06564788520336151,
0.248360037803649... |
def check _ surround ( self ) : if self. _ surrounds : return _ surrounds surrounds = self. _ surrounds = _ surround _ info ( ) return surrounds | [
0.06555347889661789,
-0.42116281390190125,
0.5992185473442078,
-0.0380818247795105,
0.630109429359436,
-0.38019469380378723,
0.4007105827331543,
-1.417245864868164,
0.45084327459335327,
-0.6662938594818115,
0.14645826816558838,
0.8118126392364502,
-1.3166823387145996,
0.6286996006965637,
... |
def get _ users ( self ) : try : members = self. sc. api _ call ( " users. list " ) ['members'] except : members = [ ] return { u ['id'] : user ( * * {'name': u ['name'],'real _ name': u ['real _ name'],'is _ bot': u ['is _ bot'],'id': u ['id'], } ) for u in members } | [
-0.624261736869812,
0.09135482460260391,
0.40792950987815857,
-0.028330137953162193,
0.3685501217842102,
-0.045173123478889465,
-1.9258347749710083,
-0.15311667323112488,
-0.23963606357574463,
-0.18354324996471405,
-1.441442608833313,
0.42458826303482056,
-0.5884361863136292,
0.08117394894... |
def is _ game _ over ( self ) : game _ state, winner = self. gm. is _ game _ over ( ) if game _ state : if winner = = 0 : self. error _ text. config ( text = " game is over. it's a tie! press any key to exit " ) self. log _ window. insert ( end, " \ nit's a tie! " ) else : self. error _ text. config ( text = " game is ... | [
-0.8769997954368591,
-0.24159172177314758,
1.0078697204589844,
0.32050007581710815,
-0.29754337668418884,
0.028207041323184967,
-0.7919729351997375,
0.397541880607605,
-0.34970811009407043,
1.1764605045318604,
0.56135094165802,
0.9587064981460571,
-0.09518524259328842,
0.902190625667572,
... |
def add _ outputs ( self, candidates : iterable [ tuple [ union [ path, str ], optional [ str ] ] ] ) : # todo what to do with duplicate paths & inputs with same defaults candidate _ paths = list ( map ( lambda x : x [ 0 ], candidates ) ) tree = directorytree. from _ list ( candidate _ paths ) input _ candidates = { } ... | [
-1.0903111696243286,
-0.8264386057853699,
0.8244072198867798,
0.6255974173545837,
0.20934821665287018,
-0.022953400388360023,
0.78074711561203,
-0.20781880617141724,
-0.5549883842468262,
-0.05611990764737129,
0.8870027661323547,
0.38787320256233215,
-0.10881442576646805,
0.9285830855369568... |
def connect ( self, max _ pool _ connections = 5 ) : if self. _ socket is none : self. _ create _ socket ( ) self. _ socket. bind ( self. _ adress ) self. _ socket. listen ( max _ pool _ connections ) print ('server is waiting for connections.') while true : self. _ socketclient, addr = self. _ socket. accept ( ) if se... | [
-0.7069302797317505,
0.18787159025669098,
0.3869693875312805,
-0.40978720784187317,
-0.06253815442323685,
0.2584216594696045,
0.4394455552101135,
-0.3390004336833954,
-0.805822491645813,
-0.17618440091609955,
-0.28502529859542847,
0.5034409761428833,
-0.2992844879627228,
-0.017936922609806... |
def add _ bonds ( self, sys, mol _ id ) : # todo raise error if mol _ id not in mol _ dict for b in sys. bonds : bond _ str = " %. 3f \ t %. 3f " % ( b. type. k, b. type. req ) bond _ params = [ b. type. uk, b. type. ureq ] self. bond _ dict. add _ param ( bond _ str, bond _ params ) self. bond _ dict. add _ atoms ( bo... | [
0.09717405587434769,
-0.4072922468185425,
0.4650222063064575,
-0.22291411459445953,
0.4613947570323944,
0.2827593684196472,
-0.5040432810783386,
0.0036057899706065655,
0.2774641215801239,
-0.6422434449195862,
-0.09759984910488129,
0.6679661870002747,
-0.5529014468193054,
1.4388188123703003... |
def resnet50 ( pretrained = false ) : model = resnet ( bottleneck, [ 3, 4, 6, 3 ] ) if pretrained : model. load _ state _ dict ( model _ zoo. load _ url ( model _ urls ['resnet50'] ) ) return model | [
-0.25589537620544434,
0.24842576682567596,
0.030703064054250717,
0.4890780746936798,
-0.638546347618103,
0.019467057660222054,
0.2505008578300476,
0.7864978909492493,
0.5471810698509216,
-0.28810277581214905,
-1.3610457181930542,
-0.7791429162025452,
-0.3471602201461792,
-0.409939050674438... |
def rotatey ( self, angle ) : rad = angle * math. pi / 180 cosa = math. cos ( rad ) sina = math. sin ( rad ) z = self. z * cosa - self. x * sina x = self. z * sina + self. x * cosa return point3d ( x, self. y, z ) | [
-0.3568708002567291,
0.2958759665489197,
0.6672611832618713,
-1.21739661693573,
0.040579840540885925,
-0.4111006259918213,
0.1908506602048874,
0.03425431251525879,
0.5095082521438599,
-1.210440993309021,
-0.3864814043045044,
-0.04359808936715126,
-0.4990071654319763,
-0.8700283169746399,
... |
def quick _ plot _ gene ( gene, adata, x ='x ', y ='y ', s = 50, log = false ) : xs, ys, vs = ordered _ predictions ( adata. obs [ x ], adata. obs [ y ], np. array ( adata [ :, gene ]. x ). flatten ( ) ) if log : vs = np. log ( 1 + np. asarray ( vs ) ) plt. scatter ( xs, ys, c = vs, cmap ='viridis ', s = s ) | [
0.2735622823238373,
0.34601154923439026,
0.5373589396476746,
-0.16864874958992004,
-0.9155492186546326,
-0.1721375435590744,
-0.867124080657959,
0.2456500381231308,
-0.13359037041664124,
0.027558542788028717,
0.07394270598888397,
2.3003201484680176,
1.5882624387741089,
-0.2707101106643677,... |
def wrap _ result ( result, is _ async = true ) : if is _ async and py3 : return wrap _ async ( result ) else : return result | [
-0.8913098573684692,
0.8071455955505371,
0.37216123938560486,
1.1600030660629272,
-0.3528718650341034,
-0.1574813425540924,
-0.4493958353996277,
-0.3298072814941406,
1.0458751916885376,
0.04780012369155884,
0.5209550857543945,
-0.26303285360336304,
-0.07851722091436386,
-0.1479887068271637... |
def send _ header ( self, keyword, value ) : if not hasattr ( self,'_ headers _ buffer') : self. _ headers _ buffer = [ ] self. _ headers _ buffer. append ( ( " % s : % s \ r \ n " % ( keyword, value ) ). encode ('latin - 1 ','strict') ) if keyword. lower ( ) = ='connection': if value. lower ( ) = ='close': self. close... | [
-0.2152906209230423,
-0.3822861313819885,
0.9179913401603699,
0.24500508606433868,
-0.8708017468452454,
0.8804745078086853,
-1.3150182962417603,
-1.411630630493164,
-0.4736092686653137,
0.3138332962989807,
-0.6340305805206299,
0.3799424171447754,
-0.8677545785903931,
0.19868987798690796,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.