text
stringlengths
25
2.19k
embedding
listlengths
768
768
def add _ arr _ as _ tbl ( fid, tname, cols ) : # create column description descr = { } for i, ( cname, cval ) in enumerate ( cols. items ( ) ) : descr [ cname ] = tb. col. from _ dtype ( cval. dtype, pos = i ) table = fid. createtable ('/ ', tname, descr, " ", tb. filters ( 9 ) ) table. append ( [ v for k, v in cols. ...
[ 0.46385329961776733, -0.05884776636958122, 0.5639625787734985, -0.19589996337890625, 0.13799169659614563, 0.7774397134780884, 0.2653767764568329, -0.8068655729293823, -0.669272780418396, 0.49193036556243896, 0.30869579315185547, 0.11933471262454987, 0.942495584487915, 0.10339543223381042, ...
def parse ( file _ name ) : with open ( file _ name, " r " ) as f : match = re. match ( r " ( \ d { 6 } ) - ( \ d { 6 } ) ", f. readline ( ) ) return ( match. group ( 1 ), match. group ( 2 ) )
[ -0.43253934383392334, -0.5634669065475464, 0.8130577802658081, -0.23223572969436646, -0.011094680987298489, 0.30955591797828674, -0.07274944335222244, 1.0547053813934326, -0.588856041431427, -0.022335486486554146, -1.0649497509002686, -1.0952666997909546, -0.02599598653614521, -0.202662676...
def _ get _ params ( ) - > tuple : parser = argparse. argumentparser ( description ='compares two image files by size and pixel value') parser. add _ argument ('first _ file ', type = argparse. filetype ('r'), help ='the first image file to compare') parser. add _ argument ('second _ file ', type = argparse. filetype (...
[ -0.07200514525175095, -0.9655336737632751, 1.1869131326675415, -0.7729955911636353, 0.4625573456287384, -0.01137089915573597, -0.3052101731300354, -0.09493910521268845, -2.02585506439209, 0.9672859907150269, 0.1459743082523346, -0.241773322224617, 0.12586709856987, 1.5388948917388916, 0....
def delete _ qualityprofile ( self, language, name ) : params = {'qualityprofile': name,'language': language } self. sonarqube. _ make _ call ('post ', api _ qualityprofiles _ delete, * * params )
[ 0.38369321823120117, 0.14237937331199646, 0.38513341546058655, 0.1877923309803009, -0.11952736228704453, -0.1278706192970276, -0.4631979763507843, -0.9176483154296875, -0.22186176478862762, 0.5525873303413391, -1.7031188011169434, 0.3961726725101471, -1.3130207061767578, -0.535667836666107...
def notification ( self, reply _ id ) : if not hasattr ( self. boilerplate,'mail') : return mail = self. boilerplate. mail db = self. boilerplate. db request = current. request base _ http ='http : / /'+ str ( request. env. http _ host ) query = ( db [ self. table _ comments ]. author _ id = = db. auth _ user. id ) & \...
[ 0.7316482663154602, 0.2413414716720581, 0.5695112943649292, -0.19274768233299255, 0.40653470158576965, -0.9170879125595093, 0.11937491595745087, -0.33748525381088257, 0.14185070991516113, 0.6017301082611084, -0.6070626378059387, 1.7723126411437988, -0.3073292374610901, 0.23538008332252502,...
def get _ variables ( equation ) : expr = sympy. parse _ expr ( equation ) variables = expr. free _ symbols variables = { str ( v ) for v in variables } # # tighter sanity check : we only accept variables in ascending order # # to avoid silent errors with lambdify later. # if ( variables not in [ {'x'}, {'x ','y'}, {'x...
[ 0.6079816222190857, -0.03573264926671982, 0.3268199861049652, -0.17850179970264435, -0.6855225563049316, -0.897089958190918, -0.6127632856369019, -0.8130313754081726, -0.03895554319024086, 0.33733752369880676, -0.4650423526763916, 0.33685559034347534, -0.07245627045631409, -0.0754152536392...
def insert _ token ( token ) : create _ token = " " " insert into tokens ( expired _ tokens ) \ values ('% s') " " " % ( token, ) cur. execute ( create _ token ) config. conn. commit ( )
[ -0.06718896329402924, 0.7995070219039917, 0.5178672671318054, -0.5123454928398132, 0.4018915295600891, 0.15565313398838043, -0.4972894787788391, 1.2328819036483765, -0.9638136625289917, -0.3103170096874237, -1.3803870677947998, -0.18497063219547272, -0.7077728509902954, -0.3238505125045776...
def _ _ init _ _ ( self, variant _ dir, cons _ vars ) : assert isinstance ( variant _ dir, str ) assert isinstance ( cons _ vars, dict ) self. variant _ dir = variant _ dir self. cons _ vars = cons _ vars pass
[ -0.4048920273780823, -0.9397025108337402, 0.2840435802936554, 0.48837602138519287, -0.5642229318618774, 0.16976924240589142, -0.07477851957082748, 1.1144481897354126, -0.29173845052719116, 0.10183699429035187, 0.14481762051582336, 0.8035058975219727, 0.1523692011833191, -0.3265953063964844...
def _ _ switchfrominput ( self, source, isnew ) : if ( isnew ) : if source is self. btnnickname. get _ child ( ) : newtext = source. get _ text ( ) strv = stringview ( ) strv. appendtext ( newtext ) self. _ myview. nick = strv elif source is self. btnpsm. get _ child ( ) : newtext = source. get _ text ( ) strv = string...
[ 0.15863461792469025, -0.2800678014755249, 0.5544160008430481, -0.6125845909118652, -0.9270849823951721, 0.14623427391052246, -0.2940923869609833, 0.26532307267189026, 0.3183605968952179, -0.24854551255702972, -0.2227526158094406, -0.06161460280418396, -0.33806297183036804, 0.60651737451553...
def test _ thermal _ expansion _ coeff ( ) : f0 = tab. q ['alpha _ exp _ check'] ( x, y ) f1 = tab. q ['alpha _ exp'] ( x, y ) yield np. testing. assert _ allclose, f0, f1, 1e - 5, 1e - 8
[ 0.08827994018793106, -0.23344215750694275, 0.5018869638442993, -0.32152631878852844, -0.23081237077713013, 0.14441105723381042, 0.3936501443386078, 0.09992605447769165, -0.1334213763475418, -0.3128304183483124, 0.14244665205478668, -0.4259154796600342, 0.08885009586811066, 0.17382746934890...
def find _ the _ last _ entry _ time ( fits ) : f = pyfits. open ( fits ) data = f [ 1 ]. data f. close ( ) ctime = numpy. max ( data ['time'] ) return ctime
[ 0.5001744627952576, -1.1866974830627441, 0.4961247146129608, -0.8763608336448669, 0.571073055267334, -0.093155637383461, 0.18330544233322144, 0.047995977103710175, -0.035162247717380524, 0.6235113739967346, 0.4245281517505646, 0.08236771076917648, -0.48474422097206116, 0.928388237953186, ...
def _ mgui _ set _ orientation ( self, value : str ) - > none : new _ layout = qtw. qhboxlayout ( ) if value = = " horizontal " else qtw. qvboxlayout ( ) for btn in self. _ btn _ group. buttons ( ) : new _ layout. addwidget ( btn ) old _ layout = self. _ qwidget. layout ( ) if old _ layout is not none : qtw. qwidget ( ...
[ -0.32792794704437256, 0.4704699218273163, 0.7429757714271545, -0.0644022524356842, -0.43560612201690674, 0.3793761432170868, 0.6170727610588074, -0.5760067701339722, 0.12887521088123322, 0.11623810976743698, -0.4188954830169678, -0.8182188272476196, 0.0019283897709101439, 0.123958952724933...
def coords _ to _ cols ( coords ) : return coords [ : :, 1 ], coords [ : :, 0 ] # return np. hstack ( ( coords [ : :, 1 ], coords [ 0, 1 ] ) ), np. hstack ( ( coords [ : :, 0 ], coords [ 0, 0 ] ) )
[ -1.2349456548690796, -0.5042760372161865, 0.5755757689476013, -0.6533769369125366, 0.586353063583374, -0.5032564401626587, 0.18780089914798737, -0.5062206387519836, -0.1499996930360794, 0.6950079202651978, -0.538393497467041, 0.16498726606369019, 0.5283079743385315, -0.41197413206100464, ...
def test _ get _ artifact _ dep _ setting ( self ) : pass
[ 0.3527895510196686, 0.9295439720153809, 0.27448445558547974, 0.35481876134872437, 0.23543159663677216, 0.01690603792667389, 1.829136610031128, -0.9176063537597656, -0.027510415762662888, -0.26008397340774536, -0.35042017698287964, -0.31059449911117554, 0.060904886573553085, -0.652235507965...
def binary _ search _ ip ( accepted _ addresses, address ) : left = 0 right = len ( accepted _ addresses ) while left < right : mid = ( left + right ) / / 2 current _ address = accepted _ addresses [ mid ] if current _ address [ 0 ] > address : right = mid elif current _ address [ 1 ] < address : left = mid + 1 else : ...
[ -0.9461503028869629, 0.4162191152572632, 0.7803687453269958, -0.11872939765453339, -1.4471633434295654, 0.14744102954864502, -0.11510035395622253, 0.2186000645160675, 0.20202797651290894, 0.4827825129032135, 0.25282153487205505, 0.6795610785484314, -1.3865383863449097, -0.29742431640625, ...
def cancel ( self ) : with self. _ condition : if self. _ state in [ running, finished, cancelled, cancelled _ and _ notified ] : return super ( celeryexecutorfuture, self ). cancel ( ) # not running and not canceled. may be possible to cancel! self. _ ar. ready ( ) # triggers an update check if self. _ ar. state! ='re...
[ 0.8079771399497986, -0.32766738533973694, 0.6260976791381836, 0.7439352869987488, -0.22535893321037292, -0.09318624436855316, 0.41827285289764404, 1.4184383153915405, -0.0949840247631073, -0.2746782898902893, 0.3892882466316223, -0.062279388308525085, 0.307757705450058, 0.5098698735237122,...
def set _ password ( self, value ) : super ( addrowinputset, self ). _ set _ input ('password ', value )
[ -1.0946468114852905, 0.5849004983901978, 0.3977102041244507, 0.30863040685653687, -0.27932414412498474, 0.34417688846588135, 0.5398519039154053, -0.6855175495147705, 0.5579030513763428, 0.14259281754493713, 0.0016110092401504517, -0.39473408460617065, 0.18602001667022705, 0.376849263906478...
def not _ response ( prompt, index ) : while true : try : value = int ( input ( prompt ) ) except indexerror : print " index out of range " continue if value > = index : print " choose within range please " continue else : break return value
[ -0.8001441955566406, -0.5848630666732788, 0.5732844471931458, -0.02874811924993992, 0.06725243479013443, 1.3114103078842163, 0.6075529456138611, -1.96998131275177, 0.5884435772895813, -0.914082944393158, 0.4131806194782257, 0.25407323241233826, -1.4399422407150269, -1.7119802236557007, 1...
def run _ in _ background ( self, *, job _ func, job _ func _ kwargs, callback _ func, callback _ func _ kwargs ) - > none : pass
[ 0.3586435616016388, -0.2686743140220642, 0.7406810522079468, 0.8608917593955994, -0.0745975449681282, -0.032774247229099274, 0.5193575024604797, -0.09266570210456848, -0.21971654891967773, -0.23720289766788483, -0.026769639924168587, 1.3952292203903198, -0.5556545257568359, -0.042957041412...
def object _ iter ( obj, parent = none, parent _ key = none, idx = none, siblings = none ) : obj _ node = node ( value = obj, parent = parent, parent _ key = parent _ key, siblings = siblings, idx = idx ) if isinstance ( obj, list ) : _ siblings = len ( obj ) for i, elem in enumerate ( obj ) : for node in object _ iter...
[ -0.4440520107746124, 0.5897107720375061, 0.9255651831626892, 0.5479015707969666, -1.0886141061782837, 0.5579947233200073, 0.5743486881256104, 0.05000805854797363, 0.4084641933441162, -0.036059021949768066, -0.0209585502743721, -0.004052432253956795, -0.0001700406864983961, -0.1310558766126...
def conv _ udb _ vpython ( vector ) : # conversion from udb coordinates to v python coordinates. # x axis is out of left wing in both coordinate systems. # y is straight up in vpython, and is the negative of the udb's z axis, # which points down. # z in vpython coordinates is the y axis in udb coordinates. # so it turn...
[ -0.5014117956161499, 0.3526850938796997, 0.5056962966918945, 0.27348700165748596, 0.16047249734401703, 0.48169592022895813, 0.02239595726132393, -0.4505491554737091, 0.5687642097473145, 0.4032869040966034, -0.837642252445221, 0.3184341490268707, 0.20117947459220886, -1.4215617179870605, ...
def _ _ str _ _ ( self ) - > str : if self. version : return " { } = { } ". format ( self. name, self. version ) return " { } ". format ( self. name )
[ -0.3488944470882416, -2.220571994781494, 0.6200572848320007, -0.8563334345817566, -0.9947943687438965, 0.726371169090271, -0.8489391207695007, -0.4755292534828186, 0.15653659403324127, 0.8251546025276184, 0.21228626370429993, 0.7887369990348816, -0.014011205174028873, 0.187860906124115, ...
def is _ valid _ float ( self ) : if self. datatype = = " float " : self. value = float. fromhex ( self. value ) return true return false
[ 0.4058578610420227, 0.9379634261131287, 0.7350207567214966, 0.18347451090812683, 0.059058092534542084, 0.3458605706691742, -0.8867304921150208, 0.6531497240066528, -0.16868914663791656, -1.0742605924606323, -0.23563876748085022, -0.48000258207321167, -0.4881942868232727, 0.6781526803970337...
def solve ( self ) : morning = self. get _ morning _ events ( ) afternoon = self. get _ afternoon _ events ( ) # this just ensures we don't always try the same events at the # same period, making sure groups dont have patterny shcedules. random. shuffle ( morning ) random. shuffle ( afternoon ) # find an emoty position...
[ -0.42365992069244385, 0.14207781851291656, 1.1154874563217163, 0.11817524582147598, 0.2822442650794983, -0.05803263187408447, 1.0267659425735474, -0.3846895694732666, 0.23086625337600708, 0.5673032999038696, 0.2421291172504425, -0.40846848487854004, -0.9245857000350952, 0.3347893953323364,...
async def intra _ copy ( self, dest _ provider, source _ path, dest _ path ) : exists = await dest _ provider. exists ( dest _ path ) copy _ source = {'bucket': self. bucket. name,'key': source _ path. full _ path } dest _ provider. bucket. object ( dest _ path. full _ path ). copy _ from ( copysource = copy _ source )...
[ -1.241729736328125, 0.01631699502468109, 0.6173668503761292, -0.025710631161928177, -0.438224732875824, 0.7083233594894409, -0.22684182226657867, 0.3836657702922821, -0.19658710062503815, 1.212279200553894, -0.08182640373706818, 0.46388670802116394, 0.18183331191539764, -1.285131573677063,...
def _ mgui _ set _ row _ count ( self, nrows : int ) - > none : self. _ qwidget. setrowcount ( nrows )
[ 0.1004347875714302, 0.8552336692810059, 0.10495321452617645, -0.40811580419540405, 0.03226713463664055, 0.23222096264362335, 0.11782465875148773, 0.22510391473770142, -0.30480509996414185, 0.06258909404277802, -0.4768778383731842, -0.5850824117660522, 0.32401415705680847, 1.305251240730285...
def _ delete _ argument _ values _ that _ must _ be _ files _ or _ dirs ( to _ unlink ) : for name in to _ unlink : if os. path. isfile ( name ) : os. unlink ( name ) else : os. rmdir ( name )
[ -0.5535057783126831, -0.10207657516002655, 0.5692039728164673, 0.256719172000885, 0.7552987933158875, 0.0814632698893547, 0.6727727651596069, 0.21119293570518494, 0.13159331679344177, -0.0034258796367794275, 0.603331446647644, -0.14819201827049255, 0.47834348678588867, 1.2811237573623657, ...
def tem _ loss _ func ( pred _ start, pred _ end, gt _ start, gt _ end ) : def weighted _ binary _ logistic ( pred _ score, gt _ label, threshold = 0. 5 ) : # flatten to 1d - array. pred _ score, gt _ label = pred _ score. view ( - 1 ), gt _ label. view ( - 1 ) threshold _ mask = ( gt _ label > threshold ). float ( ) n...
[ -0.28862065076828003, -0.5914223790168762, 0.662915825843811, 0.02861761301755905, -0.5029388666152954, -0.3995422124862671, 0.49871888756752014, -0.7114802598953247, -0.7306650876998901, 0.6781737208366394, 0.14823928475379944, 0.007640863303095102, 0.3610997200012207, -0.8876438140869141...
def parse _ start _ stop _ args ( args : list [ str ], flags : list [ str ] ) - > tuple [ str, bool ] : message ='' colored = true if long _ nocolor _ flag in flags : colored = false if args : message = args [ 0 ] return message, colored
[ -0.40067267417907715, 0.2258765697479248, 0.6224300861358643, -0.6579127907752991, 0.1233682781457901, 0.08749036490917206, -0.46864053606987, -0.14839182794094086, -1.1703875064849854, 1.028173565864563, -0.06474212557077408, 0.4906063973903656, -0.48096057772636414, 1.0728703737258911, ...
def logout _ view ( request ) : request. session. invalidate ( ) request. session. flash ( u'logged out successfully.') headers = forget ( request ) return httpfound ( location = request. route _ url ('login'), headers = headers )
[ -0.3557780385017395, -0.22230318188667297, 0.5446418523788452, -0.16311144828796387, -0.45962655544281006, -0.6201702952384949, 0.5014661550521851, -0.17468230426311493, 0.2652798891067505, -0.5187023878097534, 0.7894337773323059, -0.02394608035683632, 0.6406343579292297, -0.83295422792434...
def test _ basic _ dict ( self ) : assert get ( {'nested':'value'}, ('nested ', ) ) = ='value '
[ -0.22160358726978302, 0.2182644009590149, 0.3829815983772278, -0.7019915580749512, 0.23589450120925903, 0.3256804943084717, -0.8732625246047974, -0.020622124895453453, -0.21058349311351776, -1.5038938522338867, -0.28407421708106995, 0.8696651458740234, 0.20812302827835083, -0.3665370941162...
def remove ( file ) : if os. path. exists ( file ) : print ( " removing " + file + "... " ) os. remove ( file )
[ 0.8300293684005737, -0.004770951345562935, 0.46772828698158264, 0.16935910284519196, 0.47960662841796875, 0.9298095703125, 0.46101221442222595, 1.2484880685806274, -0.7251810431480408, 0.08713280409574509, 0.16097348928451538, -0.331565260887146, -0.17771945893764496, 0.9916998744010925, ...
def bytes _ completed ( self, byte _ count ) :
[ 0.07949163019657135, -0.33449849486351013, 0.3996603488922119, -0.25513842701911926, 0.2457924634218216, 0.09528452903032303, 0.4458554685115814, -0.18043255805969238, -0.6695850491523743, -0.22700326144695282, -1.8320903778076172, -0.2755320966243744, -0.25444307923316956, 0.7499998211860...
def sort _ run ( arr, sort _ order, start _ idx, min _ run ) : idx = start _ idx n = arr. size n _ 1 = n - 1 if idx > = n _ 1 : return n # put idx after the already sorted elements while idx < n _ 1 and arr [ idx ] < = arr [ idx + 1 ] : idx + = 1 # if min _ run elements are already sorted... if idx > = start _ idx + mi...
[ 0.20804357528686523, -0.07286784797906876, 0.6125020384788513, 0.14026618003845215, -0.8001844882965088, 0.028041834011673927, 0.5459020733833313, -0.7745208740234375, 0.2606019079685211, 0.2519431412220001, 0.1645835041999817, 1.3265700340270996, -0.6361991763114929, -0.05755035579204559,...
def get _ data _ from _ db ( quarter ) : print ( " getting information from database. " ) database = firebase. firebaseapplication ( firebase _ db ) path = " / quarter / " + quarter + " / " return database. get ( path, none )
[ -0.10564357787370682, 0.21849441528320312, 0.321871817111969, 0.0668446272611618, -0.5728231072425842, -0.03388741984963417, -0.5761628746986389, -0.8330023288726807, 0.5871613621711731, -0.7596803903579712, -0.5837721228599548, -0.6771529912948608, -0.11002647131681442, 0.3519863486289978...
def assert _ element _ exists ( self, driver, locator, by = by. css _ selector ) : try : driver. find _ element ( by, locator ) except nosuchelementexception as e : self. fail ('element with selector { } not found '. format ( locator ) )
[ -0.3891882300376892, -0.11185019463300705, 0.37827321887016296, 0.15759526193141937, 1.102538824081421, 0.24402420222759247, -0.014246436767280102, 0.44568300247192383, 0.42746448516845703, -0.20047853887081146, 0.37175342440605164, 0.033664144575595856, 0.379995197057724, 0.53036105632781...
def buildtssterritories ( infile, outfile ) : statement ='''gunzip < % ( infile ) s | cgat gtf2gtf - - method = filter - - filter - method = proteincoding - - log = % ( outfile ) s. log | cgat gtf2gtf - - method = filter - - filter - method = representative - transcript - - log = % ( outfile ) s. log | cgat gtf2gtf - -...
[ 0.6605585217475891, -0.791041374206543, 0.4323403835296631, -0.1919209361076355, -0.370804101228714, -0.190263032913208, -0.1948145478963852, 0.21661590039730072, -0.7655893564224243, 0.045185670256614685, -0.028945118188858032, 0.5345583558082581, 0.604083776473999, -0.41694074869155884, ...
def _ make _ embed ( attr : str, unk : int, width : int, column : int, table : dict [ int, int ], dropout : float ) - > model [ list [ doc ], floats2d ] : rows = len ( table ) + 1 embedder = chain ( remap ( table, default = unk, column = column ), embed ( no = width, nv = rows, column = 0, dropout = dropout ), ) return...
[ -0.22143572568893433, 0.8322664499282837, 0.42227253317832947, 0.5496623516082764, -1.0178745985031128, 0.4852304756641388, 0.14837034046649933, -0.31336069107055664, -0.17615117132663727, -0.10251317918300629, -0.016833437606692314, -0.826970636844635, 0.6087270379066467, -0.1671992540359...
def recall ( y _ true, y _ prediction ) : true _ positives = k. sum ( k. round ( k. clip ( y _ true * y _ prediction, 0, 1 ) ) ) possible _ positives = k. sum ( k. round ( k. clip ( y _ true, 0, 1 ) ) ) ret _ recall = true _ positives / ( possible _ positives + k. epsilon ( ) ) return ret _ recall
[ 1.2735892534255981, -0.5155801773071289, 0.5734972357749939, 0.1201949343085289, -0.5335081219673157, 0.09864109009504318, -0.9285460114479065, 0.6047191619873047, -0.2733613848686218, 0.8816140294075012, 0.6040309071540833, 0.250191330909729, 0.11415422707796097, -0.17947791516780853, 0...
def _ createform ( parent, master, je ) : for x in je : _ createelement ( parent, master, x )
[ -0.420074999332428, 0.6021981239318848, 0.3661358058452606, -0.21299998462200165, 0.09898952394723892, -0.03814362362027168, -0.24425162374973297, -0.29812389612197876, -0.08771864324808121, -0.666689932346344, -0.7623760104179382, -1.0405172109603882, 0.8055177330970764, 0.511711955070495...
def _ _ init _ _ ( self, * args, * * kwargs ) : self. closed = false
[ -0.6225684285163879, -0.4502556025981903, 0.389242947101593, -0.33915120363235474, -0.2503451704978943, 1.3351881504058838, 0.3834048807621002, 0.6742776036262512, -0.6147283315658569, -0.8547898530960083, -0.09458701312541962, -0.11643656343221664, -1.2935242652893066, 0.48867496848106384...
async def reopen _ room ( self, ctx ) : if not await self. bot. has _ perm ( ctx, ignored _ rooms = true ) : return message = ctx. message owner = self. bot. admin _ override ( ctx ) # allow an admin to define other users. channel = message. channel _ mentions [ 0 ] if message. channel _ mentions else ctx. channel dura...
[ -0.4755808115005493, 0.17593593895435333, 0.8353174328804016, -0.11424927413463593, 0.09149959683418274, -0.37775155901908875, 0.1627710610628128, 0.12633296847343445, 0.004528040066361427, 0.04556052386760712, -0.11764149367809296, 1.2363935708999634, -0.21140815317630768, 0.2319859862327...
def capital ( v ) : if len ( v ) > 2 : return v [ 0 ]. upper ( ) + v [ 1 : ] elif len ( v ) = = 1 : return v. upper ( ) else : return''
[ -0.7546124458312988, -0.44664809107780457, 0.8291655778884888, 0.990400493144989, -0.038098763674497604, 0.13218505680561066, 0.05997380614280701, -0.49548473954200745, 0.7598797082901001, 1.0138161182403564, 0.21681757271289825, 0.5292534828186035, -0.2147602140903473, 0.3890346586704254,...
def write ( self, cmdlist ) : doc = xml. dom. minidom. document ( ) projectnode = doc. createelementns ( " ", " project " ) projectnode. setattributens ( " ", " name ",'' ) projectnode. setattributens ( " ", " default ", " all " ) projectnode. setattributens ( " ", " xmlns : hlm ", " http : / / www. nokia. com / helium...
[ -0.8747543096542358, 0.13138318061828613, 0.5461954474449158, -0.06686506420373917, 0.31046226620674133, 0.14892727136611938, 0.6998823285102844, 0.32407498359680176, 0.014105253852903843, -0.19477719068527222, -0.42454513907432556, -0.8034504055976868, 0.28148213028907776, 0.5979388952255...
def compute _ pi ( terms = 3, make _ number = float ) : a = 1 / make _ number ( 5 ) b = 1 / make _ number ( 239 ) c = arctan ( a, terms = terms ) d = arctan ( b, terms = terms ) return 4 * ( 4 * c - d )
[ 0.04943039268255234, 0.3652938902378082, 0.30191072821617126, -0.20046760141849518, 0.10295554995536804, -0.4686124324798584, -0.33871859312057495, 0.14713487029075623, -0.2004772424697876, 0.09205996245145798, -0.05758366733789444, -0.39505133032798767, -0.27843597531318665, -1.9550081491...
def convert _ video ( self, context, file _ id ) : self. send _ message ( context, " converting _ video " ) file _ path = self. video _ converter. find _ file _ by _ id ( file _ id ) old _ format = file _ path. split ( ". " ) [ - 1 ] if old _ format in self. video _ converter. available _ formats : # todo if context [ ...
[ 0.11413860321044922, -0.7169027924537659, 0.7621960043907166, 1.5052449703216553, 0.631159782409668, -0.717881977558136, -0.21576881408691406, -0.4294278621673584, 0.9982830882072449, 0.3795451819896698, -0.09439809620380402, 1.1940288543701172, -0.20615285634994507, 1.140276551246643, -...
def templates _ directory ( ) : return os. path. join ( os. path. dirname ( os. path. dirname ( _ _ file _ _ ) ),'templates')
[ 0.27797096967697144, -0.05110762268304825, 0.6253138184547424, -0.45870241522789, -0.33115753531455994, 0.19174149632453918, 0.9986391663551331, -0.06715916097164154, 0.20797646045684814, -0.7897264361381531, -0.2126520276069641, 0.4552956223487854, -0.18687056005001068, 0.4824347794055938...
def remove _ all _ zeros _ lean ( folder _ to _ clean _ dir ) : img _ list = next ( os. walk ( folder _ to _ clean _ dir ) ) [ 2 ] parent _ dir = os. path. abspath ( join ( folder _ to _ clean _ dir, os. pardir ) ) # walk through every label map in the " segmentation " folder for img _ file in img _ list : prefix = os....
[ -0.47647830843925476, -1.3865046501159668, 0.9174407124519348, 0.0935235545039177, 0.170093834400177, 0.3777082562446594, 1.1291136741638184, 1.0268845558166504, -0.2239396721124649, 0.5792137384414673, 0.43268489837646484, 0.30746006965637207, -0.5815421342849731, 0.8047915697097778, -0...
def generate _ dropdown _ select _ template ( specifics : dict, placeholders : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders, meta = {'selected - item':'{ { selected - item } }'} ) template ['action - type'] ='select'return template
[ -1.0648036003112793, -0.4659246802330017, 0.014831144362688065, -0.5417363047599792, -0.06894949078559875, 0.14760859310626984, -0.5432214736938477, 0.20153512060642242, 0.674712598323822, 0.997467041015625, -0.5732213854789734, -0.18078231811523438, 0.4352763295173645, -0.7532535195350647...
def create _ packet _ zos ( sshkeyname = none, zt _ netid = " ", zt _ client _ instance ='main ', packet _ client _ instance ='main ', hostname ='hussein. blockchain') : zt _ api _ token = j. clients. zerotier. get ( zt _ client _ instance ). config. data ['token _'] packet _ cl = j. clients. packetnet. get ( packet _ ...
[ -0.11215662211179733, 0.43976470828056335, 0.7841769456863403, -0.6077510118484497, 0.5274996757507324, 0.10849247127771378, -0.7362210154533386, -0.1729438155889511, -0.30919477343559265, -0.11570186167955399, -0.029638422653079033, 1.1413193941116333, 0.09228051453828812, -0.057370886206...
def make _ tree _ by _ url ( nodes, url _ key ='url ', children _ key ='nodes') : for node in nodes : node [ children _ key ] = [ ] nodes _ by _ url = dict ( ( node [ url _ key ], node ) for node in nodes ) root = [ ] for node in nodes : parent _ url = os. path. dirname ( node [ url _ key ] ) if parent _ url in nodes _...
[ -0.4661368131637573, 0.6288179159164429, 0.5888895392417908, -0.5407565236091614, -0.006422863341867924, -0.2659343183040619, 0.49420297145843506, 0.856335461139679, -0.4375132918357849, 0.7789763808250427, -0.5770601034164429, 0.18073250353336334, 0.1957559585571289, 0.6604843139648438, ...
def _ register _ node ( self, test, node _ id, label, description ) : node _ data = deepcopy ( self. test _ data [ " node " ] ) node _ data [ " id " ] = node _ id node _ data [ " label " ] = label node _ data [ " description " ] = description node _ data [ " version " ] = nmosutils. get _ tai _ time ( ) self. post _ re...
[ -0.5431801080703735, 0.6458637118339539, 0.4492877721786499, -1.0031236410140991, 1.1553599834442139, 0.17166391015052795, -1.145247220993042, 0.22359488904476166, -0.06196114420890808, 0.5198822617530823, -0.33244046568870544, 0.8766382932662964, -0.5602888464927673, 0.16285616159439087, ...
def new ( * args, * * kargs ) : obj = itkimageserieswriterirgbus3irgbus2. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ -0.3270837068557739, -0.735460638999939, 0.09578131139278412, -0.03685662895441055, 0.37669530510902405, -0.7095635533332825, -0.2862303853034973, -0.0581890344619751, -0.8761268258094788, 0.19423824548721313, -0.8103195428848267, 0.8153422474861145, -0.36982235312461853, -0.50412863492965...
def score ( cls, deployment, intake _ settings = none, output _ settings = none, csv _ settings = none, timeseries _ settings = none, num _ concurrent = none, chunk _ size = none, passthrough _ columns = none, passthrough _ columns _ set = none, max _ explanations = none, threshold _ high = none, threshold _ low = none...
[ -0.14031833410263062, -0.1336783766746521, 0.8653226494789124, -0.2948085367679596, -0.5325878858566284, 0.0817977637052536, -0.16669556498527527, 0.1428678333759308, -0.6748300194740295, 0.7592995762825012, 0.48373138904571533, 0.4063926637172699, 0.5530408620834351, 0.1815522164106369, ...
def query ( self, dc : datacube, * * search _ terms : dict [ str, any ] ) - > virtualdatasetbag : raise notimplementederror
[ -0.7529107332229614, 0.8617581725120544, 0.25222674012184143, 0.4910822808742523, -0.15535540878772736, 0.07351333647966385, -1.1323367357254028, 0.17203500866889954, -0.30507978796958923, -0.5305213928222656, -0.2739008367061615, 0.5766737461090088, -0.8334945440292358, 0.3061276972293854...
def read ( self ) : data = [ ] for el in self. browser. elements ( self. rects ) : self. browser. move _ to _ element ( el ) data. append ( self. tooltip. read ( ) ) return data
[ -1.4254872798919678, -1.0329501628875732, 0.5202139616012573, 0.20704901218414307, 0.3617425858974457, 0.12123354524374008, -0.13170650601387024, -0.8775774836540222, -0.10206746309995651, 0.6105523705482483, 0.6029223203659058, -0.9902235269546509, 1.117638349533081, -0.09207140654325485,...
def descriptor ( self ) : return self. _ get ( " _ _ descriptor " )
[ 0.5597029328346252, 0.0771787017583847, 0.43351003527641296, -0.37661322951316833, -0.10758599638938904, 0.06405459344387054, 0.33599576354026794, -0.10271704196929932, 0.42643287777900696, -1.3724228143692017, 1.0124729871749878, 0.7451295256614685, 0.372802734375, -0.29999083280563354, ...
def checkusagereportstatus ( self, execution _ id : str, account _ id : str ='' ) - > response : url = f'{ self. base _ url } / execution / { execution _ id } / status '. format ( account _ id = account _ id or self. oauth. account _ id ) return self. session. get ( url, headers = self. oauth. headers )
[ -0.20998628437519073, 0.42132478952407837, 0.8129146099090576, 0.18510133028030396, 0.7896307110786438, -0.7487835884094238, -0.29705438017845154, 0.05085848644375801, 0.37329810857772827, 0.7338548302650452, 0.33193308115005493, 0.9740800261497498, -1.0478118658065796, 0.443386435508728, ...
def moneyamount ( ) : moneyfunc = float ( input ('enter the amount of your money :') ) return moneyfunc
[ 0.19053268432617188, -0.30436211824417114, 0.2880827486515045, 0.34916406869888306, -1.1373733282089233, -0.18842461705207825, 1.2289390563964844, -0.2533305585384369, -0.3042653501033783, -0.5838654637336731, -0.6114104986190796, 0.4701140224933624, -0.07604110240936279, 0.412714034318923...
def waitfor ( command, timeout ) : import subprocess, datetime, time, signal start = datetime. datetime. now ( ) process = subprocess. popen ( command, shell = true, stdout = subprocess. pipe, stderr = subprocess. pipe ) while process. poll ( ) is none : time. sleep ( 0. 2 ) now = datetime. datetime. now ( ) if ( now -...
[ 0.6202472448348999, -0.8257626891136169, 0.6161471605300903, -0.3942323327064514, -0.6377020478248596, 0.25233298540115356, -1.2436647415161133, -0.4378960430622101, -0.3957921266555786, 0.06993015110492706, 0.01099235936999321, 0.5207324028015137, 0.22508764266967773, -0.01275873277336359...
def to _ type ( txt, typ, default = none ) : value = default try : if typ is complex : txt = old _ complex ( eval ( txt ) ) # pragma pylint : disable = eval - used value = typ ( txt ) except exception : # pragma pylint : disable = broad - except pass return value
[ 0.0879502147436142, -0.2844674587249756, 0.22378948330879211, -0.18227142095565796, 0.10035889595746994, 0.2539704442024231, 0.15326640009880066, -0.014606968499720097, 0.07502216100692749, 0.7778134942054749, -0.4907384216785431, 0.09116140007972717, -0.98790442943573, -0.9041692614555359...
def is _ server _ live ( self, headers : dict [ str, t. any ] =... ) - > bool :
[ -0.5660289525985718, -0.9095301032066345, 0.7530882358551025, 0.36790141463279724, 0.16073939204216003, 0.17062053084373474, -1.0317145586013794, -0.020211540162563324, -0.04659014567732811, -0.10767202079296112, -1.0328993797302246, -0.415635883808136, -1.2167274951934814, 0.0188802741467...
def vgg16 ( pretrained = false, * * kwargs ) : model = vgg ( make _ layers ( cfg ['d'] ), * * kwargs ) if pretrained : model. load _ state _ dict ( model _ zoo. load _ url ( model _ urls ['vgg16'] ) ) return model
[ 0.3582768440246582, 1.228807806968689, 0.16656923294067383, 0.8560255169868469, -0.3617025911808014, 0.24941901862621307, 0.1786024123430252, 0.9279047250747681, -0.378569632768631, -0.29579800367355347, -0.7587167024612427, 0.02170979604125023, 0.05927913263440132, 0.04444306343793869, ...
def _ restore ( self, layer _ with _ weights, stack _ id ) : if self. share _ weights _ in _ stack : layer _ name = layer _ with _ weights. name. split ( " / " ) [ - 1 ] try : reused _ weights = self. weights [ stack _ id ] [ layer _ name ] return reused _ weights except keyerror : pass if stack _ id not in self. weigh...
[ 0.3847402036190033, 0.07605177909135818, 0.5740123987197876, -0.0643368810415268, 0.0558973029255867, -1.1787339448928833, 0.10920847207307816, -0.7397579550743103, 0.18344706296920776, 0.2761470377445221, -0.37678754329681396, -0.0006671104347333312, -1.2536540031433105, 0.540971696376800...
def selector ( self ) : data = self. data ( key = - 1 ) [ interpretdata. specific ] return gen _ local _ selector ( data )
[ -0.5949605107307434, -0.9138753414154053, 0.28118035197257996, -1.2135605812072754, 0.386559396982193, -0.3757699131965637, -0.1547357439994812, 0.898561418056488, -0.10310051590204239, -0.8158137798309326, 0.8746170401573181, 0.6341739892959595, -0.3034726679325104, -0.5652710199356079, ...
def test _ suite ( ) : testsuite = unittest. testsuite ( ) testsuite. addtest ( test _ noisepropagation ( " test _ instance " ) ) testsuite. addtest ( test _ noisepropagation ( " test _ repeat " ) ) testsuite. addtest ( test _ noisepropagation ( " test _ compound " ) ) testsuite. addtest ( test _ noisepropagation ( " t...
[ -0.026360340416431427, 0.026308370754122734, 0.6812106370925903, -0.5657438039779663, 0.3766755163669586, 0.35931098461151123, 0.06766536086797714, -0.028641166165471077, 0.9125857353210449, 0.08507093787193298, -0.5216343998908997, 0.26097753643989563, -0.27631497383117676, -0.22356751561...
def parse _ qpx ( flight _ response _ dict ) : # set key - value pair for new flight dictionary flight _ info _ dict = { " destination _ city " : flight _ response _ dict [ " trips " ] [ " data " ] [ " city " ] [ 0 ] [ " name " ], " departure _ city " : flight _ response _ dict [ " trips " ] [ " data " ] [ " city " ] [...
[ 0.008071343414485455, -1.0153281688690186, 1.0408538579940796, -1.4270579814910889, -0.8112637996673584, 0.11460421234369278, -0.5819705724716187, -0.26832491159439087, -0.21410773694515228, -0.4522950351238251, -0.8049942255020142, -0.5453051924705505, 0.7711917757987976, 0.06571255624294...
def generate _ link _ click _ template ( specifics : dict, placeholders : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders ) template ['action - type'] ='click'return template
[ -0.6901164054870605, 0.1215713694691658, 0.12988495826721191, -0.7162224054336548, 0.22749504446983337, -0.11778485774993896, -0.3661451041698456, 0.6808977723121643, 0.19327744841575623, 0.46360260248184204, -0.07181127369403839, 0.3093324601650238, 0.43766459822654724, -0.052648574113845...
def get _ absolute _ url ( self ) : return reverse ('donation - detail ', args = [ str ( self. id ) ] )
[ 0.22132672369480133, -0.5812976956367493, 0.5465234518051147, -0.14375682175159454, 0.6475644707679749, 0.6654871106147766, 0.09348683059215546, 0.44396552443504333, -0.08378208428621292, -0.1913285106420517, 1.1642907857894897, 0.6231794357299805, 1.0609019994735718, 0.40909305214881897, ...
def unpack _ to _ archive ( ext : str, source : io [ bytes ] ) - > io [ bytes ] : try : if ext = = '. tar. gz'or ext = = '. tgz': return source elif ext = = '. tar. bz2': return gzipstream ( unbz2stream ( source ) ) elif ext = = '. bz2': return gzipstream ( unbz2stream ( source ) ) elif ext = = '. gz': return source el...
[ 0.4206744134426117, 0.3097492754459381, 0.59255450963974, -0.011593502014875412, -0.6507247686386108, -0.5027154684066772, 0.08488073199987411, -0.0819116085767746, 0.46868523955345154, -0.17408215999603271, -0.09695449471473694, 0.7875815033912659, 0.6116564869880676, -0.3102937340736389,...
def find _ bigoffs ( minmax, good _ offs ) : # - - print status. tstart = start ( " calculate bigoffs. " ) bigoffs = [ ] # - - for each lightcurve and corresponding set of offs. for src, offs in zip ( minmax. t, good _ offs. t ) : # - - zero placeholder if there isn't a detected off. if sum ( offs ) < 1 : bigoffs. appe...
[ -0.24993395805358887, 0.31017208099365234, 0.5359526872634888, -0.22479985654354095, -0.48493707180023193, 0.09994728863239288, 0.15474103391170502, -0.0016697971150279045, 0.24340280890464783, 0.5240734219551086, -0.408424973487854, 0.8048399686813354, 0.44562190771102905, 0.1204026639461...
def distance _ evaluator ( self, from _ node, to _ node ) : return self. _ distances [ from _ node ] [ to _ node ]
[ -0.607352614402771, -0.6918142437934875, 0.6318375468254089, -1.624456763267517, -0.6979223489761353, 0.412502646446228, -1.01277756690979, 0.7588354349136353, -0.9240442514419556, 0.4143776297569275, 0.5704769492149353, 1.6379960775375366, 0.5548498034477234, -0.883548378944397, -0.0924...
def _ parse _ bounding _ box ( bounding _ box ) : coordinates = json. loads ( bounding _ box ) [ " coordinates " ] x _ coords = [ x for x, y in coordinates [ 0 ] ] y _ coords = [ y for x, y in coordinates [ 0 ] ] return min ( x _ coords ), min ( y _ coords ), max ( x _ coords ), max ( y _ coords )
[ -0.6099408864974976, -0.6042906045913696, 0.9246682524681091, -0.5844739079475403, 0.8345000743865967, -0.7234869003295898, -1.0094436407089233, -0.11712214350700378, 0.28187841176986694, -0.609093427658081, -0.8094409704208374, -0.36154258251190186, 0.6072288751602173, -0.3895715177059173...
def find _ file ( filename : str, dir _ name : str = ". ", use _ media _ root : bool = false, recurse : bool = false ) - > list [ str ] : if not os. path. isdir ( dir _ name ) : raise valueerror ( _ ( " { } is not a directory " ). format ( dir _ name ) ) dir _ full _ path = os. path. abspath ( dir _ name ) if use _ med...
[ 0.395445317029953, -0.3016529083251953, 0.9549485445022583, 1.262975811958313, -0.035895936191082, -0.6471346020698547, 0.4899778366088867, 0.3193765878677368, -0.137055903673172, 0.3099135756492615, 0.8025892376899719, 0.24155011773109436, -0.24264800548553467, 1.5887864828109741, -0.73...
def get _ ordered _ amount ( self, project _ id, rounded = true, dec = 1 ) : amount = self. get _ entry ( project _ id,'min _ m _ reads _ per _ sample _ ordered') self. log. debug ( " got amount { } ". format ( amount ) ) if not amount : return none else : return round ( amount, dec )
[ 0.5804494619369507, -0.3150177001953125, 0.4826490879058838, -0.4738699197769165, -0.5733798742294312, -0.6990771293640137, -0.3374090790748596, -1.2395646572113037, 0.14930100739002228, -0.37882399559020996, 1.3141649961471558, 0.3300933241844177, -0.5654203295707703, 0.41573628783226013,...
def actual _ ip _ plus _ context ( contextfun ) : def _ actual _ ip _ plus _ context ( group, req, * args, * * kwargs ) : # force whatever comes out of contextfun to be bytes. context = force _ str ( contextfun ( req ) ) # md5 hash that. hasher = md5 ( ) hasher. update ( context ) context = hasher. hexdigest ( ) # then...
[ -0.44679126143455505, -0.3297702670097351, 0.5033395290374756, -0.13916651904582977, -1.0716458559036255, -0.019024906679987907, -0.04386722669005394, 0.333088755607605, 0.7234721183776855, 0.2262105494737625, 0.7766187191009521, -0.08191902190446854, 0.9252685904502869, -1.281844019889831...
def predict _ proba ( self, x ) : return self. base _ estimators [ self. leader _ index ]. predict _ proba ( x )
[ -0.3961179256439209, -0.11764136701822281, 0.5006235837936401, 0.9444937109947205, -0.17975836992263794, 0.12931524217128754, -1.1482151746749878, -0.341155469417572, 0.20022636651992798, 0.26766708493232727, -0.09863700717687607, 0.7789134979248047, -0.4479464590549469, -0.545137524604797...
def read ( self ) : try : return datetime. strptime ( self. textbox. value, self. strptime _ format ) except valueerror : return none
[ -0.030778678134083748, -0.7472429871559143, 0.5899602770805359, -0.9368464946746826, -0.6610484719276428, -0.03595276549458504, -1.3395980596542358, -0.45710819959640503, -0.09625662118196487, 0.09982631355524063, 1.0507854223251343, 0.048797473311424255, -0.938175618648529, -0.95964741706...
def getduotriothatexistinvcf ( self, db _ vervet, vcffilename ) : sys. stderr. write ( " getting alignments based on vcf file % s... " % ( vcffilename ) ) vcffile = vcffile ( inputfname = vcffilename ) # each sample id is'% s _ % s _ % s _ % s _ vs _ % s'% ( aln. id, ind _ seq _ id, individual _ sequence. individual. c...
[ -0.7318958640098572, -0.4671081006526947, 0.6767721176147461, 0.2968366742134094, 0.11631013453006744, -0.38215014338493347, 0.3742500841617584, 0.49066904187202454, -0.5193871855735779, 0.45008596777915955, -0.08506568521261215, -0.46953755617141724, -0.7438673973083496, -0.23473571240901...
def do _ migration ( self ) : # assign partners partners = list ( range ( self. n _ isles ) ) random. shuffle ( partners ) # loop over partner pairs for i in range ( self. n _ isles / / 2 ) : partner _ 1 = self. isles [ partners [ i * 2 ] ] partner _ 2 = self. isles [ partners [ i * 2 + 1 ] ] # figure out which individ...
[ -1.5580586194992065, 0.5604706406593323, 0.9688094854354858, -0.20968449115753174, 0.22100123763084412, 0.487405925989151, 0.8214178681373596, -0.05166434869170189, -0.7205499410629272, 0.30516523122787476, -0.1365731805562973, 0.08123435825109482, -0.19119323790073395, 0.29873836040496826...
def id ( self ) : return self. _ id
[ 0.8240097165107727, -1.1357076168060303, 0.13086582720279694, 0.0036135695409029722, 0.9138023853302002, 1.698555827140808, 0.6586772799491882, 0.3193376362323761, 1.3688215017318726, -1.044265627861023, -0.312282532453537, 0.6268338561058044, -0.4173087179660797, -0.44475528597831726, 0...
def settargetvolume ( self, targetvolume ) : # phd2000 expects target volume in ml not ul like the pump11, so convert to ml targetvolume = str ( float ( targetvolume ) / 1000. 0 ) if len ( targetvolume ) > 5 : targetvolume = targetvolume [ 0 : 5 ] logging. warning ( " % s : target volume truncated to % s ml ", self. na...
[ -0.8730699419975281, -0.9036638736724854, 0.5922942757606506, -1.0713679790496826, 0.3827187120914459, -0.1901419311761856, -0.020988211035728455, 0.11614516377449036, 0.4630567133426666, -0.5129489898681641, 0.33938270807266235, 0.4229799211025238, 0.06371007859706879, -0.5395629405975342...
def _ _ init _ _ ( self, amsn _ core, parent ) : self. _ img = nsimage. alloc ( ). initwithsize _ ( ( 1, 1 ) )
[ 0.6267331838607788, 1.2672334909439087, 0.3281848728656769, 0.3776196837425232, -0.561671257019043, -0.07360284775495529, -0.06550241261720657, -0.45800644159317017, 0.7657943367958069, -0.32982054352760315, -0.6558247208595276, 0.4843858778476715, 0.6969414353370667, 1.715451955795288, ...
def _ _ init _ _ \ ( self, starturls, paramsdomain = none, alpha = [ 0. 99 ], beta = [ normalizedlawbeta. log ], parallelrequests = [ 2, 3 ], browsercount = [ 5, 8 ], banditroundduration = 120, # in seconds verbose = true, logger = none, alreadycrawledfunct = none, # for example a mongo funct alreadyfailedfunct = none,...
[ -0.17930816113948822, -0.09799757599830627, 0.9596503973007202, 0.45765239000320435, 0.23702123761177063, -0.31547096371650696, 0.755035400390625, 0.28719496726989746, -0.03870420157909393, 0.10860900580883026, 0.0068048457615077496, -0.30182692408561707, -0.31349754333496094, 0.8649685978...
def import _ module ( name, package = none ) : level = 0 if name. startswith ( '.') : if not package : msg = ( " the'package'argument is required to perform a relative " " import for {! r } " ) raise typeerror ( msg. format ( name ) ) for character in name : if character! = '.': break level + = 1 return _ bootstrap. _ ...
[ -0.4078028202056885, 0.8283450603485107, 0.7680569291114807, 0.38422155380249023, -0.27508872747421265, -0.13106350600719452, 0.6956337690353394, -1.0645071268081665, -0.3522931635379791, 1.089891791343689, -0.21247373521327972, -0.3556073307991028, -0.8194780349731445, -0.4042043089866638...
def test _ delete _ all _ parameters _ 0 ( self ) : pass
[ 0.32164472341537476, -0.5309573411941528, 0.5564932823181152, 1.2228808403015137, 0.9082504510879517, 0.5250498056411743, 0.5864694118499756, 0.9670791625976562, -0.14238640666007996, -0.5009220838546753, -0.18049505352973938, 0.16497695446014404, -0.7300423383712769, 1.7401130199432373, ...
def fields _ to _ dict ( src : any, fields : iterable [ str ] ) - > dict [ str, any ] : assert src assert fields result : dict [ str, any ] = dict ( ) for field in fields : value = getattr ( src, field ) if value is not none : result [ field ] = value return result
[ -0.6327736973762512, 0.16469763219356537, 0.2070489227771759, -1.3822814226150513, -0.34301620721817017, -1.1706209182739258, -0.4080684781074524, 0.2092449963092804, -0.5555319786071777, 0.235550656914711, -1.426068663597107, -0.24081280827522278, 0.32400253415107727, 0.5446294546127319, ...
def tokenize ( self, string ) : return re. split ( r'(?! \ & \ b ) \ w + ', string ) # r stands for raw expression
[ -0.6906020641326904, -0.9724714756011963, 0.6205533146858215, 0.3848218619823456, -0.8647652268409729, -0.3857510983943939, 0.10144376754760742, 1.7030235528945923, 0.0636773481965065, 0.4436020255088806, -0.4777069091796875, 0.446556955575943, -0.8003063797950745, -0.2683504521846771, -...
def _ _ init _ _ ( self, epsilon = 0. 05, gamma = 0. 8, alpha = 0. 2, numtraining = 0, * * args ) : args ['epsilon'] = epsilon args ['gamma'] = gamma args ['alpha'] = alpha args ['numtraining'] = numtraining self. index = 0 # this is always pacman qlearningagent. _ _ init _ _ ( self, * * args )
[ 0.05797746032476425, -0.30910661816596985, 0.5519777536392212, -0.8110272884368896, 0.7186245918273926, -0.09342186897993088, -0.48483309149742126, 0.19164316356182098, -0.09086398035287857, -0.7464262247085571, -0.5968499183654785, -0.8451504707336426, 0.07197223603725433, 0.2005674690008...
def sdc ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " sdc " )
[ 0.9478693008422852, -0.09212236106395721, 0.6193751692771912, 0.3113024830818176, 0.15583139657974243, 0.4567541480064392, 0.4893389642238617, -0.6203966736793518, 0.34346041083335876, -0.5639602541923523, 0.4940575361251831, 0.4253419041633606, 1.1265490055084229, -0.8609349131584167, -...
def invitee ( self, invitee ) : self. _ invitee = invitee
[ 0.2363068014383316, -0.3530886769294739, 0.029071755707263947, 1.1670631170272827, 0.2599380910396576, 1.0324159860610962, 0.6207054853439331, 1.764197826385498, -1.5494850873947144, 0.09083236753940582, -1.0815165042877197, 0.00346171366982162, -0.7366105318069458, 0.24069319665431976, ...
def get _ user _ recent _ media ( self, user _ id ) : return self. client. get ( self. client. users +'/ { } / media / recent '. format ( user _ id ), bucket = _ func _ ( ) )
[ -0.4660487771034241, 0.5361932516098022, 0.5265988707542419, 0.20315073430538177, -0.22170069813728333, -0.7025805115699768, -0.22883692383766174, -0.9577471613883972, -0.030385781079530716, -0.121735118329525, -0.409086138010025, 0.9979614019393921, -0.4410722255706787, 0.4500987529754638...
def get _ payoff ( model, attack _ policy, defense _ policy ) : ave _ discount _ reward = get _ payoff _ mixed ( model, [ attack _ policy ], [ defense _ policy ], [ 1. 0 ], [ 1. 0 ] ) return ave _ discount _ reward
[ 0.3477192521095276, -0.08044028282165527, 0.4249478876590729, -0.012243980541825294, 0.7923729419708252, 0.7057934403419495, -0.196241095662117, -0.006324217189103365, 0.1380031257867813, 0.7026618123054504, 0.46106842160224915, 0.054983753710985184, 0.27570608258247375, 0.0037621317896991...
def all _ possible _ phrases _ for ( words : sequence [ text ] ) - > sequence [ phrase ] : pass
[ -0.5836232304573059, -0.04660293832421303, 0.2786603271961212, 0.4652344286441803, -0.47530364990234375, 0.11325323581695557, -0.9809562563896179, 0.11953815817832947, 0.18134284019470215, 0.8296934962272644, -0.3804763853549957, -0.22798354923725128, -0.5876392126083374, 0.658325433731079...
def test _ fit _ contant ( self ) : # setup distribution = univariate ( ) replace _ mock = magicmock ( ) distribution. _ replace _ constant _ methods = replace _ mock # run distribution. fit ( np. array ( [ 1, 1, 1, 1, 1 ] ) ) # assert assert distribution. fitted assert distribution. constant _ value = = 1 replace _ mo...
[ 0.22561673820018768, 0.37796932458877563, 0.507414698600769, 0.6097957491874695, 0.4849843680858612, 0.8259268999099731, 0.6179808974266052, 1.1231513023376465, -0.07899729162454605, -0.33970916271209717, -0.44258376955986023, -0.47572776675224304, -0.5546634793281555, 0.09924882650375366,...
def _ calculate _ path ( self, start, target ) : path = [ start ] if not self. _ is _ in _ game _ bounds ( start ) : return path if start [ 0 ] = = target [ 0 ] and start [ 1 ] = = target [ 1 ] : return path elif start [ 0 ] = = target [ 0 ] : # squares are in the same column step = 1 if start [ 1 ] < target [ 1 ] else...
[ -0.6932324767112732, -0.7643203735351562, 0.8518900871276855, 0.35981589555740356, -0.2624906599521637, -0.684556245803833, 0.5045261383056641, -0.652387261390686, 0.29406481981277466, 0.7563547492027283, 0.1925283521413803, 0.048480335623025894, 0.1403542459011078, -0.2546125054359436, ...
def file ( cls, name = " main ", nocache = false ) : if not nocache and cls. cache. get ( name ) is not none : return cls. cache [ name ] logfile = osp. join ( tempfile. gettempdir ( ),'asterstudy - { 0 } - { 1 }. log '. format ( name, cls. _ user ) ) if osp. isfile ( logfile ) and not os. access ( logfile, os. w _ ok ...
[ 0.042784761637449265, -0.1751461923122406, 0.6974877715110779, -0.5960039496421814, -1.4990499019622803, 0.33690589666366577, 0.5766425132751465, -0.3058253526687622, -0.18859174847602844, 0.016119180247187614, 0.2714051902294159, -0.13376957178115845, 0.3723933696746826, -0.42567947506904...
def rsi _ vec ( data _ df, window = 14 ) : close = data _ df ['close'] delta = close. diff ( ) # delta = delta. iloc [ 1 : ] up, down = delta. copy ( ), delta. copy ( ) up [ up < 0 ] = 0 down [ down > 0 ] = 0 roll _ up = up. rolling ( window = window, center = false ). mean ( ) roll _ down = down. abs ( ). rolling ( wi...
[ -0.3393813669681549, 0.6298339366912842, 0.800140917301178, 0.23356418311595917, -0.34773874282836914, 0.008086313493549824, 1.3891035318374634, -0.18023806810379028, 0.019081462174654007, 0.42986077070236206, 0.08025002479553223, 0.5708431005477905, -0.8121594190597534, -0.058845866471529...
def test _ outgoing _ vertex _ traversal ( self ) : e1 = testedge. create ( self. v1, self. v2, numbers = 12 ) e2 = testedge. create ( self. v1, self. v3, numbers = 13 ) e3 = testedge. create ( self. v2, self. v3, numbers = 14 ) results = self. v1. outv ( testedge ) assert len ( results ) = = 2 assert self. v2 in resul...
[ -0.14092124998569489, 0.5980424284934998, 0.5790007710456848, 0.6210000514984131, -0.1482548713684082, 0.3539206385612488, 1.1977955102920532, -0.24202154576778412, -0.09836717694997787, 0.22269302606582642, -0.6373849511146545, -0.37570488452911377, -0.8552616834640503, -0.387211173772811...
def is _ valid _ pair ( self, pred _ i, pred _ j ) : if pred _ i. name! = pred _ j. name : return false if pred _ i. is _ negation = = pred _ j. is _ negation : return false return true
[ -0.9915091395378113, -0.31854701042175293, 0.6597402095794678, 0.25604820251464844, -1.4744726419448853, 1.1320013999938965, -0.5420994758605957, 0.46590739488601685, -1.3064991235733032, 0.7038478851318359, 0.5312638282775879, 0.20852087438106537, -0.5575566291809082, 0.49886444211006165,...