text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def block _ device _ mapping _ get _ all _ by _ instance ( context, instance _ uuid ) : return impl. block _ device _ mapping _ get _ all _ by _ instance ( context, instance _ uuid ) | [
-1.2662664651870728,
0.21089540421962738,
0.5584196448326111,
0.8165550827980042,
-0.09145111590623856,
-0.052094344049692154,
0.6587834358215332,
0.019974732771515846,
0.10291147232055664,
0.01597210206091404,
0.08215003460645676,
0.34466519951820374,
0.16754651069641113,
0.28094300627708... |
def n _ vec ( x, axis = none ) : if axis is none : if x. ndim = = 1 : n = x. sum ( ) return np. concatenate ( ( [ n ], n - np. cumsum ( x ) [ : - 2 ] ) ) elif x. ndim = = 2 : n = x. sum ( axis = 1 ) return np. hstack ( ( n [ :, none ], n [ :, none ] - np. cumsum ( x, axis = 1 ) [ :, : - 2 ] ) ) else : raise valueerror ... | [
-0.08806845545768738,
0.279053270816803,
1.0828746557235718,
0.7526774406433105,
-0.5519576668739319,
-0.09213119745254517,
0.9038848876953125,
-0.15537810325622559,
0.23434576392173767,
-0.12418611347675323,
-0.6278728246688843,
0.6280016899108887,
1.1441353559494019,
0.30667513608932495,... |
def get _ formatted _ desc ( self ) : if self. wf _ param _ values : if self. type = = " data " or self. type = = " data _ collection " : self. formatted _ desc + = self. get _ formatted _ inputs ( ) elif self. type = = " section " : self. formatted _ desc + = self. get _ formatted _ section _ desc ( ) elif self. type ... | [
0.03643780201673508,
-0.6836699843406677,
0.8402870893478394,
-0.27088579535484314,
0.6394901275634766,
0.5209025144577026,
-0.4863666892051697,
-0.7628679871559143,
-0.8165844082832336,
0.060271382331848145,
1.1884422302246094,
1.218909502029419,
0.2878950238227844,
1.8842235803604126,
... |
def get _ swift _ status ( msg ) : ack _ or _ nack _ flag = int ( re. findall ( r " { 451 : (. +? ) } ", msg ) [ 0 ] ) if ack _ or _ nack _ flag = = 1 : status = " nack " elif ack _ or _ nack _ flag = = 0 : status = " ack " return status | [
0.6752123236656189,
0.33792054653167725,
0.6317026019096375,
-0.23031523823738098,
0.08860275894403458,
-0.08978265523910522,
0.2320713847875595,
0.32904791831970215,
0.1000978872179985,
0.06747269630432129,
0.4177548885345459,
0.515880823135376,
0.02722415328025818,
1.0449941158294678,
... |
def press _ button ( port, button, n = 1 ) : cmd = {'units': 0xfe,'light': 0xfd,'load': 0xfd,'range': 0x7f,'apo': 0x7f,'rec': 0xfb,'peak': 0xf7,'left': 0xf7,'rel': 0xdf,'right': 0xdf,'min': 0xbf,'max': 0xbf,'up': 0xbf,'hold': 0xef,'down': 0xef,'off': 0xf3,'rec': 0xdc,'peak': 0xda,'left': 0xda,'load': 0xdb,'light': 0xdb... | [
-0.1720317006111145,
0.385635644197464,
0.7929890155792236,
0.06608309596776962,
0.19710151851177216,
-0.08591959625482559,
-0.04008126258850098,
-1.0603173971176147,
-0.03652948886156082,
-0.33456602692604065,
-0.950641930103302,
-0.35087844729423523,
-0.30024516582489014,
0.8702287673950... |
def init _ from _ ext _ values ( obj, name ) : ext = acm. getdefaultcontext ( ). getextension ('fextensionvalue ','fobject ','reportingsettings _'+ name ) if not ext : logger. wlog ('extension value reportingsettings _'+ name +'does not exist! using reportingsettings _ default.') return extlist = ext. value ( ). split ... | [
-0.28973472118377686,
0.028832824900746346,
0.824125349521637,
-0.42431962490081787,
-0.36089202761650085,
-0.4964540898799896,
-0.06553604453802109,
-0.11070902645587921,
0.04114244505763054,
0.9964348673820496,
-0.6814594864845276,
0.14766398072242737,
0.17588570713996887,
0.220965728163... |
def closest _ point _ on _ line ( point, line ) : p0, p1 = line dx = p1. x - p0. x dy = p1. y - p0. y r = ( ( point. x - p0. x ) * dx + ( point. y - p0. y ) * dy ) / ( dx * dx + dy * dy ) r = min ( 1, max ( 0, r ) ) return point ( p0. x + r * dx, p0. y + r * dy ) | [
0.8433583974838257,
-1.1113359928131104,
0.3603008985519409,
0.016219567507505417,
-0.42499276995658875,
0.9232792258262634,
-0.6702989935874939,
-0.03582514077425003,
0.12686054408550262,
-0.3473961353302002,
0.21817371249198914,
-0.26354801654815674,
-0.17996618151664734,
-0.141602262854... |
def ssb _ parse _ url ( table _ num ) : return'http : / / data. ssb. no / api / v0 / en / table /'+ str ( table _ num ) | [
-0.38373371958732605,
0.12671174108982086,
0.4170401990413666,
1.0868046283721924,
0.05113644525408745,
0.6383092999458313,
0.20846767723560333,
0.40270042419433594,
-0.3225940465927124,
-0.1335335522890091,
-0.3203076720237732,
0.5096197724342346,
0.02927733026444912,
0.05851748585700989,... |
def matching ( docs, glob ) : for doc in docs : if fnmatch ( doc. id _ path, glob ) : yield doc | [
0.09381767362356186,
-0.6352787613868713,
0.4140094518661499,
1.1725480556488037,
-0.39591583609580994,
0.16966240108013153,
0.30630889534950256,
-0.052892375737428665,
-0.1372300237417221,
-0.06887141615152359,
0.13828283548355103,
-0.881615400314331,
-0.6382718682289124,
0.08396281301975... |
def convolve _ grayscale ( images, kernel, padding ='same ', stride = ( 1, 1 ) ) : m, h, w = images. shape kh, kw = kernel. shape sh, sw = stride if isinstance ( padding, tuple ) : ( phtop, pwlft ), ( phbtm, pwrt ) = padding, padding elif padding = ='same': phtop, pwlft, phbtm, pwrt = ( kh - 1 ) / / 2, ( kw - 1 / / 2 )... | [
0.06949246674776077,
0.4649638831615448,
0.959481418132782,
0.012887577526271343,
-0.3111732602119446,
-0.28055864572525024,
-0.5154445767402649,
0.18211360275745392,
-0.4345977008342743,
0.9380199909210205,
0.15102168917655945,
0.057930074632167816,
0.2494228631258011,
1.2115647792816162,... |
def pan _ cb ( self, plot, pan _ pos ) : if self. _ panning _ x : return t = pan _ pos [ 0 ] _ t, y = self. viewer. get _ pan ( ) [ : 2 ] self. viewer. set _ pan ( t, y ) self. adjust _ view ( ) | [
0.11301679909229279,
0.008622276596724987,
0.2443210482597351,
0.19567112624645233,
-0.9247915744781494,
-0.2843019366264343,
0.578018069267273,
0.31805381178855896,
0.5009804368019104,
-0.3649410903453827,
-0.6426811814308167,
0.4130501449108124,
0.43496033549308777,
-0.470796674489975,
... |
def test _ item _ url ( self ) : response = self. client. get ( self. i1. get _ absolute _ url ( ) ) self. failunlessequal ( 200, response. status _ code ) self. failunlessequal ( serializers. serialize ('json ', [ self. i1, ] ), response. content ) | [
-1.1159191131591797,
-0.547607958316803,
0.4854646921157837,
0.3424336016178131,
0.8484148979187012,
1.1443591117858887,
-0.4193843603134155,
-0.32145553827285767,
-0.26605361700057983,
-0.07065184414386749,
-0.7241973876953125,
-0.041304342448711395,
-0.0785532295703888,
-1.41854417324066... |
def sqrt _ mhessian2invcm ( x ) : return x * sqrt _ mhessian _ to _ invcm | [
0.15130199491977692,
-0.9128889441490173,
0.3985375761985779,
-0.5220398306846619,
-0.9547781348228455,
-0.03709317743778229,
-1.946515679359436,
-0.20080778002738953,
0.9282594323158264,
-0.26473554968833923,
-0.33499330282211304,
0.5632364153862,
-0.2034268081188202,
0.14321520924568176,... |
def weighted _ loss ( y _ true, y _ softmax _ conv, weight ) : y _ true = tf. to _ float ( tf. reshape ( y _ true [..., 0 ], [ - 1 ] ) ) weight = tf. to _ float ( tf. reshape ( weight [..., 0 ], [ - 1 ] ) ) y _ conv = tf. to _ float ( tf. reshape ( y _ softmax _ conv [..., 1 ], [ - 1 ] ) ) loss _ pos = 1 / 2 * tf. pow ... | [
-0.24751052260398865,
-0.3020254671573639,
0.5096828937530518,
0.7254654765129089,
-0.3445393741130829,
-0.23463262617588043,
-0.05737496167421341,
0.27868929505348206,
-0.81580650806427,
0.9644473791122437,
0.16314412653446198,
-0.18502260744571686,
-0.0961611419916153,
0.5047804713249207... |
def get ( self, name, select = false, extract = true, * * kwargs ) : if select and not extract : raise valueerror ('cannot apply selection on raw sensor data') with self. _ lock : try : # first try to load the actual sensor data from cache sensor _ data = self. _ raw [ name ] except keyerror : # otherwise, iterate thro... | [
-0.7426407337188721,
-0.40507298707962036,
0.6631298065185547,
-0.24243375658988953,
-0.7297376394271851,
-0.9183045029640198,
0.09573658555746078,
-0.560608446598053,
0.8575119972229004,
0.11080414801836014,
-0.20131638646125793,
0.11784707009792328,
0.18422280251979828,
0.327141582965850... |
def get _ node _ params ( self, db _ id : int ) - > nodeparams : node = self. nodes [ db _ id ] return nodeparams ( db _ id = node. db _ id, value = node. value, is _ deleted = node. is _ deleted, ) | [
-0.08098390698432922,
0.5651704668998718,
0.06446832418441772,
-0.49923551082611084,
0.3132060468196869,
-0.514473557472229,
-0.8859670758247375,
-0.15737611055374146,
0.056719936430454254,
0.633769154548645,
0.36247938871383667,
0.8373103141784668,
0.2931506633758545,
1.5125906467437744,
... |
def assemble _ off _ diagonal _ stiffness _ matrix ( n, basis, l, s, t, eps, lmda, beta ) : # discreteise the domain - we will need the xis xs = np. linspace ( - 1, 1, n + 1 ) # evaluate n < < \ xi _ l \ chi _ s \ chi _ t > > coef = 2 * eps * sqrt ( lmda ) * eval _ xi _ chi _ st ( basis, l, s, t ) # construct the'globa... | [
0.1644970327615738,
-0.4494686424732208,
0.6325719356536865,
-0.9502115845680237,
-0.5822710394859314,
-0.6925772428512573,
0.4887543320655823,
0.4943343698978424,
-0.09595533460378647,
-0.07427884638309479,
-0.16269977390766144,
0.9291876554489136,
-0.11853823810815811,
0.1538816988468170... |
def _ write _ start _ of _ run _ log _ messages ( self ) : logger. info ( " full set of arguments : " ) for k, v in vars ( self ). items ( ) : logger. info ( " { } = = { } ". format ( k, v ) ) num _ locs = len ( self. all _ location _ ids ) logger. info ( " conda bin dir : { } ; conda env : { } ". format ( self. _ path... | [
-0.3039792776107788,
-1.1183158159255981,
0.7038817405700684,
-0.7297664880752563,
0.34860289096832275,
0.09151197969913483,
0.5301668643951416,
-0.09460636973381042,
-0.8713113069534302,
0.10223580151796341,
-0.042200375348329544,
0.7747036814689636,
0.2826581597328186,
0.7800517678260803... |
def test _ weak _ password ( self ) : res = self. client ( ). post ( self. full _ url ('auth / signup'), data = json. dumps ( self. data [ " weak " ] ), content _ type ='application / json') self. assertequal ( res. status _ code, 400 ) | [
-0.35107389092445374,
0.09293341636657715,
0.6897085905075073,
-0.1616862416267395,
0.9041531682014465,
0.6565946936607361,
-1.399973750114441,
-0.29682615399360657,
0.8241897821426392,
-0.047285448759794235,
-1.0754982233047485,
0.4614311754703522,
-0.38277876377105713,
0.8196340799331665... |
async def test _ logbook _ stream _ ignores _ forced _ updates ( recorder _ mock : recorder, hass : homeassistant, hass _ ws _ client : websocketgenerator ) - > none : now = dt _ util. utcnow ( ) await asyncio. gather ( * [ async _ setup _ component ( hass, comp, { } ) for comp in ( " homeassistant ", " logbook ", " au... | [
-0.08274079859256744,
0.037441518157720566,
0.9522815346717834,
0.05361853167414665,
0.5076600313186646,
0.2283020317554474,
-0.17684078216552734,
-0.46067607402801514,
-0.25865039229393005,
-0.20095624029636383,
-0.8339745402336121,
0.7341639995574951,
-0.2059241384267807,
0.8533368110656... |
def insertion _ sort ( file ) : # swap current value with all values to the left until it is in place for outer in range ( 1, len ( file ) ) : current _ pos = outer while file [ current _ pos ] < file [ current _ pos - 1 ] and current _ pos > 0 : file [ current _ pos ], file [ current _ pos - 1 ] = ( file [ current _ p... | [
-0.8273186683654785,
-0.036834776401519775,
0.6967974901199341,
-0.8339265584945679,
-0.30283409357070923,
0.7801401615142822,
0.8317022919654846,
0.6442660689353943,
-1.32597815990448,
0.22380535304546356,
0.05050303786993027,
-0.33008360862731934,
-1.2533701658248901,
1.5720970630645752,... |
def test _ create _ game _ and _ add _ a _ second _ player ( self ) : # make create request and parse response response = self. c. post ( reverse ('api - ajax - game') ) response _ dict = json. loads ( response. content ) # switch user accounts self. testbed. setup _ env ( user _ email ='anotheruser @ example. com ', u... | [
0.25513434410095215,
-0.040272947400808334,
1.021841049194336,
0.6258710026741028,
1.1570258140563965,
0.623522162437439,
-0.4781026244163513,
-0.3943169414997101,
-0.5902339220046997,
0.1898162066936493,
-0.6395204067230225,
-0.3450013995170593,
-0.08463370054960251,
0.12646208703517914,
... |
def writeif ( label ) : f. write ( " @ " + str ( sp ) + " \ n " ) f. write ( " m = m - 1 \ n " ) f. write ( " a = m \ n " ) f. write ( " d = m \ n " ) f. write ( " @ " + currentfunction + " $ " + label + " \ n " ) f. write ( " d ; jne \ n " ) | [
-0.32568585872650146,
-0.06529147922992706,
0.7185109853744507,
0.08716727048158646,
0.5082018375396729,
0.37611454725265503,
0.09123685956001282,
-0.26558491587638855,
-0.24181343615055084,
0.14721038937568665,
0.15503282845020294,
0.026087598875164986,
-0.5231173038482666,
0.314122289419... |
def create _ data _ artifact ( self, semantictype, inputpath, outputfilepath, sourceformat ) : subprocess. run ( ['qiime ','tools ','import ','- - type ', semantictype,'- - input - path ', inputpath,'- - output - path ', outputfilepath,'- - source - format ', sourceformat ] ) return outputfilepath | [
0.2178746610879898,
-0.4979878067970276,
0.37811821699142456,
-0.458449125289917,
0.15811310708522797,
0.6258126497268677,
0.039491258561611176,
-0.5802832245826721,
-0.08692347258329391,
0.24315997958183289,
0.35618048906326294,
0.5599980354309082,
-0.12367553263902664,
-0.764669895172119... |
def publish _ event ( event _ name, result, * * kwargs ) : event _ data = { " location " : str ( location ), " previous _ count " : previous _ count, " result " : result, " max _ count " : max _ count, } event _ data. update ( kwargs ) context = contexts. course _ context _ from _ course _ id ( location. course _ key )... | [
-0.0027234184090048075,
-0.02133752964437008,
0.570388913154602,
0.4601157307624817,
-0.001996090402826667,
0.056562382727861404,
0.16482116281986237,
0.3188437819480896,
-0.631784200668335,
0.5524146556854248,
-0.5914179682731628,
0.39738592505455017,
-0.6098506450653076,
-0.0010806729551... |
def get _ all ( self ) : db _ nics = dbapi. get _ nic _ list ( ) result = dict ( ) result ['nics'] = [ {'uuid': nic [ 0 ],'mac': nic [ 1 ] } for nic in db _ nics ] return result | [
-1.266640305519104,
0.4932960271835327,
0.19995570182800293,
-0.1517910659313202,
-0.08917946368455887,
-0.34789976477622986,
-0.9940857887268066,
0.21644705533981323,
-0.6242173910140991,
0.333209365606308,
-1.2052372694015503,
-0.8536184430122375,
-0.38554003834724426,
0.0582399368286132... |
def conventor _ xz ( event, indicator ) : if ( indicator ) : event, zlayers = modify _ for _ xz _ analysis _ 3 _ 4 ( event ) else : event, zlayers = modify _ for _ xz _ analysis _ 1 _ 2 ( event ) dictionary = { } for i in event. index : params = parametresxz ( event. wu [ i ], event. dist2wire [ i ], ( event. viewnb [ ... | [
0.27885061502456665,
-0.39263349771499634,
0.3251137137413025,
0.2035020887851715,
-0.9794260263442993,
-0.5225840210914612,
1.2029612064361572,
0.2067653238773346,
-0.09962204098701477,
1.2082242965698242,
-0.5081259608268738,
-0.4512473940849304,
-0.4073587656021118,
1.0785239934921265,
... |
def import _ enum ( target _ class, enum, fmt : str = none ) : fmt = fmt or " { name } " for key in enum. _ _ members _ _ : attr = fmt. format ( name = key, cls = enum. _ _ name _ _ ) if hasattr ( target _ class, attr ) : raise valueerror ( " overriding attribute " + attr + " of target class " + enum. _ _ name _ _ ) se... | [
-1.0178399085998535,
-1.1390913724899292,
0.8874356150627136,
-0.7748242020606995,
0.42281603813171387,
-0.10220714658498764,
-0.39616793394088745,
0.27288877964019775,
0.939460813999176,
0.8071711659431458,
0.17594359815120697,
0.2804771661758423,
0.4313744306564331,
0.12816819548606873,
... |
def all _ odd ( number ) : return all ( int ( n ) % 2 = = 1 for n in str ( number ) ) | [
-0.7517631649971008,
-0.01859882101416588,
0.49316269159317017,
0.09948046505451202,
-0.29973989725112915,
1.019284963607788,
-1.3163186311721802,
0.3398391604423523,
0.5139931440353394,
-0.4827962815761566,
-0.07686534523963928,
-0.2900862395763397,
0.2834094166755676,
0.4312639534473419,... |
def rotate ( phi ) : return np. array ( [ [ 1. 0, 0. 0 ], [ 0. 0, np. exp ( 1. 0j * phi ) ] ] ) | [
-0.822454571723938,
0.3005283772945404,
0.4606444835662842,
-0.8543290495872498,
0.5796983242034912,
-0.5014464855194092,
0.31292933225631714,
0.23732340335845947,
0.6741522550582886,
0.574923038482666,
-0.022621149197220802,
0.7846284508705139,
-1.9181584119796753,
0.5185909271240234,
0... |
def send _ command ( self, command, * * kwargs ) : if not command in _ command _ mapping _ : raise lib. errors. invalidcommanderror ( " command { } not supported ". format ( command ) ) if command = = lib. cmd _ src _ set : cmd _ str = _ command _ mapping _ [ command ]. format ( * * kwargs ) else : cmd _ str = _ comman... | [
-1.18433678150177,
-0.09700369834899902,
0.5518454313278198,
-0.09688708186149597,
-0.4338010847568512,
-0.012767523527145386,
-0.6799595952033997,
-0.7740121483802795,
0.7559587359428406,
-0.2171560376882553,
0.007930082269012928,
0.6443741321563721,
-0.5159028768539429,
0.981762468814849... |
def _ set _ checksum ( self, v, load = false ) : if hasattr ( v, " _ utype " ) : v = v. _ utype ( v ) try : t = yangdynclass ( v, base = restrictedclasstype ( base _ type = int, restriction _ dict = { " range " : [ " 0.. 65535 " ] }, int _ size = 16 ), is _ leaf = true, yang _ name = " checksum ", parent = self, path _... | [
-0.194736510515213,
0.3062608242034912,
0.4538933038711548,
-0.8358641862869263,
0.9319665431976318,
-0.4263010025024414,
0.6648898124694824,
-0.5289096236228943,
0.5483490824699402,
-0.7292930483818054,
-0.1175372302532196,
-0.7758370041847229,
0.3508225679397583,
0.24801208078861237,
0... |
def custom _ properties ( self, custom _ properties ) : self. _ custom _ properties = custom _ properties | [
0.9001054763793945,
-0.8305912017822266,
-0.3157026469707489,
-0.08920026570558548,
-0.2260691523551941,
-0.031148482114076614,
0.38620707392692566,
0.8625112771987915,
-0.24064578115940094,
-0.07728467136621475,
-0.7764455676078796,
-0.12611307203769684,
-0.16894641518592834,
-0.237159535... |
def delete _ layers ( layers ) : to _ delete = [ ] def recurse ( layers, parent = none ) : for name in layers : if not name : continue fullname = name if parent : fullname = parent + " : : " + name try : attr = layers [ name ] except typeerror : attr = { } if " layers " in attr : recurse ( attr [ " layers " ], fullname... | [
0.2725178003311157,
-0.36542120575904846,
0.6004276275634766,
0.45974811911582947,
0.029328787699341774,
-0.01640913635492325,
0.2333052009344101,
-0.8658803105354309,
0.9315585494041443,
0.026035534217953682,
0.3846808075904846,
-0.27690884470939636,
-0.1826610416173935,
2.155845165252685... |
def get ( self ) : pc _ list = createprocesschaintemplatelist ( ) return make _ response ( jsonify ( modulelist ( status = " success ", processes = pc _ list ) ), 200 ) | [
-0.8030850291252136,
-0.5696207284927368,
0.39498046040534973,
-0.16138538718223572,
0.8989799618721008,
0.05396278575062752,
-1.025868535041809,
-0.16332384943962097,
-0.07351004332304001,
0.3422456681728363,
-0.2272680252790451,
1.173407793045044,
-0.2153857946395874,
0.6053913235664368,... |
def normalize ( self, pc, cell _ size ) : bem = self. bem ( pc, cell _ size ) # rebin the cloud to the new cell size # todo make this into a standalone function ( in raster, grid? ), it is used in several other places # pc. grid ( cell _ size ) pc. data. _ update ( ) df = ( pd. dataframe ( bem. array ). stack ( ). rena... | [
0.11088701337575912,
0.2510002851486206,
0.6535623669624329,
0.5807387232780457,
0.4595031440258026,
0.5904625058174133,
0.5059892535209656,
0.6315902471542358,
-0.11899546533823013,
0.22124797105789185,
0.703090488910675,
0.18160730600357056,
-0.5132973790168762,
-0.41009512543678284,
0... |
def run ( server _ class = httpserver, handler _ class = handler ) : port = 8000 server _ address = ('', port ) httpd = server _ class ( server _ address, handler _ class ) try : print ('serving forever on port { }... '. format ( port ) ) httpd. serve _ forever ( ) except keyboardinterrupt : print ('ending session...') | [
-0.40872806310653687,
-0.4841524362564087,
0.5881925821304321,
0.280444860458374,
0.6554458141326904,
0.973431408405304,
-0.12137263268232346,
0.3832070827484131,
-0.5791974067687988,
-0.30116006731987,
-0.24990180134773254,
0.6480276584625244,
-0.09310057014226913,
0.176412433385849,
1.... |
def cgroup _ processes ( uid, job ) : procs = [ ] step _ g ='/ sys / fs / cgroup / memory / slurm / uid _ { } / job _ { } / step _ *'for step in glob. glob ( step _ g. format ( uid, job ) ) : cgroup ='/ sys / fs / cgroup / memory / slurm / uid _ { } / job _ { } / { } / task _ * '. format ( uid, job, step. split ('/') [... | [
0.29871705174446106,
-0.020261254161596298,
0.6623191237449646,
0.4024534821510315,
-0.8332763910293579,
0.20423421263694763,
0.30252835154533386,
0.44590696692466736,
-0.44403591752052307,
0.31458142399787903,
-0.27355027198791504,
0.24966610968112946,
-0.2990415692329407,
1.0931587219238... |
def login ( self ) : request = self. request response = request ['response'] login = request. get ('_ _ ac _ name ','' ) password = request. get ('_ _ ac _ password ','' ) submitted = request. get ('submitted ','' ) pas _ instance = self. _ getpas ( ) if pas _ instance is not none : try : pas _ instance. updatecredenti... | [
-0.7693482637405396,
-0.4611237943172455,
0.6804445385932922,
-0.18252982199192047,
-0.5038869380950928,
-0.09040424972772598,
0.3679984211921692,
0.021083228290081024,
0.23705130815505981,
-0.5163496136665344,
0.5384271740913391,
0.20518562197685242,
-0.28730472922325134,
-0.1775682419538... |
def add _ streams ( self, streams, ports = none ) : ports = ports if ports is not none else self. get _ acquired _ ports ( ) ports = self. _ validate _ port _ list ( ports ) if isinstance ( streams, stlprofile ) : streams = streams. get _ streams ( ) # transform single stream if not isinstance ( streams, list ) : strea... | [
0.07088105380535126,
0.11091763526201248,
0.7539567351341248,
0.3094137907028198,
0.38603752851486206,
0.14130455255508423,
0.2509820759296417,
-1.1887435913085938,
0.5311830639839172,
-0.10980232059955597,
-0.34519830346107483,
0.12023408710956573,
-1.1568632125854492,
0.9028528332710266,... |
def _ tracking _ metadata ( self ) : metadata = json. loads ( super ( densefeatures, self ). _ tracking _ metadata ) metadata ['_ is _ feature _ layer'] = true return json. dumps ( metadata, default = serialization. get _ json _ type ) | [
-1.2310600280761719,
0.46476104855537415,
0.45228952169418335,
0.19301901757717133,
0.6664503812789917,
-0.0797409787774086,
-0.36773279309272766,
-0.3797187805175781,
-0.4960991442203522,
0.9477776885032654,
-1.0269906520843506,
0.5137612223625183,
0.5326172113418579,
0.2638099789619446,
... |
def update ( self ) : self. surface. fill ( ( 0, 0, 0 ) ) # head self. surface. blit ( pygame. transform. rotate ( self. images [ " head " ], - 90 * self. directions [ 0 ] ), ( case _ size [ 0 ] * self. coords [ 0 ] [ 0 ], case _ size [ 1 ] * self. coords [ 0 ] [ 1 ] ) ) # body size _ x, size _ y = case _ size for i in... | [
-0.6811322569847107,
-0.20873144268989563,
0.9707609415054321,
-0.5705795884132385,
0.11122195422649384,
0.3005863428115845,
0.6252915263175964,
-0.8177412748336792,
0.2853360176086426,
0.14189009368419647,
0.2082069367170334,
0.11259662359952927,
0.03693278506398201,
-0.07334443926811218,... |
def findunitsize ( size ) : assert size > = 3, " it is not valid to use fft when size < 3 " f = size start = int ( math. ceil ( math. log ( f, 2 ) ) ) while true : total = 2 * * start unitsize = total + 1 - f if unitsize > = 2 : break start + = 1 return unitsize | [
-0.3016641438007355,
0.24731141328811646,
0.5979665517807007,
0.07613600045442581,
-0.7564694285392761,
-0.14617401361465454,
0.8256022334098816,
-0.6042525768280029,
0.12288699299097061,
-0.8796690702438354,
-0.3530045747756958,
-0.014604663476347923,
-0.4444778561592102,
0.51123881340026... |
def getmeta ( service ='obs ', params = none ) : baseurl ='http : / / mwa - metadata01. pawsey. org. au / metadata /'if params : data = urllib. urlencode ( params ) # turn the dictionary into a string with encoded'name = value'pairs else : data ='' # validate the service name if service. strip ( ). lower ( ) in ['obs '... | [
-1.2081918716430664,
0.5907900929450989,
0.821397066116333,
-0.5442002415657043,
-0.80022794008255,
-0.39825931191444397,
-1.0991671085357666,
-0.31514132022857666,
-0.4871557950973511,
0.6478375792503357,
0.24325649440288544,
1.1736541986465454,
-0.6460249423980713,
0.5536571741104126,
... |
def get _ oneview _ client ( session _ id = none, is _ service _ root = false ) : config = globals ( ) ['config'] auth _ mode = config [ " redfish " ] [ " authentication _ mode " ] if auth _ mode = = " conf " or is _ service _ root : # doing conf based authentication ov _ config = globals ( ) ['ov _ config'] ov _ clien... | [
-0.5283597707748413,
-0.9416260123252869,
0.8260425329208374,
0.2640458643436432,
-0.8571402430534363,
-0.3478020131587982,
0.5839697122573853,
-1.002135157585144,
1.397359013557434,
-0.5604925155639648,
0.8003674745559692,
0.7735928297042847,
-0.4675717353820801,
-0.2981066405773163,
0.... |
def get _ skins ( self, * ids ) : return self. _ request ( " skins ", ids = ', '. join ( str ( id ) for id in ids ) ) | [
-1.1096409559249878,
0.3194607198238373,
0.18149162828922272,
0.8387287855148315,
0.5759237408638,
-0.12994134426116943,
-1.0140430927276611,
-0.9572177529335022,
-0.007387821096926928,
-0.3903129994869232,
-0.06429179757833481,
1.294430136680603,
-0.658815324306488,
0.49765342473983765,
... |
def get _ int _ setting ( self, key : str ) - > int : key = key. split ( ". " ) return self. config [ key [ 0 ] ]. getint ( key [ 1 ] ) | [
-1.4166666269302368,
0.8772076964378357,
0.6507256031036377,
-0.3235023021697998,
-0.789763331413269,
-0.8995658755302429,
0.3994448184967041,
-1.0974563360214233,
-0.7481287121772766,
1.7028112411499023,
-0.21273817121982574,
-0.03762264549732208,
-0.8739050030708313,
-0.31317028403282166... |
def ipv6 _ cidr _ blocks ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input [ str ] ] ] ] : return pulumi. get ( self, " ipv6 _ cidr _ blocks " ) | [
0.5326045751571655,
-0.21647150814533234,
0.2326936572790146,
1.1445622444152832,
0.7489134669303894,
0.7079689502716064,
0.13004912436008453,
-0.3791987895965576,
0.9255492091178894,
0.8912039399147034,
-1.1726889610290527,
-0.11958545446395874,
-0.7280666828155518,
-1.3124566078186035,
... |
def count _ posts _ for _ hashtag ( self, hashtag ) : post = get _ post _ model ( ) hashtag _ posts _ query = make _ get _ hashtag _ posts _ for _ user _ with _ id _ query ( user _ id = self. pk, hashtag = hashtag ) return post. objects. filter ( hashtag _ posts _ query ). distinct ( ). cache ( ). count ( ) | [
0.5961049795150757,
0.2632141709327698,
0.27496248483657837,
0.690315842628479,
0.9391921758651733,
0.06832950562238693,
0.0012483467580750585,
0.5238488912582397,
-0.14196908473968506,
-0.7098784446716309,
-1.278721570968628,
-1.2353541851043701,
-0.2505035102367401,
0.7219442129135132,
... |
def add _ average ( self, obs _ value, obs _ std, errortype = " gaussian ", scale = 1. 0 ) : observable = averageo ( ) self. observables. append ( observable ) # add the necessary q functions. for i in range ( np. shape ( obs _ value ) [ 0 ] ) : self. num _ q _ functions + = 1 mean = obs _ value [ i ] std = obs _ std [... | [
-0.4554848372936249,
0.3168700039386749,
0.9894422888755798,
0.31424978375434875,
0.031901776790618896,
0.11966357380151749,
0.041987720876932144,
-0.6471147537231445,
0.11071132868528366,
-0.1433328092098236,
-0.22733692824840546,
1.0556226968765259,
0.35175183415412903,
0.549347877502441... |
def data _ winner ( self, p, game, winner ) : if winner = = p : self. _ games [ game. name ]. players [ p ]. add _ result ('win') self. _ players [ p ]. add _ result ('win') | [
-0.6141649484634399,
-0.16288024187088013,
0.4997996985912323,
0.40883681178092957,
0.41955968737602234,
0.08787576109170914,
-0.6937627196311951,
0.24318288266658783,
0.03822778910398483,
0.19385164976119995,
-0.8008815050125122,
0.6581293940544128,
0.08086967468261719,
-0.271817296743392... |
def _ eth _ addr ( v : union [ layerfieldscontainer, layerfield ] ) - > ethaddr : assert not isinstance ( v, layerfieldscontainer ) or len ( v. fields ) = = 1, v. fields return ethaddr ( v. get _ default _ value ( ) ) | [
-0.164722740650177,
0.48627251386642456,
0.2265024036169052,
-0.7936298251152039,
0.8313827514648438,
0.05774089694023132,
0.40489691495895386,
-0.7594078779220581,
0.519547164440155,
0.32245567440986633,
0.40815433859825134,
-0.01843634620308876,
-0.12705941498279572,
-0.05164672806859016... |
def create _ reader ( self, stream, start _ message _ id, local = false, reader _ listener = none, receiver _ queue _ size = 1000, reader _ name = none, subscription _ role _ prefix = none, ) : if self. persistent : flag = self. fabric. has _ persistent _ stream ( stream, local = local ) # else : # flag = self. fabric.... | [
0.5930524468421936,
-0.7740097045898438,
0.5709520578384399,
0.12627285718917847,
0.1537969708442688,
0.05945148691534996,
-0.3178994059562683,
-0.23640364408493042,
-0.0000715992646291852,
-0.628234326839447,
0.7317798733711243,
1.142785668373108,
-0.8125425577163696,
0.4540480077266693,
... |
def _ normalize ( params ) : return { k : _ weights _ config [ k ] [ " normalize " ] ( v ) for k, v in params. iteritems ( ) } | [
-0.5781631469726562,
-0.4844532907009125,
0.20076985657215118,
-0.09540843963623047,
-0.3706135153770447,
-0.8777232766151428,
-0.3546519875526428,
0.36190491914749146,
-0.6244776248931885,
1.1007715463638306,
-0.4178238809108734,
-0.6297131180763245,
-0.6272533535957336,
0.867241263389587... |
def to _ json ( self, filepath : str ) : with open ( filepath,'w') as file : json. dump ( self. to _ dict ( ), file, ensure _ ascii = false, indent = 4 ) | [
-0.9942129850387573,
-1.2869422435760498,
0.29390475153923035,
-1.1433162689208984,
0.4878382682800293,
0.3306039571762085,
0.5857925415039062,
-0.20611447095870972,
-0.41684508323669434,
0.6090518236160278,
-1.1937602758407593,
0.3347663879394531,
0.5948241353034973,
0.16190105676651,
-... |
def _ delete ( instance _ template _ revision, instance _ group _ manager, instance ) : # we don't check if there are any pending deletion calls because we don't # care. we just want the instance to be deleted, so we make repeated calls # until the instance is no longer detected. however, we do care how long # it takes... | [
-0.5990828275680542,
0.4948975741863251,
0.5442494750022888,
-0.7241547107696533,
-0.1703813672065735,
-0.44803914427757263,
-0.19109994173049927,
0.23801249265670776,
-0.6672376394271851,
0.7960754632949829,
0.08661070466041565,
0.5710104703903198,
-0.5299621224403381,
0.5135019421577454,... |
def _ h5 _ telstate _ unpack ( s ) : try : # since 2016 - 05 - 09 the hdf5 telescopestate contains encoded values return telstate _ decode ( s ) except katsdptelstate. decodeerror : try : # before 2016 - 05 - 09 the telstate values were str ( ) representations # this cannot be unpacked in general but works for numbers ... | [
-0.1561044156551361,
-0.5869361162185669,
0.3817974328994751,
-0.7013828158378601,
-1.3805816173553467,
-0.44495871663093567,
-0.5777864456176758,
0.21026459336280823,
0.7459353804588318,
-0.3772362172603607,
0.4179166853427887,
-0.40199014544487,
0.09883914142847061,
-0.741172730922699,
... |
def _ _ init _ _ ( self, port _ settings = none, * args, * * kwargs ) : # handles optional port settings if port _ settings is none : self. port _ settings = { } else : self. port _ settings = port _ settings # calls _ _ init _ _ from the abstractdevice class it inherets from abstractdevice. _ _ init _ _ ( self, * args... | [
0.29455840587615967,
0.6182547211647034,
0.49071091413497925,
0.3202964663505554,
0.3999875783920288,
0.4712631106376648,
0.12905821204185486,
-0.45583784580230713,
0.24162334203720093,
-0.056853219866752625,
0.5328176021575928,
0.028395185247063637,
0.11033866554498672,
1.0243066549301147... |
def repeat _ matrix _ in _ col ( g, n ) : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # import numpy as np r = np. empty ( ( n, g. shape [ 0 ], g. shape [ 1 ] ) ) r [ : ] = g return ( r. reshape ( n * g. shap... | [
-0.5942385792732239,
0.3756968379020691,
0.6445939540863037,
-0.4512516260147095,
-0.2678868770599365,
-0.20371964573860168,
0.5358198285102844,
-0.6304675340652466,
-1.0190114974975586,
1.2341705560684204,
-0.6819166541099548,
0.3300902247428894,
-0.4278610944747925,
-0.6033610105514526,
... |
def _ _ init _ _ ( self ) : self. stack = [ ] self. len = 0 | [
-0.027507402002811432,
0.5005267858505249,
0.2575337290763855,
0.09798023104667664,
0.6930009722709656,
-0.23522552847862244,
0.4381196200847626,
0.9256160259246826,
0.321308434009552,
-0.15445587038993835,
-1.8335102796554565,
-0.07941997796297073,
-0.5449709296226501,
1.2756909132003784,... |
def network _ count ( context ) : return impl. network _ count ( context ) | [
-0.6580758094787598,
0.6653825044631958,
0.2720004916191101,
-0.37336647510528564,
0.4930881857872009,
-0.04339649900794029,
0.6429197788238525,
-0.33452433347702026,
0.44562849402427673,
-0.7841249108314514,
-0.9755594730377197,
-0.4850497841835022,
1.1021162271499634,
0.05716453492641449... |
def delete _ article _ button ( self ) : btn = qpushbutton ( ) btn. seticon ( qicon ( os. path. normpath ( _ _ file _ _ +'/.. /.. / img / delete. png') ) ) press _ button ( self. app, btn ) btn. settooltip ('delete selected articles') btn. settooltipduration ( 1000 ) btn. pressed. connect ( self. on _ delete _ article ... | [
0.343403697013855,
0.024356437847018242,
0.36639124155044556,
-0.41007235646247864,
-0.008915039710700512,
0.06570117920637131,
0.39685577154159546,
0.2568287253379822,
0.44786202907562256,
0.6677138805389404,
-0.2948436141014099,
0.2929421663284302,
0.1265656054019928,
-0.3078045547008514... |
def to _ schema ( self ) : schema = super ( ). to _ schema ( ) schema. update ( self. inner. to _ list _ schema ( * self. args, * * self. kwargs ) ) return schema | [
-1.2272485494613647,
-0.08288485556840897,
0.408487468957901,
-0.3887573778629303,
0.6745495200157166,
-0.7305926084518433,
-1.1054613590240479,
0.9794125556945801,
0.5409930348396301,
0.09183330088853836,
-0.8086647391319275,
0.06075906381011009,
-0.03005734272301197,
-0.23534683883190155... |
async def coinflip ( self, ctx, * args ) : response ='' random. seed ( datetime. datetime. now ( ) ) coin = random. randint ( 0, 1 ) if coin = = 0 : response ='heads'else : response ='tails'return await ctx. reply ( response ) | [
-1.4481593370437622,
0.47502392530441284,
0.7466557025909424,
-0.4505935311317444,
0.5404697060585022,
0.3764168620109558,
-0.2573535442352295,
-0.37361621856689453,
-0.19846387207508087,
-0.11766594648361206,
0.0043502021580934525,
0.9255132079124451,
-1.1002259254455566,
-0.2181285619735... |
def get _ latest _ checkpoint ( saved _ model _ dir ) - > list [ str ] : iters = [ int ( x. split ( " - " ) [ - 1 ] ) for x in os. listdir ( saved _ model _ dir ) if " checkpoint " in x ] iters. sort ( ) latest _ checkpoint _ dir = os. path. join ( saved _ model _ dir, f " checkpoint - { iters [ - 1 ] } " ) return late... | [
-0.8110812306404114,
-0.22190135717391968,
0.8417656421661377,
0.9894775748252869,
0.7177072167396545,
0.17311765253543854,
1.0978219509124756,
0.16959993541240692,
-0.18979693949222565,
0.6406304240226746,
-0.11366299539804459,
-0.3071663975715637,
0.5645852088928223,
-0.00196378072723746... |
def test _ tc _ assetca _ 001 _ newassetcainadmin _ mat ( self ) : # access administration self. dashboard. accessadmin ( ) admin = setuppage ( self. uidriver ) msgcreated = " the condition assessment created successfully. " # create asset condition assessment createadmindata ( self, admin, admin. assets, admin. condit... | [
0.3469308912754059,
-0.8256239891052246,
0.6715282201766968,
-0.8558307886123657,
-0.18329912424087524,
0.7375149726867676,
0.9594359993934631,
-1.023237705230713,
0.03425607830286026,
0.08552506566047668,
0.41285619139671326,
0.10988851636648178,
0.5301036834716797,
0.45097872614860535,
... |
def index ( ) : # initialize db connection con = engine. connect ( ) md _ list = pd. read _ sql ( db _ query. sql _ providers _ in _ zip ( zip _ code ='22903'), con ). head ( ) return render _ template ( " index. html ", md _ list = md _ list ) | [
-0.7168543338775635,
1.2586195468902588,
0.24032557010650635,
-0.34610629081726074,
0.5094404816627502,
-0.46143433451652527,
0.004048411268740892,
1.045472264289856,
0.1876741349697113,
0.7134745121002197,
0.9361684322357178,
0.32817342877388,
-0.2931090295314789,
-0.4947720766067505,
-... |
def search ( self, query ) : post = webhose. search ( query ) # print post return post | [
0.3386940360069275,
0.20521943271160126,
0.4169873893260956,
0.7261526584625244,
-0.2694421410560608,
-0.03573191165924072,
-0.9300409555435181,
-0.6167945265769958,
-0.5332655310630798,
-1.2766087055206299,
0.06230347231030464,
0.0695989578962326,
-1.6003248691558838,
0.22458694875240326,... |
def on _ select _ asic ( self ) : if self. debug : print ('[ epixesamainwindow ] : on select asic') try : s = str ( self. combo _ select _ asic. currenttext ( ) ) if s = ='all': self. select _ asic = - 1 else : c = int ( s ) self. select _ asic = c # should send this to the reader to avoid reading all of the data self.... | [
0.197337806224823,
-0.8841493725776672,
0.36318710446357727,
0.2694568336009979,
-0.7350491285324097,
-0.07321462780237198,
0.40086129307746887,
0.05527248978614807,
0.2081509679555893,
0.8309845924377441,
0.08013509958982468,
0.5839784145355225,
0.3395402133464813,
0.1004675030708313,
0... |
def validate _ email ( email : str ) - > bool : _, address = parseaddr ( email ) return address. endswith ( " @ oracle. com " ) | [
0.3766478896141052,
1.242051601409912,
0.5359346866607666,
-0.19481609761714935,
-0.1268669068813324,
0.6491377949714661,
-0.27239829301834106,
0.15632663667201996,
0.6233816146850586,
0.9931840896606445,
0.2371070384979248,
0.2731151878833771,
-0.613471508026123,
-0.5792259573936462,
0.... |
def getpositioninformation ( position _ path ) : if not os. path. isfile ( position _ path ) : print ( " path % s is not available ", position _ path ) sys. exit ( 0 ) reader = csv. dictreader ( open ( position _ path ), delimiter = " ", skipinitialspace = true ) pos _ info = { } for row in reader : for c, v in row. it... | [
-0.31936171650886536,
-0.1780802309513092,
0.5586914420127869,
-0.36379942297935486,
-0.5203178524971008,
0.1758010983467102,
1.0948487520217896,
0.46608099341392517,
-0.040837936103343964,
0.3883849084377289,
-0.6845201253890991,
-1.835791826248169,
0.4005320370197296,
0.41489237546920776... |
def _ get _ data _ for _ interp _ with _ split ( ) : primary _ id _ strings = ['foo'] * 5 secondary _ id _ strings = ['a ','a ','a ','b ','c'] valid _ times _ unix _ sec = numpy. array ( [ 5, 10, 15, 20, 20 ], dtype = int ) centroid _ x _ coords = numpy. array ( [ 2, 7, 12, 17, 17 ], dtype = float ) centroid _ y _ coor... | [
0.12894326448440552,
-0.23746371269226074,
0.8759477734565735,
-0.9334297776222229,
-0.12938585877418518,
0.009365210309624672,
0.43027618527412415,
-0.6284809708595276,
0.14296136796474457,
0.3654375672340393,
-0.9993426203727722,
0.21302089095115662,
0.01128237135708332,
-1.1069922447204... |
def test _ get _ user _ projects _ needs ( self ) : self. assertsetequal ( set ( self. user1. get _ user _ projects _ needs ( ) ), { self. skill2 } ) | [
-0.20639920234680176,
-0.09439703822135925,
0.3489772379398346,
0.8309049606323242,
0.17914295196533203,
1.7263805866241455,
0.19809646904468536,
-1.3989673852920532,
-0.362770676612854,
-0.4988269507884979,
-0.5236249566078186,
0.35396257042884827,
0.014073465019464493,
-0.385074794292449... |
def _ _ clone _ _ ( self ) : # make a new object. return deepcopy ( self ) | [
0.24937227368354797,
-1.0303221940994263,
0.6877638101577759,
0.6031013131141663,
-1.0721688270568848,
0.6829082369804382,
0.10925822705030441,
-0.9266626238822937,
0.3107093870639801,
-0.9658162593841553,
-0.34364038705825806,
0.5154547095298767,
0.1895410567522049,
-1.8259519338607788,
... |
def heatmap ( datax, datay, resolutionx = 200, resolutiony = 200, logscale = false, extent = false ) : datax = np. array ( datax ) datay = np. array ( datay ) if extent : minx = extent [ 0 ] maxx = extent [ 1 ] miny = extent [ 2 ] maxy = extent [ 3 ] goodx = datax. copy ( ) goody = datay. copy ( ) goodx [ np. nonzero (... | [
0.3210813105106354,
-0.2331736981868744,
1.1729791164398193,
-0.867638349533081,
-0.24882815778255463,
-0.22900433838367462,
-1.3384370803833008,
-0.21630635857582092,
-0.10659652203321457,
0.1578103005886078,
0.04183090478181839,
0.552290678024292,
0.3942619264125824,
0.11502217501401901,... |
def _ findbase ( self ) : tops = self. _ findtops ( ) for top in tops : top _ node = self. g. node [ top ] if top _ node ['op _ type'] in ['baseselection ','nodeattachment'] : return top return none | [
-0.7419202327728271,
-0.5353246927261353,
0.6843739151954651,
0.22381334006786346,
-0.24394112825393677,
-0.33600369095802307,
1.226141333580017,
-1.4280511140823364,
-0.06553376466035843,
0.3535889685153961,
0.9817743301391602,
0.13766053318977356,
-0.5702980756759644,
-0.0790543332695961... |
def apply _ function _ on _ filtered _ inputs ( inputs, indices, check _ same _ num _ examples = false, offset = 0 ) : nonlocal update _ data fn _ args = [ inputs ] if input _ columns is none else [ inputs [ col ] for col in input _ columns ] if offset = = 0 : effective _ indices = indices else : effective _ indices = ... | [
-0.6609896421432495,
-0.019395051524043083,
0.8288318514823914,
0.13450273871421814,
-0.5435502529144287,
-0.2853202521800995,
0.028331756591796875,
0.0965806320309639,
0.38115131855010986,
0.2807387709617615,
0.33462440967559814,
0.3147272765636444,
0.07715460658073425,
-0.513053059577941... |
def from _ dlpack ( dlcapsule ) : context. context ( ). ensure _ initialized ( ) return pywrap _ tfe. tfe _ fromdlpackcapsule ( dlcapsule, context. context ( ). _ handle ) # pylint : disable = protected - access | [
-0.6177444458007812,
0.2558631896972656,
0.2818688750267029,
-0.3834027647972107,
-0.308589905500412,
-0.3944393992424011,
-0.18529215455055237,
-0.6550900340080261,
1.120225191116333,
-0.7914685606956482,
-0.4884622097015381,
-0.38465574383735657,
0.49158400297164917,
-0.18929563462734222... |
def makeguestbookentry ( self, author, message _ str ) : message = dict ( ) author = self. html _ escape ( author ) message _ str = self. html _ escape ( message _ str ) entry = guestbook ( ) entry. author = author entry. message = message _ str entry. recorded _ date = self. now ( ) entry. save ( force _ insert = true... | [
-0.80070561170578,
0.04806338623166084,
0.5313326120376587,
0.7805172204971313,
-0.1394885629415512,
0.8480821251869202,
0.3421942889690399,
-0.33155858516693115,
-1.0376447439193726,
0.2029513269662857,
-1.0330042839050293,
0.2930152118206024,
-0.9064528346061707,
0.22818070650100708,
0... |
def amount _ money ( self ) : return self. _ amount _ money | [
0.5963658690452576,
-0.6983733773231506,
0.33547648787498474,
0.24280332028865814,
0.23088477551937103,
0.8135970234870911,
0.028552556410431862,
-0.11109104007482529,
0.7816487550735474,
0.14623042941093445,
0.4418806731700897,
0.14131717383861542,
0.8257102966308594,
0.5728901028633118,
... |
def _ _ str _ _ ( self ) : return self. class _ name | [
-0.6470503807067871,
-1.8793962001800537,
0.5521256923675537,
-0.8874534964561462,
-0.2829902768135071,
0.6869871020317078,
-0.3958308696746826,
-0.2270406186580658,
0.5276686549186707,
0.17976973950862885,
0.363629549741745,
0.5910919308662415,
0.7596688270568848,
-0.25022920966148376,
... |
def test _ user _ cannot _ register _ with _ empty _ spaces ( self ) : res = self. client ( ). post ( self. full _ url ('auth / signup'), data = json. dumps ( self. data [ " spaces " ] ), content _ type ='application / json') self. assertequal ( res. status _ code, 400 ) | [
-0.26009929180145264,
1.624334692955017,
0.4458693563938141,
0.26970431208610535,
0.13999530673027039,
1.1028110980987549,
-0.8885241746902466,
-0.38177525997161865,
0.280371755361557,
-0.2966095805168152,
-0.9634073376655579,
0.528819739818573,
-0.2459070235490799,
1.407021403312683,
0.... |
async def api ( host : str = settingsoption ( prefect _ server _ api _ host ), port : int = settingsoption ( prefect _ server _ api _ port ), log _ level : str = " debug ", services : bool = true, ) : import watchfiles server _ env = os. environ. copy ( ) server _ env [ " prefect _ api _ services _ run _ in _ app " ] =... | [
-0.0382314957678318,
0.015648258849978447,
0.7710261344909668,
0.11739419400691986,
0.81462162733078,
0.11483366787433624,
0.1539888232946396,
-0.7184266448020935,
-0.5489335656166077,
0.8505352139472961,
-0.07926300168037415,
1.1522278785705566,
0.11930467188358307,
0.009160120971500874,
... |
def insert _ text ( self, data, overwrite = false, move _ cursor = true, fire _ event = true ) : # original text & cursor position. otext = self. text ocpos = self. cursor _ position # in insert / text mode. if overwrite : # don't overwrite the newline itself. just before the line ending, # it should act like insert mo... | [
-0.04009627178311348,
0.13700534403324127,
0.47766435146331787,
-0.15876677632331848,
-0.19039922952651978,
-0.13508270680904388,
-0.357362300157547,
0.31032073497772217,
-0.23410989344120026,
0.14584827423095703,
-0.7959173917770386,
-0.3520953059196472,
-0.5394301414489746,
0.22900277376... |
def smallest _ containing _ box ( boxes : tensor ) - > tensor : z = boxes [ :, :, 0 ] z = boxes [ :, :, 1 ] min _ z, _ = torch. min ( z, dim = 1, keepdim = true ) max _ z, _ = torch. max ( z, dim = 1, keepdim = true ) return torch. stack ( ( min _ z, max _ z ), dim = 2 ) | [
0.12402710318565369,
-0.5523667335510254,
0.6375206112861633,
0.5289397835731506,
-0.6540435552597046,
-0.8016228675842285,
0.4481034278869629,
-0.9023194313049316,
-0.4584493637084961,
-0.20511196553707123,
-0.838402271270752,
-0.18109023571014404,
0.13989590108394623,
-0.856436550617218,... |
def mask _ mse _ loss ( preds, labels, mask ) : mask = tf. cast ( mask, dtype = tf. float32 ) mask / = tf. reduce _ mean ( mask ) labels * = mask preds * = mask # loss = tf. losses. mean _ squared _ error ( labels = labels, predictions = preds, weights = mask ) # loss = tf. losses. mean _ squared _ error ( labels = lab... | [
-0.8436281085014343,
-1.1360554695129395,
0.4523785412311554,
0.20661868155002594,
-0.4759393334388733,
0.05889694392681122,
0.12951211631298065,
-0.3650250732898712,
-0.3655608892440796,
0.3790298104286194,
0.34154272079467773,
0.4886762499809265,
0.40761950612068176,
-0.09338901191949844... |
def get ( self ) : if self. items _ in _ queue < 0. 1 * self. queue. maxsize : # if queue is almost empty, halt the main thread a bit self. wait _ n ( n = 3 ) # get the image from the queue image = self. queue. get ( ) # check if too high new _ prob if self. _ last : diff = self. items _ in _ queue - self. _ last if di... | [
-0.4548650085926056,
-0.5126804113388062,
0.9429288506507874,
-0.40110278129577637,
-0.6118529438972473,
-0.20269498229026794,
-0.33728334307670593,
-0.7812625765800476,
-0.4676213562488556,
0.40771347284317017,
0.855439305305481,
0.37809088826179504,
-0.011410361155867577,
0.6426978707313... |
def grid _ likelihood ( data, options, grid ) : # initialize posterior likelihood = np. zeros ( shape = grid ['a']. shape ) # compute likelihood for i in range ( 0, len ( data [ :, 0 ] ) ) : y = _ psyfunction ( data [ i, 0 ], grid ['a'], grid ['b'], grid ['g'], grid ['l'], options ['sigmoid _ type'] ) *. 99 + 0. 005 li... | [
0.3168184161186218,
0.033755265176296234,
0.5838910341262817,
-0.4957506060600281,
0.5681840181350708,
-0.6423447728157043,
-0.28996628522872925,
-0.39375096559524536,
-0.297894686460495,
0.34109511971473694,
0.5217629671096802,
0.3119400441646576,
-0.9284199476242065,
0.1333611011505127,
... |
def make _ batch _ align _ matrix ( index _ tensor, size = none, normalize = false ) : n _ fill, device = index _ tensor. size ( 0 ), index _ tensor. device value _ tensor = torch. ones ( [ n _ fill ], dtype = torch. float ) dense _ tensor = torch. sparse _ coo _ tensor ( index _ tensor. t ( ), value _ tensor, size = s... | [
0.3062933087348938,
0.15482594072818756,
0.5641293525695801,
0.8121814131736755,
0.30770620703697205,
-0.20324718952178955,
1.2585456371307373,
0.33008381724357605,
0.40586039423942566,
-0.08773390203714371,
0.33399757742881775,
-0.4102000594139099,
0.03653893992304802,
-0.9594821929931641... |
def parse _ line ( self, line ) : raise runtimeerror, " implement me! " | [
-0.385110080242157,
-0.13335344195365906,
0.2699958384037018,
0.8020164966583252,
0.8512862920761108,
-0.15085206925868988,
-0.09215709567070007,
-0.127846360206604,
0.19894175231456757,
-1.3636863231658936,
-0.8703229427337646,
-0.45724430680274963,
-0.49119099974632263,
0.429615527391433... |
def get _ projection _ matrices ( weight _ matrix, threshold ) : u, s, vh = np. linalg. svd ( weight _ matrix, full _ matrices = true ) rank = get _ projection _ rank ( s, threshold ) ut = u [ :, : rank ] st = np. diag ( s [ : rank ] ) vht = vh [ : rank, : ] projection _ matrix = ut @ st back _ projection _ matrix = vh... | [
0.2842065691947937,
-0.2238505333662033,
0.5713750123977661,
0.9255149960517883,
0.005924579221755266,
-0.30666670203208923,
-0.04075796157121658,
1.0093060731887817,
0.33113569021224976,
1.6449354887008667,
0.4804164469242096,
0.5012917518615723,
-0.4171774089336395,
-0.1468668282032013,
... |
def unflow ( self, source _ node, source _ output, target _ node, target _ input ) : source = source _ node if source _ node = ='worldadapter'else source _ node. uid target = target _ node if target _ node = ='worldadapter'else target _ node. uid return self. _ nodenet. unflow ( source, source _ output, target, target ... | [
-0.5063576698303223,
-0.2731533348560333,
0.44119372963905334,
-0.9334626793861389,
-0.3726635277271271,
0.22461669147014618,
0.48413997888565063,
0.38850346207618713,
0.1924963891506195,
-0.3687577247619629,
0.724678635597229,
0.8897076845169067,
0.03741007298231125,
-0.34073492884635925,... |
def show _ all _ shortcuts ( ) : for actions in self. actions : actions. show _ shortcuts ( ) | [
1.1243644952774048,
-0.26592978835105896,
0.43407708406448364,
1.1491316556930542,
0.06393909454345703,
-0.6026410460472107,
1.061767578125,
0.6255626082420349,
0.6020257472991943,
0.317107230424881,
0.2408849149942398,
1.1545919179916382,
0.9539116024971008,
1.4151995182037354,
-0.23682... |
def test _ multiple _ do _ nothing ( self ) : band = self. band new _ popularity = self. band. popularity + 1000 # conflicting with id - should be ignored. band. insert ( band ( id = self. band. id, name = " pythonistas ", popularity = new _ popularity, ) ). on _ conflict ( action = " do nothing ", target = band. id ).... | [
-1.0375075340270996,
0.5865103602409363,
0.6345996260643005,
0.6515613198280334,
1.7099705934524536,
0.8918107748031616,
-0.5924524664878845,
-0.7387155294418335,
0.5726991891860962,
-0.19983801245689392,
-1.4897968769073486,
0.05301929637789726,
-0.4049851596355438,
-0.199209526181221,
... |
def edit _ media _ list _ table ( request ) : if not request. user. is _ superuser : return redirect ('% s? next = % s'% ( reverse ('dc _ parse : admin _ auth'), request. path ) ) media _ list _ all = media. objects. all ( ). order _ by ('pk') paginator = paginator ( media _ list _ all, 25 ) page = request. get. get ('... | [
-0.7982252836227417,
-0.4073745310306549,
0.7847037315368652,
0.06274327635765076,
0.5024648308753967,
-0.5015077590942383,
0.7730486989021301,
-0.04495066776871681,
0.2857925593852997,
0.7294309139251709,
-0.4344251751899719,
-0.19543175399303436,
0.9739958643913269,
1.7823225259780884,
... |
def _ isnewestmember ( member, members, releases ) : build _ list = member. getuniquereleases ( releases ) release = build _ list [ 0 ] # pick the oldest release. same _ name _ siblings = filter ( lambda n : str ( n ) = = str ( member ) and n! = member, members ) for s in same _ name _ siblings : sibling _ build _ list... | [
-0.0037156189791858196,
-0.44814035296440125,
0.7347844243049622,
0.35717618465423584,
0.054909296333789825,
0.025176184251904488,
-0.568788468837738,
-0.8070944547653198,
-0.4326634109020233,
0.6688764691352844,
-0.5457525849342346,
0.6137298345565796,
-0.7858676314353943,
0.2736286818981... |
def start _ history _ lines _ completion ( self ) : found _ completions = set ( ) completions = [ ] # for every line of the whole history, find matches with the current line. current _ line = self. document. current _ line _ before _ cursor. lstrip ( ) for i, string in enumerate ( self. _ working _ lines ) : for j, l i... | [
0.04451186954975128,
-0.7107363343238831,
0.4566704034805298,
0.21782837808132172,
0.6415104269981384,
-0.4066917896270752,
0.3774946331977844,
-0.05740765854716301,
-0.3630176782608032,
0.13448065519332886,
0.28112557530403137,
0.20934121310710907,
0.8852309584617615,
0.863666832447052,
... |
def instance _ num ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " instance _ num " ) | [
-0.12301713973283768,
0.15788722038269043,
0.5167932510375977,
0.026013122871518135,
0.6819825768470764,
1.270568609237671,
1.1791964769363403,
1.0154486894607544,
0.3569607734680176,
-0.44115182757377625,
-0.4278891980648041,
1.0225499868392944,
-0.03976656123995781,
-1.3508801460266113,
... |
def previous _ rung _ waits ( self ) : for rung in range ( self. current _ rung ) : if self. _ is _ rung _ waiting ( rung ) and not self. _ is _ rung _ pending ( rung ) : return true return false | [
-0.9659844040870667,
0.32651275396347046,
0.5204924941062927,
-0.15899622440338135,
-0.2557951509952545,
0.23778431117534637,
0.47338104248046875,
0.4392482340335846,
-0.9957600831985474,
-0.09466557949781418,
0.02400430664420128,
-0.012073935009539127,
-1.0289806127548218,
1.5578815937042... |
def get _ topo _ batch _ axis ( self ) : axis = self. axes. index ('b') return axis | [
-0.07885952293872833,
-0.4020647704601288,
0.34164804220199585,
0.9790646433830261,
0.23545292019844055,
1.4435020685195923,
1.06635582447052,
-0.1080659031867981,
-1.1917961835861206,
-0.3376661241054535,
0.11259379237890244,
0.9634615778923035,
-0.3646661043167114,
-1.11589515209198,
0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.