text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def v4 _ redirect ( * args, * * kwargs ) : return flask. redirect ( * args, response = fixed _ location _ response, * * kwargs ) | [
0.05324791744351387,
-1.306084156036377,
0.33703532814979553,
0.3497900366783142,
0.040566541254520416,
-0.06960666179656982,
0.6089834570884705,
-0.25178053975105286,
0.10203191637992859,
-1.0034501552581787,
0.43545031547546387,
0.34510892629623413,
-0.4684590697288513,
-0.86061072349548... |
def display _ activity ( activity _ id ) : hosting, attending, considering = none, none, none # user login required for hosting / attending / considering status if'username'in flask. session : hosting = hosting _ events ( ) attending = attending _ events ( ) considering = considering _ events ( ) with db _ session ( ) ... | [
0.21183869242668152,
-0.6929172873497009,
1.1194380521774292,
-0.36366742849349976,
0.08560653030872345,
-0.10064223408699036,
0.8419668674468994,
0.0007637421367689967,
0.004907587543129921,
0.49412649869918823,
0.9368612766265869,
0.15973325073719025,
0.5418117046356201,
0.35517591238021... |
def get _ sent _ message ( conn : sqlite3. connection, sent _ timestamp, * args ) : fields = [ * filter ( lambda f : f in sent _ message _ fields, args ) ] if fields : with conn : statement = ( f " select { ', '. join ( fields ) } from sentmessage where sent _ timestamp =? " ) values = conn. execute ( statement, ( sent... | [
-0.32917627692222595,
0.4566881060600281,
0.44283756613731384,
-0.21452739834785461,
0.37791708111763,
-1.1260067224502563,
-0.5429474711418152,
-0.825419008731842,
-0.8297814130783081,
0.6639711260795593,
-0.6668480634689331,
-0.3600248396396637,
-0.19411024451255798,
0.14716027677059174,... |
def compute _ matching ( self, inputs, model _ output ) : tree = model _ output. tree # compute matching distributions if'gt _ match _ dists'in model _ output : gt _ match _ dists = model _ output. gt _ match _ dists else : gt _ match _ dists = self. matcher. get _ w ( inputs. pad _ mask, inputs, model _ output, log = ... | [
-0.1480286568403244,
-0.5884742736816406,
0.565636157989502,
0.25715240836143494,
-0.05100107565522194,
0.004705239087343216,
-0.08023112267255783,
0.49089276790618896,
-0.7415855526924133,
-0.15088367462158203,
0.3299325406551361,
0.2528831958770752,
0.28306975960731506,
0.278220504522323... |
def as _ placement _ group _ factory ( self ) - > " placementgroupfactory " : from ray. tune. trainable import placementgroupfactory trainer _ resources = ( self. trainer _ resources if self. trainer _ resources else { " cpu " : 1 } ) trainer _ bundle = [ trainer _ resources ] worker _ resources = { " cpu " : self. num... | [
-0.16596408188343048,
0.5377483367919922,
0.4207220673561096,
-0.2333405762910843,
-0.6510385274887085,
-0.13047859072685242,
0.7086411118507385,
-0.11599638313055038,
-0.37185412645339966,
-0.2854081690311432,
0.6776391863822937,
-0.44625338912010193,
-0.19992119073867798,
-0.179896742105... |
def draw ( self, screen ) : screen. blit ( self. text _ surface _ obj, self. text _ rect _ obj ) | [
0.14454612135887146,
-0.4576035141944885,
0.33940672874450684,
-0.6559476852416992,
0.5413625836372375,
1.099076747894287,
-0.005526408553123474,
-0.30881911516189575,
-0.2788754403591156,
-0.4836254417896271,
0.2956923246383667,
0.24877753853797913,
0.06668716669082642,
0.5415540933609009... |
def children ( self, r ) : children = [ ] for radj in self. radjlst : if radj [ 0 ] = = r : children. append ( radj [ 1 ] ) return children | [
-0.006293277721852064,
-0.7397578358650208,
0.23405277729034424,
-0.567851185798645,
-1.394835352897644,
0.8318750262260437,
0.3414615988731384,
-0.8673354983329773,
0.16074936091899872,
0.13052593171596527,
-1.1702356338500977,
0.059795770794153214,
-0.6975612044334412,
0.3344720602035522... |
def read _ wave ( path ) : with contextlib. closing ( wave. open ( path,'rb') ) as wf : num _ channels = wf. getnchannels ( ) assert num _ channels = = 1 sample _ width = wf. getsampwidth ( ) assert sample _ width = = 2 sample _ rate = wf. getframerate ( ) n _ frames = wf. getnframes ( ) data = wf. readframes ( n _ fra... | [
0.3519626557826996,
-0.04550895094871521,
1.0505303144454956,
-0.3861028552055359,
-0.5428221821784973,
-0.06594833731651306,
-0.16878774762153625,
-0.5833425521850586,
0.6700106859207153,
0.13372308015823364,
0.2724999189376831,
0.5610799789428711,
-0.2744552195072174,
0.4343113303184509,... |
async def async _ step _ complete ( self, _ : none = none ) - > flowresult : return self. async _ create _ entry ( data = { } ) | [
-0.13547450304031372,
0.5801360607147217,
0.4657176434993744,
-0.06699403375387192,
0.5536203980445862,
-0.4259607791900635,
-0.20073382556438446,
0.08443392813205719,
-0.13073231279850006,
0.1311534196138382,
-0.6609668135643005,
-0.24632054567337036,
0.22426292300224304,
0.13936136662960... |
def tokenize _ and _ mask ( text, vocab _ size = vocab _ size, noise = 0. 15, randomizer = np. random. uniform, tokenize = tokenize ) : # current sentinel number ( starts at 0 ) cur _ sentinel _ num = 0 # inputs inps = [ ] # targets targs = [ ] # # # start code here ( replace instances of'none'with your code ) # # # # ... | [
-0.52580726146698,
-0.4067200720310211,
0.833234965801239,
0.3879043459892273,
-0.17524948716163635,
-1.0646260976791382,
0.12368849664926529,
-0.13161712884902954,
0.4032180905342102,
0.5276066660881042,
-0.3616965711116791,
0.29237282276153564,
-0.24225465953350067,
0.5982165932655334,
... |
def tod ( channels, dnu, band ) : map _ combine _ smoothed = [ map _ smoothing ( nu, cmb _ i * convert _ units ('uk _ cmb ','mjysr ', nu ) + dust _ map ( nu, dust _ ind1, dust _ ampl _ i ) + sync _ map ( nu, sync _ ind, sync _ ampl _ i ) + ( 1 - st. epsilon ) / ( 1 + st. epsilon ) * ( ( cmb _ q * convert _ units ('uk _... | [
-0.1384211927652359,
0.08580358326435089,
0.9247848987579346,
-1.0478112697601318,
0.39426225423812866,
0.2155601531267166,
0.03363737463951111,
-1.0859375,
0.25301477313041687,
-0.27642831206321716,
-0.3917822539806366,
0.5570462346076965,
-0.025455839931964874,
0.006982329301536083,
0.... |
def capture _ sample ( url, length ) : file _ path ='{ }. mp4 '. format ( str ( uuid. uuid4 ( ) ) ) cmd = ('{ } - i { }'' - acodec copy - vcodec copy'' - user _ agent " vlc / 3. 0. 1 "'' - t { } { }'). format ( ffmpeg _ path, url, str ( length ), file _ path ) try : _ logger. info ( " starting capture for : % s ", file... | [
0.506964921951294,
-0.7597628831863403,
0.9303472638130188,
-0.024053558707237244,
-0.9023497104644775,
-1.3864883184432983,
-0.11165542900562286,
-1.0583840608596802,
0.35451996326446533,
1.3142757415771484,
-0.5476343631744385,
0.31664198637008667,
-0.6456775069236755,
0.5644803643226624... |
def get _ live _ descriptors _ labels ( row, language ='en') : try : if row. descriptors _ uris : uris = ['( < % s > )'% x for x in row. descriptors _ uris ] logger. debug ('% s : % s ', row. paper _ id, ', '. join ( uris ) ) query = cfg. vocab _ query _ template % (''. join ( uris ), language ) res = cfg. vocab _ spar... | [
-0.7295818328857422,
-0.41286760568618774,
0.5440213680267334,
-0.8175721764564514,
-0.25374361872673035,
-0.9885684847831726,
-1.0142748355865479,
0.2710466980934143,
0.0318392775952816,
0.4387296140193939,
-0.15160824358463287,
-0.6277158260345459,
-0.09778064489364624,
-0.19290141761302... |
def test _ correlation ( data ) : assert _ equals ( 0. 62520091, process. correlation ( data,'hip circumference ( cm )') ) assert _ equals ( 0. 29145844, process. correlation ( data,'age ( years )') ) assert _ equals ( - 0. 0894953, process. correlation ( data,'height ( inches )') ) | [
-0.021526211872696877,
0.0619383305311203,
0.3618777096271515,
-0.27431342005729675,
0.3516392111778259,
0.682395339012146,
0.5728361010551453,
-0.04343201592564583,
-0.11117477715015411,
-0.308351993560791,
0.047441791743040085,
-0.6343531012535095,
-0.4817667305469513,
0.3177530169486999... |
def poisson _ cdf _ root ( target, n = 2, tol = 1e - 8 ) : # if not ( isinstance ( target, float ) and target < 1 or target > 0 ) : if target > = 1 or target < = 0 : return valueerror phi = ndtri ( target ) min _ a = 1e - 3 a = max ( ( ( phi * phi + 4 * n + 2 ) * *. 5 - phi ) * * 2 / 4, min _ a ) e = 1 count = 0 max _ ... | [
0.21716324985027313,
0.1329699158668518,
0.813506007194519,
-0.4093066453933716,
-0.5967222452163696,
-0.8070184588432312,
0.1730535626411438,
-0.13083629310131073,
-0.4306696355342865,
0.15909449756145477,
0.09223763644695282,
0.47576725482940674,
-0.5238034725189209,
-0.02441719174385070... |
def predict ( self, x, w, b ) : score = b + numpy. inner ( w, x ) # print score if score > 0 : t = 1 else : t = 0 p = self. sigmoid ( score ) if score < - 700 : lp = score else : lp = numpy. log ( p ) return ( t, p, lp ) | [
0.0513230562210083,
-0.6816975474357605,
0.5308062434196472,
0.24766099452972412,
-0.1626376062631607,
0.4414983093738556,
-0.8789503574371338,
-0.25893542170524597,
0.11301269382238388,
1.2101986408233643,
0.042803287506103516,
-0.0944526344537735,
-0.824469268321991,
-0.7088394165039062,... |
def get _ weekday ( self ) : return self. datetime. isoweekday ( ) | [
-0.6032419800758362,
0.25027596950531006,
0.6288335919380188,
0.47750529646873474,
0.292080283164978,
-0.20292946696281433,
-0.3316064774990082,
-0.8796190023422241,
-0.06774628162384033,
-0.7064827084541321,
-0.3208243250846863,
-0.2213864028453827,
-0.08296189457178116,
-0.27727675437927... |
def predict ( self, ids, x, path ) : pass | [
-1.5804239511489868,
-0.8185011744499207,
-0.014660469256341457,
0.8162655234336853,
-0.2972088158130646,
-0.07567549496889114,
-0.38271763920783997,
0.8153382539749146,
-0.5348927974700928,
0.15320393443107605,
-0.6482346653938293,
0.26183634996414185,
-0.11328629404306412,
-0.64593791961... |
def main _ profiler ( params ) : pth = os. path. join ( params. params [ " log " ] [ " dir " ],'main. prof') cprofile. runctx ('main ( params ) ', globals ( ), locals ( ), pth ) | [
0.9214476346969604,
0.13623566925525665,
0.7646231651306152,
0.47023504972457886,
-0.10782746225595474,
0.6768423914909363,
1.0505512952804565,
0.11334934085607529,
-0.6769176125526428,
0.3662717044353485,
0.0896870493888855,
0.45840978622436523,
-0.6892217993736267,
0.5368776321411133,
... |
def _ _ init _ _ ( self, options = none ) : # holds state of workflow self. state = workflowstate. initial # dict holds all workflow nodes ( wrapping signatures ) self. nodes = { } # task is in running state if its id is in the dict self. running = { } # task finished successfuly or not self. finished = { } # holds wor... | [
0.24287450313568115,
-0.21566781401634216,
0.7960042357444763,
0.23554931581020355,
-0.26865267753601074,
-0.41730761528015137,
0.9686787724494934,
0.3395780622959137,
0.5460529327392578,
0.1331767737865448,
-0.3959946036338806,
0.1133832037448883,
0.059192679822444916,
0.8704314231872559,... |
def setcurrentwidget ( self, assembly ) : super ( tabwidget, self ). setcurrentwidget ( assembly ) | [
0.17859700322151184,
-1.176809549331665,
0.16616688668727875,
0.40309587121009827,
-0.13790853321552277,
0.9493075013160706,
0.4687248766422272,
0.6198586225509644,
-0.6613797545433044,
-0.4713497459888458,
-0.36034393310546875,
0.16498692333698273,
0.10558561980724335,
0.4663575291633606,... |
def linear _ interpolate ( point1, point2, density = 1 ) : points = [ ] points. append ( point1 ) x _ diff = point2 [ 0 ] - point1 [ 0 ] y _ diff = point2 [ 1 ] - point1 [ 1 ] d = math. sqrt ( ( x _ diff ) * * 2 + ( y _ diff ) * * 2 ) for n in range ( 0, math. ceil ( d * density ) ) : xn = point1 [ 0 ] + ( n / density ... | [
0.36677634716033936,
-0.4310932159423828,
0.9941125512123108,
0.08869753032922745,
0.4337424039840698,
0.18841513991355896,
-1.586571455001831,
0.18482355773448944,
-0.150217667222023,
0.34683680534362793,
0.17602792382240295,
-0.425186425447464,
0.33478671312332153,
-0.6723498702049255,
... |
async def run _ script ( self, script = none, startline = 0 ) : if script is none : script = self. staged _ script if self. debug : print ( " running script " ) print ( script ) s = self. device if startline = = 0 : try : s. reset _ input _ buffer ( ) except exception as e : raise serialexception ( ) s. write ( b'\ r \... | [
-0.5351194739341736,
-0.2265048623085022,
0.7280671000480652,
0.7899414896965027,
-0.2605259418487549,
-0.46469271183013916,
1.1216094493865967,
-0.16133810579776764,
-0.7355804443359375,
0.37125664949417114,
-0.3080168068408966,
0.6059508919715881,
-1.0259997844696045,
0.17789094150066376... |
def get _ privileges ( tenant _ uuid, datastore _ url ) : err _ msg, _ auth _ mgr = get _ auth _ mgr ( ) if err _ msg : return err _ msg, none privileges = [ ] try : cur = _ auth _ mgr. conn. execute ( " select * from privileges where tenant _ id =? and datastore _ url =? ", ( tenant _ uuid, datastore _ url ) ) privile... | [
-0.42242276668548584,
0.4675056040287018,
0.6283612847328186,
0.13064585626125336,
0.299749493598938,
-1.429931402206421,
-1.1242995262145996,
0.664600133895874,
0.4258827865123749,
0.3668076694011688,
0.28747522830963135,
0.26934292912483215,
0.1550978720188141,
0.15523746609687805,
1.0... |
def check _ layer _ field _ exists ( packet, field _ uri ) : assert isinstance ( packet, rawpacket ) secs = field _ uri. split ( '.') layer _ name = secs [ 0 ] if not is _ layer _ field ( field _ uri ) and not is _ layer _ field _ container ( field _ uri ) : raise notimplementederror ('% s is neither a field or field c... | [
-0.591026246547699,
-0.3078036606311798,
0.679234504699707,
-0.7005475163459778,
0.21915052831172943,
0.3762749135494232,
-0.01599590852856636,
-0.04106176272034645,
-0.016289902850985527,
-0.4506143033504486,
-0.5238108038902283,
0.06363125890493393,
-0.1902197301387787,
0.416416704654693... |
def at _ least ( n _ successes, n _ possible, probabilities ) : # we will find 1 - probability of at most ( n _ successes - 1 ) successes prob = 0 possible _ indices = np. asarray ( list ( range ( n _ possible ) ) ) # possible monomers to choose from for i in range ( n _ successes ) : # get all combinations of ( n _ po... | [
-0.6930049061775208,
-0.30146005749702454,
0.7177164554595947,
-0.15709833800792694,
-0.10046432912349701,
-0.20391647517681122,
-0.3811240494251251,
-0.5363871455192566,
-0.0796356052160263,
0.4777318835258484,
-0.2463119775056839,
0.20780445635318756,
-0.6873251795768738,
-0.102889299392... |
def hook ( self, name : str ) - > optional [ simplugimpl ] : ret = getattr ( self. plugin, name, none ) if not isinstance ( ret, simplugimpl ) : return none return ret | [
-0.2205730378627777,
-0.8204736113548279,
0.6234146356582642,
-0.040193017572164536,
-0.04837875813245773,
-0.886319637298584,
0.26078110933303833,
-0.5329532027244568,
1.0616074800491333,
0.3356594145298004,
-0.6346690654754639,
0.03177187219262123,
-0.5431790351867676,
-0.946546614170074... |
def check _ considering _ status ( activity _ id, event _ id ) : # user login required if'username'not in flask. session : response = flask. make _ response ( json. dumps ('user login required'), 401 ) response. headers ['content - type'] ='application / json'return response try : with db _ session ( ) as db : user _ c... | [
-0.23042967915534973,
-0.1964917778968811,
0.7847443222999573,
0.023738738149404526,
-0.24415245652198792,
0.28317710757255554,
-0.24891600012779236,
0.035246480256319046,
-0.18546541035175323,
0.9611667990684509,
0.22476793825626373,
-0.20110498368740082,
0.4129490554332733,
0.84633666276... |
def _ spl ( a, f, quantile, scaler ) : return ( np. nanmean ( np. where ( a > = f, quantile * ( a - f ), ( 1 - quantile ) * ( f - a ) ), axis = 0 ) / scaler ) | [
0.5577184557914734,
0.26570823788642883,
0.22078180313110352,
-0.8113011717796326,
-1.3163986206054688,
-0.6031791567802429,
-0.44091302156448364,
-0.5214626789093018,
0.5129609704017639,
0.21358147263526917,
0.4339623749256134,
0.29497984051704407,
0.827616810798645,
-0.412000834941864,
... |
def get _ batch _ statistics _ rotated _ bbox ( outputs, targets, iou _ threshold ) : batch _ metrics = [ ] for sample _ i in range ( len ( outputs ) ) : if outputs [ sample _ i ] is none : continue output = outputs [ sample _ i ] pred _ boxes = output [ :, : 8 ] pred _ scores = output [ :, 8 ] pred _ labels = output [... | [
-0.7621473073959351,
-0.5764800906181335,
0.7346434593200684,
0.23901179432868958,
0.34166598320007324,
-0.04989396035671234,
0.39038464426994324,
-0.49061161279678345,
-0.4744730293750763,
-0.20181311666965485,
0.04081016778945923,
0.5806608200073242,
0.34389492869377136,
-0.3257320821285... |
def is _ url ( url ) : url = force _ text ( url ) # check what django's urlvalidator thinks about it. that covers # the http / https / ftp cases including localhost, ipv4, ipv6 and # optional ports. if validators. urlvalidator. regex. search ( url ) : return true # check if it's an about : url. if url. startswith ('abo... | [
-1.1165498495101929,
-0.19361887872219086,
0.3289519250392914,
0.858368456363678,
-0.3290594518184662,
0.8352001309394836,
0.11095327138900757,
0.04964548721909523,
0.5132261514663696,
0.023775866255164146,
-0.49185824394226074,
0.3244880437850952,
-0.7543047070503235,
0.6796062588691711,
... |
def post ( self, request ) : " " " serializer also used for to validate data " " " # to validate a serialier call is _ validate function serializer = self. serializer _ class ( data = request. data ) if serializer. is _ valid ( ) : name = serializer. validated _ data. get ('name') # message = f'saif { name }'message = ... | [
-0.6897861361503601,
-0.6282657384872437,
0.7250752449035645,
0.6391109228134155,
-0.5849786400794983,
0.008104396983981133,
-0.5578045845031738,
-0.1255650520324707,
0.15835466980934143,
-0.28374868631362915,
0.00871947780251503,
-0.5702557563781738,
-0.6915121674537659,
0.402272403240203... |
def _ translate _ _ interfaces _ interface _ mpls _ label _ security ( input _ yang _ obj, translated _ yang _ obj = none ) : if input _ yang _ obj. rpf. _ changed ( ) : input _ yang _ obj. rpf = input _ yang _ obj. rpf return translated _ yang _ obj | [
0.008134311065077782,
-0.35504060983657837,
0.4405025243759155,
-0.11148867011070251,
0.4806526303291321,
1.1197547912597656,
0.8995351195335388,
-0.8449870944023132,
1.4406611919403076,
0.3889482617378235,
-0.5221233367919922,
-0.03564237430691719,
-1.439367413520813,
-0.8564205169677734,... |
def update _ node ( self, db _ id : int, value : str, is _ deleted : bool ) - > optional [ list [ node ] ] : node = self. nodes [ db _ id ] node. value = value # undeleted operation not exist if is _ deleted : deleted _ children : list [ node ] = node. delete ( ) return deleted _ children # noqa : wps331 return none | [
-0.5432623028755188,
0.42122122645378113,
0.49386027455329895,
-0.12097866088151932,
0.26410868763923645,
-0.31269723176956177,
-0.6590428948402405,
0.3499101400375366,
1.1167622804641724,
1.1669867038726807,
-0.22873549163341522,
0.5071089267730713,
-0.33998316526412964,
-0.18197837471961... |
def get _ config _ manager ( ) : _ method _ name ='get _ config _ manager'_ logger. entering ( class _ name = _ class _ name, method _ name = _ method _ name ) getconfigmanager = _ load _ global ('getconfigmanager') try : result = getconfigmanager ( ) except ( wlstexception, exception ), e : pwe = exception _ helper. c... | [
-0.48939070105552673,
-0.03186267614364624,
0.7038499116897583,
-0.19475814700126648,
-0.6708043217658997,
-0.3108178377151489,
-0.1332942396402359,
-0.3758433759212494,
-0.048095133155584335,
-0.9047222137451172,
0.009125219658017159,
0.43251797556877136,
-0.7226409912109375,
0.8346601128... |
def retrieve _ search ( request ) : searchid = request. matchdict. get ('searchid') # get the unique search id from the url. entry = searchrecordservice. by _ id ( searchid, request ) # retrieve the search using the searchid pfams = [ int ( pf [ 2 : ] ) for pf in entry. pfams. split ( ", " ) ] # extract the list of pfa... | [
-0.39079341292381287,
0.381015807390213,
0.09865076839923859,
0.07800120860338211,
0.5470750331878662,
-0.878503143787384,
-0.3953217566013336,
-0.20174776017665863,
0.4840644598007202,
-0.5607640147209167,
-0.4088784456253052,
-0.20557156205177307,
-0.6890468001365662,
0.7096099257469177,... |
def wait _ for _ change _ set _ creation ( change _ set _ arn ) : while true : response = _ get _ boto _ client ( " cloudformation " ). describe _ change _ set ( changesetname = change _ set _ arn, ) status, reason = response ['status'], response. get ('statusreason ','' ) logger. debug ( " change set status : % s % s ... | [
-0.28637441992759705,
-0.16751860082149506,
0.39509493112564087,
-0.9924265146255493,
0.09746260195970535,
0.1563069224357605,
-0.7557633519172668,
-0.8248193264007568,
-0.39541950821876526,
-1.035381555557251,
-0.16211684048175812,
0.038408130407333374,
-0.10235647857189178,
0.61297589540... |
def save _ shcfile ( self, filepath, *, model = none, deriv = none, leap _ year = none ) : model ='tdep'if model is none else model deriv = 0 if deriv is none else deriv leap _ year = true if leap _ year is none else leap _ year if model = ='tdep': if self. model _ tdep. coeffs is none : raise valueerror ( " time - dep... | [
-0.6098693013191223,
0.1013965904712677,
0.8176876306533813,
-0.4401363730430603,
-0.143446147441864,
0.029588470235466957,
0.3960683345794678,
-0.5276570916175842,
-0.8027464747428894,
0.6228911876678467,
-0.7557997703552246,
-0.33552294969558716,
0.6713393926620483,
0.34196537733078003,
... |
def test _ is _ vector ( self ) : self. assertraises ( nonvectorerror, isvector,'a') self. assertraises ( nonvectorerror, isvector, matrix ( [ [ 1, 2 ], [ 3, 4 ] ] ) ) self. assertraises ( nonnumericerror, isvector, [ 1,'a'] ) assert ( isvector ( [ 1, 2, 3 ] ) ) assert ( isvector ( vector ( [ 1, 2, 3 ] ) ) ) | [
-0.5719830989837646,
-0.014372732490301132,
0.1760244071483612,
0.7124876379966736,
0.4859977066516876,
0.31346872448921204,
0.4329794645309448,
0.12413597106933594,
0.7656051516532898,
-0.06442783027887344,
-0.06161751225590706,
0.21382258832454681,
-0.23387940227985382,
0.549808561801910... |
async def delete _ stage ( tournament _ id : int, stage _ id : int, tournament : tournament = depends ( alterable _ tournament ), stage : stage = depends ( get _ stage _ by _ id ), db : session = depends ( get _ db ), ) : if not tournament or not stage or stage. tournament! = tournament : raise httpexception ( status _... | [
-0.21550200879573822,
-0.5889425277709961,
0.6898142695426941,
0.5653713345527649,
0.20452383160591125,
-0.03815999627113342,
-0.20107433199882507,
0.3083932101726532,
-0.14085841178894043,
0.9331128597259521,
0.5191112160682678,
0.34615015983581543,
0.13687756657600403,
0.2297996729612350... |
def test _ cant _ update _ car _ invalid _ requests ( self ) : res = self. client. post ('/ car / update') self. assertequal ( res. status _ code, 405 ) res = self. client. delete ('/ car / update') self. assertequal ( res. status _ code, 405 ) res = self. client. put ('/ car / update') self. assertequal ( res. status ... | [
-0.8202435970306396,
-0.48892349004745483,
0.7677727341651917,
0.4549528956413269,
-0.015905136242508888,
0.7946954965591431,
-0.439430296421051,
0.060738977044820786,
-0.7505283355712891,
-0.22883163392543793,
-0.25427281856536865,
-0.41449061036109924,
-0.557822048664093,
0.1979692131280... |
def _ setup ( self ) : map = rospy. wait _ for _ message ('map ', occupancygrid ) self. map _ info = map. info | [
0.2787967026233673,
-0.9811474680900574,
0.37146124243736267,
-0.17067213356494904,
0.8000289797782898,
0.339631050825119,
0.03639030084013939,
-0.05463765189051628,
-0.20496422052383423,
-0.25123220682144165,
0.45777496695518494,
-0.4101845920085907,
0.6063545346260071,
0.6650389432907104... |
def setinputs ( self, * * inputs ) : # to support both upper and lower case for key in inputs : if key. lower ( ) = = " d " : # to support both numerical / boolean values or connector # instances if isinstance ( inputs [ key ], connector ) : self. d = inputs [ key ] else : self. d. state = int ( inputs [ key ] ) elif k... | [
-0.6308184862136841,
-0.3592904210090637,
0.8391651511192322,
0.013251997530460358,
-0.3924163281917572,
0.8143081665039062,
0.5937987565994263,
-0.6865886449813843,
-0.42357271909713745,
-0.3979496955871582,
0.3280227482318878,
0.544268786907196,
-0.3345314562320709,
0.594010055065155,
... |
def stitch _ sample ( self, src _ sample, dest _ sample, end ) : source = random. sample ( src _ sample, end ) destination = random. sample ( dest _ sample, end ) for ( src, dest ) in zip ( source, destination ) : if src! = dest : self. graph. add _ edge ( src, dest, none, 0 ) | [
-0.25044921040534973,
0.1153859868645668,
0.6158572435379028,
-0.13696469366550446,
-0.40662261843681335,
0.6115712523460388,
-0.31850680708885193,
0.2078087478876114,
0.3678434193134308,
0.5370880365371704,
0.09799420088529587,
0.6340487003326416,
-0.17672224342823029,
-1.249814748764038,... |
def init _ multiprocessing _ and _ cuda ( rank, args _ from _ spawn ) : if args _ from _ spawn. multi _ gpu _ distributed : # force set the gpu device in the case where a single node has > 1 gpu os. environ ['cuda _ visible _ devices'] = str ( rank ) args _ from _ spawn. distributed _ rank = rank # set the cuda flag ap... | [
-0.08789567649364471,
0.6462588310241699,
0.988237202167511,
0.10691602528095245,
0.4332379698753357,
0.40099066495895386,
0.3212142288684845,
0.2850813567638397,
-0.5235360860824585,
0.4849236011505127,
0.42947816848754883,
1.238763451576233,
0.047832321375608444,
0.9253599643707275,
0.... |
def _ set _ af _ neighbor _ capability ( self, v, load = false ) : if hasattr ( v, " _ utype " ) : v = v. _ utype ( v ) try : t = yangdynclass ( v, base = af _ neighbor _ capability. af _ neighbor _ capability, is _ container ='container ', presence = false, yang _ name = " af - neighbor - capability ", rest _ name = "... | [
-0.2912868559360504,
0.40160590410232544,
0.5035029649734497,
0.947359025478363,
0.6319284439086914,
-0.7023725509643555,
0.7799403071403503,
-1.0370597839355469,
0.12730233371257782,
1.2437183856964111,
0.30495280027389526,
0.37323302030563354,
-0.50020432472229,
1.4039387702941895,
1.0... |
def post _ user ( user ) : payload = { " schemas " : [ schemas ], " username " : user [ " username " ], " password " : user [ " password " ], " active " : " true ", " name " : { " familyname " : user [ " name " ] [ " familyname " ], " givenname " : user [ " name " ] [ " givenname " ] }, " emails " : [ { " type " : " wo... | [
-1.1085312366485596,
0.26886504888534546,
0.7705819606781006,
0.15692004561424255,
-1.1433712244033813,
0.1664910614490509,
-0.2805667221546173,
-0.9691294431686401,
0.0481388196349144,
0.07032280415296555,
-1.3150492906570435,
0.16192921996116638,
-0.7522025108337402,
-0.5236854553222656,... |
def testcheckallset ( self ) : try : self. settings1. checkallset ( ) except assertionerror : self. fail ( " checkallset ( ) raised unexpected assertionerror. " ) with self. assertraises ( assertionerror ) : self. settings2. checkallset ( ) | [
0.3229675889015198,
0.5265156030654907,
0.5211688876152039,
1.07407808303833,
0.2568018436431885,
0.8948342204093933,
0.20509763062000275,
-0.42090973258018494,
0.05114865303039551,
-0.01980655826628208,
0.13429154455661774,
0.2272738516330719,
-0.04481483995914459,
0.915239691734314,
0.... |
def from _ database ( cls, sess, schema ) : # prior to postgres 11, pg _ proc had different columns # https : / / github. com / olirice / alembic _ utils / issues / 12 pg _ gte _ 11 = " " " and p. prokind ='f'" " " pg _ lt _ 11 = " " " and not p. proisagg and not p. proiswindow " " " # retrieve the postgres server vers... | [
0.1547756940126419,
0.09938230365514755,
0.8108174800872803,
-0.05702017992734909,
-0.22946210205554962,
-0.3707312345504761,
-0.3152009844779968,
-0.05683012306690216,
0.16492988169193268,
0.41701337695121765,
-0.2109629064798355,
0.4683998227119446,
0.029318498447537422,
-0.0817699581384... |
def test _ hardware _ sweep _ sanity ( ) : def hardware _ measurement ( station, namespace ) : return { " measurement " : { " unit " : " v ", " value " : [ 0, 1, 2, 3 ] }, } so = hardwaresweep ( hardware _ measurement ) previous _ iteration = none for iteration in so : if previous _ iteration is not none : assert previ... | [
-0.6833153963088989,
0.6182303428649902,
0.2650347650051117,
0.3032357394695282,
0.5811389684677124,
0.8144217133522034,
0.6894491314888,
-0.2915843725204468,
0.40356892347335815,
-0.5411249995231628,
-0.17727141082286835,
-0.22704127430915833,
-0.27317944169044495,
1.2781165838241577,
-... |
def mkdir ( self, folder _ name ) : # wait untill new button is avaible in webpage new = self. driver. find _ elements _ by _ xpath ( " / / button [ @ name ='new'] " ) while len ( new ) = = 0 : new = self. driver. find _ elements _ by _ xpath ( " / / button [ @ name ='new'] " ) # if button is ready, click it action = a... | [
-0.6343089938163757,
0.34163108468055725,
0.8921698331832886,
0.5691453814506531,
0.6043933033943176,
0.16488848626613617,
0.9236792922019958,
-0.05159387364983559,
0.13430307805538177,
0.029920030385255814,
-0.24924854934215546,
-0.5412473082542419,
0.019257862120866776,
0.948399126529693... |
def test _ compile _ circuit ( ) : compiler _ mock = magicmock ( side _ effect = lambda circuit : circuit ) a, b, c = cirq. linequbit. range ( 3 ) model _ circuit = cirq. circuit ( [ cirq. moment ( [ cirq. x ( a ), cirq. y ( b ), cirq. z ( c ) ] ), ] ) swap _ network = cirq. contrib. quantum _ volume. compile _ circuit... | [
-0.3016001284122467,
-0.01220671832561493,
0.5356112122535706,
-0.08706657588481903,
0.766975462436676,
0.047744762152433395,
0.4987782835960388,
0.16904225945472717,
-0.09253070503473282,
-0.8272683620452881,
-0.8168550133705139,
-0.09466242045164108,
-0.5857996940612793,
0.07041455805301... |
def _ fortran _ float _ converter ( in _ string : bytes ) - > bytes : return in _ string. replace ( b'd ', b'e') | [
0.19774213433265686,
0.04054434224963188,
0.4313627779483795,
-0.6113547682762146,
0.1704406440258026,
-0.25309544801712036,
0.06775883585214615,
0.4296501874923706,
-1.0814472436904907,
-0.5825116634368896,
-0.14534376561641693,
0.08268260955810547,
-0.4060856103897095,
-0.096139572560787... |
def predict ( clf, vect, tfidf ) : dataset = sklearn. datasets. load _ files ( " / home / vinevic / pycharmprojects / test _ mlp / fteste " ) # count _ vect = countvectorizer ( ) x _ train _ counts = vect. transform ( dataset. data ) x _ train _ counts. shape # tfidf _ transformer = tfidftransformer ( ) x _ train _ tfi... | [
0.281782865524292,
-0.42528775334358215,
0.45259860157966614,
-0.16213718056678772,
0.7196725606918335,
0.1906348466873169,
-0.08629831671714783,
0.4798601269721985,
-0.871046245098114,
0.05159531906247139,
-0.16750025749206543,
0.3321828246116638,
0.11632245779037476,
-0.4841354191303253,... |
def getperson ( self ) : url ='https : / / www. theyworkforyou. com / api / getperson? key = % s & id = % s & output = js'% ( theyworkyou _ apikey, self. person _ id ) request = get _ request ( url = url, user = none, headers = { } ) # literal eval the json request into actual json self. person = ast. literal _ eval ( ... | [
-1.097429871559143,
-0.9147863984107971,
0.5717957019805908,
-0.8369543552398682,
-0.1876501739025116,
-0.532234251499176,
-1.3174151182174683,
0.16554012894630432,
-0.5083229541778564,
-0.5631025433540344,
-0.9032348990440369,
0.024527283385396004,
-0.09998025745153427,
0.4106937944889068... |
def _ _ init _ _ ( self, width = none, height = none, x _ offset = 0, y _ offset = 0, delay = 100, delay _ den = 1000, depose _ op = 1, blend _ op = 0 ) : self. width = width self. height = height self. x _ offset = x _ offset self. y _ offset = y _ offset self. delay = delay self. delay _ den = delay _ den self. depos... | [
0.667048990726471,
0.4453330636024475,
0.8514133095741272,
0.6115027070045471,
-0.3609221875667572,
-0.04909030348062515,
0.6636506915092468,
0.6547610759735107,
0.08773070573806763,
-0.4953244924545288,
-0.3435651957988739,
-0.5036960244178772,
0.6593037247657776,
0.4444182813167572,
0.... |
def _ check _ and _ expand _ interval _ tuples ( name, arr ) : assert isinstance ( arr, ( list, tuple ) ), " argument'{ }'( type { } ) should be a list of integers or intervals ". format ( name, type ( arr ) ) res = none for i in range ( len ( arr ) ) : v = arr [ i ] if is _ int ( v ) : if res : res. append ( v ) else ... | [
-0.5483908653259277,
0.6975709795951843,
0.7274495959281921,
0.6558337211608887,
-0.911262571811676,
0.4877680838108063,
0.2292056381702423,
-0.31825536489486694,
0.5385345220565796,
0.7709469199180603,
0.4957992136478424,
-0.7477728128433228,
-1.1859573125839233,
0.4665371775627136,
0.8... |
def execute _ spectro ( self, signal _ raw, lead, r _ peak, before, after ) : if self. plot _ mode : self. debug ( signal _ raw [ lead ], lead, r _ peak, before, after ) # remove baseline signal = self. _ baseline _ remove ( signal _ raw [ lead ] ) # convolve # signal = convolve ( signal, kernel = box1dkernel ( 7. 5 ) ... | [
0.1228611096739769,
0.5017752051353455,
0.9106456637382507,
-0.039452508091926575,
-0.6422653198242188,
0.2309676706790924,
0.045512519776821136,
-0.09121189266443253,
0.5207992792129517,
0.5414572954177856,
0.22313649952411652,
0.8406112790107727,
-0.2693970203399658,
-0.2892879545688629,... |
def build _ optimizer ( model, last _ epoch = - 1 ) : optim _ map = { " rmsprop " : optim. rmsprop, " adam " : optim. adam, " adadelta " : optim. adadelta, " sgd " : optim. sgd, " momentum " : functools. partial ( optim. sgd, momentum = 0. 9 ), " lbfgs " : optim. lbfgs, } # add weight decay ( if > 0 ) and extract the o... | [
-0.27210742235183716,
-0.37230101227760315,
0.8246949315071106,
-0.17436790466308594,
-0.7273465394973755,
-0.7649902105331421,
-0.8358709812164307,
0.7301843166351318,
-0.12214499711990356,
-0.039486292749643326,
-0.1490534543991089,
0.2817649245262146,
0.3390359580516815,
0.1295089125633... |
def step ( self, metrics, tick, phase, tick _ type = none, * * kwargs ) : import requests chunks ='' if phase in ['valid ','test'] : chunks + ='% s ( % d ) [ epoch % d ] [ % s ]'% ( os. getlogin ( ), os. getpid ( ), tick, phase ) for k, v in metrics. items ( ) : if k not in ['avg _ loss ','perplexity'] : v * = 100. chu... | [
-0.45199209451675415,
0.3791022002696991,
0.46783238649368286,
0.06100233271718025,
0.7061488628387451,
0.4623025953769684,
-0.22849537432193756,
-0.19750750064849854,
-0.5707483887672424,
-0.0027020566631108522,
-0.3005547821521759,
0.6821231842041016,
-0.17855489253997803,
0.993546545505... |
def cropped ( self, index, size ) : image, label = self. _ _ getitem _ _ ( index ) image = crop _ pad _ around ( image, size ) return image, label | [
-1.0097031593322754,
-0.507240891456604,
0.48255541920661926,
-0.878931999206543,
-0.4701020121574402,
0.16539952158927917,
-0.350358247756958,
-1.0635173320770264,
1.523657202720642,
0.7222109436988831,
-0.14930027723312378,
0.4153469502925873,
0.34467849135398865,
-0.8468948006629944,
... |
def matched ( self ) : if self. _ match _ cb is not none : self. _ match _ cb ( self ) | [
0.8039703369140625,
-0.03741646558046341,
0.6644120812416077,
0.17635108530521393,
0.22050902247428894,
-0.08460033684968948,
0.7512494325637817,
0.5991401076316833,
0.8352741003036499,
-0.49031785130500793,
-0.25626659393310547,
0.062446098774671555,
-0.11308296024799347,
0.50601744651794... |
def settensorrepresentationsinschema ( schema : schema _ pb2. schema, tensor _ representations : mapping [ str, schema _ pb2. tensorrepresentation ], tensor _ representation _ group _ name : str = _ default _ tensor _ representation _ group ) - > none : tensor _ representation _ map = schema. tensor _ representation _ ... | [
-0.9455776214599609,
0.12509405612945557,
0.2352413386106491,
-0.5101936459541321,
0.05559100583195686,
0.31674924492836,
0.17082323133945465,
0.07306624203920364,
-0.34739193320274353,
1.048323392868042,
-0.4956333041191101,
0.5044834613800049,
-0.11494287103414536,
-0.41100192070007324,
... |
def clip _ gradients ( optimizer, grad _ clip ) : for group in optimizer. param _ groups : for param in group [ " params " ] : if param. grad is not none : param. grad. data. clamp _ ( - grad _ clip, grad _ clip ) | [
-0.19283384084701538,
-0.1082388311624527,
0.5246548652648926,
0.10104324668645859,
-0.356768935918808,
0.9384236931800842,
-0.48749473690986633,
-0.6636126041412354,
-0.7763142585754395,
1.4913876056671143,
0.3476450741291046,
0.9931159615516663,
-0.07121030241250992,
0.5062914490699768,
... |
def transform ( self, x, y = none ) : check _ is _ fitted ( self ) xt = check _ array ( x, ensure _ 2d = false ) if xt. ndim = = 2 : _ check _ has _ one _ column ( xt ) else : xt = xt [ :, none ] if self. kind = ='balanced': # test whether self. left _ limits _ and self. right _ limits _ have # been created - - to catc... | [
-0.0799206867814064,
-0.3668161928653717,
0.5722044110298157,
0.5520684719085693,
-0.03485910966992378,
0.2037280946969986,
-0.42216968536376953,
-1.0734014511108398,
0.542928159236908,
-0.24399924278259277,
-0.6136012077331543,
0.646909773349762,
-0.1952831894159317,
-0.6062089204788208,
... |
def clone ( self ) - > " dataframe " : return wrap _ df ( self. _ df. clone ( ) ) | [
-0.2581005394458771,
-0.04017355293035507,
0.3734714984893799,
0.9596728086471558,
-0.49413004517555237,
0.4047646224498749,
-0.04449624940752983,
-1.3355008363723755,
0.45822668075561523,
-1.0905239582061768,
0.7114760279655457,
1.6561342477798462,
0.20345976948738098,
-1.8149439096450806... |
def update ( self, trans, id, payload, * * 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 ( ... | [
-1.0793302059173584,
-0.47035133838653564,
0.5180948972702026,
-0.5096715688705444,
-0.5089356899261475,
-0.1958945095539093,
-0.034987520426511765,
-0.7005918025970459,
-0.02181793376803398,
0.6769737601280212,
-0.08706729114055634,
0.10588588565587997,
-0.13079629838466644,
0.11168312281... |
def test _ set _ index ( ) : df = pd. dataframe ( data = [ [ 8, " a ", 4 ], [ 5, " b ", 92 ] ], index = [ 1, 2 ], columns = [ " num ", " char ", " w " ] ) res _ df = setindex ( " num ", drop = true ). apply ( df ) assert " w " in res _ df. columns assert " num " not in res _ df. columns assert " char " in res _ df. col... | [
-1.0512831211090088,
0.5485047101974487,
0.6006460785865784,
-0.4124756157398224,
-0.04398582503199577,
-0.10977913439273834,
0.5063382387161255,
0.06800860911607742,
0.23634077608585358,
0.10125237703323364,
-1.1850043535232544,
0.06484111398458481,
-0.09180886298418045,
-1.00195968151092... |
def getdataframefrombase ( self, verbose = false ) : dtypes = { " abstract " : object, " acm _ class " : object, " arxiv _ id " : object, " author _ text " : object, " categories " : object, " comments " : object, " created " : object, " doi " : object, " num _ authors " : int, " num _ categories " : int, " primary _ c... | [
-0.03601239249110222,
-0.13810907304286957,
0.7804234027862549,
-0.08765382319688797,
0.5653133392333984,
-0.2644897997379303,
0.3693788945674896,
-0.21069501340389252,
-1.3351835012435913,
-0.6609290838241577,
0.739784300327301,
0.5862459540367126,
-0.029681207612156868,
0.274500727653503... |
def available _ livingspaces ( self ) : livingspaces = [ ] for room in self. all _ created _ rooms. values ( ) : if room. type _ = = " livingspace " and not room. is _ full ( ) : livingspaces. append ( room ) return livingspaces | [
-0.6571584939956665,
-0.7634950876235962,
0.22735342383384705,
1.3904228210449219,
-0.35480087995529175,
1.546539068222046,
-0.762647807598114,
-0.00026530990726314485,
1.013143539428711,
0.2669026255607605,
0.05468090623617172,
-0.16881078481674194,
-0.48164644837379456,
1.530105590820312... |
def _ _ init _ _ ( self, id = none, portfolio _ id = none, mtype = none, status = none, created _ date = none, additional _ properties = { } ) : # initialize members of the class self. id = id self. portfolio _ id = portfolio _ id self. mtype = mtype self. status = status self. created _ date = created _ date # add add... | [
0.6619053483009338,
-0.42622825503349304,
0.4142376780509949,
0.48984190821647644,
0.273377001285553,
0.6292632818222046,
-0.2447236329317093,
0.6785575747489929,
0.26878622174263,
-0.08186984807252884,
-0.8308793902397156,
0.2974940538406372,
-0.12660405039787292,
0.5116183161735535,
-0... |
def whitespace _ committee ( file ) : error = prev = none n = 0 while true : line = yield error error = none if not line : break n + = 1 # check for trailing whitespace if line. strip ( " \ r \ n " ). endswith ( " " ) : error = ( file, n + 1, " trailing whitespace detected! \ n " " { 0 } ". format ( line ) ) # check fo... | [
1.1889032125473022,
-0.43699806928634644,
0.753074586391449,
-0.5042427778244019,
0.1033274382352829,
0.3022170960903168,
0.3074193000793457,
0.022668281570076942,
-0.27416765689849854,
0.2243318408727646,
0.8549934029579163,
0.1475328505039215,
0.09211224317550659,
1.1605796813964844,
0... |
def list ( self ) : return self. _ list ( " / users ", " users " ) | [
-1.001232385635376,
-0.0942905843257904,
0.08534437417984009,
0.4695912301540375,
1.361956238746643,
-0.6718616485595703,
-1.2047430276870728,
0.5240437388420105,
0.7320030927658081,
-0.369089275598526,
-0.4938932955265045,
0.9142473936080933,
-0.2674885392189026,
0.6486989855766296,
-1.... |
def toolbar ( hex _ p ) : tint. imagepath ( config _ dir /'theme _ toolbar. png'). tint ( hex _ p [ 0 ], theme _ dir /'img / theme _ toolbar. png') | [
-0.6005744338035583,
0.5127816796302795,
0.2962109446525574,
-0.887823224067688,
0.7158898115158081,
1.5812259912490845,
0.25636354088783264,
0.15670807659626007,
-0.5189673900604248,
0.57085120677948,
-0.3241450786590576,
-0.3219510614871979,
0.3752633333206177,
0.7305973172187805,
1.15... |
def get _ access _ token ( self ) : action = " get access token " username = self. username password = self. password if username and password : now = current. request. utcnow credentials, _, error = self. http ( method = " post ", path = " / v1 / oauth2 / token ", data = " grant _ type = client _ credentials ", auth =... | [
0.007564306724816561,
-0.5661600828170776,
0.7736654281616211,
-0.15139250457286835,
-0.48472583293914795,
-0.5517272353172302,
-0.4135175049304962,
0.17554421722888947,
0.33341458439826965,
-0.5626199841499329,
0.8671165704727173,
1.3912914991378784,
0.10182767361402512,
0.329791694879531... |
def extend _ step ( self, cached _ states : nestedmap, inputs : jtensor, *, time _ step : jtensor, segment _ mask : optional [ jtensor ] = none, cross _ inputs : optional [ jtensor ] = none, cross _ paddings : optional [ jtensor ] = none, cross _ segment _ mask : optional [ jtensor ] = none ) - > tuple [ jtensor, neste... | [
-0.29451784491539,
0.7059467434883118,
0.7156482934951782,
0.47283369302749634,
0.06388907134532928,
-0.1953328549861908,
-0.034160830080509186,
-0.26275864243507385,
-0.0059874337166547775,
-0.3576039671897888,
-1.1556928157806396,
0.09531071037054062,
1.2088536024093628,
0.06872847676277... |
def super _ kls ( self ) : if not self. kls and self. parent and self. parent. name : return self. parent. kls _ name return self. kls | [
1.4958992004394531,
-0.21642141044139862,
0.4503041207790375,
0.3276161551475525,
-1.5026261806488037,
0.6224609613418579,
-0.494851678609848,
-0.23222331702709198,
0.8828666806221008,
-0.2230951339006424,
0.342540979385376,
0.2956249415874481,
0.18597666919231415,
0.5535517930984497,
-0... |
def putasync ( self ) : part _ list = [ partentity ( id = i + 1, parent = self. key, value = part ) for i, part in enumerate ( _ serialize ( self. getdata ( ) ) ) ] self. size = len ( part _ list ) yield ndb. put _ multi _ async ( part _ list + [ self ] ) | [
-1.2209138870239258,
0.6167963147163391,
0.6176077127456665,
-0.5436771512031555,
0.18503452837467194,
0.08945538848638535,
-0.6649536490440369,
-0.11454763263463974,
-0.0992988795042038,
0.34821978211402893,
-0.8963189721107483,
-0.8181633949279785,
-0.7109367251396179,
0.4588878750801086... |
def stats ( ) : class _ dict = { " amenity " : " amenities ", " city " : " cities ", " place " : " places ", " review " : " reviews ", " state " : " states ", " user " : " users " } objs = { class _ dict [ cls ] : storage. count ( cls ) for cls in class _ dict } return jsonify ( objs ) | [
-1.2556146383285522,
-0.3496897518634796,
0.5528463125228882,
-0.9303517937660217,
0.371371865272522,
0.17232345044612885,
-0.2716575562953949,
-0.4382590353488922,
0.22665007412433624,
0.3520332872867584,
-1.0033957958221436,
-0.09599721431732178,
1.1705200672149658,
0.06901352852582932,
... |
def setup ( self ) : self. client = apiclient ( ) self. user = get _ user _ model ( ). objects. create _ user ( email ='temp @ gmail. com ', password ='supersecrettestpassword') self. client. force _ authenticate ( self. user ) self. recipe = sample _ recipe ( user = self. user ) | [
0.5158335566520691,
0.6328899264335632,
0.27579352259635925,
0.917578935623169,
0.2937438189983368,
-0.012831555679440498,
0.0957188829779625,
1.0413782596588135,
0.13518722355365753,
-0.22892987728118896,
-1.2894375324249268,
0.4228110611438751,
-0.045405901968479156,
-0.2992493808269501,... |
def ema ( df, base, target, period, alpha = false ) : con = pd. concat ( [ df [ : period ] [ base ]. rolling ( window = period ). mean ( ), df [ period : ] [ base ] ] ) if ( alpha = = true ) : # ( 1 - alpha ) * previous _ val + alpha * current _ val where alpha = 1 / period df [ target ] = con. ewm ( alpha = 1 / period... | [
-0.9288927316665649,
-0.07483786344528198,
0.8974477648735046,
-0.03869568556547165,
0.6145557761192322,
0.036412034183740616,
0.8634240627288818,
0.2658771574497223,
0.1871981918811798,
0.36854317784309387,
1.0266690254211426,
1.1239365339279175,
0.15512144565582275,
0.19901379942893982,
... |
def _ _ init _ _ ( self, rootdirectory ) : # make sure to remove drive name from the filename if it's windows if platform. system ( ) = = " windows " : rootdirectory = rootdirectory [ 3 : ] # remove " c : / " # sanitise root directory by ensuring only / is used # as a path separator self. rootdirectory = re. sub ( r " ... | [
0.5011530518531799,
-0.9573501944541931,
0.7436940670013428,
0.4122428894042969,
-1.0672123432159424,
-0.39823469519615173,
-0.0451371967792511,
0.6758473515510559,
-0.07280141115188599,
-0.44145122170448303,
0.8629398941993713,
0.16500116884708405,
-0.16292959451675415,
0.9472878575325012... |
def get ( self, post _ id ) : if self. user : post = post. get _ by _ id ( int ( post _ id ) ) if not post : self. error ( 404 ) if post. user. key ( ). id ( ) = = int ( self. user ) : post. delete ( ) self. redirect ('/') else : error = " you cannot delete this post. " self. render ( " edit _ blog. html ", access _ er... | [
0.43448707461357117,
0.1541135609149933,
0.7172194123268127,
1.8351778984069824,
0.37745389342308044,
-0.14938171207904816,
0.2277747392654419,
0.7243723273277283,
0.9299600720405579,
0.23680132627487183,
0.8023424744606018,
0.4800858795642853,
-0.14412064850330353,
0.12990599870681763,
... |
def volume _ id ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " volume _ id " ) | [
1.6918041706085205,
0.06110813841223717,
0.35350659489631653,
0.6416336894035339,
1.0509275197982788,
1.0977046489715576,
-0.31523802876472473,
0.2220906913280487,
1.2043299674987793,
-0.5712188482284546,
0.5499958395957947,
1.2896088361740112,
-0.31499728560447693,
-0.5160427689552307,
... |
def predict ( self, s, target = false ) : if target : return self. model _. predict ( s ) else : return self. model. predict ( s ) | [
-0.9437641501426697,
0.011056696996092796,
0.1340014934539795,
-0.17912417650222778,
-0.8355020880699158,
-0.39628612995147705,
-0.5025390386581421,
-0.17918726801872253,
0.19787812232971191,
-0.47060760855674744,
0.3748241066932678,
0.06588582694530487,
0.25123101472854614,
-0.79249161481... |
def step ( self, reward, observation ) : self. _ last _ observation = self. _ observation self. _ record _ observation ( observation ) if not self. eval _ mode : self. _ store _ transition ( self. _ last _ observation, self. action, reward, false ) self. replay _ buffer _ temp. add ( self. _ last _ observation, self. a... | [
-0.3699241876602173,
0.23302318155765533,
0.6215618848800659,
-0.3247891664505005,
0.30314901471138,
0.03921572491526604,
0.5531043410301208,
-0.5997153520584106,
0.5614688396453857,
0.011643210425972939,
-0.8878635764122009,
0.21994981169700623,
-0.2343837171792984,
-1.0702396631240845,
... |
async def tap _ button ( self, button _ id : str ) : if button _ id in self. buttons : await self. _ request ( " createrequest ", f " / button / { button _ id } / commandprocessor ", { " command " : { " commandtype " : " pressandrelease " } }, ) | [
-0.5530930161476135,
0.06845036894083023,
0.3049730360507965,
0.1314891129732132,
0.7090325951576233,
0.3452135920524597,
-0.8515441417694092,
-0.2971362769603729,
0.9277448654174805,
-0.07571770250797272,
-0.2537343502044678,
0.3292279839515686,
0.3915002942085266,
0.9043372869491577,
0... |
def _ euro _ put ( s : float, k : float, r : float, t : float, sigma : float ) - > float : d1 = _ d1 ( s, k, t, r, sigma ) d2 = _ d2 ( s, k, t, r, sigma ) put = ( k * numpy. exp ( - r * t ) * si. norm. cdf ( - d2, 0., 1. ) ) - \ ( s * si. norm. cdf ( - d1, 0., 1. ) ) return round ( put, 4 ) | [
0.7688965797424316,
0.382041871547699,
0.3452948331832886,
-1.3356590270996094,
-0.6103959083557129,
-0.3316013216972351,
0.4936755895614624,
0.11389465630054474,
-0.6411895155906677,
1.1808708906173706,
0.2739640474319458,
-0.3670543432235718,
-0.21341253817081451,
-1.6034361124038696,
... |
def plot _ weekend _ revenue _ mojo ( self ) : self. mojo _ box _ office _ df ['weekend _ gross _ thou'] = self. mojo _ box _ office _ df ['weekend _ gross _ usd']. replace ('[ \ £, ] ','', regex = true ). astype ( float ) / 1000 ax = sns. lineplot ( x = " start _ date ", y = " weekend _ gross _ thou ", data = self. mo... | [
0.5195934176445007,
0.43564778566360474,
0.8183252215385437,
-0.9245247840881348,
-0.7382676601409912,
0.1572268307209015,
-0.05534848943352699,
0.7607640027999878,
0.22159458696842194,
-0.16339577734470367,
0.1494143009185791,
1.3439942598342896,
-0.3372676968574524,
-0.22024965286254883,... |
def test _ here ( tmpdir, project _ files, child _ dir ) : # create project file temp _ dir = path ( tmpdir ) path = temp _ dir / project _ files with path. open ( " w " ) as file _ path : file _ path. write ( " blah " ) # create child dirs ( temp _ dir / child _ dir ). mkdir ( parents = true ) chdir ( temp _ dir / chi... | [
0.9689140319824219,
-0.4157070517539978,
0.6437110900878906,
0.33698514103889465,
0.6249451041221619,
1.5491394996643066,
1.199484944343567,
-0.27880698442459106,
-0.6840910315513611,
-0.3855839669704437,
-0.17174804210662842,
-0.6730367541313171,
-0.5348709225654602,
-0.013709758408367634... |
def cinemas _ in _ town ( data : gpd. geodataframe, town _ name : str ) - > int : data = data [ " com _ nom " ]. value _ counts ( ) try : theaters _ town = data [ town _ name ] return theaters _ town except exception as error : logger. warning ( error ) return 0 | [
-0.4701271951198578,
-0.4680824875831604,
0.5751800537109375,
-0.5261001586914062,
-0.2126421332359314,
-0.010016104206442833,
0.0069194696843624115,
0.5172220468521118,
-0.6139364838600159,
0.5486807227134705,
0.10560335963964462,
0.34915322065353394,
0.01926490105688572,
0.10873614251613... |
def latitude ( self, latitude ) : self. _ latitude = latitude | [
0.1457303911447525,
-0.445777952671051,
-0.27777978777885437,
-0.7368936538696289,
-0.5770241618156433,
1.072037935256958,
-0.6647828221321106,
0.5410041809082031,
-0.49498429894447327,
0.011351436376571655,
-1.044681191444397,
-1.0945709943771362,
-0.2156597375869751,
0.3388046622276306,
... |
def valid _ for _ secs ( self ) - > optional [ int ] : def _ timeleft ( info _ dict, claim = " exp " ) - > optional [ int ] : " " " get expiry from info dictionary ( either from access token or introspection " " " if claim in info _ dict : now = time ( ) timeleft = info _ dict [ claim ] - now return timeleft return non... | [
1.119688630104065,
-0.6492160558700562,
0.6276249885559082,
-1.4542341232299805,
0.37614011764526367,
0.3695584833621979,
-0.916881799697876,
-0.0919693186879158,
0.14798583090305328,
0.22705189883708954,
0.4506027102470398,
0.21701553463935852,
-0.08162812143564224,
0.6687246561050415,
... |
def log _ skip ( self, resource, msg ) : self. logger. info ( " [ % s ] % s - skip : % s " % ( resource ['id'], resource ['name'], msg ) ) | [
-0.41826140880584717,
-0.720914900302887,
0.6154056787490845,
-0.8644468188285828,
-0.19633328914642334,
0.46808236837387085,
0.31084638833999634,
-0.37190014123916626,
-0.5846081376075745,
0.2644328773021698,
-0.12809886038303375,
0.5260396599769592,
0.38161155581474304,
-0.71823132038116... |
def will _ clear ( self ) : self. _ will = false self. _ will _ topic = " " self. _ will _ payload = none self. _ will _ qos = 0 self. _ will _ retain = false | [
0.10401379317045212,
0.2623736560344696,
0.22006183862686157,
-0.9575634002685547,
0.16211868822574615,
0.07280934602022171,
-0.2027813345193863,
-1.334643840789795,
0.46152424812316895,
-0.1660628318786621,
-0.6311697363853455,
1.4329532384872437,
-0.053155262023210526,
0.3458591401576996... |
def status ( self ) - > optional [ str ] : return pulumi. get ( self, " status " ) | [
0.8840094804763794,
-0.3404715657234192,
0.3010663390159607,
0.5359886884689331,
0.9858518838882446,
1.195312738418579,
-0.7661055326461792,
0.270215779542923,
0.8810352087020874,
0.03336980938911438,
0.06324440985918045,
0.588769793510437,
0.4507307708263397,
-1.0958200693130493,
-0.473... |
def load _ files ( directory ) : # successfully implemented files = os. listdir ( directory ) file _ data _ list = list ( ) for file in files : with open ( os. path. join ( directory, file ), encoding ='utf - 8') as f : text = f. read ( ) file _ data _ list. append ( ( file, text ) ) print ( f " loaded { file } " ) fil... | [
-0.9647265076637268,
-0.18974125385284424,
0.6200441122055054,
-1.1384297609329224,
-1.2366969585418701,
-0.1359938234090805,
-0.4902086555957794,
0.8309321999549866,
-0.5609624981880188,
0.5880703330039978,
-1.0430446863174438,
-0.7698643207550049,
0.4947426915168762,
1.1354674100875854,
... |
def init _ states ( self, target _ batch _ size : int, target _ max _ length : int ) - > nestedmap : return self. self _ attention. init _ states ( target _ batch _ size, target _ max _ length ) | [
-0.7581029534339905,
-0.4683709442615509,
0.34627482295036316,
-0.23615320026874542,
0.20481595396995544,
-0.334902822971344,
0.19234322011470795,
0.19133570790290833,
0.38868120312690735,
-0.5860154628753662,
-0.6536800265312195,
0.7711712718009949,
0.8859012722969055,
-0.7641371488571167... |
def overrides ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input ['spotfleetrequestlaunchtemplateconfigoverrideargs'] ] ] ] : return pulumi. get ( self, " overrides " ) | [
-0.4345393776893616,
-0.02448553778231144,
0.6037051677703857,
0.6124058365821838,
1.1188002824783325,
0.15922893583774567,
-0.07219165563583374,
0.2898644506931305,
0.8815534710884094,
-0.9619104862213135,
-0.6352586150169373,
0.05570955574512482,
-0.2924632132053375,
-0.44648244976997375... |
def test _ build _ mlp _ norm _ training ( init _ kwargs ) - > none : # create tensors to hold input and outputs. x = th. linspace ( - math. pi, math. pi, 200 ). reshape ( - 1, 1 ) y = th. sin ( x ) # construct our model by instantiating the class defined above model = networks. build _ mlp ( in _ size = 1, hid _ sizes... | [
0.22462157905101776,
-0.22796855866909027,
0.6993843913078308,
0.3263969421386719,
0.09035477042198181,
0.29734209179878235,
0.62957763671875,
-0.013453363440930843,
0.5460670590400696,
-0.7512006759643555,
-0.3355247676372528,
0.42633819580078125,
-0.13351668417453766,
-0.5145673751831055... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.