text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def check _ view _ permissions ( self ) : if self. action in ( " create ", " update ", " partial _ update ", " destroy ", " control _ view ", " set _ scroll ", " set _ reference _ projector ", " project ", ) : result = has _ perm ( self. request. user, " core. can _ see _ projector " ) and has _ perm ( self. request. u... | [
-0.41687455773353577,
0.589329183101654,
0.6697835326194763,
0.8295400142669678,
-0.8812175393104553,
0.33224666118621826,
0.6219597458839417,
-0.4483850300312042,
0.08132686465978622,
-0.43506407737731934,
0.661918580532074,
0.32432442903518677,
-0.6518241167068481,
0.7289010286331177,
... |
def gradient ( theta, x, y, lamda ) : h = sigmoid ( np. dot ( x, theta. reshape ( ( len ( theta ), 1 ) ) ) ) # h theta of x m = x. shape [ 0 ] # number of training examples theta [ 0 ] = ( 1. 0 / m ) * np. sum ( ( h - y ) * x [ :, 0 ]. reshape ( ( len ( x [ :, 0 ] ), 1 ) ) ) # check dimension! for j in range ( 1, x. sh... | [
-0.38120758533477783,
0.8285489082336426,
0.9678214192390442,
-0.9825703501701355,
-0.4278327524662018,
-0.03550117090344429,
-0.0529082790017128,
0.38605061173439026,
-0.9639140963554382,
0.9962599873542786,
-0.3165341317653656,
0.6011618971824646,
-0.2008751630783081,
0.09859994053840637... |
def pred _ acc _ ensemble ( model _ lst, prepare _ data, iterator, use _ gpu = false ) : muti _ valid _ acc = 0 bi _ valid _ acc = 0 n _ done = 0 y _ lst = [ ] p _ lst = [ ] for x1, x2, y in iterator : n _ done + = len ( x1 ) print ( n _ done ) x1, x1 _ mask, x2, x2 _ mask, y = prepare _ data ( x1, x2, y, use _ gpu ) y... | [
-0.17725802958011627,
-0.4932318925857544,
0.749470055103302,
0.6821674704551697,
0.5625148415565491,
0.14045311510562897,
0.710158109664917,
0.20571589469909668,
-0.22742648422718048,
1.0608296394348145,
-0.007667969912290573,
0.5702353715896606,
0.5889997482299805,
0.46625757217407227,
... |
def find _ next _ player _ no ( game : game ) - > tuple [ int, list [ turnevent ] ] : # iterate through players, starting with the person right after the current player players = player. query. filter _ by ( game _ id = game. id ). order _ by ( player. game _ player _ index ). all ( ) for player _ index in range _ wrap... | [
-0.7281270027160645,
-0.8311136364936829,
0.7819917798042297,
0.10081081092357635,
-0.3911912739276886,
-0.916645348072052,
0.632426917552948,
-0.14604219794273376,
-0.5336472392082214,
0.6059211492538452,
-0.4216713607311249,
0.05127884820103645,
-0.3273812532424927,
0.5254817008972168,
... |
def run _ elcs _ full ( x _ train, y _ train, x _ test, y _ test, randseed, i, param _ grid, n _ trials, timeout, do _ plot, full _ path, use _ uniform _ fi, primary _ metric ) : # check whether hyperparameters are fixed ( i. e. no hyperparameter sweep required ) or whether a set / range of values were specified for an... | [
0.1685914695262909,
0.5066471695899963,
1.0709470510482788,
0.44345027208328247,
0.12092234194278717,
0.4972735345363617,
0.43512850999832153,
0.31508979201316833,
-0.08764160424470901,
0.03241919353604317,
0.1564757525920868,
0.6516451239585876,
0.7784407138824463,
0.37679553031921387,
... |
def num _ cpus _ per _ worker ( self ) : return self. resources _ per _ worker. get ( " cpu ", 1 ) | [
-0.3698824644088745,
0.7753914594650269,
0.3613387942314148,
0.26225587725639343,
-0.19490733742713928,
0.30839693546295166,
0.7305559515953064,
0.03603749722242355,
-0.34705662727355957,
-0.36921602487564087,
-0.4940013289451599,
-0.9603870511054993,
-0.5607926845550537,
-0.19386869668960... |
def compute _ budgets ( self ) : if not self. _ mechanisms : return if self. _ total _ delta = = 0 : sum _ weights = 0 for mechanism in self. _ mechanisms : sum _ weights + = mechanism. weight minimum _ noise _ std = sum _ weights / self. _ total _ epsilon * math. sqrt ( 2 ) else : minimum _ noise _ std = self. _ find ... | [
0.30963364243507385,
-0.018935134634375572,
0.6011410355567932,
-0.03950319439172745,
1.1004071235656738,
0.973659873008728,
0.6452671885490417,
-0.26213374733924866,
-0.17613203823566437,
-0.6235010027885437,
-0.1953606903553009,
0.14204569160938263,
0.014923961833119392,
0.87549793720245... |
def calculate _ maf ( rpm, map1, iat, volumetric _ efficiency = default _ volumetric _ efficiency, engine _ displacement = default _ engine _ displacement ) : iat = iat + 273. 15 # converting celsius to kelvin imap = rpm * map1 / iat / 2 # synthetic variable return ( ( imap / 60 ) * ( volumetric _ efficiency / 100 ) * ... | [
0.2902583181858063,
-0.6843500733375549,
0.32035017013549805,
-0.4107222855091095,
-0.2301899641752243,
-0.5580812096595764,
-0.7581603527069092,
0.4726931154727936,
-0.5611362457275391,
0.1002916470170021,
0.3272596299648285,
-0.43678247928619385,
-0.008926493115723133,
-0.527514457702636... |
def test _ rs ( ) : assert geo _ lin. rs. shape = = ( len _ ts, mlin. m ) for xs, rs in zip ( geo _ lin. xs, geo _ lin. rs ) : assert np. allclose ( rs, mlin. j @ xs ) | [
0.7753760814666748,
0.006305916700512171,
0.22403672337532043,
-0.5234107375144958,
0.6514670252799988,
0.708439826965332,
0.3686560392379761,
-0.4607107639312744,
0.23650290071964264,
-0.042456191033124924,
0.03668371960520744,
0.8778892159461975,
0.061333026736974716,
0.2865281105041504,... |
def getsmalldependencehighgraylevelemphasisfeaturevalue ( self ) : ivector = self. coefficients ['ivector'] jvector = self. coefficients ['jvector'] nz = self. coefficients ['nz'] sdhgle = numpy. sum ( self. p _ gldm * ( ivector [ none, :, none ] * * 2 ) / ( jvector [ none, none, : ] * * 2 ), ( 1, 2 ) ) / nz return sdh... | [
0.6159654259681702,
0.12649811804294586,
0.5624805688858032,
-0.18134988844394684,
-0.2531210482120514,
0.687278151512146,
0.6162474155426025,
-0.013368154875934124,
0.05178283527493477,
-0.053735341876745224,
-0.6152058243751526,
0.4482860565185547,
-0.7516071796417236,
0.3207392394542694... |
def delete ( key ) : yield deleteasync ( key ) | [
-0.30399322509765625,
0.22378452122211456,
0.4592917263507843,
-0.1731542944908142,
-0.6872499585151672,
-0.7797397375106812,
-0.5337692499160767,
0.11015653610229492,
0.5085928440093994,
0.7437987327575684,
0.46008920669555664,
-0.4825884699821472,
-0.24921290576457977,
0.3268857598304748... |
def create _ arguement _ parser ( ) : parser = argparse. argumentparser ( prog = " python run. py ", description = " a program named picturetoascii that can make'picture to ascii'", epilog = " written by jskyzero 2016 / 12 / 03 ", formatter _ class = argparse. argumentdefaultshelpformatter, prefix _ chars ='-') parser.... | [
-0.02459758147597313,
-1.0184962749481201,
0.7669245600700378,
-0.5570123791694641,
-0.32999396324157715,
0.5868710279464722,
-0.04918605461716652,
0.29680687189102173,
-0.4007185101509094,
0.4423609972000122,
-0.15232078731060028,
0.2831542193889618,
0.012919344007968903,
0.50125372409820... |
def most _ frequent _ loser ( self ) : return reduce ( lambda a1, a2 : a1 if ( self. _ players [ a1 ]. losses / self. _ players [ a1 ]. games _ played ) > ( self. _ players [ a2 ]. losses / self. _ players [ a2 ]. games _ played ) else a2, self. _ players ) | [
0.1380082219839096,
-0.5238759517669678,
0.7531124949455261,
-0.575880229473114,
0.07948116213083267,
-0.32688668370246887,
-0.05492864549160004,
-0.664536714553833,
-0.061875972896814346,
-0.7363331317901611,
1.252305269241333,
0.054701875895261765,
-0.2544945180416107,
0.2091215699911117... |
def _ _ get _ object _ properties ( self, in _ object, excluded _ params ) : if in _ object is none : raise valueerror ( " in _ object can't be none " ) if excluded _ params is none : raise valueerror ( " excluded _ params can't be none " ) m _ return = [ ] m _ return _ append = m _ return. append for l _ p in self. _ ... | [
-0.9568240642547607,
-1.052808403968811,
0.7634090185165405,
-0.1335054188966751,
-0.48033350706100464,
0.20388546586036682,
-0.7656146287918091,
0.06954018771648407,
0.17337565124034882,
0.19868485629558563,
-0.20841963589191437,
0.3142602741718292,
0.25723493099212646,
0.7686516642570496... |
def set _ name ( self, name ) : if name is none or not isinstance ( name, str ) : raise valueerror ( " invalid name argument " ) self. name = name | [
-0.5342057347297668,
-0.04893122985959053,
0.32459118962287903,
-0.23810647428035736,
-0.25072091817855835,
-0.1250905692577362,
-0.2230929583311081,
0.0001594310742802918,
-0.07027159631252289,
0.8029372692108154,
-0.6534532904624939,
0.04686542972922325,
-0.19299493730068207,
0.777724206... |
def _ _ init _ _ ( self, host, port, username, password, ssh _ key ) : self. _ host = host self. _ port = port or 22 self. _ username = username self. _ password = password self. _ ssh _ key = ssh _ key self. _ client = none | [
0.35493505001068115,
0.19619892537593842,
0.5949472784996033,
0.4262705445289612,
0.4018128216266632,
-0.21916861832141876,
-0.2714492976665497,
0.5958243012428284,
-1.493369698524475,
-0.09366469085216522,
-0.8321514129638672,
0.38897308707237244,
-0.02639850042760372,
0.3660942316055298,... |
def update _ weights _ bias ( opts, grads, params ) - > none : for k, v in params. items ( ) : if v. shards is not none : # rts variable ops. scaled _ add _ ( v. shards, grads [ k ], b = - opts. lr ) if v. remote _ buffer is not none : ops. remote _ store ( v. remote _ buffer, 0, v. shards ) else : # not rts variable o... | [
-0.010431205853819847,
-0.14814336597919464,
0.3976205885410309,
-0.8286555409431458,
0.7671079039573669,
0.6699820756912231,
-0.3924938142299652,
-0.24113242328166962,
-0.38825517892837524,
2.006765365600586,
0.02133346162736416,
0.6650035381317139,
-0.9568657279014587,
0.4496929347515106... |
def json _ to _ mv ( file ) : path = " / home / nmiguens / json / wlasl _ mv / mv. json " with open ( r " { } ". format ( path ), " r " ) as read _ file : data = json. load ( read _ file ) return np. array ( data [ file ] ) | [
-1.2628949880599976,
-1.4185048341751099,
0.45821550488471985,
-1.2172324657440186,
-0.22935688495635986,
-0.17761677503585815,
-0.28347495198249817,
-0.17738424241542816,
0.3015671372413635,
1.2122313976287842,
-0.3826037049293518,
1.1839191913604736,
0.8766904473304749,
0.271515548229217... |
def games _ operation ( self, path ) : if path = ='/ games': return [ x for x in self. _ games ] title, func = path. split ('/') [ 2 ], path. split ('/') [ 3 ] func = func. replace ('- ','_') operation = eval ( f'self. _ games [ " { title } " ]. { func } ( )') return operation | [
-1.3036614656448364,
0.12562480568885803,
0.6574606895446777,
-0.5727506875991821,
0.006136000622063875,
-0.9193500280380249,
0.18120428919792175,
-0.3719099164009094,
-0.5894098877906799,
1.0099003314971924,
0.14918841421604156,
-0.07519646733999252,
0.31598255038261414,
-1.58690130710601... |
def _ _ init _ _ ( self, sess, num _ actions, observation _ shape = dqn _ agent. nature _ dqn _ observation _ shape, observation _ dtype = dqn _ agent. nature _ dqn _ dtype, stack _ size = dqn _ agent. nature _ dqn _ stack _ size, num _ atoms = 51, vmax = 10., gamma = 0. 99, update _ horizon = 1, min _ replay _ history... | [
0.43900713324546814,
-0.25710153579711914,
0.9018495082855225,
-0.578359067440033,
-0.20752385258674622,
-0.7736098170280457,
0.21669265627861023,
0.1598198562860489,
0.6549078226089478,
-0.21981866657733917,
-0.9234549403190613,
0.2970277667045593,
0.09244368225336075,
-0.1849793046712875... |
def run _ command ( cmd, input _ = none ) : proc = subprocess. popen ( cmd, stdin = subprocess. pipe, stdout = subprocess. pipe, stderr = subprocess. pipe ) _ out, err = proc. communicate ( input _ ) if proc. returncode! = 0 : raise exception ( err ) | [
0.20092445611953735,
-0.07436888664960861,
0.8626753091812134,
0.22418107092380524,
-0.43985092639923096,
0.5617679357528687,
0.0763215497136116,
0.49255049228668213,
-0.4211547374725342,
-0.4618740379810333,
0.6142525672912598,
0.4014878571033478,
-0.23923586308956146,
0.4084594249725342,... |
def iou _ score ( self, set _ 1, set _ 2 ) : n = set _ 1. size ( 0 ) m = set _ 2. size ( 0 ) # gets the coordinate of the top left corner of the intersection top _ left = torch. max ( set _ 1 [ :, : 2 ]. unsqueeze ( 1 ). expand ( n, m, 2 ), set _ 2 [ :, : 2 ]. unsqueeze ( 0 ). expand ( n, m, 2 ) ) # gets the coordinate... | [
-0.315917044878006,
0.20528049767017365,
1.1207456588745117,
-0.5771105885505676,
-0.3714629113674164,
-0.03063407726585865,
0.4733012616634369,
0.12177383899688721,
-0.27045679092407227,
0.8305432796478271,
0.3164167106151581,
0.10125190019607544,
0.034242041409015656,
-0.7687158584594727... |
def crossmatch ( x1, x2, max _ distance = np. inf ) : x1 = np. asarray ( x1, dtype = float ) x2 = np. asarray ( x2, dtype = float ) n1, d = x1. shape n2, d2 = x2. shape if d! = d2 : raise valueerror ('arrays must have the same second dimension') kdt = ckdtree ( x2 ) dist, ind = kdt. query ( x1, k = 1, distance _ upper ... | [
0.9524514079093933,
0.07110147923231125,
0.7091705799102783,
0.4578457772731781,
-1.0246429443359375,
0.3346095383167267,
-0.9941233992576599,
0.7940769791603088,
-0.20162107050418854,
1.458828091621399,
0.15617841482162476,
0.719572126865387,
0.2224188596010208,
-0.6343927979469299,
-0.... |
def getgroup ( self ) : group _ id = self. request. get ( " group _ id " ) if group _ id is none : return none shop = self. _ getshop ( ) # returns group or none group = igroupmanagement ( shop ). getgroup ( group _ id ) products = [ ] line = [ ] for i, product in enumerate ( iproductmanagement ( group ). getproducts (... | [
-1.7153942584991455,
-0.057776715606451035,
0.36068788170814514,
-0.4433842897415161,
-0.10658372938632965,
-0.8853539824485779,
0.027654899284243584,
-1.3517354726791382,
-0.1724424809217453,
0.0028199462685734034,
-0.10961436480283737,
0.4998292028903961,
-0.08406499773263931,
0.81176853... |
def process _ logger _ data ( dat ) : logger = [ ] for group in dat [ " groups " ] : # bcd decoding for key in [ " year ", " weekday ", " month ", " day ", " hour ", " minute ", " second " ] : group [ key ] = bcd2int ( group [ key ] ) dtime = datetime. datetime ( 2000 + group [ " year " ], group [ " month " ], group [ ... | [
-0.04435429349541664,
-0.6975688934326172,
0.701947808265686,
-1.4406276941299438,
-0.7671902179718018,
-0.6420985460281372,
-0.5608087778091431,
0.03452228009700775,
-0.20519350469112396,
-0.11824485659599304,
-0.12667545676231384,
0.011661354452371597,
0.28006812930107117,
0.991837978363... |
def _ getshortname ( interface, filter _ suffixes ) : parts = interface. getname ( ). split ('_') [ 1 : ] tail = parts [ len ( parts ) - 1 ] if tail in filter _ suffixes : parts = parts [ : - 1 ] return''. join ( parts ) | [
0.10014873743057251,
0.5651364326477051,
0.7361345887184143,
-0.6496742367744446,
-1.1448979377746582,
-0.37096524238586426,
-0.016535846516489983,
-0.6199414730072021,
-0.02796199545264244,
0.4376181960105896,
-0.4125678241252899,
0.5435832738876343,
0.17292548716068268,
-0.35271525382995... |
def _ user _ registration ( self ) - > none : while true : candidate = yield self. waiting _ room. exit ( ) print ( f " candidate { candidate. id } has started registration. " ) | [
-0.8415337204933167,
0.3047027587890625,
0.33486804366111755,
0.8956417441368103,
0.038492169231176376,
0.5050254464149475,
0.3739705979824066,
0.5531540513038635,
-0.9747024178504944,
0.27337202429771423,
-1.0295860767364502,
0.5971553921699524,
0.3132897615432739,
-0.03088442049920559,
... |
def poly _ centroid ( self, p ) : foo = np. asarray ( p ) # move points along by one : foo _ p = np. roll ( foo, - 1, axis = 0 ) ai = foo [ :, 0 ] * foo _ p [ :, 1 ] - foo _ p [ :, 0 ] * foo [ :, 1 ] aa = ( 1 / 2 ) * np. sum ( ai ) # signed area if aa! = 0. 0 : cx = ( 1 / ( 6 * aa ) ) * np. sum ( ( foo [ :, 0 ] + foo _... | [
0.2549303472042084,
-1.232312560081482,
0.7955024242401123,
-0.26259374618530273,
-0.39166462421417236,
0.20661070942878723,
0.7511118054389954,
0.2927592098712921,
1.215052604675293,
0.9170933365821838,
0.1881682425737381,
-0.20121844112873077,
-0.21285676956176758,
-0.6173219084739685,
... |
def onclose ( self, event ) : # close all renderwindow interactors beneath us queue = [ self. _ explorer ] while queue : window = queue. pop ( 0 ) for child in window. getchildren ( ) : if isinstance ( child, wxvtkrenderwindowinteractor ) : if isinstance ( event, wx. closeevent ) : child. close ( not event. canveto ( )... | [
-0.2255840301513672,
-0.47748979926109314,
1.0721925497055054,
0.8453469276428223,
-0.63956618309021,
0.5817070603370667,
0.8611776232719421,
0.14138147234916687,
0.16805090010166168,
0.0021634141448885202,
0.1765681803226471,
-0.5704782605171204,
-1.1828365325927734,
0.8009267449378967,
... |
def has _ finished _ all _ suggestions ( self ) : has _ suggestion = false for x in self. boxes : if x. attribute! = self. suggestion _ box _ attr : continue has _ suggestion = true if not x. finished : return false return has _ suggestion | [
-1.0246729850769043,
-0.7968257665634155,
0.662814736366272,
0.22334666550159454,
0.11618293076753616,
0.33576658368110657,
0.06088333949446678,
-0.6892908811569214,
-1.3088105916976929,
0.5578609108924866,
-0.6012807488441467,
-0.47947606444358826,
-0.4942532777786255,
1.593013048171997,
... |
def _ collapsependingtext ( self ) : data =''. join ( self. _ pendingtext ) data = self. _ unmungeentities ( data ) self. _ currentnode. children. append ( _ textnode ( data ) ) self. _ pendingtext = [ ] | [
-0.431829035282135,
-0.3254980742931366,
0.5034579038619995,
-1.3162059783935547,
-1.062092661857605,
-0.12368039786815643,
-0.35455289483070374,
1.3517450094223022,
-0.238682359457016,
0.7247365713119507,
0.22862067818641663,
-0.637657642364502,
-0.941277801990509,
0.7300633192062378,
0... |
def test _ comparation _ matrix ( self ) : assert ( self. matrix = = matrix ( [ [ 1, 2 ], [ 4, 3 ] ] ) ) assert ( self. matrix = = [ [ 1, 2 ], [ 4, 3 ] ] ) assert ( [ [ 1, 2 ], [ 4, 3 ] ]! = self. matrix ) assert ( [ [ 1, 2 ], [ 4, 3 ] ] = = self. matrix. elements ) assert ( not ( self. matrix = = [ [ 1, 1 ], [ 1, 1 ] ... | [
-0.024549955502152443,
-0.26494914293289185,
0.40975049138069153,
0.00033901308779604733,
0.22953270375728607,
0.14317309856414795,
1.0198454856872559,
-0.1898244321346283,
0.38754159212112427,
-0.21459268033504486,
-0.15777826309204102,
-0.20053191483020782,
-0.3298121392726898,
0.5907486... |
def to _ str ( value ) : if isinstance ( value, np. ndarray ) and value. dtype. kind = ='s': return np. char. decode ( value,'utf - 8 ','surrogateescape') elif isinstance ( value, bytes ) : return value. decode ('utf - 8 ','surrogateescape') # we use type ( value ) so that subclasses are reconstructed correctly if isin... | [
-0.23754620552062988,
-0.34646278619766235,
0.7625774145126343,
-0.30275392532348633,
-0.7641002535820007,
-0.4751885235309601,
-0.41115617752075195,
-1.1412367820739746,
0.7118657827377319,
0.29322636127471924,
0.16710682213306427,
0.4283263385295868,
0.33155035972595215,
-0.1562634408473... |
def send _ swift _ message _ to _ amb ( msg _ type, swift _ msg, msg _ id, pkg _ amb _ params _ fparameter ) : try : last _ mid = none pkg _ sender _ subject = get _ value _ of _ fparameter _ for ( pkg _ amb _ params _ fparameter,'ambsendersubject') sender _ channel = get _ value _ of _ fparameter _ for ('fswiftwritera... | [
0.34017595648765564,
-0.05268323794007301,
0.8779957890510559,
0.17398381233215332,
0.347847580909729,
-0.025715572759509087,
0.3808111548423767,
-0.9307283163070679,
-0.46490487456321716,
0.6507278680801392,
0.10497558861970901,
0.3230515420436859,
-1.137877106666565,
1.0535346269607544,
... |
def _ cron ( self ) : self. logger. debug ( " checking if cron emit should run " ) if ( self. utc ( ) ) : now = datetime. utcnow ( ) else : now = datetime. now ( ) now = [ str ( now. minute ), str ( now. hour ), str ( now. day ), str ( now. month ), str ( now. weekday ( ) ) ] if self. _ check _ cron ( now ) : spawn ( s... | [
-0.3392409682273865,
-0.1760544627904892,
0.6843900084495544,
0.36457228660583496,
0.48990097641944885,
0.23021458089351654,
-1.0798484086990356,
0.29964351654052734,
-0.36362311244010925,
-0.06209149584174156,
0.3029187321662903,
0.6027536988258362,
-0.7510294914245605,
0.4097384810447693... |
def mackey _ sequence ( b = none, n = 3000 ) : c = 0. 2 tau = 17 n = 10 yinit = np. array ( [ 0. 9697, 0. 9699, 0. 9794, 1. 0003, 1. 0319, 1. 0703, 1. 1076, 1. 1352, 1. 1485, 1. 1482, 1. 1383, 1. 1234, 1. 1072, 1. 0928, 1. 0820, 1. 0756, 1. 0739, 1. 0759 ] ) if b is none : b = np. zeros ( n ) + 0. 1 y = np. zeros ( n )... | [
-0.302319198846817,
-0.09699621051549911,
0.8114251494407654,
-0.06986594945192337,
0.14758504927158356,
-0.7961081266403198,
0.10554368793964386,
-0.30712369084358215,
0.2535594403743744,
0.4068053662776947,
-0.49116191267967224,
0.0929274931550026,
-0.7487180233001709,
0.9649676084518433... |
def get _ curr _ masks ( self ) : # g, p : ( b, c, h, w ) g = self. noisy _ true _ gate. cpu ( ). numpy ( ) p = self. pred _ gate. cpu ( ). numpy ( ) if g. shape [ 1 ] > 1 : # multi channel setting g = g. mean ( axis = 1, keepdims = true ) p = p. mean ( axis = 1, keepdims = true ) return g, p | [
-0.4198612868785858,
-0.19086118042469025,
0.5801025032997131,
0.02839026227593422,
0.29102829098701477,
0.3383851647377014,
0.6786472201347351,
-0.9703611135482788,
-0.7978840470314026,
1.394232988357544,
0.33441653847694397,
1.1454147100448608,
-0.3448813557624817,
1.3925182819366455,
... |
def empty _ prefix ( self ) : raise notimplementederror ( ) | [
-0.19143980741500854,
-0.24087858200073242,
0.6568456888198853,
-0.1443377137184143,
0.20965643227100372,
0.8924992680549622,
0.328132301568985,
-0.002304633380845189,
0.5913146138191223,
-0.3334388732910156,
-0.8159348964691162,
0.8004672527313232,
-0.16813023388385773,
0.4051669239997864... |
def build _ service _ calls _ list ( n ) : s _ call _ regids = set ( ) while len ( s _ call _ regids ) < n : new _ str = " ". join ( np. random. choice ( list ( string. ascii _ uppercase ) ) for _ in range ( s _ call _ len ) ) s _ call _ regids. add ( new _ str ) return s _ call _ regids | [
-0.91508549451828,
1.0809855461120605,
0.49296844005584717,
-0.9700010418891907,
0.4193972051143646,
0.7146954536437988,
-1.0020085573196411,
-0.9563611149787903,
0.8660052418708801,
0.17876845598220825,
-0.44937601685523987,
0.6561500430107117,
-0.6618525981903076,
0.4796659052371979,
-... |
def upgrade _ plugin _ backup ( self ) : assert _ is _ not _ none ( self. plugin _ url, " example _ v [ 34 ] _ plugin _ remote _ url is not defined! " ) example _ plugin _ remote _ name = os. path. join ( " / var ", os. path. basename ( self. plugin _ url ) ) self. check _ run ( self. source _ snapshot _ name ) self. s... | [
-0.32128727436065674,
-0.8526584506034851,
0.8579775094985962,
0.033670131117105484,
1.0861306190490723,
-0.8401170969009399,
0.12116127461194992,
0.5672723054885864,
-0.30275481939315796,
0.8571376204490662,
-1.1419390439987183,
0.5580164194107056,
-0.003632990410551429,
-0.38684636354446... |
def shift _ cities ( road _ map ) : new _ road _ map = [ 0 for i in range ( len ( road _ map ) ) ] new _ road _ map [ 0 ] = road _ map [ - 1 ] for i in range ( len ( road _ map ) - 1 ) : new _ road _ map [ i + 1 ] = road _ map [ i ] return new _ road _ map | [
-1.464442491531372,
-0.47646358609199524,
0.6938780546188354,
-0.08848584443330765,
0.530999481678009,
0.885162353515625,
-0.09384430944919586,
-0.042745135724544525,
-0.07343518733978271,
0.5025728940963745,
-0.2122006118297577,
0.267715722322464,
-1.40225088596344,
-0.044649336487054825,... |
def dns ( adapter, networks ) : if networks : networks = " ". join ( networks ) dns _ output = execute ('networksetup - setdnsservers { } { } '. format ( adapter, networks ), capture = true, sudo = true ) if dns _ output : click. echo ('added dns servers { } to { } '. format ( networks, adapter ) ) | [
-0.5425892472267151,
1.255061388015747,
0.4492427110671997,
-0.18787363171577454,
0.7473978996276855,
0.022779544815421104,
-0.4455450177192688,
-1.1171435117721558,
1.7219971418380737,
-0.2221977412700653,
-0.9133762717247009,
0.22856998443603516,
0.5439766049385071,
-0.10952480882406235,... |
def a _ to _ d ( array : [ ], key : str ) - > dict : return { item [ key ] : item for item in array } | [
-0.4208998680114746,
-0.7215827107429504,
0.5481839776039124,
-1.2112102508544922,
-1.422971248626709,
0.38479381799697876,
-0.9076846241950989,
0.8195913434028625,
-0.0705297589302063,
1.0341943502426147,
0.4393734633922577,
-0.18374182283878326,
1.6058673858642578,
0.31351691484451294,
... |
def getpublictool ( self, name = none ) : return self. _ _ getone ( self. _ publictools, name, " publictools " ) | [
0.30125948786735535,
0.5891972780227661,
0.18062227964401245,
0.8824356198310852,
-0.3731701076030731,
0.13130462169647217,
0.45538902282714844,
-1.5459225177764893,
-1.0864187479019165,
-0.7202261090278625,
-0.2713378965854645,
0.9907467365264893,
-0.3154647648334503,
-0.07080122828483582... |
def dispatch _ event ( event ) : # event resource contains only one eventrecord events = event. redfish ['events'] event _ record = events [ 0 ] subscriptions = \ globals ( ) ['subscriptions _ by _ type'] [ event _ record ['eventtype'] ]. values ( ) for subscription in subscriptions : dispatcher = eventdispatcher ( eve... | [
0.8380040526390076,
-0.17889294028282166,
0.5293073654174805,
0.6628576517105103,
0.765974223613739,
0.04591115564107895,
0.05985167995095253,
0.12807752192020416,
0.5947767496109009,
0.11661107838153839,
-0.7717483043670654,
0.07617320865392685,
0.6656280755996704,
1.3383440971374512,
0... |
def player _ add ( ) : screen = snackscreen ( ) addprompt = entrywindow ( screen,'add shooter ','please enter the full name of the shooter ', ['name'] ) screen. finish ( ) print addprompt prompt = addprompt [ 0 ] name = addprompt [ 1 ] name = name [ 0 ] print " prompt : " + ` prompt ` print " name : " + ` name ` if nam... | [
0.2969772219657898,
-0.4252375066280365,
0.8163185119628906,
0.4686781167984009,
-0.6419724822044373,
0.18614640831947327,
0.14263632893562317,
-0.35803717374801636,
0.4846322536468506,
0.7330452799797058,
-0.3676486015319824,
0.40080684423446655,
-1.2674596309661865,
0.22719387710094452,
... |
def path _ align ( self ) : # function originally from mp - align ( adapted ) if not self. _ path _ align is none : return self. _ path _ align set1 = self. path1. longest _ paths set2 = self. path2. longest _ paths graph = [ ] sscore = { } if len ( set1 ) = = 0 or len ( set2 ) = = 0 : self. _ path _ align = { } return... | [
-0.31859806180000305,
-0.49808090925216675,
1.1389188766479492,
0.28730031847953796,
-0.8592048287391663,
-0.5001307129859924,
0.47603070735931396,
0.7033092975616455,
-0.8204805254936218,
0.5031585097312927,
-0.22745980322360992,
-0.803108274936676,
-0.3731081187725067,
0.3139051795005798... |
def update ( self, * * kwargs ) : super ( gamescene, self ). update ( * * kwargs ) if len ( self. canvas. glayers [ enemy _ layer ] ) = = 0 : self. galien = gameenemy ( self. alien _ img, 32, 32, owner = self ) self. canvas. add _ gobject ( self. galien, enemy _ layer ) | [
-0.7693327069282532,
-0.12745662033557892,
0.5373733639717102,
-0.2293744534254074,
0.5856661796569824,
0.9624060988426208,
-0.8000129461288452,
-0.7848628163337708,
-0.431697815656662,
0.3592967391014099,
-0.17962893843650818,
-0.8859102129936218,
-0.0384688563644886,
0.28167974948883057,... |
def test _ blank _ note ( self ) : # provide a blank note form = self. form _ data ( note = " ", client = self. client. pk, operator = self. staff _ user. pk ) errors = form [ " note " ]. errors. as _ data ( ) self. assertequal ( len ( errors ), 1 ) self. assertequal ( errors [ 0 ]. code, " required " ) | [
0.08893673121929169,
0.7014755606651306,
0.28948813676834106,
-0.681863009929657,
1.4398754835128784,
1.077266812324524,
0.12399990856647491,
0.037211500108242035,
-0.19114354252815247,
-0.7197609543800354,
-0.05515316128730774,
0.640053391456604,
-0.18586735427379608,
0.19030509889125824,... |
def last _ sent _ or _ received _ messages _ from _ contact ( conn : sqlite3. connection, mac _ address, limit = 10 ) : received _ messages = last _ received _ messages _ from _ contact ( conn, mac _ address, limit ) sent _ messages = last _ sent _ messages _ to _ contact ( conn, mac _ address, limit ) messages = [ ] f... | [
-0.13217556476593018,
-0.22194470465183258,
0.9313889145851135,
-1.3799768686294556,
0.09588438272476196,
-0.6963205337524414,
-0.271076500415802,
-0.47393059730529785,
0.24355751276016235,
0.620646595954895,
0.14322258532047272,
-0.15822258591651917,
0.10418828576803207,
0.234466001391410... |
def data _ id ( self ) : return " { } ". format ( self. n ) | [
0.6424339413642883,
-0.4806472361087799,
0.38743066787719727,
-0.8297492861747742,
0.6668170094490051,
1.716880440711975,
-1.0646865367889404,
-0.3794550895690918,
1.0464576482772827,
-0.8088998794555664,
-0.3923657536506653,
0.8623508214950562,
0.10484474897384644,
0.4023745059967041,
-... |
def _ _ getcommandbystage ( cmdlist ) : stages = { } for cmd in cmdlist. allcommands ( ) : if not stages. has _ key ( cmd. stage ( ) ) : stages [ cmd. stage ( ) ] = [ ] stages [ cmd. stage ( ) ]. append ( cmd ) return stages | [
-0.9538974761962891,
-0.4097157120704651,
0.5348004698753357,
0.48969516158103943,
-0.5931057929992676,
-0.4119761884212494,
0.46203023195266724,
-0.7953733205795288,
-0.08469323813915253,
0.48684415221214294,
-0.38307592272758484,
-1.4240297079086304,
0.21285967528820038,
1.69594442844390... |
def _ install _ traceable _ methods ( class _, * method _ names, * * keywords ) : logger = keywords. get ( " logger ", logging. getlogger ( _ generate _ logger _ name ( class _ ) ) ) if method _ names : traceable _ method _ names = _ get _ traceable _ method _ names ( method _ names, class _, exclude = keywords. get ( ... | [
-0.22217820584774017,
0.23524519801139832,
0.9093863368034363,
-0.33733537793159485,
-0.27422037720680237,
0.02108926884829998,
0.168273463845253,
-0.06307920068502426,
0.03888459876179695,
0.32859742641448975,
-0.34756308794021606,
-0.9127281308174133,
0.3204982578754425,
0.16247348487377... |
def print _ list _ md ( info ) : for item in info : print ('-'+ item ) | [
-0.3805133104324341,
-0.7311038374900818,
0.5673310160636902,
0.3863256573677063,
0.6354296207427979,
0.7211780548095703,
-1.9621210098266602,
0.8724627494812012,
-0.5694848895072937,
-0.03995811566710472,
0.27138522267341614,
0.3291229009628296,
0.5822514295578003,
1.4449135065078735,
-... |
def insertatindex ( self, x, i ) : temp = self. head while i! = 0 : temp = temp. next i = i - 1 self. insert ( x, temp ) | [
-0.9285412430763245,
0.5667766332626343,
0.34144821763038635,
-0.20220670104026794,
-0.2222709208726883,
0.6253191828727722,
-0.08296599239110947,
-0.3045729696750641,
-0.447297066450119,
0.12693409621715546,
-1.648614525794983,
-0.5512561798095703,
-1.418921947479248,
-0.21200089156627655... |
def find _ decorrelation _ pairs ( simname, cutoff, coords _ loc = [ 3, 6 ] ) : coord, bs = extract. extract _ unwrapped ( simname, boxsize _ whole = true ) correlation _ fn _ whole = np. zeros ( ( len ( coord. keys ( ) ), 1 ) ) outer _ index = 0 for key in coord : current _ timestep = coord [ key ] type2 = current _ t... | [
-0.7802656292915344,
0.2717297375202179,
0.7560608386993408,
-0.5056021809577942,
-0.11943857371807098,
-0.3445185124874115,
0.6172888875007629,
0.4097922444343567,
-0.41115304827690125,
0.7045583128929138,
0.016629081219434738,
0.07476810365915298,
-0.3312470614910126,
0.2441859245300293,... |
def _ _ getfilereplicas ( self, lfns ) : replicas = { } noreplicas = { } res = self. dm. getactivereplicas ( lfns ) if not res ['ok'] : glogger. error ( " requestpreparation. _ _ getfilereplicas : failed to obtain file replicas. ", res ['message'] ) return res failed = res ['value'] ['failed'] for lfn, lfnreplicas in r... | [
-1.0850398540496826,
0.22267232835292816,
0.48010823130607605,
-0.6727187037467957,
0.3142254054546356,
-0.92082679271698,
-0.41112223267555237,
0.4426612854003906,
-0.7705134749412537,
-0.4289211928844452,
-0.3279346227645874,
0.21369659900665283,
-0.056301381438970566,
0.1308089792728424... |
def generate _ matrix ( minimum _ x, maximum _ x, number _ of _ dimensions, potential _ name, potential _ parameter ) : import numpy as np hbar = 1. 0 mass = 1. 0 grid _ spacing = ( maximum _ x - minimum _ x ) / ( number _ of _ dimensions - 1 ) units _ prefactor = hbar * * 2 / ( 2 * mass * grid _ spacing * * 2 ) horizo... | [
-0.3664708435535431,
-0.1394197940826416,
0.9956900477409363,
-0.34745875000953674,
-0.09007477760314941,
0.3314228057861328,
-0.09477724134922028,
-0.0850449800491333,
-0.1445983350276947,
0.09456401318311691,
-0.04902295395731926,
0.4290986955165863,
-0.22245866060256958,
0.3137783408164... |
def _ _ iter _ _ ( self ) : for e in self. _ params : yield self. _ _ dict _ _ [ e ] | [
-0.9634050130844116,
-0.9132224321365356,
0.2913215160369873,
-0.7571438550949097,
0.2679051160812378,
0.5077844262123108,
-0.3278658390045166,
-0.3997446894645691,
-0.8620104193687439,
0.06776781380176544,
0.8265830278396606,
0.2607584595680237,
0.3535497188568115,
0.888997495174408,
-1... |
def find _ all _ row _ schema _ errors ( self ) : errors = [ ] for ( table _ name, rows ) in self. rows. items ( ) : for row in rows : if hasattr ( row,'schema _ errors') : errors. extend ( row. schema _ errors ) # verify the columns which the inserts reference make sense if table _ name not in self. tables : errors. a... | [
-0.3154558539390564,
0.16121315956115723,
0.5859431028366089,
-0.12939392030239105,
0.4160356819629669,
-0.055198654532432556,
-0.10147884488105774,
0.3621877431869507,
0.04729487746953964,
0.38930320739746094,
-0.3811461925506592,
-0.02218836173415184,
0.1632915884256363,
1.32993435859680... |
def target ( self ) - > optional [ str ] : return pulumi. get ( self, " target " ) | [
0.3727310597896576,
0.27919110655784607,
0.5056555271148682,
-0.0827169120311737,
1.5296624898910522,
0.8635295033454895,
-0.5337027907371521,
-0.09325744211673737,
0.5598943829536438,
-0.18759547173976898,
1.1541517972946167,
0.8031811118125916,
0.2853963077068329,
-1.8434797525405884,
... |
def object _ id ( self, object _ id ) : self. _ object _ id = object _ id | [
0.9765186905860901,
-1.3451889753341675,
0.1790926307439804,
0.3956352174282074,
0.9173734188079834,
1.5536926984786987,
0.3688608407974243,
1.4700846672058105,
0.42044293880462646,
0.22649560868740082,
-0.7375350594520569,
0.35655224323272705,
0.5664253830909729,
0.41499555110931396,
0.... |
def hard _ set _ joint _ angles ( self, arg _ list _ joint _ angles, arg _ max _ attempts ) : number _ attempts = 0 flag _ success = false while ( ( number _ attempts < = arg _ max _ attempts ) and ( flag _ success is false ) ) : number _ attempts + = 1 flag _ success = self. set _ joint _ angles ( arg _ list _ joint _... | [
-1.225142478942871,
0.9520595669746399,
0.49791085720062256,
0.41945385932922363,
0.6393581628799438,
0.6745914816856384,
0.2991296648979187,
-0.24695999920368195,
-0.05636760964989662,
0.39689165353775024,
-0.4729885458946228,
-0.015825461596250534,
-1.0239437818527222,
-0.446823388338089... |
def test _ get _ timezones _ by _ countries1 ( self ) : pass | [
-0.7858016490936279,
0.9860495328903198,
-0.09269192814826965,
2.072017192840576,
0.30313989520072937,
0.5578734874725342,
2.0625991821289062,
-0.32103219628334045,
0.37884649634361267,
0.7519540786743164,
-0.5900780558586121,
-1.1890740394592285,
-1.1134177446365356,
0.18398645520210266,
... |
def coalesce ( bits ) : def operation ( a, b ) : return a < < 1 | b return reduce ( operation, bits ) | [
-0.07188370078802109,
1.2510082721710205,
0.546671450138092,
1.2119237184524536,
-0.25003400444984436,
-0.17783229053020477,
0.08262667804956436,
-0.9702982306480408,
0.13393007218837738,
-0.5390899181365967,
-0.18821771442890167,
0.015540983527898788,
-0.2574203312397003,
0.33594912290573... |
def start _ playlist ( self ) : self. ui. show _ message ('start playlist') subprocess. call ( ['mplayer ','- vo ','null ','- playlist ', self. tracks _ list. playlist _ uri,'- shuffle'] ) self. ui. show _ message ('end playlist') | [
0.2860119044780731,
-0.5547983646392822,
0.4740147292613983,
0.1277233362197876,
0.4916727542877197,
0.24813029170036316,
1.0229111909866333,
0.5527330636978149,
0.03410722687840462,
0.06270451843738556,
-0.08731820434331894,
0.8969139456748962,
-0.8339206576347351,
0.8139795660972595,
-... |
def itksmoothingrecursivegaussianimagefilteriuc3iuc3 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilteriuc3iuc3 _ cast ( * args ) | [
0.3674699664115906,
1.0489133596420288,
0.18206147849559784,
-1.1322578191757202,
0.11771303415298462,
1.1211841106414795,
0.5845895409584045,
0.02734118513762951,
-0.059875983744859695,
-0.3020138442516327,
0.65997314453125,
0.2734262943267822,
-0.3558236360549927,
0.6557939052581787,
0... |
def build _ discriminator _ logits _ layer ( flatten _ layer, logits _ layer, params ) : with tf. variable _ scope ( name _ or _ scope = " discriminator ", reuse = tf. auto _ reuse ) : block _ conv _ size = params [ " discriminator _ base _ conv _ blocks " ] [ - 1 ] [ - 1 ] [ 3 ] # flatten final block conv tensor. bloc... | [
-0.5265218019485474,
-0.7223327159881592,
0.4960143566131592,
-0.20968538522720337,
0.2329714000225067,
-0.11551626026630402,
-0.1045452281832695,
0.357037216424942,
0.184626966714859,
-0.20952031016349792,
-0.23189105093479156,
0.8925072550773621,
-0.6182907819747925,
-0.37694981694221497... |
def list _ kadastrale _ afdelingen _ by _ gemeente ( self, gemeente, sort = 1 ) : try : gid = gemeente. id except attributeerror : gid = gemeente gemeente = self. get _ gemeente _ by _ id ( gid ) gemeente. clear _ gateway ( ) def creator ( ) : url = self. base _ url + " / municipality / % s / department " % gid h = sel... | [
-0.2930072546005249,
0.10298825800418854,
0.5918556451797485,
-0.20133426785469055,
-1.1294622421264648,
-0.28249824047088623,
-0.6868022084236145,
-0.9808535575866699,
0.647525429725647,
0.5249418616294861,
0.6305609941482544,
0.24772734940052032,
-0.3703385591506958,
1.543932318687439,
... |
def transduce ( self, start, end ) : raise notimplementederror | [
0.005236503668129444,
-0.12357213348150253,
0.5248037576675415,
-0.6784030199050903,
0.3273285925388336,
0.002489459468051791,
-0.38931846618652344,
-0.197898268699646,
-0.514973521232605,
0.27550673484802246,
-0.7599153518676758,
0.6213726997375488,
-0.23906297981739044,
-0.51907742023468... |
def fix _ orientation _ and _ save ( src ) : if'image'not in str ( magic. from _ file ( src ) ). lower ( ) : return try : img = image. open ( src ) if not getattr ( img,'_ getexif ', none ) : return except oserror : return img, exif = resizer. fix _ orientation ( img ) if not exif : return # save params ( some formats ... | [
-0.7982725501060486,
0.174736887216568,
0.5653144121170044,
1.0521646738052368,
0.21865490078926086,
-0.5057077407836914,
0.3277706503868103,
0.7098089456558228,
-0.16103804111480713,
0.5440564155578613,
-0.6535862684249878,
-1.0587624311447144,
0.37718796730041504,
0.9035416841506958,
-... |
def scrap _ pdf ( pdf _ files, output _ dir, page _ with _ positive _ breakdown ) : if not os. path. isdir ( output _ dir ) : raise ioerror ( f " output : { output _ dir } is not a directory " ) paths = [ ] for pdf _ file in pdf _ files : date, csv _ path = scrap _ pdf _ to _ csv ( pdf _ file, output _ dir, page _ with... | [
-0.8057223558425903,
-0.775343656539917,
0.47552967071533203,
1.1344548463821411,
0.8169971108436584,
-0.347339928150177,
0.33513280749320984,
0.3735308349132538,
-0.4319465160369873,
-0.18469363451004028,
0.59855717420578,
-1.0496852397918701,
0.6511617302894592,
0.13521796464920044,
-0... |
def reset _ password ( email ) : if not email : response = jsonify ( {'error':'no email sent'} ) response. status _ code = 400 return response if not validate _ email ( email ) : response = jsonify ( {'error':'enter valid email'} ) response. status _ code = 400 return response user = usermodal ( email = email, password... | [
-0.8530411720275879,
0.2223050892353058,
0.9838702082633972,
0.5881807804107666,
0.6035332679748535,
-0.7298710346221924,
0.08293478190898895,
0.33451759815216064,
-0.0012698377249762416,
1.258730173110962,
0.08418320119380951,
0.7985401153564453,
-0.3735314905643463,
-0.1360759139060974,
... |
def itksmoothingrecursivegaussianimagefilterius2ius2 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilterius2ius2 _ cast ( * args ) | [
-0.9013988971710205,
-0.5614612698554993,
0.08744610100984573,
-0.536350429058075,
-0.6400713324546814,
-0.05030248686671257,
-0.3657481372356415,
-0.9808081984519958,
-0.8687143921852112,
-0.1280340850353241,
0.20605143904685974,
0.944388210773468,
-0.7634991407394409,
1.7202900648117065,... |
def poll ( assistant _ thread ) : is _ active = false # vals = [ 1, 1, 1 ] vals = [ 0, 0, 0 ] while true : # get input value val = gpio. input ( push _ to _ talk _ pin ) # print ( " input = ", in _ val ) # shift values vals [ 2 ] = vals [ 1 ] vals [ 1 ] = vals [ 0 ] vals [ 0 ] = val # check for button press and hold # ... | [
-0.3025364875793457,
-0.6596373319625854,
0.7862321138381958,
0.2289077788591385,
-0.3984769582748413,
0.7699890732765198,
0.11978364735841751,
-0.9941951632499695,
0.302182137966156,
0.2844300866127014,
0.24857260286808014,
0.21712517738342285,
-0.526637077331543,
0.2661992907524109,
0.... |
def test _ _ parse _ visibility ( ) : for input _ data, expected _ output in ( ( { }, connectionvisibility. user _ only ), ( {'visibility': connectionvisibility. user _ only. value }, connectionvisibility. user _ only ), ( {'visibility': connectionvisibility. everyone. value }, connectionvisibility. everyone ), ) : out... | [
0.3523564636707306,
-0.014367862604558468,
0.45119866728782654,
1.152141809463501,
0.06524542719125748,
-0.3493225872516632,
-0.30365312099456787,
0.1827164590358734,
-0.14913611114025116,
0.3969130516052246,
-0.5273458957672119,
-0.5137393474578857,
-0.40634089708328247,
0.494451344013214... |
def remove _ vowels ( word ) : if len ( word ) < = 1 : if is _ vowel ( word ) : return'' return word elif is _ vowel ( first ( word ) ) : return remove _ vowels ( rest ( word ) ) return first ( word ) + remove _ vowels ( rest ( word ) ) | [
0.1585693657398224,
0.37100663781166077,
0.5103234648704529,
0.9252878427505493,
-0.3385674059391022,
-0.24162805080413818,
-0.2812689244747162,
0.27492663264274597,
1.0502742528915405,
0.4331532418727875,
0.15098543465137482,
-0.3818899691104889,
-0.8740126490592957,
-0.07101104408502579,... |
def polar _ coords ( xyz, axis1 = np. array ( [ 0, 0, 0 ] ), axis2 = np. array ( [ 0, 0, 0 ] ), mod = true ) : tpi = 2 * np. pi polar = np. zeros ( 3 ) xy = xyz [ 0 ] * * 2 + xyz [ 1 ] * * 2 polar [ 0 ] = np. sqrt ( xy + xyz [ 2 ] * * 2 ) polar [ 1 ] = np. arctan2 ( np. sqrt ( xy ), xyz [ 2 ] ) - axis1 [ 1 ] polar [ 2 ... | [
-0.05962357297539711,
-0.5348770618438721,
0.7103712558746338,
-0.4715379476547241,
-0.35027554631233215,
0.3452548086643219,
-0.8098018765449524,
0.31158769130706787,
-0.23370976746082306,
0.3184981346130371,
-0.2603220045566559,
0.06222645565867424,
-0.9570821523666382,
-0.87584584951400... |
def pytest _ unconfigure ( config ) : cache _ path = os. path. abspath ( '. cache / v / cache / lastfailed') if os. path. isfile ( cache _ path ) : lastfailed _ file = open ( cache _ path,'r') text = lastfailed _ file. read ( ) lastfailed _ file. close ( ) text _ insert ='% s \ n'% config. getoption ('- - seq - config'... | [
0.08422290533781052,
0.5133630037307739,
0.5432146787643433,
-0.6101212501525879,
0.5047156810760498,
-0.12450776249170303,
0.9597834944725037,
1.414169192314148,
0.458953857421875,
0.7064061760902405,
-0.6104286909103394,
-0.4523891806602478,
-0.5219466090202332,
-0.15884843468666077,
0... |
def somatic _ msi _ calling _ workflow ( dummy _ workflow, minimal _ config, dummy _ cluster _ config, config _ lookup _ paths, work _ dir, config _ paths, cancer _ sheet _ fake _ fs, mocker, ) : # patch out file - system related things in abstract ( the crawling link in step is defined there ) patch _ module _ fs ( " ... | [
-0.5377367734909058,
0.29134249687194824,
0.46617263555526733,
-0.14865796267986298,
-0.8020654916763306,
-0.15928032994270325,
-0.3306932747364044,
-0.0306254830211401,
0.44121241569519043,
-0.14854593575000763,
-0.005912837106734514,
-0.1597350686788559,
0.1576407104730606,
-0.0454487726... |
def update _ subscription _ plan ( self, plan _ id ) : action = " update subscription plan % s " % plan _ id # todo implement self. log. info ( action, " not yet implemented " ) return true | [
0.07681804150342941,
-0.8488783240318298,
0.412930428981781,
0.6661860942840576,
-0.6052764058113098,
0.6237891316413879,
-0.3599996268749237,
-0.47621819376945496,
0.921768844127655,
0.21242697536945343,
-1.1801564693450928,
1.1371982097625732,
-0.285885214805603,
-0.5571706295013428,
-... |
def get _ string _ contents ( self, head _ pos _ char ) : # array of lines - top down, could be : supers, base, subs ; supers, base ; # base, subs ; base lines = [ ] for _ in range ( self. symbol _ height ) : lines. append ('' ) supers = subs = none if self. alpha _ has _ supers ( ) : supers = 0 base = 1 else : base = ... | [
0.18782708048820496,
-0.9197189807891846,
0.8147240281105042,
-1.050946831703186,
-0.8712900280952454,
-1.0528584718704224,
0.26627305150032043,
-0.7786914706230164,
0.27789419889450073,
-0.4021945595741272,
0.12280356884002686,
0.01687336340546608,
0.34859228134155273,
0.4491119384765625,... |
def readinput ( ) : import argparse parser = argparse. argumentparser ( ) parser. add _ argument ( " mazename ", type = str, help = " the name of a maze file in the maze folder, excluding. maze suffix " ) parser. add _ argument ( " - m ", " - - searchmethod ", type = str, default = " bfs ", help = " the type of search ... | [
-0.20520228147506714,
-0.4159781038761139,
0.8566977381706238,
0.061914488673210144,
0.2507055401802063,
0.5858930945396423,
0.48266881704330444,
0.32404258847236633,
-0.4660432040691376,
0.2676345407962799,
0.21172961592674255,
-0.22158606350421906,
-1.068577766418457,
0.36970484256744385... |
def external _ matcher ( database, patient, node = none ) : query = { } if node : query [ " _ id " ] = node # get all connected nodes or ther one specified by user connected _ nodes = list ( database [ " nodes " ]. find ( query ) ) if not connected _ nodes : log. error ( " could't find any connected mme nodes. aborting... | [
-0.8219513297080994,
0.04855683445930481,
0.9000706672668457,
-0.6437069773674011,
-0.582827091217041,
-0.11445178091526031,
-0.9569660425186157,
0.18363109230995178,
-0.42121389508247375,
0.5004521608352661,
0.2924521565437317,
0.3339945375919342,
-0.0966014638543129,
0.5415500402450562,
... |
def pdtb _ parser _ results ( doc ) : # todo pass | [
-0.534906268119812,
-0.40230292081832886,
0.15293675661087036,
0.3941592574119568,
-0.24014469981193542,
0.7208594083786011,
0.37536782026290894,
-0.22748558223247528,
-1.4119939804077148,
-1.0767453908920288,
-1.0828936100006104,
-0.7048103213310242,
-0.49223586916923523,
0.80856233835220... |
def create _ bucket ( ) : return { x : 0 for x in range ( int ( max _ hue / hue _ division ) ) } | [
-0.5361880660057068,
0.8290132880210876,
0.4290710687637329,
0.42397841811180115,
0.07164929062128067,
0.46592798829078674,
0.10952505469322205,
-0.30619925260543823,
-0.3160419166088104,
-0.6670913100242615,
-0.5356113314628601,
-0.9397927522659302,
0.9266878962516785,
0.9036860466003418,... |
def gettestbatch ( self ) : # optional image and label batching if self. currentindextest > = self. totalimagestest : return none, none endindex = self. currentindextest + self. options. batchsize if endindex > self. totalimagestest : endindex = self. totalimagestest self. indices = np. arange ( self. currentindextest,... | [
-0.7280698418617249,
-1.1259686946868896,
0.4859536588191986,
-0.6236622929573059,
0.0394890196621418,
-0.11063141375780106,
0.1662941575050354,
-0.46018216013908386,
0.03504835069179535,
-0.3297168016433716,
0.4304869771003723,
0.1236083060503006,
-0.9343023300170898,
-0.06300193816423416... |
def extend ( self, router ) : self. registry. extend ( router. registry ) | [
0.1428026705980301,
0.808617889881134,
0.41440287232398987,
0.7780698537826538,
0.36699217557907104,
0.8559427261352539,
-0.4222562909126282,
0.5309354066848755,
1.3603483438491821,
-0.14063258469104767,
-0.7711097002029419,
1.1663568019866943,
0.038125790655612946,
1.029617428779602,
-0... |
def costfunction ( theta, x, y, lamda ) : h = sigmoid ( np. dot ( x, theta. reshape ( ( len ( theta ), 1 ) ) ) ) m = x. shape [ 0 ] return ( 1. 0 / m ) * np. sum ( - y * np. log ( h ) - ( 1. 0 - y ) * np. log ( 1. 0 - h ) ) + lamda / ( 2. 0 * m ) * np. sum ( theta * * 2 ) | [
0.6158709526062012,
-0.07156369090080261,
0.5678269267082214,
-0.86014324426651,
-0.5230355858802795,
-0.6293900012969971,
-0.20074336230754852,
0.15778684616088867,
-0.10579777508974075,
0.9384902119636536,
0.004283057060092688,
0.4124085009098053,
-0.4526298940181732,
-0.2647537589073181... |
def demo _ trained ( env : unityagents. unityenvironment, agent : agents. ddpgagent ) - > float : brain _ name = env. brain _ names [ 0 ] env _ info = env. reset ( train _ mode = false ) [ brain _ name ] states = env _ info. vector _ observations num _ agents = len ( env _ info. agents ) scores = np. zeros ( num _ agen... | [
-0.4416338801383972,
0.1483660787343979,
0.7857258915901184,
-0.4627690315246582,
0.3470616340637207,
-0.2272978127002716,
0.4928732216358185,
-0.33162370324134827,
-0.04909101128578186,
1.0355321168899536,
-0.06101209670305252,
0.5275884866714478,
0.2283899039030075,
0.4251514971256256,
... |
def extant _ file ( x ) : if not os. path. exists ( x ) : print " error : { 0 } does not exist ". format ( x ) exit ( ) x = str ( x ) return x | [
0.45210525393486023,
-0.9104536175727844,
0.7670788764953613,
-0.9521960020065308,
0.17802879214286804,
2.167351007461548,
-0.17154385149478912,
0.2370685636997223,
-0.3281950354576111,
0.5774738788604736,
1.1815871000289917,
0.0203250702470541,
0.8452351093292236,
-0.3187217712402344,
0... |
def contains ( self, key ) : index = self. _ bucket _ index ( key ) bucket = self. buckets [ index ] for i in bucket : if i. data [ 0 ] = = key : return true return false # todo : check if the given key exists in a bucket | [
-0.6513892412185669,
0.04472235590219498,
0.3495636284351349,
0.008121519349515438,
-0.4919179379940033,
0.3622187674045563,
-0.5631504654884338,
-0.23265528678894043,
-0.34986069798469543,
-0.43197759985923767,
-0.6341127157211304,
-0.034934818744659424,
-0.5679267048835754,
0.53795284032... |
def loss ( self, h1, h2 ) : r1 = 1e - 3 r2 = 1e - 3 eps = 1e - 9 h1, h2 = h1. t ( ), h2. t ( ) # assert torch. isnan ( h1 ). sum ( ). item ( ) = = 0 # assert torch. isnan ( h2 ). sum ( ). item ( ) = = 0 o1 = o2 = h1. size ( 0 ) m = h1. size ( 1 ) # print ( h1. size ( ) ) h1bar = h1 - h1. mean ( dim = 1 ). unsqueeze ( d... | [
-0.015536908991634846,
-0.3898659646511078,
1.057347297668457,
0.7504824995994568,
-0.2855468988418579,
-0.06311963498592377,
0.6222670674324036,
0.06904058903455734,
-0.7771535515785217,
0.4814397692680359,
-0.6338289380073547,
-0.029927723109722137,
0.05199071392416954,
0.661432743072509... |
def validate _ ssn ( ssn ) : if type ( ssn ) = = int and len ( str ( ssn ) ) = = 10 : print ( " mammma " ) else : print ( " { } is invalid ". format ( ssn ) ) | [
0.4452301859855652,
0.2474406361579895,
0.68411785364151,
-0.10265325754880905,
-0.12880657613277435,
0.687134861946106,
-0.22762292623519897,
0.10922286659479141,
1.4436291456222534,
-0.3702603280544281,
-0.02656668797135353,
0.7893452048301697,
-0.01478404738008976,
1.0907342433929443,
... |
def create _ qr _ code ( doc, method ) : region = get _ region ( doc. company ) if region not in ['saudi arabia'] : return # if qr code field not present, do nothing if not hasattr ( doc,'qr _ code') : return # don't create qr code if it already exists qr _ code = doc. get ( " qr _ code " ) if qr _ code and frappe. db.... | [
0.3688085973262787,
-0.18691249191761017,
0.72434002161026,
-0.2134171724319458,
0.21630223095417023,
0.12390752881765366,
0.14833591878414154,
-0.25881651043891907,
-0.23835787177085876,
-0.16289232671260834,
0.35559454560279846,
-0.6159257292747498,
0.27615272998809814,
0.565358936786651... |
def forward ( self, input ) : b _ size = input. size ( 0 ) meanenc, sigmaenc = self. encoder ( input ) randsample = torch. randn ( size = ( b _ size, self. z _ dim ) ) inputz = torch. mul ( sigmaenc, randsample ) inputz = inputz + meanenc meandec = self. decoder ( inputz ) p = torch. sum ( input * torch. log ( meandec ... | [
-0.36114025115966797,
0.01366116851568222,
0.8513910174369812,
0.45533621311187744,
-0.6009137630462646,
0.9179078340530396,
0.5584710240364075,
-0.006976795848459005,
0.10879949480295181,
0.11679099500179291,
-0.571057915687561,
0.5342763662338257,
0.20078082382678986,
0.6782719492912292,... |
def off _ screen ( obj ) : if obj. left > width : return true elif obj. right < 0 : return true elif obj. bottom < 0 : return true elif obj. top > height : return true return false | [
-1.25631582736969,
-0.7536107301712036,
0.9922668933868408,
0.2761576473712921,
-0.9466207027435303,
1.218921422958374,
0.009951923042535782,
-1.1884398460388184,
0.5787308812141418,
0.12501947581768036,
0.020794078707695007,
-0.6281790733337402,
-0.5418660044670105,
1.065206527709961,
-... |
def get _ pbto2 _ bins ( v, tsi _ max, bins = [ 1, 5, 10, 15, 20, 25, 30, np. inf ], interpolate = true ) : v = v. dropna ( ) if interpolate : v = interpolate _ ts ( v,'tsi _ min ','pbto2 ', 60 ) v = v [ ( v ['pbto2'] > 0 ) & ( v ['tsi _ min'] < = tsi _ max ) ] l = ['pbto2 _ ct _ bin _ { } '. format ( str ( b ). zfill ... | [
-0.4930858910083771,
-0.0977715253829956,
0.6555458903312683,
0.37997257709503174,
-0.16166774928569794,
0.3462922275066376,
-0.21107706427574158,
0.26692837476730347,
-0.6804066896438599,
0.035986319184303284,
-0.3846595883369446,
0.8736750483512878,
0.2929084300994873,
-1.097233176231384... |
def getsn ( fluor, range _ ff = [ 0. 25, 0. 5 ], method ='logmexp') : ff, pxx = scipy. signal. welch ( fluor ) ind1 = ff > range _ ff [ 0 ] ind2 = ff < range _ ff [ 1 ] ind = np. logical _ and ( ind1, ind2 ) pxx _ ind = pxx [ ind ] sn = {'mean': lambda pxx _ ind : np. sqrt ( np. mean ( old _ div ( pxx _ ind, 2 ) ) ),'m... | [
-0.30767351388931274,
-0.1439332216978073,
0.48124775290489197,
0.07172767072916031,
-0.3878016471862793,
-1.2685317993164062,
-0.07190033048391342,
-0.34775546193122864,
-0.2805565297603607,
-0.27111369371414185,
-1.1823006868362427,
0.36374568939208984,
0.943071722984314,
-0.177827358245... |
def post _ processing ( outputs, conf _ thresh = 0. 95, nms _ thresh = 0. 4 ) : if type ( outputs ). _ _ name _ _! ='ndarray': outputs = outputs. numpy ( ) # outputs shape : ( batch _ size, 22743, 10 ) batch _ size = outputs. shape [ 0 ] # box _ array : [ batch, num, 6 ] box _ array = outputs [ :, :, : 6 ] # confs : [ ... | [
0.07336446642875671,
-0.2869226932525635,
0.9303138852119446,
0.7196524739265442,
-0.17807039618492126,
-0.5719025731086731,
0.5381755828857422,
-0.4927252233028412,
-0.1798633635044098,
0.22495846450328827,
0.05950460210442543,
-0.2439408153295517,
0.36283132433891296,
0.33094266057014465... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.