text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def quantize _ float ( f, q ) : return int ( round ( f / q ) * q ) | [
0.5450348854064941,
0.03359726443886757,
0.2155367136001587,
-0.9851672053337097,
0.2818537950515747,
-0.11601721495389938,
-0.16322903335094452,
-0.636159360408783,
-1.0002198219299316,
-0.9739980697631836,
0.43713727593421936,
-0.3050415515899658,
-0.5686550736427307,
0.34959912300109863... |
def feed ( self, x ) : z = weighed _ sum ( weights = self. weights ( ), activations = x, biases = self. biases ( ) ) a = self. _ activation _ function. activation ( z ) return a, z | [
0.09336124360561371,
-0.6484577059745789,
0.4170500338077545,
-0.3572191894054413,
-0.272724986076355,
-0.4838427007198334,
0.6236278414726257,
-0.3094201385974884,
0.5497899055480957,
-0.23002061247825623,
-1.069164752960205,
1.5824143886566162,
0.1362026333808899,
-0.1384766846895218,
... |
def main ( filetype, file, center ) : validate _ mapping = {'maf': validatemaf,'clinical': validateclinical,'vcf': validatevcf,'cnv': validatecnv,'fusions': validatefusion,'seg': validateseg,'bed': validatebed } syn = synapse _ login ( ) # check : fail if filename is incorrect try : validatefilename ( filetype, file, c... | [
-0.08951103687286377,
-0.7507815957069397,
0.9389365315437317,
0.942949116230011,
0.3449404835700989,
0.10293283313512802,
0.5000808835029602,
1.0481699705123901,
-0.3700747489929199,
-0.18944750726222992,
0.5617336630821228,
0.13667358458042145,
0.2818581163883209,
0.6687838435173035,
1... |
def add _ onegraph _ to _ stgraph ( onegraph, stgraph ) : if not stgraph : return onegraph stnodes, stadj = stgraph onenodes, oneadj = onegraph adj = adj _ fusion ( stadj, oneadj ) nodes = np. concatenate ( ( stnodes, onenodes ), axis = 0 ) return nodes, adj | [
-0.7154241800308228,
0.2045108526945114,
0.5252517461776733,
0.15979556739330292,
-0.13696981966495514,
0.0875992476940155,
0.40389132499694824,
0.15401741862297058,
1.269607663154602,
0.9913523197174072,
0.21003767848014832,
0.6584232449531555,
-0.286386638879776,
0.4001011252403259,
0.... |
def _ _ init _ _ ( self, name, key _ path ='', registry = none ) : super ( virtualwinregistrykey, self ). _ _ init _ _ ( key _ path = key _ path ) self. _ name = name self. _ registry = registry self. _ registry _ key = none self. _ subkeys = collections. ordereddict ( ) | [
0.2210463583469391,
0.33175545930862427,
0.3849262595176697,
0.89378422498703,
-0.1833861619234085,
-0.0976104736328125,
0.8063188195228577,
1.1564806699752808,
-0.21251913905143738,
0.8924210071563721,
-1.2521142959594727,
0.7575007081031799,
-0.2454271763563156,
0.5194058418273926,
-0.... |
def destroy ( self, context, security _ group ) : neutron = neutronapi. get _ client ( context ) try : neutron. delete _ security _ group ( security _ group ['id'] ) except n _ exc. neutronclientexception as e : exc _ info = sys. exc _ info ( ) if e. status _ code = = 404 : self. raise _ not _ found ( six. text _ type ... | [
-0.15841689705848694,
0.39987123012542725,
0.5240751504898071,
-0.14857468008995056,
0.012125479988753796,
-0.26190364360809326,
-0.29433298110961914,
-0.15688930451869965,
-0.06832863390445709,
0.5383116602897644,
0.4328010380268097,
0.23513633012771606,
-1.2333309650421143,
0.02207899652... |
def rvs ( self, num _ samples = 1 ) : pass | [
-0.06529872864484787,
0.04062569886445999,
0.22226625680923462,
0.24613860249519348,
0.8510148525238037,
-1.0408079624176025,
-0.1516530066728592,
-0.10583002120256424,
0.27081939578056335,
0.08932340145111084,
0.16065989434719086,
0.4864078462123871,
-0.7081437706947327,
-0.07287537306547... |
async def get _ response ( self, issues _ json, fields _ json = none ) : return await self. collect ( get _ request _ json _ side _ effect = [ fields _ json or [ ], issues _ json ] ) | [
-0.23355633020401,
-0.21788638830184937,
0.33116236329078674,
-0.6879187822341919,
0.7172955870628357,
-0.38815033435821533,
-1.1448522806167603,
-0.8884592056274414,
0.25988835096359253,
-0.2774713635444641,
0.07616344839334488,
-0.21589066088199615,
0.030007127672433853,
-0.7922816872596... |
def showname ( self ) : print ('votre nom ', self. name ) print ('le nom de ma classe ', self. _ _ class _ _. _ _ name _ _ ) | [
0.21500800549983978,
-0.9951843619346619,
0.8001251220703125,
-0.7625219225883484,
-0.7503791451454163,
0.3843914568424225,
-0.23543141782283783,
-0.04727214202284813,
-0.24593886733055115,
0.4934747517108917,
-0.3343615233898163,
1.445947289466858,
0.7671462297439575,
0.5194916725158691,
... |
def _ _ get _ time _ from _ time _ picker ( self, time _ picker _ instance ) : self. c _ logger. info ( " staring to get time from time picker. " ) self. c _ logger. debug ( " the getting time picker instance : { } ". format ( time _ picker _ instance ) ) time _ from _ time _ picker = time _ picker _ instance. get _ ti... | [
-0.7263138890266418,
0.035784315317869186,
0.42673370242118835,
-0.08181437104940414,
-0.07858297228813171,
0.263884037733078,
0.37575972080230713,
-0.2873343825340271,
-0.11574807018041611,
0.9918615221977234,
-0.12019841372966766,
-0.9971072673797607,
-0.5549644827842712,
0.7751734852790... |
def test _ cli _ treesync _ push _ invalid _ targets ( monkeypatch ) - > none : script = treesync ( ) testargs = ['treesync ','push ','invalid - target - name'] with monkeypatch. context ( ) as context : validate _ script _ run _ exception _ with _ args ( script, context, testargs, exit _ code = 1 ) | [
0.17066818475723267,
0.6259846687316895,
0.6745118498802185,
0.7173281311988831,
0.8332724571228027,
-0.13478803634643555,
-0.5030970573425293,
0.09802938997745514,
-0.2653374969959259,
0.6608967185020447,
-0.044364262372255325,
1.2567955255508423,
0.18396693468093872,
0.2043473869562149,
... |
def registerplayer ( name ) : # i use bleach to make sure no bad values are inserted into db. clean _ name = bleach. clean ( name ) query = " insert into players ( name ) values ( % s ) ; " db = psycopg2. connect ( " dbname = tournament " ) c = db. cursor ( ) c. execute ( query, ( clean _ name, ) ) db. commit ( ) db. c... | [
-0.9572988748550415,
0.5278456807136536,
0.8469399213790894,
-0.6630827188491821,
0.3321760296821594,
-0.17864131927490234,
-0.12235308438539505,
0.05024287849664688,
-0.4347155690193176,
0.8464334011077881,
-1.2022497653961182,
-1.0393730401992798,
-0.8607684373855591,
-0.1997879445552826... |
def tri ( x ) : y = _ np. zeros ( _ np. shape ( x ) ) y [ _ np. abs ( x ) < 1. 0 ] = 1. 0 - _ np. abs ( x [ _ np. abs ( x ) < 1. 0 ] ) return y | [
0.16208815574645996,
0.037020012736320496,
0.5672031044960022,
0.31961682438850403,
0.34129491448402405,
0.5410876870155334,
-0.09648392349481583,
-0.3816007673740387,
-0.05886304751038551,
-0.011114665307104588,
-0.42690831422805786,
0.6804049015045166,
-0.21570703387260437,
-0.5657036900... |
def _ _ init _ _ ( self ) : self. _ nof _ requests = 0 self. _ variables = dict ( ) self. _ lock = lock ( ) self. _ error = none self. _ config = dict ( ) self. _ config ['parse _ post _ data'] = false self. _ logger = none | [
-0.10354329645633698,
0.13887406885623932,
0.62260901927948,
0.03465939313173294,
0.00777416443452239,
-0.12418373674154282,
-0.0806785449385643,
-0.2479182928800583,
-0.6369948387145996,
-0.8572615385055542,
-0.7726917862892151,
-0.532429575920105,
-0.7070105671882629,
0.7187873721122742,... |
def replace _ commons _ interwiki ( wikitext ) : wikicode = mwparserfromhell. parse ( wikitext ) templates = wikicode. filter _ templates ( ) ws = [ x for x in templates if x. name. matches ('w') ] for w in ws : lang ='en'if w. has _ param ('3') : lang = w. get ('3'). value art ='' if w. has _ param ('1') : art = w. ge... | [
0.1574789434671402,
-0.8815611004829407,
0.7142054438591003,
-0.5493574142456055,
-1.4891301393508911,
-0.20167770981788635,
0.37747859954833984,
1.128762125968933,
-0.0789962112903595,
0.9690540432929993,
-0.3243333399295807,
-0.06828565895557404,
-0.8917604088783264,
0.3795871138572693,
... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, vaissuerequest ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _ | [
-0.9288526773452759,
-0.3823515772819519,
0.6928636431694031,
0.08702019602060318,
-0.597892701625824,
0.09620510041713715,
-0.607236921787262,
-0.6104159355163574,
1.257068395614624,
-0.35623446106910706,
-0.09074713289737701,
-0.33211082220077515,
-0.17140261828899384,
0.0165440961718559... |
def local _ diagonal _ stiffness _ matrix ( eps, mu, basis, s, h ) : # calculate < < \ chi _ s ^ 2 > > chi = eval _ chi _ s _ squared ( basis, s ) a = np. array ( [ [ 1, - 1 ], [ - 1, 1 ] ] ) return ( ( 1 + eps * mu ) * chi / h ) * a | [
-0.08115405589342117,
-0.3569120168685913,
0.3722674250602722,
-0.7019015550613403,
-0.12714578211307526,
-0.8849936127662659,
0.38272958993911743,
0.8356239199638367,
0.25186240673065186,
-0.2668197453022003,
-0.3712714612483978,
0.7426998019218445,
0.215194970369339,
-0.06332216411828995... |
def num _ fast ( ages ) : counter = counter ( ages ) res = 0 for a in counter : for b in counter : if request ( a, b ) : res + = counter [ a ] * ( counter [ b ] - ( a = = b ) ) return res | [
-0.509802520275116,
0.6558122634887695,
0.33946216106414795,
0.5625844597816467,
-0.07037580013275146,
-0.584245502948761,
1.2554160356521606,
-0.18942825496196747,
0.5430901646614075,
-0.6779100894927979,
-0.7767703533172607,
-0.5883198380470276,
0.4503062665462494,
0.5822924375534058,
... |
def _ _ getitem _ _ ( self, idx ) : res = [ ] # idx belongs to the positive sampled person pos = self. data [ idx ] res. append ( pos [ np. random. choice ( pos. shape [ 0 ], self. k, replace = false ) ] ) # exclude idx here neg _ indices = np. random. choice ( [ i for i in range ( len ( self. data ) ) if i! = idx ], s... | [
-1.1878327131271362,
-0.47253236174583435,
0.7545912861824036,
0.08239350467920303,
-0.8296617269515991,
0.45868560671806335,
-0.7260785698890686,
0.27560853958129883,
0.7153236865997314,
0.3097110390663147,
0.07387640327215195,
-0.36551469564437866,
-0.11798731237649918,
0.010094953700900... |
def bgra2rgba ( im : np. ndarray ) - > np. ndarray : return cv. cvtcolor ( im, cv. color _ bgra2rgba ) | [
0.5728918313980103,
-0.5677052140235901,
0.7844502925872803,
0.7187575697898865,
1.4446125030517578,
0.08261016011238098,
0.6925936937332153,
-0.2793795168399811,
-0.23821085691452026,
1.7433195114135742,
0.7192090749740601,
0.9293238520622253,
-0.18014292418956757,
0.6675008535385132,
0... |
def outputtitle ( truelist ) : output = [ ] for unit in truelist : # unit is of format ( 2,'nnp wild'), where 2 is the len ( stack ) core = unit [ 1 ] tokpos = core. split ( ) # tokpos is of format'nnp wild'if len ( tokpos ) = = 2 : tok = tokpos [ 1 ] output. append ( tok ) final = " ". join ( output ) return final | [
-1.1140824556350708,
0.03551348298788071,
0.6660646200180054,
0.33962827920913696,
-0.8535093665122986,
-0.5925103425979614,
-0.6105259656906128,
-0.15288662910461426,
-0.5580385327339172,
1.1775940656661987,
-0.3534090518951416,
-0.16971655189990997,
-1.0912647247314453,
0.403097361326217... |
def unfollow ( self, user = none ) : if user is not none : self. followers. remove ( user ) self. save ( ) | [
0.33122387528419495,
1.005244255065918,
0.42608895897865295,
1.0149656534194946,
-0.6668045520782471,
0.3433089554309845,
1.0368678569793701,
0.9622609615325928,
-0.0803450420498848,
-0.2481071501970291,
-0.7133240699768066,
0.06262136995792389,
-0.8894779086112976,
0.5458840727806091,
-... |
def is _ measurement _ in _ template ( self, template _ name : str, path : str ) : request = tsquerytemplatereq ( self. _ _ session _ id, template _ name, templatequerytype. is _ measurement. value, path, ) response = self. _ _ client. queryschematemplate ( request ) logger. debug ( " judge the path is measurement or n... | [
-0.548572838306427,
-0.2853959798812866,
0.4080680012702942,
-0.19027817249298096,
-1.055364966392517,
0.07115725427865982,
-0.4391298294067383,
0.09851806610822678,
0.019153565168380737,
0.686451256275177,
-0.22562310099601746,
-0.25620320439338684,
-1.274046778678894,
0.3142898380756378,... |
def vox _ size _ content ( x _ size : int, y _ size : int, z _ size : int ) - > bytes : assert ( x _ size > 0 and y _ size > 0 and z _ size > 0 and x _ size < = 126 and y _ size < = 126 and z _ size < = 126 ) return struct. pack ('< iii ', x _ size, y _ size, z _ size ) | [
0.7911490797996521,
-0.3875237703323364,
0.841433584690094,
-0.47866982221603394,
-0.5446364879608154,
0.47057244181632996,
-0.7492796778678894,
-0.8773388266563416,
-0.14696328341960907,
0.1796964555978775,
-0.21680422127246857,
-0.16189241409301758,
-0.7567452192306519,
-1.63299751281738... |
def create _ empty _ doc ( ) : d = collections. defaultdict ( lambda :'', {'doc _ id': 0 } ) return normalize _ data ( d, d ) | [
0.2026216983795166,
0.46501240134239197,
0.27279412746429443,
-0.23059886693954468,
-0.16630928218364716,
0.31884628534317017,
-0.6140677332878113,
0.0814269483089447,
-0.21598359942436218,
-0.29545721411705017,
-0.1574467122554779,
0.006163841113448143,
-0.3644157648086548,
-0.08898200094... |
def moves ( self ) - > list [ move ] : return [ move. from _ sgf ( move, player = pl, board _ size = self. board _ size ) for pl in move. players for move in self. get _ list _ property ( pl, [ ] ) ] | [
-0.1740742325782776,
-0.3245520293712616,
0.3047012388706207,
1.1956136226654053,
1.1017107963562012,
0.4784139096736908,
-0.6387796998023987,
0.43990474939346313,
0.6511356234550476,
-0.07912284880876541,
-0.5821535587310791,
0.487890362739563,
-0.3150382339954376,
0.08573203533887863,
... |
def setpreampgain ( index ) : return none | [
-0.9649798274040222,
0.22443245351314545,
0.3359878957271576,
0.032852333039045334,
-0.10014789551496506,
0.48245343565940857,
1.4753004312515259,
-0.4053076207637787,
0.6503966450691223,
-0.9150252938270569,
-1.1762531995773315,
-0.06018209457397461,
-0.5358006954193115,
0.007188270334154... |
def test _ synergy _ score _ no _ connection ( my _ team ) : score = synergy _ score ( my _ team ) assert set ( score. keys ( ) ) = = set ( range ( 5 ) ) for v in score. values ( ) : assert 0. < = v < = 1. | [
-0.4139987528324127,
-0.005449716933071613,
0.20617927610874176,
0.35133519768714905,
0.958016037940979,
0.1554277539253235,
-0.1337669938802719,
-0.5701417922973633,
-0.7348839640617371,
-0.2964673340320587,
-0.6541028618812561,
-0.9071413278579712,
-0.8503503799438477,
0.2028670459985733... |
def log _ gaussian ( x, mu, var ) : log _ pdf = - 0. 5 * torch. log ( 2 * torch. tensor ( [ math. pi ], device = x. device ) ) - torch. log ( var + 1e - 8 ) / 2 - ( x - mu ) * * 2 / ( 2 * var + 1e - 8 ) # print ('size log _ pdf : ', log _ pdf. shape ) return log _ pdf | [
0.22414851188659668,
-0.7781471014022827,
0.29415133595466614,
-0.5936152338981628,
-0.8246923685073853,
0.23014751076698303,
-0.9094856381416321,
0.5069329738616943,
-0.1778659075498581,
0.155328631401062,
-0.12627705931663513,
1.2063060998916626,
-0.07879006862640381,
-1.298093557357788,... |
def plot _ data ( df, title = " stock prices " ) : ax = df. plot ( title = title, fontsize = 12 ) ax. set _ xlabel ( " date " ) ax. set _ ylabel ( " price " ) plt. show ( ) | [
-0.3010319471359253,
1.281699299812317,
0.3313307762145996,
0.09465291351079941,
-0.3345155119895935,
0.6054133772850037,
-0.2589809000492096,
-0.1083240807056427,
-0.3690412640571594,
-0.2757815420627594,
0.611364483833313,
1.437515377998352,
0.8182616233825684,
-0.5038384199142456,
0.8... |
def convert _ df ( tree ) : df = pd. dataframe ( list ( iter _ docs ( tree ) ) ) # add aspect variable aspect = df. category. str. split ('#'). str [ 0 ] df [ " aspect " ] = aspect # replace wrongly written entries for polarity df. polarity = df. polarity. replace ('positve ','positive') # comes with train _ df df. pol... | [
-0.4555060565471649,
-0.8115735054016113,
0.5862255096435547,
-0.990193247795105,
0.40315788984298706,
-0.018811220303177834,
-0.45446449518203735,
0.5625426173210144,
0.282552570104599,
-0.1411515772342682,
0.7381988763809204,
0.23017551004886627,
0.42020484805107117,
0.04104354977607727,... |
def process _ folder ( dir _ path, data = [ ] ) : files = [ os. path. join ( dir _ path, f ) for f in os. listdir ( dir _ path ) ] for file in files : if file. split ( '.') [ - 1 ] = ='abc': # only open abc files with open ( file,'r') as f : lines = f. readlines ( ) # skip header info i = 0 init = lines [ i ] [ 0 : 2 ]... | [
-0.3941507935523987,
-0.5488448143005371,
0.8585817217826843,
-0.3634546995162964,
0.04623328894376755,
-0.0015136648435145617,
0.24535617232322693,
0.16402535140514374,
-0.20402570068836212,
0.371969610452652,
-0.09527520835399628,
0.11441607028245926,
-0.34021201729774475,
-0.26854634284... |
def video _ feed ( ) : return response ( gen ( ), mimetype ='multipart / x - mixed - replace ; boundary = img') # return render _ template ('video _ feed. html') | [
0.5757115483283997,
0.07763110101222992,
0.5920171737670898,
0.745720624923706,
-0.24069443345069885,
-1.0775309801101685,
-0.47491592168807983,
0.3700397312641144,
0.5620760917663574,
-0.5362170338630676,
-0.18707071244716644,
0.5412116050720215,
-0.34167489409446716,
0.3131336271762848,
... |
def setup ( properties ) : try : if not os. path. exists ( consts. env ) : call ( [ " virtualenv ", consts. env ] ) except : print " error creating virtual environment. make sure viurtualenv is installed. " sys. exit ( 1 ) try : call ( [ " cp ", os. path. join ( consts. resources,'req. pip'), ". / " ] ) call ( [ os. pa... | [
-0.02112245000898838,
0.3699142336845398,
0.5372010469436646,
0.6647015810012817,
1.0062339305877686,
0.5876765847206116,
0.2486829161643982,
-0.30286091566085815,
-0.15863461792469025,
0.6477227807044983,
0.42354637384414673,
0.05318640545010567,
-0.22779619693756104,
0.33525943756103516,... |
def bound ( state : state ) - > float : skill = state. fixed _ skill rem _ budget = budget - state. fixed _ cost for person in sorted ( state. variable, reverse = true ) : if person. cost < rem _ budget : skill + = person. skill rem _ budget - = person. cost else : skill + = ( rem _ budget / person. cost ) * person. sk... | [
0.2903285324573517,
-0.5702934265136719,
0.6257244348526001,
0.7611216306686401,
-0.10916508734226227,
0.2847669720649719,
0.6167072057723999,
-0.43584132194519043,
0.4142901599407196,
-0.17662183940410614,
-0.32338130474090576,
0.4386746883392334,
-0.030984003096818924,
0.2848310768604278... |
def slct _ common _ qry ( table _ name ) : conn = none try : params = config ( ) conn = psycopg2. connect ( * * params ) cur = conn. cursor ( ) cur. execute ( sql. sql ( " select a. time, a. velocity, a. route _ name, a. tripid from { } as a, route _ inter as b where st _ contains ( a. geom, b. geom ) order by a. ctime... | [
1.2122560739517212,
0.27248597145080566,
0.9109410643577576,
-0.131429523229599,
-0.22265483438968658,
-0.46094271540641785,
-0.31330692768096924,
-0.5034474730491638,
-0.8199741244316101,
0.4233974814414978,
0.6691280603408813,
-0.6924993991851807,
-0.5970079898834229,
0.6308578848838806,... |
def _ wait _ for _ exportstate ( self, volume _ name, state = false ) : status = false vip = self. vmem _ vip. basic # todo ( rdl ) : this implementation only waits on the master, but # may need to additionally wait for the standby to finish the # config sync # bn = " / vshare / config / export / container / % s / lun ... | [
0.09051701426506042,
0.26373499631881714,
0.6462599635124207,
0.06616976857185364,
-0.597630500793457,
-0.4538101851940155,
-1.106069564819336,
0.0124368192628026,
0.3747316300868988,
0.24571047723293304,
-0.12911993265151978,
-0.2921488285064697,
-0.5377326607704163,
-0.31726133823394775,... |
def test _ user _ consent _ inputs ( self ) : data = {'client _ id': self. client. client _ id,'response _ type':'code ','redirect _ uri': self. client. default _ redirect _ uri,'scope':'openid email ','state': self. state, # pkce parameters.'code _ challenge': fake _ code _ challenge,'code _ challenge _ method':'s256 ... | [
0.015197998844087124,
0.7363157272338867,
0.5286062359809875,
0.062328606843948364,
0.5519181489944458,
0.764447033405304,
0.19341394305229187,
-0.32289037108421326,
-0.20513799786567688,
-0.018958181142807007,
-0.31645068526268005,
0.15924499928951263,
0.24826772511005402,
-0.160853847861... |
def currently _ selected ( self ) : return [ self. browser. text ( el ) for el in self. browser. elements ( self. currently _ selected ) ] | [
-1.2843282222747803,
-1.9335263967514038,
0.4136156439781189,
0.8789053559303284,
0.1662205159664154,
-0.16965129971504211,
-0.030619334429502487,
-0.2818434536457062,
0.8020609617233276,
0.9799972772598267,
-0.057254523038864136,
0.4822247326374054,
0.07747481018304825,
0.4149942994117737... |
def _ _ resolution _ update _ ui ( self ) : if self. _ _ ui _ update : for output in self. selected _ outputs : output. ui. resolution = self. _ _ resolution _ combo _ box. current _ index ( ) | [
-0.6074291467666626,
-1.244492769241333,
0.4462071657180786,
0.14881165325641632,
0.2799678146839142,
-0.9195704460144043,
0.8055177330970764,
-0.2892649471759796,
-0.03231089934706688,
-0.2139427363872528,
-0.34773579239845276,
-1.0564879179000854,
-0.7205682396888733,
0.07393757253885269... |
def llh ( self, y, lmd, opt _ for _ minimise = false ) : if opt _ for _ minimise : return y * np. log ( lmd ) - lmd else : fct = np. array ( [ math. factorial ( v ) for v in y ] ) return y * np. log ( lmd ) - lmd - np. log ( fct ) | [
0.8177891373634338,
0.033533725887537,
0.4798771142959595,
-0.08144526928663254,
-0.6385777592658997,
0.6510443687438965,
-1.4580403566360474,
-0.21638569235801697,
0.40303802490234375,
-0.09175820648670197,
0.516843855381012,
1.244774341583252,
0.02142994850873947,
0.4055143892765045,
0... |
def get _ filtername ( self, filterfile ) : inst, bandin = filterfile. split ( " / " ) [ - 2 : ] band = [ k for k, v in self. _ filtercongig [ inst ]. items ( ) if v = = bandin ] if len ( band ) = = 0 : raise valueerror ( " cannot parse filt, unknown band : % s " % bandin ) return inst + ". % s " % band [ 0 ] | [
-0.2941904664039612,
-0.496482789516449,
0.6372944116592407,
-0.1706758737564087,
-0.9824792146682739,
0.4651581048965454,
0.5385258197784424,
-0.2882235646247864,
-0.8840501308441162,
0.622778058052063,
0.5133296847343445,
0.6165848970413208,
0.19816038012504578,
-0.027146825566887856,
... |
def load _ pickles ( self, folder ='pickle') : pkls = [ ] if os. path. exists ( folder + '. zip') : print'unpacking file % s. zip...'% ( os. getcwd ( ) +'/'+ folder, ), z = zipfile. zipfile ( folder + '. zip') files = sorted ( z. namelist ( ) ) # skip folder? print'found % d files'% len ( files ) if folder = ='pickle'a... | [
-0.6659688949584961,
0.05658045783638954,
0.712772786617279,
-0.5235769152641296,
0.05843959003686905,
0.08892117440700531,
0.6544446349143982,
0.5994954109191895,
0.2668686509132385,
0.27867528796195984,
0.12623274326324463,
-1.3020288944244385,
-0.10831806063652039,
0.5258086919784546,
... |
def _ _ init _ _ ( self, blocked, block _ sight = none ) : self. blocked = blocked if block _ sight is none : block _ sight = blocked self. block _ sight = block _ sight self. explored = false | [
0.05423840880393982,
0.6437012553215027,
0.5055895447731018,
0.6218187808990479,
-0.379023939371109,
-0.4225466251373291,
-0.130253404378891,
-0.250011682510376,
0.8744064569473267,
0.11801178008317947,
-0.24654367566108704,
0.2740401327610016,
-0.12811629474163055,
0.7558689713478088,
0... |
def readurlconfig ( filename ) : # here's some code that we give you # to read in the file and eliminate # blank lines and comments urlfile = open ( filename, " r " ) all = [ line. rstrip ( ) for line in urlfile. readlines ( ) ] lines = [ ] for line in all : if len ( line ) = = 0 or line [ 0 ] = ='#': continue lines. a... | [
-0.03881880268454552,
-0.23099474608898163,
0.6782618761062622,
0.1010548323392868,
0.01363943237811327,
0.5667429566383362,
-0.295484721660614,
1.7609610557556152,
-0.8098518252372742,
0.4403862953186035,
-0.5683720707893372,
0.41708850860595703,
-0.11613577604293823,
0.6639854311943054,
... |
def do _ cbdep ( self, action ) : package = action [ " cbdep " ] version = action [ " version " ] install _ dir = self. templatize ( action. get ( " install _ dir ", self. installdir ) ) installer = self. copy ( ) logger. info ( f " calling nested cbdep install - d { install _ dir } { package } { version } " ) installe... | [
0.08518756181001663,
-0.8094090223312378,
0.45698752999305725,
-0.029000157490372658,
0.7640237212181091,
0.617305338382721,
0.32196518778800964,
0.429435670375824,
-0.021404044702649117,
0.4372231066226959,
-0.2284756898880005,
0.3676496148109436,
-0.1526523232460022,
0.30094239115715027,... |
def _ _ eq _ _ ( self, other ) : if isinstance ( other, c2profile ) : return self. _ name = = other. name or ( self. _ id is not none and other. id is not none and self. _ id = = other. id ) return false | [
-0.05656040832400322,
-1.1026827096939087,
0.6233311891555786,
-0.09213890880346298,
0.33531734347343445,
0.4420464038848877,
-0.3205369710922241,
-0.76850426197052,
0.42047446966171265,
-0.0955096185207367,
-1.5367625951766968,
0.01479494757950306,
-0.4456874430179596,
-0.4341453313827514... |
def _ remove _ vios ( db _ vios, host, context, db _ session ) : msg = ( ras. vif _ get _ msg ('info ','reconcile _ vios _ del _ start') % {'host': db _ vios. get _ host _ name ( ),'vios': db _ vios. lpar _ id } ) ras. trace ( log, _ _ name _ _, ras. trace _ debug, msg ) db _ vios. delete ( context, db _ session ) host... | [
0.6461852788925171,
-0.4994235932826996,
0.4450990855693817,
-0.1791575700044632,
0.5178378224372864,
-0.3357348144054413,
-0.03830734267830849,
0.9694288969039917,
0.3601490259170532,
0.8559366464614868,
-0.28218695521354675,
0.019857149571180344,
-0.3357517123222351,
0.22604438662528992,... |
def spectral _ index ( spectr, pi, p, h _ tilde ) : h _ tilde = np. array ( h _ tilde ). reshape ( - 1 ) p = np. array ( p ). reshape ( - 1 ) j _ = pi. shape [ 0 ] # step 1 : compute the sorted ex - ante performance scenarios # compute the ex - ante performance scenarios y = pi @ h _ tilde # sort ex - ante performance ... | [
-0.2770472764968872,
0.09830722212791443,
0.5765273571014404,
-0.25797608494758606,
-0.5105721354484558,
0.744693398475647,
0.16216935217380524,
0.7785956263542175,
-0.7736138701438904,
1.1354776620864868,
0.36074987053871155,
0.5070015788078308,
-0.4645199477672577,
0.6532669067382812,
... |
def cidr ( i, n ) : return ~ ( mask > > n ) & mask & addr2bin ( i ) | [
-0.35794639587402344,
-0.34303992986679077,
0.402565598487854,
0.26019608974456787,
-0.24941794574260712,
0.2745612859725952,
0.05685470625758171,
-0.8074329495429993,
-0.05900612473487854,
0.16786505281925201,
0.08199356496334076,
-0.48748114705085754,
-1.1510891914367676,
-1.091998338699... |
def preset _ modes ( self ) - > list [ str ] : return self. _ preset _ modes | [
-1.119212031364441,
0.16159015893936157,
0.16101212799549103,
0.6971586346626282,
0.8996480107307434,
1.04477059841156,
0.2679014205932617,
-1.0048519372940063,
0.5532254576683044,
0.5107950568199158,
-1.384932518005371,
0.35755717754364014,
0.17037706077098846,
0.06043002009391785,
-0.1... |
def load _ user _ info ( self, service, token ) : if service = ='google': response = self. _ request _ json ( service,'access _ token ', token, method = " post " ) else : response = self. _ request _ json ( service,'access _ token ', token ) if not response : return self. bad _ request ('invalid _ token') token = respo... | [
-0.6923969388008118,
0.003800832200795412,
0.8016448616981506,
-0.2605191767215729,
-0.43937617540359497,
-0.021519826725125313,
-1.1294854879379272,
-1.5506221055984497,
-0.1942044347524643,
-0.06978356838226318,
-0.613598644733429,
0.14478348195552826,
0.18036769330501556,
0.392645120620... |
def test _ 2 _ delete _ balise _ html ( ) : result = delete _ balise _ html ( " bonjour. [ wikipedia ] " ) assert result = = " bonjour. " | [
0.4489343464374542,
0.05684787780046463,
0.3329865634441376,
0.3641476035118103,
-0.6870348453521729,
0.1790289580821991,
0.0266601350158453,
0.6011263728141785,
0.15067704021930695,
0.006368666421622038,
-0.4728950560092926,
0.5502174496650696,
-1.0863105058670044,
-0.2815386652946472,
... |
def sorted _ add ( self, mylist ) : self. add ( mylist ) self. main _ dict [ mylist [ 0 ] ]. sort ( ) | [
-0.42309701442718506,
-0.4024168848991394,
0.3879205286502838,
0.25877806544303894,
-0.560399055480957,
0.6509331464767456,
-0.5865737199783325,
0.18940280377864838,
0.24243684113025665,
-0.2880133390426636,
-1.0617718696594238,
0.043561458587646484,
-0.9617433547973633,
1.2995412349700928... |
def _ makeasynccall ( method, request, response, get _ result _ hook = none, rpc = none ) : if rpc is none : rpc = create _ rpc ( ) assert rpc. service = ='taskqueue ', repr ( rpc. service ) rpc. make _ call ( method, request, response, get _ result _ hook, none ) return rpc | [
-0.2984972298145294,
0.18744048476219177,
0.6075238585472107,
-0.642090916633606,
0.12748374044895172,
-0.08117862790822983,
-0.1675853282213211,
-1.292787790298462,
0.7999187111854553,
0.5140171647071838,
1.1441471576690674,
-0.09086252003908157,
-0.04835085570812225,
-0.28329819440841675... |
def _ get _ python2 _ only _ packages ( self ) : python _ packages = set ( self. _ get _ all _ python _ packages ( ) ) python3 _ packages = set ( self. _ get _ all _ python3 _ packages ( ) ) python2 _ only _ packages = python _ packages. difference ( python3 _ packages ) return list ( python2 _ only _ packages ) | [
-0.5993091464042664,
-0.9072852730751038,
0.7033551931381226,
0.691592812538147,
-0.17847616970539093,
0.7434973120689392,
-0.606019914150238,
-0.1992064267396927,
1.1602119207382202,
0.28371042013168335,
-0.8261660933494568,
0.7233527302742004,
-0.23328042030334473,
0.11262105405330658,
... |
def delete ( org _ id, membership _ id ) : # pylint : disable = unused - argument try : membership = membershipservice. find _ membership _ by _ id ( membership _ id ) if membership : response, status = membership. deactivate _ membership ( ). as _ dict ( ), \ http _ status. http _ 200 _ ok else : response, status = {'... | [
-0.36912983655929565,
-0.8673023581504822,
0.7466439604759216,
0.6937265396118164,
0.686010479927063,
-0.6695866584777832,
-0.09597768634557724,
0.6882531046867371,
0.8599179983139038,
0.7001950144767761,
0.13711585104465485,
0.3622712790966034,
-1.0323150157928467,
-0.25150471925735474,
... |
def train _ layer ( text, model, starting _ layer = 1, ending _ layer = 2 ) : # layer indicates number of times to transform text # add the vocab def phrase _ once ( doc, model ) : return model [ doc ] def phrase _ many ( doc, model, ntimes ) : for i in range ( ntimes ) : doc = phrase _ once ( doc, model ) return doc d... | [
-0.02301602065563202,
0.16325031220912933,
0.806344211101532,
-0.29326191544532776,
-0.5342388153076172,
-0.32676222920417786,
0.0697614923119545,
0.007870661094784737,
-0.5826848149299622,
0.9015679955482483,
-1.4166879653930664,
-0.35320377349853516,
-1.347961664199829,
0.913941919803619... |
def find _ parent ( self, family _ tree ) : if self. _ user _ input is none : return none elif self in family _ tree. _ subtrees : return family _ tree, family _ tree. _ puzzle else : for subtree in family _ tree. _ subtrees : if self. find _ parent ( subtree ) is not none : return self. find _ parent ( subtree ) retur... | [
-0.09862513840198517,
-0.2541786730289459,
0.706016480922699,
0.6667360067367554,
-0.9525759220123291,
-0.09531466662883759,
0.27404728531837463,
-1.040431261062622,
-0.05089418590068817,
-0.13411745429039001,
0.5721504092216492,
-0.4741217792034149,
-0.49983546137809753,
1.368565320968628... |
def html _ escape ( self, text ) : escape _ table = { " & " : " & amp ; ",'"': " & quot ; ", "'" : " & apos ; ", " > " : " & gt ; ", " < " : " & lt ; ", } return " ". join ( escape _ table. get ( char, char ) for char in text ) | [
-0.2829281985759735,
0.715071439743042,
0.49066436290740967,
-0.06342141330242157,
-0.7807710766792297,
0.32411107420921326,
-0.9980499744415283,
-0.2531683146953583,
-0.5227473378181458,
0.9064149260520935,
-0.6073617935180664,
-0.0868614912033081,
0.15363986790180206,
0.26192039251327515... |
def smart _ truncate ( content, length = 100, suffix = '...') : if len ( content ) < = length : return content else : return content [ : length ]. rsplit ('', 1 ) [ 0 ] + suffix | [
1.2797170877456665,
0.5114851593971252,
0.453928679227829,
-0.672993004322052,
-0.1913866102695465,
-0.9347070455551147,
-1.080815315246582,
0.23801830410957336,
0.561756432056427,
0.15359623730182648,
-0.28492099046707153,
0.9696343541145325,
-0.1324295550584793,
-0.8460987210273743,
0.... |
def get _ actions ( self, market ='market ', uuid = none, * * kwargs ) : if uuid : return self. request ('actions ', uuid = uuid, * * kwargs ) return self. request ( f'markets / { market } / actions ', * * kwargs ) | [
-1.4034905433654785,
0.3513621985912323,
0.24523091316223145,
0.7515522837638855,
0.73192298412323,
-0.8737878799438477,
-0.3219603896141052,
-0.037064328789711,
0.1411343663930893,
0.36663928627967834,
0.11347802728414536,
0.994766354560852,
-0.898502767086029,
-0.43904736638069153,
-1.... |
def git _ mass _ set _ sha1 ( self, edits ) : def g ( edits ) : for edit in edits : ( p, object ) = edit if not isinstance ( p, indexfs ) : raise runtimeerror ('path must be an indexfs path.') if ( p. repo! = self. repo or p. index! = self. index ) : raise runtimeerror ('path is from a different indexfs.') yield dict (... | [
-1.1228508949279785,
-0.25263720750808716,
0.448025643825531,
0.13794760406017303,
0.25599342584609985,
0.014602907001972198,
0.4626426100730896,
-0.11013974994421005,
0.28261852264404297,
0.31468528509140015,
-0.15845690667629242,
0.4083564877510071,
0.19012592732906342,
-0.09495010972023... |
def quiz3 ( ) : return render _ template ('quiz3. html') | [
0.2422821819782257,
0.14088648557662964,
0.20778992772102356,
0.4639638364315033,
-0.6706597805023193,
0.9932475686073303,
0.0037095893640071154,
0.5711289644241333,
0.2936323881149292,
0.027540365234017372,
0.014470716007053852,
-0.5595638751983643,
-0.8903906345367432,
-1.093488216400146... |
def create _ txt _ record ( args ) : domain _ name, token = args [ 0 ], args [ 2 ] fqdn _ tuple = extract ( domain _ name ) base _ domain _ name = ". ". join ( [ fqdn _ tuple. domain, fqdn _ tuple. suffix ] ) if fqdn _ tuple. subdomain is'' : txtrecord = u'_ acme - challenge'else : txtrecord = u'_ acme - challenge. { 0... | [
0.6295520067214966,
0.7572780847549438,
0.7527003288269043,
-1.131469964981079,
0.4232478439807892,
0.36874014139175415,
-0.2456909567117691,
-0.26006582379341125,
-0.6504074931144714,
0.5203357934951782,
-0.43992942571640015,
0.6729115843772888,
-0.13226264715194702,
-0.37240833044052124,... |
def add ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.22976702451705933,
-0.32354864478111267,
0.367561012506485,
0.9648721814155579,
0.9398144483566284,
0.4759882986545563,
0.18785184621810913,
-0.23467831313610077,
0.31277942657470703,
-0.6259744763374329,
-0.7861489057540894,
-0.007549813948571682,
-0.6201560497283936,
0.631558477878570... |
def test _ magstrfacts _ dy _ sxtal ( self ) : answers = [ 2. 084, 2. 039, 2. 039, 1. 995, 1. 995, 0. 829, 1. 01, 1. 01, 1. 01, 0. 829, 0. 829, 0. 829, 1. 01, 1. 027, 1. 168, 1. 168, 1. 168, 1. 168, 1. 027, 1. 027, 1. 027, 1. 871, 1. 871, 1. 259, 1. 144, 1. 259, 1. 144, 1. 144, 1. 259, 1. 144, 1. 259, 1. 231, 1. 231, 1... | [
0.31590545177459717,
-0.4280779957771301,
1.385428547859192,
-0.4822708070278168,
-0.33883002400398254,
-0.35216036438941956,
0.9085211157798767,
-0.3707394003868103,
0.27185186743736267,
-0.29527559876441956,
-0.6316348910331726,
0.009941618889570236,
0.06054074689745903,
-0.1138321980834... |
def turn _ on _ light ( self, channel, on ) : msg = self. device. send ( " set - ext - light - state ", channel, on ) return not msg. iserror ( ) | [
0.07720043510198593,
0.11794614791870117,
0.6363590955734253,
-0.41184917092323303,
-0.5443257689476013,
0.3792351186275482,
-1.7603455781936646,
0.38421177864074707,
0.4320524036884308,
0.04815393313765526,
-1.5306397676467896,
0.4537809193134308,
-1.1187677383422852,
0.08557357639074326,... |
def train ( epoch, model, optimizer, train _ loader, grapher, prefix ='train') : return execute _ graph ( epoch, model, train _ loader, grapher, optimizer, prefix ='train') | [
0.23046724498271942,
0.5858505368232727,
0.3307305574417114,
0.45493149757385254,
-0.3633745312690735,
-0.8469248414039612,
-1.0341650247573853,
0.3515796363353729,
-1.2759764194488525,
0.45545098185539246,
-0.5696605443954468,
1.0996689796447754,
0.380808562040329,
-1.1955205202102661,
... |
def seqlength2mask ( self, seq _ lengths ) : args = self. args ret = np. zeros ( [ args. batch _ size, args. seq _ length ] ) for i in range ( args. batch _ size ) : ret [ i ] [ : seq _ lengths [ i ] ] = np. ones ( [ seq _ lengths [ i ] ] ) return ret | [
-0.6376419067382812,
-0.9423933625221252,
0.3859589099884033,
0.12571363151073456,
1.0261716842651367,
-0.2596108019351959,
0.1458308845758438,
0.5983355641365051,
0.6460109353065491,
0.9438128471374512,
-0.6216802000999451,
0.32726457715034485,
0.19789117574691772,
0.5320794582366943,
0... |
def network _ watcher _ name ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " network _ watcher _ name " ) | [
0.3235136568546295,
-0.4412526786327362,
0.3545287847518921,
-0.08100425451993942,
0.21312490105628967,
1.6834172010421753,
0.062371887266635895,
-0.47186562418937683,
-0.28835031390190125,
-0.22084249556064606,
-0.3646669089794159,
0.07143975049257278,
0.4078025817871094,
0.03075695782899... |
def load _ inventory _ from _ cache ( self ) : cache = open ( self. cache _ path _ inventory,'r') json _ inventory = cache. read ( ) self. inventory = json. loads ( json _ inventory ) | [
-1.3826611042022705,
-1.5734995603561401,
0.5213021636009216,
-0.31556612253189087,
-0.5588067173957825,
0.3407370448112488,
-0.4232880771160126,
0.09093454480171204,
-0.4898907542228699,
1.426269769668579,
-0.6806951761245728,
0.2094826102256775,
0.03628205507993698,
-0.8904297351837158,
... |
def convert _ timeframes ( timeframe _ from : union [ str, none ], timeframe _ to : union [ str, none ], times : list [ list [ datetime ] ] ) - > tuple [ int ] : if timeframe _ from is none or timeframe _ from = ='_': last _ date = times [ - 1 ] [ 0 ]. date ( ) first _ date = times [ 0 ] [ 1 ]. date ( ) timeframe _ fro... | [
-1.80790114402771,
0.7712996006011963,
0.7656981945037842,
-0.798680305480957,
0.3390739858150482,
-1.0929720401763916,
-0.5101863741874695,
-0.03572435677051544,
-0.8324273228645325,
0.6822947859764099,
-0.44701915979385376,
-0.5474223494529724,
-0.08996551483869553,
0.40408873558044434,
... |
def main ( vcf _ file ='hq _ 2 _ cns _ final _ recal. vcf ', ref _ file ='cns _ final. fasta ', bam _ file ='hq _ 2 _ cns _ final _ recal. bam ', organism ='hcv') : if vcf _ file is none : for fname in ['merged _ muts _ drm _ annotated. csv ','cns _ max _ freq. fasta'] : fhandle = open ( fname,'a') fhandle. close ( ) r... | [
0.6996880769729614,
-0.01506489235907793,
0.8942670822143555,
1.2696799039840698,
0.731291651725769,
-0.5981807708740234,
-0.03117408975958824,
0.3521496653556824,
-0.08262771368026733,
0.4193255305290222,
0.19398267567157745,
-0.04346330836415291,
0.13866272568702698,
-0.1857278048992157,... |
def setup ( self ) : self. util = utility ( ) self. common = common ( ) self. misc = misc ( ) self. dev = device ( ) self. app = application ( ) self. object = objects ( ) self. navigate = navigate ( ) self. config = configuration ( ) self. util. set _ up ( ) if config. selected _ language = = " " : config. selected _ ... | [
0.1493668556213379,
-0.9038436412811279,
0.8691248297691345,
0.3113119602203369,
0.4335739314556122,
0.2836802899837494,
1.156095266342163,
-0.4690856337547302,
-0.2515856921672821,
0.5028908848762512,
0.028762057423591614,
-0.5419831871986389,
-0.1587325632572174,
0.14491324126720428,
0... |
def run _ style _ transfer ( cnn, normalization _ mean, normalization _ std, content _ img, style _ img, input _ img, num _ steps = 300, style _ weight = 1000000, content _ weight = 1, temporal _ weight = 5000 ) : print ('building the style transfer model..') time. sleep ( 2 ) init _ time = time. time ( ) model, style ... | [
0.047767121344804764,
-0.4116843342781067,
0.6994351744651794,
0.4140463173389435,
-0.42724183201789856,
-0.48393675684928894,
0.4111034870147705,
-0.5331208109855652,
-0.5202712416648865,
0.8098542094230652,
0.2555845379829407,
0.9250985383987427,
-0.7041342258453369,
0.4459759294986725,
... |
def test _ increment _ self _ with _ multiplication _ by _ matrix ( self ) : matrix = matrix ( [ [ 1, 2, 3 ], [ 2, 2, 2 ] ] ) self. matrix * = matrix assert ( self. matrix = = [ [ 5, 6, 7 ], [ 10, 14, 18 ] ] ) self. assertraises ( differentdimensionerror, \ self. matrix. matrixmultiplication, matrix ( [ [ 1, 2 ], [ 2, ... | [
-0.3253329396247864,
0.3253779113292694,
0.6803871393203735,
0.7816222906112671,
-0.6337142586708069,
-0.0843687579035759,
0.7485162615776062,
-0.19621306657791138,
0.5839569568634033,
-0.2941370904445648,
-0.5240932106971741,
-0.5118052363395691,
-0.22321614623069763,
0.5967018008232117,
... |
def curl _ of _ curl _ inv ( self, fz, gtype ='tri ', btype = 2 ) : if gtype = ='vor': # ensure passed array is of the correct length : assert ( len ( fz ) = = self. n _ tverts ), " length of array passed to grad is not tri _ verts length " if btype = = 1 : # calculate the divergence of the grad, which is the laplacian... | [
0.12385088205337524,
-0.357757568359375,
0.8368123173713684,
-0.3335776925086975,
-0.9308246374130249,
0.20444799959659576,
0.7631559371948242,
0.34190213680267334,
-0.29858580231666565,
0.0984596535563469,
-0.2748444080352783,
0.41587331891059875,
-0.7680291533470154,
0.3395226299762726,
... |
def multiprocess _ executor ( init _ context ) : return _ core _ multiprocess _ executor _ creation ( init _ context. executor _ config ) | [
0.801690936088562,
-0.5673443078994751,
0.4600149989128113,
0.23649750649929047,
-0.32487910985946655,
-0.22164024412631989,
-0.7673119306564331,
0.5234401822090149,
0.21208110451698303,
-0.6401479840278625,
-0.09434444457292557,
-0.16749604046344757,
-0.3129076063632965,
0.194345399737358... |
def _ run _ controller ( self, topo ) : # avoid the ryu manager is not properly closed and address conflicts # subprocess. run ( shlex. split ( " sudo killall ryu " ) ) # subprocess. run ( shlex. split ( " sudo killall ryu - manager " ) ) if not hasattr ( topo, " ctl _ prog " ) : logger. info ( " can not find bound con... | [
0.4410792589187622,
-0.8410212993621826,
0.6634938716888428,
-0.22616414725780487,
0.4914200007915497,
0.788838267326355,
1.1471766233444214,
0.2247069627046585,
-0.06826502084732056,
0.01501673087477684,
-0.015161997638642788,
0.48127493262290955,
-0.060097433626651764,
-0.419169992208480... |
def zero _ pad ( x, pad ) : x _ pad = np. pad ( x, ( ( 0, 0 ), ( pad, pad ), ( pad, pad ), ( 0, 0 ) ), mode ='constant ', constant _ values = ( 0 ) ) return x _ pad | [
0.13169637322425842,
-0.14325225353240967,
0.344743937253952,
-0.17806518077850342,
0.5194738507270813,
0.6321725249290466,
-0.8776436448097229,
-0.20246335864067078,
0.39464956521987915,
0.18790385127067566,
0.163034126162529,
0.5642110109329224,
0.25096356868743896,
-0.14198128879070282,... |
def _ _ setattr _ _ ( self, key, value ) : if key in ('width ','height') : raise valueerror ( f'board { key } cannot be changed after creation.') | [
-0.29352855682373047,
0.7819688320159912,
0.4470781087875366,
0.1643376350402832,
-1.0849084854125977,
0.2192327231168747,
0.4063522517681122,
-0.5002248287200928,
-0.7816516757011414,
0.7163169384002686,
-0.03320368006825447,
-0.19196970760822296,
0.20058445632457733,
1.3396588563919067,
... |
def main ( url ) : fw = feedwrapper ( url ) l = fw. get _ links ( ) for title, link in fw. get _ links ( ) : print ( f " { title } | { link } " ) | [
-0.8493786454200745,
-0.32887330651283264,
0.548337996006012,
-0.14432993531227112,
0.2933376729488373,
-0.2981563210487366,
-0.7730596661567688,
0.571529746055603,
-0.6447547078132629,
-1.4385650157928467,
0.3015632927417755,
1.017136812210083,
0.3516763746738434,
0.7581590414047241,
-0... |
def test _ ignore _ activity _ boost ( self, * _ ) : responses. add ( responses. get, " http : / / fish. com / nothing " ) activity = activitypub. announce ( id = " http : / / www. faraway. com / boost / 12 ", actor = self. remote _ user. remote _ id, object = " http : / / fish. com / nothing ", published = " 2021 - 03... | [
0.33793604373931885,
0.13379137217998505,
0.5118767619132996,
0.09370655566453934,
0.7754062414169312,
0.9668734669685364,
0.46452274918556213,
-0.17750343680381775,
0.4609616696834564,
-0.7377031445503235,
-0.6944082379341125,
0.10854482650756836,
-0.7108197808265686,
0.1612786054611206,
... |
def get _ enum _ constant ( self, enum _ name : str ) - > int : for enum in self. _ enums : if enum. name = = enum _ name : return enum. get _ value _ int ( ) raise enumnotfound ( " the enum for { enum _ name } has not been found. " ) | [
-0.44109806418418884,
-0.37730735540390015,
0.7248163223266602,
-0.552442729473114,
0.2195882499217987,
-0.21705670654773712,
0.43414416909217834,
0.14808505773544312,
0.07788355648517609,
1.1991615295410156,
0.11752188205718994,
0.4621833860874176,
-0.5907220840454102,
0.3350680470466614,... |
def gethardwareversion ( ) : andor _ solis. gethardwareversion. restype = ctypes. c _ uint pcb = ctypes. c _ uint ( ) decode = ctypes. c _ uint ( ) dummy1 = ctypes. c _ uint ( ) dummy2 = ctypes. c _ uint ( ) camerafirmwareversion = ctypes. c _ uint ( ) camerafirmwarebuild = ctypes. c _ uint ( ) result = andor _ solis. ... | [
-0.5521268248558044,
-0.26504912972450256,
0.572482705116272,
0.5642483234405518,
-0.6216694712638855,
-0.471535325050354,
0.6473931670188904,
-0.5384336709976196,
-0.009531950578093529,
0.12350720912218094,
-1.3494527339935303,
0.7200528383255005,
-0.9652571082115173,
0.5846948623657227,
... |
def target _ template _ member ( self, target _ template _ member ) : self. _ target _ template _ member = target _ template _ member | [
-1.208067536354065,
-0.7695643305778503,
-0.19265776872634888,
-0.4190928637981415,
-0.9027796387672424,
0.7922869920730591,
0.34061747789382935,
0.08881773799657822,
-0.5522670149803162,
-0.11598842591047287,
-1.0195127725601196,
0.2916783094406128,
0.46087589859962463,
-0.691372871398925... |
async def test _ datadisk _ migrate ( coresys : coresys, all _ dbus _ services : dict [ str, dbusservicemock | dict [ str, dbusservicemock ] ], new _ disk : str, os _ available, ) : datadisk _ service : datadiskservice = all _ dbus _ services [ " agent _ datadisk " ] datadisk _ service. changedevice. calls. clear ( ) l... | [
-1.0409961938858032,
1.3400508165359497,
0.5847115516662598,
0.18957024812698364,
0.6591545343399048,
0.23433366417884827,
-0.521941065788269,
-0.5841594338417053,
1.089998722076416,
-0.6758020520210266,
0.0309859998524189,
0.7647255063056946,
0.006891178898513317,
0.5388451814651489,
0.... |
def save _ conv2d _ kernels ( model ) : cmap = plt. get _ cmap ( amfconfig. get ('colormap') ) base = os. path. basename ( amfconfig. get ('model') ) zipf ='{ } _ kernels. zip '. format ( os. path. splitext ( base ) [ 0 ] ) zipf = os. path. join ( amfconfig. get ('outdir'), zipf ) with zf. zipfile ( zipf,'w') as z : it... | [
-0.5087730884552002,
-0.3273976445198059,
0.7167718410491943,
-0.09657656401395798,
-0.8479031920433044,
-0.27016815543174744,
0.3190711736679077,
-0.2240583300590515,
0.09691715240478516,
0.5165121555328369,
-0.8061087727546692,
0.3884581923484802,
0.6690104603767395,
0.5652486681938171,
... |
def _ validate _ translation _ table _ relations ( relations ) : if relations is none : return none if isinstance ( relations, dict ) : return _ validate _ translation _ table _ relations _ dict ( relations ) raise typeerror ( f'` translation _ table ` \'s keys ( also known as relations ) can be ` none `, ` dict `, got... | [
-0.35293272137641907,
0.6467545032501221,
0.5765498280525208,
-0.6114572882652283,
-0.09543149918317795,
-0.4011308252811432,
0.08086098730564117,
-0.6966915726661682,
-0.41319704055786133,
-0.18770696222782135,
0.4017921984195709,
-0.6614729762077332,
-0.14968106150627136,
0.2378711104393... |
def _ _ init _ _ ( self, parent ) : raise " _ _ init _ _ ( ) method has not been defined! " self. name = " basetabbedview " self. parent = parent self. main = parent. main self. tabs = [ ] self. current _ tab = 0 self. tabs. append ( ( u " some ", sometab ( self ) ) ) self. tabs. append ( ( u " other ", othertab ( self... | [
0.37215888500213623,
-0.8012110590934753,
0.6296521425247192,
0.760128378868103,
-0.5387758016586304,
0.46128302812576294,
0.16309396922588348,
-0.19090242683887482,
-0.30323952436447144,
-1.1644210815429688,
-0.3749065101146698,
-0.48603829741477966,
0.26723790168762207,
1.067621111869812... |
def _ _ init _ _ ( self, credential _ providers = none ) : self. _ credential _ providers = credential _ providers | [
0.33402588963508606,
-0.018449075520038605,
0.12988565862178802,
0.5791078805923462,
0.4186864197254181,
0.4640621542930603,
-0.3476865887641907,
1.4837064743041992,
0.6534619331359863,
-0.162065789103508,
-0.9266403913497925,
0.7178338766098022,
-0.49694904685020447,
0.4552389085292816,
... |
def stop _ exists ( _, file _, code ) : return es. stop _ exists ( file _, code ) | [
-1.2889378070831299,
-0.5182012915611267,
0.4254625737667084,
-0.5162674784660339,
1.1554032564163208,
0.14082884788513184,
-0.7592286467552185,
0.5237342119216919,
-1.8751046657562256,
0.8622286915779114,
0.18443843722343445,
-0.3322807252407074,
0.8153572678565979,
-0.8886601328849792,
... |
def log _ metrics ( self, metrics, grad _ norm _ dic, step = none ) : # add gpu memory if self. trainer. on _ gpu and self. trainer. log _ gpu _ memory : mem _ map = memory. get _ memory _ profile ( self. trainer. log _ gpu _ memory ) metrics. update ( mem _ map ) # add norms metrics. update ( grad _ norm _ dic ) # tur... | [
-0.1548783928155899,
0.70746248960495,
0.6769114136695862,
0.48904234170913696,
-0.07805322855710983,
0.36389297246932983,
0.9309602379798889,
0.5590105056762695,
-0.2706567943096161,
-0.6015356183052063,
-0.2930121421813965,
-0.011979550123214722,
0.3560214340686798,
0.5835128426551819,
... |
def _ _ eq _ _ ( self, other ) : if isinstance ( other, payloadtype ) : return self. _ ptype = = other. ptype or ( self. _ id is not none and other. id is not none and self. _ id = = other. id ) return false | [
-0.4591493606567383,
-0.6586889624595642,
0.776078462600708,
-0.4385664761066437,
0.26300203800201416,
0.24565455317497253,
-0.5992351770401001,
-1.5745766162872314,
0.46898090839385986,
0.35538285970687866,
-0.7568193674087524,
0.13883015513420105,
-0.8971339464187622,
0.33735713362693787... |
def save _ scenario ( scenario _ name ) : # create folder here = os. path. abspath ( _ _ file _ _ ) here _ dir = os. path. dirname ( here ) scenario _ path = os. path. join ( here _ dir, " results ", scenario _ name ) os. makedirs ( scenario _ path, exist _ ok = true ) # compute some additional info argmin, _ = torch. ... | [
0.04015226662158966,
-0.3371017873287201,
0.6937607526779175,
-0.24548763036727905,
0.5824154019355774,
-0.25887492299079895,
1.0687882900238037,
-0.33037081360816956,
-0.7824983596801758,
0.2082892656326294,
-1.0960233211517334,
-0.24844622611999512,
0.629091203212738,
0.3516447842121124,... |
def config _ callback ( self, config, level ) : self. _ pid. p = config ['p'] self. _ pid. i = config ['i'] self. _ pid. d = config ['d'] self. _ pid. c = config ['c'] return config | [
-0.22683614492416382,
-1.0366522073745728,
0.38851398229599,
-0.875989556312561,
-0.28214889764785767,
0.4475674033164978,
0.091006800532341,
0.8102654218673706,
-0.4440341591835022,
0.9839860200881958,
-0.7988848686218262,
-0.4680143892765045,
-0.4640862047672272,
-0.028623968362808228,
... |
def test _ srv _ transform _ and _ inverse ( self ) : curves _ ab = self. l2 _ metric _ s2. geodesic ( self. curve _ a, self. curve _ b ) curves _ ab = curves _ ab ( self. times ) curves = curves _ ab srv _ curves = self. srv _ metric _ r3. srv _ transform ( curves ) starting _ points = curves [ :, 0, : ] result = self... | [
-0.1703197956085205,
-0.2382775992155075,
0.510739266872406,
-0.32534149289131165,
0.04255148395895958,
0.9275748133659363,
0.09434663504362106,
0.015707029029726982,
-0.06923159956932068,
0.640152633190155,
-0.3861740231513977,
0.7117917537689209,
-0.31943535804748535,
-0.5569074153900146... |
def is _ markup ( location ) : t = get _ type ( location ) # do not care for small files if t. size < 64 : return false if not t. is _ text : return false if location. endswith ( extensions ) : return true with open ( location,'rb') as f : start = as _ unicode ( f. read ( 1024 ) ) if start. startswith ('<') : return tr... | [
-0.678549587726593,
-0.3992856740951538,
0.8009456992149353,
-0.4188458025455475,
-0.362846314907074,
-0.11396340280771255,
0.3790924847126007,
0.22718194127082825,
0.5321706533432007,
0.0828816369175911,
-0.020008457824587822,
-0.2557993531227112,
0.04818297177553177,
0.5965306162834167,
... |
def newton _ step ( p _ newton _ old, dt, n ) : eps = 1 pold = p _ newton _ old pnew = p _ newton _ old omega = 0. 1 step = 0 while eps > 1e - 3 and step < 1000 : pold = pnew gradient = np. gradient ( pold, 1. 0 / ( n ) ) # eliminate zeros and nans new _ divide = np. zeros ( n + 1 ) for i in range ( len ( gradient ) - ... | [
0.198849618434906,
-0.02645907737314701,
0.5884048342704773,
-0.2312646359205246,
-0.6345010995864868,
0.5072186589241028,
-0.11239095032215118,
-0.36069899797439575,
0.0252742450684309,
0.001978466287255287,
-0.31177738308906555,
0.04209040105342865,
0.17680181562900543,
0.794342756271362... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.