text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def check _ location ( position : tuple, all _ sites : np. matrix, busy _ locations : list [ tuple ] ) - > list [ tuple ] : n, m = all _ sites. shape potential _ sites = [ ( position [ 0 ], position [ 1 ] + 1 ), ( position [ 0 ], position [ 1 ] - 1 ), ( position [ 0 ] + 1, position [ 1 ] ), ( position [ 0 ] - 1, positi... | [
-0.5893451571464539,
-0.45289117097854614,
0.4818834960460663,
-0.09271788597106934,
-0.18492867052555084,
0.020822051912546158,
0.54522705078125,
0.7978435158729553,
0.6795116066932678,
0.5945970416069031,
-0.31243929266929626,
0.051364716142416,
-0.44705361127853394,
-0.301974356174469,
... |
def _ add _ conflicts _ rules ( self, package, requirements ) : # conflicts due to same - name pkg _ requirement = conflictrequirement. _ from _ string ( package. name ) obsolete _ providers = self. _ pool. what _ provides ( pkg _ requirement ) # we add our new requirement to the stack of requirements we've # gathered ... | [
-0.8228707313537598,
0.4682334065437317,
0.8523626327514648,
-0.3422348201274872,
1.0714308023452759,
0.1381828486919403,
-0.26549187302589417,
0.10767732560634613,
0.10208577662706375,
0.4496158957481384,
0.34059441089630127,
-0.14116300642490387,
0.14193201065063477,
0.20395496487617493,... |
def date ( self ) : return self. start _ time. date | [
1.3271688222885132,
-0.7210888266563416,
0.39319297671318054,
0.50398850440979,
0.21126554906368256,
0.9875170588493347,
-0.3472900986671448,
0.03623800724744797,
0.5383787155151367,
-0.22666075825691223,
-0.2393427938222885,
0.876404881477356,
-0.12305491417646408,
0.1899964064359665,
-... |
def find _ neighbor _ edges ( network, inds, flatten = true, logic ='or') : if flatten = = false : im = dict _ to _ im ( network ) am = none else : am = dict _ to _ am ( network ) im = none if im is not none : if im. format! ='lil': im = im. tolil ( copy = false ) rows = [ im. rows [ i ] for i in np. array ( inds, ndmi... | [
-0.4141969084739685,
0.32677847146987915,
1.0082062482833862,
0.698834240436554,
-0.42118170857429504,
-0.5391173958778381,
0.15742099285125732,
-0.2417782098054886,
0.7397696375846863,
1.0153518915176392,
0.8983306288719177,
0.3385533392429352,
-0.5719794034957886,
0.4810968339443207,
0... |
def run _ this _ script ( debug : bool = false ) : running _ in _ blender ='bpy'in sys. modules caller _ path = inspect. stack ( ) [ 1 ]. filename # path of script that called this function if not running _ in _ blender : # if blender is not running this script caller _ dir = os. path. dirname ( caller _ path ) env = o... | [
-0.43598464131355286,
-0.2272593080997467,
0.9372795224189758,
0.33449530601501465,
0.2949202358722687,
0.044246673583984375,
0.8222750425338745,
0.03935937210917473,
0.03745697811245918,
0.0783291906118393,
-0.04149814695119858,
0.45695939660072327,
-0.15961697697639465,
1.242690920829773... |
def test _ bad _ request ( self, test _ client ) : response = test _ client. post ( " / " ) assert response. status _ code = = 405 assert b " typefight! " not in response. data assert response. status = = " 405 method not allowed " | [
-0.3666606545448303,
0.006430722773075104,
0.5590457320213318,
0.6315663456916809,
1.2358522415161133,
1.2658761739730835,
-0.2335006445646286,
-0.8865388631820679,
-0.78373122215271,
-0.6190859079360962,
-0.1854884922504425,
0.22085395455360413,
-0.4041491746902466,
0.034437768161296844,
... |
def complete _ job ( self, budget ) : assert budget in self. budgets _ max _ configs = self. n _ configs [ list ( self. budgets ). index ( budget ) ] assert self. _ sh _ bracket [ budget ] < _ max _ configs self. _ sh _ bracket [ budget ] + = 1 | [
-0.12680065631866455,
0.7962411642074585,
0.6593785285949707,
0.5628485083580017,
0.14798422157764435,
0.3320879638195038,
0.18434609472751617,
-0.24367210268974304,
0.34311187267303467,
0.052518438547849655,
-1.0942046642303467,
-0.05027724802494049,
-0.3605128824710846,
0.514575839042663... |
def as _ dict ( self ) - > dict [ str, any ] : return {'id': self. id,'title': self. title,'image _ url': self. image _ url } | [
-1.1771539449691772,
-1.4539743661880493,
0.2504165470600128,
-0.9658284187316895,
-0.7831245064735413,
-0.2675839066505432,
-1.2230864763259888,
-0.16361640393733978,
0.29593098163604736,
-0.3871753215789795,
-0.45697104930877686,
0.02036145329475403,
0.49097350239753723,
0.87253767251968... |
async def test _ datadisk _ migrate _ mark _ data _ move ( coresys : coresys, all _ dbus _ services : dict [ str, dbusservicemock | dict [ str, dbusservicemock ] ], new _ disk : str, os _ available, ) : datadisk _ service : datadiskservice = all _ dbus _ services [ " agent _ datadisk " ] datadisk _ service. changedevic... | [
-0.6315686702728271,
0.6590328812599182,
0.6796833872795105,
0.43109551072120667,
0.7152782678604126,
0.06959298998117447,
0.05669226497411728,
-0.5674445629119873,
0.351931631565094,
-0.3816302418708801,
-0.05311313644051552,
0.5974065065383911,
0.07209044694900513,
0.4387672543525696,
... |
def w ( tag, message ) : # pylint : disable = invalid - name date = _ _ get _ date ( ) if log _ level _ stdout > = 2 : _ _ log _ to _ stdout ( colors. color _ warn, date, tag + " / w ", message ) if log _ level _ file > = 2 : _ _ log _ to _ file ( date, tag + " / w ", message ) | [
0.2103813886642456,
0.08458114415407181,
0.7542366981506348,
0.6039624810218811,
0.14319871366024017,
-0.46722039580345154,
0.700028121471405,
-1.0088223218917847,
-1.629857063293457,
-0.22099590301513672,
0.6204971075057983,
0.8338165283203125,
1.001348614692688,
0.9334986805915833,
-0.... |
def error _ msg ( code ) : error _ messages = { " 0 " : " mqtt _ err _ success ", " 1 " : " mqtt _ err _ nomem ", " 2 " : " mqtt _ err _ protocol ", " 3 " : " mqtt _ err _ inval ", " 4 " : " mqtt _ err _ no _ conn ", " 5 " : " mqtt _ err _ conn _ refused ", } return error _ messages. get ( str ( code ), " unknown error... | [
-1.11548912525177,
0.32314762473106384,
0.5760135650634766,
-1.070685863494873,
-0.05485380068421364,
0.10984908789396286,
-0.6417733430862427,
-0.16805563867092133,
-0.15563689172267914,
0.3141714930534363,
-0.6658490896224976,
-0.19649453461170197,
0.22838427126407623,
0.7381137609481812... |
def key ( self ) : return self. id | [
0.02562173269689083,
-1.0194429159164429,
0.40780502557754517,
-0.3097962439060211,
0.45296716690063477,
1.3453786373138428,
0.15958914160728455,
-0.226387619972229,
0.28149595856666565,
-0.1479978859424591,
-0.20739197731018066,
0.6471673250198364,
-1.127091646194458,
-0.5824708938598633,... |
def retirarfoco _ txt _ e _ or _ v ( self, event ) : if self. chb _ gfuncev. getvalue ( ) = = true : try : g = ( float ( self. txtmodelasticidade. getvalue ( ) ) / ( 2 * ( 1 + float ( self. txtcoefpoison. getvalue ( ) ) ) ) ) self. txtmodelasticidadetransversal. setvalue ( str ( g ) ) except : pass event. skip ( ) | [
0.28282374143600464,
0.1229563057422638,
0.46447694301605225,
0.4009816646575928,
0.13985314965248108,
0.029924817383289337,
0.5957682132720947,
0.13083675503730774,
-0.968574583530426,
0.5798313021659851,
0.18193306028842926,
-0.4754183292388916,
-0.0775703638792038,
-0.27416548132896423,... |
def expand _ axis ( x ) : new = np. zeros ( x. shape ) new [ 1 : ] = 0. 5 * ( x [ 1 : ] + x [ : - 1 ] ) first = 2 * new [ 1 ] - new [ 2 ] new [ 0 ] = first return new | [
0.9140701293945312,
0.07104285806417465,
0.7557053565979004,
1.133042335510254,
-0.2139613926410675,
0.12759560346603394,
0.4642784297466278,
-0.08730662614107132,
-0.1462542712688446,
0.049196287989616394,
-0.3751307427883148,
0.4856721758842468,
-0.13062414526939392,
-0.6866700053215027,... |
def get _ command _ help ( cmd : commands. command ) - > discord. embed : out = discord. embed ( title = command _ usage ( cmd ), description = cmd. help ) return out | [
0.7024528384208679,
0.3291591703891754,
0.4340973198413849,
0.24588122963905334,
-0.3064149022102356,
0.3220407962799072,
-0.5065358281135559,
-0.5040867924690247,
-0.12825244665145874,
0.18449212610721588,
0.9514994025230408,
1.113713026046753,
0.38714125752449036,
0.25163429975509644,
... |
def setup ( self ) : self. getname ( ) self. getid ( ) self. getstats ( ) self. gettype ( ) self. getlocation ( ) | [
-0.5485758781433105,
-0.9275478720664978,
0.40527042746543884,
-0.13620524108409882,
0.9754173159599304,
-0.055697184056043625,
0.061482492834329605,
-1.01596200466156,
0.41868144273757935,
-0.36472320556640625,
-0.5899173617362976,
-0.21711155772209167,
0.21094447374343872,
0.369058996438... |
def randomselection ( self ) : inda = self. matingpool [ random. randint ( 0, self. popsize - 1 ) ] indb = self. matingpool [ random. randint ( 0, self. popsize - 1 ) ] return [ inda, indb ] | [
-1.8590751886367798,
-1.010751485824585,
0.3440776467323303,
-0.3658108115196228,
0.19791752099990845,
0.9363624453544617,
0.6334162950515747,
-0.4368671774864197,
0.8118205070495605,
0.6424899101257324,
-0.021549781784415245,
0.18785519897937775,
-0.711179256439209,
-0.577896237373352,
... |
def merge ( mode ) : print ( " running mode : { } ". format ( mode ) ) for filename in mydir : with open ( filename,'r') as csvfile : reader = csv. reader ( csvfile, delimiter ='' ) try : for row in reader : # print ( row ) aux = [ ] temp = row if ( mode = = " full " ) : for index, att in enumerate ( temp ) : if ( inde... | [
-0.9757660031318665,
-1.1305440664291382,
1.1250401735305786,
-0.0806768462061882,
-0.648160994052887,
0.49792230129241943,
0.09192118793725967,
1.1106401681900024,
-0.3300583064556122,
-0.3556159436702728,
-0.261764794588089,
-0.6541033387184143,
-0.08538135141134262,
0.4609687328338623,
... |
def rotatex ( self, angle ) : rad = angle * math. pi / 180 cosa = math. cos ( rad ) sina = math. sin ( rad ) y = self. y * cosa - self. z * sina z = self. y * sina + self. z * cosa return point3d ( self. x, y, z ) | [
-0.4141387939453125,
0.5830263495445251,
0.5315976142883301,
-1.0712212324142456,
-0.32119670510292053,
0.25411564111709595,
-0.4924430847167969,
0.3777156472206116,
1.008809208869934,
-0.6013838648796082,
-0.26045018434524536,
0.0757148414850235,
-0.7198289632797241,
-1.5557295083999634,
... |
def to _ iter ( self, columns = none, indices = none, shuffle = false, seed = none, use _ file _ metadata = none ) : if isinstance ( columns, str ) : columns = [ columns ] # try to extract the row - size metadata # if we are not shuffling partition _ lens _ meta = none if not shuffle and use _ file _ metadata is not fa... | [
-0.6971743702888489,
0.8951783180236816,
0.5800299048423767,
0.0024004040751606226,
0.4429524838924408,
-0.36931470036506653,
-0.1236121729016304,
-0.10160782188177109,
-0.9074263572692871,
-0.09744592756032944,
0.6521135568618774,
0.032442606985569,
0.23274782299995422,
-0.512096166610717... |
def inverse ( self ) : return constantrotation ( self. _ rot. inv ( ). as _ quat ( ), self. dest, self. source ) | [
-0.46992748975753784,
0.33557382225990295,
0.4670109152793884,
-1.1379952430725098,
-0.5985206961631775,
0.5053533315658569,
0.18195536732673645,
0.09935057163238525,
-0.15476763248443604,
0.5534960627555847,
-0.6608004570007324,
-0.14585018157958984,
-1.289454460144043,
-1.726968050003051... |
def test _ empty ( minimal _ basic _ settings, fixtures _ settings, caplog ) : # get basic sample settings projectdir = os. path. join ( fixtures _ settings. fixtures _ path, " minimal _ basic " ) settings = minimal _ basic _ settings ( projectdir ) # init builder builder = pagebuilder ( settings ) # sample settings de... | [
-0.20590339601039886,
0.6647531390190125,
0.6001148223876953,
0.09617932885885239,
0.5588008761405945,
0.6316794157028198,
0.14931103587150574,
-0.5452227592468262,
0.36255526542663574,
-0.21863389015197754,
-0.2561423182487488,
0.4325485825538635,
-0.009236997924745083,
0.0628351643681526... |
def pick _ data ( ns, digits ) : f = gzip. open ('data / mnist. pkl. gz ','rb') train _ set, valid _ set, test _ set = cpickle. load ( f ) f. close ( ) images, labels = train _ set originals = [ ] ; shapes = [ ] ; ext _ shapes = [ ] ; true _ labels = [ ] ; max _ dim = 0 i = 0 for n, d in zip ( ns, digits ) : x = np. wh... | [
-0.41394659876823425,
0.15670539438724518,
0.6728519201278687,
-0.48577815294265747,
-0.9120154976844788,
0.1029781922698021,
0.39064934849739075,
-0.06320876628160477,
0.830119252204895,
0.4690312445163727,
-0.38684582710266113,
0.23776087164878845,
0.26466020941734314,
-0.135801106691360... |
def bayesian _ quad _ normal _ embedding _ ml ( f, n _ dim, sample _ size, mu, sigma, emb _ dim = 2, a = none, verbose = true ) : start = datetime. datetime. now ( ) if verbose : print start if a is none : a = np. random. normal ( 0, 1, n _ dim * emb _ dim ). reshape ( emb _ dim, n _ dim ) print a kernel = gpy. kern. m... | [
0.49121877551078796,
0.12548792362213135,
1.0569067001342773,
0.8345087170600891,
-0.8917760252952576,
-0.33447757363319397,
-0.07613905519247055,
0.4996625483036041,
-0.827478289604187,
0.2530825138092041,
-0.11220581829547882,
0.2279462367296219,
-0.4968421459197998,
0.17864644527435303,... |
def redirection _ parsing ( self, user _ query, number _ of _ results ) : with webdriver. firefox ( ) as driver : self. url = f " https : / / duckduckgo. com / html? q = { user _ query } & t = h _ & ia = web " driver. get ( self. url ) self. results = driver. find _ elements ( by. class _ name, duckduckgo _ class _ nam... | [
-1.247527003288269,
0.9878038167953491,
0.43591535091400146,
-0.34453415870666504,
0.249009370803833,
-0.43613824248313904,
0.9384623765945435,
0.007934256456792355,
0.34048089385032654,
-0.7873745560646057,
-0.3040839731693268,
-0.037583377212285995,
0.3307633697986603,
0.7039642930030823... |
def get _ flag _ object ( self, flag ) : if flag. _ _ class _ _ = = contentflag : content _ flag _ object = flag else : try : content _ flag _ object = self. model. objects. get ( name = str ( flag ) ) except exception, e : content _ flag _ object = none raise contentflagexception ( " contentflag % s does not exist " %... | [
0.2963835299015045,
-0.04039636626839638,
0.3599243760108948,
0.327640175819397,
0.2119193971157074,
0.526642918586731,
0.03756776079535484,
-0.8489234447479248,
-0.7282037734985352,
-0.6291885375976562,
-0.25786250829696655,
0.4983924329280853,
-0.9332945942878723,
0.1558406800031662,
-... |
def getguestbookentrybyid ( self, id ) : message = dict ( ) index _ select = " " " select * from guestbook where id = % s " " " index _ query = guestbook. raw ( index _ select, id ) for entry in index _ query : message [ " id " ] = entry. id message [ " author " ] = entry. author message [ " message " ] = entry. messag... | [
-1.0609312057495117,
-0.33658459782600403,
0.599326491355896,
0.38209599256515503,
0.07063385844230652,
0.03875483572483063,
0.08307941257953644,
-0.9962207674980164,
-0.8332055807113647,
0.7292978167533875,
-0.6861233115196228,
0.33234184980392456,
-0.4810398519039154,
0.8681969046592712,... |
def goestimatewaveletfromgather ( timewindow, funcert, luncert ) : st, sx, f = getvikinggrabencdp ( 800 ) nt, nx = st. count, sx. count dt, dx = st. delta, sx. delta ft, fx = st. first, sx. first ts = 0. 010, 0. 646, 0. 846, 1. 150, 1. 511, 1. 825, 2. 490, 2. 985 vs = 1. 510, 1. 575, 1. 687, 1. 817, 1. 938, 1. 980, 2. ... | [
0.5693534016609192,
-0.10474099963903427,
1.0122278928756714,
-0.3213346600532532,
-0.8393998742103577,
0.5864141583442688,
-0.06722737848758698,
-0.5176030397415161,
-0.5769050121307373,
0.3142551779747009,
-0.2136291265487671,
0.043193038552999496,
-0.21862733364105225,
0.987836301326751... |
def run ( self, image ) : # width, height = image. size # resize _ ratio = 1. 0 * self. input _ size / max ( width, height ) # target _ size = ( int ( resize _ ratio * width ), int ( resize _ ratio * height ) ) # print resize _ ratio, target _ size # target _ size = ( 610, 1024 ) # resized _ image = image. convert ('rg... | [
-1.190578579902649,
-0.878221333026886,
0.7650801539421082,
0.03764662519097328,
0.46977901458740234,
-0.13957089185714722,
0.41216641664505005,
-0.09145104885101318,
0.6531403064727783,
0.08267906308174133,
0.12545666098594666,
-0.010839072987437248,
0.3153550922870636,
-0.142254605889320... |
def detect _ kvm ( ) : kvm = popen ( [ " which ", " kvm " ], stdout = pipe ) kvm. communicate ( ) return kvm. returncode = = 0 | [
0.2930052876472473,
-0.0911405086517334,
0.9549263119697571,
0.8080446124076843,
0.15529191493988037,
0.12324128299951553,
-1.4267828464508057,
0.29789116978645325,
-0.3518291115760803,
-0.5229886174201965,
0.31100887060165405,
0.09934888780117035,
-0.46796223521232605,
0.05853462219238281... |
def shortest ( self, word1, word2 ) : wl1 = self. mapping [ word1 ] wl2 = self. mapping [ word2 ] i = j = 0 minlen = 1 < < 31 while i < len ( wl1 ) and j < len ( wl2 ) : minlen = min ( abs ( wl1 [ i ] - wl2 [ j ] ), minlen ) if wl1 [ i ] < wl2 [ j ] : i + = 1 else : j + = 1 return minlen | [
0.502434492111206,
-0.5000966191291809,
0.8029090762138367,
-0.5011110305786133,
-1.640560507774353,
1.0622838735580444,
-0.2990562617778778,
-0.5502984523773193,
-0.10652000457048416,
0.14465023577213287,
0.31368643045425415,
1.1973613500595093,
-0.8242144584655762,
0.4371667504310608,
... |
def showraw ( self, layer ) : error = self. request. get ('error') result = self. request. get ('result') layer _ id = layer. key ( ). id ( ) single _ url = blobstore. create _ upload _ url ('/ resource - create / % d'% layer _ id ) bulk _ url = blobstore. create _ upload _ url ('/ resource - bulk / % d'% layer _ id ) ... | [
-0.5944373607635498,
0.133279487490654,
0.77864009141922,
-0.9252601265907288,
-0.09663110226392746,
0.1577429175376892,
0.2981669306755066,
0.0041250623762607574,
-0.3437057137489319,
0.044494349509477615,
-0.525801956653595,
0.169436976313591,
-0.0649365559220314,
1.2408381700515747,
-... |
def drawaccountchart ( self, vbform ) : print'drawing chart...'from doubletalk. dates import * import time # make a dispath wrapper around the vb form object so we can call # any of its methods. idform = win32com. client. dispatch ( vbform ) # call a method we defined on the vb form # arrays are converted automatically... | [
-0.00847146101295948,
0.18012464046478271,
0.8518943786621094,
0.006306195631623268,
-0.5586825609207153,
-0.18373806774616241,
0.41686496138572693,
-0.6738981604576111,
0.28221890330314636,
-0.5392432808876038,
0.9946702122688293,
1.0648473501205444,
0.04112503305077553,
-0.11919896304607... |
def target _ team _ member ( self ) : return self. _ target _ team _ member | [
-0.06161028519272804,
-0.35649555921554565,
0.22405950725078583,
-0.25886300206184387,
0.528832197189331,
0.8837081789970398,
0.05201568081974983,
-0.7534767985343933,
-0.4111711084842682,
-0.4099806845188141,
0.4015839099884033,
0.8031904697418213,
0.2232714146375656,
-1.7582831382751465,... |
def timeout _ func _ on _ unix ( timeout : int, func, * args, * * kwargs ) : @ functools. wraps ( func ) def timed _ func ( * args, * * kwargs ) : def handler ( signum, frame ) : raise timeoutexception ( timeout = timeout ) # to check an attribute existence, the reliable way is to instantiate an object and then hasattr... | [
0.37204012274742126,
-0.5025904178619385,
0.8973150253295898,
0.1532236635684967,
-0.5774394273757935,
0.4748843014240265,
-0.45097973942756653,
0.44974589347839355,
0.05190693214535713,
0.4825058579444885,
-0.09054233878850937,
0.6829071044921875,
0.1511051207780838,
0.27119964361190796,
... |
def test _ directory _ max _ depth ( file, tmp _ path ) : def _ get _ oct _ mode ( name ) : " " " return a string octal representation of the permissions for name " " " return salt. utils. files. normalize _ mode ( oct ( name. stat ( ). st _ mode & 0o777 ) ) top = tmp _ path / " top _ dir " sub = top / " sub _ dir " su... | [
-0.08244182914495468,
0.38860538601875305,
0.7205613255500793,
0.13587523996829987,
-0.1441417783498764,
0.2023921012878418,
0.659580409526825,
-0.28575795888900757,
0.07257473468780518,
-0.9528437256813049,
-0.17816700041294098,
-0.030149634927511215,
0.5259140133857727,
0.162600502371788... |
def grid _ print ( grid : np. ndarray, generation : int ) - > none : print ( f " = = = = gen { generation } = = = = " ) for row in grid : for cell in row : if cell : print ( " ■ ", end = " " ) else : print ( " ", end = " " ) print ( ) | [
-0.23363009095191956,
0.17386938631534576,
0.4765336215496063,
0.25306692719459534,
0.041585154831409454,
0.26664233207702637,
-0.06000138446688652,
-0.3224145770072937,
-1.0073370933532715,
0.5440712571144104,
0.5623437166213989,
0.7916532158851624,
0.03082646057009697,
1.2434667348861694... |
def _ calculate _ canvas _ xy ( self, image, meters _ per _ px, p0, p ) : # is image neccessary? if " e " not in p or " e " not in p0 : return p [ " x " ] = int ( ( - p0 [ " e " ] + p [ " e " ] ) / meters _ per _ px ) p [ " y " ] = int ( ( p0 [ " n " ] - p [ " n " ] ) / meters _ per _ px ) | [
-0.5249812006950378,
-0.3935973048210144,
0.5195013284683228,
-0.8096989989280701,
-0.13798566162586212,
0.21178488433361053,
-0.2580411434173584,
0.393532395362854,
-0.5039437413215637,
0.04619970917701721,
0.3449288308620453,
-1.2601563930511475,
0.22298313677310944,
0.7914802432060242,
... |
def run ( self, fevals = none, brackets = none, total _ cost = none, verbose = false ) : self. start = time. time ( ) while true : if self. _ is _ run _ budget _ exhausted ( fevals, brackets, total _ cost ) : break if self. is _ worker _ available ( ) : job _ info = self. _ get _ next _ job ( ) if brackets is not none ... | [
-0.36694657802581787,
0.023918241262435913,
0.9589847326278687,
0.07710707932710648,
0.403012752532959,
-0.34426403045654297,
-0.22636091709136963,
-0.9511278867721558,
-1.1166354417800903,
0.3706757426261902,
-0.5688645243644714,
0.34098151326179504,
-0.5991223454475403,
0.908486604690551... |
def mergeproperties ( properties, propertylist ) : pnames = [ ] for p in properties : pnames. append ( propertylist [ int ( p ) ] ) if set ( dbpproperty. identprops1 ). issuperset ( set ( pnames ) ) : return true if set ( dbpproperty. identprops2 ). issuperset ( set ( pnames ) ) : return true return false | [
-0.9851272106170654,
0.2232494205236435,
0.8156756162643433,
0.16202417016029358,
0.09923525154590607,
0.7754326462745667,
-1.0344254970550537,
0.3000123202800751,
-0.033893607556819916,
0.20787359774112701,
-0.7774726748466492,
-1.1006436347961426,
-1.4320909976959229,
-0.1040432825684547... |
def _ attach _ endpoints ( self ) : for name, endpoint in inspect. getmembers ( self ) : if ( inspect. isclass ( endpoint ) and issubclass ( endpoint, self. _ endpoint ) and endpoint is not self. _ endpoint ) : endpoint _ instance = endpoint ( self. requester ) setattr ( self, endpoint. name, endpoint _ instance ) | [
-0.3985558748245239,
-0.5443121790885925,
0.6623838543891907,
0.37225183844566345,
0.24904301762580872,
0.46845877170562744,
-0.2112051099538803,
-0.400642991065979,
0.46139225363731384,
-0.1593969464302063,
0.4431649148464203,
0.05934211239218712,
-0.29387709498405457,
0.9757737517356873,... |
def to _ matrix ( self ) : return numpy. array ( [ [ 0, 1 ], [ 1, 0 ] ], dtype = complex ) | [
-1.2137610912322998,
-1.1165664196014404,
0.3444980978965759,
0.37482312321662903,
1.113328456878662,
-0.3304803967475891,
0.8005267977714539,
-0.06793975830078125,
0.8615260124206543,
-0.7996077537536621,
-0.5489595532417297,
0.26134786009788513,
-0.33110320568084717,
0.11921809613704681,... |
def auth _ func ( * args, * * kwargs ) : if not current _ user. is _ authenticated or not current _ user. is _ active : # permission denied abort ( 404 ) else : return true | [
-0.25456783175468445,
-0.7544609904289246,
0.6102704405784607,
1.4594976902008057,
-0.037442587316036224,
0.46746766567230225,
1.0321531295776367,
0.06308253109455109,
-0.09812586009502411,
-0.02703091688454151,
1.3217686414718628,
0.8879713416099548,
-0.3449576497077942,
-1.36575984954833... |
def get _ node _ id ( ) : host _ name = socket. getfqdn ( ) host _ name2 = socket. gethostname ( ) f = open ( node _ config ) for line in f : tokens = line. split ( ) if ( tokens [ 2 ] = = host _ name or tokens [ 2 ] = = host _ name2 ) and tokens [ 1 ] = ='yes': return int ( tokens [ 0 ] ) print'host :'+ host _ name +'... | [
-0.11084267497062683,
0.5142329335212708,
0.8026202917098999,
-0.1791991889476776,
-0.13212764263153076,
0.3084973096847534,
0.17262279987335205,
0.5955365896224976,
-1.1554381847381592,
0.5557486414909363,
-0.11789040267467499,
0.9275758266448975,
-0.6452498435974121,
0.3395150601863861,
... |
def test _ arange _ with _ negative _ step ( self ) : def test _ f ( dummy ) : return torch. arange ( dummy. size ( 0 ), dummy. size ( 1 ), - 1. 2 ) dummy = torch. randn ( 10, 2 ) jitvsglow ( test _ f, dummy, expected _ fused _ ops = { " aten : : arange " } ) | [
-0.20142899453639984,
0.6273978352546692,
0.4578298032283783,
1.2106338739395142,
0.07884284853935242,
0.16148321330547333,
-0.24890395998954773,
-0.6037242412567139,
-0.3170337677001953,
-0.18321946263313293,
0.004593651741743088,
0.331440269947052,
0.6578920483589172,
1.1777172088623047,... |
def set _ difficulty ( self, mode ) : self. height = difficulty [ mode ] ['height'] self. width = difficulty [ mode ] ['width'] self. mines = difficulty [ mode ] ['mines'] | [
-1.2014292478561401,
-0.4491984248161316,
0.3735443353652954,
-0.28749775886535645,
0.5557848215103149,
1.0693836212158203,
0.185261070728302,
-0.24691566824913025,
-0.6495857834815979,
-0.31723564863204956,
-1.6331613063812256,
-0.43814289569854736,
0.4106059968471527,
0.6963419318199158,... |
def calculatespeed ( self, x1, y1, x2, y2, time1, time2 ) : # calculate vector between points d _ x = x2 d _ x - = x1 d _ y = y2 d _ y - = y1 # calculate lengths of distancevector distance = np. power ( d _ x, 2 ) distance + = np. power ( d _ y, 2 ) distance = np. sqrt ( distance ) distance / = self. proportion # calcu... | [
0.8376904726028442,
0.09944048523902893,
0.7406957745552063,
0.34943056106567383,
-0.11448495835065842,
0.21850714087486267,
0.21034079790115356,
-0.25542816519737244,
-0.15160910785198212,
0.8443951606750488,
-0.1849595457315445,
0.3235930800437927,
0.2860160171985626,
-0.0351190119981765... |
def unsigned _ range _ value ( ranges : list [ valuerange ] ) - >'possiblevalueset': result = possiblevalueset ( ) result. _ value = 0 result. _ type = registervaluetype. unsignedrangevalue result. _ ranges = ranges result. _ count = len ( ranges ) return result | [
-0.8981979489326477,
0.2168521285057068,
0.26100990176200867,
-0.027657195925712585,
0.36024555563926697,
-0.01107152458280325,
0.010811970569193363,
0.15355992317199707,
0.007898001931607723,
-0.9336187839508057,
0.12282559275627136,
-0.2112543135881424,
-0.5392417311668396,
0.17673024535... |
def createsystemmsgackgui ( self ) : if self. systemmsgackgui = = none or self. systemmsgackgui. isempty ( ) : message = " o " * 100 self. systemmsgackgui = ttdialog. ttglobaldialog ( doneevent = self. systemmsgackguidoneevent, message = message, style = ttdialog. acknowledge, ) self. systemmsgackgui. hide ( ) | [
0.8136351108551025,
0.4976761043071747,
0.6355288624763489,
-0.5292845964431763,
-0.12793053686618805,
0.4689576029777527,
0.3778044581413269,
0.22390566766262054,
-0.2727169394493103,
0.4489933252334595,
-0.14314554631710052,
0.4242807626724243,
-0.49190762639045715,
1.9064217805862427,
... |
def update _ voice _ bot _ history ( transaction _ id, current _ audio _ no, user _ responce ) : try : voicebot _ user _ history. insert _ one ( { " transaction _ id " : str ( transaction _ id ), " current _ audio _ no " : current _ audio _ no, " user _ responce " : user _ responce } ) return true except exception as e... | [
0.28032803535461426,
-0.09073469042778015,
0.8402209877967834,
-0.08886444568634033,
0.13253697752952576,
0.7922794222831726,
0.18610279262065887,
-0.03994133695960045,
-0.05845191702246666,
0.5444256663322449,
-0.2360108643770218,
0.15145881474018097,
-1.112120270729065,
-0.79658198356628... |
def unbecome _ user ( request ) : referer = request. meta. get ('http _ referer ','/') if ('become _ user _ stack'in request. session and len ( request. session ['become _ user _ stack'] ) > 0 ) : become _ user _ stack = [ user for user in request. session ['become _ user _ stack'] ] username = become _ user _ stack. p... | [
-0.7922131419181824,
0.9880770444869995,
0.782845675945282,
0.8053560256958008,
-0.15827202796936035,
0.14546526968479156,
1.2454915046691895,
-0.2700079083442688,
0.5019960403442383,
0.4760541319847107,
-0.2368757724761963,
0.22878946363925934,
-0.32345065474510193,
0.5349065065383911,
... |
def post ( self ) : # se supone que aqui hay que mandarle el settings del recurso y la data que se va a mandar. if request. files : data = request. form. copy ( ) data. update ( request. files ) else : data = request. form # return str ( data ) settings = request. json return register _ qr _ code ( data = data ) | [
-0.4728468060493469,
0.1275382786989212,
0.5442510843276978,
-0.09935205429792404,
0.4786326587200165,
-0.8269100785255432,
-0.8878886699676514,
-0.8154780864715576,
0.2370995581150055,
-0.48582667112350464,
0.3124416172504425,
0.39775025844573975,
-0.06116120517253876,
0.6826616525650024,... |
def build _ wb _ callback _ postpred ( sampler _ model, x _ data, mode ='wandb ', interval = 100 ) : if not hasattr ( sampler _ model,'predict') : raise valueerror ( " expects a samplermodel object. " ) x _ data = np. array ( x _ data ). flatten ( ). reshape ( - 1, 1 ) def callback ( sampler, iteration ) : if iteration... | [
0.5482827425003052,
-0.14893949031829834,
0.8678112030029297,
0.4325762391090393,
-1.3939510583877563,
0.3791596293449402,
0.8197763562202454,
-0.0973527655005455,
-0.39250802993774414,
-0.01366878580302,
0.6336297988891602,
0.26424041390419006,
0.46413400769233704,
0.3904575705528259,
0... |
def flatten _ indices ( self, keep _ in _ memory : bool = false, cache _ file _ name : optional [ str ] = none, writer _ batch _ size : optional [ int ] = 1000, features : optional [ features ] = none, disable _ nullable : bool = true, new _ fingerprint : optional [ str ] = none, ) - > " dataset " : return self. map ( ... | [
-0.9682984352111816,
0.3264433741569519,
0.6005397439002991,
0.7641236186027527,
-0.22377248108386993,
-0.15762414038181305,
0.38985997438430786,
0.5443952083587646,
0.2005685418844223,
-0.03797631338238716,
0.16766898334026337,
0.125893235206604,
-0.4606325626373291,
-0.5244768857955933,
... |
def nth _ child _ production ( self, lexeme, tokens ) : args = self. match ( tokens,'expr') pat = self. nth _ child _ pat. match ( args ) if pat. group ( 5 ) : a = 2 b = 1 if pat. group ( 5 ) = ='odd'else 0 elif pat. group ( 6 ) : a = 0 b = int ( pat. group ( 6 ) ) else : sign = pat. group ( 1 ) if pat. group ( 1 ) els... | [
-0.7051704525947571,
-0.0303487591445446,
0.9067455530166626,
-0.0007545538246631622,
-0.7027682065963745,
-0.21875585615634918,
0.5489281415939331,
-0.7020365595817566,
-0.2140253633260727,
0.4479527473449707,
-0.5050938129425049,
-0.18386146426200867,
-0.5470771789550781,
-0.536104500293... |
def crossover ( self, inda, indb ) : child = [ ] tmp = { } indexa = random. randint ( 0, self. gensize - 1 ) print ( indexa ) indexb = random. randint ( 0, self. gensize - 1 ) print ( indexb ) for i in range ( 0, self. gensize ) : if i > = min ( indexa, indexb ) and i < = max ( indexa, indexb ) : tmp [ inda. genes [ i ... | [
-0.30690333247184753,
-0.20845401287078857,
1.012271761894226,
0.0886642262339592,
-0.889496922492981,
0.25410109758377075,
-0.1486528366804123,
0.5494211316108704,
-0.37061813473701477,
0.3862224519252777,
-0.5756834149360657,
0.5310916304588318,
-0.6598124504089355,
-0.6811416745185852,
... |
def multiplicativeconvcausalattention ( d _ feature, n _ heads = 1, sparsity = none, length _ kernel _ size = 3, dropout = 0. 0, force _ no _ dropout = false, max _ inference _ length = 2048, share _ qk = false, output _ layer _ type ='none ', v _ concat _ type ='none ', mode ='train') : assert output _ layer _ type in... | [
-0.18724851310253143,
0.002271730685606599,
0.963524580001831,
1.0073636770248413,
-0.7881578803062439,
-0.8418835401535034,
0.20532089471817017,
0.26207756996154785,
0.7800372242927551,
0.6560417413711548,
0.10432139039039612,
0.1570056825876236,
0.4262894093990326,
0.8773561716079712,
... |
def get _ action ( self, state ) : # todo : replace the example implementation below with your own search # method by combining techniques from lecture # # example : choose a random move without any search - - this function must # call self. queue. put ( action ) at least once before time expires # ( the timer is autom... | [
-1.0928218364715576,
0.24176673591136932,
0.6144965291023254,
0.40156999230384827,
0.8548120856285095,
0.15452684462070465,
0.42415133118629456,
-1.1461451053619385,
0.5730711221694946,
0.29211539030075073,
-0.8264957666397095,
0.6555398106575012,
-0.09082083404064178,
0.047220755368471146... |
def fasta _ print ( sequence _ number, haplotype _ number, haplotype ) : print ('> seq { 0 } _ hap { 1 } \ n { 2 } '. format ( sequence _ number, haplotype _ number,''. join ( haplotype ) ) ) | [
-0.167832612991333,
-0.5187958478927612,
0.6988028883934021,
0.42075976729393005,
-0.02987912856042385,
-0.23447100818157196,
0.6181507706642151,
0.6081507205963135,
-0.24194000661373138,
0.02441018633544445,
0.3602740466594696,
0.23729373514652252,
-0.04020114988088608,
0.0149759128689765... |
def distance ( self, another ) : return mpmath. sqrt ( mpmath. power ( self. getbelief ( ) - another. getbelief ( ), mpmath. mpf ( " 2 " ) ) + \ mpmath. power ( self. getdisbelief ( ) - another. getdisbelief ( ), mpmath. mpf ( " 2 " ) ) + \ mpmath. power ( self. getuncertainty ( ) - another. getuncertainty ( ), mpmath.... | [
0.1721053123474121,
-1.006894826889038,
0.6581563353538513,
-0.36366021633148193,
-0.7002230882644653,
0.6567233800888062,
0.09847407788038254,
-0.24285325407981873,
-0.10750505328178406,
-0.20945191383361816,
0.11557607352733612,
0.1965002715587616,
-1.0486211776733398,
0.8516130447387695... |
def get _ args ( ) : parser = argparse. argumentparser ( prog ='sam - merger. py ', description = " " " merge a series of sam format files from a chunked alignment pipeline. " " " ) parser. add _ argument ( " - i ", " - - infiles ", required = true, nargs ='+ ', help = " the sam files to merge ( include all file names ... | [
0.22738391160964966,
-0.4801444411277771,
0.9195056557655334,
0.260294646024704,
0.36836758255958557,
-0.13930436968803406,
-0.25758951902389526,
0.5709578394889832,
-0.6749604344367981,
-0.3133831024169922,
-0.3408800959587097,
-0.27543219923973083,
-0.3296951353549957,
0.1891243010759353... |
def check _ aea _ project ( f : callable, check _ aea _ version : bool = true, check _ finger _ prints : bool = false ) - > callable : def wrapper ( * args : any, * * kwargs : any ) - > callable : _ check _ aea _ project ( args, check _ aea _ version = check _ aea _ version, check _ finger _ prints = check _ finger _ p... | [
-0.9310976266860962,
-0.3042663633823395,
0.5310247540473938,
0.33322638273239136,
-0.2673158049583435,
0.664171040058136,
0.7001231908798218,
0.3410571813583374,
0.4121438264846802,
1.3386564254760742,
1.135085940361023,
-0.003262702375650406,
0.5311902165412903,
0.4747753441333771,
-0.... |
def suites _ from _ doc _ list ( test _ docs : list [ parser. document ], suite _ filter : str = none, case _ filter : str = none ) - > list [ suite ] : return [ suite ( spec, suite _ filter, case _ filter ) for spec in suite _ configs _ from ( test _ docs ) ] | [
-0.152368426322937,
-0.1997976303100586,
0.20775555074214935,
1.3690967559814453,
-0.2943248152732849,
0.3460094630718231,
0.34318479895591736,
0.27192360162734985,
0.48077431321144104,
0.7720812559127808,
-0.7094023823738098,
0.27123674750328064,
-0.17151859402656555,
1.0721120834350586,
... |
def delete _ data ( self, paths _ list, end _ time ) : request = tsdeletedatareq ( self. _ _ session _ id, paths _ list, - 9223372036854775808, end _ time ) try : status = self. _ _ client. deletedata ( request ) logger. debug ( " delete data from { }, message : { } ". format ( paths _ list, status. message ) ) except ... | [
-0.6983568072319031,
0.12937773764133453,
0.4848479628562927,
0.31426841020584106,
0.5335500836372375,
0.3092121183872223,
-0.1036536917090416,
0.5641024112701416,
-0.7846354246139526,
0.4398706257343292,
-0.7415599822998047,
-0.006793452892452478,
-0.20157407224178314,
0.1367523968219757,... |
def build _ generator ( self ) : # weight initialization init = randomnormal ( stddev = 0. 02 ) # label input in _ label = input ( shape = ( 1, ) ) # embedding for categorical input li = embedding ( self. n _ classes, 50 ) ( in _ label ) # linear multiplication n _ nodes = 7 * 7 li = dense ( n _ nodes, kernel _ initial... | [
-1.017622947692871,
0.24828070402145386,
0.8233824968338013,
0.2745480239391327,
-0.01701831817626953,
0.7910684943199158,
0.10940536856651306,
0.2031499296426773,
-0.810399055480957,
0.1884121596813202,
-0.03635775297880173,
-0.41614830493927,
0.6762424111366272,
0.6697927117347717,
0.0... |
def _ _ init _ _ ( self, auth = none, source = none ) : if not auth and not source : raise blekkoerror ('api key not provided') self. auth = auth self. source = source | [
-0.3016084134578705,
0.6602274775505066,
0.3134519159793854,
0.00643540546298027,
-0.12604884803295135,
-0.35690250992774963,
-0.4912530779838562,
1.2461698055267334,
0.5929220914840698,
0.23868437111377716,
-0.1506284773349762,
0.6854471564292908,
0.19034987688064575,
0.8032712340354919,
... |
def cleanuperrors ( self, errs ) : self. _ calls. append ('cleanuperror') | [
-0.5147287845611572,
-0.07506551593542099,
0.1498236060142517,
0.07622697204351425,
0.649054765701294,
0.2742249667644501,
-0.17441034317016602,
0.0534430667757988,
1.3605455160140991,
-0.7704281210899353,
-0.24845387041568756,
0.02335141785442829,
-0.07881367951631546,
0.9428516626358032,... |
def get _ inner _ neighbors ( self, p : point, wall _ points : dict [ tuple [ int, int ], point ] ) - > dict [ tuple [ int, int ], point ] : neighbors : dict [ tuple [ int, int ], point ] = dict ( ) up = ( p. x, p. y + 1 ) if up not in wall _ points : neighbors [ up ] = point ( up [ 0 ], up [ 1 ] ) down = ( p. x, p. y ... | [
-0.006134954281151295,
0.18060302734375,
0.6597882509231567,
0.07913525402545929,
-0.1629665195941925,
0.29630401730537415,
-0.04836905747652054,
-0.30768293142318726,
-0.9569471478462219,
0.47085514664649963,
-0.8903399705886841,
0.40229055285453796,
-1.388326644897461,
-0.104978121817111... |
def test _ invalid _ dates ( self ) : # provide an ` ` end _ date ` ` value that is before ` ` start _ date ` ` form = self. form _ data ( start _ date = " 2020 - 06 - 27 ", end _ date = " 2020 - 06 - 22 ", note = " some note content from test ", slack _ channel = " # slack ", project _ type = self. project _ type. pk,... | [
0.07333388179540634,
0.8979511857032776,
0.5136739611625671,
-0.3973871171474457,
0.7290400266647339,
0.9915902614593506,
-0.3852651119232178,
0.27642446756362915,
-0.6189572811126709,
-0.8172385692596436,
-0.34146344661712646,
0.6905481219291687,
-0.1732996255159378,
0.6012453436851501,
... |
def duplicate _ predicate ( self, predicate, predicate _ list ) : if isinstance ( predicate, predicate ) : new _ predicate _ list = copy. deepcopy ( predicate _ list ) return [ x for x in new _ predicate _ list if x! = predicate ] | [
-0.620176374912262,
-0.3020729422569275,
0.5203723311424255,
1.4667719602584839,
-0.277229905128479,
0.49244141578674316,
-1.0414600372314453,
0.6517964601516724,
0.48786255717277527,
1.086180329322815,
-0.7727547883987427,
1.210192084312439,
-0.8001099824905396,
0.39943844079971313,
-0.... |
def page ( title, description, element _ list = none, tab _ list = none ) : _ page = {'type':'page ','title': title,'description': description,'data': { }, } if element _ list is not none : if isinstance ( element _ list, list ) : _ page ['data'] ['elements'] = element _ list else : _ page ['data'] ['elements'] = [ ele... | [
-0.3758099675178528,
0.5688473582267761,
0.7167290449142456,
-0.5304091572761536,
-0.22870855033397675,
0.6534227728843689,
-1.1959052085876465,
0.5557442307472229,
-0.19748243689537048,
0.2949275076389313,
-0.13090349733829498,
0.14020827412605286,
-0.317486435174942,
0.48434770107269287,... |
def _ check _ params ( model _ params ) : if " objective " in model _ params : if model _ params [ " objective " ]! = " multi : softprob " : raise valueerror ( " the name of objective function must be'multi : softprob '. " ) else : model _ params [ " objective " ] = " multi : softprob " if " num _ class " not in model ... | [
0.011042654514312744,
0.3500966727733612,
0.6771809458732605,
1.1194664239883423,
0.12139348685741425,
0.9532960653305054,
-0.47765877842903137,
0.11907240748405457,
-0.6339699029922485,
1.2750585079193115,
0.11229116469621658,
-0.05467212200164795,
0.37297523021698,
1.2183893918991089,
... |
def push ( self, x ) : assert self. _ data is not none if len ( self. _ data ) < self. _ n : heapq. heappush ( self. _ data, x ) else : heapq. heappushpop ( self. _ data, x ) | [
-0.3193276822566986,
1.4936416149139404,
0.5522705316543579,
-0.29956284165382385,
-0.6079493165016174,
0.5868915319442749,
-1.5486993789672852,
-1.3827719688415527,
0.6092938184738159,
-0.011985641904175282,
-1.1224071979522705,
0.6610477566719055,
0.15566414594650269,
0.29456236958503723... |
def test _ get _ module _ non _ exosims _ error _ modtype _ wrong ( self ) : module = " tests. testmodules. planetpopulation. planetpopulationerrormodtype " modtype = " planetpopulation " with self. assertraises ( assertionerror ) : m = get _ module ( module, modtype ) | [
-0.5990707278251648,
-0.0023413626477122307,
0.2626647353172302,
0.5746628642082214,
1.1539524793624878,
1.254286289215088,
-0.16376948356628418,
-0.6197347640991211,
0.49420106410980225,
0.7936075925827026,
0.3595935106277466,
1.1494312286376953,
-0.40530580282211304,
1.0044400691986084,
... |
def mo _ ref _ id ( self ) - > optional [ str ] : return pulumi. get ( self, " mo _ ref _ id " ) | [
1.1676535606384277,
-0.5963091254234314,
0.43670153617858887,
0.4326113164424896,
0.45988282561302185,
0.8360769748687744,
-0.09178489446640015,
-0.08938128501176834,
1.2242443561553955,
0.27149951457977295,
1.2427561283111572,
1.251063346862793,
-0.20852430164813995,
-0.15563993155956268,... |
def init _ actions _ ( service, args ) : return {'test': ['install'] } | [
0.04632379114627838,
-0.6609676480293274,
0.2083422839641571,
0.1862117052078247,
0.8784199357032776,
-0.8685214519500732,
0.3936547040939331,
-0.3434707522392273,
0.2525630593299866,
0.6884211897850037,
-0.5777081251144409,
0.19462716579437256,
-0.20316436886787415,
0.673438549041748,
-... |
def terminalerror ( self, message ) : self. model. messages. visible = false evt = gevent. event. event ( ) def dialogue _ close _ callback ( loop = none, data = none ) : evt. set ( ) self. mainframe. showerrormessage ( message, dialogue _ close _ callback ) return evt | [
-0.39504727721214294,
0.30809295177459717,
0.5525793433189392,
-0.8658444285392761,
-0.9185399413108826,
0.7170015573501587,
-0.08159246295690536,
-0.4243444502353668,
-0.15456661581993103,
0.3593507707118988,
0.1939917802810669,
0.6310000419616699,
-0.39227959513664246,
0.2998226881027221... |
def _ _ init _ _ ( self, data : dict = none, version : int = 0 ) : super ( ). _ _ init _ _ ( ) self. _ _ attachments = { } if data is not none : self. on _ data _ received ( data, version ) | [
0.6090261340141296,
-0.22219890356063843,
0.813269853591919,
-0.1275833249092102,
-0.7153482437133789,
-0.06849808990955353,
-0.7342931628227234,
0.3649722635746002,
0.6833696961402893,
-0.5843060612678528,
-0.6282221674919128,
-0.2462073415517807,
-0.17546629905700684,
0.6782309412956238,... |
def execute ( * args, * * kwargs ) : conn = connection ( ) cur = conn. cursor ( ) try : cur. execute ( * args, * * kwargs ) except psycopg2. error as err : logger. error ( err ) finally : cur. close ( ) conn. close ( ) | [
-0.06209892779588699,
-0.3712974190711975,
0.6792926788330078,
0.7378421425819397,
0.30750131607055664,
0.20752422511577606,
-1.4320495128631592,
-0.09045210480690002,
-1.2938590049743652,
0.2336585372686386,
0.4675782322883606,
0.045463740825653076,
-0.5649727582931519,
-0.523085057735443... |
def getdensity ( lengths, minval, maxval ) : n, bins, patches = plt. hist ( lengths, bins = 100, range = ( minval, maxval ), density = true ) plt. clf ( ) return ( n, bins ) | [
0.28025558590888977,
0.05532389134168625,
0.39077702164649963,
-0.8720934391021729,
0.04024431109428406,
0.20900945365428925,
-0.014533627778291702,
0.09417153894901276,
-0.008336203172802925,
-0.4351348876953125,
-0.174160897731781,
0.6587697863578796,
1.21071195602417,
0.1028922945261001... |
def build _ element ( root, cval ) : if hasattr ( cval,'_ _ iter _ _') : for sval in cval : c = etree. element ( root. tag [ : - 1 ] ) c. text = str ( sval ) root. append ( c ) else : root. text = none if cval is none else str ( cval ) | [
0.14603649079799652,
-0.5360046625137329,
0.5133931636810303,
0.48750150203704834,
-0.3960663676261902,
0.1606089323759079,
-0.8097213506698608,
-0.008170109242200851,
0.35381391644477844,
-0.11660122126340866,
0.1810920089483261,
0.22083339095115662,
-0.04457409307360649,
0.76024192571640... |
def process ( self, datapoint : datapoint, t2 _ views : sequence [ t2docview ] ) - > ubson | unitresult : | [
-0.420302152633667,
0.18587586283683777,
0.11750860512256622,
-0.09759049117565155,
0.26168879866600037,
-0.22641506791114807,
0.2761441469192505,
-0.696282684803009,
0.4601966142654419,
-1.1375031471252441,
0.3207264542579651,
-0.23079313337802887,
0.49095243215560913,
-0.2929084002971649... |
def save _ file ( returntext = emptychar, filename = emptychar, folder = os. altsep +'textfiles') : directoryname = os. getcwd ( ) + folder with open ( directoryname + os. altsep + filename + '. txt ','x ', encoding ='utf - 8') as textfile : textfile. write ( returntext. replace ('\ ufeff ', emptychar ) ) return'saved ... | [
0.21829287707805634,
-0.032669052481651306,
0.4877699613571167,
-0.42497873306274414,
0.13653986155986786,
0.3540342450141907,
-0.2776634097099304,
1.2200158834457397,
-0.7498807907104492,
0.8447562456130981,
-0.5997521281242371,
-0.3247411549091339,
-0.552797257900238,
-0.33365598320961,
... |
def _ data _ limits _ table ( ) : dlimits _ dict = dict ( ) dlimits _ dict. update ( {'dbz': ( 60., - 10. ) } ) dlimits _ dict. update ( {'zdr': ( 5., - 1. 5 ) } ) dlimits _ dict. update ( {'kdp': ( 7., - 10. ) } ) dlimits _ dict. update ( {'rhohv': ( 5. 23, - 50. ) } ) dlimits _ dict. update ( {'h _ iso0': ( 5000., - ... | [
0.37982240319252014,
0.14822402596473694,
0.6586600542068481,
-1.0927088260650635,
-0.9515379667282104,
0.08021780848503113,
-1.0325062274932861,
-0.25726553797721863,
-0.6286280751228333,
0.45502686500549316,
-1.3187617063522339,
0.03524935618042946,
0.2884519696235657,
-0.206874102354049... |
def _ build _ summary ( self, text, query ) : if not query : return text [ : 500 ] if not text : return'' return shorten _ result ( text, query. split ( ), maxlen = 500 ) | [
-0.5614839196205139,
0.6207461357116699,
0.14270231127738953,
-0.19702833890914917,
-1.053701400756836,
-0.0379926860332489,
-0.4954497814178467,
0.35362550616264343,
1.1423090696334839,
0.8851829171180725,
0.5991917252540588,
0.38633742928504944,
-0.556279182434082,
-0.338907390832901,
... |
async def test _ flow _ invalid _ 2fa ( hass, aioclient _ mock ) : from homeassistant. components. hangouts. hangups _ utils import google2faerror flow = config _ flow. hangoutsflowhandler ( ) flow. hass = hass with patch ( " homeassistant. components. hangouts. config _ flow. get _ auth ", side _ effect = google2faerr... | [
-0.5310342907905579,
-0.10773900151252747,
0.32986724376678467,
0.787882387638092,
0.611355721950531,
0.12036081403493881,
0.4538901746273041,
0.213596910238266,
-0.10508638620376587,
-1.0161999464035034,
-0.5914509296417236,
0.2823532223701477,
0.6153639554977417,
0.35145530104637146,
1... |
def make _ rectangle ( self, height, width, blank = false, divider = 0, box _ char = none ) : if box _ char is none : box _ char = box _ char _ normal textlist = [ ] if not blank : for y in range ( 0, height ) : if y = = 0 : textlist. append ( box _ char ['lu'] + box _ char ['h'] * ( width - 2 ) + box _ char ['ru'] ) e... | [
-0.846903383731842,
-0.25378546118736267,
0.809059202671051,
-0.4993024170398712,
-0.8661449551582336,
-0.5988323092460632,
-0.06918493658304214,
0.34869319200515747,
-0.012043289840221405,
0.21247968077659607,
-0.7370445132255554,
-0.25503432750701904,
-0.023261994123458862,
0.02663683518... |
def infer _ init ( self ) : inputs = self. model. create _ inputs ( mode ='infer _ init') output _ dict = self. model. infer _ init ( inputs ) fetch _ dict = ordereddict ( ) fetch _ dict ['prev _ hidden'] = output _ dict ['user _ feature'] return {'feed _ names': inputs. keys ( ),'fetch _ dict': fetch _ dict } | [
-0.41949567198753357,
-0.5300137996673584,
0.49386125802993774,
-0.24780593812465668,
-0.6267169117927551,
-0.1160576194524765,
-0.05852413922548294,
-0.7702566385269165,
-1.5931898355484009,
-0.16054819524288177,
-1.707554817199707,
0.41359034180641174,
0.6607359647750854,
0.6567168831825... |
def get _ branch _ name ( text ) : if not text : return none text = text. lower ( ) for branch in sourcestamps _ branch : for pat in sourcestamps _ branch [ branch ] : if pat. match ( text ) : return branch return text | [
1.3566668033599854,
-0.40130433440208435,
0.5383337736129761,
0.21438860893249512,
-1.0101126432418823,
0.38510555028915405,
-0.22270843386650085,
-0.2567691504955292,
-0.0012686167610809207,
-0.13200989365577698,
-0.08318421989679337,
-0.504379153251648,
-0.7495625615119934,
0.30986690521... |
def apply ( self, als ) : logger. info ( " icedriftcorrection is applied " ) # 1. initialise icedriftstation self. _ get _ icedriftstation ( als, use _ polarstern = self. cfg [ " use _ polarstern " ] ) # 2. initialise empty x, y arrays in als for the projection als. init _ icedriftcorrection ( ) # 3. mask nan values fo... | [
-0.2760721743106842,
-0.7755670547485352,
0.7142863869667053,
-0.867766797542572,
0.03927865996956825,
0.7548672556877136,
0.16339701414108276,
0.49779847264289856,
0.4950264096260071,
0.19776040315628052,
0.2636107802391052,
-0.21035243570804596,
0.1297503262758255,
-0.1540554016828537,
... |
def test _ delete _ multiple _ alumno _ curso _ admin _ incorrect ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) alumno _ 1 = alumno. objects. get ( apellido = " 1 " ). pk curso _ 1 = curso. objects. get ( nombre = " curso1 " ). pk anio _ lectivo _ 1 = aniolectivo. objects. get ( nombre = "... | [
0.1590214967727661,
-0.36031174659729004,
0.6160950660705566,
-0.01959340088069439,
0.49418169260025024,
0.5474522709846497,
0.14729447662830353,
0.5039368867874146,
0.11945334821939468,
0.37285488843917847,
-0.8581202030181885,
0.1859818547964096,
0.1039365828037262,
0.4466022253036499,
... |
def stalled ( s ) : # type : ( state ) - > bool return s. status = = stalled | [
-0.49737805128097534,
-0.3367029130458832,
0.2633092403411865,
0.276391863822937,
-0.4742705821990967,
0.30466675758361816,
-0.4331115782260895,
0.36879995465278625,
0.8995510339736938,
-0.01987193524837494,
-0.2713620066642761,
-0.2871738374233246,
0.21482393145561218,
-0.6110805869102478... |
def go ( servos, targets, drive ) : pairs = zip ( servos, targets ) while any ( [ servo. pos! = target for servo, target in pairs ] ) : for servo, target in pairs : if servo. pos < target : servo. pos + = 1 elif servo. pos > target : servo. pos - = 1 drive. sync ( ) time. sleep ( settings. tickdelay ) | [
-0.3649027645587921,
-0.3829987049102783,
0.4824666678905487,
0.12992900609970093,
0.8147624135017395,
-0.15676933526992798,
0.25079986453056335,
0.11720260977745056,
-0.5379741787910461,
-0.024557223543524742,
-0.2846682369709015,
0.5367420315742493,
-0.5814920663833618,
-0.39644026756286... |
def objects _ with _ flag ( self, flag, content _ type = none ) : content _ flag _ object = self. get _ flag _ object ( flag ) if content _ type : content _ type _ object = contenttype. objects. get ( id = int ( content _ type ) ) instances = contentflaginstance. objects. filter ( content _ type = content _ type _ obje... | [
0.2747349441051483,
-0.23138202726840973,
0.4316481947898865,
0.08936897665262222,
0.218712717294693,
0.21541520953178406,
-0.353842169046402,
-0.26735207438468933,
-0.8554192781448364,
-0.05043528228998184,
-0.43530604243278503,
0.9287905693054199,
-1.0225633382797241,
0.6461585164070129,... |
def basc _ init _ collectd _ version ( self, log ) : if not self. basc _ is _ up ( log ) : self. basc _ collectd _ version = clog. error _ msg return collectd _ version = self. basc _ agent. bea _ collectd _ version ( log ) if collectd _ version is none : self. basc _ collectd _ version = clog. error _ msg self. basc _... | [
0.6553903818130493,
-0.9776178002357483,
0.6843752861022949,
0.16078221797943115,
0.27686336636543274,
0.6668077707290649,
0.6992918848991394,
-0.4024921953678131,
-0.15672169625759125,
0.7270263433456421,
-0.42312946915626526,
0.9455066919326782,
0.7996498942375183,
0.16495443880558014,
... |
def get _ paths ( name ) : path = " data / " + name + ". csv " return path | [
-0.2180875688791275,
0.11619751900434494,
0.3468008041381836,
0.6400108933448792,
-0.22763971984386444,
0.2856042683124542,
0.25497081875801086,
-0.055057674646377563,
-0.5392688512802124,
0.08948540687561035,
-0.6365624070167542,
-0.013344298116862774,
0.5879073739051819,
0.21366901695728... |
def test _ create _ pfe _ stand _ alone _ deliverysystem _ 2 ( self, context ) : # these could come from a data file id = " post _ vedevices _ allconfigadminmulticasttruetwo " pfe _ name = " post _ vedevices _ allconfigadminmulticasttruetwo " devicehost = " post _ vedevices " # define a test step with pytest. allure. s... | [
0.11980555951595306,
0.43151727318763733,
0.5642061829566956,
0.6838481426239014,
0.3838120996952057,
0.9652048945426941,
0.10922204703092575,
-0.13763202726840973,
0.3558470904827118,
-0.35151028633117676,
-1.1751545667648315,
0.09567877650260925,
0.736856997013092,
0.7210726737976074,
... |
def visit _ module ( self, node, cls = ast. module ) : # pylint : disable = invalid - name return ast. fix _ missing _ locations ( self. process _ script ( node, cls ) ) | [
-1.1229335069656372,
-0.4956910312175751,
0.35082507133483887,
-1.0287344455718994,
-0.046435702592134476,
-0.3658205568790436,
0.5604527592658997,
-0.0972406342625618,
0.6126837730407715,
1.092329740524292,
0.6038882732391357,
1.1706483364105225,
0.8839424252510071,
0.8461839556694031,
... |
def roundedrectangle ( x, y, w, h, radius = 20, fill = 255, outline = 50 ) : rectangle = image. new ('l ', ( w, h ), white ) draw = imagedraw. draw ( rectangle ) draw. rectangle ( [ ( 0, 0 ), ( w, h ) ], fill = fill, outline = outline ) draw. line ( [ ( radius, h - 1 ), ( w - radius, h - 1 ) ], fill = outline, width = ... | [
0.008388449437916279,
-0.6292524337768555,
1.0134551525115967,
-1.4334125518798828,
-0.41226425766944885,
0.09434057772159576,
-0.18884526193141937,
-0.8377225995063782,
0.21566255390644073,
-0.3663991391658783,
0.34041866660118103,
0.29366815090179443,
-0.055317673832178116,
0.71486645936... |
def translate _ words _ to _ ids ( tf _ articles, word _ id _ map ) : def flatten ( x ) : article _ id, counts = x elems = [ ( c [ 0 ], ( article _ id, c [ 1 ] ) ) for c in counts ] return elems def map _ tokens _ to _ ids ( x ) : ( token, ( ( doc _ id, count ), token _ id ) ) = x return ( doc _ id, ( token _ id, count... | [
0.18057741224765778,
0.02759985625743866,
0.30402496457099915,
-1.099158525466919,
-0.021897630766034126,
-0.687296986579895,
0.38041070103645325,
0.06844291090965271,
-0.3697650134563446,
0.9514355063438416,
-0.21776433289051056,
0.1646486222743988,
-0.4601646959781647,
-0.564950883388519... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.