text
stringlengths
25
2.19k
embedding
listlengths
768
768
def perform _ liquidity _ management ( self ) : params = self. model. parameters use _ leverage = params. bank _ leverage _ on balance = self. get _ ue _ cash ( ) cashinflows = self. get _ cash _ inflows ( ) cashcommitments = self. get _ cash _ commitments ( ) minimumsparebalanceintheperiod = balance if params. print _...
[ -0.015056153759360313, -0.3885314166545868, 0.6403405070304871, 0.20182351768016815, -0.218391552567482, 0.22813738882541656, -0.09249338507652283, -0.30838415026664734, -0.3292445242404938, -0.41135162115097046, 0.877723217010498, -0.5539724230766296, -0.6090236306190491, 0.88734966516494...
def destroy ( self ) : simulation. cars. remove ( self ) simulation. intersection. cars = set ( simulation. cars )
[ -0.311917781829834, -0.08222728222608566, 0.39742183685302734, -0.7627831697463989, 0.41515475511550903, 0.022919911891222, -0.19004909694194794, 0.7926775813102722, -0.8790576457977295, 0.5320861339569092, -0.5218292474746704, -1.0300074815750122, -1.0124260187149048, -0.05970698595046997...
def get _ headers _ end ( response _ raw ) : end _ line = bytearray ( b'\ r \ n \ r \ n') try : headers _ end = response _ raw. index ( end _ line ) + len ( end _ line ) except exception : raise exception ('failed to process headers. aborting.') return headers _ end
[ -0.44685617089271545, -0.4467979669570923, 0.7368620038032532, -0.2786860764026642, 0.18249574303627014, -0.5773718953132629, -0.14426392316818237, -0.6462513208389282, -0.23465003073215485, -0.23091445863246918, -0.1702825278043747, -0.41363346576690674, -0.46194788813591003, -0.381604880...
def plot _ images ( images, ax, ims _ per _ row = 5, padding = 5, digit _ dimensions = ( 28, 28 ), cmap = matplotlib. cm. binary, vmin = none, vmax = none ) : n _ images = images. shape [ 0 ] n _ rows = np. int32 ( np. ceil ( float ( n _ images ) / ims _ per _ row ) ) pad _ value = np. min ( images. ravel ( ) ) concat ...
[ 0.1260284185409546, 0.46186310052871704, 0.7570814490318298, -0.06107958406209946, -1.112971305847168, -0.10554642230272293, 0.42073214054107666, 0.15770313143730164, 0.607428789138794, 0.33344700932502747, 1.3996024131774902, 0.18495026230812073, 0.7060598134994507, 0.6393105983734131, ...
def _ _ truediv _ _ ( self, other : float ) - > " translation2d " : if not isinstance ( other, ( float, int ) ) : return notimplemented return translation2d ( self. x / other, self. y / other )
[ -0.38512471318244934, 0.6912011504173279, 0.6884831190109253, 0.05109627917408943, -1.3513376712799072, 0.05800934135913849, -0.05119137838482857, -1.4417507648468018, -0.2917367219924927, -0.44317764043807983, -0.2908777892589569, -1.0726042985916138, 0.526563823223114, -0.213247224688529...
def snaptoedge ( coord ) : if ( coord % edge > edge / 2 ) : return edge * ( coord / edge + 1 ) else : return edge * ( coord / edge )
[ -1.0952033996582031, 0.865960419178009, 0.5096762776374817, -0.4477093815803528, -0.5401398539543152, 0.7122533917427063, 0.2961633801460266, -0.5003305673599243, 0.3030804991722107, 0.37377867102622986, 0.4116418659687042, -0.19907334446907043, 0.26176324486732483, -1.231047511100769, 0...
def compute _ sudo _ commane _ line _ patterns ( use _ shebang, python _ flags, inherit _ flags, pass _ env, user _ str ) : import re cmd, cmdline = _ construct _ wrap _ invoke _ cmdline ( use _ shebang = use _ shebang, python _ flags = python _ flags, inherit _ flags = inherit _ flags, wrapkey ='' ) cmdstr = " ". join...
[ -0.16494430601596832, -0.7126059532165527, 0.6064355969429016, 0.43395718932151794, 0.687096357345581, 0.5472321510314941, 0.18480351567268372, 1.4786878824234009, -0.3812163472175598, -0.17591114342212677, -0.15827591717243195, 0.38316696882247925, 0.36368340253829956, 0.7527089715003967,...
def unwarp _ panos ( infiles, outdir, lutfile ='data / lut. npy ', debug = false ) : lut = np. load ( lutfile ) lutx = lut [ :, :, 0 ]. astype ('float32') luty = lut [ :, :, 1 ]. astype ('float32') # get configuration im = imread ( infiles [ 0 ] ) im _ ph = tf. placeholder ('uint8 ', im. shape ) imgs = tf. cast ( im _ ...
[ 0.06831742823123932, -0.542762041091919, 0.8759012818336487, -0.24325768649578094, -0.7173371911048889, 0.0049858056008815765, 0.9903983473777771, 0.6009204983711243, -0.46811068058013916, 0.18196138739585876, -0.35820549726486206, 0.032631415873765945, -0.000028782264053006656, -0.4385128...
async def get _ all _ event _ messages ( self ) - > mythicresponse : url = " { } { } : { } / api / v { } / event _ message ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version ) resp = await self. get _ json ( url ) if resp. response _ code = = 200 and resp. status = = " su...
[ -0.4195021390914917, -0.6860004663467407, 0.7145397067070007, 0.5587736964225769, 1.5407462120056152, -0.5732752680778503, -0.5554850101470947, -0.12526968121528625, -0.20795491337776184, 0.2574095129966736, 0.024589136242866516, 0.9835556745529175, -0.3160676658153534, 0.6605457067489624,...
def disable ( self, * names : str ) - > none : for name in names : self. get _ plugin ( name ). disable ( )
[ -1.0784443616867065, -0.896359384059906, 0.2019066959619522, 0.5327017903327942, 0.5588617324829102, -0.009121613577008247, 0.13458850979804993, 0.09747159481048584, -0.15336813032627106, 0.17013993859291077, -1.2649492025375366, 0.19368286430835724, -1.1718205213546753, 0.2004461288452148...
def get _ past _ assignments ( self ) : return assignment. objects. filter ( class _ key _ id = self. id, end _ date _ _ lt = date. today ( ) ). all ( )
[ -1.5232352018356323, -0.29017373919487, 0.9571428894996643, 0.6330703496932983, -0.5328580737113953, 0.5018219351768494, -0.05415400117635727, -0.5658155679702759, -1.3396776914596558, 0.7623280882835388, 0.7019496560096741, -0.2508232593536377, -0.47753429412841797, 0.6983171701431274, ...
def next _ batch _ queue ( self, batch _ size, dataset, preprocessing _ fn = none, features _ to _ pad _ mask = none, concat _ features = false, multiple _ examples = 1, cache _ preprocessed = false, threads = 4, queue _ size = 10 ) : # starts the self. start _ queue _ workers ( batch _ size, dataset, preprocessing _ f...
[ -0.23105651140213013, 0.4699438214302063, 0.5864914059638977, 0.3762691915035248, -0.2406994104385376, -0.6289358735084534, -0.5274947881698608, -0.14608308672904968, -0.030417442321777344, -0.7664822340011597, -0.004587291739881039, 0.9629900455474854, 0.12720440328121185, 0.2583509981632...
def validate ( function ) : _ ipopo _ explorer ['validate'] = function return function
[ -0.8875301480293274, -0.19438771903514862, 0.2465263456106186, 0.16112665832042694, -0.30024880170822144, 0.24175061285495758, 1.1592317819595337, 0.18980582058429718, 0.3032380938529968, -0.7454293370246887, 0.6187027096748352, -0.6504554152488708, 0.31459829211235046, -1.0844011306762695...
def getddgexternaloutputenabled ( index ) : andor _ solis. getddgexternaloutputenabled. restype = ctypes. c _ uint enabled = ctypes. c _ ulong ( ) result = andor _ solis. getddgexternaloutputenabled ( ctypes. c _ ulong ( index ), ctypes. byref ( enabled ) ) check _ status ( result ) return int ( enabled. value )
[ -0.7724798321723938, 1.1673195362091064, 0.6506418585777283, -0.21656718850135803, -1.3637384176254272, -0.5859885215759277, 0.5244993567466736, -0.04281448945403099, 0.5885632634162903, -0.348954439163208, -0.49394336342811584, -0.05487777665257454, -0.7671563625335693, -0.409560054540634...
def test _ comoving _ vol _ from _ uniform ( comoving _ vol _ converter ) : d = 1000 grid = mock ( ) comoving _ vol _ converter. interp _ dc2dl = grid comoving _ vol _ converter. scale = 5 with patch ( " nessai. gw. utils. interpolate. splev ", return _ value = 20 ) as interp _ mock : du, lj = comovingdistanceconverter...
[ -0.0016238926909863949, -0.14208972454071045, 0.5905002951622009, -0.37377670407295227, 0.3842030167579651, 0.5259052515029907, -0.12204186618328094, 0.3194693922996521, 0.7414175271987915, 0.05761849135160446, -1.1412882804870605, -0.29331597685813904, -0.44614243507385254, 0.838757991790...
def models _ ovamodelcombiner ( training _ data, predictor _ model = none, model _ array = none, use _ probabilities = true, feature _ column ='features ', label _ column ='label ', weight _ column = none, normalize _ features ='auto ', caching ='auto ', * * params ) : entrypoint _ name ='models. ovamodelcombiner'input...
[ -0.8897103071212769, 0.06734076142311096, 1.0613645315170288, 0.793676495552063, -0.1085677295923233, -0.16431337594985962, 0.336402952671051, -0.5454502105712891, -0.4426734447479248, 0.5537497401237488, 0.3300328254699707, -0.16307996213436127, 0.43309515714645386, -0.21076631546020508, ...
def probability _ at ( self, point, origin, width ) : if self. is _ leaf ( ) : return self. probability else : child _ index = self. index ( point, origin, width ) return self. _ children [ child _ index ]. probability _ at ( point, self. origin ( child _ index, origin, width ), width / 2 )
[ -0.05392301827669144, -0.8573578596115112, 0.7158602476119995, 0.4831797480583191, -0.31362152099609375, 0.09500931948423386, -0.3030867576599121, -0.13883504271507263, 0.0957893431186676, 0.18287761509418488, 0.5348877906799316, -0.2337847352027893, -0.1765303909778595, -0.578177750110626...
def landmark _ creation ( y, i _ y, state, s ) : l = state. new _ slot ( i _ y ) r = state. r p = state. p x = state. x r = state. r x [ l ], j _ r, j _ y = inv _ observe ( r, y ) # global landmark pose p _ rr = p [ np. ix _ ( r, r ) ] p _ lm = j _ r. dot ( p [ r, : ] ) p [ l, : ] = p _ lm p [ :, l ] = p _ lm. t p [ np...
[ 0.46230748295783997, -0.43672385811805725, 0.6154640913009644, -1.2659212350845337, -0.38112035393714905, 0.92232346534729, 0.3473338484764099, 0.6366877555847168, -0.16531816124916077, 0.7968441843986511, -0.4885371923446655, 0.32888948917388916, 0.4986790120601654, -0.28249332308769226, ...
def job _ runner ( func ) : async def job _ func ( worker : processworkerabc, command, * args, * * kwargs ) : " " " wrapping function " " " response = await func ( worker, command, * args, * * kwargs ) await worker. pool. send _ message _ out ( response ) return job _ func
[ 0.0698385089635849, -0.10707134008407593, 0.6327407956123352, -0.5140595436096191, -0.18838374316692352, 0.00022905781224835664, 0.8948763012886047, -0.09930890798568726, -0.5657561421394348, -0.554305374622345, 0.11629272997379303, 0.5425483584403992, 0.02868012897670269, -0.2150852978229...
def build _ revision ( self, build _ revision ) : self. _ build _ revision = build _ revision
[ 0.1650596708059311, -1.3330870866775513, 0.3107888400554657, 0.45415782928466797, 0.22183777391910553, 1.447266697883606, 0.5724415183067322, 1.8361338376998901, -1.202962040901184, -0.6010279059410095, -1.1416281461715698, 0.31283655762672424, 0.27051642537117004, -0.8244642615318298, 0...
def _ _ contextmenumoveright ( self ) : self. movetab ( self. contextmenuindex, self. contextmenuindex + 1 )
[ -0.6131742000579834, -0.3310951292514801, 0.5882837772369385, 0.6308434009552002, -0.22517143189907074, 0.30752328038215637, 0.29153168201446533, -0.7105330228805542, -0.26897361874580383, 0.14546269178390503, 0.3917173147201538, 0.04635597765445709, -0.07694032043218613, -0.87500768899917...
def handle _ keyrelease ( self, event ) : if event. keysym = = " backspace " : self. delete ( self. index ( tkinter. insert ), tkinter. end ) self. position = self. index ( tkinter. end ) if event. keysym = = " left " : if self. position < self. index ( tkinter. end ) : # delete the selection self. delete ( self. posit...
[ -0.08276281505823135, -0.09057079255580902, 0.6283926367759705, -0.23497694730758667, -0.013791616074740887, -0.6597734093666077, 0.2768983542919159, 0.6006143689155579, 0.4348849356174469, 0.6900242567062378, -0.3902113437652588, -0.3623094856739044, -0.6348938345909119, 0.724930524826049...
def get _ experiment1 _ setup ( ) : num _ exemplars = 8 num _ features = 18 learning _ set = np. zeros ( [ num _ exemplars, num _ features ] ) # e. g. learning _ set [ 0, 0 ] = 1 means that exemplar 1 has feature 1 present learning _ set [ 0, 0 ] = 1 learning _ set [ 0, 2 ] = 1 learning _ set [ 0, 5 ] = 1 learning _ se...
[ 0.0353936068713665, 0.13177093863487244, 0.8520749807357788, -0.27579185366630554, 0.2733153700828552, -0.5231193900108337, 1.0209851264953613, 0.5687955617904663, -0.15712817013263702, 0.6399057507514954, -0.49828630685806274, 0.278212308883667, 0.21584996581077576, 0.0012774748029187322,...
def doc _ short ( doc, keys ) : # wanted = set ( keys ). intersection ( doc. keys ( ) ) # skip non - existing keys res = { wkey : doc [ wkey ] for wkey in keys if wkey in doc. keys ( ) } return res # return { wkey : doc [ wkey ] for wkey in wanted }
[ -0.19951602816581726, 0.037608616054058075, 0.570946991443634, -0.3732978403568268, -1.2105759382247925, -0.015174496918916702, -0.2842763066291809, -0.04932123050093651, -0.9746617078781128, 0.7084074020385742, -0.060102351009845734, 0.30867525935173035, -0.26048994064331055, -0.071796730...
def put ( self ) : if jwthandler. authorize _ action ( self, 1 ) = = false : return none user _ data = jwthandler. decode _ userdata ( self. request. headers [ " authorization " ] ) body _ categories = { " old _ password " : 1, " new _ password " : 1 } password _ dict = errorutil. check _ fields ( self. request. body. ...
[ -0.9955135583877563, -0.5100711584091187, 0.9714217185974121, 0.10479247570037842, -0.12914025783538818, 0.19049234688282013, 0.16832992434501648, -0.5444384813308716, 0.1405300498008728, 0.8137527704238892, -0.1327315717935562, 0.7070537805557251, -0.41158434748649597, 0.4497118592262268,...
def isotope _ verifier ( isotope ) : isotope = isotope. symbol + str ( isotope. mass _ number ) flag = false for i in range ( len ( natural _ isotopes _ list ) ) : var = natural _ isotopes _ list [ i ]. symbol + str ( natural _ isotopes _ list [ i ]. mass _ number ) if isotope = = var : isotope _ info = [ natural _ iso...
[ -0.24996018409729004, -0.591329038143158, 0.4407133460044861, 0.5172339081764221, 0.8349335789680481, 0.8329784870147705, 0.11139006912708282, -0.15927188098430634, -1.04099702835083, 0.43645286560058594, -0.8031103610992432, 0.3600788116455078, 0.22614338994026184, 0.8427364826202393, 0...
def create _ amenitie ( ) : jsonrequest = request. get _ json ( ) if not jsonrequest : return jsonify ( {'error':'not a json'} ), 400 elif'name'not in jsonrequest : return jsonify ( {'error':'missing name'} ), 400 else : _ amenitie = amenity ( * * jsonrequest ) storage. new ( _ amenitie ) storage. save ( ) return jsoni...
[ -1.2058868408203125, -0.2923213839530945, 0.8445245027542114, 0.04963897168636322, -0.5273320078849792, -0.06000307574868202, -1.3471910953521729, -0.47382882237434387, 0.4944104552268982, 0.8077316284179688, -1.1932214498519897, -0.1112382709980011, -0.3436507284641266, 0.0611320957541465...
def scdsc _ injection _ status ( ) - > tuple [ str, int ] : return flask. jsonify ( { " status " : " ready ", " version " : versioning. get _ code _ version ( ) } )
[ -0.6980052590370178, -0.3995368480682373, 0.5713141560554504, -0.6577808260917664, -0.011196204461157322, -0.3256042003631592, -0.9377893805503845, 0.4584546983242035, -0.21650822460651398, 0.39438992738723755, -1.6423262357711792, 0.8562308549880981, 0.542811930179596, 0.19811631739139557...
def test _ add _ group ( self ) : pass
[ -0.212222620844841, 1.3684360980987549, 0.17207945883274078, 0.8960290551185608, 0.6504903435707092, 0.5697536468505859, 0.7234520316123962, -0.33441832661628723, -0.34057772159576416, -1.3738179206848145, -0.17235849797725677, -0.10055046528577805, -1.0562100410461426, 0.5518378615379333,...
def build _ discriminator _ from _ rgb _ layers ( from _ rgb _ conv _ layers, params ) : with tf. variable _ scope ( name _ or _ scope = " discriminator ", reuse = tf. auto _ reuse ) : # get fromrgb layer properties. from _ rgb = [ params [ " discriminator _ from _ rgb _ layers " ] [ i ] [ 0 ] [ : ] for i in range ( le...
[ -0.24802915751934052, -0.9286353588104248, 0.5261231660842896, 0.5894994735717773, 0.4128996431827545, 0.5319816470146179, 0.20565298199653625, 0.04080953449010849, -0.12068752199411392, 0.3330315351486206, -0.47335344552993774, 0.03354668989777565, -0.04446633532643318, 0.0099289352074265...
def _ create _ dependency _ rule ( self, package, install _ requires, reason, requirements = none ) : literals = [ - self. _ pool. package _ id ( package ) ] for dependency in install _ requires : if dependency! = package : literals. append ( self. _ pool. package _ id ( dependency ) ) return packagerule ( literals, re...
[ -0.06788580119609833, 0.03456752002239227, 0.2789752185344696, -0.868208110332489, 0.7972990870475769, 0.7200977802276611, -0.5640131235122681, 0.7620322108268738, -0.33423367142677307, 0.5473633408546448, 0.7569856643676758, -0.386024534702301, -0.419690877199173, 0.194986030459404, 0.4...
async def test _ sending _ mqtt _ commands _ rgbw ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, setup _ tasmota ) - > none : config = copy. deepcopy ( default _ config ) config [ " rl " ] [ 0 ] = 2 config [ " lt _ st " ] = 4 # 4 channel light ( rgbw ) mac = config [ " mac " ] async _ fire _ mqtt _ message ( h...
[ 0.4472180902957916, -0.10065668076276779, 0.49326223134994507, 0.17523346841335297, 0.3119945526123047, 0.6220735311508179, -0.279503732919693, -0.4710278809070587, -0.19476743042469025, -0.05528682470321655, -0.42142999172210693, 0.03598117455840111, 0.06506001949310303, 0.904884219169616...
def test _ convergence ( self, epsilon, make _ plots ) : # gather all pareto fronts par _ list = self. isle. solution _ island. dump _ pareto ( ) par _ list = self. comm. gather ( par _ list, root = 0 ) # test combined pareto front for convergence if self. comm _ rank = = 0 : tmp _ par _ list = self. pareto _ isle. dum...
[ 0.726220965385437, -0.7671505212783813, 0.9625288248062134, 0.16093628108501434, 0.6621941328048706, 0.8507755994796753, 0.4229663908481598, 0.18932241201400757, -0.575742244720459, -0.7640993595123291, 0.06121329590678215, 0.36567428708076477, 0.24849916994571686, 0.7599825859069824, -0...
def test _ cant _ get _ branch _ id _ doesnt _ exist ( self ) : json _ response = api _ call ( self, " get ",'/ branch / get ', dict ( id = 100 ), 200, true ) self. assertequal ( json _ response [ " status _ code " ], 404 ) self. assertequal ( json _ response [ " message " ], " branch not found " )
[ -0.29989850521087646, -0.008721784688532352, 0.5225315690040588, 0.5069721341133118, 1.2923007011413574, 1.458235263824463, -0.7502453327178955, 0.20685569941997528, -0.45198091864585876, -0.6830442547798157, -0.6054785847663879, 0.8344467282295227, -0.48636874556541443, 0.5361882448196411...
def extend _ level _ metadata ( self, force _ update : bool = false ) - > none : extended _ keys = ( " tiles ", " entities ", " virtual " ) updated _ level _ info = false try : for level, levelinfo in self. levels. items ( ) : atlas _ id = levelinfo [ " atlas _ id " ] if not atlas _ id : continue if not force _ update ...
[ -0.24891908466815948, -0.2039303481578827, 0.6602508425712585, -1.0869897603988647, 0.3693181276321411, 0.6933627128601074, -0.4254235327243805, 0.21946367621421814, -1.0245542526245117, 0.5540080070495605, -0.9359419941902161, 0.0850919634103775, 0.4839194416999817, 0.682773768901825, 0...
def load _ mapping _ index ( self, index _ file ) : file _ path = '.. / resources / mapping _ files /'+ index _ file try : voxel _ point _ index = np. load ( file _ path, allow _ pickle = true ) except assertionerror as error : print ( error ) print ('voxel mapping file not found!') return voxel _ point _ index
[ -0.37707316875457764, -0.6095097661018372, 0.27217113971710205, -0.2702949643135071, -0.664039134979248, 0.565825879573822, 0.4817340075969696, 0.8683391213417053, -0.19065037369728088, 0.7092188596725464, 0.5281047821044922, -0.2512989342212677, -0.41308075189590454, -0.8403369188308716, ...
def pre _ mesh ( self ) : self. create _ tri _ mesh ( ) self. create _ mappings ( ) self. define _ vorverts ( ) self. process _ voredges ( )
[ 0.7246161103248596, 0.6415944695472717, 0.3000246286392212, 0.953394889831543, 0.7132187485694885, -0.021710306406021118, 1.0333428382873535, -0.23525120317935944, 0.7536653280258179, -0.48961925506591797, -0.6735051274299622, 0.506403386592865, 0.20512598752975464, 0.7999064922332764, -...
def getuserinfo ( user _ id ) : user = session. query ( user ). filter _ by ( id = user _ id ). one ( ) return user
[ 0.3315318822860718, 0.07423914968967438, 0.30397623777389526, 0.6276994347572327, 0.440585732460022, -0.09794045984745026, 0.3511127829551697, -1.112332820892334, -0.034658245742321014, -0.5220562815666199, -0.1019030287861824, -0.07499638944864273, 0.3529618978500366, 0.14260847866535187,...
def delete _ draft ( request ) : if request. method = = " post " : if " id " in request. post : try : photo _ id = request. post [ " id " ] item = photo. objects. get ( pk = photo _ id ) photo _ name = item. title item. delete ( ) return redirect ('request _ result _ ok ', " delete successfully. photo { } is available ...
[ -0.844735324382782, -0.37181177735328674, 0.8547248244285583, 1.0210676193237305, -0.4358867108821869, 0.7934361100196838, 0.4429459273815155, 0.3809925615787506, 0.7611955404281616, -0.21216446161270142, 0.41806331276893616, -0.25537919998168945, 0.31631574034690857, 0.449795663356781, ...
def user _ website _ lookup ( users : list [ userinfo ] ) - > dict [ userhandle, str ] : return t. pipe ( users, t. map ( lambda user : ( user [ " screen _ name " ], t. get _ in ( [ " entities ", " url ", " urls ", 0, " display _ url " ], user ), ) ), t. curry ( tqdm. tqdm, desc = " processed " ), dict, t. valfilter ( ...
[ -0.5160481333732605, 0.18099075555801392, 0.40234458446502686, -0.09419823437929153, -0.8738421201705933, -0.05049513280391693, 0.9371065497398376, -0.3611711859703064, 0.10723168402910233, 0.07280860841274261, 0.22852671146392822, -0.1767093539237976, 0.7292011976242065, 0.643008589744567...
def accuracy _ function ( self, prbs, labels, mask ) : decoded _ symbols = tf. argmax ( input = prbs, axis = 2 ) accuracy = tf. reduce _ mean ( tf. boolean _ mask ( tf. cast ( tf. equal ( decoded _ symbols, labels ), dtype = tf. float32 ), mask ) ) return accuracy
[ -0.7116926312446594, -0.12597768008708954, 0.35976076126098633, 0.17257072031497955, 0.6929826140403748, 0.1606285572052002, 0.697324812412262, 0.3222610354423523, -0.5280469059944153, 0.7439626455307007, 0.43691563606262207, 1.027079463005066, -0.25401294231414795, -1.1362541913986206, ...
def insert ( self, index, item ) : if not 0 < = index < = self. _ size : raise indexerror ('invalid index') if self. _ size = = self. _ capacity : self. _ resize _ to _ new _ capacity ( self. _ capacity * self. growth _ factor ) for i in range ( self. _ size, index, - 1 ) : self. _ data [ i ] = self. _ data [ i - 1 ] s...
[ -0.5016574263572693, 0.8582204580307007, 0.6141325831413269, -0.09682612121105194, 0.7312303781509399, 0.5794261693954468, 0.27539584040641785, -0.33477336168289185, -0.5509698390960693, -0.23151952028274536, -1.086909532546997, 0.12448593229055405, -0.832085907459259, -1.0680075883865356,...
def test _ streamstarted ( self ) : observers = [ ] def addonetimeobserver ( event, observerfn ) : observers. append ( ( event, observerfn ) ) xs = self. xmlstream xs. addonetimeobserver = addonetimeobserver xs. makeconnection ( self ) self. assertidentical ( none, xs. sid ) self. assertfalse ( xs. _ headersent ) xs. d...
[ -0.002762145595625043, -0.12717200815677643, 0.5662250518798828, -0.23212873935699463, 0.29174140095710754, -0.0930660292506218, -0.35773709416389465, 0.040301334112882614, 0.6798112988471985, -0.5953701138496399, -0.9800127744674683, -0.15545153617858887, 0.11757855117321014, 0.1840216219...
def move ( self, keys ) : movedy = false movedx = false # change speed of player according to all pressed keys regarding order, change orientation if necessary for key in reversed ( keys ) : if key in [ pygame. k _ w, pygame. k _ up ] and not movedy : self. movey = - player _ speed movedy = true elif key in [ pygame. k...
[ -1.6861095428466797, -0.6422948241233826, 0.9207932949066162, 0.04197230190038681, 0.08783150464296341, -0.04896106570959091, -0.00027234002482146025, -0.2661728262901306, -0.17454323172569275, 0.7717279195785522, -0.2848057746887207, -0.7930789589881897, -0.5829222202301025, 0.28946313261...
def get _ absolute _ positions ( self ) : # uses direction to get relative directions rel _ coord = dict ( left = self. direction _ dict [ self. current _ direction ] [ 0 ], forward = self. direction _ dict [ self. current _ direction ] [ 1 ], up = ( 1, 0, 0 ), down = ( - 1, 0, 0 ) ) # adds backward and right coordinat...
[ -0.38172343373298645, -1.313491702079773, 0.8561484813690186, -0.8516340255737305, -0.49106723070144653, -0.176679328083992, 0.40332353115081787, 0.5584303140640259, -0.9986310601234436, 0.631842851638794, -0.8164146542549133, -0.7772246599197388, -0.29283177852630615, 0.54145348072052, ...
def _ choose _ option ( self, graph, depth, nearby _ opponents = [ ] ) : command _ list = [ ] score _ list = [ ] collision _ cmds = [ ] pos = graph [ 0 ] direction = graph [ 1 ] speed = graph [ 2 ] graph _ dict = graph [ 3 ] for opp in nearby _ opponents : cmds = self. _ calculate _ collision _ cmds ( pos, direction, s...
[ -0.4758450388908386, 0.33377882838249207, 0.9768010973930359, 0.2259635329246521, 0.7271664142608643, -0.39392411708831787, 0.848580002784729, -0.8797945976257324, 0.04465954378247261, 0.352764755487442, 0.5289598107337952, -0.1011265218257904, -0.29583820700645447, -0.08474930375814438, ...
def _ raw _ hex ( v : union [ layerfieldscontainer, layerfield ] ) - > int : # split v into octets and reverse the order assert not isinstance ( v, layerfieldscontainer ) or len ( v. fields ) = = 1 iv = v. hex _ value try : int ( v. get _ default _ value ( ) ) assert int ( v. get _ default _ value ( ) ) = = iv, ( v. ge...
[ -0.0686434656381607, 0.48456308245658875, 0.5952469706535339, -0.205903559923172, 0.5681602954864502, -0.5480585098266602, 0.2605651915073395, -0.17368444800376892, -0.1290978491306305, -0.5253909826278687, -0.3281315863132477, -0.5205536484718323, 0.37261301279067993, 0.3082940876483917, ...
def set _ accesstoken ( self, value ) : super ( addrowinputset, self ). _ set _ input ('accesstoken ', value )
[ -0.3375594913959503, 0.6362623572349548, 0.357397198677063, -0.21279661357402802, -0.6666598320007324, 0.1259394735097885, 0.6523633599281311, -0.19964610040187836, 0.33720624446868896, -0.6280124187469482, -0.007894124835729599, 0.5901398658752441, 0.7992597818374634, 0.34241819381713867,...
def delete _ user ( self, id : uuid ) : user = self. get _ user ( id ) if not user : return false users. delete ( ). where ( users. c. id = = id ). execute ( ) return true
[ -0.6028309464454651, 0.7185315489768982, 0.5090326070785522, 0.4275519549846649, 0.27990347146987915, 0.2647723853588104, -0.01958250254392624, 0.13012628257274628, 0.0930328369140625, 0.5650580525398254, -0.6334236860275269, -1.0510691404342651, -0.38413557410240173, -0.1211434081196785, ...
def randhighch ( ) - > int : return min ( randint ( 2, 4 ) * 64, 255 )
[ 0.19078874588012695, 0.35132184624671936, 0.6213730573654175, 0.7072919607162476, -0.27994439005851746, 0.6125438809394836, 0.05645062401890755, -0.29101067781448364, 0.48984548449516296, -0.9459603428840637, -0.45892608165740967, -0.11995159089565277, -0.18124407529830933, -0.312836825847...
async def _ parse _ http _ leases ( self, response ) : # remove leading and trailing quotes and spaces data = await self. _ parse _ http _ data ( response ) cleaned _ str = data. get ('dhcp _ leases'). replace ( " \ " ", " " ). replace ( " \'", " " ). replace ( " ", " " ) elements = cleaned _ str. split ( ',') num _ cl...
[ -0.4232775866985321, 0.07975655794143677, 0.38677939772605896, -0.6919995546340942, -0.1649881899356842, -0.45514976978302, -0.5716273188591003, -0.20574285089969635, -0.8706780076026917, 0.12898823618888855, -0.446749210357666, -0.1934155970811844, -0.7931941151618958, 0.05247107893228531...
def get _ fixed _ filename ( filename ) : new _ name = " " for i, letter in enumerate ( filename ) : if letter = = '.': new _ name + = '.'+ filename. split ( '.') [ 1 ] break if letter. isupper ( ) and i! = 0 and new _ name [ - 1 ] not in ['( ',') ','_'] : new _ name + ='_'if letter = ='' : new _ name + ='_'else : new ...
[ -0.5372543334960938, -0.7751994729042053, 1.0718836784362793, -0.3199208974838257, -0.9254330992698669, 0.04499957337975502, 0.2048117220401764, 0.23702381551265717, -0.28363674879074097, 0.6067216396331787, 0.003735656151548028, 0.6353278756141663, -0.36570465564727783, 0.1397220641374588...
def _ _ init _ _ ( self, board, autodetect = true, allow _ fallback = false, page _ size = 256, pages = 8192, maximum _ address = none, allow _ null _ jedec = false, device _ id = 0, chip _ select _ pin = none, clock _ frequency = 2000000, mode = 0, force _ page _ size = none, ) : # pylint : disable = too - many - argu...
[ 0.9740199446678162, 0.9030348658561707, 0.6130989193916321, 0.9259787201881409, -0.5397661328315735, -0.7448687553405762, 0.8798055052757263, 0.1451154500246048, 0.6634830832481384, -1.021317720413208, -0.41082698106765747, 0.07126347720623016, 0.5016230344772339, 0.743998646736145, 0.45...
def vis _ segmentation ( image, seg _ map ) : plt. figure ( figsize = ( 15, 5 ) ) grid _ spec = gridspec. gridspec ( 1, 4, width _ ratios = [ 6, 6, 6, 1 ] ) plt. subplot ( grid _ spec [ 0 ] ) plt. imshow ( image ) plt. axis ('off') plt. title ('input image') plt. subplot ( grid _ spec [ 1 ] ) seg _ image = label _ to _...
[ 0.06711070239543915, -0.33929410576820374, 0.8825688362121582, -0.647855281829834, 0.3981819152832031, -0.05171375349164009, 1.3105911016464233, 0.12018825858831406, 0.35754385590553284, 0.20010946691036224, 0.6439259648323059, 0.6162179112434387, 0.22976210713386536, -0.038260459899902344...
def call ( self, encoder _ inputs, categories, attention _ bias, training ) : for n, layer in enumerate ( self. layers ) : # run inputs through the sublayers. self _ attention _ layer = layer [ 0 ] feed _ forward _ network = layer [ 1 ] with tf. name _ scope ( " layer _ % d " % n ) : with tf. name _ scope ( " self _ at...
[ -0.14563748240470886, 0.26852935552597046, 0.5090144276618958, 0.5791391134262085, -0.42342182993888855, -0.8009213805198669, 0.804594099521637, -0.9938270449638367, -0.2878526449203491, -0.2227383255958557, 0.15946415066719055, -0.13870014250278473, 0.17143385112285614, 0.4770250320434570...
def _ parse _ options ( self, _ opts ) : _ options = { } if'options'in _ opts : for name, value in _ opts ['options']. items ( ) : replaceable _ values = { } for _, variable, _, _ in formatter ( ). parse ( value ) : if variable is not none : replaceable _ values [ variable ] = os. environ. get ( variable ) value = valu...
[ 0.07390540093183517, -0.37656038999557495, 0.46689558029174805, -0.6107000112533569, -0.12240662425756454, -1.0968610048294067, -0.6452305316925049, -0.0428098663687706, -0.10764899849891663, 0.29860231280326843, -0.11456059664487839, -0.307998925447464, -0.2129845917224884, 1.247144103050...
def disable _ pairing ( self ) : try : out = self. get _ output ( " discoverable off " ) out = self. get _ output ( " pairable off " ) except bluetoothctlerror, e : print ( e ) return none
[ -0.11210867762565613, -0.11130780726671219, 0.6810651421546936, 1.133948802947998, -0.620864987373352, 0.02714441530406475, 0.5754662752151489, 0.5931004285812378, -0.23326654732227325, -0.7672727108001709, 0.1779269427061081, -0.4752357602119446, -1.7794837951660156, 0.8504540324211121, ...
def visit ( graph, node ) : if node in visited : return false path. append ( node ) visited. append ( node ) for neighbour in graph. get ( node, [ ] ) : if neighbour in path or visit ( graph, neighbour ) : return true path. remove ( node ) return false
[ -0.09994958341121674, 1.3159782886505127, 0.6422932147979736, -0.07597678899765015, -0.5475579500198364, -0.08540401607751846, -0.06535523384809494, 0.5456584692001343, -0.23829835653305054, 0.48640426993370056, 0.0648767352104187, -0.48938116431236267, -0.47246530652046204, -0.05855016037...
def test _ update _ with _ block _ from _ shopping _ basket _ with _ voucher _ code ( self ) : block = baker. make _ recipe ('booking. block _ 10 ', user = self. user, block _ type _ _ event _ type = self. pole _ class _ event _ type, paid = true, start _ date = timezone. now ( ) ) event = baker. make _ recipe ('bookin...
[ -0.06340391933917999, 0.6316067576408386, 0.8568950891494751, 1.5449886322021484, 0.1683499962091446, 0.2217961698770523, 0.10369379818439484, 0.4148525595664978, 0.09098710119724274, 0.4560490846633911, -0.2899104952812195, 0.09091148525476456, 0.04888289049267769, 0.9003645181655884, 1...
def volume _ size ( self ) - > optional [ pulumi. input [ int ] ] : return pulumi. get ( self, " volume _ size " )
[ 0.8537623882293701, 0.5135446190834045, 0.5491235256195068, 0.13176767528057098, 0.880448579788208, 0.7945449352264404, 0.14291273057460785, 0.14333714544773102, 0.6946961879730225, -0.8501519560813904, 0.26383620500564575, 0.8018715977668762, -0.23150818049907684, -1.1152886152267456, 0...
def read ( self, file _ name : optional [ path ] = none ) : # initialize all the lists self. titv _ mat = [ ] self. tpmi _ mat = [ ] self. landmarks = [ ] self. lmk _ jacobians = [ ] self. lmk _ pred _ pixlines = [ ] self. lmk _ observed _ pixlines = [ ] self. lmk _ body _ fixed _ vec _ sigmas = [ ] self. lmk _ body _ ...
[ -0.34631359577178955, -0.7575345635414124, 0.676514208316803, -0.06255495548248291, -0.19823934137821198, -0.22674815356731415, -0.3038876950740814, 0.6398048400878906, -0.2927958071231842, -0.34644070267677307, -0.11425350606441498, 0.17290768027305603, 0.1287650316953659, 1.2707108259201...
def add _ grid _ frame ( grid : np. ndarray, generation : int, grid _ frames : list [ np. ndarray ], pixels _ per _ cell : int, ) - > none : arr _ grid = enlarge _ image ( grid * 255, pixels _ per _ cell ) image = image. fromarray ( arr _ grid, mode = " l " ). convert ( " p " ) grid _ frames. append ( image )
[ -0.5663173198699951, 1.262060284614563, 0.6618933081626892, 0.7096692323684692, 0.3691519796848297, -0.05662652850151062, -0.8911094069480896, -0.37483224272727966, 0.09603609889745712, 0.32605645060539246, 0.38745903968811035, 0.03380061313509941, 0.10086840391159058, 1.090843677520752, ...
def format _ minimal ( values ) : values = np. asarray ( values ) if np. max ( np. abs ( values ) ) > 1e5 or np. min ( np. diff ( values ) ) < 1e - 5 : fmt _ type ='e'else : fmt _ type ='f'for ndec in range ( 1, 15 ) : fmt ='{ { :. { 0 } { 1 } } } '. format ( ndec, fmt _ type ) strings = [ fmt. format ( x ) for x in va...
[ 0.3241101801395416, -0.6666666865348816, 0.4595276117324829, -0.5605441331863403, -0.28317272663116455, -0.06456290185451508, -0.10919099301099777, -1.4958614110946655, 0.6545447111129761, -0.08700260519981384, 0.7789565324783325, 0.28054705262184143, 0.1810544729232788, 1.0259023904800415...
def aggpageinit ( self, pages, aggname, aggtype ) : basenum = 0 # using the latest one produced way more weirdness... # len ( pages ) - 1 # use the latest one, chronologically, as the base reference. this actually doesn't guarantee latest chronologically due to teacher names. # however, i could implement a search to ma...
[ -0.8390130400657654, 0.10043492168188095, 0.9732086658477783, -0.031702205538749695, -0.0976565033197403, -0.4098939299583435, 0.3068576455116272, 0.0014984149020165205, 0.13688229024410248, 0.7148080468177795, 0.7911022901535034, 0.10006613284349442, -0.618249237537384, 1.1296871900558472...
def select ( self, pn, vn, node, strategy ='greedy') : utd = 0 parent _ visit = node. visit selected _ node = node. chirdren [ 0 ] for n in node. chirdren : child _ value = n. value child _ visit = n. visit # calculate utd if child _ visit = = 0 : curr _ utd = np. inf else : curr _ utd = ( child _ value / child _ visit...
[ 0.22843889892101288, -0.2541810870170593, 0.6061564683914185, -0.20176275074481964, 0.05547806993126869, -0.059624478220939636, 0.4208705425262451, 0.16099075973033905, 0.41278064250946045, 0.16044190526008606, 0.6380342841148376, 1.3503793478012085, -0.26471954584121704, -0.68453454971313...
def download _ file ( url, dst = none ) : request = requests. get ( url, stream = true ) with open ( dst, " wb " ) as downloaded _ file : shutil. copyfileobj ( request. raw, downloaded _ file ) return dst
[ -0.1719657927751541, -0.03832341358065605, 0.6034934520721436, 0.35870566964149475, -0.9307186007499695, 0.45994213223457336, 0.07049688696861267, 0.48631882667541504, -0.4371725022792816, -0.7517133355140686, -0.5050182342529297, -0.0063705164939165115, 0.5425673723220825, -0.643540143966...
def getsupply ( self, amount ) : if ( self. supply is not none ) : valout = min ( self. supply, amount ) self. supply - = valout self. getaccum + = valout return valout return none
[ 0.39992648363113403, -0.49675872921943665, 0.8212411403656006, -0.14332161843776703, -0.795055091381073, -0.5498486161231995, 0.15248455107212067, -1.3549649715423584, 0.9092026352882385, -0.29220765829086304, 0.1751079559326172, 0.139283686876297, -0.2914944589138031, -0.35753270983695984...
def from _ port ( self ) - > pulumi. input [ int ] : return pulumi. get ( self, " from _ port " )
[ 1.0735222101211548, 0.384952187538147, 0.6264293193817139, -0.028146842494606972, 0.7250939607620239, 1.2417854070663452, 1.2790859937667847, 0.03365148603916168, 0.2021131068468094, 0.15630826354026794, -0.23912180960178375, 0.9910920858383179, 0.06808137893676758, -1.690293312072754, 0...
def _ init _ common ( self ) : # generate a random suffix for resource names to avoid conflicts alphabet = string. ascii _ lowercase + string. digits setattr ( self. args,'suffix ',''. join ( random. choice ( alphabet ) for i in range ( 0, 8 ) ) ) # generate an ephemeral ssh key logging. info ('creating ephemeral key p...
[ -0.7229523658752441, 0.2862165868282318, 0.7306543588638306, -0.10754059255123138, 0.7119303941726685, 0.7333659529685974, 0.7698449492454529, 0.3382631540298462, -0.665143609046936, 0.2798473834991455, -0.8150767087936401, -0.3709365725517273, 0.6001536250114441, 1.4688221216201782, 0.7...
def update _ heatmap ( self ) : # iterate x - and y - axis axis for x, gx in enumerate ( self. x _ interp ) : for y, gy in enumerate ( self. y _ interp ) : # reset lists temperatures = [ ] distances = [ ] weights = [ ] # iterate sensors for room in self. rooms : for sensor in room. sensors : los = true # check if doors...
[ -0.18358249962329865, -0.8688256740570068, 0.8257830739021301, 0.18662433326244354, 0.2656230628490448, 0.7830356359481812, 0.6017760634422302, 0.4654181897640228, -0.35604655742645264, 0.7999042272567749, 0.3394366204738617, 0.06655507534742355, -0.6377532482147217, 0.7834235429763794, ...
def startswithfunc ( self, data ) : return unicode ( self. field. sortvalue ( data ) ). \ startswith ( unicode ( self. value ) )
[ 0.2827622890472412, -0.11276345700025558, 0.30464085936546326, 0.25773534178733826, -0.6831039786338806, -0.21117110550403595, -0.04367581382393837, -1.177803635597229, 0.1305532455444336, -0.40795889496803284, -0.3652131259441376, 0.6187838912010193, 0.0007793516851961613, 0.3945120871067...
def wrap _ document ( kind, name, data, block _ strings = true ) : wrapped _ schema ='deckhand / % s / v1'% kind wrapped _ metadata = ordereddict ( [ ('schema ','metadata / document / v1'), ('name ', name ), ('layeringdefinition ', ordereddict ( [ ('abstract ', false ), ('layer ','site'), ] ) ), ('storagepolicy ','clea...
[ 0.47847291827201843, 0.3551884889602661, 0.4518875777721405, -0.5312556028366089, -0.7799168229103088, 0.31315675377845764, -0.8599358797073364, -0.43112772703170776, -0.32317042350769043, 0.47488895058631897, -0.0007372046238742769, 0.7487522959709167, -0.13998372852802277, -0.48926040530...
def get _ message _ header ( cls, id ) : session = get _ session ( ) try : message = session. query ( cls ). get ( id ) print ( str ( message. msg _ sent _ subject ) ) return message except exception as e : logger. error ('error :'+ str ( e ) )
[ -0.42889404296875, -0.2901540696620941, 0.5543946027755737, -0.23612965643405914, -0.08793362975120544, -0.1329721361398697, -0.3425148129463196, -1.863085389137268, -0.3841279447078705, 0.26840734481811523, 0.5039970874786377, 1.1770200729370117, -0.6589134931564331, -0.08603775501251221,...
def get _ pkglist _ changes ( target1, target2 ) : print " target1 url : % s " % target1. url print " target2 url : % s " % target2. url pkghash1 = get _ pkghash ( target1 ) pkghash2 = get _ pkghash ( target2 ) changehash = { } for pkgname1, version1 in pkghash1. items ( ) : # add versions log. debug ( " % s - % s " % ...
[ -0.009488778188824654, -0.21021239459514618, 0.7736757397651672, -0.5643348097801208, -0.7906621694564819, 0.35191234946250916, -0.6760128736495972, 0.630276620388031, -0.25704196095466614, 1.1301459074020386, -0.8147270679473877, 0.36220377683639526, 0.8347245454788208, 0.8801658749580383...
def mirror _ new _ dest ( self, chm, mocked _ methods ) : return chm [ " mirror " ]
[ -1.2470929622650146, -0.32556790113449097, 0.2071349024772644, -0.49438831210136414, -0.5764822959899902, 0.1672746241092682, 0.18187826871871948, -0.17165400087833405, -0.14419794082641602, -0.01840326376259327, -0.9394888281822205, 0.9665547609329224, 0.17659012973308563, 0.0179541930556...
def finishwriting ( self, x ) : if self. chunkedout : # write last chunk and closing crlf self. channel. write ( " 0 \ r \ n \ r \ n " ) base. baseclientchannelrequest. finishwriting ( self, x )
[ -0.08113020658493042, -0.479791522026062, 0.46474510431289673, -0.8637957572937012, 0.8090654611587524, 0.06635583937168121, -0.12613877654075623, -0.360594779253006, -0.7975876927375793, 0.08523374050855637, 0.04042373597621918, -0.19262616336345673, -0.9975705742835999, 0.928381025791168...
def edit _ media _ list _ ava ( request ) : if not request. user. is _ superuser : return redirect ('% s? next = % s'% ( reverse ('dc _ parse : admin _ auth'), request. path ) ) # media _ list _ all = media. objects. all ( ). order _ by ('- pk') # desk'- pk'or. reverse ( ) media _ list _ all = mediavkphotothumbnail. ob...
[ -0.8855567574501038, -0.37735021114349365, 0.4542929232120514, 0.233307346701622, -0.1294737309217453, -0.5954237580299377, 0.8119981288909912, 0.6242953538894653, 0.6746587753295898, 0.9416046738624573, 0.1886112540960312, 0.00030002943822182715, 1.2265124320983887, 1.1583483219146729, ...
def uncapped _ flatprice ( chain, beneficiary, team _ multisig, preico _ starts _ at, preico _ ends _ at, flat _ pricing, preico _ cap, preico _ funding _ goal, preico _ token _ allocation, uncapped _ token ) - > contract : token = uncapped _ token args = [ token. address, flat _ pricing. address, team _ multisig, bene...
[ -0.1258411556482315, 0.022712353616952896, 0.4166383743286133, 0.07273778319358826, -0.29783186316490173, -0.20848023891448975, -0.3058825433254242, -0.32398316264152527, 0.16475355625152588, 0.3741081953048706, -0.314360648393631, 0.34010156989097595, -0.27486586570739746, -0.537438392639...
def validate _ username ( self, username : stringfield ) : if username. data = = " " : flash ( " the user name is empty ", " danger " ) raise validationerror ( " input username " )
[ 0.7803373336791992, 0.8918803930282593, 0.1872646063566208, 0.28779321908950806, 0.19013305008411407, 0.6740933656692505, 0.5222339630126953, 0.5172246098518372, 0.07372666150331497, -0.08055827766656876, -0.6785134673118591, -0.33802077174186707, -0.5081432461738586, 0.599027693271637, ...
def generate ( * args ) : names = [ ] classes = [ ] objects = [ ] for e in args : n, o, c = _ generate ( e ) names + = n classes + = c objects + = o return names, objects, classes
[ -1.517677664756775, 0.020091652870178223, 0.7027321457862854, -0.12101518362760544, 0.595657467842102, 0.8349394202232361, 0.380780965089798, -0.8498232960700989, -1.3058162927627563, -0.016727959737181664, -1.5555106401443481, -1.0148659944534302, 0.4212017357349396, 0.6765068769454956, ...
def predict ( self, data, targets, idx = none, batch _ size = 64, cuda = false, minmax = ( 0, 255 ) ) : if isinstance ( idx, type ( none ) ) : idx = numpy. arange ( len ( data ) ) predict _ loader = loader. get _ loader ( data [ idx ], targets [ idx ], batch _ size = batch _ size, validation = true, minmax = minmax ) s...
[ -0.5500912666320801, -0.16307802498340607, 0.6689867377281189, 0.020189525559544563, -0.6692448854446411, 0.14820724725723267, -0.8565537929534912, -0.04302877187728882, -0.3442988395690918, 0.04639795422554016, 0.29313358664512634, 0.7689247727394104, 0.6013067364692688, 0.071757897734642...
def subtrees ( obj : any ) - > iterator [ any ] : if isinstance ( obj, dict ) : for k, v in obj. items ( ) : yield from subtrees ( v ) elif isinstance ( obj, list ) : for v in obj : yield from subtrees ( v ) else : pass yield obj
[ 0.401605486869812, 0.21758808195590973, 1.034446120262146, 0.46794676780700684, -1.0451874732971191, 0.4556935429573059, -0.21909263730049133, -0.16257287561893463, 0.6333376169204712, -0.3569679260253906, -0.4536984860897064, 0.4530728757381439, -0.23859469592571259, 0.7004297971725464, ...
def solvesudoku ( self, board : list [ list [ str ] ] ) - > none : n = len ( board ) rows = [ set ( ) for _ in range ( n ) ] cols = [ set ( ) for _ in range ( n ) ] boxes = [ set ( ) for _ in range ( n ) ] empty = [ ] for i in range ( n ) : for j in range ( n ) : if board [ i ] [ j ] = = '.': empty. append ( ( i, j ) )...
[ 0.06009988859295845, 1.3544278144836426, 1.0828704833984375, 0.14322932064533234, -0.5282067060470581, -0.38160666823387146, 0.48867660760879517, 0.15235091745853424, 0.3291855752468109, -0.12051869183778763, -0.4260213375091553, -0.8091983795166016, -0.9984085559844971, -0.151401787996292...
def load _ ndc ( ) : global ndc _ codes with sqlite3. connect ('source. db') as conn : cur = conn. cursor ( ) ndc _ codes = [ map ( str, row ) for row in cur. execute ( " select product _ id, name, suffix, non _ proprietary _ name, dea _ schedule from ndc _ product " ) ]
[ -0.39475366473197937, 0.6339658498764038, 0.39196667075157166, -0.4734802544116974, -0.48825520277023315, -0.1519923210144043, -0.6721502542495728, -0.4601691663265228, -0.15584637224674225, 0.9879984259605408, -0.9579406976699829, -0.22588112950325012, 0.06776869297027588, 0.3115006685256...
def selection _ sort ( lst, start, end ) : count = start if start = = end : return lst else : minumum = lst [ count ] minpos = count for i in range ( count + 1, end + 1 ) : if lst [ i ] < minumum : minumum = lst [ i ] minpos = i lst [ count ], lst [ minpos ] = lst [ minpos ], lst [ count ] start + = 1 selection _ sort ...
[ -0.41405269503593445, -0.8499526381492615, 0.43961045145988464, 0.3962213099002838, -0.6152050495147705, 0.08331189304590225, -0.04534574970602989, -0.2624557912349701, -0.035599347203969955, -0.02970881573855877, -1.3459523916244507, 0.5832763910293579, -0.22740936279296875, -0.0334012806...
def get _ variables _ files _ count ( d ) : variables = { } c = sddb. conn. cursor ( ) c. execute ( " select variable, count ( * ) from file where dataset _ id =? group by variable ", ( d. dataset _ id, ) ) " " " the query returns something like : tos | 5 tossq | 5 " " " rs = c. fetchone ( ) while rs is not none : vari...
[ 0.14183309674263, 0.3904530107975006, 0.5517657995223999, -1.065563678741455, -0.8720098733901978, -0.8888487815856934, 0.20449179410934448, -0.09158219397068024, -1.241173505783081, -0.08847242593765259, -0.6905065178871155, -0.4474533796310425, 0.2272457778453827, 0.6146760582923889, -...
def add _ callback ( self, regexp, fn ) : self. _ callbacks. append ( ( regexp, fn ) )
[ 0.05193469300866127, -0.38482609391212463, 0.4543658494949341, 0.46906208992004395, 0.7605139017105103, 0.037769004702568054, -0.32374313473701477, 1.1181122064590454, 0.46746736764907837, -0.7945792078971863, -0.6863786578178406, 0.5252122282981873, -0.21930938959121704, -0.28237602114677...
def setup ( self ) : self. heka _ conf = {'stream _ class':'heka. streams. debugcapturestream ','plugins': {'raven': ('heka _ raven. raven _ plugin : config _ plugin ', {'dsn': dsn } ) }, } self. sentry _ client ='djangoraven. heka. hekadjangoclient'from heka. config import client _ from _ dict _ config self. heka = cl...
[ 0.23972225189208984, -0.7822442650794983, 0.3397252857685089, -0.5133526921272278, 1.1207470893859863, -0.6601617336273193, 0.1550334244966507, 0.19097112119197845, 0.41666024923324585, 0.5485490560531616, -0.6874201893806458, 0.7023437023162842, 0.17733986675739288, 1.032393217086792, 0...
def detect _ lang _ wrapper ( text, hint = none ) : # hint = cfg. language if cfg. language! ='en'else none hint = hint if hint! ='en'else none bf = cfg. best _ effort _ lang _ detection lang, score = detect _ lang ( text, best _ effort = bf, hint _ language = hint, return _ score = true, logger = logger ) return pd. s...
[ -0.30460646748542786, 0.04391540586948395, 0.3231322765350342, 0.18531058728694916, -0.1056351512670517, -0.15681228041648865, -0.6675395965576172, -0.14320211112499237, 0.14919720590114594, 0.023408353328704834, 0.07479813694953918, 0.37577739357948303, 0.29988619685173035, 0.782319903373...
def test _ check _ input _ nolandmask ( ) : # call checker function chmap, landmap, basevalues, time _ window, dim0 = mob. check _ inputs ( chmask, basevalues _ idx = [ 0 ], window _ idx = 1 ) # assert types assert dim0 = ='time'assert isinstance ( chmap, xr. dataarray ) is true assert landmap is none assert isinstance...
[ -0.19265145063400269, 0.1778337061405182, 0.39714112877845764, 1.0125651359558105, 0.23906004428863525, 0.6859074234962463, -0.0665656328201294, -0.8596357703208923, 0.0038687954656779766, -0.41727158427238464, -0.2840521037578583, 0.09906639158725739, -0.41095662117004395, 1.2870504856109...
def siblings ( self, lhs, rhs ) : parents = [ node. parent for node in lhs ] return [ node for node in rhs if node. parent in parents ]
[ -0.13355541229248047, -0.04563405364751816, 0.5398220419883728, 0.2441205531358719, -0.35424551367759705, 0.5807692408561707, -0.536210834980011, 0.12746459245681763, -0.4885749816894531, 1.0967191457748413, -0.4118320345878601, 0.9448094367980957, -1.0805972814559937, 0.8624064326286316, ...
def add _ path ( self, path ) - > none : paths = [ path ] if isinstance ( path, str ) else path # convert single string to list paths = [ unique for unique in paths if unique not in self. _ paths ] # filter out duplicates if self. _ recursive : " " " unlike inotify, inotifytrees does not expose a method for adding dire...
[ -0.3372136950492859, 0.21141569316387177, 0.5618191957473755, 0.6664178371429443, 0.37922972440719604, -0.14601708948612213, 0.30598723888397217, -0.26098281145095825, 0.7203341126441956, -0.5563234090805054, -0.29372069239616394, 0.022746199741959572, -0.17044062912464142, 1.0661617517471...
def chosen _ inline _ result _ callback ( self, callback ) : if callable ( callback ) : self. _ default _ chosen _ inline _ result _ callback = callback return callback elif isinstance ( callback, str ) : def decorator ( fn ) : self. add _ chosen _ inline _ result _ callback ( callback, fn ) return fn return decorator ...
[ -0.8387664556503296, -0.35952049493789673, 0.4443610906600952, 0.32857686281204224, -0.44491708278656006, -0.1986382156610489, 0.6907795667648315, 0.23352330923080444, 0.99958735704422, -0.6549040675163269, -0.04713498800992966, -0.20396699011325836, -0.3404879570007324, -0.120678201317787...
def setup _ overrides ( self, host, secret _ key, resource ) : # get the best username, password, and space old _ un, old _ pw, old _ space = ( self. clowder _ user, self. clowder _ pass, self. clowderspace ) self. clowder _ user, self. clowder _ pass, self. clowderspace = \ self. get _ clowder _ context ( host, secret...
[ -0.35556986927986145, -0.15200069546699524, 0.6681393384933472, -0.2312801480293274, 0.3539263606071472, -0.47811171412467957, 0.15203672647476196, -0.307474821805954, -0.08124522119760513, 0.17784956097602844, 0.31864121556282043, -0.369797945022583, -0.3588773012161255, 0.748734772205352...
def test _ backoff _ func ( self ) : def backoff ( retry ) : return 2 * * retry with mock. patch ('time. sleep') as sleep : @ retried ( retries = 3, backoff = backoff ) def f ( ) : raise valueerror with self. assertraises ( valueerror ) : f ( ) calls = [ mock. call ( backoff ( 1 ) ), mock. call ( backoff ( 2 ) ), mock....
[ 0.4612129330635071, 0.69992995262146, 0.45615318417549133, 0.30464044213294983, 0.7739296555519104, 0.02303662896156311, 0.107837975025177, -0.35254040360450745, 0.14857079088687897, 0.2579943537712097, -0.39741531014442444, -0.4773770868778229, -0.4999138414859772, -0.3759726881980896, ...
def add _ noise ( num, std ) : if type ( num ) = = int : return int ( round ( np. random. normal ( num, std, 1 ) [ 0 ] ) ) else : return np. random. normal ( num, std, 1 ) [ 0 ]
[ -0.5080696940422058, 0.07517142593860626, 0.8700238466262817, 0.46210920810699463, -0.5819380879402161, 0.7167488932609558, 0.13642077147960663, -0.5403479337692261, 0.6400511264801025, -0.09968773275613785, 0.9212570190429688, 1.0944935083389282, -0.5408499836921692, -0.034741561859846115...
def save _ eyeball _ model ( self, path ) : if ( self. eyefitter. eye _ centre is none ) or ( self. eyefitter. aver _ eye _ radius is none ) : print ( " 3d eyeball model not found. you may need - v or - m argument to check whether the pupil segmentation works properly. " ) raise else : save _ dict = { " eye _ centre " ...
[ -0.9688965082168579, -0.658076286315918, 0.4429532289505005, -0.5243135690689087, 0.3774688243865967, 0.7955560088157654, -0.3139016926288605, -0.14474350214004517, 0.13505810499191284, 1.5775911808013916, -1.525989294052124, 0.02794121392071247, -0.5129401087760925, 0.1330757439136505, ...
def setup _ module ( ) : print ( " \ n * * * " + _ _ name _ _ ) global d d = direct ( )
[ -0.399667352437973, -0.10928884893655777, 0.5598944425582886, -0.3204798996448517, 0.6373860836029053, 2.104175567626953, 1.4238088130950928, -0.13484716415405273, -0.4023131728172302, 0.10213956981897354, 0.005823568440973759, 1.8995323181152344, 0.8457139134407043, 0.8656279444694519, ...
def _ is _ internal _ name ( name ) : return name. startswith ( " _ _ " ) and not name. endswith ( " _ _ " )
[ -1.2141066789627075, -0.35149645805358887, 0.7241048216819763, -0.9774829745292664, -1.3286573886871338, 0.2221536785364151, -0.4071679413318634, -1.1197558641433716, 0.4102291464805603, 0.28170299530029297, -0.5127711296081543, -0.053288694471120834, -0.6908698081970215, 0.462898999452590...
async def xp ( self, ctx ) : pass
[ -0.09447009116411209, 0.6329995393753052, 0.220818892121315, 0.9769598245620728, 0.9246397614479065, 0.1280597299337387, -0.9796656966209412, -0.02948666550219059, 1.054336428642273, -0.4196513295173645, 0.2702406644821167, 0.3513304591178894, -0.4167506992816925, -0.8061015605926514, -1...