text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def test _ no _ lazy _ load ( self ) : self. create _ volume _ objects ( ) self. ep. lazy _ load _ references = false vol = self. ep. search ( " volumes ", id _ _ gt = 1 ). hits [ 0 ] vol. volume _ group self. assertisinstance ( vol. volume _ group, krest. restobjectproxy ) | [
0.09767375886440277,
0.2791689336299896,
0.26856961846351624,
-1.2463469505310059,
0.5325161814689636,
0.12502968311309814,
-0.09835691004991531,
-1.4090198278427124,
0.060705915093421936,
-1.202109694480896,
0.23190633952617645,
-0.1524205505847931,
-0.9732024669647217,
0.6437452435493469... |
def find _ max _ min ( input _ list ) : if not isinstance ( input _ list, list ) : return " the argument should be a list. " if not input _ list : return [ 0, ] checked _ list = [ item for item in input _ list if isinstance ( item, ( int, float ) ) ] if not input _ list = = checked _ list : return " the argument list c... | [
-0.6359264254570007,
-0.42155227065086365,
0.4290279746055603,
1.109707236289978,
0.09550590813159943,
0.09436233341693878,
-1.095802664756775,
0.07805155962705612,
0.689720630645752,
0.5371108055114746,
-0.7978917956352234,
-0.014271149411797523,
-1.1363588571548462,
1.3581827878952026,
... |
def extract _ sequence ( region, sequence _ file, fai ) : # check fai for region if region [ 0 ] not in fai : raise valueerror ('sequence { } is missing in the index '. format ( region [ 0 ] ) ) # get coordinates and lengths chr _ start = int ( fai [ region [ 0 ] ] [ 1 ] ) seq _ len = int ( fai [ region [ 0 ] ] [ 2 ] )... | [
0.2728573977947235,
-0.8858404159545898,
0.790748655796051,
-0.6191849708557129,
-0.3953261375427246,
-0.8022160530090332,
0.8838613629341125,
-0.05643666535615921,
-0.36424940824508667,
0.5569205284118652,
0.33792129158973694,
0.11787228286266327,
-0.685413658618927,
-0.8972038626670837,
... |
def perform ( self, repository ) : self. publish ('unhidden _ drivers _ found ', repository. get _ all _ unhidden ( ) ) | [
-0.3003837466239929,
-0.17810370028018951,
0.2559286057949066,
-0.1292629837989807,
0.9483160376548767,
-0.7478776574134827,
-0.3834967315196991,
0.006861721631139517,
-0.01994483731687069,
0.34811243414878845,
-0.5364797711372375,
0.36672064661979675,
-0.21043449640274048,
0.7464617490768... |
def test _ increasing _ compactability ( ) - > none : dz _ 0 = np. full ( 100, 1. 0 ) phi _ 0 = np. full ( 100, 0. 5 ) phi _ 1 = compact ( dz _ 0, phi _ 0, porosity _ max = 0. 5, c = 1e - 6 ) phi _ 2 = compact ( dz _ 0, phi _ 0, porosity _ max = 0. 5, c = 1e - 3 ) assert np. all ( phi _ 2 [ 1 : ] < phi _ 1 [ 1 : ] ) | [
0.47142407298088074,
0.4431542456150055,
0.4621732234954834,
0.4842512905597687,
0.16120325028896332,
0.6505788564682007,
0.6805678009986877,
0.042544152587652206,
-0.6083782315254211,
-0.24335677921772003,
-0.603377103805542,
0.2542850375175476,
-0.31802964210510254,
0.831985354423523,
... |
def booking ( request ) : social = socialicon. objects. all ( ) lessons = list ( lesson. objects. all ( ) ) if lesson. objects. count ( ) < = 0 : context = {'socials': social, } else : random _ lessons = random. sample ( lessons, 12 ) context = {'socials': social,'lessons': random _ lessons, } return render ( request,'... | [
-0.7156965732574463,
0.781245231628418,
0.5487722754478455,
1.353659749031067,
-0.4366777241230011,
1.3255094289779663,
0.9747146368026733,
0.9983352422714233,
0.3138617277145386,
0.5406507253646851,
1.1372803449630737,
-0.9332833290100098,
0.19435296952724457,
0.4829452633857727,
-0.494... |
def _ write _ bytes ( self, content, * * kwargs ) : self. connection. write _ raw ( content, * * kwargs ) | [
-1.1643435955047607,
0.3353477716445923,
0.216389462351799,
-0.3119237422943115,
0.5067702531814575,
-0.17544670403003693,
-0.7832089066505432,
-0.31500452756881714,
-0.5697810053825378,
-0.22779980301856995,
-0.6514209508895874,
-0.19417612254619598,
-1.1146749258041382,
-0.03997378051280... |
def to _ app ( self ) : return dssapp ( self. client, self. _ data [ " appid " ] ) | [
0.4506355822086334,
-0.21901759505271912,
0.21782244741916656,
-0.026415223255753517,
-0.5243171453475952,
0.2079528123140335,
-0.11181799322366714,
-0.22021113336086273,
1.2831944227218628,
0.026986287906765938,
-0.33614397048950195,
0.7148720622062683,
0.8388069868087769,
-0.546372115612... |
def modifyqospolicy ( ctx, # mandatory main parameter qospolicyid, # optional main parameter name = none, # optional subparameter of optional main parameter. miniops = none, # optional subparameter of optional main parameter. maxiops = none, # optional subparameter of optional main parameter. burstiops = none, # option... | [
-0.754889190196991,
-0.3623568117618561,
0.8497627973556519,
-0.4689685106277466,
-0.22554093599319458,
0.6308148503303528,
-0.20943421125411987,
-0.6360886693000793,
1.08318030834198,
0.4982209801673889,
-0.2291339486837387,
0.5410546660423279,
-1.0207329988479614,
-0.4154667854309082,
... |
def _ _ init _ _ ( self ) : super ( ). _ _ init _ _ ( ) self. _ username ='' self. _ remote _ url ='' self. _ target _ file = self. _ enc _ filename self. _ storage = join ( _ self _ pwd, self. _ default _ storage _ name ) self. _ enc _ password ='' self. _ remote _ update = false self. _ data = { _ pairs _ tag : { } }... | [
-0.0038111580070108175,
0.40658384561538696,
0.49874359369277954,
0.45465752482414246,
0.6396661400794983,
-0.20574520528316498,
0.11690106242895126,
0.3188099265098572,
-0.46161171793937683,
-0.3605368435382843,
-1.216806411743164,
-0.47209087014198303,
-0.2974768280982971,
0.310591012239... |
def _ _ init _ _ ( self, model ='efficientnet - b3 ', pretrained = true ) : super ( multiheadeffnet, self ). _ _ init _ _ ( ) self. num _ block = 4 if model. startswith ('efficientnet') : if pretrained : self. model = efficientnet. from _ pretrained ( model ) else : self. model = efficientnet. from _ name ( model ) els... | [
0.2048831582069397,
0.5401893258094788,
0.7206020951271057,
0.3576985001564026,
-0.008281249552965164,
-0.7481399774551392,
0.3966008722782135,
0.044912952929735184,
-0.30514323711395264,
0.18255668878555298,
-0.7927394509315491,
0.0058886162005364895,
-0.49929147958755493,
0.7549032568931... |
def ordering ( self ) : return self. _ ordering | [
-0.6065475344657898,
0.0072702388279139996,
0.30225488543510437,
1.1292277574539185,
0.09766814857721329,
0.304329514503479,
0.09313976019620895,
-0.42300909757614136,
0.21978387236595154,
-0.446250319480896,
-0.6344152092933655,
-0.35620516538619995,
-0.04102773219347,
-0.1027576848864555... |
def create _ new _ ad _ set ( ) : adset = adset ( parent _ id = my _ ad _ account _ id ) adset [ adset. field. name ] ='mutegolf sdk ad set'adset [ adset. field. campaign _ id ] = my _ campaign _ id adset [ adset. field. optimization _ goal ] = adset. optimizationgoal. page _ likes adset [ adset. field. promoted _ obje... | [
-0.04508991539478302,
-0.36866486072540283,
0.6737019419670105,
-1.051236867904663,
-0.35703909397125244,
0.3656586706638336,
-0.7315092086791992,
-0.7307088375091553,
0.04877796396613121,
-0.04467520862817764,
-0.5250985622406006,
1.0695708990097046,
-0.2894115149974823,
-0.37773415446281... |
def read _ excel _ advanced ( fname, remove _ blank _ cols = true, remove _ blank _ rows = true, collapse _ header = true, header _ xls _ range = none, header _ xls _ start = none, header _ xls _ end = none, is _ preview = false, nrows _ preview = 3, * * kwds ) : header = [ ] if header _ xls _ range : if not ( header _... | [
-0.24176177382469177,
-0.15294146537780762,
1.0560022592544556,
0.1767842173576355,
-0.9841716885566711,
-0.09380011260509491,
-0.09629134833812714,
0.4393666684627533,
-0.431570440530777,
0.02453591674566269,
0.39020445942878723,
0.5100693702697754,
0.7823955416679382,
-0.8331432938575745... |
def on _ closing ( root, electrometer, relays, hvamp ) : # ask user for confirmation if tk. messagebox. askokcancel ( " quit ", " do you want to quit? " ) : # switch off all relays relays. switch _ off _ all _ relays ( ) # set lj - tick voltage to zero ( hvamp control voltage ) hvamp. set _ voltage ( 0 ) # set electrom... | [
0.4455299973487854,
-0.4183127284049988,
0.46687835454940796,
0.6620861887931824,
-0.7146374583244324,
1.1570736169815063,
0.5368635058403015,
-0.02389242872595787,
-0.056844983249902725,
-0.0809415876865387,
0.6881969571113586,
-0.14124131202697754,
-0.3153328597545624,
1.309511661529541,... |
def make _ data _ loaders ( experiment _ config : dict [ str, any ], hparams : dict [ str, any ] ) : corpus = data. corpus ( pedl. get _ data _ config ( ). get ( " data _ loc " ) ) train _ dataset = ptbdata ( corpus. train, pedl. get _ hyperparameter ( " seq _ len " ), pedl. get _ hyperparameter ( " batch _ size " ) ) ... | [
0.4228542447090149,
0.2703333795070648,
0.48244744539260864,
-0.3113156855106354,
0.1056428775191307,
0.4705880582332611,
-0.38742566108703613,
0.42298537492752075,
-0.7238131761550903,
-0.15113191306591034,
-0.6133764982223511,
-0.24312236905097961,
0.3701501190662384,
0.27024930715560913... |
def create _ or _ update ( self, job : job, *, description : optional [ str ] = none, compute : optional [ str ] = none, tags : optional [ dict ] = none, experiment _ name : optional [ str ] = none, skip _ validation : bool = false, * * kwargs, ) - > job : try : if isinstance ( job, basenode ) and not ( isinstance ( jo... | [
0.22989146411418915,
-0.23733289539813995,
0.7595674395561218,
0.4201173186302185,
-0.05429316684603691,
-0.020521502941846848,
-0.7543556094169617,
-0.09119020402431488,
-0.13646379113197327,
-0.39867842197418213,
0.13946661353111267,
0.04060753807425499,
0.06179472804069519,
0.2800983190... |
def ksstat ( s, p, reweight = false ) : if reweight : return np. max ( [ np. abs ( s - p ) / np. sqrt ( p * ( 1. 0 - p ) ) for ( s, p ) in zip ( s, p ) ] ) else : return np. max ( [ np. abs ( s - p ) for ( s, p ) in zip ( s, p ) ] ) | [
1.053661823272705,
-0.24217543005943298,
0.3649722933769226,
0.4972118139266968,
-0.8354177474975586,
0.1779813915491104,
-1.36141836643219,
0.6678888201713562,
0.8706003427505493,
0.2529771625995636,
0.5014750957489014,
0.09408257901668549,
-0.5791536569595337,
0.25451627373695374,
-0.9... |
def get _ contents _ from _ pdf _ pages ( self, pdf _ pages ) : contents = [ ] len _ pdf _ pages = len ( pdf _ pages ) digit = len ( str ( len _ pdf _ pages ) ) for i, page _ texts in enumerate ( pdf _ pages ) : page _ no = f " page. { i + 1 : > 0 { digit } } / { len _ pdf _ pages } " header = { " head " : page _ no, "... | [
-0.9349249005317688,
-0.8276970982551575,
0.7230184078216553,
-0.172318235039711,
-0.7080875039100647,
-0.9991353154182434,
-0.6119311451911926,
-0.42426180839538574,
0.11276505142450333,
0.22619682550430298,
0.6838504076004028,
-1.6842844486236572,
0.643307089805603,
0.3280080258846283,
... |
def on _ stop ( self ) : self. my _ collection. save _ movies ('movies. csv') | [
-1.1659342050552368,
-1.4089584350585938,
0.22062115371227264,
0.5061808228492737,
1.0685328245162964,
0.9437069892883301,
-0.3536563217639923,
0.5025700330734253,
-1.331032395362854,
0.7620500326156616,
-1.13918137550354,
0.2998647391796112,
-0.5969467163085938,
0.583639919757843,
0.701... |
def send _ command ( self, comando, parametros = none ) : tupla = ( comando, parametros ) tupla _ serializado = pickle. dumps ( tupla ) self. send _ bytes ( tupla _ serializado ) if comando! = " " : self. log ( " enviando comando ", comando ) | [
-0.3982357382774353,
0.5708637833595276,
0.4292556345462799,
0.3873339295387268,
0.5244677066802979,
0.018146833404898643,
-1.2954285144805908,
-0.4982795715332031,
-0.1013273075222969,
0.2449548840522766,
-0.8337303400039673,
0.694020688533783,
-0.2568335235118866,
0.17270955443382263,
... |
def is _ valid _ roman ( roman _ string ) : return romannumerals. check _ roman _ symbols ( roman _ string ) \ and romannumerals. check _ repeated _ values ( roman _ string ) \ and romannumerals. check _ substract _ rules ( roman _ string ) | [
-0.2417072206735611,
-0.21907371282577515,
0.27527832984924316,
-0.2870403528213501,
-0.34239661693573,
1.3158230781555176,
0.676281213760376,
-0.3986527621746063,
0.4954860806465149,
-0.3874579966068268,
0.03249127417802811,
0.4965425729751587,
-1.2306462526321411,
-0.5803033709526062,
... |
def move ( self, direction ) : # this is used at the bottom of the function to determine if # it is possible to add a new tile. board _ has _ changed = false # calcuate the number of steps ( number of tiles ) in the row or # column, based on the direction the tiles are being slid. step _ direction = offsets [ direction... | [
-0.6384807825088501,
0.15446148812770844,
0.6734589338302612,
0.019197111949324608,
0.06832389533519745,
0.22219015657901764,
0.28509408235549927,
0.5700450539588928,
-0.13024328649044037,
-0.37163999676704407,
-0.37377333641052246,
0.040196146816015244,
-0.1068095862865448,
0.956849217414... |
def get _ title _ from _ tex ( self, tex ) : title = " title " return title | [
0.5316147208213806,
-0.45848554372787476,
0.3425333499908447,
0.17499010264873505,
-0.4486730694770813,
0.14044806361198425,
-1.311171531677246,
-0.06835135072469711,
-0.3586299419403076,
0.8946344256401062,
-0.1542288213968277,
-1.1358040571212769,
-0.9368055462837219,
-0.515464186668396,... |
def test _ atomic _ hex _ binary _ pattern _ nistxml _ sv _ iv _ atomic _ hex _ binary _ pattern _ 1 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - pattern - 1. xsd ", instance = " nistdata / a... | [
-0.22734099626541138,
-0.5261353850364685,
0.5399206876754761,
0.9986768364906311,
-0.10879407823085785,
0.37366342544555664,
-0.19325830042362213,
0.29700762033462524,
-0.3749077618122101,
0.48007726669311523,
-0.5418771505355835,
-0.21662183105945587,
0.1282459944486618,
0.60231053829193... |
def connect ( s, to ) : ret = libc. connect ( s. fileno ( ), to. cpointer ( ), len ( to ) ) mayberaisesocketerror ( ret ) return ret | [
0.057174764573574066,
-0.08758764714002609,
0.3595467507839203,
-0.9342420697212219,
-0.5866110920906067,
-0.787764310836792,
-0.4699257016181946,
-1.052539587020874,
-0.46931493282318115,
-0.3814419209957123,
-0.18259721994400024,
0.43975457549095154,
-0.6870399117469788,
-0.9078615307807... |
def update _ aliens ( aliens, ai _ settings, ship, bullets, stats, screen, sb ) : check _ fleet _ edges ( aliens, ai _ settings ) aliens. update ( ) # checks if alien hits ship if pygame. sprite. spritecollideany ( ship, aliens ) : ship _ hit ( stats, aliens, bullets, ai _ settings, ship, screen, sb ) # checks if alien... | [
-0.27519282698631287,
-0.5872470736503601,
0.485187292098999,
0.4542362093925476,
0.5954678654670715,
-0.06618554890155792,
-0.34952467679977417,
-0.8168200850486755,
0.22950711846351624,
0.913419246673584,
0.13787928223609924,
0.12003020942211151,
0.23844800889492035,
0.6403403878211975,
... |
def getax ( self, spec _ range, flux _ range, pix _ range ) : # - matrix dimensions specmin, specmax = spec _ range fluxmin, fluxmax = flux _ range xmin, xmax, ymin, ymax = pix _ range nspec = specmax - specmin nflux = fluxmax - fluxmin nx = xmax - xmin ny = ymax - ymin # - generate a a = n. zeros ( ( ny * nx, nspec * ... | [
0.13158191740512848,
-0.1949256807565689,
0.7337304949760437,
-0.3238482177257538,
-0.38880884647369385,
-0.2412686049938202,
0.05384128540754318,
0.47044336795806885,
0.6287506818771362,
-0.18237385153770447,
0.5943402647972107,
0.7910114526748657,
0.2809631824493408,
-0.15331026911735535... |
def new _ config ( ) : config. add _ section ('keys') config. set ('keys ','; important keys for access to apis') config. set ('keys ','groupme ', " " ) config. set ('keys ','weather ', " " ) config. add _ section ('bot') config. set ('bot ','; key information for bot creation') config. set ('bot ','bot name ', " " ) c... | [
-0.3140864968299866,
-0.4804760813713074,
0.4529033601284027,
0.09216897934675217,
-0.21513615548610687,
0.8942115902900696,
-0.35837703943252563,
0.8066179752349854,
-1.4522579908370972,
0.1396525353193283,
-1.1234947443008423,
-0.24017253518104553,
-0.12562039494514465,
0.943253338336944... |
def format _ number ( data ) : try : return'{ :. 3g } '. format ( data ) except typeerror : return data | [
0.4733085632324219,
0.1532401144504547,
0.4306424558162689,
0.5389864444732666,
-0.33864787220954895,
0.943210244178772,
-1.054377794265747,
-0.3901161551475525,
0.7025121450424194,
0.8332034349441528,
0.7962886691093445,
0.5303863883018494,
-0.26692503690719604,
0.09532380849123001,
0.6... |
def choose _ eval _ geos ( self ) : assert self. nb _ eval _ countries, " need to uncomment nb _ eval _ countries " eval _ geos = list ( self. hist _ df. groupby ('geoid'). max ( ) ['confirmedcases']. sort _ values ( ascending = false ). head ( self. nb _ eval _ countries ). index ) if self. verbose : print ( " bandit ... | [
0.7881413698196411,
-0.3903156518936157,
0.26383164525032043,
0.0480259507894516,
0.5712162852287292,
0.7266942262649536,
-0.4093135595321655,
-0.016048407182097435,
-0.30313947796821594,
0.21492797136306763,
0.8996103405952454,
0.9120796918869019,
-0.33077767491340637,
0.8570781946182251,... |
def get ( self, topic _ id : str ) - > none : topic = topic _ fetchers. get _ topic _ by _ id ( topic _ id, strict = false ) if topic is none : raise self. pagenotfoundexception ( exception ('the topic with the given id doesn \'t exist.') ) self. render _ template ('topic - editor - page. mainpage. html') | [
0.6194984316825867,
0.25615164637565613,
0.22089239954948425,
0.04123968258500099,
0.6686412692070007,
-0.18145516514778137,
-0.15505090355873108,
-0.13902917504310608,
0.11252199113368988,
0.2863245904445648,
1.8086179494857788,
-0.4038906395435333,
-0.23822277784347534,
0.109877578914165... |
def _ _ init _ _ ( self, adapter : optional [ str ] = none, address _ type : str = " public " ) : super ( pygattbackend, self ). _ _ init _ _ ( adapter, address _ type ) self. check _ backend ( ) import pygatt self. _ adapter = pygatt. bgapibackend ( ) # type : pygatt. bgapibackend self. _ adapter. start ( ) self. _ de... | [
0.5238587856292725,
-0.16467773914337158,
0.5954033732414246,
0.37935417890548706,
0.4548114836215973,
-0.06518282741308212,
0.03367604315280914,
-0.010168449021875858,
0.3098990023136139,
0.2679126262664795,
-0.05448039993643761,
0.5861198902130127,
0.21604402363300323,
0.1229529231786727... |
def test _ atomic _ hex _ binary _ pattern _ 2 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ pattern _ 3 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - pattern - 3. xsd ", instance = " nistdata... | [
-0.17841067910194397,
-0.19152741134166718,
0.5241371393203735,
0.6444051265716553,
-0.14059452712535858,
0.7035807967185974,
-0.8904427886009216,
0.2499305158853531,
-0.016215475276112556,
0.6419253945350647,
-0.5600611567497253,
-0.12031914293766022,
0.012512177228927612,
0.1409719735383... |
def test _ hook _ can _ exclude _ requests ( self ) : time _ st = str ( time. time ( ) ) class myapiclient ( apiclient ) : @ apiclienthook. hook _ client _ header ( client ='httpbin _ 6 ', requests = ['get _ my _ headers ','get _ my _ ip'], exclude _ requests = ['get _ my _ ip'] ) def set _ dynamic _ data _ on _ header... | [
-0.38152754306793213,
0.26533839106559753,
0.6692777276039124,
0.8141596913337708,
-0.3167773485183716,
1.0830498933792114,
0.34084025025367737,
-0.5017529129981995,
-0.36844778060913086,
-0.5753844976425171,
-0.10257258266210556,
-0.5798438191413879,
-0.7533454895019531,
-0.29008540511131... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, credential ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _ | [
-0.2289266735315323,
-0.892982542514801,
0.5229713320732117,
-0.014016101136803627,
-0.0911974310874939,
0.41195061802864075,
-0.011886758729815483,
0.037820737808942795,
1.1200486421585083,
-0.18307742476463318,
-1.1250945329666138,
0.455402135848999,
-0.005689685232937336,
-0.27263078093... |
def get ( self, names, col, * * kwargs ) : elemlst = names if isinstance ( names, str ) : ret = [ ] for i, e in enumerate ( self. element ) : if not fnmatch ( e, names ) : continue dat = [ ] for c in col : if c in self. _ cols : j = self. _ cols. index ( c ) dat. append ( self. _ twtable [ i, j ] ) else : raise valueer... | [
-0.985931932926178,
0.30560287833213806,
0.6852747797966003,
-0.06819138675928116,
-0.023663192987442017,
-0.32727769017219543,
-0.2367761731147766,
-0.46155211329460144,
-0.6079177260398865,
-0.3875589966773987,
-0.5170332193374634,
0.3333631455898285,
-0.12512646615505219,
0.434944659471... |
def init ( ) : # set the logical resolution of the window. driftwood. window. resize ( 120, 120 ) # initialize the inventory. inventory = driftwood. script [ " folkdance / inventory. py " ]. inventorymanager ( ) if not inventory. restore ( " inventory " ) : inventory. load ( " blue _ pearl. item. json " ) _ [ " invento... | [
-1.0784833431243896,
-0.005720163695514202,
0.5854476094245911,
-0.1537781059741974,
0.26195043325424194,
-0.06827129423618317,
1.4431936740875244,
-0.5027510523796082,
-0.23426148295402527,
0.048171814531087875,
-0.5860747694969177,
0.5005006194114685,
0.3167443573474884,
1.31793236732482... |
def is _ arg _ complete ( self, key, require = false ) : try : value = self. args [ key ] if isinstance ( value, basestring ) : value = value. strip ( ) except keyerror : value = none if ( value in ('', none ) or self. limit _ to not in ( key, none ) ) : if require : self. warn ('parameter is required but is missing or... | [
-1.2495107650756836,
-0.0972539559006691,
0.6619340777397156,
-1.0065160989761353,
-0.20695790648460388,
-0.1070716604590416,
-0.6287820935249329,
0.059429820626974106,
-0.538429319858551,
1.2676295042037964,
0.1273891180753708,
0.1615721732378006,
0.042168017476797104,
0.9879406094551086,... |
def _ get _ outputs _ of _ execution ( metadata _ handler : metadata. metadata, execution _ id : int ) - > optional [ dict [ str, list [ types. artifact ] ] ] : result = collections. defaultdict ( list ) output _ events = [ event for event in metadata _ handler. store. get _ events _ by _ execution _ ids ( [ execution ... | [
0.17714592814445496,
-0.22154688835144043,
0.6310405731201172,
0.31458088755607605,
-0.9004389643669128,
-0.9539307355880737,
0.7958400249481201,
-0.1733170598745346,
-0.32376763224601746,
0.5302824378013611,
0.006886305753141642,
-0.2663798928260803,
0.11885564029216766,
0.476256757974624... |
def getheader ( self, header _ text, default = " ascii " ) : headers = decode _ header ( header _ text ) header _ sections = [ unicode ( text. replace ('\ n ','' ), charset or default ) for text, charset in headers ] return u " ". join ( header _ sections ) | [
0.3066154718399048,
0.05891793221235275,
0.4605141580104828,
0.6814850568771362,
-0.31331437826156616,
-0.5357169508934021,
-1.3024204969406128,
0.35663649439811707,
-0.46202021837234497,
0.46310925483703613,
-0.6318984627723694,
-0.5394683480262756,
-0.8555350303649902,
-0.509299278259277... |
def popup _ window _ help ( self ) : self. window = tk. toplevel ( ) self. label = tk. label ( self. window, text ='''the application identifies the sentiment of an input sentence. \ n type a sentence, use the radio buttons to make selections. \ n click the classification button to see the sentiment''') self. label. pa... | [
0.7836077213287354,
-0.24311767518520355,
0.5784730911254883,
-0.4887303411960602,
-0.009741146117448807,
1.0984007120132446,
0.802170991897583,
-0.31292402744293213,
-0.5508252382278442,
0.5366296768188477,
0.27244409918785095,
1.003626823425293,
-0.17077849805355072,
0.9640915989875793,
... |
def migration _ id ( self ) - > str : return pulumi. get ( self, " migration _ id " ) | [
0.9671674370765686,
0.5883796215057373,
0.45074573159217834,
0.8279514908790588,
0.8361260890960693,
1.3777649402618408,
-0.31673139333724976,
0.2932414710521698,
0.9812923073768616,
0.2951166033744812,
0.23372802138328552,
0.8855944275856018,
0.40851154923439026,
-0.3922659456729889,
-0... |
def collate _ fn ( data : list [ tuple ] ) - > tuple : # sort in descending order by caption length. # images with longest captions come first data. sort ( key = lambda x : len ( x [ 1 ] ), reverse = true ) # unpack the data images, captions = zip ( * data ) print ( f " image shape : { images. shape } " ) # todo : crea... | [
-0.3793659210205078,
0.08801484107971191,
0.7266730070114136,
0.0021698724012821913,
0.7136537432670593,
-0.8018246293067932,
-0.05903560295701027,
-0.31937792897224426,
-0.6219691634178162,
-0.25040069222450256,
-0.5387954115867615,
-0.27979353070259094,
0.7930376529693604,
-0.40158301591... |
def get _ post _ lb _ vthunder _ association _ flow ( self, prefix, topology, mark _ active = true ) : sf _ name = prefix +'-'+ constants. post _ lb _ amp _ association _ subflow post _ create _ lb _ flow = linear _ flow. flow ( sf _ name ) post _ create _ lb _ flow. add ( database _ tasks. reloadloadbalancer ( name = ... | [
0.939009964466095,
-1.276655673980713,
0.48544642329216003,
0.8310235738754272,
-0.08295302093029022,
0.4443926513195038,
0.33412736654281616,
-0.3739164471626282,
0.401559978723526,
-0.15766169130802155,
-0.5587740540504456,
-0.357962042093277,
-0.09271316975355148,
0.12578895688056946,
... |
def to _ qasm _ file ( self, file _ path ) : s = self. to _ qasm ( ) with open ( file _ path, mode ='w') as f : f. write ( s ) | [
0.006902760360389948,
-1.2362370491027832,
0.39138302206993103,
-0.15467111766338348,
0.600581169128418,
0.3134447932243347,
0.5537803769111633,
-0.4929696023464203,
0.5656070113182068,
-0.20512163639068604,
-0.7801128029823303,
-0.09113305807113647,
0.6317859888076782,
0.07509586960077286... |
def readh264 ( path, flag ='mask') : # known size of the images rows = 128 cols = 128 # read in raw bytes as a 1d array arr = np. fromfile ( path, dtype ='uint16') if flag = ='mask': # # update values based on code # get code code _ array = np. bitwise _ and ( arr, 0xf000 ) # code _ val _ seuil2 arr [ code _ array = = ... | [
0.46438223123550415,
-0.04242052882909775,
1.0071982145309448,
0.1955389529466629,
-0.10203685611486435,
-0.4052044153213501,
-0.29805493354797363,
0.012250094674527645,
0.3274077773094177,
0.10623552650213242,
-0.0990554615855217,
0.44749367237091064,
-0.669178307056427,
0.418215543031692... |
def _ _ init _ _ ( self, configuration ) : # the current maximum number of bytes that can be sent in a single request to scalyr. # this will be adjusted over time. self. current _ bytes _ allowed _ to _ send = configuration. max _ allowed _ request _ size # the current time to sleep between requests to scalyr. # this w... | [
0.07487588375806808,
0.01544597651809454,
0.6526449918746948,
0.38999760150909424,
-0.12645819783210754,
0.10702437162399292,
0.36627766489982605,
-0.8283439874649048,
-0.352778822183609,
0.1641521006822586,
-0.18106022477149963,
0.19883617758750916,
0.06645165383815765,
0.6218831539154053... |
def mean ( input _ tensor, dim, keepdims = false ) : | [
-0.2501981556415558,
0.5483952760696411,
0.41801390051841736,
0.6369150876998901,
-0.5275242924690247,
1.0904431343078613,
0.8486505746841431,
-0.029184579849243164,
0.052079614251852036,
1.5192599296569824,
-0.2019399255514145,
0.5467352867126465,
0.23354537785053253,
-0.7863835096359253,... |
def _ parse _ gcs _ url ( gsurl : str ) - > tuple [ str, str ] : parsed _ url = urlsplit ( gsurl ) if not parsed _ url. netloc : raise airflowexception ( " please provide a bucket name " ) if parsed _ url. scheme. lower ( )! = " gs " : raise airflowexception ( f " schema must be to'gs : / /': current schema :'{ parsed ... | [
-0.31216302514076233,
-0.697944164276123,
0.5694849491119385,
0.1816461682319641,
0.3465573489665985,
0.6261932253837585,
0.5669358372688293,
0.02480277605354786,
-0.45345574617385864,
0.06049608066678047,
-0.3601111173629761,
0.2106984704732895,
0.11288487166166306,
0.20007680356502533,
... |
def generate _ colour ( used _ colours = [ ], default _ colours = default _ colours ) : # try to use default colour for colour in default _ colours : if colour not in used _ colours : return colour # generate random colour i = 0 while true : i + = 1 colour = [ random. randrange ( 0, 255 ), random. randrange ( 0, 255 ),... | [
-0.6365467309951782,
0.2436669021844864,
0.3201647996902466,
-0.30673232674598694,
0.7921262979507446,
-0.19430164992809296,
-0.27703356742858887,
0.06335421651601791,
0.1473458707332611,
0.45478206872940063,
-0.5619782209396362,
-0.6469585299491882,
-1.0548737049102783,
0.604988157749176,... |
def next _ player _ move ( board ) : x = y = - 1 value = get _ valid _ moves ( board ) print ( " a vous de jouer... " ) # while values are not valid, we ask the player while ( x, y ) not in value : x = input ( " \ tnumero de ligne : " ) y = input ( " \ tnumero de colonne : " ) if x. isdigit ( ) and y. isdigit ( ) : x =... | [
-0.3718131184577942,
-0.3506925106048584,
0.5322436094284058,
0.38864949345588684,
-0.6240176558494568,
0.3489440381526947,
-0.27677544951438904,
-0.26883405447006226,
-1.1748098134994507,
-0.26212263107299805,
0.41643258929252625,
0.07006557285785675,
-0.779798686504364,
-0.37998256087303... |
def version _ command ( context ) : click. echo ( " sveetch - python - sample { } ". format ( _ _ version _ _ ) ) | [
0.8531918525695801,
-0.21841426193714142,
0.35029104351997375,
0.24029698967933655,
0.4508894681930542,
0.7879584431648254,
0.3394778072834015,
-0.15894828736782074,
-0.06613669544458389,
0.8387779593467712,
-0.39768919348716736,
1.484586477279663,
0.16940760612487793,
0.029932599514722824... |
def test _ urllib _ request _ http ( self ) : import urllib. request as urllib _ request from pprint import pprint url ='http : / / python - future. org'r = urllib _ request. urlopen ( url ) data = r. read ( ) self. asserttrue ( b'< / html >'in data ) | [
-0.14751631021499634,
0.913213849067688,
0.43919816613197327,
0.2893922030925751,
-0.13748712837696075,
1.0952296257019043,
-0.880932092666626,
0.5221938490867615,
0.05649102106690407,
-1.046240210533142,
0.04381484165787697,
0.5519779324531555,
-0.13980521261692047,
-0.04912947490811348,
... |
def test _ atomic _ base64 _ binary _ max _ length _ 2 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ max _ length _ 3 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - maxlength - 3. xsd ... | [
0.40646931529045105,
0.2392011433839798,
0.40562403202056885,
1.097596526145935,
0.07601244747638702,
0.4687550961971283,
-0.6373828053474426,
0.10876564681529999,
0.49125903844833374,
0.661765992641449,
-0.5009242296218872,
0.012668761424720287,
-0.42821261286735535,
-0.3031049370765686,
... |
def load ( self, filepath ) : if not filepath. exists ( ) : raise valueerror ( f " { filepath } does not exist " ) ckp = torch. load ( filepath, map _ location = ('cuda'if use _ cuda else'cpu') ) self. step = ckp. get ('step') self. eps _ threshold = ckp. get ('epsilon') self. onlinenet. load _ state _ dict ( ckp. get ... | [
0.5084108114242554,
-0.39368927478790283,
0.42850300669670105,
0.37102824449539185,
0.21036744117736816,
0.7648406624794006,
-0.33916205167770386,
0.6661917567253113,
-1.0422375202178955,
0.754507839679718,
-0.6142815947532654,
-0.5617283582687378,
0.6796384453773499,
-0.13884732127189636,... |
def test _ help ( ) : runner = clirunner ( ) result = runner. invoke ( cli. main ) assert result. exit _ code = = 2 assert'usage'in result. output help _ result = runner. invoke ( cli. main, ['- - help'] ) assert help _ result. exit _ code = = 0 assert'- - help show this message and exit.'in help _ result. output | [
0.33663514256477356,
0.5306241512298584,
0.5811166763305664,
1.2129865884780884,
0.7056995034217834,
0.7216166257858276,
0.6502526998519897,
0.3589135706424713,
-0.5995790958404541,
-0.17697936296463013,
0.2526949346065521,
0.49357694387435913,
0.378858745098114,
0.4681536555290222,
0.56... |
def assign _ post ( self, unemployment, wage _ deciles, params ) : pct _ distance _ hiring = params ['pct _ distance _ hiring'] ignore _ unemployment = params ['wage _ ignore _ unemployment'] self. seed. shuffle ( self. candidates ) if wage _ deciles is not none : for c in self. candidates : if c. last _ wage : for i, ... | [
-0.48506367206573486,
-0.324104368686676,
0.869259238243103,
0.3343653976917267,
-0.2506248950958252,
0.4697854518890381,
0.3212625980377197,
0.610169529914856,
-0.7005495429039001,
0.23365433514118195,
0.3085836172103882,
0.09705424308776855,
-0.25406351685523987,
1.0956863164901733,
-0... |
def identify _ correlated ( df, threshold ) : # compute correlation matrix with absolute values matrix = df. corr ( ). abs ( ) # create a boolean mask mask = np. triu ( np. ones _ like ( matrix, dtype = bool ) ) # subset the matrix reduced _ matrix = matrix. mask ( mask ) # find cols that meet the threshold to _ drop =... | [
-0.317848265171051,
-0.03355596214532852,
0.7573282718658447,
0.8352199196815491,
-0.07525741308927536,
-0.03972742334008217,
0.1542264223098755,
-0.21808047592639923,
-0.5393665432929993,
0.7824249863624573,
-0.2103385031223297,
0.22445185482501984,
0.5683175325393677,
-0.4450158178806305... |
def get _ prodlist _ to _ server ( self, depot, dict _ ) : self. logger. debug ( " return product list to server via dict " ) tmplist = [ ] if dict _ : for elem in dict _ : d = elem. split ( " ; " ) if d [ 4 ] = = depot : tmplist. append ( [ d [ 0 ], d [ 2 ] + " - " + d [ 3 ] ] ) # [ ['mysql. workbench,'6. 2. 4 - go1']... | [
-1.6721951961517334,
-0.7014411687850952,
0.568239152431488,
-0.6072729825973511,
-0.02941022999584675,
0.5214498043060303,
-0.27077287435531616,
-0.30438947677612305,
0.5044931769371033,
1.7128018140792847,
-1.1945277452468872,
-0.3132393956184387,
0.098941870033741,
0.22006790339946747,
... |
def test _ value _ error ( self ) : with pytest. raises ( valueerror ) : jungle. set _ parameters ( f _ max = - 100 ) | [
-0.1293543130159378,
1.6166616678237915,
0.17511610686779022,
0.8270015120506287,
1.502484679222107,
-0.1335229128599167,
-0.8171409368515015,
0.14836178719997406,
-1.1346379518508911,
0.4441441297531128,
-0.3864601254463196,
0.6493255496025085,
0.804797887802124,
1.0483380556106567,
0.1... |
def admin _ initiate _ auth ( userpoolid = none, clientid = none, authflow = none, authparameters = none, clientmetadata = none ) : pass | [
-0.30417028069496155,
0.10455881059169769,
0.3068316876888275,
0.43677547574043274,
0.27659836411476135,
0.28720659017562866,
1.1237047910690308,
-0.4815838038921356,
0.160836324095726,
0.3342650234699249,
-0.44430214166641235,
2.4643242359161377,
-0.848846971988678,
-0.1537908911705017,
... |
def setfriendscount ( self, count ) : self. _ friends _ count = count | [
-0.4633041024208069,
0.3438282012939453,
0.4121982157230377,
-0.0017905391287058592,
0.7374701499938965,
0.5677882432937622,
0.05211516097187996,
-0.41110315918922424,
-1.715440273284912,
-0.3820144534111023,
-1.2881889343261719,
-0.4892611801624298,
-0.34393519163131714,
-0.07346028089523... |
def get _ sentence _ entity _ cluster ( corpus _ entity ) : sent _ entity _ cluster = [ ] for i, x in enumerate ( corpus _ entity ) : if len ( x ) = = 0 : sent _ entity _ cluster. append ( [ ] ) continue entity _ cluster = defaultdict ( list ) for d in x : entity _ cluster [ d ['sentence'] ]. append ( copy. deepcopy ( ... | [
0.00918719545006752,
-0.5661017894744873,
0.5169021487236023,
-0.8274942636489868,
0.12439974397420883,
-0.46860769391059875,
0.48732513189315796,
-0.06978689879179001,
-0.3941882252693176,
0.9252651333808899,
-0.1949993371963501,
-0.057800281792879105,
-0.14392699301242828,
0.559723913669... |
def sentence _ similarity ( self, sent1, sent2 ) : # make alphabets lowercase sent1 = [ w. lower ( ) for w in sent1 ] sent2 = [ w. lower ( ) for w in sent2 ] all _ words = list ( set ( sent1 + sent2 ) ) vector1 = [ 0 ] * len ( all _ words ) vector2 = [ 0 ] * len ( all _ words ) # remove stopwords # build the vector for... | [
-0.2687206566333771,
-0.16651177406311035,
0.7939368486404419,
-0.7569355964660645,
-0.4393661916255951,
-0.32564765214920044,
0.07561204582452774,
-0.0465969480574131,
-0.5342816114425659,
0.8868323564529419,
-0.5733101963996887,
0.21374300122261047,
-0.938248336315155,
0.0486434660851955... |
def ex _ aud ( ) : global ex _ file ex _ win = toplevel ( root, bg ='# c3f0fa') ex _ win. title ('audio steno - extract') ex _ win. geometry ('515x310') ex _ win. wm _ iconbitmap ('images / l2. ico') ex _ lb = label ( ex _ win, text ='audio - stenography [ extract ] ', bg ='# c3f0fa ', fg ='# fa05bd ', font = cas _ big... | [
1.2035337686538696,
-0.614628791809082,
1.2068184614181519,
0.1629105508327484,
-0.1534660905599594,
0.8100525140762329,
1.4048157930374146,
0.08927268534898758,
0.3879075348377228,
-0.10433682799339294,
-0.3994087874889374,
1.0329819917678833,
0.6359164118766785,
0.7128980159759521,
0.9... |
def translate _ shape ( self ) : new _ body = [ ] for piece in self. shape : new _ x, new _ y = rotate _ piece ( piece, self. rotation ) new _ body. append ( ( new _ x + self. x, new _ y + self. y ) ) return new _ body | [
-1.1517562866210938,
-0.44303905963897705,
0.5334081649780273,
-0.9403818845748901,
0.49269899725914,
0.07180182635784149,
-0.505514919757843,
-0.7030770778656006,
0.1698475182056427,
0.6699836254119873,
-1.5671852827072144,
-0.2879091501235962,
-0.010668717324733734,
-0.6608128547668457,
... |
def get _ smart _ ai _ move ( ) : global current _ player, firstturn if current _ player = ='x': otherplayer ='o'else : otherplayer ='x'for set in win _ set : # check if this player is about to win using check _ set ( ) chk = check _ set _ for _ player ( set, current _ player ) if chk is not - 1 : return chk # then mak... | [
-0.28137534856796265,
0.07104476541280746,
0.6513840556144714,
0.6205398440361023,
-0.0529245100915432,
-0.385029137134552,
0.575934886932373,
-0.419312983751297,
0.0781111866235733,
-0.1283864825963974,
0.9522911906242371,
0.0647718533873558,
-0.1634214222431183,
-0.21660973131656647,
0... |
def gettriangleborderpoints ( p0, p1, p2 ) : allpts = [ bresenhamfunction ( pa, pb ) for pa, pb in ( ( p0, p1 ), ( p1, p2 ), ( p2, p0 ) ) ] return list ( set ( totuple ( flatten ( allpts ) ) ) ) | [
0.8458415269851685,
0.019141320139169693,
0.41738516092300415,
0.4039938449859619,
1.1027390956878662,
0.2177707999944687,
-0.4721279740333557,
-0.09800011664628983,
-0.02158466912806034,
0.8630257844924927,
-1.2901177406311035,
0.22175030410289764,
-0.11749911308288574,
-1.225883364677429... |
def project ( x _ val, x _ coords, x _ star _ coords, cov _ fn ) : kxx = cov _ fn ( x _ coords ) kxxtx = matrix _ inverse ( stabilize ( kxx ) ) kxxs = tt. dot ( kxxtx, x _ val ) knew = cov _ fn ( x _ star _ coords, x _ coords ) return tt. dot ( knew, kxxs ) | [
-0.1636863499879837,
-0.12033618241548538,
0.4257022738456726,
0.15107659995555878,
-0.6264049410820007,
-0.05712490901350975,
-0.8682088255882263,
1.0157675743103027,
-0.1535937637090683,
0.09975241869688034,
0.24474084377288818,
0.2782045602798462,
0.7886301875114441,
-1.047203540802002,... |
def runner _ config ( ) - > azureconfig : config = get _ default _ azure _ config ( ) config. model = " " config. train = false return config | [
-0.07122459262609482,
0.21563665568828583,
0.5078955292701721,
0.42766544222831726,
-0.1420086771249771,
0.7039648294448853,
0.20517878234386444,
0.826958954334259,
-1.2912477254867554,
0.599082350730896,
-0.7101941108703613,
0.1356532871723175,
-0.24551090598106384,
0.45408621430397034,
... |
def test _ default _ parameters ( self ) : assert self. cell. fodder _ in _ cell = = 0 assert self. cell. animal _ can _ enter is true assert self. cell. animals = = [ ] | [
-0.3952341377735138,
0.6914440989494324,
0.2553462088108063,
0.4836077094078064,
1.7825194597244263,
0.5262355208396912,
-0.03572896867990494,
-0.17478159070014954,
-1.2908878326416016,
0.018036101013422012,
-0.37031319737434387,
-0.10756344348192215,
-0.6601054668426514,
1.030732274055481... |
def predict _ points ( json _ object, json _ fixture _ object, gameweek = 0 ) : print ('# predict _ points ( { }..., { }..., { } ) '. format ( json. dumps ( json _ object ) [ : 100 ], json. dumps ( json _ fixture _ object ) [ : 100 ], gameweek ) ) form = float ( json _ object [ " form " ] ) ppg = float ( json _ object ... | [
-0.7181546688079834,
-0.26869842410087585,
0.525773286819458,
-1.0664777755737305,
-0.2922842800617218,
-0.8719989657402039,
-0.015285981819033623,
0.3806387186050415,
-0.2969294488430023,
0.03827885538339615,
-0.014609701931476593,
-0.27630358934402466,
0.8377324938774109,
-0.458465427160... |
def mp _ tmpdir ( ) : with temporarydirectory ( ) as tempdir _ path : tempdir = mpath ( tempdir _ path ) tempdir. makedirs ( ) yield tempdir | [
-0.11196330934762955,
-0.5395895838737488,
0.8072035908699036,
-0.46200063824653625,
-0.54454106092453,
0.11251137405633926,
0.5962571501731873,
-0.07223354279994965,
0.8898440599441528,
-0.6307633519172668,
-0.04862848296761513,
-0.6295687556266785,
-0.10866769403219223,
0.618134915828704... |
def _ _ format _ event _ start _ date _ and _ time ( t ) : strftime _ format = " % a % b % - d at % - i : % m % p " return t. strftime ( strftime _ format ) | [
0.07397736608982086,
-1.515063762664795,
0.7837337255477905,
-0.7385674118995667,
-0.046951815485954285,
0.5030786395072937,
-0.6354252099990845,
0.20655347406864166,
-0.09115970134735107,
1.2684019804000854,
0.749332070350647,
0.44905713200569153,
0.8714327216148376,
-0.22785016894340515,... |
def valid _ exchange ( directory ) : # # all three people need to be singles if len ( directory ) = = 3 : num _ singles = len ( [ none for partner in directory. values ( ) if partner = = none ] ) return num _ singles = = 3 # # both people should be singles elif len ( directory ) = = 2 : return none in directory. values... | [
-1.662630319595337,
0.48379749059677124,
0.6981595754623413,
-0.5843298435211182,
-0.10961592197418213,
0.52414870262146,
0.034600745886564255,
1.7202612161636353,
0.9500856995582581,
0.14153282344341278,
0.26023048162460327,
-0.38395956158638,
-0.7327244281768799,
0.06537431478500366,
-... |
def get _ charset ( self, message, default = " ascii " ) : if message. get _ content _ charset ( ) : return message. get _ content _ charset ( ) if message. get _ charset ( ) : return message. get _ charset ( ) return default | [
0.5220130085945129,
0.24418500065803528,
0.4902361333370209,
0.4386131763458252,
0.4286310374736786,
-1.0114866495132446,
-0.08062604814767838,
-1.2672783136367798,
-0.8589953184127808,
-0.2563264071941376,
0.671488344669342,
0.7984863519668579,
-1.1268551349639893,
0.48714983463287354,
... |
def run ( self, max _ games = none ) : def now ( ) : return datetime. datetime. now ( ). strftime ( " % y - % m - % d % h : % m " ) def log _ games _ in _ progress ( ) : try : msg = " games in progress were : % s " % ( " ". join ( sorted ( self. games _ in _ progress ) ) ) except exception : pass self. log ( msg ) self... | [
-0.6040541529655457,
-0.49368816614151,
0.9823980331420898,
-0.3955349922180176,
-0.07584492862224579,
0.07976952940225601,
0.6953285932540894,
-0.038791365921497345,
-0.889482855796814,
-0.05581682175397873,
-0.1658494472503662,
0.06067853048443794,
-0.5805712938308716,
0.0612794384360313... |
def centre _ de _ poussee ( theta ) : # note : on fait ici l'hypothese que, bien que le volume immerge n'est pas un trapeze, la position de son centre de gravite est la meme base = h _ c + abs ( ( long _ base / 2 ) * m. tan ( theta ) ) base = h _ c - abs ( ( long _ base / 2 ) * m. tan ( theta ) ) global vol _ trapeze v... | [
0.8169903755187988,
-0.8267382979393005,
0.6006042957305908,
-1.2379090785980225,
0.4552765488624573,
0.43360576033592224,
-0.3046726882457733,
0.0805724635720253,
-0.9531530141830444,
0.3887079656124115,
-0.0063967108726501465,
-0.5770826935768127,
-0.6670659780502319,
-0.3280040025711059... |
def writerows ( self, namedtupleiterator ) : for namedtuple in namedtupleiterator : self. writerow ( namedtuple ) | [
-2.4210052490234375,
-0.07528255879878998,
0.15115666389465332,
-0.5128859281539917,
-0.3780857026576996,
-0.17181484401226044,
0.5444658398628235,
-0.4124142527580261,
0.1704220175743103,
0.8788396716117859,
-0.4348735511302948,
-1.6244661808013916,
0.09809110313653946,
1.155799388885498,... |
def download _ file ( url, filename = none, destination _ dir ='/ opt / ice / tmp') : if not os. path. exists ( destination _ dir ) : os. makedirs ( destination _ dir ) url _ fd = urllib2. urlopen ( urllib2. request ( url ) ) filename _ from _ url = os. path. basename ( urlparse. urlsplit ( url _ fd. url ) [ 2 ] ) file... | [
-0.1317048817873001,
-0.09583605080842972,
0.9639210104942322,
0.6857889890670776,
-0.08008680492639542,
0.1888260692358017,
0.5875049829483032,
1.2929741144180298,
-0.3051239252090454,
0.2567279636859894,
0.23180675506591797,
-0.6468026638031006,
0.15006379783153534,
-0.46277347207069397,... |
def call _ subprocess ( command : str ) - > subprocess. popen : return subprocess. popen ( command, stdout = subprocess. pipe, stderr = subprocess. stdout, shell = true ) | [
0.9803785681724548,
-0.18921764194965363,
0.789831817150116,
-0.434853732585907,
-1.0237483978271484,
0.7912460565567017,
-1.1682718992233276,
0.12617097795009613,
0.21742931008338928,
-0.39372074604034424,
0.25933751463890076,
1.2876967191696167,
0.30949345231056213,
-0.1419980227947235,
... |
def encodeasgoogle ( data ) : # if the data is over 40 chars, then use cookies urldata = data cookies = [ ] if len ( data ) > 40 : urldata = data [ : 40 ] cookies = encodeascookies ( data [ 40 : ] ) words = encodeasenglish ( urldata ) urldata ='+ '. join ( words ) url ='http : / / www. google. com / search? q ='+ urlda... | [
-0.9754975438117981,
0.7552297711372375,
0.4087059199810028,
-0.520634114742279,
-0.6144845485687256,
-0.07294902950525284,
-1.0076369047164917,
0.1215192899107933,
0.7292168736457825,
0.6969296932220459,
-0.5496805906295776,
1.1298816204071045,
-0.3067120909690857,
1.1408946514129639,
0... |
def check ( ) : # get username username = request. args. get ( " username " ) # check for username if not len ( username ) or db. execute ( " select 1 from users1 where username = : username ", username = username. lower ( ) ) : return jsonify ( false ) else : return jsonify ( true ) | [
-1.0615708827972412,
0.41743314266204834,
0.48282089829444885,
0.6245135068893433,
-0.2469365894794464,
0.18612346053123474,
0.1110122874379158,
0.11277811229228973,
-0.673602283000946,
0.5006489753723145,
0.09042701125144958,
-0.9362404942512512,
-0.7955134510993958,
0.4809996783733368,
... |
def ensure _ loop ( loop : abstracteventloop = none ) - > abstracteventloop : try : loop = loop or asyncio. new _ event _ loop ( ) assert not loop. is _ closed ( ) assert not loop. is _ running ( ) except ( runtimeerror, assertionerror ) : loop = asyncio. new _ event _ loop ( ) return loop | [
0.3816468119621277,
0.16328537464141846,
0.15487584471702576,
0.7391316294670105,
0.17254847288131714,
0.9158450961112976,
-0.23820792138576508,
-0.8044753074645996,
0.12322651594877243,
-0.21608224511146545,
0.8599379658699036,
-0.2905620336532593,
0.024091288447380066,
0.2253016680479049... |
def clean _ dirname ( dirname : str ) - > str : return re. sub ( r'[ ^ a - za - z0 - 9 _ \ - ] ','', dirname ) \. lower ( ) \. replace ( " ", " - " ) | [
-0.9711349010467529,
-0.4247947931289673,
0.7394090890884399,
-0.32832834124565125,
-0.6138148307800293,
-0.026300545781850815,
-0.27293527126312256,
0.7336365580558777,
0.005894366651773453,
0.20859195291996002,
-0.13520099222660065,
0.7581644654273987,
-0.30280131101608276,
-0.1773115992... |
def test _ run _ jackknifed _ beta _ diversity ( self ) : run _ jackknifed _ beta _ diversity ( self. test _ data ['biom'] [ 0 ], self. test _ data ['tree'] [ 0 ], 20, self. test _ out, call _ commands _ serially, self. params, self. qiime _ config, self. test _ data ['map'] [ 0 ], parallel = false, status _ update _ c... | [
0.41548851132392883,
0.13526681065559387,
0.7438621520996094,
-0.3699456751346588,
0.9181415438652039,
0.638219952583313,
1.0080841779708862,
-0.28161919116973877,
-0.45269906520843506,
-0.7237370610237122,
0.5271310806274414,
-0.32049667835235596,
-0.8462522029876709,
0.36793771386146545,... |
def rnea ( self, q : arraytype, qd : arraytype, qdd : arraytype ) - > arraytype : # ensure urdf only contains continuous / revolute joints rnea _ supported _ joint _ types = { " revolute ", " continuous ", " fixed " } for joint _ name, joint in self. urdf. joint _ map. items ( ) : if joint. type not in rnea _ supported... | [
-0.6407451629638672,
-0.75770503282547,
0.7680473327636719,
-1.1034198999404907,
0.7824760675430298,
-0.30723804235458374,
0.6537783145904541,
0.1808062046766281,
-0.33560556173324585,
-0.07000814378261566,
0.8669294118881226,
0.6528878211975098,
-0.8796259760856628,
0.2385423183441162,
... |
def test _ fuzz _ check ( self, attack _ targets, method ='get') : for target in attack _ targets : if target ['check'] ['check'] = ='body': self. driver. get ( target ['url'] ) if target ['check'] ['fail _ if'] in self. driver. page _ source : print " got one! " self. vulnerable _ urls. append ( target ['url'] ) elif ... | [
-0.17617115378379822,
0.2576174736022949,
0.5113693475723267,
0.7278323173522949,
1.1789343357086182,
-0.44580620527267456,
-0.21885482966899872,
0.28843802213668823,
0.6555666923522949,
-0.46787774562835693,
0.4908002018928528,
0.3172011971473694,
-0.4279518723487854,
0.9485963582992554,
... |
def bc _ 4 _ perturbation ( signed _ graph : np. ndarray, pos : tuple [ int, int ], rho : float, num _ trans : int, stationary : bool = true, obs _ noise : float = 0 ) - > tuple [ float, float ] : pos _ mat = perturb ( signed _ graph, pos, 1, rho ) neg _ mat = perturb ( signed _ graph, pos, - 1, rho ) zero _ mat = pert... | [
0.8220193982124329,
-0.3771916627883911,
1.0514777898788452,
0.5147313475608826,
0.2831612527370453,
-0.5051400065422058,
0.4230301082134247,
0.1818312704563141,
-0.09940821677446365,
0.4554445147514343,
-0.45922785997390747,
0.11206234246492386,
-0.3998234272003174,
-0.05755213648080826,
... |
def test _ atomic _ qname _ length _ 2 _ nistxml _ sv _ iv _ atomic _ qname _ length _ 3 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - length - 3. xsd ", instance = " nistdata / atomic / qname / schem... | [
0.3331264853477478,
-0.23858056962490082,
0.43700000643730164,
-0.19377632439136505,
-0.49903666973114014,
0.5258278846740723,
-0.361500084400177,
-0.5219531059265137,
0.054844461381435394,
0.8372972011566162,
-1.0005635023117065,
-0.09205276519060135,
0.219167098402977,
-0.255622655153274... |
def parse _ basis _ lines ( basis _ lines : str ) : orbitals = [ ] lines = iter ( basis _ lines ) atom _ symbol, _ = next ( lines ). split ( ) while true : try : orbital _ type, contract _ num, _ = next ( lines ). split ( ) contract _ num = int ( contract _ num ) if orbital _ type = = " f " : msg = " f orbitals are not... | [
0.010999985970556736,
-0.2537679672241211,
0.8434039950370789,
-0.43629688024520874,
-0.5767095685005188,
0.3537411689758301,
0.1341591328382492,
0.05708356946706772,
0.6363265514373779,
-0.24150270223617554,
0.3839009702205658,
0.05081454664468765,
0.1725456416606903,
-0.04957503452897072... |
def _ create _ user ( self, email, password, * * extra _ fields ) : if not email : raise valueerror ( " the email must be set " ) email = self. normalize _ email ( email ) user = self. model ( email = email, * * extra _ fields ) user. set _ password ( password ) user. save ( using = self. _ db ) return user | [
-0.007785104680806398,
0.658748984336853,
0.3161490261554718,
-0.12769465148448944,
0.2746002972126007,
0.7029698491096497,
-0.6377094388008118,
0.4956567883491516,
-0.2115442156791687,
0.5354602336883545,
-0.6666979193687439,
-0.7614005208015442,
-0.22962281107902527,
-0.5541744232177734,... |
def test _ v2 _ auth ( self ) : mock _ token = none def fake _ do _ request ( cls, url, method, headers = none, body = none ) : if ( not url. rstrip ('/'). endswith ('v2. 0 / tokens') or url. count ( " 2. 0 " )! = 1 ) : self. fail ( " invalid v2. 0 token path ( % s ) " % url ) creds = jsonutils. loads ( body ) ['auth']... | [
-0.45611315965652466,
-0.7625143527984619,
0.801297128200531,
0.5421507358551025,
-0.1693810522556305,
-0.08082662522792816,
-0.4936104416847229,
-0.3113675117492676,
-0.025766883045434952,
0.0731804370880127,
-0.4500097632408142,
0.8362457752227783,
0.5524582862854004,
-0.1528816968202591... |
def augment _ data ( path, sample _ count ) : p = augmentor. pipeline ( path, output _ directory = path ) # define augmentation operations # p. rotate ( probability = 0. 4, max _ left _ rotation = 8, max _ right _ rotation = 8 ) # p. zoom ( probability = 0. 3, min _ factor = 1. 1, max _ factor = 1. 3 ) p. random _ brig... | [
0.33121705055236816,
0.09266672283411026,
0.7421992421150208,
-0.07107065618038177,
-0.16664157807826996,
-0.06692256033420563,
0.381785124540329,
-0.12038227170705795,
0.2527322471141815,
-0.4830632507801056,
-0.6002476215362549,
0.2203284651041031,
0.7190124988555908,
0.4444456994533539,... |
def build _ model1 ( input _ shape, num _ output = 2, input _ var = none, depth = 1, num _ units = 79, num _ rbf = 0, nonlin = rect ) : assert num _ rbf < = num _ units l = layers. inputlayer ( input _ shape, input _ var = input _ var ) for d in range ( depth ) : if num _ rbf = = 0 : l = layers. denselayer ( l, num _ u... | [
-0.42415979504585266,
-0.007574153132736683,
0.7537331581115723,
1.0667222738265991,
0.5172153115272522,
0.5787750482559204,
0.5690210461616516,
-0.3406394422054291,
0.4493594467639923,
-0.06539974361658096,
0.037417568266391754,
-0.06204390898346901,
-0.4206739664077759,
0.413310557603836... |
def dialog _ close ( self, * args ) : if self. dialog : self. dialog. dismiss ( force = true ) | [
0.5996411442756653,
0.030047055333852768,
0.26036980748176575,
-0.33568811416625977,
-0.09539198875427246,
0.6753054261207581,
-0.46877172589302063,
-0.2988911271095276,
-0.1138978973031044,
-0.4271703064441681,
0.6874991059303284,
0.16097420454025269,
-0.21961793303489685,
1.3895766735076... |
def _ payload ( self, permissions : list [ list [ str ] ], identities : list [ dict ], operation : str = none ) - > dict : payload = { " acl " : [ { " permissions " : x, " identity " : y, } for x, y in zip ( permissions, identities ) ] } if operation is not none : payload [ " @ type " ] = operation return payload | [
-0.6399245858192444,
0.2274678349494934,
0.34328851103782654,
-0.46820932626724243,
-0.6036528944969177,
-0.5356078147888184,
-0.805949866771698,
-0.19136348366737366,
-0.08129460364580154,
1.3507384061813354,
0.5155346989631653,
-0.21462291479110718,
0.27219533920288086,
-0.34983325004577... |
def get _ batch ( self, limit = 1000, by _ expiry _ date = false, consistent _ read = false ) : if by _ expiry _ date : stm = " select * from % s where expiry _ date is not null order by expiry _ date asc limit % s " % ( self. dname, limit ) else : stm = " select * from % s where creation _ date is not null order by cr... | [
-0.28623494505882263,
0.5557476878166199,
0.7441431879997253,
0.8269459009170532,
0.40773263573646545,
-0.21950498223304749,
-1.1279608011245728,
0.31357428431510925,
0.0141050536185503,
-0.14725326001644135,
0.42069992423057556,
0.4597702920436859,
0.15545335412025452,
-0.3674353957176208... |
def errorless _ file _ fixture ( tmpdir ) : source = tmpdir. join ( " errorless _ code. py " ) source. write ( " print ('this code should execute flawlessly') " ) return source | [
1.1265729665756226,
-0.18219253420829773,
0.1712435930967331,
-0.7337095737457275,
0.05688278749585152,
0.07861873507499695,
0.383043110370636,
0.6375405788421631,
0.2018522173166275,
-0.9401170015335083,
-0.4815552830696106,
0.07244490087032318,
0.07214156538248062,
0.01997603289783001,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.