text
stringlengths
25
2.19k
embedding
listlengths
768
768
def callback ( ) : core _ v1 = kubernetes. client. corev1api ( ) nodes = core _ v1. list _ node ( ) for node in nodes. items : # ignore masters, the daemon set will not get scheduled there if'node - role. kubernetes. io / master'in node. metadata. labels : continue # collect all image names on this node and ensure the ...
[ -0.34470951557159424, 0.593739926815033, 0.7093153595924377, -0.36493349075317383, 0.05834392458200455, -0.34393611550331116, -0.7139173150062561, 0.263441801071167, 0.26601076126098633, 0.9004631042480469, 0.047237198799848557, -0.3951214551925659, 0.10235721617937088, 0.5157695412635803,...
def find _ fast _ path ( aux _ structures, loc1, loc2 ) : nodes, edges, dic = aux _ structures nodes1 = nearest ( dic, loc1 ) nodes2 = nearest ( dic, loc2 ) agenda = [ [ [ nodes [ nodes1 ] ], 0 ] ] empty = set ( ) while agenda : # remove the path with the lowest cost from the agenda. # print ( [ [ [ dic [ d ] for d in ...
[ 1.119213581085205, -0.18395908176898956, 0.8133862018585205, -0.10356605798006058, -0.6755414605140686, -0.15942348539829254, 0.14109653234481812, -0.6543489098548889, -0.5231757760047913, 0.3190310001373291, 0.43915703892707825, 0.2799704074859619, 0.14945673942565918, -0.2444973737001419...
def entity _ instance ( entity _ label, entity _ id ) : from entityfk. providers import get _ providers desc = ( entity _ label, entity _ id, ) for provider in get _ providers ( ) : try : return provider. to _ object ( desc ) except typenotsupported : pass raise exception ( ( " model { } could not be found and " " is n...
[ -0.08678199350833893, -0.49964213371276855, 0.3817006051540375, -0.281011164188385, 0.8168008923530579, -0.17946290969848633, -0.7233638763427734, -0.03797461465001106, -0.032844360917806625, 0.4817984998226166, 0.1530725359916687, 0.8580746054649353, -0.00531406095251441, 0.11865730583667...
def showform ( self, layer ) : layer _ id = layer. key ( ). id ( ) upload _ url = blobstore. create _ upload _ url ('/ resource - create / % d'% layer _ id ) return {'upload _ url': upload _ url }
[ 0.23759019374847412, 0.06779520958662033, 0.234871506690979, -1.425075888633728, -0.029790673404932022, -0.07575362920761108, 0.050255101174116135, 0.19207531213760376, -0.8025254607200623, 0.1350562572479248, -0.4520547389984131, -0.13371023535728455, 0.3813190162181854, 0.765735805034637...
def index ( self, trans, * * kwd ) : rval = [ ] for group in trans. sa _ session. query ( trans. app. model. group ). filter ( trans. app. model. group. table. c. deleted = = false ( ) ) : if trans. user _ is _ admin : item = group. to _ dict ( value _ mapper = {'id': trans. security. encode _ id } ) encoded _ id = tra...
[ -0.8192138671875, 0.6723436713218689, 0.2551819384098053, -0.10193856805562973, -0.5803585648536682, 0.16877400875091553, -0.5348305702209473, -0.32011741399765015, -0.30521056056022644, 0.4369101822376251, 0.027460092678666115, 0.49475738406181335, 0.08976290374994278, 0.36253127455711365...
def _ _ init _ _ ( self, learning _ rate, learning _ rate _ power = - 0. 5, initial _ accumulator _ value = 0. 1, l1 _ regularization _ strength = 0. 0, l2 _ regularization _ strength = 0. 0, use _ locking = false, name = " ftrl " ) : super ( ftrloptimizer, self ). _ _ init _ _ ( use _ locking, name ) if initial _ accu...
[ 0.5465452075004578, 0.4894377589225769, 0.5631307363510132, 0.6537788510322571, 0.07558675855398178, -0.4578770399093628, -0.3094305992126465, -0.19247396290302277, -1.0614073276519775, -0.39544492959976196, -0.327442467212677, -0.42470166087150574, 0.28425854444503784, 0.31710636615753174...
def draw ( self ) : ac. setbackgroundopacity ( self. _ _ window _ id, 0. 0 ) for component in self. _ _ components : ac. glcolor4f ( * colors. white ) component. draw ( self. _ _ data ) ac. glcolor4f ( * colors. white )
[ 0.04453481361269951, -0.143381729722023, 0.5335915088653564, -1.5239580869674683, 1.0076593160629272, 0.8882506489753723, -0.06366056948900223, -0.3797939121723175, 0.3567638695240021, -0.7327512502670288, 0.8793079853057861, 0.9639756083488464, -0.39895153045654297, 1.2893108129501343, ...
def test _ get _ parameter _ type ( self ) : pass
[ -0.3828922510147095, 0.5773654580116272, 0.3053343892097473, 1.2467567920684814, 1.6242661476135254, -0.19635970890522003, 1.0054689645767212, -0.46956682205200195, 0.21333886682987213, -0.5565202236175537, 0.01952601782977581, 0.9406910538673401, -1.195872187614441, 0.5094645023345947, ...
def lat _ long _ to _ xyz ( latitude, longitude, radians = false, datum = osgb36 ) : if not radians : latitude = rad ( latitude ) longitude = rad ( longitude ) nu = datum. a * datum. f _ 0 / sqrt ( 1 - datum. e2 * sin ( latitude ) * * 2 ) return array ( ( ( nu + datum. h ) * cos ( latitude ) * cos ( longitude ), ( nu +...
[ -0.9060719013214111, 0.113924041390419, 0.5553180575370789, -0.663806676864624, 0.011132659390568733, 0.17719882726669312, -0.9589332938194275, 0.1736440658569336, -0.15103250741958618, 0.6916579604148865, -0.684369683265686, 0.6362879872322083, 0.11080538481473923, -0.4765428602695465, ...
def _ sort _ registry ( self ) - > none : if self. _ registry _ sorted : return orderedkeys = self. _ registry. _ _ diot _ _ ['orderedkeys'] self. _ registry. _ _ diot _ _ ['orderedkeys'] = sorted ( orderedkeys, key = lambda plug : self. _ registry [ plug ]. priority ) self. _ registry _ sorted = true
[ -1.029401183128357, -0.3053929805755615, 0.40565600991249084, -1.0870145559310913, 0.43892502784729004, -0.872140645980835, 0.5967975854873657, 0.21496206521987915, -0.1395772248506546, 0.4359615743160248, -0.17351068556308746, 0.5510542988777161, -0.06091545522212982, 0.257098913192749, ...
def new ( * args, * * kargs ) : obj = itksmoothingrecursivegaussianimagefilteriuc3iuc3. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ 0.7750654220581055, 0.9098648428916931, 0.20912057161331177, -0.6329547762870789, -0.40416476130485535, 0.7241368293762207, 1.0549747943878174, 0.18120227754116058, -0.39249610900878906, -0.647523045539856, 0.0027946853078901768, 0.17046402394771576, 0.10514850169420242, 0.7712617516517639...
def iterpoints ( self ) : yield self. pt1 # bottom left yield point ( self. pt2. x, self. pt1. y ) # bottom right yield self. pt2 # top right yield point ( self. pt1. x, self. pt2. y ) # top left
[ -0.6239054203033447, -0.43261945247650146, 0.36058610677719116, 0.18614791333675385, 0.5572696924209595, 0.8902959227561951, 0.44121795892715454, -0.7146168351173401, -0.38889244198799133, -0.02320200204849243, 0.21682500839233398, 0.3281831741333008, 0.3271491825580597, 0.0805946141481399...
def basename ( p ) : i = p. rfind ('/') + 1 return p [ i : ]
[ -0.25458860397338867, -0.11261928081512451, 0.5333142876625061, 0.3866686224937439, 0.21833068132400513, 0.7231729030609131, 0.6957219243049622, -0.023556439206004143, 0.34151655435562134, 0.7574811577796936, 0.16662420332431793, -0.5924757719039917, -1.351015567779541, -1.4308040142059326...
def testresolvequery ( self ) : tagapi ( self. user ). create ( [ ( u'username / tag1 ', u'description'), ( u'username / tag2 ', u'description') ] ) self. store. commit ( ) object1 = uuid4 ( ) object2 = uuid4 ( ) tagvalueapi ( self. user ). set ( { object1 : { u'username / tag1': 20, u'username / tag2': 20 }, object2 :...
[ -0.26715612411499023, 0.2908655107021332, 0.5934234857559204, -0.16596372425556183, 0.7497995495796204, -0.22144897282123566, -0.17319217324256897, -0.45241785049438477, -0.8457233309745789, -0.7130459547042847, -0.8850609660148621, -0.5181795954704285, 0.1811186671257019, -0.2830678224563...
def trigger ( self ) : if self. clear. state = = 1 and self. preset. state = = 0 : return self. setff ( ) elif self. preset. state = = 1 and self. clear. state = = 0 : return self. resetff ( ) elif not ( self. clear. state or self. preset. state ) : print ( " error : invalid state - resetting the latch " ) self. clear....
[ -0.2524976432323456, 0.2605479061603546, 0.5846649408340454, 0.44367432594299316, -0.05470919981598854, -0.1615619659423828, 0.017723973840475082, 0.16759243607521057, 0.07695276290178299, 0.33200135827064514, -0.003885203041136265, 0.6277148723602295, -0.2737557291984558, 0.43389159440994...
def gr ( ) : from simple _ graph import simplegraph new _ graph = simplegraph ( ) return new _ graph
[ -0.3256894648075104, 0.8291110992431641, 0.36192557215690613, 0.5859516263008118, -0.5758419632911682, 0.2440125197172165, 0.336340993642807, 0.4470318853855133, -0.5654836893081665, -0.6516750454902649, -0.660827100276947, 0.9685478210449219, -0.28030285239219666, -0.7157294750213623, 0...
def _ pick _ next _ build ( bldr, requests ) : now = datetime. now ( ) if now. hour > = 20 or now. hour < 6 : priority _ category ='integration - branch'else : priority _ category ='merge - request'for r in requests : for c in r. source. changes : if c. category = = priority _ category : return r return requests [ 0 ]
[ 0.02030646614730358, -0.10947909951210022, 0.36913880705833435, 0.0521707758307457, -0.1780717670917511, 0.015458201989531517, -0.5848197937011719, -0.41259440779685974, 0.5652870535850525, -0.7970733642578125, 0.39300718903541565, 0.09055791795253754, -0.20241427421569824, 0.0958604812622...
def is _ cuda ( self ) : return next ( self. parameters ( ) ). is _ cuda
[ -0.35110756754875183, 1.015649676322937, 0.29552212357521057, 1.3771098852157593, 0.5763276219367981, -0.5907027125358582, -0.21397727727890015, -0.37530240416526794, -0.08321979641914368, 0.41822144389152527, 1.0089889764785767, 1.3989096879959106, -0.640123188495636, 0.6719423532485962, ...
def new _ tsv _ to _ numpy ( tsv _ path, segmentations ) : # instantiate arrays to hold values : s _ samples = [ ] l _ samples = [ ] a _ samples = [ ] p _ samples = [ ] t _ samples = [ ] # loop over tsv file and append data to arrays : with open ( tsv _ path,'r') as f : headers = ['tag ','read _ id ','chr ','idx ','sam...
[ 0.05714426934719086, -1.1797047853469849, 0.6322444081306458, -1.4253932237625122, -0.1819104701280594, -0.2094893604516983, -0.09485156089067459, -0.13635094463825226, -0.7627559304237366, 1.1575678586959839, -0.7056572437286377, -0.22342750430107117, 0.8784835338592529, 0.360603660345077...
def train _ chatbot ( ) : for arq in os. listdir ('chat') : # opening the directory with conversation guides chats = open ('chat /'+ arq,'r'). readlines ( ) # reading all files with conversation data and storing in a variable trainer. train ( chats ) # training the chatbot
[ -0.8615546226501465, -0.3303692936897278, 0.3859291076660156, 0.5307841897010803, 0.4431222677230835, 0.7252373099327087, 0.7731095552444458, 0.7068871855735779, -1.3932143449783325, 0.16711007058620453, -0.8336246013641357, -0.2878074049949646, 0.1999208778142929, 0.7139915227890015, -0...
def jwt _ authorizer ( event : dict ) - > dict : token = get _ bearer _ token ( event ) if token. startswith ( " bearer " ) : token = token [ len ( " bearer " ) : ] try : res = jwt. decode ( token, secret, algorithms = [ algorithm ] ) except exception as e : # todo : make less general raise authenticationerror ( ) retu...
[ 0.48301395773887634, 0.2402850240468979, 0.6097084879875183, 0.2298773229122162, -1.281283974647522, -1.2298808097839355, -0.31441423296928406, 0.14546586573123932, 0.2253592312335968, 0.6690963506698608, -0.03091161698102951, 0.4657372832298279, 0.4773189127445221, 0.2581841051578522, 0...
async def call ( self, http _ auth : httpauthorizationcredentials ) - > optional [ union [ dict [ str, any ], basemodel, bool ] ] : claims : dict [ str, any ] = jwt. get _ unverified _ claims ( http _ auth. credentials ) if not self. user _ info : return claims try : current _ user = self. user _ info. parse _ obj ( cl...
[ -0.1763298362493515, -0.2019575536251068, 0.5798083543777466, 0.555651843547821, -0.09603244811296463, 0.1933981478214264, -0.7834337949752808, -1.3105391263961792, 0.02804586850106716, -0.26834893226623535, 0.33919501304626465, 0.7170277833938599, -0.20876549184322357, 0.12382587045431137...
async def async _ step _ user ( self, user _ input = none ) : if user _ input is not none : return await self. async _ step _ init ( user _ input = none ) return self. async _ show _ form ( step _ id = " confirm " )
[ -0.018084978684782982, 0.5954807996749878, 0.42083728313446045, 1.476632833480835, -0.05104939267039299, 0.0033845119178295135, 0.2127559781074524, 0.36562561988830566, -0.41414377093315125, -0.3978639543056488, -0.12076010555028915, 0.32712599635124207, 0.45992305874824524, 1.057476878166...
def param _ size ( model ) : n _ params = sum ( np. prod ( v. size ( ) ) for k, v in model. named _ parameters ( ) if v. requires _ grad and not k. startswith ('aux _ head') ) return n _ params / 1024. / 1024.
[ 0.21608665585517883, 0.7683656215667725, 0.7043572664260864, -0.5318882465362549, -0.8002768754959106, 0.050750114023685455, 0.2666415870189667, -0.33906036615371704, -0.0025944504886865616, 1.1954981088638306, -1.1028141975402832, 0.11908078193664551, 0.0860542431473732, 1.123627185821533...
def leftrotate ( self, t ) : node = t. right t. right = node. left if node. left! = none : node. left. parent = t node. parent = t. parent if t. isroot ( ) : self. root = node else : if t. isleft ( ) : t. parent. left = node else : t. parent. right = node node. size = t. size if t. left : lsize = t. left. size else : l...
[ 0.7693176865577698, 0.9835116267204285, 0.7278347611427307, -1.0709666013717651, 0.20573125779628754, 0.2788178324699402, 0.36917972564697266, -0.653567373752594, 0.38869282603263855, 0.5405295491218567, -1.1765024662017822, -0.2560521960258484, -1.0840673446655273, 1.330080509185791, -0...
def worker ( problemdir, configdir, work _ queue, done _ queue ) : while true : problemid, configid = work _ queue. get ( ) print ( " received " ) if problemid = = stop : # poison pill print ( " exiting worker process. " ) done _ queue. put ( stop ) break testproblemlist = testproblem. get _ all _ from _ file ( problem...
[ -0.280973345041275, -1.0370374917984009, 0.6027644872665405, -0.6580424904823303, 0.35099443793296814, 0.909552276134491, 0.3601089119911194, 0.19245800375938416, -0.12721362709999084, 0.06381271034479141, -0.7336520552635193, -0.4986840486526489, -0.9226979613304138, -0.09380371868610382,...
def remove ( self, recursive = true ) : if not self. exists : return if not self. isdir : os. remove ( self. path ) return lst = os. listdir ( self. path ) if len ( lst )! = 0 and not recursive : raise directorynotemptyerror ('directory not empty : ` { 0 } ` '. format ( self. path ) ) shutil. rmtree ( self. path )
[ -0.5602071285247803, 0.7925593852996826, 0.5062520503997803, 0.4433988630771637, 0.19184863567352295, -0.062313348054885864, 0.6160467267036438, 1.0817099809646606, 0.11177093535661697, -0.5342893004417419, 0.24785469472408295, -0.22042159736156464, -0.5739855170249939, 0.9917460083961487,...
def update _ entry ( ebook _ data ) : solr _ data = {'add': {'doc': ebook _ data, }, } headers = {'content - type':'application / json ','accept':'application / json'} requests. post ('http : / / localhost : 8983 / ebooks / update ', data = json. dumps ( solr _ data ), headers = headers )
[ -1.0247658491134644, -0.8087862133979797, 0.5298689603805542, 0.33476442098617554, 0.15646691620349884, 0.9174637198448181, -0.9301702976226807, 0.1262618750333786, -0.10887527465820312, 0.4718204140663147, 0.11301975697278976, 0.45217540860176086, -0.7325396537780762, 0.020337942987680435...
def contains ( self, value ) : return bool ( self. search ( value ) )
[ -0.5126112103462219, 0.0833817720413208, 0.20767123997211456, 0.3156331777572632, -0.5937409400939941, 0.6510457396507263, -0.03611799702048302, -0.6321344971656799, -0.04931097850203514, -0.5177952647209167, -0.1489676982164383, -0.6041441559791565, -0.6919150352478027, 0.2106900513172149...
def preprocess _ features ( features, sparse = true ) : rowsum = np. array ( features. sum ( 1 ) ) r _ inv = np. power ( rowsum, - 1 ). flatten ( ) r _ inv [ np. isinf ( r _ inv ) ] = 0. r _ mat _ inv = sp. diags ( r _ inv ) features = r _ mat _ inv. dot ( features ) if sparse : return sparse _ to _ tuple ( features ) ...
[ -1.1042470932006836, 0.45669496059417725, 0.5633642673492432, 0.776769757270813, 0.6042860150337219, -0.41085532307624817, 0.8241701126098633, 1.114975929260254, 0.827859103679657, 0.47742587327957153, -0.26165181398391724, -0.4962961673736572, -0.1749686300754547, -0.23427432775497437, ...
def get _ validation _ fold _ time ( x _ train, y _ train, x _ val : pd. dataframe, y _ val : union [ pd. series, pd. dataframe ], end _ too : bool = false ) - > pd. series : timeindex = y _ val. index [ [ 0 ] ] if not end _ too : return pd. series ( timeindex, index = timeindex, name ='valstart') # also in index for a...
[ -0.28041699528694153, 0.9551637172698975, 0.6297113299369812, 0.21907971799373627, -0.02810291387140751, -0.23189938068389893, -0.6777277588844299, -0.2841207683086395, -0.7018734216690063, 0.82264643907547, 0.6007450222969055, 1.018510103225708, 0.4917066991329193, 0.061466336250305176, ...
def addcomponentstokit ( self, session, kit, complist ) : dbkit = session. query ( kits ). filter ( and _ ( kits. name = = kit. getname ( ), kits. version = = kit. getversion ( ), kits. iteration = = kit. getiteration ( ) ) ). one ( ) # add components. for c in complist : self. _ addcomponenttokit ( session, c, dbkit )...
[ -1.3984838724136353, 0.21740199625492096, 0.45600268244743347, -0.22429093718528748, 0.64592045545578, -0.1667056381702423, -0.1256890743970871, 0.06971185654401779, 1.0257134437561035, -0.34246566891670227, -0.5724589824676514, -1.101638674736023, -0.5798486471176147, 0.43604859709739685,...
def init ( outputfile ) : global f f = open ( outputfile, " w " )
[ 0.1464751958847046, -0.7271537184715271, 0.3292764127254486, 0.650460422039032, 0.02562488242983818, 0.9572619795799255, 2.176175594329834, 0.678192138671875, -2.0597381591796875, -0.5721522569656372, -0.35729897022247314, -0.043584417551755905, 0.2365114390850067, 0.3343803584575653, -0...
def solve ( self, ones, dont _ care = [ ] ) : # handle special case for functions that always evaluate to true or # false. if len ( ones ) = = 0 : return 0,'0'if len ( ones ) + len ( dont _ care ) = = 1 < < self. numvars : return 0,'1'primes = self. compute _ primes ( ones + dont _ care ) return self. unate _ cover ( l...
[ -1.5797712802886963, 0.8482187390327454, 0.47129490971565247, 0.5057352781295776, 0.42461368441581726, -0.08612078428268433, 0.18222923576831818, -0.2321159392595291, 0.4638194739818573, 0.38801878690719604, -0.5842397809028625, -0.7749762535095215, -0.5690460801124573, 0.7792935967445374,...
def scrape _ desired _ group _ elements ( self ) : # find name and designation elements # self. designations = webdriverwait ( self. driver, 10 ). until ( lambda x : x. find _ element _ by _ class _ name ( " _ 60rj " ) ) # self. names = webdriverwait ( self. driver, 10 ). until ( lambda x : x. find _ element _ by _ cla...
[ -1.703831672668457, -0.2044590413570404, 0.5862087607383728, -0.19959042966365814, 0.5846511721611023, 0.07262063771486282, 0.3259364068508148, 0.28115779161453247, -0.6462886929512024, -0.3948761522769928, 0.15302543342113495, 0.30243855714797974, -0.055946581065654755, 1.1813031435012817...
def downsample _ avg ( in _ chs, out _ chs, kernel _ size = 1, stride = 1, dilation = 1, norm _ layer = none, preact = false, ) : norm _ layer = norm _ layer or nn. batchnorm2d avg _ stride = stride if dilation = = 1 else 1 pool = nn. identity ( ) if stride > 1 or dilation > 1 : avg _ pool _ fn = avgpool2dsame if avg _...
[ -0.4984368681907654, -0.10394184291362762, 0.7611070275306702, 0.3264271914958954, -1.400051236152649, -0.31445300579071045, 0.7671532034873962, -0.07306107133626938, -0.03788219764828682, 0.03069854900240898, 0.5059592723846436, 1.113162875175476, -0.09324127435684204, 0.03644474595785141...
def _ _ http _ download ( self, url _ string ) : try : if ( url _ string [ : 7 ]! = " http : / / " ) : url _ string = " http : / / " + url _ string if ( self. _ _ is _ allowed ( url _ string ) ) : return requests. get ( url _ string, headers = { " user - agent " : " student @ dtu _ bot / 0. 1 " } ) except requests. exc...
[ -0.14138995110988617, -0.4453833997249603, 0.7684495449066162, 0.6418765783309937, -0.8253400325775146, 0.4164585769176483, -0.35638734698295593, -0.6502545475959778, -0.0656432956457138, 0.02357938140630722, 0.36519142985343933, 0.2971031069755554, -0.9121649265289307, -0.838701605796814,...
def reset _ heartbeat ( self ) : self. poller. unregister ( self. bind _ heatbeat ) self. log. debug ( " unregistered heartbeat. " ) self. bind _ heatbeat. close ( ) self. log. debug ( " heartbeat connection closed. " ) self. bind _ heatbeat = self. heatbeat _ connect ( ) return self. get _ heartbeat
[ -0.0754719004034996, 0.3483758270740509, 0.7274436950683594, 0.7977039813995361, 0.24169020354747772, 0.4358653128147125, 0.19934295117855072, 0.0642099604010582, 0.04341539368033409, -0.26568683981895447, -0.2715989053249359, 1.185756802558899, -1.7966629266738892, 0.34094059467315674, ...
def _ mgui _ get _ orientation ( self ) - > str : if isinstance ( self. _ qwidget. layout ( ), qtw. qvboxlayout ) : return " vertical " else : return " horizontal "
[ 0.2749076783657074, 0.039593521505594254, 0.49539563059806824, 0.579050600528717, -0.8794164657592773, 0.5494667887687683, -0.23087897896766663, -1.008169174194336, -0.1415492594242096, 0.43147072196006775, 0.31285062432289124, -1.072858214378357, -0.3272249102592468, -0.45660486817359924,...
def add _ human _ player ( self ) : self. players. append ( human _ player ( ) ) self. values _ for _ negamax. append ( 1 )
[ -1.3779973983764648, 0.2302934229373932, 0.38154011964797974, 0.52928227186203, 0.8563186526298523, 1.0700998306274414, -0.6642658114433289, 0.07557941973209381, -0.5665649175643921, -0.14593954384326935, -0.7962599396705627, 0.06641142815351486, -0.09417849779129028, 0.8566514253616333, ...
def categorical _ features ( parsed _ comments ) : parsed _ comments ['has _ exag'] = 0 parsed _ comments ['has _ ques'] = 0 parsed _ comments ['has _ at'] = 0 parsed _ comments ['num _ emoji'] = 0 for index, row in parsed _ comments. iterrows ( ) : if parsed _ comments ['usernamet'] [ index ]! = [ ] : parsed _ comment...
[ -0.30200549960136414, -0.7200515270233154, 0.579884946346283, -0.9632178544998169, 0.6432715058326721, -0.2986704409122467, 0.1812918335199356, 0.7077692747116089, -0.8555961847305298, -0.19343437254428864, -0.8367283940315247, -0.13090616464614868, 0.5569507479667664, 0.5252907276153564, ...
def select _ targets ( self, count = 1 ) : targ _ count = np. random. multinomial ( count, pvals = self. target _ probs ) targ _ gi _ count = { } for targ _ ind in xrange ( self. ntargs ) : if targ _ count [ targ _ ind ] > 0 : gi = self. target _ gis [ targ _ ind ] if not self. sel _ targ _ pos _ probs. has _ key ( gi ...
[ -0.9820115566253662, -0.4459030330181122, 0.5304526090621948, -0.6096255779266357, 0.6885704398155212, -0.5765459537506104, -0.20099827647209167, 0.12068136781454086, -0.5139057636260986, 0.8536096811294556, 0.1754729151725769, 0.19805896282196045, -0.10158160328865051, 0.21118013560771942...
def update _ time ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " update _ time " )
[ 0.4950213134288788, -0.8218655586242676, 0.4830574691295624, 0.3433084487915039, -0.19001096487045288, 0.6671984791755676, -0.5185207724571228, 0.31471219658851624, 0.048481978476047516, 1.3021677732467651, 0.0003689229488372803, 0.2045784294605255, -0.07724913209676743, -1.016247868537902...
def plot _ metric ( x, cut _ off ) : plt. plot ( sorted ( x ), label ='sorted metric') plt. axhline ( cut _ off, color ='red ', label ='cut _ off _ point') plt. legend ( ) plt. show ( )
[ 1.7630451917648315, 0.9534319639205933, 0.3677314519882202, -0.5800083875656128, -1.3394278287887573, 2.0878102779388428, 0.37385818362236023, -0.15544162690639496, -0.17274223268032074, 0.6291636228561401, 0.789200484752655, 1.4839617013931274, 0.8018057942390442, -0.2652991712093353, 0...
def distributors ( ) : print ( " \ n ". join ( cosmic _ ray. plugins. distributor _ names ( ) ) ) sys. exit ( exitcode. ok )
[ 0.45961466431617737, -1.2061575651168823, 0.6380429267883301, 0.5547180771827698, 0.8895475268363953, 0.09394118189811707, 0.0704968199133873, 0.5848559141159058, -0.29662904143333435, 0.2846170663833618, -0.18476808071136475, 0.6590672731399536, 0.2977570593357086, 0.1498347520828247, 0...
def gcd ( a, b ) : while b > 0 : a, b = b, a % b return a
[ 0.6004133224487305, 0.2734820246696472, 0.49019086360931396, -0.4140491485595703, 0.06670734286308289, 0.8011682033538818, -0.37071359157562256, -0.595104992389679, -0.1850443333387375, -0.45487093925476074, 1.6315200328826904, 0.6873621940612793, -0.8140566945075989, -0.2977019250392914, ...
def rear ( self ) - > int : if self. isempty ( ) : return - 1 return self. items [ self. tail - 1 ]
[ -0.7685131430625916, 0.5771622061729431, 0.8219946026802063, 0.155526265501976, 0.3214195668697357, -0.3712746500968933, -0.1040477454662323, 0.23501749336719513, -0.5789649486541748, -0.8377712965011597, -0.4454537630081177, 1.1626007556915283, -1.3101049661636353, -0.5187994837760925, ...
def testpregister ( self ) : client = client ( ) response = client. get ( " / register / " ) self. assertequal ( response. status _ code, 200 )
[ -0.30832111835479736, 1.1003268957138062, 0.2535412013530731, 0.7626636624336243, 1.8115546703338623, 0.2688053548336029, -0.39304178953170776, 0.8539940714836121, -0.7358401417732239, -1.1793885231018066, -0.6160264015197754, 0.31077831983566284, 0.046370573341846466, 0.24126306176185608,...
def search ( self, * * kwargs ) : if'uuid'in kwargs and kwargs. get ('uuid') is not none : uuid = kwargs ['uuid'] del kwargs ['uuid'] return self. request ('search ', method ='get ', uuid = uuid, * * kwargs ) if'dto'in kwargs and kwargs. get ('dto') is not none : dto = kwargs ['dto'] del kwargs ['dto'] return self. req...
[ -1.1569771766662598, 0.820716917514801, 0.9264834523200989, -0.2896643579006195, 0.37304598093032837, -0.1830819994211197, -0.4474561810493469, -0.358322411775589, 0.14633800089359283, 0.9242701530456543, 0.3834366202354431, 0.6200178861618042, -1.0802313089370728, 0.16060861945152283, -...
def parse _ threshold ( threshold ) : try : return float ( threshold ) except valueerror : try : raw _ millis = float ( threshold [ : - 1 ] ) suffix = threshold [ - 1 ] if suffix in threshold _ suffix _ multipliers : return raw _ millis * threshold _ suffix _ multipliers [ suffix ] print ('unexpected duration in thresh...
[ 0.8594034910202026, 0.03403574973344803, 0.5680167078971863, 0.6286470890045166, -0.9391694664955139, -0.45243945717811584, -0.15985363721847534, 0.07806973904371262, 0.06731633841991425, 0.5441808104515076, -0.35190415382385254, 0.4471490979194641, 0.6971043944358826, -0.0152610307559371,...
def analyzestep ( vec, allfifos, thetime ) : fifoid = 0 for fifo in ( vec > 0 ) : if fifo : allfifos [ fifoid ]. recordwrite ( thetime ) fifoid = fifoid + 1 fifoid = 0 for fifo in ( vec < 0 ) : if fifo : allfifos [ fifoid ]. recordread ( thetime ) fifoid = fifoid + 1
[ -0.15309743583202362, -0.40486088395118713, 0.3143404424190521, 0.6937848329544067, 0.831000030040741, -0.866753339767456, 0.2760642468929291, 0.5718076229095459, -0.8434175848960876, -0.0363827608525753, -0.10512474924325943, -0.010664688423275948, -0.3615559935569763, 2.064793825149536, ...
def format _ failed _ rules _ dict ( failed _ rules _ dict ) : if failed _ rules _ dict : failed _ rules _ list = [ ] for key in failed _ rules _ dict : element = key +':'+ failed _ rules _ dict [ key ] failed _ rules _ list. append ( element ) counter = 1 failed _ rules _ dict = { } for each in failed _ rules _ list :...
[ -0.49339383840560913, -0.5977453589439392, 0.4387129843235016, -0.881163477897644, 0.33778083324432373, 0.7297295928001404, -0.42993786931037903, 0.3855186700820923, -0.09318637102842331, 0.5136370062828064, 0.10723959654569626, -0.440330445766449, 0.2666761577129364, 1.1499501466751099, ...
def test _ read ( self ) : old _ in _ files = list ( self. _ sp. in _ files ) self. _ sp. set _ in _ files ( [ self. _ test _ file, self. _ test _ file ] ) self. _ sp. read ( ) # check the size of the items parsed. received = self. _ sp. size expected = 2953 msg ='size of items parsed error'self. assertequal ( received...
[ 0.27655228972435, -0.467099666595459, 0.8359202146530151, -0.4794146418571472, 0.6284772753715515, -0.09218199551105499, 0.585402250289917, 0.35200929641723633, 0.26131969690322876, -0.08127959072589874, -0.26389312744140625, -0.3137391209602356, -0.7644926309585571, -0.6234389543533325, ...
def parse _ event ( self, response, today ) : event _ name = response. css ( '. b - content _ _ title - highlight : : text'). get ( ). strip ( ) event _ id = response. url. split ('/') [ - 1 ] # should i use this as the event id? should the id be more descriptive? date _ and _ location = response. css ( '. b - list _ _...
[ -0.0440058670938015, -0.09968253970146179, 0.85501629114151, 0.14594140648841858, 0.5268656611442566, 0.010395018383860588, -0.7909016013145447, -0.08137261122465134, -0.28390878438949585, -0.27020612359046936, -0.09933003783226013, -1.3367033004760742, 0.7782610654830933, 0.63477402925491...
def modf ( arg, queue = none ) : intpart = arg. _ new _ like _ me ( queue = queue ) fracpart = arg. _ new _ like _ me ( queue = queue ) _ modf ( intpart, fracpart, arg, queue = queue ) return fracpart, intpart
[ -0.5881600975990295, -0.14478349685668945, 0.48862844705581665, -1.2282981872558594, -0.6620696187019348, -0.5428457856178284, 0.40073198080062866, -0.23745529353618622, -0.25483840703964233, -0.607315182685852, -0.40854862332344055, -0.4217998683452606, -1.010987401008606, 0.9037426710128...
def save ( self ) : assignments = self. _ get _ update ( ) return self. driver. put _ element ( [ a. get _ ast ( ) for a in assignments ] )
[ -1.9831066131591797, -0.0535423681139946, 0.3590185344219208, -0.3502504229545593, -0.2688359320163727, -0.4909628927707672, -0.2853880226612091, 0.3137226700782776, -0.21028347313404083, 1.293539047241211, -0.0751798003911972, -1.4059916734695435, -0.9935104250907898, 0.31255027651786804,...
def delete ( self ) : self. method = " delete " self. send ( )
[ 0.3832002282142639, 0.5390037298202515, 0.23276403546333313, 0.7047644853591919, 1.8360378742218018, -0.512144923210144, 0.6962189674377441, 0.2740132510662079, 0.21852615475654602, -0.39138031005859375, 0.06597144901752472, 0.9999790191650391, -0.9716310501098633, 0.4828340411186218, -0...
def update _ stats ( self, batch : th. tensor ) - > none : b _ size = batch. shape [ 0 ] if len ( batch. shape ) = = 1 : batch = batch. reshape ( b _ size, 1 ) self. inv _ learning _ rate + = self. decay * * self. num _ batches learning _ rate = 1 / self. inv _ learning _ rate if self. count = = 0 : self. running _ mea...
[ -0.1488722711801529, -0.47692587971687317, 0.5627462863922119, 0.25875958800315857, 0.05900668725371361, 0.5059621334075928, 0.4980601370334625, 0.13488918542861938, -0.3104081451892853, 0.1360730230808258, 0.10796336084604263, 1.0570917129516602, -0.20613166689872742, 0.30650416016578674,...
def _ gen _ dict ( rc _ name, properties ) : rc _ str ='boxplot. { 0 }. { 1 }'dictionary = dict ( ) for prop _ dict in properties : dictionary. setdefault ( prop _ dict, plt. rcparams [ rc _ str. format ( rc _ name, prop _ dict ) ] ) return dictionary
[ -0.11904996633529663, -0.3272223174571991, 0.3333536982536316, -0.713450014591217, -0.4659922122955322, 0.049277037382125854, -0.29818814992904663, 0.08578548580408096, -1.5013729333877563, 0.18053984642028809, -0.18640011548995972, -0.6061733365058899, 0.19451390206813812, -0.033217027783...
def validateinfections ( self ) : # convert infection date to date if not already self. infections. date = pd. to _ datetime ( self. infections. date ) # convert burnin to date if not already self. infections. burnin = pd. to _ datetime ( self. infections. burnin )
[ -0.7057686448097229, -0.6447530388832092, 0.6572808623313904, 0.19268999993801117, 0.2750686705112457, 0.22019588947296143, -0.21883438527584076, -0.3389682471752167, 0.14475299417972565, -0.19089120626449585, 0.9971621036529541, 0.5230156779289246, -0.29784590005874634, 0.0638144835829734...
def score _ gcp ( cls, deployment, source _ url, destination _ url, credential = none, * * kwargs ) : intake _ settings = { " type " : " gcp ", } if credential is not none : if isinstance ( credential, credential ) : intake _ settings [ " credential _ id " ] = credential. credential _ id else : intake _ settings [ " cr...
[ -0.6142281889915466, -0.007051126565784216, 0.6826715469360352, -0.13070650398731232, 0.512933075428009, 0.6303675770759583, -0.6692228317260742, -0.40011969208717346, -0.8483187556266785, 1.4557431936264038, -0.06829605251550674, 0.34106358885765076, -0.48384615778923035, -0.1848968714475...
def dump _ interference ( dump _ file, patches ) : l = [ ] for patch in patches : tmp = [ ] for other in patch. interfering : tmp. append ( [ patch. id, other. id ] ) tmp. sort ( ) l. extend ( tmp ) csv. writer ( dump _ file ). writerows ( l )
[ 0.33555108308792114, -0.4525097906589508, 0.4467444121837616, -0.6699194312095642, 0.2507329285144806, 0.8776494860649109, 0.3583134114742279, 0.19032709300518036, 0.010625539347529411, -0.4143081605434418, -0.20688673853874207, -0.11858145892620087, -0.525880753993988, -0.0415563955903053...
def tensor _ to _ list ( t ) : return t. detach ( ). cpu ( ). numpy ( ). tolist ( )
[ -0.019269723445177078, -0.10177033394575119, 0.1995343714952469, -0.8310824632644653, 0.6580445170402527, 0.10111740231513977, 0.03619740158319473, -0.0066426899284124374, 0.2122822105884552, 1.5141792297363281, -1.6607868671417236, 0.3482944071292877, 0.6274272203445435, -0.76353847980499...
def testnewstyleaudiosummary ( self ) : event _ sink = _ eventgenerator ( self, zero _ out _ timestamps = true ) writer = test _ util. filewriter ( self. get _ temp _ dir ( ) ) writer. event _ writer = event _ sink with tf. compat. v1. graph ( ). as _ default ( ) : with self. test _ session ( ) as sess : ipt = tf. rand...
[ 0.37724751234054565, 0.6602988243103027, 0.7273444533348083, 0.3375158905982971, 0.7552167177200317, -0.278289258480072, 1.0019371509552002, -0.30299583077430725, 0.20817826688289642, 0.5171321034431458, -0.16355697810649872, 0.28090307116508484, 0.7921270728111267, -0.7063401341438293, ...
def is _ square ( self ) : return ( self. pt2. x - self. pt1. x ) = = ( self. pt2. y - self. pt1. y )
[ -0.4103405773639679, -1.2248960733413696, 0.7668260931968689, 0.7916123867034912, 0.6394688487052917, 0.13677720725536346, -0.08190637826919556, -0.8006505966186523, 0.6572105288505554, 0.09825698286294937, -1.1050883531570435, 0.8798558115959167, 0.14554859697818756, -0.4284062385559082, ...
def structural _ variant _ sample ( project, institution, structural _ variant ) : item = { " project " : project [ " @ id " ], " institution " : institution [ " @ id " ], " structural _ variant " : structural _ variant [ " @ id " ], " call _ info " : " some _ sample ", " file " : " some _ vcf _ file ", } return item
[ 0.25754791498184204, -0.572007954120636, 0.21129241585731506, -0.5066115260124207, -0.451299250125885, 0.03632263094186783, -0.9310509562492371, 0.14448900520801544, -0.1372658759355545, 0.4934506416320801, -0.46067988872528076, 0.10366444289684296, -0.5220267176628113, -1.239516019821167,...
def collater ( self, samples ) : return collate ( samples, pad _ idx = self. langpair _ dataset. src _ dict. pad ( ), eos _ idx = self. langpair _ dataset. src _ dict. eos ( ), ctx _ pad _ idx = self. context _ dict. pad ( ), left _ pad _ source = false, left _ pad _ target = false, input _ feeding = true, input _ form...
[ -0.1719464361667633, -0.3564791977405548, 0.6043485403060913, -1.0766377449035645, -0.32171425223350525, 0.17641200125217438, -0.3963311016559601, -0.5777943134307861, 0.23950603604316711, -0.1867150515317917, 0.9885602593421936, -0.5674694776535034, -0.30572158098220825, 0.571653068065643...
def ldap _ search ( self, user ) : dn = " uid = " + user + ldapserver. _ base _ dn try : data = self. server. search _ s ( dn, ldap. scope _ subtree ) [ 0 ] [ 1 ] self. search = {'login': user,'data': data } return self. search except ldap. ldaperror : return none
[ -1.711927056312561, 0.48605871200561523, 0.4618838429450989, -0.8310464024543762, -1.3095684051513672, -0.24419942498207092, -0.5411862134933472, -0.9156836867332458, 1.0022472143173218, -0.6901504993438721, -0.6372824311256409, 0.6212705969810486, -0.35156330466270447, -0.0461396761238575...
def get _ method ( self ) : return self. method
[ -0.2720002233982086, 0.21116900444030762, 0.3026027977466583, -0.2158157229423523, 0.8494172096252441, -0.583339512348175, 0.5063505172729492, -0.7649427056312561, -0.1556553691625595, -1.0192103385925293, 0.6981723308563232, 0.7974652647972107, 0.13384900987148285, -0.060569118708372116, ...
def _ _ walk _ to _ realoffset _ _ ( self, offset, filter = lambda sptr, items : items ) : owner = self. owner # define a closure that grabs the type information for a particular # member, and converts it to a pythonic - type. this way it's easier # for us to determine both the member's type and its size. def dissolve ...
[ -0.9039415717124939, -0.4133380353450775, 0.9311952590942383, -0.6993151903152466, -0.1449189931154251, -0.17692717909812927, 0.30446580052375793, -0.17985516786575317, -0.009267227724194527, -0.2619672417640686, 0.2865229845046997, 0.2709093987941742, -0.5402620434761047, 0.13240842521190...
def object _ embedding ( self, z, x _ color ) : # use z to get at color values at x z _ patch = z [..., : 4 ]. detach ( ) z _ patch = self. sup. sy _ from _ quotient ( z _ patch ) patches = self. sup. patches _ from _ z ( x _ color. flatten ( end _ dim = 1 ), z _ patch. flatten ( end _ dim = 2 ) ) # could do autoencodi...
[ -0.07349582761526108, -0.21942973136901855, 0.5488722920417786, -0.09295976161956787, -0.7023128271102905, 0.3388790488243103, 0.4589024484157562, -0.17525063455104828, 0.8241564631462097, 0.021370965987443924, -0.60808926820755, 0.24932079017162323, 0.6070958375930786, -0.2629560530185699...
def cleanname ( constructname ) : return constructname. split ( " : : ", 2 ) [ - 1 ]
[ -0.6937005519866943, -1.4778517484664917, 0.7212221026420593, -0.3581545352935791, -0.5379974246025085, 0.5122404098510742, 0.08383069187402725, 0.04459172114729881, -0.39030593633651733, 0.770977258682251, -0.2382146418094635, -0.29750198125839233, -0.36368849873542786, -0.981908977031707...
def finddashboardlink ( url ) : global covid _ dashboard _ link try : page = requests. get ( url ) soup = beautifulsoup ( page. content, " html. parser " ) covid _ dashboard _ link = soup. find ( src = re. compile ( " coviddashboard " ) ). attrs ['src'] except requests. exceptions. requestexception as e : print ( f'err...
[ -0.1652653068304062, 0.6464681625366211, 0.7470967769622803, 0.3167877793312073, 0.27939489483833313, -0.32644787430763245, 1.4761838912963867, 0.7976946234703064, -0.6433148980140686, -0.852230966091156, -0.0704006627202034, 0.10815151035785675, -0.29792624711990356, 0.5293792486190796, ...
def log _ info ( self, resource, msg ) : self. logger. info ( " [ % s ] % s - % s " % ( resource ['id'], resource ['name'], msg ) )
[ 0.20005738735198975, -0.8252411484718323, 0.4853546917438507, -0.939046323299408, 0.04574672877788544, 0.04533925652503967, -0.9486393928527832, 0.06044040620326996, -0.867729663848877, 0.016345739364624023, -0.35392868518829346, 0.06672739237546921, 0.6382058262825012, 0.5920465588569641,...
def skip _ tasks ( self, task _ ids ) : # verify that all nodes _ to _ skip have all dependencies finished nodes _ to _ skip = [ self. nodes [ node _ id ] for node _ id in task _ ids ] # todo verify if this works as desired, # it seems like we're checking if task can be skipped one by one # while this may not work when...
[ -0.9082815647125244, 0.24637600779533386, 0.49548783898353577, 0.24875424802303314, 0.5981420874595642, 0.9100008606910706, 1.3625086545944214, -0.1398056149482727, -1.0254218578338623, 0.554631769657135, -0.6647235155105591, 0.04153161868453026, 0.1270751804113388, 1.0851140022277832, -...
def _ flush ( self, buffer, start, end ) : buffer _ size = len ( buffer ) if not buffer _ size : return with self. _ size _ lock : if end > self. _ size : with _ handle _ azure _ exception ( ) : self. _ resize ( content _ length = end, * * self. _ client _ kwargs ) self. _ reset _ head ( ) if buffer _ size > self. max ...
[ -0.3280809223651886, 0.26516246795654297, 0.8010623455047607, -0.1600010246038437, -0.23567645251750946, 0.0354795902967453, -0.06712981313467026, -0.6036919951438904, -0.8226815462112427, -0.07886800915002823, -0.25035718083381653, 0.9042996168136597, -1.1007806062698364, -0.3179122805595...
def plot _ posterior _ predictive ( trace, eval = none, lm = none, samples = 30, * * kwargs ) : import matplotlib. pyplot as plt if lm is none : lm = lambda x, sample : sample ['intercept'] + sample ['x'] * x if eval is none : eval = np. linspace ( 0, 1, 100 ) # set default plotting arguments if'lw'not in kwargs and'li...
[ 0.4785211980342865, 0.43314868211746216, 0.8524339199066162, -0.5735872387886047, -0.9441309571266174, 0.7470796704292297, -0.41397643089294434, -0.0992068201303482, 0.05780523642897606, -0.3699612319469452, -0.2780921757221222, 0.6679622530937195, -0.6757271885871887, -0.06890592724084854...
def get _ hardware _ address ( self ) : raise notimplementederror ( " the method not implemented " )
[ -0.5155121088027954, -0.11056440323591232, 0.908621072769165, 1.3388665914535522, -0.0013668239116668701, 1.1004364490509033, 0.7095704674720764, 0.10971025377511978, -0.44289377331733704, -0.23526093363761902, 0.09085110574960709, 1.2020615339279175, -0.4673309922218323, 0.235395580530166...
def molfromadjmat ( atoms, amat, sanitize = true ) : m = chem. rwmol ( ) # add in the separate atoms for a in atoms : m. addatom ( atom ( a ) ) side _ len = len ( amat ) for r in range ( side _ len ) : for c in range ( r + 1, side _ len ) : bond _ order = amat [ r ] [ c ] if bond _ order > 0 : if bond _ order = = 1 : m...
[ 0.2964238226413727, -0.3965628147125244, 0.6583366990089417, -0.37650516629219055, -0.5770198702812195, 0.5541160702705383, -0.9064226150512695, -0.6890996098518372, 0.6778920292854309, 0.4823174774646759, 0.28581103682518005, -0.3945273458957672, 0.03656085208058357, -0.5047995448112488, ...
def quat ( self ) : return self. _ rot. as _ quat ( )
[ -0.6358850598335266, -0.8828675150871277, 0.34925034642219543, -0.35963764786720276, -0.03467384725809097, -0.16032831370830536, 0.1688355803489685, -1.2565637826919556, 0.511080265045166, -0.9463974833488464, 0.20532572269439697, 0.0962977260351181, -0.31576523184776306, -1.67753648757934...
def perm _ unique ( elements ) : eset = set ( elements ) listunique = [ [ i, elements. count ( i ) ] for i in eset ] u = len ( elements ) return perm _ unique _ helper ( listunique, [ 0 ] * u, u - 1 )
[ -0.5902272462844849, 0.5563356280326843, 0.5731894373893738, 0.3965814709663391, -0.5740674138069153, 0.540925920009613, 0.8079993724822998, 1.19257652759552, 1.2687740325927734, 0.34830036759376526, -0.5697150826454163, 0.10603263229131699, -1.0808708667755127, -0.25619107484817505, 0.1...
def list _ all _ workspaces ( self ) - > list [ str ] : names = [ ] try : resp = self. api _ client. list _ namespaced _ pod ( self. namespace, pretty = true ) for item in resp. items : names. append ( item. metadata. name ) except apiexception as e : print ( f " exception when calling list _ namespaced _ pod : { e } \...
[ -0.4752126932144165, -0.3177601397037506, 0.493447870016098, 0.19089911878108978, 0.2070755511522293, 0.7331240773200989, -0.9208751916885376, -1.1716680526733398, 0.7693766951560974, 0.19516733288764954, -0.30891215801239014, 1.2113738059997559, -0.8602918982505798, 0.7051759958267212, ...
def quat _ to _ rotmat ( quat ) : norm _ quat = quat norm _ quat = norm _ quat / norm _ quat. norm ( p = 2, dim = 1, keepdim = true ) w, x, y, z = norm _ quat [ :, 0 ], norm _ quat [ :, 1 ], \ norm _ quat [ :, 2 ], norm _ quat [ :, 3 ] b = quat. size ( 0 ) w2, x2, y2, z2 = w. pow ( 2 ), x. pow ( 2 ), y. pow ( 2 ), z. p...
[ 0.03428862616419792, -0.48514968156814575, 0.7977417707443237, -1.0803066492080688, -0.5171955823898315, 0.11284887045621872, 0.3872033953666687, -0.7971348166465759, 0.2266211062669754, -0.11785620450973511, -0.5556331872940063, -0.3213886320590973, -0.3164580464363098, -1.436865210533142...
def isvalidtocloseoff ( adjcell, sidedir ) : # if the adjcell has no required sides, then it is okay to close this off if adjcell. reqsides is none : return true countblank = adjcell. countblanksides ( ) # the side bordering the adjcell and the 5 - cell ( will become active ) borderside = adjcell. sides [ sidedir ] # t...
[ 0.12360870838165283, -0.05736059695482254, 0.7597612142562866, -0.786371111869812, -0.7478622794151306, 0.6438276171684265, 0.11168193817138672, -0.4820226728916168, -0.09657137095928192, 0.16640783846378326, 0.7547562122344971, 0.4189276099205017, -0.8598487973213196, 0.6207832098007202, ...
async def test _ str _ temperature ( self ) : xknx = xknx ( ) expose _ sensor = exposesensor ( xknx, " testsensor ", group _ address = " 1 / 2 / 3 ", value _ type = " temperature " ) await expose _ sensor. process ( telegram ( destination _ address = groupaddress ( " 1 / 2 / 3 " ), payload = groupvaluewrite ( dptarray ...
[ 0.18798072636127472, 0.40923643112182617, 0.3375247120857239, -0.43382030725479126, -0.0029844995588064194, 0.23552961647510529, -0.4133744239807129, -0.026066463440656662, 0.033587247133255005, 0.7390245795249939, -0.3251332640647888, -0.0837426632642746, -0.44535374641418457, -0.52083545...
def clear _ cache ( self ) : # call clean up of recurrenceplot jointrecurrenceplot. clear _ cache ( self ) # call clean up of network network. clear _ cache ( self )
[ 0.6965702772140503, 0.17513743042945862, 0.12269594520330429, 0.40129685401916504, -0.3982921242713928, 0.06433062255382538, 0.9558971524238586, -0.11079425364732742, 0.11750748008489609, 0.165832057595253, 0.632861316204071, 0.5087040066719055, -0.23817864060401917, 0.10111609846353531, ...
async def do _ worklist ( self, msgs : [ ] ) : msg _ ids = { msg. msg _ id for msg in msgs } responses = [ ] for msg in msgs : await self. send _ message _ in ( msg ) while len ( msg _ ids ) > 0 : self. logger. debug ('doworklist remaining : { } '. format ( len ( msg _ ids ) ) ) item = await self. get _ message _ out (...
[ -0.49125972390174866, -0.6227912306785583, 0.8869727849960327, 0.08906929194927216, 0.3627040386199951, -0.13071449100971222, 0.47168225049972534, -0.3346555829048157, 0.1123948022723198, 0.496753990650177, -0.24379265308380127, -0.5739614367485046, -1.5411250591278076, 0.7933477163314819,...
def _ delete _ iscsi _ target ( self, volume ) : v = self. vmem _ vip target _ name = self. _ get _ short _ name ( volume ['name'] ) # todo ( rlucio ) : afterglow + does not require the user to manually # delete both iscsi target bindings before deleting the target # log. info ( _ ( " deleting iscsi target for % s " ),...
[ 0.0559084452688694, -0.7554997205734253, 0.5726167559623718, -0.08764493465423584, -0.24680572748184204, -0.52781081199646, -0.22167973220348358, -0.0572342611849308, 0.5506159663200378, 0.452597975730896, 0.8908290266990662, 0.5031914114952087, -0.723400354385376, -0.4986981451511383, 0...
async def get _ paste ( self, paste _ id : str ) - > paste : data = await self. _ fetch ( urljoin ( _ pastebin _ url, paste _ id ) ) tree = document _ fromstring ( data ) def validate _ element ( element : optional [ _ t ], name : str ) - > _ t : if element is none : raise runtimeerror ( f " unknown response returned, ...
[ -0.7815423011779785, 0.3191753029823303, 0.6931576132774353, 0.458676815032959, -0.7139585018157959, -0.2975086271762848, -0.8675145506858826, -0.7192884683609009, 0.43440935015678406, 0.2921367883682251, 0.06080445274710655, 0.15145516395568848, -0.13148291409015656, -0.15504826605319977,...
def ledger ( self, operation ='' ) : params = { } if operation! ='' : if operation not in self. ledger _ operations : raise exception ('wrong operation') else : params = {'operation': operation } return self. call ('ledger ','get ', params )
[ -0.4864083528518677, 1.0212453603744507, 0.6164674758911133, 0.9799442887306213, 0.11398474127054214, 0.11818259954452515, -0.21647118031978607, -0.1993795484304428, 0.21964159607887268, -0.025091568008065224, 0.45183324813842773, 0.8144352436065674, -0.7373653650283813, 0.1604554504156112...
def build _ tool ( self, build _ tool ) : self. _ build _ tool = build _ tool
[ -0.04094961658120155, -0.823735237121582, -0.11284787952899933, 1.3239033222198486, 0.08519840240478516, 1.4957504272460938, 0.5854164361953735, 0.2003939300775528, -1.6846598386764526, -0.9765949249267578, -1.4462757110595703, -0.004221461247652769, 1.1502785682678223, 0.24721193313598633...
def from _ uri ( cls, reference ) : if not isinstance ( reference, uri. urireference ) : reference = uri _ reference ( reference ) return cls ( scheme = reference. scheme, userinfo = reference. userinfo, host = reference. host, port = reference. port, path = reference. path, query = reference. query, fragment = referen...
[ 0.03270120918750763, -0.2524951100349426, 0.6034492254257202, 0.040640685707330704, -0.48429393768310547, -0.023085681721568108, 0.12679331004619598, -0.9196579456329346, 0.873674750328064, -0.5329447388648987, 0.810924768447876, 0.2549996078014374, -0.8422756791114807, -0.6972166299819946...
def range100 ( ) : global secret _ number, num _ range, num _ guesses secret _ number = random. randrange ( 0, 100 ) num _ range = 100 num _ guesses = 7 init ( )
[ -0.7106664180755615, -0.12024107575416565, 0.282182902097702, 0.8815765976905823, 0.9657685160636902, 0.12127181887626648, -0.013226990588009357, 0.7752563953399658, -0.21809926629066467, 0.16922630369663239, -1.1601512432098389, 0.5578607320785522, 0.3620719313621521, 0.20025385916233063,...
def insert _ data ( data ) : document = collection. insert _ one ( data ) return document. inserted _ id
[ -0.2717996835708618, 0.8447146415710449, 0.31854623556137085, -0.6254845261573792, 0.03688380494713783, 0.5812156200408936, -0.05430534482002258, 0.09872297197580338, 0.06395015120506287, -0.13612112402915955, -1.0370094776153564, -0.9030703902244568, -1.8842376470565796, 0.089941658079624...
def _ str ( v : union [ layerfieldscontainer, layerfield ] ) - > str : assert not isinstance ( v, layerfieldscontainer ) or len ( v. fields ) = = 1 return str ( v. get _ default _ value ( ) )
[ -0.15655949711799622, 0.4591970145702362, 0.1509014070034027, -0.531831681728363, 0.7852442860603333, -0.06966527551412582, 0.258301317691803, -1.181552529335022, -0.20346544682979584, 0.06362739205360413, 0.16569805145263672, 0.1846884787082672, -0.13942934572696686, 0.23367607593536377, ...
def test _ duplicate _ report ( self ) : duplicate _ report = copy. deepcopy ( self. report _ form _ sample _ duplicate ) with self. assertraises ( exception ) as context : report _ saver = reportformsaver ( duplicate _ report ) report _ saver. extract _ report _ data _ into _ airflow ( report _ exists = false ) self. ...
[ 0.8331635594367981, 0.5577203035354614, 0.4029826819896698, 0.36749377846717834, 1.2025102376937866, 0.18320465087890625, 0.430510938167572, -0.2514025568962097, 0.5976516008377075, -0.4700224995613098, -0.9670635461807251, -0.13373903930187225, -0.30209434032440186, 0.0243412833660841, ...
def getinverseprojection ( self ) : return self. projection. inverse _ perspective ( self. width, self. height, self. fov, self. fznear, self. fzfar ). cvalues ( )
[ -0.41864821314811707, -0.6209046244621277, 0.7031710743904114, 0.29145556688308716, 0.26824623346328735, -0.0976666510105133, -0.5782586336135864, -0.4425387680530548, -0.7119722962379456, 0.18181592226028442, -0.3463456928730011, 0.25988084077835083, -1.8266710042953491, -0.60095846652984...
def unifyrepo ( ui, settings ) : conf = unifyconfig ( settings ) # ensure destrepo is created with generaldelta enabled. ui. setconfig ('format ','usegeneraldelta ', true ) ui. setconfig ('format ','generaldelta ', true ) # verify all source repos have the same revision 0 rev0s = set ( ) for source in conf. sources : r...
[ -0.01998286508023739, 0.7922129034996033, 0.6839290261268616, -0.27819985151290894, -0.01415327936410904, -0.05163450166583061, 0.4422648549079895, -0.204863503575325, -0.19739583134651184, 0.2234845608472824, -0.1612139195203781, -0.2879456877708435, 0.7144452929496765, 0.2706363201141357...
def data _ services ( request ) : return render ( request,'the _ snowmen _ snowpack _ viewer / data _ services. html')
[ -0.17622330784797668, 1.1191602945327759, 0.1583954244852066, -0.9250163435935974, -0.6499408483505249, 0.24010641872882843, 0.4032711386680603, 0.23228131234645844, 0.1664058119058609, -1.488276720046997, 0.6035958528518677, 0.6933020353317261, 0.6004577279090881, 0.6369999051094055, -0...
def trackcells ( self, max _ dist : float = np _. inf, bidirectional : bool = false ) - > none : if self. segm _ channel is none : raise runtimeerror ( " segmentation - related function called before segmentation " ) self. tracking = tracks _ t ( ) # call the track _ t class from " tracks " script frames = self. frames...
[ -0.0947546437382698, -0.4531961977481842, 0.8090804815292358, 0.24216191470623016, 0.4964825212955475, -0.36491090059280396, 1.193686604499817, 0.24536840617656708, -0.5172193050384521, -0.23084713518619537, -0.43603649735450745, -0.13293154537677765, -0.05460624024271965, 0.51553809642791...