text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def self _ check ( self ) : if self. k is not none and self. m is not none : g = self. pub. group. generator ( ) assert self. a = = self. k * g assert self. b = = self. k * self. pub + self. m * g | [
-0.021121833473443985,
-0.0029951855540275574,
0.17341002821922302,
0.13213016092777252,
-0.1723698079586029,
0.1401320844888687,
0.8437618017196655,
-0.1395615041255951,
-0.5480427742004395,
-0.7872331142425537,
0.6650285720825195,
-0.08570490777492523,
-1.2493418455123901,
0.634865880012... |
def _ _ repr _ _ ( self ) : info = " " " the samplednn class provides examples for you to build your own class. " " " | [
0.39049896597862244,
-0.8909235000610352,
0.42853057384490967,
-0.3718799352645874,
-0.48441892862319946,
0.29185381531715393,
0.04999672248959541,
0.28724542260169983,
0.6312589049339294,
-0.4076434075832367,
-0.7690075039863586,
0.8330218195915222,
1.1503255367279053,
-0.1333480775356292... |
def transform ( self, raw _ documents ) : # print ('len ( raw _ documents ) = { } '. format ( len ( raw _ documents ) ) ) # print ('raw _ documents = { } '. format ( raw _ documents ) ) # for index, value in enumerate ( raw _ documents ) : # print ( index, value ) for tokens in self. _ tokenizer ( raw _ documents ) : w... | [
-0.324337363243103,
0.11290258914232254,
0.5516871809959412,
-0.7856970429420471,
-0.02714800462126732,
-0.48467621207237244,
-0.22147633135318756,
-0.13683435320854187,
-0.08153153210878372,
0.7620386481285095,
-0.6931414008140564,
0.2771182060241699,
-0.402476042509079,
0.556400299072265... |
def overwriting ( func ) : def wrapper ( self, fname, * args, * * kwargs ) : " " " check if fname exists. if it does, add number to fname. " " " i = 0 path _ exists = true while path _ exists : path _ exists = os. path. isfile ( fname ) if path _ exists : pieces = fname. split ( ". " ) path = " ". join ( pieces [ 0 : -... | [
-1.1147067546844482,
-0.272777795791626,
0.976312518119812,
-0.20596861839294434,
-0.33264681696891785,
-0.4906666874885559,
1.0673433542251587,
0.4035276770591736,
-0.10661351680755615,
0.5956254601478577,
0.45559874176979065,
-0.3220784366130829,
0.6208288073539734,
-0.481137752532959,
... |
def login ( self, userd ) : user = usermodel. query. filter _ by ( email = userd ['email'] ). first ( ) if not user : user = usermodel. add ( name = userd ['name'], email = userd ['email'], picture = userd ['picture'] ) return login _ user ( user ) | [
-0.5017878413200378,
0.6655753254890442,
0.5362902283668518,
0.07871544361114502,
-0.5900471806526184,
0.5962837338447571,
-0.3653022050857544,
-0.3828091621398926,
0.7312147617340088,
-0.22547411918640137,
-0.6562893986701965,
-0.47845369577407837,
0.27354592084884644,
-0.1266359686851501... |
def getsource ( object, alias ='', lstrip = false, enclosing = false, \ force = false, builtin = false ) : # hascode denotes a callable hascode = _ hascode ( object ) # is a class instance type ( and not in builtins ) instance = _ isinstance ( object ) # get source lines ; if fail, try to'force'an import try : # fails ... | [
-0.3267756402492523,
-0.1555417776107788,
0.768001914024353,
-0.3611578047275543,
-0.4449506103992462,
-0.4117286503314972,
0.5061997175216675,
-0.06266766786575317,
0.673393726348877,
0.7363348007202148,
-0.5845074653625488,
0.5774015784263611,
0.540060818195343,
0.21759110689163208,
0.... |
def _ closuredsource ( func, alias ='' ) : # fixme : this entire function is a messy messy hack # - pollutes global namespace # - fails if name of freevars are reused # - can unnecessarily duplicate function code from dill. detect import freevars free _ vars = freevars ( func ) func _ vars = { } # split into'funcs'and'... | [
-0.2830345034599304,
0.3284807801246643,
0.6485280394554138,
-1.0691224336624146,
-0.7292913794517517,
-0.5917220711708069,
0.256458580493927,
0.06342858076095581,
0.5714829564094543,
0.000542468624189496,
-0.015239933505654335,
0.7841656804084778,
0.7173722982406616,
0.5168561339378357,
... |
def encrypted _ data ( self, encrypted _ data ) : if encrypted _ data is none : raise valueerror ( " invalid value for ` encrypted _ data `, must not be ` none ` " ) # noqa : e501 self. _ encrypted _ data = encrypted _ data | [
0.18365421891212463,
0.18494975566864014,
-0.4929468631744385,
0.2601424753665924,
0.6522102355957031,
0.6286534667015076,
0.1949227750301361,
0.6235960721969604,
-0.24899113178253174,
-0.0941881611943245,
-0.6965106129646301,
0.34231746196746826,
-0.4511731266975403,
0.16335034370422363,
... |
def _ make _ layer ( self, block, planes, num _ blocks, stride ) : strides = [ stride ] + [ 1 ] * ( num _ blocks - 1 ) layers = [ ] for stride in strides : layers. append ( block ( self. in _ planes, planes, stride ) ) self. in _ planes = planes * block. expansion return nn. sequential ( * layers ) | [
0.7396811842918396,
0.6432583928108215,
0.3001062273979187,
0.6829605102539062,
-0.3658079206943512,
0.0014702404150739312,
0.3833046555519104,
-0.5159806609153748,
-0.904174268245697,
-0.3990837037563324,
-0.5841479301452637,
-0.4080548584461212,
-0.5044293999671936,
-0.29933661222457886,... |
def get _ all _ questions ( ) : all _ questions = questions. getall _ questions ( ) return make _ response ( jsonify ( { " message " : " success ", " meetups " : all _ questions } ), 200 ) | [
-0.2798965275287628,
-0.8069361448287964,
0.7153416872024536,
1.4733939170837402,
0.13489168882369995,
-0.048206206411123276,
-0.8081338405609131,
0.5753214359283447,
-0.13570600748062134,
0.7048388719558716,
-0.4738725423812866,
-0.40660637617111206,
0.4052433669567108,
-0.180159270763397... |
def removegappedcolumns ( mali, gap _ char = " - " ) : if len ( mali ) = = 0 : return mali keys = mali. keys ( ) lmali = len ( mali [ keys [ 0 ] ] ) wmali = len ( keys ) gaps _ per _ column = [ 0 ] * lmali for m in mali. values ( ) : for x in range ( lmali ) : if m [ x ] = = gap _ char : gaps _ per _ column [ x ] + = 1... | [
-0.27211320400238037,
-0.5633254051208496,
0.6741659641265869,
-0.7783944010734558,
-1.3978021144866943,
0.6803068518638611,
1.0121526718139648,
0.734486997127533,
-0.36103230714797974,
0.2588997781276703,
-0.14586105942726135,
-0.4147742688655853,
-0.4630650579929352,
-0.01332007721066475... |
def init _ model ( self, create _ model _ function ) : args = self. args mini _ batch _ size = self. mini _ batch _ size # restrict limits to actual size of datasets : training _ set _ length = ( len ( self. problem. train _ loader ( ) ) ) * mini _ batch _ size if hasattr ( args,'num _ training') and args. num _ traini... | [
0.0493810698390007,
0.233706995844841,
0.6547718644142151,
0.6094217896461487,
0.5114052891731262,
-0.03214256092905998,
0.7649786472320557,
0.07300309091806412,
-0.5243511199951172,
-0.4260844588279724,
-0.5707287192344666,
0.3198227286338806,
-0.004344134125858545,
0.3068814277648926,
... |
def getincrementindex ( self ) : return _ itkimageserieswriterpython. itkimageserieswriteriuc3iuc2 _ getincrementindex ( self ) | [
0.2029612809419632,
0.5365743637084961,
0.27420246601104736,
0.2085198014974594,
0.164326012134552,
0.5716487169265747,
0.5590419173240662,
0.022436359897255898,
-0.7363297939300537,
-0.5946173071861267,
-0.3407008647918701,
0.5427102446556091,
-0.04144473746418953,
-0.5260365605354309,
... |
def add _ dims ( array, ant, index, nodeid, depth ) : assert ant = = tuple ( sorted ( ant ) ) # a = array. copy ( ) # a = np. expand _ dims ( a, axis = index ) # zeros _ dim = list ( a. shape ) # zeros _ dim [ index ] = depth - 1 # zeros _ dim = tuple ( zeros _ dim ) # zeros = np. zeros ( zeros _ dim, dtype = int ) # a... | [
-0.687315046787262,
-0.4548603892326355,
0.837921142578125,
-0.9008907079696655,
-0.040454912930727005,
0.19178034365177155,
0.16076447069644928,
-0.046637870371341705,
0.8946930170059204,
-0.09037815779447556,
0.8115156292915344,
0.23770125210285187,
0.6071274280548096,
0.1132923290133476... |
def test _ room _ light _ time ( self ) : if hardwarethread. _ hardwarethread _ _ singleton is not none : hardwarethread. _ drop ( ) # get current original value ( none ) and ensure getter returns the same original _ room _ light _ time = \ hardwarethread. _ hardwarethread _ _ room _ light _ time self. assertequal ( or... | [
-0.2749671936035156,
-0.44518324732780457,
0.627519428730011,
0.01479687076061964,
0.7451350092887878,
0.5162801146507263,
0.005607201252132654,
-0.23266682028770447,
-0.006729118525981903,
-0.702737033367157,
-0.7778794765472412,
0.2598475515842438,
-0.55548495054245,
1.265763521194458,
... |
def _ _ init _ _ ( self ) : super ( tracer, self ). _ _ init _ _ ( ) self. lines _ trace = [ ] self. var _ traces = [ ] self. nb _ max _ entree = 400 # call, line, return, exception, opcode self. dico _ event = { " call " : true, " line " : true, " return " : false, " exception " : false, " opcode " : false } | [
1.2971839904785156,
0.40443089604377747,
0.6163720488548279,
0.72147136926651,
0.536247968673706,
0.3287648558616638,
-0.3190922737121582,
0.30736058950424194,
-0.17748504877090454,
-0.10278487205505371,
-0.801030695438385,
-0.6229857206344604,
-0.17827852070331573,
1.5944269895553589,
0... |
def bitrevered _ fft _ stage ( inp, fft _ size, stage _ nr ) : input _ stride = 2 * * stage _ nr local _ fft _ size = fft _ size / / input _ stride twiddles = toggle _ bit _ reverse ( [ w ( i, local _ fft _ size ) for i in range ( local _ fft _ size / / 2 ) ] ) packets = np. array ( np. reshape ( inp, ( local _ fft _ s... | [
-0.4497922360897064,
-0.1613205075263977,
0.7482621669769287,
-0.3779963254928589,
-0.8500342965126038,
-0.575237512588501,
1.0487223863601685,
0.41835084557533264,
0.7578591108322144,
0.4917844831943512,
-0.3413749933242798,
0.19884565472602844,
-0.2743566334247589,
0.5651030540466309,
... |
def _ _ init _ _ ( self, n ) : self. name = n self. age = random. randint ( 18, 25 ) self. year = 1 self. num _ credits = 0 | [
-0.7235392928123474,
0.03631744161248207,
0.6329566240310669,
-0.5049598813056946,
-0.38788607716560364,
1.0570721626281738,
-0.40132856369018555,
-0.35213392972946167,
0.579846978187561,
-0.4444979727268219,
-1.4187655448913574,
-0.2232467085123062,
-0.13863636553287506,
0.974462926387786... |
def test _ 02 _ system ( self ) : l _ irr = self. m _ api. read _ irrigation _ xml ( self. m _ pyhouse _ obj ) l _ sys = l _ irr [ 0 ] l _ xml = self. m _ api. _ write _ one _ system ( l _ sys ) # print ( prettyformatany. form ( l _ xml,'c1 - 02 - a - system') ) self. assertequal ( self. m _ pyhouse _ obj. house. irrig... | [
-0.7477179169654846,
-0.5906270146369934,
0.3806322515010834,
-0.2187889814376831,
0.871446430683136,
0.4005286395549774,
0.2905806601047516,
-0.017756974324584007,
1.1205761432647705,
-1.3773021697998047,
0.38702675700187683,
-0.10718347132205963,
-0.4675455093383789,
0.650792121887207,
... |
def cache _ model ( self ) : # self. _ index _ list. clear ( ) # self. _ source _ parent _ map. clear ( ) # self. _ index _ map. clear ( ) self. _ source _ to _ index _ map = { } # qtcore. qt. qmap ( ) self. _ index _ to _ source _ map = { } # qtcore. qt. qmap ( ) self. _ index _ list = [ ] # qtcore. qt. qlist ( ) # st... | [
-1.070988416671753,
0.329393595457077,
0.3190656304359436,
-0.2028135508298874,
-0.1843956559896469,
0.48020559549331665,
0.8311340808868408,
-0.2767590582370758,
0.5575299263000488,
-0.5061056017875671,
-1.4770418405532837,
-0.08534171432256699,
0.1591235101222992,
-0.13721652328968048,
... |
def call ( ser, number, duration = 0, timeout = 30 ) : ser. write ('atd % s ; \ r'% number ) res = wait _ for _ strs ( ser, call _ res _ states, timeout = timeout ) # if we receive a'cme error : 100 ', it means that we # got a busy. and for some weird reason, the data is not # streamed into the serial comm. what we do ... | [
-0.4064459204673767,
0.12066175788640976,
0.7507847547531128,
-0.5832455158233643,
-0.7033628821372986,
-0.4589731693267822,
-1.2800616025924683,
-1.2957552671432495,
0.035329848527908325,
0.19793014228343964,
-0.42459288239479065,
0.20081420242786407,
-0.10183458775281906,
-0.485921829938... |
def parse _ raw _ token _ spec ( r ) : try : content = json. loads ( r ) except exception : raise valueerror ('malformed json for raw token.') if type ( content ) is dict : return content else : raise valueerror ('token must be a dictionary of attributes.') | [
-0.5399293899536133,
-0.42421481013298035,
0.3753637671470642,
-1.376739263534546,
-1.4564123153686523,
-0.9400103688240051,
-0.46986839175224304,
-0.36407381296157837,
-0.2591667175292969,
0.6366806626319885,
-0.14349181950092316,
-0.08943188190460205,
1.167845368385315,
-0.39333540201187... |
def fb _ create ( self, * * kwargs ) : social _ app = socialapp. objects. all ( ) [ 0 ] client _ id = social _ app. client _ id access _ token = " { 0 } | { 1 } ". format ( client _ id, social _ app. secret ) user = none fb _ post = none if kwargs. get ('fb _ uid') : # if theres a fb _ uid then were fetching an existin... | [
0.49454814195632935,
-0.43125537037849426,
0.946047306060791,
1.4592628479003906,
0.2822190821170807,
0.23502804338932037,
-0.6699079871177673,
-0.4540339410305023,
0.14357349276542664,
-0.25243011116981506,
0.13846230506896973,
-0.1963767260313034,
-0.4857432544231415,
0.1460733413696289,... |
def grid ( m, dtype = np. float32 ) : m = m * * 2 x = np. linspace ( 0, 1, m, dtype = dtype ) y = np. linspace ( 0, 1, m, dtype = dtype ) xx, yy = np. meshgrid ( x, y ) z = np. empty ( ( m, 2 ), dtype ) z [ :, 0 ] = xx. reshape ( m ) z [ :, 1 ] = yy. reshape ( m ) return z | [
-0.3170611262321472,
0.4495856463909149,
0.5862831473350525,
0.5235203504562378,
-0.33303606510162354,
-0.1073603555560112,
0.2893913984298706,
-0.6144570708274841,
-0.029418930411338806,
0.11978913843631744,
-0.030163923278450966,
0.9575371742248535,
-0.533988356590271,
0.6825934648513794... |
def test _ check _ input _ 1dlandmask ( ) : with pytest. raises ( typeerror ) : mob. check _ inputs ( chmask, basevalues _ idx = [ 0 ], window _ idx = 1, landmap = np. ones ( ( 10, 1 ) ) ) | [
-0.15327101945877075,
0.5147120952606201,
0.4371929168701172,
0.9480819702148438,
0.6013338565826416,
1.2061107158660889,
0.45003142952919006,
-0.7039939761161804,
0.45879068970680237,
-0.7281236052513123,
-0.029564885422587395,
0.5174537301063538,
-0.7367073893547058,
1.1534507274627686,
... |
def deserialize _ numpy ( self, str, numpy ) : try : if self. header is none : self. header = std _ msgs. msg. header ( ) end = 0 _ x = self start = end end + = 12 ( _ x. header. seq, _ x. header. stamp. secs, _ x. header. stamp. nsecs, ) = _ get _ struct _ 3i ( ). unpack ( str [ start : end ] ) start = end end + = 4 (... | [
0.6520126461982727,
-0.33964043855667114,
0.9429060816764832,
-0.6921384930610657,
-0.37553009390830994,
0.13455456495285034,
-0.24017508327960968,
-0.9229438304901123,
0.0603417232632637,
-0.6083744764328003,
-0.6648314595222473,
-0.0746433362364769,
-0.8667485117912292,
-0.36070141196250... |
def display ( self ) : for r in range ( len ( self. grid ) ) : for c in range ( len ( self. grid [ r ] ) ) : if ( r, c ) = = self. location : print ('* ', end = " " ) else : print ( self. grid [ r ] [ c ], end = " " ) print ( " " ) print ( " " ) | [
0.5316774249076843,
-0.8384342193603516,
0.7036488652229309,
-0.3076351583003998,
-0.2148866355419159,
0.29504287242889404,
0.19737237691879272,
0.3765360116958618,
-0.20874372124671936,
0.9056833386421204,
1.1885334253311157,
0.9626611471176147,
-0.5015755891799927,
0.5519086718559265,
... |
def render _ to _ reportlab _ document ( output _ filename, papersize _ tuple, manager ) : c = canvas ( output _ filename, papersize _ tuple ) render _ to _ reportlab _ canvas ( c, papersize _ tuple, manager ) c. save ( ) | [
-0.29781031608581543,
0.2738032937049866,
0.2741047739982605,
-0.3618116080760956,
-0.15575569868087769,
0.6660048365592957,
0.6264406442642212,
-0.37162333726882935,
0.08988124877214432,
0.11988095939159393,
0.05439731106162071,
-1.0380386114120483,
-0.6699559688568115,
-0.633671224117279... |
def vectorized _ gaussian _ logpdf ( x, means, covariances ) : _, d = x. shape constant = d * np. log ( 2 * np. pi ) log _ determinants = np. log ( np. prod ( covariances, axis = 1 ) ) deviations = x - means inverses = 1 / covariances return - 0. 5 * ( constant + log _ determinants + np. sum ( deviations * inverses * d... | [
0.3075864613056183,
-0.016377869993448257,
0.659627377986908,
-0.5476781129837036,
-0.6495932340621948,
-0.23351764678955078,
-0.8095601797103882,
0.29207417368888855,
-0.1573134809732437,
0.9296220541000366,
0.35574081540107727,
1.342529296875,
0.6182356476783752,
-0.72048020362854,
0.3... |
def inject _ flight ( flight _ id : str ) - > tuple [ str, int ] : try : json = flask. request. json if json is none : raise valueerror ( " request did not contain a json payload " ) req _ body : injectflightrequest = implicitdict. parse ( json, injectflightrequest ) except valueerror as e : msg = " create flight { } u... | [
-0.6838032007217407,
-0.12285444885492325,
0.906003475189209,
0.10283716022968292,
-0.04110740125179291,
-0.04773573949933052,
0.4771294593811035,
-0.27442970871925354,
0.7896101474761963,
0.0627119317650795,
0.8781561255455017,
-0.1780167818069458,
-0.007270872127264738,
0.454419970512390... |
def getpixelsize ( ) : andor _ solis. getpixelsize. restype = ctypes. c _ uint xsize, ysize = ctypes. c _ float ( ), ctypes. c _ float ( ) result = andor _ solis. getpixelsize ( ctypes. byref ( xsize ), ctypes. byref ( ysize ) ) check _ status ( result ) return float ( xsize. value ), float ( ysize. value ) | [
0.019048698246479034,
-0.02839016355574131,
0.6587733626365662,
-0.5910995006561279,
-0.5436386466026306,
-0.4821489453315735,
-0.42286962270736694,
-0.9013621211051941,
0.3608851432800293,
-0.2728417217731476,
0.28019243478775024,
0.22267691791057587,
-0.5607768893241882,
0.59762161970138... |
def validate _ metadata _ values ( metadata _ values ) : if metadata _ values is none : return none if not isinstance ( metadata _ values, dict ) : raise typeerror ( f'` metadata _ values ` can be ` dict `, got { metadata _ values. _ _ class _ _. _ _ name _ _ } ; { metadata _ values! r }.') if not metadata _ values : r... | [
-0.271037757396698,
-0.09998232871294022,
0.46697139739990234,
-0.22191792726516724,
0.19938698410987854,
0.5550228953361511,
-1.00082266330719,
-0.06533383578062057,
-0.5485351085662842,
0.26738524436950684,
0.567510724067688,
0.5019161105155945,
0.5891645550727844,
0.9738215804100037,
... |
def test _ fit _ not _ contant ( self, select _ mock ) : # setup candidate = magicmock ( ) candidates = [ candidate ] distribution = univariate ( candidates ) # run data = np. array ( [ 1, 2, 3, 4, 5 ] ) distribution. fit ( data ) # assert assert distribution. fitted assert distribution. constant _ value is none # cand... | [
-0.38937729597091675,
-0.07726870477199554,
0.48966625332832336,
0.2713346481323242,
0.5139057040214539,
1.2014814615249634,
0.3355596661567688,
0.13645882904529572,
0.1025691106915474,
-0.31569546461105347,
-0.27785077691078186,
0.1327492594718933,
-1.0433573722839355,
0.39732876420021057... |
def test _ update ( subtests, etcd _ client, prefix ) : etcd _ client. set ( " { } / read / 1 ". format ( prefix ), " one " ) etcd _ client. set ( " { } / read / 2 ". format ( prefix ), " two " ) etcd _ client. set ( " { } / read / 3 / 4 ". format ( prefix ), " three / four " ) # update existent fields with subtests. t... | [
-0.08649184554815292,
-0.22314122319221497,
0.7778132557868958,
-0.9590850472450256,
-0.43160736560821533,
0.4806188941001892,
-0.035280436277389526,
0.18795612454414368,
0.0007261706050485373,
-0.055008675903081894,
0.18024450540542603,
0.21265809237957,
-0.2974577844142914,
-0.8901604413... |
def num _ diffs ( state ) : number _ of _ differences = 0 # if letter! = next letter, increment counter for n in range ( len ( state ) - 1 ) : if state [ n ]! = state [ n + 1 ] : number _ of _ differences + = 1 return number _ of _ differences | [
-0.6816452145576477,
0.45032036304473877,
0.5843116044998169,
-0.748018741607666,
-0.43714573979377747,
0.11226892471313477,
1.1974366903305054,
0.27694642543792725,
1.2123503684997559,
-0.7584056854248047,
-1.688736915588379,
0.2528705596923828,
-0.21672272682189941,
0.6656414270401001,
... |
def get _ name ( self ) : return " test _ name _ " + self. ty | [
-0.35249096155166626,
-1.0346518754959106,
0.56976717710495,
-0.6223201751708984,
0.09863587468862534,
0.5659680366516113,
0.5049130320549011,
-0.8950096964836121,
0.3751251697540283,
0.9055379629135132,
-0.06760544329881668,
0.18581481277942657,
-0.3159395456314087,
0.10048788785934448,
... |
def seek ( self, offset, whence = io. seek _ set ) : pass | [
-0.3550494909286499,
0.09479883313179016,
0.4768543243408203,
0.11765755712985992,
-0.15296895802021027,
0.67718505859375,
0.505843997001648,
-0.6862912178039551,
-0.4705837666988373,
-1.3573954105377197,
0.19278088212013245,
0.598026692867279,
0.0326511412858963,
-0.6877083778381348,
-0... |
def close ( self ) : self. sock. close ( ) self. stats. disconnect ( ) self. logger. log _ v ( " socket closed " ) | [
0.4092811942100525,
-0.17667047679424286,
0.6500696539878845,
-0.756245493888855,
-0.3157919645309448,
0.7949709892272949,
0.45636019110679626,
-0.5055602192878723,
0.17294356226921082,
-1.080448031425476,
0.7263455986976624,
0.9431061148643494,
0.3398834466934204,
0.7757139205932617,
0.... |
def test _ dynamic _ overlay _ memoization ( self ) : def fn ( x, y ) : return scatter ( [ ( x, y ) ] ) dmap = dynamicmap ( fn, kdims = [ ], streams = [ positionxy ( ) ] ) counter = [ 0 ] def fn2 ( x, y ) : counter [ 0 ] + = 1 return image ( np. random. rand ( 10, 10 ) ) dmap2 = dynamicmap ( fn2, kdims = [ ], streams =... | [
-0.6822023987770081,
0.45319581031799316,
0.827170729637146,
0.3175552785396576,
0.08560991287231445,
-0.5243896842002869,
1.1320644617080688,
-0.26672688126564026,
0.8109527230262756,
-1.222782850265503,
-0.6164333820343018,
-0.29720553755760193,
0.10993249714374542,
0.14219899475574493,
... |
def play ( self, app _ config : appconfig, volume _ adjustment = 0 ) : if self. interface : self. interface. play _ sound ( self. get _ absolute _ path ( app _ config ), volume _ adjustment = volume _ adjustment ) | [
0.9545300006866455,
-0.6581950187683105,
0.48656195402145386,
1.0952951908111572,
0.5498195290565491,
0.8910598754882812,
0.4741290211677551,
-0.28564706444740295,
0.06915487349033356,
0.4190045893192291,
1.0503031015396118,
-0.06381373852491379,
-0.004002145957201719,
0.5057744383811951,
... |
def normalize _ content ( content, codif ='utf8') : try : return remover _ acentos ( content, codif ). upper ( ) except unicodedecodeerror as e : raise exceptions. criticalerrorexception ('utf - 8 was not able to normalize this content : ('+ str ( e ) +') maybe you should try to use encode _ literal _ utf _ 8 _ string ... | [
0.5911351442337036,
-0.321265310049057,
0.3744022846221924,
0.2738349437713623,
-0.5898528695106506,
-0.05778777599334717,
-0.4795643389225006,
0.2687259614467621,
0.31683263182640076,
0.5928787589073181,
0.6010207533836365,
-0.5114479660987854,
-0.4896262288093567,
-0.7274703979492188,
... |
def deg ( rad, dms = false ) : d = rad * ( 180. / pi ) if dms : m = 60. 0 * ( d % 1. ) return floor ( d ), floor ( m ), round ( 60 * ( m % 1. ), 4 ) else : return d | [
-0.768450140953064,
0.6942440271377563,
0.4494086802005768,
-1.444884181022644,
-0.21696431934833527,
0.06188685819506645,
0.15507835149765015,
0.026112310588359833,
-0.038528140634298325,
-0.3282150328159332,
-0.16855892539024353,
-0.8175497651100159,
-0.49790841341018677,
0.3363745212554... |
def get _ metric _ type ( line ) : return is _ metric _ line ( line ) and get _ field ( metric _ type _ field, line, metric _ field _ count ) | [
0.7938979864120483,
1.1562480926513672,
0.34660759568214417,
0.8473221659660339,
1.0158905982971191,
0.04958236962556839,
0.6562360525131226,
-1.0268096923828125,
-0.989715576171875,
0.027241889387369156,
0.06456070393323898,
-0.285335898399353,
-0.3091895878314972,
-0.6041665077209473,
... |
def test _ get ( subtests, etcd _ client, prefix ) : # test general get case with key = value with subtests. test ( " inserted keys should be able to be retrieved " ) : etcd _ client. set ( " { } / get - test / key ". format ( prefix ), " value " ) assert etcd _ client. get ( " { } / get - test / key ". format ( prefix... | [
-0.20415401458740234,
0.6150389909744263,
0.45532503724098206,
-0.47721853852272034,
0.3314451277256012,
-0.013448361307382584,
-0.607185959815979,
-0.013838974758982658,
-0.593070924282074,
-0.26784640550613403,
0.32058045268058777,
1.0885332822799683,
-0.15905579924583435,
-0.29715847969... |
def request _ reboot ( pending = true, immediately = false, delay = 10, reason = " unknown " ) : if pending or _ _ context _ _. get ( " power. request _ reboot ", false ) : if immediately : log. warn ( " performing system reboot immediately because of reason'{ : }'". format ( reason ) ) # trigger a reboot event _ _ sal... | [
-0.6206759214401245,
0.23461034893989563,
0.8295680284500122,
0.5090910792350769,
0.008243981748819351,
-0.8706414699554443,
-0.9617040157318115,
0.6874635219573975,
0.5674364566802979,
-0.2260066717863083,
0.8790924549102783,
0.30340439081192017,
-0.8482052683830261,
0.3449161946773529,
... |
def check _ semantic _ type ( self, semantic _ types ) : # the semantic types can be multiple types matched _ semantic _ type = [ s _ type for s _ type in semantic _ types if s _ type in self. vocabulary. keys ( ) ] semantic _ type = matched _ semantic _ type and matched _ semantic _ type [ 0 ] or false return semantic... | [
0.10304874926805496,
-0.1395190805196762,
0.4136892259120941,
0.592605710029602,
0.455342173576355,
-0.3139294385910034,
-0.8530720472335815,
0.022589916363358498,
0.5103887915611267,
0.6635356545448303,
0.9243289828300476,
0.020681072026491165,
-1.318156361579895,
0.5338802337646484,
-0... |
def forward ( self, x ) : p, s = self. padding, self. stride x _ padded = np. pad ( x, ( ( 0, 0 ), ( p [ 0 ], p [ 0 ] ), ( p [ 1 ], p [ 1 ] ) ), mode ='constant') # check dimensions assert ( x. shape [ 1 ] - self. kernel _ size [ 0 ] + 2 * p [ 0 ] ) / s [ 0 ] + 1 > 0, \'height doesn \'t work'assert ( x. shape [ 2 ] - s... | [
0.33604753017425537,
-0.025800509378314018,
1.0626928806304932,
0.147125244140625,
-0.0622272752225399,
-0.28064626455307007,
-0.2969854176044464,
0.03665917366743088,
0.45793047547340393,
-0.03840723633766174,
-0.34115996956825256,
0.1312652826309204,
0.05072448402643204,
0.64404356479644... |
def _ perform _ calculation ( self, operator : operator ) - > none : x = self. _ buffer. pop ( ) if len ( self. _ buffer ) > 0 : value = operator. compute ( self. _ buffer. pop ( ), x ) self. _ buffer. append ( value ) else : self. _ try _ unary _ operation ( operator, x ) | [
0.036616530269384384,
1.1751811504364014,
0.8402454257011414,
0.4209982454776764,
-0.08905720710754395,
-0.40974846482276917,
0.1007685661315918,
-0.09209217131137848,
0.14261429011821747,
-0.13067546486854553,
-0.4442904591560364,
-0.7264286279678345,
-0.20790615677833557,
0.0734332948923... |
def target _ model ( self, target _ model ) : allowed _ values = [ " team ", " portal ", " template ", " imagefolder ", " design " ] if target _ model not in allowed _ values : raise valueerror ( " invalid value for ` target _ model ` ( { 0 } ), must be one of { 1 } ". format ( target _ model, allowed _ values ) ) self... | [
-1.2139455080032349,
-0.06193927675485611,
-0.29304033517837524,
0.4912053942680359,
0.309910386800766,
1.4280346632003784,
0.28634113073349,
0.42387640476226807,
-0.8649467825889587,
-0.010639235377311707,
-0.4604310393333435,
0.1667737513780594,
0.5484930872917175,
-0.19927434623241425,
... |
def _ _ log ( buf, entry ) : buf. write ( entry ) | [
0.6060987710952759,
-0.9049179553985596,
0.31497570872306824,
-1.2858283519744873,
0.6527780890464783,
0.24526436626911163,
-0.4041554033756256,
0.3386019170284271,
-0.05453695356845856,
-0.09651494771242142,
-0.8722545504570007,
1.156129240989685,
0.06798745691776276,
-0.5666348338127136,... |
def unload _ type ( t, left, right, boat ) : if len ( boat. contents ) = = 0 : return 0 if boat. side = = 0 : active _ list = left else : active _ list = right try : x = boat. contents. index ( t ) active _ list. append ( boat. contents. pop ( x ) ) return 1 except valueerror : # no such creature left return 0 | [
-1.2289636135101318,
-0.40977510809898376,
0.6583826541900635,
-1.4839372634887695,
0.3348439037799835,
-0.030423404648900032,
0.028304820880293846,
-0.23582935333251953,
-1.0508121252059937,
1.0517723560333252,
-0.28265488147735596,
-0.31613409519195557,
-0.8330374956130981,
-0.2281650602... |
def process _ all ( self, dataset, cnn _ layer, save ) : self. _ init _ net ( mode ='dataset') num _ examples = dataset. shape [ 0 ] blobs = [ self. net. blobs [ l ]. data. copy ( ). squeeze ( ) for l in cnn _ layer ] features = np. zeros ( ( num _ examples, np. hstack ( blobs ). shape [ 1 ] ) ) iterations = int ( roun... | [
-0.0006081665051169693,
-0.33205100893974304,
0.8893804550170898,
0.1894415020942688,
0.7588405013084412,
-0.6964876651763916,
0.9292740225791931,
0.01801150105893612,
-0.4558635950088501,
0.6000152826309204,
-1.071961760520935,
0.17084679007530212,
-0.1905871033668518,
1.3390092849731445,... |
def test _ packages ( self ) : self. asserttrue ( self. check _ package _ output ( " java - version ",'openjdk version " 1. 8 ', true ) ) self. asserttrue ( self. is _ package _ present ( " mvn " ) ) self. asserttrue ( self. is _ package _ present ( " gradle " ) ) | [
0.17005468904972076,
-0.0737541988492012,
0.4241045415401459,
0.1580432504415512,
0.6779119372367859,
1.0536506175994873,
0.17790277302265167,
0.011646043509244919,
0.1872985064983368,
0.2147604376077652,
-0.4134344458580017,
-0.6635268926620483,
0.10784099996089935,
0.8789454698562622,
... |
def construct _ term _ dict ( self, key, value ) : term _ dict = dict ( ) term _ dict [ " concept name " ] = key term _ dict [ " positional info " ] = value [ 0 ] term _ dict [ " semantic types " ] = self. vocabulary [ value [ 1 ] ] [ 0 ] term _ dict [ " sources " ] = value [ 2 ] return term _ dict | [
-0.40842998027801514,
-0.5275906324386597,
0.42300087213516235,
-1.458707571029663,
-1.0234744548797607,
-0.44982245564460754,
-0.886374294757843,
0.09537171572446823,
-0.8567243814468384,
0.6387354135513306,
-0.41042980551719666,
-0.43171659111976624,
0.33727604150772095,
0.12119929492473... |
def provisioning _ state ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " provisioning _ state " ) | [
0.26504838466644287,
-0.5235426425933838,
0.2356261909008026,
0.14276067912578583,
-0.10754995793104172,
0.9865447282791138,
-0.11480506509542465,
0.31414350867271423,
0.8774012327194214,
0.6819149255752563,
0.2214599996805191,
0.26798978447914124,
0.34951168298721313,
-1.045824408531189,
... |
def test _ setup _ template _ name _ and _ pattern ( self ) : self. render _ config ( ) exit _ code = self. run _ beat ( logging _ args = [ " - v ", " - d ", " * " ], extra _ args = [ " setup ", self. cmd, " - e ", " setup. template. name = " + self. custom _ template, " - e ", " setup. template. pattern = " + self. cu... | [
-0.28530532121658325,
-0.6209620237350464,
0.6836203932762146,
-1.0564576387405396,
0.1380055993795395,
0.6207883358001709,
0.6261267066001892,
0.6621069312095642,
0.11255551874637604,
0.4997536540031433,
-0.5929594039916992,
0.15689323842525482,
0.16740339994430542,
-0.06864811480045319,
... |
def _ _ init _ _ ( self, width : int, height : int ) : self. width = width self. height = height | [
-0.020748089998960495,
-0.6276051998138428,
0.7181729674339294,
0.30621033906936646,
-0.6473192572593689,
-0.23193016648292542,
-0.4511224627494812,
-0.03310900554060936,
0.00046660981024615467,
-0.6928291320800781,
-0.175198033452034,
0.16092199087142944,
-0.06158239394426346,
0.958414971... |
def new _ ip ( self ) : result = self. api. query ( ). ips. post ( { " organization " : self. org _ id } ) ['ip'] print ( result ) new _ ip = ip ( self, result ) self. ips. add ( new _ ip ) return new _ ip | [
-1.205177903175354,
-0.5349637866020203,
0.48220759630203247,
0.46242114901542664,
-0.34877389669418335,
-0.03327920660376549,
-0.9757968783378601,
0.5649352073669434,
0.32339805364608765,
-0.08319128304719925,
0.4957006573677063,
-0.44371795654296875,
-0.8814646601676941,
-1.3073191642761... |
def get _ module _ defined _ k8s _ ver ( k8s _ version _ opts, env _ name ) : if isinstance ( k8s _ version _ opts, six. string _ types ) : return k8s _ version _ opts if k8s _ version _ opts. get ( env _ name ) : return k8s _ version _ opts. get ( env _ name ) if k8s _ version _ opts. get ( " * " ) : return k8s _ vers... | [
-0.30252373218536377,
-1.1649158000946045,
0.65593421459198,
0.6372798681259155,
0.14742925763130188,
0.26346707344055176,
-1.2739688158035278,
-0.8099008202552795,
0.45135125517845154,
1.1750046014785767,
0.18500015139579773,
1.1817537546157837,
-0.15419453382492065,
-0.05497677996754646,... |
def test _ list _ alumno _ docente ( self ) : self. client. force _ authenticate ( user = self. user _ docente ) response = self. client. get ( " / api / alumnos / list / " ) self. assertequal ( response. status _ code, status. http _ 200 _ ok ) self. assertequal ( response. data. get ( " count " ), 4 ) | [
0.20726795494556427,
0.6482254266738892,
0.4230773448944092,
-0.05230345577001572,
0.5681779980659485,
0.8798531293869019,
-0.8833602666854858,
0.4418491721153259,
0.17045876383781433,
-0.5532833337783813,
-0.7773386240005493,
0.8262069821357727,
1.676737904548645,
-0.5792608261108398,
-... |
def filtercoloredpolygons ( self, polygons, color ) : if polygons = = none : return none filtered = [ ] for p in polygons : xc, yc = p. findcenter ( ) x, y = self. _ reversecoordinates ( xc, yc ) pixelcolor = self. getpixelat ( x, y ) if numpyimage. _ isrightcolor ( pixelcolor, color ) : filtered + = [ p ] return filte... | [
0.4792954623699188,
-0.7752570509910583,
0.7381943464279175,
-0.03243236616253853,
-0.1304265856742859,
0.5001925230026245,
-0.9937396049499512,
-0.9804122447967529,
0.9970750212669373,
1.3807270526885986,
-0.228523388504982,
0.5488597750663757,
-0.38720765709877014,
-0.24479921162128448,
... |
def fbdisconnect ( ) : fb _ id = login _ session ['facebook _ id'] access _ token = login _ session ['access _ token'] url ='https : / / graph. facebook. com / % s / permissions? fb _ exchange _ token = % s'% ( fb _ id, access _ token ) h = httplib2. http ( ) # remove the access token for this user from fb's server : r... | [
0.17192433774471283,
-0.9153647422790527,
0.7090265154838562,
-0.21103422343730927,
-0.2978243827819824,
-0.38201460242271423,
-0.26984500885009766,
-0.02169746533036232,
0.6185398697853088,
-0.06400977820158005,
-0.037044163793325424,
0.21806654334068298,
-0.6516963243484497,
-0.801634132... |
def farm _ ram _ menu _ default ( self, rop _ path ) : return 0 | [
-0.21801160275936127,
-0.3964598774909973,
0.48635220527648926,
1.640291690826416,
1.0272979736328125,
-0.43956494331359863,
1.202622890472412,
0.3114033341407776,
0.36956986784935,
-0.4838046133518219,
0.06802114844322205,
-0.483814001083374,
-0.7721308469772339,
-0.3264341354370117,
-0... |
def check _ for _ setup _ error ( self ) : pass | [
-0.5908896923065186,
-0.5585336685180664,
0.2828943431377411,
0.6358249187469482,
0.7911310195922852,
-0.08871813118457794,
1.0897881984710693,
0.05621735006570816,
-0.2904813587665558,
0.5646708011627197,
0.7649942636489868,
-0.16630417108535767,
-0.20942160487174988,
1.1185040473937988,
... |
def test _ phantom _ alignment ( data _ path, air _ path ) : data = np. squeeze ( loadmat ( data _ path ) ['cc _ struct'] ['data'] [ 0 ] [ 0 ] [ 0 ] [ 0 ] [ 0 ] ) air = np. squeeze ( loadmat ( air _ path ) ['cc _ struct'] ['data'] [ 0 ] [ 0 ] [ 0 ] [ 0 ] [ 0 ] ) # do the air correction corr = np. squeeze ( np. log ( np... | [
0.5079072117805481,
-0.36826929450035095,
0.7637518644332886,
-0.575887143611908,
0.10323058068752289,
1.1649812459945679,
1.1144330501556396,
0.7053616046905518,
-0.15591779351234436,
-0.9177589416503906,
1.2786779403686523,
0.34891510009765625,
-0.31710925698280334,
-0.31286388635635376,... |
def get _ group _ ideas _ with _ http _ info ( self, group _ id, start, end, logged _ in _ user _ id, access _ token, client _ token, * * kwargs ) : all _ params = ['group _ id ','start ','end ','logged _ in _ user _ id ','access _ token ','client _ token ','fields'] all _ params. append ('callback') all _ params. appe... | [
-0.7647472023963928,
0.3100774884223938,
0.9052850604057312,
0.4926319122314453,
-0.047911468893289566,
-0.08659102767705917,
0.09140351414680481,
-1.0865767002105713,
-1.237166404724121,
0.234831303358078,
0.6612673401832581,
1.2521631717681885,
-0.7932825684547424,
0.4927428066730499,
... |
def local _ density ( num _ points, distances, dc ) : def density ( dij, dc ) : if dij < dc : return 1 # if point is in dc neighbourhood else : return 0 # if point is outside dc neighbourhood rho = [ 0 ] * num _ points for i in range ( 0, num _ points - 1 ) : for j in range ( i + 1, num _ points ) : rho [ i ] + = float... | [
0.7043483853340149,
-0.5148176550865173,
0.39410945773124695,
-0.19696871936321259,
-0.2143012434244156,
-0.29436373710632324,
0.0487227737903595,
0.40498989820480347,
0.4621763527393341,
0.5946075320243835,
0.09688747674226761,
-0.021148622035980225,
0.2421005219221115,
-0.000410719570936... |
def cmd _ help ( ) : commands = ['" h, help " for help ','" q, quit " for quit ','" n, north " for north ','" e, east " for east ','" s, south " for south ','" w, west " for west ','" t, take, get " " item " for take item ','" d, drop " " item " for drop item ','" i, inventory " for inventory ','" u, use " " item " for... | [
-0.21526670455932617,
-0.5661407113075256,
0.9808526635169983,
-0.026540672406554222,
0.7726658582687378,
0.708213210105896,
0.40649697184562683,
-0.7997694611549377,
-0.49464407563209534,
0.0773838609457016,
0.1903238594532013,
0.525442361831665,
0.40024206042289734,
0.20020927488803864,
... |
def unpool ( self, pool, ind, ksize = [ 1, 2, 2, 1 ], scope ='unpool') : with tf. variable _ scope ( scope ) : input _ shape = tf. shape ( pool ) output _ shape = [ input _ shape [ 0 ], input _ shape [ 1 ] * ksize [ 1 ], input _ shape [ 2 ] * ksize [ 2 ], input _ shape [ 3 ] ] flat _ input _ size = tf. cumprod ( input ... | [
-0.806155800819397,
0.17448410391807556,
0.8735980987548828,
-0.5411770939826965,
-1.2152844667434692,
0.2998976409435272,
0.5939863324165344,
0.029617417603731155,
0.1907832771539688,
0.627777636051178,
-0.028383610770106316,
0.5354539752006531,
0.011405311524868011,
-1.570838451385498,
... |
def vaccinate ( self, entityid ) : person = self. _ _ personrepository. findbyid ( entityid ) if not ( person. status = = " ill " ) : person. imunization = " vaccinated " else : raise personexception ( " the person can't be vaccinated " ) | [
-0.4475657343864441,
-0.30895572900772095,
0.4424501061439514,
-0.031107859686017036,
-0.32526695728302,
0.5805276036262512,
-0.7036937475204468,
0.10273274034261703,
0.4038040339946747,
0.18288549780845642,
0.18842969834804535,
0.2835480570793152,
0.1901688277721405,
0.4775882959365845,
... |
def linregress ( x, y = none, santer = false ) : tiny = 1. 0e - 20 if y is none : # x is a ( 2, n ) or ( n, 2 ) shaped array _ like x = np. asarray ( x ) if x. shape [ 0 ] = = 2 : x, y = x elif x. shape [ 1 ] = = 2 : x, y = x. t else : msg = ( " if only ` x ` is given as input, it has to be of shape " " ( 2, n ) or ( n... | [
0.502868115901947,
0.5971407294273376,
0.9551861882209778,
-0.10226152837276459,
-0.3527514934539795,
-0.2509400546550751,
-0.09135376662015915,
-0.3157583773136139,
0.5681539177894592,
0.8300172090530396,
0.2713882327079773,
0.7717416882514954,
0.6666032671928406,
-0.3423544764518738,
0... |
def create _ dummy _ computation _ reference ( ) : type _ signature = computation _ types. tensortype ( tf. float32 ) value = pb. computation ( type = type _ serialization. serialize _ type ( type _ signature ), reference = pb. reference ( name ='a') ) return value, type _ signature | [
0.20808301866054535,
-0.18690446019172668,
0.5871797204017639,
-0.644974946975708,
0.9617599844932556,
0.0744071826338768,
0.9463391900062561,
-0.6799158453941345,
-0.37716060876846313,
0.1781633198261261,
-0.5121749639511108,
0.3411397337913513,
-0.34943023324012756,
0.6153716444969177,
... |
def _ closuredimport ( func, alias ='', builtin = false ) : import re from dill. detect import freevars, outermost free _ vars = freevars ( func ) func _ vars = { } # split into'funcs'and'non - funcs'for name, obj in list ( free _ vars. items ( ) ) : if not isfunction ( obj ) : continue # get import for'funcs'fobj = fr... | [
-0.49628564715385437,
-0.3478181064128876,
0.9295585751533508,
-0.9466330409049988,
-0.8222101926803589,
-0.8644563555717468,
0.9404146075248718,
0.22157958149909973,
0.041417211294174194,
-0.07877858728170395,
-0.3341298997402191,
0.745833694934845,
0.37706562876701355,
0.4775349795818329... |
def _ _ init _ _ ( self, num _ scenarios = 3, dump _ dir = none, render = false, params = parameterserver ( ) ) : self. _ dump _ dir = dump _ dir self. _ num _ scenarios = num _ scenarios self. _ params = params self. _ bp = continuoushighwayblueprint ( self. _ params, \ number _ of _ senarios = self. _ num _ scenarios... | [
0.6200398206710815,
0.4048888087272644,
0.706687331199646,
0.7742298245429993,
0.3125564754009247,
-0.06439512223005295,
0.8607161641120911,
0.919333815574646,
0.1755649447441101,
-0.43509766459465027,
-0.5522850751876831,
-0.061369746923446655,
-0.5324639678001404,
0.6531547904014587,
0... |
def get _ payoff _ mixed ( model, attack _ profile, defense _ profile, attack _ strategy, defense _ strategy ) : total _ discount _ reward = 0 attack _ policies = np. random. choice ( attack _ profile, max _ episodes, p = attack _ strategy ) defense _ policies = np. random. choice ( defense _ profile, max _ episodes, p... | [
0.593418538570404,
0.07860230654478073,
0.7943640947341919,
-0.1919749230146408,
0.5533487200737,
0.5193927884101868,
-0.020350074395537376,
0.08723478764295578,
0.38184842467308044,
0.5775058269500732,
0.1261155605316162,
-0.16391877830028534,
0.3296993374824524,
-0.018449030816555023,
... |
def parse _ arguments ( ) : parser = argparse. argumentparser ( description ='submit toil job') parser. add _ argument ('- - project _ name ', action ='store ', dest ='project _ name ', help ='name for project ( e. g. pipeline _ test ) ', required = true ) parser. add _ argument ('- - output _ location ', action ='stor... | [
0.3448234498500824,
-0.5012829899787903,
0.6327646970748901,
-0.5836800336837769,
-0.30116140842437744,
0.39710533618927,
0.1035538837313652,
0.7254006266593933,
-1.0826879739761353,
0.6350510716438293,
-0.27313077449798584,
0.22657732665538788,
-0.4256410300731659,
0.2984858751296997,
-... |
def weighteddictrandom ( indict, num _ sel = 1 ) : # selection is without replacement ( important for use when picking participants etc. ) if not indict : return ( ) if num _ sel > len ( indict ) : raise indexerror if not num _ sel : return ( ) if num _ sel = = len ( indict ) : return list ( indict. keys ( ) ) keys = [... | [
-0.613288164138794,
-0.362496942281723,
0.718060314655304,
-0.17621323466300964,
-0.18290413916110992,
-0.04645419865846634,
0.6338470578193665,
-0.0027584147173911333,
0.771450400352478,
0.7096468806266785,
-0.3258287310600281,
-0.5496379137039185,
-0.6670218706130981,
0.46065831184387207... |
def test _ listdomain _ unif _ rand _ samp ( ) : dom _ params = namespace ( set _ domain _ list = true, domain _ list = [ 1. 0,'cat ', ( 5, 5 ) ] ) listdom = listdomain ( params = dom _ params ) nsamp = 10 samp _ list = listdom. unif _ rand _ sample ( n = nsamp ) assert isinstance ( samp _ list, list ) assert len ( sam... | [
-0.047949690371751785,
0.7064548134803772,
0.3002537190914154,
0.03664375841617584,
0.09112256020307541,
0.41539570689201355,
-0.10615224391222,
0.45385581254959106,
1.324653148651123,
-0.39009276032447815,
-0.8731445074081421,
0.5542935729026794,
0.29308855533599854,
0.7499439120292664,
... |
def getgraylevelnonuniformitynormalizedfeaturevalue ( self ) : raise deprecationwarning ('gldm - gray level non - uniformity normalized is mathematically equal to first order -'' uniformity, see http : / / pyradiomics. readthedocs. io / en / latest / removedfeatures. html for more'' details') | [
-0.010375835932791233,
0.1383861005306244,
0.4345599114894867,
-0.03178352490067482,
0.09737829864025116,
0.5930166244506836,
0.46286842226982117,
-0.3621927797794342,
-0.16131901741027832,
-0.7166605591773987,
-0.7972670197486877,
0.48077037930488586,
-0.8046445250511169,
0.34299513697624... |
def senddata ( url, key, field1, field2, field3, field4, temp, pres, humid, tempf ) : values = {'api _ key': key,'field1': temp,'field2': pres,'field3': humid,'field4': tempf,'timezone': tz _ local } postdata = urllib. urlencode ( values ) # encode values in url format - - - - - - > ( postdata ) = api _ key = key & fie... | [
-1.1641799211502075,
-0.18589237332344055,
1.0608381032943726,
-0.048668619245290756,
-0.0771886333823204,
0.5886149406433105,
-0.4513062536716461,
-0.0892718955874443,
-1.0208847522735596,
0.029818737879395485,
-1.1439274549484253,
0.5598788261413574,
-0.6406298875808716,
0.62892955541610... |
def luma _ matrix _ horizontal _ size ( self ) : # type : ( ) - > int return self. _ luma _ matrix _ horizontal _ size | [
1.159148931503296,
0.1752883642911911,
0.290226012468338,
0.4976130425930023,
-0.42877423763275146,
1.118691086769104,
0.4600349962711334,
1.1011199951171875,
-0.04692409932613373,
-0.8572283387184143,
0.10410666465759277,
0.308848112821579,
-0.6882833242416382,
-0.14388322830200195,
0.9... |
def to _ dict ( self ) : result = { } for attr, _ in six. iteritems ( self. openapi _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ att... | [
-0.6693187355995178,
-0.3947540521621704,
0.8680081963539124,
-0.6332703232765198,
-0.7122994065284729,
-0.6619346141815186,
0.13689111173152924,
-0.8400680422782898,
0.19874952733516693,
0.2828713059425354,
-0.7523773312568665,
-0.1343313306570053,
0.028995612636208534,
0.5141352415084839... |
def load _ pixmap ( * args, * * kwargs ) : if q. qapplication. instance ( ) is none : return kwargs. get ('default ', none ) pixmap = q. qpixmap ( ) for name in args : pixmap = q. qpixmap ( cfg. rcfile ( name ) ) if not pixmap. isnull ( ) : break if pixmap. isnull ( ) and'default'in kwargs : pixmap = kwargs ['default']... | [
0.024464193731546402,
-0.23846295475959778,
0.8728663921356201,
-0.41729894280433655,
-0.3310181796550751,
0.14990690350532532,
-0.6976402401924133,
-0.764041543006897,
0.7130502462387085,
0.20601795613765717,
-0.3129187226295471,
-0.8181917071342468,
-0.760722279548645,
0.663022518157959,... |
def calcbadtpstcetransits ( binwidth, filenamein, skyefilename, outfilename ) : maxt = 1600. 0 # maximum bkjd of the data # read in the tce data ( name, period, epoch, and skygroup ) data = np. genfromtxt ( filenamein, names = true, dtype = none ) # read in the output file from calcskye with the bad times and skygroups... | [
-0.24344180524349213,
-0.0406876802444458,
0.661502480506897,
-0.6081493496894836,
-0.7506865859031677,
0.22175821661949158,
0.6707519292831421,
0.4282481372356415,
-0.5875440835952759,
0.9024224877357483,
-0.3732947111129761,
0.38139796257019043,
-0.33347564935684204,
1.4458125829696655,
... |
def mcgroupcount ( self ) : if self. force _ auto _ sync : self. get ('mcgroupcount') return self. _ mcgroupcount | [
-0.4096982777118683,
0.693306565284729,
0.48269209265708923,
0.331645667552948,
-0.5670232176780701,
0.04167185723781586,
1.2349640130996704,
0.06694328039884567,
-0.28779900074005127,
-0.26584991812705994,
-0.5028136968612671,
1.0119709968566895,
-0.5770642161369324,
0.22626015543937683,
... |
def batch _ by _ size ( self, indices, max _ tokens = none, max _ sentences = none, required _ batch _ size _ multiple = 1, ) : from fairseq. data import data _ utils fixed _ shapes = self. get _ batch _ shapes ( ) if fixed _ shapes is not none : def adjust _ bsz ( bsz, num _ tokens ) : if bsz is none : assert max _ to... | [
-0.15878251194953918,
0.4260967969894409,
0.5109007358551025,
0.6123760342597961,
0.07251127809286118,
-0.559742271900177,
0.06699846684932709,
0.11014550924301147,
-0.2234737128019333,
-0.15666663646697998,
-0.5035589337348938,
0.37978890538215637,
0.09390169382095337,
-0.1865700632333755... |
def save _ matr ( matr, filename, fileformat = " txt " ) : if fileformat = = " txt " : np. savetxt ( filename, matr ) elif fileformat = = " npy " : np. save ( filename, matr ) | [
0.0493105947971344,
-1.2035787105560303,
0.15411420166492462,
-0.016560815274715424,
-0.18501079082489014,
0.5108418464660645,
-0.40640193223953247,
-0.2351270318031311,
0.2685525417327881,
-0.08852347731590271,
0.662771999835968,
-0.13326886296272278,
0.06913399696350098,
1.20501804351806... |
def concatdatahorizontally ( data1, data2 ) : if len ( data1 ) = = 0 : return data2 if len ( data2 ) = = 0 : return data1 data1 _ height = len ( data1 ) data2 _ height = len ( data2 ) data _ result _ height = max ( data1 _ height, data2 _ height ) # data2 starts at the end of the longest row in data1 that is next to it... | [
0.9344100952148438,
0.3571180999279022,
1.1020630598068237,
0.22450192272663116,
-1.0413495302200317,
0.41474735736846924,
-1.2563819885253906,
-0.16531309485435486,
-0.7123214602470398,
0.07231194525957108,
-0.217123880982399,
1.1318514347076416,
-0.025938065722584724,
0.488299161195755,
... |
def actionabort ( self ) : frc1 = self. _ executesubdriver ( ['abort ', ], fmayskip = false ) ; frc2 = self. _ killallvboxprocesses ( ) ; frc3 = testdriverbase. actionabort ( self ) ; return frc1 and frc2 and frc3 ; | [
-0.29861852526664734,
-0.6928258538246155,
0.6760214567184448,
0.9201711416244507,
1.1099931001663208,
-0.006779886316508055,
0.31074491143226624,
-0.7519871592521667,
-0.3788521885871887,
0.11867406964302063,
0.5770582556724548,
-0.11036711931228638,
-1.137486219406128,
0.0880670323967933... |
def change _ range ( cls, change _ start : position, change _ end : position, change _ text : str, old _ text : str, ) - > " textdocumentcontentchangeevent " : change _ range = range ( change _ start, change _ end ) return cls ( range = change _ range, rangelength = change _ range. calculate _ length ( old _ text ), te... | [
0.16390733420848846,
-1.0229219198226929,
0.43858614563941956,
-0.6299920678138733,
-0.9956150054931641,
-0.3951856791973114,
-0.815436840057373,
0.42892205715179443,
-0.9247835874557495,
0.4444482922554016,
-0.33512815833091736,
0.9836751222610474,
-0.3980964124202728,
0.07646232098340988... |
def enrich _ embryo _ with _ contactid ( poly _ in, d _ parentid _ map = none ) : a _ parentindex = dsa. wrapdataobject ( poly _ in ). celldata ['parentindex']. _ _ array _ _ ( ) a _ contactindex = dsa. wrapdataobject ( poly _ in ). celldata ['contact _ index']. _ _ array _ _ ( ) a _ contact _ id = np. array ( [ a _ pa... | [
-0.5629616975784302,
-0.8358595371246338,
0.7967177629470825,
-0.10278978943824768,
-0.008663436397910118,
0.10650354623794556,
0.6825977563858032,
-0.19281575083732605,
0.4437468945980072,
0.08793976157903671,
0.7490990161895752,
0.21374991536140442,
0.43047499656677246,
-0.05662113428115... |
def extract _ region ( init _ pos, end _ pos ) : size = size _ region ( init _ pos, end _ pos ) blocks = world. renderer. get _ blocks ( vec3 ( init _ pos. x, init _ pos. y, init _ pos. z ), vec3 ( end _ pos. x, end _ pos. y, end _ pos. z ) ) blocks _ list = list ( blocks ) # the order in getblocks is z, x, y and for a... | [
0.2956518828868866,
-0.31405380368232727,
0.8159746527671814,
-0.6218293905258179,
-0.4119825065135956,
-0.27010875940322876,
-0.26603326201438904,
0.10305605828762054,
-0.44285154342651367,
0.3531877398490906,
-0.8566511273384094,
0.6255775690078735,
-0.3066052794456482,
0.029302738606929... |
def all _ options ( self ) : b = self. browser return [ b. text ( el ) for el in b. elements ( self. item _ locator ) ] | [
-0.5525668859481812,
-1.1620149612426758,
0.33686715364456177,
0.9178058505058289,
0.7792795896530151,
0.35087084770202637,
-0.8481680154800415,
-0.004881404340267181,
1.174943447113037,
0.6204281449317932,
0.04397701472043991,
-0.28782498836517334,
0.35588744282722473,
0.15980857610702515... |
def ask _ yes _ no ( prompt, default = none ) : if default : prompt ='% s [ % s ]'% ( prompt, default ) return ipython. genutils. ask _ yes _ no ( prompt, default ) | [
-0.565676748752594,
0.5478670001029968,
0.33414962887763977,
0.5992261171340942,
-0.19090808928012848,
-0.3264075815677643,
0.1509588658809662,
0.11597108095884323,
-0.5560279488563538,
-0.7777436971664429,
-0.8297262787818909,
0.8434370756149292,
-0.3160645365715027,
-1.0312111377716064,
... |
def showrestaurantsxml ( ) : restaurants = session. query ( restaurant ). all ( ) rs = {'restaurant': [ r. serialize for r in restaurants ] } return response ( xmlify ( rs, wrap ='restaurants'), mimetype ='text / xml') | [
-0.5757145285606384,
0.05873320624232292,
0.018187053501605988,
-0.752332866191864,
-0.969840407371521,
-0.36069411039352417,
-1.0390509366989136,
1.0760879516601562,
0.3814442455768585,
0.3316969573497772,
0.07110219448804855,
0.43259185552597046,
-0.54937344789505,
0.028977401554584503,
... |
def steiner _ conv _ strat ( grid, dx = none, dy = none, intense = 42. 0, work _ level = 3000. 0, peak _ relation ='default ', area _ relation ='medium ', bkg _ rad = 11000. 0, use _ intense = true, fill _ value = none, refl _ field = none ) : # get fill value if fill _ value is none : fill _ value = get _ fillvalue ( ... | [
0.05591380596160889,
-0.053116101771593094,
0.903773844242096,
-0.7665904760360718,
-0.6929717659950256,
0.28655245900154114,
0.12621845304965973,
-0.2380855679512024,
-0.6118791699409485,
0.8866498470306396,
-0.11827569454908371,
0.8193031549453735,
0.45391762256622314,
0.1913038492202758... |
def abortspsexposure ( self, cmd ) : cmdkeys = cmd. cmd. keywords filter ='sunss'if'sunss'in cmdkeys else'sps'try : sequence = self. engine. registry. identify ( cmdkeys, filter = filter ) sequence. doabort ( cmd ) except exception as e : cmd. fail ( f'text = " { str ( e ) } "') return cmd. finish ( ) | [
-0.4932645261287689,
-0.6900802254676819,
0.5965324640274048,
0.49000266194343567,
-0.8661889433860779,
0.7211662530899048,
0.3500540852546692,
-0.2455059438943863,
0.4714813232421875,
0.23683592677116394,
0.9414957165718079,
0.4077141582965851,
-0.5169553756713867,
0.9157068729400635,
0... |
def normalize _ data ( self, orig _ images, norm _ image _ size ) : # 1. original images shape orig _ images _ shape = np. array ( [ [ orig _ images [ image _ index ]. shape [ 0 ], orig _ images [ image _ index ]. shape [ 1 ] ] for image _ index in range ( len ( orig _ images ) ) ] ) # 2. normalize original images # ( ... | [
-0.3678518533706665,
-0.6138322353363037,
0.824226975440979,
-0.8943560719490051,
0.012314525432884693,
-0.32663673162460327,
0.4521310031414032,
0.20775644481182098,
-0.08194156736135483,
1.022825837135315,
0.5641680955886841,
0.5294614434242249,
-0.15818467736244202,
0.25660625100135803,... |
def bssc _ init _ influxdb _ version ( self, log ) : if not self. bssc _ is _ up ( log ) : self. bssc _ influxdb _ version = clog. error _ msg return influxdb _ version = self. bssc _ server. bes _ influxdb _ version ( log ) if influxdb _ version is none : self. bssc _ influxdb _ version = clog. error _ msg self. bssc ... | [
0.027165569365024567,
-0.7584645748138428,
0.7515991926193237,
1.2470301389694214,
0.7148767113685608,
0.2395755499601364,
-0.2667805850505829,
-0.385040283203125,
-0.10821212083101273,
0.39487573504447937,
-0.7062520384788513,
0.976398766040802,
0.20083686709403992,
0.25671109557151794,
... |
def _ extract _ play _ by _ play ( game _ id ) : nflscrapr. run ('play _ by _ play ', game _ id = game _ id, ) nflscrapr _ output = etl _ tools. extract _ from _ csv ( config. play _ by _ play _ dump _ csv _ path ) return nflscrapr _ output | [
-0.38715702295303345,
0.41756290197372437,
0.326316773891449,
-0.01740574836730957,
0.16990961134433746,
-0.86290442943573,
0.2401628941297531,
-1.6557538509368896,
0.24789507687091827,
0.816883385181427,
0.24584180116653442,
-0.3767782151699066,
0.31313133239746094,
-0.6644879579544067,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.