text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def enable _ toolbar _ buttons ( self, state ) : for b in [ self. select _ part _ button, self. remove _ part _ button, self. toggle _ bom _ cpl _ button, self. toggle _ bom _ button, self. toggle _ cpl _ button, self. part _ details _ button, ] : if state : b. enable ( ) else : b. disable ( ) | [
-0.010770353488624096,
-0.557715892791748,
0.4035244286060333,
0.39353349804878235,
0.3645654618740082,
0.9083465933799744,
0.2223990112543106,
-0.3429257869720459,
0.3271540701389313,
-0.05946267023682594,
-1.1770962476730347,
-0.42885494232177734,
-0.398296594619751,
0.2756846845149994,
... |
def layout _ 2 _ group ( self, layout _ id ) : random. shuffle ( self. layout _ 2 _ group _ table [ layout _ id ] ) return self. layout _ 2 _ group _ table [ layout _ id ] [ 0 ] | [
-0.6720771193504333,
0.05080721527338028,
0.44597965478897095,
-0.4320339560508728,
-1.2007452249526978,
-0.2530730068683624,
0.686105489730835,
-0.7764112949371338,
0.6853420734405518,
-0.7907266616821289,
0.7596268057823181,
0.2478533685207367,
0.16025608777999878,
0.10600753873586655,
... |
def active _ url ( context, viewname, * args, * * kwargs ) : request = get _ request ( context ) url = resolve _ url ( viewname, * args, * * kwargs ) return'active'if request. path = = url else'' | [
-0.44350665807724,
-0.9532296657562256,
0.6764042973518372,
0.4163096249103546,
0.43949055671691895,
-0.3497519791126251,
0.03949851170182228,
-0.04866625368595123,
0.09767528623342514,
-0.38239505887031555,
0.601798951625824,
0.3371194005012512,
-0.2074536383152008,
-0.9116000533103943,
... |
def get _ time _ prior ( time, uncertainty, name = " geocent _ time ", latex _ label = " $ t _ c $ " ) : return bilby. core. prior. uniform ( minimum = time - uncertainty, maximum = time + uncertainty, name = name, latex _ label = latex _ label, unit = " $ s $ ", ) | [
0.873408854007721,
-0.669032096862793,
0.839958667755127,
-0.46683213114738464,
-0.04019374027848244,
0.24487556517124176,
-0.6822399497032166,
-0.3256378471851349,
0.007018137723207474,
0.61427241563797,
0.4836709797382355,
0.2608187794685364,
0.001754587166942656,
-0.6393349170684814,
... |
def getguids ( session, users = none, flags = 0 ) : ems = getdefaultstore ( session ). queryinterface ( iid _ iexchangemanagestore ) if users is none : users = getuserlist ( session ) elif isinstance ( users, basestring ) : users = [ users ] for user in users : try : storeid = ems. createstoreentryid ( none, user, 0 ) ... | [
-0.5347457528114319,
0.19239172339439392,
0.4226112365722656,
0.3131103217601776,
-0.5247534513473511,
0.09250012040138245,
-0.11506246775388718,
-0.07230038940906525,
0.7840323448181152,
0.34186720848083496,
0.5836206674575806,
0.47271668910980225,
-0.7379113435745239,
0.4506330192089081,... |
def connect _ db ( ) : rv = app. config ['database'] return rv | [
-0.257269948720932,
0.08685817569494247,
0.27454838156700134,
0.7962488532066345,
0.16302764415740967,
0.3468001186847687,
-0.36948949098587036,
0.13380682468414307,
-0.32989978790283203,
0.619629979133606,
0.30767321586608887,
-0.020247936248779297,
-0.9573177099227905,
0.2891730070114136... |
def get _ commerce _ transactions _ current _ buys ( self, token = none ) : # todo : add paging support! return self. _ request ( " commerce / transactions / current / buys ", access _ token = token ) if token else self. _ request ( " commerce / transactions / current / buys " ) | [
-0.4658955931663513,
0.28773579001426697,
0.4370845556259155,
0.5058154463768005,
0.7313916683197021,
-1.0298302173614502,
-0.2979055941104889,
-0.1985906958580017,
-0.044983845204114914,
0.2694261372089386,
0.14159035682678223,
0.918516218662262,
-0.1401149183511734,
-0.14886170625686646,... |
def test _ get _ signup _ page ( self ) : page = self. client. get ( reverse ( " signup " ), follow = true ) self. assertequal ( page. status _ code, 200 ) self. asserttemplateused ( page, " signup. html " ) | [
-0.10405513644218445,
0.48419058322906494,
0.5315355062484741,
0.33819571137428284,
0.5990279912948608,
0.5796775221824646,
0.3794874846935272,
0.806768536567688,
0.14760886132717133,
-0.024149784818291664,
0.2529584467411041,
-0.6874501705169678,
0.5380339622497559,
-0.025094028562307358,... |
def get _ fitness ( solution, node _ list ) : # append path back to initial node. solution _ aux = np. hstack ( ( solution, solution [ 0 ] ) ) # compute fitness. return np. sum ( [ dist _ func ( node _ list [ el [ 0 ] ], node _ list [ el [ 1 ] ] ) for el in [ ( solution _ aux [ idx ], solution _ aux [ idx + 1 ] ) for i... | [
-0.26013028621673584,
0.4421693980693817,
0.4870641231536865,
0.582062304019928,
0.37042236328125,
-0.5675719380378723,
1.0077697038650513,
0.7175688147544861,
-0.2948355972766876,
0.37313175201416016,
-0.6327049136161804,
0.7422640323638916,
0.231973797082901,
0.13754980266094208,
-0.27... |
def _ attributes _ t _ conversion _ flavor ( self, key, val ) : # fixme : there are possibly nicer and more reversible ways to # convert the flavors... # easiest conversion of them all... ; - ) if val = = none : return none # make sure interface is ready to use. d = self. _ attributes _ t _ init ( key ) # check if we n... | [
-0.7182721495628357,
-0.3912142515182495,
0.6966619491577148,
-0.08024271577596664,
-0.5552304983139038,
-1.532633662223816,
-0.5167499780654907,
0.1172889992594719,
0.005266866646707058,
0.605837345123291,
0.21591401100158691,
0.8275663256645203,
0.019032616168260574,
0.8460134863853455,
... |
async def async _ step _ user ( self, user _ input = none ) : errors = { } if user _ input is not none : if ( user _ input. get ( conf _ show _ configurable, false ) is true and user _ input. get ( conf _ show _ configurable _ date, none ) is none ) : errors [ conf _ show _ configurable _ date ] = " missing _ configura... | [
-0.2507101595401764,
0.2677975296974182,
0.6603348255157471,
0.4436594545841217,
-0.5764098167419434,
-0.41996753215789795,
1.1276897192001343,
0.04017918184399605,
-0.03400915116071701,
0.0863426923751831,
-0.0399019755423069,
0.44890692830085754,
0.4094691872596741,
0.5571563839912415,
... |
def db _ sync ( engine, version = none ) : if version is not none and int ( version ) < db _ version ( engine ) : raise exception. error ( _ ( " cannot migrate to lower schema version. " ) ) return migration. db _ sync ( engine, version = version ) | [
-0.5165725350379944,
1.0440826416015625,
0.5155022740364075,
1.0216410160064697,
-0.3031042218208313,
-0.2891441583633423,
-0.4970436692237854,
-0.6730558276176453,
-0.22364400327205658,
0.8592576384544373,
-0.9665567874908447,
-0.04494045302271843,
-0.14171895384788513,
-0.096493683755397... |
def _ _ call _ _ ( self, func _ self, * args, * * kwargs ) : changed _ related _ field = kwargs. pop ('_ change _ related ', none ) do _ trigger = self. check _ trigger _ function ( func _ self, changed _ related _ field = changed _ related _ field ) if not do _ trigger : return return self. func ( func _ self, * args,... | [
0.10688483715057373,
-0.06423859298229218,
0.5520455837249756,
-0.2903226315975189,
0.2927332818508148,
-0.5959469079971313,
0.5108563899993896,
0.22678051888942719,
-0.02235003374516964,
-0.4803617596626282,
-0.0908145010471344,
0.5195327401161194,
0.3619290590286255,
-0.24133767187595367... |
def conv2d ( x, w, step ) : return tf. nn. conv2d ( x, w, strides = [ 1, step, step, 1 ], padding ='same') | [
0.48511743545532227,
-1.024078130722046,
0.12800219655036926,
0.3318345844745636,
-1.540174126625061,
0.2112026959657669,
-0.6943841576576233,
-0.7186982035636902,
-1.1042574644088745,
-0.5201925039291382,
-0.49318552017211914,
0.16100244224071503,
0.6539418697357178,
0.489896684885025,
... |
def set _ input ( self, input ) : self. real = input ['a']. to ( self. device ) self. real _ b = input ['b'] self. image _ paths = input ['a _ paths'] | [
-0.8366971015930176,
-0.09999881684780121,
0.08202818781137466,
0.442525178194046,
0.16320766508579254,
0.31639814376831055,
1.0138806104660034,
0.3940006494522095,
0.28645727038383484,
-0.18970075249671936,
-0.8833260536193848,
-0.09146352112293243,
0.3688262104988098,
0.6621392965316772,... |
def test _ choices ( self ) : self. assertequal ( ebay _ shipping _ choices [ 5 ], ( 5,'pick up only!') ) | [
-0.8117098212242126,
0.3193313479423523,
0.14077995717525482,
-0.4103054702281952,
1.4850949048995972,
0.8478600382804871,
0.12939150631427765,
-0.07413338124752045,
0.49926626682281494,
0.8426313400268555,
-0.5626878142356873,
-0.3327253758907318,
0.47434017062187195,
-0.3058977425098419,... |
def subclass _ to _ rules ( view : schemaview, child : classdefinitionname, parent : classdefinitionname, type _ designator _ slot : slotdefinitionname = none ) - > list [ classrule ] : child _ slots = view. class _ induced _ slots ( child ) rule = classrule ( ) if type _ designator _ slot is none : type _ designators ... | [
0.2023802548646927,
0.3701656460762024,
0.844615638256073,
-0.32864078879356384,
-0.1052040085196495,
0.4458310604095459,
0.5243890285491943,
0.07222290337085724,
-0.04381486028432846,
0.44961434602737427,
-0.3287898898124695,
0.6528429388999939,
0.7558033466339111,
0.6399505734443665,
-... |
def _ backproject _ grad ( op, grad, tmp, _ ) : data = op. inputs [ 0 ] depth = op. inputs [ 2 ] meta _ data = op. inputs [ 3 ] grid _ size = op. get _ attr ('grid _ size') kernel _ size = op. get _ attr ('kernel _ size') threshold = op. get _ attr ('threshold') # compute gradient data _ grad = backproject _ grad ( dat... | [
-0.34256377816200256,
0.41166454553604126,
0.6417263746261597,
-0.23935729265213013,
0.3797663450241089,
-0.7385850548744202,
0.45180097222328186,
0.4996383786201477,
-0.8638859987258911,
1.0058226585388184,
-0.1565871387720108,
0.14922766387462616,
-0.5772911906242371,
-0.6618897318840027... |
def process ( self, cube : cube ) - > cube : # if cube has no threshold - type coordinate, raise an error try : self. thresh _ coord = find _ threshold _ coordinate ( cube ) except coordinatenotfounderror : raise valueerror ( " input is not a probability cube " " ( has no threshold - type coordinate ) " ) self. cube = ... | [
-0.3410302996635437,
-0.5893579721450806,
0.7126483917236328,
0.10950804501771927,
-0.6566647291183472,
0.7172529101371765,
0.4818114638328552,
-0.08430903404951096,
-0.48402416706085205,
0.07019404321908951,
0.24524188041687012,
0.37340641021728516,
-0.669845461845398,
-0.2608698010444641... |
def volume _ get ( context, volume _ id ) : return impl. volume _ get ( context, volume _ id ) | [
0.5546866655349731,
-0.3726128041744232,
0.09499367326498032,
-0.35675710439682007,
1.1265348196029663,
-1.5687127113342285,
-0.7896397113800049,
-0.7669878602027893,
0.009280874393880367,
-0.3726951777935028,
1.0530403852462769,
1.5578982830047607,
0.0465179942548275,
-0.5782808661460876,... |
def update _ context _ status ( self ) : message ='' if self. message = = message _ on _ break : message = message _ on _ break else : line _ len = 0 words = self. message. split ( " " ) for word in words : if line _ len + len ( word ) > message _ split _ length : message + = " \ n " line _ len = 0 message + = word + "... | [
0.11591365933418274,
-0.6152524352073669,
0.8098448514938354,
-0.24888385832309723,
-0.42830216884613037,
0.5300301909446716,
-0.018608499318361282,
0.41395407915115356,
-0.6960559487342834,
0.3361208140850067,
0.2755660116672516,
0.6970742344856262,
-0.9921399354934692,
0.3573343157768249... |
def compute _ bias _ metrics _ for _ model ( dataset, subgroups, model, label _ col, include _ asegs = false ) : records = [ ] for subgroup in subgroups : record = {'subgroup': subgroup,'subgroup _ size': len ( dataset [ dataset [ subgroup ] ] ) } record [ subgroup _ auc ] = compute _ subgroup _ auc ( dataset, subgroup... | [
0.4654771685600281,
0.561408281326294,
0.5324786901473999,
0.1729544997215271,
-0.03406008332967758,
-0.06764418631792068,
0.4582598805427551,
-0.09233830869197845,
-0.9745426177978516,
0.14533431828022003,
0.5597495436668396,
1.0240556001663208,
0.4184021055698395,
-0.5829287767410278,
... |
def _ _ init _ _ ( self, img _ size = ( 1, 72, 144 ), latent _ dim = 10 ) : super ( decoderclimatevae, self ). _ _ init _ _ ( ) if img _ size [ 1 ]! = 72 or img _ size [ 2 ]! = 144 : raise valueerror ('climate decoder architecture only supported for ( none, 72, 144 ) image size.') self. img _ size = img _ size n _ chan... | [
0.336162805557251,
0.3180811405181885,
0.965419352054596,
0.27375301718711853,
-0.18723119795322418,
-0.4155363142490387,
0.2008044421672821,
-0.17575769126415253,
-0.8424167633056641,
0.38873371481895447,
-0.16592708230018616,
-0.47613275051116943,
0.29392892122268677,
0.6930570602416992,... |
def decode ( args ) : set _ deterministic _ pytorch ( args ) # read training config idim, odim, train _ args = get _ model _ conf ( args. model, args. model _ conf ) # show arguments for key in sorted ( vars ( args ). keys ( ) ) : logging. info ('args :'+ key +':'+ str ( vars ( args ) [ key ] ) ) # define model transla... | [
0.035806410014629364,
-0.4838649332523346,
0.6586995720863342,
-0.3190178871154785,
-0.1262028068304062,
-0.2229929268360138,
-0.020280849188566208,
0.34152302145957947,
-0.3118172585964203,
0.9137430787086487,
-0.09422376751899719,
0.29428112506866455,
0.7276805639266968,
0.07633753120899... |
def overlay ( self, gdf, how ='intersection ', as _ index = false, as _ tile = false, * * kwargs ) : gdf = super ( ). overlay ( gdf, how, as _ index = false, * * kwargs ) return self. _ _ handle _ tile _ index _ _ ( gdf, as _ tile, as _ index ) | [
-0.8083969950675964,
0.5532727241516113,
0.5353969931602478,
-0.009711215272545815,
0.009370394051074982,
-0.31223422288894653,
0.7580051422119141,
-0.27229514718055725,
-0.2152329832315445,
0.023827917873859406,
0.5481542944908142,
-0.344839870929718,
-0.2917026877403259,
-0.2598978877067... |
def get _ activation ( self ) : return self. _ activation _ function | [
-0.4898473620414734,
-0.3821401596069336,
0.26147302985191345,
0.5683016180992126,
0.3614603579044342,
-0.7701417207717896,
1.2135871648788452,
0.5139631628990173,
-0.19805659353733063,
-0.6308774352073669,
-0.43999961018562317,
1.0714889764785767,
0.0835607498884201,
-1.932627558708191,
... |
def tile _ tensor ( net, timesteps ) : n, c, h, w = net. shape net _ tiled = net. repeat ( timesteps, 1, 1, 1, 1 ). view ( timesteps, n, c, h, w ) net _ tiled = torch. transpose ( net _ tiled, 1, 0 ) return net _ tiled | [
-0.018423445522785187,
0.6011528968811035,
0.23093834519386292,
-0.28907158970832825,
0.42206650972366333,
-0.06773940473794937,
0.4227079451084137,
-0.16952234506607056,
-0.11978986114263535,
0.36102160811424255,
-0.7999697923660278,
-1.5365209579467773,
0.12276509404182434,
-0.1432181596... |
def read _ dataset ( user _ path ) : path = user _ path [ : - 8 ] # erase the file name and keep the path if os. path. exists ( path ) : # the user has provided a file path with a set of texts try : list _ texts = re. split ( ". i \ d * \ n. w \ n ", open ( user _ path ). read ( ) ) [ 1 : ] # split text file with the d... | [
-0.2680046856403351,
0.022022856399416924,
0.5971386432647705,
0.4050675630569458,
-1.1065716743469238,
0.19525405764579773,
0.2233191877603531,
0.41875770688056946,
-0.011049242690205574,
0.39547228813171387,
0.8675742745399475,
-0.22793690860271454,
-0.33851301670074463,
-0.5599822998046... |
def new _ input ( self, location : str ) - > inputfile : | [
-0.09015487134456635,
-0.9561553597450256,
0.17759664356708527,
-0.32774993777275085,
-0.3270634412765503,
0.9706170558929443,
0.513706624507904,
-0.2390548586845398,
-0.46530643105506897,
-0.8432170152664185,
-0.7717313766479492,
0.27754995226860046,
0.16242152452468872,
-0.89243888854980... |
def aggregate _ host _ get _ all ( context, aggregate _ id ) : return impl. aggregate _ host _ get _ all ( context, aggregate _ id ) | [
-0.4165932834148407,
0.7693541646003723,
0.6528591513633728,
0.8697100281715393,
0.9901846647262573,
-0.4193630516529083,
-0.6735265254974365,
-0.30694207549095154,
-0.44059625267982483,
0.2237917184829712,
0.5607839822769165,
0.4784705638885498,
0.02727198787033558,
0.4596390724182129,
... |
def measure _ pix _ props ( dataarr, indices = none, dopositions = false, clip = 0. 0, niter = 10 ) : # if indices are provided mask off other pixels as nans if not indices is none : mask = np. ones _ like ( dataarr ) mask [ indices ] = 0 nanarr = np. where ( np. equal ( mask, 1. 0 ), np. nan, dataarr ) else : nanarr =... | [
-0.1418486088514328,
-0.4359135031700134,
0.8382308483123779,
0.04866143688559532,
-0.6416212320327759,
-0.1988496035337448,
-0.022391613572835922,
-0.060780562460422516,
0.9996688365936279,
0.5974435806274414,
0.3796014189720154,
-0.22202348709106445,
0.5297838449478149,
1.114626407623291... |
def cosmtaux ( z, e = 1. 0, dist = dust. dustdist ( ), scatm = ss. scatmodel ( ), cosm = cosmology ( ), nz = 100 ) : zvals = zvalues ( zs = z, nz = nz ) md = cosmdens ( cosm = cosm ). md spec = dust. dustspectrum ( rad = dist, md = md ) if np. size ( e ) > 1 : result = np. array ( [ ] ) for ener in e : evals = ener * (... | [
0.2618848979473114,
-0.2960285544395447,
0.593467652797699,
-0.020885393023490906,
-0.39306578040122986,
-0.37249162793159485,
0.4715963304042816,
0.809071958065033,
-0.10278095304965973,
-0.21928495168685913,
-0.5075632929801941,
0.24890954792499542,
-0.07092204689979553,
0.77298271656036... |
def test _ parse _ input ( ) : assert parser. parse _ input ( " ou est paris? " ) [ 0 ] = = " paris " assert parser. parse _ input ( " salut grandpy, dis moi ou est lille? " ) [ 0 ] = = " lille " assert parser. parse _ input ( " bonjour, tu peux me donner l'adresse de openclassrooms? " ) [ 0 ] = = " openclassrooms " | [
-0.31334739923477173,
-0.32918021082878113,
0.5086287260055542,
-0.0753810927271843,
0.12987272441387177,
0.8173739314079285,
0.14185461401939392,
0.34429076313972473,
0.47054770588874817,
-0.8167815804481506,
-0.7957039475440979,
-0.052573248744010925,
-0.5619838833808899,
-0.287316143512... |
def registration _ type ( self, registration _ type ) : self. _ registration _ type = registration _ type | [
-0.6733012795448303,
1.1712275743484497,
-0.03421275317668915,
1.3490291833877563,
0.7193937301635742,
0.5455265641212463,
0.8426307439804077,
0.621945321559906,
-0.1482694298028946,
0.508793830871582,
-0.8941617608070374,
-0.7635340094566345,
-0.00605908315628767,
1.2800847291946411,
0.... |
def stop _ sleep ( self, start _ sleep ) : total _ sleep = float ( self. pluginprefs. get ('configmenuuploadinterval ', 300 ) ) if t. time ( ) - start _ sleep > total _ sleep : return true return false | [
-0.853864848613739,
-0.14236949384212494,
0.5307475924491882,
0.4382548928260803,
-0.7103622555732727,
0.39627814292907715,
-0.18992619216442108,
-0.548089325428009,
-0.6585771441459656,
0.29236000776290894,
-0.7152607440948486,
-0.34898483753204346,
-1.0847886800765991,
-0.511256933212280... |
def return _ single _ loan ( finance _ db, uid, did ) : finance _ cursor = finance _ db. cursor ( ) sql ='select * from debts where did = % s and uid = % s'val = ( did, uid ) finance _ cursor. execute ( sql, val ) loan _ details = finance _ cursor. fetchone ( ) if loan _ details is none : return false loan = lu. constr... | [
0.38128331303596497,
0.1520078480243683,
0.6167238354682922,
-0.6798830628395081,
-0.05429266393184662,
0.9186879992485046,
-0.5733648538589478,
0.19975052773952484,
-0.11997527629137039,
-0.9010941386222839,
0.961704432964325,
-0.19167011976242065,
-0.8527117967605591,
-0.0008482933044433... |
def mediaitembytype ( self, media _ type : str ) - > object : try : return models. media. objects. filter ( media _ type = media _ type ) except ( databaseerror, dataerror, operationalerror ) as ex : raise except exception as ex : raise | [
-0.3036612272262573,
-0.8226613402366638,
0.2610534727573395,
0.8106798529624939,
-0.09959692507982254,
-0.48349717259407043,
-0.40976518392562866,
-1.0738469362258911,
0.04031464084982872,
0.514781653881073,
0.3446081578731537,
0.006912044249475002,
-0.8453434705734253,
0.4954643845558166... |
def get _ continent _ floor _ region _ map _ tasks ( self, continent _ id, floor _ id, region _ id, map _ id, * ids ) : return self. _ request ( " continents / { } / floors / { } / regions / { } / maps / { } / tasks ". format ( continent _ id, floor _ id, region _ id, map _ id ), ids = ', '. join ( str ( id ) for id in... | [
-0.44817012548446655,
-0.8083187341690063,
0.6536738276481628,
0.41079604625701904,
0.5991572141647339,
-0.224744975566864,
-0.15059493482112885,
-0.3127157688140869,
-0.6573768258094788,
0.21883992850780487,
-0.1463579684495926,
0.15367896854877472,
-0.7490997314453125,
0.6315419673919678... |
def security _ policy ( self ) - > str : return pulumi. get ( self, " security _ policy " ) | [
1.1568468809127808,
-0.4664422571659088,
0.1631937325000763,
0.6229404807090759,
1.0050513744354248,
1.7756952047348022,
0.13232240080833435,
-0.39371851086616516,
1.1948363780975342,
-0.5452527403831482,
-0.0006308036972768605,
0.04149574786424637,
0.11349590867757797,
-1.540097951889038,... |
def reconfig _ dfe _ set _ tap _ 3 ( fpgaid, data, verbose = 1 ) : if ( verbose & 1 ) = = 1 : print " " " specifies the coefficient for the third post tap. the valid range is 0 - 7. " " " # read out = reconfig _ dfe _ get _ indirect _ register ( fpgaid, 3, verbose ) # modify data data = ( out & ~ 7 ) | ( data < < 0 ) r... | [
-0.31374719738960266,
0.41907140612602234,
0.7036426663398743,
-0.388505756855011,
-0.26202893257141113,
0.2980855703353882,
-0.05227329209446907,
0.21981418132781982,
0.15691879391670227,
0.24310678243637085,
-0.0009213982266373932,
0.36252152919769287,
0.161280557513237,
-0.2854049205780... |
def from _ params ( cls, save = false, force _ download = false, url = none, object _ type = none, * * kwargs ) : lookup _ kwargs = dict ( * * kwargs ) if'post _ id'in lookup _ kwargs and object _ type! ='post': lookup _ kwargs. pop ('post _ id') if lookup _ kwargs and not force _ download : try : # see if we can get t... | [
0.03797241672873497,
-0.04934772104024887,
0.8264819979667664,
0.5831618309020996,
0.4356977939605713,
0.28317990899086,
-0.5359472632408142,
-0.2064277082681656,
0.7861310243606567,
0.3742234706878662,
0.39964011311531067,
-0.12202747911214828,
-0.0011401564115658402,
0.6752743124961853,
... |
def get _ formatted _ repeat _ desc ( self ) : repeat _ paramlist = " " if self. wf _ param _ values! = " [ ] " : tool _ inp = { } for inp in self. tool _ inp _ desc [ " inputs " ] : tool _ inp. setdefault ( inp [ " name " ], inp ) tmp _ wf _ param _ values = self. wf _ param _ values cur _ level = self. level for para... | [
-0.11424294859170914,
-0.361843466758728,
0.7903574705123901,
-0.66094970703125,
0.07476114481687546,
0.06359647214412689,
-0.02564859576523304,
-0.43317341804504395,
-0.9174297451972961,
0.18986383080482483,
0.3900441825389862,
0.7044384479522705,
0.22805505990982056,
0.8469286561012268,
... |
def _ _ init _ _ ( self, man ) : self. man = man # sensors for robot. self. sensor = sensors ( man ) # create the main box. self. _ _ create _ main _ box ( ) # create the sphere. self. _ _ create _ sphere ( ) | [
-0.5461260080337524,
0.1832968294620514,
0.44087734818458557,
0.1287398785352707,
-0.2012268453836441,
0.07343345880508423,
0.5450279116630554,
-0.6303298473358154,
0.6391457319259644,
-0.9673245549201965,
-0.8820862174034119,
-0.5039481520652771,
0.49463024735450745,
1.3756511211395264,
... |
def score ( self, x _ test ) : return self. _ calculate _ j ( x _ test = x _ test, sigma = self. _ sigma ) | [
0.3289012014865875,
0.31115278601646423,
0.1612238883972168,
0.17092779278755188,
-0.5106456279754639,
-0.551091194152832,
0.49807971715927124,
-0.5921984314918518,
-0.06756218522787094,
0.37147706747055054,
-0.24868786334991455,
0.006342882290482521,
-0.3825516104698181,
-0.43897008895874... |
def skip _ messages _ for _ subscription ( self, stream, subscription, num _ of _ messages, local = false ) : if self. persistent : url _ endpoint ='/ streams / persistent / stream / { } / subscription / { } / skip / { }? local = { }'\. format ( stream, subscription, num _ of _ messages, local ) # else : # url _ endpoi... | [
-0.16480162739753723,
0.07625103741884232,
0.8633134961128235,
0.3265599012374878,
0.10739650577306747,
-0.29054540395736694,
0.2759292721748352,
-1.036500334739685,
-0.27973347902297974,
-0.022384535521268845,
0.3121567666530609,
0.5957246422767639,
-1.0057768821716309,
-0.250505059957504... |
def report ( self, data ) : return true | [
-0.42948096990585327,
0.6960010528564453,
0.268648624420166,
0.0650249794125557,
0.777443528175354,
0.49318504333496094,
0.21711453795433044,
0.699684202671051,
0.3968431055545807,
-1.0971769094467163,
-0.7188130021095276,
-0.8041111826896667,
-1.7203781604766846,
0.2957064211368561,
-1.... |
def create _ mock _ resource ( data ) : resource _ attributes = build _ attributes _ defs ( data ) resource _ class = attr. make _ class ( name = " mockresource ", attrs = resource _ attributes, slots = true, bases = ( resource, ) ) resource = resource _ class ( name = " name ", location = " / foo / bar ", path = " som... | [
-0.3500956594944,
-0.4449974596500397,
0.2906099557876587,
-0.5278856754302979,
-0.3617112636566162,
0.08061996102333069,
0.26036882400512695,
0.6248726844787598,
0.2797725796699524,
0.07264822721481323,
0.05568566918373108,
-0.5004475712776184,
-0.4328894019126892,
-0.07775826007127762,
... |
def dfs _ hamiltonian ( sub _ start, sub _ dist _ matrix, end _ dists, l _ 0 = 0. 0, l _ best = np. inf ) : if np. all ( sub _ dist _ matrix [ sub _ start, : ] = = np. inf ) : l _ 1 = l _ 0 + end _ dists [ sub _ start ] return [ sub _ start, 0 ], l _ 1 else : dists = np. zeros ( sub _ dist _ matrix. shape [ 0 ] ) + np.... | [
0.009065065532922745,
-0.15608595311641693,
0.8815498352050781,
0.5533819198608398,
0.23889675736427307,
0.26222658157348633,
0.47315549850463867,
0.7814369201660156,
-0.6447902321815491,
0.41187968850135803,
-0.17768876254558563,
0.7923116683959961,
0.08379403501749039,
0.0061342311091721... |
def sweep ( self ) : for xy in self. adjacent : neighbor = app. field. get _ tile ( * xy ) if not neighbor. clicked : neighbor. click ( ) | [
-0.3543791174888611,
0.46568429470062256,
0.2914477586746216,
0.13664951920509338,
0.20352928340435028,
1.20842444896698,
1.2591462135314941,
-0.05697128176689148,
-0.3953314423561096,
-0.3260854184627533,
-0.10658477246761322,
-0.12474405020475388,
0.010518183931708336,
0.8131693601608276... |
def sorting _ strategy ( self, e ) : e [ e. real > 100. 0 ] = 0 e [ e. real < 1e - 1 ] = - e [ e. real < 1e - 1 ] index = np. argsort ( np. real ( e ) ) return ( e, index ) | [
-1.026658058166504,
-0.24686875939369202,
0.49114444851875305,
-0.3892765939235687,
-0.11162638664245605,
0.6746456623077393,
0.8030552268028259,
0.10489116609096527,
0.35240602493286133,
0.6736559271812439,
0.4849601984024048,
0.2280564159154892,
1.2228221893310547,
0.17581860721111298,
... |
def test _ init ( config ) : assert config. file _ name = = test _ file _ name | [
0.5539408326148987,
-0.8638869524002075,
0.3544778823852539,
0.4683639705181122,
0.9049538969993591,
0.7956724762916565,
0.9364300966262817,
0.774131178855896,
-0.23070386052131653,
0.15543130040168762,
-0.625498354434967,
0.060315486043691635,
0.29320037364959717,
0.5350009202957153,
0.... |
def get _ required _ multi _ asset _ keys ( self, asset _ key : assetkey ) - > abstractset [ assetkey ] : if self. _ required _ multi _ asset _ sets _ by _ key is none : raise dagsterinvariantviolationerror ( " required neighbor information not set when creating this assetgraph " ) if asset _ key in self. _ required _ ... | [
-0.8784394860267639,
0.18732649087905884,
0.591145396232605,
-0.3512670397758484,
-0.4868565797805786,
0.3290480971336365,
0.07859320193529129,
-1.1378690004348755,
-0.3882964253425598,
0.5452147126197815,
-0.06764332205057144,
0.4130302369594574,
0.2070448100566864,
0.6868512034416199,
... |
def individual ( interferometer, plot _ visibilities = false, plot _ noise _ map = false, plot _ u _ wavelengths = false, plot _ v _ wavelengths = false, plot _ uv _ wavelengths = false, plot _ amplitudes _ vs _ uv _ distances = false, plot _ phases _ vs _ uv _ distances = false, plot _ primary _ beam = false, include ... | [
0.10847242176532745,
0.3612811863422394,
0.7318974137306213,
0.4488738179206848,
-0.8038213849067688,
0.9070319533348083,
0.31567665934562683,
1.0695418119430542,
0.9909188747406006,
-0.6809636950492859,
-0.40352532267570496,
0.40888020396232605,
-0.448832631111145,
0.9517380595207214,
-... |
def year _ str ( self ) : year = str ( self. year ) if self. dual _ year is not none : year + = " / " + str ( self. dual _ year ) [ - 2 : ] if self. bc : year + = " b. c. " return year | [
0.982534646987915,
-1.1211397647857666,
0.6147096157073975,
-0.4050739109516144,
-0.49523279070854187,
1.7083015441894531,
0.5507725477218628,
-0.1625777930021286,
0.7999117970466614,
0.3650559186935425,
1.1283384561538696,
0.2822053134441376,
-0.16189798712730408,
-0.33347824215888977,
... |
def _ _ init _ _ ( self, env, n _ neurons = 64 ) : super ( policynetwork, self ). _ _ init _ _ ( ) self. observation _ space = env. observation _ space self. num _ actions = env. action _ space. shape [ 0 ] self. action _ scaling = torch. tensor ( env. action _ space. high, dtype = torch. float32 ) self. h1 = nn. linea... | [
0.1295394003391266,
0.55643230676651,
0.6649962067604065,
0.9669935703277588,
0.8259958028793335,
0.5203394889831543,
-0.2758754789829254,
0.02610550820827484,
0.16715115308761597,
0.04952658712863922,
-0.6254168748855591,
-0.05789545178413391,
1.0053788423538208,
0.6291754841804504,
-0.... |
def inspectlessobviouscellclues ( self, cell ) : if not cell. isfullyset ( memoize = true ) : if len ( self. nextmovelist ) = = 0 : self. inspectsymmetrical3cell ( cell ) if len ( self. nextmovelist ) = = 0 : self. inspectunsetsidelinks ( cell ) if len ( self. nextmovelist ) = = 0 : self. inspecttheoreticals ( cell ) i... | [
-0.13914264738559723,
0.010563780553638935,
0.7477514743804932,
-0.3217373788356781,
-0.5004695653915405,
-0.724551796913147,
1.1013199090957642,
-0.8538661599159241,
0.10542836785316467,
-0.31532496213912964,
0.14353787899017334,
0.7370145320892334,
-0.19359779357910156,
1.6911700963974,
... |
def create _ discriminator _ growth _ transition _ downsample _ layers ( params ) : with tf. variable _ scope ( name _ or _ scope = " discriminator ", reuse = tf. auto _ reuse ) : # down sample from 2s x 2s to s x s image. downsample _ layers = [ tf. layers. averagepooling2d ( pool _ size = ( 2, 2 ), strides = ( 2, 2 )... | [
-0.45743614435195923,
-0.3073916733264923,
0.48224398493766785,
0.9715198278427124,
0.153126060962677,
-0.1438506841659546,
1.283610224723816,
-0.7583128809928894,
0.027032935991883278,
-0.3821503818035126,
-0.3143536448478699,
0.4599877595901489,
0.0819278135895729,
0.4445144534111023,
... |
def children ( self ) - > iterable [ entity ] : yield from self. content | [
0.4380298852920532,
-0.7923906445503235,
0.34700655937194824,
-0.3152601420879364,
-0.021589038893580437,
0.5367066264152527,
-0.30579033493995667,
-0.5308423042297363,
-0.9787724018096924,
-1.0004597902297974,
0.21710047125816345,
0.16540741920471191,
-0.0018463825108483434,
0.42650502920... |
def augmentation _ rotate ( image, orig _ key _ points ) : # if any of original key points is around image center, abort rotating image _ center = np. array ( [ image. shape [ 1 ] / 2, image. shape [ 0 ] / 2 ] ) for orig _ key _ point in orig _ key _ points : if np. sqrt ( np. sum ( ( orig _ key _ point [ : 2 ] - image... | [
-0.30870679020881653,
-0.6327211260795593,
0.926206111907959,
0.0061790128238499165,
-0.5954412817955017,
-0.0655006542801857,
0.34687021374702454,
0.3611542284488678,
0.055071599781513214,
1.0967395305633545,
-0.03772182762622833,
0.33864110708236694,
0.21453158557415009,
-0.0970812812447... |
def is _ full ( self ) - > bool : if len ( self ) = = 0 : return true if not self. is _ monotonic _ increasing : raise valueerror ( " index is not monotonic " ) values = self. asi8 return bool ( ( ( values [ 1 : ] - values [ : - 1 ] ) < 2 ). all ( ) ) | [
-0.2372918277978897,
0.11856212466955185,
0.7201936841011047,
0.5160869359970093,
0.6921392679214478,
0.27338361740112305,
-0.48711469769477844,
-0.8048267364501953,
0.4181020259857178,
0.33482545614242554,
-0.68656986951828,
0.18086721003055573,
-0.6869297027587891,
0.014570212922990322,
... |
def check _ same ( ref : any, tar : any, rtol : float, atol : float ) - > tuple [ bool, union [ str, none ] ] : # check for matching types. if not isinstance ( tar, type ( ref ) ) : error = ( " expected ref and tar to have the same type but got " f "'{ type ( ref ) }'and'{ type ( tar ) }'" ) logging. error ( error ) re... | [
-0.46308204531669617,
0.2488066852092743,
0.8484609723091125,
-0.3164133131504059,
0.309353768825531,
-0.019694572314620018,
0.5347525477409363,
-1.3796536922454834,
-0.19033323228359222,
0.4143596589565277,
0.11523284018039703,
0.24413898587226868,
-0.12485289573669434,
0.7776928544044495... |
def create _ int _ list ( list _ size ) : int _ list = singly _ linked _ list. sll ( ) # add ints to list for i in range ( 1, list _ size + 1 ) : int _ list. push ( i ) return int _ list | [
-0.3218393623828888,
0.3319450616836548,
0.3774067461490631,
0.020429065451025963,
-0.06826987862586975,
0.48107725381851196,
-0.32728898525238037,
0.610313892364502,
1.4934420585632324,
-0.2147403210401535,
-1.173022985458374,
0.04862140491604805,
-1.0912890434265137,
0.5924878716468811,
... |
def fitgh _ lmfit ( xax, data, deggh = 2, err = none, params = none, fixed = none, limitedmin = none, limitedmax = none, minpars = none, maxpars = none, iprint = 50, lmfit _ method ='leastsq ', verbose = true, veryverbose = false, * * fcnargs ) : import copy # # default values lmfit _ methods = ['leastsq ','lbfgsb ','a... | [
0.9599926471710205,
0.23142535984516144,
0.5870306491851807,
0.06641506403684616,
-0.176841139793396,
0.11723596602678299,
-0.4699755012989044,
0.24254263937473297,
-0.0615171380341053,
-0.47833508253097534,
0.15991836786270142,
1.0113108158111572,
-0.7035267353057861,
0.9735466241836548,
... |
def validate _ password ( self, password : passwordfield ) : if password. data = = " " : flash ( " the password is empty ", " danger " ) raise validationerror ( " " ) if len ( password. data ) < 4 or 20 < len ( password. data ) : flash ( " the password must be between 4 and 20 characters. ", " danger " ) raise validati... | [
0.6239883303642273,
0.4181564152240753,
0.4884214699268341,
-0.41966530680656433,
0.33635586500167847,
0.6490757465362549,
0.29518938064575195,
0.160034641623497,
-0.33453989028930664,
-0.16134129464626312,
-0.807762086391449,
0.10780680179595947,
-0.5093501806259155,
0.7750048041343689,
... |
def createtables ( self ) : self. cur. execute ( " create table if not exists users ( " " name string, " " password string, " " realname string, " " question string, " " answer string, " " highscore int ) " ) self. cur. execute ( " create table if not exists highscores ( " " id int, " " name string, " " score int ) " ) | [
0.4279910922050476,
0.17611338198184967,
0.61678546667099,
0.9198546409606934,
0.7810347080230713,
0.4396461248397827,
0.322243332862854,
-0.8460109829902649,
-0.3999689221382141,
-0.0020668795332312584,
-1.079204797744751,
-0.6875051259994507,
-0.5816433429718018,
0.14475242793560028,
-... |
def get _ script _ args ( self, arguments ) : def read _ file ( path ) : if not os. path. exists ( path ) : self. die ( " cannot open file'% s'" % path ) with open ( path ) as f : return f. read ( ) def parse _ json ( j ) : try : return ujson. loads ( j ) except valueerror as e : self. die ( " failed to parse json : % ... | [
-0.8198528289794922,
-0.5794020295143127,
0.8788576722145081,
-0.8098184466362,
-0.09937258809804916,
-0.6511023640632629,
-0.1405719518661499,
-0.8556686639785767,
-0.6065573692321777,
1.005832552909851,
-0.2629968523979187,
0.29034224152565,
-0.170514777302742,
0.33268308639526367,
0.0... |
def replace ( self, column : str, new _ col : series ) : self. _ df. replace ( column, new _ col. inner ( ) ) | [
-0.09729860723018646,
0.004358734469860792,
0.37997251749038696,
0.2920781672000885,
0.2399274855852127,
-0.35360535979270935,
-0.27677464485168457,
0.5828418135643005,
-1.0612915754318237,
-0.3629545271396637,
-0.6725144386291504,
1.8537390232086182,
-0.16573211550712585,
-0.8659222126007... |
def remove _ tag _ from _ words ( mot ) : if mot. find ('\ \ b')! = - 1 : mot = mot. replace ('\ \ b ','' ) return mot | [
1.1820299625396729,
-0.16476815938949585,
0.41052788496017456,
0.15845437347888947,
-0.26917579770088196,
-0.2034771889448166,
-0.447198748588562,
0.8523052930831909,
-0.8894779682159424,
1.171939492225647,
-0.36743155121803284,
-0.054566387087106705,
-1.5951275825500488,
1.171471357345581... |
def group _ id ( self ) - > optional [ str ] : return pulumi. get ( self, " group _ id " ) | [
1.2071772813796997,
1.2315086126327515,
0.22280345857143402,
0.5356066226959229,
1.224090337753296,
0.9001194834709167,
0.13961605727672577,
-0.1708962768316269,
0.5318514108657837,
-0.13381268084049225,
0.9108841419219971,
1.3047747611999512,
-0.1104772761464119,
-0.17463292181491852,
-... |
def clean _ es ( es, es _ index, org ) : common. clear _ index _ by _ org ( es, org, es _ index ) | [
-0.5036739110946655,
-0.22214403748512268,
0.306907057762146,
0.21548327803611755,
0.3717600405216217,
0.18445327877998352,
0.00910874456167221,
0.2248685210943222,
0.17793501913547516,
1.3977384567260742,
-0.013643586076796055,
1.2599067687988281,
0.4696837067604065,
-1.3625035285949707,
... |
def insert _ str _ record ( self, device _ id, timestamp, measurements, string _ values ) : if type ( string _ values ) = = str : string _ values = [ string _ values ] if type ( measurements ) = = str : measurements = [ measurements ] data _ types = [ tsdatatype. text. value for _ in string _ values ] request = self. g... | [
-0.945896327495575,
0.9804089665412903,
0.4271738529205322,
-0.4522351324558258,
0.6333675384521484,
0.4948315918445587,
-0.253233402967453,
-0.057106830179691315,
-0.5146561861038208,
-0.1639736145734787,
-0.20567560195922852,
0.05472647398710251,
-1.1599823236465454,
0.3650694489479065,
... |
def used ( ) - > int : storage = psutil. disk _ usage ('/') return storage. used | [
-0.44608309864997864,
0.31981801986694336,
0.7576445937156677,
0.4610857665538788,
0.20760855078697205,
-0.9888187646865845,
1.3572214841842651,
-0.5666245818138123,
-0.5084130167961121,
-0.9264023303985596,
-0.027603883296251297,
-0.012746253982186317,
-0.0009116599103435874,
0.7033557891... |
def walkrepeatedruns ( runner _ output _ dir ) : repeated _ run _ count = 0 for node _ name in os. listdir ( runner _ output _ dir ) : repeat _ dir = os. path. join ( runner _ output _ dir, node _ name ) if not os. path. isdir ( repeat _ dir ) : continue try : repeat _ id = int ( node _ name ) except valueerror : conti... | [
-1.1466625928878784,
0.21041731536388397,
0.7078824043273926,
0.19612710177898407,
-0.4469115138053894,
-0.3130049705505371,
1.4927090406417847,
-0.24440965056419373,
0.24118110537528992,
-0.4705745279788971,
-0.13586567342281342,
0.3428215980529785,
0.1106310486793518,
0.5583537817001343,... |
def random _ integer ( h ) : return np. random. randint ( 0, h, size = 1 ) [ 0 ] | [
-0.7242527604103088,
-0.08201628923416138,
0.49713364243507385,
-0.035965681076049805,
-0.06455443799495697,
0.6315040588378906,
0.15554295480251312,
-0.07028467208147049,
0.3194999098777771,
-0.48299556970596313,
0.13394978642463684,
0.37083321809768677,
-1.3872759342193604,
0.52425861358... |
def plot _ benchmark _ dicts ( bmk _ dict _ list ) : factored = [ x for x in bmk _ dict _ list if'factors'in x ] simples = [ x for x in bmk _ dict _ list if'factors'not in x ] if len ( factored ) : plot _ factored _ bmks ( factored ) if len ( simples ) : plot _ simple _ bmks ( simples ) | [
0.49076735973358154,
1.1635841131210327,
0.3653986155986786,
0.14366242289543152,
0.06873206794261932,
0.0693696066737175,
0.32853150367736816,
0.6558403968811035,
0.036421794444322586,
0.06583604216575623,
-0.5253583788871765,
0.3561587631702423,
-0.8476079702377319,
1.772765874862671,
... |
def _ _ init _ _ ( self, peerclass = peer ) : self. logger = logging. getlogger ( self. _ _ class _ _. _ _ name _ _ ) self. peerclass = peerclass self. peer = none | [
-0.6325551271438599,
-0.7972217798233032,
0.6988099217414856,
-0.2253098338842392,
0.1481582075357437,
0.04448097199201584,
-0.6955857872962952,
0.2767181694507599,
0.38234734535217285,
-0.22067920863628387,
-0.22763904929161072,
0.3057883381843567,
-0.7142366170883179,
1.3643724918365479,... |
def isempty ( self ) : # o ( 1 ) return self. root = = none | [
-1.175716757774353,
-0.4362979531288147,
0.5386836528778076,
0.5054214000701904,
0.31186234951019287,
-0.3158973455429077,
0.01297635119408369,
0.16007056832313538,
0.44071346521377563,
0.3027285933494568,
-0.9472630620002747,
0.7889727354049683,
-1.099603533744812,
0.3453727960586548,
-... |
def getmultiple ( self, layers, where = " 1 = 1 ", fields = [ ], srid ='4326 ', layer _ name _ field = none ) : features = [ ] for layer in layers : get _ fields = fields or self. enumerate _ layer _ fields ( layer ) this _ layer = self. get ( layer, where, get _ fields, false, srid ). get ('features') if layer _ name ... | [
-0.8097792863845825,
0.22972352802753448,
0.7488531470298767,
0.24681369960308075,
0.6183270812034607,
-0.771003007888794,
-0.6837635636329651,
-0.05221350118517876,
-0.6582929491996765,
0.11232396215200424,
-1.0812790393829346,
-0.7326271533966064,
0.31918492913246155,
0.6423322558403015,... |
def get _ nodes ( self, request ) : nodes = [ ] archives = [ ] attributes = {'hidden': hide _ gbobject _ menu } for gbobject in gbobject. published. all ( ) : year = gbobject. creation _ date. strftime ('% y') month = gbobject. creation _ date. strftime ('% m') month _ text = gbobject. creation _ date. strftime ('% b')... | [
-0.9776936769485474,
-0.16880419850349426,
0.8169266581535339,
-0.020110778510570526,
0.5476674437522888,
0.8393511772155762,
0.11006736755371094,
0.0794571042060852,
0.17544756829738617,
0.36401981115341187,
0.21318574249744415,
0.2725071310997009,
0.5661661624908447,
-0.08644456416368484... |
def entity _ display _ name ( entity : element, langs = none ) - > str : for displayname in filter _ lang ( entity. iter ( " { % s } displayname " % ns ['mdui'] ), langs = langs ) : return displayname. text. strip ( ) for servicename in filter _ lang ( entity. iter ( " { % s } servicename " % ns ['md'] ), langs = langs... | [
0.16048888862133026,
-0.06205901503562927,
0.668391227722168,
-0.4762858748435974,
-1.70918607711792,
0.2424309253692627,
-0.3077249526977539,
-0.5934739708900452,
0.29018452763557434,
0.7687556743621826,
1.0881226062774658,
-0.34138962626457214,
0.6337971687316895,
1.0449438095092773,
0... |
def testreplacefieldtype ( self ) : locale = locale. getfrance ( ) dtpg = datetimepatterngenerator. createinstance ( locale ) sdf = simpledateformat ('eeee d mmmm y hh : mm : ss zzzz ', locale ) sdf. settimezone ( self. tz ) pattern = sdf. topattern ( ) self. assertequal ( pattern, u'eeee d mmmm y hh : mm : ss zzzz') s... | [
-0.15769201517105103,
0.8577235341072083,
0.7856475710868835,
-0.910919725894928,
0.38120338320732117,
0.25675538182258606,
-0.10334106534719467,
0.8037987947463989,
0.46455132961273193,
-0.30716609954833984,
-1.474092960357666,
0.07419010996818542,
-0.7293772101402283,
-0.2718807160854339... |
def process _ rule _ change ( rule, new _ value ) : rule _ changed = false if rule not in list ( rules. keys ( ) ) : print ( " that rule is invalid. no changes will be made. " ) elif not new _ value. isdigit ( ) : print ( " you must enter an integer greater than 0. \ n " ) elif rule = = " doubling _ allowed " : if int ... | [
-0.38986971974372864,
0.14621245861053467,
0.9603289365768433,
-0.43301448225975037,
-0.3021923303604126,
0.3328591287136078,
0.2610325515270233,
0.36516472697257996,
-0.3941444158554077,
0.7766261100769043,
0.18162016570568085,
0.7164931893348694,
-0.3174174427986145,
0.9082555770874023,
... |
def ignore _ errors ( self ) : new _ command = copy. deepcopy ( self ) new _ command. _ ignore _ errors = true return new _ command | [
-0.6653952598571777,
-0.7702851295471191,
0.6233624815940857,
0.0717562660574913,
0.006480416748672724,
1.188408613204956,
0.19683916866779327,
-0.7876242995262146,
0.4286423325538635,
-1.0203038454055786,
-0.29395395517349243,
0.5638799071311951,
-1.1969082355499268,
-0.4264211058616638,
... |
def confirm _ login _ allowed ( self, user ) : if not user. is _ active : raise validationerror ( self. error _ messages ['inactive'], code ='inactive ', ) | [
0.5054807066917419,
0.2049742341041565,
0.38880178332328796,
1.339064121246338,
-0.9215826392173767,
1.2884448766708374,
0.5579017996788025,
-0.6319876313209534,
-0.2049141526222229,
0.43788382411003113,
0.5848035216331482,
0.6871160864830017,
-0.19182415306568146,
-0.13422586023807526,
... |
def test _ rel _ path _ to ( self ) : self. assertequal ( posixpath ( b'/ var / log / apache2 /'). rel _ path _ to ( b'/ var / www / cat. jpg'). path, b '.. /.. / www / cat. jpg') self. assertequal ( posixpath ( b'/ var / log / apache2 /'). rel _ path _ to ( b'/ tmp / access. log'). path, b '.. /.. /.. / tmp / access. ... | [
0.9729935526847839,
-0.585211455821991,
0.8231440186500549,
0.25879135727882385,
-0.25193262100219727,
0.3393334746360779,
0.5402953028678894,
0.0518086813390255,
-0.0009246368426829576,
-0.5587761402130127,
-0.7951876521110535,
-0.559517502784729,
-0.321667343378067,
-0.10279960930347443,... |
def getmodels ( database _ name, source _ name = none ) : conn = sqlite3. connect ( database _ name ) cmd ='select models. id, models. description, models. created, model _ sources. name from models join model _ sources on model _ sources. id = models. source _ id'if source _ name! = none : cmd = cmd +'where model _ so... | [
-0.5708541870117188,
0.3058820366859436,
0.46543216705322266,
0.42872148752212524,
0.5504779815673828,
-0.06988625228404999,
-0.8788682222366333,
0.35881105065345764,
-0.07898252457380295,
0.465834379196167,
-0.9792523384094238,
-0.6799532771110535,
-0.1909746676683426,
0.9376806020736694,... |
def list _ downloads ( request, * args ) : return render _ to _ response ('list _ downloads. html ', args [ 0 ], context _ instance = requestcontext ( request ) ) | [
0.11201482266187668,
-0.16000618040561676,
0.30332455039024353,
-0.1590988039970398,
0.45367491245269775,
-0.03259751945734024,
-0.17413143813610077,
0.01650889962911606,
0.22154325246810913,
-0.3628426790237427,
0.36196643114089966,
-0.09221482276916504,
0.6916937232017517,
0.757532119750... |
def favorite _ item ( product _ id : optional [ int ], token : optional [ str ] = header ( none ) ) : token _ decoded = decode _ token ( token ) if ( token _ decoded = = none ) : return {'msg':'token is required'} controller = wishlistcontroller ( ) return controller. favorite _ item ( product _ id, token _ decoded ['i... | [
-0.10366891324520111,
0.36030343174934387,
0.23237833380699158,
0.9802977442741394,
0.04841936379671097,
-0.11550915241241455,
-1.168508529663086,
0.0523713082075119,
-0.5359033346176147,
0.0021118761505931616,
-0.7974911332130432,
0.47231748700141907,
0.09290234744548798,
-0.6326041817665... |
def buildsourcejar ( jar _ file, sources ) : staging _ dir = tempfile. mkdtemp ( ) for f in sources. keys ( ) : temp _ src = os. path. join ( staging _ dir, f ) pkg _ dir = os. path. dirname ( temp _ src ) if not os. path. exists ( pkg _ dir ) : os. makedirs ( os. path. dirname ( temp _ src ) ) shutil. copyfile ( sourc... | [
-0.563873827457428,
-0.6162547469139099,
0.8706257939338684,
0.1766187995672226,
-0.3091167211532593,
0.3875090777873993,
1.6067107915878296,
0.5743752717971802,
-0.4966379702091217,
0.09668395668268204,
0.049525242298841476,
-1.3551487922668457,
-0.6459484696388245,
0.4756928086280823,
... |
def s3 _ access _ log _ bucket _ policy ( self, *, source _ bucket _ arn : str, target _ bucket _ arn : str, path _ prefix : str ) - > jsons : self. _ validate _ bucket _ path _ prefix ( path _ prefix ) return [ {'effect':'allow ','principal': {'service':'logging. s3. amazonaws. com'},'action': ['s3 : putobject'],'reso... | [
-0.16318565607070923,
-0.5718579888343811,
0.5741259455680847,
-0.9475615620613098,
-0.0804128497838974,
0.6330620646476746,
0.03945906087756157,
0.13882006704807281,
0.39272210001945496,
0.5153201222419739,
-0.2792714238166809,
1.8843600749969482,
0.3565570116043091,
-1.007505178451538,
... |
def db ( request, django _ db _ setup, django _ db _ blocker ) : if " django _ db _ reset _ sequences " in request. fixturenames : request. getfixturevalue ( " django _ db _ reset _ sequences " ) if ( " transactional _ db " in request. fixturenames or " live _ server " in request. fixturenames ) : request. getfixtureva... | [
-0.58855140209198,
1.1803728342056274,
0.4640641510486603,
0.831762969493866,
0.7427200675010681,
-0.20277619361877441,
0.7507800459861755,
-0.07160340994596481,
0.35499414801597595,
0.7213208675384521,
0.11676038801670074,
0.04415728524327278,
0.10958902537822723,
0.5339425802230835,
-0... |
def insert ( self, prefix, node = none ) : if not node : node = self. root parts = prefix. split ( ". " ) length = len ( parts ) if length > 1 : for i in range ( 1, length + 1 ) : name = ". ". join ( parts [ : i ] ) if not self. exists ( name ) and not name = = prefix : self. insert ( name ) if prefix. startswith ( nod... | [
-0.3713485300540924,
1.2190052270889282,
0.9990995526313782,
-0.263957142829895,
-0.4735918641090393,
-0.0406697653234005,
0.08415350317955017,
0.5195221900939941,
0.5487276911735535,
0.4100806415081024,
-0.5394118428230286,
-0.26836031675338745,
-0.8386088609695435,
0.3277069926261902,
... |
def as _ unordered _ list ( filled _ template ) : if not isinstance ( filled _ template, dict ) : raise valueerror ( " a filled template is a dictionary, not { 0 } ". format ( type ( filled _ template ) ) ) result = " " for key in filled _ template : if not isinstance ( key, str ) : raise valueerror ( " a filled templa... | [
-0.5856510400772095,
-1.117161750793457,
0.5943852066993713,
-1.523547887802124,
-0.3646416664123535,
0.005313646513968706,
-0.3396525979042053,
0.1010672077536583,
0.5564904808998108,
0.3241327702999115,
-0.12996865808963776,
-0.7364656925201416,
0.29705217480659485,
0.39322343468666077,
... |
def add _ op _ verilog ( path _ in, op, verilog _ version, path _ out, new _ buff = " researchbuff ", new _ po = " researchpo " ) : if verilog _ version not in [ " iscas85 ", " epfl " ] : raise nameerror ( " verilog version { } not supported ". format ( verilog _ version ) ) lines = read _ verilog _ lines ( path _ in )... | [
0.24228063225746155,
-0.4955625832080841,
0.9878736138343811,
-0.7847291231155396,
-0.14005030691623688,
0.33579951524734497,
0.677131175994873,
0.11068271845579147,
0.11023227125406265,
0.9904071092605591,
-0.33435213565826416,
0.3854995369911194,
0.06876299530267715,
-0.3709518611431122,... |
def train _ step ( self, sample, raise _ oom = false ) : try : self. optimizer. zero _ grad ( ) loss = self. model. module. train _ loss ( sample ) loss. backward ( ) grad _ norm = torch. norm ( torch. stack ( [ torch. norm ( p. grad. detach ( ), 2 ). cpu ( ) for p in self. model. parameters ( ) if p. grad is not none ... | [
-0.39030560851097107,
0.5895078778266907,
0.783174991607666,
0.4357180893421173,
-0.8514189124107361,
-0.395595908164978,
0.2844206690788269,
-0.4430471658706665,
-0.31502383947372437,
0.4199841022491455,
0.33874309062957764,
0.5334147214889526,
-0.6104986071586609,
0.18448714911937714,
... |
def _ build _ objects ( file, struct ) : base _ types = _ base _ types head = file. header arch, endian = head [ 1 : : ] # get cache version = file. header. version version _ cache = blenderobject. cache. get ( version ) if version _ cache is none : version _ cache = { } blenderobject. cache [ version ] = version _ cac... | [
-0.7669628858566284,
-0.5088269710540771,
0.858801007270813,
-0.13210700452327728,
-0.20893211662769318,
-0.5016151666641235,
0.4274723529815674,
-0.4212679862976074,
-0.3733115494251251,
0.1590576022863388,
-1.3710691928863525,
-0.40110230445861816,
0.0753583088517189,
-0.3051985800266266... |
def reconfig _ eyeq _ get _ polarity ( fpgaid, verbose = 1 ) : if ( verbose & 1 ) = = 1 : print " " " specifies the sign of the vertical height. when 0, the vertical height is negative. when 1, the vertical height is positive. " " " out = reconfig _ eyeq _ get _ indirect _ register ( fpgaid, 3, verbose ) out = out & 4 ... | [
-0.8108188509941101,
-0.006356681697070599,
0.7982670664787292,
0.054899267852306366,
-0.16907715797424316,
-0.559678316116333,
0.17320463061332703,
-0.10814669728279114,
-0.045962005853652954,
0.997223973274231,
-0.04385866969823837,
0.41314697265625,
-0.8738714456558228,
0.33443790674209... |
def generate _ public _ meetings ( self, rows ) : header = ('id |'' purpose |'' date |'' time | l'' ocation |'' contact') output = [ header ] with open ('{ } public _ meetings. csv '. format ( self. directory ),'w +') \ as output _ file : for meeting _ id in range ( 1, rows + 1 ) : purpose = self. fake. format ('senten... | [
-0.7711330056190491,
0.08555502444505692,
0.9369661808013916,
0.041394561529159546,
0.24367006123065948,
0.4339078962802887,
-0.5701384544372559,
-0.3703337013721466,
-0.48458993434906006,
0.17863492667675018,
-0.39926180243492126,
0.3810633718967438,
0.07403498142957687,
0.826573431491851... |
def get _ tweet _ peak _ dates ( self ) : # get tweets and group by date tweets = database _ helper. select _ geo _ tweets ( self. movieid ) tweets ['date'] = tweets ['created _ at']. dt. date date _ freq = tweets. groupby ('date'). size ( ). reset _ index ( name ='count') date _ freq. sort _ values ('date') date _ fre... | [
0.3209373354911804,
0.22404028475284576,
0.4305212199687958,
0.3309493064880371,
0.3063705265522003,
0.0526498407125473,
-0.16030186414718628,
0.15357394516468048,
-0.45885202288627625,
0.8678562045097351,
0.006154192145913839,
0.7035430669784546,
0.5607109069824219,
0.72650146484375,
0.... |
def ground _ truth _ generator ( dataset ) : for batch in dataset : # print ( batch ) # [ shape = ( 10, 512, 512, 3 ), shape = ( 10, 1, 5 ) ] # imgs imgs = batch [ 0 ] # true boxes [ batch, ( xmin, ymin, xmax, ymax, class ) ] true _ boxes = batch [ 1 ] # matching _ true _ boxes and detector _ mask batch _ matching _ tr... | [
-0.6455633640289307,
-0.033803969621658325,
0.7778196930885315,
0.1423775851726532,
0.2018182873725891,
0.2692965269088745,
0.43813255429267883,
-0.32279735803604126,
-0.4445419907569885,
0.15861234068870544,
-0.41225481033325195,
-0.05654647573828697,
0.5551247000694275,
0.589719176292419... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.