text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def onehot ( y, n ) : return np. array ( [ 1 if y = = i else 0 for i in range ( n ) ] ) | [
-1.0138168334960938,
-0.28800591826438904,
0.2114250212907791,
1.1690962314605713,
0.8454879522323608,
-0.2945963740348816,
-0.18572735786437988,
-0.5755346417427063,
0.7649630308151245,
0.142794668674469,
-0.21710698306560516,
0.37569689750671387,
-0.2370602786540985,
0.7283623218536377,
... |
def createpullrequest ( self ) : git _ origin = self. _ git _ helper. getremoteorigin ( ) if not git _ origin. startswith ('https : / / github. com /') : print ('{ 0 : s } aborted - unsupported git remote origin : { 1 : s } '. format ( self. _ command. title ( ), git _ origin ) ) print ('make sure the git remote origin... | [
-0.08029913157224655,
0.34727543592453003,
0.8127391934394836,
-0.3149511516094208,
0.8438889980316162,
0.4868719279766083,
-0.1501407027244568,
-0.07741813361644745,
-0.7975225448608398,
-0.4517975151538849,
0.4163670241832733,
0.2036842405796051,
-0.7515883445739746,
0.5823836922645569,
... |
def train ( self, ) - > none : raise notimplementederror ( " please implement this method " ) | [
-0.9975143074989319,
0.10222332924604416,
0.38768938183784485,
0.7254399061203003,
0.6270827054977417,
0.7469161748886108,
0.9256462454795837,
0.6718167662620544,
-0.3291427195072174,
-0.702738881111145,
-1.0268934965133667,
0.3505505919456482,
0.34096139669418335,
0.2319137454032898,
-0... |
def generatehistoricalmetrics ( self, request, context ) : context. set _ code ( grpc. statuscode. unimplemented ) context. set _ details ('method not implemented!') raise notimplementederror ('method not implemented!') | [
-1.2151321172714233,
0.8593720197677612,
0.7697980403900146,
0.16971105337142944,
0.8398703932762146,
1.210911512374878,
0.9664652347564697,
0.11389247328042984,
-0.4858998656272888,
0.1632605344057083,
-0.09778223931789398,
1.4634392261505127,
-1.0465372800827026,
0.3916776776313782,
0.... |
def query ( self, query ) : msg = {'action':'query ','args': [ query ] } response = self. requester. send _ request ( msg ) return response | [
-1.3297358751296997,
0.1811990886926651,
0.14110621809959412,
0.44417092204093933,
0.20366312563419342,
-0.48087701201438904,
-0.6235564351081848,
-0.7127287983894348,
1.0883857011795044,
-0.3326928913593292,
0.5908781886100769,
0.7516582012176514,
-1.4403669834136963,
0.07466526329517365,... |
def test _ api _ can _ update _ user ( self ) : user = user. objects. get ( ) change _ user = {'first _ name':'something new'} res = self. client. patch ( reverse ('details ', kwargs = {'pk': user. id } ), change _ user, format ='json') self. assertequal ( res. status _ code, status. http _ 200 _ ok ) | [
-0.06542881578207016,
-0.07696988433599472,
0.6534037590026855,
-0.06683662533760071,
-0.054994381964206696,
1.0121452808380127,
-0.04536563903093338,
0.4491746425628662,
-0.13765878975391388,
-0.21793422102928162,
-0.9707162380218506,
-0.07634221017360687,
0.5431379675865173,
0.4407919049... |
def get _ json ( json _ file ) : json _ array = none if json _ file is none : return none try : f = open ( json _ file,'rb') json _ array = json. load ( f ) except exception as e : print ('failed to parse json file { } { } '. format ( json _ file, e ) ) return json _ array | [
-0.2650233507156372,
-1.4621236324310303,
0.4782758355140686,
-0.451227068901062,
-0.15855321288108826,
-0.14160194993019104,
0.6288155913352966,
-0.3886244297027588,
-0.3253503441810608,
0.46810585260391235,
-0.49885135889053345,
0.7453011870384216,
-0.3371851444244385,
0.6632553935050964... |
def takenutrient ( self, nutrient ) : self. heldnutrient = nutrient | [
0.3065042793750763,
-1.2754757404327393,
0.13247355818748474,
-0.6657519936561584,
-0.16506928205490112,
0.7552809715270996,
0.06892921030521393,
0.10654380172491074,
0.1414213627576828,
-0.8869159817695618,
-0.6847111582756042,
0.36695772409439087,
-0.6077028512954712,
-0.2899352610111236... |
def save ( self, file = none ) : self. configabouttosave. emit ( ) cfg = { } if file is not none : # todo : we assume here that this is a new config ; a " save to file " feature is not yet implemented. self. _ propertycollection. defineproperty ( " cfgfile ", str ( file ), " the absolute path to the configuration file.... | [
-1.228102207183838,
0.02686932682991028,
0.45130443572998047,
-0.22356417775154114,
-0.4852825403213501,
-0.741539716720581,
0.37280523777008057,
0.591178297996521,
-1.3076797723770142,
0.08794861286878586,
-1.173440933227539,
-0.8573144674301147,
-0.24477574229240417,
1.084126591682434,
... |
def commands ( self, engine ) : command _ list = ordereddict ( [ ( " q ", ( none, " 出 ", true ) ), ( " help ", ( engine. display _ help, " 示 ", true ) ), ( " begin ", ( engine. start, " ", true ) ), ( " x ", ( engine. coordinates, " 示 前 ", false ) ), ( " exit ", ( engine. exit, " 下 一 地 ", false ) ), ( " c ", ( engine. ... | [
-0.45775893330574036,
-0.0064599886536598206,
0.6561066508293152,
-0.4053179621696472,
-0.20206430554389954,
-0.048940837383270264,
0.16208958625793457,
-0.32875534892082214,
-0.5227725505828857,
0.3338130712509155,
-1.087314248085022,
-0.4718407094478607,
-0.12108207494020462,
0.376173228... |
def cmd _ help ( self, which = none ) : if which is none : print ('available namespaces') for obj in list ( get _ commands ( ). values ( ) ) : print ('', obj. ns. ljust ( 20 ),'- ', obj. descr ) elif which. find (':') < 0 : if which in get _ commands ( ) : obj = get _ commands ( ) [ which ] print ( which,'- ', obj. des... | [
0.7872710824012756,
-0.7557963728904724,
0.8691038489341736,
0.07301502674818039,
0.18109551072120667,
0.38485512137413025,
0.36633825302124023,
-0.6881864070892334,
-0.20628589391708374,
-0.35235047340393066,
0.46957167983055115,
1.2873108386993408,
0.5316466093063354,
1.0107187032699585,... |
def calculated _ field _ is ( data : dict, income _ statement _ cls : dict ) - > dict : global is _ cal _ index, year _ count _ is, is _ header _ mapping _ dict, km1, km4, km5, signage, is _ graph _ output, all _ neg global scenario _ flag _ is is _ header _ mapping _ dict ['cost of goods sold / cost of sales'] = [ ] p... | [
-0.051522206515073776,
-0.06810760498046875,
0.8582958579063416,
0.5279190540313721,
-0.3583267629146576,
0.17201384902000427,
0.4697708189487457,
0.17444224655628204,
0.19896772503852844,
0.3627084493637085,
-0.07337076216936111,
-0.06269609183073044,
0.27112215757369995,
-0.3821704685688... |
def calc _ h _ err ( ch, line ) : w = ch. refined _ box [ 2 ] - ch. refined _ box [ 0 ] thr = w * 0. 25 x, y = center _ of _ char ( ch ) xv = ( 1 - line [ 1 ] * y ) / line [ 0 ] if xv < ch. refined _ box [ 0 ] or xv > ch. refined _ box [ 2 ] : return none if abs ( xv - x ) > thr : return 1. else : return abs ( xv - x )... | [
0.5968111753463745,
-0.19132022559642792,
0.6379727125167847,
0.05065839737653732,
-0.1194930449128151,
0.21742716431617737,
-0.14111341536045074,
-0.738920271396637,
-0.36463186144828796,
-0.31786489486694336,
0.18748211860656738,
0.4870631992816925,
-0.3708229660987854,
-0.16411341726779... |
def getnewbrailleline ( clearbraille = false, addline = false ) : if clearbraille : braille. clear ( ) line = braille. line ( ) if addline : braille. addline ( line ) return line | [
0.7501958012580872,
-0.14160379767417908,
0.5032435655593872,
0.5695498585700989,
0.023129167035222054,
0.6464663743972778,
-1.5170708894729614,
-0.32663002610206604,
-0.14809797704219818,
-0.5379379391670227,
-0.23521848022937775,
0.7424740791320801,
-0.7867729067802429,
-0.00173898017965... |
def test _ in _ place _ update ( self ) : self. create _ volume _ objects ( index = 1 ) vg _ id = self. ep. search ( " volume _ groups ", name = " unittest _ vg1 " ). hits [ 0 ]. id tst _ desc = " tst _ desc " self. ep. new ( " volume _ groups ", id = vg _ id, description = tst _ desc ). save ( ) vg = self. ep. get ( "... | [
0.1254163235425949,
0.16649146378040314,
0.304060161113739,
-0.6275021433830261,
0.3499065637588501,
0.33549660444259644,
-0.9413050413131714,
0.26803550124168396,
-0.4545261859893799,
1.100771427154541,
0.18157611787319183,
0.4616287648677826,
-0.995988130569458,
0.03150264546275139,
-0... |
def push ( self ) : self. ptrpush = self. ptrread | [
0.33652517199516296,
0.16196604073047638,
0.338392972946167,
-1.0019930601119995,
1.1964564323425293,
0.3746888041496277,
0.2662127912044525,
-0.6811892986297607,
0.047186028212308884,
-0.14209377765655518,
0.9470295906066895,
1.1615206003189087,
-1.1625065803527832,
-0.20903156697750092,
... |
def peakpick ( self, mpf ) : return pk. indexes ( np. array ( self. i ), mpf, 7 ) | [
-0.7506680488586426,
-0.22802293300628662,
0.14378096163272858,
0.4620811343193054,
0.18463800847530365,
-0.17401650547981262,
0.9796357154846191,
0.7585349082946777,
0.33438944816589355,
0.8517681360244751,
-0.5780521631240845,
-0.20883704721927643,
-0.544863760471344,
-1.2367424964904785... |
def get _ flights ( self ) : all _ flights = [ ] delay = 15 try : webdriverwait ( self. driver _ data, delay ). until ( ec. presence _ of _ element _ located ( ( by. class _ name,'day - list - item') ) ) flights _ elemnt = self. driver _ data. find _ elements _ by _ class _ name ( " day - list - item " ) except timeout... | [
-0.4704534709453583,
0.10686418414115906,
0.9985607862472534,
-0.35812705755233765,
0.0239457618445158,
0.0928618386387825,
-0.340121865272522,
0.39155498147010803,
-0.5440583825111389,
-0.15113848447799683,
-1.0256813764572144,
-0.09667069464921951,
0.3839884400367737,
1.3751988410949707,... |
def _ _ init _ _ ( self, h = true, v = false, p = 0. 5 ) : self. horizontal = h self. vertical = v self. p = p | [
0.41639694571495056,
-0.02460602857172489,
0.4421623647212982,
0.7280313372612,
0.3890186846256256,
1.243501901626587,
-0.48197001218795776,
0.8001046180725098,
-1.1090121269226074,
0.43092840909957886,
-0.7466963529586792,
-0.3793926239013672,
-0.9733001589775085,
0.4077340066432953,
-0... |
def kp _ land ( dset, lf ) : assert hasattr ( dset,'lat'), f'no lat in data set, { dset. coords = }'assert len ( dset ['lat'] ) = = len ( lf ['lat'] ), f " no good! data : { len ( dset ['lat'] ) }, land : { len ( lf ['lat'] ) } " if np. count _ nonzero ( dset ['lat'] = = lf ['lat'] )! = len ( lf ['lat'] ) : print ( f "... | [
0.5300068259239197,
0.04614489525556564,
0.32116347551345825,
-0.8255398869514465,
-0.4862678349018097,
0.257110595703125,
-1.0205886363983154,
0.6447737812995911,
-0.06333674490451813,
-0.10171028226613998,
1.078794002532959,
0.07246718555688858,
0.10012436658143997,
-0.09661893546581268,... |
def step ( self, i _ t, x _ t, z _ t, z _ p, h _ p ) : return [ t. tanh ( z _ t + z _ p ) ] | [
0.21276089549064636,
-0.1685199737548828,
0.3598538935184479,
0.2481488734483719,
0.9267857670783997,
0.7882031202316284,
-0.2365819811820984,
0.6589128971099854,
-1.0370759963989258,
0.549403965473175,
-1.3686765432357788,
-0.9783397912979126,
-0.4734736979007721,
-0.7531154155731201,
-... |
def connect ( self, host ='localhost ', port = 0, source _ address = none ) : if source _ address : self. source _ address = source _ address if not port and ( host. find (':') = = host. rfind (':') ) : i = host. rfind (':') if i > = 0 : host, port = host [ : i ], host [ i + 1 : ] try : port = int ( port ) except value... | [
-0.23409229516983032,
-0.24837994575500488,
0.7708132266998291,
-0.3349234163761139,
0.053885962814092636,
-0.6801344752311707,
0.05884386599063873,
0.16122759878635406,
-0.5916081070899963,
0.2631034553050995,
-0.009503265842795372,
0.31076309084892273,
-0.35311055183410645,
0.29129633307... |
def maybe _ write _ and _ plot ( self, global _ step, * args, * * kwargs ) : if self. _ plot _ schedule ( global _ step ) : self. write ( ) self. plot ( * args, * * kwargs ) | [
0.002852049423381686,
0.2965881824493408,
0.4613704979419708,
0.6174004673957825,
-0.05546563118696213,
0.04402465000748634,
0.7576394081115723,
0.24486775696277618,
-0.30322983860969543,
-0.5137460827827454,
0.3036126494407654,
0.6934426426887512,
-0.047838836908340454,
0.8987155556678772... |
def append _ path ( self, typ, append _ to _ num, path, with _ sign = 1 ) : old _ path = self. path _ coordinates ( typ, append _ to _ num ) old _ path + = with _ sign * path | [
-0.7310693860054016,
-0.5247386693954468,
0.5777608156204224,
0.8209669589996338,
-0.07142767310142517,
0.1689019799232483,
0.4828752279281616,
-0.24811388552188873,
0.43295642733573914,
-0.27094849944114685,
0.33223575353622437,
-0.3838508725166321,
0.013749425299465656,
-0.16471998393535... |
def get _ backbone ( backbone _ model _ name : str ) : if backbone _ model _ name = = " mobilenetv2 " : model : mobilenetv2 = mobilenet _ v2 ( pretrained = true ) feature _ size = 1280 else : raise valueerror return model. features, feature _ size | [
-0.035876303911209106,
0.1709090769290924,
0.36456918716430664,
0.4884013831615448,
0.2360568642616272,
-0.44445592164993286,
-0.3963049650192261,
-0.12280512601137161,
0.2608838975429535,
0.1303875893354416,
-0.9815769791603088,
0.21304939687252045,
-0.2145850956439972,
0.3756012916564941... |
def get _ group _ name _ nonetrick ( self, group _ name = none ) : groups = self. m [ " groups " ] if ( len ( groups ) = = 0 ) : raise exception ( " cannot find any groups in metadata " ) if ( not group _ name ) : if ( len ( groups ) > 1 ) : raise exception ( " we have more than one payment group in metadata, so group ... | [
-0.36112692952156067,
1.2416905164718628,
0.44644463062286377,
-0.20443154871463776,
0.02080574259161949,
-0.6617560386657715,
-0.3443674147129059,
-0.5024577379226685,
-0.2772901654243469,
0.15573298931121826,
1.4089422225952148,
0.21759581565856934,
-0.3589569926261902,
1.270100355148315... |
def reset _ monitors ( self ) - > none : for key in list ( self. monitors. keys ( ) ) : self. monitors [ key ]. reset _ dependencies ( ) | [
-1.0116691589355469,
-0.14781658351421356,
0.21955768764019012,
0.22816111147403717,
1.0157580375671387,
0.1967276781797409,
0.6925898194313049,
-0.8913945555686951,
-0.3010850250720978,
0.5444413423538208,
-0.6149648427963257,
0.7485363483428955,
-0.5169572234153748,
0.9117312431335449,
... |
def bounded _ lemire _ uint64 ( bitgen, rng ) : rng _ excl = uint64 ( rng ) + uint64 ( 1 ) assert ( rng! = 0xffffffffffffffff ) x = next _ uint64 ( bitgen ) leftover = uint64 ( x ) * uint64 ( rng _ excl ) if ( leftover < rng _ excl ) : threshold = ( uint64 _ max - rng ) % rng _ excl while ( leftover < threshold ) : x =... | [
0.04524372145533562,
0.15362069010734558,
0.7610288858413696,
-0.3711227774620056,
-0.9956932663917542,
0.6247738003730774,
-0.3942088782787323,
0.10944755375385284,
0.7463716864585876,
-0.32054731249809265,
-0.0404234379529953,
0.11445127427577972,
-0.6693432331085205,
0.4615648090839386,... |
def do _ get _ volumes ( self, args ) : global token global pp headers = { " region " : datacenter, " x - auth - token " : token } custom _ url = dct [ datacenter ] +'/ volumes'r = requests. get ( custom _ url, headers = headers ) if r. status _ code = = 200 : global pp pp. pprint ( r. json ( ) ) print ( " number of vo... | [
-0.04930206760764122,
0.0022079560440033674,
0.6881480813026428,
-0.1180897206068039,
0.572285532951355,
-0.5986148715019226,
-0.31377843022346497,
-0.003825579071417451,
0.187863290309906,
-0.4717470109462738,
0.09945984929800034,
0.9927793145179749,
-0.02568710595369339,
-0.0954922512173... |
def test _ connection ( self ) : if not self. is _ connected ( ) : return false # send query for reading version of protocol try : self. get _ protocol _ version ( ) except btle. btleexception : self. disconnect ( ) return false except brokenpipeerror : # bluepy - helper died self. connection = none return false return... | [
-0.6031215190887451,
-0.41548213362693787,
0.6250918507575989,
-0.09200946986675262,
0.19824081659317017,
0.27787381410598755,
-0.42434161901474,
-0.42122313380241394,
-1.0287104845046997,
0.32527393102645874,
0.3244777023792267,
-0.9786906242370605,
-1.4049898386001587,
-0.995519697666168... |
def transcribe _ stream ( self, audio _ stream : typing. iterable [ bytes ], sample _ rate : int, sample _ width : int, channels : int, ) - > typing. optional [ transcription ] : if self. model _ type = = kaldimodeltype. nnet3 : # use online2 - tcp - nnet3 - decode - faster if not self. decode _ proc : self. start _ de... | [
0.7774925231933594,
-0.819781482219696,
0.7476798295974731,
0.2883520722389221,
0.14855585992336273,
-0.7003069519996643,
-0.3281276524066925,
-0.33977746963500977,
-0.4748607575893402,
0.5772448778152466,
0.22801153361797333,
0.23995903134346008,
-0.03828912228345871,
0.9167119860649109,
... |
def resource ( model, id ) : code = 200 if request. method = = " patch " : model. set ( id, request. get _ json ( ) ) code = 201 result = model. get ( id ) if not result : return abort ( 404 ) return odump ( result ), code | [
-0.9515506029129028,
-0.5871953964233398,
0.572266161441803,
-0.5837550163269043,
-0.5218231678009033,
0.12322444468736649,
-0.5204058289527893,
-0.051239192485809326,
0.5715218186378479,
0.7549500465393066,
0.17568086087703705,
0.475920706987381,
0.06363345682621002,
0.06068632751703262,
... |
def clamp _ tensor ( tensor, minimum, maximum ) : if tensor. is _ sparse : coalesced _ tensor = tensor. coalesce ( ) # pylint : disable = protected - access coalesced _ tensor. _ values ( ). clamp _ ( minimum, maximum ) return coalesced _ tensor else : return tensor. clamp ( minimum, maximum ) | [
0.6796145439147949,
-0.1839374452829361,
0.286956250667572,
0.17334911227226257,
0.024814028292894363,
0.3003430664539337,
-1.1260989904403687,
-0.6897572875022888,
-0.23185698688030243,
-0.04496834799647331,
0.03539900854229927,
0.8762387037277222,
0.5207657814025879,
-1.2134100198745728,... |
def _ get _ default _ sample _ dim ( objects ) : is _ xarray _ input = _ check _ either _ all _ xarray _ or _ plain _ arrays ( objects ) if not is _ xarray _ input : # by default, assume the leading dimension is the sampling # dimension return 0 for obj in objects : if is _ xarray _ object ( obj ) : try : sample _ dim ... | [
0.2915838658809662,
-0.07576249539852142,
0.7698127627372742,
1.006859540939331,
-0.32002246379852295,
-0.2682075500488281,
0.5051812529563904,
-0.6684659719467163,
-0.30585649609565735,
0.7111788392066956,
-0.006481690797954798,
-0.32433417439460754,
-0.6350758075714111,
0.789320945739746... |
def build ( self, storage _ dir, environment = none, output _ to _ file = true ) : # create our temporary directory name = self. _ xpd. name self. _ work _ dir = tempfile. mkdtemp ( suffix ='- xpkg - install -'+ name ) # todo : make this a hash of something meaning, full pad _ hash = util. hash _ string ( name ) instal... | [
-0.8392307162284851,
-0.5153471827507019,
0.800373911857605,
1.2031002044677734,
0.5296750068664551,
-0.3496502935886383,
0.02825624868273735,
0.1355692744255066,
-0.27519509196281433,
0.29643750190734863,
-0.17599272727966309,
-0.7954367995262146,
0.08813478797674179,
0.024173637852072716... |
def test _ get _ github _ login ( self ) : pass | [
-0.27047449350357056,
-0.007431678473949432,
0.1681988537311554,
1.5447543859481812,
0.5455200672149658,
0.4957752227783203,
0.9310418367385864,
0.21367274224758148,
-0.05333591252565384,
-0.969467282295227,
-0.23423247039318085,
0.8617767095565796,
-0.7010287046432495,
-0.6703382730484009... |
def get _ roi _ center ( roi _ native _ path, roi _ mni _ path ) : # computations in native space if type ( roi _ native _ path ) is str : img = nib. load ( roi _ native _ path ) else : img = roi _ native _ path data = img. get _ data ( ) data = as _ ndarray ( data ) my _ map = data. copy ( ) center _ coords = ndimage.... | [
0.6264619827270508,
-1.4165847301483154,
0.8350947499275208,
-0.2980613708496094,
-0.3896598517894745,
-0.05939723923802376,
-0.3531789779663086,
0.5484028458595276,
0.02741076610982418,
0.7373706102371216,
0.3504158854484558,
-0.14728952944278717,
-0.29450610280036926,
0.6946451663970947,... |
def print _ banner ( ) : print _ green ( " / / / / / / / / / / / / / / / / / / / / / " ) print _ green ( " / / s l y t h e r / / / / " ) print _ green ( " / / / / / / s e r v e r / / " ) print _ green ( " / / / / / / / / / / / / / / / / / / / / / " ) | [
0.8779914379119873,
-0.20763298869132996,
1.0723469257354736,
0.5987913608551025,
0.46181562542915344,
1.5081496238708496,
-0.6391551494598389,
0.06409347057342529,
-0.7722212672233582,
-0.5735345482826233,
-0.5961158275604248,
0.8817266821861267,
0.09327120333909988,
0.9638799428939819,
... |
def set _ debuglevel ( self, debuglevel ) : self. debuglevel = debuglevel | [
0.18459291756153107,
-0.11801892518997192,
0.21533863246440887,
0.14576707780361176,
0.006325907073915005,
0.617026150226593,
-0.11103243380784988,
-0.691510021686554,
-0.07118076831102371,
-0.03165946900844574,
-1.1560503244400024,
0.30592262744903564,
-0.36724287271499634,
0.697438001632... |
def pytest _ collection _ modifyitems ( items, config ) : sanity = config. getoption ('- - sanity ', false ) non _ interactive = config. getoption ('- - non - interactive ', false ) remaining = [ ] deselected = [ ] for item in items : if _ skip _ item ( item, sanity, non _ interactive ) : deselected. append ( item ) el... | [
-0.8568815588951111,
-0.3478626012802124,
0.6817532181739807,
0.28636547923088074,
1.7119746208190918,
0.8486396074295044,
0.9884241223335266,
0.35569968819618225,
0.508892297744751,
0.6006250381469727,
-0.2817178964614868,
-0.4606857895851135,
-0.8838225603103638,
-0.03085458092391491,
... |
def set _ session ( self, session ) : self. _ session = session | [
-0.648876428604126,
-0.24124756455421448,
-0.05457114800810814,
-0.0417618602514267,
0.663652777671814,
0.1041858047246933,
0.7558247447013855,
-0.2649366855621338,
0.8530848026275635,
-0.7247018814086914,
-1.2971389293670654,
0.5380231142044067,
0.333229124546051,
0.238440603017807,
0.4... |
def on _ error ( self, message ) : self. _ logger. error ( " error occurred " % message ) | [
0.061017557978630066,
-0.07254799455404282,
0.36844632029533386,
0.367793470621109,
-0.019836636260151863,
-0.21643616259098053,
0.30828437209129333,
0.217876136302948,
-0.11587769538164139,
0.1918543577194214,
-0.52655428647995,
0.4365122318267822,
-0.08446488529443741,
0.5212329626083374... |
def _ status _ str ( self, status ) : for status _ pair in self. status : if status = = status _ pair [ 0 ] : return status _ pair [ 1 ] return none | [
0.03550845384597778,
-1.4166353940963745,
0.43440571427345276,
-0.0036865733563899994,
-1.1079126596450806,
-0.46650975942611694,
-0.9252979159355164,
-0.7251273393630981,
-0.14652663469314575,
0.5700804591178894,
0.6511374711990356,
-0.2241351157426834,
-0.30140262842178345,
-0.8916732072... |
def makemove ( self, player, pos ) : if self. board [ pos ] = = " * " : # checks to see if a move has been made already self. board [ pos ] = player self. count + = 1 return true else : return false | [
-0.6077916026115417,
0.35697147250175476,
0.8071087598800659,
0.1174895241856575,
-0.20501379668712616,
-0.003541629295796156,
-0.5580660700798035,
0.5887942910194397,
-0.2893264889717102,
0.042093560099601746,
-0.45365744829177856,
-0.9874780774116516,
-0.7744136452674866,
-0.451710522174... |
def split _ rendered _ audio ( self, path = none ) : if path is none : path = self. wavfile if not path or not os. path. exists ( path ) : raise ioerror ( ". wav file not found! cannot split " ) labels = self. _ get _ receivers _ labels ( ) return snd. split _ channels ( self. wavfile, labels ) | [
-0.5587957501411438,
-0.15290255844593048,
0.7347100973129272,
-0.7256706357002258,
-0.04892570525407791,
0.38211551308631897,
0.977112889289856,
0.22517864406108856,
0.49169278144836426,
-0.573108434677124,
0.22559309005737305,
0.3111025094985962,
-1.0072404146194458,
-0.25769293308258057... |
def generate _ a ( self, i ) : return 2 - i * ( 2 / self. iterations ) | [
-1.167800784111023,
0.07914784550666809,
0.3285571038722992,
-0.17547132074832916,
-0.5764991641044617,
0.5839530825614929,
1.3724815845489502,
-0.3000212609767914,
-0.3051970899105072,
-0.18478739261627197,
-0.025953155010938644,
-0.25985386967658997,
-0.3162846863269806,
0.28350618481636... |
async def download _ many ( self ) : semaphore = asyncio. semaphore ( self. concur _ req ) # _ _ aenter _ _ for. acquire ( ), _ _ aexit _ _ for. release ( ) results = [ ] async with aiohttp. clientsession ( ) as session : # self. data. append ('error') # testing exceptions handling coros = [ self. download _ one ( sess... | [
-0.41439691185951233,
-0.2165512889623642,
0.7753222584724426,
0.5667417049407959,
0.542343020439148,
-0.325099915266037,
-0.6056838631629944,
0.24708464741706848,
0.05817277356982231,
0.060713257640600204,
-0.004633804317563772,
-0.49525684118270874,
-0.04967730492353439,
1.29976081848144... |
def mcwd _ composite _ map ( mcwd _ exp, map _ exp, mcwd _ ctl, map _ ctl, save = none, save _ table = none ) : # noqa # get dimensions ntim, nlat, mlon = mcwd _ exp. shape # get significant differences for both d1 = analysis. get _ significant _ diff ( map _ exp, map _ ctl, eqvar = false ) d2 = analysis. get _ signifi... | [
-0.36215370893478394,
-0.8312296271324158,
0.9190859198570251,
-0.5249727368354797,
-0.2925349175930023,
0.9641874432563782,
1.103468894958496,
0.4361366629600525,
0.6024165153503418,
0.24413900077342987,
0.6324847936630249,
0.1978360414505005,
0.008348969742655754,
0.4447498619556427,
0... |
def editmenu ( self ) : self. printmenu ( ) datesofdays = dict ( ) # create answers for a cl menu for idx, day in enumerate ( self. days ) : datesofdays [ str ( idx ) ] = formatdatestring ( day. date ) daypicker = multimenu ( datesofdays ) daypicker. question ='valitse paiva, jonka ateriaa / aterioita haluat muokata :'... | [
-1.042780876159668,
-0.10963738709688187,
0.6474037766456604,
-0.3479291796684265,
0.20267072319984436,
-0.007183969486504793,
0.2714734375476837,
0.18203094601631165,
0.22770944237709045,
-1.193943738937378,
-0.04639764502644539,
0.7500861287117004,
0.7275123596191406,
0.8333448171615601,... |
def _ layout _ info ( self ) : layout = super ( container, self ). _ layout _ info ( ) layout ['share _ layout'] = self. share _ layout layout ['padding'] = self. padding return layout | [
0.7613180875778198,
-0.06955172121524811,
0.4305529296398163,
-0.11442318558692932,
-0.08922088891267776,
0.11238811910152435,
0.7897658944129944,
-0.36137720942497253,
-0.34317582845687866,
-0.44389599561691284,
-0.4679489731788635,
-0.5790013074874878,
0.8121556043624878,
0.3097031712532... |
def getloginlink ( self ) : if users. get _ current _ user ( ) : url = users. create _ logout _ url ( self. request. uri ) url _ linktext ='logout'else : url = users. create _ login _ url ( self. request. uri ) url _ linktext ='login'return ( url, url _ linktext ) | [
-1.1667654514312744,
-0.8900570869445801,
0.5361769199371338,
0.40962591767311096,
-0.010835575871169567,
0.34262391924858093,
-0.48802685737609863,
0.6732619404792786,
0.47307249903678894,
-0.5704092383384705,
0.14454412460327148,
0.4350053668022156,
-0.5802757740020752,
-0.10931882262229... |
def create _ playlist ( self, name ) : data = { " name " : name } url = " users / { } / playlists ". format ( self. user _ id ( ) ) resp = self. post _ api _ v1 ( url, data = data ) self. get _ user _ playlists ( self. get _ user ( ), force _ clear = true ) return playlist ( resp ) | [
-0.12752707302570343,
-0.16321006417274475,
0.45516058802604675,
0.7346381545066833,
-0.13968132436275482,
0.4050099849700928,
-0.16740450263023376,
-1.4718488454818726,
0.5625867247581482,
0.38555243611335754,
-0.95714271068573,
0.4763937294483185,
-0.8868995904922485,
-0.7362194657325745... |
def choixcouleurjoueur1 ( ) : choix = colorchooser. askcolor ( title = " choisissez une couleur " ) joueur1 ['couleur'] = choix [ 1 ] # on applique le code couleur hexadecimal choisi entrynomjoueur1 ['fg'] = joueur1 ['couleur'] # on applique la couleur choisie au nom du joueur | [
-0.496600478887558,
-0.7678672671318054,
0.4649297893047333,
0.2491084188222885,
-0.6549348831176758,
0.534756600856781,
-0.1911303699016571,
0.06192963570356369,
-0.688862681388855,
0.25698983669281006,
-0.9177085161209106,
0.6214110255241394,
0.2908392548561096,
0.4723956286907196,
0.5... |
def start ( self, func, * args ) : return get _ kernel ( ). run ( self. astart, func, args ) | [
-0.20607998967170715,
-0.3011094033718109,
0.37661653757095337,
0.5590419173240662,
0.40200743079185486,
-0.9539949893951416,
0.10659459233283997,
0.4318644404411316,
-0.28660139441490173,
-0.4204205274581909,
0.43912360072135925,
0.983086884021759,
0.3506774604320526,
0.555832028388977,
... |
def refresh ( self ) : self. _ get _ schedule _ properties ( ) | [
-0.27063438296318054,
-0.7169613838195801,
0.20272576808929443,
0.8691819906234741,
-0.6152940392494202,
-0.32547295093536377,
-0.7246209979057312,
-0.3119119107723236,
-0.6160654425621033,
0.21941614151000977,
0.39589938521385193,
0.9114038944244385,
0.19323821365833282,
-0.61022824048995... |
def agg _ year _ df ( df, agg _ f, index _ ='datetime') : days = sorted ( list ( set ( [ i [ : 10 ] for i in df [ index _ ]. values ] ) ) ) df _ = df. copy ( ) df _ [ index _ ] = [ i [ : 10 ] for i in df _ [ index _ ]. values ] df _ = df _. set _ index ( index _ ) data = [ ] for i in days : val = [ ] for j in df _. col... | [
-0.10095740109682083,
1.3925180435180664,
0.8574343919754028,
-0.41924116015434265,
0.23187381029129028,
-0.07761968672275543,
0.2127087265253067,
0.42719200253486633,
-0.12372385710477829,
0.32361742854118347,
0.5180196166038513,
0.708846390247345,
0.8973628282546997,
-0.3426781892776489,... |
def get _ tstats ( stim _ events, pairs, start _ time, duration, return _ pvalues = false, before _ experiment = true, ) : stim _ duration = 0. 500 if before _ experiment : # only use stim events from artifact detection period stim _ events = stim _ events [ stim _ events ['list'] = = - 999 ] if len ( stim _ events ) <... | [
0.28911399841308594,
0.18568657338619232,
0.7868093252182007,
-0.6628789305686951,
-0.5129857063293457,
-0.21066035330295563,
0.4665372669696808,
0.39265188574790955,
0.01768416538834572,
1.4163625240325928,
0.15566271543502808,
0.3390171229839325,
-0.4802911877632141,
-0.5108333826065063,... |
def test _ example _ input _ two _ add _ close _ entity ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) input _ page. create _ new _ input. select ( " example input two " ) input _ page. entity2. examp... | [
-0.12422426044940948,
-0.07879198342561722,
0.6902193427085876,
0.4580332338809967,
0.1861429363489151,
1.3376219272613525,
0.012095918878912926,
-0.5231738686561584,
0.21243621408939362,
-0.038853470236063004,
0.11730779707431793,
-0.0997314602136612,
0.08972741663455963,
0.35593336820602... |
def do _ test _ token ( self, args ) : global token headers = { " content - type " : " application / json ", " x - auth - token " : token } custom _ url = url _ act +'/ tokens /'+ token r = requests. get ( custom _ url, headers = headers ) if r. status _ code = = 200 : global pp pp. pprint ( r. json ( ) ) return true e... | [
-0.41319963335990906,
0.21664194762706757,
0.4903319180011749,
-0.4366688132286072,
0.4500264823436737,
0.16662827134132385,
0.06408102810382843,
0.1413954645395279,
0.6741592884063721,
-0.6448163390159607,
-0.39051398634910583,
1.3120609521865845,
-0.08064169436693192,
-0.2219925969839096... |
def rebin _ 2d ( a, ysize, xsize ) : yfactor, xfactor = np. asarray ( a. shape ) / np. array ( [ ysize, xsize ] ) return a. reshape ( ysize, int ( yfactor ), xsize, int ( xfactor ), ). mean ( 1 ). mean ( 2 ) | [
-0.4990164041519165,
-0.3496567904949188,
0.666443943977356,
0.2752586007118225,
-0.27227669954299927,
-0.515332818031311,
0.6699883341789246,
-0.02518361434340477,
0.41087162494659424,
0.014479507692158222,
-0.09278590232133865,
1.1173834800720215,
0.5101222991943359,
0.2334422618150711,
... |
def select _ chat ( directory ='data /') : default _ chat ='sample. txt'chat _ list = { } with path ( directory ) as dir _ path : # the path ( ) object will convert forward slashes into the # correct kind of slash for the current operating system. id = 0 for entry in dir _ path. iterdir ( ) : if entry. is _ file ( ) an... | [
-0.3690311312675476,
-0.17341016232967377,
0.6000927686691284,
0.22011439502239227,
-0.5642684102058411,
-0.14930972456932068,
1.3435165882110596,
-0.6961795091629028,
-0.7458589673042297,
0.06910689175128937,
0.24550192058086395,
0.5271921157836914,
-0.1440587341785431,
0.5916382670402527... |
def testinitfuncwithparams ( self ) : def cb ( e = none ) : self. passed = self. passed and e is none def check ( param1, param2 ) : return true def init ( a, b ) : self. passed = a and b checkfunc = functioncall ( check, {'param1':'non - empty string ','param2':'asdfasdf'} ) initfunc = functioncall ( init, {'a':'str '... | [
-0.20059585571289062,
-0.07889848947525024,
0.6296579241752625,
0.24052301049232483,
0.6656861305236816,
0.21295714378356934,
-0.20624850690364838,
-0.19872726500034332,
-0.9738802313804626,
-0.3581693172454834,
-0.2645123302936554,
0.797686755657196,
0.2901202440261841,
0.5593467950820923... |
def netinfo _ geolocation ( self, ipaddress ) : endpoint = " { } / { } ". format ( self. ep _ netinfo _ geolocation, ipaddress ) return self. _ make _ request ( endpoint = endpoint ) | [
-0.5921327471733093,
0.847000241279602,
0.6513194441795349,
-0.22460365295410156,
0.11622750759124756,
-0.15452249348163605,
-0.08775313943624496,
-0.7424125075340271,
0.32999923825263977,
0.2320309728384018,
-0.4067932665348053,
-0.139029860496521,
0.13394634425640106,
-0.4361014366149902... |
def read _ word _ model ( word _ model _ file ) : with open ( word _ model _ file ) as fin : return fin. readline ( ) | [
0.45808854699134827,
-0.3910283148288727,
0.3207584023475647,
-0.16296516358852386,
-0.6069465279579163,
1.169783592224121,
0.025056838989257812,
0.28096523880958557,
-1.2443459033966064,
1.0810719728469849,
-0.05835559964179993,
0.43256819248199463,
-0.44795405864715576,
-0.43282625079154... |
def add ( self, user ) : if ( user. add ( ) is none ) : self. _ _ logger. debug ( " adding user % s to list " % user ) self. _ _ userlist [ user. user _ id ] = user return none else : return 1 | [
-1.2421613931655884,
0.4241657257080078,
0.6901295185089111,
0.7973049283027649,
-0.06696226447820663,
0.30120301246643066,
0.015057428739964962,
0.05786178633570671,
0.9512988328933716,
-0.33364662528038025,
-1.069834589958191,
-0.37486642599105835,
-1.1729646921157837,
1.0672521591186523... |
def check _ realms ( self, realms ) : return all ( ( r in self. realms for r in realms ) ) | [
0.11673502624034882,
-0.34697282314300537,
0.3989032506942749,
0.2215738743543625,
0.09966056793928146,
0.8884737491607666,
-0.7270147204399109,
0.21285265684127808,
-0.0731087327003479,
0.17565327882766724,
0.9232954978942871,
0.060766421258449554,
-1.319150686264038,
1.1381630897521973,
... |
def load _ bookmarks _ threaded ( self ) : threads = [ ] self. _ bookmarks = [ ] for page in range ( self. _ bookmarks _ pages ) : threads. append ( self. _ load _ bookmarks ( page = page + 1, threaded = true ) ) for thread in threads : thread. join ( ) | [
-0.06905002146959305,
0.43579551577568054,
0.5124896168708801,
0.3476516306400299,
1.1846275329589844,
-0.102879598736763,
0.41677117347717285,
-0.5275055170059204,
-0.4241838753223419,
-0.06686440110206604,
-0.6484401822090149,
0.372148722410202,
-0.8409625887870789,
0.5556948781013489,
... |
def choosebytype ( self, foodtype ) : res = con. session. query ( dish ). all ( ) query = session. query ( dish ). filter ( dish. foodtype = = foodtype ) dishoptions = dict ( ) for idx, dish in enumerate ( res ) : dishoptions [ str ( idx ) ] = dish. name dishoptions ['w'] ='kirjoita itse'dishmenu = multimenu ( dishopti... | [
-0.3807155191898346,
0.20596158504486084,
0.6571800708770752,
0.741898238658905,
-0.3576667904853821,
-0.3682224452495575,
-0.019682329148054123,
-0.853283166885376,
0.6328368782997131,
-0.07912294566631317,
0.009406720288097858,
0.7364959716796875,
0.18871788680553436,
1.4367380142211914,... |
def trigger ( self, value = none ) : if self. _ step _ triggered : return try : for action in self. current _ step. get ('actions ', [ ] ) : if self. mudpi. actions. exists ( action ) : _ data = value or { } self. mudpi. actions. call ( action, action _ data = _ data ) except exception as e : logger. log ( log _ level ... | [
-1.6495795249938965,
-0.24317115545272827,
0.24762164056301117,
0.5245765447616577,
0.3181436359882355,
-0.8598266839981079,
0.21594972908496857,
0.3478412926197052,
-0.29532772302627563,
0.16213145852088928,
-1.0153019428253174,
0.07511456310749054,
-0.31920990347862244,
0.982925057411193... |
def parse _ request _ body _ response ( self, body, scope = none ) : self. token = parse _ token _ response ( body, scope = scope ) self. _ populate _ attributes ( self. token ) return self. token | [
-0.9992821216583252,
-0.6760890483856201,
0.38268449902534485,
-0.3254392445087433,
0.2866043150424957,
-0.27920353412628174,
-0.24008314311504364,
0.34157565236091614,
1.3882871866226196,
-0.766694962978363,
-0.9182690978050232,
0.06080000847578049,
-0.04228408634662628,
-0.92946630716323... |
def arcsinh ( x ) : try : return variable ( x. name, np. arcsinh ( x. val ), { k : v / np. sqrt ( 1 + x. val * * 2 ) for ( k, v ) in x. der. items ( ) }, false ) except attributeerror : return np. arcsinh ( x ) | [
0.8745503425598145,
0.4829447269439697,
0.6094039082527161,
0.11933980137109756,
-1.2772423028945923,
0.36064547300338745,
-0.7925751805305481,
-0.5534825325012207,
0.3919728398323059,
-0.24809584021568298,
-0.291230708360672,
0.8132016062736511,
0.5320791006088257,
-0.4484136700630188,
... |
def insert ( self, table, * * kw ) : c1 ='('+ ', '. join ( [':'+ k for k, v in kw. items ( ) ] ) +')'c2 ='('+ ', '. join ( [ k for k, v in kw. items ( ) ] ) +')'try : self. cursor. execute ( " " " insert or replace into " " " + table +'' + c2 + " values " + c1, kw ) except exception as err : print'error ','\ n'print er... | [
-0.4707868993282318,
0.45331767201423645,
0.8399602770805359,
-0.23424331843852997,
-1.010216236114502,
-0.031272970139980316,
-0.6505035161972046,
0.5448276996612549,
-0.6898040771484375,
0.031252555549144745,
0.07394129037857056,
-0.3592090606689453,
-1.4793760776519775,
0.38287520408630... |
def buffered _ bounded _ lemire _ uint32 ( bitgen, rng ) : rng _ excl = uint32 ( rng ) + uint32 ( 1 ) assert ( rng! = 0xffffffff ) # generate a scaled random number. m = uint64 ( next _ uint32 ( bitgen ) ) * uint64 ( rng _ excl ) # rejection sampling to remove any bias leftover = m & 0xffffffff if ( leftover < rng _ ex... | [
0.38980698585510254,
0.5332566499710083,
0.8439696431159973,
-0.9871104955673218,
-0.8563253879547119,
1.1927381753921509,
-0.5429116487503052,
-0.019503243267536163,
0.335941344499588,
-0.8455767035484314,
-0.7288320660591125,
0.20721770823001862,
-0.7048496007919312,
0.3422496020793915,
... |
def flush ( self, _ fh ) : raise typeerror ( " block. flush not implemented " ) | [
-0.20862753689289093,
-0.05043483152985573,
0.37831827998161316,
0.6466667652130127,
-0.07805156707763672,
1.2199469804763794,
0.9836167693138123,
-0.1283702552318573,
-1.0307353734970093,
0.15613795816898346,
-0.4068796634674072,
0.7595729231834412,
-0.3977997303009033,
1.8362025022506714... |
def _ check _ off _ diagonal ( self ) : if self. _ row + self. _ col = = 2 : total = sum ( [ self. _ letter _ dict [ self. _ game _ state. board [ off _ diagonal _ indexing ] [ 2 - off _ diagonal _ indexing ] ] for off _ diagonal _ indexing in range ( 3 ) ] ) if abs ( total ) = = 3 : winning _ letter = self. _ game _ s... | [
-1.06577730178833,
0.3791443109512329,
0.7339087724685669,
-0.36535996198654175,
-1.012272596359253,
0.7672570943832397,
0.08511576056480408,
-0.01564721204340458,
0.18625156581401825,
0.5541505217552185,
-0.2483740895986557,
0.0243240799754858,
0.19539470970630646,
-0.7448751330375671,
... |
def get _ cover _ state ( self, cover _ id : str ) - > cover : if self. _ state _ by _ endpoint is not none : return self. _ state _ by _ endpoint [ cover _ id ] raise homeassistanterror ( " unknown cover " ) | [
0.14351432025432587,
-0.42652884125709534,
0.26172441244125366,
1.0440804958343506,
-0.3924367129802704,
-0.3127455711364746,
-0.22782553732395172,
-1.2154393196105957,
0.9695703387260437,
-0.12573248147964478,
0.2462054342031479,
-0.1301352083683014,
-0.5053724050521851,
0.449568063020706... |
def createuploadtask ( self, extent ) : return swiftuploadtask ( self, extent ) | [
-0.034965161234140396,
-0.3136575222015381,
0.7723646759986877,
0.07147905230522156,
-0.19382455945014954,
0.5183209776878357,
-0.9905359148979187,
-0.3451690673828125,
-0.8698863387107849,
0.37771469354629517,
-1.1419668197631836,
0.22118055820465088,
-0.7909880876541138,
-0.2372346520423... |
def isotope _ switch _ recursively ( self, switch, stop _ switch = none ) : self. isotope _ switch _ as _ far _ as _ possible ( switch ) for cusp in self. _ small _ tt. outgoing _ cusps ( switch ) : if self. is _ cusp _ collapsed ( cusp ) : # if a cusp is collapsed, there is no way to isotope further. return # if no cu... | [
-0.6329431533813477,
0.1071920245885849,
0.6134659647941589,
0.44027572870254517,
-0.8914464712142944,
0.35775652527809143,
0.5413416028022766,
-0.6680908203125,
-0.2497175931930542,
-0.26038533449172974,
-0.14591263234615326,
-0.8743276000022888,
-0.3973125219345093,
-0.21053546667099,
... |
def stop _ page ( self ) : # self. ui. webview. stop ( ) df = pd. dataframe ( ['text to copy'] ) df. to _ clipboard ( index = false, header = false ) print ( df ) | [
-1.122941255569458,
0.2562197744846344,
0.4417596757411957,
-0.3778708279132843,
-0.5335508584976196,
0.8156364560127258,
0.6138345003128052,
0.1128038838505745,
-0.7274031043052673,
0.6633930206298828,
0.7676486968994141,
0.5833527445793152,
-0.100904181599617,
-0.8367308974266052,
-0.1... |
def test _ atomic _ hex _ binary _ min _ length _ 4 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ min _ length _ 5 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - minlength - 5. xsd ", instance ... | [
0.2634147107601166,
-0.3721086084842682,
0.38500311970710754,
0.38463902473449707,
-0.3417068123817444,
0.10524241626262665,
-0.32341551780700684,
-0.6115625500679016,
-0.05071379616856575,
0.20952706038951874,
-0.8334781527519226,
-0.5002259016036987,
-0.7911072969436646,
0.48208177089691... |
def is _ auth _ message ( msg ) : keywords = [ " unauthorized ", " expired " ] return any ( [ k in msg for k in keywords ] ) | [
-0.4078432619571686,
0.4763627052307129,
0.3526982069015503,
0.7422844767570496,
-0.5422906279563904,
-0.03779249265789986,
-1.4184081554412842,
0.4773169159889221,
0.6022593975067139,
0.4907930791378021,
0.5281704068183899,
0.985864520072937,
-1.1029126644134521,
0.8974187970161438,
-1.... |
def position _ in _ interval _ to _ large _ switch ( self, interval, paths _ on _ side, side ) : # todo : collapsed cusp total = self. paths _ left _ or _ right _ of _ interval ( interval, side ) return paths _ on _ side + total | [
-0.46634528040885925,
0.5114685297012329,
0.4846029579639435,
-0.1313570737838745,
0.2788887917995453,
0.011090196669101715,
-0.15675567090511322,
0.029126252979040146,
0.1822252720594406,
0.3651796579360962,
-0.23780366778373718,
-1.26934015750885,
0.15565696358680725,
0.12131060659885406... |
def save _ checkpoint ( self, state, filename ='checkpoint. pth. tar') : filename = os. path. join ( self. experiment _ dir, filename ) torch. save ( state, filename ) | [
0.06435401737689972,
-0.05645917356014252,
0.10819165408611298,
0.24850133061408997,
0.6159613728523254,
0.9717947244644165,
0.6597757339477539,
1.2931466102600098,
-0.5542745590209961,
0.264567106962204,
-0.2805255949497223,
-0.8003377914428711,
0.26540952920913696,
-0.43836522102355957,
... |
def subscribe ( self, address ) : key _ interest = self. _ key ( " servers ", address, " interest " ) interest = yield from self. _ connection. incr ( key _ interest ) yield from self. _ _ push _ iq ( interest, address ) log. debug ( " interest in % s now % i ", address, interest ) | [
-0.23667438328266144,
0.6930260062217712,
0.6024261713027954,
-0.6075173616409302,
-0.06139067932963371,
-0.2681726813316345,
-0.49603673815727234,
-0.5923053026199341,
0.6464682221412659,
-0.2921922206878662,
-0.6858984231948853,
1.8317941427230835,
-0.9209083914756775,
-0.233937978744506... |
def circle ( size, r ) : center = size / / 2 maxdist = np. sqrt ( 2 * ( center * * 2 ) ) x, y = np. indices ( ( size, size ) ) array = ( 1 - np. abs ( np. hypot ( x - center, y - center ) / r ) ) return array. clip ( min = 0 ) | [
0.09648753702640533,
-0.9758114814758301,
0.44630464911460876,
-0.17870956659317017,
-0.2225285917520523,
-0.11542600393295288,
0.02459714561700821,
-0.7160837650299072,
0.685687780380249,
1.2502431869506836,
0.02279840223491192,
0.17339864373207092,
-0.3053254187107086,
-0.463117182254791... |
def dotnet _ ticks _ to _ unix _ epoch ( tick _ column : union [ str, column ] ) - > column : if not isinstance ( tick _ column, ( str, column ) ) : raise valueerror ( f " given column must be a column name ( str ) or column instance ( column ) : { type ( tick _ column ) } " ) sc = sparkcontext. _ active _ spark _ cont... | [
-0.28548339009284973,
0.12087304890155792,
0.5234864950180054,
-0.3845624029636383,
0.39243990182876587,
-0.540961742401123,
0.7244746685028076,
0.11286990344524384,
0.20585504174232483,
0.027562318369746208,
-1.07904052734375,
0.30477696657180786,
0.4427851140499115,
-0.5999694466590881,
... |
def sort _ sequences ( inputs : torch. tensor, lengths : torch. tensor ) - > tuple [ torch. tensor, torch. tensor, callable [ [ torch. tensor ], torch. tensor ] ] : lengths _ sorted, sorted _ idx = lengths. sort ( descending = true ) _, unsorted _ idx = sorted _ idx. sort ( ) def unsort ( tt : torch. tensor ) - > torch... | [
-0.12167829275131226,
-0.7920724749565125,
0.529300332069397,
-1.0532536506652832,
0.09031371027231216,
-0.5003189444541931,
0.22509807348251343,
-0.5773355960845947,
-0.2494312971830368,
0.17285194993019104,
-0.2900807559490204,
0.26168400049209595,
0.39085233211517334,
-0.305250585079193... |
def _ generate _ transaction _ id ( self ) : return uuid. uuid4 ( ). hex. upper ( ) | [
0.2324034720659256,
-0.40983879566192627,
0.6020641922950745,
-0.5476507544517517,
0.188236802816391,
0.5360817909240723,
-0.7350300550460815,
0.9906653165817261,
0.6335753202438354,
0.5336421728134155,
-0.04305000975728035,
-0.7365998029708862,
-0.35331180691719055,
-0.5338466167449951,
... |
def set _ port _ number ( self, port _ number ) : self. port = port _ number | [
0.2764256000518799,
-0.47508111596107483,
0.31945252418518066,
0.05194322392344475,
1.1625690460205078,
0.4140743017196655,
0.9594604969024658,
0.8163743019104004,
0.23059241473674774,
-0.46407589316368103,
-0.7083557844161987,
0.6287838816642761,
0.28058287501335144,
0.2907196283340454,
... |
def mypy ( self ) : return self. mypy _ args is not none | [
-0.865924596786499,
-0.5326224565505981,
0.31568458676338196,
-0.15283112227916718,
0.17039793729782104,
-0.15124227106571198,
-0.052129026502370834,
-0.41328081488609314,
-0.10427276045084,
-0.11443749815225601,
-0.06450516730546951,
0.07306879758834839,
-1.1999646425247192,
0.65799677371... |
def _ _ init _ _ ( self, object _ name : str ) - > none : message = f'{ object _ name } has no threshold set, call ` infer _ threshold ` to fit one!'super ( ). _ _ init _ _ ( message ) | [
0.8564271926879883,
0.07412613928318024,
0.5264723896980286,
0.8250972628593445,
-0.14651323854923248,
-0.18151526153087616,
0.14460378885269165,
-0.03693908080458641,
-0.3529298007488251,
-0.4822562038898468,
-0.772388219833374,
0.31450000405311584,
0.39601629972457886,
0.3323639631271362... |
def div ( x, y, name = none ) : return _ div _ python2 ( x, y, name ) | [
-0.22128495573997498,
-0.03326570242643356,
0.498291939496994,
0.712841272354126,
-1.2278233766555786,
-0.7038454413414001,
-1.0023740530014038,
-1.7381621599197388,
-0.6388397812843323,
-0.18477855622768402,
-0.7287673950195312,
0.7236497402191162,
0.9381558299064636,
-0.5950454473495483,... |
def savecalibrationfile ( ci, filename, cname ) : # make sure the directory exists and the file is writable f = none try : f = open ( filename,'w') except ioerror as e : if e. errno in set ( [ errno. eacces, errno. eperm ] ) : pass elif e. errno in set ( [ errno. enoent ] ) : # find last slash in the name. the url pars... | [
0.08320890367031097,
-0.37452733516693115,
0.8560321927070618,
0.08601618558168411,
-0.5525261163711548,
0.31712573766708374,
0.798631489276886,
0.24745984375476837,
-0.5259366035461426,
0.48974335193634033,
-0.9983772039413452,
-1.20020592212677,
-0.16258567571640015,
0.41643476486206055,... |
def generate _ words ( wordcount ) : return [ generate _ word ( ) for _ in xrange ( wordcount ) ] | [
-0.31946590542793274,
1.0067428350448608,
0.3075029253959656,
-0.17703679203987122,
0.9545788168907166,
0.286986380815506,
-0.5850672125816345,
0.26099327206611633,
-0.8416195511817932,
0.5073104500770569,
-0.5676891803741455,
-0.16059495508670807,
-0.11259608715772629,
1.2573373317718506,... |
def cycle _ learner ( dls : dataloader, m : cyclegan, opt _ func = adam, loss _ func = cycleganloss, show _ imgs : bool = true, imga : bool = true, imgb : bool = true, show _ img _ interval : bool = 10, metrics : list = [ ], cbs : list = [ ], * * kwargs ) : lms = lossmetrics ( ['id _ loss _ a ','id _ loss _ b ','gen _ ... | [
0.28279486298561096,
0.24824513494968414,
0.7376635670661926,
-0.12518300116062164,
-1.229935646057129,
-0.21166585385799408,
0.6943095326423645,
-0.6379003524780273,
-0.029120855033397675,
-0.5677669048309326,
0.3556459844112396,
0.857510507106781,
0.6945011615753174,
0.5110719203948975,
... |
def get _ heuristic _ corrections ( self, tile _ key ) : if ( len ( self. foc _ est [ tile _ key ] ) > 1 and len ( self. astgx _ est [ tile _ key ] ) > 1 and len ( self. astgy _ est [ tile _ key ] ) > 1 ) : wd _ corr = ( self. heuristic _ calibration [ 0 ] * ( self. foc _ est [ tile _ key ] [ 0 ] - self. foc _ est [ ti... | [
-0.5793254971504211,
-0.21852488815784454,
0.6560220718383789,
-0.7552319765090942,
-0.9343084692955017,
0.3184843361377716,
0.4482021927833557,
-0.3057994246482849,
-0.6392475366592407,
1.0415050983428955,
-0.04470989480614662,
0.04988938570022583,
-0.4355410039424896,
0.815877377986908,
... |
def get _ word _ list ( self ) : return self. _ _ word _ list | [
-0.6200416088104248,
-0.13963431119918823,
0.37976282835006714,
0.05678151547908783,
0.9172048568725586,
0.3715231120586395,
-0.3893020451068878,
0.5357851386070251,
0.5058602094650269,
0.17953020334243774,
-0.7444433569908142,
0.5834261775016785,
-0.36930498480796814,
0.7522482872009277,
... |
def extract _ params ( raw ) : if isinstance ( raw, bytes _ type ) or isinstance ( raw, unicode _ type ) : try : params = urldecode ( raw ) except valueerror : params = none elif hasattr ( raw,'_ _ iter _ _') : try : dict ( raw ) except valueerror : params = none except typeerror : params = none else : params = list ( ... | [
-0.7083713412284851,
0.01369316503405571,
0.7468571066856384,
0.21144582331180573,
-0.6640112400054932,
-1.0098247528076172,
-0.8241147398948669,
0.37023356556892395,
0.6828181743621826,
0.32825279235839844,
0.03314749896526337,
-0.06248127669095993,
-0.4778684377670288,
0.7348201274871826... |
def write _ mgf ( all _ preds _ in, output _ filename = " ms2pip ", unlog = true, write _ mode ='w + ', return _ stringbuffer = false, peprec = none ) : all _ preds = all _ preds _ in. copy ( ) if unlog : all _ preds ['prediction'] = ( ( 2 * * all _ preds ['prediction'] ) - 0. 001 ). clip ( lower = 0 ) all _ preds. res... | [
-0.5056188106536865,
-0.8746399879455566,
0.765450656414032,
-0.16910986602306366,
0.028192531317472458,
-0.04524271562695503,
-0.044473305344581604,
1.099308729171753,
-0.9708815813064575,
0.6289774775505066,
0.15238775312900543,
-0.20870772004127502,
0.17718039453029633,
0.35373613238334... |
def _ extract _ time _ series ( data, time _ series _ name ='values') : # if it's already a series, just return it if isinstance ( data, pd. series ) : return data if time _ series _ name not in data : raise valueerror ( " could not locate column { } in provided data ". format ( time _ series _ name ) ) return pd. seri... | [
-0.09667935222387314,
0.7888848781585693,
0.20944803953170776,
-0.17501960694789886,
-0.0032299670856446028,
-0.731879472732544,
-0.797109067440033,
-0.8526616096496582,
0.7675513029098511,
0.40803319215774536,
0.757022500038147,
0.35798850655555725,
-0.29456546902656555,
-0.79591023921966... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.