text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def delete _ instance ( self, metadata : dict ) - > none : pass | [
-0.6825500130653381,
0.12973815202713013,
0.39984914660453796,
0.012098312377929688,
0.6031875610351562,
1.192842960357666,
0.09571848809719086,
1.169443964958191,
-0.6289793848991394,
0.6042390465736389,
0.046204134821891785,
1.0270521640777588,
-0.6612265110015869,
-0.2073410153388977,
... |
def get _ payments ( self, payment _ ids, height ) : cmd = { " method " : " get _ bulk _ payments ", " params " : { " payment _ ids " : payment _ ids, " min _ block _ height " : height } } r = utils. curl ( cmd ) if r and " payments " in r : payment _ list = r [ " payments " ] payments = [ ] # store payment objects her... | [
-0.15951891243457794,
-0.12375984340906143,
0.5525421500205994,
0.561687171459198,
0.6285638809204102,
-0.7999418377876282,
-1.022454857826233,
-1.1046439409255981,
-0.08024531602859497,
0.3649972975254059,
0.0509096160531044,
1.041754126548767,
-0.8826891779899597,
0.634247362613678,
-1... |
def _ _ setitem _ _ ( self, key, value ) : raise typeerror ( self. _ _ msg ) | [
-0.836252748966217,
0.25417986512184143,
0.43362921476364136,
-0.2677136957645416,
-0.1377551555633545,
0.1859307587146759,
-0.04302576556801796,
-0.5599927306175232,
-0.5132294297218323,
0.5618904232978821,
0.27405422925949097,
0.6160492300987244,
-0.5318803191184998,
0.504288375377655,
... |
def _ _ init _ _ ( self, items = [ ] ) : self. set = dict ( ( item. state, item ) for item in items ) self. heap = list ( items ) heapq. heapify ( self. heap ) | [
-0.29824790358543396,
-0.05745547264814377,
0.42360565066337585,
-0.19848528504371643,
0.012969579547643661,
-0.40419185161590576,
-1.1466447114944458,
0.10583900660276413,
0.2157539576292038,
-0.07210829854011536,
-1.2515767812728882,
-0.4660395085811615,
0.36776262521743774,
0.5447097420... |
def alllogbookentriesbyuser ( self, username ) : logbook _ select = " " " select * from logbook where user _ id ='% s'order by id ; " " " % ( username ) logbook _ query = logbook. raw ( logbook _ select ) all _ entries = list ( ) for log in logbook _ query : all _ entries. append ( log ) return all _ entries | [
-0.1453150361776352,
-0.7185226082801819,
0.28049296140670776,
1.3525536060333252,
-0.05705447867512703,
0.6759791970252991,
-0.6082872152328491,
0.20427799224853516,
-0.44421088695526123,
0.17726488411426544,
-0.3587482273578644,
0.7889032959938049,
-0.48045527935028076,
0.498045384883880... |
def cancelwait ( ) : return none | [
0.9389472603797913,
-1.4841828346252441,
0.28212770819664,
1.0174691677093506,
-1.1479226350784302,
1.0817288160324097,
0.4197104275226593,
0.8421998620033264,
-0.6207075119018555,
-0.3774087727069855,
-0.27073460817337036,
-0.5482442378997803,
-0.12613636255264282,
-0.5878463387489319,
... |
def tableau _ to _ strategy ( tableau, basic _ labels, strategy _ labels ) : # print ( " bl ", basic _ labels ) # print ( " sl ", strategy _ labels ) vertex = [ ] for column in strategy _ labels : if column in basic _ labels : for i, row in enumerate ( tableau [ :, column ] ) : if row! = 0 : vertex. append ( tableau [ ... | [
-0.32963529229164124,
-0.6199843287467957,
0.34267932176589966,
-0.04828640818595886,
0.4264923632144928,
0.09293137490749359,
-0.3189535140991211,
-0.4254686236381531,
0.10369238257408142,
1.18147611618042,
0.587751030921936,
0.23469309508800507,
0.3970783054828644,
-0.7383903861045837,
... |
def get _ active _ resources _ in _ grid ( grid ) : _ check _ grid ( grid ) active _ resources = set ( grid. plant. loc [ grid. plant [ " pmax " ] > 0 ]. type. unique ( ) ) return active _ resources | [
-0.02653275430202484,
-0.6823200583457947,
0.47717592120170593,
0.31754612922668457,
0.26618921756744385,
-0.3296245038509369,
0.31505724787712097,
-0.21274255216121674,
0.22855789959430695,
0.32559385895729065,
-0.3109266757965088,
-0.10930907726287842,
-0.3272799551486969,
-0.70387488603... |
def _ _ region _ x _ update _ ui ( self ) : if self. _ _ ui _ update : for output in self. selected _ outputs : output. ui. region _ x = self. _ _ render _ region _ x _ spin _ box. value ( ) | [
-0.4909202456474304,
-0.8229764699935913,
0.3447469174861908,
-0.43668332695961,
-0.5673413276672363,
-0.22304892539978027,
0.4369191527366638,
-0.4112147390842438,
0.28753435611724854,
-0.34598395228385925,
-0.40796297788619995,
0.24026349186897278,
-0.7050248384475708,
0.1594364792108535... |
def get _ git _ description ( ) : try : with open ( '. /. git / description ','r') as git _ desc : for line in git _ desc : if line. startswith ('unnamed repository ;') : return'your project description here'else : return git _ desc. read ( ) except filenotfounderror : return'your project description here ' | [
0.8848474621772766,
-0.04126434773206711,
0.47070562839508057,
-0.3009321093559265,
0.04112488403916359,
0.4031183123588562,
-0.7003533244132996,
0.3129851520061493,
-0.5658241510391235,
0.8069136142730713,
0.6936496496200562,
0.4857736825942993,
-0.26783135533332825,
0.5113086104393005,
... |
def modelfit ( alg, dtrain, predictors, x _ test, usetraincv = true, cv _ folds = 5, early _ stopping _ rounds = 50 ) : # time model training duration t = time. time ( ) # use cross validation if usetraincv : xgb _ param = alg. get _ xgb _ params ( ) xgtrain = xgb. dmatrix ( predictors, label = dtrain ) cvresult = xgb.... | [
0.8960822224617004,
1.0000237226486206,
0.5288358330726624,
0.5072756409645081,
0.2706037163734436,
0.25931259989738464,
0.4276835322380066,
0.14762090146541595,
-1.1675299406051636,
0.5360780358314514,
0.02142426185309887,
0.3112383186817169,
0.24377873539924622,
0.34658175706863403,
0.... |
def print _ images _ args ( * * images ) : for index, ( title, image ) in enumerate ( images. items ( ), start = 1 ) : print ( index, title ) plt. subplot ( 1, len ( images ), index ) plt. title ( images [ str ( title ) ] ) plt. imshow ( image, cmap ='gray') plt. show ( ) | [
-0.8747096061706543,
0.3168615698814392,
0.34826788306236267,
-0.7016404867172241,
0.2589026987552643,
0.5318002104759216,
0.05307226628065109,
0.20568230748176575,
-0.25154632329940796,
0.25084400177001953,
0.5669586062431335,
1.0704106092453003,
0.5160696506500244,
0.209929421544075,
0... |
def test _ user _ not _ found ( self ) : connection _ data = {'user _ id': str ( uuid. uuid4 ( ) ) } response = self. client. post ( self. url, connection _ data ) self. assertequal ( 400, response. status _ code ) | [
-0.32673507928848267,
0.10851578414440155,
0.3691747486591339,
0.7332617044448853,
1.0734100341796875,
1.4918861389160156,
-0.8469086289405823,
-0.36651551723480225,
-0.6338499784469604,
-0.7844341993331909,
-0.38626623153686523,
-0.062283892184495926,
-0.5836634635925293,
0.56827032566070... |
def get _ host _ name ( ) - > str : return socket. getfqdn ( ) | [
0.25253698229789734,
-0.1552520990371704,
0.4347265362739563,
0.2931285798549652,
-1.0968732833862305,
-0.3975319266319275,
-0.5032429695129395,
-0.21859042346477509,
-0.5261116027832031,
-0.20638710260391235,
0.4218917787075043,
0.6502853631973267,
-0.17031119763851166,
-0.717673599720001... |
def zero _ pad ( x, pad, axis ) : pad _ widths = [ ( 0, 0 ) ] * len ( x. shape ) pad _ widths [ axis ] = pad # padding on axis. return jnp. pad ( x, pad _ widths, mode ='constant ', constant _ values = x. dtype. type ( 0 ) ) | [
0.3661266267299652,
0.04780595377087593,
0.4392469525337219,
-0.04619189724326134,
-0.017553525045514107,
0.40861278772354126,
-0.34198489785194397,
0.029908429831266403,
0.3980354964733124,
0.020440606400370598,
-0.1972396820783615,
1.2059458494186401,
0.3888179361820221,
-0.1554360985755... |
def post _ failed _ message ( cluster _ name, reason ) : return f'token post { terminal. failed ( " failed " ) } on { cluster _ name } : \ n { terminal. reason ( reason ) } ' | [
0.8704087138175964,
-0.6756932735443115,
0.12179891765117645,
-0.5710561871528625,
-0.0704989954829216,
-0.1435265690088272,
-1.800736665725708,
-0.7842697501182556,
-0.7301619648933411,
-0.6428038477897644,
0.5087353587150574,
1.259057879447937,
-0.6154610514640808,
-0.42418214678764343,
... |
def name ( self ) : return self. _ event _ attributes [ " summary " ] | [
-0.2073153853416443,
-0.28847211599349976,
0.7053813934326172,
0.07953823357820511,
-0.750430166721344,
0.7122726440429688,
0.5061110258102417,
-0.3273721933364868,
0.37854665517807007,
1.0455291271209717,
-0.055986031889915466,
0.09819994866847992,
1.2576510906219482,
-0.45063385367393494... |
def testuniform ( self ) : for n in range ( 100, 500, 100 ) : print ( f " testing estimation of uniform distribution for a data size of { n }. " ) data = np. random. uniform ( low = 0, high = 1, size = ( n, ) ) for n _ blk in range ( 1, n / / 2 ) : # non blocking param = tools. analysis. analysisparam ( tools. analysis... | [
0.09375219792127609,
0.10591842234134674,
0.594741702079773,
0.11708623915910721,
0.426230788230896,
0.20869691669940948,
1.0226103067398071,
-0.1003209725022316,
-0.11013567447662354,
-0.3646918833255768,
-0.7385788559913635,
0.7754064202308655,
-0.4479401409626007,
0.8714597821235657,
... |
def bin _ thresh ( img : np. ndarray, thresh : int ) - > np. ndarray : res = img > = thresh return res | [
0.15146343410015106,
0.36160221695899963,
0.42297181487083435,
0.4163344204425812,
-0.19746960699558258,
0.3793385922908783,
-0.14332671463489532,
-1.063924789428711,
-0.060893941670656204,
0.18743188679218292,
-0.08337678015232086,
0.8866333961486816,
-0.03220386803150177,
-0.149507701396... |
def l ( x, tau, n ) : return 1 / tau * * n * np. exp ( - x / tau ) | [
0.9330313801765442,
-0.06633199006319046,
0.19189141690731049,
-0.5302579402923584,
-0.5424854159355164,
0.018736017867922783,
-1.6926193237304688,
-0.5168948769569397,
0.8466542959213257,
-0.09285461902618408,
0.17018373310565948,
-0.2505538761615753,
0.49487853050231934,
0.18335546553134... |
def fetch _ type ( self, object _ type : type [ pbxobjecttype ] ) - > dict [ str, pbxobjecttype ] : self. _ populate _ cache ( object _ type ) return cast ( dict [ str, pbxobjecttype ], self. _ cached _ items [ object _ type. _ _ name _ _ ] ) | [
-0.7690272331237793,
-0.3341957628726959,
0.5568884611129761,
-0.0657489225268364,
-0.10108237713575363,
0.127460777759552,
-0.825660228729248,
-1.5452604293823242,
0.8046436905860901,
1.0136319398880005,
-1.285334825515747,
0.03972124308347702,
-0.08372955024242401,
0.4286613464355469,
... |
def _ write _ error _ file ( self, error _ list, file, mode ='w') : with open ( file, mode ) as f : for i, models in enumerate ( error _ list ) : if len ( models ) > 0 : items = [ self. result. iloc [ i ]. start, self. result. iloc [ i ]. length,'; '. join ( [ str ( m ) for m in models ] ),'; '. join ( [ data. names _ ... | [
-1.3238624334335327,
-0.6386233568191528,
0.5280300974845886,
0.060124389827251434,
0.8550748229026794,
0.6932817697525024,
0.6595546007156372,
0.719404935836792,
-0.4806379973888397,
0.07095849514007568,
-0.8648162484169006,
-0.5009099841117859,
0.49514928460121155,
0.1736903339624405,
... |
def executable ( self ) : return self. _ executable | [
0.5534374117851257,
-1.2606761455535889,
0.3593444526195526,
0.6717550158500671,
0.22051723301410675,
0.9386606812477112,
1.002877116203308,
-0.1355467289686203,
0.49279651045799255,
-1.4012576341629028,
0.18836580216884613,
0.5264842510223389,
0.202193483710289,
-0.6005133390426636,
0.3... |
def _ unexport _ lun ( self, volume ) : v = self. vmem _ vip log. info ( _ ( " unexporting lun % s " ), volume ['name'] ) try : self. _ send _ cmd ( v. lun. unexport _ lun,'', self. container, volume ['name'],'all ','all ','auto') except exception : log. exception ( _ ( " lun unexport failed! " ) ) raise else : self. _... | [
0.4400869607925415,
-1.0950461626052856,
0.500510036945343,
0.017828699201345444,
-0.5483455061912537,
-0.6818037033081055,
-0.19536708295345306,
0.6852946877479553,
0.48667311668395996,
-0.19150425493717194,
-0.4729788899421692,
0.3545990288257599,
-0.545206606388092,
-0.8788005113601685,... |
def target _ image _ folder _ member ( self, target _ image _ folder _ member ) : self. _ target _ image _ folder _ member = target _ image _ folder _ member | [
-1.4715757369995117,
-0.9282194375991821,
-0.17654946446418762,
-0.21880044043064117,
-0.34035277366638184,
0.7205975651741028,
0.4288804531097412,
0.42652401328086853,
-0.9854966402053833,
-0.26201850175857544,
-0.1568845957517624,
0.06522177904844284,
0.6949364542961121,
0.02987510897219... |
def on _ bt _ del _ node _ clicked ( self ) : index = self. ui. cb _ nodes. currentindex ( ) label = self. ui. cb _ nodes. currenttext ( ) if index > - 1 and self. graph. has _ node ( label ) : self. graph. remove _ node ( label ) self. redraw ( ) self. ui. cb _ nodes. removeitem ( index ) self. ui. cb _ starting _ nod... | [
0.08375197649002075,
0.1887912005186081,
0.5520792007446289,
-0.4801928997039795,
0.23483555018901825,
0.18457917869091034,
0.24546192586421967,
0.3707306683063507,
0.30674102902412415,
0.46019965410232544,
0.2899627387523651,
0.3134155571460724,
-0.7273062467575073,
-0.49786898493766785,
... |
def test _ calculate _ mil _ hdbk _ 217f _ part _ count ( application _ id, environment _ active _ id ) : attributes ['hazard _ rate _ method _ id'] = 1 attributes ['application _ id'] = application _ id attributes ['environment _ active _ id'] = environment _ active _ id try : lambda _ b = part _ count _ lambda _ b [ ... | [
0.9106007814407349,
-0.051000844687223434,
0.707832396030426,
0.10360881686210632,
1.0819112062454224,
-0.004263352137058973,
-0.044233255088329315,
-0.2648305594921112,
-0.5636749267578125,
-0.09554649889469147,
0.03327950835227966,
-0.7353404760360718,
-0.24264466762542725,
0.35605859756... |
def main ( ) : arguments = docopt. docopt ( _ _ doc _ _, version ='kmeans 1. 0') checkpoint _ id = arguments ['< checkpoint _ id >'] checkpoint _ path = ckpt _ format. format ( id = checkpoint _ id or id _ ) data = load _ or _ generate _ dataset ( arguments ['< input _ path >'] ) data ['x'] = data ['x']. reshape ( ( - ... | [
0.5298298597335815,
0.2032141536474228,
0.6847693920135498,
1.385481357574463,
0.24297545850276947,
0.26823189854621887,
0.2625090181827545,
0.5647689700126648,
-0.051300883293151855,
0.3276815414428711,
0.006926830857992172,
0.4413343071937561,
-0.21736975014209747,
-0.4279367923736572,
... |
def filter _ getthreshold ( ) : andor _ solis. filter _ getthreshold. restype = ctypes. c _ uint threshold = ctypes. c _ uint ( ) result = andor _ solis. filter _ getthreshold ( ctypes. byref ( threshold ) ) check _ status ( result ) return float ( threshold. value ) | [
0.33985596895217896,
0.06821183860301971,
0.33659452199935913,
0.7428375482559204,
-0.5941564440727234,
-1.0799833536148071,
0.40274864435195923,
-0.656001627445221,
0.27169090509414673,
-0.3622061312198639,
-0.13186703622341156,
1.0651534795761108,
-0.6043718457221985,
-0.3051190078258514... |
def text ( self, text ) : self. _ text = text | [
-0.2797408401966095,
0.10857677459716797,
-0.02710670605301857,
-0.17364247143268585,
-0.4010537564754486,
0.4611365497112274,
-0.35111942887306213,
0.7699923515319824,
0.17420557141304016,
0.04827641323208809,
-1.2622448205947876,
-0.22147536277770996,
-0.5739439129829407,
-0.196221143007... |
def create ( asyncsocketspool, srvaddr, srvbacklog = 256, bufslots = none ) :... | [
-0.33493465185165405,
1.0035030841827393,
0.3272377848625183,
0.06324438750743866,
-0.5476473569869995,
-0.4845496118068695,
0.7782701253890991,
-1.184746265411377,
0.8399850726127625,
-0.10301689058542252,
-0.8198218941688538,
1.4950441122055054,
-0.09782697260379791,
0.2853262424468994,
... |
def _ _ init _ _ ( self, va _ type _ code = none, issue _ request _ count = none, ra _ id = none, va _ contract _ auth _ key = none, va _ holder _ name _ kana = none, va _ holder _ name _ pos = none ) : # noqa : e501 # noqa : e501 self. _ va _ type _ code = none self. _ issue _ request _ count = none self. _ ra _ id = ... | [
-0.09830030053853989,
-0.26612359285354614,
0.490410715341568,
-0.2540731728076935,
-0.3821462392807007,
-0.26389485597610474,
-0.20703676342964172,
0.4158022999763489,
1.1736010313034058,
-0.19343799352645874,
0.04992625117301941,
0.37436211109161377,
0.2592791020870209,
0.035591289401054... |
def test _ get _ snapshot _ dep ( self ) : pass | [
-0.7511577010154724,
0.5000993609428406,
0.454702764749527,
1.0252233743667603,
-0.49342256784439087,
0.16444770991802216,
1.1794828176498413,
0.32982489466667175,
0.6607540845870972,
-1.2425843477249146,
-1.1586039066314697,
-0.5676774382591248,
0.5009914040565491,
0.2954402565956116,
0... |
def _ init _ subpop ( self ) : self. de = { } for i, b in enumerate ( self. _ max _ pop _ size. keys ( ) ) : self. de [ b ] = asyncde ( * * self. de _ params, budget = b, pop _ size = self. _ max _ pop _ size [ b ] ) self. de [ b ]. population = self. de [ b ]. init _ population ( pop _ size = self. _ max _ pop _ size ... | [
-0.410000741481781,
0.6394699215888977,
0.7918987274169922,
0.6062373518943787,
-0.12034408748149872,
0.5399372577667236,
-0.07430864870548248,
0.4492737352848053,
-0.8747569918632507,
0.47287288308143616,
-0.9331223368644714,
-0.08863288909196854,
0.6628608107566833,
0.6018205881118774,
... |
def create _ results _ folder ( self ) : if not os. path. exists ( self. result _ folder ) : os. mkdir ( self. result _ folder ) | [
0.20900726318359375,
0.2912423312664032,
0.2194376289844513,
-0.16927866637706757,
0.8671697378158569,
0.5891504287719727,
0.9469677805900574,
-0.9614458084106445,
-0.8489802479743958,
-1.9126484394073486,
-0.09670018404722214,
-0.299701064825058,
-0.7306130528450012,
0.9799165725708008,
... |
def gethandle ( self ) : return _ topods. topods _ twire _ gethandle ( self ) | [
0.14684011042118073,
0.6031159162521362,
0.24412856996059418,
0.11416905373334885,
0.9978215098381042,
1.1334097385406494,
0.7413324117660522,
-0.8277788758277893,
-0.14260630309581757,
-0.9095878005027771,
0.17131003737449646,
-0.5395250916481018,
-1.7200140953063965,
0.649036705493927,
... |
def _ auth ( c, user : user ) : token = token. objects. get ( user = user ) c. credentials ( http _ authorization ='token'+ token. key ) | [
0.171068474650383,
-0.06599240005016327,
0.22001688182353973,
0.4538622498512268,
-0.14042013883590698,
0.09407803416252136,
-0.4989987015724182,
-0.16401435434818268,
-0.6881539225578308,
-0.4817090928554535,
-0.9874089956283569,
0.49638834595680237,
1.3004664182662964,
-0.581806659698486... |
def file _ directory ( instance, filename ) : return os. path. join ( " repository / " + str ( instance. theme ) + " / " + str ( instance. specification ) + " / " + str ( instance. identifier ), filename, ) | [
-0.42678070068359375,
-0.738679826259613,
0.38612663745880127,
-1.3892215490341187,
0.24747729301452637,
0.18232060968875885,
0.4657762944698334,
1.1378740072250366,
-0.7955669164657593,
-0.5134590864181519,
0.40137675404548645,
0.12834802269935608,
0.8316099047660828,
0.024477927014231682... |
def to _ dict ( self ) : base = dict ( ) for key, value in self. items ( ) : if isinstance ( value, type ( self ) ) : base [ key ] = value. to _ dict ( ) elif isinstance ( value, ( list, tuple ) ) : base [ key ] = type ( value ) ( item. to _ dict ( ) if isinstance ( item, type ( self ) ) else item for item in value ) e... | [
-0.8986501693725586,
-0.28924503922462463,
0.8230962157249451,
0.0033451495692133904,
-0.19996054470539093,
0.010880067013204098,
0.25185897946357727,
-0.3333543539047241,
-0.29850831627845764,
-0.0012886980548501015,
-0.4163196384906769,
-0.13047568500041962,
-0.524850606918335,
0.5312786... |
def indicator _ summary ( config ) : result = [ ] for d in config ['sources'] : tmp = pd. read _ csv ( os. path. join ( os. getcwd ( ), config ['paths'] ['output'], d ['name'],'data. csv') ) sr = ( tmp. groupby ('indicator code') ['year']. max ( ). reset _ index ( ). rename ( columns = {'year':'last updated'} ). to _ d... | [
-1.1377893686294556,
-0.18696610629558563,
0.4783385694026947,
-0.846606433391571,
-0.3004116714000702,
0.11563511192798615,
0.13993258774280548,
1.148893117904663,
0.30274760723114014,
1.192326545715332,
-0.1934424191713333,
-0.3500954508781433,
0.5473967790603638,
0.37693673372268677,
... |
def put _ age ( ) : do _ log ( " debug ", " calling put _ age endpoint " ) request _ counter. labels ('put ','/ age'). inc ( ) if not request. json : response. status = 400 msg = " this endpoint only accept json objects " do _ log ( " warn ", msg ) return msg if " name " not in request. json : response. status = 400 ms... | [
-1.6919037103652954,
0.20769786834716797,
1.1497528553009033,
-0.6598234176635742,
-0.3429071307182312,
0.03223138675093651,
-0.08199615031480789,
-0.3751415014266968,
-0.2442338615655899,
0.9483405947685242,
-0.443021297454834,
-0.4487457275390625,
-1.1227205991744995,
0.656740665435791,
... |
def check _ for _ filename ( filename ) : # create path for filename of a new file path = pathlib. path. cwd ( ) / filename # check whether filename already exists if path. exists ( ) : print ( " the filename " + filename + " is already in use. " ) else : print ( " there is no file named " + filename + ". " ) print ( )... | [
0.06567554175853729,
-0.736250102519989,
0.30118057131767273,
-0.16890743374824524,
0.8271094560623169,
-0.030587736517190933,
1.038421392440796,
0.3993310034275055,
-0.8637638688087463,
-0.1452818065881729,
0.7919203042984009,
0.666755735874176,
0.01942361332476139,
0.9439756274223328,
... |
def encrypt ( self, msg ) : basic. validate _ type ( msg, types. stringtype ) # make hmac mac = self. make _ hmac ( msg ) inbuf = cstringio. stringio ( mac + msg ) outbuf = cstringio. stringio ( ) outbuf. write ( self. encryptcipher. update ( inbuf. read ( ) ) ) outbuf. write ( self. encryptcipher. final ( ) ) # no ide... | [
0.14095677435398102,
0.6432451009750366,
0.1738281100988388,
0.11279185116291046,
-0.20500001311302185,
-0.18697847425937653,
0.43694940209388733,
-0.8210034370422363,
0.26009032130241394,
-0.21550902724266052,
-0.3064608871936798,
0.13561993837356567,
-1.4095525741577148,
0.08622942119836... |
def read ( self ) : return self. data | [
-0.5805023908615112,
-1.0559285879135132,
0.46355384588241577,
-0.7602149248123169,
-0.5085200071334839,
1.082029104232788,
-0.8129178881645203,
-0.8895198702812195,
-0.1554943323135376,
-1.9951879978179932,
0.37257108092308044,
0.9434177279472351,
-0.6642470359802246,
-1.3190327882766724,... |
def list _ contents ( self ) : return self. zip. namelist ( ) | [
-0.6391388177871704,
-1.5545790195465088,
0.43777015805244446,
-0.7739907503128052,
-0.5797609686851501,
-0.5368213653564453,
-1.3777003288269043,
-0.29114213585853577,
1.4899606704711914,
-0.06303098052740097,
-0.44918498396873474,
-0.4559716284275055,
0.5255080461502075,
0.73070842027664... |
def _ transact _ sell ( self, quantity, price, commission ) : self. avg _ sold = ( ( self. avg _ sold * self. sell _ quantity ) + ( quantity * price ) ) / ( self. sell _ quantity + quantity ) self. sell _ quantity + = quantity self. sell _ commission + = commission | [
0.002738252514973283,
-0.5752754807472229,
0.3201051652431488,
-1.1781458854675293,
0.7370428442955017,
-0.23748253285884857,
-0.43002086877822876,
0.14553900063037872,
0.24670708179473877,
1.0672012567520142,
0.20343530178070068,
0.3665141761302948,
0.2469053715467453,
-0.7522709369659424... |
def get _ all _ unique _ alleles _ in _ db ( self ) - > list [ str ] : allele _ pairs = list ( set ( [ alleles for alleles in self. _ database. allele ] ) ) alleles = [ ] for allele _ pair in allele _ pairs : alleles. extend ( allele _ pair. extend (';') ) return list ( set ( alleles ) ) | [
0.6299149394035339,
0.3303307592868805,
0.7216731309890747,
0.8021926283836365,
-0.25763261318206787,
0.7932782173156738,
-0.8464252352714539,
1.044893741607666,
0.9273771047592163,
0.5565782785415649,
0.08651412278413773,
0.2592150568962097,
-0.6685705780982971,
0.24066753685474396,
-0.... |
def model _ registered ( sender, * * kwargs ) : if sender is model : return for parent in sender. _ _ bases _ _ : model _ registered ( parent ) if sender not in perms _ dict : perms _ dict [ sender ] = cerberusmodelpermission ( cls = sender ) # build inherited objects here for parent in sender. _ _ bases _ _ : if paren... | [
-0.18044111132621765,
0.38967224955558777,
0.973160445690155,
0.48187029361724854,
-0.6182959675788879,
0.03886861726641655,
0.1393546611070633,
0.20824189484119415,
-0.5014727711677551,
0.5841579437255859,
-1.1294063329696655,
-0.03218607231974602,
0.9347019791603088,
0.9260453581809998,
... |
def validate _ profile ( main _ dir, name ) : if not name : return " the dataset name \ " % s \ " is not valid. dataset names may not be blank. " elif name. lstrip ( ). rstrip ( ) = = " " : return " the dataset name \ " % s \ " is not valid. dataset names may not be all spaces. " elif name. startswith ( ". " ) : return... | [
-0.11508768051862717,
-0.24836084246635437,
0.7590572834014893,
-0.5724864602088928,
-0.6174757480621338,
-0.17666366696357727,
0.14960597455501556,
-0.5555130839347839,
0.06346866488456726,
0.39325326681137085,
0.5233380794525146,
0.6642117500305176,
-0.5351773500442505,
0.185968980193138... |
def in _ set _ of _ values ( values : union [ list [ int ], set [ int ] ] ) - >'possiblevalueset': result = possiblevalueset ( ) result. _ type = registervaluetype. insetofvalues result. _ values = set ( values ) result. _ count = len ( values ) return result | [
-0.0455331914126873,
1.0274858474731445,
0.27643129229545593,
-0.21359388530254364,
0.026611754670739174,
-0.6064474582672119,
0.019686663523316383,
-0.2954048812389374,
0.1292007565498352,
-0.961230456829071,
0.09470850229263306,
0.0793110728263855,
-0.8172111511230469,
0.6072850227355957... |
def _ zero _ dimensional _ mvndiag ( dtype ) : dummy _ mvndiag = mvn _ diag. multivariatenormaldiag ( scale _ diag = tf. ones ( [ 0 ], dtype = dtype ) ) dummy _ mvndiag. covariance = lambda : dummy _ mvndiag. variance ( ) [..., tf. newaxis ] return dummy _ mvndiag | [
-0.6326385736465454,
0.17699353396892548,
0.5259016156196594,
-0.09226498007774353,
-0.39668500423431396,
0.0277657862752676,
-0.10891404747962952,
0.015743108466267586,
0.24253156781196594,
-0.2989484667778015,
-0.4717653691768646,
0.5971360802650452,
0.34912389516830444,
1.19646894931793... |
def total _ sold ( self ) : return self. avg _ sold * self. sell _ quantity | [
0.15602603554725647,
-0.6812817454338074,
0.4924697279930115,
-1.111008882522583,
0.3575482964515686,
0.18138639628887177,
0.5097214579582214,
-0.7117974162101746,
0.4492175281047821,
0.08248838037252426,
0.3042759895324707,
0.6392629742622375,
0.24482159316539764,
-0.7223920226097107,
-... |
def load ( self, filepath ) : self. embedding = keyedvectors. load ( filepath, mmap = " r " ) return self | [
0.2608276903629303,
-0.5073496699333191,
0.10436300933361053,
-0.12008816003799438,
-0.4009658694267273,
1.3782262802124023,
0.600243091583252,
0.4358609616756439,
0.2154984176158905,
-0.33975842595100403,
-0.5856903195381165,
-0.4454817473888397,
-0.32626813650131226,
-0.11105502396821976... |
def testgetvaluesforquerywithillegalquery ( self ) : self. store. commit ( ) with login ( u'username ', uuid4 ( ), self. transact ) as session : deferred = self. facade. getvaluesforquery ( session, u'has fluiddb / about ', [ u'username / bar'] ) yield self. assertfailure ( deferred, tbadrequest ) | [
0.25850555300712585,
0.822689950466156,
0.43954703211784363,
0.8168561458587646,
-0.02938826195895672,
0.9781116247177124,
-0.5613784193992615,
-0.9566472768783569,
-0.11129435151815414,
-0.9292574524879456,
0.9018932580947876,
-0.3631594777107239,
-0.18524734675884247,
1.0898661613464355,... |
def update _ amenity ( amenity _ id ) : obj = storage. get ( amenity, amenity _ id ) jsonrequest = request. get _ json ( ) if not jsonrequest : return jsonify ( {'error':'not a json'} ), 400 if obj : for key, value in jsonrequest. items ( ) : setattr ( obj, key, value ) storage. save ( ) return jsonify ( obj. to _ dict... | [
-1.8698031902313232,
-1.5248725414276123,
0.9173287749290466,
-0.18610182404518127,
-0.6866916418075562,
-0.3278268575668335,
-0.8104426264762878,
-0.5402617454528809,
0.6537120938301086,
0.9524540305137634,
-0.4572211503982544,
0.6894339323043823,
0.14774802327156067,
-0.08244005590677261... |
def get _ i ( self ) : if not self. is _ tors ( ) : raise typeerror ( " mode ", self. n, " is not torsional! " ) elif self. i : return self. i else : raise valueerror ( " moment of inertia undefined for mode ", self. n ) | [
-0.3607533574104309,
-0.17733809351921082,
0.48798060417175293,
0.4502990245819092,
0.5110687017440796,
0.6344079971313477,
0.7709782123565674,
-0.8969431519508362,
-0.6688982248306274,
-0.07103822380304337,
0.8448804020881653,
-0.4008671045303345,
-1.0052796602249146,
-0.19335530698299408... |
def insert ( self :'linked _ list ', test : callable [ [ any ], bool ], element : any ) - >'linked _ list': if self. head is none : return linked _ list ( plc _ node ( element, none ), 1 ) else : return linked _ list ( self. head. insert ( test, element ), self. size + 1 ) | [
0.2026478797197342,
1.1503262519836426,
0.2213398814201355,
0.14076301455497742,
0.18076972663402557,
-0.06259991973638535,
0.03911494091153145,
0.5492275953292847,
0.8286049365997314,
-0.46334218978881836,
-0.6876876950263977,
-0.12413442879915237,
-1.365182876586914,
0.32731807231903076,... |
def _ reconcile _ host ( context, host _ data, dom _ factory = dom. dom _ factory ( ), db _ session = none ) : if not db _ session : db _ session = session. get _ session ( ) # parse the inventory data into a dom object. use the no _ db dom factory # as we want to parse into non - db backed elements to start... non _ d... | [
0.0014841851079836488,
-0.6157729029655457,
0.7309063076972961,
0.5378100872039795,
0.851114809513092,
-0.4189656674861908,
0.06740070879459381,
1.0147006511688232,
0.28428906202316284,
0.4906270503997803,
0.10694018006324768,
-0.17113898694515228,
-0.11632993817329407,
0.10497076064348221... |
def docker _ wrapper ( module : str, load _ data : bool = true, use _ new _ client : bool = false, log _ traceback : bool = false ) - > none : wrapper = dockerwrapper ( ) wrapper. wrap _ algorithm ( module, load _ data, use _ new _ client, log _ traceback ) | [
-0.17560327053070068,
0.3527054190635681,
0.46821898221969604,
0.19655387103557587,
-0.657366931438446,
0.5292119979858398,
0.022260965779423714,
0.006293827202171087,
0.005766662769019604,
0.3897791802883148,
0.35339513421058655,
0.946455180644989,
1.0344473123550415,
0.864507794380188,
... |
def product _ is _ fresh ( product ) : current _ date = open ('current _ date. txt'). read ( ) return product ['expiration _ date'] > = current _ date | [
-0.16584645211696625,
-0.9203714728355408,
0.3851790726184845,
0.6371573805809021,
-0.494266539812088,
1.1373395919799805,
-0.7554087042808533,
-0.4884672164916992,
-0.45067718625068665,
0.961881697177887,
-0.49329081177711487,
0.34642699360847473,
0.8035363554954529,
0.11250483989715576,
... |
def mainloop ( self ) : while self. running : self. clock. tick ( 60 ) self. update ( ) event = self. current _ loop. increment ( ) if event is not none : self. loop _ switch ( event ) self. draw ( ) | [
-0.17477287352085114,
-0.6466695666313171,
0.5898704528808594,
-0.1074223592877388,
-0.45485371351242065,
0.9238613247871399,
0.1628032624721527,
-0.457168847322464,
0.6258538961410522,
-0.3568848669528961,
0.35430750250816345,
-0.07990851998329163,
-1.0742841958999634,
0.00988983921706676... |
def test _ delete _ trigger ( self ) : pass | [
0.3705172538757324,
0.6539379954338074,
0.18485282361507416,
0.8966652750968933,
0.5384299755096436,
-0.3708000183105469,
0.8032030463218689,
0.6236681342124939,
0.6162168383598328,
-1.5497106313705444,
-1.144457221031189,
0.1542554348707199,
-0.9814028143882751,
0.013262733817100525,
-0... |
def get _ users ( self ) : url = self. get _ url ( " users " ) return self. get _ resource ( url ) [ " users " ] | [
-1.123311996459961,
0.2375335991382599,
0.28553661704063416,
1.0078403949737549,
0.756574809551239,
-0.4443219304084778,
-1.0712268352508545,
0.18967927992343903,
0.5543085932731628,
-0.47039994597435,
-0.12461632490158081,
0.6749852895736694,
-0.8196873068809509,
-0.06808162480592728,
-... |
def test _ transaction _ claimable _ balance _ id _ result ( client, acc2 _ eth _ cb _ deposit _ transaction _ factory, ) : deposit = acc2 _ eth _ cb _ deposit _ transaction _ factory ( client _ address ) encoded _ jwt = sep10 ( client, client _ address, client _ seed ) # for testing, we make the key ` http _ authoriza... | [
1.209736704826355,
0.4543761610984802,
0.499532014131546,
0.21032878756523132,
0.42854219675064087,
0.260379821062088,
-0.6371766924858093,
-0.9299792051315308,
0.6217465400695801,
-0.7752529978752136,
-0.7258257269859314,
0.01620618626475334,
0.2713836133480072,
0.0991872176527977,
0.16... |
def triangle _ area ( ) : stacks = [ ] try : for _ in range ( 3 ) : stack = [ float ( x ) for x in input ('input 2 values separated by space and press < enter > :'). split ( ) ] stacks. append ( stack ) except valueerror : raise valueerror ('please, use integer or float values only!') if ( stacks [ 0 ] [ 0 ] = = stacks... | [
1.0698931217193604,
-0.15501998364925385,
1.2635524272918701,
0.7234007716178894,
0.0123649463057518,
0.27222925424575806,
1.1702401638031006,
-0.7516235709190369,
-0.13849572837352753,
0.5061319470405579,
0.13160568475723267,
-0.39728111028671265,
-0.48060980439186096,
-0.8155460357666016... |
def check _ user ( self, user ) : if not user. status = = user. status _ inactive : # an active user has registered this email raise registrationerror ( " user % s already registered " % user. email ) # else : email registered but user account has not been activated # get activation data and check if it is still valid ... | [
-0.15737105906009674,
0.4557439088821411,
0.6355507969856262,
1.0158250331878662,
-0.5395368933677673,
0.170048326253891,
0.8716921210289001,
0.18891654908657074,
-0.10306041687726974,
0.536943793296814,
-0.5941876769065857,
0.19676516950130463,
-0.11007649451494217,
-0.07531624287366867,
... |
def is _ goal ( state ) : # get the info of cars of the current state cars = state. board. cars # check if the goal car is at goal place : ( 2, 4 ) for car in cars : if car. is _ goal : if car. fix _ coord = = 2 and car. var _ coord = = 4 : return true else : return false | [
-0.9566100835800171,
-0.05870252102613449,
0.6238111257553101,
0.4218788146972656,
0.10826542228460312,
-0.4451095163822174,
-0.9886167645454407,
0.45558157563209534,
-0.9099522829055786,
0.27391791343688965,
-0.7488455772399902,
-0.45426589250564575,
-0.05337716266512871,
-0.0397646278142... |
def stop _ exists ( self, file _, code ) : exists = code in self. stops if not exists and code not in self. not _ exists : self. not _ exists. add ( code ) utils. logger. warning ( f " stop atco code { code! r } in file { file _! r } " f " does not exist. " ) return exists | [
-1.2518366575241089,
-0.41507792472839355,
0.5737451910972595,
-0.6696773767471313,
0.6092604994773865,
0.45743051171302795,
-0.7081920504570007,
0.030740749090909958,
-1.707198143005371,
0.8606364130973816,
0.11492946743965149,
-0.1758657991886139,
0.5408458709716797,
0.057464152574539185... |
def _ one _ hot ( self, label _ list ) : # creates an identity matrix and selects the rows according to the labels. a label is just # a particular row of the matrix return np. eye ( self. num _ classes ( ), dtype = np. float32 ) [ label _ list ] | [
-1.4082329273223877,
0.06538849323987961,
0.3292776346206665,
0.3996432423591614,
0.9314497113227844,
-0.002341714221984148,
-0.3737439811229706,
0.03568568080663681,
0.8960179090499878,
0.4963841438293457,
0.6129051446914673,
-0.1049732118844986,
-0.6729592084884644,
0.26953214406967163,
... |
def is _ outdated ( self, number, files ) : cur _ harvest = self. harvestpath +'/ nlab _'+ str ( number ) + '. harvest'if not os. path. isfile ( cur _ harvest ) : return true harvest _ time = os. path. getmtime ( cur _ harvest ) for file _ name in files : cur _ file = self. sourcepath + file _ name if os. path. isfile ... | [
-0.3788098096847534,
-0.25703099370002747,
0.922749936580658,
0.0017614912940189242,
-0.4986881911754608,
0.4752681255340576,
-0.037517249584198,
-0.20807434618473053,
-0.08392329514026642,
0.21090228855609894,
0.15824905037879944,
-0.6904189586639404,
-0.23418816924095154,
0.5490779876708... |
def test _ check _ config _ params _ missing _ bugfix _ keywords ( gitdelver _ config _ params _ fixture : callable [ [ none ], dict [ str, str ] ] ) : config _ params = gitdelver _ config _ params _ fixture. pop ( " bugfix _ keywords ", none ) with pytest. raises ( systemexit ) : gitdelver. _ check _ config _ params (... | [
0.6285275816917419,
0.12922635674476624,
0.24969033896923065,
0.29137715697288513,
0.0028084730729460716,
0.07887034118175507,
-0.4414941072463989,
0.31126928329467773,
-0.7382478713989258,
0.44273242354393005,
-1.1397873163223267,
0.02575984224677086,
-0.4503385126590729,
1.73542845249176... |
def softmaxloss ( x, y, w, reg = 1 ) : scores = x. dot ( w ) # 500x10 - scores for each image for each class scores - = np. max ( scores, axis = 1 ) [ :, np. newaxis ] # subtract max value for the scores for each image p = np. exp ( scores ) / np. sum ( np. exp ( scores ), axis = 1 ) [ :, np. newaxis ] correct _ class ... | [
-0.3996446430683136,
-0.3770853579044342,
0.657298743724823,
0.15510250627994537,
-1.1718765497207642,
-0.2602821886539459,
0.13478480279445648,
0.3160240650177002,
0.882820725440979,
0.7956728935241699,
0.366993248462677,
0.5245956182479858,
0.8739309310913086,
0.5552477836608887,
0.500... |
def classimagechange ( self, classnametext ) : if ( classnametext = = " barbarian " ) : # ~ / documents / py / graphics _ basics / character _ select / resources / self. smallimage = qimage ( " resources / barbarian. jpg " ) self. smallerimage = self. smallimage. scaled ( 50, 50 ) self. smallimagepixmap = qpixmap ( sel... | [
-1.0031455755233765,
-0.8331871032714844,
0.6741137504577637,
-1.2251826524734497,
-0.8817256093025208,
0.09245261549949646,
0.4423432946205139,
-0.18944470584392548,
0.8261356353759766,
0.5376153588294983,
-0.3748043477535248,
0.01872674934566021,
0.33547040820121765,
0.40740907192230225,... |
def create _ discriminator _ base _ conv _ layer _ block ( regularizer, params ) : with tf. variable _ scope ( name _ or _ scope = " discriminator ", reuse = tf. auto _ reuse ) : # get conv block layer properties. conv _ block = params [ " discriminator _ base _ conv _ blocks " ] [ 0 ] # create list of base conv layers... | [
-0.41833388805389404,
-0.8793459534645081,
0.9755745530128479,
0.551217257976532,
0.17455190420150757,
-0.17875881493091583,
-0.23734422028064728,
-0.16515354812145233,
-0.3188842236995697,
0.13121449947357178,
-0.8784613013267517,
0.3446189761161804,
-0.1396767944097519,
0.435448646545410... |
def solve _ distances ( instance, distances, max _ time ) : # instantiate the data problem. data = dataproblemdistances ( instance, distances ) # data = dataproblem ( instance, locations ) model _ parameters = pywrapcp. routingmodel. defaultmodelparameters ( ) # create routing model routing = pywrapcp. routingmodel ( d... | [
-0.35861238837242126,
0.11419720202684402,
0.904549777507782,
-0.7416213154792786,
0.7270503044128418,
-0.5177267789840698,
-0.3406796157360077,
0.3272205591201782,
-0.5461775660514832,
0.16868232190608978,
-0.275157630443573,
-0.32370904088020325,
0.0034616158809512854,
0.3648106157779693... |
def getddgiocperiod ( ) : andor _ solis. getddgiocperiod. restype = ctypes. c _ uint period = ctypes. c _ uint64 ( ) result = andor _ solis. getddgiocperiod ( ctypes. byref ( period ) ) check _ status ( result ) return int ( period. value ) | [
-1.0419316291809082,
1.425028920173645,
0.554228663444519,
0.16465911269187927,
-0.7085297107696533,
-0.3608255982398987,
0.8813409209251404,
-0.45383599400520325,
0.1247398778796196,
0.2476302534341812,
0.3857383728027344,
0.4742654860019684,
-0.7375044822692871,
-0.4689139425754547,
1.... |
def can _ attack ( self ) : if super ( ). can _ attack ( ) : return self. is _ moving ( ) return false | [
-0.6009554862976074,
0.5529195070266724,
0.6631898283958435,
1.8089929819107056,
-0.3985532224178314,
0.030813222751021385,
0.3195068836212158,
0.41648298501968384,
-0.5419541597366333,
0.2227325588464737,
0.38221970200538635,
0.15808559954166412,
-0.8167665600776672,
-0.2547297179698944,
... |
def _ _ set _ _ ( self, instance, amount ) - > none : if not isinstance ( amount, decimal ) : raise typeerror ( f " expected decimal type for tax related data, got { type ( amount ) }. " ) elif amount < 0 : raise valueerror ( f " tax related data cannot be less than 0, got { amount }. " ) else : self. _ instance _ data... | [
0.08834820240736008,
-0.15652677416801453,
0.5629909634590149,
-1.2314674854278564,
-0.23874790966510773,
0.3184530735015869,
-0.2468014806509018,
-0.38805511593818665,
-0.4105546474456787,
0.16098663210868835,
-0.2406911998987198,
0.6121472120285034,
0.4792885184288025,
0.2279407978057861... |
def clean _ dob _ relative _ to _ consent _ datetime ( self ) : dob = self. cleaned _ data. get ('dob') consent _ datetime = self. cleaned _ data. get ('consent _ datetime ', self. instance. consent _ datetime ) if not consent _ datetime : self. _ errors [ " consent _ datetime " ] = errorlist ( [ u " this field is requ... | [
-0.09585227817296982,
-0.16203968226909637,
1.057178020477295,
0.6904500722885132,
-0.5726898908615112,
1.2603497505187988,
0.37094464898109436,
-0.5895115733146667,
-0.5562590956687927,
1.3402897119522095,
0.253172904253006,
0.13106806576251984,
0.2820989787578583,
0.7935589551925659,
0... |
def fill _ summary _ vulns ( self, context ) : m _ all _ vulns = self. common _ get _ resources ( data _ type = data. type _ vulnerability ) m _ results = { } # total vulns m _ results ['total'] = 0 # count each type of vuln m _ counter = counter ( ) # init m _ counter ['critical'] = 0 m _ counter ['high'] = 0 m _ coun... | [
-0.6682355403900146,
-0.1882658451795578,
0.6023219227790833,
-1.2126466035842896,
0.2923223078250885,
0.4908280074596405,
0.25121456384658813,
-0.3349124491214752,
0.04792380332946777,
0.2831203043460846,
-0.4454541802406311,
0.16964641213417053,
0.10105057060718536,
0.5590105056762695,
... |
def _ get _ full _ path ( self, path _ part ) : return path. join ( self. _ current _ folder, path _ part ) | [
0.5841442942619324,
-1.352268099784851,
0.3848921060562134,
0.15901851654052734,
-0.5261086225509644,
0.4080069661140442,
0.1531248241662979,
-0.49933651089668274,
-0.7711503505706787,
-0.029847122728824615,
0.9717336893081665,
-0.5970500707626343,
-1.1862637996673584,
-0.48660045862197876... |
def setuptestdata ( cls ) : cls. client = apiclient ( ) cls. group _ admin = group. objects. create ( name = " admin " ) cls. group _ admin. permissions. add ( permission. objects. get ( name = " can add alumno " ) ) cls. group _ admin. permissions. add ( permission. objects. get ( name = " can change alumno " ) ) cls.... | [
-0.18057310581207275,
0.7336511015892029,
1.0102123022079468,
0.03423624485731125,
0.5144500136375427,
0.4906917214393616,
0.5637410283088684,
-0.20353387296199799,
-0.44608333706855774,
0.26568418741226196,
-0.3067268133163452,
0.2630227208137512,
0.30908554792404175,
-0.2461680769920349,... |
def write _ tour _ to _ img ( coords, tour, img _ file ) : padding = 20 coords = [ ( x + padding, y + padding ) for ( x, y ) in coords ] maxx, maxy = 0, 0 for x, y in coords : maxx, maxy = max ( x, maxx ), max ( y, maxy ) maxx + = padding maxy + = padding img = image. new ( " rgb ", ( int ( maxx ), int ( maxy ) ), colo... | [
-0.43857842683792114,
0.24028314650058746,
0.7739706039428711,
-0.9128270149230957,
-0.3378410339355469,
0.7043641805648804,
0.8406479954719543,
0.5639681220054626,
-0.005582802928984165,
0.477674663066864,
-0.4957676827907562,
-0.2599075436592102,
0.5658189058303833,
-0.544283390045166,
... |
def plot _ 2d _ features ( data ) : # create a trace trace = go. scatter ( x = data [ ['acousticness'] ]. t. squeeze ( ), y = data [ ['danceability'] ]. t. squeeze ( ), mode ='markers ', marker = dict ( size = 16, color = data [ ['energy'] ]. t. squeeze ( ), # set color equal to a variable colorscale ='rdbu ', showscal... | [
-0.1182301864027977,
0.6211893558502197,
0.6928553581237793,
-0.43792665004730225,
-0.4162704348564148,
0.1243697926402092,
0.2741679847240448,
-0.35944193601608276,
-0.4528045654296875,
-0.4258338212966919,
0.015611954964697361,
0.817950427532196,
0.1038520485162735,
-0.08872869610786438,... |
def load _ matrix ( matrix _ filename ) : with open ( matrix _ filename ) as matrix _ file : matrix = matrix _ file. read ( ) lines = matrix. strip ( ). split ('\ n') header = lines. pop ( 0 ) columns = header. split ( ) matrix = { } for row in lines : entries = row. split ( ) row _ name = entries. pop ( 0 ) matrix [ r... | [
0.09713084995746613,
-0.6369966268539429,
0.5358280539512634,
-0.779421329498291,
-1.2072644233703613,
-0.02811729535460472,
-0.0028554846066981554,
0.8105160593986511,
-0.4777354300022125,
-0.08625966310501099,
-0.1291167438030243,
-0.1893572360277176,
-0.11757225543260574,
-0.02417131885... |
def code _ block _ end _ test ( lines, index ) : return code _ end. match ( lines [ index ] ) | [
0.16637150943279266,
0.08077751845121384,
0.5367679595947266,
0.23851101100444794,
0.11873093247413635,
0.2608194053173065,
-0.27552932500839233,
0.0662786066532135,
-0.3607516586780548,
-0.31485259532928467,
-0.07276646047830582,
-0.17072376608848572,
-0.9367122054100037,
0.18240381777286... |
def _ _ init _ _ ( self, * args, * * kwargs ) : self. info = args comm = kwargs [ " comm " ] if " comm " in kwargs else none n = 0 r = [ ] for info in self. info : r. append ( [ n, n + info. n ] ) n + = info. n self. n = n self. r = np. asanyarray ( r ) # set up our communicator if necessary comm _ needed = any ( [ inf... | [
0.3767838180065155,
-0.23452869057655334,
0.6641786694526672,
0.14858785271644592,
0.590498149394989,
0.11278142035007477,
0.27458202838897705,
0.10673543810844421,
0.21526767313480377,
-0.4457157552242279,
-0.07071447372436523,
-0.16125546395778656,
-0.8733887672424316,
1.5367205142974854... |
def inviter _ id ( self ) : return self. _ inviter _ id | [
1.3221793174743652,
-0.863918662071228,
0.14252017438411713,
0.5884608030319214,
0.388199120759964,
1.0275202989578247,
0.22587749361991882,
1.5246140956878662,
0.13845111429691315,
0.3045575022697449,
-0.2619405686855316,
1.0712695121765137,
-1.2456517219543457,
0.23169511556625366,
1.0... |
def get _ db _ dumpfile _ path ( db _ name ) : directory = get _ database _ folder ('database') sql _ filename = db _ name + ". sql " path = os. path. join ( directory, sql _ filename ). replace ( " \ \ ", " / " ) return path | [
0.47864946722984314,
0.692610502243042,
0.48081332445144653,
-0.1439668834209442,
-0.0350368395447731,
1.0101854801177979,
0.7171807289123535,
0.1920432448387146,
-0.3154156506061554,
0.2968941330909729,
0.34606897830963135,
-0.5896120071411133,
-0.661941409111023,
0.610069751739502,
0.0... |
def test _ tag _ count ( self ) : tag = create _ tag ( name ='dogs') create _ post _ tag ( tag = tag ) self. assertequal ( tag. post _ count ( ), 1 ) | [
0.2894531786441803,
0.43714430928230286,
0.045537903904914856,
0.5281733870506287,
1.2558071613311768,
0.3870854377746582,
-0.3448143005371094,
0.2136460691690445,
-1.3173691034317017,
-1.0045363903045654,
-1.3249229192733765,
-0.5497322082519531,
0.041312914341688156,
1.0663061141967773,
... |
def predict ( model, sentence, print _ info = true ) : y _ pred = model. predict ( [ sentence ] ) # todo # convert predicted class to label ( 0 - > cs, 2 - > en ) use label2lang dictionary from config. py # # # start code here # # # ( ≈ 1 line of code ) label = label2lang [ y _ pred [ 0 ] ] # # # end code here # # # if... | [
-0.04706745594739914,
-1.072616696357727,
0.45256590843200684,
0.2761875092983246,
-1.0748369693756104,
0.5723980665206909,
-0.4146604835987091,
-0.26693299412727356,
-0.5806427597999573,
0.3339575529098511,
-0.07370802760124207,
-0.2340952754020691,
0.28538966178894043,
0.3905574679374695... |
def is _ parameter _ variable ( self ) - > bool : return self in self. _ function. parameter _ vars | [
-0.5555667877197266,
-0.33123764395713806,
0.3121172785758972,
0.5007436275482178,
0.021985603496432304,
0.00700589781627059,
-0.3813120722770691,
-0.20458348095417023,
0.07119563221931458,
-0.09651836007833481,
0.0492946095764637,
1.879705548286438,
-0.5228244662284851,
0.0124773150309920... |
def _ _ len _ _ ( self ) : return len ( self. heap ) | [
0.382664293050766,
-0.7618731260299683,
0.39163345098495483,
-1.2265934944152832,
0.3226074278354645,
0.623883068561554,
-0.4277988374233246,
0.6009756326675415,
0.9847825169563293,
-0.700605034828186,
-1.1027193069458008,
-0.07874499261379242,
0.46549126505851746,
-0.2660905718803406,
0... |
def missing _ data ( ) : # dataframe by numpy array dates = pd. date _ range ( " 20170518 ", periods = 6 ) df = pd. dataframe ( np. random. randn ( 6, 4 ), index = dates, columns = list ( " abcd " ) ) # reindexing allows you to change / add / delete the index on a specified axis. df1 = df. reindex ( index = dates [ 1 :... | [
0.1516537219285965,
0.03278021141886711,
0.7147092223167419,
0.3853718042373657,
0.29718661308288574,
0.4415540099143982,
0.8938493728637695,
-0.20365369319915771,
0.5212756991386414,
-0.26531726121902466,
-0.346558541059494,
0.6567419171333313,
0.6448537707328796,
-0.00570297846570611,
... |
def prepare _ meal ( self, internal _ order, curr _ time ) : internal _ order. set _ cooked _ time ( curr _ time ) print ( " [ + ] { kitchen _ name } just prepared order { order _ id } at time { cooked _ time }. ". format ( kitchen _ name = self. kitchen _ name, order _ id = internal _ order. get _ order _ id ( ), cook... | [
-0.6167763471603394,
-0.9009829759597778,
0.5871483683586121,
-0.21891310811042786,
-0.5158027410507202,
-0.6550213694572449,
-1.1355540752410889,
0.059858594089746475,
-0.1614755243062973,
0.5206195712089539,
-0.03539900481700897,
1.0732060670852661,
0.11441222578287125,
1.500503778457641... |
def split _ dataset ( x, y, kfold, smote, * * kwargs ) : set _ x _ train = [ ] set _ x _ test = [ ] set _ y _ train = [ ] set _ y _ test = [ ] if kfold : kf = kfold ( n _ splits = 10, shuffle = true ) for train _ index, test _ index in kf. split ( x ) : x _ train, x _ test, y _ train, y _ test = x [ train _ index ], x ... | [
-0.2762087881565094,
0.7536343932151794,
0.6938738226890564,
-0.23374967277050018,
-0.027756962925195694,
-0.18410779535770416,
-0.41520899534225464,
0.3598809242248535,
0.5000531673431396,
0.3703250288963318,
-0.5047821402549744,
0.4938788115978241,
-0.36837127804756165,
-0.59801763296127... |
def init _ weights _ and _ state ( self, input _ signature ) : d _ model = input _ signature. shape [ - 1 ] shape _ m1 = ( d _ model, self. _ n _ experts ) shape _ w1 = ( d _ model, self. _ d _ ff ) shape _ w2 = ( self. _ d _ ff, d _ model ) shape _ b2 = ( d _ model, ) rng _ m1, rng _ w1, rng _ w2, rng _ b2 = fastmath.... | [
-0.5283520817756653,
0.2161472588777542,
0.4866669476032257,
0.05403774604201317,
0.07268570363521576,
-0.33719921112060547,
0.4818437099456787,
0.5904056429862976,
-0.2055720090866089,
-0.09646954387426376,
-1.1056828498840332,
-0.40594178438186646,
0.7944210171699524,
1.1805024147033691,... |
def _ run _ workdir ( self, workdir, cache ) : if " args " in cache : t _ workdir = self. template. from _ string ( workdir ) workdir = t _ workdir. render ( * * cache [ " args " ] ) try : os. makedirs ( workdir, exist _ ok = true ) except ( fileexistserror, permissionerror ) as e : return str ( e ), false else : retur... | [
-1.6605000495910645,
0.6747340559959412,
0.6059553027153015,
-0.5765931010246277,
-0.5660768151283264,
0.34034696221351624,
0.6466842293739319,
-0.050854429602622986,
0.08276328444480896,
0.3464198112487793,
0.09325231611728668,
-0.7002602815628052,
-0.5822953581809998,
0.18873398005962372... |
def itkimageserieswriteriuc3iuc2 _ cast ( * args ) : return _ itkimageserieswriterpython. itkimageserieswriteriuc3iuc2 _ cast ( * args ) | [
-0.11695994436740875,
0.2842901647090912,
0.15036126971244812,
-0.7562987804412842,
0.4221116602420807,
0.3983794152736664,
-0.09934232383966446,
0.4679209291934967,
-0.09287726879119873,
0.4731905460357666,
0.41333481669425964,
0.2943275570869446,
0.45098090171813965,
-0.8292953372001648,... |
def get _ repository _ version ( pear _ output ) : lines = pear _ output. split ('\ n') for line in lines : if'latest'in line : return line. rsplit ( none, 1 ) [ - 1 ]. strip ( ) return none | [
0.4413617253303528,
-0.4621909558773041,
0.4962713420391083,
-0.24242226779460907,
-0.06886745244264603,
-0.09482602775096893,
0.016228314489126205,
-0.013528156094253063,
-0.7072798609733582,
-0.3805183470249176,
0.3483845293521881,
-0.37802228331565857,
-0.8283833265304565,
-0.5115298628... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.