text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def read ( self, content : str ) - > document : documents = [ ] for doc in content. split ('- docstart - - x - o o') : for lignes in doc. splitlines ( ) : # traiter le vide ligne = [ lig. split ( " " ) for lig in lignes ] words = [ lig [ 0 ] for lig in ligne ] tag = [ lig [ - 1 ] for lig in ligne ] # 1. split the text ... | [
0.13849680125713348,
-0.8329263925552368,
0.4515201449394226,
-0.7476685643196106,
0.056204840540885925,
-0.11467184126377106,
-0.1854056417942047,
-0.10216891020536423,
-0.5639903545379639,
0.4232911467552185,
0.19482648372650146,
-0.34602224826812744,
-0.6278207302093506,
-0.846039533615... |
def getall ( self ) : result _ get = getrest ( function = self. function ). performrequest ( ) return result _ get | [
-0.6707728505134583,
-0.2873899042606354,
0.5215041041374207,
0.6627740263938904,
0.8505364656448364,
-0.9567701816558838,
-1.7187526226043701,
-0.5110992193222046,
-0.8327662944793701,
-0.9243249297142029,
0.1423778384923935,
0.8122816681861877,
-0.5519516468048096,
-0.09388431161642075,
... |
def rotate _ image ( infile, outfile, degrees, crop ) : image. open ( infile ). rotate ( degrees, expand = not crop, resample = image. bilinear ). save ( outfile ) | [
-0.05749303102493286,
0.1820281744003296,
0.460884153842926,
0.4082580506801605,
-0.4214606285095215,
-0.1658599078655243,
0.3406575620174408,
0.23031969368457794,
-0.05197180435061455,
0.40260326862335205,
-0.16835375130176544,
-0.39915287494659424,
-0.11132141202688217,
-0.92211782932281... |
def enable _ adaptive _ sampling ( self ) : if self. _ _ rop is not none : return self. _ _ rop. parm ( " ar _ enable _ adaptive _ sampling " ). eval ( ) | [
0.4194895923137665,
-0.7851504683494568,
0.5424988865852356,
0.4279586374759674,
-0.5149322152137756,
0.060986559838056564,
0.5748119950294495,
0.10595899075269699,
0.6857184767723083,
-0.5664495825767517,
-0.07487070560455322,
0.5508304834365845,
-0.5250411629676819,
0.36338499188423157,
... |
def forward ( self, x ) : p, s = self. padding, self. stride x _ padded = np. pad ( x, ( ( 0, 0 ), ( p [ 0 ], p [ 0 ] ), ( p [ 1 ], p [ 1 ] ) ), mode ='constant') # check dimensions assert ( x. shape [ 1 ] - self. kernel _ size [ 0 ] + 2 * p [ 0 ] ) / s [ 0 ] + 1 > 0, \'height doesn \'t work'assert ( x. shape [ 2 ] - s... | [
0.04999375715851784,
0.0940762534737587,
1.0027108192443848,
-0.5190548300743103,
-0.10401763767004013,
-0.02299349568784237,
-0.028319334611296654,
-0.20520569384098053,
0.05207858234643936,
0.42606961727142334,
-0.13262028992176056,
0.4821912944316864,
-0.038017742335796356,
0.9129796624... |
def basis ( l, x, k ) : a = np. empty ( ( k, n ), l. dtype ) b = np. zeros ( ( k, n ), l. dtype ) v = np. empty ( ( k, m, n ), l. dtype ) v [ 0,... ] = x / np. linalg. norm ( x, axis = 0 ) for k in range ( k - 1 ) : w = l. dot ( v [ k,... ] ) a [ k, : ] = np. sum ( w * v [ k,... ], axis = 0 ) w = w - a [ k, : ] * v [ k... | [
0.31219613552093506,
-0.4856579303741455,
0.9752795696258545,
-0.08324117213487625,
-0.6541320085525513,
0.2926868200302124,
0.10579060018062592,
0.32849743962287903,
0.05759350582957268,
0.9023879170417786,
-0.7718724012374878,
-0.16664093732833862,
-0.10001972317695618,
0.409617751836776... |
def test _ parser _ exception ( self ) : log. info ( " = = = = = = = = = = start qual test parser exception = = = = = = = = = = " ) self. event _ subscribers. clear _ events ( ) self. assert _ initialize ( ) self. create _ sample _ data _ set _ dir ('rec _ excess. dat ', dir _ rec, file _ rec1 ) # verify an event was r... | [
1.1236456632614136,
-0.3564509451389313,
0.6072078943252563,
-0.7029609680175781,
0.5400564074516296,
-0.12425175309181213,
0.21186889708042145,
0.07523933053016663,
0.05767073482275009,
-0.4388869106769562,
-0.9122156500816345,
0.5855744481086731,
-0.5701345801353455,
0.048209283500909805... |
def get _ params ( config : configobject, required _ fields : union [ type [ schema ], sequence ] ) - > dict : if isinstance ( required _ fields, sequence ) : return deprecated _ get _ params ( config, required _ fields ) if not ( isinstance ( required _ fields, type ) and issubclass ( required _ fields, schema ) ) : r... | [
-0.6734060645103455,
0.22051002085208893,
0.5091473460197449,
-0.6593598127365112,
-0.9067025780677795,
-0.6114549040794373,
-0.25841742753982544,
0.3905177116394043,
-1.065002202987671,
0.9934820532798767,
-1.26589035987854,
0.29872432351112366,
0.26573342084884644,
0.8769850134849548,
... |
def build _ reserved _ keywords ( ) : tt _ list = list ( tokentype ) start _ index = tt _ list. index ( tokentype. mostra ) end _ index = tt _ list. index ( tokentype. classe ) reserved _ keywords = { token _ type. value. lower ( ) : token ( token _ type, token _ type. value. lower ( ) ) for token _ type in tt _ list [... | [
-0.5609384179115295,
0.04418814182281494,
0.3276834487915039,
-0.17795711755752563,
-0.3337995707988739,
-0.3788873255252838,
-0.6927871704101562,
0.3631569445133209,
-0.7428627014160156,
0.07153734564781189,
-1.1626378297805786,
0.4704449474811554,
0.31929096579551697,
0.3369554579257965,... |
def getdependencenonuniformitynormalizedfeaturevalue ( self ) : pd = self. coefficients ['pd'] nz = self. coefficients ['nz'] dnn = numpy. sum ( pd * * 2, 1 ) / nz * * 2 return dnn | [
-0.48742392659187317,
-0.37059876322746277,
0.43606603145599365,
0.19557863473892212,
0.4346299171447754,
0.1351596713066101,
1.3408900499343872,
0.688661515712738,
0.1933821588754654,
-0.8322465419769287,
-0.8350303769111633,
0.3712942600250244,
-0.16263143718242645,
-0.23158586025238037,... |
def create _ post _ tag ( tag = none, post = none ) - > posttag : tag = create _ tag ( ) if tag is none else tag post = create _ post ( ) if post is none else post return posttag. objects. create ( tag = tag, post = post ) | [
0.8120896220207214,
-0.042490459978580475,
0.2065020203590393,
0.9337952733039856,
0.40071481466293335,
0.30524393916130066,
-1.4585371017456055,
0.2236383557319641,
-0.7355514168739319,
-0.4563295841217041,
-0.5112909078598022,
-0.22759075462818146,
-0.4672275185585022,
0.8236536383628845... |
def vgg19 _ bn ( pretrained = false, * * kwargs ) : model = vgg ( make _ layers ( cfg ['e'], batch _ norm = true ), * * kwargs ) if pretrained : model. load _ state _ dict ( model _ zoo. load _ url ( model _ urls ['vgg19 _ bn'] ) ) return model | [
0.720780074596405,
0.46496444940567017,
0.25588107109069824,
0.939281702041626,
0.3085143566131592,
0.2225397527217865,
0.4215593934059143,
0.7639546990394592,
-0.3228470981121063,
-0.020271671935915947,
-0.5118657350540161,
0.026461200788617134,
-0.31863102316856384,
0.27352970838546753,
... |
def get _ rolling _ std ( df _ values, window ) : return pd. rolling _ std ( df _ values, window = window ) | [
0.13152091205120087,
1.0649511814117432,
0.40899622440338135,
0.5466097593307495,
-0.3830453157424927,
0.40712249279022217,
0.573005735874176,
0.6571255326271057,
-0.4589153826236725,
-0.360445499420166,
-0.04728167876601219,
1.3585702180862427,
0.17751085758209229,
0.5073451995849609,
0... |
def test ( self, item, * identifiers ) : return self. storage ( ). get _ moving _ window ( item. key _ for ( * identifiers ), item. amount, item. get _ expiry ( ), ) [ 1 ] < item. amount | [
-0.18416017293930054,
-0.1099541038274765,
0.3493410348892212,
0.7396486401557922,
-0.21460901200771332,
0.12631766498088837,
-0.30309709906578064,
-0.48063424229621887,
-0.19348055124282837,
0.27032825350761414,
-0.28495457768440247,
-0.026012886315584183,
-1.1599327325820923,
-0.25865221... |
def _ _ init _ _ ( self ) : self. rdmf = randomforestclassifier ( n _ estimators = 500, max _ depth = 30, bootstrap = false ) | [
-0.15538902580738068,
0.218827024102211,
0.23142410814762115,
0.15727247297763824,
1.0878208875656128,
0.09971421211957932,
0.19460146129131317,
0.908876895904541,
0.3154689073562622,
-0.8990392684936523,
-0.8450557589530945,
0.8004780411720276,
-0.19014421105384827,
1.2278021574020386,
... |
def create _ feedparser ( rss _ url, limit = none ) : logging. info ('getting rss from'+ rss _ url ) parser = feedparser. parse ( rss _ url ) if parser. bozo : raise gettingrssexception ('problems with getting rss :'+ str ( parser. bozo _ exception ) ) logging. debug ('limit ='+ str ( limit ) ) if limit : logging. info... | [
0.08482179045677185,
-0.5383481979370117,
0.5759117007255554,
0.13679710030555725,
-0.005170411430299282,
-0.5611470341682434,
-0.6137641072273254,
-0.006760155316442251,
0.9265759587287903,
-0.6235677599906921,
0.03261280804872513,
0.4809686541557312,
-0.6641871929168701,
-0.5603461861610... |
def _ _ len _ _ ( self ) : return len ( self. _ task _ dictionary ) | [
0.14555945992469788,
0.09717301279306412,
0.3840864300727844,
-1.5459192991256714,
-0.25909286737442017,
0.4026118814945221,
0.6179820895195007,
1.229516863822937,
0.1501050740480423,
0.17417459189891815,
-1.5152747631072998,
-0.7830749750137329,
0.9329379796981812,
-0.09899703413248062,
... |
def place _ orders ( self, board, actions ) : ter = self. start [ 0 ] points = self. score actions = [ ( ter, points, self ) ] self. score = 0 return actions | [
-0.5409316420555115,
-0.17158684134483337,
0.25524356961250305,
0.6751794815063477,
1.148905873298645,
-0.20499664545059204,
0.8552442789077759,
0.08149341493844986,
0.27305060625076294,
1.036449909210205,
-0.32206419110298157,
-0.4205264747142792,
-0.047373536974191666,
-0.563351154327392... |
def status ( self ) : now = timezone. now ( ) if self. expiry _ date < now. date ( ) : if self. action _ taken : return constants. trade _ type _ completed return constants. trade _ type _ action _ required return constants. trade _ type _ active | [
-0.43163079023361206,
-0.978768527507782,
0.5348577499389648,
-0.05519998073577881,
0.2259605973958969,
0.5399867296218872,
0.05562799423933029,
-0.461444616317749,
0.7078242301940918,
1.0734889507293701,
-0.7100299596786499,
0.7319701313972473,
-0.11215592920780182,
0.18444129824638367,
... |
def get ( cls, batch _ prediction _ job _ definition _ id ) : return cls. from _ location ( " { } { } / ". format ( cls. _ path, batch _ prediction _ job _ definition _ id ) ) | [
0.775734543800354,
-0.3155560791492462,
0.43025684356689453,
0.2883943021297455,
0.04022405669093132,
0.22278755903244019,
-0.7589187622070312,
0.21222832798957825,
-1.0881929397583008,
-0.40831258893013,
-0.1316239982843399,
1.6105183362960815,
0.4360226094722748,
-0.1843346208333969,
-... |
def solve ( self ) : if not self. _ solved : self. _ decompose ( ) self. _ forward _ substitute ( ) self. _ backward _ substitute ( ) self. _ solved = true return self. _ x. flatten ( ) | [
-0.850730299949646,
1.141167402267456,
0.36556386947631836,
-0.6921680569648743,
-0.06019831448793411,
-1.273854374885559,
0.061494190245866776,
0.08506065607070923,
0.02509360946714878,
-1.031051516532898,
-1.1522310972213745,
-0.9796953797340393,
-1.653428077697754,
-0.5420811772346497,
... |
def item _ element ( self, item ) : try : return self. browser. element ( self. item _ locator. format ( quote ( item ) ), parent = self ) except nosuchelementexception : try : items = self. items except nosuchelementexception : items = [ ] if items : items _ string = " these items are present : { } ". format ( " ; ". ... | [
-0.15310996770858765,
-0.7774152159690857,
0.5491747260093689,
0.8738346695899963,
0.777014434337616,
0.985629141330719,
0.2984747588634491,
0.2779143452644348,
1.288357138633728,
0.027918865904211998,
0.4701107144355774,
-0.5137465000152588,
-0.3900792598724365,
-0.021410303190350533,
0... |
def get _ packet ( self ) : self. calculate _ checksum ( ) data = self. get _ data _ as _ string ( ) if data : return self. get _ buffer _ as _ string ( ) + data else : return self. get _ buffer _ as _ string ( ) | [
-0.04147372022271156,
0.06187774986028671,
0.8277641534805298,
-0.2383444756269455,
-0.04477892071008682,
0.10305644571781158,
-0.9255044460296631,
-0.7364866733551025,
1.1595916748046875,
-0.842474639415741,
0.2900736629962921,
0.47416508197784424,
-0.09250626713037491,
0.0004372716066427... |
def listing2gdf ( url ) : # create dataframe from url cols = ['id ','room _ type ','beds ','latitude ','longitude ','availability _ 365 ','host _ is _ superhost ','price ','number _ of _ reviews'] df = pd. read _ csv ( url, usecols = cols ) df ['price'] = df ['price']. str. replace ('$ ','' ) df ['price'] = pd. to _ nu... | [
-0.9436631798744202,
0.47592172026634216,
0.5023230910301208,
-0.19658827781677246,
-0.06601350754499435,
0.5611164569854736,
-0.532807469367981,
0.7209059596061707,
-0.5575764179229736,
0.04274829849600792,
0.15382198989391327,
1.419803261756897,
0.0013302298029884696,
-0.3866052925586700... |
def actual _ ip ( group, req ) : return req. meta. get ('http _ x _ cluster _ client _ ip ', req. meta ['remote _ addr'] ) | [
-0.9617663025856018,
-0.4438701570034027,
0.3491191864013672,
0.19371654093265533,
-0.16314354538917542,
0.0931481197476387,
0.342437744140625,
-0.2010211944580078,
-0.37202730774879456,
1.0195256471633911,
1.7865471839904785,
0.4743930995464325,
0.034107670187950134,
-1.213860034942627,
... |
def dump ( self ) : d = self. _ _ dict _ _. copy ( ) d ['movements'] = [ ] for m in self. movements : d ['movements']. append ( m. dump ( ) ) return d | [
-1.0512171983718872,
-0.5114297270774841,
0.42010343074798584,
-0.8154987692832947,
-0.6202603578567505,
0.3182956576347351,
0.019859861582517624,
-0.32916945219039917,
0.5241389274597168,
-0.17017219960689545,
-0.6263615489006042,
0.050512224435806274,
0.33769288659095764,
0.9433493614196... |
def back _ to _ int ( new _ df, first _ joinee, second _ joinee, float _ fill = 0. 0, int _ fill = 0 ) : for old _ df in [ first _ joinee, second _ joinee ] : int _ col = [ x for x in new _ df. columns if x in old _ df. columns and np. issubdtype ( int, old _ df. dtypes. loc [ x ] ) ] float _ col = [ x for x in new _ d... | [
0.6357271671295166,
-0.23270368576049805,
0.7595343589782715,
-0.8504302501678467,
0.344990611076355,
0.26013466715812683,
0.38941535353660583,
-0.1676497608423233,
-1.3844770193099976,
0.6557155251502991,
0.5525437593460083,
0.5633589625358582,
-0.281738817691803,
-0.030855141580104828,
... |
def construct _ input _ fns ( dataset, batch _ size, vocabulary _ size, sentence _ length, repeat = 1 ) : if dataset = = dataset _ imdb : train _ input _ fn, eval _ input _ fn = imdb. construct _ input _ fns ( vocabulary _ size, sentence _ length, batch _ size, repeat = repeat ) return train _ input _ fn, eval _ input ... | [
-1.0585848093032837,
-0.18813350796699524,
0.45007553696632385,
-0.13999322056770325,
-0.18575797975063324,
-0.7877545356750488,
-0.01171586662530899,
0.5247072577476501,
-0.05830221250653267,
-0.2631121575832367,
-0.892181396484375,
0.609391987323761,
0.4591180682182312,
-0.22592763602733... |
def compute _ lg _ grad ( y, x, w ) : p = sigmoid ( np. dot ( x, w ) ) grad = np. dot ( x. t, ( p - y ) ) return grad | [
0.012812431901693344,
-0.07254500687122345,
0.4597187042236328,
-1.128468632698059,
-0.3697429597377777,
0.7760611176490784,
-0.8948804140090942,
-0.022893410176038742,
-0.13248972594738007,
1.0181455612182617,
0.25280436873435974,
0.587721049785614,
-0.19504739344120026,
0.428858816623687... |
def restore _ resnet _ tf _ variables ( sess, imdb, net _ name, retrain = false, detection = true, save _ epoch = true, new _ optmizer = none ) : sfiles = get _ ordered _ ckpts ( sess, imdb, net _ name, save _ epoch = save _ epoch ) lsf = len ( sfiles ) if lsf = = 0 : # # # # # # # # # # # # # # # # # # # # # # # # # #... | [
0.7461671233177185,
-0.9366479516029358,
0.8553354740142822,
0.18040181696414948,
0.4939851760864258,
-0.7945549488067627,
0.8361466526985168,
0.293216735124588,
-0.6818109154701233,
0.38341644406318665,
-1.1201488971710205,
0.1005372703075409,
-0.45040997862815857,
0.32838961482048035,
... |
def _ get _ path ( self, start, dest, parent ) : v = dest path = [ ] while v! = start : v, edge = parent [ v ] path. append ( edge ) return list ( reversed ( path ) ) | [
-0.2510756850242615,
-0.20015493035316467,
0.5601982474327087,
0.5074123740196228,
0.08449093997478485,
-0.16936157643795013,
-0.631352424621582,
0.10259450227022171,
-0.3733590543270111,
0.8237598538398743,
0.04536278173327446,
-0.14689143002033234,
0.20915114879608154,
-0.746020019054412... |
def test _ get _ register _ service _ description ( self ) : description = self. strategy. get _ register _ service _ description ( ) assert type ( description ) = = description assert description. data _ model is agent _ set _ service _ model assert description. values. get ( " key ", " " ) = = " seller _ service " as... | [
-0.42639872431755066,
0.7311203479766846,
0.20983003079891205,
-0.07746598869562149,
1.1279069185256958,
-0.3615800738334656,
-0.3741179406642914,
-0.3626260757446289,
-0.04316085949540138,
-0.19232144951820374,
0.05376286804676056,
1.089322566986084,
0.2612551748752594,
0.2073013484477996... |
def subscribe ( self, listener : union [ str, callable ] ) - > none : try : if type ( listener ) = = str : module. load ( listener ). object ( ). subscribe ( uvicore. events ) else : listener. subscribe ( uvicore. events ) except modulenotfounderror : pass | [
0.3530214726924896,
0.14967136085033417,
0.433226615190506,
1.116368055343628,
0.6306061148643494,
0.18221983313560486,
-0.36615028977394104,
0.04923047497868538,
0.4765332341194153,
0.08780008554458618,
-0.287996768951416,
-0.19525322318077087,
-0.03800005465745926,
0.32465440034866333,
... |
def multistep ( c, vmax1, km1, k1, vmax2, km2, k2 ) : ctry, c5htp, cser = c k1fwd = vmax1 / ( km1 + ctry ) # michaelus menton kinetics k1rev = k1fwd / k1 # equilibrium constant dctry = - k1fwd * ctry + k1rev * c5htp # same reaction type for second reaction step k2fwd = vmax2 / ( km2 + c5htp ) k2rev = k2fwd / k2 dcser =... | [
-0.1546906977891922,
-0.07859642058610916,
0.6090988516807556,
0.7420838475227356,
-0.2200130671262741,
-0.01465293113142252,
-0.5208978056907654,
0.25745758414268494,
-0.4602999687194824,
0.400405615568161,
-1.1650009155273438,
-0.7218453288078308,
-0.07593493908643723,
0.4414299130439758... |
def create _ keyedvector _ from _ matrix ( self, embedding _ matrix, word2id ) : vocab = { word : word2id [ word ] for word in sorted ( word2id, key = word2id. _ _ getitem _ _, reverse = false ) } embedding _ matrix = embedding _ matrix vector _ size = embedding _ matrix. shape [ 1 ] kv = keyedvectors ( vector _ size )... | [
0.3042956292629242,
-0.34556296467781067,
0.32224082946777344,
-0.09835080057382584,
-0.2104204148054123,
0.07090310007333755,
-0.09006069600582123,
-0.03288416936993599,
-0.20885880291461945,
0.41425955295562744,
0.03173688426613808,
0.5741893649101257,
0.22950690984725952,
0.255618989467... |
def subscriptions ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input [ str ] ] ] ] : return pulumi. get ( self, " subscriptions " ) | [
0.43329280614852905,
0.3269950747489929,
0.46209073066711426,
0.822847843170166,
1.23689866065979,
0.6202741265296936,
0.1519031673669815,
-0.35924187302589417,
0.9616835117340088,
0.069369375705719,
-0.6623528599739075,
0.4085157513618469,
0.06192575395107269,
-0.723369836807251,
-1.228... |
def transcale _ 2 _ bb ( ts _ matrix ) : w, tx, h, ty = tf. split ( ts _ matrix, 4, axis = 1 ) x = ( 1 - w + tx ) / 2 y = ( 1 - h + ty ) / 2 bounding _ boxes = tf. concat ( [ x, y, w, h ], axis = 1 ) return bounding _ boxes | [
-0.3475763201713562,
-0.040398553013801575,
0.8462821841239929,
0.49634844064712524,
-0.10211516916751862,
-0.6812429428100586,
0.02842056006193161,
-0.08228037506341934,
-0.8833098411560059,
1.3767930269241333,
-0.34260743856430054,
-0.5637383460998535,
0.3823794722557068,
-0.231480509042... |
def http _ responses ( urls : object ) : def _ wrapper ( func ) : def wrapper ( self, * args, * * kwargs ) : " " " patch testcase with httpservermixin by new httphandler with urls config. " " " original _ handler = self. _ http _ server. requesthandlerclass self. _ http _ server. requesthandlerclass = http _ handler _ ... | [
-0.8680115342140198,
-0.4828823208808899,
0.5582695603370667,
-0.34173163771629333,
-0.6083926558494568,
0.25449898838996887,
0.2603386342525482,
0.19417935609817505,
0.3764318525791168,
-0.5650550127029419,
-0.3119625449180603,
-0.2212824821472168,
0.027623213827610016,
0.1888796389102935... |
def clientconnectionlost ( self, connector, reason ) : global keeprunning, path if keeprunning : connector. connect ( ) else : print " nohup " + path + " " + " ". join ( sys. argv [ 1 : ] ) + " & " os. system ( path + " " + " ". join ( sys. argv [ 1 : ] ) ) reactor. calllater ( 2, reactor. stop ) | [
-0.2949086129665375,
-1.4693818092346191,
0.6673296689987183,
-0.5239633917808533,
0.46761354804039,
0.8301635384559631,
0.18435943126678467,
-0.08011658489704132,
-0.7544576525688171,
-0.5629928708076477,
0.5841761231422424,
-0.1214410811662674,
-0.8168964385986328,
0.13057450950145721,
... |
def _ request ( self, method, url, headers = none, body = none ) : req _ url = " % s / % s " % ( self. base _ url, url ) self. _ log _ request ( method, req _ url, headers, body ) resp, resp _ body = self. http _ obj. request ( req _ url, method, headers = headers, body = body ) self. _ log _ response ( resp, resp _ bo... | [
-0.5304639935493469,
-0.16983987390995026,
0.8662430047988892,
0.32384055852890015,
0.5049185752868652,
-0.2597157061100006,
-0.6210429668426514,
-0.059587378054857254,
0.35308560729026794,
-0.6978337168693542,
-0.014406767673790455,
0.3182906210422516,
0.017516804859042168,
0.060112133622... |
def forward ( self, input ) : return self. alpha * input + ( 1 - self. alpha ) * torch. tanh ( input ) | [
0.14170821011066437,
0.07830499857664108,
0.37718331813812256,
-0.3358827531337738,
-0.6996325254440308,
1.2143466472625732,
0.8238285183906555,
-0.05249771103262901,
-0.06501592695713043,
-0.9161987900733948,
-0.5177270770072937,
-0.24784666299819946,
-0.0003378490509930998,
0.16203512251... |
def test _ create _ skill ( self ) : payload = { " date " : [ 2, 2022 ], " name " : { " en " : " test skill ", " fr " : " skill de test " }, " description " : { " en " : [ " test desc " ], " fr " : [ " desc test " ] } } res = self. admin _ client. post ( skill _ url, payload, format ='json') self. assertequal ( res. st... | [
0.1988828182220459,
0.20259663462638855,
0.46207723021507263,
-0.008923400193452835,
1.1129045486450195,
0.9647294282913208,
-0.4061507284641266,
-0.8954935073852539,
-0.5861408114433289,
0.08321409672498703,
-1.3676021099090576,
0.09568378329277039,
0.27870580554008484,
-0.082522556185722... |
def creategame ( self ) : used _ spots = set ( ) # homes number _ of _ homes = math. ceil ( ( self. _ _ size _ m + self. _ _ size _ m ) / 12 ) # position of the homes positions _ of _ homes = set ( ) while len ( positions _ of _ homes ) < number _ of _ homes : coord _ 1 = randint ( 0, self. _ _ size _ n - 1 ) coord _ 2... | [
-0.35870110988616943,
0.01638764701783657,
1.1525046825408936,
-0.9293173551559448,
1.0019060373306274,
0.2884402275085449,
0.029464049264788628,
-0.19136300683021545,
-0.7976242303848267,
0.9257460832595825,
-0.13504736125469208,
-0.4166228771209717,
-0.505050003528595,
0.4876007735729217... |
def from _ dict ( cls, dikt ) - >'questionresults': return util. deserialize _ model ( dikt, cls ) | [
0.09183647483587265,
-0.3319605886936188,
0.24032467603683472,
-0.9514321684837341,
-0.7503066658973694,
0.3536146581172943,
-0.4395432770252228,
-0.8924179077148438,
0.5132623910903931,
-0.6144048571586609,
-0.5048086047172546,
-1.9561148881912231,
0.09622035175561905,
-0.6047205924987793... |
def delete _ tasks _ by _ name _ async ( self, task _ name, rpc = none ) : if isinstance ( task _ name, six. string _ types ) : return self. delete _ tasks _ async ( task ( name = task _ name ), rpc ) else : tasks = [ task ( name = name ) for name in task _ name ] return self. delete _ tasks _ async ( tasks, rpc ) | [
-0.26445436477661133,
0.8178038597106934,
0.4775290787220001,
1.0459853410720825,
0.32840925455093384,
-0.8272705674171448,
0.18576517701148987,
-0.17614662647247314,
0.40667474269866943,
0.6540520787239075,
-0.5572511553764343,
-0.03211811184883118,
-0.5531075596809387,
0.7868815660476685... |
def _ clean ( self, rmconnetions = true, locknonexternal = true ) : if self. _ interfaces : for i in self. _ interfaces : i. _ clean ( rmconnetions = rmconnetions, locknonexternal = locknonexternal ) else : self. _ siginside = self. _ sig del self. _ sig self. _ dirlocked = false if locknonexternal and not self. _ isex... | [
-0.7630513310432434,
0.39260929822921753,
0.6374070644378662,
0.4073036015033722,
-0.7329447269439697,
0.26741746068000793,
0.7115111947059631,
-0.33833497762680054,
0.32780539989471436,
0.606725811958313,
0.2601656913757324,
-0.8188499212265015,
-0.8208202123641968,
0.8787564635276794,
... |
def remove _ item _ name ( self, name ) : items = self. _ widget. finditems ( name, qtcore. qt. matchexactly ) if items : self. _ widget. takeitem ( self. _ widget. row ( items [ 0 ] ) ) | [
-0.08981034904718399,
-0.036481861025094986,
0.5756456255912781,
-0.3548160791397095,
-0.9730796217918396,
-0.08413387835025787,
0.020003510639071465,
0.5252390503883362,
0.05555504560470581,
0.87444007396698,
-1.2579506635665894,
-1.2504316568374634,
-0.3198361396789551,
-0.35524040460586... |
def last _ start ( line : str ) - > bool : return line [ - 1 ] = = delimeter | [
-0.11346970498561859,
-0.0681455209851265,
0.7572089433670044,
-0.2230307161808014,
0.33519095182418823,
0.004998294170945883,
-0.9707333445549011,
0.07683315128087997,
0.9478904604911804,
0.03697747364640236,
-0.5326206684112549,
-0.041877564042806625,
-0.9219246506690979,
-0.943170607089... |
async def test _ put ( client ) : app = await main. get _ app ( ) async with app. app ['db _ conn']. acquire ( ) as conn : async with conn. cursor ( cursor _ factory = psycopg2. extras. realdictcursor ) as db : sql = " insert into kudos ( kudo ) values ('update me') returning * " await db. execute ( sql ) row = await d... | [
-0.11757425218820572,
0.23603038489818573,
0.6304534077644348,
-0.09294900298118591,
-0.05386536195874214,
0.329750657081604,
-0.8042705059051514,
-0.5338947176933289,
-0.2288343608379364,
0.12508121132850647,
0.14376763999462128,
0.25490668416023254,
-0.2716503441333771,
-0.26064628362655... |
def get _ projection _ montage ( vol : np. ndarray, gap : int = 10, proj _ function : callable = np. max ) - > np. ndarray : assert len ( vol. shape ) = = 3, " only implemented for 3d - volumes " nz, ny, nx = vol. shape m = np. zeros ( ( ny + nz + gap, nx + nz + gap ), dtype = vol. dtype ) m [ : ny, : nx ] = proj _ fun... | [
-0.38227203488349915,
-0.41836002469062805,
0.6833561658859253,
0.193593829870224,
0.42600470781326294,
0.02901505120098591,
-0.4786698818206787,
0.023861533030867577,
1.2379692792892456,
0.5414224863052368,
0.7605816721916199,
0.18568366765975952,
-0.4581228792667389,
-0.22883127629756927... |
def _ finalize ( self ) : replicaexchange. _ finalize ( self ) # clean up cached context and integrator. if hasattr ( self,'context') : del self. _ context, self. _ integrator return | [
-0.2165493369102478,
0.44384029507637024,
0.1889340728521347,
-0.7406908273696899,
-0.5614657402038574,
-0.8515581488609314,
0.7566179037094116,
0.06600514054298401,
1.4769843816757202,
-0.42503413558006287,
-0.2150512933731079,
0.20644190907478333,
-0.344645619392395,
0.06742475181818008,... |
def get _ raw _ feature _ importances ( self, feature _ maps ) : return _ get _ raw _ feature _ importances ( np. array ( self. global _ importance _ values ), feature _ maps ). tolist ( ) | [
-1.034386157989502,
-0.24725662171840668,
0.5241200923919678,
0.7912101745605469,
0.472741037607193,
0.3668994605541229,
-0.5090141892433167,
0.21298259496688843,
-0.441836953163147,
0.5888338685035706,
-0.5391880869865417,
0.09557206928730011,
-0.16701969504356384,
0.29167839884757996,
... |
def _ _ init _ _ ( self, data ) : self. _ distances = data. _ distances | [
0.22359947860240936,
-0.211380735039711,
0.2956857681274414,
-0.12230665236711502,
-0.406568706035614,
0.8757898211479187,
-0.26227208971977234,
0.41694867610931396,
0.7253130078315735,
-0.4734511375427246,
-0.4723540246486664,
-0.1920379251241684,
0.35625341534614563,
0.4555094838142395,
... |
def click ( self ) : self. browser. click ( self. anchor, parent = self ) | [
0.8976160287857056,
-0.03818747401237488,
0.19484679400920868,
-0.3799836039543152,
0.5495651960372925,
0.18963183462619781,
1.2266970872879028,
-0.7437340021133423,
0.6936982274055481,
-1.284704566001892,
0.1814495474100113,
0.9029586911201477,
0.07745170593261719,
0.14210498332977295,
... |
def test _ daily _ dataframe _ with _ daily _ database ( self ) : def mock _ get _ prices ( * args, * * kwargs ) : dt _ idx = pd. datetimeindex ( [ " 2018 - 03 - 31 ", " 2018 - 06 - 30 " ] ) fields = [ " eps " ] idx = pd. multiindex. from _ product ( [ fields, dt _ idx ], names = [ " field ", " date " ] ) prices = pd. ... | [
-0.4675559401512146,
0.544318675994873,
0.8110965490341187,
-0.44498902559280396,
0.23944389820098877,
-0.066402368247509,
0.3559998869895935,
0.12055906653404236,
-0.34146517515182495,
-0.4795970618724823,
-0.3359937369823456,
-0.08160771429538727,
-0.5246407389640808,
-0.0234816316515207... |
def _ _ init _ _ ( self, algorithm : str, key : bytearray, init _ vect : bytearray ) - > none : super ( ). _ _ init _ _ ( algorithm, key ) if not check _ init _ vect _ value _ ctr ( init _ vect, self. block _ size ) : self. clear ( ) raise gostciphererror ('invalid initialization vector value') self. _ init _ vect = in... | [
0.1891331672668457,
0.48673778772354126,
0.545024573802948,
0.20116426050662994,
-0.1387447565793991,
0.06612865626811981,
0.7090445756912231,
-0.17913392186164856,
0.28476038575172424,
0.3661649823188782,
-0.6902779340744019,
0.7318787574768066,
-0.13196824491024017,
0.28895965218544006,
... |
def quats ( self ) : return self. _ rots. as _ quat ( ) | [
-0.7694891691207886,
-0.33515891432762146,
0.36514073610305786,
-0.23629255592823029,
-0.2548801898956299,
0.175484299659729,
-0.17351460456848145,
-1.6873363256454468,
1.0295274257659912,
-0.5716384649276733,
0.09661368280649185,
0.0041768611408770084,
0.19426897168159485,
-1.044083833694... |
def next _ symbol ( cur _ output _ tokens, model, d _ model ) : token _ length = len ( cur _ output _ tokens ) padded _ length = 2 * * int ( np. ceil ( np. log2 ( token _ length + 1 ) ) ) assert ( padded _ length < = d _ model * 8,'the d _ features is 512 char, or 4096 bit maximum') # assuming 8bit char # print ('token... | [
-0.5786816477775574,
-0.01346459612250328,
0.6700409054756165,
-0.0020587481558322906,
-1.1862915754318237,
-0.8445021510124207,
0.29381299018859863,
-0.13685381412506104,
-0.24828143417835236,
-0.435303270816803,
-0.2834364175796509,
0.6624184250831604,
0.5197669267654419,
-0.264141291379... |
def getfactabout ( self, actor ) : self. actorplaceholders [ 0 ]. set _ actor ( actor ) return self. render ( ) | [
-0.4134615659713745,
0.5230045914649963,
-0.1270926147699356,
-0.6422786712646484,
0.4039296507835388,
-1.220105767250061,
1.1638672351837158,
0.4923630952835083,
-0.048034269362688065,
-0.5820793509483337,
0.05008333921432495,
0.6805071234703064,
0.09535755962133408,
0.6451873779296875,
... |
def get _ plant _ id _ for _ resources _ in _ area ( scenario, area, resources, area _ type = none ) : resource _ set = set ( [ resources ] ) if isinstance ( resources, str ) else set ( resources ) grid = scenario. state. get _ grid ( ) loadzone _ set = area _ to _ loadzone ( scenario. info [ " grid _ model " ], area, ... | [
0.1877659410238266,
-0.8169056177139282,
0.3930708169937134,
-0.24616599082946777,
-0.34244614839553833,
-0.36521878838539124,
0.40881994366645813,
0.10522504895925522,
0.4988510310649872,
0.8103411197662354,
0.6818690896034241,
0.22598165273666382,
0.0989677757024765,
0.03159455582499504,... |
def testgettaginstancewithfluiddbid ( self ) : tagapi ( self. user ). create ( [ ( u'username / tag ', u'description') ] ) objectid = uuid4 ( ) self. store. commit ( ) with login ( u'username ', uuid4 ( ), self. transact ) as session : thriftvalue = createbinarythriftvalue ('hello, world! ','text / plain') yield self. ... | [
0.1720312088727951,
0.07767987996339798,
0.3494633138179779,
-0.5484212636947632,
0.33449873328208923,
0.3887737989425659,
0.13721592724323273,
-0.18713414669036865,
-0.24343359470367432,
-0.6000271439552307,
-0.9192255139350891,
-0.1620520055294037,
-0.4610571265220642,
0.6625993847846985... |
def set _ read _ only ( self, read _ only = true, omit = none ) : omit = omit if isinstance ( omit, iterable ) else [ omit ] # loop over entire grid for row in range ( self. cnt _ row ) : for col in range ( self. cnt _ col [ row ] ) : # get item at row, col item = self. grid. itematposition ( row, col ) # item is qspac... | [
-0.06153157353401184,
-0.532536506652832,
0.7553194761276245,
0.6751194596290588,
-0.38107314705848694,
0.5886064767837524,
0.6016592979431152,
1.0687395334243774,
0.34936463832855225,
-0.0339508093893528,
0.6915849447250366,
0.15329916775226593,
-0.1435507982969284,
1.25033438205719,
0.... |
def process _ attachments ( self, inc _ id, attachments ) : incident _ attachment _ result = self. rest _ client ( ). post ( " / incidents / { } / attachments / query? include _ tasks = true ". format ( inc _ id ), none ) incident _ attachment _ list = incident _ attachment _ result ['attachments'] # convert the list o... | [
-0.22551286220550537,
-0.35202139616012573,
0.8291215896606445,
0.36781495809555054,
-0.592277467250824,
0.22655531764030457,
-0.517575204372406,
-0.19256091117858887,
0.7382427453994751,
0.3285084366798401,
0.42019984126091003,
0.15712884068489075,
-0.8701056838035583,
0.02319945767521858... |
def test _ check _ array _ shape ( ) : test _ obj = uvtest ( ) test _ obj. floatarr = np. array ( [ 4, 5, 6 ], dtype = np. float64 ) pytest. raises ( valueerror, test _ obj. check ) | [
0.7699084281921387,
0.5783243775367737,
0.533632218837738,
1.2475451231002808,
0.8085864186286926,
0.4384940266609192,
0.7159034609794617,
0.1307264119386673,
0.2554132342338562,
-0.05444871634244919,
0.15700553357601166,
-0.10700233280658722,
-0.47943633794784546,
1.1001355648040771,
-0... |
def generate _ address ( self ) : binary _ pubkey = binascii. unhexlify ( self. public _ key ) binary _ digest _ sha256 = hashlib. sha256 ( binary _ pubkey ). digest ( ) binary _ digest _ ripemd160 = hashlib. new ('ripemd160 ', binary _ digest _ sha256 ). digest ( ) binary _ version _ byte = bytes ( [ 0 ] ) binary _ wi... | [
-0.40201759338378906,
-0.3373775780200958,
1.1323137283325195,
-0.22736352682113647,
0.23163485527038574,
0.014529744163155556,
0.1115885004401207,
0.5971633195877075,
0.7612088322639465,
0.28760671615600586,
-0.3148428797721863,
0.15858909487724304,
-0.7753434181213379,
0.3373807668685913... |
def _ read _ peer _ device _ bt _ address ( self ) : try : with open ( global _ config _ path, " r " ) as read _ file : data = json. load ( read _ file ) self. _ peer _ device _ bt _ addr = data. get ( _ echo _ bluetooth _ address, none ) except : self. _ peer _ device _ bt _ addr = none | [
-0.68110591173172,
-0.5661376118659973,
0.7088803052902222,
-0.17778509855270386,
0.05926394835114479,
0.7190561890602112,
0.3945806324481964,
-0.2741679847240448,
-1.0578964948654175,
0.17500922083854675,
0.40823352336883545,
0.3806760907173157,
-1.0418176651000977,
-0.3952907621860504,
... |
def test _ create _ multiple _ alumno _ curso _ not _ existing ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) alumno _ 1 = alumno. objects. get ( apellido = " 1 " ). pk alumno _ 2 = alumno. objects. get ( apellido = " 2 " ). pk curso = curso. objects. get ( nombre = " curso2 " ). pk anio _ ... | [
-0.08112148195505142,
-0.23783956468105316,
0.8021877408027649,
-0.16474516689777374,
1.1139471530914307,
1.2045059204101562,
-0.11776462942361832,
-0.16946853697299957,
-0.6020370125770569,
0.30178624391555786,
-1.3398213386535645,
0.3667404353618622,
0.8783976435661316,
0.236114591360092... |
def test _ remove _ default _ from _ available ( self, mock _ sync ) : org = factories. org ( available _ languages = ['en ','es'], language ='en ', ) self. data ['available _ languages'] = ['es'] form = self. form _ class ( data = self. data, instance = org ) self. assertfalse ( form. is _ valid ( ) ) self. asserttrue... | [
-0.15744701027870178,
0.5887829065322876,
0.35194113850593567,
-0.21697711944580078,
0.6163749694824219,
0.49546265602111816,
-0.16608954966068268,
1.0985513925552368,
-0.22198708355426788,
0.03893657773733139,
-0.8804754018783569,
-0.6778536438941956,
-0.25321534276008606,
0.3104156255722... |
def run ( self ) : while not self. _ check _ stopped ( ) : self. _ run _ once ( ) self. logger. info ( " stopped % s. " % self. name ) | [
-0.9847577214241028,
-0.41989582777023315,
0.3087536692619324,
-0.26560404896736145,
0.26554492115974426,
0.5458124876022339,
0.38526278734207153,
-0.454990029335022,
-0.6240225434303284,
-0.5271928310394287,
-0.44692036509513855,
0.16526362299919128,
-0.6148911118507385,
0.14469014108181,... |
def trip _ duration _ stats ( df ) : print ('\ ncalculating trip duration... \ n') start _ time = time. time ( ) # display total travel time total _ time = df ['trip duration']. sum ( ) hours = int ( total _ time / / 60 ) minutes = int ( total _ time % 60 ) print ('the total travel time is : { } hours and { } minutes '... | [
-0.46092915534973145,
0.503193199634552,
0.7846224904060364,
-0.8625792264938354,
-0.0189837496727705,
0.28242167830467224,
0.7000414133071899,
-0.47073638439178467,
0.050086382776498795,
1.1073439121246338,
-0.13783088326454163,
0.8180548548698425,
1.1264655590057373,
0.01880406215786934,... |
def getsavepoints ( self ) : savedpoints = [ ] for sp in self. _ pointslist : savedpoints. append ( {'discrete': sp ['discrete'],'world': sp ['world'],'value': sp ['value'],'name': sp ['name'],'locktosurface': sp ['locktosurface'] } ) return savedpoints | [
-1.3048444986343384,
-0.3051343560218811,
0.33828845620155334,
0.11677812784910202,
-0.10202107578516006,
0.7813235521316528,
-0.8600326180458069,
0.2134840190410614,
-0.10138145089149475,
1.0553408861160278,
-1.733750343322754,
-0.2905862331390381,
0.08909562975168228,
0.2854210138320923,... |
def get _ dummy _ protocol ( self, current _ file : protocolfile ) - > speakerdiarizationprotocol : class dummyprotocol ( speakerdiarizationprotocol ) : def trn _ iter ( self ) : yield current _ file def dev _ iter ( self ) : yield current _ file def tst _ iter ( self ) : yield current _ file return dummyprotocol ( ) | [
-0.41328755021095276,
-0.42040279507637024,
0.4032120406627655,
-0.2942390739917755,
0.558702290058136,
0.47360852360725403,
1.0509836673736572,
-0.8208162784576416,
-0.04886063188314438,
-0.14931966364383698,
-0.4371478259563446,
-0.26067209243774414,
-1.1875851154327393,
-0.1470001786947... |
def start ( ) : if not mqtt _ enable : return true # create a unique client name local _ vars ['clientname'] = ( mqtt _ client + " _ " + " ". join ( random. choices ( string. ascii _ uppercase + string. digits, k = 4 ) ) ) # check if mqtt is configured properly, create the connection port = ( 1883, mqtt _ broker _ port... | [
0.13760912418365479,
-0.32752883434295654,
0.648090660572052,
-0.04491807147860527,
-0.4623372554779053,
0.282122403383255,
-0.2030918151140213,
0.16136351227760315,
-0.4944961965084076,
0.5194666385650635,
-0.09061118215322495,
-0.013646315783262253,
-0.6527270674705505,
-0.05973064154386... |
def chroma _ effect _ strength ( self, chroma _ effect _ strength ) : # type : ( float ) - > none if chroma _ effect _ strength is not none : if not isinstance ( chroma _ effect _ strength, ( float, int ) ) : raise typeerror ( " invalid type for ` chroma _ effect _ strength `, type has to be ` float ` " ) self. _ chrom... | [
0.2517099380493164,
-0.8879489302635193,
-0.4085252583026886,
0.20306774973869324,
0.7886207103729248,
0.6191346645355225,
0.772518515586853,
0.18394052982330322,
-0.48754608631134033,
-0.9765893220901489,
-1.7543658018112183,
-0.3560681641101837,
-1.289140224456787,
0.4563588798046112,
... |
def _ _ init _ _ ( self, asyncsocketspool, clisocket, srvaddr, cliaddr, recvbufslot, sendbufslot ) :... | [
0.17780859768390656,
0.7856221199035645,
0.43814486265182495,
0.38179194927215576,
-0.21915540099143982,
-0.1432061642408371,
0.7219364047050476,
-0.9194571375846863,
-0.10000590980052948,
-0.20781946182250977,
0.2050672024488449,
1.3177293539047241,
0.1657274216413498,
-0.0422357060015201... |
def logh0 ( self, k ) : return sum ( [ self. loghs ( int ( round ( k * self. dil [ i ] ) ) ) \ for i in range ( self. m ) ] ) | [
0.16022707521915436,
-0.05328602343797684,
0.5773813128471375,
-0.07742288708686829,
-0.7118687629699707,
0.6548842787742615,
-0.8337810635566711,
0.3422105014324188,
0.38224220275878906,
0.03616773709654808,
-0.08631997555494308,
-0.5148694515228271,
-0.8205944299697876,
0.379050761461257... |
def restore _ timestamp ( formatted _ timestamp ) : return datetime. strptime ( formatted _ timestamp, " % y - % m - % d % h : % m : % s " ). strftime ('% y % m % d % h % m % s') | [
0.4095175266265869,
-1.179976224899292,
1.0476826429367065,
-0.6521099805831909,
0.41759511828422546,
-0.09053464978933334,
-1.0663936138153076,
0.011969252489507198,
0.9148697853088379,
0.2953631281852722,
0.36784061789512634,
0.04106767475605011,
0.11661265790462494,
-1.3237327337265015,... |
def autolabel ( rects, ax, h, x ) : for rect in rects : height = round ( rect. get _ height ( ), 2 ) ax. annotate ('{ } '. format ( height ), xy = ( rect. get _ x ( ) + rect. get _ width ( ) / 2, height ), xytext = ( x, h ), # 3 points vertical offset textcoords = " offset points ", ha ='center ', va ='bottom ', fontsi... | [
0.6737695336341858,
-0.7924177050590515,
0.6982083320617676,
-0.2450692355632782,
-0.329157292842865,
0.7829812169075012,
0.08943852037191391,
0.3344298005104065,
-0.020066849887371063,
0.3190678656101227,
-0.3239889442920685,
0.34664687514305115,
1.1805421113967896,
-0.5075693726539612,
... |
def get _ max _ core _ threshold ( self, target ) : return query _ int _ attribute ( self, target, 0, nv _ ctrl _ gpu _ max _ core _ threshold ) | [
-0.36829110980033875,
0.5439115166664124,
0.6155693531036377,
1.107121467590332,
-0.4885038137435913,
-0.3841409683227539,
0.002761607989668846,
-1.1805908679962158,
0.42560553550720215,
0.1202927976846695,
-0.20958219468593597,
0.13154199719429016,
-1.0243146419525146,
-0.1184034347534179... |
def get _ host ( self ) - > str : return platform. node ( ) | [
0.32258880138397217,
0.04519229382276535,
0.3291078507900238,
0.3602064847946167,
-0.3313094675540924,
0.8494503498077393,
-0.4227089285850525,
0.15854480862617493,
-1.3581660985946655,
-0.1906515210866928,
0.8901394605636597,
0.8557876348495483,
-0.5701782703399658,
-0.8561946153640747,
... |
def bashlib _ filename ( ) : print ( bashlib _ filename ) | [
0.7219561338424683,
-1.1631485223770142,
0.3813127279281616,
0.45521673560142517,
-0.5230276584625244,
0.6961367130279541,
0.8765488862991333,
0.8445804715156555,
-1.3771148920059204,
-0.5966575741767883,
0.3508818447589874,
0.791541576385498,
1.4648007154464722,
0.04250314086675644,
0.1... |
def get _ norm ( self, side = 1 ) : # maths for collisions is based on normal pointing in the same direction # to the wall each time ( 90degrees ccw ). should be invariant though self. norm = np. concatenate ( ( - np. reshape ( self. vec [ :, 1 ], [ self. n, 1 ] ), np. reshape ( self. vec [ :, 0 ], [ self. n, 1 ] ) ), ... | [
-0.3685309588909149,
0.1548919975757599,
0.8658732175827026,
0.6079584956169128,
0.24060417711734772,
-0.33398643136024475,
1.033065676689148,
-0.2939490079879761,
-0.11883649975061417,
0.28336384892463684,
-0.2654869556427002,
-0.3482176661491394,
-0.7428227066993713,
0.6307768821716309,
... |
def psnr ( samples _ a, samples _ b ) : # gather maximum amplitude in signal a if samples _ a. dtype = = np. float32 : peak = 1. 0 elif samples _ a. dtype = = np. int16 : peak = 2 * * 15 # convert to 64 - bit integers to prevent potential integer overflow samples _ a = samples _ a. astype ( np. int64 ) samples _ b = sa... | [
0.6788231730461121,
-0.33454033732414246,
0.6440215706825256,
0.09437542408704758,
0.11777353286743164,
-1.2465497255325317,
-0.6464619040489197,
-0.11860206723213196,
0.13518701493740082,
0.5406783223152161,
0.1261652112007141,
0.7373796701431274,
-0.09244512766599655,
0.5925253629684448,... |
def api ( self ) : return api ( user = self. request. user ) | [
-0.6305683851242065,
-0.8862872123718262,
0.15462127327919006,
0.9872311949729919,
-0.1590682417154312,
0.5327565670013428,
0.05699273571372032,
-0.2289867401123047,
0.4179620146751404,
-1.1095969676971436,
-0.11075358092784882,
0.0945904552936554,
0.01726643741130829,
-0.5966379642486572,... |
def data ( self, index, role ) : if not index. isvalid ( ) : return row = index. row ( ) column = index. column ( ) node = index. internalpointer ( ) if role in [ qtcore. qt. displayrole, qtcore. qt. editrole ] : if column = = 0 : return node. name ( ) elif column = = 1 : return node. type ( ) elif column = = 2 and isi... | [
-0.9774484038352966,
-0.18424654006958008,
0.7171920537948608,
-0.5211160182952881,
-0.9186527729034424,
-0.30087774991989136,
0.15318676829338074,
-1.1992666721343994,
0.44670626521110535,
0.43604955077171326,
0.14173287153244019,
0.7067731022834778,
0.23836037516593933,
-0.49772763252258... |
async def say ( self, text : str, voice _ id : str, * * kwargs ) - > bytes : espeak _ cmd = [ self. espeak _ prog, " - v ", shlex. quote ( str ( voice _ id ) ), " - - stdout ", shlex. quote ( text ), ] _ logger. debug ( espeak _ cmd ) proc = await asyncio. create _ subprocess _ exec ( * espeak _ cmd, stdout = asyncio. ... | [
0.9001762270927429,
0.4955797791481018,
0.6562814712524414,
0.2860542833805084,
0.06713125109672546,
-0.4555198550224304,
-1.5360058546066284,
-0.5435778498649597,
0.0573892667889595,
0.553687572479248,
-0.06550545990467072,
0.9939467310905457,
-0.5436016917228699,
0.023526759818196297,
... |
def print _ chores ( chores : typing. list [ chore ] ) : for index, chore in enumerate ( chores ) : print ( f'{ index + 1 : 3 }. { chore. key : 3 } \'{ chore. name } \'' ) | [
-0.7231739163398743,
0.5717060565948486,
0.36607494950294495,
-0.16577839851379395,
-0.071193628013134,
0.9343615770339966,
0.18388594686985016,
-0.6566401720046997,
-0.3649754822254181,
0.07769940048456192,
-0.9387018084526062,
0.8870266675949097,
-0.018794076517224312,
0.5301932096481323... |
async def game ( self, ctx : ctx, game _ id : int ) : game = self. bot. client. get _ game ( game _ id ) home = game. host. username if game. host else'[ deleted user ]'if game. started _ at : away = game. away. username if game. away else'[ deleted user ]'else : away ='[ waiting for opponent ]'timings = ( f'each playe... | [
0.006170962937176228,
0.44372424483299255,
1.0177351236343384,
-0.5725075006484985,
-0.1281571239233017,
0.23493753373622894,
-0.8576439619064331,
-0.3935825228691101,
-0.1672920286655426,
1.1570335626602173,
0.12578704953193665,
0.6223372220993042,
0.41063442826271057,
0.27943024039268494... |
def keys _ upload ( ) : remote = bottle. request. get ('remote _ addr') params = bottle. request. query # check whether all parameters have been provided with the request if'mac'not in params. keys ( ) or'key'not in params. keys ( ) : logging. error ('request from % s : missing parameters. ', remote ) return bottle. ht... | [
-0.37720438838005066,
0.31495028734207153,
0.6360725164413452,
-0.19719935953617096,
0.033701226115226746,
-0.35466518998146057,
-0.3972705900669098,
-0.20444688200950623,
-1.0488700866699219,
0.7399324178695679,
0.8311665654182434,
0.2467103749513626,
-0.9369087815284729,
0.63526076078414... |
def _ mgui _ get _ max _ width ( self ) - > int : return self. _ qwidget. maximumwidth ( ) | [
0.45167335867881775,
0.3714521527290344,
0.4708770215511322,
0.5150417685508728,
-0.7129091024398804,
0.02038085088133812,
-0.5369971394538879,
0.07582741975784302,
0.5803924202919006,
-1.2353469133377075,
0.3434528708457947,
0.06678362190723419,
-0.6714580655097961,
0.9833866953849792,
... |
def protein _ alignment ( s, t ) : gap _ ext = - 1 gap _ open = - 11 blos = load _ matrix ( " blosum62. txt " ) m = len ( s ) n = len ( t ) # holds the number of substitutions between versions of the two strings edit _ mat = np. zeros ( ( m + 1, n + 1 ), dtype = int ) backtrack = edit _ mat. copy ( ) # fill left column... | [
-0.19689598679542542,
-0.8945847749710083,
0.957485556602478,
-0.3723495304584503,
-0.5952191352844238,
-0.6203553676605225,
0.44499096274375916,
-0.0947139710187912,
-0.1081794798374176,
0.5439621806144714,
0.42561227083206177,
0.3314276933670044,
0.23307794332504272,
-0.2203984558582306,... |
def _ _ init _ _ ( self, theta ) : super ( ). _ _ init _ _ ('rx ', 1, [ theta ] ) | [
-0.027728652581572533,
0.7573060989379883,
0.48655569553375244,
0.10757293552160263,
0.5640814900398254,
-0.2642059922218323,
0.1310158371925354,
-0.07700898498296738,
0.3622169494628906,
-0.4389612674713135,
-0.2628434896469116,
-0.06371542811393738,
-0.558344841003418,
-0.050727829337120... |
def acl6hitsrate ( self ) : try : return self. _ acl6hitsrate except exception as e : raise e | [
1.4239771366119385,
-0.28435033559799194,
0.016996394842863083,
0.3961515426635742,
0.0029302637558430433,
0.33109691739082336,
0.0023995121009647846,
-0.5950368046760559,
0.19370771944522858,
-0.2738213837146759,
0.845789909362793,
-0.5317775011062622,
-0.2965211272239685,
-0.431654930114... |
def _ _ getitem _ _ ( self, element ) : timestamp = self. redis _ instance. zscore ( self. set _ key, element ) return datetime. fromtimestamp ( timestamp ) if timestamp else none | [
0.005075122695416212,
0.709756076335907,
0.44612953066825867,
0.06996219605207443,
-0.36393603682518005,
-0.9834768176078796,
-1.1559303998947144,
-1.1274895668029785,
0.976934015750885,
0.9982403516769409,
-0.115890733897686,
-0.17580795288085938,
-0.01629437319934368,
-0.3644703924655914... |
def _ _ terminate _ hick ( self ) : def terminate ( procs ) : " " " terminates given list of processes @ param procs : list @ return : " " " for p in procs : p. terminate ( ) gone, alive = psutil. wait _ procs ( procs, timeout = 1 ) return alive hick _ procs = [ i for i in psutil. process ( os. getpid ( ) ). children (... | [
0.6733892560005188,
-0.5834845900535583,
0.9454820156097412,
0.5972045063972473,
1.5270236730575562,
-0.19059327244758606,
-0.38535499572753906,
-0.4199652075767517,
-0.2911911904811859,
0.08185219764709473,
-1.0823535919189453,
-0.08678336441516876,
-0.7069112062454224,
1.074609637260437,... |
def elapsed _ since ( data : iterable, min _ wait : int = 0 ) : last _ time = none # must be none for or logic to work below since 0 is true for i in data : current _ time = time. perf _ counter ( ) delta = current _ time - ( last _ time or current _ time ) if delta < min _ wait : delta = min _ wait - delta time. sleep... | [
-0.29743582010269165,
0.11626306921243668,
0.7498219013214111,
0.3732481002807617,
-0.9434810280799866,
0.7167803645133972,
0.10365179926156998,
-0.02431153506040573,
-0.09122810512781143,
-0.11689213663339615,
-0.5282524228096008,
-0.424538254737854,
-0.2855769693851471,
0.704386055469512... |
def resnet18 ( pretrained = false ) : model = resnet ( basicblock, [ 2, 2, 2, 2 ] ) if pretrained : model. load _ state _ dict ( model _ zoo. load _ url ( model _ urls ['resnet18'] ) ) return model | [
-0.1720864325761795,
0.14509479701519012,
0.17905963957309723,
0.5898960828781128,
0.21502892673015594,
-0.22006502747535706,
0.21660499274730682,
0.5151284337043762,
-0.16756689548492432,
-0.40430524945259094,
-1.3966641426086426,
-0.8060558438301086,
-0.02137221023440361,
-0.700361251831... |
def put ( self, item, block = true, timeout = none, evict = false ) : self. not _ full. acquire ( ) try : if self. maxsize > 0 : if evict and self. _ qsize ( ) = = self. maxsize : # evict the oldest, lowest priority item from the queue, # iff it is lower priority than this item : tail = heapq. nlargest ( 1, self. queue... | [
0.49773603677749634,
0.7100560069084167,
0.9631612300872803,
0.15677236020565033,
-0.37823888659477234,
0.23703838884830475,
-0.08225518465042114,
0.25658050179481506,
0.08194124698638916,
0.613724410533905,
-1.1115630865097046,
-0.39449170231819153,
-0.512304425239563,
0.14511020481586456... |
def test _ check _ input _ notbinary _ chmap ( ) : ch _ nonbin = np. zeros ( ( 3, 3, 3 ) ) ch _ nonbin [ 0, 1, 1 ] = 1 ch _ nonbin [ 0, 1, 2 ] = 2 with pytest. raises ( valueerror ) : mob. check _ inputs ( ch _ nonbin, basevalues _ idx = [ 0 ], window _ idx = 1 ) | [
-0.46781936287879944,
-0.2071497142314911,
0.6987469792366028,
1.207062840461731,
0.5288992524147034,
0.8111392855644226,
0.3491031527519226,
-0.7140661478042603,
-0.48086875677108765,
0.008577786386013031,
-0.29038605093955994,
0.557157039642334,
-1.2002365589141846,
1.125603199005127,
... |
def flatten ( x ) : return model. reshape ( x = x, target _ dim = 2 ) | [
-0.9314959049224854,
0.34074223041534424,
0.2664875090122223,
0.2952295243740082,
-0.050523072481155396,
-0.026917601004242897,
-0.19571642577648163,
0.1845150589942932,
0.16989566385746002,
-0.9294977188110352,
-1.0104690790176392,
0.12593089044094086,
0.3041512668132782,
-1.0694874525070... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.