text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def export _ best _ params ( file _ name, param _ grid ) : best _ params _ copy = param _ grid for best in best _ params _ copy : best _ params _ copy [ best ] = [ best _ params _ copy [ best ] ] df = pd. dataframe. from _ dict ( best _ params _ copy ) df. to _ csv ( file _ name, index = false ) | [
0.16639496386051178,
-0.2896910309791565,
0.3711552619934082,
1.52163565158844,
-0.077256940305233,
-0.004421820864081383,
-0.5353491902351379,
0.4162227213382721,
-0.5829723477363586,
0.9997782707214355,
-0.2482907772064209,
1.6912516355514526,
0.6743936538696289,
0.29851895570755005,
-... |
def remove _ from _ cart ( request, item _ id ) : product = get _ object _ or _ 404 ( product, pk = item _ id ) try : cart = request. session. get ('cart ', { } ) cart. pop ( item _ id ) messages. success ( request, f'you have removed { product. friendly _ name } from your cart') request. session ['cart'] = cart return... | [
-0.6363557577133179,
-1.5341871976852417,
0.447508305311203,
0.38374781608581543,
0.14498543739318848,
-0.41050416231155396,
0.4188198745250702,
-0.5730128884315491,
0.6206214427947998,
0.6189950704574585,
0.03276124224066734,
0.19990569353103638,
0.09870391339063644,
-0.3813985288143158,
... |
def key ( self ) : calendar = convertdate. hebrew year = - self. year if self. bc else self. year month = self. month _ num or calendar. year _ months ( year ) day = self. day if self. day is not none else calendar. month _ days ( year, month ) dates = [ ( year, month, day, 0. ), ( year, month + 1, 1, 1. ), ( year + 1,... | [
-0.853764533996582,
0.2470700442790985,
0.7368966937065125,
-0.22546032071113586,
-0.46711695194244385,
0.464232474565506,
0.20579417049884796,
0.1923275738954544,
-0.3750956356525421,
0.2756524980068207,
0.5055925846099854,
0.32819342613220215,
-0.5588704943656921,
1.1902003288269043,
0... |
def add _ conv _ block ( self, nout, kw, kh, sw, sh, pw, ph, bnpar = 1e - 3, leakyrelu = 0. 1, prelu = false ) : if len ( self. _ _ inps ) = = 0 or len ( self. _ _ fmaps ) = = 0 : raise valueerror ('specify the number of input dimensions and the image size!') out = ( float ( self. _ _ inps [ - 1 ] [ 0 ] + 2 * pw - kw )... | [
0.09369511157274246,
-0.08434819430112839,
1.0127993822097778,
1.0680115222930908,
-0.17913678288459778,
0.02132677100598812,
0.38650915026664734,
-0.34364768862724304,
-0.5233644843101501,
-0.05843227729201317,
-0.10589684545993805,
0.45365744829177856,
-0.5424745082855225,
1.412472963333... |
def compute _ avg _ err ( name, * cols, avgs = " ", errs = " - err " ) : # load all the runs for the given experiment name, and keep only a subset datas = tuple ( histogram. select ( histogram. session ( args. data _ directory / f " { name } - { seed } " ), * cols ) for seed in seeds ) # make the aggregated data frames... | [
-0.5362686514854431,
0.4650524854660034,
0.5590837001800537,
-0.04760269820690155,
0.31388092041015625,
-0.19644172489643097,
0.2791244089603424,
0.31697311997413635,
-0.3215446174144745,
0.7055507302284241,
-0.16576068103313446,
0.978100597858429,
0.0951835960149765,
-0.11105021089315414,... |
def obj ( x ) : sse = 0 self. sigma, self. kappa, self. theta, self. xi, self. rho = x for key, value in d. items ( ) : self. t = key combo = self. heston _ fft ( ) sse + = np. sum ( ( c - self. payoff ( k, combo ) ) * * 2 for k, c in value ) print ( sse, x ) return sse | [
0.16664357483386993,
0.33742719888687134,
0.30438223481178284,
-0.2322005331516266,
-0.4351242482662201,
0.05374055355787277,
0.04522022232413292,
0.05285261198878288,
0.20620980858802795,
0.22954566776752472,
-1.1138797998428345,
-0.07508940249681473,
0.3209575116634369,
1.065861344337463... |
def set _ size _ max ( self, mx ) : assert _ is _ cpo _ interval _ value ( mx ), " interval max should be an integer in [ interval _ min, interval _ max ] " assert mx > = self. size [ 0 ], " interval max should be lower or equal to interval max " self. size = ( self. size [ 0 ], mx ) | [
0.0740271583199501,
0.4475644528865814,
0.45375099778175354,
0.8392871618270874,
-0.11271416395902634,
1.1464329957962036,
-0.6205606460571289,
-0.0029928272124379873,
-0.2134953737258911,
0.33042633533477783,
-0.896221935749054,
0.9889692068099976,
-0.6938888430595398,
-0.3919756710529327... |
def _ _ getitem _ _ ( self, key ) : return self. raw [ key ] | [
-1.377690076828003,
-0.07196003198623657,
0.46154913306236267,
-0.636135458946228,
-1.261374831199646,
0.17799222469329834,
-0.5049360990524292,
-0.5035567283630371,
-0.18797099590301514,
-0.32073238492012024,
0.4036746323108673,
0.2568870782852173,
0.7595534324645996,
-1.0459648370742798,... |
def _ _ pad _ with _ zeros ( self, img ) : offset = [ 0, 0 ] if img. shape [ 0 ] < self. output _ size : delta = self. output _ size - img. shape [ 0 ] top = delta / / 2 bottom = delta - top img = cv2. copymakeborder ( img, top, bottom, 0, 0, cv2. border _ constant, value = [ 0, 0, 0 ] ) offset [ 0 ] = top if img. shap... | [
-0.3250328600406647,
-0.8299758434295654,
0.9703816175460815,
-0.1309281289577484,
-0.49795952439308167,
0.4259551763534546,
0.7211897373199463,
-0.09405972808599472,
0.6071926355361938,
-0.05932074412703514,
0.41389912366867065,
-0.3557456135749817,
0.2708733379840851,
1.4984887838363647,... |
def _ _ init _ _ ( self, token, environment ='sandbox') : if environment not in self. _ _ env : raise exception ('wrong environment') self. _ _ api _ url = self. _ _ env [ environment ] self. _ _ version ='v1'self. _ _ name _ path _ map = { } self. _ _ add _ path _ map ('rfq ','/ request _ quotes') self. _ _ add _ path... | [
-0.3156795799732208,
-0.2450263947248459,
0.9517860412597656,
0.4315448999404907,
1.0038659572601318,
-0.014832157641649246,
0.0017402478260919452,
-1.0590121746063232,
-0.09770425409078598,
0.019950969144701958,
-0.35981816053390503,
0.08597007393836975,
0.11867279559373856,
0.94334501028... |
def _ open _ input _ chunks ( self, job ) : self. inputchunks = [ inputchunk. open ( ) for inputchunk in job. inputchunks ] self. loadeddata = [ ] for loadinputchunk in job. loadedinputchunks : self. loadeddata. append ( list ( loadinputchunk. open ( ) ) ) loadinputchunk. close ( ) | [
-0.7462611794471741,
-0.6490423679351807,
0.5413946509361267,
-1.4954650402069092,
-0.5602330565452576,
0.7152130007743835,
0.03358537703752518,
0.10620635002851486,
-0.7741687297821045,
-1.0138823986053467,
0.11325099319219589,
0.7095535397529602,
-0.1886131316423416,
0.48560044169425964,... |
def monthly _ avgs ( means ) : mtotals = [ ] cday = 0 for i in range ( 12 ) : msum = sum ( means [ cday : cday + dim [ i ] ] ) / dim [ i ] mtotals. append ( msum ) cday + = dim [ i ] ncm = [ ] for j in range ( 12 ) : ncm + = [ mtotals [ j ] ] * dim [ j ] return ncm | [
-0.45338767766952515,
0.6535046100616455,
0.6808175444602966,
-0.3550093472003937,
-0.542151153087616,
0.13702164590358734,
0.02625894546508789,
-0.3061244487762451,
0.5832629203796387,
0.5580070614814758,
-0.2513692378997803,
0.49026116728782654,
0.2632037103176117,
1.3050503730773926,
... |
def create _ time ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " create _ time " ) | [
0.766480028629303,
-0.220526784658432,
0.37162187695503235,
-0.045219358056783676,
0.9170966148376465,
1.0356274843215942,
-0.5085974335670471,
-0.3539467751979828,
-0.3779527544975281,
0.9884400963783264,
-0.2151801884174347,
0.05454324558377266,
0.23610417544841766,
-0.6390113234519958,
... |
def print _ cities ( db ) : session = db [ 1 ] i = session. query ( city, state ). filter ( state. id = = city. state _ id ) for c, s in i : print ( s. name,': ( { } ) '. format ( c. id ), c. name, sep ='' ) session. close ( ) db [ 0 ]. dispose ( ) | [
0.305769145488739,
-0.9691874980926514,
0.48756977915763855,
-0.786389946937561,
-0.6301787495613098,
0.19244007766246796,
-0.1353181004524231,
-0.17549020051956177,
-0.016277415677905083,
0.517983078956604,
-0.39861366152763367,
0.3723142743110657,
0.1887931227684021,
0.7181279063224792,
... |
def set _ inputs ( self, * values ) : for i in range ( 4 ) : if not isinstance ( values [ i ], connector ) : self. leads = [ none ] * 4 self. _ history = [ 0 ] * 4 raise exception self. set _ input ( i, values [ i ] ) self. _ history [ i ] = values [ i ]. state | [
-0.9404261112213135,
0.1417018622159958,
0.46984773874282837,
0.5262678265571594,
0.8038361072540283,
0.14705796539783478,
0.6138051152229309,
-0.9585657715797424,
0.3841080963611603,
-1.0657529830932617,
-0.08364959806203842,
-0.0061709643341600895,
-1.0407769680023193,
0.5601955056190491... |
def _ _ init _ _ ( self, fastas, labels, max _ seqs = 45 ) : self. is _ sparse = false self. edge _ indices = none self. edge _ weights = none self. f = none # holder for hdf5 file self. data = np. zeros ( ( len ( fastas ), max _ seqs, 3 ) ) self. labels = np. array ( labels, dtype = np. long ) self. dist = np. zeros (... | [
0.19217972457408905,
-0.4001549482345581,
0.6315516233444214,
-0.17722231149673462,
-0.06442754715681076,
-0.12666958570480347,
0.04543166607618332,
0.7475417852401733,
0.13355964422225952,
0.623602032661438,
0.20643813908100128,
-0.3967437446117401,
0.4717382788658142,
-0.1185825690627098... |
def test _ zope _ root _ default _ challenge ( self ) : # check the zope root pas plugin configuration self. assertin ( " credentials _ basic _ auth ", self. root _ acl _ users. objectids ( ), " basic auth plugin missing from zope root ` / acl _ users ` ", ) basic _ plugin = self. root _ acl _ users. credentials _ basi... | [
0.2753169536590576,
-0.7792441248893738,
0.36360660195350647,
0.5666531324386597,
0.6598005890846252,
-0.0907762423157692,
0.645522952079773,
-0.33101072907447815,
0.5753695368766785,
0.3304429054260254,
-0.17036908864974976,
0.09341174364089966,
-0.5109299421310425,
-0.3919549882411957,
... |
def test _ at _ symbol _ in _ username ( self ) : parts = normalize ('user @ example. com @ www. example. com') eq _ ( parts [ 0 ],'user @ example. com') eq _ ( parts [ 1 ],'www. example. com') | [
-0.3090705871582031,
0.24702492356300354,
0.21564741432666779,
-0.22837196290493011,
-0.3041646480560303,
0.3662305176258087,
1.3568713665008545,
-0.21119439601898193,
0.7952438592910767,
-0.6360233426094055,
-0.40916433930397034,
0.8554710149765015,
-0.485896497964859,
-0.6896067261695862... |
def test _ p2p _ random _ dataset _ 0 ( bid _ dataset _ 0 ) : df = bid _ dataset _ 0 r = np. random. randomstate ( 1234 ) trans, extra = p2p _ random ( df, r = r ) trading _ list = [ [ ( 1, 3 ), ( 2, 4 ), ( 0, 5 ) ], [ ( 2, 3 ) ], [ ( 0, 3 ), ( 2, 5 ) ] ] assert trading _ list = = extra ['trading _ list'] true _ trans ... | [
-0.3526563346385956,
0.4297817647457123,
0.9029299020767212,
-0.4887924790382385,
-0.1605924516916275,
0.405755877494812,
0.31870800256729126,
0.32994866371154785,
0.11604753136634827,
0.2858280837535858,
-0.6473343372344971,
-0.0582822747528553,
-0.016878964379429817,
-0.5166971683502197,... |
def setmode ( self, mode ) : self. mode = mode self. update = false | [
-1.1123112440109253,
-0.30817028880119324,
0.39462894201278687,
-0.5235875248908997,
-0.02239122986793518,
1.5605665445327759,
-0.17229346930980682,
0.8187586069107056,
-0.3909011483192444,
0.028029287233948708,
-0.5832009315490723,
-0.4332011640071869,
-1.069549560546875,
0.34036272764205... |
def shell _ sqlalchemy ( session : sqlalchemysession, backend : shellbackend ) : namespace = {'session': session } namespace. update ( backend. get _ namespace ( ) ) embed ( user _ ns = namespace, header = backend. header ) | [
0.8150016069412231,
-0.39445412158966064,
0.5036830306053162,
0.010084536857903004,
-0.11248981207609177,
0.058210473507642746,
-0.7024530172348022,
-1.0072340965270996,
1.187412977218628,
-0.0032412507571280003,
0.18190555274486542,
0.883550226688385,
0.9798591732978821,
-0.03678134083747... |
def get _ number ( file ) : numofvar = - 1 infile = open ( file + '. c ','r') for line in infile. readlines ( ) : matchobj = re. match ( r'for ', line, re. m | re. i ) if matchobj : line _ group1 = line. split (';') line _ group2 = line _ group1 [ 1 ]. split ('<') numofvar = line _ group2 [ 1 ]. strip ( ) return int ( ... | [
0.2789420485496521,
-0.02943846397101879,
0.8169151544570923,
0.14116495847702026,
-0.5023597478866577,
-0.22338953614234924,
1.3362231254577637,
0.9267013072967529,
-1.4604010581970215,
-0.7395985126495361,
-0.27692312002182007,
-0.2312045395374298,
0.08458231389522552,
0.604266881942749,... |
def pano _ to _ text _ handler ( ) : panoid = request. args. get ('panoid ','null') panolat = float ( request. args. get ('panolat ', 0. ) ) panolng = float ( request. args. get ('panolng ', 0. ) ) heading = float ( request. args. get ('heading ', 0. ) ) placename = request. args. get ('placename ','null') print panoid... | [
-1.1567691564559937,
-0.8877029418945312,
0.481747031211853,
-0.14368212223052979,
-1.1578267812728882,
-0.419479638338089,
-0.27641868591308594,
-0.1685747504234314,
0.06346320360898972,
0.5682042241096497,
-1.572717308998108,
-0.3655620515346527,
-0.34146347641944885,
-0.2414721846580505... |
def get _ parser ( ) : parser = argparse. argumentparser ( description ='train') def comma _ sep _ float _ list ( comma _ str ) : return [ float ( i _ str ) for i _ str in comma _ str. split ( ',') if i _ str! ='' ] def comma _ sep _ int _ list ( comma _ str ) : return [ int ( i _ str ) for i _ str in comma _ str. spli... | [
0.026053084060549736,
-0.10419531911611557,
0.9381999969482422,
-0.45383337140083313,
0.6906231045722961,
0.3214894235134125,
0.4858626425266266,
0.5611065030097961,
-1.249714970588684,
0.39430201053619385,
-0.2924463152885437,
-0.03263537213206291,
-0.24923591315746307,
0.4977762699127197... |
def get _ tile _ at ( self, horizontal _ index, vertical _ index ) : row = self. get _ tiles _ in _ row ( vertical _ index ) try : tile = row [ horizontal _ index ] except indexerror : raise indexerror ( " invalid position : { horizontal }, { vertical } ". format ( horizontal = horizontal _ index, vertical = vertical _... | [
0.29947006702423096,
-0.25098365545272827,
0.5091097950935364,
0.37167903780937195,
1.029205083847046,
-0.37004324793815613,
-0.1870749294757843,
-0.8580155968666077,
-1.0069392919540405,
0.00861022062599659,
0.3695017397403717,
0.8517608642578125,
-0.20853112637996674,
-1.4550745487213135... |
def get _ zone ( coord ) : # there are 60 longitudinal projection zones numbered 1 to 60 starting at 180w # so that's - 180 = 1, - 174 = 2, - 168 = 3 zone = ( ( coord - - 180 ) / 6. 0 ) return int ( math. ceil ( zone ) ) | [
-0.19383685290813446,
-0.10513512045145035,
0.5868626832962036,
-0.48006969690322876,
-0.3903736174106598,
-0.3123672604560852,
0.38038724660873413,
-0.5759197473526001,
0.4916168451309204,
-0.027495870366692543,
-0.3544960021972656,
-0.05230477452278137,
-0.1753215491771698,
-0.4949372410... |
def gaussian ( x, hwhm _ g ) : return np. sqrt ( np. log ( 2 ) / np. pi ) / hwhm _ g * np. exp ( - ( x / hwhm _ g ) * * 2 * np. log ( 2 ) ) | [
0.4170212745666504,
-0.5639404058456421,
0.3025662899017334,
-0.22991681098937988,
-0.9061954021453857,
0.755671501159668,
-0.6153664588928223,
0.32527807354927063,
-0.25850924849510193,
0.11070512235164642,
0.0058206841349601746,
1.3327393531799316,
-0.4578409492969513,
0.4723655581474304... |
def getnames ( cf, is _ regexp ) : delimiter = cf. get _ parameter ('delimiter ','string') if delimiter = ='tab': delimiter ='\ t'reader = csv. reader ( open ( cf. get _ input ('namelist'),'rb'), delimiter = delimiter, \ quoting = csv. quote _ none ) names = [ ] for row in reader : if not len ( row ) > 0 : continue eli... | [
-0.650460422039032,
0.2488548457622528,
0.7389135360717773,
0.44699907302856445,
0.2880436182022095,
0.040586814284324646,
-0.5799895524978638,
0.32217127084732056,
-0.3629014790058136,
1.0237947702407837,
-0.450406014919281,
0.13067014515399933,
-0.2830093204975128,
0.3655230402946472,
... |
def match ( self, txs, ptr ) : # print ('comparing ', txs ) if len ( self. tmpl ) = = 0 : return 0 # no matches if no templates if len ( txs ) = = 0 : return 0 # string is empty lim = bound ( txs ) # get limit for matching tx = list ( x. lower ( ) for x in txs [ : lim ] ) # separate copy to scan # print ('tx = ', tx ) ... | [
-0.9350486397743225,
-0.28741151094436646,
0.8553966283798218,
-0.43098440766334534,
-1.289873719215393,
-0.3008882403373718,
0.5438531637191772,
0.2612392008304596,
0.08410676568746567,
0.07481414079666138,
0.026828207075595856,
-0.4526735246181488,
-0.7006343007087708,
0.8903301358222961... |
def _ _ contains _ _ ( self, item ) : return self. _ execute _ script ('contains ', self. key, self. client. encode ( item ) ) | [
-0.27169057726860046,
-0.022607849910855293,
0.3853709399700165,
0.44226208329200745,
-0.26814836263656616,
-0.2581532597541809,
-0.9047856330871582,
-1.4348713159561157,
0.1688089221715927,
0.4163128137588501,
-0.33830490708351135,
0.3597163259983063,
-1.4322589635849,
-0.4110588133335113... |
def test _ filtercustomers _ no ( intercompartylist ) : nocustomers = intercompartylist. filtercustomers ( nolist, office, longdistance ) verify _ answer ( nocustomers, [ ] ) | [
0.13095249235630035,
0.0913943350315094,
0.4405441880226135,
0.022560346871614456,
-0.23247015476226807,
-0.31109291315078735,
-0.4421031177043915,
1.2599209547042847,
-0.4889930188655853,
-0.28310197591781616,
-1.0237284898757935,
0.25103920698165894,
-1.324323296546936,
0.006412486080080... |
def processedgecell ( cell ) : # if cell's faction is not unknown, it has already been processed # so do nothing else. if not cell. isfactionunknown ( ) : return for sidedir in hexsidedir : adjcell = cell. adjcells [ sidedir ] # if adjacent cell is none, it is the outside of the board if adjcell is none : # if the side... | [
0.0365610308945179,
0.7091062664985657,
0.6743752360343933,
-0.013841330073773861,
0.9738781452178955,
-0.4442196190357208,
0.16910335421562195,
0.23694191873073578,
0.06094054505228996,
0.26348447799682617,
0.05126870423555374,
-0.49661925435066223,
0.2974908947944641,
0.9646415114402771,... |
def adddescriptor ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.32026347517967224,
0.03109150379896164,
0.554623007774353,
0.33167192339897156,
0.7833998799324036,
0.4954695701599121,
-0.18599069118499756,
0.19861488044261932,
0.26408684253692627,
-0.9971352219581604,
-0.0011040406534448266,
0.3428846597671509,
-0.35162898898124695,
1.02726089954376... |
def establish _ service ( ) : # if modifying these scopes, delete the file token. pickle. scopes = ['https : / / www. googleapis. com / auth / gmail. send'] creds = none # the file token. pickle stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the fir... | [
-0.01673751324415207,
-0.8451866507530212,
0.36510342359542847,
-0.1594914346933365,
0.4789384603500366,
0.27583545446395874,
-0.4636971354484558,
-0.7232868075370789,
0.30882883071899414,
-0.3173348307609558,
-0.411891371011734,
1.4192782640457153,
-0.31034550070762634,
0.0500930435955524... |
def get _ input _ spec ( self ) - > union [ spec, none ] : return none | [
-0.042790547013282776,
0.08536127954721451,
0.3600364327430725,
0.11254215240478516,
0.15915502607822418,
0.279257595539093,
0.4719626009464264,
-0.6407459378242493,
0.34775421023368835,
-0.8164836764335632,
0.1476074904203415,
0.44920530915260315,
-0.11707991361618042,
-0.5323659777641296... |
def avg _ time _ for _ query _ n ( n : int, df : dataframe ) - > int : is _ query _ n = df [ col _ query ] = = n query _ n = df [ is _ query _ n ] avg _ time = 0 for _, row in query _ n. iterrows ( ) : avg _ time + = row [ col _ time ] avg _ time / = len ( query _ n. index ) return avg _ time | [
-1.2585022449493408,
1.141548991203308,
0.16073626279830933,
-0.14353206753730774,
0.26178452372550964,
-0.14232806861400604,
-0.06556959450244904,
-0.6095900535583496,
-0.1267424374818802,
1.3361364603042603,
0.013027511537075043,
0.22643937170505524,
0.35032716393470764,
0.86079639196395... |
def _ _ init _ _ ( _ _ self _ _, *, create _ time : optional [ pulumi. input [ str ] ] = none, description : optional [ pulumi. input [ str ] ] = none, labels : optional [ pulumi. input [ mapping [ str, pulumi. input [ str ] ] ] ] = none, name : optional [ pulumi. input [ str ] ] = none, project : optional [ pulumi. in... | [
-0.8392728567123413,
0.5447582602500916,
0.9837788343429565,
-0.19955505430698395,
1.0397785902023315,
0.5683018565177917,
-0.7054249048233032,
0.591891884803772,
0.539607584476471,
0.972634494304657,
-0.8332456350326538,
0.29054078459739685,
-0.04941100999712944,
-0.6230248808860779,
-0... |
def validate _ network _ rules ( mt _ type, swift _ message _ obj, swift _ message, acm _ obj, swift _ metadata _ xml _ dom = none ) : notifier. debug ( " { 0 } validating network rules ". format ( mt _ type ) ) fmt _ network _ rules _ class _ obj = fswiftwritermtfactory. fswiftwritermtfactory. create _ fmt _ network _... | [
-0.3365984261035919,
0.09319404512643814,
0.5705650448799133,
-0.5708231329917908,
0.6631631255149841,
0.22320221364498138,
0.2729339003562927,
-1.0143848657608032,
-0.9533001780509949,
0.2978266477584839,
0.13150253891944885,
-0.6224037408828735,
-0.48335978388786316,
1.6584551334381104,
... |
def _ accu _ rate ( predictions, labels ) : if labels. shape [ - 1 ] > 1 : return 100. 0 * \ np. sum ( np. argmax ( predictions, 1 ) = = np. argmax ( labels, 1 ) ) / \ predictions. shape [ 0 ] else : return 100. 0 * \ np. sum ( ( predictions > 0. 5 ) = = labels ) / \ predictions. shape [ 0 ] | [
-0.22900672256946564,
0.18096061050891876,
0.3743257224559784,
-0.34522268176078796,
0.04491540044546127,
-0.19914701581001282,
0.13882705569267273,
0.20278914272785187,
-0.6105649471282959,
1.220635175704956,
1.9460327625274658,
0.423126220703125,
0.4146912097930908,
-0.14116139709949493,... |
def post ( self ) : grant _ type = flask. request. form. get ('grant _ type') if grant _ type is none : error = exception. oauth2invalidrequest ( int ( http. client. bad _ request ), http. client. responses [ http. client. bad _ request ], _ ('the parameter grant _ type is required.') ) log. info ('get oauth2. 0 access... | [
-0.19777557253837585,
-1.1533254384994507,
0.8597472906112671,
0.4009818732738495,
-0.3798716068267822,
-0.7253921031951904,
-0.11734003573656082,
-0.6213235259056091,
-0.6285303235054016,
0.11354940384626389,
0.8080495595932007,
1.0594521760940552,
0.48004820942878723,
0.8014428019523621,... |
def getbulk ( self, oid ) : vars = netsnmp. varlist ( netsnmp. varbind ( oid ) ) # must be a list # res = netsnmp. snmpgetbulk ( 1, oid, version = version, desthost = dest _ host, community = community ) res = self. session. getbulk ( 0, 100, vars ) if res : # print res for var in vars : print " % s. % s = % s : % s " ... | [
-0.5928274989128113,
-0.022812729701399803,
0.6289253234863281,
0.014371933415532112,
0.2764159142971039,
-0.7208196520805359,
-1.0449960231781006,
-0.8729532957077026,
1.0107083320617676,
0.18587112426757812,
-0.9476573467254639,
0.684515655040741,
-0.4323261082172394,
0.7600830793380737,... |
def delete ( user _ id, self, productid ) : product. delete _ product ( dict _ cursor, cursor, productid, user _ id ) return { " message " : " product deleted successully " }, 200 | [
0.050412941724061966,
-0.7014402151107788,
0.24074755609035492,
1.626150369644165,
0.4855242669582367,
0.5276817083358765,
0.2984470725059509,
-0.3345487415790558,
0.7737848162651062,
0.4191051423549652,
-0.3084324300289154,
0.4202127158641815,
-0.09168855845928192,
0.19880042970180511,
... |
def add _ celery _ canvas ( self, canvas, dependencies = none ) : type _ map = { entities. signature : self. add _ celery _ signature, entities. chord : self. add _ celery _ chord, entities. chain : self. add _ celery _ chain, entities. group : self. add _ celery _ group, } handler = type _ map [ type ( canvas ) ] retu... | [
-0.05035184696316719,
0.2862650752067566,
0.6199416518211365,
0.4007326364517212,
-0.4020419418811798,
0.3214951455593109,
0.9690268039703369,
-1.156303882598877,
0.5175557136535645,
-0.8849360942840576,
0.045985203236341476,
0.262271523475647,
0.2619844377040863,
1.0060150623321533,
0.5... |
def index ( ) : messages = [ ] auth = ( os. environ. get ('twilio _ account _ sid'), os. environ. get ('twilio _ auth _ token') ) r = requests. get ( " http : / / api. twilio. com / 2010 - 04 - 01 / accounts / " + os. environ. get ('twilio _ account _ sid') + " / messages. json? datesent > = " + str ( datetime. date. t... | [
0.19134816527366638,
0.12935543060302734,
0.5492704510688782,
-0.6405012607574463,
0.03267909958958626,
0.32623282074928284,
-0.18354585766792297,
-0.35008588433265686,
-0.3565792143344879,
0.32402244210243225,
0.6898244619369507,
0.2331104427576065,
-0.39074331521987915,
0.425050020217895... |
def minimum ( a, b, out = none, queue = none ) : # silly, but functional return if _ positive ( a. mul _ add ( 1, b, - 1, queue = queue ), b, a, queue = queue, out = out ) | [
0.25089606642723083,
-0.21895438432693481,
0.5971177220344543,
0.8775729537010193,
-1.3695883750915527,
-0.7759480476379395,
-0.9983704090118408,
-0.6379131078720093,
0.6432342529296875,
0.04141882807016373,
0.4391223192214966,
-0.14754796028137207,
-0.3841392695903778,
-0.0279528852552175... |
def _ multiply _ from _ right ( mat _ list ) : out = mat _ list [ - 1 ] for mat in reversed ( mat _ list [ : - 1 ] ) : out = mat @ out return out | [
-0.22198723256587982,
0.07633677870035172,
0.8015336990356445,
0.6968777775764465,
-0.29545119404792786,
0.03713732957839966,
-0.6352594494819641,
-0.43874603509902954,
0.408951073884964,
0.6551545858383179,
-0.4547090232372284,
-0.8345996141433716,
-0.5797180533409119,
0.8404189944267273,... |
def _ _ init _ _ ( self, fpath, continuous _ data _ type ='downsampled ', spike _ name ='spikes ', clustering _ name = none, no _ waveforms = false, no _ spikes = false, ignore _ cluster _ zero = false, position _ data _ name ='processedpos ', verbose = false ) : self. verbose = verbose self. _ fpath = parse _ fpath ( ... | [
0.271727979183197,
0.09812038391828537,
0.971136212348938,
-0.0550200454890728,
-0.20248758792877197,
-0.07129788398742676,
0.5674309134483337,
0.07027524709701538,
-0.5739095211029053,
0.0705796405673027,
-0.29106077551841736,
-0.4871726632118225,
0.11996076256036758,
-0.17211154103279114... |
def join ( * parts ) : path = os. path. join ( * parts ) if os. name = ='nt': path = path. replace ('\ \ ','/') return path | [
0.7059624791145325,
-0.18376000225543976,
0.4400938153266907,
0.31127846240997314,
-0.38156890869140625,
1.3219268321990967,
-0.5673497319221497,
-0.3088056743144989,
-0.8262266516685486,
0.05705687776207924,
0.6580005288124084,
-0.8291069865226746,
-1.4814289808273315,
-0.4355586469173431... |
def _ is _ skip _ token ( token ) : return ( token. type = = tokenize. nl or token. type = = tokenize. newline or ( token. type = = tokenize. name and token. string = = " class " ) or token. line. strip ( ). startswith ( " @ " ) ) | [
-1.4091371297836304,
0.02685079723596573,
0.667570948600769,
0.03897804394364357,
-0.5172985792160034,
-0.10313039273023605,
-0.5219376087188721,
-1.2863363027572632,
-0.11648347228765488,
0.24159809947013855,
-0.30845415592193604,
0.17853854596614838,
0.13642628490924835,
0.29501137137413... |
def blog _ not _ found ( request : request, exception : blognotfound ) - > json : return json ( { " message " : " oooooops! cannot found the blog! ",'status': exception. status _ code,'error': exception. args [ 0 ],'results': none, }, status = exception. status _ code ) | [
-0.8137308359146118,
-0.19595277309417725,
0.32269060611724854,
0.007499347440898418,
-0.020939886569976807,
-0.06399916112422943,
-0.0843677967786789,
-0.5087652802467346,
-0.11138703674077988,
1.0700334310531616,
-0.2537367641925812,
0.582179069519043,
0.00972786545753479,
0.083893112838... |
def validatevcf ( filepath ) : print ( " validating vcf file " ) required _ headers = [ " # chrom ", " pos ", " id ", " ref ", " alt ", " qual ", " filter ", " info " ] # format is optional total _ error = " " warning = " " headers = none with open ( filepath, " r " ) as foo : for i in foo : if i. startswith ( " # chro... | [
0.4371090233325958,
-0.5281657576560974,
0.6733188033103943,
-0.012071048840880394,
0.1407003402709961,
0.00006773425411665812,
0.514424741268158,
0.22774353623390198,
-0.5145990252494812,
-0.026649506762623787,
-0.05870482698082924,
0.34803852438926697,
-0.27211520075798035,
-0.2956455945... |
def apply _ clock _ corrections ( self ) : # first make sure that we haven't already applied clock corrections flags = self. table ['flags'] if any ( [ f. has _ key ('clkcorr') for f in flags ] ) : log. warn ( " some toas have'clkcorr'flag. not applying new clock corrections. " ) return # an array of all the time corre... | [
-0.43364447355270386,
-0.11684123426675797,
0.4400665760040283,
-0.3168666958808899,
-0.1758284866809845,
-0.33876484632492065,
0.8833547830581665,
-0.19644464552402496,
-0.4781108498573303,
0.8494634628295898,
0.6889232993125916,
0.12888705730438232,
-0.13384008407592773,
1.35373008251190... |
def live _ server ( request ) : skip _ if _ no _ django ( ) import django addr = request. config. getvalue ( " liveserver " ) or os. getenv ( " django _ live _ test _ server _ address " ) if addr and " : " in addr : if django. version > = ( 1, 11 ) : ports = addr. split ( " : " ) [ 1 ] if " - " in ports or ", " in port... | [
0.14062540233135223,
-0.7719993591308594,
0.5339590311050415,
-0.5086063742637634,
0.277716726064682,
0.7606887817382812,
0.640762209892273,
0.30263039469718933,
1.1031982898712158,
0.14087626338005066,
0.1534142941236496,
-0.2127084732055664,
-0.3778473138809204,
-0.29892393946647644,
-... |
def create _ table ( self, conn, create _ table _ sql ) : try : c = conn. cursor ( ) # interface of database c. execute ( create _ table _ sql ) logger. info ( " table created " ) except error as e : logger. error ( " can not create table " ) | [
1.1537363529205322,
0.06422589719295502,
0.3596886098384857,
1.6188853979110718,
1.4132895469665527,
0.40954557061195374,
-0.3144156336784363,
0.09253507107496262,
-1.1771599054336548,
0.47232359647750854,
0.2555130422115326,
-0.24882017076015472,
0.3632654547691345,
0.4840112328529358,
... |
def get _ gene _ symbols ( self, * confidence _ levels : str ) : return self. select _ from _ genes ( " symbol ", * confidence _ levels ) | [
-0.7494046688079834,
0.26590949296951294,
-0.051854874938726425,
0.7116233706474304,
0.6360666751861572,
-0.10954507440328598,
-0.4492233097553253,
-0.43519023060798645,
-1.3151724338531494,
0.04084400460124016,
-0.14765730500221252,
0.6594100594520569,
0.06934008002281189,
-0.072858780622... |
def test _ determine _ workers ( self ) : self. job _ 2. number _ of _ processes, self. job _ 2. workers = 1, none self. job _ 2. _ determine _ workers ( ) self. assertequal ( self. job _ 2. workers, 1 ) self. job _ 2. number _ of _ processes, self. job _ 2. workers = 2, none self. job _ 2. _ determine _ workers ( ) se... | [
-0.0863044410943985,
-0.49166449904441833,
0.8978297114372253,
-0.36693376302719116,
1.1098839044570923,
-0.5217713713645935,
0.6588825583457947,
-0.7987663745880127,
-1.0881338119506836,
-1.1198208332061768,
-1.1283375024795532,
-0.33579692244529724,
0.11825151741504669,
0.541291713714599... |
def _ _ init _ _ ( self ) : self. _ element _ list = [ ] # collection elements self. _ element _ to _ indicies = { } # collection element to set of inidicies containing that element | [
-0.48594677448272705,
-0.34092244505882263,
0.2702621519565582,
-0.2742284834384918,
0.6085184216499329,
0.507620632648468,
0.5959673523902893,
0.9069226384162903,
-0.3938669264316559,
-0.3709886968135834,
-1.0937795639038086,
-0.06119811534881592,
-0.4702587127685547,
0.08422097563743591,... |
def find _ best _ cycle ( road _ map _ 0 ) : attempts = 10000 random. seed ( 1 ) upper _ limit = len ( road _ map _ 0 ) - 1 tracking _ list = [ ] tracking _ list. append ( road _ map _ 0 ) index1 _ 0 = random. randint ( 0, upper _ limit ) index2 _ 0 = random. randint ( 0, upper _ limit ) tracking _ list. append ( shift... | [
-0.6459628939628601,
0.009253686293959618,
1.153363823890686,
0.0026237438432872295,
-0.3922112286090851,
0.42483800649642944,
0.5522322058677673,
-0.06137929856777191,
-0.37467464804649353,
0.5388370156288147,
0.09149327874183655,
0.030906453728675842,
-0.7677539587020874,
-0.594738006591... |
def _ _ init _ _ ( self, args, relations ) : self. args = args self. relations = relations # super ( lowlabelelldataset, self ). _ _ init _ _ ( mode ) self. _ prepare _ params ( relations ) self. _ load ( ) | [
0.8271926045417786,
0.07340448349714279,
0.5822014808654785,
-1.196847677230835,
0.3825097680091858,
0.3676304519176483,
-0.0465562604367733,
0.23064352571964264,
-0.11386433988809586,
-1.2819323539733887,
0.7159682512283325,
0.6314284205436707,
-0.5721102356910706,
0.21452738344669342,
... |
def _ _ start _ visualisation ( self ) : self. c _ logger. info ( " starting visualisation. " ) from _ date = self. _ _ get _ date _ from _ calendar ( self. visualisation _ from _ calendar _ instance ) to _ date = self. _ _ get _ date _ from _ calendar ( self. visualisation _ to _ calendar _ instance ) date _ range = s... | [
-0.36606365442276,
0.7433217763900757,
0.7831902503967285,
-1.0298633575439453,
-0.4809907376766205,
0.8583768010139465,
0.36643916368484497,
-0.29531100392341614,
-0.8357643485069275,
0.37549546360969543,
-0.377817302942276,
0.4172711670398712,
0.6224642395973206,
0.6630159020423889,
0.... |
def push _ if ( self ) : self. if _ stack. append ( ifentry ( len ( self. scopes ) ) ) | [
0.40265586972236633,
1.1007412672042847,
0.3564639985561371,
-0.045541275292634964,
0.734310507774353,
-0.24996323883533478,
0.05359597131609917,
-0.5737391114234924,
0.42540809512138367,
0.7546351552009583,
-0.37128081917762756,
0.9161108732223511,
-0.5252191424369812,
0.631411612033844,
... |
def _ _ orientation ( self, p, q, r ) : val = ( float ( q. y - p. y ) * ( r. x - q. x ) ) - ( float ( q. x - p. x ) * ( r. y - q. y ) ) if ( val > 0 ) : # clockwise orientation return 1 elif ( val < 0 ) : # counterclockwise orientation return 2 else : # colinear orientation return 0 | [
-0.24335502088069916,
-0.28107208013534546,
0.6216204762458801,
-0.6033158302307129,
0.1476413607597351,
0.5520932674407959,
0.05532718822360039,
-0.6390989422798157,
-0.15901489555835724,
0.9078882932662964,
0.29857292771339417,
-0.6400372385978699,
-0.7362787127494812,
-1.323573350906372... |
def connector _ config _ path _ fixture ( inputs, base _ path ) - > path : return path ( base _ path ) / getattr ( inputs, " config _ path " ) | [
-0.5406481623649597,
-0.8602571487426758,
0.3726503551006317,
0.4612475633621216,
0.38813644647598267,
0.31423425674438477,
1.1000192165374756,
-0.0731240063905716,
-0.23558856546878815,
-0.11240407824516296,
0.6965128183364868,
-1.0024148225784302,
0.22496305406093597,
-0.0058752507902681... |
def pad4 ( seq ) : return _ value = [ ] for thing in seq : return _ value. append ( " 0 " * ( 4 - len ( thing ) ) + thing ) return return _ value | [
-0.41438746452331543,
-0.7277713418006897,
0.5580101609230042,
-0.11960622668266296,
-0.026951033622026443,
0.18757274746894836,
-0.8230449557304382,
0.2007959634065628,
0.30831167101860046,
0.46509841084480286,
-1.0064102411270142,
-0.9843353629112244,
-0.48581066727638245,
1.160981178283... |
def getlegalmoves ( self, state, role ) : if self. thebackingmachine = = none : return none try : return self. thebackingmachine. getlegalmoves ( state, role ) except movedefinitionexception as me : raise me except exception as e : self. failgracefully ( e, none ) except outofmemoryerror as e : raise e except threaddea... | [
0.29409199953079224,
0.3007981479167938,
0.5887196660041809,
0.07522375881671906,
0.6090363264083862,
-0.5001170635223389,
-0.7016064524650574,
-0.4673144519329071,
0.31117844581604004,
0.2895301282405853,
0.7577652931213379,
0.6217673420906067,
-0.14039580523967743,
0.09206554293632507,
... |
def overlaps ( self, rect ) : for pt in rect. points : if self. is _ inside ( pt ) : return true return false | [
-1.0593161582946777,
0.5294364094734192,
0.5599257946014404,
0.5390766859054565,
-0.0512474961578846,
0.6407980918884277,
-0.5656468868255615,
-0.07332374155521393,
-0.2647368609905243,
-0.6491082906723022,
-0.4875696897506714,
-0.9588539004325867,
-0.5472617745399475,
-0.15967410802841187... |
def _ apply _ fates ( self ) : # the new cells grid has live cells for every " birth " or " survive " # fates, and dead cells for everything else new _ cells = np. zeros ( ( self. width, self. height ), dtype = np. int8 ) new _ cells [ ( self. fates = = fate. birth ) | ( self. fates = = fate. survive ) ] = 1 # check wh... | [
-0.2941403388977051,
-0.027110306546092033,
0.5606390833854675,
0.16522622108459473,
0.3475921154022217,
-0.2285255491733551,
-0.08843599259853363,
0.26089513301849365,
-0.2857121229171753,
-0.3276452422142029,
0.5083378553390503,
0.030741730704903603,
1.2382235527038574,
1.504412889480590... |
def markdown2html _ custom ( source ) : return markdownwithmath ( renderer = mymarkdownrenderer ( escape = false ) ). render ( source ) | [
0.07548049092292786,
0.5118632316589355,
0.31865036487579346,
-0.00413266196846962,
-2.054302215576172,
-0.2643997371196747,
-0.21467354893684387,
0.4698607623577118,
-0.002978086471557617,
-0.4690525233745575,
0.21114757657051086,
-0.15996840596199036,
0.9763911366462708,
0.74752396345138... |
def vegetationgenerator ( specs, cellsize, vgcells, n ) : width = 5. 0 separation = 1. 0 height = 3. 0 parks = etree. subelement ( specs, " parks " ) for v in vgcells : park = etree. subelement ( parks, " park " ) parkoutline = etree. subelement ( park, " outline " ) parkheight = etree. subelement ( park, " height " ) ... | [
-0.013251475989818573,
0.36365625262260437,
0.4811467230319977,
-0.18431322276592255,
-0.5192467570304871,
-0.13119755685329437,
0.3642222583293915,
0.44181889295578003,
0.06678532063961029,
0.6725041270256042,
0.48029789328575134,
-0.4702581763267517,
0.4956774115562439,
0.202248975634574... |
def check _ config _ mode ( self, * args, * * kwargs ) : pass | [
-1.4566259384155273,
-0.2010880559682846,
0.5394090414047241,
0.9749857783317566,
0.6158896684646606,
0.6669171452522278,
-0.02568925730884075,
0.17028483748435974,
-1.1978877782821655,
0.6562048196792603,
-0.14928209781646729,
-0.10998588800430298,
-0.5934243202209473,
0.6976280212402344,... |
def _ _ getattr _ _ ( self, item : str ) - > any : if hasattr ( self. model, item ) : return getattr ( self. model, item ) else : raise attributeerror ( f " { self } has no attribute { item } " ) | [
0.22654736042022705,
-0.8998894095420837,
0.4736112952232361,
0.0854579508304596,
0.4101703464984894,
-0.026046015322208405,
0.5221222043037415,
-0.7640216946601868,
0.1954578161239624,
-0.22297386825084686,
0.35660088062286377,
-0.08739499002695084,
0.758996844291687,
-0.04000379890203476... |
def init _ game _ setting ( self ) : pass | [
-0.5483611226081848,
0.24612344801425934,
0.5198325514793396,
0.6107192039489746,
0.19207251071929932,
0.3391294479370117,
-0.0017889539012685418,
-0.9735543131828308,
-0.786632239818573,
0.991337776184082,
-0.933048665523529,
0.07111073285341263,
-0.40522265434265137,
0.49678802490234375,... |
def load _ chrom _ sizes ( reference _ genome ) : my _ path = os. path. abspath ( os. path. dirname ( _ _ file _ _ ) ) rg _ path = f'{ my _ path } / { reference _ genome }. chrom. sizes'f = open ( rg _ path ) lengths = { } for line in f : [ ch, l ] = line. strip ( ). split ( ) lengths [ ch ] = int ( l ) return lengths | [
0.4177154302597046,
-0.18242716789245605,
0.6371586918830872,
-1.0833446979522705,
-0.7006344199180603,
0.20475833117961884,
0.4444536864757538,
-0.21056421101093292,
-0.6415342092514038,
0.9819613099098206,
-1.377071499824524,
-0.30373072624206543,
-0.8958020210266113,
1.4767183065414429,... |
def _ spectrogram ( self, signal, log ) : f, t, sxx = scipy. signal. spectrogram ( signal, fs = self. f _ s, nperseg = self. win, noverlap = self. hop, nfft = self. nfft ) if log : # mask values equal to 0 sxx = abs ( sxx ) mask = sxx > 0 sxx [ mask ] = 10 * np. log ( sxx [ mask ] ) return f, t, sxx | [
0.30830973386764526,
0.20841343700885773,
0.5671476721763611,
0.3542953431606293,
-0.22634944319725037,
-0.575081467628479,
-0.2548666000366211,
0.04061822220683098,
0.5500087141990662,
0.19054506719112396,
-0.3497004508972168,
-0.46528327465057373,
0.46497878432273865,
-0.3651884198188782... |
def _ _ init _ _ ( self, make, model, year ) : super ( ). _ _ init _ _ ( make, model, year ) self. battery = battery ( ) | [
0.4366450309753418,
-0.20061013102531433,
0.42973119020462036,
1.0039058923721313,
-0.1711810976266861,
1.3391064405441284,
-0.34494373202323914,
-0.032858673483133316,
-0.38391661643981934,
-0.20678851008415222,
-0.6032986044883728,
0.3051674962043762,
0.1642000675201416,
0.40042886137962... |
def mask _ regions ( imagepath, regionpath ) : shapes, par = parse _ region _ file ( regionpath ) # open the input image and run it through the various region masks im = fpimage ( imagepath, update = true ) for i in range ( len ( shapes ) ) : if shapes [ i ] = = " circle " : im. badp [ mask _ circle ( im. badp, par [ i... | [
-0.2328740358352661,
-0.8996307849884033,
0.41107091307640076,
-0.3689306974411011,
0.3528754711151123,
0.0592438168823719,
0.6988014578819275,
-0.6276547312736511,
0.5198544263839722,
0.6483430862426758,
0.10727148503065109,
0.26596587896347046,
-0.1403617113828659,
-0.11898753046989441,
... |
def run ( self, timeout ) : # rsp. run is blocking. running it in a dedicated thread allows to # stop it after a timeout. t = thread ( name = " rsp - " + self. session _ type + " - " + str ( self. port ), target = self. thread _ main ) self. _ handling _ timeout = false t. start ( ) t. join ( timeout = timeout ) timeou... | [
-0.5314773917198181,
0.27479287981987,
0.9138746857643127,
-0.4798015356063843,
-0.3578588664531708,
0.19670921564102173,
-0.39091140031814575,
-0.3376135230064392,
-0.23808033764362335,
0.35018080472946167,
-0.16578829288482666,
-0.2738741934299469,
-1.4103142023086548,
-0.803682386875152... |
def create _ dictionary _ trie ( filename ) : words = read _ file ( filename ) if not words : raise bogglesetupexception ('a valid dictionary must be provided.') valid _ words = [ ] for word in words : if len ( word ) > 2 : valid _ words. append ( word ) return trie ( valid _ words ) | [
0.2709619402885437,
0.5545940399169922,
0.1374429613351822,
-0.39127588272094727,
0.07291993498802185,
0.17504531145095825,
0.2901132106781006,
1.0248733758926392,
-0.8853051662445068,
0.5023202300071716,
0.21366629004478455,
0.03579965606331825,
-0.3514966666698456,
0.5407042503356934,
... |
def _ add _ update _ job _ rules ( self, job ) : packages = self. _ pool. what _ provides ( job. requirement, use _ modifiers = false ) if len ( packages ) = = 0 : return # an update request * must * install the latest package version def key ( package ) : package _ id = self. _ pool. package _ id ( package ) installed... | [
-0.8130144476890564,
-0.05110544711351395,
0.6483369469642639,
-0.3663936257362366,
-0.029557811096310616,
0.33391648530960083,
-0.8712739944458008,
0.6404794454574585,
0.025373198091983795,
0.6783925294876099,
0.0478091686964035,
0.050286199897527695,
-0.24666762351989746,
0.8179996609687... |
def _ _ getattr _ _ ( self, item ) : return self. _ state [ " data " ]. get ( item, none ) | [
-0.7503960132598877,
-0.6690566539764404,
0.5275564789772034,
-0.9006612300872803,
-0.26591232419013977,
-0.28163182735443115,
-0.40268030762672424,
-1.0533679723739624,
1.0483005046844482,
-0.5517931580543518,
-0.4016028344631195,
0.5590641498565674,
0.8797361254692078,
-0.836436927318573... |
def spot _ price ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " spot _ price " ) | [
-0.03435332700610161,
-0.18917030096054077,
0.32178476452827454,
0.08049853146076202,
0.7112922668457031,
1.4869191646575928,
-0.2913672924041748,
0.09738357365131378,
0.6890243887901306,
0.5826219916343689,
0.6078847050666809,
0.03980330005288124,
0.06965961307287216,
-1.1168466806411743,... |
def login ( self, request ) : id _ token = request. get. get ( " id _ token " ) result = verify _ token ( id _ token ) if " email " in result : try : user = user. objects. get ( email = result [ " email " ]. strip ( ) ) is _ new = false except user. doesnotexist : user = user ( email = result [ " email " ]. strip ( ), ... | [
-0.8251882791519165,
-0.25702735781669617,
0.6413761973381042,
0.1431945264339447,
0.3480839729309082,
0.06778939813375473,
-0.9660892486572266,
-0.4477337598800659,
0.2367798388004303,
-0.6195663213729858,
-1.512096881866455,
-0.943954348564148,
-0.35876229405403137,
-0.18508699536323547,... |
def _ load _ data _ from _ hg ( self ) : if not self. _ connected : return false # read data from pymax for metadata, funct in ( ( self. _ maxdevice. attributenode, self. _ maxdevice. getattributedata ), ( self. _ maxdevice. masternode, self. _ maxdevice. getmasterdata ), ( self. _ maxdevice. writenode, self. _ maxdevi... | [
-0.5898309946060181,
0.9204822778701782,
0.7225106954574585,
-0.5793939828872681,
0.12220224738121033,
0.11098657548427582,
-0.685015082359314,
-0.2173895239830017,
-0.9315621852874756,
-0.2490745186805725,
-0.8207374215126038,
0.13297578692436218,
0.034765347838401794,
-0.0096578681841492... |
def getlanguagelist ( self ) : found = [ ] for scriptrecord in self. scriptlist. scriptrecord : script = scriptrecord. script if script. langsyscount : for langsysrecord in script. langsysrecord : langsystag = langsysrecord. langsystag if langsystag not in found : found. append ( langsystag ) return found | [
-0.07723817229270935,
-0.21131476759910583,
0.4583111107349396,
-0.13277815282344818,
0.10518839210271835,
-0.681631326675415,
-0.28861838579177856,
-0.19877471029758453,
0.36926987767219543,
0.70851069688797,
-0.908963680267334,
0.07599369436502457,
-0.2818470299243927,
2.0328245162963867... |
def fit _ predict ( model : callable, x _ in, y _ in, x _ val = none, y _ val = none, n _ folds = 10, split _ on _ year = true, balance _ training : str = none ) : if isinstance ( model, ( randomforestclassifier, logisticregression ) ) : # renaming of the methods, such that the preferred one for the classifier is a pro... | [
-0.42737337946891785,
-0.03494938090443611,
0.9346579909324646,
0.7870948910713196,
0.013586645014584064,
-0.049639541655778885,
-0.47406405210494995,
0.14064177870750427,
-0.2611837387084961,
-0.12568897008895874,
0.6043435335159302,
0.5496366024017334,
0.5560942888259888,
0.4837037026882... |
def auto _ crop _ img ( img, size, mode = none, upscale = false ) : mode = mode or resizer. resize _ to _ fill # create image and get size img = img if isinstance ( img, image. image ) else image. open ( img ) src = img. size dst = [ int ( x ) for x in size. split ('x') ] # get src sides long _ side = 0 if src [ 0 ] > ... | [
-0.18216809630393982,
0.08434765040874481,
0.9796520471572876,
-0.086836077272892,
-1.470728874206543,
-0.07738032937049866,
0.3434726595878601,
-0.48237910866737366,
-0.032876498997211456,
0.5144356489181519,
0.3473862111568451,
-0.26103657484054565,
0.35722145438194275,
0.109656259417533... |
def playershm ( playershm ) : if abs ( playershm ['val'] ) = = 8 : playershm ['dir'] * = - 1 if playershm ['dir'] = = 1 : playershm ['val'] + = 1 else : playershm ['val'] - = 1 | [
-0.5517619252204895,
-0.15634401142597198,
0.5005322694778442,
0.431048721075058,
0.262040376663208,
0.36314353346824646,
0.33520251512527466,
0.3156033754348755,
0.8960465788841248,
0.056437332183122635,
-0.30580928921699524,
-0.012206705287098885,
-0.3884004056453705,
0.3211158812046051,... |
def grad ( self, a, b ) : grada = np. zeros ( a. shape ) gradb = np. zeros ( b. shape ) ai = [ np. eye ( len ( b ) ) ] for i in xrange ( self. predcount ) : ai. append ( np. dot ( a, ai [ - 1 ] ) + np. eye ( len ( b ) ) ) num = 0. 0 for trial in self. trials : num + = len ( trial ) preds = self. predictions ( trial, a,... | [
-0.21670858561992645,
-0.13428954780101776,
1.021195650100708,
-0.9057965278625488,
0.2379550188779831,
0.45653846859931946,
0.08955062180757523,
0.7259310483932495,
-0.7040624022483826,
0.9386091232299805,
0.725956916809082,
1.1205904483795166,
-0.009002971462905407,
0.7536242008209229,
... |
def pop ( self ) : if len ( self. b ) = = 0 : while self. a : self. b. append ( self. a. pop ( ) ) return ( self. b. pop ( ) ) | [
-0.023075349628925323,
0.4463292360305786,
0.8064135313034058,
-0.18200504779815674,
0.37197214365005493,
-0.25147750973701477,
-0.2700037360191345,
-0.2707522511482239,
-0.10065702348947525,
0.8937730193138123,
0.06580612808465958,
-0.2367805689573288,
-1.6395039558410645,
0.0510614775121... |
def combine _ counts ( d1, d2 ) : d = d1. copy ( ) for word, count in d2. items ( ) : d [ word ] = d. get ( word, 0 ) + count return d | [
0.19425193965435028,
0.23421992361545563,
0.6131623387336731,
-0.40958479046821594,
-0.14353249967098236,
-0.011099367402493954,
-0.7574679255485535,
0.27663591504096985,
-0.9397109746932983,
0.4843263328075409,
0.8372296690940857,
0.8631261587142944,
0.8866913318634033,
-0.097054287791252... |
def format _ prior _ pb _ winners _ data ( pb _ df : pd. dataframe ) - > pd. dataframe : pb _ df. columns = pb _ prior _ winners _ columns pb _ df [ columns _ to _ sort ] = np. sort ( pb _ df [ columns _ to _ sort ]. values ) return pb _ df | [
-0.28017738461494446,
0.018448399379849434,
0.5056625604629517,
0.16867893934249878,
0.028944140300154686,
1.0842055082321167,
0.6435437202453613,
-0.8623751401901245,
0.2016066610813141,
-0.32469314336776733,
1.1794131994247437,
1.0370793342590332,
-0.22918136417865753,
-0.329112142324447... |
def show _ generator _ output ( sess, n _ images, input _ z, out _ channel _ dim ) : z _ dim = input _ z. get _ shape ( ). as _ list ( ) [ - 1 ] example _ z = np. random. uniform ( - 1, 1, size = [ n _ images, z _ dim ] ) samples, _ = sess. run ( generator ( input _ z, out _ channel _ dim, is _ train = false ), feed _ ... | [
-0.7534940838813782,
0.05439002066850662,
0.30720195174217224,
0.051531050354242325,
-1.0610454082489014,
-0.8454530239105225,
1.0232977867126465,
0.2642515003681183,
-0.4203161895275116,
-0.23616647720336914,
0.29980117082595825,
0.16350071132183075,
0.6072579622268677,
0.4829438030719757... |
def _ _ init _ _ ( self, speed _ of _ sound : float, density : float ) : self. speed _ of _ sound = speed _ of _ sound self. density = density | [
1.2942286729812622,
-0.7121913433074951,
0.7110546231269836,
0.06310208886861801,
0.5999093651771545,
-0.21063369512557983,
-0.4529060125350952,
-0.5029192566871643,
-0.7231289148330688,
-0.21211189031600952,
0.6363990306854248,
0.1882985681295395,
0.5798910856246948,
0.5107238292694092,
... |
def show ( self, trans, id, * * kwd ) : group _ id = id try : decoded _ group _ id = trans. security. decode _ id ( group _ id ) except typeerror : trans. response. status = 400 return " malformed group id ( % s ) specified, unable to decode. " % str ( group _ id ) try : group = trans. sa _ session. query ( trans. app.... | [
-0.37174832820892334,
0.6048005819320679,
0.19696159660816193,
-0.38322746753692627,
-0.9729893803596497,
-0.26274362206459045,
-0.06422974169254303,
0.02202521450817585,
-0.13719677925109863,
0.057417988777160645,
0.34952491521835327,
0.5493783354759216,
0.23435193300247192,
0.12458303570... |
def framecountchange ( self, p ) : if p : self. framecount = int ( p ) # update currentframespinbox self. currentframespinbox ['to _'] = self. framecount # rewrite code with new number of frame self. code. delete ('1. 0 ','end') if self. framecount is 1 : self. code. insert ('1. 0 ','const uint8 _ t'+ self. spritename ... | [
-0.9634134769439697,
-0.03959188237786293,
0.9231905341148376,
-0.1988300234079361,
-0.11464577168226242,
-0.6079776883125305,
1.021741271018982,
0.4422036409378052,
0.327338844537735,
-0.046948112547397614,
-0.5311886072158813,
0.1642124354839325,
-0.9977113008499146,
0.7944174408912659,
... |
def clear ( self ) : with self. lock : self. obj _ dict. clear ( ) self. key _ list. clear ( ) self. nb _ found _ by _ id = 0 self. nb _ found _ by _ value = 0 self. nb _ create _ new = 0 | [
-0.8104131817817688,
-0.16938716173171997,
0.2817156910896301,
0.255776971578598,
0.3837675154209137,
0.576641857624054,
1.202847957611084,
-0.8602511882781982,
-0.6505088210105896,
0.22004175186157227,
-0.7478552460670471,
0.19563347101211548,
-0.0338246114552021,
0.8665076494216919,
0.... |
def fromkeys ( cls, seq, value = none ) : return cls ( dict. fromkeys ( seq, value ) ) | [
-0.4196923077106476,
-0.24644018709659576,
0.17738425731658936,
0.0513988696038723,
-1.5566426515579224,
-0.7883768677711487,
-0.887078583240509,
0.781541109085083,
0.48427340388298035,
0.6083184480667114,
-0.8330137133598328,
-0.5183460116386414,
0.21897365152835846,
-0.19527477025985718,... |
def reset _ history ( calc ) : # check to see if calc exists if check _ integrity ( calc ) : del calc ['history'] [ : ] | [
1.4376208782196045,
0.8428103923797607,
0.30712953209877014,
0.5869873762130737,
0.7104021310806274,
0.2410602569580078,
0.6202987432479858,
0.007046113256365061,
0.37607601284980774,
0.04110293835401535,
0.3238064646720886,
1.3743393421173096,
0.05337422341108322,
-0.26786598563194275,
... |
def fake _ dataset _ fn ( unused ) : del unused def make _ dataset ( time _ us, num _ elements ) : dataset = dataset _ ops. dataset. range ( num _ elements ) if time _ us > 0 : dataset = dataset. apply ( testing. sleep ( time _ us ) ) return dataset if not initial _ delay _ us : return make _ dataset ( remainder _ dela... | [
-0.2208726555109024,
0.8691312074661255,
0.4901077151298523,
0.03855057805776596,
-0.40067189931869507,
-0.3900856673717499,
0.757448673248291,
0.27208608388900757,
0.5433633923530579,
-0.944601833820343,
0.38832327723503113,
0.14677470922470093,
0.14387547969818115,
-0.6042941808700562,
... |
def get _ current _ user ( self, * * kwargs ) : return self. request ('users / me ', * * kwargs ) | [
-1.614732265472412,
-0.4835818111896515,
0.4185935854911804,
1.1539801359176636,
0.4548233449459076,
0.038744740188121796,
-0.4493583142757416,
-1.2254633903503418,
-0.6430507898330688,
-0.5649566650390625,
0.023229017853736877,
0.30637168884277344,
-0.7387859225273132,
-0.4719638824462890... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.