text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def output _ results ( self, results, verbosity = 1 ) : if verbosity = = 0 : return for result in results : prefix = " % s : " % result [ " account " ] if " account " in result else " " if " fetched " in result : noun = ( self. singular _ noun if result [ " fetched " ] = = 1 else self. plural _ noun ) self. stdout. wri... | [
-0.2210196852684021,
-0.0425470732152462,
0.4968545138835907,
0.12777000665664673,
0.32997506856918335,
-0.11070379614830017,
-0.2483075112104416,
-0.5391551852226257,
-0.24263110756874084,
0.2705347537994385,
0.7278354167938232,
-0.21479585766792297,
0.284911572933197,
0.7651152014732361,... |
def get _ ip _ by _ id ( self, id _ str : str ) : for ip in self. ips : if id _ str = = ip. id : return ip raise lookuperror ( " no ip with that id found! " ) | [
-0.2545437812805176,
-1.3866742849349976,
0.2760208547115326,
-0.03018735721707344,
-0.5676727890968323,
-0.15473544597625732,
-0.6125741004943848,
-0.3417428135871887,
0.4674445688724518,
0.11258085072040558,
1.218021273612976,
-0.11506083607673645,
0.07683754712343216,
-1.340350866317749... |
def add _ drink ( data ) : drink = data ['drink'] if not drink. query. get ( drink ['drink _ id'] ) : try : new _ drink = drink ( drink _ id = drink ['drink _ id'], name = drink ['name'], image _ url = drink ['image _ url'] ) db. session. add ( new _ drink ) db. session. commit ( ) except integrityerror : db. session. ... | [
-0.8311875462532043,
0.041990846395492554,
0.686934232711792,
-0.3909686505794525,
0.7990269660949707,
-0.2277083843946457,
-0.8696412444114685,
0.6099613308906555,
0.916465163230896,
0.47239214181900024,
-0.44272828102111816,
-0.69364994764328,
-0.2863268554210663,
1.0244560241699219,
-... |
def discriminator _ network ( x, alpha _ var, params ) : print _ obj ( " \ ndiscriminator _ network ", " x ", x ) # create regularizer for layer kernel weights. regularizer = tf. contrib. layers. l1 _ l2 _ regularizer ( scale _ l1 = params [ " discriminator _ l1 _ regularization _ scale " ], scale _ l2 = params [ " dis... | [
-0.14458082616329193,
-0.3225165605545044,
0.8559182286262512,
0.910497784614563,
0.16191641986370087,
-0.03789680451154709,
0.4651821553707123,
-0.036980874836444855,
0.09928307682275772,
-0.6033371686935425,
-0.7272800207138062,
0.047894302755594254,
0.6867477297782898,
0.675917565822601... |
def set _ tag ( self, index, tag ) : index = self. _ _ validate _ tag _ index ( index ) pos = 12 + 4 * index for i, val in enumerate ( tag. get _ bytes ( ) ) : self. set _ byte ( pos + i, val ) | [
-0.4214603900909424,
0.35434120893478394,
0.15863579511642456,
-0.46543440222740173,
1.023960828781128,
-0.2639373540878296,
-0.4388289153575897,
-0.8068187832832336,
-0.502862811088562,
-0.06838750094175339,
-1.3902044296264648,
0.227279394865036,
-0.3369459807872772,
0.09402934461832047,... |
def get _ dei ( self ) : return ( self. get _ byte ( 2 ) & 0x10 ) > > 4 | [
-0.17460833489894867,
0.4195428490638733,
0.4096655547618866,
1.082388162612915,
0.9262246489524841,
-0.17006365954875946,
0.41602203249931335,
-0.2550930976867676,
0.41860243678092957,
-0.8518216013908386,
-0.8693285584449768,
-0.45270970463752747,
-0.45830270648002625,
-0.290690004825592... |
def register _ filter ( f ) : if not issubclass ( f, filter ) : raise valueerror ( " must be a subclass of'filter'" ) if not f. name : raise valueerror ('must have a name') _ filters [ f. name ] = f | [
-0.9908626675605774,
1.0361822843551636,
0.46216630935668945,
0.4199009835720062,
-0.11906836181879044,
0.17870227992534637,
-0.1582018882036209,
-0.7563217282295227,
-0.4139849841594696,
-0.1849929541349411,
-0.9677501916885376,
0.6822900772094727,
0.20465950667858124,
1.0625391006469727,... |
def maximum _ bytes _ per _ packet ( self ) - > pulumi. output [ optional [ int ] ] : return pulumi. get ( self, " maximum _ bytes _ per _ packet " ) | [
0.6153859496116638,
0.5883699059486389,
0.5413241982460022,
0.18369461596012115,
-0.18520070612430573,
0.5152813196182251,
-0.18966856598854065,
0.10205764323472977,
0.9767209887504578,
-0.915404736995697,
-0.2342696189880371,
0.22821928560733795,
-0.519856870174408,
-0.6059892773628235,
... |
def make _ query ( source = none, start = none, end = none, bounds = none ) : constraints = [ ] # if source : # constraints. append ( ( " source = % s ", [ source ] ) ) if start : # todo : add timestamp to sql code constraints. append ( ( " sitevoinfo. qt _ date = % s ", [ start. date ( ) ] ) ) constraints. append ( ( ... | [
0.088291235268116,
-0.4421268403530121,
0.5921374559402466,
0.031896863132715225,
-1.0847382545471191,
-0.0384146049618721,
-0.12640197575092316,
0.18484948575496674,
0.21062222123146057,
0.14543455839157104,
0.010725835338234901,
0.022264210507273674,
0.06142275407910347,
0.59845423698425... |
def _ _ create _ new _ record _ gui _ section ( self ) : self. c _ logger. info ( " starting to create the new record setting gui section. " ) create _ label = ttk. label ( self. main _ window, text = " create record ", font = ( " helvetica ", 16, " bold " ) ) create _ label. grid ( row = 0, column = 0, columnspan = 2,... | [
-0.23497740924358368,
0.3397919535636902,
0.9503428936004639,
-0.951554000377655,
-0.6815049052238464,
0.7224054336547852,
0.533397376537323,
-0.8931093215942383,
-1.103758692741394,
0.7910673022270203,
0.14719833433628082,
0.15074394643306732,
0.043262068182229996,
1.7523186206817627,
1... |
def test _ read _ eth _ supply ( block _ number : int, result _ key : str, result _ value : str, should _ pass : bool ) : result _ key _ bytes = bytes. fromhex ( result _ key ) if result _ key is not none else none result _ value _ bytes = bytes. fromhex ( result _ value ) if result _ value is not none else none mock _... | [
-0.783612847328186,
0.13575375080108643,
0.7493417859077454,
-0.11670427024364471,
0.407339483499527,
0.1537100076675415,
-0.30960020422935486,
-0.2342800796031952,
0.5144854187965393,
0.15486127138137817,
-0.5147590637207031,
-0.6197599768638611,
-0.08876723796129227,
-0.4172981381416321,... |
def rate _ limited ( bot, chat _ id, command ) : rate _ limit = ratelimit. query. filter ( and _ ( ratelimit. chatid = = chat _ id, ratelimit. command = = command ) ). first ( ) if rate _ limit is none : new _ rate _ limit _ record = ratelimit ( chatid = chat _ id, status ='new ', command = command, count = 0 ) db _ se... | [
-0.057757195085287094,
0.6816918253898621,
0.926292896270752,
-0.14025944471359253,
0.2789742648601532,
-0.3128313720226288,
-0.3165912628173828,
-0.7108590006828308,
-0.3808920979499817,
0.5892022848129272,
-0.5424432754516602,
0.6122626662254333,
-1.1805003881454468,
0.8297966718673706,
... |
def free ( self, * args ) : return _ topods. topods _ tshape _ free ( self, * args ) | [
-0.5801767706871033,
0.33101460337638855,
0.349840372800827,
-1.0724836587905884,
-0.35033226013183594,
0.10882727056741714,
0.5449599623680115,
-1.3465733528137207,
-0.6353157758712769,
0.18895314633846283,
-0.6320797204971313,
-0.3422292470932007,
-0.5252730846405029,
-0.0770264863967895... |
def senddata ( self, event, args, room ) : pkt = dict ( type = " event ", name = event, args = args, endpoint = self. ns _ name ) # room _ name = self. _ get _ room _ name ( room ) for sessid, socket in self. socket. server. sockets. iteritems ( ) : # if not hasattr ( socket,'rooms') : # continue # if room _ name in so... | [
-0.936760425567627,
0.0767558142542839,
0.723213791847229,
0.6634031534194946,
0.02778276987373829,
0.15728329122066498,
-0.3890800476074219,
-0.35538849234580994,
0.26848024129867554,
0.5475952625274658,
-0.6346496939659119,
0.8660691380500793,
-0.03257981687784195,
1.0405447483062744,
... |
def get _ subject _ name ( chat _ id, index, stype ) : if stype = = " lectures " : subject _ data = lecture. query. filter ( lecture. chatid = = chat _ id ). all ( ) else : subject _ data = practical. query. filter ( practical. chatid = = chat _ id ). all ( ) index - = 1 # db tables are zero - index return subject _ da... | [
-0.4466024935245514,
0.45341548323631287,
0.6074257493019104,
-0.21135897934436798,
-1.0935755968093872,
0.20757131278514862,
-0.11731138825416565,
-1.6440448760986328,
-0.5074310898780823,
1.224058747291565,
0.3294602632522583,
0.6065751910209656,
0.2878322899341583,
0.006612805183976889,... |
def dosearch ( self, original _ query, response _ type ) : search _ status = false search _ results = " " self. _ geplaces. f _ callback = self. f _ callback self. _ coordinate. f _ callback = self. f _ callback self. _ geplaces. fly _ to _ first _ element = self. fly _ to _ first _ element self. _ geplaces. display _ ... | [
-0.8603537678718567,
0.03239079564809799,
0.6136348843574524,
-0.08745121955871582,
-0.10021089017391205,
0.46259379386901855,
0.16178373992443085,
-0.29934921860694885,
0.6079153418540955,
-0.3038930296897888,
0.6364559531211853,
-0.2336185723543167,
-0.22127790749073029,
1.08288776874542... |
def scatter _ plot _ with _ groups ( coordinates, labels, legend _ colors, legend _ descriptions, save _ plot = false, path = none ) : # set figure size. plt. rcparams ['font. serif'] ='times new roman'# set font family. plt. rcparams ['font. family'] ='serif'plt. rcparams ['figure. figsize'] = [ 9. 69, 6. 27 ] figure,... | [
0.4474997818470001,
0.8503643274307251,
0.7656716108322144,
-0.5986164212226868,
-0.1285688728094101,
0.7153913378715515,
0.3354140818119049,
-0.030454937368631363,
-0.9000235199928284,
0.26786211133003235,
0.8489333391189575,
0.6044273376464844,
0.20985904335975647,
-0.572125256061554,
... |
def publish _ on _ nervous _ system ( self, data ) : self. nervous _ system. publish ( channel = self. get _ publish _ channel ( ), message = data ) | [
-0.6955350637435913,
-0.41026997566223145,
0.32157543301582336,
-0.10569638013839722,
0.6679864525794983,
0.7262954115867615,
-1.1664584875106812,
-0.6933424472808838,
0.2147376984357834,
-0.7452449798583984,
-0.15606249868869781,
1.118125081062317,
-1.4116833209991455,
1.6925263404846191,... |
def bgm _ structural _ variant _ sample ( bgm _ project, institution, structural _ variant ) : item = { " project " : bgm _ project [ " @ id " ], " institution " : institution [ " @ id " ], " structural _ variant " : structural _ variant [ " @ id " ], " call _ info " : " some _ bgm _ sample ", " file " : " some _ bgm _... | [
0.44402486085891724,
-0.5577659606933594,
0.2267657220363617,
-0.1830109804868698,
-0.10065203905105591,
-0.31070974469184875,
-0.3762405216693878,
0.24884434044361115,
-0.5495705604553223,
0.9902781844139099,
-0.41880926489830017,
0.6385667324066162,
-1.0205851793289185,
-0.90580987930297... |
def _ publish _ state ( self, dt ) : # create internal state message msg = jointcontrollerstate ( ) msg. header. stamp = rospy. time. now ( ) msg. command = self. _ effort msg. set _ point = self. _ setpoint msg. process _ value = self. _ position msg. process _ value _ dot = self. _ velocity msg. error = self. _ pid. ... | [
-0.25585973262786865,
-0.32496577501296997,
0.5538391470909119,
-0.8100167512893677,
-0.02959490194916725,
-0.033982645720243454,
0.2529633641242981,
-0.6824472546577454,
-0.5438216924667358,
-0.40633317828178406,
0.37749260663986206,
-0.23462219536304474,
-0.05688164010643959,
0.730795502... |
def task ( x, y ) : return {'% s + % s'% ( x, y ) : longtask. add ( x, y ) } | [
0.3248203694820404,
0.3606042265892029,
0.6688337326049805,
-1.1037095785140991,
-1.0557384490966797,
-0.27642837166786194,
-1.4333075284957886,
-0.49825939536094666,
-0.4927356243133545,
0.7616391777992249,
-1.5329164266586304,
-0.5608519315719604,
1.4890482425689697,
-0.3393378257751465,... |
def test _ echo _ env _ variables ( self ) : now = datetime. utcnow ( ) now = now. replace ( tzinfo = timezone. utc ) dag = dag ( dag _ id ='bash _ op _ test ', default _ args = {'owner':'airflow ','retries': 100,'start _ date': default _ date }, schedule _ interval ='@ daily ', dagrun _ timeout = timedelta ( minutes =... | [
-0.3049793839454651,
0.34967949986457825,
0.7532780766487122,
0.480525404214859,
0.35024160146713257,
0.750417172908783,
-0.048472508788108826,
0.18938322365283966,
-0.8944674730300903,
-0.3170582354068756,
-0.09017864614725113,
0.5439813137054443,
0.7768341898918152,
0.4804958403110504,
... |
async def table _ event _ manager _ application _ exists ( self ) - > bool : mycursor, db = await the _ database ( ) await mycursor. execute ( " show table status like'eventmanagerapplication'" ) exists = await mycursor. fetchall ( ) await mycursor. close ( ) if len ( exists ) : return true else : return false | [
-0.44506072998046875,
-0.2892230153083801,
0.6511356830596924,
0.3317408561706543,
0.1848098486661911,
0.5498590469360352,
-0.7358919978141785,
0.4163166582584381,
-1.0026891231536865,
0.6422725915908813,
-0.3304426372051239,
-0.4516194760799408,
0.24243390560150146,
1.0477584600448608,
... |
def log _ message ( self, format, * args ) : self. globals. _ logger. debug ( format, * args ) | [
-0.7158928513526917,
0.09498430788516998,
0.5097070336341858,
-0.36029550433158875,
1.2780095338821411,
0.16827769577503204,
-0.8595924377441406,
-0.22777056694030762,
-0.9303364157676697,
-0.6750379800796509,
0.1661929488182068,
0.7367397546768188,
-0.44327783584594727,
1.878159761428833,... |
def contains _ peak ( species _ list ) : if any ( species. energy is none for species in species _ list ) : logger. warning ('cannot determine if path contains a peak, an e = none') return false for i, species in enumerate ( species _ list ) : # cannot be a peak on the end points if i = = 0 or i = = len ( species _ lis... | [
-0.042693909257650375,
-0.1753619760274887,
0.49648991227149963,
0.9531823992729187,
0.2551172375679016,
0.4268294870853424,
-0.5281851887702942,
0.8709374666213989,
-0.9371299743652344,
0.654853880405426,
-0.43965306878089905,
-0.35689058899879456,
-1.186409592628479,
0.7224047183990479,
... |
def findlines ( self ) : gray = self. _ converttogray ( ) canny = cv2. canny ( gray, self. line _ th _ l, self. line _ th _ h ) lines = cv2. houghlinesp ( canny, rho = self. rho, theta = self. theta, threshold = self. hough _ threshold, minlinelength = self. min _ line _ length, maxlinegap = self. max _ line _ gap ) if... | [
0.5043048858642578,
-0.8404539227485657,
0.5410184860229492,
0.9592200517654419,
0.7489491105079651,
-0.1314644068479538,
-1.0441265106201172,
-0.42198237776756287,
0.3774354159832001,
-0.25557035207748413,
0.13342584669589996,
-0.7664448618888855,
-0.19127219915390015,
0.4627390503883362,... |
def baseline _ rating ( data ) : # compute global mean using training data r _ mean = data. sum ( ) / data. getnnz ( ) return r _ mean | [
-0.21657033264636993,
0.8561689853668213,
0.4294184744358063,
0.11138799786567688,
0.6037129163742065,
0.7512649297714233,
0.2613007724285126,
0.5494665503501892,
-0.24629804491996765,
1.4973589181900024,
-0.24489182233810425,
0.7660401463508606,
-1.6797326803207397,
-0.37554487586021423,
... |
def get _ stgraphs ( jsonlist, seuil, ratio, only _ xy = false, test = false ) : nodes, edges, y = list ( ), list ( ), list ( ) path = " / home / nmiguens / json / wlasl / " for json in jsonlist : if test : node, adj = dict _ to _ stgraph ( json _ to _ dict ( path + json ), seuil, ratio, 1 ) mean, var = json _ to _ mv ... | [
-0.7333753705024719,
0.3091501295566559,
0.5724039673805237,
-0.5058647394180298,
-0.503357470035553,
-0.911777913570404,
-0.02086798846721649,
-0.048206087201833725,
0.2797097861766815,
1.6376928091049194,
-0.4145546555519104,
0.14065687358379364,
0.34771913290023804,
0.01953205280005932,... |
def test _ listdomain _ is _ in _ domain ( ) : dom _ params = namespace ( set _ domain _ list = true, domain _ list = [ 1. 0,'cat ', ( 5, 5 ) ] ) pts = ['cat ', ( 5. 0, 5. 0 ), 1,'1 ', ( 5, 6 ),'dog'] bool _ list = [ true, true, true, false, false, false ] listdom = listdomain ( params = dom _ params ) in _ dom _ list ... | [
-0.17500817775726318,
0.16053172945976257,
0.3079773187637329,
0.6868550181388855,
0.18490850925445557,
0.30838248133659363,
-0.5038592219352722,
0.20987947285175323,
0.3243224620819092,
-0.19501249492168427,
-1.3822845220565796,
1.3438547849655151,
-0.09197449684143066,
0.8673085570335388... |
async def test _ filter _ security _ warnings _ hotspots _ by _ status ( self ) : self. set _ source _ parameter ( " security _ types ", [ " security _ hotspot " ] ) self. set _ source _ parameter ( " hotspot _ statuses ", [ " to review ", " fixed " ] ) response = await self. collect ( get _ request _ json _ return _ v... | [
0.6957623958587646,
-0.022294677793979645,
0.2840306758880615,
0.8223303556442261,
0.5691561102867126,
1.2283662557601929,
-0.2987135946750641,
0.49542319774627686,
0.18344374001026154,
0.046500008553266525,
-0.6014665961265564,
-0.20841309428215027,
0.6209232807159424,
0.8489610552787781,... |
def get _ separador ( draw = false, ancho = 0, expand = false ) : from gi. repository import gtk separador = gtk. separatortoolitem ( ) separador. props. draw = draw separador. set _ size _ request ( ancho, - 1 ) separador. set _ expand ( expand ) return separador | [
0.2072899043560028,
0.8197029829025269,
0.50510174036026,
0.13959600031375885,
-1.4378681182861328,
0.2972399890422821,
-0.3310929238796234,
-0.22311265766620636,
-0.3057868182659149,
-0.7184634804725647,
-0.4633277654647827,
-0.8149284720420837,
-0.6973876953125,
-0.48811471462249756,
0... |
def newgeneration3 ( self ) : # print ( " printing child after iteration : { } ". format ( self. iteration ) ) for i in range ( 0, len ( self. population ) ) : " " " depending of your experiment you need to use the most suitable algorithms for : 1. select two candidates 2. apply crossover 3. apply mutation " " " ia, ib... | [
-0.1099093109369278,
-0.22977033257484436,
0.5307668447494507,
0.9841641783714294,
-0.37518933415412903,
1.288557529449463,
0.8422654271125793,
-0.021401068195700645,
0.08362676948308945,
0.7847039699554443,
-0.7898682951927185,
-0.16510221362113953,
-0.1908365935087204,
0.0979901850223541... |
def make _ relative _ href ( source _ href, start _ href, start _ is _ dir = false ) : parsed _ source = urlparse ( source _ href ) parsed _ start = urlparse ( start _ href ) if not ( parsed _ source. scheme = = parsed _ start. scheme and parsed _ source. netloc = = parsed _ start. netloc ) : return source _ href if st... | [
0.3663831353187561,
-0.09271311014890671,
0.5817967653274536,
0.053689878433942795,
-0.1261085569858551,
0.10220436751842499,
1.0710245370864868,
0.4061574339866638,
-0.13406777381896973,
0.06792224198579788,
0.6286568641662598,
0.28235697746276855,
-0.5159310698509216,
-0.4166261851787567... |
def _ translate _ _ interfaces _ interface _ statistics ( input _ yang _ obj, translated _ yang _ obj = none ) : if input _ yang _ obj. discontinuity _ time. _ changed ( ) : input _ yang _ obj. discontinuity _ time = input _ yang _ obj. discontinuity _ time if input _ yang _ obj. in _ octets. _ changed ( ) : input _ ya... | [
-0.5623009204864502,
-0.26618292927742004,
0.670616626739502,
-0.5191973447799683,
-0.5328306555747986,
0.32243531942367554,
1.5868871212005615,
-0.8365143537521362,
0.9836101531982422,
-0.30770576000213623,
-0.5701309442520142,
0.2784138321876526,
-0.013664579950273037,
0.4651119410991668... |
def _ _ init _ _ ( self, * args ) : _ topods. topods _ shape _ swiginit ( self, _ topods. new _ topods _ shape ( * args ) ) | [
-0.04089055582880974,
0.4106687307357788,
0.3960326313972473,
0.2482074648141861,
0.38339075446128845,
0.6535198092460632,
0.4908219873905182,
0.07976780086755753,
-0.11408358067274094,
-0.25438186526298523,
-0.5510070323944092,
-0.8337741494178772,
0.28795716166496277,
0.3557312786579132,... |
def _ variable ( name, shape, initializer ) : # getting rid of stddev for xavier # # testing this for faster convergence var = tf. get _ variable ( name, shape, initializer = initializer ) return var | [
0.7599340081214905,
-0.2864427864551544,
0.14750714600086212,
-0.8335546255111694,
-0.8526661396026611,
-0.8724718689918518,
-0.25133830308914185,
-0.2951489984989166,
-0.5672249794006348,
-0.3108817934989929,
-0.5297676920890808,
0.8433884382247925,
0.5043677687644958,
-1.084862232208252,... |
def bondglyphmethod ( bondglyph, bondglyphsource, * args, * * kwargs ) : pointid = bondglyph. getpointid ( ) vector = bondglyph. getpointdata ( ). getvectors ( ). gettuple3 ( pointid ) pos = bondglyph. getpoint ( ) bondglyphsource. setpoint1 ( pos ) bondglyphsource. setpoint2 ( pos [ 0 ] + vector [ 0 ], pos [ 1 ] + vec... | [
-0.4521755874156952,
0.1890883892774582,
0.45771828293800354,
-0.8264960646629333,
0.7060481309890747,
0.620624840259552,
0.3734004497528076,
0.18653345108032227,
-0.10168149322271347,
0.5130850672721863,
-0.8203165531158447,
1.3759145736694336,
-0.6387923359870911,
-1.0558134317398071,
... |
def moveto ( self, pos : tuple [ int, int ] ) - > none : self. square _ rect. center = pos if self. square _ rect. left < 0 : self. square _ rect. left = 0 elif self. square _ rect. right > self. rect. width : self. square _ rect. right = self. rect. right if self. square _ rect. top < 0 : self. square _ rect. top = 0 ... | [
-0.7810125350952148,
-0.7231709361076355,
0.6683345437049866,
-0.6353924870491028,
0.603545069694519,
-0.3636132776737213,
-0.27984490990638733,
-0.25116610527038574,
0.37403836846351624,
0.16277803480625153,
-1.100221872329712,
-0.07232622802257538,
0.5161768198013306,
-0.4214942753314972... |
def get _ data _ from _ csv ( self ) : res _ list = [ ] with open ( restaurentconstants. data _ with _ review,'r ', encoding ='ascii ', errors ='ignore') as csvfile : reader = csv. dictreader ( csvfile ) created _ at = arrow. utcnow ( ). datetime for row in reader : res _ list. append ( resdata ( url = row ['url'], nam... | [
-0.6338475346565247,
-0.5329626202583313,
0.383592814207077,
-0.22520314157009125,
0.10192982107400894,
0.6269749402999878,
-1.402018427848816,
0.5316374897956848,
0.011423671618103981,
0.17156878113746643,
-0.8216336965560913,
-0.27444982528686523,
-0.05919743701815605,
-0.660505950450897... |
async def dtc ( self, ctx ) - > none : response = get ( " http : / / danstonchat. com / random. html " ) soup = beautifulsoup ( response. content, " html. parser " ) quote = soup. find _ all ( " p ", class _ = " item - content " ) [ randint ( 1, 25 ) - 1 ] content = " " for elem in quote. a. contents : if elem. name = ... | [
-0.04957231506705284,
0.9926910996437073,
0.8172227740287781,
-0.77754145860672,
0.24969105422496796,
0.19432111084461212,
0.396414190530777,
-0.7615733742713928,
0.025942938402295113,
-0.5147930383682251,
-0.42476746439933777,
0.40944764018058777,
-0.13409750163555145,
0.4317386746406555,... |
def get _ examples ( n = none, coco = coco ) : data = [ ] images = coco. getimgids ( ) if n is not none : images = images [ : n ] images = coco. loadimgs ( images ) for img in images : img _ ann _ ids = coco. getannids ( imgids = img [ " id " ] ) img _ anns = coco. loadanns ( img _ ann _ ids ) captions = [ pad _ or _ t... | [
-0.7144270539283752,
0.4511314928531647,
0.48980262875556946,
-0.5493715405464172,
-0.3103140890598297,
-0.5227325558662415,
-0.32742518186569214,
0.16135528683662415,
0.1586264669895172,
0.6495322585105896,
-1.2482271194458008,
0.5221177935600281,
1.3106210231781006,
1.4585548639297485,
... |
def readlines ( ) - > list [ str ] : with open ( file _ dest ) as f : return f. readlines ( ) | [
0.3649599254131317,
-0.5943424105644226,
0.5258057117462158,
-0.20132921636104584,
0.373042494058609,
0.7509552836418152,
-2.138838052749634,
1.0918262004852295,
-0.44518163800239563,
0.26442795991897583,
0.6557395458221436,
-0.23037585616111755,
0.9138056635856628,
-0.31671595573425293,
... |
def set _ properties ( self, props _ dict, * * kwargs ) : self. _ check _ exists ( ) props _ string = " <? xml version ='1. 0'encoding ='utf - 8 '? > < layerapi > < layer " for key, value in list ( props _ dict. items ( ) ) : props _ string + = " % s = \ " % s \ " " % ( key, value ) props _ string + = " / > < / layerap... | [
-0.5571510791778564,
-0.928886890411377,
0.4269130229949951,
-0.5717549920082092,
0.36944523453712463,
0.9386933445930481,
-0.8472597002983093,
-0.447022020816803,
0.10394825041294098,
-0.0147135304287076,
-0.2689172029495239,
0.11069124191999435,
-0.8413106799125671,
0.699000358581543,
... |
def copy _ smoke _ test ( self ) : self. _ smoke ('copy') | [
-0.26875919103622437,
-0.20702937245368958,
0.3721054792404175,
1.295069694519043,
-0.18354859948158264,
0.28531405329704285,
0.7989078164100647,
0.3634029030799866,
0.9834791421890259,
0.5685281157493591,
-0.18741358816623688,
0.8805953860282898,
-0.076590895652771,
0.08753317594528198,
... |
def printmenu ( self ) : print ('\ ncontacts sample \ n'' 1 ) list all of your contacts. \ n'' 2 ) create a contact. \ n'' 3 ) query contacts on updated time. \ n'' 4 ) modify a contact. \ n'' 5 ) delete a contact. \ n'' 6 ) list all of your contact groups. \ n'' 7 ) query your groups on updated time. \ n'' 8 ) exit. \... | [
0.2516933083534241,
-0.8150694370269775,
0.6129545569419861,
0.48049426078796387,
0.1972396969795227,
-0.21657511591911316,
-0.17477068305015564,
-0.10157410055398941,
0.4904663860797882,
-0.4692908525466919,
0.15890488028526306,
0.5032521486282349,
-0.5427138805389404,
0.19922998547554016... |
def _ _ init _ _ ( self, host, port, username, password ) : self. _ reader = none self. _ writer = none self. _ host = host self. _ port = port or 23 self. _ username = username self. _ password = password self. _ prompt _ string = none self. _ connected = false self. _ io _ lock = asyncio. lock ( ) | [
-0.1939520388841629,
-0.203151136636734,
0.5643661022186279,
0.4564964473247528,
0.14321114122867584,
-0.34195664525032043,
0.34087106585502625,
0.5162225961685181,
-0.8797059655189514,
-0.33970797061920166,
-0.27363136410713196,
-0.23178774118423462,
-0.5707162618637085,
-0.81766718626022... |
def test _ school _ departments _ get _ post ( self ) : school = school _ sample ( ) data = {'school': school,'major':'marketing ','course':'bachelor of science in business'} url = school _ course _ url ( school. id ) res = self. client. get ( url ) res2 = self. client. post ( url, data ) object = models. courses. obje... | [
-0.6633249521255493,
-0.07857394963502884,
0.8075937628746033,
0.11932387948036194,
0.9136574268341064,
1.1090985536575317,
-0.5526905655860901,
-0.5351215600967407,
0.4202209413051605,
-0.9438817501068115,
-0.478969931602478,
0.5976753830909729,
-0.2159794420003891,
-0.244629368185997,
... |
def list ( self, context, object _ type = none, metadata _ only = false ) : if object _ type and object _ type not in self. _ secret _ type _ dict : msg = _ ( " invalid secret type : % s " ) % object _ type raise exception. keymanagererror ( reason = msg ) resp = self. _ do _ http _ request ( self. _ session. get, self... | [
-0.9817452430725098,
-0.5505495071411133,
0.654884934425354,
0.5579076409339905,
1.0271543264389038,
-0.08189572393894196,
-1.2538185119628906,
-0.19667497277259827,
0.4732215106487274,
0.7333442568778992,
-0.1408880054950714,
1.21277916431427,
-0.5091878175735474,
0.5860903859138489,
-1... |
def polyval ( alpha, beta, x ) : n = len ( alpha ) m = len ( x ) p = np. zeros ( ( m, n + 1 ) ) p [ :, 0 ] = 1 p [ :, 1 ] = ( x - alpha [ 0 ] ) * p [ :, 0 ] for k in xrange ( 1, n ) : p [ :, k + 1 ] = ( x - alpha [ k ] ) * p [ :, k ] - beta [ k ] * p [ :, k - 1 ] return p | [
0.4949098527431488,
-0.263857901096344,
0.7122777104377747,
-0.6482423543930054,
-0.6717761754989624,
0.44284355640411377,
-0.8163349628448486,
0.12343240529298782,
0.004693472292274237,
0.8450172543525696,
-0.44501882791519165,
0.17230819165706635,
-0.1589718759059906,
-0.2871089875698089... |
def savefile ( xfile, yfile, fnamestr ='testfile. txt') : if len ( xfile )! = len ( yfile ) : print " list names are not equal, cannot write file " ; return ; thefile = open ( fnamestr,'w') ; for i in range ( len ( xfile ) ) : thefile. write ( " % s \ t % d \ n " % ( xfile [ i ], yfile [ i ] ) ) ; thefile. close ( ) ; ... | [
-0.2838335931301117,
-0.762975811958313,
0.6256504654884338,
-0.04899759218096733,
0.4308874011039734,
0.919416069984436,
-0.13715897500514984,
0.22144019603729248,
-1.5897672176361084,
0.43290814757347107,
-1.177630066871643,
-0.8277631998062134,
-0.3416826128959656,
0.3784638047218323,
... |
def open _ and _ read _ file ( file _ path ) : file _ data = open ( file _ path ). read ( ) return file _ data | [
-0.19117429852485657,
-0.7748607397079468,
0.22640441358089447,
-0.6931287050247192,
-0.0514213964343071,
1.0506181716918945,
-0.22396838665008545,
0.9364392757415771,
-1.0352051258087158,
-0.4310229420661926,
0.6913164854049683,
-0.275804340839386,
0.48413053154945374,
-1.0128448009490967... |
def rad ( deg, min = 0, sec = 0 ) : return ( deg + min / 60. + sec / 3600. ) * ( pi / 180. ) | [
0.14942452311515808,
-0.1526041477918625,
0.44672247767448425,
-0.9776086211204529,
-0.4584355354309082,
0.42733022570610046,
-0.9168900847434998,
-1.0561901330947876,
-0.6315832138061523,
-0.590367317199707,
0.03258147090673447,
0.75314861536026,
-0.17333415150642395,
-0.12228992581367493... |
def _ get _ pathway _ components ( graph ) - > tuple [ dict [ str, dict [ str, dict [ str, str ] ] ], dict [ str, dict [ str, dict [ str, str ] ] ], dict [ str, dict [ str, dict [ str, str ] ] ], ] : return _ get _ nodes ( graph ), _ get _ complexes ( graph ), _ get _ interactions ( graph ) | [
-0.8460677266120911,
-0.6090341210365295,
0.4397651255130768,
-1.069870114326477,
0.1543310433626175,
-0.005887549836188555,
0.36979982256889343,
-0.19008494913578033,
-0.8479477167129517,
-0.3314480781555176,
0.061717692762613297,
-0.7538590431213379,
0.2723782956600189,
-0.49862271547317... |
def test _ lamp _ time ( self ) : if hardwarethread. _ hardwarethread _ _ singleton is not none : hardwarethread. _ drop ( ) # get current original value ( none ) and ensure getter returns the same original _ lamp _ time = \ hardwarethread. _ hardwarethread _ _ lamp _ time self. assertequal ( original _ lamp _ time, ha... | [
-0.38347363471984863,
0.2260182797908783,
0.5812384486198425,
-0.3694854974746704,
0.5971760153770447,
0.8017868995666504,
-0.1483485847711563,
-0.562335193157196,
0.023698456585407257,
-0.5901232361793518,
-0.4128541350364685,
-0.10338497161865234,
-0.4327496290206909,
1.0867750644683838,... |
async def decline _ invite ( self, ctx : ctx, game _ id : int ) : game = self. bot. client. get _ game ( game _ id ) ctx. session. decline _ inivitation ( game ) await ctx. send ('declined invitation.') | [
-0.027818741276860237,
0.07290828973054886,
0.6691761016845703,
0.3796434998512268,
0.8022816777229309,
0.5315436124801636,
-0.8443853855133057,
0.05715406686067581,
-0.23835544288158417,
0.6432824730873108,
-0.24063904583454132,
1.5785819292068481,
-1.2742011547088623,
0.1036735251545906,... |
async def reset _ table _ event _ manager _ application ( self, ctx ) - > none : if not await self. table _ event _ manager _ application _ exists ( ) : return await ctx. send ( " * * table ` eventmanagerapplication ` doesn't exist yet! * * " ) mycursor, db = await the _ database ( ) await mycursor. execute ( " delete ... | [
0.30658814311027527,
-0.09584891051054001,
0.46761566400527954,
0.8356501460075378,
0.5330080986022949,
0.2517630457878113,
0.42110294103622437,
-0.07648807764053345,
-0.739766538143158,
0.6462021470069885,
0.17528082430362701,
0.8690846562385559,
-0.23739537596702576,
0.40761134028434753,... |
def plot _ spectrum ( l, algo ='eig') : # algo is eig to be sure to get all eigenvalues. plt. figure ( figsize = ( 17, 5 ) ) for i, lap in enumerate ( l ) : lamb, u = fourier ( lap, algo ) step = 2 * * i x = range ( step / / 2, l [ 0 ]. shape [ 0 ], step ) lb ='l _ { } spectrum in [ { : 1. 2e }, { : 1. 2e } ] '. format... | [
0.3807904124259949,
0.3169283866882324,
0.648837685585022,
-0.593413770198822,
-0.4251898229122162,
0.019527621567249298,
-0.08518500626087189,
0.8857927918434143,
0.006043898873031139,
-0.3031403720378876,
-0.29397979378700256,
0.7730400562286377,
0.726865828037262,
1.6265482902526855,
... |
def deeplabv3 _ resnetd50b _ ade20k ( pretrained _ backbone = false, classes = 150, aux = true, * * kwargs ) : backbone = resnetd50b ( pretrained = pretrained _ backbone, ordinary _ init = false, bends = ( 3, ) ). features del backbone. final _ pool return get _ deeplabv3 ( backbone = backbone, classes = classes, aux =... | [
-1.2508318424224854,
1.059600830078125,
0.3608214855194092,
-0.3772539496421814,
-0.3821706771850586,
0.22327610850334167,
-0.05578817054629326,
0.7515609264373779,
0.6014004945755005,
0.30704885721206665,
-0.13328349590301514,
0.3597005307674408,
-0.5216148495674133,
0.08030147850513458,
... |
def test _ stat _ centos _ 7 _ 7 ( self ) : self. assertequal ( jc. parsers. stat. parse ( self. centos _ 7 _ 7 _ stat, quiet = true ), self. centos _ 7 _ 7 _ stat _ json ) | [
0.9681888818740845,
-0.680347204208374,
0.22064967453479767,
-0.5393357872962952,
-0.06827889382839203,
0.31004682183265686,
-0.8169459104537964,
-0.49695542454719543,
0.8615052103996277,
-0.3395596444606781,
-0.28646400570869446,
-0.47432419657707214,
0.4582015872001648,
0.079041704535484... |
def flops _ compute ( self, x ) : hook _ list = [ ] self. flops = [ ] for layer in self. model. modules ( ) : if isinstance ( layer, ( nn. conv2d, ) ) : hook _ list. append ( layer. register _ forward _ hook ( self. _ flops _ conv _ hook ) ) elif isinstance ( layer, ( nn. linear, ) ) : hook _ list. append ( layer. regi... | [
-1.1250691413879395,
0.2505916655063629,
0.643593966960907,
-0.06977894902229309,
0.21456538140773773,
0.23402145504951477,
0.8075377941131592,
-0.4009439945220947,
0.05080178380012512,
-0.10967401415109634,
0.2104637175798416,
-0.0031121287029236555,
0.42584431171417236,
0.845328629016876... |
def create _ model ( self ) : return none, none, none, none, none | [
-1.064587950706482,
-0.19555824995040894,
0.5284505486488342,
-0.054528962820768356,
2.205589532852173,
0.8591012358665466,
0.21544981002807617,
-0.32252979278564453,
-0.2667996287345886,
-0.09988563507795334,
-1.7433382272720337,
-1.124603271484375,
-0.3019263744354248,
-0.030732631683349... |
def get _ options _ dialog _ pixieapp ( self ) : return " pixiedust. display. chart. renderers. table. tableoptions. tableoptions " | [
0.7181665301322937,
0.08136249333620071,
0.2130609005689621,
0.19602076709270477,
0.39262935519218445,
1.073931097984314,
-0.22126439213752747,
-0.5849518775939941,
0.16565270721912384,
0.414772093296051,
0.31856003403663635,
-0.6828264594078064,
1.1796538829803467,
0.3621295392513275,
-... |
def add _ logical _ component _ to _ deviceset ( self, cpt, lib, deviceset ) : symbol _ names = set ( ) # set of names used for eaglexml symbols gate _ names = set ( ) # set of names used for eaglemxl gates for symindex, symbol in enumerate ( cpt. symbols ) : for bodyindex, body in enumerate ( symbol. bodies ) : index ... | [
-0.700287938117981,
-0.38571441173553467,
0.7010775804519653,
-1.8657968044281006,
-0.1902644783258438,
0.5283660888671875,
0.18489833176136017,
-0.5201976299285889,
0.2177317887544632,
-0.09903130680322647,
-0.09184183180332184,
0.18920153379440308,
0.03065156564116478,
0.4992633759975433... |
def add _ previous _ build _ information ( self, prev _ build _ dict ) : self. _ prev _ build _ dict = copy. deepcopy ( prev _ build _ dict ) | [
-0.7034814357757568,
0.008658229373395443,
0.5526201128959656,
-0.13736355304718018,
0.188073068857193,
1.1561681032180786,
0.9100651144981384,
0.10445978492498398,
0.1460600346326828,
-0.11090058088302612,
-0.4125422239303589,
0.48336249589920044,
-0.8225059509277344,
0.19805598258972168,... |
def build ( self ) : for i in list ( range ( 9 ) ) : self. sectors [ i ] = sector ( self. evmananger ) self. sectors [ 3 ]. neighbors [ direction _ up ] = self. sectors [ 0 ] self. sectors [ 4 ]. neighbors [ direction _ up ] = self. sectors [ 1 ] self. sectors [ 5 ]. neighbors [ direction _ up ] = self. sectors [ 2 ] s... | [
-0.10545241087675095,
-0.49068376421928406,
1.0669610500335693,
-0.9457083940505981,
0.7077598571777344,
0.19568179547786713,
0.6810346245765686,
-0.6734766364097595,
0.3999529778957367,
-0.07559178024530411,
-0.5000718832015991,
-0.9259909391403198,
-0.5060727596282959,
0.1111076548695564... |
def test _ cancel _ task _ fails ( c, users : list [ user ], flights : list [ flight ] ) : def callback ( request : httprettyrequest, uri, response _ headers ) : return [ 404, response _ headers, " " ] httpretty. register _ uri ( httpretty. post, f " http : / / container - nodeodm : 3000 / task / cancel ", body = callb... | [
0.20765899121761322,
0.8058193922042847,
0.6845201849937439,
0.1819642037153244,
0.3016299307346344,
1.0105679035186768,
0.012237749062478542,
-0.07257547229528427,
-0.7190226316452026,
0.12823568284511566,
-0.4466051161289215,
-0.43543723225593567,
0.0662420392036438,
0.30962133407592773,... |
def nearest ( dic, loc1 ) : node = none loc = none # loop over i in dic. keys ( ) for i in dic. keys ( ) : if loc = = none or great _ circle _ distance ( loc, loc1 ) > great _ circle _ distance ( i, loc1 ) : # update node and loc node = dic [ i ] loc = i return node | [
-0.13675537705421448,
-0.7296299934387207,
0.5872032046318054,
-1.0463811159133911,
-1.0701957941055298,
0.11305462568998337,
0.35456210374832153,
0.29177168011665344,
-0.6709799766540527,
0.7531710267066956,
0.25291675329208374,
0.4499281048774719,
-0.07770123332738876,
-0.647659718990325... |
def convex ( self, * args ) : return _ topods. topods _ tshape _ convex ( self, * args ) | [
0.28566738963127136,
0.05298580974340439,
0.45396384596824646,
0.21110586822032928,
-0.07852401584386826,
0.2553117573261261,
-0.009309777058660984,
-1.1016086339950562,
-0.6672006249427795,
0.38022974133491516,
-0.21305322647094727,
-0.06738249957561493,
0.1300102025270462,
-0.72149002552... |
def get _ all _ cameras ( path = false ) : cameras = hou. nodetype ( hou. nodetypecategories ( ) [ " object " ], " cam " ). instances ( ) cameras + = hou. nodetype ( hou. nodetypecategories ( ) [ " object " ], " stereocam " ). instances ( ) if path : return [ i. path ( ) for i in cameras ] return cameras | [
-0.26989755034446716,
0.7235099673271179,
0.4764539897441864,
1.8426494598388672,
0.6403366923332214,
0.24129405617713928,
-0.20507806539535522,
-0.3753039240837097,
1.54436194896698,
-0.03653787449002266,
-0.4043545722961426,
0.5955332517623901,
-0.5357346534729004,
0.9326838254928589,
... |
def compute _ intermediate _ medoids ( fm, labels, hydro _ names, kmax _ iter = 100, nsamples _ small = 40000, sampling _ size _ clara = 10000, niter _ clara = 5, use _ median = false ) : inter _ medoids _ dict = dict ( ) for ihydro, hydro _ name in enumerate ( hydro _ names ) : ind = np. where ( labels = = ihydro ) [ ... | [
-0.07123208045959473,
-0.01309721078723669,
0.8165421485900879,
-0.2258090376853943,
-0.7799146175384521,
-0.07642147690057755,
-0.1322619915008545,
0.5967499613761902,
-0.22108674049377441,
0.737005352973938,
0.16903401911258698,
0.48194998502731323,
-0.28096890449523926,
0.27937537431716... |
def prepare _ dataset ( size ) : print ( f " creating dataset of order { int ( np. log10 ( size ) ) } " ) # generate raw data data = { " year " : np. random. choice ( [ str ( x ) for x in range ( 2000, 2020 ) ], size ), " month " : np. random. choice ( [ str ( x ). zfill ( 2 ) for x in range ( 1, 12 ) ], size ), " day ... | [
-0.3422622084617615,
0.6126211881637573,
0.8677811026573181,
-1.0048673152923584,
-0.830967903137207,
-0.23325186967849731,
-0.5583881139755249,
-0.9054806232452393,
0.3158648908138275,
-0.0007528804708272219,
-0.18200775980949402,
0.14443328976631165,
0.3794424533843994,
0.056541044265031... |
def create ( user _ guid, user _ auth _ type, registration _ id, action ) : return _ utils. create ( registrationevent, user _ guid, user _ auth _ type, registration _ id, action, ) | [
0.3323695957660675,
0.6728600859642029,
0.20924855768680573,
1.1434354782104492,
0.25593456625938416,
-0.2189837545156479,
0.13268345594406128,
0.09263095259666443,
0.36187297105789185,
0.5654696822166443,
-0.6355765461921692,
0.9059346914291382,
0.47446903586387634,
-0.06673440337181091,
... |
def lookup _ table _ value ( lookup _ table, mapping ) - >'possiblevalueset': result = possiblevalueset ( ) result. _ type = registervaluetype. lookuptablevalue result. _ table = lookup _ table result. _ mapping = mapping return result | [
0.019732249900698662,
0.24062567949295044,
0.37844622135162354,
0.19974344968795776,
-0.9822847843170166,
-0.5639336109161377,
-0.5248813033103943,
0.4819950461387634,
-0.21016329526901245,
-0.5609234571456909,
0.6046003103256226,
0.5225996971130371,
0.028223104774951935,
-0.98004257678985... |
def mutual _ info ( self, dists ) : dist _ params, mi = dists ['concat'], none for param, reparam in zip ( dist _ params, self. reparameterizers ) : reparam _ obj = reparam [ - 1 ] if isinstance ( reparam, nn. sequential ) else reparam mi = reparam _ obj. mutual _ info ( param ) if mi is none else mi + reparam _ obj. m... | [
-0.4892924726009369,
-0.2138925939798355,
0.4779331386089325,
-0.16349326074123383,
-0.07192914187908173,
0.054170750081539154,
-0.19594401121139526,
-0.29732653498649597,
-0.48442718386650085,
0.2460542470216751,
0.22401636838912964,
-0.2439207136631012,
-0.05167478322982788,
0.8683540821... |
def test _ linear ( self ) : myfunc = simul. linear nvar = 3 vbounds = np. zeros ( ( nvar, 2 ) ) vbounds [ 0, 0 ] = - 3. 14 vbounds [ 0, 1 ] = 3. 14 vbounds [ 1, 0 ] = 0. vbounds [ 1, 1 ] = 5. vbounds [ 2, 0 ] = - 10. vbounds [ 2, 1 ] = 20. mypb = genop. genop ( ) mypb. verbose = false self. assertequal ( mypb. popsize... | [
0.4086739122867584,
0.5157638192176819,
0.6908249855041504,
-0.060679495334625244,
0.48955032229423523,
0.7893082499504089,
0.17062532901763916,
0.0023006503470242023,
0.2739253342151642,
-0.06483331322669983,
-1.36885666847229,
-0.4660360813140869,
-1.1366926431655884,
-0.2085929811000824... |
def to _ symm _ qsm ( self, x : jaxarray ) - > symmqsm : pinf = self. stationary _ covariance ( ) a = jax. vmap ( self. transition _ matrix ) ( jax. tree _ util. tree _ map ( lambda y : jnp. append ( y [ 0 ], y [ : - 1 ] ), x ), x ) h = jax. vmap ( self. observation _ model ) ( x ) q = h p = h @ pinf d = jnp. sum ( p *... | [
-0.2153569757938385,
-0.3820139169692993,
0.5327309966087341,
-0.26637372374534607,
-0.680151641368866,
-0.09669944643974304,
-0.24249832332134247,
-1.035804033279419,
1.199243426322937,
0.29980358481407166,
-0.5875023007392883,
0.2080116719007492,
0.46065226197242737,
-0.17394036054611206... |
def update ( self, k, a ) : k + = self. n - 1 self. dat [ k ] = a while k > 0 : k = ( k - 1 ) / / 2 # parent self. dat [ k ] = self. op ( self. dat [ k * 2 + 1 ], self. dat [ k * 2 + 2 ] ) | [
-0.48749423027038574,
0.1904485672712326,
0.4252086877822876,
-0.06045417860150337,
-1.229134440422058,
0.11442213505506516,
0.9343258738517761,
0.07687345147132874,
-0.023673279210925102,
0.5973368883132935,
-0.1744726002216339,
-0.008064307272434235,
0.1919112503528595,
-0.11327708512544... |
def convert ( stat ) : size = 1024 * 1024 * 1024 * 1024 * 1024 for mag in ['pib ','tib ','gib ','mib ','kib ','b'] : if stat > size : return " % 10. 2f % s " % ( float ( stat ) / size, mag ) size = size / 1024 return " % 10d " % stat | [
0.6401066184043884,
-0.5807888507843018,
0.5399682521820068,
-0.684495747089386,
-0.10193151235580444,
-0.7042309641838074,
0.0027531732339411974,
-0.55617755651474,
0.6386745572090149,
0.331036776304245,
0.21486972272396088,
-0.08947485685348511,
-0.05416572093963623,
0.7280964851379395,
... |
def remove _ volume _ from _ volumes _ table ( tenant _ uuid, datastore _ url, vol _ name ) : err _ msg, _ auth _ mgr = get _ auth _ mgr ( ) if err _ msg : return err _ msg logging. debug ( " remove volumes from volumes table ( % s % s % s ) ", tenant _ uuid, datastore _ url, vol _ name ) if _ auth _ mgr. allow _ all _... | [
0.17735019326210022,
-0.6901242733001709,
0.5725306272506714,
-0.1528869867324829,
-0.8080275058746338,
-0.8548791408538818,
-0.5241923928260803,
0.5738173127174377,
0.3295418322086334,
0.5400515794754028,
0.5840255618095398,
-0.5558614134788513,
-0.2373431921005249,
-0.750883162021637,
... |
def test _ dict ( self ) : self. assertin ('name ', self. state. _ _ dict _ _ ) | [
0.24888059496879578,
-0.0051397415809333324,
0.5391966700553894,
-0.7637754678726196,
-0.683936595916748,
0.6930216550827026,
0.3649612367153168,
0.11316399276256561,
0.5996443629264832,
-0.8607151508331299,
-0.30678582191467285,
-0.27865591645240784,
0.3054274320602417,
0.7741539478302002... |
def find _ min _ max _ cuboid _ vertex ( vertex, vertex _ opposite ) : vertex _ min = vertex _ max = none width = abs ( vertex _ opposite. x - vertex. x ) height = abs ( vertex _ opposite. y - vertex. y ) length = abs ( vertex _ opposite. z - vertex. z ) # find all vertex in the up face : up1 and up3 are already known ... | [
0.30386465787887573,
-0.1941494196653366,
1.4102046489715576,
0.5552446246147156,
-0.30352747440338135,
0.1550968587398529,
0.4326627254486084,
0.09547487646341324,
0.03572644293308258,
0.33273404836654663,
-0.6315956115722656,
0.055330730974674225,
-0.5834938287734985,
-0.7063186168670654... |
def wait _ until _ proxy _ is _ listening ( self ) : for i in range ( self. time _ to _ wait _ for _ proxy _ seconds ) : proxy _ is _ listening = self. is _ proxy _ listening ( ) if proxy _ is _ listening : return true time. sleep ( 1 ) return false | [
0.15470194816589355,
0.2608182430267334,
0.48733729124069214,
-0.620071291923523,
-0.11017082631587982,
0.1531008780002594,
-0.8977785110473633,
0.1506650149822235,
-0.7590001821517944,
-0.5764177441596985,
-0.2919754981994629,
-0.21524196863174438,
-0.7476611733436584,
-0.4901462197303772... |
def finished _ list ( request ) : if request. method = ='get': # get all requirements in finished and service status if request. user. has _ perm ('customer. customer _ view _ others') : requirements = requirement. objects. filter ( q ( status = " finished " ) | q ( status = " delivered " ) | q ( status = " delivered _... | [
-0.29504430294036865,
0.2137087732553482,
0.9097242951393127,
-0.07061077654361725,
-0.6061617732048035,
0.3032340109348297,
0.7875992059707642,
-0.08681812882423401,
-0.5518222451210022,
0.37912824749946594,
-0.024266419932246208,
-0.4434540271759033,
0.5351540446281433,
1.326420783996582... |
def find _ port ( master _ class _ name, masters, output, opts ) : try : master _ class = getattr ( master, master _ class _ name ) except attributeerror : raise valueerror ('master class % s does not exist'% master _ class _ name ) used _ ports = set ( ) for m in masters : for port in ('port ','slave _ port ','alt _ p... | [
0.14286406338214874,
-0.5699416399002075,
0.8043259382247925,
-0.4927009046077728,
0.34064948558807373,
-0.24715764820575714,
0.4406276345252991,
-0.030125692486763,
-1.214383840560913,
1.0662035942077637,
-0.6960205435752869,
0.19425660371780396,
0.15517529845237732,
0.9113836884498596,
... |
def jwt _ and _ secret _ to _ user ( token, secret ) : decoded = jwt. decode ( token, secret, algorithms = ['hs256'] ) ; user = { } user ['userid'] = decoded ['sub'] user ['name'] = decoded ['name'] user ['roles'] = decoded ['roles'] return user | [
0.20062822103500366,
-0.7247035503387451,
0.4022930860519409,
-1.1185829639434814,
-0.9141247272491455,
-0.6210228204727173,
-1.300243854522705,
-0.9006829261779785,
-0.6875218749046326,
0.3577837347984314,
-2.095719814300537,
0.5621399879455566,
0.760930061340332,
-0.48720061779022217,
... |
def make _ dom ( self, design ) : eagle = g. eagle ( ) eagle. drawing = g. drawing ( ) eagle. drawing. schematic = g. schematic ( ) eagle. drawing. schematic. libraries = g. libraries ( ) eagle. drawing. schematic. parts = g. parts ( ) eagle. drawing. schematic. sheets = g. sheets ( ) eagle. drawing. schematic. sheets.... | [
-0.015132679603993893,
0.6897321939468384,
0.5589861869812012,
-0.7743714451789856,
-0.8222681879997253,
0.825214684009552,
-0.6765164732933044,
0.06568589806556702,
0.7383004426956177,
-1.0678211450576782,
-0.1504141092300415,
-0.07542963325977325,
1.1685372591018677,
0.23314642906188965,... |
def load _ packages ( ) - > mapping [ str, str ] : return { _ norm ( record [ " name " ] ) : record [ " item " ] for record in query _ wikidata ( packages _ sparql ) } | [
-0.7587234973907471,
-0.13738761842250824,
0.2649535834789276,
-0.9053913950920105,
-0.9832903742790222,
-0.27052032947540283,
-1.0638387203216553,
0.37362754344940186,
0.24851515889167786,
0.26668351888656616,
-0.8037953972816467,
-0.6505028605461121,
0.3652331829071045,
-0.30583098530769... |
def encode ( self, uuid ) : pad _ length = self. encoded _ length ( len ( uuid. bytes ) ) return self. _ num _ to _ string ( uuid. int, pad _ to _ length = pad _ length ) | [
-0.6524768471717834,
0.011531032621860504,
0.21642836928367615,
-0.38590848445892334,
-0.96840500831604,
0.14108970761299133,
0.37444984912872314,
-0.3359159827232361,
0.9045665264129639,
-0.39061200618743896,
-0.6459518671035767,
0.30204474925994873,
-0.4268908202648163,
-0.70835721492767... |
def dns ( ) : local ( " dscacheutil - flushcache " ) | [
-0.2586468458175659,
1.5877865552902222,
-0.04172348976135254,
-0.013255387544631958,
0.12786129117012024,
-0.5602432489395142,
-0.050361525267362595,
0.28074267506599426,
1.0428625345230103,
0.047792308032512665,
-0.9920755624771118,
1.4098142385482788,
1.5649030208587646,
-0.120565041899... |
def measure _ qy ( self, channel ) : msg = self. device. send ( " measure - qy ", channel ) if msg. iserror ( ) : raise exception ( msg. geterror ( ) ) return { # todo : implement check for extreme / noisy measures that could possibly lead to crazy results in qy calculations " qy " : ( ( msg. getintparam ( 2 ) - msg. g... | [
-0.48956331610679626,
0.3065268099308014,
0.7869080901145935,
-0.9313122034072876,
-0.2099197953939438,
-0.9332131147384644,
-0.07096337527036667,
-1.4922378063201904,
-0.11847832798957825,
-0.40221667289733887,
-0.944688618183136,
-0.24615474045276642,
-0.9228214025497437,
1.4209848642349... |
def test _ wg _ save _ to _ file ( self ) : r1 = rectangle ( 1, 1, 1, 1, 1 ) r2 = rectangle ( 2, 2, 2, 2, 2 ) l = [ r1, r2 ] rectangle. save _ to _ file ( l ) with open ( " rectangle. json ", " r " ) as f : ls = [ r1. to _ dictionary ( ), r2. to _ dictionary ( ) ] self. assertequal ( json. dumps ( ls ), f. read ( ) ) | [
-1.3800183534622192,
-0.5475875735282898,
0.5333662033081055,
-0.7464868426322937,
0.5236594676971436,
0.045524708926677704,
0.4971003532409668,
-0.38917702436447144,
-0.6988030076026917,
0.6308579444885254,
-1.126701831817627,
-0.5488279461860657,
0.2262309193611145,
0.17808891832828522,
... |
def run _ subtest ( baseline _ summary _ name, tmp _ path, args, summaries = none, xfail = true, has _ result _ hashes = false, generating _ hashes = false, update _ baseline = update _ baseline, update _ summary = update _ summary ) : if update _ baseline and update _ summary : raise valueerror ( " cannot enable both ... | [
0.5355434417724609,
0.19717928767204285,
0.9705228805541992,
-0.19340354204177856,
0.2587953507900238,
0.953137993812561,
0.7834844589233398,
0.24286912381649017,
0.10643287003040314,
0.2071104198694229,
-0.5013948082923889,
-0.23314833641052246,
-0.439829558134079,
-0.4640985131263733,
... |
def grid _ graph ( * size ) : def neighbors ( v ) : neighborhood = [ ] for i in range ( len ( size ) ) : for dx in [ - 1, 1 ] : w = list ( v ) w [ i ] + = dx if 0 < = w [ i ] < size [ i ] : neighborhood. append ( tuple ( w ) ) return neighborhood return { v : neighbors ( v ) for v in product ( * map ( range, size ) ) } | [
-0.5504440069198608,
1.3061392307281494,
0.5815356969833374,
0.12177745252847672,
-1.0650748014450073,
-0.6204620599746704,
0.39430326223373413,
-0.6343381404876709,
0.07559951394796371,
0.44546839594841003,
-0.8969654440879822,
-0.5060311555862427,
-0.29220280051231384,
-0.668549597263336... |
def test _ prompt _ none _ parameter ( self ) : data = {'client _ id': self. client. client _ id,'response _ type': next ( self. client. response _ type _ values ( ) ),'redirect _ uri': self. client. default _ redirect _ uri,'scope':'openid email ','state': self. state,'prompt':'none'} response = self. _ auth _ request... | [
-0.9149695038795471,
-0.07255309820175171,
0.4804205000400543,
-0.14233170449733734,
0.8402345776557922,
0.3394504487514496,
-0.05893860384821892,
-0.5151230096817017,
0.4890049993991852,
-0.5101722478866577,
-0.13903404772281647,
0.8267336487770081,
-0.43780630826950073,
-0.33361411094665... |
def get _ hops ( a, k ) : hops = { 1 : a. tolil ( ), - 1 : a. tolil ( ) } hops [ 1 ]. setdiag ( 0 ) for h in range ( 2, k + 1 ) : # compute the next ring next _ hop = hops [ h - 1 ]. dot ( a ) next _ hop [ next _ hop > 0 ] = 1 # make sure that we exclude visited n / edges for prev _ h in range ( 1, h ) : next _ hop - =... | [
-0.7814017534255981,
0.6067228317260742,
0.7671233415603638,
0.3748583495616913,
-0.6580274701118469,
-0.30471935868263245,
1.3510698080062866,
0.24358180165290833,
0.255165696144104,
1.2015602588653564,
0.020793726667761803,
-0.7802547812461853,
0.4345226287841797,
0.014337320812046528,
... |
def post _ question ( ) : data = request. get _ json ( ) if not data : return jsonify ( { " message " : " data set cannot be empty " } ) if not all ( field in data for field in [ " title ", " content " ] ) : return jsonify ( { " status " : 400, \ " message " : " please fill in all the required input fields " } ), 400 p... | [
-0.6640496850013733,
-0.5587193369865417,
1.114711880683899,
0.768345296382904,
-0.5517537593841553,
0.5347751379013062,
-0.9496776461601257,
0.09880149364471436,
-0.68073570728302,
0.17684751749038696,
-0.12698830664157867,
-0.6605119705200195,
-1.2305303812026978,
-0.0073371222242712975,... |
def _ translate _ span ( self, span ) : | [
-0.5149906873703003,
0.4952026605606079,
0.03799407184123993,
-0.766901969909668,
-0.3431335389614105,
-0.15286409854888916,
-0.2714940905570984,
-0.2569628357887268,
1.3131474256515503,
-0.4246540069580078,
-0.6189781427383423,
-0.5385215282440186,
1.1296721696853638,
-0.44807299971580505... |
def name ( self ) - > pulumi. output [ str ] : warnings. warn ( " " " field'name'has been deprecated from provider version 1. 120. 0. new field'launch _ template _ name'instead. " " ", deprecationwarning ) pulumi. log. warn ( " " " name is deprecated : field'name'has been deprecated from provider version 1. 120. 0. new... | [
-0.3821667432785034,
-0.1722836196422577,
0.7612846493721008,
-0.13117574155330658,
-1.1337025165557861,
-0.3507362902164459,
-0.7296110987663269,
0.0655529722571373,
0.44402968883514404,
1.1785435676574707,
-0.9194141626358032,
-0.1391851305961609,
0.5487285256385803,
-0.4594215750694275,... |
def test _ get _ module _ non _ exosims _ notthere _ package ( self ) : module = " tests _ not _ there " modtype = " planetpopulation " with self. assertraises ( valueerror ) : m = get _ module ( module, modtype ) | [
-0.4623468816280365,
0.4161142408847809,
0.17985062301158905,
0.5588900446891785,
1.8567090034484863,
0.6010746955871582,
-0.4310725927352905,
-0.7727602124214172,
0.35979387164115906,
0.4213663637638092,
0.079889215528965,
0.8088247179985046,
-0.06356069445610046,
0.6460285782814026,
0.... |
def timer ( func ) : @ functools. wraps ( func ) def wrapper ( * args, * * kwargs ) : start = time. time ( ) result = func ( * args, * * kwargs ) duration = time. time ( ) - start print ( f'finished { func. _ _ name _ _! r } in { duration :. 4f } seconds') return result return wrapper | [
-0.40973255038261414,
-0.19800110161304474,
0.650311291217804,
-0.5524271726608276,
-0.28352975845336914,
-0.08273721486330032,
0.20193448662757874,
-0.477550745010376,
-0.3107399046421051,
0.5647749304771423,
-0.297346830368042,
0.7104064226150513,
0.45290452241897583,
0.6310072541236877,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.