text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def sparsevectors ( self ) : words = list ( self. vocabulary. keys ( ) ) sparsevectors = { } currentword = 0 for word in words : currentword + = 1 files = self. vocabulary [ word ] for file in files : if file not in sparsevectors : sparsevectors [ file ] = { currentword : self. vocabulary [ word ] [ file ] } else : spa... | [
0.03696656599640846,
-0.75272536277771,
0.35856184363365173,
-0.7137855887413025,
-0.1705910861492157,
-0.3594796359539032,
0.564200758934021,
0.15504632890224457,
0.2662103772163391,
0.3552207350730896,
-0.29726436734199524,
0.13854187726974487,
-0.7919936776161194,
0.8047140836715698,
... |
def age ( self, row, col ) : # the light implementation does not know the ages, so it cheats and # returns a constant value. return 1000 | [
0.0712462067604065,
0.6608794927597046,
0.4892996549606323,
-0.31096118688583374,
0.17966288328170776,
0.029729459434747696,
-0.40481963753700256,
-0.34385448694229126,
0.0846395343542099,
0.821182906627655,
0.23020218312740326,
-0.21601003408432007,
0.7129813432693481,
0.52833092212677,
... |
def test _ ens _ lookup _ multichain ( ethereum _ inquirer, call _ order, ethereum _ manager _ connect _ at _ start, ) : wait _ until _ all _ nodes _ connected ( ethereum _ manager _ connect _ at _ start, ethereum _ inquirer ) # test default ethereum result = ethereum _ inquirer. ens _ lookup ( ens _ bruno, call _ orde... | [
-0.49802759289741516,
0.308022677898407,
0.7219056487083435,
0.24030984938144684,
0.534028947353363,
0.05273139849305153,
-0.9052096605300903,
-0.265580952167511,
-0.0809904932975769,
-0.1366005688905716,
-0.37748217582702637,
-0.14635029435157776,
-0.2304176241159439,
0.5480044484138489,
... |
def registerconfig ( self, cfg ) : self. model. fit _ cfg _ end _ event = cfg. endevent def show _ shutdown ( evt ) : gevent. wait ( [ evt ] ) if evt. is _ set ( ) : self. _ monitor _ shutdown ( ) grn = gevent. spawn ( show _ shutdown, self. model. fit _ cfg _ end _ event ) grn. name = " console - registerconfig - { } ... | [
-0.16830097138881683,
0.5102096199989319,
0.564277172088623,
0.5795934796333313,
0.4335104525089264,
-0.2011023759841919,
0.9553598761558533,
0.034372955560684204,
-0.6859316825866699,
-0.022596554830670357,
-0.7778405547142029,
0.3678393065929413,
-0.31044310331344604,
1.3115811347961426,... |
def bubble _ sort ( items ) : sorted = false # is the array sorted last = len ( items ) - 1 # last item sorted is always at the end # dont break until the array is sorted while not sorted : sorted = true # for each item in the array for i in range ( last ) : # bitwise calculation # greater ( ) if items [ i ] > items [ ... | [
-0.8846290707588196,
0.03143543377518654,
0.9746728539466858,
0.5558729767799377,
-0.21294954419136047,
0.7874578833580017,
-0.10163246095180511,
-0.4855889081954956,
0.48501265048980713,
0.014271662570536137,
-0.6716574430465698,
-0.04930597543716431,
-1.1164557933807373,
0.58853036165237... |
def get _ struct ( self ) : return pymatgen. structure. from _ dict ( self. struct _ dict ) | [
0.2302607148885727,
-0.4614710807800293,
0.06060649827122688,
-0.5106228590011597,
0.06756226718425751,
0.09140686690807343,
-0.11843246221542358,
-0.20485088229179382,
0.5724606513977051,
-1.2946629524230957,
0.032515063881874084,
-0.26463744044303894,
0.1394077092409134,
-0.5910586118698... |
def main ( ) : numbers = [ - 7, 2, 5, 8, - 1, 90, - 2, - 33, 0, 12 ] # task : create a list of all positive numbers # list comprehension positives = [ num for num in numbers if num > = 0 ] print ( positives ) # generator positives = list ( ( num for num in numbers if num > = 0 ) ) print ( positives ) # filter ( ) and l... | [
0.4435138404369354,
0.31914588809013367,
0.9849400520324707,
0.4054390490055084,
0.3210928440093994,
0.0351061187684536,
0.2571033835411072,
0.6274253129959106,
0.07536785304546356,
-0.0027776106726378202,
0.048169173300266266,
-0.303981214761734,
0.23955799639225006,
0.3997373580932617,
... |
def getrenderedpage ( handler, templatevalues ) : # get an environment for the html blocks jinjaenv = getjinjaenv ( os. path. join ( rh. rootdir,'html / templates') ) # get the current user currentuser = uau. getloggedinuser ( handler ) # render the buttons _ top tempvals = {'user':'guest ','logged _ in': false } if'lo... | [
-0.6556274890899658,
-0.01440621167421341,
0.7980139255523682,
0.33094522356987,
-0.37420520186424255,
0.7043979167938232,
-0.2145330309867859,
0.01363943051546812,
-0.44859957695007324,
-0.30892884731292725,
0.04253135249018669,
-0.41275039315223694,
-0.03847119212150574,
0.93978023529052... |
def _ _ setattr _ _ ( self, name, value ) : if name. startswith ('_') and name! ='_ content': self. _ _ dict _ _ [ name ] = value return if self. _ readonly : raise readonlyerror, read _ only _ message node = self. _ findbyid ( self. _ tree, name ) if hasattr ( value,'_ tree') and value. _ tree is node : return # x. y ... | [
-0.5091010332107544,
-0.15994058549404144,
0.6977114081382751,
-0.9385153651237488,
-1.147078275680542,
-0.25157690048217773,
0.32095423340797424,
-0.7664822340011597,
-0.09893026202917099,
0.7583240270614624,
-0.23047076165676117,
0.33387380838394165,
0.4451884627342224,
0.811706781387329... |
def submit ( url, gremlin, bindings = none, lang = " gremlin - groovy ", aliases = none, op = " eval ", processor = " ", timeout = none, session = none, loop = none, username = " ", password = " ", future _ class = none, connector = none ) : loop = loop or asyncio. get _ event _ loop ( ) graph = graphdatabase ( url, ti... | [
-0.9996854066848755,
0.7564874291419983,
0.746044397354126,
0.21253494918346405,
-0.3972254693508148,
-0.9535525441169739,
-0.16337551176548004,
0.18273450434207916,
-0.15366435050964355,
0.7752977013587952,
-0.26063045859336853,
0.5519781708717346,
-0.6287151575088501,
-0.1773079633712768... |
def magnitude _ response ( self ) : return magnitude _ response ( self. data, self. fs ) | [
-0.07393109053373337,
-1.7143462896347046,
0.10137207806110382,
-0.5696430802345276,
-0.7082058191299438,
-0.4340822994709015,
-0.7262558937072754,
-0.22328633069992065,
0.9666038155555725,
-0.6327627897262573,
0.3170010447502136,
-0.34461602568626404,
-0.08533542603254318,
-0.005914075765... |
def write ( self, handle ) : handle. write ( self. asbed ( ) + " \ n " ) | [
-0.1456507444381714,
-0.11146035045385361,
0.3859342038631439,
0.5122025609016418,
0.9644736647605896,
1.399662971496582,
0.22449862957000732,
-0.598257839679718,
-0.7295201420783997,
-1.3878263235092163,
-0.3800434172153473,
0.005427984520792961,
-0.6517791152000427,
0.7664220929145813,
... |
def _ _ getitem _ _ ( self, key ) : item = self. client. lindex ( self. key, key ) if item is none : raise indexerror ( " index out of range. " ) return self. observe ( self. client. decode ( item ), key ) | [
0.6476364135742188,
0.2778959274291992,
0.4885410666465759,
-0.5253074169158936,
-0.3334193527698517,
-0.539175271987915,
-0.8183237314224243,
-1.2218759059906006,
-0.1228514015674591,
-0.38586676120758057,
0.04779038950800896,
0.8678562045097351,
-0.45076659321784973,
-1.26045560836792,
... |
def required _ questions _ answered ( app, type ) : types = ['all ', type ] q _ ids = set ( q. id for q in required _ questions if q. type in types ) for answer in app. answer _ set. all ( ) : if answer. answer : # " " is not an answer try : q _ ids. remove ( answer. question _ id ) except keyerror : pass return len ( ... | [
-0.30239686369895935,
-1.01319420337677,
0.5449708700180054,
0.05446873605251312,
-0.3019809126853943,
0.7510991096496582,
-0.6585662961006165,
-0.46167996525764465,
0.19869856536388397,
0.7941555976867676,
0.3082009553909302,
0.22176800668239594,
-0.20622628927230835,
0.8196684122085571,
... |
def import _ fasta ( file _ name ) : file = open ( file _ name ) out = [ ] for num, line in enumerate ( file, 1 ) : if line [ 0 ]! ='>': out. append ( line. rstrip ('\ n') ) assert ( len ( out ) = = 2 ) return out | [
0.2920439839363098,
-0.731186032295227,
0.722277045249939,
1.080824613571167,
0.06349609047174454,
-0.10243357717990875,
0.4274749755859375,
0.6216514706611633,
-0.3245452642440796,
0.5798317790031433,
-0.6990020275115967,
0.26791098713874817,
0.35136839747428894,
0.4794797897338867,
-0.... |
def process _ saved _ data ( dat ) : dat2 = [ ] for rec in dat [ " data " ] : if rec [ " pos " ] = = 0 : # we have reached the first empty register position break # bcd decoding for key in [ " year ", " weekday ", " month ", " day ", " hour ", " minute ", " second " ] : rec [ key ] = bcd2int ( rec [ key ] ) stat0 = dec... | [
-0.06927060335874557,
-0.7091774940490723,
0.6464762091636658,
-1.2574001550674438,
-0.17187920212745667,
-0.610573947429657,
-0.2513643801212311,
0.29469266533851624,
-0.07678918540477753,
-0.3134268820285797,
-0.49241143465042114,
0.24456851184368134,
0.18233604729175568,
0.4371224939823... |
def put _ nowait ( self, item ) : self. put ( item ) | [
-0.37750163674354553,
0.20747603476047516,
0.30718496441841125,
-0.9988231658935547,
0.4618445932865143,
1.3296900987625122,
0.37510809302330017,
-0.6128515601158142,
-0.07713740319013596,
0.2195003628730774,
-1.4369300603866577,
-0.6317654848098755,
-0.8349572420120239,
-0.501450002193450... |
def enzyme ( ) : allowed _ str _ args = ['hgnc _ symbol ','ec _ number'] allowed _ int _ args = ['limit ','hgnc _ identifier'] args = get _ args ( request _ args = request. args, allowed _ int _ args = allowed _ int _ args, allowed _ str _ args = allowed _ str _ args ) return jsonify ( query. enzyme ( * * args ) ) | [
-1.1038451194763184,
0.07087016105651855,
0.5427573919296265,
-0.5750085115432739,
0.11789141595363617,
-0.9436350464820862,
-0.4092687964439392,
0.11867028474807739,
-1.2572505474090576,
0.3969530761241913,
0.3953389525413513,
0.32342198491096497,
-0.6939473152160645,
-0.21219225227832794... |
def to _ dict ( self ) : new _ dict = self. _ _ dict _ _. copy ( ) new _ dict [ " _ _ class _ _ " ] = type ( self ). _ _ name _ _ new _ dict [ " created _ at " ] = self. created _ at. isoformat ( ) new _ dict [ " updated _ at " ] = self. updated _ at. isoformat ( ) return new _ dict | [
-1.2175153493881226,
-1.0557490587234497,
0.7902526259422302,
-0.8591955304145813,
-0.6040270924568176,
0.7325577735900879,
-0.5164952278137207,
-0.5187729001045227,
-0.2858338952064514,
0.2821826636791229,
-0.543019711971283,
0.6884058117866516,
0.7492045164108276,
0.7822805047035217,
0... |
def list _ files ( self, prefix, flat = false ) : layer _ path = self. get _ path _ to _ file ( " " ) path = os. path. join ( layer _ path, prefix ) @ retry def s3lst ( continuation _ token = none ) : kwargs = {'bucket': self. _ path. bucket,'prefix': path, } if continuation _ token : kwargs ['continuationtoken'] = con... | [
-0.3122311532497406,
-0.40510648488998413,
0.8717557787895203,
-0.5838868618011475,
-0.18278768658638,
-0.1961272656917572,
-0.34729111194610596,
0.2541511654853821,
0.17792317271232605,
0.1525154560804367,
-0.5344325304031372,
0.6203057169914246,
0.09032910317182541,
-0.1585012823343277,
... |
def process _ file ( pgn, duration, output _ dir, reverse ) : basename = os. path. basename ( pgn ) name = basename [ : - 4 ] + '. gif'if name in os. listdir ( '.') : print ( " gif with name % s already exists. " % name ) else : print ('creating'+ name, end = '....') create _ gif ( pgn, name, duration, output _ dir, re... | [
0.24138452112674713,
0.267494261264801,
0.7091524600982666,
0.27270567417144775,
1.1181721687316895,
0.11607522517442703,
0.4897339940071106,
-0.29387593269348145,
-1.5313785076141357,
0.7193580269813538,
-0.23410962522029877,
0.2971855401992798,
-0.4063709080219269,
0.060906555503606796,
... |
def get _ files ( folder, extension ) : all _ files = [ f for f in os. listdir ( folder ) if os. path. isfile ( os. path. join ( folder, f ) ) ] filtered _ files = [ f for f in all _ files if f. split ( '.') [ 1 ] = = extension ] return filtered _ files | [
0.5596035122871399,
-0.21135985851287842,
0.9486299753189087,
1.0119028091430664,
-0.774187445640564,
-0.31767359375953674,
-0.879623532295227,
0.5553857684135437,
-0.658816397190094,
1.1666746139526367,
-0.1781960278749466,
1.0665162801742554,
-0.6039868593215942,
0.07035590708255768,
-... |
def children ( self, node ) : if not isinstance ( node, ( cl. variable, cl. top, cl. bot ) ) : return [ succ for succ in node. succ ] else : return none | [
0.2357833832502365,
0.3686106204986572,
0.499318927526474,
0.9987764954566956,
-0.8050834536552429,
0.6360145211219788,
-0.2183280736207962,
-0.7620172500610352,
-0.13999055325984955,
-0.8474838137626648,
-0.6035516858100891,
0.416593998670578,
-0.07328856736421585,
0.6562283039093018,
-... |
def get _ project ( self, project ) : url = self. get _ url ( " projects ", project ) return self. get _ resource ( url ) | [
-0.6704657077789307,
0.9733708500862122,
-0.013477315194904804,
0.6025617122650146,
0.46616920828819275,
-0.7801386117935181,
-0.7155486941337585,
-0.27316591143608093,
0.6682297587394714,
-0.0727306604385376,
0.9382937550544739,
0.20312602818012238,
-1.1071183681488037,
-0.454360485076904... |
def version _ between ( min _ version, max _ version, candidate ) : if not candidate : raise valueerror ( " candidate is required. " ) candidate = normalize _ version _ number ( candidate ) # normalize up front to validate any malformed inputs if min _ version : min _ version = normalize _ version _ number ( min _ vers... | [
-0.3629128336906433,
-1.5841915607452393,
0.5956025719642639,
0.41910117864608765,
-0.887718915939331,
1.139447569847107,
-0.9054682850837708,
0.331684947013855,
-0.5963457822799683,
0.3026474118232727,
-0.6243813633918762,
0.6589164733886719,
-0.45240989327430725,
-0.7783626317977905,
-... |
async def test _ subscribe _ unsubscribe _ logbook _ stream _ entities ( recorder _ mock : recorder, hass : homeassistant, hass _ ws _ client : websocketgenerator ) - > none : now = dt _ util. utcnow ( ) await asyncio. gather ( * [ async _ setup _ component ( hass, comp, { } ) for comp in ( " homeassistant ", " logbook... | [
0.2821519374847412,
0.014476736076176167,
0.9740059971809387,
0.10581980645656586,
0.6855661273002625,
-0.2002866566181183,
-0.3006671369075775,
-0.40573951601982117,
-0.5614058971405029,
-0.2528770864009857,
-0.5153408646583557,
0.7411785125732422,
0.13154885172843933,
0.8303439021110535,... |
def do _ attributes ( part, start, end ) : by _ start = defaultdict ( list ) # for o in part. iter _ all ( score. divisions, start, end ) : # by _ start [ o. start. t ]. append ( o ) for t, quarter in part. quarter _ durations ( start. t, end. t ) : by _ start [ t ]. append ( int ( quarter ) ) for o in part. iter _ all... | [
-0.02262694761157036,
0.03297518566250801,
0.8951773047447205,
-0.4307921230792999,
-0.3659784197807312,
0.17062386870384216,
0.8144099116325378,
-0.3694702684879303,
-0.3763584494590759,
0.8063879609107971,
0.2746303677558899,
-0.3663046956062317,
0.5277661085128784,
0.8465166091918945,
... |
def check _ test _ data ( test _ case, test _ data, expected _ match, expected _ gremlin, expected _ sql ) : if test _ data. type _ equivalence _ hints : # for test convenience, we accept the type equivalence hints in string form. # here, we convert them to the required graphql types. schema _ based _ type _ equivalenc... | [
-0.0007895226590335369,
0.14450578391551971,
0.7275396585464478,
0.11081746965646744,
1.1018949747085571,
0.3696019649505615,
0.6662391424179077,
-0.42728182673454285,
-0.2978633940219879,
0.6387837529182434,
0.14993390440940857,
0.6963244676589966,
-0.6801069378852844,
-0.1970400810241699... |
def versioned _ data _ for ( self, url = none, min _ version = none, max _ version = none, * * kwargs ) : min _ version, max _ version = _ normalize _ version _ args ( none, min _ version, max _ version ) no _ version = not max _ version and not min _ version version _ data = self. version _ data ( reverse = true, * * ... | [
-0.33848443627357483,
-0.6710653901100159,
0.6299053430557251,
0.5234567523002625,
-0.08234552294015884,
0.02547898143529892,
-0.9287220239639282,
-0.33438751101493835,
-0.5341554880142212,
-0.3692479431629181,
0.06939604133367538,
0.6807978749275208,
-0.1860082447528839,
-0.26703524589538... |
def producemovablequery ( self ) : return parse _ input ('fact : ( movable? disk? init? target )') | [
0.11510185897350311,
-0.3721410036087036,
0.2866670787334442,
0.6982919573783875,
-0.4235474765300751,
0.30215492844581604,
-0.07736969739198685,
-0.35686972737312317,
-0.7155632376670837,
-0.7957390546798706,
1.040584683418274,
0.15083763003349304,
-0.5625967383384705,
-0.5272508263587952... |
def _ _ init _ _ ( self, name, commname, cs, competitive, activation, rct ) : self. name = name self. commname = commname self. cs = cs self. competitive = competitive #'c'for competitive,'n'for noncompetitive and'a'for allosteric self. activation = activation # can have the values true, false or none self. rct = rct #... | [
0.7249140739440918,
-0.7403891682624817,
0.3492659330368042,
0.24811163544654846,
0.6010985970497131,
-0.07948976010084152,
-0.3508148193359375,
0.021291112527251244,
0.37917590141296387,
-0.3011181056499481,
-1.1430586576461792,
-0.04013551399111748,
-0.3043556809425354,
0.258106827735900... |
def unique _ id ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " unique _ id " ) | [
1.1572059392929077,
0.15136991441249847,
0.36646220088005066,
0.19990003108978271,
1.0924744606018066,
1.1843006610870361,
0.3398265838623047,
0.5405955910682678,
1.4402779340744019,
-0.2620668113231659,
0.2965354025363922,
1.4079234600067139,
-0.15550275146961212,
-1.4338980913162231,
-... |
def group _ metrics ( metrics : list [ metrictype ] ) - > dict [ str, list [ metrictype ] ] : return { " all " : metrics } | [
-0.1618693619966507,
0.5820711255073547,
0.2101983278989792,
0.12940162420272827,
-0.34091562032699585,
0.48620009422302246,
0.43705376982688904,
-0.11607492715120316,
-0.36043277382850647,
0.3427559733390808,
0.2889258563518524,
0.4452883303165436,
0.0016250672051683068,
0.989528536796569... |
def create _ synthetic _ workload ( output _ path, extension = " ", regenerate = false, logger = logging. getlogger ( _ _ name _ _ ) ) : if not regenerate : logger. warn ( " skipping the generation of synthetic traces, " " since they are already pre - generated " ) logger. warn ( " pass regenerate = true to create new ... | [
0.3325084447860718,
0.5303168296813965,
0.7002193331718445,
0.902786910533905,
-0.318143367767334,
0.05228672921657562,
0.3865378797054291,
-0.7172612547874451,
-0.21571096777915955,
0.5886642336845398,
-0.6796017289161682,
-0.3805854022502899,
-0.5713942646980286,
0.3552367091178894,
-0... |
def generate _ data _ frame ( self, node ) : self. app. set _ data _ management _ widget ( view _ only = true, item _ data = node. item _ data ) | [
-0.07757362723350525,
1.0505449771881104,
0.16200920939445496,
-0.4729449152946472,
0.6369176506996155,
0.3804531395435333,
-0.026907017454504967,
1.0603668689727783,
-0.12695686519145966,
-1.1799694299697876,
-0.4337335526943207,
1.2394083738327026,
1.3033055067062378,
0.5634037852287292,... |
def _ _ init _ _ ( self, username = common. get _ current _ user ( ), server = " localhost ", sync _ port = 4501, async _ port = 4500, verbose _ level = loggerapi. verbose _ quiet, logger = none, virtual = false ) : self. username = username # init objects self. ports = { } self. server _ version = { } self. system _ i... | [
0.40994343161582947,
-0.008367069996893406,
0.8406099677085876,
-0.17847906053066254,
0.09353328496217728,
0.2027735859155655,
1.2217158079147339,
-0.44983893632888794,
-0.5037020444869995,
-0.10370130836963654,
-0.8031975030899048,
0.2750028669834137,
-0.6290245652198792,
0.27159762382507... |
def test _ tsql _ assignment _ operator ( dialect : str ) : sql = " " " insert into foo select firstcolumnheading ='xyz ', secondcolumnheading = productid from production. product " " " assert _ column _ lineage _ equal ( sql, [ ( columnqualifiertuple ( " productid ", " production. product " ), columnqualifiertuple ( "... | [
-0.1727519929409027,
-0.2255818396806717,
0.37598559260368347,
0.03327053785324097,
-0.23723061382770538,
0.17636533081531525,
-0.1832723170518875,
0.4642047584056854,
-0.696774959564209,
0.8893303871154785,
-0.7997127771377563,
-0.3477306067943573,
0.5474170446395874,
-0.34796205163002014... |
def add ( self, card ) : self. cards. append ( card ) | [
-0.7995613813400269,
-0.10602670907974243,
0.186562180519104,
-0.5522255897521973,
0.8112101554870605,
1.0481081008911133,
-1.2576475143432617,
0.6324520111083984,
0.7538213133811951,
-0.7631750106811523,
-0.08997277915477753,
0.679291307926178,
-0.009344658814370632,
0.8066788911819458,
... |
def bounce ( self ) : self. bounced = true self. save ( ) self. person. on _ bounce ( self ) | [
0.7984707355499268,
-0.6436625719070435,
0.3802030384540558,
0.6666514873504639,
0.38455915451049805,
1.0818579196929932,
-0.29879918694496155,
0.2387300282716751,
0.21830493211746216,
-0.5483717322349548,
-1.7633198499679565,
-0.6447156667709351,
-0.23806731402873993,
0.8775922060012817,
... |
def _ get _ cutout _ wcs _ dict ( self ) : wcs _ header = self. cutout _ wcs. to _ header ( ) cutout _ wcs _ dict = dict ( ) # # cutout array keywords # # cutout _ wcs _ dict [ " wcax { } " ] = [ wcs _ header ['wcsaxes'], " number of wcs axes " ] # todo : check for 2? this must be two cutout _ wcs _ dict [ " 1ctyp { } ... | [
-0.25473424792289734,
-0.8371126651763916,
0.5386412739753723,
-1.1944650411605835,
-1.4471142292022705,
-0.197597935795784,
0.05898400396108627,
-0.74085932970047,
-0.4282147288322449,
0.5771305561065674,
-0.26069220900535583,
0.4783596098423004,
0.008542133495211601,
0.7679599523544312,
... |
def get ( operator ) - > operator : return operator ( operator ) | [
-0.7419053316116333,
0.059590909630060196,
0.11049354076385498,
0.08012150228023529,
-0.9066485166549683,
-1.1638444662094116,
-0.6691290736198425,
-0.11615511029958725,
0.326730877161026,
-1.1655205488204956,
-0.486736923456192,
0.47578325867652893,
0.44654056429862976,
-1.276868820190429... |
def _ get _ action _ from _ name ( self, name ) : container = self. _ actions if name is none : return none for action in container : if'/ '. join ( action. option _ strings ) = = name : return action elif action. metavar = = name : return action elif action. dest = = name : return action | [
-0.38145217299461365,
-1.0997841358184814,
0.6158453226089478,
0.37081074714660645,
-0.0927586629986763,
-0.6582719683647156,
0.24925297498703003,
-1.202409029006958,
0.3270026743412018,
0.6561283469200134,
0.47696420550346375,
0.5052202939987183,
0.00034980083000846207,
-0.345443397760391... |
async def test _ get _ events _ invalid _ filters ( recorder _ mock : recorder, hass : homeassistant, hass _ ws _ client : websocketgenerator ) - > none : await async _ setup _ component ( hass, " logbook ", { } ) await async _ recorder _ block _ till _ done ( hass ) client = await hass _ ws _ client ( ) await client. ... | [
-0.17085501551628113,
0.5053731799125671,
0.8306006789207458,
0.26119962334632874,
0.590219259262085,
-0.1204952746629715,
-0.1987074911594391,
-0.3445713222026825,
0.06301563233137131,
-0.4420435428619385,
0.17262879014015198,
1.1175404787063599,
0.12397012114524841,
0.3628217875957489,
... |
def get _ location ( address ) : try : location = google _ maps. search ( location = address ) # sends search to google maps. my _ location = location. first ( ) # returns only first location. return my _ location. lat, my _ location. lng except : print " not a valid address. " return 0, 0 | [
-0.9796583652496338,
-0.5214583277702332,
0.633155882358551,
0.12298059463500977,
-0.05396680533885956,
-0.17563128471374512,
-0.0392741896212101,
0.6022331714630127,
0.7597589492797852,
0.27885401248931885,
0.4365781545639038,
0.5406969785690308,
-0.28152361512184143,
0.41714349389076233,... |
def deposit _ withdrawal _ movements ( key, secret _ key, * * params ) : endpoint ='history / movements'return request ( authenticate = true, key = key, secret _ key = secret _ key, version = 1, endpoint = endpoint, method ='post ', body _ params = params ) | [
-1.2455321550369263,
1.1207270622253418,
0.6944735646247864,
0.5323956608772278,
0.8291690349578857,
-0.11995421350002289,
0.029972214251756668,
0.03959251940250397,
-0.1882847249507904,
0.5726902484893799,
-0.5542600154876709,
1.1190637350082397,
-0.35778599977493286,
0.45997297763824463,... |
def read _ fifo ( self ) : red _ led = none ir _ led = none # read 1 byte from registers ( values are discarded ) reg _ intr1 = self. bus. read _ i2c _ block _ data ( self. address, reg _ intr _ status _ 1, 1 ) reg _ intr2 = self. bus. read _ i2c _ block _ data ( self. address, reg _ intr _ status _ 2, 1 ) # read 6 - b... | [
-0.07593058049678802,
-0.268419086933136,
0.6841973066329956,
-0.11920352280139923,
0.019173869863152504,
-0.2712258994579315,
0.16873079538345337,
0.2354646623134613,
-0.002940770238637924,
0.10494010895490646,
-0.5792393088340759,
0.8004142642021179,
-0.9108112454414368,
0.71588754653930... |
def _ _ init _ _ ( self, parent = none, model = none, _ id = none ) : super ( ). _ _ init _ _ ( parent, model, _ id ) self. setupui ( self ) self. setwindowicon ( qtgui. qicon ( icons ('64x64') ) ) # dock windows [ wms ] : self. cbtools. clear ( ) self. cbtools. additems ( [ " ( select to open control ) ", " vertical s... | [
0.33618462085723877,
0.6978869438171387,
0.8313655257225037,
0.39030542969703674,
-0.3727928400039673,
0.40908247232437134,
1.075413465499878,
-1.1207340955734253,
-0.9008781909942627,
-0.396198034286499,
-0.796609103679657,
-0.35853999853134155,
0.2999705672264099,
1.1472450494766235,
0... |
def pickle ( self, filename = none ) : if filename is not none : cpickle. dump ( self, open ( filename, " wb " ) ) elif self. filename is not none : cpickle. dump ( self, gzip. open ( self. filename + ". pickle. gz ", " wb " ) ) else : log. warn ( " toa pickle method needs a filename. " ) | [
0.3688246011734009,
-0.25634902715682983,
0.5876373052597046,
0.1588403433561325,
0.7380489110946655,
-0.23196756839752197,
0.9228923916816711,
0.6892268657684326,
-0.14682099223136902,
0.1474728286266327,
0.8705503344535828,
-0.5655040144920349,
-0.2708404064178467,
-0.10656283795833588,
... |
def convert _ utc _ str _ to _ nite _ old ( datestr ) : import pytz import datetime from dateutil. parser import parse from dateutil import tz # e. g. datestr : 2014 - 08 - 15t17 : 31 : 02. 416533 + 00 : 00 nite = none # convert date string to datetime object utc _ dt = parse ( datestr ) # convert utc to local on mount... | [
0.39990630745887756,
-1.0737310647964478,
0.746504545211792,
-0.3237958252429962,
-0.4566127359867096,
0.0002784022653941065,
-0.27192845940589905,
-0.6824999451637268,
0.3035394549369812,
-0.11776359379291534,
-0.07597893476486206,
0.03667986020445824,
0.2289753407239914,
0.08962654322385... |
def valid _ to _ date ( self, valid _ to _ date ) : self. _ valid _ to _ date = valid _ to _ date | [
-0.0650860071182251,
-0.3004287779331207,
0.5970983505249023,
-0.5304768085479736,
-0.20235612988471985,
0.9529121518135071,
0.15481284260749817,
0.5199207663536072,
-0.91084885597229,
-0.4249304234981537,
-0.4207604229450226,
-0.5485953092575073,
0.4318426251411438,
-0.31913837790489197,
... |
def get _ income _ distribution ( xml = countries ) : distributions = defaultdict ( list ) root = et. parse ( xml ). getroot ( ) for country in root : income = country. find ('{ http : / / www. worldbank. org } incomelevel'). text name = country. find ('{ http : / / www. worldbank. org } name'). text distributions [ in... | [
-0.3178231120109558,
-0.6828972697257996,
0.45842769742012024,
-0.39547303318977356,
-0.713242769241333,
0.7162894606590271,
-0.04170148819684982,
0.2702666223049164,
-0.224202498793602,
0.7006634473800659,
-0.4307865500450134,
-0.998211681842804,
-0.26173633337020874,
0.7345563769340515,
... |
def history _ backward ( self, count = 1 ) : self. _ set _ history _ search ( ) # go back in history. found _ something = false for i in range ( self. working _ index - 1, - 1, - 1 ) : if self. _ history _ matches ( i ) : self. working _ index = i count - = 1 found _ something = true if count = = 0 : break # if we move... | [
-0.4077102541923523,
0.24710315465927124,
0.6989158987998962,
0.013125468976795673,
1.1482280492782593,
-0.5869448184967041,
1.2512538433074951,
0.021993793547153473,
-0.8818864822387695,
-0.13584500551223755,
0.3412926495075226,
0.519149124622345,
-0.9135727286338806,
0.15108880400657654,... |
def decode _ label ( serialized _ example ) : features = tf. io. parse _ single _ example ( serialized _ example, features = { " label " : tf. io. fixedlenfeature ( [ ], tf. int64 ) }, ) label = tf. cast ( features [ " label " ], tf. int32 ) return label | [
-0.17065444588661194,
-0.49631717801094055,
0.25664111971855164,
-0.37729522585868835,
-0.12007605284452438,
0.5242531299591064,
-0.16039614379405975,
0.5894119739532471,
0.7037798166275024,
0.23562967777252197,
-0.8607912659645081,
0.20941774547100067,
-0.043062724173069,
-1.3306587934494... |
def gen ( self, n = 0 ) : if n : raise indexerror ( " only one generator " ) return self. _ cache. _ gen | [
-1.6438112258911133,
1.456316590309143,
0.4005582928657532,
0.6621227860450745,
-0.028769785538315773,
0.3424661159515381,
0.4893420338630676,
-0.04919086769223213,
-0.5302048921585083,
-1.1875561475753784,
0.019450947642326355,
-0.3847198784351349,
-0.3348976969718933,
0.48275667428970337... |
def download _ to _ filename ( self, filename : text ) : shutil. copyfile ( os. path. join ( self. dir, self. name ), filename ) | [
0.12471022456884384,
-1.20267915725708,
0.5433655977249146,
-0.001725603942759335,
0.0448298454284668,
0.7400023341178894,
0.6498229503631592,
0.1583813726902008,
-0.4897633492946625,
0.2979097068309784,
-0.057013947516679764,
0.3212912678718567,
0.618174135684967,
-0.26480844616889954,
... |
def sort _ structure ( self, structure ) : def _ cmp ( arg1, arg2 ) : arg1 = arg1 [ 1 ] [ " title " ] if " title " in arg1 [ 1 ] else arg1 [ 0 ] arg2 = arg2 [ 1 ] [ " title " ] if " title " in arg2 [ 1 ] else arg2 [ 0 ] # cmp not exists in py3 # via < https : / / docs. python. org / 3. 0 / whatsnew / 3. 0. html # order... | [
-0.5427283644676208,
-0.3662545382976532,
0.816452145576477,
-0.05521685630083084,
-0.7869350910186768,
0.3351558744907379,
-0.18766960501670837,
-1.1169453859329224,
0.03482663631439209,
0.10433389246463776,
-0.25391414761543274,
-0.16930566728115082,
-0.7625353336334229,
0.19908353686332... |
def check _ config _ paths ( self, config ) : for style in self. config ['alternate _ styles'] or \ self. config ['persistent _ styles'] or \ self. config ['preferred _ styles'] : if'path'not in style or not style ['path'] or \ style ['path'] is none : raise valueerror ('all stylesheets must have \ a \'path \'attribute... | [
-0.15595264732837677,
-0.2733480632305145,
0.3154866695404053,
0.44326508045196533,
0.3514750003814697,
1.1524419784545898,
0.47884660959243774,
0.6651960611343384,
-0.6281424760818481,
0.5334295630455017,
0.48631155490875244,
-0.9993880987167358,
0.12490330636501312,
1.2702652215957642,
... |
def preparenode ( self, nodename ) : pass | [
-1.1768901348114014,
0.06450169533491135,
0.30611905455589294,
-0.52364581823349,
0.10611894726753235,
-0.16991932690143585,
-0.09928679466247559,
0.5109202265739441,
0.5859003663063049,
0.13097716867923737,
-0.3928202688694,
0.34039223194122314,
0.14153243601322174,
0.16594994068145752,
... |
def slice _ all _ packets ( signal : np. array, endpoint _ list : ty. list [ ty. tuple [ int, int ] ] ) - > np. ndarray : max _ length = max ( stop - start for start, stop in endpoint _ list ) logger. debug ( f'got max packet length : { max _ length }') _ packets = np. vstack ( [ _ slice _ and _ pad ( signal, pair, max... | [
-0.4955415725708008,
0.3988911211490631,
0.3492269515991211,
1.0321266651153564,
0.07059226185083389,
-0.11672686040401459,
-0.5990583896636963,
0.11734741181135178,
0.5673114061355591,
0.9500476121902466,
-0.6261416673660278,
-0.02185940369963646,
-0.017936941236257553,
0.2773185074329376... |
def history _ forward ( self, count = 1 ) : self. _ set _ history _ search ( ) # go forward in history. found _ something = false for i in range ( self. working _ index + 1, len ( self. _ working _ lines ) ) : if self. _ history _ matches ( i ) : self. working _ index = i count - = 1 found _ something = true if count =... | [
0.03450630232691765,
0.5305150151252747,
0.5512881875038147,
-0.2097325623035431,
0.9014158248901367,
-0.16430996358394623,
0.9982973337173462,
0.30001547932624817,
-0.9415003061294556,
-0.5634649395942688,
0.4684002995491028,
0.25453442335128784,
-0.09026052802801132,
0.4544356167316437,
... |
def is _ encrypted ( self ) : try : if ( self. dataheader. configuration _ field [ 0 ] & 0x0f! = 0 ) : return true except indexerror : pass return false | [
-0.30585619807243347,
0.5603882670402527,
0.4182227551937103,
0.10949808359146118,
0.6633555889129639,
-0.00428433483466506,
-0.10358146578073502,
-0.09459110349416733,
-0.11777524650096893,
0.23277676105499268,
-0.6078455448150635,
-0.13987092673778534,
-1.1233160495758057,
0.224282890558... |
def get _ commerce _ listings ( self, * ids ) : if not ids : ids = self. get _ commerce _ listings _ ids ( ) else : ids = ids [ 0 ] if isinstance ( ids, int ) : return self. _ request ( " commerce / listings ", ids = str ( ids ) ) elif len ( ids ) < = 200 : return self. _ request ( " commerce / listings ", ids = ', '. ... | [
-1.9318307638168335,
0.46432605385780334,
0.4664842188358307,
0.3074110746383667,
0.4704899489879608,
-1.151727557182312,
0.00234609586186707,
0.2003582864999771,
0.9304144978523254,
0.10133393853902817,
0.27210375666618347,
0.6445310115814209,
-0.6539615988731384,
0.13312850892543793,
-... |
def test _ delete _ recipe ( self ) : pass | [
0.637723445892334,
0.9321660995483398,
0.17185163497924805,
1.306762456893921,
0.15380756556987762,
-0.1911712884902954,
0.7778385281562805,
1.5743788480758667,
0.4051040709018707,
-0.9946290850639343,
0.02738291583955288,
-0.22533376514911652,
-0.8655548691749573,
0.4019525945186615,
-0... |
def invalid _ connector _ config _ path _ fixture ( inputs, base _ path ) - > path : return path ( base _ path ) / getattr ( inputs, " invalid _ config _ path " ) | [
-0.5751534700393677,
-0.9918746948242188,
0.40042832493782043,
0.44256213307380676,
-0.04169062525033951,
0.6407508254051208,
1.1775918006896973,
-0.03460421785712242,
-0.0643901601433754,
-0.6567038297653198,
0.8408515453338623,
-0.5635488033294678,
0.20966164767742157,
-0.042355086654424... |
def add _ plot _ decor ( self, plotable ) : plotable. register _ decor ( self ) self. plot _ decor _ d [ plotable. kind ] = plotable self. plot _ decor _ l. append ( plotable ) self. canvas. add ( plotable ) # set callbacks for tool tips if plotable. kind = ='plot _ bg': plotable. set _ callback ('pick - down ', self. ... | [
0.026591097936034203,
0.3404066562652588,
0.4764895439147949,
0.2074166089296341,
-0.21722690761089325,
-0.04276656359434128,
0.600488543510437,
-0.5991786122322083,
0.4827122688293457,
-0.1314575970172882,
-0.3192005753517151,
0.8201717138290405,
0.9836543798446655,
0.5556254386901855,
... |
def audit _ request _ file ( self, filename ) : return self. audit _ file ( filename, self. request ) | [
-0.9178410172462463,
-1.2505062818527222,
0.3294714391231537,
-0.20047026872634888,
-0.15857850015163422,
0.1659931242465973,
0.2767254412174225,
0.14286059141159058,
-0.5942246913909912,
-0.7135080695152283,
1.5779528617858887,
0.9087443947792053,
0.04071491211652756,
0.0705299973487854,
... |
def service _ get _ all _ by _ host ( context, host ) : return impl. service _ get _ all _ by _ host ( context, host ) | [
-0.38186758756637573,
0.4141891896724701,
0.42345285415649414,
1.099057912826538,
0.13393515348434448,
-0.32678914070129395,
-0.6815509796142578,
-0.3570888340473175,
-1.105000615119934,
-0.20177902281284332,
-0.07288092374801636,
0.8050769567489624,
-0.002080195117741823,
0.94011771678924... |
def test _ create _ user _ without _ email ( self ) : with self. assertraises ( valueerror ) : user. objects. create _ user ( * * newuser _ invalid ) | [
0.5017667412757874,
1.006603717803955,
-0.09755206853151321,
0.7881386876106262,
0.6837441325187683,
1.0586860179901123,
-0.30299338698387146,
0.22559845447540283,
-0.46948060393333435,
-0.30781233310699463,
-0.9823225736618042,
-0.6274757385253906,
-0.5439528226852417,
0.37843042612075806... |
def testchromeebuildinit ( self ) : ebuild = cros _ mark _ chrome _ as _ stable. chromeebuild ( self. sticky ) self. assertequal ( ebuild. chrome _ version, self. sticky _ version ) | [
0.8454979062080383,
-0.3619900047779083,
0.14359383285045624,
0.975969672203064,
1.7028778791427612,
1.516344666481018,
0.43248316645622253,
-0.22438181936740875,
-0.37359845638275146,
-0.048794668167829514,
-1.428770899772644,
0.5369471311569214,
-0.38610488176345825,
0.2298082709312439,
... |
def get ( self, domain, name, response _ key = true, * * kwargs ) : key = none if response _ key : key = " dns _ entry " return self. _ get ( " / os - floating - ip - dns / % s / entries / % s " % ( _ quote _ domain ( domain ), name ), " dns _ entry ", * * kwargs ) | [
0.08382844179868698,
0.9308093786239624,
0.4795086979866028,
0.4246845841407776,
0.12053778022527695,
-1.1747201681137085,
-0.410622239112854,
-1.4173588752746582,
0.06055909022688866,
-0.14604049921035767,
0.03588177263736725,
0.5630400776863098,
-0.39770612120628357,
0.04714242368936539,... |
def plot _ main _ effects ( main _ effects, ax, truncation _ pct = 0. 95, max _ slices = 5, rv ='z ', qoi = 0 ) : main _ effects = main _ effects [ :, qoi ] assert main _ effects. sum ( ) < = 1. + np. finfo ( float ). eps main _ effects _ sum = main _ effects. sum ( ) # sort main _ effects in descending order ii = np. ... | [
1.220887541770935,
0.2512986660003662,
0.8988509774208069,
-0.46747687458992004,
-1.6717461347579956,
0.2137582153081894,
0.8599807024002075,
0.0029440289363265038,
0.9488751888275146,
0.556685745716095,
0.7410148978233337,
-0.06080179661512375,
-0.5526344776153564,
-0.8732469081878662,
... |
def gettilelocations ( obsid, flags = [ ], fdir = ". " ) : f = fits. open ('{ 0 } / { 1 } _ metafits _ ppds. fits '. format ( fdir, obsid ) ) # names = f [ 1 ]. data ['antenna'] [ : : 2 ] east = f [ 1 ]. data ['east'] [ : : 2 ] north = f [ 1 ]. data ['north'] [ : : 2 ] height = f [ 1 ]. data ['height'] [ : : 2 ] # heig... | [
0.037189334630966187,
-0.25136321783065796,
0.6115671396255493,
-0.5952779054641724,
-0.9132062792778015,
0.5729866623878479,
0.2557491958141327,
0.05062268301844597,
-0.3168937861919403,
0.13857746124267578,
-0.3445875644683838,
0.7835918068885803,
-0.012128397822380066,
0.428351372480392... |
def prepare _ recording ( self ) : raise notimplementederror ( ) | [
-0.4668480455875397,
0.23763731122016907,
0.5984674096107483,
0.4454690217971802,
-0.3798431158065796,
0.7125061750411987,
0.21228837966918945,
0.0714304968714714,
0.5172814130783081,
0.29874569177627563,
-0.3565601408481598,
0.35540083050727844,
0.3570297956466675,
0.8248111009597778,
-... |
def put _ song ( song _ id ) : song = session. query ( song ). get ( song _ id ) filename = request. json. get ('filename') if not song : file = file ( filename = filename ). save ( ) song = song ( file _ id = file. id ). save ( ) else : song. file. filename = filename song. save ( ) return response ( json. dumps ( son... | [
-0.6671353578567505,
-0.7753171920776367,
0.570702314376831,
-0.1757943034172058,
0.48907458782196045,
0.2421857714653015,
-0.21576420962810516,
0.8053812384605408,
0.09805477410554886,
0.5682181715965271,
-0.5611774921417236,
-0.10876352339982986,
-0.4566677212715149,
-0.24019572138786316... |
def getlandlordbranch ( self, addr : addresstype, n : int = none ) - > typing. generator [ landlordcoortype, none, none ] : if ( n is not none ) and ( ( not isinstance ( n, int ) ) or ( n < = 0 ) ) : raise typeerror ( ) # initiate @ co with dummy values : layer = ( - 1 ), address = @ addr co = landlordconverter. landlo... | [
0.049025095999240875,
0.45517992973327637,
0.7302799224853516,
0.10651476681232452,
-0.15329952538013458,
0.012735901400446892,
-0.0118127865716815,
-0.6967926621437073,
0.39977747201919556,
-0.8089737892150879,
-0.06223220005631447,
0.3489309847354889,
-0.7488453388214111,
0.8580207228660... |
def create _ credentials ( self, service _ account _ json _ filename ) : # check if provided string contains the phrase '. json'assert '. json'in service _ account _ json _ filename,'ensure that your service account filename is a json file.'# create credenntials used to access google services. credentials = serviceacco... | [
-0.35690316557884216,
-1.0752842426300049,
0.26583296060562134,
-0.32637709379196167,
-0.4790678322315216,
0.7035460472106934,
0.4143022894859314,
-0.5950256586074829,
-0.3764154613018036,
0.2040853351354599,
-0.3938431441783905,
0.7413187623023987,
0.05114825814962387,
0.1349380910396576,... |
def _ create _ html _ table ( self, style ) : # set table id if style : style ='style = " { 0 } " '. format ( style ) html _ table = ('< table id = " table _ { 0 } " class = " display table text - center " { 1 } > '. format ( self. html _ id, style ) ) # create table's header th ='< th > { 0 } < / th >'if self. index i... | [
-0.46690860390663147,
0.3214612603187561,
0.4948072135448456,
0.28943073749542236,
-0.03651256859302521,
-0.0480489507317543,
-0.3596099019050598,
-0.5935351252555847,
-0.6695166230201721,
0.16440725326538086,
0.7703784704208374,
0.10879829525947571,
0.01577538065612316,
0.1314789354801178... |
def test _ instanciation _ of _ object _ matrix ( self ) : self. assertraises ( nonmatrixerror, matrix,'a') self. assertraises ( nonmatrixerror, matrix, [ 1, 2 ] ) self. assertraises ( nonmatrixerror, matrix, [ [ 1 ], [ 4, 3 ] ] ) self. assertraises ( nonnumericerror, matrix, [ [ 1,'a'], [ 4, 3 ] ] ) self. assertequals... | [
-0.7446770071983337,
-0.3482024371623993,
0.3496822118759155,
0.03637772798538208,
-0.018388420343399048,
0.43687373399734497,
0.7820727229118347,
0.25999534130096436,
0.37201163172721863,
-0.49895548820495605,
-0.5341158509254456,
0.05491876229643822,
0.15200090408325195,
0.68853288888931... |
def _ sample ( self ) : ind = np. random. randint ( len ( self. dist ) ) q = np. random. random ( ) if q < self. table [ ind ] [ 1 ] : return ind return self. table [ ind ] [ 0 ] | [
-0.3433997631072998,
-0.375005841255188,
0.5983097553253174,
-0.8215113878250122,
-1.7623041868209839,
0.6831713914871216,
0.2573171555995941,
-0.7651190161705017,
0.21929171681404114,
0.011313175782561302,
1.0033340454101562,
0.8212694525718689,
-0.5983133912086487,
-0.708063542842865,
... |
def _ build _ intersect _ result ( self ) : print ('start building intersect result') is _ close = self. is _ close intersect _ or _ not = self. intersect _ or _ not intersect _ result = self. intersect _ result intersect _ or _ not [ : ] = false for i in range ( self. nedges ) : n1, n2 = self. edges [ i, : ] if ( is _... | [
-0.8637761473655701,
0.06462044268846512,
0.7914279103279114,
0.36237090826034546,
0.006898776162415743,
0.1412799209356308,
0.5890285968780518,
-0.0032340509351342916,
-0.5712057948112488,
0.6128106117248535,
0.4337203800678253,
-0.9120224714279175,
-0.8813198208808899,
0.3369998335838318... |
async def test _ logbook _ stream _ match _ multiple _ entities ( recorder _ mock : recorder, hass : homeassistant, hass _ ws _ client : websocketgenerator, entity _ registry : er. entityregistry, ) - > none : now = dt _ util. utcnow ( ) await asyncio. gather ( * [ async _ setup _ component ( hass, comp, { } ) for comp... | [
0.0870717316865921,
-0.04315963014960289,
0.8981039524078369,
-0.14415301382541656,
0.9980217218399048,
-0.14230194687843323,
0.028404468670487404,
-0.42631664872169495,
-0.5214897394180298,
-0.17509843409061432,
-0.20423467457294464,
0.2602018415927887,
-0.13235020637512207,
0.66574025154... |
def trendremover ( time, data, trend _ type ) : rank = polyfit ( time, data, trend _ type ) fitting = 0. 0 for rank _ i in range ( len ( rank ) ) : fitting + = rank [ rank _ i ] * ( time * * ( len ( rank ) - 1 - rank _ i ) ) data - = fitting return data | [
0.4666370451450348,
-0.6177255511283875,
0.4735659956932068,
-0.15798193216323853,
0.005004155449569225,
0.6733983755111694,
0.31589275598526,
0.32695674896240234,
0.23192007839679718,
0.4317387044429779,
-0.6282922029495239,
1.2161771059036255,
-0.7446796894073486,
-0.17320524156093597,
... |
def scan _ leaves ( obj, path = " " ) : # case : map. fetch leaves of each value. sort them so similar objects generate same sequence. if isinstance ( obj, dict ) : for ( k, v ) in sorted ( obj. items ( ) ) : yield from scan _ leaves ( obj [ k ], f " { path }. { k } " ) # case : list. fetch leaves of each list item. el... | [
-0.48223310708999634,
-0.6863702535629272,
0.8021231293678284,
0.690690815448761,
-1.2019869089126587,
0.09125549346208572,
-0.21832877397537231,
-0.646504282951355,
0.7714948654174805,
-0.9154790639877319,
0.1834794282913208,
0.00617149006575346,
0.45126980543136597,
0.7584196925163269,
... |
def cross _ validate ( frame, train _ descriptors, num _ folds = 3, verbose = false, tc = tkcontext. implicit ) : tkcontext. validate ( tc ) arguments. require _ type ( frame, frame, " frame " ) all _ grid _ search _ results = [ ] grid _ search _ results _ accumulator = none for train _ frame, test _ frame in split _ d... | [
0.26232126355171204,
1.3525679111480713,
0.6936628818511963,
0.2872326970100403,
0.43102601170539856,
-0.341069757938385,
0.41138389706611633,
-0.09129061549901962,
-0.5475569367408752,
0.783294141292572,
0.7382449507713318,
-0.71524578332901,
0.28356584906578064,
0.4145750105381012,
-0.... |
def make _ property ( elem, key = none ) : if key : def _ get ( self ) : return getattr ( self, elem ). get ( key ) def _ set ( self, value ) : getattr ( self, elem ). set ( key, value ) self. _ modified = true return property ( _ get, _ set ) else : def _ get ( self ) : return getattr ( self, elem ). text def _ set ( ... | [
-0.7896354794502258,
-0.24992790818214417,
0.47468656301498413,
-0.018334167078137398,
-1.172714352607727,
-0.4180416166782379,
-0.24507617950439453,
0.03398790583014488,
0.8674739003181458,
0.10387037694454193,
0.480499267578125,
-0.1598655730485916,
0.3643838167190552,
-0.524700880050659... |
def is _ fill _ request _ seq ( seq ) : if is _ source ( seq ) : return false is _ fcseq = false if hasattr ( seq, " _ _ iter _ _ " ) : is _ fcseq = any ( map ( is _ fill _ request _ el, seq ) ) if is _ fill _ request _ el ( seq ) : is _ fcseq = true return is _ fcseq | [
-1.6323477029800415,
-0.12959593534469604,
0.4321533143520355,
0.5822404623031616,
-0.5470560789108276,
-0.09468698501586914,
-0.012776498682796955,
0.02092340774834156,
0.9740206599235535,
-0.43096551299095154,
0.002384566469117999,
-0.3911702036857605,
-0.04639261215925217,
1.74442052841... |
def test _ reactorselectionmixin ( self ) : executed = [ ] install _ event ='reactor installed'subcommand _ event ='subcommands loaded'class reactorselectionoptions ( usage. options, app. reactorselectionmixin ) : def subcommands ( self ) : executed. append ( subcommand _ event ) return [ ('subcommand ', none, lambda :... | [
-0.0321124829351902,
-0.19257725775241852,
0.597065269947052,
0.19338127970695496,
1.6476874351501465,
-0.8711293339729309,
0.09266448020935059,
0.234907329082489,
0.9775906205177307,
-0.6549486517906189,
-1.0371149778366089,
-0.3307330012321472,
-0.6283549666404724,
-0.2963341176509857,
... |
def calc _ sijk ( data, vecout = false, weighted = false ) : from itertools import combinations from scipy. special import binom n = data. shape [ 1 ] if weighted is false : weighted = np. ones ( ( data. shape [ 0 ] ) ) / data. shape [ 0 ] if vecout : sijk = np. zeros ( ( binom ( n, 3 ) ) ) j = 0 for i in combinations ... | [
0.5225217938423157,
1.0594838857650757,
0.781181275844574,
0.5040565133094788,
-0.721177339553833,
-0.5879591107368469,
1.0474343299865723,
0.5298684239387512,
0.5473514795303345,
0.7720608711242676,
-0.39062410593032837,
-1.2129197120666504,
-1.115149736404419,
-0.3215220868587494,
-0.8... |
def writebooleanresultstofile ( self, results, pathtofile ) : with open ( pathtofile,'w') as output : for k, v in results. items ( ) : if len ( v ) = = 0 : output. write ('{ : < 3 } { : < 3 } { : < 8 } { : < 3 } { : < 8 } { : < 3 } \ n '. format ( k, 0,'null ', 0,'null ', 0 ) ) for counter, doc in enumerate ( sorted ( ... | [
-0.18331849575042725,
-0.33827459812164307,
0.7583829164505005,
-0.34800711274147034,
1.3269445896148682,
0.7646424770355225,
0.35297513008117676,
0.08225655555725098,
-0.41928598284721375,
0.49654504656791687,
-0.4557409882545471,
-0.8100190758705139,
-0.10583677142858505,
-0.036113034933... |
def plot ( self ) : sc = seaborncanvas ( self, 3, 4, 100 ) smote _ 15 _ classes = pickle. load ( open ('serializedobjects / statistics / smote _ 15 _ classes. pkl ','rb') ) sns. heatmap ( pd. dataframe ( smote _ 15 _ classes ). iloc [ : - 1, : ]. t, annot = true, ax = sc. ax ) sc. ax. tick _ params ( which ='both ', la... | [
0.3956374526023865,
0.6946514844894409,
0.5936552882194519,
-0.16792000830173492,
0.07675373554229736,
-0.11586490273475647,
0.8199142217636108,
-0.18595018982887268,
1.0586475133895874,
-0.2817769944667816,
0.09216301888227463,
1.4654954671859741,
0.584756076335907,
-0.11259196698665619,
... |
def sm _ volume _ create ( context, values ) : return impl. sm _ volume _ create ( context, values ) | [
-0.026256538927555084,
0.48449450731277466,
0.17535260319709778,
0.46273496747016907,
0.07394687831401825,
-0.3978325128555298,
-0.4224526584148407,
-0.9540141224861145,
0.20394794642925262,
-0.28297555446624756,
-0.5466347932815552,
-0.24121904373168945,
0.22745347023010254,
-0.1600755006... |
def test _ has _ method ( method _ name ) : assert hasattr ( classdef ( 8 ), method _ name ) | [
0.9932321906089783,
0.43822580575942993,
0.3839094042778015,
0.5711974501609802,
1.0292989015579224,
0.015138975344598293,
0.4917060434818268,
-0.00443490082398057,
0.3395835757255554,
-0.7032058835029602,
-0.2626863121986389,
-0.552617609500885,
0.5941334962844849,
1.794545292854309,
-0... |
def replacer ( request ) : log. debug ( f'request. post, ` ` ` { pprint. pformat ( request. post ) } ` ` `') validator = validator ( ) if validator. check _ validity ( request ) is false : return httpresponsebadrequest ('400 / bad request') return httpresponse ('implementation coming') data : dict = update _ helper. pr... | [
-0.13792560994625092,
-0.27761611342430115,
0.6696726679801941,
-0.178277388215065,
-0.4208536446094513,
0.03856426849961281,
-0.30204030871391296,
1.0373612642288208,
-0.09998253732919693,
-0.4254916310310364,
0.512746274471283,
-0.5402416586875916,
0.30130183696746826,
0.5847381949424744... |
def lines _ of _ words ( s, w, text _ words ) : assert sorted ( s. keys ( ) ) = = list ( range ( 1, 1 + max ( s. keys ( ) ) ) ), [ sorted ( s. keys ( ) ), list ( range ( 1, 1 + max ( s. keys ( ) ) ) ) ] return [ line _ words ( s, w, text _ words, i ) for i in sorted ( s. keys ( ) ) ] | [
0.32901400327682495,
-0.4459625780582428,
0.3023499548435211,
-0.18890313804149628,
-0.24605880677700043,
-0.703555703163147,
-0.7224203944206238,
0.2715165913105011,
0.09750868380069733,
0.45245736837387085,
0.6097063422203064,
0.0769280269742012,
0.04583335667848587,
0.8170656561851501,
... |
def k _ longest _ sequence _ index ( nested _ list, k ) : seq _ len = np. array ( [ len ( i ) for i in nested _ list ] ) max2min _ index = seq _ len. argsort ( ) [ : : - 1 ] k _ longest _ index = max2min _ index [ : k ] k _ longest _ len = seq _ len [ k _ longest _ index ] return {'idx': k _ longest _ index,'len': k _ ... | [
-0.40640637278556824,
-1.0198761224746704,
0.5263240933418274,
-0.03976196050643921,
-0.7614341974258423,
-0.5648683905601501,
-0.7399608492851257,
0.8451089262962341,
-0.4461548626422882,
0.592528223991394,
-1.378557801246643,
0.5223439931869507,
0.5191612839698792,
0.31781724095344543,
... |
def cq _ analytics _ saint _ exporter _ pagesize ( self, cq _ analytics _ saint _ exporter _ pagesize : confignodepropertyinteger ) : self. _ cq _ analytics _ saint _ exporter _ pagesize = cq _ analytics _ saint _ exporter _ pagesize | [
-0.266986608505249,
-0.28066638112068176,
0.033726900815963745,
0.3618103861808777,
-0.2917100191116333,
0.5524167418479919,
0.7114905118942261,
0.8152307868003845,
0.5235740542411804,
-0.04821602627635002,
-0.07172021269798279,
-0.19398829340934753,
1.036585807800293,
0.6930909156799316,
... |
def test _ redirect _ request _ with _ code _ challenge ( self ) - > none : req = mock ( spec = [ " cookies " ] ) req. cookies = [ ] with self. metadata _ edit ( { " code _ challenge _ methods _ supported " : [ " s256 " ] } ) : url = urlparse ( self. get _ success ( self. provider. handle _ redirect _ request ( req, b ... | [
-0.04673421382904053,
0.37660929560661316,
0.5351340174674988,
0.30165302753448486,
0.548194408416748,
-0.328906774520874,
0.06565743684768677,
0.10448779165744781,
0.7063301205635071,
-0.7348240613937378,
-0.46657228469848633,
0.3464643657207489,
0.03186934441328049,
0.21497976779937744,
... |
def reset _ session ( self ) : self. _ requester _ session = requests. session ( ) self. _ requester _ session. headers. update ( self. _ default _ headers ) | [
-0.9739086627960205,
-0.4485088586807251,
0.33845776319503784,
0.9217114448547363,
0.8863394856452942,
-0.7161721587181091,
-0.18294313549995422,
-0.9390538334846497,
-0.02971218340098858,
-0.2563769817352295,
-0.04409689083695412,
0.4205908179283142,
-0.5398705005645752,
-0.96766459941864... |
def to _ dict ( self ) : formatted _ timestamp = self. created _ at. strftime ('% y - % m - % dt % h : % m : % s. % f') formatted _ timestamp = formatted _ timestamp [ : - 3 ] return { " station " : self. station. name, " username " : self. username, " timestamp " : formatted _ timestamp } | [
-0.7007417678833008,
-0.5841573476791382,
0.6626465916633606,
-0.6871157884597778,
-0.49522045254707336,
0.4281657040119171,
-0.8441234827041626,
-0.4726387858390808,
-0.48379218578338623,
0.21439900994300842,
-0.9776629209518433,
0.00568329868838191,
0.29567527770996094,
-0.13829994201660... |
def visitfrench ( self, date ) : raise notimplementederror ( ) | [
-0.5041408538818359,
1.682701826095581,
0.5115817189216614,
-0.0008082928834483027,
-0.010212279856204987,
-0.6271784901618958,
0.5335959196090698,
-1.8437306880950928,
-0.5765123963356018,
-0.3399880826473236,
0.0819232314825058,
0.8978257179260254,
0.4186742901802063,
0.8924945592880249,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.