text
stringlengths
25
2.19k
embedding
listlengths
768
768
def min _ max _ normalize ( self, data, data _ min = pd. dataframe ( ), data _ max = pd. dataframe ( ) ) : if ( data _ min. empty ) : data _ min = data. min ( ) if ( data _ max. empty ) : data _ max = data. max ( ) data _ normalized = ( data - data _ min ) / ( data _ max - data _ min ) return ( data _ min, data _ max, ...
[ -0.3616047203540802, 0.10253402590751648, 0.42641639709472656, 0.08394241333007812, -0.021625956520438194, -0.17746402323246002, -1.4389464855194092, 0.3630468547344208, -0.18661214411258698, -0.03207213059067726, -0.6984019875526428, 0.46784359216690063, -0.4087963104248047, -0.1725994944...
def create _ schema _ template ( self, template : template ) : bytes _ array = template. serialize request = tscreateschematemplatereq ( self. _ _ session _ id, template. get _ name ( ), bytes _ array ) status = self. _ _ client. createschematemplate ( request ) logger. debug ( " create one template { } template name :...
[ -1.6004772186279297, 0.3945121765136719, 0.4469902515411377, -0.10030673444271088, 0.23251153528690338, 0.08897131681442261, -0.5384230613708496, -0.17557866871356964, 0.7540861964225769, 0.09579530358314514, -1.1201987266540527, -0.6583014726638794, -1.0570613145828247, -0.554511845111846...
def get _ total _ memory ( * * kwargs ) : mem = psutil. virtual _ memory ( ) return mem. total
[ 0.4065777361392975, -0.24707071483135223, 0.3953472673892975, 0.024697018787264824, 0.6631975769996643, -0.43157216906547546, 0.022290125489234924, -0.3870663046836853, 0.06416544318199158, 0.5481289029121399, -0.67364901304245, 0.5865245461463928, -0.8525969982147217, -0.17237530648708344...
def _ finish ( self ) : if self. _ process. returncode is none : self. _ process. stdin. flush ( ) self. _ process. stdin. close ( ) self. _ process. wait ( ) self. closed = true
[ 0.3006984293460846, -0.6860727071762085, 0.5469369888305664, -0.1632097363471985, -0.13767248392105103, 0.8296825289726257, 0.02853136882185936, -0.5605732798576355, -1.1064850091934204, -0.25152456760406494, -0.25745144486427307, 0.11448885500431061, -0.8623164892196655, 0.786615490913391...
def consume ( self, stream, source = none, chunksize = 1 ) : stats = { processing _ total : 0, processing _ skipped : 0, processing _ success : 0, processing _ error : 0 } if source : stats ['source'] = source def skip _ unless ( r ) : if r : return r stats [ processing _ skipped ] + = 1 stats [ processing _ total ] + ...
[ -0.49073612689971924, 0.406560480594635, 0.9312955737113953, -0.8637162446975708, -0.5363569855690002, -0.6311900019645691, 0.5620822906494141, -0.4432927370071411, -0.25367334485054016, 0.16887010633945465, 0.015781428664922714, 0.2476866990327835, -0.14590656757354736, 0.52083420753479, ...
def onmessagereceived ( self, messageview ) : raise notimplementederror
[ 0.3690387010574341, -0.7381361126899719, 0.619677722454071, -0.4150279462337494, -0.20877614617347717, 0.046333830803632736, 0.12959526479244232, 0.2775512635707855, 0.4623928964138031, -1.066082239151001, 0.10612156242132187, -0.3136691153049469, 0.28706493973731995, 0.3257297873497009, ...
def notify ( self, subject, index ) : self. _ _ setitem _ _ ( index, subject )
[ -0.1569441258907318, 0.17997074127197266, 0.043102361261844635, -0.7633540630340576, 0.1845969408750534, -0.08015673607587814, -0.6473530530929565, -0.3538844585418701, -0.3359147012233734, 0.1517757773399353, -1.2626018524169922, 1.6365814208984375, 0.3244810402393341, -0.6506357789039612...
def test _ query _ eod _ history _ db ( self ) : def mock _ get _ history _ db _ config ( db ) : return { " bar _ size " : " 1 day ", " universes " : [ " usa - stk " ], " vendor " : " ibkr ", " fields " : { " close " : " float ", " open " : " float ", " high " : " float ", " low " : " float ", " volume " : " float " } ...
[ -0.2808227837085724, 0.31105801463127136, 0.7571641206741333, -0.520456075668335, 0.6356423497200012, -0.11962991952896118, 0.6897367835044861, -0.32046860456466675, 0.29560980200767517, 0.16286049783229828, -0.044475384056568146, -0.06503389030694962, -0.1449800431728363, 0.37997612357139...
def find _ all _ candidates ( doc, noun _ chunk _ spans ) : all _ nounps = [ ] already _ in = set ( ) for noun _ chunk in noun _ chunk _ spans : all _ nounps. append ( noun _ chunk ) already _ in. add ( noun _ chunk. text. strip ( ) ) # extract phrase from left to right edges of the noun chunk noun _ phrase = doc. doc ...
[ 0.5939603447914124, -0.715465247631073, 0.622319221496582, -0.02146984450519085, -0.37863248586654663, 0.4790782928466797, -0.46591317653656006, -0.38567420840263367, 0.5813398957252502, 0.4603370726108551, -0.0931873470544815, -0.0187450610101223, -0.5661481022834778, 0.9555385112762451, ...
def create _ deployment ( self, name, model _ uri, flavor = none, config = none, endpoint = none ) : final _ config = self. _ default _ deployment _ config ( ) if config : self. _ apply _ custom _ config ( final _ config, config ) app _ name, flavor = _ deploy ( app _ name = name, model _ uri = model _ uri, flavor = fl...
[ -0.020629970356822014, -0.40690213441848755, 0.7760955095291138, -0.12271718680858612, -0.9131035804748535, -0.3419997990131378, -0.34214290976524353, 0.5486178398132324, -0.2132868766784668, 1.674331545829773, -0.8083329796791077, 0.016215750947594643, -0.09277431666851044, 0.145123347640...
def invalid _ yes _ or _ no _ option ( ) : print ( " invalid y / n option, choose again : " )
[ 0.41406121850013733, -1.0721399784088135, 0.15106087923049927, 0.9153162837028503, 0.035739216953516006, 0.4992233216762543, 0.527101457118988, -0.013742111623287201, -0.19153212010860443, -0.3336923122406006, -0.13312885165214539, 1.1477502584457397, 0.2146327793598175, 0.267672598361969,...
def listener ( event ) : test _ events. append ( event )
[ 0.9458871483802795, -0.5538038611412048, 0.2530633509159088, -0.47348663210868835, 0.8514513373374939, 0.8397908806800842, 0.1456306129693985, 0.10837633162736893, 0.7456162571907043, -0.2826399505138397, -1.077197790145874, 0.23801358044147491, -0.2795581817626953, 0.2670053541660309, -...
def test _ add _ feature _ parameter ( self ) : pass
[ -0.4471539258956909, 0.6660085916519165, 0.3824296295642853, 1.5291690826416016, 1.0136994123458862, 0.4895073473453522, 1.185104489326477, 0.11662829667329788, -0.0697801411151886, -0.4069015085697174, -0.802423357963562, 0.3765873610973358, -0.28958791494369507, 0.9105405211448669, -1....
def get _ service _ type _ resource _ types _ view ( request ) : service _ type = ar. get _ value _ matchdict _ checked ( request, " service _ type " ) ax. verify _ param ( service _ type, paramcompare = service _ type _ dict. keys ( ), isin = true, httperror = httpnotfound, msgonfail = s. servicetyperesourcetypes _ ge...
[ -0.3388787806034088, -0.06425435096025467, 0.4732005298137665, -0.47581782937049866, -0.03292274475097656, 0.34396910667419434, 0.6299540400505066, -0.9423982501029968, 0.09048236161470413, 0.3017089366912842, 1.2675139904022217, 0.032781414687633514, 0.03537861630320549, 0.592340230941772...
def parse _ genome ( self, details ) : for regex in hgvsregex. genomic _ allele _ regexes : match = re. match ( regex, details ) if match : groups = match. groupdict ( ) # parse mutation type. if groups. get ('delins') : self. mutation _ type ='delins'else : self. mutation _ type = groups ['mutation _ type'] # parse co...
[ -0.05877196043729782, 0.1816970407962799, 0.707929253578186, 0.14908158779144287, -0.03093102015554905, -0.14976361393928528, -0.6253417730331421, 0.16251200437545776, -0.27685582637786865, -0.01872418448328972, -0.18856863677501678, 0.6267125010490417, 0.1631002128124237, 0.45036146044731...
def get _ ex ( self ) : return self. ex
[ 0.24588142335414886, 0.34170615673065186, 0.3921736478805542, 0.7565091252326965, -0.2736334502696991, 0.5565557479858398, -0.22359515726566315, 0.6689429879188538, 0.8177154064178467, -0.8385958671569824, 0.1702459305524826, 1.0549448728561401, -0.22280310094356537, -0.7185900807380676, ...
def read ( filename ) : conf = {'webserver': { },'kafka': { },'redis': { },'hadoop': { },'consumer': { },'mongo': { },'oss': { },'resultlog': { } } config = configparser. configparser ( ) try : config. read ( filename ) conf ['webserver'] ['host'] = config. get ('webserver ','host') conf ['webserver'] ['port'] = int ( ...
[ -0.19655953347682953, -0.6015923023223877, 1.0226008892059326, -0.14776721596717834, -0.5409725904464722, -0.13473208248615265, 0.42969414591789246, 1.0948642492294312, -1.3639906644821167, 0.5479098558425903, -1.0124589204788208, -0.21627220511436462, -0.2647397518157959, 1.0200275182724,...
def shape ( self ) - > tuple [ int, int, int ] : return ( self. nx, self. ny, self. nz )
[ -0.9055173397064209, 0.3371036648750305, 0.2537519931793213, -0.04381832480430603, 0.8781418204307556, 0.7559359073638916, 0.42714881896972656, -0.5619165897369385, 0.34283900260925293, -0.07274067401885986, -1.011881709098816, -1.112442970275879, -0.4766542613506317, 0.02692381478846073, ...
def get ( resource _ name : str, id : pulumi. input [ str ], opts : optional [ pulumi. resourceoptions ] = none, created _ time : optional [ pulumi. input [ str ] ] = none, custom _ oss _ bucket : optional [ pulumi. input [ str ] ] = none, end _ time : optional [ pulumi. input [ str ] ] = none, instance _ name : option...
[ -0.8865935206413269, 0.4106855094432831, 0.42936795949935913, -1.0156285762786865, -0.10086693614721298, 0.0948757603764534, 0.11218755692243576, 0.8168995976448059, 1.0815587043762207, 0.9522863626480103, -0.6420614719390869, 0.7006900906562805, -0.8475661277770996, -0.7998180389404297, ...
def create _ map _ from _ reformulation ( path ) : # read in characters in keyslots keyslots = get _ keyslots ( ) characters = get _ characters ( ) # read in mst file line by line and create mapping mst = codecs. open ( path,'r ', encoding = " utf - 8 " ) first _ line = mst. readline ( ) # optimization parameters snd _...
[ -0.48191171884536743, -1.0303955078125, 0.6636974215507507, -0.455586314201355, -2.199700355529785, 0.48222965002059937, -0.034124575555324554, 0.6567444205284119, -0.7392289042472839, 0.9680498838424683, -0.49464717507362366, 0.41391870379447937, 1.0547831058502197, -0.14796273410320282, ...
def find _ record ( self, uri, * * kwargs ) : pass
[ -0.49280527234077454, 0.03128905966877937, 0.43380409479141235, 0.20220279693603516, 0.3416248857975006, -0.27200037240982056, 0.018805835396051407, -0.5013666152954102, -0.676556408405304, -0.3220209777355194, 0.3227772116661072, 0.3427527844905853, -1.728691577911377, -0.1003038808703422...
def _ _ init _ _ ( self, shape = none, mask = none, default = none, array = none, distributed = false ) : self. distributed = distributed self. mask = mask shapes = [ ] if shape is not none : shapes. append ( shape ) if mask is not none : shapes. append ( mask. shape ) if array is not none : default = array if default ...
[ 0.14560706913471222, 0.45229849219322205, 0.5432732105255127, 1.0337421894073486, 1.0958653688430786, -0.31514614820480347, 0.4783777892589569, -0.26337042450904846, 0.6222417950630188, -0.0824827253818512, -0.6138539910316467, -0.5185366868972778, 0.27976229786872864, 0.32008033990859985,...
def link ( self ) - > optional [ str ] : return pulumi. get ( self, " link " )
[ 0.8647932410240173, 0.616234540939331, 0.4435634911060333, 0.7193742990493774, 1.9480863809585571, 1.5143018960952759, 0.02394075132906437, 0.18869644403457642, 0.8665002584457397, -0.8073462247848511, 0.519707441329956, 1.2029714584350586, -0.08775115758180618, -1.3462364673614502, -1.0...
def create _ xvg _ connection ( ) : access = authserviceproxy ( " http : / / verge : 12345678 @ 47. 88. 59. 130 : 2300 " ) return access
[ -0.6568332314491272, 0.08265300840139389, 0.5180031657218933, -0.9022002816200256, 0.20890983939170837, -1.061142921447754, -0.489480197429657, 0.4258022606372833, 0.220240518450737, 0.3799993097782135, 0.4523671269416809, 0.2881154417991638, -1.212172031402588, -0.73676598072052, -0.037...
def getaverageipscalarrange ( self ) :...
[ -1.4442487955093384, -0.11651001870632172, 0.3170231282711029, -0.13816145062446594, -0.6550021171569824, -0.22613470256328583, -0.2649761736392975, -0.7237379550933838, -0.6907863020896912, 0.2705216705799103, -0.122285857796669, 0.11724338680505753, -0.09949332475662231, -0.1159856766462...
def file _ type _ code ( self, file _ type _ code : str ) : if file _ type _ code is none : raise valueerror ( " invalid value for ` file _ type _ code `, must not be ` none ` " ) # noqa : e501 self. _ file _ type _ code = file _ type _ code
[ 0.08603164553642273, -0.26234838366508484, -0.38919907808303833, 0.4080662727355957, 0.99690842628479, 0.3580351769924164, 0.3595832586288452, 0.40028294920921326, -0.5519182682037354, -0.08779142051935196, 0.1810724139213562, -0.04010828956961632, -0.2255416065454483, 0.5665938258171082, ...
def getconnectedsidesbyvertex ( side ) : connsidesatvtx1 = side. endpoints [ 0 ]. getallsidesexcept ( side. id ) connsidesatvtx2 = side. endpoints [ 1 ]. getallsidesexcept ( side. id ) return ( connsidesatvtx1, connsidesatvtx2 )
[ 0.19121204316616058, -0.34907305240631104, 0.77828449010849, -0.4300709068775177, 0.07521408796310425, -0.10170163214206696, -0.7261350154876709, -0.9939035177230835, -0.46063023805618286, 0.732099711894989, -1.0383268594741821, -0.2096271514892578, -0.39565587043762207, -0.318885594606399...
def _ _ virtual _ _ ( ) : if _ _ grains _ _ [ " os " ] in ( " debian ", " raspbian ", " devuan ", " nilinuxrt ", ) and not salt. utils. systemd. booted ( _ _ context _ _ ) : return _ _ virtualname _ _ else : return ( false, " the debian _ service module could not be loaded : " " unsupported os family and / or systemd r...
[ -0.32127755880355835, 0.2393585741519928, 0.5892848968505859, 0.36540257930755615, -0.7777685523033142, 0.6161811351776123, -0.47676119208335876, -0.5038264989852905, -0.15481142699718475, 0.15129800140857697, 0.3057764768600464, -0.13620899617671967, -0.3814980089664459, 0.795759856700897...
def create _ table ( self, table _ def ) : table _ name = table _ def [ 0 ] table _ data = table _ def [ 1 ] args = [ table _ name, self. metadata ] constraints = [ ] # first column is always'id'args. append ( column ('id ', integer, primary _ key = true ) ) for col in table _ data. items ( ) : col _ name = col [ 0 ] t...
[ -0.46584397554397583, 0.34431192278862, 0.4730684161186218, 0.5060957670211792, 0.9174217581748962, 0.18952439725399017, -0.43510702252388, 0.16944891214370728, -0.9125335216522217, 0.1425788551568985, -0.37656480073928833, 0.09727708250284195, -0.002634086413308978, 0.0027221913915127516,...
def record _ deployed _ values ( deployed _ values : dict [ str, any ], filename : str ) - > none : final _ values : dict [ str, any ] = { } if os. path. isfile ( filename ) : with open ( filename,'r') as f : final _ values = json. load ( f ) final _ values. update ( deployed _ values ) with open ( filename,'wb') as ou...
[ -0.015455535613000393, -0.6319167017936707, 0.6547814011573792, -0.2949048578739166, 0.3198562562465668, 0.776091456413269, -0.13650059700012207, 0.3521236479282379, -0.5929749608039856, 0.3561626970767975, -0.5199745297431946, 0.43297043442726135, 0.8272737860679626, 0.8489190340042114, ...
def reconnect ( self ) : print ( " reconnect " ) if len ( self. _ host ) = = 0 : raise valueerror ('invalid host.') if self. _ port < = 0 : raise valueerror ('invalid port number.') self. _ in _ packet = { " command " : 0, " have _ remaining " : 0, " remaining _ count " : [ ], " remaining _ mult " : 1, " remaining _ le...
[ -0.5654770731925964, -0.3587290346622467, 0.8039333820343018, -0.44786572456359863, -0.39916619658470154, -0.4348025918006897, 0.44142255187034607, -0.6499298810958862, -0.5620948076248169, -0.035680484026670456, -0.4193987250328064, -0.24352185428142548, -0.8113800287246704, -0.4269831478...
def parse _ template ( s, open _ brace ='< ', close _ brace ='> ', separator = ',') : if open _ brace not in s and close _ brace not in s : return s t = [ s. split ( open _ brace, 1 ) [ 0 ] ] targs = split _ template _ args ( s, open _ brace = open _ brace, close _ brace = close _ brace, separator = separator ) for tar...
[ -0.7626743316650391, 0.1767451912164688, 0.8313077688217163, 0.04745829477906227, -0.528641939163208, -0.6466324925422668, -0.09864196926355362, 0.4708380103111267, -0.5306491851806641, 0.10235950350761414, -0.7769953608512878, -1.2142088413238525, -0.3433685302734375, -0.2417234629392624,...
def symbolic _ probabilities ( symx ) : symx = np. array ( symx ) # initialize p = { } n = len ( symx ) for xi in symx : if xi in p : p [ xi ] + = 1. 0 / n else : p [ xi ] = 1. 0 / n return p
[ 0.5277633666992188, 0.24041356146335602, 0.4619483947753906, 0.24796104431152344, -0.2643490731716156, -0.3882733881473541, 0.7332053184509277, 0.2464888095855713, 0.752789318561554, 0.9168103933334351, -0.5909156203269958, -0.7506642937660217, 0.10231327265501022, 0.4673217535018921, 0....
def parse _ file ( self, filepath ='' ) : self. filepath = filepath # path of file if self. debug : print ( self. filepath ) # opens document and passes to beautifulsoup object. doc = open ( filepath ) soup = beautifulsoup ( doc,'html. parser') # obs! xml parser will not work with sec txt format # print document struct...
[ -0.04099515825510025, 0.07396494597196579, 0.8435758948326111, 0.14824190735816956, 0.6003543734550476, 0.5358416438102722, 0.8502103686332703, -0.16271430253982544, -0.9514325261116028, -0.003027381142601371, -0.12013835459947586, -1.0381712913513184, 0.30102136731147766, 0.73262768983840...
def _ normalize _ whitespace ( text ) : corrected = str ( text ) corrected = re. sub ( r " / / t ", r " \ t ", corrected ) corrected = re. sub ( r " ( ) \ 1 + ", r " \ 1 ", corrected ) corrected = re. sub ( r " ( \ n ) \ 1 + ", r " \ 1 ", corrected ) corrected = re. sub ( r " ( \ r ) \ 1 + ", r " \ 1 ", corrected ) cor...
[ 0.0007830837857909501, -0.5774260759353638, 0.6708996891975403, -0.9766964912414551, -1.2140955924987793, -0.4557746648788452, 0.5091052055358887, 0.08031074702739716, 0.31129637360572815, 0.6917628645896912, 0.4476446807384491, -0.020295048132538795, -0.16368468105793, 0.26076993346214294...
def get _ data ( self ) : self. current _ xbx _ price = self. _ _ get _ data ( ) # self. logger. info ( " xbx price is $ { } ". format ( self. current _ xbx _ price ) ) return self. current _ xbx _ price
[ -0.7724757790565491, -0.3779551684856415, 0.690567672252655, 0.3382163643836975, -0.12370562553405762, 0.16540312767028809, -0.7295063138008118, -0.7077224254608154, -0.41767939925193787, 0.4383851885795593, -0.46965038776397705, 0.7588061094284058, -0.7839009165763855, -0.5336431860923767...
def getstartindex ( self ) : return _ itkimageserieswriterpython. itkimageserieswriterius3ius2 _ getstartindex ( self )
[ -0.29092052578926086, -0.7281396389007568, 0.2023727148771286, 0.09792782366275787, 0.22027045488357544, 0.03366867080330849, -0.14463607966899872, 0.18616436421871185, 0.1334773749113083, 0.06347109377384186, -0.49945810437202454, 0.7946083545684814, -0.9123955965042114, -0.28905203938484...
def timsort _ ( x, y ) : n = x. size # if sort _ order is none : # sort _ order = arange ( n ) assert x. shape [ 0 ] = = y. shape [ 0 ] min _ run = find _ minrun ( n ) stack = stack ( 20 ) stack. push ( 0 ) index = 0 while index! = n : index = sort _ run ( x, y, index, min _ run ) stack. push ( index ) while stack. n >...
[ 0.1529587060213089, 1.5969445705413818, 0.6865637302398682, -0.2143917679786682, -0.20035429298877716, -0.7786692380905151, -0.031081348657608032, -1.2618876695632935, -0.11250299215316772, 0.6473546624183655, -0.7846100926399231, 0.16004982590675354, 0.03921026736497879, -0.28512275218963...
def setup ( self ) : rmgpy _ path = os. path. normpath ( os. path. join ( getpath ( ), '..') ) filestore = os. path. join ( rmgpy _ path,'testing ','qm ','qmfiles') self. mop1 = qmcalculator ( software ='mopac ', method ='pm3 ', filestore = filestore ) self. mop2 = qmcalculator ( software ='mopac ', method ='pm6 ', ) s...
[ 0.11101391911506653, -0.2848833203315735, 0.6261939406394958, -0.14303407073020935, 0.1679023802280426, -0.1419505923986435, 0.6791247129440308, -0.6720547676086426, -0.004602581728249788, -0.5086755752563477, 0.18144087493419647, -0.6155681610107422, -0.4769183397293091, 0.365812033414840...
def test _ translation _ rules _ g _ suite _ post ( self ) : pass
[ -0.02192091941833496, 1.3547358512878418, 0.05980300158262253, 0.6673291325569153, 0.33107423782348633, 1.485756516456604, 0.5337244868278503, -0.09905767440795898, -0.9338961839675903, 0.40387415885925293, -1.084912657737732, -0.8452143669128418, -0.306528776884079, 0.4043073058128357, ...
def _ log _ error ( logconf, msg ) : print ('error when logging % s : % s'% ( logconf. name, msg ) )
[ 0.29779258370399475, -0.3059432804584503, 0.4049077033996582, -0.6715213060379028, -0.34559786319732666, -0.22157970070838928, -0.5091959834098816, 0.48669710755348206, -0.5548152923583984, 0.23481614887714386, -0.7034229636192322, 1.0058540105819702, -0.19282956421375275, 0.11664971709251...
def _ syncoutputselectedpoints ( self ) : temp _ output _ selected _ points = [ ] # then transfer everything for i in self. _ pointslist : temp _ output _ selected _ points. append ( {'name': i ['name'],'discrete': i ['discrete'],'world': i ['world'],'value': i ['value'] } ) if temp _ output _ selected _ points! = self...
[ -0.46249014139175415, -0.4911998212337494, 0.3741433322429657, 0.5523304343223572, -0.2336588203907013, -0.13324125111103058, 0.4911779761314392, -0.3800985515117645, 0.09990415722131729, 1.0962234735488892, -0.3216172158718109, 1.0321221351623535, -0.22765479981899261, -0.0369635894894599...
def showwindowmenu ( self, windowmenu ) : pass
[ 0.04587941989302635, -0.6011214852333069, 0.2793492376804352, 1.2096325159072876, -0.866581916809082, -0.1434352844953537, 0.3863247036933899, 0.6196581125259399, 0.06707487255334854, -0.4576367139816284, 0.13102035224437714, 1.1127594709396362, -1.5240709781646729, 1.2251923084259033, -...
def test _ 2 ( ) : # from from https : / / scikit - learn. org / stable / auto _ examples / linear _ model / plot _ huber _ vs _ ridge. html # sphx - glr - auto - examples - linear - model - plot - huber - vs - ridge - py rng = np. random. randomstate ( 0 ) x, y = make _ regression ( n _ samples = 20, n _ features = 1,...
[ 0.9319502711296082, 0.5815369486808777, 0.7668501734733582, -0.456855833530426, 0.4632627069950104, 0.03816075250506401, 0.5768914818763733, -0.7768747806549072, -0.04087240248918533, -0.4653988182544708, -1.0629686117172241, 0.8822960257530212, -0.31169089674949646, -0.2999337911605835, ...
def test _ can _ create _ driver ( self ) : json _ response = api _ call ( self, " post ", " / driver / create ", dict ( first _ name = " alan ", last _ name = " turing ", dob = " 23 / 06 / 1962 " ), 200, true ) self. assertequal ( json _ response [ " status _ code " ], 201 ) self. assertequal ( json _ response [ " mes...
[ -0.18294939398765564, -0.2508307993412018, 0.40145033597946167, 0.31100258231163025, 1.0420154333114624, 0.7991160750389099, -0.6822344064712524, 0.3675951063632965, -0.2302292287349701, -0.07053832709789276, -0.5517887473106384, -0.4077991843223572, -0.4107882082462311, 0.4940686225891113...
def plot _ phy _ fas ( handle : str, title : str ='phylogenetic tree ', save _ image : bool = false, folder _ path : str ='report') : cons = distancetreeconstructor ( ) aln _ file = read ( open ( handle ),'fasta') calc = distancecalculator ('identity') distance _ matrix = calc. get _ distance ( aln _ file ) tree = cons...
[ 0.43913915753364563, 0.2823335528373718, 0.8672692179679871, 0.24176223576068878, -0.7180750370025635, 0.3348037600517273, 0.3726249039173126, 0.583993673324585, -0.0678362175822258, -0.3154623210430145, 0.6322731375694275, 0.372911274433136, 0.43431827425956726, -0.37690314650535583, 0....
def calc _ avg _ qv ( self, name ) : srm = self. get _ entry ( name ) try : count = [ float ( x ) for x in srm [ " fastqc " ] [ " stats " ] [ " per sequence quality scores " ] [ " count " ] ] quality = srm [ " fastqc " ] [ " stats " ] [ " per sequence quality scores " ] [ " quality " ] return round ( sum ( [ x * int ( ...
[ -0.41650018095970154, -0.6967610716819763, 0.5624088644981384, -1.1099627017974854, -0.6991046667098999, -0.7411781549453735, 0.12830518186092377, -0.7081552147865295, 0.15028613805770874, 0.6360965967178345, -0.6290432214736938, 0.5941895842552185, -0.5066223740577698, 0.21664214134216309...
def setwidget ( self, widget ) : self. cubewidget = glwidget ( widget ) # self. worker _ thread = workerthread ( self. cubewidget ) self. ui _ manualcontrol. startbutton. clicked. connect ( lambda : self. startbuttonpressed ( ) ) self. connect ( self. worker _ thread, qtcore. signal ( " finished ( qstring ) " ), self. ...
[ 0.7043783068656921, 0.09272784739732742, 0.458082377910614, -0.2599673867225647, 0.385538786649704, 0.7537012100219727, -0.16606108844280243, 0.029771247878670692, -0.3774384558200836, -0.40490755438804626, -1.3174983263015747, 0.5780982375144958, -0.783280611038208, 0.4410611391067505, ...
async def initialize _ processes ( self, process _ worker _ type, * * kwargs ) : for index in range ( self. _ _ num _ processes ) : proc _ name = " { } # { : 02d } ". format ( self. pool _ name, index ) proc = multiprocessing. process ( name = proc _ name, target = process _ pool _ worker _ internal, args = ( self, pro...
[ -0.7844043970108032, 0.11008456349372864, 0.6478332281112671, -0.12539328634738922, 1.0660090446472168, 0.22464244067668915, -0.04831923916935921, -0.999801516532898, 0.2870311737060547, -0.38106706738471985, -1.0599596500396729, 0.4731096923351288, -0.578879714012146, 0.4331890344619751, ...
def ispunc ( s ) : if s in punctuations _ and _ symbols : return true return false
[ -0.6715722680091858, -0.4679878056049347, 0.27969786524772644, -0.32643747329711914, -0.5024240612983704, -0.17371590435504913, 0.1207183375954628, 0.8350925445556641, 0.889624834060669, -0.11836141347885132, 0.057017672806978226, 0.23559696972370148, -0.28109821677207947, -0.1167587041854...
def _ replaceparam ( self, pname, newp ) : p = getattr ( self, pname ) i = self. _ params. index ( p ) assert i > - 1 self. _ params [ i ] = newp del p. _ scopes [ self ] # remove reference from old param newp. _ registerscope ( pname, self ) setattr ( self, pname, newp )
[ -0.9705826640129089, -0.7113298177719116, 0.4263189733028412, -0.9095878005027771, -0.14954359829425812, 0.10299061983823776, 0.08118676394224167, 0.1993681788444519, 0.0696944072842598, 1.3170256614685059, -0.18387055397033691, 1.1696147918701172, -0.6348065137863159, 0.6184690594673157, ...
def test _ create _ networklocation ( self, context ) : # these could come from a data file id = " networklocationwithrulesgroups " name = " network rules and groups " # define a test step with pytest. allure. step ( " create networklocation ` { } ` ( { } ). ". format ( name, id ) ) : # create a place in context. statu...
[ 0.41795268654823303, 0.09691694378852844, 0.6544641852378845, 0.04215988144278526, 0.22416594624519348, 0.7084698677062988, 1.02425217628479, 0.0856795608997345, 0.775126576423645, -0.2183968871831894, -0.5469639301300049, -0.26116296648979187, -0.3408729135990143, 0.024902736768126488, ...
def search _ helper ( word _ part, y, x, seen ) : to _ check = [ ] if ( y - 1 ) > = 0 and ( ( y - 1 ), x ) not in seen : to _ check. append ( ( y - 1, x ) ) if ( y + 1 ) < height and ( ( y + 1 ), x ) not in seen : to _ check. append ( ( y + 1, x ) ) if ( x - 1 ) > = 0 and ( y, ( x - 1 ) ) not in seen : to _ check. appe...
[ 0.2435111105442047, 0.0635642260313034, 0.7648972272872925, -0.4033975303173065, -0.9309192299842834, -0.6163200736045837, 0.579424262046814, -0.6469575762748718, -0.18507489562034607, 0.7292349934577942, -0.4757101535797119, -0.19730806350708008, -0.7707828283309937, 0.6105777621269226, ...
def get _ item ( self, item _ id : int ) - > item :
[ 0.16082970798015594, 0.12728960812091827, -0.14276710152626038, 0.4921886920928955, 1.0797287225723267, 0.284986674785614, -0.7224994897842407, -0.46414610743522644, -0.4023005962371826, -0.27414485812187195, 0.2383175492286682, 1.0966063737869263, 0.4159817695617676, -0.8594508767127991, ...
def parse _ args ( input _ args, parser, allow _ unknown = true ) : if len ( input _ args ) = = 0 : raise bilbypipeerror ( " no command line arguments provided " ) ini _ file = input _ args [ 0 ] if os. path. isfile ( ini _ file ) is false : if os. path. isfile ( os. path. basename ( ini _ file ) ) : input _ args [ 0 ]...
[ -0.1862586885690689, -0.8085203766822815, 0.623265266418457, 0.1061779111623764, 0.6430295705795288, 0.12233801186084747, -0.31469058990478516, 1.1334375143051147, -1.1373003721237183, 0.6645863652229309, 0.11668146401643753, 0.07519961148500443, -0.9887431859970093, 0.3627068102359772, ...
def test _ cant _ update _ branch _ invalid _ parameters ( self ) : json _ response = api _ call ( self, " put ",'/ branch / update ', dict ( capacity = 2018 ), 200, true ) self. assertequal ( json _ response [ " status _ code " ], 400 ) self. assertequal ( json _ response [ " message " ], " missing id " ) json _ respo...
[ -0.4023381769657135, -0.26515671610832214, 1.1186532974243164, 0.1476603001356125, 0.06557746231555939, 0.6997769474983215, -0.1642993837594986, -0.13466918468475342, -0.6380375623703003, -0.0704372301697731, -0.7667475938796997, 0.09845004230737686, -0.8016834855079651, 0.3441908359527588...
def change _ state ( self, new, errstr ='', params = { }, silent = false ) : san = self. san _ interface if str ( new ) not in objstate. _ keys : self. substate = new new = objstate. other params ['oldstate'] = str ( self. state ) params ['newstate'] = str ( new ) if new! = self. state and str ( new ) in ['error ','abs...
[ -0.29470157623291016, -0.11737267673015594, 1.0085943937301636, 0.494694322347641, -0.6939714550971985, 0.4773043394088745, -0.45429447293281555, -0.5330981612205505, 0.13711723685264587, 0.10071779787540436, -0.6269524097442627, 0.23762407898902893, -0.272849440574646, 0.3298991918563843,...
def _ _ eq _ _ ( self, other ) - > bool : return isinstance ( other, _ color ) and \ self. color = = other. color and \ self. modifier = = other. modifier
[ -1.173022985458374, -0.7813982367515564, 0.6183742880821228, -0.9379181861877441, 0.07797268033027649, 0.1824692338705063, -0.3248409032821655, -0.8385285139083862, 0.9006111025810242, -0.1927041858434677, -0.8090971112251282, 1.0770655870437622, 0.31305593252182007, 0.7994332313537598, ...
def check _ visible _ card ( self ) : result = self. driver. find _ element _ by _ css _ selector ( self. css _ get _ carddetail ). is _ displayed ( ) assert result = = true
[ 0.2634834051132202, 0.300295889377594, 0.7257360219955444, -0.1117895171046257, 0.6118350028991699, 0.820789098739624, 0.15057483315467834, 0.7558446526527405, 0.4575745761394501, 0.6858429908752441, -0.456187903881073, 0.5321781635284424, 0.46156543493270874, 0.3468596935272217, 0.69462...
def get _ energy _ range ( self ) : return self ['energy _ min'], self ['energy _ max']
[ -0.9775904417037964, -0.6132582426071167, 0.36490368843078613, -0.17459261417388916, 0.3504696190357208, 0.14126186072826385, -1.6484754085540771, 0.8531515002250671, -1.2298341989517212, 0.5575287938117981, -0.7941609621047974, 0.30457016825675964, -0.24774953722953796, -0.191898733377456...
def handle _ error ( self, request, client _ address ) : print ('-'* 40, file = sys. stderr ) import traceback traceback. print _ exc ( ) print ('-'* 40, file = sys. stderr )
[ 0.7472208142280579, -0.16938361525535583, 0.5802009701728821, -0.2673371136188507, 0.8309456706047058, 0.4410155117511749, 0.06617043167352676, 0.4696343243122101, 0.29051926732063293, -0.5159598588943481, 0.8888605833053589, 0.5121931433677673, 0.3192165791988373, 0.3698479235172272, 0....
def _ _ init _ _ ( self, bot : commands. bot ) : self. bot = bot
[ 0.12548880279064178, -0.39071300625801086, 0.25502997636795044, 0.4037728011608124, -0.06418319791555405, 0.6389508843421936, -0.18200992047786713, 0.45850780606269836, 0.15710486471652985, -1.0349372625350952, -0.3432650566101074, 0.45308053493499756, 0.03756420314311981, 1.11860954761505...
def decode ( self, output _ dict : dict [ str, torch. tensor ] ) - > dict [ str, torch. tensor ] : class _ probabilities = f. softmax ( output _ dict ['logits'], dim = - 1 ) output _ dict ['class _ probabilities'] = class _ probabilities predictions = class _ probabilities. cpu ( ). data. numpy ( ) argmax _ indices = n...
[ -1.0806028842926025, -1.0029791593551636, 0.45696595311164856, -0.2350274920463562, -0.6784223318099976, -0.7334779500961304, -0.7815255522727966, 0.8660171627998352, -0.10685843229293823, 0.5849791169166565, 0.06289809197187424, 0.27505019307136536, 0.6302363276481628, -0.4791541993618011...
def get _ str _ setting ( self, key : str ) - > str : key = key. split ( ". " ) return self. config [ key [ 0 ] ]. get ( key [ 1 ] )
[ -1.028907060623169, 0.17976197600364685, 0.5941458344459534, -0.20197048783302307, -0.9783895611763, -0.3711017370223999, -0.3443753719329834, -1.2469216585159302, -0.7889272570610046, 1.9556753635406494, 0.5141399502754211, 0.40117621421813965, -0.440238356590271, -0.7495400905609131, 1...
def test _ intraday _ pass _ timezone ( self ) : def mock _ get _ history _ db _ config ( db ) : return { " bar _ size " : " 30 mins ", " universes " : [ " usa - stk " ], " vendor " : " ibkr ", " fields " : { " close " : " float ", " open " : " float ", " high " : " float ", " low " : " float ", " volume " : " float " ...
[ -0.43038299679756165, 0.20815987884998322, 1.1038880348205566, 0.3494499623775482, 0.4935028553009033, 0.15087632834911346, 0.8045572638511658, -0.0787758156657219, -0.19522903859615326, 0.22360779345035553, -0.3347126245498657, -0.31422939896583557, -0.21805207431316376, 0.095973715186119...
def create _ authentification _ by _ refresh _ token ( self, body, content _ type ) : # prepare query url _ query _ builder = configuration. get _ base _ uri ( ) _ query _ builder + ='/ oauth / v1 / token'_ query _ url = apihelper. clean _ url ( _ query _ builder ) # prepare headers _ headers = {'content - type': conte...
[ -0.772503137588501, -0.09169251471757889, 0.5378316044807434, 1.0259884595870972, 0.15651299059391022, -0.06293929368257523, -0.5731515288352966, -1.5999935865402222, -0.04915807396173477, 0.49050071835517883, -0.8860805630683899, 0.7337503433227539, -0.4118574261665344, -0.008043156005442...
def trip _ length ( filename ) : with open ( filename,'r') as f _ in : # set up csv reader object reader = csv. dictreader ( f _ in ) # initialize count variables n _ greaterthan30 = 0 n _ lessthan30 = 0 total _ trip _ length = 0 # add each trip length to compute total trip length for row in reader : duration = float (...
[ -0.08684438467025757, 0.04773520678281784, 0.6177477836608887, -0.9184208512306213, 0.028452515602111816, 1.2363067865371704, 0.21577823162078857, 0.34344780445098877, -0.3521483838558197, 1.188133716583252, -0.02292230725288391, -0.2581801116466522, 0.8551382422447205, 0.20478899776935577...
def read _ file ( name ) : file = open ( name,'r') data = file. readlines ( ) weights = [ 0 ] * ( int ( data [ 0 ] ) + 1 ) for index, line in enumerate ( data [ 1 : ] ) : item = line. split ( ) weights [ index + 1 ] = int ( item [ 0 ] ) return weights
[ -0.6400675177574158, -0.23586398363113403, 0.6204684376716614, -0.6029078960418701, -0.1729402244091034, 0.007343356031924486, 0.15978427231311798, 0.46196243166923523, -0.9097561836242676, 0.6757863759994507, -0.7496729493141174, -0.24281571805477142, -0.510326087474823, 0.331946760416030...
def returnfrequentitemsets ( itemset, transactionlist, minsupport, freqset ) : _ itemset = set ( ) localset = defaultdict ( int ) for item in itemset : for transaction in transactionlist : if item. issubset ( transaction ) : freqset [ item ] + = 1 localset [ item ] + = 1 for item, count in localset. items ( ) : support...
[ -0.018213076516985893, 0.5763213038444519, 0.2843726575374603, -0.6757702827453613, -1.058074712753296, -1.142350196838379, -0.22206684947013855, -0.10062019526958466, -0.24776001274585724, 0.10073462873697281, 0.12124430388212204, -0.502977192401886, -0.44140321016311646, -0.2215555757284...
def get _ self _ followed _ by ( self ) : url = self. client. me +'/ followed - by'return self. client. get ( url, bucket = _ func _ ( ) )
[ -0.4595968723297119, 0.6359453797340393, 0.4424261748790741, 1.193878173828125, -1.070298433303833, -0.31916749477386475, 0.5340448021888733, -1.0613902807235718, -0.5358699560165405, -1.0870640277862549, -1.1646860837936401, 0.748249888420105, -0.26668083667755127, -0.12543250620365143, ...
def get _ observations ( * * params ) - > union [ list, str ] : response _ format = params. pop ('response _ format ','json') if response _ format not in observation _ formats : raise valueerror ('invalid response format') validate _ multiple _ choice _ param ( params,'order _ by ', v0 _ obs _ order _ by _ properties )...
[ -0.7985739707946777, -0.14410920441150665, 0.7723485231399536, 0.17780615389347076, 0.31126371026039124, -0.59852135181427, -0.648653507232666, -1.0143654346466064, 0.3247249722480774, 0.7479593753814697, 0.5732253193855286, -0.12166261672973633, 0.37155336141586304, 0.12931697070598602, ...
def k2c ( k ) : return _ np. asanyarray ( k ) - zero _ celsius
[ 0.29692697525024414, -1.403252363204956, 0.5408779382705688, 0.08902011066675186, 0.028951967135071754, 0.35553887486457825, -0.4429953694343567, 0.5304791927337646, -0.5146753191947937, 0.5979007482528687, 0.2844221591949463, -0.393494576215744, 0.26114070415496826, -0.1888202279806137, ...
def _ get _ foreign _ key _ model ( model, fieldname ) : field _ object, model, direct, m2m = model. _ meta. get _ field _ by _ name ( fieldname ) if not m2m and direct and isinstance ( field _ object, models. foreignkey ) : return field _ object. rel. to return none
[ -0.32995548844337463, 0.2043110579252243, 0.26090919971466064, 0.5812556743621826, 0.2191920429468155, -0.3406059145927429, 0.44785821437835693, -0.7852534651756287, -0.4958683252334595, -0.04560522735118866, 0.20490115880966187, -0.06336314976215363, -0.2567930519580841, -0.40630283951759...
def rounder ( num, prec ) : return float ( decimal. decimal ( num ). quantize ( decimal. decimal ( str ( prec ) ), rounding = decimal. round _ half _ up ) )
[ 0.5473548173904419, -0.2589985728263855, 0.38706517219543457, -0.9944813251495361, -0.3778599798679352, -0.3557172119617462, 0.08232124149799347, -0.7511418461799622, -1.334630012512207, -0.6448489427566528, 0.4615721106529236, 0.4580886662006378, -0.4557220935821533, -0.29456955194473267,...
def test _ show _ edit _ tag ( self ) : with app. test _ client ( ) as client : resp = client. get ( f'/ tags / { self. tag _ id } / edit') html = resp. get _ data ( as _ text = true ) self. assertequal ( resp. status _ code, 200 ) self. assertin ( f'< input type = " text " class = " form - control " id = " name " name...
[ -0.09755848348140717, 0.2344079166650772, 0.3804776668548584, -0.6974813342094421, 0.4727873206138611, -0.033308789134025574, 0.09857678413391113, 0.3109872341156006, -0.28582313656806946, -0.2967202067375183, -0.26725056767463684, 0.461996853351593, 0.5801557898521423, 0.9651457667350769,...
def data _ preprocess ( self, x ) : input _ = self. model _ info. inputs [ 0 ] dtype = model _ data _ type _ to _ np ( input _. dtype ) return cv2. resize ( x, ( input _. height, input _. width ) ). astype ( dtype )
[ -0.799225926399231, 0.60002201795578, 0.7817205190658569, -0.45807042717933655, 0.005125766154378653, 0.13539694249629974, -0.47415730357170105, -1.3576104640960693, 0.8681865334510803, -0.05768165737390518, -0.8203496932983398, 0.7907364964485168, 0.6892637610435486, 0.2703012526035309, ...
def setstartindex ( self, * args ) : return _ itkimageserieswriterpython. itkimageserieswriterid3id2 _ setstartindex ( self, * args )
[ -0.8130390048027039, -1.0179299116134644, 0.4191243052482605, -0.19126896560192108, -0.24894118309020996, 0.9087949991226196, -0.07740066945552826, 0.10221029818058014, -0.11401157826185226, 0.6411927938461304, -1.7507554292678833, 1.086620807647705, -0.7434607744216919, -0.222834005951881...
def test _ connection _ superset _ security _ connection ( self, mock _ g, mock _ event _ logger, mock _ get _ sqla _ engine ) : database = get _ example _ database ( ) mock _ g. user = security _ manager. find _ user ( " admin " ) mock _ get _ sqla _ engine. side _ effect = supersetsecurityexception ( superseterror ( ...
[ 0.6801292896270752, 0.7851258516311646, 0.3764665126800537, 0.2763929069042206, 0.10516083240509033, 0.370950311422348, 0.12118017673492432, -0.06856925040483475, -0.014241714961826801, 0.028298093006014824, -0.8229171633720398, 0.10859831422567368, -0.6397607326507568, 0.18472202122211456...
def test _ learning _ curve _ implementation ( ) : # this test is different from the other tests which just use regression data. # the reason is that we want this test to fail in case our implementation # diverges from the scikit - learn implementation. this test essentially # serves as a regression test as well. # loa...
[ 0.519409716129303, 0.18698497116565704, 0.7678987979888916, 0.37636294960975647, 0.1689606010913849, -0.24747036397457123, -0.1587301343679428, -0.1422131210565567, 0.25618496537208557, -0.30267107486724854, -0.3885543942451477, 0.07012216746807098, 0.3593399226665497, 0.173597514629364, ...
def _ datetime _ to _ gbase ( self, value ) : if value. microsecond : return'% d - % 02d - % 02d % 02d : % 02d : % 02d. % 06d'% ( value. year, value. month, value. day, value. hour, value. minute, value. second, value. microsecond ) return'% d - % 02d - % 02d % 02d : % 02d : % 02d'% ( value. year, value. month, value. ...
[ -0.22893543541431427, 0.545240581035614, 1.1303749084472656, -0.6332302093505859, -0.12277591973543167, 0.7407036423683167, -0.657991886138916, -1.1623191833496094, -0.2539149820804596, 1.7475223541259766, -0.14583666622638702, 0.2672116756439209, -0.4517594575881958, 0.2932488024234772, ...
def build _ dict ( self, control ) : d = { } for k in packages _ gatherer. mandatory : if k not in control : print " mandatory field % s not specified " % k d [ k ] = control [ k ] for k in packages _ gatherer. non _ mandatory : if k in control : d [ k ] = control [ k ] else : d [ k ] = none for k in control. iterkeys ...
[ 0.28046420216560364, -0.5183344483375549, 0.4823576509952545, -0.21975429356098175, -0.4161905348300934, 0.165648952126503, -0.21442577242851257, 0.08869266510009766, -0.6385629177093506, 0.28707370162010193, -0.2075193077325821, -0.2545624077320099, -0.20730213820934296, 0.379072099924087...
def update _ position ( self, button ) : # pressed button is for changing direction if self. buttons _ dict [ button ] in ['turn _ left ','turn _ right'] : self. update _ direction ( button ) # pressed button is for movement else : # gets a dictionary of the absolute position and if the direction # associated with the ...
[ -0.7001396417617798, -1.528998851776123, 0.5862968564033508, 0.20298011600971222, 0.16680793464183807, 0.7137458920478821, 0.14689959585666656, 0.1521180421113968, 0.2704005241394043, 0.22835874557495117, -0.40796512365341187, -0.6889792680740356, 0.927729070186615, 0.18919475376605988, ...
def dft _ recursive ( self, starting _ vertex ) : stack = [ ] visited = [ false for x in range ( len ( self. vertices ) ) ] def dftutil ( self, vertex ) : nonlocal stack neighbors = self. get _ neighbors ( vertex ) nextvertex = none if not visited [ vertex - 1 ] : visited [ vertex - 1 ] = true print ( vertex ) for neig...
[ 0.22387759387493134, 1.2330615520477295, 0.5179256200790405, 0.9741719365119934, -0.665204644203186, -0.3540264368057251, 0.9875955581665039, -0.5456726551055908, -0.14228685200214386, -0.19410069286823273, -0.8155099749565125, 0.49451178312301636, -0.5660873651504517, 0.4007954001426697, ...
def _ _ arrow _ array _ _ ( self, type = none ) : import pyarrow as pa if type is none : type = pa. string ( ) values = self. _ ndarray. copy ( ) values [ self. isna ( ) ] = none return pa. array ( values, type = type, from _ pandas = true )
[ -0.388636976480484, -0.7953314185142517, 0.49785032868385315, 0.06176043674349785, 0.14189967513084412, 0.22933869063854218, -0.0363045372068882, -1.2466031312942505, 0.9040558934211731, -0.18962302803993225, 0.568498432636261, 1.262882947921753, -0.014081478118896484, -0.0829116478562355,...
def get _ features _ labels _ pairs _ generator ( subset ='train') : datasets = mnist. read _ data _ sets ( train _ dir ='/ tmp / data / ', validation _ size = 0 ) if subset = ='train': features = datasets. train. images labels = datasets. train. labels else : features = datasets. test. images labels = datasets. test. ...
[ -1.057594895362854, -0.44097447395324707, 0.3685918152332306, -0.7580389380455017, -1.3576200008392334, -0.05297636613249779, -0.5001870393753052, 0.7704352140426636, -0.08947470784187317, -0.21451884508132935, 0.18323825299739838, -0.07519342005252838, 0.7799696326255798, 0.53851145505905...
def next ( self, dataset, preprocessing _ fn = none, multiple _ examples = 1, return _ key = false, cache _ preprocessed = false ) : # retrieves the next filename to be read. _ get _ next _ filenames returns a list of filenames even if # the provided batch _ size is 1 mult _ filenames, first _ pos = self. _ get _ next ...
[ -0.4637755751609802, 0.4317843019962311, 0.7842446565628052, 0.3961241543292999, -0.9064205884933472, -0.7502594590187073, 0.5954881906509399, 1.3789480924606323, -0.08766435831785202, 0.19476941227912903, -0.350745290517807, -0.2722133696079254, 0.11936742067337036, 0.7829285860061646, ...
def _ _ continuous _ prices ( self ) : # self. wst = threading. thread ( target = ) # self. wst. daemon = true # self. wst. start ( ) while self. is _ continuous : self. get _ data ( ) time. sleep ( 0. 5 )
[ 0.37197861075401306, -0.7249591946601868, 0.5532011389732361, 0.19596907496452332, 0.6848767995834351, 0.7132364511489868, -0.4396170377731323, -0.27343612909317017, -0.814118504524231, 0.1367383450269699, -0.21073246002197266, 0.7673901319503784, -0.9606802463531494, -0.40826767683029175,...
def predict ( self, x _ test ) : data = x _ test for component in self. components : if isinstance ( component, transformer ) : data = component. transform ( data ) if isinstance ( component, estimator ) : data = component. predict ( data ) return data
[ -0.4301474094390869, -0.5460360050201416, 0.42149868607521057, -0.30592334270477295, -0.20477963984012604, -0.45451295375823975, -0.6455588936805725, -0.02391820028424263, 0.10426145792007446, -0.7971305251121521, 0.03242793306708336, 0.42522338032722473, -0.42446327209472656, 0.1838347464...
def initial _ henry _ slope ( isotherm, max _ adjrms = 0. 02, p _ limits = none, l _ limits = none, verbose = false, * * plot _ parameters ) : # get the isotherm data on the adsorption branch pressure = isotherm. pressure ( branch ='ads') loading = isotherm. loading ( branch ='ads') if p _ limits : if p _ limits [ 0 ] ...
[ 0.28468045592308044, 0.05289297550916672, 0.8775039911270142, -0.19668683409690857, 0.33829841017723083, 0.9336985945701599, -0.3621346950531006, 0.37795400619506836, -0.8786866068840027, -0.11057522147893906, 0.20482970774173737, 0.7536073327064514, -0.20887944102287292, -0.40764653682708...
def download ( self, directory : str ) - > none : if self. _ _ pages : dir _ path = os. path. join ('mangas ', directory, self. _ _ title ) os. makedirs ( dir _ path, exist _ ok = true ) for page in self. _ _ pages : response = requests. get ( page. link, headers = self. _ _ headers ) file _ name = f'{ page. title }. j...
[ -0.7404504418373108, -0.31199339032173157, 0.8081368207931519, 0.20342528820037842, 0.2027539759874344, -0.251822292804718, -0.3994550108909607, 0.04504632204771042, 0.7099609375, -0.3297579884529114, -0.11573953926563263, -0.11671701073646545, 0.46651580929756165, 1.0125863552093506, -0...
def push _ flow ( self, flow _ md ) : req _ url = urljoin ( self. _ remote _ base _ url, self. _ url _ create _ flow ) r = requests. put ( req _ url, data = flow _ md ) logger. info ( " status code : { }, text : { } ". format ( r. status _ code, r. text ) ) if r. status _ code! = 200 : raise runtimeerror ( " failed to ...
[ -0.37645986676216125, 0.4495830237865448, 0.5340999960899353, 0.2715994417667389, 0.34107932448387146, 0.5991959571838379, -1.0855498313903809, -0.43736571073532104, -0.048913050442934036, -0.2901451587677002, -0.5062245726585388, 1.0066494941711426, -1.1573853492736816, 0.473050057888031,...
def get _ excel _ content ( self, filename, sheet _ name = none ) : adapter = exceladapter ( ) return adapter. convert _ to _ list ( filename, sheet _ name )
[ -0.12854671478271484, -0.8875354528427124, 0.36361220479011536, 0.8981160521507263, -0.3872810900211334, -0.3992604613304138, -1.8833743333816528, 0.8439726829528809, -0.3220575451850891, 0.9391327500343323, -0.1271800547838211, -0.13680002093315125, 0.7628402709960938, -0.2270368933677673...
def move ( self ) : " " " keeping within boundaries " " " if random. random ( ) < 0. 5 : self. _ y = ( self. _ y + 1 ) % self. rows else : self. _ y = ( self. _ y - 1 ) % self. rows if random. random ( ) < 0. 5 : self. _ x = ( self. _ x + 1 ) % self. cols else : self. _ x = ( self. _ x - 1 ) % self. cols
[ -1.2218152284622192, -0.15216952562332153, 0.6582157015800476, 0.016648514196276665, -0.4013001024723053, 0.9426515698432922, 0.40073350071907043, -0.7338771224021912, 0.6026307344436646, -0.453269362449646, -0.031004222109913826, 0.00885836686939001, -0.29910075664520264, 0.16686333715915...
def incremental _ forward ( self, initial _ input = none, c = none, g = none, t = 100, test _ inputs = none, tqdm = lambda x : x, softmax = true, quantize = true ) : self. clear _ buffer ( ) b = 1 # note : shape should be * * ( b x t x c ) * *, not ( b x c x t ) opposed to # batch forward due to linealized convolution ...
[ 0.41482222080230713, -0.36534371972084045, 0.7223626971244812, 0.06568919122219086, 0.09043070673942566, 0.024951130151748657, 0.7080228924751282, 0.4463481307029724, -0.9306730628013611, -0.11417204886674881, 0.3422894775867462, 0.29164057970046997, -0.18752695620059967, 0.328781843185424...
def key _ to _ instance ( key ) : module _ path, cls _ name, id _ = key. split (':') module = _ _ import _ _ ( module _ path, fromlist = [ cls _ name ] ) cls = getattr ( module, cls _ name ) instance = cls. objects. get ( pk = int ( id _ ) ) return instance
[ -0.8798984289169312, -0.5265357494354248, 0.612461507320404, -0.8291106820106506, -0.36056554317474365, 0.9039295315742493, -0.01354890689253807, -0.2909058928489685, 0.22989176213741302, 1.4887059926986694, -0.7319779396057129, 0.18796510994434357, -0.49990805983543396, -0.419528573751449...
def explore _ phenograph ( ) : big _ clusters, big _ clusters _ cells, big _ clusters _ genes = \ macosko2015. load _ big _ clusters ( ) amacrine, amacrine _ cells, amacrine _ genes = macosko2015. load _ amacrine ( ) # - - - read the " lowrank " or " smoothed " data from robust pca - - - # csv = macosko2015. base _ url...
[ 0.5625007152557373, 0.8695350885391235, 0.5628355741500854, -0.5581134557723999, 0.14395023882389069, -0.19482511281967163, 0.5515100955963135, 0.7501562833786011, -0.19207312166690826, -0.17310743033885956, 0.20455273985862732, 0.8182112574577332, 0.3619258999824524, -0.932377815246582, ...
def to _ dict ( self ) : result = { } for attr, _ in six. iteritems ( self. openapi _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ att...
[ -1.0924562215805054, -0.2839862108230591, 0.8545952439308167, -0.917729377746582, -0.5548188090324402, -0.4249226152896881, 0.5681208372116089, -0.7377259731292725, -0.10844872146844864, -0.01909378543496132, -0.7162183523178101, -0.44790083169937134, 0.12244656682014465, 0.713758945465087...
def wrap _ algorithm ( self, module : str, load _ data : bool = true, use _ new _ client : bool = false, log _ traceback : bool = false ) - > none : info ( f " wrapper for { module } " ) # read input from the mounted input file. input _ file = os. environ [ " input _ file " ] info ( f " reading input file { input _ fil...
[ 0.0889996662735939, -0.06552574783563614, 0.9108402132987976, -0.4525531530380249, 0.28208476305007935, 0.0368950180709362, 0.22370664775371552, -0.5850653648376465, -0.565876841545105, 0.677432119846344, 0.29010266065597534, 0.6255592703819275, 0.20321393013000488, 0.4623247981071472, 0...
def update _ absence ( cursor, table ='clean. all _ absences ', col ='absence') : col _ date, dtype _ date = col +'_ starting _ date ','date'col _ cnt, dtype _ cnt = col +'_ consec _ count ','int'if col = ='absence': table _ intermed ='clean. aggregated _ absence _ intermediate'else : table _ intermed ='clean. aggregat...
[ 0.2366776168346405, -0.45567238330841064, 1.002985954284668, 0.1792946308851242, -0.5703569054603577, 0.49622493982315063, 1.0084694623947144, 0.4200138449668884, -0.7588077187538147, 0.7363142371177673, 0.8123007416725159, 0.5712056756019592, 0.6826231479644775, 0.20345811545848846, 0.9...
def load _ comments ( site _ name : str, target : generator ) - > generator : while true : comment = yield comment _ as _ html = beautifulsoup ( docutils. core. publish _ string ( source = comment. attrib [ " text " ], writer _ name = " html5 ", parser = xref. custom _ parser ( site _ name ) ( ), parser _ name = " md "...
[ -0.3381306231021881, 0.26044926047325134, 0.5134735107421875, -1.0653254985809326, 0.07324980199337006, -0.6392686367034912, 0.13096320629119873, -0.4173249304294586, -0.4037274122238159, 0.524452805519104, 0.1298060417175293, 0.5795201659202576, 0.12772341072559357, 0.1272164136171341, ...