text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def load _ model ( self, save _ folder = ". / chkpt ", cuda = false, epoch = none ) : tmp = " " if isinstance ( epoch, type ( none ) ) else f " _ { epoch } " # net _ params = torch. load ( os. path. join ( save _ folder, f " params { epoch }. net " ), map _ location = torch. device ( " cpu " ) ) print ( f " [ % % % % ]... | [
0.1280585676431656,
0.05396531894803047,
0.7387973666191101,
0.28367793560028076,
0.24380269646644592,
0.5678972005844116,
-0.08252178877592087,
0.42141059041023254,
-0.43599262833595276,
0.8910475969314575,
-0.7420706748962402,
-0.31970715522766113,
0.2450477033853531,
0.9529882073402405,... |
def set _ interval ( self, interval ) : self. interval = interval | [
-0.3006509840488434,
0.01709226332604885,
0.10138910263776779,
0.6090809106826782,
0.0020862200763076544,
1.3437095880508423,
-0.2251882702112198,
0.9752482771873474,
-0.9570223689079285,
-0.6257092952728271,
-0.8922441601753235,
0.722000002861023,
-0.9952317476272583,
0.4056621193885803,
... |
def _ get _ missing _ subfiles ( file _ group ) : if not'of'in file _ group [ 0 ]. split ('-') [ - 1 ] : return [ ] else : extensions = [ f. split ('-') [ - 1 ] for f in file _ group ] numbers = set ( ) total _ set = set ( ) for ext in extensions : num, tot = splitext ( ext ) [ 0 ]. split ('of') numbers. add ( int ( nu... | [
0.12334607541561127,
-0.011973997578024864,
1.0450299978256226,
-0.22608353197574615,
-0.2107333391904831,
-0.3799895644187927,
0.8686487674713135,
-0.7115939259529114,
-0.21001029014587402,
0.47320565581321716,
-0.040592316538095474,
-0.43118011951446533,
-0.06203688308596611,
-0.05378487... |
def postabq ( self, fn = none ) : types = ['abaqus results file ( *. fil )'] fn = askfilename ( gd. cfg ['workdir'], types, exist = true ) if fn : chdir ( fn ) name, ext = os. path. splitext ( fn ) post = name + '. post'cmd = " % s / lib / postabq % s > % s " % ( gd. cfg ['pyformexdir'], fn, post ) sta, out = utils. ru... | [
-0.25352075695991516,
-0.39012306928634644,
0.7228126525878906,
0.20177926123142242,
-0.016204386949539185,
0.4679405689239502,
0.41743913292884827,
-0.7353613376617432,
-0.6053924560546875,
-0.7936767339706421,
-0.5256015658378601,
0.5255255103111267,
-0.21390312910079956,
0.3386871218681... |
def hadec _ to _ altaz ( ha, decl, obslat, input = " sexigesimal ", output = " deg " ) : # convert equatorial coords to radians if input = = " sexigesimal " : ha = protractor. convert ( ha, " hmsstr ", " rad " ) decl = protractor. convert ( decl, " dmsstr ", " rad " ) else : ha = protractor. convert ( ha, input, " rad ... | [
-0.07309344410896301,
-0.7450499534606934,
0.6579073071479797,
-0.6321134567260742,
-0.26500052213668823,
0.45969462394714355,
-0.3929694592952728,
0.11793401837348938,
-0.4080745279788971,
0.1297777146100998,
0.17127862572669983,
0.6990278363227844,
0.8079754114151001,
0.8811396956443787,... |
def fibseq ( limit ) : fiblist = list ( ) fiblist. append ( i + ( i + 1 ) for i in range ( 0, ( limit ) ) ) return ( fiblist ) | [
-1.113001823425293,
0.02529355324804783,
0.5312837362289429,
1.250563621520996,
0.12350472807884216,
-0.05228157341480255,
0.17801064252853394,
0.6642782688140869,
0.49023815989494324,
0.3815625011920929,
-1.337790608406067,
-0.034096989780664444,
-0.7892229557037354,
0.009378363378345966,... |
def wrap ( text, width ) : return reduce ( lambda line, word, width = width :'% s % s % s'% ( line,'\ n'[ ( len ( line ) - line. rfind ('\ n') - 1 + len ( word. split ('\ n ', 1 ) [ 0 ] ) > = width ) ], word ), text. split ('' ) ). split ('\ n') | [
0.276294469833374,
0.0017936546355485916,
0.7183166742324829,
-0.20926938951015472,
-1.4334756135940552,
-0.6394140124320984,
-0.7707684636116028,
0.2554553151130676,
0.4819805324077606,
0.9335888624191284,
0.41974157094955444,
0.24486421048641205,
-0.2021467685699463,
0.3735058903694153,
... |
def take ( values, i ) : return values [ i ], values [ i + 1 ], i + 2 | [
0.06539929658174515,
0.6488795876502991,
0.27820491790771484,
0.13227133452892303,
-0.3126095235347748,
0.36672070622444153,
0.6234315037727356,
-0.6148054599761963,
-1.2108057737350464,
-0.5365367531776428,
-1.328096866607666,
-0.4968383014202118,
-0.22158002853393555,
-1.057116150856018,... |
def test _ operate ( self ) : test _ dict = { " key " : " значение " } test _ list = [ " item0 ", " элемент1 " ] # fill table with self. session. transaction : self. session. add _ all ( [ exampletable ( row _ name = " dict _ record ", json _ record = test _ dict ), exampletable ( row _ name = " list _ record ", json _... | [
-0.6542039513587952,
0.5697007775306702,
0.9554473757743835,
-0.23434914648532867,
0.29224351048469543,
-0.521676778793335,
0.21127349138259888,
0.7820290327072144,
-0.06144136190414429,
0.419939786195755,
-0.6824926137924194,
0.26198893785476685,
0.6410961151123047,
-0.27217721939086914,
... |
def test _ 06 _ 5 _ days ( self ) : self. m _ schedule _ obj. dayofweek = dayofweek _ monday l _ days = schedtime. _ extract _ days ( self. m _ schedule _ obj, t _ wednesday ) # print ( prettyformatany. form ( l _ days,'b1 - 06 - a - days') ) self. assertequal ( l _ days, 5 ) | [
-0.36728012561798096,
0.47956758737564087,
0.29970234632492065,
-1.5700503587722778,
0.21906782686710358,
-0.5667072534561157,
0.1493881344795227,
-1.012863039970398,
0.4429052174091339,
-0.3996131718158722,
-0.19679760932922363,
-0.31877848505973816,
0.03767597675323486,
0.200974479317665... |
def test _ event _ as _ attribute ( self ) : html _ code = f " " " < html > < head > < / head > < body > < button id = " button " { reachable _ att _ name } = " true " onclick = " { self. event _ code } " > < / button > < / body > < / html > " " " self. _ inject _ code ( html _ code ) self. asserttrue ( list ( self. we... | [
-0.014455588534474373,
0.32549747824668884,
0.8691478967666626,
-0.16470244526863098,
-0.008651710115373135,
0.17148417234420776,
0.5133481025695801,
0.4665875732898712,
0.9516783356666565,
0.09971283376216888,
-0.06016135960817337,
0.3066253066062927,
1.112916111946106,
0.8137683272361755... |
def contactlistupdated ( self, clview ) : raise notimplementederror | [
-0.8808146715164185,
-1.1770168542861938,
0.4345354437828064,
0.7356488108634949,
-0.8721503019332886,
0.5004861354827881,
0.04540378227829933,
-0.31842041015625,
1.0986989736557007,
0.4370076358318329,
-0.683356761932373,
-0.8419036865234375,
0.6629710793495178,
0.1978430300951004,
-1.5... |
def test _ somatic _ msi _ calling _ workflow ( somatic _ msi _ calling _ workflow ) : # check created sub steps expected = [ " link _ out ", " mantis " ] assert list ( sorted ( somatic _ msi _ calling _ workflow. sub _ steps. keys ( ) ) ) = = expected # check result file construction expected = [ " output / mantis. bw... | [
0.3336479663848877,
0.11481928080320358,
0.8041989207267761,
0.2635154724121094,
-0.2195129096508026,
0.2972122132778168,
-0.017036957666277885,
-0.03510938584804535,
-0.7378824353218079,
-0.2716282904148102,
-0.06489703804254532,
-0.4105262756347656,
-0.7680250406265259,
0.315344482660293... |
def get _ nearest _ neighbors ( self, q, k = 1 ) : # buffer for nearest neightbors neighbors = priorityqueue ( k ) # list of nodes ot visit visit _ stack = [ ] self. add _ node ( visit _ stack, self, q ) # distance of n - nearest neighbors so far tau = np. inf total _ seen = 0 while len ( visit _ stack ) > 0 : d, node ... | [
-0.11665786802768707,
0.25733456015586853,
0.9590749740600586,
0.36738526821136475,
-0.3610447347164154,
-0.48107287287712097,
0.09735648334026337,
-0.8745797276496887,
0.0534353107213974,
0.45528900623321533,
-0.45272576808929443,
0.540267825126648,
-0.12263262271881104,
0.799862146377563... |
def get _ queryset ( self ) : return question. objects. order _ by ('- pub _ date') | [
0.7383300065994263,
-0.22742396593093872,
0.6254798769950867,
0.7736126780509949,
0.2910810112953186,
1.1836758852005005,
-0.7074586749076843,
0.15684717893600464,
-0.8826380968093872,
-0.5240585207939148,
1.2320945262908936,
0.18275628983974457,
0.1905626654624939,
0.04260293021798134,
... |
async def async _ step _ init ( self, user _ input : dict | none = none ) - > flowresult : return await self. async _ step _ public _ weather _ areas ( ) | [
-0.7520579695701599,
0.7279480695724487,
0.2675662636756897,
0.7586952447891235,
-0.2771267890930176,
0.21914489567279816,
0.4809819459915161,
0.05953272059559822,
0.09941475093364716,
-0.7500085830688477,
-0.6248192191123962,
0.4976281225681305,
0.44732728600502014,
1.0800820589065552,
... |
def roc ( labels, scores, saveto ='/ media / bozorgta / elements / anomaly / ganomaly / output / plots /') : fpr = dict ( ) tpr = dict ( ) roc _ auc = dict ( ) # true / false positive rates. fpr, tpr, _ = roc _ curve ( labels, scores ) roc _ auc = auc ( fpr, tpr ) # equal error rate eer = brentq ( lambda x : 1. - x - i... | [
0.34711402654647827,
-0.10950381308794022,
0.7409125566482544,
-1.1575437784194946,
0.2108844667673111,
0.1072203665971756,
1.2478326559066772,
0.32796820998191833,
-0.30558016896247864,
0.3894067108631134,
0.17406968772411346,
0.00039540897705592215,
0.25613895058631897,
-0.78026765584945... |
def get _ included ( self, serializer ) : context = {'request': self. request,'view': self } for backend in self. filter _ backends : if issubclass ( backend, jsonapiincludefilter ) : return backend ( ). to _ representation ( serializer, context = context ) return [ ] | [
-0.21792544424533844,
0.1423705518245697,
0.6361700892448425,
0.6595688462257385,
-0.11252596229314804,
-0.5770208835601807,
-0.4539337158203125,
-0.3971392512321472,
1.408520221710205,
0.5615216493606567,
-0.4476429522037506,
0.78477942943573,
-0.665757954120636,
0.13153426349163055,
-0... |
def _ prolix _ pass ( self, all : str, prolix : list [ str ] ) - > str : print ('tagging prolix tokenization') remainingtext = str ( all ) prolixtokenization ='' for i, proposed in enumerate ( self. prolix ) : print ( f'{ i / len ( self. prolix ) * 100 : 6. 2f } % \ r ', end ='' ) try : index = remainingtext. index ( p... | [
0.18613845109939575,
-0.7785845994949341,
0.686886191368103,
-0.2668054699897766,
-0.491800993680954,
-0.175669327378273,
-0.595962405204773,
0.7429918050765991,
-0.6229014992713928,
0.15708744525909424,
0.4396814703941345,
-0.19482798874378204,
-0.202607661485672,
0.4694805443286896,
-0... |
def extend _ path ( self, path ) : existing _ path = self. path or " " path = " { } / { } ". format ( existing _ path. rstrip ( " / " ), path. lstrip ( " / " ) ) return self. add _ path ( path ) | [
0.32692503929138184,
-0.03455480560660362,
0.7745283246040344,
0.2857256233692169,
-0.3460646867752075,
0.749775767326355,
-0.4390212595462799,
0.40302979946136475,
0.9673197269439697,
-0.6186391711235046,
0.15852215886116028,
0.05640106275677681,
-0.4505067765712738,
-0.10493780672550201,... |
def upper ( f ) : res = f. copy ( ) res. input _ project ( ) res. minimize ( ) return res | [
-0.7748096585273743,
0.16180652379989624,
0.27166885137557983,
1.68467378616333,
-0.4629844129085541,
-0.002813365776091814,
0.8477323055267334,
0.23442277312278748,
0.2284223884344101,
0.3336336314678192,
0.13465005159378052,
-0.1682439148426056,
0.407850056886673,
-1.3635166883468628,
... |
def write ( file, lines ) : with open ( file,'w') as f : bytes _ = f. write ('\ n '. join ( lines [ 0 : ] ) +'\ n') return bytes _ | [
0.6326268911361694,
-0.13553564250469208,
0.33557993173599243,
0.11493198573589325,
1.0838350057601929,
0.2954690456390381,
-1.0112648010253906,
0.6043157577514648,
-0.9195770621299744,
-0.37891581654548645,
-0.10827478021383286,
-0.48048555850982666,
0.021640855818986893,
0.38271403312683... |
def temporarily _ as _ user ( setenv = true ) : return _ set _ uids ( false, false, setenv = setenv ) | [
-0.9252400994300842,
-0.015552262775599957,
0.41657090187072754,
0.7162303328514099,
-0.3548499047756195,
0.6503278613090515,
0.48544397950172424,
-0.3995026648044586,
0.19108928740024567,
-0.15867553651332855,
-0.848740816116333,
0.6691458821296692,
-0.8919447660446167,
0.3300081789493561... |
def test _ 02 _ delete _ all _ snapshots ( self ) : snapshots = list _ snapshots ( self. apiclient ) if snapshots is not none : for s in snapshots : try : if s. state = ='backedup': cmd = deletesnapshot. deletesnapshotcmd ( ) cmd. id = s. id self. apiclient. deletesnapshot ( cmd ) except exception as e : continue | [
0.2323269248008728,
0.047137342393398285,
0.6216918230056763,
1.3765252828598022,
0.6307958364486694,
-0.4487190842628479,
0.252005010843277,
0.5580347180366516,
1.668699026107788,
-0.5076673626899719,
-0.035411711782217026,
-0.5759741067886353,
-0.2160479575395584,
0.5203683972358704,
-... |
def is _ valid _ application _ command _ name ( name ) : return ( application _ command _ name _ rp. fullmatch ( name ) is not none ) | [
0.28514957427978516,
-1.0421392917633057,
0.5606661438941956,
0.4937475919723511,
-0.4898698031902313,
0.42272573709487915,
-0.2972603440284729,
-0.7127982378005981,
0.7293096780776978,
0.10525965690612793,
0.3427425026893616,
-0.27644041180610657,
0.17293347418308258,
0.8248813152313232,
... |
def get _ command _ for _ log ( infasta, minlen, maxlen, procs, single _ mode, chunk _ size, strand, starts, stops, table, include _ stop, partial3, partial5, bw _ stops, longest, byframe, ignorecase, bed12, bed, dna, rna, pep, outdir ) : cmd = " orfipy " + infasta + " - - min " + str ( minlen ) + " - - max " + str ( m... | [
-0.18473681807518005,
-1.5541367530822754,
0.9436315298080444,
-0.7398707866668701,
-0.2259708195924759,
-0.3961108922958374,
-0.12998968362808228,
-0.5270316004753113,
-0.14027826488018036,
-0.8028088808059692,
0.5076788663864136,
0.3668975532054901,
0.16647031903266907,
-0.50340169668197... |
def lj _ potential ( r _ sq, r _ c ) : dphi = np. where ( r _ sq < ( r _ c * * 2 ), 24 * ( 2 * ( 1 / ( r _ sq * * 7 ) ) - ( 1 / ( r _ sq * * 4 ) ) ), 0 * r _ sq ) return dphi | [
0.7659736275672913,
-0.8991029858589172,
0.5207199454307556,
-1.0112892389297485,
-0.33268293738365173,
0.14397095143795013,
-1.1338872909545898,
-0.744754433631897,
0.031128520146012306,
0.2913720905780792,
0.3762080669403076,
0.6734344363212585,
-0.8316642642021179,
0.23033960163593292,
... |
def first _ arg _ dependent _ memoize _ nested ( nested _ func ) : from functools import wraps cache _ dict _ name = intern ( " _ memoize _ inner _ dic _ % s _ % s _ % d " % ( nested _ func. _ _ name _ _, nested _ func. func _ code. co _ filename, nested _ func. func _ code. co _ firstlineno ) ) from inspect import cur... | [
-0.4984227120876312,
-0.10495131462812424,
0.8484243750572205,
0.049018651247024536,
0.3723948895931244,
-0.12788181006908417,
0.7396136522293091,
0.008952982723712921,
-0.22633682191371918,
-0.23556607961654663,
-0.3237210810184479,
0.49675458669662476,
0.35702377557754517,
0.495938420295... |
def get _ dynamic _ results ( self, elm _ name = none, var _ name = none, offset = 10000, time _ step = false ) : # read the results and time steps and store them as lists time = [ ] var _ values = [ ] # load results from file self. app. resloaddata ( self. res ) # get number of rows ( time steps ) in the results file ... | [
-0.2126588374376297,
-0.12558549642562866,
0.8086676597595215,
0.44329896569252014,
0.4179978668689728,
-0.1969062238931656,
-0.2519128918647766,
-0.33489343523979187,
-1.2250834703445435,
-0.056377947330474854,
-0.1498587727546692,
-0.04371136799454689,
0.08780152350664139,
0.688574373722... |
def make _ main _ class ( dat ) : m = mainclass ( ) for c in dat. classes. values ( ) : i = instancetest ( m, c. name ) for clazz in flatten _ classes ( dat. classes, c ) : for meth in flatten _ class _ methods ( dat. classes, clazz ) : i. add _ func ( func ( meth, clazz. name,'virtual') ) for iface in flatten _ interf... | [
-0.31858620047569275,
0.5441192984580994,
0.5337514281272888,
-0.7045747637748718,
-0.8137916922569275,
1.1312875747680664,
0.6489042639732361,
-0.6885567307472229,
0.8743263483047485,
-0.5806055665016174,
0.5103135108947754,
-0.520121693611145,
-0.21593044698238373,
0.37491098046302795,
... |
def timeout _ child ( conn : multiprocessing. connection. connection, func : types. functiontype, * args, * * kwargs ) : verbose = kwargs. get ('verbose ', 0 ) if verbose : tplog ( f " func = { func } " ) if not func : # https : / / stackoverflow. com / questions / 43369648 / cant - get - attribute - function - inner -... | [
1.0085728168487549,
-0.5416259169578552,
1.1180446147918701,
-0.28859615325927734,
-0.2894437313079834,
-0.25189074873924255,
-0.13300558924674988,
-0.09446384012699127,
-0.3999539315700531,
0.6909594535827637,
-0.24939437210559845,
0.5352911353111267,
-0.5514221787452698,
0.31413096189498... |
def mask _ syllables ( self, mask : text = " x " ) - > sequence [ text ] : return [ word. pf. mask _ syllables ( mask ) for word in self. words ] | [
-0.0860367864370346,
-0.07545147091150284,
0.30783525109291077,
1.4105867147445679,
0.10326580703258514,
-0.11563791334629059,
-0.14304840564727783,
0.04723137244582176,
-0.12795965373516083,
0.00574170146137476,
-0.624715268611908,
-0.26991933584213257,
-0.7576825022697449,
0.185886219143... |
def _ set _ to _ python ( self, v, dsc = none ) : pv = none try : pv = set ( v. split ( ',') ) except valueerror : raise valueerror, " could not convert set % s to a set. " % v return pv | [
-0.5280970335006714,
0.510778546333313,
0.1576281487941742,
-1.0403130054473877,
0.2084876000881195,
-0.9001337289810181,
-0.5275607705116272,
-0.4135224223136902,
0.15918569266796112,
0.7795799970626831,
0.09720523655414581,
1.0263227224349976,
0.045391909778118134,
-1.2341923713684082,
... |
def _ _ init _ _ ( self, command : str ) : self. command = command self. docs _ command = docscommandcontext ( ) | [
0.3629832863807678,
-0.536623477935791,
0.439144492149353,
0.32794296741485596,
-0.08807723969221115,
0.21050971746444702,
-0.1708517223596573,
-0.35557836294174194,
1.169026494026184,
-1.1839054822921753,
-0.05014330521225929,
0.8537022471427917,
-0.08073577284812927,
1.0398507118225098,
... |
def tables _ exist ( ) : err _ msg, _ auth _ mgr = get _ auth _ mgr ( ) if err _ msg : return err _ msg, false try : cur = _ auth _ mgr. conn. execute ( " select name from sqlite _ master where type ='table'and name ='tenants'; " ) result = cur. fetchall ( ) except sqlite3. error as e : logging. error ( " error % s whe... | [
-0.47926169633865356,
-0.021521268412470818,
1.1000480651855469,
0.27954283356666565,
0.5613042712211609,
0.36465826630592346,
-0.06863704323768616,
-0.2470972090959549,
-0.6274681091308594,
0.7339969277381897,
0.5693008303642273,
-0.262203186750412,
0.06881214678287506,
0.6239585876464844... |
def run ( self ) : self. logger. info ( " thread opencv started " ) # call config in config parameter is set if self. kwargs ['config'] : self. opencvconfig ( ) return framedistance = 8 framecounter = 0 while not self. threadexit : # capture frame - by - frame ret, frame = self. cap. read ( ) self. frame = frame [ 132 ... | [
0.03311360999941826,
-0.9576570391654968,
1.1466262340545654,
0.7006824016571045,
0.2162424474954605,
0.17441968619823456,
0.622416079044342,
-0.15821483731269836,
0.26774948835372925,
0.5086879730224609,
-0.5370768904685974,
-0.02645181305706501,
-0.19801954925060272,
0.7737820744514465,
... |
def write _ example ( config : config, example _ name : str, example _ block : str ) - > none : output = pystache. render ( config. output _ template, name = example _ name, code = example _ block, comment _ prefix = config. comment _ prefix, comment _ suffix = config. comment _ suffix, language _ name = config. langua... | [
0.13391917943954468,
-0.5250545740127563,
0.7335319519042969,
-0.1612624078989029,
0.2916150391101837,
-0.5908697247505188,
0.17596958577632904,
0.2659086585044861,
-0.8178345561027527,
0.6461887359619141,
-0.7871171236038208,
-0.1577601432800293,
-0.16836866736412048,
0.052734553813934326... |
def _ _ init _ _ ( self, private _ key ) : self. _ _ sk = ed25519. ed25519privatekey. from _ private _ bytes ( private _ key. bytes ) | [
-0.018261002376675606,
0.11282630264759064,
0.1776677370071411,
0.3349987268447876,
-0.26616859436035156,
-0.6553822755813599,
-0.04421636462211609,
-0.1983656883239746,
1.2984658479690552,
0.546502411365509,
-0.07084210962057114,
0.6589648127555847,
-0.2852765917778015,
0.7584317922592163... |
def getddgexternaloutputstepenabled ( index ) : andor _ solis. getddgexternaloutputstepenabled. restype = ctypes. c _ uint enabled = ctypes. c _ ulong ( ) result = andor _ solis. getddgexternaloutputstepenabled ( ctypes. c _ ulong ( index ), ctypes. byref ( enabled ) ) check _ status ( result ) return int ( enabled. va... | [
-1.0756957530975342,
1.3619849681854248,
0.6149139404296875,
0.04025210067629814,
-1.050734281539917,
-0.461164653301239,
0.2516687512397766,
-0.033593591302633286,
0.1850155144929886,
-0.30381113290786743,
-0.9593687653541565,
-0.5283166766166687,
-0.5237189531326294,
-0.05465800687670708... |
def save _ checkpoint ( state, is _ best, filename ='checkpoint. pth. tar') : torch. save ( state, filename ) | [
0.3191497325897217,
-0.008505650795996189,
0.0582701750099659,
1.1064741611480713,
0.8437020182609558,
0.6937476992607117,
-0.10322916507720947,
0.9853436946868896,
-0.8023874759674072,
0.15120884776115417,
-0.7757976651191711,
-0.5993532538414001,
0.8300979137420654,
-0.6601740717887878,
... |
def variants _ per _ dataset ( conn, dataset ) : nvars = 0 try : # with conn. cursor ( ) as cursor : sql ='select count ( * ) as vars from beacon _ data _ table where dataset _ id = % s'result = conn. execute ( sql, dataset ) row = result. fetchone ( ) nvars = row ['vars'] except : log. error ('unexpected error : % s '... | [
-0.25105831027030945,
0.8711656928062439,
0.39615827798843384,
-0.13607436418533325,
-0.763441264629364,
-0.14144757390022278,
-0.2032986581325531,
-0.32465848326683044,
0.03848960995674133,
0.11908359080553055,
0.1357492059469223,
-0.2550068497657776,
-0.0815066397190094,
0.55083477497100... |
def get _ samples ( self, fc _ id, sample _ prj = none ) : self. log. debug ( " retrieving samples subset by flowcell'{ }'and sample _ prj'{ }'". format ( fc _ id, sample _ prj ) ) sample _ ids = self. get _ sample _ ids ( fc _ id, sample _ prj ) return [ self. db. get ( x ) for x in sample _ ids ] | [
0.3885902166366577,
0.14770019054412842,
0.2936064302921295,
0.5937467217445374,
0.32880082726478577,
-0.37016990780830383,
-0.43581682443618774,
0.10164593905210495,
-0.4447108805179596,
-0.4844062328338623,
0.6019496917724609,
0.3366035223007202,
-0.417472243309021,
0.13792139291763306,
... |
def exists ( path ) : try : st = os. stat ( path ) except os. error : return false return true | [
-0.19759047031402588,
-0.08982376754283905,
0.6301989555358887,
-0.1756729632616043,
0.6054736971855164,
1.511035442352295,
-0.31649166345596313,
0.08621799200773239,
-0.4801950454711914,
-0.8472942113876343,
0.30582132935523987,
-0.8155161142349243,
0.39627206325531006,
-0.516070723533630... |
def writeheader ( self, output _ mediator ) : cell _ format = self. _ workbook. add _ format ( {'bold': true } ) cell _ format. set _ align ('center') self. _ column _ widths = [ ] for column _ index, field _ name in enumerate ( self. _ field _ names ) : self. _ sheet. write ( 0, column _ index, field _ name, cell _ fo... | [
-0.8379931449890137,
-0.4185446500778198,
0.48650482296943665,
0.5632178783416748,
0.49473196268081665,
-0.45811960101127625,
0.48109766840934753,
-0.0524279847741127,
-0.9987414479255676,
-0.03670615330338478,
-0.021581722423434258,
-0.034468475729227066,
0.07909319549798965,
0.4867247641... |
def createsquaremask ( sz, t ) : t = min ( sz / / 2, t ) mask = [ [ ] for _ in range ( sz ) ] for i in range ( t ) : mask [ i ]. extend ( [ 0 for _ in range ( sz ) ] ) for j in range ( t, sz - t ) : mask [ j ]. extend ( [ 0 for _ in range ( t ) ] ) mask [ j ]. extend ( [ 255 for _ in range ( sz - 2 * t ) ] ) mask [ j ]... | [
-0.6180223226547241,
-1.0758728981018066,
0.8237864375114441,
0.17861077189445496,
-0.4931640625,
-0.14910006523132324,
0.02532314509153366,
-0.6335020065307617,
0.563694417476654,
0.5277543663978577,
-0.8342780470848083,
0.07807648926973343,
0.7901419401168823,
-0.12329806387424469,
-0.... |
def hosted _ zone _ id ( self ) - > optional [ str ] : return pulumi. get ( self, " hosted _ zone _ id " ) | [
1.9891635179519653,
-0.17653913795948029,
0.24263814091682434,
1.0726696252822876,
0.77736496925354,
1.7804369926452637,
0.5501245856285095,
0.7092296481132507,
1.083311676979065,
-0.4155660569667816,
-0.28131553530693054,
0.9558368921279907,
-0.7024703621864319,
-0.9783677458763123,
-0.... |
def percentile _ range ( l _ bound, u _ bound, vec, p _ vec = none ) : if p _ vec is none : p _ vec = percentilize ( vec ) l _ index, l _ val = percentile ( l _ bound, vec, p _ vec ) u _ index, u _ val = percentile ( u _ bound, vec, p _ vec ) return ( l _ val, u _ val ) | [
0.2795097529888153,
-0.4571133255958557,
0.48794615268707275,
0.2523306608200073,
-0.00013887764362152666,
0.6302544474601746,
0.0011202722089365125,
0.5031890273094177,
-0.5218547582626343,
-0.5673873424530029,
0.09846577793359756,
-0.045835305005311966,
-0.7168319225311279,
-0.5626782178... |
def extract _ region _ with _ data ( init _ pos, end _ pos ) : size = size _ region ( init _ pos, end _ pos ) blocks _ bytes = bytearray ( ) data _ bytes = bytearray ( ) # use the same loop than reading schematic format : x - > z - > y for y in range ( 0, size. y ) : for z in range ( 0, size. z ) : for x in range ( 0, ... | [
0.47206979990005493,
-0.7982861995697021,
0.6462613940238953,
-0.5221875905990601,
-0.6346675753593445,
-0.2146584540605545,
-0.27060073614120483,
-0.4523683786392212,
-0.2596108317375183,
0.1327938586473465,
-0.8184756636619568,
0.3173333406448364,
-0.37992724776268005,
-0.120765276253223... |
async def process _ binary ( self, msg ) : data = json. loads ( gzip. decompress ( msg ). decode ( ) ) # logger. debug ( " data : ", json. dumps ( data ), caller = self ) channel = data. get ( " ch " ) if not channel : if data. get ( " ping " ) : hb _ msg = { " pong " : data. get ( " ping " ) } await self. _ ws. send (... | [
-0.1665450483560562,
0.14624284207820892,
1.0766881704330444,
0.45232826471328735,
0.21768245100975037,
-0.1719340831041336,
-0.19517666101455688,
-0.8079649806022644,
-0.6259188055992126,
0.33146870136260986,
-0.6433420181274414,
0.4342166781425476,
-0.3693894147872925,
0.7722537517547607... |
def get _ scores ( trajectory _ true, trajectory _ pred, t _ column = " tmsp ", coordinate _ columns = ( " x ", " y " ) ) : scores = { " rmse " : rmse ( trajectory _ true, trajectory _ pred, t _ column, coordinate _ columns ), " mie " : mie ( trajectory _ true, trajectory _ pred, t _ column, coordinate _ columns ), } r... | [
0.3090847432613373,
0.14414356648921967,
0.2537797689437866,
-0.5889546871185303,
0.02779606729745865,
-0.23628740012645721,
-0.6913466453552246,
0.40473923087120056,
-1.976462721824646,
1.2129608392715454,
-0.5796682834625244,
-0.38661858439445496,
0.6256546974182129,
-0.46169981360435486... |
def _ _ setattr _ _ ( self, name, val ) : if hasattr ( self,'before _ update') and name in self. _ _ class _ _. set _ params : # tbd look into it if self. before _ update ( self,'before _ update ','value _ changed ', params = {'name': name,'value': val } ) [ 0 ] : return # if callback returned true than dont update if ... | [
-0.6647611856460571,
-0.6161354184150696,
1.0056049823760986,
-0.3302042782306671,
-1.4193929433822632,
-0.16040650010108948,
-0.10747057944536209,
-0.7853556275367737,
0.4412045478820801,
0.8158530592918396,
-0.25562992691993713,
-0.5574679970741272,
0.2888841927051544,
1.5710208415985107... |
def set _ last _ batch _ time ( self, line ) : data _ fields = line. split ( ", " ) date = str ( ) time = str ( ) try : date = data _ fields [ self. data _ field _ index [ " date " ] ] time = data _ fields [ self. data _ field _ index [ " time " ] ] except valueerror : print ( " data input corrupted " ) if not date or ... | [
-0.09292550384998322,
-0.1912023425102234,
0.6733376979827881,
0.036148399114608765,
0.6693215370178223,
0.20626875758171082,
-0.6730034351348877,
-0.24469931423664093,
-1.0238372087478638,
0.526532769203186,
-1.0054796934127808,
0.3750190734863281,
-0.19702863693237305,
0.6538870334625244... |
def start ( self ) : self. report ('info : started convergence workflow version { } \ n'' info : workchain node identifiers : { }'' '. format ( self. _ workflowversion, processregistry ( ). current _ calc _ node ) ) # # # # # # # init # # # # # # # # internal para / control para self. ctx. last _ calc = none self. ctx.... | [
0.01945984922349453,
-0.5929228663444519,
0.4937700927257538,
0.19112055003643036,
0.2618766725063324,
-0.06834859400987625,
0.3663988411426544,
0.03467293828725815,
-0.4053705334663391,
-0.5303244590759277,
0.05545085296034813,
0.48284727334976196,
-0.23394809663295746,
0.2597376406192779... |
def getampmaxspeed ( index ) : andor _ solis. getampmaxspeed. restype = ctypes. c _ uint speed = ctypes. c _ float ( ) result = andor _ solis. getampmaxspeed ( ctypes. c _ int ( index ), ctypes. byref ( speed ) ) check _ status ( result ) return float ( speed. value ) | [
-0.09037524461746216,
0.06327073276042938,
0.2438727766275406,
0.6128907799720764,
-0.12104122340679169,
-0.552613377571106,
-0.14612789452075958,
-0.7954531311988831,
1.447676420211792,
0.1572170853614807,
0.02796114608645439,
0.07610300183296204,
-1.1785610914230347,
-0.04511731490492821... |
def _ generate _ uniform _ planes ( self ) : return np. random. randn ( self. hash _ size, self. input _ dim ) | [
0.2046377956867218,
-0.030035842210054398,
0.38836178183555603,
-0.42521101236343384,
0.6644651293754578,
1.7075811624526978,
-0.03856493532657623,
0.022963549941778183,
0.3712138235569,
-0.5929833650588989,
-0.36622878909111023,
-0.1359257996082306,
-0.6793217658996582,
0.3311445116996765... |
def view ( self, dtype = none ) : if dtype is none : dtype = self. dtype old _ itemsize = self. dtype. itemsize itemsize = np. dtype ( dtype ). itemsize from pytools import argmin2 min _ stride _ axis = argmin2 ( ( axis, abs ( stride ) ) for axis, stride in enumerate ( self. strides ) ) if self. shape [ min _ stride _ ... | [
0.15292797982692719,
-0.418508380651474,
0.808372437953949,
-0.786865234375,
-1.3278557062149048,
-0.2501589357852936,
0.02074037306010723,
-0.33170872926712036,
0.48713943362236023,
-0.1558028906583786,
0.4325809180736542,
1.5618394613265991,
0.19684098660945892,
-0.059660546481609344,
... |
def write _ headers _ titlecase ( headers, write ) : # rfc says host : header should be written out first. for name, value in headers : if name = = b " host " : write ( b " % s : % s \ r \ n " % ( name. title ( ), value ) ) for name, value in headers : if name = = b " upgrade " : # skyq doesn't like'websocket ', it wan... | [
-0.9448047876358032,
-0.8609175682067871,
0.9495900869369507,
-0.015781007707118988,
0.44109460711479187,
-0.031077932566404343,
-1.4901319742202759,
-0.6126343607902527,
0.09446288645267487,
0.8583714962005615,
-0.0345025472342968,
-0.3839488625526428,
-0.408011794090271,
0.05582663789391... |
def _ createdatepage ( self ) : page = directframe ( self. frame ) page. setname ( " partyplannerdatepage " ) self. createdatetitlelabel = directlabel ( parent = page, relief = none, text = ttlocalizer. partyplannerdatetitle, pos = self. gui. find ( " * * / title _ locator " ). getpos ( ), scale = self. titlescale, ) p... | [
0.27670949697494507,
-0.1396787464618683,
0.7426547408103943,
-0.5192298889160156,
-0.6312897801399231,
0.9695498943328857,
-0.2491227090358734,
0.18921416997909546,
-0.3353322744369507,
0.02326080948114395,
0.5459867119789124,
-0.7088444828987122,
0.05288253352046013,
0.5565229058265686,
... |
def test _ loop ( config, sess, summary _ op, summary _ writer, saver, restore _ saver, directories, test _ dict, exp _ label, num _ params, log, map _ out ='test _ maps ', num _ batches = none, placeholders = false, checkpoint = none, save _ weights = false, save _ checkpoints = false, save _ activities = false, save ... | [
-0.11173970997333527,
-0.30015361309051514,
0.6542120575904846,
0.1304241418838501,
0.5230264067649841,
0.13327178359031677,
0.6910590529441833,
0.06988662481307983,
0.13795913755893707,
0.7830578088760376,
0.7367603182792664,
-0.2918035686016083,
-0.073405422270298,
0.04581352695822716,
... |
def size ( self ) : return self. _ dll. _ length | [
0.34028664231300354,
-0.05681478604674339,
0.2465175986289978,
-1.034307599067688,
0.3051246702671051,
1.084143877029419,
0.9672600030899048,
-0.003963092807680368,
0.6876856088638306,
-0.708116352558136,
-1.0607577562332153,
0.08619800209999084,
-0.4036571681499481,
0.23330272734165192,
... |
def _ is _ ignored _ path ( candidate : union [ path, str ], ignored _ list : optional [ set [ str ] ] = none ) - > bool : return ignored _ list is not none and str ( candidate ) in ignored _ list | [
-0.2812404930591583,
-0.3807949423789978,
0.23511455953121185,
0.3687790632247925,
-0.46676066517829895,
0.5740900039672852,
-0.7189604043960571,
1.2937228679656982,
0.7013311982154846,
0.5426928400993347,
-0.20133091509342194,
0.05717533826828003,
-0.8212720155715942,
0.39646369218826294,... |
def tag _ parser ( file _ list ) : for this _ file in file _ list : # # # todo # # # parse & purge tags, check for mbid or acoustid fingerprint if fingerprint ( this _ file ) : flag = " 2 " else : flag = " 1 " db _ handler ( " update ", this _ file, tags, flag ) return | [
0.16690869629383087,
-0.4848615825176239,
0.1747826784849167,
0.6583707928657532,
0.7251780033111572,
0.20465728640556335,
0.1300089955329895,
0.7517241835594177,
-0.9454783201217651,
0.3493855595588684,
-0.8637123703956604,
-1.1655384302139282,
-0.27334755659103394,
1.684956431388855,
-... |
def isdate ( s ) : raise notimplementederror | [
-0.3171284794807434,
-0.5136739015579224,
0.635044515132904,
1.3697494268417358,
-0.5982640981674194,
0.9029220342636108,
-0.3284468352794647,
0.32772424817085266,
1.919341802597046,
-0.6548153162002563,
-0.4071841537952423,
0.14748096466064453,
-0.3282243609428406,
0.22623401880264282,
... |
def terms _ of _ use _ url ( self ) - > optional [ str ] : return pulumi. get ( self, " terms _ of _ use _ url " ) | [
0.4471460282802582,
0.08785270154476166,
0.7426289319992065,
-0.2386516034603119,
1.4612549543380737,
-0.1063561886548996,
0.2575702667236328,
0.12381289899349213,
0.5008693933486938,
-0.17943844199180603,
0.09704013913869858,
0.44585075974464417,
0.03346956521272659,
-1.051526427268982,
... |
def get ( self, server : server, name : str ) - > alias : keys = ( server. transport. id. lower ( ), server. id. lower ( ), name. lower ( ) ) node = self. aliases for key in keys : if key in node : node = node [ key ] else : return none return node | [
-0.2778085172176361,
-0.8359942436218262,
0.45857948064804077,
-0.6403876543045044,
-0.6881701946258545,
-0.1658993661403656,
-1.5453983545303345,
-0.3292213976383209,
-1.022842526435852,
0.7485167384147644,
-0.5756089091300964,
1.6325501203536987,
-0.6849108934402466,
-0.36707040667533875... |
def _ _ getbiomassreactionid ( self ) : reactionids = np. array ( self. getreactionids ( ) ) def getbiomassreactionbyname ( ) : reactionnames = [ rxn. name for rxn in self. gem. reactions ] biomassreactionname = [ name for name in reactionnames if re. search ('(? i ) ( biomass | growth ) ', name ) ] if biomassreactionn... | [
0.4660351872444153,
-1.0296820402145386,
0.5615843534469604,
0.172989159822464,
0.7507078051567078,
-0.4102660119533539,
-0.303013414144516,
-0.13786637783050537,
0.05863209068775177,
-0.09802111238241196,
0.43693193793296814,
0.3618868589401245,
-0.6034542918205261,
0.6558453440666199,
... |
def find _ adds _ deletes ( filepath, data, data _ html, colnames ) : with open ( filepath,'r') as csvfile : reader = csv. reader ( csvfile ) csvrows = [ row [ 0 : len ( colnames ) ] for row in reader ] # ignore the timestamp ( last column ) csvrows = csvrows [ 1 : ] # first row is header # if job is on the website and... | [
0.1507682204246521,
-0.3001626133918762,
0.5211945176124573,
0.06500419229269028,
-0.02682093158364296,
0.3738005459308624,
-0.11904598772525787,
0.0342252254486084,
0.03163410723209381,
0.329014390707016,
-0.25609683990478516,
0.009809578768908978,
-0.375861257314682,
0.8835258483886719,
... |
def init _ double _ deep _ collection ( dim, n, num _ boxes _ per _ step, num _ cells, rng, betas = none ) : lhs = [ [ ] ] deep _ ps _ collection = [ ] deep _ cs _ collection = [ ] for i in range ( num _ boxes _ per _ step ) : l, h = choose _ cell ( rng, num _ cells = num _ cells, d = dim ) rng, _ = random. split ( rng... | [
-1.235264778137207,
0.546364963054657,
0.7342919111251831,
0.5973723530769348,
-0.03931796923279762,
0.4411945641040802,
0.11265730112791061,
-0.5878839492797852,
-1.0141115188598633,
-0.24761822819709778,
-1.2526886463165283,
0.2906143367290497,
0.4130951762199402,
1.0653849840164185,
-... |
def _ normalize _ contractions _ text ( text, contractions ) : new _ token _ list = [ ] token _ list = text. split ( ) for word _ pos in range ( len ( token _ list ) ) : word = token _ list [ word _ pos ] first _ upper = false if word [ 0 ]. isupper ( ) : first _ upper = true if word. lower ( ) in contractions : replac... | [
-0.41194871068000793,
-0.5372515916824341,
0.6685839891433716,
0.332817405462265,
-0.9166774153709412,
-0.7961170077323914,
0.13639679551124573,
1.1913425922393799,
0.25803613662719727,
0.7227739691734314,
-0.06653563678264618,
-0.6254006624221802,
-1.5196613073349,
0.2974281311035156,
-... |
async def send _ bot _ help ( self, mapping : mapping [ optional [ commands. cog ], list [ commands. command ] ] ) : dest = self. get _ destination ( ) await dest. send ( embed = self. get _ bot _ help ( mapping ) ) | [
-0.7301911115646362,
0.4768109917640686,
0.40460294485092163,
0.8337740302085876,
0.10607084631919861,
0.7169872522354126,
-0.34484022855758667,
0.5155752301216125,
-0.981368362903595,
0.4678170382976532,
-0.35674360394477844,
1.070084571838379,
0.838931679725647,
0.11901622265577316,
-0... |
def read _ neurone _ protocol ( fpath ) : # define filename fname _ protocol = path. join ( fpath, " protocol. xml " ) fname _ session = path. join ( fpath, " session. xml " ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # read the protocol data # - - - - - - - -... | [
-0.06522412598133087,
-0.18409588932991028,
0.7582340240478516,
-0.735152542591095,
-1.0125212669372559,
-0.3587875962257385,
0.061940986663103104,
-0.15363475680351257,
-0.5461429357528687,
0.6697681546211243,
0.4442431330680847,
-0.047004543244838715,
-0.4830625057220459,
-0.436768829822... |
def test _ main ( kafka _ mock ) : host _ config = producer. healthcheckconfig ('example. com ', 5 ) producer. produce ( kafka _ mock,'test - topic ', [ host _ config ] ) kafka _ mock. send. assert _ called _ once ( ) | [
0.3218111991882324,
0.8767646551132202,
0.41948819160461426,
1.2777538299560547,
0.38015520572662354,
0.16033975780010223,
0.4201030135154724,
0.05863134190440178,
-0.601482629776001,
0.26280680298805237,
0.13645434379577637,
-0.3487263321876526,
-0.27839747071266174,
-0.23689697682857513,... |
def getboundingbox ( self, point, image, scale = 1. 0 ) : size = point. size * scale minc = int ( max ( 0, point. pt [ 0 ] - size ) ) maxc = int ( min ( 640, minc + 2 * size ) ) minr = int ( max ( 0, point. pt [ 1 ] - size ) ) maxr = int ( min ( 480, minr + 2 * size ) ) return image [ minr : maxr, minc : maxc, : ] | [
-0.3176319897174835,
-0.510516345500946,
0.7082076072692871,
1.0256927013397217,
-0.5046475529670715,
-0.5810521245002747,
-0.967727541923523,
-0.8515235185623169,
0.5348020195960999,
0.3796564042568207,
0.17743688821792603,
0.6073737144470215,
-0.10331235080957413,
0.6339249610900879,
0... |
def getimages ( first, last, shape ) : andor _ solis. getimages. restype = ctypes. c _ uint arr = ( ctypes. c _ long * shape [ 0 ] * shape [ 1 ] ) ( ) size = shape [ 0 ] * shape [ 1 ] * int ( abs ( last - first ) ) validfirst = ctypes. c _ long ( ) validlast = ctypes. c _ long ( ) result = andor _ solis. getimages ( ct... | [
-0.3214293122291565,
-0.20155276358127594,
0.7378168106079102,
-0.07135456800460815,
0.4632958173751831,
-0.8196872472763062,
-0.5391917824745178,
-0.605023980140686,
-0.06887973099946976,
0.40172863006591797,
-0.17970257997512817,
0.6540427803993225,
-0.07133807241916656,
0.26135393977165... |
def set _ scan _ config ( self, profile ) : profiles = { } profiles [ " lazy " ] = { " max _ cellid _ time " : 600, " max _ cellid _ dist " : 500, " min _ wlan _ time " : 6, " max _ wlan _ time " : 3600, " max _ wlan _ dist " : 10000, } profiles [ " turbo " ] = { " max _ cellid _ time " : 180, " max _ cellid _ dist " :... | [
-0.8238992094993591,
0.04899460822343826,
0.42573413252830505,
0.5917529463768005,
-0.3680453896522522,
0.07812374830245972,
-0.466109961271286,
-0.07947274297475815,
-0.3693787455558777,
0.5702559351921082,
-1.3290899991989136,
-0.7093102931976318,
0.09937280416488647,
1.096723198890686,
... |
def df _ to _ json ( df, file ) : df. to _ json ( path. abspath ( json _ path. format ( file ) ), orient ='records ', lines = true, compression ='gzip') | [
-0.5770823359489441,
-0.8171483278274536,
0.4006308913230896,
-0.48790523409843445,
0.3694268465042114,
-0.3752804696559906,
0.13575227558612823,
0.07359033077955246,
-1.4915450811386108,
0.47170811891555786,
-0.3934323191642761,
0.9299207925796509,
1.059410572052002,
-0.18050403892993927,... |
def process _ message ( self, message ) : logging. info ( " got message : % s ", message ) intent, ents = self. nlp. parse _ intent ( message ) return self. process _ intent ( intent, ents ) | [
-0.02813510224223137,
-0.47254523634910583,
0.5420999526977539,
-0.5111218094825745,
0.03494129702448845,
-0.04609503969550133,
-0.37056148052215576,
-0.7254524827003479,
0.48610299825668335,
-0.3673001527786255,
0.6483376026153564,
0.05779612809419632,
-1.1461777687072754,
0.2011710405349... |
def _ node _ io _ loop _ prepare ( self, root _ nodes ) : return [ none ], [ root _ nodes ] | [
-0.43107011914253235,
-0.49272674322128296,
0.11805813759565353,
-0.031035972759127617,
0.2674356698989868,
-0.41880181431770325,
-0.0915139839053154,
-0.4770614206790924,
-0.5125076770782471,
0.6460014581680298,
0.3709318935871124,
0.1900181770324707,
0.0515253059566021,
0.308086812496185... |
def generate _ prob _ map ( self, image _ size, center _ location ) : center _ x = int ( round ( center _ location [ 0 ] ) ) center _ y = int ( round ( center _ location [ 1 ] ) ) if center _ x > = image _ size [ 0 ] : center _ x = image _ size [ 0 ] - 1 if center _ y > = image _ size [ 1 ] : center _ y = image _ size ... | [
-0.6198095679283142,
-1.2930068969726562,
0.7807636857032776,
-0.6267841458320618,
0.23023512959480286,
0.2432362139225006,
0.10781562328338623,
0.7244279980659485,
0.7435939311981201,
1.0268073081970215,
0.5743210315704346,
0.06661398708820343,
0.10096313059329987,
0.2182503044605255,
0... |
def wordcounter ( ) : text = ( open ( '. / resources / big. txt ','r') ). read ( ) words = re. findall ( r'\ w + ', text. lower ( ) ) wordtypes _ n _ counts = counter ( words ) # types = 32198, tokens = 1115585 return wordtypes _ n _ counts | [
0.5807333588600159,
0.09819651395082474,
0.5264184474945068,
-1.0883642435073853,
0.14809831976890564,
0.14562533795833588,
0.47580817341804504,
0.5284241437911987,
-0.34259605407714844,
0.6061878800392151,
-0.49778810143470764,
0.02721669152379036,
-0.21315306425094604,
1.2132441997528076... |
def get _ resource ( self, url ) : # set up headers headers = dict ( ) headers. update ( {'accept':'application / json'} ) # do the get resource r = requests. get ( url, headers = headers, verify = self. verify, proxies = self. proxies ) # if successful return the json data or empty json if 200 = = r. status _ code : i... | [
-0.7485532760620117,
-0.6341113448143005,
0.8561142086982727,
-0.4411282241344452,
-0.8340163826942444,
-0.9174511432647705,
-1.2591838836669922,
-0.37391504645347595,
0.23003500699996948,
0.4916878044605255,
-0.5240999460220337,
0.35096418857574463,
-0.5798590183258057,
-0.377421885728836... |
def recalculate _ step ( self, width ) : self. duration = abs ( self. upper - self. lower ) # every n - th pixel.. marks = width / 7 step = float ( self. duration ) / marks if step < 10 : pass elif step < 60 : step = int ( step / 5 ) * 5 elif step < 300 : step = 60 elif step < 1800 : step = int ( step / 120 ) * 120 eli... | [
-0.9268500804901123,
0.19883102178573608,
0.6492868661880493,
0.1444343626499176,
-0.6673212647438049,
-0.5224447250366211,
0.4031202495098114,
-0.8805042505264282,
-0.14252528548240662,
-0.36792439222335815,
-0.2379235476255417,
-0.470371276140213,
0.028491545468568802,
1.5415223836898804... |
def get _ tile _ south _ neighbor ( self, tile ) : return self. _ get _ tile _ neighbor ( tile, " south " ) | [
0.6548658013343811,
0.2874830663204193,
0.47055283188819885,
0.7102109789848328,
-0.6348865032196045,
0.5376972556114197,
0.4392872750759125,
-1.102826714515686,
-0.30919283628463745,
0.23430079221725464,
-1.3602648973464966,
0.7311683893203735,
-0.18194076418876648,
-0.4140177071094513,
... |
def line _ maker ( seq ) : geno = [ ] # asso = ['ac ','ag ','at ','cg ','ct ','gt'] dico _ multiphasta = {'a / c':'m ','a / g':'r ','a / t':'w ','c / g':'s ','c / t':'y ','g / t':'k'} for allele in seq : # possible cases # missing data if allele = ='- -': geno. append ( "? " ) # hmz alleles elif len ( allele ) = = 1 : ... | [
-0.16073434054851532,
-0.5656169056892395,
0.7378736138343811,
0.23728562891483307,
-0.5368095636367798,
0.5357308983802795,
-0.9170814752578735,
0.8070862889289856,
0.20895934104919434,
0.12385343760251999,
-0.7659706473350525,
-0.4503346085548401,
0.8405914306640625,
0.5448718667030334,
... |
def video _ page ( self, url, vid = none ) : if vid is none : return none # post _ url = ('https : / / sv. baidu. com / haokan / api?'#'cmd = comment / getreply & log = vhk & tn = 1001128v & ctn = 1001128v'#'& imei = 279014587228348'#'& cuid = c577c0f8f6aa9ffe3e41cb0b3e507a14 | 843822785410972'#'& os = android & osbran... | [
-0.13481344282627106,
0.4024370610713959,
1.3291995525360107,
0.807958722114563,
0.06600409746170044,
-0.217074915766716,
0.6585612297058105,
0.12409499287605286,
0.44607511162757874,
0.2058720886707306,
0.08399000018835068,
-0.043012045323848724,
-1.073269248008728,
0.16908009350299835,
... |
def rotation _ default ( self ) : if self. config. displayorientation = = win32con. dmdo _ 90 or \ self. config. displayorientation = = win32con. dmdo _ 270 : self. swap _ pels ( ) self. config. displayorientation = win32con. dmdo _ default self. apply _ config ( ) | [
-0.2344617396593094,
0.8483538031578064,
0.4414915144443512,
-0.06332428753376007,
-0.12036693841218948,
0.3684382140636444,
1.2521731853485107,
-0.14790064096450806,
0.44132691621780396,
0.2445322424173355,
-0.1311219334602356,
-0.04303129389882088,
-1.1218962669372559,
0.3373932540416717... |
def register ( request ) : if request. method = = " post " : post = request. post form = registrationform ( post ) if not form. is _ valid ( ) : return httpresponse ( " invalid registration request ", status = 400 ) if not post [ " password " ] = = post [ " passwordconf " ] : return httpresponse ( " passwords do not ma... | [
-0.5320147275924683,
0.753354549407959,
0.9621064066886902,
1.0740923881530762,
0.19286948442459106,
0.21382667124271393,
0.2507900595664978,
0.26824086904525757,
-0.5344934463500977,
-0.4574965536594391,
-0.37414008378982544,
-0.3589842915534973,
0.1644473671913147,
0.3452984690666199,
... |
def inject _ year _ week _ sentiment _ analysis ( db _ connector : connector, google _ client : languageserviceclient, redis _ manager : redismanager, list _ week _ year : list, company _ id : str ) - > dict : week _ s, year _ s, week _ e, year _ e = extract _ first _ last _ weeks ( list _ week _ year ) period = { " st... | [
-0.28544673323631287,
0.7090572714805603,
0.6781383752822876,
-1.3592973947525024,
0.0579608790576458,
-0.16907522082328796,
-0.6977893114089966,
-0.1964680254459381,
1.1966243982315063,
0.5540986061096191,
-0.0664515346288681,
0.11286073923110962,
-0.4356159567832947,
0.5052818655967712,
... |
def brute _ force ( market _ close _ prices ) : max _ profit = 0 for buy _ day in range ( 0, len ( market _ close _ prices ) ) : for sell _ day in range ( buy _ day + 1, len ( market _ close _ prices ) ) : # if marketcloseprices [ buyday ] > budget : # continue curr _ profit = market _ close _ prices [ sell _ day ] - m... | [
-0.8668289184570312,
0.28000444173812866,
0.7724016308784485,
1.1797086000442505,
0.03150201961398125,
0.5142799019813538,
-0.10482336580753326,
-0.438931941986084,
-0.2016594260931015,
0.314755916595459,
0.5582181215286255,
-0.41557106375694275,
-1.0140100717544556,
0.13435223698616028,
... |
def execute _ row0 ( self, sql, * params ) - > optional [ dict [ str, any ] ] : cursor = self. _ _ conn. cursor ( as _ dict = true ) cursor. execute ( sql, * params ) rows = cursor. fetchall ( ) cursor. close ( ) n = len ( rows ) if n = = 1 : return rows [ 0 ] elif n = = 0 : return none else : raise resultexception ('0... | [
-0.2152647078037262,
0.8168357610702515,
0.6508346796035767,
1.013411283493042,
0.3340945541858673,
-0.6416357159614563,
-0.7017046809196472,
-0.4703536927700043,
-0.1589219719171524,
0.1734207570552826,
0.849701464176178,
-0.20032350718975067,
0.04581940919160843,
1.157575249671936,
-0.... |
def serialize ( self ) : return {'name': self. name,'shade': self. shade,'quantity': self. quantity,'skintype': self. skintype,'price': self. price,'date': self. date,'id': self. id } | [
-1.1714894771575928,
-0.9234737753868103,
0.6103261709213257,
-0.7868162989616394,
-1.0726064443588257,
-0.303701251745224,
-0.5776206851005554,
-1.2892316579818726,
0.3802274763584137,
-0.23003295063972473,
-1.7723888158798218,
0.5555895566940308,
0.1946667581796646,
0.9975203275680542,
... |
def display ( self ) : if self. alarm _ temp ( self. _ temp ) : print ( " * * * urgent : attend immediately * * * " ) print ( f " name : { self. _ name } ; id : { self. _ id } ; temp : { self. _ temp } ° \ n " ) | [
0.796972393989563,
-1.6812721490859985,
0.6959912776947021,
-0.3751731216907501,
-0.5922254920005798,
1.1527423858642578,
0.016534533351659775,
-0.3811439573764801,
0.0011853583855554461,
0.46534207463264465,
0.194173663854599,
1.2207061052322388,
0.5059325098991394,
0.3636742830276489,
... |
def quat ( self, new _ quat ) : self. _ rot = rotation. from _ quat ( np. asarray ( new _ quat ) ) | [
-0.5509232878684998,
-0.5590083599090576,
0.2576492726802826,
-1.2389112710952759,
0.13919483125209808,
-0.5171840190887451,
-0.8240405917167664,
-0.8070235252380371,
0.2158946394920349,
0.11853337287902832,
-0.6351792812347412,
0.43039634823799133,
0.3563731610774994,
-1.0281771421432495,... |
def columns _ used ( self, *, using = none ) : self. _ clear _ columns _ currently _ used ( ) self. _ columns _ used _ implementation ( using = using ) tables = self. get _ tables ( ) columns _ used = { k : v. columns _ currently _ used. copy ( ) for ( k, v ) in tables. items ( ) } return columns _ used | [
-1.33053457736969,
-0.21988394856452942,
0.5795601606369019,
0.2922426760196686,
-0.4788454473018646,
-0.3201533257961273,
0.9494529366493225,
-1.1734416484832764,
-1.0859709978103638,
-0.05111631751060486,
-1.261473298072815,
0.45795348286628723,
0.10606950521469116,
0.3887362778186798,
... |
def syllable _ range ( self, begin, end ) : sylls = self. syllabification if begin not in range ( 0, len ( sylls ) ) : raise valueerror ( " begin value % s out of range " % begin ) if end not in range ( 0, len ( sylls ) + 1 ) : raise valueerror ( " end value % s out of range " % end ) cursor = 0 words _ in _ range = [ ... | [
0.1354137659072876,
-0.5912220478057861,
0.6465497612953186,
-0.010664024390280247,
-0.22271132469177246,
-0.6327118277549744,
0.6820518374443054,
0.06762446463108063,
-0.2944343090057373,
1.0692552328109741,
-0.09238754212856293,
0.8212154507637024,
-0.8688398599624634,
0.5500103235244751... |
def _ setup _ drydock _ client ( self ) : # retrieve endpoint information self. drydock _ svc _ endpoint = self. endpoints. endpoint _ by _ name ( service _ endpoint. drydock ) log. info ( " drydock endpoint is % s ", self. drydock _ svc _ endpoint ) # parse drydock service endpoint drydock _ url = urlparse ( self. dry... | [
-0.8123396039009094,
-0.36914846301078796,
0.680659830570221,
-0.45086291432380676,
0.5950977206230164,
-0.18876144289970398,
1.0913625955581665,
-0.12879647314548492,
-0.20139242708683014,
-0.660716712474823,
0.15862363576889038,
0.6323426961898804,
0.45454350113868713,
-0.521451950073242... |
def forward ( self, inputs, hidden ) : import pdb ; pdb. set _ trace ( ) embed = self. seq ( inputs ) batch _ size = embed. size ( 0 ) both = torch. cat ( inputs, dim = 2 ) embeds = both. view ( - 1, sum ( self. input _ dims ) ) import pdb ; pdb. set _ trace ( ) # embeds = self. bn1 ( embeds ) embeds = self. fc1 ( embe... | [
0.21930944919586182,
-0.26918500661849976,
0.6348487734794617,
0.27579525113105774,
-0.30373048782348633,
0.6904240250587463,
0.27694952487945557,
0.31873294711112976,
-0.15842202305793762,
-0.5160577893257141,
-0.584076464176178,
0.5660641193389893,
0.19988074898719788,
0.4257409572601318... |
def periodicbox ( pos, l ) : # find and correct particles at the left and down border pos = np. where ( pos < = l, pos, pos % l ) # find an correct particles at the upper and right border pos = np. where ( pos > = 0, pos, pos % l ) return pos | [
0.18052475154399872,
-0.6090563535690308,
0.6811737418174744,
-0.6483640670776367,
-0.3328995108604431,
-0.34905725717544556,
-0.6517424583435059,
-0.1611143797636032,
0.2186022847890854,
-0.5839783549308777,
-0.14679105579853058,
-0.11490170657634735,
-0.8616716265678406,
0.25193092226982... |
def prevent _ incorrect _ plt ( * * kwargs ) : return plt _ rename _ err ( * * kwargs ) or plt _ wrong _ import ( * * kwargs ) | [
0.8945766091346741,
-0.21470262110233307,
0.16817471385002136,
0.3140747547149658,
-0.8363401889801025,
0.9512397050857544,
0.12479749321937561,
-1.1997582912445068,
-0.05894668400287628,
0.6823948621749878,
0.19439218938350677,
1.8271753787994385,
-0.05584621801972389,
0.16639909148216248... |
def demo _ random ( env : unityagents. unityenvironment ) - > float : brain _ name = env. brain _ names [ 0 ] brain = env. brains [ brain _ name ] action _ size = brain. vector _ action _ space _ size env _ info = env. reset ( train _ mode = false ) [ brain _ name ] states = env _ info. vector _ observations num _ agen... | [
-0.6338269710540771,
-0.09958352148532867,
0.840943455696106,
-0.4472665786743164,
0.5203658938407898,
-0.11810309439897537,
0.5731646418571472,
-0.3980303704738617,
0.43904390931129456,
0.9401357769966125,
0.2024032026529312,
0.43363243341445923,
0.015653064474463463,
0.35034480690956116,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.