text
stringlengths
25
2.19k
embedding
listlengths
768
768
def increment ( self, num _ samples ) : if num _ samples < 0 : raise valueerror ('sample buffer read increment cannot be negative.') else : if num _ samples > = len ( self ) : # increment will skip over all available samples self. _ arrays. clear ( ) self. _ stored _ start _ index = self. _ stored _ end _ index self. _...
[ 0.0485030822455883, -0.9137853384017944, 0.6915228962898254, 0.2399756759405136, 0.1763974130153656, 0.7904406189918518, 1.0797206163406372, -0.28774210810661316, 0.2062363475561142, -0.7405890226364136, 0.04246179759502411, 0.49794408679008484, -0.1530465930700302, -0.4767620861530304, ...
def parse ( self ) : kml = kml ( ) super ( ). save _ file ( ) kml. from _ string ( open ( self. file _ obj ). read ( ). encode ('utf - 8') ) center = [ 0, 0 ] # get the base folder object from kml folder _ object = list ( list ( kml. features ( ) ) [ 0 ]. features ( ) ) # get the placemark tags from kml placemarks = li...
[ 0.09393246471881866, -0.5023106932640076, 0.6634390950202942, -0.22699296474456787, -0.002246581483632326, 0.6420919299125671, 0.27599960565567017, 0.8567715883255005, -0.09901927411556244, 0.8061016201972961, -0.6465251445770264, -0.7630345821380615, -0.23385992646217346, -0.0228949673473...
def _ _ replace _ spaces _ in _ string ( self, line ) : for match in re. finditer ( string _ const _ regex, line ) : if match : start _ ind, end _ ind = match. span ( ) mid _ line = line [ start _ ind : end _ ind ] line = line [ 0 : start _ ind ] + mid _ line. replace ( space _ char, new _ line ) + line [ end _ ind : ]...
[ 0.7922408580780029, -0.5545873641967773, 0.45355501770973206, -0.18081821501255035, 0.22213268280029297, -0.18447868525981903, 0.5073236227035522, 1.1811285018920898, -0.49428221583366394, -0.08879276365041733, 0.21142517030239105, 0.4317522346973419, -0.1671942174434662, 0.112950608134269...
def get _ subjects _ for _ specific _ user _ by _ admission ( self, admission _ no ) : self. curr. execute ( " " " select un. unit _ name, un. unit _ code, us. admission _ no, us. firstname, us. lastname, us. surname from subjects as s inner join units as un on s. unit = un. unit _ name inner join users as us on s. stu...
[ 0.16367822885513306, -0.23149150609970093, 0.4726421535015106, -0.2672266364097595, -0.7177150845527649, 0.004270576406270266, 0.32016515731811523, -0.5499283671379089, -0.21256497502326965, 0.14622578024864197, 0.513670802116394, 0.8991751670837402, 0.6074895262718201, 0.15390877425670624...
def checkcameraposition ( self ) : threshold = 0. 3 # defines the boundaries as a percentage of screensize w, h = self. screen. get _ size ( ) character _ x, character _ y = self. character. rect. center x _ threshold = ( w * threshold, w - w * threshold ) # left and right y _ threshold = ( h * threshold, h - h * thres...
[ -0.25374922156333923, -0.9405077695846558, 0.9200122952461243, 0.2660338580608368, 0.09945037961006165, -0.49048933386802673, -0.2235363870859146, -0.587655246257782, 0.45852160453796387, 0.3841359615325928, -0.37479764223098755, -0.39503201842308044, -0.5250524282455444, 0.411413162946701...
def has _ attribute _ type ( self, attribute : str, typ : type ) - > bool : if not self. has _ attribute ( attribute ) : return false attr _ node = self. get _ attribute ( attribute ). yaml _ node if typ in scalar _ type _ to _ tag : tag = scalar _ type _ to _ tag [ typ ] return attr _ node. tag = = tag elif typ = = li...
[ -0.16206014156341553, -0.7773116827011108, 0.48121556639671326, -0.021780287846922874, 0.2862697243690491, -0.4935520887374878, 0.17434749007225037, -0.4012300968170166, 0.7279670834541321, 0.3208748996257782, 0.4297019839286804, 1.0438185930252075, 0.6303086280822754, 0.6179695725440979, ...
def gen _ full _ alignment ( self ) : # get only the focus columns for seq _ name, sequence in self. seq _ name _ to _ sequence. items ( ) : # replace periods with dashes ( the uppercase equivalent ) sequence = sequence. replace ( ". ", " - " ) # then get only the focus columns self. seq _ name _ to _ sequence [ seq _ ...
[ -0.19674688577651978, -0.4483879506587982, 0.7541700005531311, -0.42399898171424866, -0.4226371645927429, -0.6498518586158752, 0.515386700630188, 0.6402693390846252, -0.3046862781047821, 0.9095507860183716, -0.18624642491340637, 0.0751107782125473, 0.09007252752780914, -0.06212719157338142...
def has _ section ( self, section ) : return self. cf. has _ section ( section )
[ -0.2921403646469116, 0.4162461459636688, 0.30078572034835815, 0.522463858127594, 0.5777539610862732, -0.7384780049324036, -0.2224276214838028, -0.06862388551235199, -0.8112255334854126, -0.5738142728805542, -0.07177958637475967, -0.616726279258728, 0.6031532287597656, 1.683964490890503, ...
def bulkcreate ( self, layer ) : uploads = self. get _ uploads ( ) index = 0 created _ resource _ ids = [ ] error = none try : while true : resource _ type = self. request. get ('type % d'% index ) name = self. request. get ('filename % d'% index ) url = self. request. get ('url % d'% index ) blob = self. get _ uploads...
[ -1.0768101215362549, 0.023746734485030174, 0.6351147890090942, -0.035890690982341766, 0.8691829442977905, -0.3876553475856781, 0.7678661942481995, -0.8944479823112488, -0.41978076100349426, -0.04845639690756798, 0.01016766857355833, -0.5617348551750183, -0.0739225223660469, 0.5882309675216...
def _ compute _ harmonics ( self, orders ) : return frequencymaths. compute _ harmonics ( self. stimulation. frequencies, fmin = self. fmin, fmax = self. fmax, orders = orders )
[ -0.18154628574848175, 0.5184728503227234, 0.34686997532844543, 0.7479384541511536, -0.19289855659008026, -0.6763811707496643, -0.556516706943512, -0.3617619276046753, -0.1488884836435318, -0.6015886664390564, 0.8316681981086731, -0.08500778675079346, 0.11679929494857788, -0.614302814006805...
def on _ key _ down ( self, event ) : if self. guimode is none : # try custom tool of metacanvas input = self. set _ keypress ( event ) # print'on _ key _ down ', input self. metacanvas. make _ transition ( input, self )
[ 0.3825238049030304, 0.258273184299469, 0.4375665485858917, 0.4201054573059082, -0.7137672901153564, 0.5899603962898254, 0.5699055790901184, -0.06738831847906113, -0.006937034428119659, -0.19161267578601837, -0.7119976282119751, 0.22472326457500458, 1.0235649347305298, 0.6486945748329163, ...
def process _ service _ create _ data ( smodelctx, sdata, dev, * * kwargs ) : modify = true if modify and kwargs is not none : for key, value in kwargs. iteritems ( ) : log ( " % s = = % s " % ( key, value ) ) if modify : config = kwargs ['config'] inputdict = kwargs ['inputdict'] inputkeydict = kwargs ['inputkeydict']...
[ -1.0485557317733765, -0.015653932467103004, 0.7111073136329651, -0.08156657218933105, -0.03245832771062851, 0.8464439511299133, 0.007278448902070522, 0.24221943318843842, 0.6386967897415161, 0.2906925678253174, -0.1531464159488678, -0.2924586236476898, -0.0797678753733635, 0.69796615839004...
def write ( self, cmdlist ) : doc = xml. dom. minidom. document ( ) productnode = doc. createelementns ( " ", " product " ) cmdsnode = doc. createelementns ( " ", " commands " ) productnode. appendchild ( cmdsnode ) doc. appendchild ( productnode ) for cmd in cmdlist. allcommands ( ) : cmdsnode. appendchild ( self. _ _...
[ -0.5583145618438721, 0.06410779058933258, 0.5978438258171082, 0.8669552206993103, 0.37336573004722595, 0.11931711435317993, 0.8044409155845642, -0.047777339816093445, 0.5725436210632324, -0.5282825231552124, -0.3969273865222931, -0.43796226382255554, 0.38953036069869995, 1.2227389812469482...
def char _ list ( list _ val ) : return sum ( [ len ( val ) for val in list _ val ] )
[ -0.10090290009975433, 0.07784779369831085, 0.4698801040649414, -0.3674353063106537, 0.4150114059448242, 0.11305630952119827, -0.38891279697418213, 0.8751969933509827, 0.7060120701789856, 0.2767454981803894, -1.954531192779541, -0.28602975606918335, 0.5456234216690063, 0.5478343367576599, ...
def set _ led _ states ( self, state ) : assert len ( state ) = = self. led _ count with self. buffer _ lock : self. current _ state = state self. framebuffer = [ prev or new for prev, new in zip ( self. framebuffer, state ) ]
[ -0.9661480188369751, -0.20166277885437012, 0.40105462074279785, -0.21349546313285828, -0.14606931805610657, 0.385882169008255, 0.44470590353012085, -0.7157815098762512, 0.863806426525116, -0.32148128747940063, -1.3796106576919556, 0.17983293533325195, -0.9084629416465759, 1.259045362472534...
def get _ diff _ weights ( geotargets, goal = 100 ) : # avoid divide by zero or other problems # numerator = np. full ( geotargets. shape, goal ) # with np. errstate ( divide ='ignore') : # dw = numerator / geotargets # dw [ geotargets = = 0 ] = 1 goalmat = np. full ( geotargets. shape, goal ) with np. errstate ( divid...
[ -0.8742889165878296, -0.1420917809009552, 0.29896169900894165, 0.8255661129951477, 0.10140487551689148, 0.21563221514225006, 0.5711625218391418, -0.1684119552373886, -0.4235078990459442, 0.7367527484893799, 0.8253704905509949, 0.13316546380519867, 0.1483904868364334, 0.686631441116333, 0...
def nansum _ with _ nan _ for _ empty ( values, axis = none ) : result = np. nansum ( values, axis = axis ) reset = np. sum ( ~ np. isnan ( values ), axis = axis ) if np. isscalar ( result ) : if reset = = 0 : return np. nan else : return result else : result [ reset = = 0 ] = np. nan return result
[ -0.2926757037639618, 0.5420406460762024, 0.4728638231754303, 1.0811556577682495, 0.1091577336192131, -0.3289584815502167, 0.5404606461524963, -0.8403044939041138, 0.14570669829845428, 0.13698223233222961, -0.09438508003950119, 0.7029269337654114, 0.3337388038635254, -0.34782102704048157, ...
def insertview ( self, win, tabwidget, index, fn = none, noname = " " ) : editor = win. geteditor ( ) if fn is none : if not noname : self. untitledcount + = 1 noname = self. tr ( " untitled { 0 } " ). format ( self. untitledcount ) tabwidget. insertwidget ( index, win, noname ) editor. setnoname ( noname ) else : if s...
[ -0.36390507221221924, -0.01786183938384056, 0.7220779657363892, -0.2405168116092682, -0.5731462240219116, -0.18532977998256683, 0.4230220913887024, 0.5513787269592285, -0.4844017028808594, -0.2896491289138794, -0.2633610963821411, -0.4772268533706665, 0.15714474022388458, 0.348998308181762...
def persist ( self, path ) : path = path ( path ) path. mkdir ( ) sorted _ slot _ fillers = sorted ( iteritems ( self. slot _ fillers ) ) slot _ fillers = [ ] for i, ( intent, slot _ filler ) in enumerate ( sorted _ slot _ fillers ) : slot _ filler _ name = " slot _ filler _ % s " % i slot _ filler. persist ( path / sl...
[ -0.5344902873039246, -0.5691623687744141, 0.5737505555152893, -0.6908188462257385, 0.7289240956306458, 0.9622225165367126, 0.9660553336143494, 0.07838185131549835, 0.1758222132921219, -0.22748076915740967, -0.7798295021057129, 0.010805200785398483, -0.2523753046989441, 0.4577266573905945, ...
def heapify ( self, index = none, max _ index = none ) : raise notimplementederror ('algorithm should be implemented')
[ -0.05107783526182175, 0.5991408824920654, 0.4519616961479187, 0.19049158692359924, 0.5308690071105957, 0.2453494817018509, -1.0223002433776855, 0.2550651431083679, 0.49280259013175964, -0.2666017711162567, -0.6175628304481506, 0.6212552189826965, 0.21777461469173431, -0.23825344443321228, ...
def getvirtualaddress ( self ) - > int :...
[ 0.1030123308300972, -0.47720101475715637, 0.5380786657333374, 0.5563969016075134, 0.006136277224868536, -0.6002465486526489, 0.6380193829536438, 0.5055477023124695, 0.6535321474075317, -0.014444708824157715, -0.14233465492725372, 1.7482703924179077, -0.8363692760467529, -1.155676245689392,...
def get _ android _ manifest _ xml ( self ) : try : return self. _ xml [ " androidmanifest. xml " ] except keyerror : return none
[ 0.4368407130241394, -0.8020238876342773, 0.12345383316278458, -0.19070856273174286, -0.6376613974571228, -0.3341003358364105, -1.2760345935821533, -0.4602876901626587, 1.041145920753479, -0.46990105509757996, 1.1891015768051147, 0.271586149930954, 0.09669617563486099, 0.03140728548169136, ...
def is _ on ( self ) - > bool : return self. _ api. is _ on
[ -0.28205227851867676, -0.16454638540744781, 0.33147740364074707, 0.8902684450149536, 0.5672296285629272, -0.17485755681991577, -1.6199822425842285, 0.6109651923179626, 0.3938094973564148, 0.1715226173400879, -0.6364880800247192, 0.9131627082824707, -1.238821268081665, -0.5032639503479004, ...
async def _ negotiate _ transport ( self ) - > transport : self. _ incoming _ queue = asyncio. queue ( maxsize = self. _ max _ pending _ count ) http _ session = await self. _ get _ http _ session ( ) transport = create _ transport ( default _ connection _ type, url = self. url, incoming _ queue = self. _ incoming _ qu...
[ -0.47018444538116455, -0.5160505771636963, 0.6564552187919617, -0.0913575068116188, 0.7143912315368652, -0.6971238851547241, -0.7207204103469849, -0.8799027800559998, -0.38810816407203674, -0.719108521938324, -0.01397042628377676, 0.49815815687179565, -0.5227844715118408, 0.090954065322875...
def ecrantocam ( self, p ) : return self. etoc @ p
[ -0.09259501099586487, -0.4222635328769684, 0.1171516552567482, -0.7062974572181702, 0.061359114944934845, 0.45319807529449463, 0.134240984916687, -0.7243796586990356, -0.13440635800361633, 0.3531047999858856, 0.7957301735877991, -0.36885446310043335, 0.17879623174667358, -1.408633947372436...
def delete _ on _ termination ( self ) - > optional [ pulumi. input [ bool ] ] : return pulumi. get ( self, " delete _ on _ termination " )
[ 0.9577093720436096, -0.05155782774090767, 0.567216157913208, 0.9206065535545349, 0.1925012618303299, 1.0165694952011108, -0.7531551718711853, 0.12665709853172302, 0.5759928226470947, 0.8734838962554932, -0.6376994252204895, 0.4393329322338104, -0.5623825192451477, -0.947784423828125, -0....
def upstream _ key _ iterator ( self, asset _ key : assetkey ) - > iterator [ assetkey ] : visited : set [ assetkey ] = set ( ) queue = deque ( [ asset _ key ] ) while queue : current _ key = queue. popleft ( ) if self. is _ source ( current _ key ) : continue for parent _ key in self. get _ parents ( current _ key ) :...
[ -1.239469289779663, 0.07389985769987106, 0.7008106708526611, -1.5076959133148193, -1.169986367225647, 0.14215804636478424, 0.723506510257721, -0.8031675815582275, -0.1417733132839203, 0.9867541790008545, -0.013076123781502247, 0.7228642702102661, 0.21144434809684753, 0.47779637575149536, ...
def _ _ init _ _ ( self, elem, service ) : # todo - examine the parent for bounding box info. # self. _ parent = parent self. _ elem = elem self. _ service = service self. id = elem. find ( ns ('name') ). text self. title = testxmlvalue ( elem. find ( ns ('label') ) ) self. abstract = testxmlvalue ( elem. find ( ns ('d...
[ 0.06446833908557892, -0.02275032550096512, 0.5420441627502441, -0.014725342392921448, -0.5132846832275391, -0.20526620745658875, -0.20243848860263824, -0.8875424861907959, 0.17680694162845612, -0.3092512786388397, 0.10091719776391983, 0.22867387533187866, -0.13529419898986816, 0.2063696533...
def part _ encode ( part ) : return str ( part ). replace ( " ~ ", " ~ 0 " ). replace ( " / ", " ~ 1 " )
[ -0.11553022265434265, -1.3538051843643188, 0.3128238022327423, 0.2242969572544098, -0.9970541000366211, 0.3847137987613678, 0.41707175970077515, 0.15888534486293793, -0.07264125347137451, 0.0689963698387146, -0.2038828730583191, -0.3070437014102936, -1.2413638830184937, -0.2513274550437927...
async def test _ get _ pins ( v3 _ server, v3 _ settings _ response ) : v3 _ server. get ( ( f " https : / / api. simplisafe. com / v1 / ss3 / subscriptions / { test _ subscription _ id } " " / settings / normal? forceupdate = false " ), status = 200, body = v3 _ settings _ response, ) async with aiohttp. clientsession...
[ -0.11152078956365585, 1.1459758281707764, 0.46967223286628723, -0.06275235116481781, 1.2039518356323242, 0.047588229179382324, 0.06347507238388062, -0.21482066810131073, 1.2882076501846313, 0.08835426717996597, -1.3493698835372925, 0.9405101537704468, -0.21971027553081512, -0.7599143981933...
def _ _ init _ _ ( self, name ) : self. name = name credentials = current _ app. config ['oauth _ credentials'] [ name ] self. id = credentials ['id'] self. secret = credentials ['secret']
[ -0.12810972332954407, -1.0293010473251343, 0.47515320777893066, 0.2347286343574524, -0.7145523428916931, -0.01793273352086544, -1.1923859119415283, -0.13959889113903046, 0.3052771985530853, 0.4334677457809448, -1.0650206804275513, 0.08071499317884445, 0.08236370235681534, 0.112942919135093...
def addattendees ( event, i ) : # find the last created line created = event. rfind ('created') # insert the attendees before it. return event [ : created ] +''. join ( attendees ) + event [ created : ]
[ 0.17131371796131134, -0.8385570049285889, 0.5454151630401611, -0.9343256950378418, 0.5567835569381714, 0.23527583479881287, -0.35249385237693787, 0.30661460757255554, -0.27820348739624023, 0.5446265339851379, 0.07415410131216049, -0.01293802261352539, 0.42144614458084106, -0.79176408052444...
def get _ instrument _ filters ( instrument ) : return os. listdir ( path _ lepharedir + " / filt / " + instrument. lower ( ) )
[ -0.7758549451828003, -0.10184252262115479, 0.6805388331413269, -0.09603092819452286, 0.2285514771938324, 0.4857105612754822, 0.30296221375465393, -0.4433777928352356, 0.06070169061422348, 0.04294774681329727, -0.2009866088628769, 0.5783905982971191, -0.31377241015434265, 0.6838442087173462...
def overlap _ tile ( self, comptile ) : for tile in self. all _ tiles : if tile. coor = = comptile. coor : return true return false
[ 0.024349743500351906, -0.23573413491249084, 0.6201204061508179, 0.0907883495092392, -0.10978744924068451, 1.00171959400177, 0.3094528615474701, 0.09709232300519943, -0.8338545560836792, 0.43834197521209717, -0.2710619270801544, -0.7115883231163025, -1.0733977556228638, 0.5095415711402893, ...
def make _ move ( self, move : int ) : self. board [ move - 1 ] = self. nplayer
[ -1.3637135028839111, 0.6709766983985901, 0.5305727124214172, 0.10199436545372009, 0.5131939053535461, 0.07696876674890518, 0.6207199096679688, -0.18641266226768494, -0.01853921450674534, 0.14523200690746307, -1.1097328662872314, 0.04514570161700249, -0.8706631660461426, 0.01230967510491609...
def display _ image ( self, img : image ) - > none : try : # if there is already an image there, remove it if self. image _ label : self. image _ label. image = none # properly display the loaded image img = imagetk. photoimage ( self. resize _ image ( img ) ) self. image _ label = label ( self. image _ box, image = im...
[ -0.573429524898529, 0.015228355303406715, 0.3911169767379761, -0.56048184633255, -0.19579538702964783, 0.224325492978096, 0.698277473449707, 0.4492190480232239, 0.6235119700431824, 0.14436215162277222, 0.9601271748542786, 0.25076353549957275, 0.15178027749061584, 1.0505437850952148, 1.05...
def mean _ squared _ end _ to _ end ( simname, coords _ loc = [ 3, 6 ] ) : coords, bs = extract. extract _ unwrapped ( simname, first _ only = true, boxsize = true ) rend _ list = [ none ] * len ( coords ) all _ chains = list ( coords ['timestep _ 0']. mol. unique ( ) ) rend _ inner _ list = [ none ] * len ( all _ chai...
[ -0.4926711320877075, -0.5558682680130005, 0.8171698451042175, -0.7510957717895508, 0.2553562521934509, -0.7559635639190674, 0.09635330736637115, -0.033049728721380234, 0.0939972922205925, 0.6166703104972839, -0.5718755722045898, 0.3775111436843872, 0.1296955943107605, -0.1075010672211647, ...
def get _ roledefs ( hostinfo ) : # init a dictionary with an empty list for all tags specified in the hosts - dict roledefs = { } env. hostinfo = hostinfo all _ tags = set ( itertools. chain ( * [ d. keys ( ) for d in hostinfo. values ( ) ] ) ) for tag in all _ tags : roledefs [ tag ] = [ ] # convert host information ...
[ 0.1427830010652542, -0.2798473834991455, 0.27079567313194275, -0.5466268658638, 0.20383761823177338, 0.09626926481723785, -0.972208559513092, 0.6316739916801453, -1.2537535429000854, 0.06991390883922577, -1.0752959251403809, 0.24619901180267334, 0.23444980382919312, 1.6618127822875977, 0...
def invoke _ webhook ( self, appdata, config _ file, action, env, user ) : envset = [ ] commandsset = [ ] self. function _ execution _ start _ time = datetime. now ( ) self. webhooksetting ( ) self. configlevelsettings ( config _ file ) self. action = action self. envr = env self. user = user self. app _ name = appdata...
[ 0.5486760139465332, -0.6289536356925964, 0.844467282295227, 0.4815255105495453, 0.6503672003746033, -0.05237315222620964, -0.1174955815076828, 0.3098585903644562, -0.7566870450973511, 0.6014084815979004, 0.23038522899150848, 0.5056141018867493, 0.40954214334487915, 1.2198604345321655, 0....
def corner _ floor _ to _ vert _ groups ( obj, vert _ locs, native _ subdivisions ) : select ( obj. name ) mode ('edit') deselect _ all ( ) ctx = {'object': obj,'active _ object': obj,'selected _ objects': [ obj ] } # make vertex groups obj. vertex _ groups. new ( name ='leg 1 end') obj. vertex _ groups. new ( name ='l...
[ 0.43588778376579285, -0.667889416217804, 0.7264807820320129, -0.20667362213134766, -0.313006192445755, 0.21996480226516724, 0.8902913331985474, -0.8155589699745178, -0.5438910722732544, 0.18006227910518646, -0.3683985769748688, 0.12989413738250732, 0.0025454270653426647, 0.0810208395123481...
def add _ host ( self, host ) : return uribuilder ( scheme = self. scheme, userinfo = self. userinfo, host = normalizers. normalize _ host ( host ), port = self. port, path = self. path, query = self. query, fragment = self. fragment, )
[ -0.49656757712364197, 0.002636135555803776, 0.5772112607955933, 0.7911829948425293, -0.6744295954704285, 0.6715090870857239, -0.40148109197616577, 0.8813469409942627, 0.4896406829357147, -1.524106740951538, 0.12995803356170654, -0.6645668745040894, -1.2205901145935059, -0.6476508975028992,...
def compare _ anagrams ( self, file ) : with open ( file, " r " ) as file : for line in file : if line [ : - 1 ] in self. anagrams : print ( line [ : - 1 ] ) self. counter + = 1
[ 0.9728512167930603, -0.34847885370254517, 0.4925253093242645, 0.09295118600130081, -0.1631283313035965, 0.5226381421089172, 0.47115281224250793, -0.3973712921142578, -0.7253881096839905, 0.7774098515510559, -0.1213926300406456, 0.7552287578582764, -0.5031588077545166, 0.7977148294448853, ...
def _ _ init _ _ ( self, spread = 0. 0 ) : self. spread = spread
[ 1.2598966360092163, -0.7304542064666748, 0.6655938029289246, 0.6574852466583252, -0.5746436715126038, 0.6109501123428345, -0.23486410081386566, 0.7874901294708252, 0.9294331073760986, -0.9528217315673828, 0.42350175976753235, -0.3239012360572815, -0.3073069453239441, 1.26035737991333, 0....
def _ _ to _ list ( cad ) : lista = [ ] aux1 = cad [ 0 ] aux2 = cad [ 0 ] for i in range ( 1, len ( cad ) ) : if cad [ i ] = = aux1 : aux2 + = cad [ i ] if i = = len ( cad ) - 1 : lista. append ( aux2 ) else : lista. append ( aux2 ) aux2 = cad [ i ] aux1 = cad [ i ] return lista
[ -0.13258683681488037, -0.09765806794166565, 0.5524753332138062, -0.40132763981819153, 0.36266130208969116, -0.06677154451608658, 0.020914120599627495, -0.06853438913822174, 1.063490867614746, 0.628890872001648, -1.1180087327957153, 0.5716423392295837, 0.3065026104450226, 0.0799396187067031...
def hung _ serviceitem _ rate ( cls, staff, date _ min, date _ max, staff _ data ) : staff _ data. volume = 0 staff _ data. conversion _ rate = " 0 % " staff _ data. open _ number = 0 staff _ data. open _ rate = " 0 % " staff _ data. activation _ number = 0 staff _ data. activation _ rate = " 0 % " staff _ data. new _ ...
[ -0.4530356228351593, -0.10954384505748749, 0.7114155888557434, 0.017440028488636017, 0.3471669554710388, 0.5026493668556213, -0.34441596269607544, -0.2484089583158493, -0.5425742268562317, 0.10678209364414215, 0.23432911932468414, 0.31680765748023987, 0.15632842481136322, 0.357622385025024...
def setsize ( self, size : int ) - > none :...
[ -0.5667234659194946, 0.9867515563964844, 0.16432976722717285, 0.10516034066677094, 0.2911214232444763, 0.3313985764980316, 0.811716616153717, -0.046477220952510834, 0.15167957544326782, -1.13094961643219, -1.3083242177963257, 0.25855281949043274, -0.36165571212768555, 0.08492546528577805, ...
def copy _ values _ from ( self, bus ) : if not isinstance ( bus, bus ) : raise exception ( " error : invalid input " " " ) if bus. width! = self. _ width : raise exception ( " error : width of both the busses must be same " ) self. set _ voltage _ all ( bus. get _ voltage _ all ( ) )
[ -0.6451780796051025, -0.045029617846012115, 0.6741668581962585, 1.5470600128173828, -0.5349238514900208, 0.928589403629303, -0.32505521178245544, 0.07741909474134445, 0.5002543330192566, -0.18864411115646362, -0.13914720714092255, 0.6029248833656311, -0.9638479948043823, 1.1591994762420654...
def get _ depth ( depth _ stream ) : while true : dmap = np. fromstring ( depth _ stream. read _ frame ( ). get _ buffer _ as _ uint16 ( ), dtype = np. uint16 ). reshape ( resy, resx ) # works & it's fast d4d = np. uint8 ( dmap. astype ( float ) * 255 / 2 * * 12 - 1 ) # correct the range. depth images are 12bits d4d = ...
[ -0.44903361797332764, -0.04711930826306343, 0.8114433884620667, -0.1682845801115036, -0.31174027919769287, -0.5031061172485352, 0.7802790999412537, -0.5580411553382874, 0.3609277307987213, -0.2057252675294876, -0.5100947022438049, 1.0367709398269653, 0.1078905239701271, 0.7000663876533508,...
def scanexistingdevices ( self ) : for serial, d in self. devices. items ( ) : print " checking % s for a vaild handle. " % serial if not labjackpython. ishandlevalid ( d. handle ) : # we lost this device self. devicecountsbytype [ d. devtype ] - = 1 d. close ( ) print " deleting device ", self. devices [ serial ] self...
[ -0.4376186430454254, 0.08246071636676788, 0.5075493454933167, 0.11524253338575363, 0.23403628170490265, 0.11618481576442719, 1.0448189973831177, -0.30032336711883545, 0.9589880704879761, -0.5073745846748352, 1.0574989318847656, 0.2171585112810135, -0.9711435437202454, 1.3534175157546997, ...
def enable _ incremental _ dataset _ refresh ( self ) - > optional [ bool ] : return pulumi. get ( self, " enable _ incremental _ dataset _ refresh " )
[ 0.4706342816352844, 0.39723843336105347, 0.5567036271095276, 0.7240273952484131, -0.7958428859710693, 1.6373775005340576, 0.12987983226776123, 0.0583639033138752, 0.24275712668895721, -0.41649577021598816, 0.05652016028761864, 1.024512529373169, -0.7558320164680481, -0.9602563381195068, ...
def compute _ mean _ std _ dataset ( data ) : means = [ ] stdevs = [ ] for i in range ( data. shape [ 1 ] ) : pixels = data [ :, i, :, : ]. numpy ( ). ravel ( ) means. append ( np. mean ( pixels ) ) stdevs. append ( np. std ( pixels ) ) return means, stdevs
[ -0.4571027159690857, -0.07214200496673584, 0.3338332772254944, -0.36737319827079773, -0.6998321413993835, 0.07727663218975067, 0.3239578604698181, 0.5471147894859314, 0.9449257850646973, 1.108490228652954, 0.013332495465874672, 0.5627210140228271, 0.14774449169635773, 0.8303324580192566, ...
def main ( ) : doc = c4d. documents. getactivedocument ( ) # get active cinema 4d document selected = doc. getactiveobjects ( 0 ) # get selected objects doc. startundo ( ) # start recording undos keymod = getkeymod ( ) # get keymodifier objects = [ ] # initialize a list for objects if keymod = = " none " : for s in sel...
[ -0.469851553440094, -0.2125633955001831, 1.1056509017944336, 0.5450022220611572, -0.534899890422821, -0.10184113681316376, 0.9807116389274597, 0.3681204617023468, 0.02380426973104477, 0.07535561174154282, -1.1572457551956177, 0.23359428346157074, 0.22599360346794128, 0.5593900680541992, ...
def _ strparse01 ( self, val, ptype = none, ctype = none ) :
[ 0.05388044938445091, -0.49547436833381653, 0.4818403124809265, 0.2955078184604645, -1.3386391401290894, 0.07619420439004898, -0.060143522918224335, 0.08041677623987198, 0.043763358145952225, 0.5901658535003662, 0.09517786651849747, 0.47349536418914795, -0.6943373680114746, 0.09718919545412...
def thumbs ( self ) : return self. thumb _ set. filter ('up ', true ). count ( ) - \ self. thumb _ set. filter ('up ', false ). count ( )
[ -0.8594143390655518, 0.3605794310569763, 0.6883038282394409, 0.3912181854248047, -0.06718165427446365, 0.8342115879058838, 0.9241740703582764, 0.718695342540741, -0.1362684667110443, 0.41002219915390015, -0.43466314673423767, -0.20715457201004028, 0.2833729088306427, 0.29579025506973267, ...
def process _ map _ pair ( selector, target, context, current _ node ) : from knife. template import template from knife. transformer import transform, contextkeytransform, templatetransform, maptransform # try and select from the current _ node new _ node = current _ node ( selector ) # if we did't select anything, re...
[ -1.5942707061767578, -0.9275270700454712, 0.3874516487121582, -0.35399624705314636, -0.14329630136489868, -0.7544003129005432, -0.37815621495246887, -0.4320753216743469, 0.3374967575073242, 0.1181570515036583, 0.5740018486976624, 0.5392622947692871, 0.1540748029947281, -0.364904522895813, ...
def end _ to _ end _ distance _ squared ( coords, bs, coords _ loc = [ 3, 6 ], sidechain = false, hist = false ) : rend _ list = [ none ] * len ( coords ) gauss _ list = { } index = 0 sidehx = bs [ 0 ] / 2 sidehy = bs [ 1 ] / 2 sidehz = bs [ 2 ] / 2 for key in coords : rend = [ ] gauss _ list [ key ] = [ ] for chain in...
[ -0.028819577768445015, -0.874642550945282, 0.6748871207237244, -0.8314699530601501, 0.5074074864387512, -0.4630337655544281, -0.6311801075935364, 0.5027655959129333, -0.32884418964385986, 0.6077073216438293, -0.5197069644927979, 0.3127574622631073, -0.25272560119628906, 0.103176549077034, ...
def fit ( self, train _ set, val _ set = none ) : recommender. fit ( self, train _ set, val _ set ) self. _ init ( ) if self. trainable : self. _ fit _ hft ( ) return self
[ 0.04994291812181473, 0.9637634754180908, 0.26275524497032166, 1.212510585784912, 0.46870356798171997, 0.131483256816864, -0.4352588951587677, 0.008321909233927727, -0.7148186564445496, -1.1224898099899292, 0.5402103066444397, 0.28544947504997253, -0.2728297710418701, 0.40888428688049316, ...
def set _ pump _ params ( self, pump, direction, flow ) : msg = self. device. send ( " set - pump - params ", pump, direction, flow ) return not msg. iserror ( )
[ -1.3046940565109253, 0.6571871638298035, 0.42445239424705505, 0.09534075111150742, 0.0632123053073883, 0.749097466468811, -0.1439543217420578, -0.03957368806004524, -0.4115487337112427, 0.23799987137317657, -0.6286975741386414, 0.1273719072341919, -1.0925265550613403, 0.13842244446277618, ...
def with _ shell ( self ) : new _ command = copy. deepcopy ( self ) new _ command. _ shell = true return new _ command
[ -0.20757386088371277, -0.475256085395813, 0.5757458209991455, -0.1630949079990387, -0.6314331293106079, 0.24712307751178741, -0.8062728643417358, -0.5838416814804077, 0.3530658483505249, -0.9694763422012329, -0.3608401119709015, 1.0107855796813965, 0.023265263065695763, 0.5000039339065552,...
def dump _ to _ stream ( q _ err, q _ in, file _ out, engine ) : try : with open ( file _ out, " wb " ) as f : while true : data = q _ in. get ( ) if data is none : break kas. dump ( data, f, engine = engine ) except exception as exc : tb = traceback. format _ exc ( ) q _ err. put ( ( exc, tb ) )
[ 0.7729223370552063, -0.3361855745315552, 0.5321031808853149, -0.08014748245477676, -0.1949080526828766, -0.06900635361671448, -0.6393024921417236, 0.22699838876724243, -0.555883526802063, -0.1206865906715393, 0.35388922691345215, 0.30423909425735474, 0.08221561461687088, 0.4090450704097748...
def solve _ apply ( expr, vars ) : func = _ _ solve _ for _ scalar ( expr. func, vars ) args = [ ] kwargs = { } for arg in expr. args : if isinstance ( arg, ast. pair ) : if not isinstance ( arg. lhs, ast. var ) : raise errors. efiltererror ( root = arg. lhs, message = " invalid argument name. " ) kwargs [ arg. key. va...
[ -0.6482734680175781, 0.3732830882072449, 0.7068590521812439, 0.12695547938346863, -0.965604841709137, -1.094663381576538, -0.5643274188041687, 0.2709456980228424, -0.34115070104599, 0.21652083098888397, -0.09605567902326584, -0.034968581050634384, 0.349721759557724, 0.7462724447250366, -...
def format _ number ( self, n ) : return ('{ :.'+ str ( self. number _ precision ) +'f }'). format ( n )
[ 0.21271903812885284, -0.40004706382751465, 0.6945124268531799, -0.4001591205596924, 0.0720779076218605, 0.029255753383040428, -0.5905677676200867, 0.26209282875061035, 0.09577266871929169, -0.839015781879425, 0.6554682850837708, -0.2240462750196457, 0.9838582873344421, 0.3727659583091736, ...
def load _ credentials ( credentials _ path ) : with open ( credentials _ path, " r " ) as f : credentials = json. load ( f ). get ( " mongo _ db " ) return credentials
[ -0.1357630044221878, -0.566440224647522, 0.43424302339553833, -0.5962090492248535, -0.31703123450279236, 0.22485186159610748, -0.7373608350753784, -0.060794681310653687, -0.26455071568489075, 1.1121352910995483, -0.891389012336731, -0.3219977021217346, -0.7363463640213013, -0.6757755875587...
def delete ( self, summary _ samples ) : summary _ sample _ ids = arg _ handler. extract _ ids ( summary _ samples ) msg = deletesummarysamplerequest ( ids = summary _ sample _ ids ) endpoint = " / api / v1 / summaries / deletesample " response = self. _ conn. make _ proto _ request ( " delete ", endpoint, body = msg )...
[ -1.1841071844100952, 0.26753324270248413, 0.43099820613861084, 0.7496307492256165, 0.11547896265983582, 0.831602156162262, 0.4570864737033844, -0.13454307615756989, 0.33862191438674927, 0.5617565512657166, -0.11645645648241043, 0.10847991704940796, -1.0722907781600952, -0.139595165848732, ...
def _ _ contextmenuopenrejections ( self ) : if self. contextmenueditor : filename = self. contextmenueditor. getfilename ( ) if filename : rej = " { 0 }. rej ". format ( filename ) if os. path. exists ( rej ) : self. vm. opensourcefile ( rej )
[ 0.1299339383840561, 0.2640191316604614, 0.4973692297935486, -0.7955660223960876, 0.056734129786491394, 0.3897477984428406, 0.449664443731308, 0.9483820199966431, -0.05058889463543892, -0.20798151195049286, 0.8256296515464783, -0.1774345487356186, -1.0942513942718506, -0.42139387130737305, ...
def readobject ( filename ) : # import cpickle as pickle target _ dir = os. path. basename ( _ _ file _ _ ). split ( '.') [ 0 ] +'_ objects'filename = os. path. join ( target _ dir, filename ) with open ( filename,'rb') as input _ file : return pickle. load ( input _ file )
[ -1.1029595136642456, -0.9058335423469543, 0.7951036095619202, -0.9057193994522095, 0.02761480212211609, 0.31586647033691406, 0.9754671454429626, -0.10614077746868134, -1.158301591873169, 0.22396130859851837, -0.22109052538871765, 0.13622385263442993, 0.7544377446174622, -1.4858192205429077...
def aff _ by _ eval ( means, covars ) : aff _ table = np. empty ( [ means. shape [ 0 ], 0 ] ) # iterate through the components for i, ( mean, covar ) in enumerate ( zip ( means, covars ) ) : # find the probability for every mean point in the current component p _ mus _ kx = normpdf ( means, mean, covar ) # transpose th...
[ 0.39205607771873474, -0.5162398815155029, 0.6687172651290894, -0.8417874574661255, -0.2552630305290222, -0.5270708799362183, 0.534711480140686, 0.644117534160614, -0.9063803553581238, 1.163286566734314, 1.665765643119812, 0.6300913095474243, 0.6373093724250793, 0.1007760763168335, 0.1765...
def add _ url _ http ( event, context ) : print ( event ['body'] ) try : data = json. loads ( event ['body'] ) url = data ['url'] if'url'in data else none return add _ url ( url ) except : return { " error " : sys. exc _ info ( ) }
[ -0.04313132166862488, 0.1548680067062378, 0.9134788513183594, 0.1890467405319214, 0.08280907571315765, 0.4027831554412842, -1.279551386833191, -0.1586473286151886, 0.4894118905067444, 0.6618132591247559, -0.13027246296405792, 0.4525351822376251, -0.12509939074516296, 0.24924242496490479, ...
def getwcsfromdetector ( detector, boresight, rotation = 0 * geom. degrees, flipx = false ) : trans = detector. gettransform ( detector. makecamerasys ( camerageom. pixels ), detector. makecamerasys ( camerageom. field _ angle ) ) wcs = afwgeom. makeskywcs ( trans, rotation, flipx, boresight ) return wcs
[ 0.5613319873809814, 0.3905860483646393, 0.3261410593986511, 0.23945476114749908, -0.6440403461456299, -0.6007993817329407, 0.13427549600601196, -1.0655107498168945, 0.4458971917629242, -0.6429266333580017, -0.23063066601753235, 0.40320226550102234, 0.5035741925239563, 0.43981990218162537, ...
def get _ list _ offers _ link ( url, step ) - > list : url _ list = [ f " { url } & page = { i } " for i in range ( step, step + 20 ) ] offers _ links _ list = [ ] ayo _ html _ pages = get _ htmls ( url _ list ) html _ pages = [ html. result ( ) for html in ayo _ html _ pages ] if _ _ name _ _ = = " _ _ main _ _ " : w...
[ -0.8946791887283325, 0.4495789706707001, 0.5649453997612, 0.4140464663505554, 0.04529408738017082, -0.3715306520462036, 0.5223948359489441, 1.1080297231674194, -0.1783694326877594, 0.09063410758972168, 0.1279641091823578, 1.0249379873275757, 0.2315262258052826, 1.3521382808685303, -0.456...
def data _ generation ( caller, obtained _ gamma _ range, mode ) : if obtained _ gamma _ range. shape [ 0 ] = = 1 : gamma _ range = list ( deepcopy ( obtained _ gamma _ range [ 0 ] ) ) arr _ shape = len ( gamma _ range ) else : gamma _ range = list ( product ( * obtained _ gamma _ range ) ) arr _ shape = [ len ( dim ) ...
[ -1.4891928434371948, -0.5847123265266418, 0.81043940782547, -0.25455790758132935, 0.845710277557373, -0.018636584281921387, 0.1937047243118286, -0.28513893485069275, -0.6428308486938477, 0.45116811990737915, -0.471201092004776, 0.44533008337020874, 0.3423991799354553, 0.6250260472297668, ...
def _ mgui _ set _ width ( self, value : int ) - > none : self. _ qwidget. resize ( value, self. _ qwidget. height ( ) )
[ -0.19431699812412262, 1.133357286453247, 0.5232179164886475, 0.025998666882514954, -0.23505240678787231, 0.6197965741157532, 0.17627720534801483, -0.8352252244949341, 0.026063647121191025, -0.5386270880699158, -0.46021562814712524, -0.8653668165206909, -0.22317564487457275, 0.8779215216636...
def convert _ record _ to _ run ( record ) : logger. debug ('converting % s to run. ', record ) if record. type = ='run': return generate _ run _ from _ json ( json _ input = record. raw ) else : msg = ('record must be of subtype run to convert to run. given'' { }. '. format ( record. id ) ) logger. warn ( msg ) raise ...
[ -0.3815925419330597, 0.007414007559418678, 0.5710291266441345, 0.32897812128067017, -0.46069958806037903, 0.06730923801660538, 0.22367705404758453, -0.5508753061294556, -0.08337673544883728, 0.6656818389892578, -0.3360244035720825, 1.2230980396270752, -0.28388112783432007, -0.4558984041213...
def place _ rgba ( self, image, png _ center ) : png _ center _ y, png _ center _ x = png _ center image _ height, image _ width = image. shape [ : 2 ] png _ start _ y = png _ center _ y - ( image _ height / / 2 ) png _ start _ x = png _ center _ x - ( image _ width / / 2 ) alphas = np. expand _ dims ( image [ :, :, 3 ...
[ -0.2973196506500244, -0.8190404772758484, 1.037011981010437, -0.9635984897613525, 0.01091270986944437, 0.7284227609634399, 0.5635632276535034, 0.20761017501354218, 0.22994817793369293, 0.8288322687149048, 0.13639862835407257, -0.08143549412488937, -0.39778485894203186, 0.5203322768211365, ...
def get _ allow _ redirects ( path ) : return extract _ section _ by _ name ( path, allow _ redirects _ name ) is not none
[ 0.2867834270000458, 0.3091740310192108, 0.6958931088447571, 0.0030018582474440336, -0.9366223812103271, 0.16306434571743011, 0.7129573822021484, -0.3338712155818939, 0.2200886756181717, 0.5986871719360352, 0.5612460374832153, -0.012778622098267078, 0.02083880454301834, -0.32751014828681946...
def share _ google _ drive _ file ( self, file _ id, emails, credentials = none, role ='writer') : def callback ( request _ id, response, exception ) : if exception : # handle error print ( exception ) if self. credentials is not none : credentials = self. credentials results = {'user': [ ],'role': [ ] } service = buil...
[ -0.2695988416671753, -0.10836024582386017, 0.6616017818450928, -0.2878250777721405, 0.7618825435638428, 0.22804859280586243, 0.18561989068984985, 0.43573427200317383, -0.9422509074211121, 0.19654683768749237, 0.06043009087443352, 0.35927847027778625, -1.3631607294082642, 0.3130455315113067...
def policy _ evaluation ( pi, u, mdp, k = 20 ) : r, t, gamma = mdp. r, mdp. t, mdp. gamma for i in range ( k ) : for s in mdp. states : u [ s ] = r ( s ) + gamma * sum ( p * u [ s1 ] for ( p, s1 ) in t ( s, pi [ s ] ) ) return u
[ 0.09885958582162857, 0.12701639533042908, 0.42018601298332214, -1.3089168071746826, -0.26688507199287415, 0.9542310833930969, -0.5245571136474609, 1.6960216760635376, 0.2680228352546692, 0.7794213891029358, -0.0448831282556057, -0.20751896500587463, -0.22865046560764313, -0.811969935894012...
def fit ( self, input _ data, expected _ output _ data ) : loss, loss _ value = self. compute _ loss ( input _ data, expected _ output _ data ) self. optimizer. zero _ grad ( ) loss. backward ( ) self. optimizer. step ( ) return loss _ value
[ -0.5940380096435547, -0.0019770474173128605, 0.3391565978527069, 0.1301417350769043, 0.2389543205499649, -0.6244286298751831, -0.17522020637989044, 0.25472110509872437, -0.921715259552002, -0.6639761924743652, 0.2952518165111542, 1.154615044593811, -0.49469152092933655, -0.1939014494419098...
def fit ( self ) : # reset outputs self. outputvals = np. zeros ( npt2 ) self. nfev = 2 self. fitted = false # set the levmpy common variables self. _ setcommon ( ) # print fit information self. _ print _ fit _ info ( sys. stdout. write ) # run mainclc if maxfev > 3 if self. maxfev > 3 : self. result = _ lv. mainclc ( ...
[ 0.6368715763092041, -0.6611308455467224, 0.7382823824882507, -0.14396503567695618, 0.17171600461006165, -0.04704555496573448, 0.9131594896316528, -0.7699497938156128, -0.6813361644744873, -0.8521393537521362, 0.0968073159456253, 0.2128940373659134, -0.45014744997024536, 0.6471578478813171,...
def testbuckminsterfullerene ( self ) : ( q, n ) = conftest. buckminsterfullerene ( ) self. assertequal ( q, true ) self. assertequal ( len ( n ), 120 ) # a result of 120 seems reasonable ( symmetry number is 60 )
[ 0.16266071796417236, 0.3340758979320526, 0.3290015459060669, -0.7210713624954224, 0.8863731622695923, -0.4502819776535034, -0.4381410479545593, 0.4942936897277832, 0.3977434039115906, -0.902407705783844, -1.3933438062667847, -1.052841067314148, 0.10214753448963165, -0.3768894672393799, 0...
def eval _ loop ( master, dataset _ config _ pbtxt, checkpoint _ dir, model _ name, batch _ size, max _ examples, eval _ name, max _ ckpt _ to _ evaluate, use _ tpu = false ) : logging. info ('running fixed eval for : % s ', dataset _ config _ pbtxt ) tf _ dataset = data _ providers. get _ input _ fn _ from _ dataset (...
[ -0.397386759519577, 0.03155531734228134, 0.7760650515556335, 0.1419464349746704, -0.37787574529647827, 0.44830822944641113, -0.1617954671382904, 0.41636016964912415, -0.8526148200035095, 0.8443635702133179, -0.5023488402366638, -0.3262041211128235, 0.6774699091911316, 0.1845918893814087, ...
def write _ animated _ gif ( fp, frames, format = " gif ", save _ all = true, optimize = true, duration = 40, loop = 0, verbose = false, ) : frames [ 0 ]. save ( fp, append _ images = frames [ 1 : ], format = format, save _ all = save _ all, optimize = optimize, duration = duration, loop = loop, ) if verbose : log. inf...
[ 0.49264222383499146, 0.36412620544433594, 0.6948848962783813, 1.1056208610534668, 0.6501801609992981, -0.26241442561149597, 0.513961911201477, 0.38745972514152527, -0.36531543731689453, 0.893251895904541, -0.7106797695159912, -0.0355069525539875, -0.22006766498088837, 0.9786408543586731, ...
def amat _ edit ( amat, r, c, delta ) : amat [ r - 1 ] [ c - 1 ] + = delta if r! = c : amat [ c - 1 ] [ r - 1 ] + = delta return
[ 0.006074381526559591, -0.6288604736328125, 0.5290639400482178, -0.6708637475967407, 0.32622718811035156, 0.4928073585033417, 0.8930737376213074, -0.6968075633049011, 0.02091178297996521, 0.4422510266304016, 0.08376694470643997, 0.11749934405088425, 0.24255116283893585, -0.4078783392906189,...
async def test _ sending _ mqtt _ commands _ on _ off ( 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 mac = config [ " mac " ]...
[ 0.10933933407068253, -0.05378233641386032, 0.40431830286979675, 0.18343085050582886, 0.379609078168869, 0.20842279493808746, -0.21711362898349762, 0.25954967737197876, 0.11601036041975021, 0.022418038919568062, -0.4595273435115814, -0.0136544955894351, 0.3031570613384247, 0.968349337577819...
def upload _ file _ to _ google _ drive ( self, path, credentials = none, parent _ id = none ) : if self. credentials is not none : credentials = self. credentials mime = mimetypes ( ) service = build ('drive ','v3 ', credentials = credentials ) file _ metadata = {'name': os. path. basename ( path ), } if parent _ id :...
[ -0.2481764703989029, -0.06017554551362991, 0.7179369330406189, -0.452345609664917, 0.521437406539917, 0.24300211668014526, -0.6157654523849487, -0.30408912897109985, -0.9995809197425842, 0.47570446133613586, -0.6005648374557495, 0.21509504318237305, -1.4278924465179443, 0.6228271126747131,...
def round _ gls ( gls, precision = none ) : if abs ( sum ( gls ) - 1 ) > 1e - 6 : raise valueerror ('invalid genotype likelihoods do not sum to one : sum ( { } ) = { } '. format ( gls, sum ( gls ) ) ) if precision is none : return gls min _ ix = 0 min _ gl = gls [ 0 ] for ix, gl in enumerate ( gls ) : if gl < min _ gl ...
[ -0.15246982872486115, -0.65938401222229, 0.6613346338272095, -0.2331138551235199, 0.2208411693572998, 0.6881896257400513, -0.1235603541135788, -0.8118196129798889, 0.503591775894165, 0.3296087384223938, 0.3828997015953064, 0.7951922416687012, -0.7043157815933228, 0.8951539397239685, -0.0...
def demarkup _ text ( text ) : # keep the opening tag name of certain tags that contains these strings # note : < s > are from debian copyright files kept _ tags = ('lic ','copy ','www ','http ','auth ','contr ','leg ','inc ','@ ','< s > ','< / s > ','169 ','a9') # find start and closing tags or the first white space w...
[ 0.37827882170677185, -0.7941699028015137, 0.8099008798599243, -0.31533411145210266, -1.1480594873428345, -0.2076898068189621, 0.39353981614112854, 0.8855655193328857, 0.2822282314300537, -0.21762090921401978, 0.2639889717102051, -0.07656031101942062, -0.06198976933956146, -0.03236726298928...
def missing ( name ) : return name not in get _ all ( )
[ -0.1739634871482849, -0.11686401069164276, 0.1920934021472931, -0.10145281255245209, -0.2605315148830414, 1.2022234201431274, -1.528182864189148, 0.07673756033182144, -0.6001036167144775, 0.04468853026628494, -0.7953969240188599, -0.8497291803359985, -0.3924545645713806, 0.6021995544433594...
def test _ build _ mlp _ raises _ on _ invalid _ normalize _ input _ layer ( ) - > none : with pytest. raises ( valueerror, match = " normalize _ input _ layer. * not a valid normalization layer. * ", ) : networks. build _ mlp ( in _ size = 1, hid _ sizes = [ 16, 16 ], out _ size = 1, normalize _ input _ layer = th. nn...
[ 0.6941785216331482, 0.5279945135116577, 0.2542416751384735, 1.1485562324523926, -0.48026320338249207, 0.27938562631607056, 0.17898665368556976, -0.04814828187227249, 0.6297059655189514, 0.04551108926534653, -0.25435855984687805, 0.2854808270931244, -1.8746111392974854, -0.01210863050073385...
def setsplitorientation ( self, orientation ) : self. _ _ splitter. setorientation ( orientation )
[ -0.9700794219970703, -0.14316894114017487, 0.30532556772232056, 0.1110331118106842, 0.11694858223199844, 0.21252861618995667, 1.2457960844039917, 0.6246907711029053, -0.09418109804391861, 0.353963166475296, -1.389050006866455, -0.3965624272823334, -1.2415635585784912, 0.0535457469522953, ...
def to _ feature _ reports ( self ) : rest = self. to _ string ( ) seq = 0 out = [ ] # when sending a frame to the yubikey, we can ( should ) remove any # 7 - byte serie that only consists of'\ x00 ', besides the first # and last serie. while rest : this, rest = rest [ : 7 ], rest [ 7 : ] if seq > 0 and rest : # never ...
[ -0.14399559795856476, 0.07277031987905502, 0.7723591923713684, 0.5177326798439026, 0.623554527759552, -0.6100975871086121, 0.35434430837631226, 0.039186909794807434, 0.3975222706794739, 0.012949742376804352, -0.39223870635032654, 0.45009368658065796, -0.9412358999252319, -0.021026516333222...
def process _ request ( src, dest, date, time ) : src, dest, time = prepare _ form _ data ( src, dest, time ) try : validate _ form _ data ( src, dest, date, time ) userquery = query. query ( src, dest, date, time ) except valueerror as e : return false, str ( e ) try : details, weathersummary = data _ handling. get _ ...
[ -0.9401093125343323, 0.3772382438182831, 0.6641519069671631, -0.02615870162844658, -0.5613470077514648, 0.6464550495147705, -0.7009654641151428, -0.30910512804985046, -0.4945603907108307, -0.15787973999977112, 0.10506033152341843, -0.09861526638269424, 0.33618393540382385, 0.87613219022750...
def char _ at ( row, column ) : try : return _ grid [ row ] [ column ] except indexerror : if 0 < = row < = _ max _ rows : raise rowrangeerror ( ) raise columnrangeerror ( )
[ 0.12987945973873138, -0.050564028322696686, 0.43246716260910034, 0.005818178877234459, -0.1780351847410202, -0.31572338938713074, 0.4086647033691406, -1.2082980871200562, -0.6192339658737183, -0.03126413747668266, 0.7536364197731018, 1.169471025466919, 0.2259918749332428, -1.39048433303833...
def get _ info ( self ) : info = { " green _ genes " : len ( self. symbols [ " 3 " ] ), " entity _ types " : self. data [ " stats " ] } return info
[ -0.22012968361377716, 0.23855800926685333, 0.2014801800251007, -1.4098283052444458, 0.44334474205970764, 0.18777456879615784, -0.6349883079528809, -0.795774519443512, -1.4630296230316162, -0.20804496109485626, -0.7016128301620483, -0.11148649454116821, 0.9147247672080994, 0.749874591827392...
def train _ network ( self ) : states, actions, gae _ advantages, discounted _ rewards, values = \ self. memory. get _ batch ( self. training _ batch _ size ) gae _ advantages = gae _ advantages. reshape ( - 1, 1 ) # batches of shape ( 1, ) required gae _ advantages = k. utils. normalize ( gae _ advantages ) # optional...
[ -1.1338214874267578, -0.39231759309768677, 0.453498512506485, 0.08175995200872421, 0.43204063177108765, -0.03665021434426308, 0.49198994040489197, 0.9146955013275146, 0.17556746304035187, 0.1613335907459259, 0.09841643273830414, 1.3171892166137695, 0.7357177138328552, 0.5883599519729614, ...
def lint ( ) : shell ( " pylint manage. py pymoji tests " ) # shell ( " static / js / node _ modules /. bin / eslint - - ext. js,. jsx,. json,. es6,. es static / js " )
[ 0.702380895614624, 0.11633914709091187, 0.6414568424224854, -0.6719599366188049, 0.5089884996414185, 0.387136846780777, -0.18167731165885925, -0.8446547389030457, 0.7410838007926941, 0.190758615732193, -0.5765538811683655, 0.785502016544342, 0.09822089970111847, 0.5676578283309937, 0.119...
def test _ callback _ batch _ on _ device ( tmpdir ) : batch _ callback = batchhookobservercallback ( ) model = batchhookobservermodel ( ) trainer = trainer ( default _ root _ dir = tmpdir, max _ steps = 1, limit _ train _ batches = 1, limit _ val _ batches = 1, limit _ test _ batches = 1, limit _ predict _ batches = 1...
[ 0.6666701436042786, 0.9437059760093689, 0.5588675141334534, 1.8503323793411255, 0.09888613969087601, 0.6812617182731628, 0.894527792930603, 0.14467813074588776, 0.3086935877799988, -0.7263462543487549, -0.21586476266384125, 0.043393515050411224, 0.4421851634979248, 0.6170933246612549, 0....
def manual _ seed ( seed : int ) - > none : # the torch. mps. manual _ seed ( ) can be called from the global # torch. manual _ seed ( ) in torch / random. py. so we need to make # sure mps is available ( otherwise we just return without # erroring out ) if not torch. _ c. _ has _ mps : return seed = int ( seed ) _ get...
[ 0.45519745349884033, 0.4232615530490875, 0.515416145324707, -0.13180339336395264, -0.004360578488558531, 0.09990942478179932, 0.3235010802745819, 0.15680807828903198, -0.5503031015396118, -0.8018590211868286, 0.033081430941820145, 0.7065103650093079, 0.01808285526931286, 0.5286785364151001...
def character _ span ( self ) : return ( self. pb. beginchar, self. pb. endchar )
[ -0.2022770643234253, -1.0734713077545166, 0.5238991379737854, -0.515848696231842, 0.07367480546236038, 1.336055040359497, 0.00403157714754343, -0.19600211083889008, 0.20225298404693604, -0.47329840064048767, -0.8470380902290344, 0.5226712822914124, -0.9992960095405579, -0.27497249841690063...
def read _ shoulder ( self ) : " " " [ l2, r2, l1, r1, select, start, l3, r3 ] " " " byte = self. info [ self. p2shoulder ] return [ ( byte & 1 )! = 0, ( byte & 2 )! = 0, ( byte & 4 )! = 0, ( byte & 8 )! = 0, ( byte & 16 )! = 0, ( byte & 32 )! = 0, ( byte & 64 )! = 0, ( byte & 128 )! = 0 ]
[ -0.247108593583107, -0.9386039972305298, 0.6348854899406433, -0.4261622726917267, 0.24464121460914612, 0.7148342132568359, -0.928717851638794, -0.6338585615158081, 0.23156826198101044, 0.03777376189827919, -0.8351916670799255, 0.5483516454696655, -0.8188835382461548, -0.20358474552631378, ...