text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def handle _ query _ message ( self, message : messages. querystatusmessage ) : response = messages. queryresponsemessage ( self. owner, self. ownership _ level, self. destruction _ level ) self. reply _ to _ message ( message, response ) | [
0.014258050359785557,
0.09787948429584503,
0.42701005935668945,
-0.4331650733947754,
0.596168041229248,
-0.4047124981880188,
-0.15070275962352753,
-0.950705349445343,
1.2083570957183838,
-0.6600341200828552,
0.8447678089141846,
0.06641079485416412,
-1.3896046876907349,
-0.5514378547668457,... |
def get _ stores _ by _ product ( self, product ) : stores = self. db. query ( product. select _ sql _ query _ stores ) stores _ list = [ ] for store in stores : stores _ list. append ( store [ " store _ name " ] ) return stores _ list | [
-0.6162481904029846,
0.1477547287940979,
0.26599571108818054,
1.572324514389038,
0.170576810836792,
0.6242445707321167,
-0.1787589192390442,
-0.1446584165096283,
1.061296820640564,
0.9615917801856995,
-0.5047146677970886,
-0.6718037128448486,
-0.4249144494533539,
0.021765833720564842,
-0... |
def get _ best _ path ( digraph, start, end, path, max _ dist _ outdoors, best _ dist, best _ path ) : if start = = end : # check to see if end of the current path trail return path # if at the end of the path, return what you got as a path startnode = node ( start ) endnode = node ( end ) currshortestpath = [ ] if not... | [
0.2986460328102112,
-0.1637384593486786,
0.8376958966255188,
0.465231329202652,
-0.4303074777126312,
0.1081223338842392,
0.17106013000011444,
0.42926907539367676,
-0.2097162902355194,
0.4883756935596466,
0.2834019660949707,
0.760708749294281,
0.38439077138900757,
-0.5358547568321228,
-0.... |
def _ scan ( buffr ) : n = 0 ln = len ( buffr ) while n < ln : if not ellychar. isletter ( buffr [ n ] ) : break n + = 1 return n | [
-0.8591145873069763,
0.3423616886138916,
0.6143800616264343,
0.1809995174407959,
-0.8464922904968262,
-0.6643151044845581,
0.41809970140457153,
0.26714327931404114,
0.19467543065547943,
-0.9186892509460449,
-0.8229159712791443,
-0.09326279908418655,
-1.4982218742370605,
0.5768625736236572,... |
def create _ inner _ fold ( self, nber _ splits, test _ fold ) : self. test _ folds = self. f [ self. f = = test _ fold ]. index for _ train = self. f [ self. f! = test _ fold ]. index skf = stratifiedkfold ( n _ splits = nber _ splits, shuffle = true ) stratefied _ variable = self. sv [ self. f! = test _ fold ] obj = ... | [
-0.5780181288719177,
0.2511330544948578,
0.40315836668014526,
0.17628933489322662,
-0.38160470128059387,
-0.1483142077922821,
0.3969825208187103,
-0.2463303953409195,
-0.13801085948944092,
-0.7121585011482239,
0.04668362811207771,
0.5900135636329651,
-0.3135737180709839,
-0.866012096405029... |
def select _ dataset ( self, dataset _ tag ) : stdout _ redirect ( self. _ model _ evaluator. select _ dataset, dataset _ tag ) self. _ data _ loader = acdataloader ( self. _ model _ evaluator. dataset ) | [
0.08694403618574142,
0.01147961150854826,
-0.11983495950698853,
-1.3399407863616943,
-0.13185249269008636,
-0.3645889461040497,
0.13227353990077972,
-0.7939425706863403,
-0.06621088832616806,
-0.966171145439148,
0.34515872597694397,
1.2571156024932861,
1.085889458656311,
0.3706831037998199... |
def display _ hosting ( ) : with db _ session ( ) as db : dates = db. query ( models. event, sqlalchemy. func. generate _ series ( models. event. start _ date, models. event. end _ date, sqlalchemy. text ( "'1 day': : interval " ) ). cast ( sqlalchemy. date ). label ('event _ date') ) \. subquery ( ) events = db. query... | [
0.613212525844574,
0.025845810770988464,
0.9040437936782837,
0.45069804787635803,
-0.7089363932609558,
0.3619914948940277,
-0.07070795446634293,
0.5362098813056946,
-1.3923561573028564,
0.48418232798576355,
0.8951860070228577,
-0.10391334444284439,
0.038294196128845215,
0.02340205945074558... |
def labels _ to _ flows2 ( labels ) : nimg = len ( labels ) # if labels [ 0 ]. ndim < 3 : # labels = [ labels [ n ] [ np. newaxis, :, : ] for n in range ( nimg ) ] if labels [ 0 ]. shape [ 0 ] = = 1 or labels [ 0 ]. ndim < 3 : print ('note : computing flows for labels ( could be done before to save time )') # compute f... | [
-0.6900380849838257,
-0.9743340611457825,
0.9792879819869995,
0.810054361820221,
0.5179935693740845,
0.17834100127220154,
0.5737665295600891,
-0.16265647113323212,
0.5815759897232056,
0.9818287491798401,
0.5534688830375671,
0.011215047910809517,
0.4477238059043884,
0.3783489763736725,
0.... |
def wolf _ retreat ( farmer, wolf, wolf _ pack ) : if wolf. rect. centerx < wolf. cb _ settings. screen _ width / 2 : # retreat left wolf. image = pygame. image. load ('images / wolf / left _ wolf. png') wolf. rect. centerx - = 1 elif wolf. rect. centerx > wolf. cb _ settings. screen _ width / 2 : # retreat right wolf.... | [
-1.1287022829055786,
-0.3986838161945343,
0.9930155873298645,
-0.2044304460287094,
-0.08870149403810501,
-0.2867963910102844,
-0.3299829363822937,
-0.30561569333076477,
0.42273303866386414,
0.5819737315177917,
-0.17688724398612976,
-1.0656293630599976,
-1.023730754852295,
0.819624841213226... |
def quiet _ logs ( sc ) : logger = sc. _ jvm. org. apache. log4j logger. logmanager. getlogger ( " org " ). setlevel ( logger. level. error ) logger. logmanager. getlogger ( " akka " ). setlevel ( logger. level. error ) | [
0.25641828775405884,
-0.23699459433555603,
0.5415457487106323,
-0.37279200553894043,
-0.11163407564163208,
-0.2359946221113205,
0.03933730721473694,
-0.8158048391342163,
0.0732831060886383,
0.15237703919410706,
-0.14526286721229553,
1.2104542255401611,
0.016303373500704765,
0.4897777140140... |
def _ findbyid ( self, node, name ) : if node. attributes. get ('id') = = name : return node for child in node. children : result = self. _ findbyid ( child, name ) if result : return result | [
0.3509167730808258,
-0.07108849287033081,
0.45770639181137085,
-0.15087361633777618,
-0.4074775278568268,
-0.7372660040855408,
-0.1685532182455063,
-1.0366568565368652,
-0.441801518201828,
0.8737465739250183,
0.07300741970539093,
-0.4950970709323883,
-0.535156786441803,
0.5087011456489563,... |
def volume _ get _ active _ by _ window ( context, begin, end = none, project _ id = none ) : return impl. volume _ get _ active _ by _ window ( context, begin, end, project _ id ) | [
0.0594414621591568,
-1.5702199935913086,
0.6376006603240967,
0.769551694393158,
-0.08096757531166077,
-0.7000972032546997,
0.7238540053367615,
-0.6486857533454895,
-0.6243336200714111,
0.018792279064655304,
0.9206146001815796,
1.7411870956420898,
-0.9510829448699951,
-0.7115718126296997,
... |
def config ( ) : odooenv _ ( ). _ config ( ) | [
-0.842911958694458,
0.53122878074646,
0.23814155161380768,
-0.031274523586034775,
0.9230060577392578,
-0.643142819404602,
0.5994520783424377,
0.040590692311525345,
-0.5801445841789246,
0.3146192729473114,
-0.40013304352760315,
0.5718683004379272,
1.1878533363342285,
1.1061832904815674,
0... |
def vi2fpar _ lineal ( self, vi, coeficientes ) : # # calibration and value filtering fpar = ( getattr ( self, vi ) * coeficientes [ 0 ] ) + coeficientes [ 1 ] filtered _ fpar = fpar. apply ( lambda x : x if x > 0 else 0 ). apply ( lambda x : x if x < 1 else 1 ) # # store attribute back into self setattr ( self, " fpar... | [
-0.5180209875106812,
-1.133259892463684,
0.6208416223526001,
-0.48108357191085815,
-0.8023736476898193,
0.3680373430252075,
-0.2662763297557831,
-0.7198325395584106,
0.23571550846099854,
0.18080344796180725,
-0.7061353921890259,
-0.07621275633573532,
-0.10154041647911072,
-0.52844291925430... |
def _ hg _ event _ callback ( self, device, caller, attribute, value ) : has _ changed = false # is data needed for this instance? if f " { attribute } : { device. partition (':') [ 2 ] } " in self. _ channel _ map : self. _ data [ attribute ] = value has _ changed = true # availability has changed if self. available! ... | [
-0.2900778353214264,
-0.31528398394584656,
0.7214285135269165,
-0.17121033370494843,
-0.2664584517478943,
0.5054485201835632,
-0.06931276619434357,
0.1774367094039917,
0.17820100486278534,
0.29076412320137024,
0.022156894207000732,
-0.1288662552833557,
0.6974171996116638,
0.535148441791534... |
def get _ topstats ( self ) : if self. scorer : html = requests. get ( self. pre _ link + self. league _ name + self. post _ link + " scorers " ) elif self. assist : html = requests. get ( self. pre _ link + self. league _ name + self. post _ link + " assists " ) # log ( " used cache : { 0 } ". format ( html. from _ ca... | [
-1.2832995653152466,
0.5591215491294861,
0.7550995945930481,
-0.9312195181846619,
-0.4105094373226166,
-0.4470677673816681,
-0.3235397934913635,
-0.8837209343910217,
0.023150593042373657,
0.3622189164161682,
-0.46285879611968994,
-0.510993480682373,
0.3138027787208557,
0.28720805048942566,... |
def cmd ( self, value ) : self. _ modify _ instruction ('cmd ', value ) | [
-0.7732866406440735,
-0.30172330141067505,
0.39650535583496094,
0.16110455989837646,
-0.011601453647017479,
0.99088454246521,
1.2958964109420776,
-0.30424267053604126,
0.8332231044769287,
-0.6388009786605835,
0.5968337059020996,
0.14380519092082977,
0.33927232027053833,
1.2112118005752563,... |
def chunks ( l, n ) : n = max ( 1, n ) wells _ per _ line = list ( l [ i : i + n ] for i in range ( 0, len ( l ), n ) ) return wells _ per _ line | [
-0.4024762511253357,
0.4953480362892151,
0.5733507871627808,
0.16712528467178345,
0.3026830852031708,
-0.0045893010683357716,
0.02634139358997345,
-0.5686841011047363,
0.14928673207759857,
-0.4161235988140106,
-0.6510658860206604,
-0.35154569149017334,
0.16280177235603333,
1.49015593528747... |
def computation _ from _ dict ( d ) : return compositecomputation ( * set ( d. keys ( ) ) | set ( sum ( d. values ( ), ( ) ) ) ) | [
-0.7193005681037903,
0.45872724056243896,
0.3392418324947357,
-0.370425283908844,
-0.281058669090271,
-0.13552488386631012,
0.6407113671302795,
0.053325314074754715,
0.5948295593261719,
0.5373396277427673,
0.11471034586429596,
-1.0579216480255127,
0.30067014694213867,
0.004274873528629541,... |
def get _ xs _ strong ( self ) : xs _ strong = 0. for idx, xs in enumerate ( self. _ xs ) : if self. _ is _ strong ( self. _ p1 [ idx ] ) and \ self. _ is _ strong ( self. _ p2 [ idx ] ) : xs _ strong + = xs return xs _ strong | [
0.2888038158416748,
0.20115534961223602,
0.541874885559082,
0.18621431291103363,
0.5511234402656555,
-0.31663092970848083,
-1.130743384361267,
-0.10912513732910156,
-0.39585432410240173,
0.0293568167835474,
-0.7238979339599609,
0.6285839676856995,
0.09145369380712509,
-0.6291163563728333,
... |
def printhelp ( ) : print " rimworld translation template script " print " copies all def's from the rimworld core mod folder and creates definject templates for them. " print " usage : rimworld _ defstodefinject. py < rimworld installation folder > < folder for templates > " print " " print " use - h to get this messa... | [
0.3059684932231903,
0.14745542407035828,
0.5596053600311279,
0.02003730833530426,
0.6168433427810669,
0.3935263156890869,
0.7894678115844727,
-0.5788801908493042,
-0.36452776193618774,
0.3523792624473572,
-0.14325891435146332,
0.6688735485076904,
-0.1839136779308319,
0.35201719403266907,
... |
def console _ pool _ get _ all _ by _ host _ type ( context, host, console _ type ) : return impl. console _ pool _ get _ all _ by _ host _ type ( context, host, console _ type ) | [
-0.4904254674911499,
-0.3177696466445923,
0.6281643509864807,
1.0445053577423096,
0.8413904309272766,
0.06384047865867615,
-0.0009067869395948946,
-1.2590802907943726,
-0.8698017597198486,
0.37727370858192444,
-0.345060795545578,
1.3064879179000854,
-0.40621960163116455,
0.6591824293136597... |
def prelude ( bitwidth, carry = false ) : # list with primary inputs a = range ( bitwidth ) # msb [ 0, 1, 2, 3 ] lsb an example for 4 bitwidth b = range ( bitwidth, bitwidth * 2 ) # msb [ 4, 5, 6, 7 ] lsb c = bitwidth * 2 # define index varible, skip primary inputs, depends on carry bit idx = bitwidth * 2 if carry : id... | [
-0.4978063702583313,
-0.06269742548465729,
0.8788806200027466,
-0.30362236499786377,
-0.40019690990448,
-0.24794499576091766,
0.18673968315124512,
-0.08044680207967758,
0.15327852964401245,
0.2660271227359772,
-0.3590109646320343,
-0.00906485877931118,
-0.07729337364435196,
0.0801450759172... |
def test _ nonword _ character _ in _ username ( self ) : eq _ ( normalize ('user - with - hyphens @ someserver. org') [ 0 ],'user - with - hyphens') | [
-0.15075065195560455,
0.5043214559555054,
0.18801860511302948,
0.4935632050037384,
-0.22465801239013672,
0.3418644070625305,
-0.06183572858572006,
0.2634361982345581,
0.3786585032939911,
-0.284578412771225,
-0.4142419993877411,
0.5324831008911133,
-1.2890547513961792,
0.439126193523407,
... |
def test _ addcallback ( self ) : l = [ ] sd = synchronousdeferred ( none ) self. assertequals ( sd. addcallback ( l. append ), sd ) self. assertequals ( l, [ none ] ) | [
0.8312541246414185,
1.0968254804611206,
0.5903303027153015,
0.4304622411727905,
0.8998292684555054,
0.2538093626499176,
-0.682222306728363,
-0.13341514766216278,
1.2910665273666382,
-1.661512017250061,
-0.7617475986480713,
-0.2614403963088989,
-0.18457548320293427,
1.399001121520996,
0.3... |
def wave _ number ( g, omega, h ) : p = omega * * 2 * h / g q = dispersion ( p ) k = q * omega * * 2 / g return k | [
0.46720650792121887,
0.22601504623889923,
0.5721904039382935,
0.47001367807388306,
-0.32350412011146545,
-0.27153000235557556,
0.611340343952179,
1.0303224325180054,
-0.7773534059524536,
-0.7751331329345703,
-0.6955970525741577,
0.15013572573661804,
-0.05779517814517021,
0.5084161162376404... |
def get _ url ( self, resource, item _ id = none, group _ id = none, action = none ) : # get resource path resource _ path = self. paths [ resource ] # if grouped resource ( like topics or subs that belong under a project ) if'{ }'in resource _ path : # add groups name into the resource path resource _ path = resource ... | [
-0.16536614298820496,
-0.43674299120903015,
0.6446461081504822,
0.4379492998123169,
0.34653788805007935,
0.5683178305625916,
-0.15658175945281982,
-0.09656504541635513,
-0.11908097565174103,
0.5151674747467041,
0.7105528116226196,
0.7251835465431213,
-0.1500919610261917,
0.0706920400261879... |
def exp _ lr _ scheduler ( optimizer, epoch, init _ lr = 0. 01, lr _ decay _ epoch = 10 ) : lr = init _ lr * ( 0. 8 * * ( epoch / / lr _ decay _ epoch ) ) print ('lr is set to { } '. format ( lr ) ) for param _ group in optimizer. param _ groups : param _ group ['lr'] = lr return optimizer | [
0.5488039255142212,
-0.939532995223999,
0.49662673473358154,
-0.49959683418273926,
-0.5839114785194397,
0.1672699749469757,
-0.9329437017440796,
1.0601062774658203,
0.32142120599746704,
0.3894961476325989,
-0.04138181731104851,
0.5613709688186646,
-0.26350077986717224,
1.0450358390808105,
... |
def forward ( self, x, step _ counter, actions = none, pretrain = false ) : self. step _ counter = step _ counter self. sup. step _ counter = step _ counter self. dyn. step _ counter = step _ counter # save color image for apperance information x _ color = x if self. c. debug _ bw : x = bw _ transform ( x ) else : x = ... | [
-0.2922705113887787,
0.6769567728042603,
0.5348263382911682,
0.4510578513145447,
-0.3066827058792114,
-0.14926709234714508,
0.3654544949531555,
0.937476396560669,
-0.2121383249759674,
-1.0593541860580444,
-0.8878792524337769,
0.32548266649246216,
0.9729106426239014,
0.9179733991622925,
0... |
def test _ protprot _ 1bkd _ dockq ( protprot _ 1bkd _ caprimodule ) : protprot _ 1bkd _ caprimodule. irmsd = 8. 16 protprot _ 1bkd _ caprimodule. fnat = 0. 07 protprot _ 1bkd _ caprimodule. lrmsd = 28. 47 protprot _ 1bkd _ caprimodule. calc _ dockq ( ) assert round _ two _ dec ( protprot _ 1bkd _ caprimodule. dockq ) ... | [
-0.34582430124282837,
-0.2620416581630707,
0.5832754373550415,
0.7961428165435791,
-0.2125069946050644,
0.7831130027770996,
0.3359890282154083,
-0.32474613189697266,
0.3989619016647339,
-0.6325270533561707,
0.3801979422569275,
0.37950021028518677,
-0.07101297378540039,
0.7214224338531494,
... |
def sell ( ) : if request. method = = " post " : # get the user input from the form userid = session [ " user _ id " ] symbol = request. form. get ( " symbol " ) amount = request. form. get ( " shares " ) # check if the user selected a symbol if not symbol : return apology ( " a stock symbol must be selected. " ) # che... | [
0.30253472924232483,
0.43350160121917725,
0.8982274532318115,
0.25972434878349304,
0.22760041058063507,
-0.8158628344535828,
0.8960592746734619,
-0.7739341855049133,
-0.16661056876182556,
0.013230596669018269,
0.5082047581672668,
0.06002802401781082,
-0.44016033411026,
0.4493682384490967,
... |
def original _ lbp ( image ) : rows = image. shape [ 0 ] cols = image. shape [ 1 ] lbp _ image = np. zeros ( ( rows - 2, cols - 2 ), np. uint8 ) # 的 lbp , 上 lbp _ image for i in range ( 1, rows - 1 ) : for j in range ( 1, cols - 1 ) : pass center = image [ i ] [ j ] code = 0 # code = code | 2 ( ) code < < = 7 code = co... | [
0.6445364356040955,
-1.123970627784729,
1.080811619758606,
-0.46151313185691833,
-0.45973634719848633,
0.23334050178527832,
0.11953311413526535,
-0.1033296212553978,
1.012468695640564,
1.342834711074829,
0.2670254409313202,
0.753903329372406,
-0.9625755548477173,
0.1575358659029007,
0.32... |
def buildingparametres ( specifications, i, n, crs = none ) : # - - the roof types rooftypes = ['flat ','shed ','hipped ','gabled ','pyramidal'] # - - unique uuid for each building. this will later be translated to gml : id in citygml name = str ( uuid. uuid4 ( ) ) # - - element tree, building building = etree. subelem... | [
-0.7691474556922913,
0.8038066625595093,
0.7811517715454102,
-0.3477763533592224,
-0.2862757742404938,
0.6329957842826843,
0.3413449227809906,
0.22115278244018555,
-0.23604120314121246,
0.36511123180389404,
-0.046933066099882126,
-0.6299140453338623,
-0.1850874125957489,
0.5238832235336304... |
def test _ modulepickling _ simulate _ deleted _ cache ( tmpdir ) : grammar = load _ grammar ( ) module ='fake parser'# create the file path = tmpdir. dirname +'/ some _ path'with open ( path,'w') : pass io = file _ io. fileio ( path ) try _ to _ save _ module ( grammar. _ hashed, io, module, lines = [ ] ) assert load ... | [
0.5765517950057983,
-0.1565169394016266,
0.5314346551895142,
-0.08989516645669937,
0.9526010751724243,
0.402536004781723,
0.14467616379261017,
-0.36291787028312683,
0.38558924198150635,
0.24668560922145844,
-1.1003930568695068,
0.4334143102169037,
0.36656129360198975,
0.114920973777771,
... |
def subject ( self ) - > str : return self. get ( " sub ", " " ) | [
0.3821862041950226,
0.4743315577507019,
0.41019561886787415,
0.1653723269701004,
-0.36217546463012695,
1.4691730737686157,
-0.10764245688915253,
-1.0034739971160889,
-0.03901742771267891,
-0.8452829718589783,
-0.07768017798662186,
0.9154357314109802,
0.05316411331295967,
-1.111570477485656... |
def getplayer1alphabet ( self ) - > list [ int ] : return self. p1 _ alphabet | [
-1.138152003288269,
-0.8540099859237671,
0.4838484525680542,
0.7170339822769165,
0.48445799946784973,
1.019331932067871,
0.43742653727531433,
0.07327475398778915,
0.43619099259376526,
0.7907510995864868,
-1.0284724235534668,
0.7287682890892029,
-0.60519939661026,
0.48768967390060425,
0.1... |
def instance _ get _ all _ by _ project ( context, project _ id ) : return impl. instance _ get _ all _ by _ project ( context, project _ id ) | [
-0.17632192373275757,
0.6598832011222839,
0.24805407226085663,
0.30420994758605957,
0.5686953663825989,
0.4221668243408203,
-0.15618053078651428,
-0.45259034633636475,
-0.6231682300567627,
0.44278737902641296,
0.40058407187461853,
0.7631523013114929,
-0.3931674659252167,
0.7188394069671631... |
def augment _ json ( hyper ) : if hyper. augment is none : return none elif isinstance ( hyper. augment, str ) : return hyper. augment # if isinstance ( hyper. augment, ( dict, list ) ) : # cant check for list because seq inherits from it elif isinstance ( hyper. augment, ub. odict ) : # already specified in json forma... | [
-0.5269938111305237,
-0.7338935136795044,
0.6221833825111389,
-0.11356999725103378,
-0.4475502669811249,
-0.8520864248275757,
-0.09914083778858185,
-0.5029016137123108,
0.7928458452224731,
-0.1501172035932541,
-0.6229296922683716,
1.050841212272644,
0.6189666986465454,
0.8857869505882263,
... |
def forward ( self, input ) : # the input is needed when computing the backward pass. self. input = input. clone ( ) output = input. clamp ( min = 0 ) return output | [
-0.030264880508184433,
0.11885501444339752,
0.3359253704547882,
0.326673299074173,
-0.2023584097623825,
0.5728634595870972,
0.2544880211353302,
-0.839167594909668,
0.11824296414852142,
-1.1201895475387573,
0.050099655985832214,
0.7135531902313232,
-0.4971657395362854,
-0.07202281057834625,... |
def _ enclose ( object, alias ='' ) : # fixme : needs alias to hold returned object # xxx : dummy and stub should append a random string dummy ='_ _ this _ is _ a _ big _ dummy _ enclosing _ function _ _'stub ='_ _ this _ is _ a _ stub _ variable _ _'code ='def % s ( ) : \ n'% dummy code + = indent ( getsource ( object... | [
-0.14567409455776215,
0.49805930256843567,
0.8298272490501404,
-0.4052450954914093,
-0.2834869623184204,
-0.2993803918361664,
0.7199032306671143,
-0.3335883319377899,
0.6097684502601624,
0.23941226303577423,
-0.3263830840587616,
0.8952202796936035,
0.47287580370903015,
0.3335750997066498,
... |
def wrapper ( self, * args, * * kwargs ) : original _ handler = self. _ http _ server. requesthandlerclass self. _ http _ server. requesthandlerclass = http _ handler _ factory ( urls ) try : return func ( self, * args, * * kwargs ) finally : self. _ http _ server. requesthandlerclass = original _ handler | [
-1.8468832969665527,
-0.159506693482399,
0.4838135838508606,
0.43087995052337646,
-0.3153867721557617,
0.6080021262168884,
-0.25502684712409973,
0.3268275260925293,
-0.637324333190918,
-1.3065133094787598,
0.284268856048584,
0.49845895171165466,
0.1945064216852188,
0.3202436566352844,
0.... |
async def _ wait _ connection _ timeout ( self, timeout : union [ int, float ] ) \ - > none : assert self. _ transport is not none while true : await self. _ transport. wait _ for _ state ( transportstate. connecting ) try : await asyncio. wait _ for ( self. _ transport. wait _ for _ state ( transportstate. connected )... | [
-0.4323606789112091,
0.051336392760276794,
0.4811687767505646,
-0.7209628224372864,
-0.0592026524245739,
0.3305342197418213,
-1.1022136211395264,
-0.03239070251584053,
-0.6214985251426697,
0.3912496864795685,
-0.05788692459464073,
-0.8555184006690979,
0.30320918560028076,
-0.63298499584198... |
def update _ contact ( conn : sqlite3. connection, mac _ address, * * kwargs ) : fields = [ * filter ( lambda f : f in contact _ fields and contact _ fields [ f ] ['editable'], kwargs ) ] if fields : values = [ kwargs [ field ] for field in fields ] values. append ( mac _ address ) statement = f " update contact set {'... | [
-0.4394643008708954,
-0.5500392913818359,
0.38056302070617676,
0.09504862874746323,
-0.5064289569854736,
-0.2200280725955963,
-0.41383427381515503,
0.12736457586288452,
-0.45768657326698303,
0.8250302672386169,
0.047598280012607574,
-0.016711825504899025,
-0.8986296057701111,
-0.1914904117... |
def log ( self, printto, txt ) : try : res = db. execute ( " " " insert into udplog ( time, printto, txt ) values ( % s, % s, % s ) " " ", ( time. time ( ), printto, txt ) ) except exception, ex : rlog ( 10,'udp ','failed to log to db : % s'% str ( ex ) ) return res | [
-0.943167507648468,
1.3290706872940063,
0.745711088180542,
-0.7919788360595703,
0.14692270755767822,
0.3791433274745941,
-1.14042329788208,
0.16687285900115967,
-0.7034876942634583,
0.046404313296079636,
-0.9599606394767761,
-0.4438115358352661,
-1.1136624813079834,
-0.6479968428611755,
... |
def move _ robber ( self, game _ state ) : return | [
-1.152108073234558,
-0.2593376040458679,
0.3067496716976166,
0.690904974937439,
0.4780123829841614,
-0.13464225828647614,
-0.3741411566734314,
-0.1484660506248474,
-0.21962569653987885,
0.6905350089073181,
-1.0736284255981445,
-0.022461991757154465,
-0.045423950999975204,
-1.00002038478851... |
def discrepancies ( self, groups ) : if not self. use _ discrepancy : return { } chain _ ids = [ ] for group in groups : chain _ ids. append ( group ['db _ id'] ) with self. session ( ) as session : sim = mod. chainchainsimilarity query = session. query ( sim ). \ filter ( sim. chain _ id _ 1. in _ ( chain _ ids ) ). \... | [
-0.5354005098342896,
0.38452666997909546,
0.5668699741363525,
-0.1291152983903885,
0.185845747590065,
-0.14372453093528748,
0.8524668216705322,
-0.19026900827884674,
-0.4752828776836395,
0.12301656603813171,
-0.38563621044158936,
0.3678555488586426,
-0.805532693862915,
0.44925355911254883,... |
def transform ( self, y ) : self. _ check _ fitted ( ) y _ is _ multilabel = type _ of _ target ( y ). startswith ('multilabel') if y _ is _ multilabel and not self. multilabel _ : raise valueerror ( " the object was not fitted with multilabel " " input. " ) return label _ binarize ( y, self. classes _, multilabel = se... | [
-0.8170389533042908,
-0.7529001235961914,
0.7493559718132019,
0.6675241589546204,
0.3168564438819885,
0.012816345319151878,
-0.06464764475822449,
-0.2663118243217468,
0.9215278625488281,
0.2726935148239136,
-0.5811334848403931,
0.10856621712446213,
0.0818275436758995,
0.5533818602561951,
... |
def reconfig _ dfe _ set _ tap _ 4 ( fpgaid, data, verbose = 1 ) : if ( verbose & 1 ) = = 1 : print " " " specifies the coefficient for the fourth post tap. the valid range is 0 - 7. " " " # read out = reconfig _ dfe _ get _ indirect _ register ( fpgaid, 4, verbose ) # modify data data = ( out & ~ 7 ) | ( data < < 0 ) ... | [
-0.4400445520877838,
0.10969281196594238,
0.6334115862846375,
-0.5122085213661194,
-0.07983195036649704,
-0.252590537071228,
0.33745235204696655,
-0.34546342492103577,
-0.3512919545173645,
-0.0798332691192627,
-0.09198356419801712,
0.21630516648292542,
0.0038710511289536953,
0.331614375114... |
def count _ loci ( loci : list, sep ='_') - > int : acc = 0 num = 0 for locus in loci : # type : locus for seq _ feat in locus. features : # type : seqfeature if not seq _ feat. id : continue # split the locus _ id into it's component parts parts = seq _ feat. id. split ( sep ) try : num = int ( parts [ - 1 ] ) except ... | [
0.19986404478549957,
-0.786386251449585,
0.7176071405410767,
0.09061810374259949,
-0.49542665481567383,
-0.5217161178588867,
0.6807782053947449,
0.48895710706710815,
0.3437153398990631,
-0.5183534622192383,
-0.5812510251998901,
-0.4854384958744049,
0.5676029920578003,
-0.32378214597702026,... |
def run _ interactive ( self ) : while true : input = raw _ input ( " enter input string or q to quit : " ) if input in ['q ','q'] : break self. run ( input ) print | [
-0.0065365079790353775,
-0.8258488178253174,
0.43900594115257263,
0.4490646719932556,
-0.3089672327041626,
1.1399704217910767,
0.30995744466781616,
-0.8110908269882202,
-0.1487012654542923,
-1.1927205324172974,
0.3046311140060425,
0.9530714154243469,
-0.9640840888023376,
-0.619172394275665... |
def get _ time _ label ( self, i, step ) : lt = time. localtime ( i ) ret = " " if step < 60 : return'{ 0 } : { 1 : 0 > 2 } : { 2 : 0 > 2 } '. format ( lt. tm _ hour, lt. tm _ min, lt. tm _ sec ) # < 1h if step < 86400 : return'{ 0 } : { 1 : 0 > 2 } '. format ( lt. tm _ hour, lt. tm _ min ) # greater then 2 days.. if s... | [
-0.925609290599823,
-0.5360109806060791,
0.8791976571083069,
-0.6993329524993896,
-0.5225536823272705,
0.4619486331939697,
-0.6424188613891602,
-0.8654510974884033,
-0.8511236310005188,
1.0818966627120972,
-0.13176721334457397,
-0.4722607731819153,
0.1335289031267166,
0.542006254196167,
... |
def ops _ random ( ops ) : for a in ops : n = 0 for b in ops [ a ] : n + = len ( ops [ a ] [ b ] ) r = [ random. random ( ) for i in range ( n ) ] s = sum ( r ) r = [ i / s for i in r ] i = 0 for b in ops [ a ] : for e in ops [ a ] [ b ] : ops [ a ] [ b ] [ e ] = np. log ( r [ i ] ) return ops | [
-0.4442059099674225,
0.2342502474784851,
0.8123692274093628,
-0.39249473810195923,
-0.009395337663590908,
0.09553755074739456,
1.4131402969360352,
-0.016993211582303047,
1.3142342567443848,
0.7837582230567932,
0.0019211152102798223,
-0.6906121373176575,
0.10112292319536209,
-0.335365891456... |
def exclude _ paths ( self, exclude _ paths ) : self. _ exclude _ paths = exclude _ paths | [
0.11051403731107712,
0.7715743780136108,
0.3085167706012726,
1.5050350427627563,
-0.66567462682724,
1.6399750709533691,
0.7148196697235107,
0.5638787746429443,
-0.17018288373947144,
-0.23074889183044434,
-0.6332136988639832,
-1.28831148147583,
-0.4689394235610962,
-0.3617382347583771,
0.... |
def create _ tables ( ) : for cls in [ party, county, electiontype, election, officetype, office, candidate, vote, votetotal ] : cls. create _ table ( true ) | [
-0.24228215217590332,
0.11512403190135956,
0.14811359345912933,
0.6689855456352234,
1.2550383806228638,
0.7940990924835205,
0.06775662302970886,
-0.3859419524669647,
-0.30276206135749817,
0.4758044481277466,
-0.7682231664657593,
-0.21793970465660095,
-0.06099335849285126,
0.715781450271606... |
def get _ nodes _ tasks ( nodes _ offsets ) : nodes _ tasks = defaultdict ( set ) for node, platform _ offset in nodes _ offsets. items ( ) : for platform, offsets in platform _ offset. items ( ) : for offset in offsets : url = base _ url _ get. format ( limit = limit, offset = offset, platform = platform ) nodes _ tas... | [
-0.6026743650436401,
0.38116705417633057,
0.5361009240150452,
-0.8117461800575256,
0.008520499803125858,
0.3212910294532776,
-0.19452433288097382,
0.14947205781936646,
-1.5108230113983154,
0.7282322645187378,
-0.45360350608825684,
0.422748863697052,
1.0118340253829956,
-0.1456543207168579,... |
def testlonglinearchainhomconf ( self ) : ( q, n ) = conftest. longlinearchainhomconf ( 30 ) # use a chain of length 30 for this test self. assertequal ( q, true ) self. assertequal ( len ( n ), 1 ) | [
0.6343348026275635,
0.05259751155972481,
0.19821298122406006,
-0.1674177199602127,
0.9328984618186951,
0.5391309857368469,
-0.9055647253990173,
0.3380967378616333,
0.3815368711948395,
-1.1619760990142822,
-0.987451434135437,
0.15646164119243622,
-0.13426926732063293,
0.6343137621879578,
... |
def character _ span ( self ) : return ( self. _ sentences [ 0 ]. character _ span [ 0 ], self. _ sentences [ - 1 ]. character _ span [ 1 ] ) | [
-0.4681102931499481,
-1.2753956317901611,
0.5501800775527954,
-1.05778169631958,
0.07361719012260437,
0.2941747009754181,
0.10851243883371353,
-0.09602529555559158,
-0.027589913457632065,
0.004172069486230612,
-0.8941618800163269,
0.4846915304660797,
-0.059559207409620285,
-0.2335663288831... |
def get ( self, key : int ) - > int : bucket _ to _ map = self. hash _ function ( key ) ; if self. buckets [ bucket _ to _ map ] is none : return - 1 bucket _ data = self. buckets [ bucket _ to _ map ]. head while bucket _ data : if bucket _ data. data [ 0 ] = = key : return bucket _ data. data [ 1 ] bucket _ data = bu... | [
-0.9976972937583923,
0.40020474791526794,
0.7389885187149048,
0.22507724165916443,
-0.41850629448890686,
-0.5141932964324951,
-0.0009951404063031077,
-0.3299579918384552,
-0.8871952295303345,
-0.33303651213645935,
-0.1734476089477539,
0.46866345405578613,
-0.41623711585998535,
-0.014230498... |
def test _ propagate _ anchors _ off ( ufo _ module ) : font = generate _ minimal _ font ( ) font. customparameters [ " propagate anchors " ] = 0 glyphs = ( ( " sad ", [ ], [ ( " bottom ", 50, - 50 ), ( " top ", 50, 150 ) ] ), ( " dotabove ", [ ], [ ( " top ", 0, 150 ), ( " _ top ", 0, 100 ) ] ), ( " dad ", [ ( " sad "... | [
-0.4797866940498352,
0.3824635148048401,
0.6708892583847046,
-1.2376148700714111,
0.6809791922569275,
0.7717169523239136,
1.1051148176193237,
-0.34426790475845337,
0.7607131004333496,
-0.7631335854530334,
-0.32226353883743286,
0.8364989161491394,
-0.27795925736427307,
-0.17119407653808594,... |
def sfc _ sfcisfileprotected ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " rpchandle ", " protfilename " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value ) | [
0.29886481165885925,
0.1419643759727478,
0.6526886224746704,
0.6303320527076721,
0.11968427151441574,
0.02319394424557686,
0.7838998436927795,
-0.45926007628440857,
-0.6261115670204163,
-0.4509901702404022,
-0.05741706117987633,
-0.3117494285106659,
-1.0072741508483887,
0.18269743025302887... |
def test _ create _ superuser ( self ) : user = get _ user _ model ( ). objects. create _ superuser ( email = " superuser @ recipeapi. com ", password = " somethingrandom " ) self. asserttrue ( user. is _ staff ) self. asserttrue ( user. is _ superuser ) | [
0.7339351773262024,
0.9995778799057007,
0.1315164864063263,
1.2985836267471313,
0.7596659064292908,
0.9989954233169556,
-0.18689483404159546,
0.9325098395347595,
0.1504923552274704,
-1.0094664096832275,
-1.5471819639205933,
0.19716449081897736,
-0.111238993704319,
-0.015263725072145462,
... |
async def receive ( self, data ) : status = data. get ('status') if status = ='data': if data. get ('action') = ='move': return # too many data ; _ ; elif status = ='game': action = data. get ('action') if action = ='start': self. start = true elif action = ='over': self. start = false if is _ silent : return print ( s... | [
-0.10991255193948746,
0.3533065617084503,
0.831946611404419,
-0.6411116123199463,
0.019558332860469818,
-0.38135606050491333,
-0.7854034900665283,
-0.22916772961616516,
0.5917437672615051,
0.3255952298641205,
-0.057041771709918976,
0.7766022682189941,
0.2578409016132355,
0.067159004509449,... |
def post ( self, author _ name, post _ id ) : action = self. request. get ('action _ comment') comment _ id = self. request. get ('comment _ id') uri = self. uri _ for ('post - comments ', author _ name = author _ name, post _ id = post _ id, _ fragment ='cid _'+ str ( comment _ id ) ) if action = ='submit comment'\ an... | [
-0.09367085993289948,
-0.4408944249153137,
0.9371560215950012,
1.108807921409607,
0.3940023183822632,
0.2127174437046051,
0.33069074153900146,
0.16803357005119324,
-0.14409026503562927,
-0.13382376730442047,
0.3584461808204651,
-0.3417106866836548,
-0.15222710371017456,
0.07056590169668198... |
def sm _ volume _ delete ( context, volume _ id ) : return impl. sm _ volume _ delete ( context, volume _ id ) | [
0.5451807975769043,
-0.45507243275642395,
0.24182821810245514,
0.27643075585365295,
0.006910823285579681,
-1.3788985013961792,
0.02927374839782715,
0.25888729095458984,
1.456486701965332,
0.38250285387039185,
0.002938736230134964,
0.511448860168457,
-0.5741075277328491,
-0.0357670634984970... |
def flatten _ list ( l ) : for el in l : if isinstance ( el, list ) or isinstance ( el, tuple ) : for sub in flatten _ list ( el ) : yield sub else : yield el | [
-0.6261930465698242,
0.8687613010406494,
0.7195757031440735,
1.3534817695617676,
-0.4125966727733612,
0.6802096366882324,
-0.06182122603058815,
0.6058685183525085,
0.9066045880317688,
-0.5101191401481628,
-0.33020448684692383,
-1.1724581718444824,
-0.362163245677948,
0.7547777891159058,
... |
def test _ load _ valid ( ) - > none : conf = configuration ('tests / configurations / valid. yaml') assert conf is not none assert len ( conf. files ) = = 2 assert'file1. vhd'in conf. files assert'file2. vhd'in conf. files assert len ( conf. tests ) = = 2 assert'file1 _ tb'in conf. tests assert'file2 _ tb'in conf. tes... | [
0.586072564125061,
-0.3900301456451416,
0.5672794580459595,
0.28486040234565735,
0.1792011260986328,
0.3878389000892639,
0.44499051570892334,
1.0625241994857788,
-0.5277062058448792,
0.28161606192588806,
-1.2442166805267334,
-0.982764720916748,
0.3599992096424103,
-0.1440274715423584,
0.... |
def prepare _ data ( ) : global x _ train global y _ train global categoricals global df global y _ labels x _ train = df. drop ( ['id ','label'], axis = 1 ) y _ labels = df ['label'] # get _ dummies effectively creates one - hot encoded variables y _ train = pd. get _ dummies ( y _ labels, columns = categoricals, dumm... | [
-0.3783825933933258,
0.8685498833656311,
0.46593642234802246,
0.19459226727485657,
0.7683148980140686,
0.09488283097743988,
-0.6993473768234253,
0.34433144330978394,
0.10513032972812653,
-0.07043111324310303,
-0.842677891254425,
0.9921335577964783,
1.0285414457321167,
-0.07813099771738052,... |
def access _ key2 ( self ) - > optional [ str ] : return pulumi. get ( self, " access _ key2 " ) | [
0.48629429936408997,
-1.0255095958709717,
0.4848872721195221,
0.8156781196594238,
-0.13480424880981445,
0.2163616269826889,
0.6402478218078613,
-0.7052688598632812,
-0.5116697549819946,
0.012904280796647072,
0.740594744682312,
1.7097296714782715,
0.9757789373397827,
-0.5129914283752441,
... |
def server _ status _ field ( log, server _ status, field _ name ) : # pylint : disable = unused - argument return server _ status. bssc _ field _ result ( log, field _ name ) | [
0.47989675402641296,
-0.09329629689455032,
0.19146020710468292,
-0.579647958278656,
-0.3460279405117035,
-0.21390189230442047,
-0.6121041178703308,
-0.2257602959871292,
-0.2909500300884247,
0.34241315722465515,
-1.09200119972229,
0.4277563989162445,
-0.010661362670361996,
-0.27850505709648... |
def _ is _ blacklisted _ domain _ name ( self, context, domain _ name ) : blacklists = cfg. conf ['service : central']. domain _ name _ blacklist for blacklist in blacklists : if bool ( re. search ( blacklist, domain _ name ) ) : return blacklist return false | [
0.3458784818649292,
-0.3901154398918152,
0.5602426528930664,
-0.05260809510946274,
-0.01485864631831646,
0.11212721467018127,
-0.5173342227935791,
0.6393944621086121,
0.5151937007904053,
1.0473073720932007,
-0.21676646173000336,
1.1911194324493408,
-0.7544857859611511,
0.13363617658615112,... |
def polar ( afile, re, * args, * * kwargs ) : if calc _ polar ( afile, re, polarpath, cppath, coordpath, * args, * * kwargs ) : print ( " computed polar. reading it now... " ) data = read ( polarpath, cppath, coordpath ) # delete _ polar ( polarpath ) return data return none | [
0.16079673171043396,
-0.8348919153213501,
0.4839375615119934,
-0.1504686027765274,
-0.5849217176437378,
0.33172526955604553,
0.3085944950580597,
0.472404807806015,
-0.6157130599021912,
-0.4097438156604767,
0.7304409146308899,
-0.12074720114469528,
-0.9507575631141663,
-1.2474173307418823,
... |
def get _ path ( self ) - > str : pass | [
-0.003220328828319907,
-0.785819411277771,
0.20401550829410553,
1.2323648929595947,
0.13825471699237823,
1.103710412979126,
0.722487211227417,
0.036505453288555145,
-0.3199215233325958,
-0.4463549256324768,
0.7331740856170654,
0.23032830655574799,
-0.16823676228523254,
-0.386444628238678,
... |
def dummy _ sensor _ getter ( name, value = none, dtype = np. float64, timestamp = 0. 0 ) : if value is none : if np. issubdtype ( dtype, np. floating ) : value = np. dtype ( dtype ). type ( np. nan ) elif np. issubdtype ( dtype, np. integer ) : value = np. dtype ( dtype ). type ( - 1 ) elif np. issubdtype ( dtype, np.... | [
-0.5320158004760742,
-0.28980639576911926,
0.747404158115387,
-0.45635342597961426,
-0.7767795920372009,
-0.5583921074867249,
-0.7599546909332275,
-1.095147967338562,
1.305901050567627,
-0.3448597490787506,
-0.01769777573645115,
0.3785821795463562,
0.06063315272331238,
-0.01573301479220390... |
def test _ protprot _ irmsd ( protprot _ caprimodule ) : # using standard cutoff protprot _ caprimodule. calc _ irmsd ( cutoff = 10. 0 ) assert round _ two _ dec ( protprot _ caprimodule. irmsd ) = = 8. 33 # using default cutoff = 5. 0 protprot _ caprimodule. calc _ irmsd ( ) assert round _ two _ dec ( protprot _ capri... | [
0.3555960953235626,
-0.524472713470459,
0.5148036479949951,
-0.0029331741388887167,
0.10644638538360596,
0.8751357793807983,
0.06962220370769501,
-0.5672675967216492,
-0.005874229595065117,
-0.12863041460514069,
0.4505419433116913,
0.23429830372333527,
-1.2353289127349854,
0.34473571181297... |
def conv ( channels, dnu, band ) : map _ i _ smoothed = [ map _ smoothing ( nu, dust _ map ( nu, dust _ ind1, dust _ ampl _ i ), fwhm ( nu ) ) for nu in band ] i _ conv = sum ( np. multiply ( np. mat ( channels [ 1 ] ). t * dnu, np. mat ( map _ i _ smoothed ) ) ) map _ q _ smoothed = [ map _ smoothing ( nu, dust _ map ... | [
0.05019090697169304,
-0.11460716277360916,
0.8491256833076477,
-0.44553858041763306,
-0.041729629039764404,
0.3923347592353821,
-0.27082559466362,
-0.4575546383857727,
-0.32360953092575073,
0.22658661007881165,
-0.40340372920036316,
0.4986235201358795,
0.3315424621105194,
0.127325683832168... |
def _ is _ equal _ values ( v1, v2 ) : # check obvious cases if v1 is v2 : return true # check specifically cpo expressions ( to not call'= ='operator on it ) if isinstance ( v1, cpoexpr ) : return v1. equals ( v2 ) if isinstance ( v2, cpoexpr ) : return false # check floats if is _ float ( v1 ) : return is _ float ( v... | [
-0.17333030700683594,
-0.08163893967866898,
0.7993588447570801,
0.4617164134979248,
-0.23614506423473358,
-0.20941373705863953,
-0.7879124283790588,
-0.18118919432163239,
-0.31512895226478577,
0.8667930364608765,
-0.5568478107452393,
0.3187919557094574,
-0.29059284925460815,
0.283855438232... |
def page _ not _ found ( e ) : return render _ template ('404. html'), 404 | [
-0.1132318377494812,
-0.207339346408844,
0.3987339735031128,
0.11531192064285278,
0.5974615216255188,
0.787588357925415,
0.22699956595897675,
0.7901851534843445,
-0.21726636588573456,
0.5563891530036926,
0.2748606204986572,
-0.6475122570991516,
0.5569325685501099,
0.43830132484436035,
-0... |
def agent _ build _ create ( context, values ) : return impl. agent _ build _ create ( context, values ) | [
-0.4757804572582245,
-1.0518471002578735,
0.13185343146324158,
0.38870859146118164,
0.7961951494216919,
0.2964835464954376,
-0.4037861227989197,
-0.5615636110305786,
0.4169270694255829,
-0.2699139416217804,
-0.27390363812446594,
-0.02105003595352173,
0.2762051820755005,
-1.0078943967819214... |
def after _ script ( self ) : self. return _ home ( ) | [
0.18145067989826202,
-0.9184952974319458,
0.280838280916214,
0.6429793238639832,
-0.48455390334129333,
-0.14660678803920746,
1.5779980421066284,
-0.45730841159820557,
0.7376022338867188,
0.2822757661342621,
-0.6233197450637817,
0.9149959087371826,
-0.020617110654711723,
-0.0656453520059585... |
def set _ destination ( self, destination ) : update = false assert isinstance ( destination, destinationemailaddress ) if destination. at _ localhost : raise rerr ( _ ( " the destination address'domain name must not be " " localhost. " ), domain _ invalid, ) if self. _ addr = = destination : raise rerr ( _ ( " address... | [
-0.3591921925544739,
0.4264787435531616,
0.7286825180053711,
-0.37817224860191345,
-0.5364488959312439,
0.29022863507270813,
0.18547022342681885,
0.1669876128435135,
0.253081738948822,
0.49786460399627686,
-0.37770238518714905,
0.7580101490020752,
-0.2501721978187561,
-0.40198490023612976,... |
def _ _ init _ _ ( self, theinitialmachine ) : super ( failsafestatemachine, self ). _ _ init _ _ ( ) self. thebackingmachine = theinitialmachine | [
0.21199853718280792,
0.42911460995674133,
0.4841727018356323,
0.49535682797431946,
0.3787204623222351,
0.2983403503894806,
-0.11437404900789261,
0.0798109620809555,
0.1973908245563507,
-0.21925562620162964,
-0.08486916869878769,
0.4189756512641907,
-0.5813424587249756,
0.14609338343143463,... |
def o _ auth _ settings ( self ) - > optional ['outputs. apioauthsettingsresponse'] : return pulumi. get ( self, " o _ auth _ settings " ) | [
-0.3804408013820648,
0.43779629468917847,
0.49527010321617126,
0.38224679231643677,
0.43111178278923035,
-0.46492892503738403,
0.7924250960350037,
-0.9859453439712524,
1.6619552373886108,
0.7994460463523865,
0.1871521919965744,
0.26607823371887207,
0.22435997426509857,
-1.437812089920044,
... |
def listdependents ( employeeid ) : dbdata = db. session. query ( dependent, employee ) \. join ( employee ) \. filter ( employee. id = = employeeid ). all ( ) result = [ ] for dependent, employee in dbdata : result. append ( { " dependentname " : dependent. firstname + " " + dependent. lastname, " dependentid " : depe... | [
-0.9150297045707703,
-0.25137922167778015,
0.5625256299972534,
-1.2967389822006226,
-0.8301831483840942,
0.21578681468963623,
-0.9719259738922119,
0.07176730036735535,
-0.3254047930240631,
0.8472353219985962,
-0.9320523738861084,
-0.02566591277718544,
0.13697932660579681,
1.148896098136901... |
def test _ protprot _ 1bkd _ ilrmsd ( protprot _ 1bkd _ caprimodule ) : protprot _ 1bkd _ caprimodule. calc _ ilrmsd ( ) assert round _ two _ dec ( protprot _ 1bkd _ caprimodule. ilrmsd ) = = 21. 71 | [
0.8459360599517822,
-0.7373837232589722,
0.46824201941490173,
-0.20164108276367188,
0.05201461538672447,
1.3683083057403564,
-0.6144304871559143,
-0.4506344497203827,
0.6706823110580444,
-0.7267796993255615,
0.6288740038871765,
0.6682935953140259,
-0.8576799035072327,
0.0004774709232151508... |
def to _ numpy ( self ) - > np. ndarray : return np. vstack ( [ self [ :, i ]. to _ numpy ( ) for i in range ( self. width ) ] ). t | [
-0.5124492645263672,
-0.2024262547492981,
0.48975759744644165,
-0.5051358938217163,
1.145660161972046,
-0.44031891226768494,
0.3901149034500122,
-0.521561861038208,
0.258334219455719,
0.591118574142456,
-0.35713574290275574,
0.24049457907676697,
-0.01058707945048809,
-0.15855151414871216,
... |
def file _ read ( fp _ id, num _ bytes ) : fp = get _ object ( fp _ id ) buf = _ string _ ( fp. read ( num _ bytes ) ) return buf | [
1.0513650178909302,
-0.8819099068641663,
0.3781282901763916,
-0.3492667078971863,
-0.2099001109600067,
0.053430430591106415,
-0.9036035537719727,
-0.22732461988925934,
-0.1867903620004654,
-0.33771172165870667,
0.330011248588562,
-0.046766456216573715,
0.38828542828559875,
-1.8153743743896... |
def sms _ template _ id ( self, sms _ template _ id ) : self. _ sms _ template _ id = sms _ template _ id | [
0.4323018491268158,
-0.4026131331920624,
0.14704513549804688,
0.6463435888290405,
-0.9985837340354919,
0.4588775038719177,
-0.5896075963973999,
1.1041033267974854,
0.6948514580726624,
0.05414185672998428,
-1.480371117591858,
-0.537459135055542,
-0.3212195038795471,
1.2696881294250488,
-0... |
def save ( request, pk = none ) : template _ values = {'page': {'title':'provider list'} } if request. method = ='get': if pk : provider = get _ object _ or _ 404 ( models. provider, pk = pk ) template _ values ['pk'] = provider. pk form = forms. provider ( instance = provider ) else : form = forms. provider ( ) templa... | [
-1.1198348999023438,
0.6379312872886658,
0.853622555732727,
0.044210147112607956,
0.04572543874382973,
0.5792720913887024,
0.01721947267651558,
0.9558088183403015,
0.6931295990943909,
0.6894596815109253,
-0.7248037457466125,
-0.9396620988845825,
-0.2073444277048111,
0.8224421143531799,
-... |
def set _ active ( self, state ) : return self. set _ option ( 3, 0x01 if state else 0 ) | [
-0.43452000617980957,
-0.0314147025346756,
0.37761807441711426,
0.4404843747615814,
0.5429885983467102,
0.24589718878269196,
0.2209397703409195,
0.05509784445166588,
0.8863868713378906,
-0.1117733046412468,
-0.8817049860954285,
0.05063866823911667,
-0.4619537889957428,
-1.4806089401245117,... |
def standard _ time ( hour, quarter ) : print ( f " \ nstandard _ time ( hour = { hour }, quarter = { quarter } ) " ) period = " am " if hour < 12 else " pm " # morning or afternoon print ( f " period = { period } " ) standard _ hour = hour if hour < 13 else hour - 12 # 8 - 12 am or 1 - 9 pm print ( f " standard _ hour... | [
0.611280083656311,
-0.7317835688591003,
0.6746297478675842,
-0.5508652329444885,
-0.43939298391342163,
0.5792995095252991,
-0.5679996013641357,
-0.3197176456451416,
-0.3187294602394104,
1.0105412006378174,
-0.38277319073677063,
0.610249936580658,
-0.15883061289787292,
0.057847246527671814,... |
def _ save _ checkpoint ( self, epoch, path ) : state = {'epoch': epoch,'model _ state _ dict': self. model. state _ dict ( ),'optimizer _ state _ dict': self. optim. state _ dict ( ),'logger': self. writer. log _ dir } torch. save ( state, path + " _ checkpoint. pth " ) print ( " [ checkpoint created ] epoch = { 0 } "... | [
-0.46835029125213623,
-0.4191969037055969,
0.22156986594200134,
-0.01648360677063465,
0.5984411239624023,
0.3366117775440216,
0.5266932845115662,
0.20595109462738037,
-1.065550684928894,
0.5120830535888672,
-1.1474425792694092,
-0.4325495660305023,
0.3584899604320526,
-0.2460995465517044,
... |
def childrentotext ( self ) : text = [ ] for child in self. children : text. append ( child. totext ( ) ) return''. join ( text ) | [
-0.34087488055229187,
-0.8916659355163574,
0.6863771080970764,
-0.46780580282211304,
0.011827227659523487,
-0.18963263928890228,
-0.7364614605903625,
0.07879042625427246,
0.16208980977535248,
0.7965291142463684,
-1.4132076501846313,
-0.39026662707328796,
-0.4285273551940918,
-0.04952366650... |
def filenames ( self, is _ training, data _ dir ) : if is _ training : return [ os. path. join ( data _ dir,'train - % 05d - of - 01024'% i ) for i in range ( 1024 ) ] else : return [ os. path. join ( data _ dir,'validation - % 05d - of - 00128'% i ) for i in range ( 128 ) ] | [
-0.7801839709281921,
0.4733423590660095,
0.7609797716140747,
0.44605880975723267,
0.606905460357666,
0.12338254600763321,
-0.1715705841779709,
0.5226491689682007,
0.40201613306999207,
0.7192179560661316,
-0.2704310417175293,
0.4261954724788666,
0.8998810052871704,
0.34748420119285583,
-0... |
def test _ divide _ array ( ctx _ factory ) : context = ctx _ factory ( ) queue = cl. commandqueue ( context ) # test data a = np. array ( [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ] ). astype ( np. float32 ) b = np. array ( [ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 ] ). astype ( np. float32 ) a _ gpu = cl _ array. to _... | [
0.5447846055030823,
-0.1405889242887497,
0.9670299291610718,
0.6824927926063538,
1.147315502166748,
0.6613643169403076,
0.84450364112854,
-0.5888835191726685,
0.06527647376060486,
-0.34760165214538574,
0.3221830427646637,
-0.3398352563381195,
0.03455810621380806,
0.6033040881156921,
1.04... |
def _ get _ hostname ( self, mg _ to _ query ) : hostname = self. config. gateway _ vip conn = self. vmem _ vip. basic if mg _ to _ query = = " mga " : hostname = self. config. gateway _ mga conn = self. vmem _ mga. basic elif mg _ to _ query = = " mgb " : hostname = self. config. gateway _ mgb conn = self. vmem _ mgb.... | [
-0.4643193483352661,
-0.14930301904678345,
0.5635569095611572,
-0.1610342115163803,
-0.663998544216156,
-0.267558753490448,
-0.34920161962509155,
-0.04794878140091896,
-0.49447405338287354,
0.965141236782074,
0.8801507353782654,
0.002582188230007887,
-0.7280254364013672,
-0.032519519329071... |
def remove _ table ( self, table ) : if not table. name in self. _ tables : raise valueerror ('cannot remove table % s from database because it does not exist'% table. name ) self. _ schema _ errors = none self. _ schema _ warnings = none self. _ tables. pop ( table. name, none ) | [
-0.09694242477416992,
0.9041557312011719,
0.2002338171005249,
0.32025155425071716,
0.2773647606372833,
0.16210325062274933,
0.031398579478263855,
0.15355165302753448,
0.4723546504974365,
-0.014797717332839966,
-0.42343661189079285,
0.2301141768693924,
-0.4062163829803467,
0.569830715656280... |
def info ( g ) : tic = time ( ) print ( " { 0 : > 15s } |'{ 1 : s }'". format ('graph ', g. name. replace ('_ ','-') ) ) multi = false for edge in g. edges ( ) : if g. number _ of _ edges ( edge [ 0 ], edge [ 1 ] ) > 1 : multi = true break print ( " { 0 : > 15s } |'{ 1 : s }'". format ('type ','= = ='if multi else'- - ... | [
0.5314997434616089,
-0.08112987875938416,
1.3091808557510376,
-0.6662943363189697,
-0.5258363485336304,
0.22495143115520477,
1.030444622039795,
-0.578394889831543,
-0.40762707591056824,
0.07024654746055603,
-0.13775502145290375,
0.08641432225704193,
0.6760479807853699,
-0.0875231996178627,... |
def read _ and _ clean _ csv ( csv _ name ) : with open ( f'{ csv _ name }. txt ', encoding ='utf8') as fin : reader = csv. reader ( fin ) header = next ( reader ) keys = { key : i for key, i in zip ( header, range ( len ( header ) ) ) } readerlist = [ line for line in reader ] for show in readerlist : show [ keys ['sh... | [
-0.6999412775039673,
-1.3192721605300903,
0.6774483323097229,
-0.7119646668434143,
-0.9244420528411865,
0.02618744783103466,
-0.979607343673706,
0.5833004117012024,
0.0653773620724678,
1.2446553707122803,
-0.380199134349823,
0.9186728000640869,
-0.29960161447525024,
0.30750763416290283,
... |
def getfile ( self, key, default = _ unset ) : fn = self. get ( key, default ) if fn = = " " or fn = = " - " : return fn fn = os. path. expanduser ( fn ) return fn | [
0.0014264967758208513,
0.5899948477745056,
0.5633835792541504,
0.708304762840271,
-0.012112114578485489,
-0.17517301440238953,
-0.26521027088165283,
0.07950808107852936,
-0.8419678211212158,
-0.8292198777198792,
1.1375892162322998,
-0.38408973813056946,
0.09522315859794617,
-0.326064318418... |
def _ validate ( attribute, data, code ) : if not data : raise valueerror ('data " { data } " cannot be empty. attribute " { attribute } " will not be modified.'" ". format ( data = data, attribute = attribute ) ) try : adapter _ class = _ adapters [ attribute ] except keyerror : # pragma : no cover raise valueerror ('... | [
-0.2608695328235626,
-0.07095114141702652,
0.6073907017707825,
-0.9129659533500671,
-0.467176228761673,
-0.5421333909034729,
-0.5536454319953918,
0.16913515329360962,
0.7206062078475952,
-0.1572808027267456,
0.7671706676483154,
0.9630580544471741,
0.7133297920227051,
0.09795386344194412,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.