text
stringlengths
25
2.19k
embedding
listlengths
768
768
def count _ inversion ( sequence ) : return sum ( [ len ( filter ( lambda x : x < i, sequence [ idx : ] ) ) for idx, i in enumerate ( sequence ) ] )
[ -0.7822394371032715, 0.20000241696834564, 0.4922656714916229, -1.040137529373169, -0.22588372230529785, 0.050340842455625534, 0.8915650248527527, 0.7534981369972229, 0.05608582869172096, 0.7686806321144104, -2.0645861625671387, 0.15034636855125427, -0.3559671938419342, -0.6647530794143677,...
def _ generate _ thumbnail ( self, width, height ) : logging. info ( " generating thumbnail % dx % d " % ( width, height ) ) if type ( self. img _ orig ) is blobstore. blobinfo : img = images. image ( blob _ key = str ( self. img _ orig. key ( ) ) ) else : img = images. image ( image _ data = self. img _ orig ) img. re...
[ -0.09263230115175247, 0.03568759560585022, 0.5709177255630493, -0.07858097553253174, 0.025127606466412544, -1.000206708908081, -0.4717901945114136, 0.17869430780410767, -0.0002774349122773856, -0.3097465932369232, -0.1762000173330307, -0.6008160710334778, -0.050372712314128876, -0.35484179...
def cleanobjectfiles ( object _ files ) : cleaning _ list = ['libavcodec / file _ open. o ', # includes libavutil / file _ open. c'libavformat / file _ open. o ', # includes libavutil / file _ open. c # these codecs are not supported by chromium and allowing ogg to parse # them can lead to issues. see http : / / crbug....
[ 0.45000016689300537, -1.2610583305358887, 0.9357032775878906, 0.16333124041557312, 0.26876184344291687, 0.32989054918289185, 0.2643710970878601, -0.22904983162879944, 0.26966336369514465, -0.29777005314826965, 0.06975153088569641, -0.1491086184978485, 0.06249544769525528, 0.256509274244308...
def plot _ roc ( preds, labels, title = " receiver operating characteristic " ) : # compute values for curve fpr, tpr, _ = roc _ curve ( labels, preds ) # compute fpr ( 95 % tpr ) tpr95 = fpr _ at _ 95 _ tpr ( preds, labels ) # compute auroc roc _ auc = auroc ( preds, labels ) # draw the plot plt. figure ( ) lw = 2 plt...
[ 0.7698084712028503, 0.27923712134361267, 0.7187631726264954, -1.266703486442566, -0.4986237585544586, 0.17599742114543915, 0.5166125297546387, 0.6638289093971252, -0.13234393298625946, -0.13013049960136414, 0.31810662150382996, 0.6070939898490906, 0.5130441784858704, -0.31177809834480286, ...
def place _ mines ( self, x, y ) : self. mines = [ ] options = self. buttons. copy ( ) del options [ ( x, y ) ] # remove initial square from options for xy in random. sample ( list ( options ), app. mines ) : self. get _ tile ( * xy ). arm ( )
[ -0.37745386362075806, -0.14327195286750793, 0.36527127027511597, -0.21176254749298096, 1.1890677213668823, 1.139266014099121, -0.0377587229013443, -1.2279170751571655, 0.9006609320640564, 0.05561221018433571, -0.4466600716114044, 0.15055164694786072, 0.13371501863002777, -0.497862368822097...
def save ( self ) : # save the file xfile. _ save _ file ( self. _ filename, self. _ datasourcetree )
[ -0.022713331505656242, 0.23840337991714478, 0.1340801864862442, -1.36404550075531, 0.5498645305633545, -0.1441083550453186, -0.14668938517570496, 1.3430910110473633, -0.6951397061347961, 0.11267774552106857, -1.4307096004486084, -0.3720340430736542, 0.10731685906648636, 0.00657147541642189...
def multi _ input ( self, gen _ function, on _ done = none ) : def progress ( result ) : try : progress. variable _ name, progress. initial _ value = gen _ function. send ( result ) if type ( progress. initial _ value ) is str : sublime. active _ window ( ). show _ input _ panel ( progress. variable _ name, progress. i...
[ -0.7301552891731262, 0.2547110617160797, 0.7945447564125061, -0.07779832184314728, -0.33711686730384827, 0.057525403797626495, 0.5430946350097656, -0.5438613295555115, -0.973484218120575, 0.12114587426185608, -0.3855832517147064, 0.08034959435462952, -0.4546118378639221, 1.258681297302246,...
def generate _ passwords ( self, password _ list ) : global passwords if passwords is none : passwords = [ none ] * len ( password _ list ) for index, password in enumerate ( password _ list ) : if password : passwords [ index ] = self. bcrypt. generate _ password _ hash ( password ) else : passwords [ index ] = none r...
[ -0.45355382561683655, 0.954149067401886, 0.5914886593818665, 0.8689386248588562, 1.078644871711731, -0.5095606446266174, -0.5130237340927124, 0.2940797507762909, 0.678517758846283, 0.9025487303733826, -1.4391487836837769, -0.4220382273197174, -1.1448605060577393, 1.1338611841201782, -0.9...
def fit _ predict ( self, x, y, ids _ test, x _ test, prediction _ path ) : pass
[ -0.11012925207614899, -1.016726016998291, 0.12195220589637756, 1.1743223667144775, 0.08180546015501022, 0.09890686720609665, -0.03458094969391823, 0.800857663154602, -0.5586814880371094, 0.27885696291923523, -0.09918829053640366, 0.6478416919708252, -0.2677108645439148, -0.8064861297607422...
def parse _ token ( scanner, token _ type ) : if scanner. peek ( ). type = = token _ type : return scanner. next ( ) else : raise parseerror ( expected = set ( [ token _ type ] ) )
[ 0.4117814600467682, 0.0069940825924277306, 0.5417183637619019, 0.22462797164916992, -0.128214493393898, -0.2924639582633972, -0.4942886531352997, -0.8041409850120544, -0.49326765537261963, -0.23234397172927856, 0.9556125998497009, 0.6007410287857056, -0.43160444498062134, 0.350666522979736...
def extract _ information ( prayer ) : # removes uppercase and special characters ponto = normalize ('nfkd ', prayer. lower ( ) ). encode ('ascii ','ignore') deity = { } # first it runs a scan based on the most unambiguous potential mentions # like when preceded by'sarava ', meaning'hail ', which is the surest one # or...
[ -0.25521761178970337, -0.09071926027536392, 0.6878898739814758, -0.7438397407531738, -0.527090311050415, -0.6626421809196472, 0.29435575008392334, 0.04140430688858032, -0.3698478639125824, -0.5054804682731628, -0.4935433864593506, 0.5408777594566345, 0.6316303610801697, 1.1745128631591797,...
def train _ base _ classifiers ( bootstrap _ data, val _ data, lr = 0. 7, iteration = 50 ) : # lr = 0. 7, iteration = 50 # train the base classifier trained _ models = { } for model, bootstrap in enumerate ( bootstrap _ data ) : _, _, opt _ theta, opt _ beta, validation _ acc = base _ classifer ( bootstrap, val _ data,...
[ -0.9078617691993713, -0.7403380870819092, 0.49291378259658813, 0.6371236443519592, 0.660159707069397, -0.09704579412937164, -0.49778202176094055, -0.3900225758552551, -1.316914677619934, 0.28608840703964233, -0.8441858887672424, -0.321769654750824, -0.16656844317913055, 0.4543132483959198,...
def _ restore _ thermodynamic _ states ( self, ncfile ) : logger. debug ( " restoring thermodynamic states from netcdf file... " ) initial _ time = time. time ( ) # define reference units temperature _ unit = unit. kelvin pressure _ unit = unit. atmospheres # make sure this netcdf file contains thermodynamic state info...
[ -0.13328474760055542, -0.28862056136131287, 0.1898302286863327, -0.48842868208885193, 0.23811617493629456, 0.24309322237968445, -0.07175091654062271, -0.6798589825630188, -0.7773436903953552, -0.37183114886283875, 0.22413884103298187, -0.6627577543258667, -0.32510867714881897, 0.1091816201...
def mock _ actor ( cls, count ) : counter = {'count': 0 } class wrappedactor ( cls ) : async def on _ message ( self, message ) : await super ( ). on _ message ( message ) counter ['count'] + = 1 if counter ['count'] = = count : await self. stop ( ) return wrappedactor
[ -1.2054259777069092, -0.2487892210483551, 0.5505663156509399, 0.07694754749536514, 0.10485078394412994, -0.21378464996814728, 1.1198230981826782, -0.4121655523777008, -0.02567657269537449, -0.052317749708890915, -0.15737511217594147, 0.23198874294757843, -0.6806706786155701, 0.434267908334...
def testreloadpopulatesfirsteventtimestamp ( self ) : gen = _ eventgenerator ( self ) acc = self. _ make _ accumulator ( gen ) gen. addevent ( event _ pb2. event ( wall _ time = 1, step = 2, file _ version = " brain. event : 2 " ) ) acc. reload ( ) def _ die ( * args, * * kwargs ) : # pylint : disable = unused - argume...
[ 0.2981570363044739, 0.4400410056114197, 0.7918449640274048, 0.5571602582931519, 1.1075612306594849, 0.48446935415267944, 0.0935157909989357, -0.7206156849861145, -0.13212770223617554, -0.4913251996040344, -0.5106590986251831, -0.527423620223999, 0.2472306787967682, 0.5331114530563354, 0....
def run ( self, get _ error = false ) : if type ( self. input _ sol ) = = list : x, y, z = self. input _ sol [ 0 ]. shape [ 0 ], self. input _ sol [ 0 ]. shape [ 1 ], len ( self. input _ sol ) else : x, y, z = self. input _ sol. shape [ 0 ], self. input _ sol. shape [ 1 ], self. input _ sol. shape [ 2 ] a1, a2, a3 = po...
[ -0.6044157147407532, -0.2971356511116028, 0.9235078692436218, 0.1431054323911667, 0.255104660987854, 0.4219731390476227, 0.6767916679382324, 0.33483898639678955, 0.15147578716278076, 0.428171306848526, 0.15479892492294312, -0.2688482105731964, -0.28753483295440674, -0.3951733112335205, 1...
def tools _ convertxargstopx ( xposition, objw, textw ) : if xposition = = " left " : x = 0 elif xposition = = " center " : x = int ( 0. 5 * objw - 0. 5 * textw ) elif xposition = = " right " : x = int ( objw - textw ) else : try : x = int ( xposition ) except : print ( " [ pssmol ] invalid input for xposition " ) retu...
[ -0.6787900328636169, -0.6845351457595825, 0.6889110207557678, -1.007904052734375, -1.0849225521087646, 0.43247872591018677, -0.8087789416313171, -0.45451733469963074, -0.06345485150814056, 0.8387647271156311, -0.43863460421562195, -1.153030276298523, -0.609527051448822, -0.6006984710693359...
def get _ all _ unique _ organims _ in _ db ( self ) - > list [ str ] : return list ( set ( self. _ database. iloc [ :, 5 ] ) )
[ -0.34346821904182434, 0.6503427028656006, 0.42221423983573914, 0.34890028834342957, 0.4699403643608093, 0.6155986189842224, 0.2317223697900772, -0.2806061804294586, -0.18871670961380005, 0.2337748110294342, -0.8793798685073853, 0.16670604050159454, -0.42362654209136963, -0.0371654890477657...
def getobjectasarray ( self, object, classname ) : objlist = acm. farray ( ) # list if type ( object ) is list : for el in object : objlist. add ( self. getobject ( el, classname ) ) else : # tuple if isinstance ( object, tuple ) : for el in object : objlist. add ( self. getobject ( el, classname ) ) # int / string eli...
[ -1.5487887859344482, -0.907812774181366, 0.7773129343986511, 1.213924765586853, 0.6889849901199341, -0.09607654809951782, 0.6150744557380676, -0.671873152256012, 0.42114514112472534, 0.19762557744979858, -0.03281109780073166, 1.134312391281128, -0.3883627951145172, 0.6120878458023071, -0...
def perturb _ coordinates ( old _ coords, negative _ freq _ vecs, molecule _ perturb _ scale, reversed _ direction ) : max _ dis = max ( math. sqrt ( sum ( x * * 2 for x in vec ) ) for vec in negative _ freq _ vecs ) scale = molecule _ perturb _ scale / max _ dis normalized _ vecs = [ [ x * scale for x in vec ] for vec...
[ -0.17114074528217316, -0.2828314006328583, 0.5683472156524658, 0.08316481113433838, 0.16181008517742157, -0.1602293998003006, -0.2932121157646179, 0.36098840832710266, 0.23697185516357422, -0.02975769340991974, 0.6885107755661011, -0.1168498694896698, -0.11637876182794571, 0.02903437428176...
def clear ( self ) : for ids in self. _ id. values ( ) : ids. clear ( )
[ -0.7179538607597351, -0.8052978515625, 0.1938316524028778, -0.6689751148223877, 0.4516109526157379, 0.4496012032032013, -0.29028385877609253, -0.3334236145019531, -0.3592851758003235, 0.35104262828826904, -0.4889509677886963, 1.0282648801803589, 0.14109200239181519, 0.35198089480400085, ...
def _ _ init _ _ ( self, pos, radius = 0, cp1 = false, cp2 = false, direction = false, transform = false, sharp = true, israpid = false, comment = false ) : self. init ( ) self. pos = vec ( pos ) self. point _ type ='sharp'self. radius = radius self. cp1 = vec ( cp1 ) self. cp2 = vec ( cp2 ) self. direction = direction...
[ 0.38651248812675476, -0.6916282176971436, 0.6539509296417236, 0.3987540304660797, 0.4599222242832184, 0.21332168579101562, -0.22882433235645294, -0.06968624889850616, 0.3410699665546417, -0.062195416539907455, -0.7727665305137634, 0.10399340093135834, 0.4426277279853821, -0.176432162523269...
def getkey ( self, key, default = none ) : try : return self. _ config [ key ] except keyerror : return default
[ -0.7179921865463257, 0.7119053602218628, 0.03075314313173294, 0.9555373191833496, 0.5458478927612305, -0.34269213676452637, -0.725884199142456, -0.3710973858833313, -0.4829062819480896, 0.9980234503746033, -0.02723836898803711, -0.32937267422676086, -1.132157325744629, -0.10320891439914703...
def arguments ( ) : parser = argparse. argumentparser ( ) parser. add _ argument ('campaign ', help = " shortcode for this call campaign ", type = str ) parser. add _ argument ('list _ file ', help = " the list file to call. ", type = str ) parser. add _ argument ('- c ','- - cps ', help = " max calls in one second ", ...
[ -0.045489601790905, -0.41333484649658203, 0.9588175415992737, -0.9476498961448669, 0.059877362102270126, 0.20946207642555237, -1.0448157787322998, 0.40524813532829285, -0.02055700309574604, 0.36829710006713867, -0.19746387004852295, -0.17566081881523132, -0.6933394074440002, 0.643163383007...
def most _ frequent ( self, k ) : return orderedvocabulary ( words = self. words [ : k ] )
[ 0.7973529100418091, -0.41356971859931946, 0.3374766707420349, 0.13717783987522125, -0.4446096420288086, -1.2701141834259033, -0.9299110770225525, -0.7197959423065186, -0.13669444620609283, -0.37224429845809937, 0.31210142374038696, -0.2496088147163391, 0.37268730998039246, 0.23619872331619...
def bnmf ( df : pd. dataframe, k : int = 4, n _ run : int = 10, * * kwargs ) : bmf = nimfa. bmf ( df. values, rank = k, n _ run = n _ run, * * kwargs ) bmf _ fit = bmf ( ) w = pd. dataframe ( bmf _ fit. fit. w, index = df. index ). t h = pd. dataframe ( bmf _ fit. fit. h, columns = df. columns ). t h. columns = h. colu...
[ 0.03869615122675896, -0.32111692428588867, 0.5350867509841919, 0.44515952467918396, 0.2929411828517914, -1.2969495058059692, 0.2192831188440323, -0.14233075082302094, -0.8499069809913635, -0.036708101630210876, -0.5929144620895386, 0.24481184780597687, -1.095065951347351, 0.163446515798568...
def _ get _ filter _ indices ( vector, filter _ treshold ) : # compute index - wise change in data diff = vector [ 1 : ] - vector [ 0 : - 1 ] # compute change of data point to both directions diff _ right = np. full ( vector. shape, np. nan ) diff _ left = np. full ( vector. shape, np. nan ) diff _ right [ 1 : ] = diff...
[ -0.3479929268360138, -0.5714468359947205, 0.8402391076087952, 0.07731018215417862, -0.6597375869750977, -0.11189381778240204, 0.5690295100212097, 0.03468549624085426, -0.197147935628891, 0.646338939666748, -0.33271846175193787, 1.3348239660263062, 0.4819987714290619, -0.19865716993808746, ...
async def _ login ( self ) : try : await self. _ load _ areas ( ) # read / project to determine bridge type project _ json = await self. _ request ( " readrequest ", " / project " ) project = project _ json. body [ " project " ] if ( project [ " producttype " ] = = " lutron radiora 3 project " or project [ " producttyp...
[ -0.7414202094078064, -0.025086121633648872, 0.6073621511459351, 0.953399121761322, 0.5538817048072815, 0.3075735569000244, 0.6172732710838318, -0.493105411529541, 0.8227845430374146, -0.28545212745666504, -0.17473401129245758, -0.5153968334197998, 0.015146812424063683, 0.2559574842453003, ...
def dense _ to _ one _ hot ( labels _ dense, label _ encoder ) : n _ classes = len ( label _ encoder. classes _ ) logger. debug ('unique classes : { 0 } '. format ( n _ classes ) ) n _ labels = labels _ dense. shape [ 0 ] index _ offset = np. arange ( n _ labels ) * n _ classes labels _ one _ hot = np. zeros ( ( n _ la...
[ -1.8944404125213623, -0.6988824605941772, 0.45033326745033264, -0.12210667878389359, 0.6128450036048889, 0.5374870300292969, 0.23042985796928406, 0.44125816226005554, 1.0733022689819336, 0.39423850178718567, 0.4451928734779358, 0.2560083866119385, 0.017033889889717102, 0.14697763323783875,...
def synth _ values _ tdep ( self, time, radius, theta, phi, *, nmax = none, deriv = none, grid = none, extrapolate = none ) : return self. model _ tdep. synth _ values ( time, radius, theta, phi, nmax = nmax, deriv = deriv, grid = grid, extrapolate = extrapolate )
[ -0.6384273171424866, 1.0662728548049927, 0.41384825110435486, -0.14700786769390106, -0.627230703830719, -0.7194612622261047, -1.1983996629714966, -0.39440369606018066, -0.8770902752876282, 0.4957963824272156, -0.6365721821784973, -0.036550406366586685, 0.598054051399231, 0.3737073838710785...
def get _ coded _ value ( self, domain _ name, description ) : domain = self. get _ domain ( domain _ name,'codedvalue') for ( code, desc ) in domain. codedvalues. items ( ) : if desc = = description : return code raise valueerror ('domain % s has no code for description % s'% ( domain _ name, description ) )
[ 0.40012890100479126, 0.18128080666065216, 0.5214093327522278, 0.3890669345855713, -0.051185332238674164, -0.20366938412189484, -0.42693740129470825, -0.05764317139983177, -0.4327322542667389, -0.18532265722751617, 1.0321729183197021, 1.8352513313293457, 0.181427001953125, 0.642643034458160...
def non _ maximum _ suppression ( bbox, thresh, score = none, limit = none ) : return _ non _ maximum _ suppression _ gpu ( bbox, thresh, score, limit )
[ -0.10844257473945618, 1.0080804824829102, 0.5026508569717407, 1.7602859735488892, 0.017022637650370598, -0.7530665993690491, -0.35799598693847656, -0.7829221487045288, 0.35794946551322937, 0.052488312125205994, 0.20317339897155762, -0.0532519668340683, 0.03525645658373833, -0.9467186927795...
def grid _ indexer ( self ) : return flex. grid ( self. grid _ size ( ) )
[ 0.47408807277679443, 0.010105886496603489, 0.3330514132976532, 0.1456804871559143, -0.3403494656085968, -0.6061206459999084, -0.05428057909011841, -0.07919023185968399, -0.21061521768569946, -1.1817620992660522, 0.6997263431549072, 0.2820446789264679, -0.7054219841957092, 0.394332230091094...
def create _ index ( self, definition _ name ='page') : # build a index and increment the version idx = index ( name ='% s _ v % d'% ( self. name, self. v ), using = es ) while idx. exists ( ) : self. v + = 1 idx = index ( name ='% s _ v % d'% ( self. name, self. v ), using = es ) mapping = definitions. get ( definitio...
[ -0.7262753248214722, -0.0851931944489479, 0.5941702723503113, -0.3838285803794861, 0.47426414489746094, 0.2420053780078888, 0.491717666387558, 0.7721258401870728, 0.08793886750936508, 0.45964252948760986, -0.4735499620437622, -0.40637263655662537, -0.10305140912532806, -0.314789354801178, ...
def test _ cancel _ booking ( self ) : event = baker. make _ recipe ('booking. future _ ev') booking = baker. make _ recipe ('booking. booking ', event = event, user = self. user, paid = true ) self. assertequal ( booking. objects. all ( ). count ( ), 1 ) url = reverse ('booking : delete _ booking ', args = [ booking. ...
[ 0.3771958351135254, 1.03347647190094, 0.29279467463493347, 1.4764198064804077, -0.40702271461486816, 1.0156933069229126, -0.17043918371200562, 1.9078463315963745, -0.1523321568965912, -0.28689923882484436, -0.45834553241729736, -0.980987548828125, 0.18498630821704865, 0.48551926016807556, ...
def least _ common _ multiple ( m, n ) : # - - - - - - - - - - 1. input validation - - - - - - - - - - if not isinstance ( m, int ) or not isinstance ( n, int ) : raise exception ( " either m or n is not of integer type! " ) if m < = 0 or n < = 0 : raise exception ( " either m or n is non - positive! " ) # - - - - - - ...
[ 0.43085023760795593, -0.026747239753603935, 0.6126550436019897, -0.5674006342887878, -0.2139294296503067, 0.2873511016368866, -0.2581179141998291, -0.004809037782251835, 0.03690015897154808, 0.05153565853834152, 0.7258710265159607, 0.21905022859573364, -1.274610161781311, 1.408221125602722...
def eval _ atomic ( atomic, env ) : if isinstance ( atomic, lambda ) : return closure ( atomic, env ) if isinstance ( atomic, variable ) : return env [ atomic ] if isinstance ( atomic, ( int, bool, str, list, type ( none ) ) ) : return atomic assert ( not isisinstance ( atomic, atomic ) ) raise valueerror ( " % s is no...
[ -0.3260139524936676, -0.2397756427526474, 0.5048113465309143, -0.2639709711074829, -0.06451079994440079, -0.38736066222190857, -0.48978424072265625, -0.3527682423591614, 0.006826707161962986, 0.5906658172607422, 0.8169223666191101, 1.3033688068389893, -0.11818555742502213, -0.2927167117595...
def input _ create ( k, file, numofvar, x, ub, lb ) : infile = open ( file,'w') # print ( " data ", a, b, k, numofvar ) for i in range ( numofvar ) : if ( i in k ) : # generate a random number for kth row rn = 100 * np. random. rand ( 1 ) [ 0 ] # print ( rn ) a = sobol _ seq. i4 _ sobol ( 1, rn ) [ 0 ] [ 0 ] * ( ub [ i...
[ 0.1411799043416977, 0.013440459966659546, 0.7037146687507629, 0.5524588823318481, 0.007163959089666605, 0.9539658427238464, 0.3897970914840698, 0.25280290842056274, -0.1349032074213028, -0.02465682104229927, -0.050399456173181534, -0.8636617660522461, -0.2966744303703308, -0.06086773797869...
def plot _ signs ( images, labels, counts = none, pred _ labels = none ) : count = len ( images ) fig, axes = plt. subplots ( 6, 7, figsize = ( 10, 10 ) ) fig. subplots _ adjust ( hspace = 1, wspace = 1 ) plot _ axes ( axes, images [ : - 1 ], labels [ : - 1 ], counts, is _ count = true )
[ 0.2821621298789978, 0.20233209431171417, 0.4397365152835846, 0.5153983235359192, 0.0006833709194324911, 0.09760000556707382, 0.7720636129379272, 0.6151004433631897, -0.36109232902526855, -0.4635474681854248, 0.8000620603561401, -0.01007537730038166, 0.27787867188453674, 0.6121111512184143,...
def test _ get _ all _ stacks ( self ) : stacks = stack. objects. all ( ) for s in stacks : self. asserttrue ( s. stackname. startswith ('wordpress') ) self. assertequal ( stacks. count ( ), 3 )
[ 1.217868685722351, 1.170318841934204, 0.3955606520175934, 1.1028766632080078, 1.5240486860275269, 0.4956720471382141, -0.1342904418706894, -0.18293699622154236, -0.08242814987897873, -0.14272157847881317, -0.6653186678886414, -0.6398719549179077, 0.2843714952468872, 0.726802408695221, -0...
def get _ address _ by _ name ( self, address _ name : str, resource _ group _ name : str, * * kwargs : any ) - > _ models. addressresource : api _ version = self. _ get _ api _ version ('get _ address _ by _ name') if api _ version = ='2020 - 12 - 01 - preview': from. v2020 _ 12 _ 01 _ preview. operations import edgeo...
[ -0.9510253667831421, -0.5292556881904602, 0.8642226457595825, -0.15045712888240814, -0.9436139464378357, -0.9107983112335205, -0.19634857773780823, -0.8324737548828125, 0.5064647197723389, 0.5962311029434204, 0.007195387035608292, 0.5811497569084167, -0.5914627909660339, 0.1543137729167938...
def resertfile ( self ) - > image : self. img. close ( ) self. img = image. open ( self. image _ file _ name ) return self. img
[ 0.08695929497480392, -0.5026000142097473, 0.46101415157318115, -0.6021663546562195, -0.3442719578742981, 0.2517407238483429, 0.5531048774719238, 0.6480107307434082, -0.6140538454055786, -1.0298242568969727, 0.9945887327194214, 0.28140872716903687, -0.5690789222717285, -0.7931454181671143, ...
def order _ list ( request ) : if request. method = ='get': # get all requirements in order status if request. user. has _ perm ('customer. customer _ view _ others') : requirements = requirement. objects. filter ( status = " order " ). distinct ( ) else : requirements = requirement. objects. filter ( q ( customer _ _ ...
[ -0.14887847006320953, -0.3552941679954529, 1.0366275310516357, 0.40144625306129456, -0.5545573830604553, 0.24220150709152222, 0.16286839544773102, 0.7461630702018738, -0.23341481387615204, 0.47970664501190186, 0.41032928228378296, -0.5965175032615662, 0.6029458045959473, 1.0955020189285278...
def get _ new _ name ( x : str ) - > str : y = x. lower ( ) if y = = " cervical " : return " cervical _ spine " m = re. match ( r " ^ ( [ lr ] ) \ s + (. + ) $ ", y ) if not m : raise valueerror ( " cannot parse site name : {! r } ". format ( x ) ) side = " left " if m. group ( 1 ) = = " l " else " right " site = m. gr...
[ -0.42643243074417114, -0.14313603937625885, 0.9658163785934448, -0.5272397994995117, -1.4471642971038818, 0.05801717936992645, -0.21970543265342712, -0.4699305295944214, 0.3497008681297302, 0.5624917149543762, -0.7381105422973633, -0.11064758896827698, 0.9415329098701477, -0.93581598997116...
def test _ valid _ data ( self ) : form = self. form _ data ( operator _ 1 = self. staff _ user. pk, role _ 1 = self. project _ role. pk, start _ date _ 1 = " 2020 - 06 - 22 ", end _ date _ 1 = " 2020 - 06 - 27 ", note _ 1 = " ", ) self. asserttrue ( form. is _ valid ( ) )
[ -0.18875393271446228, 0.35564300417900085, 0.5076242089271545, 0.535564661026001, -0.006491447798907757, 1.6160650253295898, -0.14218837022781372, 0.5369239449501038, -0.8406416177749634, -1.193800449371338, -0.4374749958515167, 0.10223428159952164, -0.08368664234876633, -0.518843650817871...
def num _ examples ( self ) : if classesmixin. _ does _ quack ( self ) : return self. _ local _ importance _ values [ 0 ]. shape [ 0 ] else : return self. _ local _ importance _ values. shape [ 0 ]
[ 0.37709543108940125, 0.6268399357795715, 0.44496864080429077, -0.3806719183921814, 0.9505742192268372, 0.15783832967281342, 0.8889613151550293, 0.8483873009681702, 0.9202030897140503, -0.25205519795417786, -0.5179375410079956, 0.46085864305496216, 0.3129030168056488, 0.47909894585609436, ...
async def defaultrole ( self, ctx ) : role = self. settings. getserverstat ( ctx. message. server, " defaultrole " ) if role = = none or role = = " " : msg ='new users are not assigned a role on joining this server.'await self. bot. say ( msg ) else : # role is set - let's get its name found = false for arole in ctx. m...
[ 0.044167306274175644, 0.5519965887069702, 0.599669337272644, 0.2502977252006531, 1.0937291383743286, 0.19504135847091675, -0.5099358558654785, -0.25962430238723755, 0.11444508284330368, 0.21449898183345795, -0.07213613390922546, 0.72531658411026, -1.511471152305603, 1.1199432611465454, -...
def test _ create _ reply _ notification _ via _ signal ( self ) : self. comment. save ( ) self. reply. save ( ) self. assertequal ( notification. objects. count ( ), 3 ) self. assertequal ( str ( notification. objects. get ( action = notification. reply ) ), f'{ self. user. display _ name } replied to { self. reply. b...
[ 0.7493754625320435, 0.07641539722681046, 0.4979126751422882, -0.37263569235801697, 1.2052748203277588, 0.824860692024231, 0.013261490501463413, -0.6772682070732117, 0.039108872413635254, 0.3063655495643616, -1.9623851776123047, 0.3211277425289154, 0.4232615530490875, -0.03133758530020714, ...
def match ( self, other ) : if self. sub _ type! ='*'and other. sub _ type! ='*'and other. sub _ type! = self. sub _ type : return false if self. main _ type! ='*'and other. main _ type! ='*'and other. main _ type! = self. main _ type : return false return true
[ -0.030967824161052704, -0.4532845914363861, 1.0894737243652344, 1.2497929334640503, -0.5913984775543213, 1.0959193706512451, -0.341212660074234, -0.29194504022598267, -0.6459781527519226, -0.10142920911312103, -0.16240647435188293, 0.5325918197631836, -1.237762451171875, 0.3572688102722168...
def init _ weights _ and _ state ( self, input _ signature ) : x _ input _ signature = input _ signature [ 0 ] d _ model = x _ input _ signature. shape [ - 1 ] shape _ m1 = ( d _ model, self. _ d _ lowrank ) shape _ m2 = ( self. _ d _ lowrank, self. _ d _ ff ) shape _ mb = ( self. _ d _ ff, ) rng _ m1, rng _ m2, rng _ ...
[ -0.5030962228775024, 0.34271711111068726, 0.529180645942688, -0.17656826972961426, 0.30238816142082214, -0.7760290503501892, 0.27445361018180847, 0.23894305527210236, -0.04011252894997597, -0.30258703231811523, -0.8868544101715088, -0.07088111340999603, 0.5177664160728455, 0.84793758392333...
def table _ features ( data ) : data _ select = data [ ['album _ name ','artist _ name ','name ','acousticness ','danceability ','energy ','instrumentalness'] ] df _ table = plotly. offline. plot ( ff. create _ table ( data _ select ), output _ type ='div') return df _ table
[ -0.25835758447647095, 0.329342246055603, 0.2869637608528137, 0.49229156970977783, -0.24258646368980408, -0.07957052439451218, 0.4720253348350525, -0.4555325508117676, -0.5579978227615356, -0.3840130567550659, -0.30638933181762695, 1.0492298603057861, -0.09327984601259232, -0.13533642888069...
def make _ html ( station, sensor _ d, sensor, mean, changed : bool, url, url2 = none, hourly = false ) : # sensor info si = sensor _ d [ sensor ] [ 0 ] if sensor! ='temperature': totals, avg _ total = total _ and _ 95 ( sensor _ d, sensor, mean ) avg _ total = round ( avg _ total, 2 ) tstring = str ( round ( np. perce...
[ 0.29820072650909424, 0.565634548664093, 1.0553194284439087, -0.18458153307437897, -1.1157984733581543, 0.5204080939292908, 0.49061158299446106, -0.23342685401439667, -0.2798372209072113, 0.33635178208351135, 1.1322189569473267, -0.17181797325611115, 0.9061049222946167, 0.6131996512413025, ...
def logged _ user ( request ) : return models. user. objects. filter ( id = request. session [ " user _ id " ] ) [ 0 ]
[ 0.13994336128234863, -1.023232340812683, 0.728924036026001, 0.7304985523223877, 0.48087990283966064, -0.09409430623054504, 0.6282119154930115, -0.9198648929595947, 0.6561555862426758, -0.5058190822601318, 0.5461412072181702, 0.18623915314674377, 0.7115662097930908, -0.4853028953075409, -...
def test _ addcircuit _ modify ( self ) : bits = cirq. gridqubit. rect ( 1, 20 ) circuit _ a = cirq. testing. random _ circuit ( bits, 10, 0. 9, util. get _ supported _ gates ( ) ) circuit _ b = cirq. testing. random _ circuit ( bits, 10, 0. 9, util. get _ supported _ gates ( ) ) expected _ append = util. convert _ to ...
[ -0.38753101229667664, 0.07314276695251465, 0.9211502075195312, -0.6367073655128479, 0.6188862919807434, 0.11051663011312485, 0.5577645301818848, -1.0515985488891602, 0.5793946385383606, -0.6409333944320679, -0.12073373049497604, 0.469251811504364, -0.02390795759856701, 0.4218777120113373, ...
def conv2d _ maxpool ( x _ tensor, conv _ num _ outputs, conv _ ksize, conv _ strides, pool _ ksize, pool _ strides ) : # implement function weight = tf. variable ( tf. truncated _ normal ( [ * conv _ ksize, int ( x _ tensor. shape [ 3 ] ), conv _ num _ outputs ], stddev = 0. 01 ) ) bias = tf. variable ( tf. zeros ( co...
[ 0.8522639274597168, -0.7440701723098755, 0.5637798309326172, 0.6162006855010986, -1.0660816431045532, 0.12255220115184784, -0.3629080355167389, -0.20722104609012604, 0.1940961331129074, 0.2326059490442276, -0.12255705147981644, 0.4681580662727356, 0.6674381494522095, -0.4798530638217926, ...
def swap ( values, a, b ) : temp = values [ a ] values [ a ] = values [ b ] values [ b ] = temp
[ -1.0459959506988525, -0.05031036585569382, 0.5265388488769531, -0.3654398024082184, 0.503867506980896, -0.022323792800307274, -1.0116862058639526, 0.6108666062355042, -0.335832804441452, -0.2317447066307068, 0.04401494935154915, 0.9456471800804138, 0.34651923179626465, -0.23199643194675446...
def init ( model : model [ list [ doc ], floats2d ], x : optional [ list [ doc ] ] = none, y : optional = none, ) - > none : width = model. get _ dim ( " width " ) tables = model. attrs [ " tables " ] if tables is none : raise valueerror ( " tables have to be set before initialization " ) unk = model. attrs [ " unk " ]...
[ -0.7299835085868835, 1.1034554243087769, 0.6523035764694214, 0.5650659799575806, -0.9992169737815857, 0.017858300358057022, 0.7981399297714233, -0.1918124556541443, -0.32533708214759827, 0.3868738114833832, -0.9972442388534546, 0.07787688821554184, 0.5511276125907898, 0.7779654264450073, ...
def _ _ ne _ _ ( self, other ) : if not isinstance ( other, security ) : return true return self. to _ dict ( )! = other. to _ dict ( )
[ -1.1670111417770386, 0.08932150900363922, 0.717353105545044, 0.4359626770019531, -0.03776931390166283, 0.3516422510147095, -0.613232433795929, -1.1187260150909424, 0.2925841510295868, -0.0935508981347084, -1.4138869047164917, -0.3282957673072815, -0.45250293612480164, -0.25627022981643677,...
def compare _ predictions ( y _ pred, y _ axis, subtitles, title ) : fig, axes = plt. subplots ( 1, len ( subtitles ), figsize = ( 15, 5 ) ) fig. suptitle ( title ) for i in range ( 3 ) : axes [ i ]. scatter ( y _ pred [ subtitles [ i ] ], y _ axis [ subtitles [ i ] ] ) axes [ i ]. title. set _ text ( subtitles [ i ] )...
[ 0.2746594250202179, -0.3531953990459442, 0.867006242275238, -0.04799710586667061, -0.4494772255420685, 1.3550136089324951, 0.17246805131435394, 0.536827564239502, -0.9274803400039673, 0.2453010231256485, 0.1610441654920578, 1.3212593793869019, 0.09748139977455139, 0.06338247656822205, 0....
def plotdecisionboundary ( theta, x, y, lamda ) : m = x. shape [ 0 ] pos = [ ] neg = [ ] for i in range ( m ) : if y [ i ] = = 1 : pos. append ( list ( x [ i, 1 : ] ) ) else : neg. append ( list ( x [ i, 1 : ] ) ) line1 = plt. scatter ( np. array ( pos ) [ :, 0 ], np. array ( pos ) [ :, 1 ], c ='r ', marker = '. ', s =...
[ 0.15777653455734253, 0.1109248548746109, 1.1727017164230347, 0.17961089313030243, -0.41858699917793274, 0.663439154624939, 0.5020462870597839, 1.095293402671814, 0.5817831158638, -0.10303056240081787, -0.149942085146904, 0.8864328265190125, 0.3579716980457306, 0.5558667182922363, 0.55162...
def populate _ dungeon ( dungeon : list ) : for row in dungeon : for room in row : room ['monster'] = generate _ monster ( monster _ types, monster _ descriptions )
[ -2.122382402420044, 1.0042880773544312, 0.4798484742641449, -0.1480683982372284, 1.650139570236206, 0.1262235790491104, -0.35795435309410095, 0.5587757229804993, -0.5707360506057739, 0.5928894281387329, -0.804183304309845, 0.016114410012960434, 0.34613409638404846, 2.04512882232666, -0.4...
def bfs ( start _ x, start _ y, stop _ x, stop _ y, grid ) : q = queue ( ) temp _ path = [ ( start _ x, start _ y ) ] q. put ( temp _ path ) while not q. empty ( ) : tmp _ path = q. get ( ) last _ node = tmp _ path [ len ( tmp _ path ) - 1 ] if last _ node = = ( stop _ x, stop _ y ) : return tmp _ path [ 1 : ] next = u...
[ -0.3521897792816162, -0.26247596740722656, 1.1757181882858276, 0.15467485785484314, 0.23097112774848938, -0.39309707283973694, -0.030696386471390724, -0.8328033089637756, -0.297909677028656, 0.3739384710788727, -0.030931157991290092, 0.4583984911441803, -0.6680043935775757, 0.2691302895545...
def _ update _ common _ subjects ( self, idx ) : self. common _ subjects = [ sub for i, sub in enumerate ( self. common _ subjects ) if idx [ i ] ]
[ -0.5425397753715515, -0.490633100271225, 0.4155086278915405, -0.8376258611679077, -0.006899675354361534, 0.5384988188743591, 0.4417400658130646, -0.9785221219062805, 0.3110786974430084, 0.8513729572296143, 0.05313540995121002, 0.7392469048500061, -1.24000084400177, -0.6955775022506714, -...
def do _ migration ( self ) : # assign partners if self. comm _ rank = = 0 : partners = list ( range ( self. comm _ size ) ) random. shuffle ( partners ) else : partners = none partners = self. comm. bcast ( partners, root = 0 ) ind = partners. index ( self. comm _ rank ) # primary partner primary = ( ind % 2 = = 0 ) i...
[ -0.7816872596740723, 0.5597367882728577, 0.9620393514633179, -0.16347987949848175, 0.49603474140167236, -0.10952575504779816, 0.7209634780883789, 0.0007679228438064456, -0.4698839485645294, -0.0034891727846115828, -0.5164045691490173, 0.3239598274230957, -0.5487022399902344, 0.585736215114...
def write _ json ( self, fieldname = " hgf _ record ", ) : fw = open ( os. path. join ( self. curdir, fieldname ), " w " ) json. dump ( self. data, fw, sort _ keys = true, indent = 2 ) fw. close ( )
[ -1.0956767797470093, -0.5371339321136475, 0.5178765058517456, -0.40460118651390076, 0.8528158068656921, 0.060673873871564865, 1.0250074863433838, 0.40786242485046387, -1.3870327472686768, -0.6700947284698486, -0.9215295910835266, 0.6830754280090332, -0.042128585278987885, 0.737092375755310...
def load _ units ( self, spike _ name, clustering _ name, no _ waveforms = false, ignore _ cluster _ zero = false ) : data = nwbio. load _ spikes ( self. fpath, spike _ name = spike _ name, use _ idx _ keep = true, use _ badchan = true, no _ waveforms = no _ waveforms, clustering _ name = clustering _ name, verbose = s...
[ -0.6926276683807373, 0.3867735266685486, 0.6984949707984924, -1.171925663948059, 0.6370471715927124, -0.044011302292346954, 0.3304521143436432, 0.24572385847568512, 0.16288986802101135, 0.4150400757789612, -0.5542934536933899, -0.3478631377220154, 0.2484317272901535, 0.2957439422607422, ...
def cu _ r4 ( f1, t0, tn, y0, h, k = [ ] ) : hi = np. linspace ( t0, tn, 1 + int ( ( tn - t0 ) / h ) ) # defines mesh of t between t0, tn if k = = [ ] : # defining dummy variable k when k is not required f = lambda y, t, k : f1 ( y, t ) k = np. zeros ( 2 * len ( hi ) - 1 ) else : f = lambda y, t, k : f1 ( y, t, k ) y =...
[ 0.4630067050457001, -0.187006875872612, 0.9766669273376465, 0.06722874939441681, 0.20107561349868774, -0.3023136258125305, 0.5821178555488586, 0.09198026359081268, -1.4583325386047363, 0.4636767506599426, 0.1099606305360794, 0.06913138926029205, -0.025911923497915268, 0.11661449819803238, ...
def detect _ labels ( path ) : client = vision. imageannotatorclient ( ) with io. open ( path,'rb') as image _ file : content = image _ file. read ( ) image = vision. image ( content = content ) response = client. label _ detection ( image = image ) labels = response. label _ annotations tags = [ ] for label in labels ...
[ -0.3620651662349701, -0.7477929592132568, 0.5114759802818298, -0.09780427813529968, 0.6651033759117126, 0.22844700515270233, -1.24491548538208, -0.4509125351905823, -0.6163630485534668, 1.4513394832611084, -0.45927727222442627, 0.31207022070884705, 0.0928448960185051, 1.3920719623565674, ...
def create _ javascript _ function ( self ) : js _ function = " " " < script async type = " text / javascript " > function parsecsv _ { 0 } ( csv, id ) { { papa. parse ( csv, { { comments :'# ', delimiter : ', ', header : true, dynamictyping : true, error : function ( reason ) { { console. log ( reason ) ; } }, complet...
[ 0.060779228806495667, -0.11498496681451797, 0.525201678276062, -0.0928121879696846, -0.1218094602227211, -1.2314850091934204, 0.11388688534498215, -0.6935998797416687, -0.36389437317848206, 0.18734635412693024, -0.2909591495990753, 0.5666577816009521, 0.6396636962890625, -0.000545467075426...
def div _ xy ( self, fx, fy, gtype ='tri ', btype = 1 ) : if gtype = ='tri': # get component of vector field parallel to tri _ mesh tangents ( and therefore perpendicular to vor _ edges ) : ff = fx * self. tri _ tang [ :, 0 ] + fy * self. tri _ tang [ :, 1 ] if btype = = 2 : divf = ( 1 / self. vor _ sa ) * np. dot ( - ...
[ 0.6995774507522583, 0.2228071093559265, 0.8139315843582153, -0.10893447697162628, -0.13402606546878815, -0.06273595243692398, 0.4888259172439575, -0.3220579922199249, -0.8214918971061707, 0.13990484178066254, 0.2506526708602905, 0.39777132868766785, -0.6655260920524597, 0.44621413946151733...
def check _ rootfolders ( ) : folders _ util = [ args. checkpoint _ dir, os. path. join ( args. checkpoint _ dir,'log'), os. path. join ( args. checkpoint _ dir,'checkpoint') ] for folder in folders _ util : if not os. path. exists ( folder ) : print ( ('creating folder'+ folder ) ) os. mkdir ( folder )
[ -0.06681104004383087, -0.22067010402679443, 0.8096259236335754, 1.02814519405365, 1.371115803718567, 1.1065417528152466, 0.7145550847053528, -0.5082566142082214, -0.24238766729831696, -0.48870429396629333, 0.43416517972946167, 0.16363555192947388, -0.008446455001831055, 0.6847853660583496,...
def _ test _ random _ forest _ classification ( ) : folder _ name = ". " from os import listdir files = sorted ( [ file for file in listdir ( folder _ name ) if " csv " in file ] ) for file in files : print file, test _ random _ forest _ classification ( file )
[ 0.06780275702476501, -0.32708558440208435, 0.6755356788635254, 0.9691146612167358, 0.6335455775260925, 0.31215375661849976, 0.7593933939933777, 0.178418830037117, -0.3722131848335266, -0.6103947162628174, -0.2561604082584381, 0.5998753905296326, 0.22383734583854675, 1.447326898574829, -1...
def datasets ( self, datasets ) : self. _ datasets = datasets
[ -1.034074068069458, 0.865634024143219, -0.3564791977405548, -0.21388433873653412, -0.6248032450675964, 0.30983516573905945, 0.00362687767483294, 0.7001109719276428, 0.504957914352417, -1.0698415040969849, -0.6311512589454651, 0.593252420425415, 0.04328456148505211, 0.24402643740177155, -...
def launch ( self, deployable _ type _ id, site, allocation, count = 1, extravars = none, caller = none ) : raise notimplementederror
[ -0.49903321266174316, 0.13892075419425964, 0.4558390974998474, 0.17801204323768616, -0.32178443670272827, -0.06614325195550919, 0.40246641635894775, -0.05912944674491882, 0.9726609587669373, 0.3528299033641815, 0.4785550534725189, 0.39816710352897644, 0.36434775590896606, 0.402768939733505...
def create _ component ( array, disabled, player _ settings _ 1, player _ settings _ 2, index ) : element = array [ index ] if element = = array _ identifier _ empty : emoji = emoji _ nothing style = buttonstyle. blue elif element = = player _ settings _ 1. identifier : emoji = player _ settings _ 1. emoji style = play...
[ -0.31487828493118286, -0.48036423325538635, 0.4896109104156494, 0.033988479524850845, 0.22702543437480927, 0.4992130994796753, -0.33683913946151733, -0.0778532326221466, 0.7818107604980469, 0.3007635772228241, -0.4235513210296631, 0.010700270533561707, -0.7687101364135742, -0.6767465472221...
def update ( self, time _ evt ) : # check if this is the first time we are being called if time _ evt. last _ real : # calculate time delta between calls dt = time _ evt. current _ real - time _ evt. last _ real self. _ publish _ effort ( dt ) self. _ publish _ state ( dt )
[ 0.05925238877534866, -0.549497127532959, 0.5017423033714294, 0.0673128217458725, 0.28867852687835693, 0.44504156708717346, -0.030133429914712906, -0.11325647681951523, 0.3059568703174591, 0.4220769703388214, -0.570584774017334, -0.6624438762664795, -0.5434762835502625, 1.8642204999923706, ...
def remove _ mc ( self, ns _ key, ipv4 _ vec ) : ver _ args = [ {'name':'ns _ key ','arg': ns _ key,'t': emunamespacekey }, {'name':'ipv4 _ vec ','arg': ipv4 _ vec,'t':'ipv4 _ mc ','allow _ list': true }, ] emuvalidator. verify ( ver _ args ) ipv4 _ vec = [ ipv4 ( ip, mc = true ) for ip in ipv4 _ vec ] ipv4 _ vec = [ i...
[ -1.3657597303390503, -0.08079642057418823, 0.5569022297859192, -0.18949691951274872, -0.6164891719818115, -0.5522093772888184, 0.23593509197235107, 0.14206866919994354, -0.12514345347881317, 1.0956063270568848, -0.2304142713546753, 0.3946734666824341, -1.260887622833252, 0.2947566211223602...
def test _ func ( self ) : self. rol _ nu, self. functie _ nu = rol _ get _ huidige _ functie ( self. request ) return self. rol _ nu = = rollen. rol _ bko
[ 0.0009160514455288649, -0.5611129999160767, 0.33852121233940125, 0.727191686630249, 1.0472739934921265, -0.16395863890647888, 0.9613775610923767, -0.6667676568031311, 0.20127388834953308, -0.4168430268764496, 0.11501945555210114, 0.5656507015228271, -0.47980499267578125, -0.751270294189453...
def write _ score ( score _ dir, score, duration ) : score _ filename = join ( score _ dir,'scores. txt') with open ( score _ filename,'w') as ftmp : ftmp. write ( f'score : { score } \ n') ftmp. write ( f'duration : { duration } \ n') logger. debug ( f " wrote to score _ filename = { score _ filename } with " f " scor...
[ -0.020771339535713196, -0.9074758291244507, 0.7271391153335571, 0.34230172634124756, 1.4560343027114868, 0.4752452075481415, 0.05634571984410286, 0.6167489886283875, -0.2935572564601898, 1.2405542135238647, -0.6189605593681335, 0.6772567629814148, 0.019245922565460205, -0.3012838363647461,...
def write _ scores _ to _ file ( neg, pos, filename ) : os. makedirs ( os. path. dirname ( filename ), exist _ ok = true ) with open ( filename, " wt " ) as f : for i in pos : text = ( " 1 % f \ n " % i if numpy. random. normal ( 0, 1 ) > 0. 01 else " 1 nan \ n " ) f. write ( text ) for i in neg : text = ( " - 1 % f \ ...
[ -0.8715319037437439, -0.5599267482757568, 0.575102686882019, 0.16212859749794006, 0.7345077395439148, 1.4616843461990356, 0.27595239877700806, 0.36765509843826294, -0.3843969404697418, 0.741998016834259, -0.23531503975391388, -0.38018256425857544, 0.12473257631063461, 0.33835846185684204, ...
def terminate ( self ) : self. send _ signal ( signal. sigterm )
[ 0.20524652302265167, 0.2906985282897949, 0.4281005263328552, 0.7834730744361877, 1.1303397417068481, 0.21443527936935425, -0.7800717353820801, -0.07401349395513535, -0.4968910217285156, -0.3255612850189209, -0.9402241110801697, -0.5527008175849915, -0.6642363667488098, 0.13626238703727722,...
def binarize _ y ( self, params, save _ path = none, ensure _ balanced = false ) : labb = labelbinarizer ( params ) self. x, self. y = labb. fit ( ). transform ( self. x, self. y ) if labb. idx _ is not none : self. _ update _ common _ subjects ( labb. idx _ ) if ensure _ balanced : self. _ undersample _ majority ( ) i...
[ -0.49014368653297424, -0.7852003574371338, 0.661225438117981, 0.6501402854919434, 1.1233079433441162, 0.27074021100997925, 0.5335270762443542, -0.5175172686576843, -0.633590579032898, 0.06101389601826668, -0.5945234298706055, -0.40686216950416565, -0.36070433259010315, 0.3166326880455017, ...
def team _ 12 _ adv ( ) : # def choosing ( choice ) : # def dead ( ) : # quit ( ) print ( " you walk into a room and see a glass of milk sitting on a table. do you drink it? ) " ) choice1 = input ( " [ yes / no ] " ) choosing ( choice1 ) sleep ( 1 ) print ( " in the dark hall you see a libra scale. you have to set the ...
[ -0.2451346069574356, 0.14907917380332947, 1.0121617317199707, 0.6370794773101807, -0.46610069274902344, 0.7855756282806396, 0.40800657868385315, -0.6849619746208191, -0.14615358412265778, 0.6997138261795044, -0.9404972791671753, 0.7808459401130676, -0.16477183997631073, 0.22662541270256042...
def get _ created _ time ( self ) : return self. _ _ created _ time
[ 0.5299991369247437, -0.3903716802597046, 0.3993384540081024, 0.2230941504240036, 1.6410847902297974, 0.7998982667922974, -0.17264825105667114, -0.164279967546463, -0.39204099774360657, -0.6843407154083252, -0.4271499216556549, 0.07430216670036316, -0.11754488945007324, 0.16534236073493958,...
def test _ write _ directory ( subtests, etcd _ client, prefix ) : with subtests. test ( " we should be able to create a non - existent directory " ) : assert etcd _ client. write _ directory ( " { } / write _ dir / dir1 ". format ( prefix ), none ) assert etcd _ client. get ( " { } / write _ dir / dir1 ". format ( pre...
[ -0.8078579902648926, -0.03369636461138725, 0.4268801510334015, -0.6773043870925903, 1.0950074195861816, 0.15573064982891083, 0.1446504443883896, 0.36320462822914124, 0.02500648982822895, -0.06837937980890274, 0.1648710072040558, 0.34257426857948303, 0.34551939368247986, -0.2131474316120147...
def send _ request ( request ) : sock = socket. socket ( socket. af _ inet, socket. sock _ dgram ) sock. sendto ( bytes ( request,'utf - 8'), addr ) reply, _ = sock. recvfrom ( 1024 ) return json. loads ( reply )
[ -1.6003916263580322, 0.9157530665397644, 0.7606937885284424, -0.8174663186073303, -0.7710788249969482, -1.130345344543457, -0.9826893210411072, -1.3770833015441895, 0.4677681028842926, 0.4187178909778595, -0.13789354264736176, 0.717036247253418, -0.26900410652160645, -0.580228328704834, ...
def test _ successful _ update ( self ) : response = self. client. post ( self. url, { } ) self. assertredirects ( response, reverse ('tasks : home'), status _ code = 302, target _ status _ code = 200 ) self. task. refresh _ from _ db ( ) self. profile2. refresh _ from _ db ( ) self. assertequal ( self. task. status, t...
[ 0.5553402304649353, 0.22291387617588043, 0.629135012626648, 1.1418431997299194, 0.0014991677599027753, 1.4852510690689087, 0.22072891891002655, 0.3979850709438324, -0.14572353661060333, -0.06645543873310089, -0.9856659173965454, -0.1764664202928543, 0.5673896074295044, 0.10907544195652008,...
def reset _ to _ device ( self ) : self. send _ device _ mitm ( managementreset ( ) )
[ -0.5124836564064026, 0.6771078705787659, 0.05289413407444954, 0.9229392409324646, 1.1766809225082397, -0.3836906850337982, 0.8614251017570496, -0.9619429111480713, -0.13177761435508728, -0.18654948472976685, -0.012269493192434311, 1.8540797233581543, -0.10295629501342773, -0.47349646687507...
def acl6totmisses ( self ) : try : return self. _ acl6totmisses except exception as e : raise e
[ 0.4108770489692688, 0.0756983757019043, 0.17706839740276337, -0.5887556076049805, 0.4635734558105469, -1.0287936925888062, 0.3055271506309509, -0.7405675649642944, 0.7462999820709229, 0.6758838891983032, -0.5236692428588867, -1.242975115776062, 0.17662620544433594, -0.48255228996276855, ...
def get _ responsecode ( self ) : return self. _ output. get ('responsecode ', none )
[ 1.2292975187301636, -0.8017759323120117, 0.35739484429359436, 0.587668240070343, -0.4881168305873871, -0.9525429606437683, 1.3066136837005615, -0.23280006647109985, 0.19490905106067657, -1.181197166442871, 0.695793092250824, 0.027292465791106224, -0.1385466307401657, -0.43073001503944397, ...
def contactable _ fields ( agency, office _ dict ) : agency. phone = office _ dict. get ('phone') agency. emails = office _ dict. get ('emails ', [ ] ) agency. fax = office _ dict. get ('fax') agency. office _ url = office _ dict. get ('website') agency. request _ form _ url = office _ dict. get ('request _ form') serv...
[ -0.6474941372871399, -0.5050538778305054, 0.6277177929878235, -0.7758609056472778, -0.8291530609130859, 0.08269267529249191, -0.6671562194824219, 0.4470711350440979, 0.1479366272687912, 0.80878746509552, -0.5258654952049255, -0.3617428243160248, 0.11139683425426483, -0.06706686317920685, ...
def extra _ state _ attributes ( self ) : return self. _ attrs
[ -0.9464250206947327, -0.38386356830596924, 0.4057950973510742, -0.3343028426170349, -1.2223007678985596, 0.3764427900314331, -0.0731927752494812, 0.4576786160469055, 0.6294298768043518, -0.3139447569847107, -0.7961755990982056, -0.294874370098114, -0.24440467357635498, -0.01095053739845752...
def get _ metric _ lines ( output _ lines ) : return [ l for l in output _ lines if is _ metric _ line ( l ) ]
[ 0.7770786285400391, -0.3502795100212097, 0.2155766636133194, 1.8656364679336548, -0.28588560223579407, 0.8066361546516418, -0.49106720089912415, -0.4259520471096039, -0.7771409749984741, 0.6426733732223511, 1.110308289527893, 0.08871199935674667, 0.24387450516223907, 0.2833464741706848, ...
def search ( search _ terms, corpus = corpus ) : # instantiate tf / idf vectorizer, provided by sklearn vectorizer = tfidfvectorizer ( min _ df = 1, analyzer = lemmatize ) # get the features and tf / idf scores from the corpus and the search terms features = vectorizer. fit _ transform ( [ search _ terms ] + corpus ) s...
[ 0.2913219630718231, -0.6113063097000122, 0.6148064732551575, 0.3529723584651947, 1.2537949085235596, -0.46961092948913574, -0.3097741901874542, 0.03766096383333206, -0.6659491658210754, 0.590362012386322, 0.18979008495807648, -0.17519105970859528, -0.675807774066925, 0.13188329339027405, ...
def require _ cuda ( func ) : @ functools. wraps ( func ) def wrapped ( * args, * * kwargs ) : if liteglobal. get _ device _ count ( litedevicetype. lite _ cuda ) : return func ( * args, * * kwargs ) return wrapped
[ -0.2719458043575287, -0.044581007212400436, 0.8292357921600342, -0.004067144822329283, -0.27317896485328674, 0.09979849308729172, 0.08193057775497437, -0.30336475372314453, 0.30501431226730347, 0.8284253478050232, 0.8407078981399536, 0.2598646581172943, 0.30998772382736206, 0.9351288676261...
def clear _ gateway ( self ) : self. gateway = none if self. _ gemeente is not none : self. _ gemeente. clear _ gateway ( )
[ 0.2630910277366638, -0.1632586270570755, 0.4399772882461548, -0.029546042904257774, -0.6112127900123596, -0.24237105250358582, -0.3795604705810547, -0.6814151406288147, -0.4538399279117584, 0.750765323638916, 0.1706228405237198, 1.2344799041748047, -0.9410513639450073, 1.2313008308410645, ...
def parse _ item ( self, section, key, method, parser = none ) : fn = getattr ( section, method ) value = fn ( key, none ) if value is none : value = self. defaults [ key ] elif parser is not none : value = parser ( value ) return ( key, value )
[ -0.641770601272583, -0.37677550315856934, 0.4963894784450531, 0.3246818482875824, 0.17558668553829193, -0.9598134160041809, -1.1252750158309937, -0.005968828219920397, -0.7551336884498596, 0.513465166091919, 0.20205095410346985, -0.5198904275894165, 0.3259614408016205, 0.4920613467693329, ...
def following _ count ( self ) : return self. _ following _ count
[ 0.3882460296154022, 0.2627864480018616, 0.4424426257610321, 0.6184644103050232, -0.6726179122924805, 1.7800732851028442, 0.7235603332519531, -0.35502955317497253, -0.17546769976615906, -0.9606541991233826, -0.8548941016197205, 0.06765127182006836, 0.07798103988170624, 0.38961461186408997, ...
def fit ( model, data _ bunch, callbacks, return _ best _ model = false, * * kwargs ) : train _ x = data _ bunch. train. features. underlying train _ y = data _ bunch. train. targets. underlying valid _ x = data _ bunch. valid. features. underlying valid _ y = data _ bunch. valid. targets. underlying try : model. fit (...
[ 0.6197469234466553, 0.16044171154499054, 0.5538328886032104, 1.20624840259552, 0.11978598684072495, 0.8798272013664246, -0.5490773916244507, -0.010418770834803581, -0.3142002522945404, -0.50050288438797, 0.049572207033634186, -0.4836612045764923, -0.878129780292511, 0.15850985050201416, ...
def _ _ init _ _ ( self, output = true ) : n _ out = 1 if output else 0 self. _ output = output super ( ). _ _ init _ _ ( name ='_ rememberinreverse ', n _ out = n _ out )
[ -0.08870351314544678, 0.7812551856040955, 0.522545576095581, 0.5576441287994385, -0.2596483528614044, -0.7914819121360779, 1.0209351778030396, 0.8196480870246887, -0.4736468493938446, -0.1007068008184433, -0.5788772106170654, 0.1565682739019394, -0.7960241436958313, 0.6609588861465454, 0...