text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def fitallgraphstoviewsnow ( self ) - > none :... | [
0.04579302296042442,
0.053473301231861115,
0.2688097655773163,
1.249752402305603,
-0.2967856824398041,
-0.14318953454494476,
1.0823653936386108,
0.09686549752950668,
0.07125746458768845,
-0.7742740511894226,
-0.5674726366996765,
0.8246586322784424,
-0.4323992133140564,
0.917679488658905,
... |
def showwelcomeanimation ( ) : # index of player to blit on screen birdindex = 0 # cycles the birds wings playerindexgen = cycle ( [ 0, 1, 2, 1 ] ) # iterator used to change playerindex after every 5th iteration loopiter = 0 playerx = int ( screenwidth * 0. 2 ) playery = int ( ( screenheight - images ['bird'+ str ( bir... | [
-0.07831429690122604,
0.4929550588130951,
0.8602768778800964,
-0.4127565324306488,
-1.1787549257278442,
0.19143973290920258,
0.18587392568588257,
-1.0961318016052246,
-0.11192207038402557,
0.7835481762886047,
-0.04191635921597481,
0.36128905415534973,
-0.4580068588256836,
1.15509831905365,... |
def distance ( self, replacee ) : for similar _ word _ list in self. _ similar _ word _ lists : try : return similar _ word _ list. index ( replacee ) except : continue return - 1 | [
-0.14485371112823486,
0.3134649395942688,
0.5475788712501526,
0.0008249057573266327,
-0.9850094318389893,
0.5901320576667786,
0.7743247151374817,
1.829387903213501,
0.25502318143844604,
0.5593420267105103,
-0.7303299903869629,
0.4635242819786072,
-1.7481564283370972,
0.969822883605957,
0... |
def _ _ len _ _ ( self ) : if len ( self. shape ) : return self. shape [ 0 ] else : return typeerror ( " scalar has no len ( ) " ) | [
0.7732966542243958,
-0.1405932605266571,
0.7581105828285217,
-0.7126978635787964,
0.7548890709877014,
-0.2512455880641937,
0.6858464479446411,
-0.23394545912742615,
0.8271868824958801,
-0.241295725107193,
-0.25082308053970337,
0.4539741277694702,
0.0451803132891655,
-0.07320325076580048,
... |
def fixed ( self ) : return getattr ( self, " _ fixed " ) | [
-0.07529761642217636,
0.10281719267368317,
0.3486230671405792,
0.071339912712574,
0.12346967309713364,
0.4264991879463196,
1.1348234415054321,
-0.4493967592716217,
-0.11569975316524506,
-0.6266041994094849,
-0.8445785045623779,
0.31427282094955444,
0.30912280082702637,
-0.09891773760318756... |
def preprocess _ im ( im ) : if rescale _ size is not none : im = np. squeeze ( im, axis = - 1 ) im = skimage. transform. resize ( im, [ rescale _ size, rescale _ size ], mode ='constant ', preserve _ range = true ) im = np. expand _ dims ( im, axis = - 1 ) im = im / 255. * 2. - 1. return np. clip ( im, - 1., 1. ) | [
-0.40345823764801025,
0.07063211500644684,
0.850368320941925,
0.3172764778137207,
-0.45294249057769775,
-0.6757089495658875,
0.702265739440918,
-0.32391852140426636,
1.178741455078125,
0.5137227773666382,
0.9681930541992188,
-0.34794825315475464,
0.02144531160593033,
0.13538818061351776,
... |
def test _ _ sticker _ _ hash ( ) : sticker _ id = 202201070030 guild _ id = 202201070031 available = true description ='komeiji'name ='koishi'pack _ id = 202201070032 sort _ value = 4 sticker _ format = stickerformat. png sticker _ type = stickertype. guild tags = ['rin ','okuu'] user = user. precreate ( 202201070033 ... | [
1.097005844116211,
0.4646832346916199,
0.6607772707939148,
0.4888859987258911,
-0.07574453949928284,
0.5885834693908691,
0.18382517993450165,
-0.7476467490196228,
-0.5674728155136108,
-0.7678687572479248,
-1.0145273208618164,
-0.2438444197177887,
-0.8826627731323242,
0.5317500829696655,
... |
def has _ start _ notification ( self ) : return self. notification _ begin | [
0.06804392486810684,
-0.22401420772075653,
0.5781015753746033,
0.8480170965194702,
0.08530610799789429,
0.47964927554130554,
0.4753955602645874,
0.7757359743118286,
-0.2093295454978943,
0.5706350803375244,
-1.0354030132293701,
0.5909833908081055,
-0.37817177176475525,
0.4052283763885498,
... |
def build _ graph ( self ) - > none : with tf. name _ scope ('embedding _ layer') : # initialize user - item matrices and biases self. user _ embeddings = tf. get _ variable ('user _ embeddings ', shape = [ self. num _ users, self. dim ], initializer = tf. contrib. layers. xavier _ initializer ( ) ) self. item _ embedd... | [
-0.21296775341033936,
-0.2320273071527481,
0.4006851613521576,
0.5858579874038696,
-0.0021627391688525677,
0.7080485224723816,
0.760823667049408,
1.0581681728363037,
-0.051989633589982986,
0.5255796909332275,
-0.30961886048316956,
0.6884810924530029,
0.19059744477272034,
-0.515188336372375... |
def value _ from _ datadict ( self, data, files, name ) : related _ value = data. get ( self. related _ form _ field _ name, none ) if isinstance ( data, ( multivaluedict, mergedict ) ) : return tuple ( [ ( item, related _ value ) for item in data. getlist ( name ) ] ) return ( data. get ( name, none ), related _ value... | [
-0.07252978533506393,
0.40856191515922546,
0.4127967953681946,
-1.190525770187378,
-0.33417895436286926,
-0.26135581731796265,
-0.9642319679260254,
0.5269139409065247,
0.03126489743590355,
-0.3720003664493561,
-0.5700944662094116,
-0.6550299525260925,
0.14167723059654236,
0.474547535181045... |
def create _ empty _ collection ( host, clowder _ user, clowder _ pass, collectionname, description, parentid = none, spaceid = none ) : logger = logging. getlogger ( _ _ name _ _ ) if parentid : if ( spaceid ) : url ='% sapi / collections / newcollectionwithparent'% host result = requests. post ( url, headers = { " co... | [
-0.19599522650241852,
0.02141847461462021,
0.8601291179656982,
0.07960386574268341,
0.04846201837062836,
0.5279157757759094,
-0.6011797785758972,
-1.0184409618377686,
-0.5017222166061401,
0.13909581303596497,
-0.3077574074268341,
0.8834648728370667,
-0.7686079740524292,
1.3592150211334229,... |
def type _ of _ user ( datum, city ) : # your code here return user _ type | [
-0.33667880296707153,
0.4663175046443939,
0.20483645796775818,
0.8895103931427002,
0.22998598217964172,
0.030333707109093666,
0.9262350797653198,
0.07007355988025665,
0.485409677028656,
-0.2924719452857971,
-0.44721558690071106,
0.5196194648742676,
-0.3733852505683899,
-0.8092783689498901,... |
async def test _ set _ invalid _ property ( v3 _ server, v3 _ settings _ response ) : v3 _ server. post ( ( f " https : / / api. simplisafe. com / v1 / ss3 / subscriptions / { test _ subscription _ id } " " / settings / normal " ), status = 200, body = v3 _ settings _ response, ) async with aiohttp. clientsession ( ) a... | [
0.24039089679718018,
0.7925559282302856,
0.328290194272995,
0.10524435341358185,
0.8461444973945618,
0.20227821171283722,
-1.1067243814468384,
-0.809496283531189,
0.7944703698158264,
0.04099392518401146,
-0.5454602837562561,
0.45152005553245544,
-0.3816743493080139,
0.12032684683799744,
... |
def falsefunc ( self, data ) : return false | [
-0.6890358924865723,
-0.2811511158943176,
0.26836392283439636,
-0.09971901774406433,
0.3489772379398346,
0.42734619975090027,
0.3977009356021881,
0.2907017767429352,
-0.007921970449388027,
-1.1422572135925293,
-0.4482007920742035,
-0.5532763600349426,
-0.9438363909721375,
-0.16821201145648... |
async def delete _ button ( self, ctx : context, *, name : str ) - > none : if ctx. guild. id not in self. views : self. views [ ctx. guild. id ] = { } async with self. config. guild ( ctx. guild ). buttons ( ) as buttons : if name in buttons : role _ id = buttons [ name ] [ " role _ id " ] custom _ id = f " { name. lo... | [
0.8038761615753174,
-0.13419020175933838,
0.937926709651947,
0.08061984181404114,
0.05707043781876564,
-0.07672642916440964,
-0.34888938069343567,
0.4660642147064209,
0.9755117297172546,
0.016803527250885963,
-1.065474033355713,
0.9043562412261963,
-0.3929363191127777,
0.25314685702323914,... |
def function _ not _ called ( module, name ) : called = [ ] @ transient _ function _ wrapper ( module, name ) def _ function _ not _ called _ ( wrapped, instance, args, kwargs ) : called. append ( true ) return wrapped ( * args, * * kwargs ) @ function _ wrapper def wrapper ( wrapped, instance, args, kwargs ) : new _ w... | [
-0.8113963007926941,
0.14125394821166992,
0.6580681204795837,
-0.9280591607093811,
0.1771109253168106,
0.20744523406028748,
-0.6987043023109436,
-0.3444201350212097,
0.2971073091030121,
0.08218667656183243,
-0.5853309631347656,
0.35247474908828735,
-0.6079162359237671,
-0.07320790737867355... |
def draw ( self, point, layer = 0, terminal = none, default _ bg _ color = none ) : terminal = terminal or nice _ terminal for call in self. _ draw _ calls _ by _ layer [ layer ] : ( p, value, fg, bg ) = call terminal. color ( fg ) if bg is not none : terminal. bkcolor ( bg ) elif default _ bg _ color is not none : ter... | [
0.12664225697517395,
1.1639684438705444,
0.5022006630897522,
0.3941948115825653,
0.8192449808120728,
0.3938082158565521,
-0.9721243381500244,
-0.6881929636001587,
-0.4954729378223419,
-0.10210822522640228,
0.024406446143984795,
0.6000499129295349,
-0.3971329927444458,
1.0876221656799316,
... |
def _ set _ filter _ list ( self, v, load = false ) : if hasattr ( v, " _ utype " ) : v = v. _ utype ( v ) try : t = yangdynclass ( v, base = filter _ list. filter _ list, is _ container ='container ', presence = false, yang _ name = " filter - list ", rest _ name = " filter - list ", parent = self, path _ helper = sel... | [
-0.5626726746559143,
0.22942271828651428,
0.615833044052124,
0.2471400499343872,
0.45686689019203186,
-1.1368967294692993,
1.005184292793274,
-0.6917999386787415,
0.5666759014129639,
1.0923874378204346,
-0.723421037197113,
-0.12514440715312958,
-0.1120569258928299,
0.9526706337928772,
0.... |
def processlists ( cf, is _ quiet ) : out = { } for name in ('blacklist ','whitelist') : out [ name ] = processlists ( cf, name ) if not is _ quiet : out [ name ]. print _ records ( f'{ name } - { cf. outdirs [ " lists " ] [ name ] }') return out | [
-0.4898730516433716,
0.2294457107782364,
0.3264433741569519,
-0.6304264664649963,
-0.043009061366319656,
-0.5578474402427673,
-0.19419948756694794,
-0.2402183711528778,
-0.13929252326488495,
0.5700557827949524,
-0.6851013898849487,
0.47873416543006897,
-0.1814279407262802,
1.49547779560089... |
def get _ geotweet _ count _ by _ dates ( self, start _ date = none, end _ date = none, senti _ class = none ) : tweets = self. get _ geotweets _ by _ dates ( start _ date, end _ date, senti _ class ) return len ( tweets ) | [
-0.04523827135562897,
0.17670990526676178,
0.4914081394672394,
0.09110070765018463,
0.44848644733428955,
0.49713635444641113,
0.06367172300815582,
-0.020745163783431053,
-1.3614675998687744,
0.3070584535598755,
-0.20135176181793213,
0.23339185118675232,
0.6280213594436646,
0.13351869583129... |
def _ load _ visit _ data ( handle ) : logging. info ('loading visit data from { } '. format ( handle. name ) ) result = pd. read _ csv ( handle, index _ col = 0 ) logging. info ('result is a table with shape { } '. format ( result. shape ) ) return result | [
-0.27760040760040283,
0.5533255338668823,
0.5152194499969482,
-0.5257847309112549,
-0.6712561845779419,
0.03797761723399162,
1.0105290412902832,
-0.4588187634944916,
-0.9704445600509644,
-0.287350594997406,
0.49697017669677734,
0.866143524646759,
-0.4058108925819397,
-1.1226773262023926,
... |
def close ( self ) : self. _ parser. parse ( " ", true ) | [
0.5502392053604126,
-0.3060804009437561,
0.374254047870636,
-1.07113778591156,
-0.11214585602283478,
1.4052164554595947,
-0.30089861154556274,
0.37351879477500916,
-0.9584341049194336,
-0.8543729782104492,
-0.06366714090108871,
-0.09475372731685638,
-1.2564454078674316,
0.4401477873325348,... |
def delete _ indirect _ files _ list ( working _ dir ) : paths = [ get _ indirect _ inputs _ path ( working _ dir ), get _ indirect _ outputs _ path ( working _ dir ), get _ indirect _ parameters _ path ( working _ dir ), ] for path in paths : try : os. remove ( path ) except filenotfounderror : pass | [
-0.041610922664403915,
-0.564150333404541,
0.47255340218544006,
0.0279835257679224,
0.849818766117096,
0.6600197553634644,
1.2289007902145386,
0.09069061279296875,
-0.9577760100364685,
0.9093788266181946,
-0.9095547795295715,
0.4140825867652893,
-0.00902626197785139,
0.8528168797492981,
... |
def check _ integrity ( calculator, check _ calc = true ) : try : if not isinstance ( calculator, dict ) : raise calculatorerror ( ) elif check _ calc and ('operations'not in calculator or'history'not in calculator ) : raise calculatorerror ( ) else : return true except calculatorerror as err : return false | [
0.09643098711967468,
0.9715597629547119,
0.5746074914932251,
0.836602509021759,
-0.5115368366241455,
0.45751795172691345,
0.16707691550254822,
0.1435750424861908,
0.28853514790534973,
-0.5368597507476807,
0.5965985059738159,
-0.5567840337753296,
-0.31373006105422974,
0.6585250496864319,
... |
def getbatches ( glist : list [ graphobject ], problem _ based : str, aggregation _ mode : str, batch _ size : int = 32, number _ of _ batches = none, one _ graph _ per _ batch = true ) - > union [ list [ graphobject ], list [ list [ graphobject ] ] ] : if number _ of _ batches is none : batches = [ glist [ i : i + bat... | [
0.44686123728752136,
1.0411616563796997,
0.7612326145172119,
1.815016746520996,
0.5135459899902344,
0.5708950161933899,
-0.002470809267833829,
-0.2388136386871338,
0.43801257014274597,
-0.04430503770709038,
-0.48886847496032715,
-0.039226140826940536,
-0.1715903878211975,
-0.13532046973705... |
def test _ empty _ field ( self ) : assert get ( 5, ( ) ) = = 5 | [
-0.7284812331199646,
1.0402201414108276,
0.1482040286064148,
-1.2941526174545288,
1.2270170450210571,
0.7093959450721741,
0.10391049087047577,
-0.8351404070854187,
-0.1884358525276184,
-0.8587544560432434,
-0.9217061400413513,
0.4169226586818695,
-1.050047516822815,
-0.8654047846794128,
... |
def setup ( self ) : self. tmp _ overlay = os. path. join ( self. tempdir,'coreos - overlay') self. mock _ chrome _ dir = os. path. join ( self. tmp _ overlay, constants. chrome _ cp ) os. makedirs ( self. mock _ chrome _ dir ) ebuild = os. path. join ( self. mock _ chrome _ dir, constants. chrome _ pn +'- % s. ebuild'... | [
-0.29860612750053406,
-0.33752933144569397,
0.7482520937919617,
0.02559179812669754,
0.42315563559532166,
0.54278564453125,
1.1028244495391846,
-0.3703788220882416,
-0.09140738099813461,
0.24906916916370392,
-0.4194779098033905,
-0.8565396070480347,
-0.22080416977405548,
0.2905595898628235... |
def perplexity ( self, corpus ) : return pow ( 2. 0, self. entropy ( corpus ) ) | [
-0.19509650766849518,
-0.6400532126426697,
0.41750237345695496,
-0.0628814622759819,
0.08484671264886856,
0.267783522605896,
-0.08786734193563461,
0.7630524635314941,
-0.12012618780136108,
-0.444105863571167,
-0.1678783893585205,
-0.3909273147583008,
-1.4898735284805298,
-0.117911182343959... |
def findforces ( self, n ) : pairs = [ ] lines = self. findlines ( n, 2 ) for l in lines : currentpair = [ ] points = self. linetopoints ( l ) for p in points : if self. pointtovalue ( p ) = = 0 : currentpair + = [ p ] pairs + = [ currentpair ] return pairs | [
-0.568352460861206,
-0.1765822470188141,
0.46246373653411865,
0.5631769299507141,
0.7384554147720337,
-0.2277282029390335,
-0.28486835956573486,
-0.392408549785614,
-0.25704696774482727,
-0.51643306016922,
0.08581608533859253,
-1.6661707162857056,
-0.5081883668899536,
1.7849749326705933,
... |
def create _ filelist ( self ) : files _ list = os. listdir ( self. sourcepath ) files _ list = fnmatch. filter ( files _ list,'[ 0 - 9 ] *. html') files _ list = sorted ( files _ list, key = lambda f : int ( f. split ( '.') [ 0 ] ) ) return files _ list | [
-0.35175246000289917,
0.055267829447984695,
0.7447256445884705,
0.2593883275985718,
-0.03727281093597412,
-0.2599424421787262,
0.9521916508674622,
0.13243190944194794,
0.33205345273017883,
-0.37930095195770264,
-0.3220617473125458,
-0.17290472984313965,
0.7172978520393372,
0.82105737924575... |
def remove _ series _ from _ watchlist ( series _ id, user _ id ) : session = create _ db _ session ( ) tv _ series = session. query ( tv _ series ). \ filter _ by ( tvmaze _ id = series _ id ). \ first ( ) if not tv _ series : session. close ( ) output _ text = " _ congratulations! you're already * not * following " +... | [
0.4538486897945404,
-0.1980055421590805,
0.5284475088119507,
0.033046968281269073,
-0.9375418424606323,
0.16674937307834625,
0.2440010905265808,
-0.5551942586898804,
0.48365747928619385,
0.5946756601333618,
0.20960667729377747,
0.6581452488899231,
-0.31725233793258667,
0.17494136095046997,... |
def get _ bands ( d _ r, number _ of _ bands, precision = 2, nearest _ integer = false ) : prec = abs ( precision ) if prec > 14 : prec = 14 bands = dict ( ) if ( d _ r [ 1 ] < d _ r [ 0 ] ) or ( number _ of _ bands < = 0 ) : return bands x = list ( d _ r ) if nearest _ integer : x [ 0 ] = math. floor ( x [ 0 ] ) x [ 1... | [
-0.6095762848854065,
0.7224275469779968,
0.7147613167762756,
-0.05376014858484268,
-0.6739893555641174,
-0.2921607196331024,
0.07500892877578735,
-0.6414695382118225,
0.06288991868495941,
-0.37444740533828735,
-0.22300907969474792,
-0.6360850930213928,
0.4814966022968292,
0.371862828731536... |
def build _ revision ( self ) : return self. _ build _ revision | [
0.5166917443275452,
-0.8773795366287231,
0.3518710732460022,
0.2309311032295227,
0.41064631938934326,
1.136718988418579,
1.0314538478851318,
1.5604441165924072,
-0.32463279366493225,
-1.050653100013733,
-0.22798433899879456,
0.9401988983154297,
0.1203814297914505,
-1.783945083618164,
0.4... |
def _ bucket _ index ( self, key ) : return hash ( key ) % len ( self. buckets ) | [
-0.9832050204277039,
-0.03302432596683502,
0.3346964418888092,
-0.36635860800743103,
-0.8391911387443542,
0.7500066757202148,
0.27640771865844727,
-0.47746357321739197,
-0.36538460850715637,
-0.32085511088371277,
-0.5414114594459534,
-1.0710924863815308,
-0.01054410170763731,
-0.4234236776... |
def cal _ si _ snr _ with _ pit ( source, estimate _ source, source _ lengths ) : assert source. size ( ) = = estimate _ source. size ( ) b, c, t = source. size ( ) # mask padding position along t mask = get _ mask ( source, source _ lengths ) estimate _ source * = mask # step 1. zero - mean norm num _ samples = source... | [
-0.2003559172153473,
-0.2261834293603897,
0.8685673475265503,
-0.06106080114841461,
0.15311294794082642,
-0.7417051792144775,
0.14754660427570343,
0.6309221386909485,
-0.11464250087738037,
0.6187417507171631,
-0.6577866077423096,
0.21850933134555817,
0.1316969394683838,
-0.1747956871986389... |
def _ learn _ from _ experience _ batch ( self, obs, obs _ next, actions, old _ policies, rewards, first _ obs, first _ actions, dones, lengths ) : batches _ indices = tf. raggedtensor. from _ row _ lengths ( values = tf. range ( tf. reduce _ sum ( lengths ) ), row _ lengths = lengths ) values = tf. squeeze ( self. _ c... | [
0.09787566214799881,
-0.3953571915626526,
0.7150196433067322,
-0.9437276124954224,
0.40734681487083435,
0.4264936149120331,
0.5501208305358887,
-0.16350238025188446,
0.47075706720352173,
0.4137188494205475,
0.2087554931640625,
0.7818310260772705,
1.163448452949524,
-0.7375798225402832,
0... |
def delete _ contact ( conn : sqlite3. connection, mac _ address ) : with conn : conn. execute ('delete from contact where mac _ address =? ', ( mac _ address, ) ) | [
1.0504212379455566,
-0.44911450147628784,
0.31130096316337585,
0.24804221093654633,
-0.38353627920150757,
-0.4358423948287964,
-0.17859749495983124,
0.5136128664016724,
0.4090612232685089,
0.5695980191230774,
0.8325797319412231,
-0.15504248440265656,
-0.4676249027252197,
-0.287048965692520... |
def query _ by _ grid _ points ( self, gps ) : if self. nn _ groups is none : self. partition _ grid ( ) return [ self. atom _ labels [ self. nn _ groups [ self. grid _ indexer ( g ) ] ] for g in gps ] | [
-0.9046794772148132,
0.2763010263442993,
0.24672071635723114,
0.9436785578727722,
-0.07903681695461273,
0.025167876854538918,
-0.32235583662986755,
-0.774280309677124,
-0.19565637409687042,
0.7418691515922546,
1.6241947412490845,
-0.24441766738891602,
-0.5526392459869385,
-0.04119441285729... |
def edit _ list ( id ) : # we check that user is logged in if check _ if _ user _ logged _ in ( ) : form = createlistform ( ) user _ email = session ['user _ email'] # get all forms associated with the user shopping _ list = shopping _ list _ app. shopping _ lists [ user _ email ] [ id ] if shopping _ list : # provide ... | [
-0.6379880309104919,
0.2900501489639282,
0.2469925880432129,
-0.0075468942523002625,
0.6354129910469055,
0.18152135610580444,
-0.06666962802410126,
0.7429239749908447,
1.1873325109481812,
0.10701068490743637,
-0.7271307110786438,
-0.34651726484298706,
0.21974509954452515,
1.252542853355407... |
def test _ gravatar ( self ) : dev _ id ='test'device = device _ tracker. device ( self. hass, timedelta ( seconds = 180 ), true, dev _ id,'ab : cd : ef : gh : ij ','test name ', gravatar ='test @ example. com') gravatar _ url = ( " https : / / www. gravatar. com / avatar / " " 55502f40dc8b7c769880b10874abc9d0. jpg? s ... | [
-0.6389074921607971,
0.944251298904419,
0.42997676134109497,
-0.020369261503219604,
0.009465932846069336,
0.5583708882331848,
0.5083113312721252,
-0.13804136216640472,
0.24877171218395233,
0.03952809050679207,
-0.49888181686401367,
-0.014458974823355675,
0.3701346814632416,
0.2368870377540... |
def name ( self, value ) : max _ characters = 512 conditions = [ validate _ max _ length ( value, max _ characters ) ] if all ( conditions ) : self. _ update _ values ('name ', value ) else : raise invalidvalue ( f'{ value } is invalid. condition max _ characters must be less or equal to'f'{ max _ characters }') | [
-0.7777566313743591,
0.5432764887809753,
0.5682284832000732,
-0.3199940323829651,
-1.6551408767700195,
0.3049337863922119,
0.004765041638165712,
-0.4273497760295868,
0.2897970974445343,
1.0919383764266968,
-0.6512188911437988,
-0.17800550162792206,
0.28910642862319946,
0.3279207646846771,
... |
def normalize ( x, max _ number, min _ number ) : return ( x - min _ number ) / ( max _ number - min _ number ) | [
0.29348310828208923,
-0.24380207061767578,
0.4119154214859009,
0.8955336213111877,
-0.6610170006752014,
0.16557574272155762,
-1.0400848388671875,
0.2137432098388672,
0.16315573453903198,
-0.17235781252384186,
-0.7577983140945435,
0.5546531677246094,
0.02200755476951599,
-1.2399934530258179... |
def tmp _ path ( path = " " ) : default _ path = os. getenv ( " tmpdir ", config. get ( " paths " ). get ( " tmp _ dir " ) ) if path : try : os. makedirs ( path ) except oserror as e : if e. errno! = errno. eexist : return default _ path return path return default _ path | [
0.09893207252025604,
0.6218526363372803,
0.4472154676914215,
0.10565325617790222,
0.8511840105056763,
0.6631999611854553,
0.7352101802825928,
-0.17778220772743225,
-0.21720287203788757,
0.07292269915342331,
0.08601772785186768,
-1.3856170177459717,
-0.7540767192840576,
0.481936514377594,
... |
def _ getthunkfilename ( filenode, relpath ) : path = os. path. split ( filenode. getproperty ('name') ) [ 0 ] name = _ getbasefilename ( filenode ) # we don't reattach the path for thunk. if relpath : name = os. path. join ( relpath, name ) name ='% s % s'% ( name,'_ thunk. cc') return name | [
0.3564798831939697,
-0.4381535053253174,
0.7418496012687683,
-0.6727272272109985,
-0.33560049533843994,
0.044659219682216644,
0.5211410522460938,
-0.07960890233516693,
-1.1838059425354004,
0.7561700344085693,
0.8704161047935486,
-0.1778693050146103,
1.1526234149932861,
-0.10693735629320145... |
def _ _ init _ _ ( self, num _ units, num _ cores, forget _ bias = 1. 0, timestep = 0 ) : self. _ num _ units = num _ units self. _ forget _ bias = forget _ bias # additional variables self. _ cores = tf. constant ( num _ cores ) self. _ timestep = tf. variable ( timestep ) # assign to 0 then terminal ( or epoch ) self... | [
-0.01871291734278202,
0.41465041041374207,
0.5318717956542969,
0.09492451697587967,
0.036815471947193146,
-0.42687761783599854,
0.44790419936180115,
0.11904016137123108,
-0.061386220157146454,
0.5611998438835144,
-0.5117865800857544,
0.1050034686923027,
0.5765073299407959,
0.00881586037576... |
def analyze _ network ( data : gpd. geodataframe, network _ name : str ) : data = data [ data [ " marque " ] = = network _ name ] if len ( data ) > 0 : max _ screens = data [ " nb _ screens " ] [ data [ " nb _ screens " ]. notnull ( ) ]. astype ( int ). max ( ) name _ theater _ max _ screens = data [ [ " name " ] ] [ d... | [
-0.6386131048202515,
-0.1261541098356247,
0.800072431564331,
-0.15996970236301422,
0.5230641961097717,
-0.5041954517364502,
-0.47681060433387756,
0.03514758497476578,
-0.06196394935250282,
0.5038578510284424,
-0.5328347682952881,
-0.14836923778057098,
0.5025384426116943,
0.7920811772346497... |
def process _ change _ line ( self, change _ line ) : seq = change _ line ['seq'] rev = change _ line ['changes'] [ 0 ] ['rev'] return ( change _ line, rev, seq, ) | [
-0.6094650626182556,
-0.906693160533905,
0.42566320300102234,
-0.12456463277339935,
0.6233090162277222,
-0.6808822751045227,
-0.799902617931366,
0.798669695854187,
-0.3702469766139984,
0.8809009790420532,
-0.9079058766365051,
-0.03767768666148186,
0.279462993144989,
0.39881739020347595,
... |
def linetopoints ( self, line ) : if ( 0 < = line and line < 16 ) : return self. rowstopoints ( line ) elif ( 16 < = line and line < 32 ) : return self. colstopoints ( line ) elif ( 32 < = line and line < 48 ) : return self. vrtstopoints ( line ) elif ( 48 < = line and line < 76 ) : return self. diastopoints ( line ) e... | [
-0.945974588394165,
-0.32329416275024414,
0.6690497994422913,
0.5132923126220703,
0.5611503720283508,
0.2349935621023178,
-0.6424316763877869,
-0.6046488881111145,
0.6473985314369202,
0.07356005907058716,
-0.7614247798919678,
0.1614762842655182,
-0.08526081591844559,
-0.22551320493221283,
... |
def cone ( * * named ) : return _ newnode ( geometry. vpcone, named ) | [
-0.17932024598121643,
0.21587087213993073,
0.4389239549636841,
0.41615474224090576,
-0.973085343837738,
-0.2594243288040161,
-0.5812499523162842,
-0.3637881577014923,
-0.7723264098167419,
0.5464780330657959,
-0.9107341170310974,
-0.3215486407279968,
-0.6083419919013977,
-1.7291343212127686... |
def replace _ extension ( self, new = none ) : if new is none : new ='' root, ext = os. path. splitext ( self. _ path ) return file ( root + '.'+ new, make _ absolute = self. _ absolute ) | [
0.7768470048904419,
-0.37566080689430237,
0.7541735172271729,
0.5385790467262268,
-0.7989437580108643,
-0.3378622531890869,
-0.15232785046100616,
1.0029816627502441,
-0.537194550037384,
-0.5108057260513306,
-0.17933210730552673,
0.11597386002540588,
-0.19363419711589813,
-0.358827829360961... |
def clear _ healthmonitor ( self, context, resource _ data ) : log. info ( " received clear health monitor api for nfds : " " % ( nfds ) s ", {'nfds': resource _ data ['nfds'] } ) event _ key = resource _ data ['nfds'] [ 0 ] ['vmid'] poll _ event _ id = gen _ cfg _ const. event _ configure _ healthmonitor self. sc. sto... | [
-0.8380727171897888,
0.014609192498028278,
0.2683418393135071,
-0.4178318977355957,
0.2062319964170456,
0.2559816241264343,
-0.7654858827590942,
-0.9823253154754639,
0.3390343189239502,
0.450028657913208,
0.6137505769729614,
0.8285938501358032,
-0.029425812885165215,
0.5942602157592773,
... |
def get _ frequency _ table ( x _ unvec, y, idx _ feat _ dict, idx _ class _ dict ) : num _ feature = len ( idx _ feat _ dict ) num _ class = len ( idx _ class _ dict ) # initialize table with zeros class _ feat _ freq _ table = np. zeros ( ( num _ class, num _ feature ) ) for features, class _ idx in zip ( x _ unvec, ... | [
-0.5555303692817688,
0.41174083948135376,
0.7177480459213257,
0.7569570541381836,
0.1894432008266449,
-0.6592837572097778,
0.6580289006233215,
-0.258439302444458,
-0.4623594582080841,
-0.2978050708770752,
0.1871819645166397,
-0.07425107061862946,
1.0361918210983276,
-0.07874780148267746,
... |
def get _ cluster _ name ( self ) : raise notimplementederror ( " the method not implemented " ) | [
-0.4030081033706665,
-0.5452263355255127,
0.8076764345169067,
0.7531175017356873,
-0.9005311727523804,
0.762069046497345,
0.4244568645954132,
-0.20369203388690948,
0.2980964481830597,
0.4644707143306732,
0.35431063175201416,
0.713168740272522,
0.7586265206336975,
-0.37383413314819336,
-0... |
def wrap ( string ) : return " \ n ". join ( fill ( paragraph, width = 78, replace _ whitespace = false ) for paragraph in string. split ( " \ n " ) ) | [
0.17796437442302704,
0.36334389448165894,
0.4674660265445709,
-0.7441228032112122,
-1.2545137405395508,
0.16976958513259888,
-1.081761121749878,
-0.09369102120399475,
0.38142532110214233,
0.569800615310669,
1.495941400527954,
0.5284008979797363,
0.30254220962524414,
-0.7298504114151001,
... |
def itksmoothingrecursivegaussianimagefilterif2if2 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilterif2if2 _ cast ( * args ) | [
0.0925978347659111,
0.3824370801448822,
-0.016660118475556374,
-0.2713492214679718,
-0.44359180331230164,
-0.17490887641906738,
0.05013401806354523,
-1.2131160497665405,
-1.0381792783737183,
-0.23751968145370483,
0.23757420480251312,
0.8530722260475159,
-0.48068928718566895,
1.680818319320... |
def unwrap _ match ( doc, match ) : return doc [ match. a : match. a + match. size ] | [
0.028611350804567337,
-0.2623800039291382,
0.43255531787872314,
-1.0770753622055054,
-1.4342224597930908,
-0.0455399751663208,
0.6521874666213989,
0.297525554895401,
-0.21069328486919403,
-0.08575914800167084,
0.630617618560791,
0.9730697870254517,
-0.5458244681358337,
-2.270301342010498,
... |
def pad ( self, matrices, pad _ value ) : shapes = [ m. shape for m in matrices ] m, n = sum ( [ s [ 0 ] for s in shapes ] ), sum ( [ s [ 1 ] for s in shapes ] ) zeros = torch. floattensor ( np. zeros ( ( m, n ) ) ). to ( device ) pad _ matrices = pad _ value + zeros i, j = 0, 0 for k, matrix in enumerate ( matrices ) ... | [
-0.5620531439781189,
-0.29056790471076965,
0.4846110939979553,
-0.2466353327035904,
0.09064728766679764,
0.5494515299797058,
0.5911160111427307,
0.1836158037185669,
0.3671627342700958,
0.47907668352127075,
-0.1669965535402298,
-0.5491434335708618,
0.060045670717954636,
1.201634407043457,
... |
async def zci _ with _ type ( q : str, web _ fallback : bool = true, priority : tuple [ str ] = default _ priorities, urls : bool = true, * * kwargs, ) - > tuple [ str, str ] : ( result, ddg ) = await zci _ with _ result ( q, web _ fallback, priority, urls, * * kwargs ) return ( result, getattr ( ddg, " type ", " " ) ) | [
-0.262551486492157,
0.7215994000434875,
0.4598698318004608,
-0.431418776512146,
-0.06823068112134933,
-1.3295307159423828,
-0.372947096824646,
-0.8217072486877441,
0.4163826107978821,
0.03515399619936943,
-0.4606983959674835,
0.08664838969707489,
-0.4217659831047058,
0.4817446768283844,
... |
def backward ( self, grad _ output ) : assert ( self. input is not none ) assert ( grad _ output. size ( ) = = self. input. size ( ) ) grad _ input = grad _ output. clone ( ) grad _ input [ self. input < 0 ] = 0 return grad _ input | [
-0.2647232413291931,
-0.3824916183948517,
0.670583188533783,
-0.32654842734336853,
-0.37651777267456055,
0.49955883622169495,
0.6932054162025452,
-0.7857334613800049,
-0.14826205372810364,
-0.2206098437309265,
0.5097888112068176,
0.7149579524993896,
-1.0102492570877075,
-0.1479485630989074... |
def circumc ( self, a, b, c ) : # point coords : ax = a [ 0 ] ay = a [ 1 ] bx = b [ 0 ] by = b [ 1 ] cx = c [ 0 ] cy = c [ 1 ] # calculate circumcentre : # ( from https : / / en. wikipedia. org / wiki / circumscribed _ circle # cartesian _ coordinates _ 2 ) a2 = ax * * 2 + ay * * 2 b2 = bx * * 2 + by * * 2 c2 = cx * * ... | [
0.8001447319984436,
-0.6735590696334839,
1.1618432998657227,
-1.3179470300674438,
0.11190932244062424,
-0.1471872478723526,
1.053795337677002,
-0.03818190470337868,
0.5163900256156921,
0.9989199042320251,
0.004640894941985607,
-0.21056382358074188,
-0.23124516010284424,
-0.5181053876876831... |
def _ create _ tree ( self ) : # create nodes in order that would break rebuild tree if it didn't # order them correctly self. n1 = node. objects. create ( name ='1') self. n3 = node. objects. create ( name ='3 ', parent = none ) self. n4 = node. objects. create ( name ='4 ', parent = none ) self. n2 = node. objects. c... | [
-0.17941251397132874,
0.39571282267570496,
0.5171263813972473,
0.42050397396087646,
0.5569549202919006,
-0.2153647243976593,
0.4573301672935486,
-0.6515380144119263,
-0.49694719910621643,
0.17116506397724152,
-1.0024482011795044,
-1.0864795446395874,
-0.291768878698349,
-0.0478168651461601... |
def run _ images ( self ) : self. logger. info ( " consuming messages from'% s'" % self. topic _ name _ in ) consumer = consumer. initialize ( self. topic _ name _ in ) for m in consumer : json _ data = m. value json _ data _ parsed = json. loads ( json _ data ) self. logger. info ( " running general object det against... | [
-0.5914093255996704,
-1.0610427856445312,
0.6102681159973145,
0.30644965171813965,
0.8688704371452332,
-0.15537063777446747,
0.18168045580387115,
-0.33561447262763977,
-0.2565620541572571,
0.791322648525238,
-0.30076777935028076,
0.7074867486953735,
-0.10200058668851852,
1.2357397079467773... |
def facility ( self, facility ) : if facility is not none and len ( facility ) > 50 : raise valueerror ( " invalid value for ` facility `, length must be less than or equal to ` 50 ` " ) # noqa : e501 self. _ facility = facility | [
-0.7947689294815063,
0.27429720759391785,
-0.19289939105510712,
0.4785412549972534,
0.3701028823852539,
-0.04544498026371002,
1.3637516498565674,
0.06915853172540665,
0.5085025429725647,
-0.8071276545524597,
-0.6161739230155945,
0.2536044716835022,
0.3667890429496765,
0.501826822757721,
... |
def test _ fs _ xfm ( subject, tmp _ path ) : fname = data _ path / " subjects " / subject / " mri " / " transforms " / " talairach. xfm " xfm, kind = _ read _ fs _ xfm ( str ( fname ) ) if subject = = " fsaverage " : assert _ allclose ( xfm, np. eye ( 4 ), atol = 1e - 5 ) # fsaverage is in mni assert kind = = " mni tr... | [
0.21963511407375336,
-0.20223455131053925,
0.6203051209449768,
-0.4592391550540924,
0.24825508892536163,
-0.21358826756477356,
0.13823913037776947,
-0.15607967972755432,
0.09924885630607605,
-0.45151853561401367,
0.7901872992515564,
-0.38998129963874817,
0.22417274117469788,
0.295152962207... |
def test _ add _ edge _ empty ( gr ) : gr. add _ edge ('a ','b') assert sorted ( gr. nodes ( ) ) = = ['a ','b'] | [
-0.37631967663764954,
0.9493083357810974,
0.44413313269615173,
-0.29362425208091736,
1.7717900276184082,
0.879939615726471,
-0.42667895555496216,
-0.08192764222621918,
-0.46525561809539795,
0.17307426035404205,
0.3120417594909668,
0.21287758648395538,
-0.63308185338974,
-0.1288912743330001... |
def create _ user ( self, name, email, password = none, * * extra _ fields ) : extra _ fields. setdefault ( " is _ staff ", false ) extra _ fields. setdefault ( " is _ superuser ", false ) return self. _ create _ user ( name, email, password, * * extra _ fields ) | [
-0.20689411461353302,
1.44038987159729,
0.5960879921913147,
0.5263872742652893,
-0.013223017565906048,
0.5565539002418518,
-0.41331371665000916,
-0.13349567353725433,
-0.3486419916152954,
-0.10688275098800659,
-1.3443946838378906,
-0.656766414642334,
-0.2553921341896057,
-0.337391614913940... |
def chunk ( string, encoding = default _ encoding, max _ length = chunk _ length ) : if not isinstance ( string, basestring ) : raise typeerror ('expected basestring, not'+ type ( string ). _ _ name _ _ ) chunks = [ ] remaining = string while remaining : if isinstance ( remaining, unicode ) : # see if the encoded strin... | [
0.11890240013599396,
-0.07028893381357193,
0.6300082802772522,
-0.09043562412261963,
-0.4370768368244171,
-0.38315728306770325,
-0.04881659895181656,
-0.11167627573013306,
0.8038458228111267,
-0.05831800401210785,
0.15384526550769806,
0.9676713347434998,
-0.5552430748939514,
-0.75061923265... |
def is _ leaf ( self ) : return self. _ children = = { } | [
0.2114707976579666,
-0.1117880642414093,
0.4226886034011841,
-0.0493692085146904,
0.1488625556230545,
0.6165889501571655,
-0.5737131237983704,
-0.029835406690835953,
0.6974457502365112,
-0.8336693048477173,
-1.2057021856307983,
-0.43517380952835083,
-0.0654863640666008,
0.4438360333442688,... |
def read _ inspections ( self, filename = none ) : if not filename : filename = vi _ filename data = [ ] if os. path. isfile ( filename ) : with open ( filename,'r') as infile : data = json. load ( infile ) return data | [
-0.5320208668708801,
-0.5999731421470642,
0.8109097480773926,
-0.003111485159024596,
0.03318149968981743,
-0.31208333373069763,
-0.068422831594944,
0.5282123684883118,
-0.3247098922729492,
0.33891764283180237,
-0.28674328327178955,
-0.20035217702388763,
-0.5610188245773315,
-0.253951102495... |
def periodic _ distance _ return _ new _ coords ( x, y, z, x2, y2, z2, sidehx, sidehy, sidehz, bs ) : dx = x2 - x dy = y2 - y dz = z2 - z if ( dx < - sidehx ) : x = x - bs [ 0 ] if ( dx > sidehx ) : x = x + bs [ 0 ] if ( dy < - sidehy ) : y = y - bs [ 1 ] if ( dy > sidehy ) : y = y + bs [ 1 ] if ( dz < - sidehz ) : z =... | [
0.08953012526035309,
-0.8032516241073608,
0.7266865968704224,
0.5480966567993164,
-0.30862870812416077,
0.33721068501472473,
-0.48975223302841187,
-0.23207904398441315,
-0.2876381576061249,
-0.5816775560379028,
-0.5129674077033997,
-0.2550554573535919,
-0.7862489223480225,
-0.4132968187332... |
def handleserverjob ( self, serversocket ) : app = screens ( serversocket ) # communicate with server threading. thread ( target = self. send _ and _ recv _ data, args = ( app, serversocket ) ). start ( ) app. setup ( ) | [
-0.1410687118768692,
0.08481257408857346,
0.5748953223228455,
0.255815327167511,
-0.07924675941467285,
0.30800920724868774,
-0.15259209275245667,
-0.9484133720397949,
0.25601181387901306,
-0.4856640100479126,
-0.11005821824073792,
0.23786614835262299,
-0.2726190686225891,
1.416590213775634... |
def letshoot ( shooter ) : if len ( shooter ) > 1 : sessionid = shooter [ 1 ] [ 0 ] # load previous sessionid else : sessionid = 0 print " session id : " + ` sessionid ` hits = [ ] while 1 : print shooter screen = snackscreen ( ) li = listbox ( height = 10, width = 25 ) count = 0 if hits! = [ ] : for i in hits : if i =... | [
-0.5412606596946716,
0.19441267848014832,
0.9630228877067566,
0.2650171220302582,
-0.042660485953092575,
-0.13946373760700226,
0.5603365898132324,
-1.1299917697906494,
0.4221789836883545,
0.7773477435112,
-0.9682281613349915,
0.0875169113278389,
-0.3888118863105774,
1.327876091003418,
0.... |
def _ denormalize _ value ( self, normed, range ) : value = 0. 5 * ( normed + 1 ) * ( range [ 1 ] - range [ 0 ] ) + range [ 0 ] return value | [
-0.24512432515621185,
-0.2722010016441345,
0.4142792224884033,
0.08887552469968796,
-0.5462097525596619,
-0.4223659038543701,
0.007009109016507864,
-0.07696232944726944,
-0.21427559852600098,
-0.5412139892578125,
0.3337756097316742,
0.3538796901702881,
-0.6149787306785583,
-0.4274073839187... |
def skellam _ cdf _ root ( target1, target2, n = 0, tol = 1e - 8 ) : # if not ( isinstance ( target1, float ) and isinstance ( target2, float ) and # target1 > 0 and target2 > 0 and target1 + target2 < 1 ) : if target1 + target2 > = 1 or min ( target1, target2 ) < = 0 : raise valueerror phi _ d = ndtri ( target1 ) phi ... | [
0.09047403186559677,
-0.13591130077838898,
0.8836460113525391,
0.6660147905349731,
-0.5929951667785645,
-0.7651554346084595,
0.20260308682918549,
-0.004488077480345964,
0.07679963856935501,
0.8982298374176025,
0.35800814628601074,
0.3741854727268219,
0.1487579345703125,
0.27448561787605286... |
def cal ( self, raw ) : return raw * self. slope + self. inter | [
0.2330837845802307,
0.014665093272924423,
0.36260688304901123,
-0.5839240550994873,
-0.864534854888916,
0.40860268473625183,
0.2919621467590332,
-0.34950461983680725,
0.35772138833999634,
-1.0629521608352661,
-0.5451086759567261,
-0.2762790322303772,
-0.2176085114479065,
-0.640281677246093... |
def read ( self, collab _ id : str, project _ id : str, expt _ id : str, run _ id : str ) : return self. _ execute _ operation ( operation = " get ", url = self. _ generate _ single _ url ( collab _ id = collab _ id, project _ id = project _ id, expt _ id = expt _ id, run _ id = run _ id ), payload = none ) | [
0.2589263916015625,
0.10223614424467087,
0.6223735809326172,
0.6267164945602417,
0.826064944267273,
0.16596414148807526,
-1.3333261013031006,
-0.0379176139831543,
-0.2946731150150299,
0.4042621850967407,
1.3932087421417236,
1.6817395687103271,
-1.3734124898910522,
-1.2078006267547607,
0.... |
def generatebody ( self, out, filenode, releases, options ) : _ _ pychecker _ _ ='unusednames = options'out _ members = [ ] meta = thunkbodymetadata ( ) for node in filenode. getlistof ('interface') : # skip if this node is not in this release if not node. inreleases ( releases ) : print ( " skipping % s " % node ) con... | [
-0.6826592683792114,
-0.38605961203575134,
0.6652482748031616,
-0.09158038347959518,
0.48100224137306213,
0.1161210760474205,
-0.32565295696258545,
0.15895220637321472,
-0.6263341903686523,
0.9980360865592957,
-0.3540832996368408,
0.04901457950472832,
-0.3547367751598358,
0.675168216228485... |
def d ( self, d _ file, download _ or _ delete ) : # split file or folder names d _ list = d _ file. split ( " " ) # flag fl = 0 # wait untill all the files and folders are avaible in webpage elements = self. driver. find _ elements _ by _ xpath ( " / / div [ @ data - item - index ] " ) while len ( elements ) = = 0 : e... | [
-0.3181392252445221,
0.054662272334098816,
1.1893678903579712,
0.39502933621406555,
0.34939059615135193,
0.054972242563962936,
0.9633488655090332,
0.6348739266395569,
-0.15622715651988983,
0.5143905878067017,
0.3785576820373535,
-0.1248214840888977,
0.11669155955314636,
1.0415561199188232,... |
def gamebook ( self, season _ year, week, gamekey ) : url = " http : / / www. nflgsis. com / { } / reg / { } / { } / gamebook. xml " if week < 10 : week = " 0 { } ". format ( week ) else : week = str ( week ) return self. get ( url. format ( season _ year, week, gamekey ) ) | [
-1.4997698068618774,
0.6258971691131592,
0.3756978511810303,
-0.6115326881408691,
0.10279344022274017,
-0.20319321751594543,
-0.9720975160598755,
-0.4715348184108734,
0.16333995759487152,
0.6075533032417297,
0.8647854328155518,
-0.23543256521224976,
-0.8933289051055908,
-0.2029762268066406... |
def transfer _ funds ( request ) : title ='transfer'print ( request. post ) print ( request. get ) content = {'title': title } if request. method = ='post': if request. post ['email _ code'] : pending _ transfer = transfer. objects. filter ( tracking _ id = request. post ['tracking _ id'] ). first ( ) if hashlib. sha25... | [
-0.2775653898715973,
0.3502613604068756,
0.9068037867546082,
0.0034570179414004087,
0.42861637473106384,
0.5093804001808167,
0.7054593563079834,
-0.00553933484479785,
0.22341439127922058,
0.18266969919204712,
0.15696880221366882,
-0.0990484356880188,
0.417407751083374,
0.2912498116493225,
... |
def dwae ( a, f, last _ of _ array ) : # plus one to assure squared errors are bigger in the case of 0 to 1 return np. nanmean ( np. where ( np. sign ( f - last _ of _ array ) = = np. sign ( a - last _ of _ array ), np. abs ( a - f ), ( np. abs ( a - f ) + 1 ) * * 2, ), axis = 0, ) | [
-0.5606882572174072,
0.4976067543029785,
0.9935885667800903,
0.10529100149869919,
-0.03842569515109062,
-0.0488547720015049,
0.650898814201355,
-0.24097639322280884,
-0.06703130155801773,
0.3315924406051636,
0.9195401072502136,
0.6960264444351196,
0.642142653465271,
0.29584649205207825,
... |
def shape ( matrix ) : if type ( matrix [ 0 ] )! = list : return [ len ( matrix ) ] else : return [ len ( matrix ) ] + shape ( matrix [ 0 ] ) | [
0.037171121686697006,
0.869940996170044,
0.48340868949890137,
0.6952216625213623,
0.7403396964073181,
0.24420829117298126,
0.3254351317882538,
0.7017769813537598,
1.6829841136932373,
0.6777140498161316,
-0.34637027978897095,
0.0004246064636390656,
-0.10207395255565643,
0.8030555248260498,
... |
def silent _ scream ( file ) : global ignore _ error counter = 0 while true : line = yield none if not line : break if counter : ignore _ error = true counter - = 1 else : ignore _ error = false match = re. match ( " \ s *.. lint : ignore errors for the next ( \ d + ) line? ", line ) if match : # + 1 for empty line rig... | [
1.333672285079956,
-0.19040262699127197,
0.825101375579834,
0.2815846800804138,
0.014821657910943031,
0.6085290312767029,
0.3004372715950012,
-0.022994372993707657,
-0.06448831409215927,
-0.18566176295280457,
-0.174468994140625,
0.10815805196762085,
-0.3718000650405884,
-0.3093267977237701... |
def dfs ( init _ board ) : # init the start state start _ state = state ( init _ board, zero _ heuristic, 0, 0 ) # create frontier and explored frontier = [ start _ state ] explored = [ ] while len ( frontier ) > 0 : current _ state = frontier. pop ( ) # check if explored if current _ state. id not in explored : explor... | [
-0.2635859549045563,
0.5290718078613281,
0.7713450789451599,
1.046924352645874,
0.22374935448169708,
-0.5884408354759216,
0.24788318574428558,
1.129420518875122,
-0.19131359457969666,
-0.2376350462436676,
-0.17018556594848633,
-0.3863791525363922,
-0.25782495737075806,
0.7611240744590759,
... |
def reshape ( x, target _ dim = 3 ) : x _ shape = x. get _ shape ( ). as _ list ( ) if len ( x _ shape ) > target _ dim : with tf. name _ scope ('reshape _ to _ % dd'% target _ dim ) : n _ input _ dim = 1 for i in xrange ( target _ dim - 1, len ( x _ shape ) ) : n _ input _ dim * = x _ shape [ i ] x = tf. reshape ( x, ... | [
-0.5776692032814026,
0.5529730916023254,
0.7567172646522522,
0.45671510696411133,
-0.04556407406926155,
0.028717253357172012,
-0.30562248826026917,
0.28107407689094543,
0.4302501380443573,
0.1486569046974182,
0.22794556617736816,
0.9336622357368469,
0.8259247541427612,
-1.218767762184143,
... |
def _ firms _ fire ( self, df _ firms ) : ev _ id = 0 for cons _ id in np. unique ( df _ firms. cons _ id. values ) : firms _ cons = df _ firms. clus _ id. values [ df _ firms. cons _ id. values = = cons _ id ] for clus _ id in np. unique ( firms _ cons ) : df _ firms. event _ id. values [ np. logical _ and ( df _ firm... | [
-0.285506010055542,
0.24863629043102264,
0.699569582939148,
0.08544645458459854,
0.4260873794555664,
-0.22218623757362366,
0.05297799035906792,
0.4021041691303253,
-0.7594709992408752,
-0.2293560951948166,
0.3865545094013214,
0.8720971941947937,
0.8715368509292603,
1.4739996194839478,
0.... |
def numvals ( shape ) : if ( len ( shape ) = = 0 ) : return 1 return reduce ( operator. mul, shape ) | [
-0.2823541760444641,
1.6423052549362183,
0.46321558952331543,
0.46555227041244507,
0.32980918884277344,
-0.5166720151901245,
0.3175145089626312,
0.9422420859336853,
0.32781028747558594,
-0.0018807798624038696,
-0.5511952042579651,
-0.48348569869995117,
0.47135645151138306,
0.87787950038909... |
def _ _ init _ _ ( self, ops ) : super ( proxylessnasblockspec, self ). _ _ init _ _ ( ops,'list') | [
1.2410861253738403,
1.1493936777114868,
0.2552160322666168,
0.5618728399276733,
0.3327251374721527,
-0.6432436108589172,
0.18840418756008148,
0.03902197256684303,
0.5262804627418518,
-0.10060525685548782,
-0.9728040099143982,
-0.36996006965637207,
0.23627471923828125,
0.2524055242538452,
... |
def submit ( self, job ) : logging. debug ('attempt to submit job'+ str ( job ) ) self. lock. acquire ( ) running = self. running queue = self. queue if job is running or job in queue : logging. info ('the job'+ str ( job ) +'is already running or in the queue.') self. lock. release ( ) return queue. append ( job ) que... | [
-0.12334200739860535,
-0.6194666028022766,
0.4945341944694519,
-0.31156468391418457,
0.011973218992352486,
0.08578304201364517,
-0.5926955938339233,
-0.9636345505714417,
0.012336271815001965,
-0.19911383092403412,
0.21213896572589874,
0.5204498767852783,
-1.0157760381698608,
0.246260270476... |
def read ( self, file _ name : optional [ path ] = none ) : if file _ name is none : if self. file _ name is not none : file _ name = self. file _ name else : raise valueerror ('file _ name must be specified') with open ( file _ name,'r') as ifile : # parse the name and observation _ date lines ( first two lines self. ... | [
-0.12084047496318817,
-0.7032320499420166,
0.9935873746871948,
-0.2749485671520233,
-0.05893673002719879,
0.5027583241462708,
-0.021356848999857903,
0.8182166218757629,
-0.788872480392456,
0.06672456115484238,
0.04196089878678322,
0.3496486246585846,
0.1016523614525795,
0.22578607499599457... |
def check _ win ( self ) : # set center image to string if tuple ( self. current _ position ) = = self. end _ position : self. image _ grid [ 1 ] [ 1 ]. settext ( " you win! " ) | [
-0.30871009826660156,
-0.6898638010025024,
0.4806830585002899,
0.6480636596679688,
0.18359701335430145,
0.0914914458990097,
0.5090018510818481,
0.4910368323326111,
0.19426381587982178,
0.9961994290351868,
0.6086891889572144,
0.5904707312583923,
-0.5030820369720459,
0.32812371850013733,
-... |
def take ( self, count : int ) - >'dataset': return sliceddataset ( self, 0, count ) | [
0.29764261841773987,
-0.1546056717634201,
0.3776247799396515,
-0.051987357437610626,
-0.58773273229599,
-0.34361520409584045,
0.4219459593296051,
0.022485842928290367,
0.15679660439491272,
-1.3363564014434814,
-0.25112661719322205,
-0.03840746358036995,
-0.3246927857398987,
-1.127916932106... |
def createapiurl ( self, path ) : return self. _ _ makeurl ( path, self. apiloc ) | [
-0.6751894354820251,
-1.1420319080352783,
0.29945215582847595,
-0.5352144241333008,
-0.271430641412735,
1.2622610330581665,
-0.10770410299301147,
-0.12190037220716476,
-0.1631283015012741,
-0.3870740830898285,
-0.17503879964351654,
-0.24849702417850494,
-0.048734527081251144,
-0.9284481406... |
def un2kn ( self, valor ) : fator _ forca = 1 if self. parent. unidadeforca = = " [ kn ] - kilo newton " : fator _ forca = 1 elif self. parent. unidadeforca = = " [ lb ] - libra " : fator _ forca = 224. 8089431 elif self. parent. unidadeforca = = " [ klb ] - kilo libra " : fator _ forca = 0. 2248089431 elif self. paren... | [
-0.09649703651666641,
-0.022176669910550117,
0.763313889503479,
-0.3003299832344055,
-0.6643673777580261,
-0.18469896912574768,
0.6254863142967224,
-0.43191152811050415,
-0.2505086362361908,
-0.5201932191848755,
-0.34421005845069885,
0.06775383651256561,
0.6067567467689514,
1.1366935968399... |
def range ( at, txt, lo = 0, hi = 1 ) : return { " at " : at, " txt " : txt, " lo " : lo, " hi " : lo or hi, " y " : sym ( ) } | [
-0.9320197701454163,
-0.1646571159362793,
0.3388381004333496,
-0.8901475071907043,
-0.9554052352905273,
-0.22864888608455658,
-0.9819532632827759,
-0.029574403539299965,
-1.1909922361373901,
0.2236631065607071,
-0.9051820039749146,
-0.49542146921157837,
0.46480709314346313,
-0.169669240713... |
def exposures ( self ) : return self. call ('exposures ','get ', { } ) | [
-0.610194742679596,
0.04741404578089714,
0.4038243293762207,
1.1898399591445923,
-0.074500672519207,
-0.6926001906394958,
0.4940255880355835,
-0.46383675932884216,
0.6579607129096985,
0.09055235236883163,
-0.4943397045135498,
0.21994519233703613,
-0.6287569999694824,
0.9645268321037292,
... |
def test _ cant _ create _ driver _ invalid _ request ( self ) : json _ response = api _ call ( self, " post ",'/ driver / create ', none, 200 ) self. assertequal ( json _ response, none ) res = self. client. post ('/ driver / create') self. assertequal ( res. status _ code, 200 ) res = self. client. post ('/ driver / ... | [
-0.8884839415550232,
-0.004831905011087656,
0.7929815053939819,
0.3558156490325928,
1.0669842958450317,
0.6985539197921753,
-0.22820982336997986,
-0.15186908841133118,
-0.23624582588672638,
-0.2985399663448334,
-0.01678304187953472,
-0.5188133120536804,
-0.5538259148597717,
0.7619551420211... |
def generate _ data ( n, t, dt = 0. 02, lam = 0. 1, tau = 1. 5, sigma = 0. 1 ) : s = np. random. poisson ( lam = lam * dt, size = ( n, t ) ) gam = 1. 0 - dt / tau c = lfilter ( [ 1. 0 ], [ 1. 0, - gam ], s ) f = c + sigma * np. random. randn ( n, t ) # a = 1. 0, b = 0. 0 return s, c, f | [
0.4818477928638458,
0.117119699716568,
0.7272145748138428,
-0.33456724882125854,
0.14255785942077637,
0.44961676001548767,
-0.8081029653549194,
-0.2726355195045471,
-1.1124933958053589,
-0.2803418040275574,
-0.8173259496688843,
-0.08857890963554382,
0.012969803996384144,
-0.171252518892288... |
def alignments ( self, chains ) : pdbs = list ( set ( chain ['pdb'] for chain in chains ) ) helper = cr. helper ( self. config, self. session. maker ) alignments = helper. aligned _ chains ( pdbs, good = true ) if not alignments : raise core. invalidstate ( " no alignments loaded " ) return alignments | [
-0.8957220315933228,
-0.4549369812011719,
0.3791816830635071,
0.18244977295398712,
0.581810712814331,
-0.0754796490073204,
-0.6753278374671936,
-0.5136423707008362,
-0.22024720907211304,
0.007461125031113625,
0.47022897005081177,
-0.3813665509223938,
-0.7967567443847656,
0.3055656552314758... |
def test _ reactorinstallation ( self ) : installed = [ ] def install ( ) : installed. append ( true ) fakereactor = fakereactor ( install,'fakereactortest ', _ _ name _ _,'described') modules = {'fakereactortest': fakereactor } self. replacesysmodules ( modules ) installer = reactors. reactor ('fakereactor ','fakereac... | [
-0.19293543696403503,
-0.004821205046027899,
0.1717173010110855,
-0.20752659440040588,
1.5170220136642456,
-0.861992597579956,
-0.2661556005477905,
0.9454708099365234,
0.3569072186946869,
0.3214383125305176,
-1.6716428995132446,
-0.3719223141670227,
-0.7528284788131714,
0.00320415291935205... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.