text
stringlengths
25
2.19k
embedding
listlengths
768
768
def get _ improvement ( n : int, baseline : dataframe, kml : dataframe ) - > float : avg _ baseline = avg _ time _ for _ query _ n ( n, baseline ) avg _ kml = avg _ time _ for _ query _ n ( n, kml ) improvement = avg _ baseline / avg _ kml return improvement
[ -0.12147104740142822, 1.381084680557251, 0.5005739331245422, -0.08933339267969131, -0.22219696640968323, -0.6466581225395203, -0.34669238328933716, -0.6019731760025024, -0.9700981378555298, 0.23300206661224365, -0.3384900391101837, 0.6338366270065308, -0.23426547646522522, 0.55375939607620...
def plot _ sample _ files _ from _ list ( file _ list, folder ='', plot _ sample = 12, cols = 6, show = true, savepath = none ) : if plot _ sample is none : plot _ sample = len ( file _ list ) imgs _ to _ plot = read _ imgs _ from _ list ( np. random. choice ( file _ list, min ( plot _ sample, len ( file _ list ) ), re...
[ 0.33179426193237305, 0.39444127678871155, 0.4626154899597168, 0.8638801574707031, -0.3757834732532501, 0.13611507415771484, 0.9483597278594971, 0.6128401160240173, 0.7022498846054077, 0.2375987321138382, -0.3709014356136322, 0.25996723771095276, 0.069877989590168, 0.8085870146751404, -0....
def create _ placeholders ( self ) - > none : raise notimplementederror ( )
[ -0.15944989025592804, 0.3377988636493683, 0.34140750765800476, 0.055743228644132614, 0.7807855010032654, 1.5096808671951294, 0.4243188202381134, -0.1657726764678955, -0.24070358276367188, 0.015088020823895931, -0.14731933176517487, -1.169935941696167, -0.46069005131721497, 0.81922054290771...
def add _ group ( self, dto ) : return self. request ('groups ', method ='post ', dto = dto )
[ -1.3480956554412842, 2.080350160598755, 0.27451038360595703, 0.022302228957414627, 0.25210022926330566, 0.17008242011070251, -0.7754043936729431, -0.7412095069885254, -0.23764890432357788, -1.2571911811828613, -0.5248361825942993, 0.9437668919563293, -0.663520336151123, -0.1769783496856689...
def iops ( self ) - > optional [ pulumi. input [ int ] ] : return pulumi. get ( self, " iops " )
[ -0.15625500679016113, 0.8416749835014343, 0.5174602270126343, 0.2083648443222046, 0.41632676124572754, 1.047224998474121, 0.46458879113197327, -0.23822683095932007, 1.1042563915252686, -0.12022139132022858, 0.7436880469322205, -0.34487345814704895, -0.5484268665313721, -1.8667973279953003,...
def get _ bs _ three _ point _ cached ( col, basis _ dir = '. ', verbose = false ) : basis _ name = " three _ point _ basis _ { } _ { }. npy ". format ( col, col ) d = none if basis _ dir is not none : path _ to _ basis _ file = os. path. join ( basis _ dir, basis _ name ) if os. path. exists ( path _ to _ basis _ file...
[ -0.26379528641700745, 0.47257199883461, 0.8554338216781616, 0.47633519768714905, 0.09707313030958176, 0.33975017070770264, 0.44628921151161194, -0.304376482963562, 0.30934929847717285, 0.6093608736991882, -0.04038725048303604, 0.34546083211898804, -0.05167892202734947, -0.6726003885269165,...
def make _ dictionary ( cls, words ) : dictionary = cls ( ) # read every word. for word in words : # add all the prefixes. for i in range ( len ( word ) ) : prefix = word [ : i ] if prefix not in dictionary. words : dictionary. words [ prefix ] = false # add the word. dictionary. words [ word ] = true return dictionary
[ 0.10344812273979187, 0.2184482216835022, 0.404337078332901, -1.2912641763687134, -1.057836890220642, 0.012075315229594707, -0.08918891847133636, 0.2095901072025299, 0.002986869076266885, 0.3499046266078949, 0.36361750960350037, 0.0724494680762291, -0.43974193930625916, 0.9073877930641174, ...
def _ compile _ plugins ( plug : path, reloading : bool ) - > optional [ exception ] : try : global namespace eval ( compile ( plug. open ('u'). read ( ), plug,'exec'), namespace ) except exception as e : print ( f'error loading plugin : { type ( e ). _ _ name _ _ } { e }.') if reloading : print ('continuing use of old...
[ 0.1196766346693039, -1.3579984903335571, 0.43434736132621765, -0.06685671955347061, -0.06962716579437256, -0.7176436185836792, 0.32134342193603516, -0.3838259279727936, 0.3808836340904236, -0.20640096068382263, -0.21470263600349426, 0.6457075476646423, -0.7937153577804565, -0.3672821223735...
def connect _ to _ database ( ) : database _ url = os. environ. get ('database _ url ', none ) if not database _ url : print ('error : set the database _ url environment variable') exit ( 1 ) database _ url = database _ url. strip ('jdbc :') try : base _ connection _ command, env _ vars = parse _ db _ url ( database _ ...
[ -0.08249812573194504, -0.005462508648633957, 0.8444349765777588, 0.7702773213386536, 0.9652933478355408, 0.5119614601135254, 0.3416859805583954, -0.2636739909648895, -1.2416744232177734, 0.014613675884902477, 0.26568442583084106, 0.46220505237579346, -0.534609854221344, 0.397722065448761, ...
def test _ single _ gen _ next ( self ) - > none : id _ gen = self. _ create _ id _ generator ( ) async def test _ gen _ next ( ) - > none : async with id _ gen. get _ next ( ) as next _ id : # we haven't persisted ` next _ id ` yet ; current token is still 123 self. assertequal ( id _ gen. get _ current _ token ( ), 1...
[ -0.8625282049179077, 0.5417922139167786, 0.43639296293258667, 0.14823953807353973, 0.7285041809082031, 0.3154081702232361, 0.31440040469169617, 0.3487323224544525, -0.18406246602535248, -0.9521910548210144, -0.915772020816803, -0.15660148859024048, 0.0369604155421257, 0.4103875160217285, ...
def tavsiye ( self, secim = " idare " ) : filtre = self. veri [ self. veri. kategori = = secim ] return filtre. sozler. sample ( n = 1 ). values [ 0 ]
[ 0.05438488721847534, 0.6621922850608826, 0.19557154178619385, 1.181596040725708, -1.0790125131607056, -0.4166693687438965, 0.11921309679746628, -0.8391420245170593, -0.002452706918120384, 0.6696076989173889, -0.26996758580207825, 0.5450358390808105, -0.17884348332881927, -0.289611160755157...
def variable _ recurrent _ factory ( inner, reverse = false ) : if reverse : return variablerecurrentreverse ( inner ) else : return variablerecurrent ( inner )
[ -0.4357832372188568, -0.12150482833385468, 0.5370817184448242, -0.47358664870262146, -1.0857555866241455, -0.22168728709220886, 0.07860276848077774, -0.22633513808250427, -0.2690902650356293, -0.8996797800064087, 0.22626805305480957, 1.1039388179779053, -0.5656706094741821, -1.052796125411...
def balance _ dataframe ( df, category = ['stars'] ) : if category is none or not all ( [ col in df. columns for col in category ] ) : raise valueerror ('please provide one or more columns containing categorical variables') lowest _ count = df. groupby ( category ). apply ( lambda x : x. shape [ 0 ] ). min ( ) df = df....
[ 0.15669086575508118, 0.18250225484371185, 0.7476913928985596, 0.316788911819458, 0.43160155415534973, 0.25812992453575134, 0.4548495411872864, -0.5426546931266785, 0.0090430723503232, -0.02771768905222416, 0.9477826356887817, 0.8116260766983032, -0.31240424513816833, -0.273064523935318, ...
def ppo _ actor _ loss ( action _ logits : np. ndarray, actions : np. ndarray, advantages : np. ndarray, old _ action _ logits : np. ndarray, clip _ eps : float ) - > float : advantages = jax. lax. stop _ gradient ( advantages ) new _ log _ pa = np. take _ along _ axis ( jax. nn. log _ softmax ( action _ logits, axis =...
[ -0.5253131985664368, -0.6748040318489075, 0.8053309917449951, -0.6959487795829773, -1.5847623348236084, -0.08944401144981384, -0.37255439162254333, 0.061401501297950745, 0.9271811246871948, 1.017791748046875, 0.4241262376308441, 1.10508394241333, 0.8208099603652954, -0.4828275442123413, ...
def add _ to _ palette ( self, color : tuple [ int, int, int, int ] ) - > int : if color in self. _ palette : return self. _ palette [ color ] else : color _ i = len ( self. _ palette ) if color _ i > 254 : # if the new index is larger than 254, it means there are at least 256 # colors, which is not allowed raise excep...
[ -1.4230800867080688, 0.9286805987358093, 0.6177504658699036, -1.210637092590332, -0.06750309467315674, 0.2294161021709442, 0.3132803440093994, -0.30220159888267517, 0.6374533176422119, 0.0959552526473999, -0.6346914768218994, -0.025370148941874504, -0.7518342137336731, -0.3452335000038147,...
def set _ display _ name ( self, display _ name ) : self. _ call ('set _ display _ name ', display _ name = display _ name )
[ 0.22165358066558838, -0.4209837019443512, 0.3178820312023163, 0.9156895279884338, -0.8727290630340576, 0.717115581035614, 0.1460002064704895, -0.29995089769363403, -0.17820721864700317, 0.5478817820549011, -0.5248773097991943, 0.38757264614105225, 0.3000999689102173, 0.37876832485198975, ...
def _ configure _ aws _ kops ( self ) : # poll the region to get availability zones aws _ ec2 = boto3. client ('ec2') zones = aws _ ec2. describe _ availability _ zones ( ) [ u'availabilityzones'] zones = [ zone [ u'zonename'] for zone in zones if zone [ u'state'] = ='available'] self. kops _ parameters + = ['- - node ...
[ -0.6041515469551086, -0.06693192571401596, 0.38386067748069763, -0.27657535672187805, 0.011682202108204365, 0.06486127525568008, -0.42824745178222656, 0.02089661732316017, 0.5820907354354858, 1.0539220571517944, 0.1174401268362999, -0.14637206494808197, 0.6025219559669495, 0.00434172060340...
def _ split _ bracketed _ expression ( expression ) : parts = [ ] current _ part = - 1 last _ part = 0 unmatched ='' for i, char in enumerate ( expression ) : if char in'[ ( {': if current _ part = = - 1 : current _ part = i if last _ part! = current _ part : part = expression [ last _ part : current _ part ]. strip ( ...
[ -0.5538707971572876, -0.33243635296821594, 1.0967202186584473, 0.32296261191368103, -0.07723454385995865, -0.42100605368614197, 0.2526991665363312, -0.24390988051891327, -0.026549141854047775, 0.7802239060401917, -0.153884619474411, 0.17945964634418488, -0.9017081260681152, 0.2192415297031...
def test _ where ( self ) : band = self. band new _ popularity = self. band. popularity + 1000 query = band. insert ( band ( name = self. band. name, popularity = new _ popularity ) ). on _ conflict ( target = band. name, action = " do update ", values = [ band. popularity ], where = band. popularity < self. band. popu...
[ 0.8468918800354004, 0.340129017829895, 0.5427367091178894, 0.3802099823951721, 0.4256814122200012, 0.4531111419200897, -0.28411826491355896, -0.6804279685020447, -0.05004993826150894, -0.15253131091594696, -0.28302910923957825, -0.022585434839129448, -0.10813280194997787, -0.56790834665298...
def schedule _ dense ( attrs, outs, target ) : if target. device _ name = = " vta " : if outs [ 0 ]. shape = = 4 : # this implies the layout is packed target = tvm. target. create ( target ) assert target. device _ name = = " vta " return topi. generic. schedule _ dense ( outs ) # if it's not packed, run on arm cpu wit...
[ -0.6561428308486938, 0.21543562412261963, 0.5167608857154846, 0.7301786541938782, -0.41953882575035095, -0.6837843060493469, 0.6921907663345337, -0.10912945866584778, 0.5724183917045593, 0.10136813670396805, 0.9302075505256653, 0.1725001484155655, 0.35416924953460693, -0.7017152309417725, ...
def _ callback _ group ( self, key, item, option ) : if option = = cataloguegroup. added : # create new mapping based on the added item self. _ item _ added ( key, item ) elif option = = cataloguegroup. removed : # create new mapping based on the added item self. _ item _ removed ( key, item ) else : # create new mappi...
[ -0.42024773359298706, -0.007541494444012642, 0.5269667506217957, -0.3798184096813202, -0.36137139797210693, -0.6704347133636475, 0.37828347086906433, -0.5727152824401855, 0.752906858921051, 0.29471898078918457, 0.33895036578178406, -0.8005757927894592, -0.035967838019132614, -0.01957820169...
def setup ( self ) : super ( rununitteststrampolinetest, self ). setup ( ) run _ tests. trampoline. platform ='my _ platform'run _ tests. trampoline. config ='my _ config '
[ 0.10334557294845581, -0.030514417216181755, 0.44811445474624634, -0.09409536421298981, 0.7982395887374878, 0.8805454969406128, 0.5758544206619263, 0.4882061779499054, -0.2904561758041382, -0.33280491828918457, -1.455359697341919, 0.11837352812290192, -0.5417754650115967, 0.2427440136671066...
def test _ move _ before ( self ) : self. assertequal ( self. n3. order, 0 ) self. assertequal ( self. n4. order, 10 ) self. n4. move _ before ( self. n3 ) n3 = nodeorderable. objects. get ( name ='3') n4 = nodeorderable. objects. get ( name ='4') self. assertequal ( n3. order, 0 ) self. assertequal ( n4. order, - 10 )
[ -0.4239284098148346, 0.6949838995933533, 0.5235704183578491, 0.4237203896045685, 0.9538321495056152, -0.21956194937229156, 0.6189835667610168, -1.1165682077407837, -0.085812509059906, 0.1009400486946106, -0.8656449913978577, -0.7695057392120361, -0.3622421622276306, -0.20035789906978607, ...
def convert _ sentence _ to _ list ( func ) : @ functools. wraps ( func ) def wrapper ( embedding _ instance, sentences : union [ sentence, list [ sentence ] ], * args, * * kwargs ) : if type ( sentences ) is sentence : sentences = [ sentences ] return func ( embedding _ instance, sentences, * args, * * kwargs ) return...
[ -0.2925802171230316, -0.6525546312332153, 0.5670794248580933, -0.14803601801395416, 0.14672161638736725, -0.6626807451248169, -0.5782803297042847, 1.004531741142273, 1.2608975172042847, 1.3665835857391357, -0.5864412188529968, 0.03974774852395058, 0.4812774956226349, 0.8403357267379761, ...
def obtain _ sub _ video ( input _ video, output _ video, start _ seconds, end _ seconds ) : video = videofileclip ( input _ video ). subclip ( start _ seconds, end _ seconds ) result = compositevideoclip ( [ video, ] ) result. to _ videofile ( output _ video )
[ 0.2887883484363556, -0.5620071887969971, 0.5328043103218079, 1.5157413482666016, -0.1862403303384781, -0.31011074781417847, -0.15987148880958557, -0.15066564083099365, -0.5885298252105713, -0.5777328014373779, -0.32246240973472595, 1.585243582725525, 0.011813613586127758, -1.12124550342559...
def test _ all _ columns ( self ) : band = self. band new _ popularity = self. band. popularity + 1000 new _ name = " rustaceans " # conflicting with id - should be ignored. q = band. insert ( band ( id = self. band. id, name = new _ name, popularity = new _ popularity, ) ). on _ conflict ( action = " do update ", targ...
[ -0.2956467568874359, 0.37319424748420715, 0.5764913558959961, 0.7096599340438843, 0.6416480541229248, 0.3849926292896271, -0.669608473777771, -0.5891993045806885, 0.06728503108024597, -0.1610429883003235, -1.420593500137329, -0.05131852999329567, -0.1652543693780899, -0.5867516398429871, ...
def run _ server ( args ) : if not path. exists ( args. origin ) : print " error : can't find origin directory. " print " aborting " sys. exit ( ) cwd = getcwd ( ) if not path. exists ( path. join ( args. origin, o ) ) : print " error : can't find output directory. " print " aborting " sys. exit ( ) handler = requestha...
[ -0.16042020916938782, -0.704525351524353, 0.981181800365448, 0.3349536657333374, 0.48113325238227844, 0.25313103199005127, 0.6667706370353699, 0.24103787541389465, -0.8650262355804443, -0.5107758045196533, -0.6604618430137634, 0.5870589017868042, -0.16671393811702728, 0.5693782567977905, ...
def left _ chat _ member ( self, bot : bot, update : update ) - > none : self. logger. info ( " user left : % s ", self. _ log _ user ( update. message. left _ chat _ member ) ) if self. config. delete _ leave _ messages : bot. delete _ message ( chat _ id = update. message. chat. id, message _ id = update. message. me...
[ 1.3142894506454468, -1.301181435585022, 0.520566463470459, -0.3707014322280884, -0.23683062195777893, 0.8386845588684082, -0.9493626356124878, -0.5241715908050537, 0.03604825958609581, 0.32752352952957153, -0.9914648532867432, 0.13825979828834534, -0.543430745601654, 0.6608293652534485, ...
def initialize _ app ( app = app, config _ cls ='default') : try : config _ cls = getattr ( config, config _ cls ) app. config. from _ object ( config _ cls ) except attributeerror : traceback = sys. exc _ traceback raise ( attributeerror, " config class'% s'does not exist in app. config module " % config _ cls, traceb...
[ -0.2759060263633728, -0.010677320882678032, 0.4268139898777008, 0.8145036101341248, 0.7644906640052795, 0.23576274514198303, -0.42830973863601685, 0.20594003796577454, 0.3991468548774719, 0.9667181968688965, -0.5966001749038696, -0.0845208615064621, 0.5191895961761475, 0.9009674787521362, ...
def test _ see _ passive _ zone _ state ( self ) : register _ time = datetime ( 2015, 9, 15, 23, tzinfo = dt _ util. utc ) scan _ time = datetime ( 2015, 9, 15, 23, 1, tzinfo = dt _ util. utc ) with assert _ setup _ component ( 1, zone. domain ) : zone _ info = {'name':'home ','latitude': 1,'longitude': 2,'radius': 250...
[ -0.379718542098999, -0.04802597686648369, 0.5737428069114685, -0.40848639607429504, 0.12983882427215576, 0.25959688425064087, 0.33349916338920593, 0.2947016656398773, 0.5475834012031555, -0.13817548751831055, -0.4885578751564026, -0.366838663816452, 0.005862551275640726, -0.117758296430110...
def do _ eval ( self, args ) : args = self. process _ args ( args ) try : self. locate _ element ( ) print eval ( args ) except : self. handle _ exception ( )
[ 0.03101673536002636, -0.38993948698043823, 0.443666011095047, -0.0735153928399086, 1.206967830657959, 0.6372374892234802, 0.2620633542537689, -0.16015803813934326, -0.16005004942417145, -0.03639134019613266, 0.4524455964565277, 0.6553176045417786, -0.4614207446575165, -0.31668686866760254,...
def get _ necessary _ data ( ) : with open ('necessary _ data. pck ','rb') as file : necessary _ data = pickle. load ( file ) colones = necessary _ data ['columns'] scientificwords = necessary _ data ['scientificwords'] membres _ var _ glob = necessary _ data ['membres _ var _ glob'] cote _ gauche _ var _ glob = necess...
[ 0.12026666849851608, -0.667293131351471, 0.4316844344139099, -0.7473386526107788, 0.5350464582443237, 0.2921307682991028, -0.10262223333120346, 0.11474326997995377, -1.5326569080352783, 0.16326119005680084, -0.10390377044677734, 0.158139169216156, -0.17513729631900787, -0.2738204002380371,...
def updated _ date ( self, updated _ date ) : self. _ updated _ date = updated _ date
[ 0.6690042018890381, -0.10353638976812363, -0.0027452760841697454, 0.7298030853271484, -0.3361065983772278, 0.9498260021209717, -0.06752569228410721, 1.3811626434326172, 0.11378307640552521, -0.5071095824241638, -0.6287407279014587, 0.8291511535644531, 0.6366053223609924, 0.4260921478271484...
def regex _ is _ part _ of _ word ( string : str ) - > [ str ] : p = re. compile ( string, re. ignorecase ) matches = [ ] for word in global _ list _ of _ american _ english _ words : m = p. match ( word ) if m : matches. append ( word ) return matches
[ 0.17947392165660858, -0.04765545576810837, 0.4866711497306824, 0.5780073404312134, 0.2757839560508728, 0.09623938798904419, -0.40052205324172974, 0.582987904548645, 0.5737801194190979, 1.0301252603530884, -0.5391398072242737, 0.5200543403625488, -0.9389298558235168, 0.35138440132141113, ...
def create ( self, word, morse, frequency ) : return self ( word = word, morse = morse, frequency = frequency )
[ 0.23774603009223938, -0.5858101844787598, 0.3874146640300751, 0.6244045495986938, -0.22833965718746185, 0.277931809425354, -0.29521483182907104, -0.4485231339931488, -0.05132048949599266, -0.5884969234466553, 0.01869847998023033, 0.05109468102455139, -1.1822487115859985, 0.0922018513083458...
def get _ initial _ state ( self ) - > union [ nesteddict, list [ tensortype ] ] : return nesteddict ( )
[ 0.27350181341171265, 0.2939744293689728, 0.4023539125919342, -0.2226192057132721, -0.06603482365608215, 0.04138394445180893, 0.2644968330860138, -0.12357437610626221, 0.5197603106498718, -1.4474886655807495, -0.9373819231987, 0.4059929847717285, 0.24200886487960815, 0.19347158074378967, ...
def email _ body _ template _ id ( self, email _ body _ template _ id ) : self. _ email _ body _ template _ id = email _ body _ template _ id
[ -0.6120015382766724, -0.8596975207328796, 0.1601274609565735, -0.19680839776992798, 0.03577504679560661, 0.6213014721870422, -0.7034721374511719, 0.239008828997612, 0.6777958869934082, 0.9535973072052002, -1.5318467617034912, -0.33143746852874756, -0.34819909930229187, 0.9474931955337524, ...
def parse _ fight ( self, response, weight, event _ id, today ) : fight _ id = response. url. split ('/') [ - 1 ] # should i use this as the fight id? should the id be more descriptive? fighter _ names = response. css ( '. b - fight - details _ _ person - name : not ( p ) : : text'). getall ( ) fighter _ 1 = fighter _ ...
[ 0.16192679107189178, -0.5460216999053955, 0.735427975654602, 0.2846856713294983, 0.6892719268798828, -0.3511982560157776, -0.8090463876724243, -0.12672041356563568, -0.1691693514585495, -1.2656298875808716, 0.23139981925487518, -1.05040442943573, 0.6939432621002197, 0.7510784268379211, 1...
def test _ review _ to _ pure _ activity _ no _ rating ( self, * _ ) : status = models. review. objects. create ( name = " review name ", content = " test content ", user = self. local _ user, book = self. book, ) activity = status. to _ activity ( pure = true ) self. assertequal ( activity [ " id " ], status. remote _...
[ -0.4865693747997284, -0.7444266080856323, 0.3819809556007385, -0.5954157710075378, 0.24461548030376434, 0.8248401284217834, 0.031248336657881737, -0.029777273535728455, 0.11368618905544281, -0.16192953288555145, -0.3518492877483368, -0.1132751926779747, -0.5712664723396301, -0.636246085166...
def create _ views ( self ) : self. view _ actions. separator ( ) # keep the order of self. default _ views. view _ names = [ vn for vn in self. default _ views if vn in self. _ requested _ view _ count ] # we add the views in the requested view count, but not in the default views. view _ names. extend ( [ vn for vn in...
[ -0.6966808438301086, 0.9754359722137451, 0.4681284725666046, 0.609521746635437, 1.0991978645324707, -0.16676348447799683, 0.0938061773777008, -0.7622057795524597, -0.0266161747276783, -0.7176596522331238, 0.1990884244441986, -0.07813972979784012, -0.030593331903219223, 0.15614159405231476,...
def splitcommand ( command ) : cmd = command. split ( " < " ) # cmd = [ " any > anything ", " / any > " ] cmd = cmd [ 1 ]. split ( " > " ) # cmd [ 0 ] = = " any > anything " # cmd = [ " any ", " anything " ] if len ( cmd ) > 1 : return ( cmd [ 0 ], cmd [ 1 ] ) # ( command type, value ) else : return ( cmd [ 0 ], )
[ -1.4337589740753174, -0.7487131357192993, 0.5931819081306458, 0.4758220314979553, 0.21139100193977356, -0.38729768991470337, -0.023632533848285675, 0.06424487382173538, 0.15000145137310028, -0.8966174721717834, -0.5699949860572815, -0.1461857557296753, -0.40358367562294006, 1.4388953447341...
def forward ( self, prediction, true _ labels ) : label _ length = self. c + self. b * 5 # initialize corresponding masks for selecting predictions # with or without objects c _ mask = true _ labels [ :, :, :, 4 ] > 0 n _ mask = true _ labels [ :, :, :, 4 ] = = 0 c _ mask = c _ mask. unsqueeze ( - 1 ). expand _ as ( tr...
[ -0.46569597721099854, -0.27528226375579834, 0.7831664085388184, 0.2786700427532196, -0.23656676709651947, 0.027004960924386978, 1.3495064973831177, 0.4067263603210449, -0.3880341053009033, 0.28043076395988464, -0.026826215907931328, -0.015450578182935715, 0.5920389294624329, -0.07874602079...
def read ( path, in _ format = none, encoding ='utf - 8 ', csv _ delimiter = ',') : if not in _ format : in _ format = infer _ format ( path ) dataframe = none if in _ format = = format. csv : dataframe = pandas. read _ csv ( path, delimiter = csv _ delimiter, encoding = encoding ) elif in _ format = = format. json : j...
[ -0.31206077337265015, -0.3713113069534302, 0.8456721305847168, 0.4195803999900818, -0.8529424667358398, 0.1618783324956894, -0.8193277716636658, 0.09311849623918533, -0.19185110926628113, -0.3786242604255676, 0.8705581426620483, 0.7124277949333191, 0.008232285268604755, -0.86440110206604, ...
def _ _ init _ _ ( self, puzzle, move = none ) : self. _ puzzle = puzzle self. _ user _ input = move self. _ subtrees = [ ]
[ 0.0669943243265152, 0.3482862412929535, 0.3090359568595886, 1.3073879480361938, -0.9172559976577759, -0.07473587244749069, 0.649941086769104, 0.032875120639801025, 0.6415545344352722, -0.03928937390446663, -1.1537691354751587, 0.04912798851728439, -0.3568790555000305, 0.4066013693809509, ...
def _ sign _ collect _ rewards ( transaction _ dict, private _ key ) : # preliminary steps if transaction _ dict [ " directive " ]! = directive. collectrewards : raise typeerror ( " only collectrewards is supported by _ sign _ collect _ rewards " ) # first common step account, sanitized _ transaction = _ get _ account ...
[ 0.22641749680042267, -0.015938060358166695, 0.46666160225868225, -0.6893231868743896, 0.3264877200126648, -0.6303493976593018, -0.5137718915939331, -0.11155133694410324, -0.03342219069600105, 0.915007472038269, 0.2611362040042877, -0.2166031301021576, 0.3215022087097168, -0.041748072952032...
def legends ( self ) : return list ( self. _ legends. keys ( ) )
[ 0.44367581605911255, -0.5807396769523621, 0.16743741929531097, 0.3135368824005127, 0.6272478103637695, 0.9382025599479675, -1.2950475215911865, 0.4641784429550171, 0.8862101435661316, -0.03833957388997078, -0.8308995366096497, 0.41711220145225525, 0.3309936225414276, 0.27103933691978455, ...
def update ( self, file _ attachment ) : self. content _ type = " application / json " self. method = " patch " entity = fileattachment ( json. loads ( self. send ( file _ attachment ). content ) ) self. _ initialize _ collection _ properties ( entity ) return entity
[ -0.8924826383590698, -1.7679320573806763, 0.4367794692516327, -0.5112008452415466, -0.7144320011138916, 0.04915385693311691, 0.10383826494216919, -0.06418731063604355, -0.11453863233327866, -0.31568363308906555, -0.05269184708595276, 0.09734266251325607, -0.44982442259788513, 0.26267895102...
def get _ posts ( sub : praw. models. reddit. subreddit. subreddit, sort _ type : str, num : int = 100 ) - > praw. models. listing. generator. listinggenerator : posts = [ ] if sort _ type = = " random " : sort _ type = random. choice ( [ " hot ", " top ", " new " ] ) if sort _ type = = " top " : posts = sub. top ( lim...
[ -0.45327696204185486, 0.6807005405426025, 0.6133930087089539, 1.297370195388794, -0.02029394544661045, 0.09278549998998642, -0.836881160736084, -0.806487500667572, 0.2658804953098297, -0.6210482716560364, 0.0900668129324913, 0.6858441829681396, 0.13024337589740753, 0.6122227311134338, -0...
def set _ proba _ fire _ seasons ( self, n _ fire _ seasons = 1, n _ ignitions = none, keep _ all _ fires = false ) : # min / max for uniform distribtion to sample for n _ fires per year if n _ ignitions is none : ign _ min = np. min ( self. n _ fires ) ign _ max = np. max ( self. n _ fires ) else : ign _ min = n _ ign...
[ -0.35040751099586487, -0.5236533880233765, 0.5615466833114624, 1.3670941591262817, 0.0901826024055481, 0.27960634231567383, 0.10056918114423752, 0.15658408403396606, 0.23475763201713562, 0.28016021847724915, -0.026125513017177582, -0.14993923902511597, -0.6349501609802246, 0.49007347226142...
def _ init _ logs _ table ( ) : _ logs _ table = sqlalchemy. table ('logs ', _ metadata, sqlalchemy. column ('job _ id ', sqlalchemy. foreignkey ( " jobs. job _ id ", ondelete = " cascade " ), nullable = false ), sqlalchemy. column ('timestamp ', sqlalchemy. datetime ), sqlalchemy. column ('message ', sqlalchemy. unico...
[ 1.5251706838607788, 0.13297878205776215, 0.9467519521713257, -0.8312205672264099, 0.19200259447097778, -0.311383992433548, -0.7494757771492004, -0.2945846915245056, -1.2271405458450317, 0.3073367476463318, -0.00785999558866024, 0.3971788287162781, 0.3190818130970001, 0.06053411588072777, ...
def writegoto ( label ) : f. write ( " @ " + currentfunction + " $ " + label + " ) \ n " ) f. write ( " 0 ; jmp \ n " )
[ -0.8001344203948975, -0.11845799535512924, 0.5703773498535156, -0.48817211389541626, 1.435839295387268, 0.7860020995140076, 0.12377603352069855, 0.3995831310749054, -1.0730879306793213, 0.4473816454410553, -0.300875186920166, 0.5114068984985352, -0.5721272230148315, -0.4059058427810669, ...
def constant _ features ( x _ train, x _ test, threshold = 0 ) : vs _ constant = variancethreshold ( threshold ) # select the numerical columns only. numerical _ x _ train = x _ train [ x _ train. select _ dtypes ( [ np. number ] ). columns ] # fit the object to our data. vs _ constant. fit ( numerical _ x _ train ) # ...
[ 0.6267818808555603, -0.5534846782684326, 0.826513946056366, 0.47922033071517944, 0.23616927862167358, 0.005242473911494017, -0.22452782094478607, 0.9668576717376709, -0.7510088086128235, 0.48154377937316895, -0.4425888955593109, 0.7847913503646851, 0.5285516381263733, -0.8784855008125305, ...
def xsaid _ heuristic ( doc ) : # find any mentions of said for v in doc. verbs : anaphor = none antecedent = none if v. gettext ( ) = = " said " : for np in doc. nps : # get the previous np if np. getend ( ) < v. getstart ( ) : if antecedent is none : antecedent = np elif np. getend ( ) > antecedent. getend ( ) : ante...
[ 0.497527539730072, 0.034610848873853683, 0.7984073758125305, -0.7759376168251038, -0.5486294031143188, -0.025014610961079597, 0.48997050523757935, 0.008937522768974304, 0.35843029618263245, 0.20069675147533417, 0.304210364818573, 0.4524865448474884, 0.3173377215862274, 1.0407238006591797, ...
def me ( self ) : params = {'includes':'shops / sections'} resource ='users / _ _ self _ _'results = self. get ( resource, params = params ) return results
[ -1.0400104522705078, -0.12806929647922516, 0.5376636981964111, 0.4374908208847046, -0.668058454990387, -0.3751385509967804, -0.1320229321718216, -1.450547218322754, -0.012045678682625294, -0.6956093907356262, 0.1759660392999649, -0.05441603809595108, -0.23072056472301483, 0.298931211233139...
def _ get _ version ( self ) : fpm _ version ='unknown'try : output = subprocess. popen ( [ self. options ['path'],'- v'], stdout = subprocess. pipe ). communicate ( ) [ 0 ] match = re. match ( r " ^ php ( \ s + ) ", output ) if match : fpm _ version = match. group ( 1 ) except oserror : self. logger. debug ('can not e...
[ -0.09803808480501175, -0.2741014063358307, 0.7549448609352112, 0.3154943883419037, 1.017958641052246, -0.18032094836235046, 0.19717924296855927, -0.45431074500083923, -0.41209402680397034, -0.10790558904409409, 0.11323540657758713, 0.009570842608809471, -0.5827061533927917, 0.2243487089872...
def validate _ state _ token ( *, session = flask. session ) : # validate state token if flask. request. args. get ('state')! = flask. session ['state'] : response = flask. make _ response ( json. dumps ('invalid state parameter'), 401 ) response. headers ['content - type'] ='application / json'return ( false, response...
[ -0.7085660099983215, -1.0975173711776733, 0.5922264456748962, 0.2169567495584488, -0.12905879318714142, 0.021000171080231667, 0.005115516949445009, -0.7078286409378052, 0.5182911157608032, 0.4386076033115387, -0.6895049214363098, -0.2809768319129944, 0.3513564467430115, -0.2494857013225555...
def measure _ aux ( self, channel ) : raise notimplementederror ( " the method not implemented " )
[ -0.1272927224636078, -0.4273017346858978, 0.7712199687957764, -1.2815762758255005, -0.5538843870162964, 0.8316131830215454, -0.026641517877578735, -0.19879785180091858, 0.9912275075912476, -0.06977184861898422, -0.8793261647224426, 0.5055471062660217, 0.13663293421268463, 1.877466201782226...
def home ( request, id ='0') : form = noteform ( ) if id is none or id = ='0': notes _ list = note. objects. all ( ). order _ by ('- created _ date') else : notes _ list = note. objects. filter ( tags _ _ id = id ). order _ by ('- created _ date') tag _ list = tag. objects. all ( ) paginator = paginator ( notes _ list,...
[ 0.27335143089294434, -0.13663223385810852, 0.7427571415901184, 0.095380999147892, 0.8093401193618774, -0.22943438589572906, 0.1105366200208664, 0.07510008662939072, 0.6535568833351135, 0.13962619006633759, 0.12508326768875122, 0.2466622292995453, 0.5862113237380981, 0.916510820388794, -1...
def unpack _ contractions ( text ) : # standard text = re. sub ( r " ( \ b ) ( [ aa ] re | [ cc ] ould | [ dd ] id | [ dd ] oes | [ dd ] o | [ hh ] ad | [ hh ] as | [ hh ] ave | [ ii ] s | [ mm ] ight | [ mm ] ust | [ ss ] hould | [ ww ] ere | [ ww ] ould )n't ", r " \ 1 \ 2 not ", text ) text = re. sub ( r " ( \ b ) (...
[ -0.6270015835762024, -0.41081130504608154, 1.093339204788208, -0.5697116851806641, -1.4167505502700806, -0.13477885723114014, 0.6819214820861816, 0.69452965259552, 0.11718931049108505, 0.6896423697471619, -0.7781290411949158, -0.8216673135757446, -0.63687664270401, -0.008003131486475468, ...
def test _ create _ stages ( self ) : print'run create _ stages...'stages = self. long _ future. create _ stages ( ) self. assertequal ( type ( stages ), list ) for stage in stages : print stage self. assertequal ( type ( stage ), positionstage )
[ -0.25098904967308044, 0.45963606238365173, 0.3208181858062744, 0.014442158862948418, 0.957646369934082, 0.9031301736831665, -0.504696249961853, -0.6273152232170105, 0.020513096824288368, -0.7212649583816528, -0.6870632171630859, -1.324161410331726, 0.22802941501140594, 0.9132776856422424, ...
def remove _ gen _ mc _ sg ( self, ns _ key, g _ start, g _ count = 1, s _ start = none, s _ count = 1 ) : return self. _ add _ remove _ gen _ mc _ sg ( ns _ key, g _ start, g _ count, s _ start, s _ count, " remove " )
[ -0.6602556109428406, 0.2005169838666916, 0.535601794719696, 0.5139251947402954, -1.4376417398452759, -0.5364637970924377, 0.749045193195343, 0.1959969699382782, -0.4448235034942627, 0.7368147373199463, -0.4272269308567047, 0.13511686027050018, -0.5558200478553772, 0.35343003273010254, -0...
def get _ songs ( ) : songs = [ song. to _ dict ( ) for song in session. query ( song ). all ( ) ] return response ( json. dumps ( songs ), 200, mimetype = mimetype )
[ -0.9479384422302246, -0.8736528754234314, 0.47518202662467957, -0.14422321319580078, 0.7690653204917908, -0.020144905894994736, -1.1058298349380493, -0.27361977100372314, -0.4214068055152893, 0.7341164946556091, -0.9339849948883057, -0.08601213246583939, 0.22355736792087555, -0.42259502410...
def get _ last _ matches ( matches, team _ api _ id, date, x = 5 ) : team _ matches = matches [ ( matches ['home _ team _ api _ id'] = = team _ api _ id ) | ( matches ['away _ team _ api _ id'] = = team _ api _ id ) ] last _ matches = team _ matches [ team _ matches. date < str ( date ) ]. sort _ values ( by ='date ', ...
[ -0.24369657039642334, 0.2185928076505661, 0.5554207563400269, -0.3832038342952728, 0.46450304985046387, 0.14352279901504517, -0.6312434077262878, -0.9229372143745422, -0.6329561471939087, 0.3854132890701294, 0.38291987776756287, -0.016282645985484123, -0.051828883588314056, -1.119750976562...
def invalid _ spacing _ error ( ) : print ( " invalid size, choose again : " )
[ 1.8286815881729126, -0.6524425745010376, 0.1557856798171997, 0.5167582035064697, -0.1583726555109024, 0.4086289703845978, 0.6544912457466125, 0.42632120847702026, 0.7487654089927673, -0.4565761685371399, -0.07223690301179886, 1.1228151321411133, -0.5131140947341919, 0.40853172540664673, ...
def _ parallelize ( self ) : # start the day gevent. spawn ( self. _ capitalist ). join ( ) # do work. greenlets = gevent. joinall ( [ gevent. spawn ( self. _ prole ) for w in xrange ( self. num _ workers ) ] )
[ -0.34712138772010803, 0.7726021409034729, 0.5470349788665771, 0.13848942518234253, 0.994095504283905, 0.7295559644699097, -0.3129091262817383, 0.050297003239393234, -0.4599539339542389, -0.45854878425598145, 0.26637697219848633, -0.49705904722213745, -0.6634412407875061, 0.0037771391216665...
def make _ file _ name _ v1 ( self, final _ sweep ) : now = datetime. datetime. today ( ) nowstr = str ( now ). split ('' ) [ 0 ] +'_'+ str ( now ). split ('' ) [ 1 ] outstring = output _ prefix + " ta0 " + str ( self. target _ area ) \ + " _ f0 " + str ( final _ sweep ) \ + " _ started " + nowstr return outstring
[ -0.6287643313407898, -1.2497235536575317, 0.7993993163108826, -0.7963175177574158, -0.8154541254043579, 0.2888175845146179, 0.241139218211174, 0.6511056423187256, -0.32429102063179016, 0.3778126835823059, 0.9425182938575745, 0.09659584611654282, 1.5389949083328247, -0.18686550855636597, ...
def _ parse _ arguments ( self, arguments : t. optional [ str ] ) : if not arguments : return _ args = arguments. split ( ',') for arg in _ args : name, value = arg. split ('=') self. _ validate _ and _ set _ argument ( name, value )
[ -0.7410568594932556, 0.37380290031433105, 0.1715502142906189, -0.27197518944740295, 1.1016334295272827, -0.1800386905670166, -0.8629075288772583, 0.21033650636672974, -0.131195530295372, 0.9865252375602722, 0.12621846795082092, -0.1363208144903183, -0.36376315355300903, 0.18427495658397675...
def download _ file ( directory : str, source _ url : str, decompress : bool = false ) - > none : if isinstance ( directory, str ) : directory = path ( directory ) directory. mkdir ( parents = true, exist _ ok = true ) filename = source _ url. split ('/') [ - 1 ] filepath = path ( f'{ directory } / { filename }') # str...
[ 0.19361227750778198, 0.858043372631073, 0.835693359375, 0.5217683911323547, -0.07886610180139542, -0.8033673763275146, 0.42233502864837646, 0.2665199637413025, 0.19955067336559296, -0.5769969820976257, -0.5764505863189697, -0.27727216482162476, 0.3905118703842163, 0.3636791706085205, 0.0...
def is _ valid ( self, print _ warnings = none ) : # pylint : disable = too - many - branches warnings = [ ] # we should issue a warning if type is reserved and we are not # actually a reserved object. this check is removed for now because it # warrants significant code changes in sql / cass modules. # for files / data...
[ -0.14462651312351227, -0.25376391410827637, 0.8587496280670166, -0.4119921922683716, 0.5547967553138733, -0.34429943561553955, -0.6850360035896301, -0.2326270192861557, -0.3096587359905243, -0.2250048816204071, 0.16527758538722992, 0.6941372156143188, -0.11738278716802597, 0.88310831785202...
async def test _ discovery _ removal _ relay _ as _ light ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, caplog : pytest. logcapturefixture, setup _ tasmota, ) - > none : config1 = copy. deepcopy ( default _ config ) config1 [ " rl " ] [ 0 ] = 1 config1 [ " so " ] [ " 30 " ] = 1 # enforce home assistant auto -...
[ 0.6146442890167236, 0.4091951549053192, 0.33675169944763184, 0.48068350553512573, 0.1250208616256714, 0.3369162678718567, 1.1179143190383911, 0.5448195934295654, 0.7448675036430359, -0.5538690090179443, -0.6831921935081482, 0.009655415080487728, 0.4126601219177246, 0.9144200086593628, 0....
def solver _ numba ( x, y, theta, r, alpha, maxiter, tol, verbose, computeobj ) : n _ tasks = len ( x ) n _ samples, n _ features = x [ 0 ]. shape ls = utils. lipschitz ( x ) dg _ tol = tol * np. linalg. norm ( y ) * * 2 loss = [ ] for i in range ( maxiter ) : w _ max = 0. 0 d _ w _ max = 0. 0 for j in range ( n _ feat...
[ 0.4501381516456604, -0.3648664951324463, 1.2256333827972412, 0.4261918067932129, -1.4110068082809448, 0.23143450915813446, 0.6763592958450317, -0.27615368366241455, 0.020893462002277374, 0.40687990188598633, -0.0650944709777832, -0.319684237241745, 0.5173264145851135, 0.5161123275756836, ...
def pop ( self, index = 0 ) : return self. _ execute _ script ('pop ', self. key, index )
[ -0.8427643179893494, 0.8427780270576477, 0.4566713869571686, -0.1403692066669464, -0.04437645152211189, -0.6042376160621643, -0.06822017580270767, -0.8229323029518127, -0.4709169566631317, 1.0919923782348633, -0.03284196928143501, 0.23018181324005127, -1.4972447156906128, -1.05892586708068...
def answer ( request ) : response ='' response = bot. get _ response ( request ) # searching the bot response if float ( response. confidence ) > 0. 5 : # verify if the response is correct and reliably response = str ( response ) else : # if the response is not found, the function return the message below : response ='...
[ -0.06948123872280121, -0.9825913906097412, 0.5355478525161743, 0.5466035008430481, 0.208114892244339, 0.6561558842658997, -0.06511159241199493, -0.4952358305454254, 0.2050553411245346, -0.4060347080230713, 0.6670630574226379, -0.6463298797607422, -0.9013236165046692, -0.15525421500205994, ...
def composerewrite ( items ) : rewrite _ rules = [ ] # list to hold our rewrite rules for item in items : # skip any rows were all 3 fields are blank if ( item ['source']! = " " and item ['destination']! = " " and item ['redirect _ code']! = " " ) : # compose a new rewrite rule and add it to the list # grab the path pa...
[ -0.49366244673728943, -0.39155295491218567, 0.45499682426452637, 0.4516986906528473, 0.8074834942817688, -0.2179119884967804, -0.1708240658044815, 0.9149801135063171, -0.06730052083730698, 0.4349792003631592, 0.42796099185943604, -0.6158502697944641, 0.2867067754268646, 0.6474507451057434,...
def connect ( self ) : _ logger. debug ( " connecting with bridge " ) self. comfoconnect. connect ( true )
[ 0.10132278501987457, -0.415616512298584, 0.1760137975215912, 0.3441183567047119, 1.1834702491760254, 1.0450738668441772, 0.04264434799551964, 0.25571775436401367, -0.42662373185157776, -0.4875728487968445, -0.3196623921394348, -0.0742800235748291, -1.0320988893508911, 1.0890825986862183, ...
def get _ candidate _ penalty _ delta ( self, candidate _ rule, rules _ to _ remove ) : delta = 0. 0 delta - = self. _ get _ rule _ penalty ( candidate _ rule ) for rule in rules _ to _ remove : delta + = self. _ get _ rule _ penalty ( rule ) return delta
[ 0.48710009455680847, -0.4334541857242584, 0.7995239496231079, 0.40367281436920166, 0.19442030787467957, 0.6727346777915955, -0.24202167987823486, 1.447311520576477, -0.4580364227294922, 1.1054288148880005, 0.05248089134693146, 0.04467436671257019, -0.21192093193531036, -0.13167747855186462...
def load _ data ( database _ filepath ) : conn = sqlite3. connect ( database _ filepath ) df = pd. read _ sql ( " select * from my _ db ", con = conn ) x = df ['message'] y = df [ df. columns [ 4 : ] ] category _ names = df. columns [ 4 : ] return x, y, category _ names
[ -0.4320056736469269, 0.6493600010871887, 0.5260321497917175, -0.96232670545578, -0.03863128647208214, 0.14675630629062653, -0.6944418549537659, -0.7043284177780151, -1.3015296459197998, 0.19283901154994965, -0.18308864533901215, -0.15275877714157104, -0.703302264213562, -0.5341904759407043...
def select ( self, pos ) : if self [ pos ] is not none : insect = self [ pos ] if insect. color = = self. turn : self. insect = insect
[ -0.26492002606391907, -1.6617751121520996, 0.38619571924209595, -0.5515797138214111, 0.5637955069541931, -0.7402193546295166, -0.33898505568504333, -0.5583309531211853, 0.736592710018158, 0.09491632133722305, -0.2698075473308563, 0.440525621175766, -0.33853068947792053, -0.9402791261672974...
def net _ ads _ join ( user, pswd, password _ server ) : try : # print'aaa'errors = [ ] client = salt. client. localclient ( ) # cmd _ to _ run = " net ads join - s % s - u % s % % % s " % ( password _ server, user, pswd ) cmd _ to _ run = " net ads join - u % s % % % s " % ( user, pswd ) print'running % s'% cmd _ to _...
[ 0.04329223185777664, 0.3015265166759491, 0.8287206888198853, -0.1961638331413269, 0.25486326217651367, 1.2271558046340942, -0.10493091493844986, -0.379700243473053, -0.2343185693025589, 0.30039894580841064, 0.23523297905921936, 0.28498923778533936, -0.8012970089912415, 0.6862509846687317, ...
def download _ health ( self, ds ) : # must first open session with open _ session ( ) to log in to pems ts = 10 # default time to sleep logging. info ('initial time to sleep'+ str ( ts ) ) while true : try : logging. info ('start _ date :'+ str ( ds ) ) logging. info ('time to sleep'+ str ( ts ) ) # update the dynamic...
[ -0.027123255655169487, -0.6138776540756226, 1.1213194131851196, -0.26539891958236694, -0.36945924162864685, 0.7741492390632629, -0.48309126496315, -0.5284616947174072, 0.4368635416030884, -0.7216544151306152, 0.20486369729042053, 0.4956531226634979, -0.2627013921737671, 0.4704185724258423,...
def aws _ gax _ unhealthy _ endpoint _ group _ check ( cache : dict, session, awsaccountid : str, awsregion : str, awspartition : str ) - > dict : # iso time iso8601time = datetime. datetime. now ( datetime. timezone. utc ). isoformat ( ) for epg in list _ gax _ endpoint _ groups ( cache, session ) : # b64 encode all o...
[ -0.5629964470863342, -0.6391933560371399, 0.48077547550201416, -0.5560346841812134, 0.19083575904369354, -0.22759994864463806, -0.25568151473999023, -0.24022944271564484, -0.3559373915195465, 0.39823248982429504, 0.27376589179039, 0.2859407067298889, -0.06792807579040527, -0.16398388147354...
def write _ mohgp _ results ( organ, strain, path, fit, geneid ) : # extract the cluster assigned to each probe clustnum = np. argmax ( fit. phi, axis = 1 ) + 1 # cluster number clustname = [ strain +'_'+ organ [ : 2 ] +'_ % 02d'% i for i in clustnum ] # cluster name geneid ['cluster'] = clustname # add to data frame #...
[ 0.12004358321428299, -0.2894456684589386, 0.612053394317627, 0.3282964527606964, 0.25825589895248413, 0.27799224853515625, 0.7740070223808289, 0.6673067212104797, -0.7742310166358948, 0.40199100971221924, -0.12322341650724411, 0.9414410591125488, -0.6356562376022339, -0.45852503180503845, ...
def equals ( self, other ) : return super ( cpointvar, self ). equals ( other ) and ( self. domain = = other. domain )
[ 0.009319036267697811, -0.5936518311500549, 0.24915574491024017, 0.3072471618652344, -0.13513900339603424, 0.6531237959861755, -0.1534288078546524, -0.7860545516014099, 0.3868359327316284, -0.38561734557151794, -1.0101908445358276, 0.9097040295600891, -0.5873509049415588, 0.450671911239624,...
def _ _ init _ _ ( self, obj _ store ) : super ( windowsregistrypreprocess, self ). _ _ init _ _ ( obj _ store ) self. _ file _ path _ expander = winreg _ path _ expander. winregistrykeypathexpander ( obj _ store, none ) self. _ key _ path _ expander = none
[ 0.5849823951721191, 0.42002418637275696, 0.4684680700302124, 0.6221210360527039, -0.39363235235214233, -0.1361735463142395, 1.5292942523956299, 1.4875253438949585, 1.0043494701385498, 0.007883915677666664, -0.6889564990997314, -0.23157916963100433, -0.30447903275489807, 0.3948605954647064,...
def frame _ generator ( frame _ duration _ ms, audio, sample _ rate ) : n = int ( sample _ rate * ( frame _ duration _ ms / 1000. 0 ) * 2 ) offset = 0 timestamp = 0. 0 duration = ( float ( n ) / sample _ rate ) / 2. 0 while offset + n < len ( audio ) : yield frame ( audio [ offset : offset + n ], timestamp, duration ) ...
[ 0.4131409227848053, 0.05020619183778763, 0.6164199113845825, 0.5254075527191162, -0.3202284276485443, -0.3492538034915924, -0.4431784749031067, -0.10901126265525818, 0.5443817377090454, -0.06960899382829666, 0.12747488915920258, -0.10959029197692871, 0.6782403588294983, -0.0340594910085201...
def movie _ playing ( self ) : return self. movie _ playing _ value
[ -0.9227129220962524, -0.81288743019104, 0.5756336450576782, 0.9637036919593811, -0.04405970871448517, 1.0580320358276367, -0.26280948519706726, 0.10096621513366699, -0.17578019201755524, 0.24762162566184998, 0.25306570529937744, 0.9225889444351196, -0.7698487639427185, 0.39160531759262085,...
def prove _ tautology ( tautology : formula, model : model = frozendict ( ) ) - > proof : assert is _ tautology ( tautology ) assert tautology. operators ( ). issubset ( {'- > ','~'} ) assert is _ model ( model ) assert sorted ( tautology. variables ( ) ) [ : len ( model ) ] = = sorted ( model. keys ( ) ) # task 6. 3a ...
[ 0.22714518010616302, 0.12869925796985626, 0.49639892578125, 0.8792922496795654, 0.2366161197423935, -0.3049159646034241, 0.4321354925632477, -0.5263573527336121, -0.41221678256988525, 0.6709737181663513, -0.6721125245094299, -1.0519160032272339, -0.05105788633227348, 0.957763671875, -0.1...
def delta ( initial, final ) : return parse ( final ) - parse ( initial )
[ 0.3604110777378082, -1.0238298177719116, 0.5648036003112793, -0.44549816846847534, 0.3068849444389343, 0.3702239394187927, -0.47194844484329224, 0.9359428286552429, -1.6538234949111938, -0.3733271658420563, -0.2993042469024658, 0.1268097460269928, -0.003671026322990656, -1.0066945552825928...
def device _ name ( self ) - > pulumi. input [ str ] : return pulumi. get ( self, " device _ name " )
[ -0.007267681881785393, 0.42004507780075073, 0.42926180362701416, 0.7326252460479736, 0.22218000888824463, 1.3711744546890259, 0.58197021484375, 0.4547446668148041, 0.2618754208087921, -0.2155497819185257, 0.4040726125240326, 0.8705541491508484, 0.6370580196380615, -0.5067761540412903, 0....
def test _ get _ parameter _ type _ raw _ value ( self ) : pass
[ -0.8363645076751709, 0.3778061270713806, 0.7264574766159058, 0.5956709980964661, 0.0610184520483017, 0.14523206651210785, 0.43360257148742676, -0.5332901477813721, 0.011015049181878567, -0.3471044600009918, -0.38066554069519043, 0.4233763515949249, 0.22891974449157715, 0.6860681176185608, ...
def check _ gpu ( ) : print ( tf. config. list _ physical _ devices ('gpu') )
[ -0.019018027931451797, 0.5405352711677551, 0.40937042236328125, 1.5725034475326538, 1.0057923793792725, 0.4527505934238434, -0.2957479655742645, 0.23480330407619476, -0.9134536981582642, 0.3030235469341278, 0.3982280492782593, 1.2238014936447144, -0.01994241029024124, -0.055182166397571564...
def irc _ nick ( self, prefix, params ) : old _ nick = prefix. split ( '!') [ 0 ] new _ nick = params [ 0 ] self. atrusdata. log ( { " kind " : " user _ nick _ change ", " who " : old _ nick, " msg " : new _ nick } )
[ -0.3160153925418854, -0.48878127336502075, 0.40406784415245056, -0.4296131730079651, -0.2764294743537903, -0.8475028872489929, -0.20549575984477997, 0.238484725356102, -0.28838422894477844, 0.7072066068649292, -0.7056635618209839, 1.951249361038208, 0.5017902851104736, -0.3193945288658142,...
def affinity ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " affinity " )
[ 0.8017718195915222, -0.21892273426055908, 0.475385457277298, 0.6424660086631775, 0.7967326045036316, 1.2972437143325806, 0.42844972014427185, 0.014649885706603527, 0.714054524898529, 0.5170636177062988, 0.37657836079597473, 1.2981116771697998, 0.05114290118217468, -0.6553754806518555, 0....
def _ next _ relationship ( self, relationship _ list, joined _ tables ) : for relationship in relationship _ list : relationship _ obj = self. schema _ graph. relationship _ dictionary [ relationship ] if relationship _ obj. start in joined _ tables : return relationship _ obj, true for relationship in relationship _ ...
[ -0.20696504414081573, 0.3404867947101593, 0.5359413027763367, 0.39882153272628784, -0.8963140845298767, 0.5202893018722534, -0.13623037934303284, -0.08199407905340195, -0.5080002546310425, 0.058049291372299194, 0.036332935094833374, -0.5741672515869141, -1.353377342224121, 0.14284987747669...
def cmp _ to _ key ( mycmp ) : class k ( object ) : def _ _ init _ _ ( self, obj, * args ) : self. obj = obj def _ _ lt _ _ ( self, other ) : return mycmp ( self. obj, other. obj ) < 0 def _ _ gt _ _ ( self, other ) : return mycmp ( self. obj, other. obj ) > 0 def _ _ eq _ _ ( self, other ) : return mycmp ( self. obj, ...
[ -0.6991480588912964, -1.241857886314392, 1.0388284921646118, -0.35142219066619873, -0.9737302660942078, 0.5491024255752563, 0.5919942259788513, -0.6149170994758606, 0.22415076196193695, -0.0392911471426487, -0.6118181943893433, -0.7218760848045349, -0.25774380564689636, 0.33878767490386963...
def fahrenheit _ converter ( value, convert _ to ) : if convert _ to = = " °c " : return f " { str ( round ( ( value - 32 ) * 5 / 9, 2 ) ) } { convert _ to } " elif convert _ to = = " k " : return f " { str ( round ( ( value - 32 ) * 5 / 9 + 273. 15, 2 ) ) } { convert _ to } "
[ -0.04518930986523628, -0.6160468459129333, 0.5029744505882263, -0.47438958287239075, -0.6791519522666931, -0.2254733294248581, -0.3665905296802521, -0.2775213420391083, -0.76041579246521, 0.7666120529174805, 0.1001807153224945, -0.29687386751174927, 0.30748000741004944, 0.4604233205318451,...
def contact ( ) : return render _ template ('contact. html ', title ='contact ', year = datetime. now ( ). year, message ='your contact page.')
[ 0.7788785099983215, -0.3293394446372986, 0.6143810749053955, 0.19165493547916412, -0.603891909122467, 0.14910319447517395, -0.0558006577193737, 0.2596426010131836, -0.4451691806316376, 0.6623568534851074, 0.8209853172302246, -0.6342554688453674, -0.08238182961940765, 0.36366158723831177, ...
def _ jiggle _ bbox ( img, bbox, size, jig _ amt = 5 ) : n = random. randint ( - jig _ amt, jig _ amt ) imgh, imgw, _ = img. shape x, y, w, h = bbox x, y = x + w / 2 - size / 2 + n, y + h / 2 - size / 2 + n x, y = max ( x, 0 ), max ( y, 0 ) x, y = min ( x, imgw - size ), min ( y, imgh - size ) return img [ y : y + size...
[ -0.168158620595932, -0.40743905305862427, 0.8634459972381592, -0.4952302873134613, -0.46077778935432434, -0.1870006024837494, 0.3653862178325653, -0.7079755663871765, 1.1316907405853271, -0.06471340358257294, 0.23418401181697845, 0.32512205839157104, -0.12699396908283234, -0.14049071073532...
def key _ press _ callback ( self, event ) : # check that the event is in an axis... if not event. inaxes : return #... but not the information box! if event. inaxes = = self. axes ['info'] : return axisid = self. get _ axisid ( event ) self. operations ( event. key, axisid, event )
[ 0.4417076110839844, 0.33391809463500977, 0.5492492914199829, 0.560511589050293, -0.17975762486457825, -0.21733398735523224, 1.2815742492675781, -0.19357901811599731, 0.4675239026546478, -0.005636359099298716, 0.39448273181915283, -0.40997010469436646, -0.02231842838227749, -0.5480359196662...
def save _ data _ to _ file ( file _ name, list _ of _ product _ objects ) : with open ( file _ name, " wb " ) as fh : try : pickle. dump ( list _ of _ product _ objects, fh ) return true,'success'except pickle. picklingerror as e : error _ message = " " " error detected while trying to pickle object to file { }. objec...
[ -0.8759762048721313, -0.41660481691360474, 0.7965477705001831, 0.5422807335853577, 0.9956156611442566, 0.6763786673545837, 0.8662881851196289, -0.136649951338768, -1.016165852546692, 0.6524791717529297, -1.406542420387268, -0.7553979158401489, -0.2001504749059677, -0.000537683954462409, ...