text
stringlengths
25
2.19k
embedding
listlengths
768
768
def test _ shop _ defaults ( self ) : shop = shop. objects. get ( pk = 1 ) self. assertequal ( shop. name, " lfs " ) self. assertequal ( shop. shop _ owner, " john doe " ) self. assertequal ( shop. product _ cols, 3 ) self. assertequal ( shop. product _ rows, 3 ) self. assertequal ( shop. category _ cols, 3 ) self. ass...
[ -0.7856171131134033, 0.7523093819618225, 0.18419857323169708, 0.6488966345787048, 0.51096510887146, 0.9159812927246094, 0.06923739612102509, -0.6683445572853088, 0.31441983580589294, -0.2662999927997589, -0.8850384950637817, -0.11857343465089798, 0.6105077862739563, -0.05283463001251221, ...
def provider _ tenant _ name ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " provider _ tenant _ name " )
[ -0.12901848554611206, -0.22055239975452423, 0.22294257581233978, 0.03080550581216812, -0.7407673001289368, 1.2831073999404907, 0.3235899806022644, 0.3273541331291199, 0.6445306539535522, 0.9536629915237427, 0.27431848645210266, 0.9841374754905701, 0.425519734621048, -1.498712420463562, -...
def getaction ( self, gamestate ) : " * * * your code here * * * " def pacman _ move ( state, depth ) : if state. iswin ( ) or state. islose ( ) : # if the game is over we won't need to check the state return state. getscore ( ) # we can just return the score for that state it is our terminal node pac _ actions = state...
[ -0.3631601333618164, -0.42954903841018677, 0.7872680425643921, 0.20485155284404755, 0.624735951423645, -0.7666112780570984, 0.35997703671455383, -0.33037954568862915, -0.06895826756954193, -0.055930379778146744, 0.4089350700378418, 0.7397578358650208, -0.13648025691509247, 0.17816174030303...
def build _ volume _ list ( self ) : self. volumes = set ( ) volumes _ dict = self. api. query ( ). volumes ( ). get ( ) for volume in volumes _ dict [ " volumes " ] : self. volumes. add ( volume ( self, volume ) )
[ -0.8635479211807251, -0.6419760584831238, 0.20365822315216064, -0.1068410873413086, 1.589780330657959, -0.32951876521110535, -1.7630892992019653, 0.3254126012325287, 0.15698345005512238, -0.16664668917655945, -0.05644699186086655, -0.37030020356178284, 0.6356379985809326, -0.11380057036876...
def _ register _ event _ listener ( self, url ) : if self. _ rsn _ oms is none : raise platformconnectionexception ( " cannot _ register _ event _ listener : _ rsn _ oms object required ( created via connect ( ) call ) " ) try : already _ registered = self. _ rsn _ oms. event. get _ registered _ event _ listeners ( ) e...
[ -0.6626520752906799, 0.06839121133089066, 0.6555889844894409, -0.1582150012254715, 0.613553524017334, -0.6244944930076599, -0.24401845037937164, -0.2533586025238037, 0.06505658477544785, 0.045132920145988464, -0.7932579517364502, -0.16233140230178833, -0.08871341496706009, 0.66238719224929...
def save _ data _ to _ dat ( file, data ) : # add. dat extension if needed if ( len ( file ) < 4 or file [ - 4 : ]! = ". dat " ) : file = file + ". dat " print _ log ('started saving data to " { file } ". '. format ( file = file ) ) file _ object = open ( file, mode ='wb') data. tofile ( file _ object ) file _ object. ...
[ -0.08323247730731964, -0.21887439489364624, 0.46395695209503174, -0.21576644480228424, 0.5611876249313354, 1.3085243701934814, -0.1880989670753479, -0.35775819420814514, -1.1273503303527832, -0.02128021977841854, -0.7638357281684875, 0.23296941816806793, 0.36964935064315796, 0.179899170994...
def _ _ selecciones ( self, treeselection, model, path, is _ selected, listore ) : iter = self. get _ model ( ). get _ iter ( path ) fuente = self. get _ model ( ). get _ value ( iter, 1 ) if self. fuente! = fuente : self. fuente = fuente self. scroll _ to _ cell ( path ) self. emit ('nueva - seleccion ', self. fuente ...
[ -1.0940492153167725, 0.42338675260543823, 0.3737453818321228, 0.9812763929367065, 0.22427736222743988, -0.9748498201370239, -0.247577503323555, -0.6331000328063965, -0.3889296352863312, 0.17522068321704865, -0.8640108704566956, 0.047281403094530106, -0.214889794588089, -0.02837947010993957...
def str2bool ( v ) : if isinstance ( v, bool ) : return v if v. lower ( ) in ('yes ','true ','t ','y ','1') : return true elif v. lower ( ) in ('no ','false ','f ','n ','0') : return false else : raise argparse. argumenttypeerror ('boolean value expected.')
[ -0.33909711241722107, -0.4639650583267212, 0.6714240908622742, -0.010094072669744492, -0.000269880925770849, 1.0415898561477661, -0.17557090520858765, 0.3188408613204956, -0.8777880072593689, 0.427557110786438, 0.03829367086291313, 0.6562156081199646, -0.26081737875938416, -0.0943791046738...
def generate _ cnn _ model ( n _ classes, n _ words ) : def cnn _ model ( features, target ) : # convert indexes of words into embeddings. # this creates embeddings matrix of [ n _ words, embedding _ size ] and then # maps word indexes of the sequence into [ batch _ size, sequence _ length, # embedding _ size ]. target...
[ -0.34200865030288696, -0.12798087298870087, 0.7615340948104858, 0.6374287009239197, -0.536698579788208, -0.10568488389253616, 0.3898571729660034, 0.25881335139274597, -0.14733755588531494, 0.8756229281425476, -0.32216671109199524, 1.1325491666793823, 0.6691319942474365, 0.3161922097206116,...
def update ( self, checkpoint ) : assert isinstance ( checkpoint, entities. checkpoint ) # payload payload = checkpoint. to _ json ( ) # request success, response = self. _ client _ api. gen _ request ( req _ type ='patch ', path ='/ checkpoints / { } '. format ( checkpoint. id ), json _ req = payload ) # exception han...
[ -0.735784649848938, -0.39898017048835754, 0.4102148711681366, 0.3239571154117584, -0.011292452923953533, 0.9539149403572083, -0.05766559764742851, -0.11666971445083618, 0.009427959099411964, 0.18978682160377502, 0.09653352200984955, -0.22554586827754974, -0.7959448099136353, -0.48420602083...
def test _ adderrback ( self ) : failure = synchronousfailure ( runtimeerror ( ) ) sd = synchronousdeferred ( failure ) l = [ ] self. assertequals ( sd. adderrback ( l. append ), sd ) self. assertequals ( l, [ failure ] )
[ 0.5122839212417603, 1.1726890802383423, 0.7916069626808167, 0.805105447769165, 1.1187645196914673, 0.2220177948474884, -0.7252197265625, 0.6189413666725159, 0.12629103660583496, -1.5681803226470947, -0.7472082376480103, 0.36086389422416687, -0.5165714025497437, 1.1560144424438477, 0.7279...
def det _ factory ( name, fs, path, shutter = none, * * kwargs ) : cycle = build _ image _ cycle ( path ) gen = cycle ( ) def nexter ( ) : return next ( gen ) ['pe1 _ image'] if shutter : stream _ piece = next ( gen ) sample _ img = stream _ piece ['pe1 _ image'] gen = chain ( ( i for i in [ stream _ piece ] ), gen ) #...
[ -0.03045341931283474, 0.3897075951099396, 0.5068352818489075, 0.3803241550922394, -0.9648467302322388, 0.11461029201745987, 0.43890616297721863, 0.006112079601734877, 0.05384490266442299, 0.12300338596105576, -0.2483978569507599, 0.13015995919704437, 0.27650636434555054, -0.023589247837662...
def getparallelwriterforpath ( datapath ) : return getbyscheme ( datapath, schemas _ to _ parallelwriters, localfsparallelwriter )
[ 0.5600414872169495, -0.13096082210540771, 0.07944704592227936, -0.5833224058151245, -0.357226699590683, -0.9679405093193054, 0.48178502917289734, 0.646971583366394, 0.7354863286018372, -0.16190941631793976, 0.33134031295776367, -0.2783801853656769, -0.4412948787212372, -0.3192920386791229,...
def _ check _ multi _ rbl ( self, msg, rbl _ server, mask = none ) : if self. ctxt. skip _ rbl _ checks : return false if mask is not none : try : mask = int ( mask ) except ( valueerror, typeerror ) : try : mask = int ( ipaddress. ip _ address ( str ( mask ) ) ) except valueerror as e : self. ctxt. err ( " invalid mas...
[ -0.5869643688201904, 0.24305975437164307, 0.8596439361572266, 0.4666207432746887, 0.695146918296814, -0.053326234221458435, 0.3116472065448761, -0.40303656458854675, -0.18667687475681305, 0.11760472506284714, 0.2278141975402832, -0.046373069286346436, -1.5476266145706177, 0.740417897701263...
def _ _ operate ( self, consumer ) : # for msg in consumer : # # { action : { mc. field _ server _ full _ name : server _ name, mc. field _ sid : sid, mc. field _ user _ name : user _ name } } # for action, info in msg. value : # if action in switcher : # mu. log _ info ( self. _ _ logger, " trying to perform action : ...
[ -1.398247480392456, -0.7348774075508118, 0.9169954061508179, 0.5151270627975464, 0.5294391512870789, -0.12526683509349823, 0.7266395092010498, -0.8020465970039368, -0.5513178706169128, 0.44131630659103394, 0.539544403553009, -0.27721768617630005, -0.3860267698764801, 0.9853582978248596, ...
def dropevent ( self, event ) : mimedata = event. mimedata ( ) oldid = int ( mimedata. data ( " tabbar - id " ) ) fromindex = int ( mimedata. data ( " source - index " ) ) toindex = self. tabat ( event. pos ( ) ) if oldid! = id ( self ) : parentid = int ( mimedata. data ( " tabwidget - id " ) ) if event. proposedaction...
[ -0.8251319527626038, -0.5713708400726318, 0.8114925026893616, 0.25546392798423767, -0.5550358891487122, 0.5725917220115662, 0.06203935295343399, -0.5741246938705444, 0.010628188960254192, 0.23484815657138824, -0.12049825489521027, 0.17728114128112793, 0.3489310145378113, 0.1838690489530563...
def topods _ solid ( * args ) : return _ topods. topods _ solid ( * args )
[ -0.630814790725708, 0.2814291715621948, 0.20481941103935242, -0.11062277108430862, -0.42602765560150146, 0.26565608382225037, 0.48823127150535583, -1.5343923568725586, 0.04091215133666992, -0.3110751211643219, 0.10228723287582397, -0.9147316813468933, -0.7153846025466919, 0.216941565275192...
def handle _ set ( hass : homeassistant, gateway _ id : gatewayid, msg : message ) - > none : validated = validate _ set _ msg ( gateway _ id, msg ) _ handle _ child _ update ( hass, gateway _ id, validated )
[ 0.9040300846099854, 0.09390777349472046, 0.22555720806121826, -0.26633232831954956, 0.13436083495616913, -0.7467516660690308, -0.3216050863265991, -0.529779314994812, 0.1784295290708542, 0.12572365999221802, -0.3419901728630066, 0.4441384971141815, 0.007097203284502029, 0.8638597130775452,...
def logging _ level ( self ) - > optional [ str ] : return pulumi. get ( self, " logging _ level " )
[ 0.3023911416530609, 0.6115566492080688, 0.4430834949016571, 0.6986885666847229, 1.1465762853622437, 1.2611985206604004, -0.369000643491745, -0.07757356017827988, 0.5479021668434143, -0.2747810482978821, -0.2673887014389038, 0.20359697937965393, 0.21464206278324127, -1.2495639324188232, -...
def number _ vs _ distance ( h, generator, survey, d _ max, n = 30, average = true, * * kwargs ) : categories = ['all ','eec ','hot ','warm ','cold'] n _ pl = { key : np. zeros ( ( len ( d _ max ), n ), dtype = int ) for key in categories } for j in util. bar ( range ( n ) ) : for i, d in enumerate ( d _ max ) : sample...
[ -0.9196515679359436, 0.7164222002029419, 0.6779292821884155, -0.06880945712327957, -0.28745242953300476, 0.3907397985458374, 0.2530130445957184, 0.16379503905773163, -0.7109390497207642, 0.2769622504711151, -0.9286884665489197, 0.11214583367109299, 1.0911545753479004, 1.0401051044464111, ...
def test _ mutiple _ error ( self ) : with self. assertraises ( notimplementederror ) as manager : band = self. band band. insert ( band ( ) ). on _ conflict ( action = " do nothing " ). on _ conflict ( action = " do update ", ). run _ sync ( ) assert manager. exception. _ _ str _ _ ( ) = = ( " postgres and cockroach o...
[ 0.026576263830065727, 0.7134870886802673, 0.4828307628631592, 0.35966408252716064, 0.6581276059150696, 0.7724660038948059, -0.151664599776268, -0.28850018978118896, 0.05008647218346596, 0.8530025482177734, -0.7999923825263977, -0.22968818247318268, -0.8654319047927856, 0.4125795066356659, ...
def is _ valid _ label ( self ) : if self. datatype = = " label " : pattern = re. compile ( r " ^ [ a - za - z _ $ & % *!? \ - ] [ a - za - z0 - 9 _ $ & % *!? \ - ] * $ " ) result = re. match ( pattern, self. value ) if result! = none : return true return false
[ -0.5386418700218201, -0.5533138513565063, 0.7872516512870789, 0.042337898164987564, -0.48700448870658875, 1.3188118934631348, -0.8911325335502625, 0.5232654809951782, 0.4007807970046997, -0.05314897373318672, 0.04262636974453926, 0.33860084414482117, -0.7212393283843994, -0.021570170298218...
def listen ( self, events : union [ str, list ], listener : union [ str, callable ] = none, *, priority : int = 50 ) - > none : def handle ( events, listener ) : if type ( events )! = list : events = [ events ] # expand all wildcards for event in events : # get the string name of this event if type ( event )! = str : e...
[ -0.41865259408950806, -0.06264893710613251, 0.8243511319160461, -0.4978026747703552, -0.21557986736297607, -0.39648163318634033, -0.5494636297225952, 1.05846107006073, 1.1607025861740112, -0.581608772277832, -0.04485103487968445, 0.3262806236743927, 0.14083240926265717, 0.4887934625148773,...
async def listen _ for _ all _ credentials ( self, callback _ function = none, timeout = none ) : url = " { } { } : { } / ws / credentials / current _ operation ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port ) if callback _ function : task = await self. stream _ output ( url, callback _ function, ti...
[ 0.07640954107046127, 0.010214216075837612, 0.6629360914230347, 0.3267722427845001, -0.6759870648384094, -0.4476111829280853, 0.31876176595687866, 0.5397538542747498, 0.029729895293712616, 0.09370071440935135, 0.24335402250289917, 1.0341248512268066, -0.15028958022594452, 0.7810497283935547...
def allcachesfoundbyuser ( self, username ) : entries = self. alllogbookentriesbyuser ( username ) caches = [ ] for e in entries : caches. append ( e. cache ) return caches
[ -0.37039169669151306, -0.1735115647315979, 0.4130645990371704, 1.8322432041168213, -0.4992862343788147, 0.6748677492141724, 0.03972078114748001, 0.13420255482196808, 0.12867878377437592, -0.0010214211652055383, -0.4725590944290161, -0.04089087247848511, -0.1449722945690155, 0.7329398989677...
def vote _ comment ( ) : comment _ id = int ( request. form ['comment _ id'] ) user _ id = g. user. id if not comment _ id : abort ( 404 ) comment = comment. query. get _ or _ 404 ( int ( comment _ id ) ) comment. vote ( user _ id = user _ id ) return jsonify ( new _ votes = comment. get _ votes ( ) )
[ 0.09519796073436737, -0.8403290510177612, 0.47796133160591125, 0.36112040281295776, 1.397742509841919, -0.41304072737693787, -0.09211966395378113, -0.4967222511768341, -0.2995935082435608, 0.9256657958030701, -0.31554675102233887, -0.002813484286889434, 0.20854493975639343, -0.145300507545...
def test _ multiple _ do _ update ( self ) : band = self. band new _ popularity = self. band. popularity + 1000 # conflicting with name - should update. band. insert ( band ( name = " pythonistas ", popularity = new _ popularity ) ). on _ conflict ( action = " do nothing ", target = band. id ). on _ conflict ( action =...
[ -0.9199585914611816, 0.4902537763118744, 0.6785115599632263, 0.8953021168708801, 0.9167832732200623, 0.4803881347179413, -0.6207877397537231, -0.5966443419456482, 0.44949859380722046, 0.17935068905353546, -1.600032091140747, 0.038363002240657806, 0.017915232107043266, -0.2556554973125458, ...
def get _ raw _ feature _ importances ( self, raw _ to _ output _ maps ) : if self. is _ local _ sparse : return _ get _ raw _ feature _ importances ( self. local _ importance _ values, raw _ to _ output _ maps ). tolist ( ) else : return _ get _ raw _ feature _ importances ( self. _ local _ importance _ values, raw _ ...
[ -1.4128109216690063, -0.6724240779876709, 0.49785998463630676, 0.5045202374458313, 0.15198734402656555, -0.30248990654945374, -0.21193188428878784, 0.3115438222885132, -0.2877565622329712, -0.14769989252090454, -0.2422311156988144, 0.08174298703670502, 0.4144675135612488, -0.01597180217504...
def _ update _ job ( job _ id, job _ dict ) : # avoid sqlalchemy " unicode type received non - unicode bind param value " # warnings. if job _ id : job _ id = unicode ( job _ id ) if " error " in job _ dict : job _ dict [ " error " ] = _ validate _ error ( job _ dict [ " error " ] ) job _ dict [ " error " ] = json. dum...
[ -0.5226526856422424, -0.68609619140625, 0.35195624828338623, -0.3649894595146179, -0.9541568756103516, -0.04607289284467697, -1.1077498197555542, 0.48031362891197205, -0.7796769142150879, 0.6153711676597595, -0.04353538155555725, 0.15875039994716644, 0.3354493975639343, 0.26862192153930664...
def energy _ functional ( den, vh, en ) : print ( " [ info ] building new total energy : " ) # evaluate and integrate functions on a dense grid r = np. linspace ( tmin, tmax, nsteps _ dense ) # compare with eq. ( 1 ) from assignment sheet e _ h = 0. 5 * trapz ( vh ( r ) * den ( r ), r ) e _ tot = z * en - e _ h print (...
[ 0.44576674699783325, -0.4956437647342682, 0.4210662245750427, -0.28541263937950134, -0.6050158739089966, -0.5612959265708923, 0.00756846135482192, 0.8195810914039612, -0.8047590851783752, 0.9437935948371887, 0.04758315905928612, 0.19073636829853058, -0.22231969237327576, -0.051816072314977...
def available ( self ) : return true
[ -0.3902510702610016, -0.4793582558631897, 0.4060159921646118, 0.9270334243774414, -0.34119683504104614, 1.923196792602539, -0.010375415906310081, 1.2523231506347656, 0.18045666813850403, 0.2960125207901001, -0.17394769191741943, -0.10962933301925659, -0.658210039138794, 0.3701239228248596,...
def timeplot ( self, axial, lat, xlabel ='time ( ms ) ', ylabel ='displacement ( \ mum ) ', title = none, show = true ) : import matplotlib. pyplot as plt import numpy as np fig, axes = plt. subplots ( ) axind = np. min ( np. where ( self. axial > = axial ) ) latind = np. min ( np. where ( self. lat > = lat ) )
[ 1.164201021194458, 0.13124911487102509, 0.5736078023910522, -0.6165516972541809, -0.8409518003463745, 1.0229661464691162, -0.333758145570755, -0.015836305916309357, -0.2255629450082779, 0.3785148859024048, 0.5275708436965942, 0.6401652097702026, -0.08048667758703232, 0.07238715887069702, ...
def letter _ perm ( lex, couple ) : plug = [ ] for cara in lex : if cara = = couple [ 0 ] : plug. append ( couple [ 1 ] ) elif cara = = couple [ 1 ] : plug. append ( couple [ 0 ] ) else : plug. append ( cara ) return plug
[ -0.3958258628845215, -0.4735089838504791, 0.6040787696838379, 0.33384785056114197, -0.6145853996276855, -0.2897033989429474, -1.0424902439117432, 0.40619009733200073, 0.18110188841819763, 1.2903735637664795, -0.21124695241451263, 0.4958611726760864, -0.8478567004203796, -0.3956166803836822...
def printmatrix ( m ) : for i in range ( len ( m ) ) : print'| ', for j in range ( len ( m [ i ] ) ) : if ( j = = len ( m ) ) : print'| ', print'{ 0 : 13. 6f } '. format ( m [ i ] [ j ] ), else : print'{ 0 : 13. 6f } '. format ( m [ i ] [ j ] ), print'|'print
[ 0.6055865287780762, -0.4972768723964691, 0.74083411693573, 0.2199310064315796, -0.2828367352485657, 0.5872421860694885, 0.08786741644144058, 0.05245126411318779, -0.21337920427322388, 0.7000867128372192, 0.9271166920661926, 0.040887124836444855, -0.5611482262611389, 0.7717687487602234, -...
def tag _ similar _ posts ( user, post, tag, action ) : for p in more _ like _ post ( post, tag ) : if p. id = = post. id \ or action = ='add'and tag in p. accepted _ smart _ tags \ or action = ='remove'and tag not in p. accepted _ smart _ tags : continue p. _ handle _ tag _ assignment ( user, [ tag ], action, tag _ si...
[ 0.5344798564910889, 0.23348231613636017, 0.49425122141838074, 0.8799538016319275, -0.6382468342781067, 0.5197585225105286, 0.10616573691368103, -0.06670704483985901, 0.08697109669446945, 0.32278183102607727, -0.9715709090232849, 0.5983579158782959, 0.16077034175395966, 1.094562292098999, ...
def deal _ with _ user ( ) : selected _ a = false selected _ b = false selected _ c = false images _ a, images _ b, images _ c = [ ], [ ], [ ] z _ a, z _ b, z _ c = [ ], [ ], [ ] while true : if selected _ a and selected _ b and selected _ c : # the user has selected all the three images, now can break the interactive ...
[ 0.046605248004198074, 0.14640159904956818, 0.8370800018310547, 0.16551926732063293, 0.9604969620704651, 0.49350130558013916, 1.1291288137435913, -0.7944352626800537, 0.1644602119922638, -0.42638036608695984, -0.6638330817222595, -0.5334519743919373, -0.6188424825668335, 0.09660810232162476...
def _ postonfence ( self, post ) : point = post. point for fence in self. _ fences : if fence. isremoval! = post. isremoval : continue if diagramdata. _ pointsclose ( point, ( fence. x, fence. y ) ) : continue if diagramdata. _ pointsclose ( point, ( fence. x2, fence. y2 ) ) : continue if self. _ pointonfence _ ( point...
[ 0.6369485855102539, -0.4689213037490845, 0.7116072177886963, 0.09304579347372055, 0.04008454084396362, 0.3297191560268402, -0.40031519532203674, -0.5453002452850342, -0.228664368391037, 0.5762749314308167, -0.8112284541130066, -0.42361411452293396, -0.3657762110233307, 0.4260939061641693, ...
def generaterandomstring ( self, length = 20 ) : character _ set = string. digits + string. letters + string. punctuation return''. join ( random. choice ( character _ set ) for c in range ( length ) )
[ -0.10933183878660202, -0.33627447485923767, 0.3200992941856384, -1.5958036184310913, -0.48403191566467285, 0.48693031072616577, -0.685592770576477, 0.2771589756011963, 0.5410588383674622, -0.16492149233818054, -0.5050680637359619, 0.2868945002555847, -0.6540194749832153, -0.629837274551391...
def esc ( arg ) : buf ='' for i in arg : if ( i = ='\ \') : buf + ='\ \ \ \'elif ( i = ='\ n') : buf + ='< br / >'elif ( i = ='"') : buf + ='\ \ "'elif ( i = ='' ) : buf + ='& nbsp ;'elif ( i = ='>') : buf + ='& gt ;'elif ( i = ='<') : buf + ='& lt ;'else : buf + = i return buf
[ 0.2926490902900696, -0.28330177068710327, 0.8893817663192749, -0.3682694733142853, -0.8871061205863953, 0.05133504793047905, -0.6224735975265503, -0.10319530218839645, -0.04334567114710808, 0.2030414193868637, -0.07712901383638382, 0.5779098272323608, 0.42723333835601807, 0.987256288528442...
async def test _ discovery _ device _ remove _ relay _ as _ light ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, setup _ tasmota ) - > none : config = copy. deepcopy ( default _ config ) config [ " rl " ] [ 0 ] = 1 config [ " so " ] [ " 30 " ] = 1 # enforce home assistant auto - discovery as light unique _ id ...
[ 0.6892382502555847, 0.6171212792396545, 0.2727786600589752, 0.37753117084503174, 0.29628798365592957, 0.25475597381591797, 1.195385456085205, 0.7917816042900085, 0.9436551332473755, -0.8182694911956787, -0.5942245125770569, 0.04143596440553665, 0.26830825209617615, 0.876318633556366, 0.4...
def get _ ret ( self ) : return self. ret
[ -0.1549663543701172, -0.6261274218559265, 0.5789734721183777, 0.3192191421985626, 0.3424229621887207, 0.22644975781440735, 0.46793386340141296, -0.37806907296180725, -0.46446043252944946, -0.8474429845809937, 0.04173360392451286, 0.82323157787323, -1.346220850944519, -1.6750338077545166, ...
def validate _ argument ( self, name : str, value : str ) - > t. tuple [ str, t. any ] : return name, int ( value )
[ -1.085937738418579, -0.8236838579177856, 0.3882177770137787, -1.4256997108459473, -0.995080828666687, 0.17883102595806122, -0.8438898324966431, -0.6231774091720581, -0.6364092826843262, 0.9304578900337219, -0.0425865463912487, -0.08405668288469315, 0.0494333878159523, 0.34451770782470703, ...
def scrapper ( web _ site ) : req = request. request ( web _ site ) response = request. urlopen ( req ) web _ page = str ( response. read ( ). decode ('utf - 8') ) df _ list = pd. read _ html ( web _ page ) # this parses all the tables in webpages to a list df = df _ list [ 0 ] df ['курс'], df ['изменение'] = df ['курс...
[ -1.3406013250350952, 0.4205811619758606, 0.6864355802536011, 0.18249063193798065, -0.391323447227478, -0.015261976979672909, 0.3033304214477539, 0.7288522720336914, 0.06644228100776672, 0.40371444821357727, -0.16967302560806274, -0.07380279898643494, 0.4825485944747925, 0.5009778738021851,...
def _ transform _ raw _ data ( self, df, x _ col, y _ col, label2indexes = none, sample _ size = none ) : x = [ ] y = [ ] actual _ max _ sentence = 0 if sample _ size is none : sample _ size = len ( df ) for i, row in df. head ( sample _ size ). iterrows ( ) : x _ data = row [ x _ col ] y _ data = row [ y _ col ] sente...
[ -0.4487977623939514, 0.1598423719406128, 0.5994818210601807, -0.3512299656867981, -0.688321590423584, -1.2556779384613037, -0.2355564385652542, 0.22578361630439758, -0.472954124212265, 0.00925342459231615, -0.14770394563674927, 0.2025534212589264, 0.5754626989364624, 0.1064366027712822, ...
def test _ get _ all _ statements ( ) - > none : player _ index = 2 result = villager. get _ all _ statements ( player _ index ) assert result = = ( statement ( " i am a villager. ", ( ( 2, frozenset ( { role. villager } ) ), ) ), )
[ -0.2224714308977127, -0.3984757661819458, 0.22648261487483978, 0.3466174602508545, 0.18536610901355743, -0.7033249735832214, -0.6388480067253113, -0.694414496421814, 0.4344239830970764, -0.03736346587538719, 0.27184316515922546, -0.3961560130119324, -0.8107720017433167, -0.0154562778770923...
def test _ errbackresultchangesnextcallbackargument ( self ) : sd = synchronousdeferred ( synchronousfailure ( runtimeerror ( ) ) ) sd. adderrback ( lambda r : 42 ) l = [ ] sd. addcallback ( l. append ) self. assertequals ( l, [ 42 ] )
[ 0.1760900318622589, 1.049431562423706, 0.4672210216522217, 0.456036776304245, 0.7857703566551208, -0.3198535740375519, 0.1991567760705948, -0.24577267467975616, 0.6614308953285217, -0.7923812866210938, -1.2682960033416748, 0.5873021483421326, -0.2399061769247055, 1.1283354759216309, 0.75...
def slct _ final _ qry ( table _ name ) : conn = none try : params = config ( ) conn = psycopg2. connect ( * * params ) cur = conn. cursor ( ) cur. execute ( sql. sql ( " select * from { } order by time " ). format ( sql. identifier ( table _ name ) ) ) results = cur. fetchall ( ) print ( " the number of parts : ", cur...
[ 0.5899685621261597, 0.4320950508117676, 0.8282106518745422, -0.09062601625919342, -0.25796863436698914, -0.7928279638290405, -0.7194775938987732, -0.42950010299682617, -0.4377170503139496, 0.2945759892463684, 0.5459088087081909, -0.6391698718070984, -0.6864891648292542, 0.8469619750976562,...
def rand _ building _ color ( ) - > tuple [ int, int, int, int ] : choice = randint ( 0, 5 ) if choice = = 0 : # red ( 0xff0000 ) return ( randhighch ( ), randlowch ( ), randlowch ( ), 255 ) elif choice = = 1 : # green ( 0x00ff00 ) return ( randlowch ( ), randhighch ( ), randlowch ( ), 255 ) elif choice = = 2 : # blue ...
[ -0.8828341364860535, -0.09650570899248123, 0.7231115698814392, -0.5167315006256104, -0.1668606996536255, 0.5599350333213806, 0.15739797055721283, -0.5294033288955688, 0.2705446779727936, -0.33713242411613464, -1.0337834358215332, -0.24310711026191711, -0.4051227271556854, 0.448613256216049...
def log ( self, message ) : self. log _ file. write ( " # info - { } \ n ". format ( message ) )
[ 0.5486599206924438, -0.06808342784643173, 0.40280336141586304, -0.05013326555490494, 1.2014714479446411, 1.008203387260437, 0.13757158815860748, 0.44005098938941956, -1.4614853858947754, -0.86642986536026, -0.14132389426231384, 0.06305918097496033, 0.15929953753948212, 1.2003439664840698, ...
def _ load _ file ( filename, fields ) : basename, ext = splitext ( filename ) # kjetil's matlab lr - spline files ( not finished ) if ext = = '. mat': dep _ files = ['{ } - lr { }. lr '. format ( basename, field ) for field in fields ] if not all ( exists ( f ) for f in dep _ files ) : raise filenotfounderror ( ) retu...
[ 0.402113676071167, -0.010147720575332642, 0.37707915902137756, -0.8056216239929199, -0.26117441058158875, 0.3682277202606201, -0.36114585399627686, 0.13905169069766998, -0.6890668272972107, -0.09672202914953232, -0.21331886947155, -0.9443750381469727, -0.1896342784166336, -0.35658168792724...
async def _ subscribe _ to _ occupancy _ groups ( self ) : _ log. debug ( " subscribing to occupancy group status updates " ) try : response, _ = await self. _ subscribe ( " / occupancygroup / status ", self. _ handle _ occupancy _ group _ status ) _ log. debug ( " subscribed to occupancygroup status " ) except bridger...
[ -0.22591640055179596, 0.4291391372680664, 0.23343132436275482, 0.2960647940635681, -0.10518094152212143, -0.5064454078674316, -0.32495108246803284, -0.131300151348114, -0.14417803287506104, -0.1276744306087494, 0.038163527846336365, -0.35991430282592773, -0.2209043800830841, 0.329249054193...
async def create _ operator ( self, operator : operator ) - > mythicresponse : url = " { } { } : { } / api / v { } / operators ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version ) resp = await self. post _ json ( url, data = { " username " : operator. username, " password...
[ -0.9886348843574524, -0.7032091617584229, 0.8816428184509277, 0.1185573935508728, 0.22937709093093872, -0.7438486218452454, 0.09924335777759552, -0.5454107522964478, 0.7730162739753723, 0.3917144238948822, -0.7535508275032043, -0.2933771312236786, -0.7175254821777344, -0.4240874648094177, ...
def teardown ( self ) : if os. path. isdir ( self. test _ dir ) : shutil. rmtree ( self. test _ dir )
[ 0.6614001393318176, -0.15669040381908417, 0.5763139128684998, -0.15272361040115356, 0.8497411012649536, 0.3093136250972748, 1.640691876411438, 0.3380928635597229, 1.3351311683654785, -0.7182884216308594, 0.840985119342804, 0.41633400321006775, -1.2898144721984863, 0.5536903142929077, -0....
def put ( self, key : int, value : int ) - > none : bucket _ to _ map = self. hash _ function ( key ) ; if self. buckets [ bucket _ to _ map ] is none : self. buckets [ bucket _ to _ map ] = linkedlist ( ) self. buckets [ bucket _ to _ map ]. head = node ( ( key, value ) ) else : current _ data = self. buckets [ bucket...
[ -0.5091248154640198, 0.525172233581543, 0.6832786798477173, -0.6760546565055847, -0.2924378514289856, 0.18748094141483307, 0.3825843632221222, -0.39386215806007385, -0.3453007638454437, 0.2077452391386032, -0.6228970289230347, -0.012149819172918797, -0.32879313826560974, -0.315271198749542...
def validate _ amp _ query _ params ( query _ params ) : bool _ params = ['term _ 1 ','term _ 2 ','term _ 3 ','term _ 1 _ next _ year ','summer ','is _ summer _ school ','session _ 1 ','session _ 2 ','lsr ','year _ long ','is _ undergraduate'] for param in bool _ params : if query _ params. get ( param ) : try : strtob...
[ -1.0965635776519775, -1.2500190734863281, 0.6728471517562866, -0.36676013469696045, -0.3157481551170349, 0.7694669961929321, -0.45777350664138794, -0.32752206921577454, -0.460806280374527, 0.7235586643218994, 0.4138754606246948, 0.28330352902412415, -0.38315802812576294, 0.5142403244972229...
def _ _ getitem _ _ ( self, item ) : return self. _ state [ " data " ]. get ( item, none )
[ -0.7571805119514465, -0.25895899534225464, 0.38681209087371826, -0.7194918394088745, -0.04538588225841522, -0.20814242959022522, -0.7637689709663391, -1.2123112678527832, 0.797429621219635, -0.9159112572669983, -0.5330414175987244, 0.5200846195220947, 0.49141502380371094, -1.40534567832946...
def analyticalsolutiongradient ( x, a = 1000, b = 100 ) : tdirect = np. abs ( x ) / a # direct wave tmp = 1 + ( ( b * * 2 * np. abs ( x ) * * 2 ) / ( 2 * a * * 2 ) ) trefrac = np. abs ( b * * - 1 * np. arccosh ( tmp ) ) return np. minimum ( tdirect, trefrac )
[ -0.022369954735040665, -0.5289668440818787, 0.5122496485710144, -0.4009610414505005, -0.2339729368686676, 0.12544205784797668, 0.24666213989257812, -0.665822446346283, -0.007394748739898205, 0.32432833313941956, 0.2746190130710602, 0.07227681577205658, 0.348430871963501, -0.248188525438308...
def nfvipop _ from _ internal ( host ) : pop = { } pop [ " id " ] = host [ " host _ name " ] if " location " in host : pop [ " location " ] = copy. deepcopy ( host [ " location " ] ) else : pop [ " location " ] = { } if " gw _ ip _ address " in host : pop [ " gw _ ip _ address " ] = host [ " gw _ ip _ address " ] # cop...
[ -0.8160539269447327, -0.24910323321819305, 0.7061085104942322, -0.34325119853019714, -1.3879737854003906, -0.17661190032958984, 0.08318781852722168, -0.22008727490901947, -0.4208689332008362, 1.1955467462539673, -0.48144546151161194, -0.12170020490884781, 0.5018138885498047, -0.26125723123...
def _ div ( out, self, other, queue = none ) : assert self. shape = = other. shape return elementwise. get _ divide _ kernel ( self. context, self. dtype, other. dtype, out. dtype )
[ 0.0460803285241127, -0.2743511497974396, 0.6587822437286377, 0.20222873985767365, -0.7677841186523438, -0.8214672207832336, 0.27365294098854065, -0.9589899778366089, 0.07918024063110352, 0.03945978358387947, 0.3190113306045532, 0.5381088256835938, 0.31756794452667236, 0.2170250117778778, ...
def diff _ strings ( a, b ) : d = differ ( ) if a is none and b is none : return'[ both a and b are none ]'out ='' if a is none : out + ='[ a is none ] \ n'elif b is none : out + ='[ a is none ] \ n'a ='' if a is none else a b ='' if b is none else b result = d. compare ( a. splitlines ( keepends = true ), b. splitline...
[ 0.3816368579864502, -1.1593239307403564, 0.9210320711135864, -1.0257822275161743, -0.19921354949474335, -0.8631232976913452, -0.4532090723514557, 0.10940184444189072, 0.34481382369995117, 0.12281441688537598, 0.5383833646774292, 1.625648856163025, -0.24993208050727844, 0.28821709752082825,...
def preprocess _ diffs _ adrar ( diffs : pd. dataframe ) - > dict [ tuple, pd. dataframe ] : def fix _ column _ name ( c1 : str, c2 : str ) - > str : " " " remove unamed : number and number. added by pd. dataframe when reading the pdf " " " if'unnamed :'in c1 : c1 ='' if re. match ( r '. * \. \ d + ', c1 ) : c1 = re. s...
[ -0.11737214773893356, -0.49391523003578186, 0.9431204199790955, -1.3118400573730469, -0.033803146332502365, 0.18221060931682587, 0.38872891664505005, -0.46331587433815, 0.09850949794054031, -0.11827091872692108, -0.05023149400949478, -0.24627424776554108, 1.1176849603652954, 0.113059192895...
def reset ( self ) : self. env = standard _ env ( )
[ 0.13568904995918274, -0.40437108278274536, 0.03601917624473572, 0.8090182542800903, 0.18745768070220947, 0.6830636262893677, 0.8569974303245544, 0.4376337230205536, -1.4819761514663696, -0.09684070199728012, -0.32792067527770996, 1.9114160537719727, -0.44797444343566895, -0.119673423469066...
def mqae ( ae, q = 0. 85, nan _ flag = true ) : if ae. shape [ 0 ] < = 1 : vals = ae else : qi = int ( ae. shape [ 0 ] * q ) qi = qi if qi > 1 else 1 vals = np. partition ( ae, qi, axis = 0 ) [ : qi ] if nan _ flag : return np. nanmean ( vals, axis = 0 ) else : return np. mean ( vals, axis = 0 )
[ -0.6881734728813171, 0.6529792547225952, 0.6155450344085693, -0.765170693397522, -0.7671122550964355, 0.026715947315096855, 0.03561098128557205, -0.022025346755981445, 1.045320749282837, 0.9744356274604797, 0.7278615832328796, 0.19801698625087738, 0.16793450713157654, 0.6962679028511047, ...
def updateviewmatrix ( self ) : # reconstruct the view matrix. self. orientation. normalise ( ) self. view = self. orientation. matrix ( ) # load the axis vectors self. xaxis = vector3 ( self. view [ 0 ], self. view [ 4 ], self. view [ 8 ] ) self. yaxis = vector3 ( self. view [ 1 ], self. view [ 5 ], self. view [ 9 ] )...
[ 0.062002915889024734, -0.8482844829559326, 0.44182196259498596, -0.5488182902336121, -0.7932663559913635, -0.18825078010559082, 0.16441884636878967, 0.3880831003189087, 0.4382334351539612, -0.4671975076198578, 0.5966269373893738, 0.02627648040652275, 0.07981366664171219, -0.522779703140258...
def privs ( self ) : log. debug ( " executing volatility privs plugin on " " { 0 } ". format ( self. memdump ) ) self. _ _ config ( ) results = [ ] command = self. plugins [ " privs " ] ( self. config ) for task in command. calculate ( ) : for value, present, enabled, default in task. get _ token ( ). privileges ( ) : ...
[ -0.4899258017539978, -0.7646199464797974, 0.553771436214447, -0.7425902485847473, 0.4797632098197937, -0.9667981266975403, -1.0385313034057617, 0.43139955401420593, -0.16587546467781067, 0.3623482882976532, -0.6933753490447998, 0.4466460347175598, -0.12585553526878357, 0.44367650151252747,...
def patch ( self ) : self. _ method _ not _ allowed ( )
[ -0.18855753540992737, 0.6190800666809082, 0.16017833352088928, 0.355136901140213, -0.43172287940979004, 0.5907847881317139, 1.2036707401275635, 0.006399761885404587, 0.18859580159187317, -0.47566574811935425, 1.2412009239196777, 0.8745409846305847, -1.1259781122207642, 0.3268488645553589, ...
def number _ of _ trips ( filename ) : with open ( filename,'r') as f _ in : # set up csv reader object reader = csv. dictreader ( f _ in ) # initialize count variables n _ subscribers = 0 n _ customers = 0 # tally up ride types for row in reader : if row ['user _ type'] = ='subscriber': n _ subscribers + = 1 else : n ...
[ 0.3624993860721588, 0.4153633415699005, 0.7085884809494019, -0.6933379769325256, 0.41909629106521606, -0.25956860184669495, 0.31216463446617126, 0.43935054540634155, -1.2717585563659668, 0.5585550665855408, -0.5223687291145325, -0.47642335295677185, 0.5681121349334717, 0.15606363117694855,...
def getopeneditorsforsession ( self ) : editorlists = [ ] for tabwidget in self. tabwidgets : editors = [ ] for index in range ( tabwidget. count ( ) ) : widget = tabwidget. widget ( index ) if isinstance ( widget, editorassembly ) : editor = widget. geteditor ( ) editors. append ( editor ) editorlists. append ( editor...
[ -1.2298922538757324, -1.4259839057922363, 0.24954979121685028, -0.06402406096458435, -0.06726932525634766, -0.024772243574261665, -0.2913557291030884, 0.2066161036491394, 0.7319445610046387, -0.18341784179210663, -0.28856322169303894, -0.21227626502513885, 0.07512197643518448, 0.7463774085...
def store _ image ( img ) : global frame _ num save _ path = image _ folder frame _ name = save _ path + ( " % d. " % frame _ num ) + format mpimg. imsave ( frame _ name, img, format = format ) frame _ num + = 1 return img
[ -0.8485777378082275, -0.058266520500183105, 0.4241141676902771, 0.08292078226804733, -0.5421595573425293, -0.008592946454882622, 0.9176379442214966, 0.020528584718704224, 0.6480470299720764, -0.38717371225357056, -0.17809616029262543, 0.1850527673959732, -0.3523664176464081, 1.304173946380...
def test _ reject _ nonexistent _ user ( self ) : sub _ process. reject _ user ('test3') assert true
[ 0.5870868563652039, 0.30303338170051575, 0.3031076490879059, 1.2136622667312622, 0.07379564642906189, 1.6544766426086426, 0.2864559292793274, 0.2145375907421112, -0.4591682553291321, -0.20835724472999573, -0.9382658004760742, 0.3525206744670868, -0.6398193836212158, -0.44133415818214417, ...
def pending _ count ( self ) - > int : if self. _ incoming _ queue is none : return 0 return self. _ incoming _ queue. qsize ( )
[ 0.3148019015789032, 0.021942416206002235, 0.6965758204460144, -1.0583624839782715, -0.21665239334106445, 0.6749341487884521, -0.3323062062263489, 0.4192022383213043, -0.13094407320022583, -1.0704511404037476, 0.022331397980451584, 0.03067902661859989, -0.47567686438560486, 1.14349257946014...
def getnamesfromnexudus ( self ) : url = " https : / / spaces. nexudus. com / api / spaces / coworkers? size = 500 " all _ users = requests. get ( url, auth = self. nexudus _ auth ) all _ users = pd. dataframe ( all _ users. json ( ) ['records'] ) names = all _ users. fullname. to _ list ( ) self. users = all _ users r...
[ -0.8572893738746643, 0.42076990008354187, 0.4797417223453522, 0.057333797216415405, -0.04518193006515503, -0.16749456524848938, -1.3232581615447998, 0.08341024816036224, 0.2586037218570709, 0.22484001517295837, -1.097470998764038, 1.1479142904281616, -0.6377115249633789, 0.6437283754348755...
def _ _ init _ _ ( self, network _ distribution, known _ distribution ) : super ( ). _ _ init _ _ ( network _ distribution, known _ distribution )
[ 0.9118112325668335, -0.4020542502403259, 0.48387908935546875, 0.5236368775367737, 0.38846534490585327, 0.42780259251594543, -0.43414297699928284, 1.165141224861145, 0.14868871867656708, -0.507099986076355, -0.3927353322505951, -0.07732497155666351, 1.20988130569458, 0.3471032977104187, 0...
def _ model _ file _ path ( dump _ directory ) : return os. path. join ( dump _ directory, " random _ forest _ model. pkl " )
[ -0.328236848115921, 0.3697119355201721, 0.24864652752876282, -0.24224334955215454, 0.8471307754516602, 0.9166439771652222, 0.7624853849411011, 0.09619387239217758, -0.7014102935791016, 0.42808210849761963, 0.04856784641742706, -1.3755159378051758, 0.7483112215995789, 0.1645662486553192, ...
def farm _ ram _ menu ( self ) : pass
[ -0.09515870362520218, -0.6298477649688721, 0.39314624667167664, 1.274835467338562, -0.2986893355846405, -0.14777244627475739, 1.1788444519042969, -0.19567923247814178, 0.5429827570915222, -0.27938446402549744, -0.12269430607557297, 0.8460221886634827, -0.5448317527770996, -0.31182891130447...
def transform _ order _ list ( string _ list = " " ) : chars _ to _ remove = [ " * " ] string _ list = " ". join ( i for i in string _ list if i not in chars _ to _ remove ). strip ( ) return " < li > { } < / li > \ n ". format ( string _ list )
[ -0.21729597449302673, -0.18634448945522308, 0.7374603152275085, 0.3131102919578552, -0.7056282162666321, -0.40441861748695374, -0.6466696262359619, 1.518364667892456, 0.17313793301582336, 0.39120030403137207, -0.9385918974876404, 0.01755782961845398, 0.32201892137527466, 0.4449617862701416...
def _ m _ step ( self, data ) : n, d = data. shape # print ( " k " ) # set self. w, self. mean, self. sigma n _ comp, _ = self. mean. shape self. w = self. q _ z. mean ( axis = 0 ) norma = self. q _ z. sum ( axis = 0 ) self. mean = np. dot ( self. q _ z. t, data ) / norma [ :, np. newaxis ] if self. diag : # bonus part...
[ 0.06824435293674469, -0.5481531023979187, 0.6865904927253723, -0.242112398147583, -0.7194111347198486, -0.17276610434055328, 0.9933635592460632, 0.6621514558792114, 0.19637589156627655, 0.13132736086845398, -0.2645169794559479, 0.14051687717437744, 0.20492812991142273, 1.1499336957931519, ...
def checkin ( self ) : self. reshelf ( ) self. status = " checked in " self. due _ date = none print ( " { book } checked in. ". format ( book = self. title ) )
[ 0.5367526412010193, -0.6332109570503235, 0.36449941992759705, 0.7038901448249817, 0.015381705947220325, 1.3644710779190063, 0.5960756540298462, 0.6967328786849976, -1.0122624635696411, -0.08481708914041519, 0.07031737267971039, 0.5478124022483826, -0.4587832987308502, 0.05790605768561363, ...
def read _ file ( file _ name, simple _ string _ is _ enough ) : try : with open ( file _ name ) as file : preferences _ string = file. read ( ) except filenotfounderror : return " the game _ stat. txt file is missing, or incorrect filename given. " else : error = check _ errors _ in _ file ( preferences _ string, file...
[ 0.26799941062927246, -0.3133760988712311, 0.8002063035964966, -0.47215887904167175, -0.6874819993972778, 0.7720924615859985, -0.7076243758201599, 0.22371229529380798, -1.2494949102401733, 0.7405637502670288, 0.7458118200302124, 0.19283603131771088, -0.20012323558330536, -0.6395915150642395...
def collate _ fn ( data ) : # sort a data list by caption length ( descending order ). data. sort ( key = lambda x : x [ 1 ]. size ( 1 ), reverse = true ) images, captions = zip ( * data ) n = len ( images ) # batch _ size images = torch. cat ( images, 0 ) # image loader already adds a batch dimension max _ len = capti...
[ 0.3872571587562561, -0.41923269629478455, 0.6366129517555237, 0.37061554193496704, 0.061225347220897675, -0.5809667706489563, 0.14811541140079498, 0.10713796317577362, -0.41911596059799194, -0.4427732527256012, -0.566002607345581, -0.17404574155807495, 0.7846579551696777, 0.748789608478546...
def test _ string ( ) : ver = _ version. version ( " 1. 2. 3. 4. foo ", true, 5 ) assert str ( ver ) = = " 1. 2. 3. 4. foo. dev5 " ver = _ version. version ( " 1. 2. 3. 4. foo ", false, 5 ) assert str ( ver ) = = " 1. 2. 3. 4. foo " ver = _ version. version ( " 1. 2. 3. 4. foo \ xe9 ", false, 5 ) assert str ( ver ) = =...
[ 0.09760557860136032, -0.9166504144668579, 0.3086606562137604, 0.015949372202157974, -0.6853581666946411, 0.6079210638999939, 0.4064125716686249, -0.6091641187667847, -0.3850178122520447, 0.7575656175613403, -0.7592243552207947, -0.311065673828125, -0.48453307151794434, -0.9323341846466064,...
def _ _ repr _ _ ( self ) : return f'{ self. body } ( { self. author } ) '
[ -0.20759589970111847, -1.3290609121322632, 0.5746344923973083, -1.248854160308838, -0.10238863527774811, 0.7967303991317749, -0.631071925163269, 0.15308019518852234, 0.5482299327850342, 0.10991811007261276, 0.840411365032196, 1.162188172340393, -0.12293342500925064, -0.3247068226337433, ...
def solve _ with _ input ( self, b ) : self. _ b = b if not self. _ decomposed : self. _ decompose ( ) self. _ forward _ substitute ( ) self. _ backward _ substitute ( ) return self. _ x. flatten ( )
[ -1.063889503479004, 0.7753677368164062, 0.5582554936408997, -0.21132303774356842, -0.40323615074157715, -0.8740524649620056, 0.3948792815208435, 0.008528158068656921, 0.44491446018218994, -0.6935268640518188, -1.2219994068145752, -0.7046186327934265, -1.5654346942901611, -0.145744502544403...
def rename _ nodes ( g ) : node2idx = { node : i for i, node in enumerate ( g ) } h = type ( g ) ( ) for u in g : h. add _ node ( node2idx [ u ] ) for u, v in g. edges : h. add _ edge ( node2idx [ u ], node2idx [ v ] ) return h
[ -1.0497492551803589, 0.3111640214920044, 0.5385714173316956, -0.7219712734222412, -0.6864786148071289, -0.23564139008522034, 0.10769838839769363, 0.06590180844068527, 0.21684032678604126, 1.1554633378982544, -0.3393199145793915, 0.9463974237442017, 0.40549910068511963, -1.0713238716125488,...
def _ transformation ( self, x : np. ndarray ) - > np. ndarray : return x * * self. exponent / ( self. denominator _ shift + x * * self. exponent )
[ -0.5972259640693665, 0.4411863386631012, 0.6196580529212952, -0.7090666890144348, -0.2244068831205368, 0.1941816657781601, -0.6029385924339294, -0.7280970215797424, 0.9361321330070496, -0.1484801173210144, -0.19838301837444305, 0.06620705872774124, 0.11633577197790146, -0.8687756061553955,...
def make _ bucket ( name ) : try : minio _ client. make _ bucket ( name ) except bucketalreadyownedbyyou : pass
[ 0.04894399270415306, 1.1192121505737305, 0.2705867290496826, 0.8131075501441956, -0.25238457322120667, 0.16849437355995178, 0.923374354839325, -1.0805721282958984, 0.040056511759757996, -1.0557591915130615, -1.0433132648468018, 0.19267654418945312, 0.2264225035905838, -0.8393607139587402, ...
def backward ( self, top, propagate _ down, bottom ) : pass
[ -0.5110890865325928, -0.14466522634029388, 0.4014272093772888, 0.6936401128768921, 0.7657696604728699, -0.371911883354187, 0.8278253674507141, -0.2784380316734314, -0.8769888877868652, -0.48399919271469116, 0.6735432147979736, 0.5027710199356079, -0.8880561590194702, -0.00509163923561573, ...
def make _ lens _ basic ( f, d, z _ offset ) : material = bk7 wavelength = green n = material. get _ ior ( wavelength ) a = 1. b = - f * ( n - 1 ) * 2 c = f * d * ( n - 1 ) * * 2 / n r1 = ( - b + np. sqrt ( b * * 2 - 4 * a * c ) ) / ( 2 * a ) # r1 _ = ( - b - np. sqrt ( b * * 2 - 4 * a * c ) ) / ( 2 * a ) implied _ f =...
[ 0.22908131778240204, -0.5124459862709045, 0.6206233501434326, -0.034987036138772964, -0.3152724802494049, 0.6315346360206604, -0.08565215021371841, -0.4444305896759033, 0.08487966656684875, -0.5879563689231873, 0.1694750338792801, -0.13854467868804932, 0.8079482913017273, -0.35644629597663...
def reconstruction _ ratio ( aligned _ error, identity _ error ) : num = 1 - aligned _ error den = 1 - identity _ error try : return 1 - ( num / den ) except zerodivisionerror : return 0. 0
[ -0.31831106543540955, -0.1540147066116333, 0.3525733947753906, 0.4957495927810669, 0.7014233469963074, -0.19778338074684143, 0.2721635103225708, 0.42492997646331787, 0.1917046308517456, -0.0069217681884765625, 1.087527871131897, -0.42388251423835754, -0.6183152794837952, -0.640373528003692...
def get _ led _ battery _ state ( self ) : try : recv = self. _ read ( self. command _ get _ led _ batt _ mon, self. _ i2c _ read _ len ) except keyboardinterrupt as e : # pragma : no cover self. _ log. warning ( " keyboard interrupt, % s ", e ) raise e except ioerror as e : # pragma : no cover msg = " failed reading l...
[ -0.15277014672756195, 0.027405280619859695, 0.6190325021743774, -0.11907432228326797, -0.9664809107780457, 1.308755874633789, 0.010364456102252007, -0.7076417803764343, -0.6378425359725952, -0.7829752564430237, -0.09765688329935074, 0.557506799697876, -1.2953696250915527, 0.174963295459747...
def keyspace ( self ) - > optional [ str ] : return self. _ _ keyspace
[ 0.7644486427307129, -0.17264798283576965, 0.14184366166591644, 0.37484240531921387, -0.08170946687459946, 0.7103222608566284, -0.36556515097618103, -0.8031444549560547, 1.0991138219833374, -0.863376259803772, 0.4268184006214142, 0.5448809266090393, -0.7038798332214355, -0.10415161401033401...
def get _ preprocessing _ methods ( self, istest = false ) : pass
[ -0.485527902841568, 0.6797286868095398, 0.6044010519981384, 0.4183467626571655, 0.7392962574958801, -0.2990012466907501, -0.17469406127929688, -0.6083559989929199, 0.5896139740943909, 0.03156784549355507, -0.38249677419662476, 0.14929473400115967, -0.7324512600898743, 0.6780070662498474, ...
def click _ managingprofile ( self ) : m = self. driver. find _ element _ by _ css _ selector ( self. css _ managingprofile ) action = touchactions ( self. driver ) action. tap ( m ). perform ( ) time. sleep ( 0. 2 ) # self. driver. implicitly _ wait ( 5 )
[ 0.6662448048591614, 0.5708047747612, 0.5382261276245117, 0.8176524639129639, 0.9359099268913269, 0.027768459171056747, 1.155910849571228, -0.7193980813026428, 0.6099931597709656, -0.21488253772258759, -0.3352549374103546, -0.1866426169872284, -0.6734927892684937, 0.13520540297031403, 0.0...
def _ get _ matching _ signature ( oper, args ) : # search corresponding signature return next ( ( s for s in oper. signatures if _ is _ matching _ arguments ( s, args ) ), none )
[ -0.012196370400488377, -0.25139155983924866, 0.395541787147522, 0.6874131560325623, -0.2647850811481476, -0.9483578205108643, -0.12247113138437271, -0.4928302764892578, -1.515203833580017, 0.47549355030059814, 0.43882033228874207, -0.4816261827945709, -0.5129809379577637, -0.06355115026235...
def setup _ ddp _ components ( self ) : # for example : # # training _ models = [ # distributeddataparallel ( model ) # for model in self. models # ] # self. setup _ operator ( training _ models ) pass
[ -1.1570261716842651, 0.4270346164703369, 0.6462174654006958, 0.21983301639556885, 1.0170379877090454, 1.0139440298080444, 0.4956725537776947, 0.3275347948074341, 0.1727655529975891, -0.1973589062690735, -0.49699825048446655, -1.1680115461349487, 0.2984914779663086, 0.030893849208950996, ...
def topods _ vertex ( * args ) : return _ topods. topods _ vertex ( * args )
[ -0.4297351837158203, 0.6228354573249817, 0.39089125394821167, 0.3808835744857788, -0.3929618000984192, -0.2143193483352661, 0.5441468358039856, -0.20667582750320435, 0.37726470828056335, -0.14469945430755615, -0.351421594619751, -0.14409641921520233, -0.4048148989677429, -0.470225155353546...
def test _ none _ args ( self ) : b1 = basemodel ( none ) self. assertnotin ( none, b1. _ _ dict _ _ )
[ -0.30136606097221375, 0.00016662810230627656, 0.26874980330467224, -0.21679121255874634, 0.8982563018798828, 0.0890493392944336, -0.00010876026499317959, -0.25535687804222107, -1.039882779121399, -1.1727875471115112, -0.3548676073551178, -0.5950863361358643, -1.2824500799179077, 1.02046072...
def ram _ role _ name ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " ram _ role _ name " )
[ 0.8450149893760681, -0.4078097343444824, 0.33279579877853394, 0.02445390075445175, 0.05038785934448242, 0.984922468662262, -0.2495446503162384, 0.14128857851028442, 0.639745831489563, 0.5104286670684814, -0.08569242060184479, 0.9125630259513855, -0.2355576753616333, -0.8230777978897095, ...
def _ _ len _ _ ( self ) : return len ( self. clr _ paths )
[ 0.5502036809921265, -0.12483210861682892, 0.1676899790763855, -0.5862189531326294, 0.8511900901794434, 0.495462566614151, 0.5152415037155151, 0.4042135179042816, 0.19381466507911682, -0.22167924046516418, -0.43959444761276245, -0.5829468965530396, 0.10567395389080048, 0.04165349155664444, ...
def build _ cpo _ expr ( val ) : # check if already a cpo expression if isinstance ( val, cpoexpr ) : return val # check atoms ( not cached ) vtyp = type ( val ) ctyp = _ python _ to _ cpo _ type. get ( vtyp ) if ctyp : return cpovalue ( val, ctyp ) # check numpy scalars ( special case when called from overloaded opera...
[ 0.1664833426475525, -0.21335938572883606, 0.3337593674659729, 0.5082195997238159, -0.8459895253181458, 0.04016222059726715, 0.30248594284057617, -0.1818639189004898, 0.04198508337140083, 0.45487943291664124, -0.28145870566368103, 0.8237429261207581, -0.043397217988967896, -0.00630555627867...