text
stringlengths
25
2.19k
embedding
listlengths
768
768
def rnn ( x ) : print " creating model " # permute the batch _ size and num _ steps dimensions x = tf. transpose ( x, [ 1, 0, 2 ] ) # reshape for input to multilstm layer x = tf. reshape ( x, [ - 1, num _ features ] ) layer1 = layers. fully _ connected _ layer ( x, num _ features, num _ hidden,'layer1') # we can't use ...
[ 0.08277861028909683, -0.3339351713657379, 0.5868908166885376, 0.5175939202308655, -0.5143011808395386, 0.025898780673742294, 0.17895658314228058, 0.00056409154785797, 0.6515437364578247, -0.1315806657075882, -1.4264634847640991, 0.021267840638756752, 0.5561436414718628, 0.33431220054626465...
def split _ pair _ to _ vars ( sample _ batch _ pair, scaler _ input, scaler _ label, n _ pad ) : # clean _ batch = np. stack ( [ pair [ 0 ]. reshape ( 1, - 1 ) for pair in sample _ batch _ pair ] ) clean _ batch = sample _ batch _ pair [ 0 ] clean _ batch = scale _ on _ 2d ( clean _ batch, scaler _ label ) clean _ bat...
[ -0.6106616854667664, -0.5697002410888672, 0.6741142868995667, 0.22780247032642365, -0.5805255770683289, 0.19623348116874695, -0.1691986471414566, -0.7654052972793579, -0.6530320644378662, 0.8717623949050903, -0.42271170020103455, 0.39519596099853516, 0.2682163417339325, 0.742788553237915, ...
def xml _ compare ( self, x1, x2, excludes = none ) : excludes = [ ] if excludes is none else excludes if x1. tag! = x2. tag : print ('tags do not match : % s and % s'% ( x1. tag, x2. tag ) ) return false for name, value in x1. attrib. items ( ) : if name not in excludes : if x2. attrib. get ( name )! = value : print (...
[ -0.10649656504392624, 0.1002785712480545, 1.19236421585083, -0.281602680683136, -1.1761623620986938, 0.6491840481758118, -0.5349284410476685, -0.513721227645874, -0.7280738353729248, -0.04668664187192917, -0.49358516931533813, 0.27011290192604065, -0.45832112431526184, -0.12579414248466492...
def set _ text ( self, text : str ) : rows = text. split ('\ n') self. set _ row _ data ( rows )
[ -0.19316375255584717, 0.45652759075164795, 0.19117683172225952, -0.026833049952983856, -0.49058595299720764, -0.5183217525482178, -1.0649795532226562, 0.8969435691833496, 0.3708163797855377, 0.4400894045829773, -0.8207425475120544, 0.34872984886169434, -0.18526113033294678, 0.1276328116655...
def is _ terminal _ support _ colors ( ) - > bool : if sys. platform = = " win32 " : return false if not is _ tty ( ) : return false if " colorterm " in os. environ : return true term = os. environ. get ( " term ", " dumb " ). lower ( ) if term in ( " xterm ", " linux " ) or " color " in term : return true return false
[ -0.730695366859436, 0.41901853680610657, 0.548417329788208, -0.23736445605754852, -0.10152997821569443, 0.32442083954811096, -1.647497296333313, 0.3245975375175476, -0.08175049722194672, -0.516553521156311, -0.6213342547416687, 0.7215635776519775, -0.4570479691028595, 0.6234304308891296, ...
def is _ auth _ token _ valid ( self, username : str, auth _ token : str, checktime : bool = false ) - > bool : return self. sqldata. is _ auth _ token _ valid ( username, auth _ token, checktime )
[ -0.5513559579849243, 0.08208591490983963, 0.36499926447868347, 0.6619566679000854, -0.30680760741233826, 0.6052566170692444, -1.0300711393356323, 0.021333295851945877, -0.1790865957736969, 0.11646069586277008, -0.38593366742134094, 0.8557875156402588, -0.2014792114496231, -0.17087289690971...
def change _ password ( self, user, password, send _ email = none ) : user. password = password self. user _ manager. save ( user ) if send _ email or ( app. config. security _ send _ password _ changed _ email and send _ email is none ) : self. send _ mail ( _ ('flask _ unchained. bundles. security : email _ subject. ...
[ 0.14962433278560638, 0.30042722821235657, 0.4536161422729492, 1.0844056606292725, 0.19699817895889282, -0.2904396951198578, 0.09903892129659653, 0.6320642828941345, 0.2125036120414734, 0.5886082053184509, -0.5117838382720947, 1.3629640340805054, 0.47446370124816895, 0.022698579356074333, ...
def testnregisterinvalidid ( self ) : pass
[ 0.10389309376478195, 0.5336323976516724, 0.2640036940574646, 0.8116404414176941, 1.1404790878295898, 0.30750223994255066, 0.3610568642616272, 0.26171836256980896, 0.19746826589107513, -1.388304591178894, -1.9856592416763306, 0.13020244240760803, -0.766294538974762, 0.8439130783081055, 0....
def solve ( probdata, cone, * * kwargs ) : if not probdata or not cone : raise valueerror ('missing data or cone information') if'b'not in probdata or'c'not in probdata : raise valueerror ('missing one or more of b, c from data dictionary') if'a'not in probdata : raise valueerror ('missing a from data dictionary') a = ...
[ 0.44104495644569397, -0.3108821213245392, 0.9888679385185242, -0.3256399631500244, 0.004429847002029419, 0.13863122463226318, 0.4439423978328705, 0.4090425372123718, 0.02445375733077526, 0.49607643485069275, 0.16790051758289337, 0.08716485649347305, -0.2536267936229706, -0.7657857537269592...
def subpixeltranslate ( translation, im, window _ size, silent = true, debug = false, max _ scale = 100 ) : if type ( im ) is not np. ndarray : im = np. array ( image, dtype = np. uint8 ) if debug : print ( " subpixeltranslate : im. shape : ", im. shape ) test _ name = " imported " new _ im = image. fromarray ( im, mod...
[ 1.0426008701324463, -0.07123351097106934, 0.7836691737174988, 0.09062046557664871, -1.3116618394851685, 0.020437562838196754, -0.14901697635650635, 0.11998256295919418, 0.6642755270004272, 0.16298361122608185, -0.8300407528877258, 0.09000362455844879, -0.07831935584545135, 0.01590167358517...
def tables ( self ) : return self. _ tables
[ -0.22847189009189606, 0.46803903579711914, 0.39282453060150146, 0.798885703086853, -0.46208322048187256, 1.062404990196228, 1.0114951133728027, -0.37393248081207275, 0.4103633761405945, -1.3841544389724731, -0.9788013100624084, 0.38304412364959717, 0.10436376929283142, 0.29797741770744324,...
def get _ target _ actions ( self, uuid, * * kwargs ) : return self. request ( f'targets / { uuid } / actions ', * * kwargs )
[ -2.1497159004211426, -0.38816970586776733, 0.4027888774871826, 0.36605167388916016, 0.8463205695152283, -1.155124545097351, -0.4914673864841461, -0.11858530342578888, 0.1206255853176117, 0.44370606541633606, -0.10502675920724869, 1.5872118473052979, -0.09961951524019241, -0.679113686084747...
def num _ of _ inversions _ efficient ( self, array ) - > int : return self. modified _ merge _ sort ( array, 0, len ( array ) - 1 )
[ -1.2797527313232422, 1.5452296733856201, 0.5663989186286926, -0.041680604219436646, 0.10596290975809097, -0.5779697895050049, 0.7981618046760559, 0.2507166564464569, 0.21752387285232544, 0.13463616371154785, 0.044632766395807266, 0.09199343621730804, -1.1850978136062622, 0.781366765499115,...
def test _ has _ node ( gr ) : gr. add _ node ('val1') assert gr. has _ node ('val1')
[ 0.696721613407135, 1.5380958318710327, 0.4044495224952698, 0.5765619277954102, 1.1169077157974243, 0.9116405248641968, 0.07467232644557953, 0.1877720057964325, -0.441471666097641, -0.5022915005683899, 0.32000550627708435, 0.22264014184474945, 0.19591455161571503, -0.11893215775489807, -0...
def decode ( self, src _ sentence ) : self. initialize _ predictor ( src _ sentence ) self. lower _ bound = self. get _ empty _ hypo ( ) if self. use _ lower _ bound else none self. cur _ capacity = self. capacity open _ set = minmaxheap ( reserve = self. capacity ) if self. capacity > 0 else [ ] self. push ( open _ se...
[ 0.039860647171735764, 0.19015532732009888, 0.9693569540977478, 0.2320747673511505, -0.27975383400917053, -0.6384601593017578, -0.033167313784360886, 0.061674438416957855, -0.03432219475507736, 0.17897355556488037, -0.44998735189437866, -0.03464199975132942, -0.4998463988304138, 0.015867738...
def blog _ months ( * args ) : dates = blogpost. objects. published ( ). values _ list ( " publish _ date ", flat = true ) date _ dicts = [ { " date " : datetime ( d. year, d. month, 1 ) } for d in dates ] month _ dicts = [ ] for date _ dict in date _ dicts : if date _ dict not in month _ dicts : month _ dicts. append ...
[ 0.4265492260456085, 0.13028016686439514, 0.5857911705970764, 0.4606946110725403, -0.13463272154331207, 0.804190993309021, -0.1811085045337677, 0.9644958972930908, -0.7184123992919922, -0.05433444678783417, -0.6656814813613892, -0.09317870438098907, 0.28493577241897583, 0.7557140588760376, ...
def _ _ init _ _ ( self, * args, * * kwargs ) : self. user = kwargs. pop ('user') super ( reportfilter, self ). _ _ init _ _ ( * args, * * kwargs ) for fltr in self. filters. values ( ) : if'shipment'= = fltr. name : # override the options ; sort on unicode of each shipment qs = fltr. field. choices. queryset sorted _ ...
[ -0.041486598551273346, 0.5568166971206665, 0.6177178621292114, -0.328158974647522, 0.12437330186367035, 0.17694197595119476, 0.6622297167778015, -0.085874542593956, -0.05690138041973114, -0.4441455602645874, 0.25443100929260254, -0.1691737025976181, -0.1510789394378662, 0.48131316900253296...
def _ unquoteattribute ( self, value ) : value = value. replace ('& quot ; ','"'). replace ('& amp ; ','&') return value. replace ('& lt ; ','<'). replace ('& gt ; ','>')
[ -0.4443425238132477, -1.3361048698425293, 0.698514997959137, -1.9408303499221802, -1.1563057899475098, -0.5904949903488159, 0.11978188902139664, 0.22119548916816711, 0.06258443742990494, 0.7779801487922668, 0.07490567117929459, -0.08610325306653976, 0.3970544636249542, -0.13312563300132751...
def create _ tri _ mesh ( self ) : logs. log _ info ( " creating triangular mesh... " ) self. trimesh _ core _ calcs ( ) if self. single _ cell is false : self. sanity _ check ( ) # check for bad triverts ( triverts belonging to no simplexes ) # next check for triverts with really close circumcenters, and, if necessary...
[ 0.3004263937473297, 0.034299179911613464, 0.541594386100769, 0.37689724564552307, 0.643146812915802, 0.31662002205848694, 0.19240015745162964, 0.11251678317785263, 0.6921159029006958, -0.6505358219146729, -0.40285342931747437, -0.19724342226982117, -0.833406925201416, -0.012153597548604012...
def action ( self ) - > pulumi. input [ str ] : return pulumi. get ( self, " action " )
[ 0.2644207179546356, -0.24419565498828888, 0.35455384850502014, 0.18265415728092194, 1.3669078350067139, 1.5274043083190918, 0.816022515296936, 0.2852868437767029, 1.0267632007598877, 0.45418480038642883, 0.21687810122966766, 1.2375025749206543, 0.5600747466087341, -1.194536566734314, -1....
def create _ wheel _ topology ( particles ) : for p in particles [ 1 : ] : p [ 0 ]. connections. append ( p ) p. connections. append ( p [ 0 ] )
[ -0.25883594155311584, -0.6751660108566284, 0.4878557026386261, -0.8040918111801147, 1.287985920906067, 0.560542643070221, -0.6265441179275513, 0.22108279168605804, 0.07894759625196457, 0.5396087169647217, 0.030007759109139442, -0.6046521663665771, -0.4072701334953308, 0.1369294375181198, ...
def test _ shutdown _ badarg ( ) : common. shutdown ( " 5 " )
[ -0.4255588948726654, 0.34453311562538147, 0.38419097661972046, 0.6952048540115356, 0.008126710541546345, 0.6371124982833862, 0.1896655112504959, -0.31268247961997986, -0.3966616690158844, 0.7784659266471863, -0.25060930848121643, -1.100494623184204, -0.6863917112350464, 0.3844150900840759,...
def _ load ( self, database _ name ) : db = sqlite3. connect ( database _ name ) cursor = db. cursor ( ) cursor. execute ('select id from datacollections where name =? ', ( self. name, ) ) my _ id = cursor. fetchone ( ) [ 0 ] # create consistent mapping of trialid to profile index cursor. execute ('select id from trial...
[ 0.32489630579948425, 0.2774377465248108, 0.6715041399002075, -0.5070533752441406, 0.23065544664859772, 0.5149165391921997, 0.3795360028743744, -0.7687920331954956, -0.33032160997390747, -0.31047531962394714, -0.39027512073516846, -0.6131731867790222, 0.19291247427463531, 0.3219728767871856...
def upvotes ( question _ id ) : question = questions. getone _ question ( question _ id ) if question : upvote = questions ( ). upvotes ( question _ id ) return jsonify ( { " status " : 201, " data " : upvote,'message':'question upvoted'} ) return make _ response ( jsonify ( {'message':'question not found'} ), 404 )
[ 0.2526855170726776, -0.6849136352539062, 0.6929901838302612, 0.6112490892410278, 0.5026246905326843, -0.03550899773836136, -1.3538926839828491, -0.4349645972251892, 0.4281686246395111, 0.45708703994750977, -0.27072083950042725, 0.05409657210111618, 0.10389212518930435, 0.11241590976715088,...
def _ _ get _ ssh _ public _ key ( self, ssh _ key _ value = none ) : if not ssh _ key _ value : # default to root user's ssh public key ssh _ key _ value ='/ root /. ssh / id _ rsa. pub'else : # use command - line override for public ssh key if not ssh _ key _ value. startswith ('/') : if not ssh _ key _ value. starts...
[ 0.05363668501377106, 0.0030305725522339344, 0.47501546144485474, 0.39673301577568054, -0.20194664597511292, 0.7115612030029297, -0.08943583816289902, 0.3766903877258301, -1.0876307487487793, -0.3444397747516632, 0.38048604130744934, -0.05520104989409447, 0.00969383493065834, 1.165587067604...
def read _ shapefile ( sf ) : fields = [ x [ 0 ] for x in sf. fields ] [ 1 : ] print ( fields ) # records = sf. records ( ) records = [ y [ : ] for y in sf. records ( ) ] print ( records [ 0 ] ) shps = [ s. points for s in sf. shapes ( ) ] df = pd. dataframe ( columns = fields, data = records ) df = df. assign ( coords...
[ 0.5704975724220276, -0.00977884791791439, 0.41022247076034546, -0.7303531169891357, 0.04995812103152275, 0.4886176288127899, 0.3604526221752167, 0.35194119811058044, -0.43340322375297546, -0.6109492182731628, -0.13996776938438416, 0.32398921251296997, 0.3649715185165405, -0.614613473415374...
def _ observe ( self ) : return self. handeye. observe ( )
[ -0.12566395103931427, -0.6876088380813599, 0.3474089801311493, -0.6958116888999939, 0.32040756940841675, 0.02503626048564911, -0.7516078352928162, -0.7315348386764526, -0.27903738617897034, -0.2756168842315674, 0.25799888372421265, -0.39129459857940674, 0.02795293554663658, 0.1693533807992...
def common _ get _ resources ( self, data _ type = none, data _ subtype = none ) : # get each resource m _ resource = none m _ len _ urls = database. count ( data _ type, data _ type ) if m _ len _ urls < 200 : # increase as you see fit... # fast but memory consuming method m _ resource = database. get _ many ( databas...
[ -0.15647558867931366, 0.4696655869483948, 0.5375535488128662, -0.2666977345943451, 0.5618337392807007, -0.5283382534980774, -0.38513344526290894, 0.17574989795684814, -0.5820392370223999, -0.010164176113903522, 0.5958864688873291, 0.42261433601379395, -0.2138747125864029, 0.586232841014862...
def test _ consolidate _ overlapping _ fields _ and _ respect _ priority ( self ) : def mock _ get _ history _ db _ config ( db ) : if db = = " usa - stk - 1d " : return { " bar _ size " : " 1 day ", " universes " : [ " usa - stk " ], " vendor " : " ibkr ", " fields " : { " close " : " float ", " open " : " float ", " ...
[ -0.24964946508407593, 0.7050666213035583, 0.9679515957832336, 0.07294845581054688, 0.5662674903869629, 0.025646517053246498, 0.6998828649520874, -0.21876798570156097, -0.542256772518158, -0.2669747769832611, -0.0758405402302742, 0.1860845386981964, 0.09353067725896835, 0.36204782128334045,...
def clean _ document ( document ) : # remove all characters outside of alpha numeric # and some punctuation document = re. sub ('[ ^ a - za - z. - ] + ','', document ) document = document. replace ('- ','' ) document = document. replace ( '... ','' ) document = document. replace ('mr. ','mr'). replace ('mrs. ','mrs') #...
[ 0.18572655320167542, -0.931901216506958, 0.5304349064826965, -0.28368568420410156, -1.2173759937286377, 0.24094824492931366, -0.13792286813259125, 0.34108203649520874, 0.6109675168991089, 0.6558794379234314, 0.13082733750343323, -0.07490581274032593, -0.24779146909713745, 0.297457098960876...
def synth _ euler _ angles ( self, time, satellite, *, dim = none, deriv = none, extrapolate = none ) : if satellite not in self. model _ euler : string ='", " '. join ( [ * self. model _ euler. keys ( ) ] ) raise valueerror ( f'unknown satellite " { satellite } ". use'f'one of { { " { string } " } }.') coeffs = self. ...
[ -0.06330553442239761, 0.49387726187705994, 0.37996718287467957, -0.34189045429229736, -0.2887671887874603, -0.874636709690094, -0.5655820965766907, -0.40105903148651123, -0.3124012351036072, 0.5100176930427551, -0.7796568870544434, 0.2165338099002838, 0.6693092584609985, 0.1588687151670456...
def label2onehot ( labels, dim, cuda ) : batch _ size = labels. size ( 0 ) out = torch. zeros ( batch _ size, dim ) out [ np. arange ( batch _ size ), labels. long ( ) ] = 1 if cuda : out = out. to ( torch. device ('cuda') ) return out
[ -0.522504985332489, 0.24457542598247528, 0.4826449155807495, 1.1772581338882446, 0.36872169375419617, 0.32300832867622375, -0.7783938646316528, 0.15949435532093048, -0.2016158103942871, 1.050395131111145, 0.43470731377601624, 0.4014071524143219, 0.0014286886435002089, -0.4738539159297943, ...
def test _ extra _ attributes ( self ) - > none : userinfo = { " sub " : " foo ", " username " : " foo ", " phone " : " 1234567 ", } request, _ = self. start _ authorization ( userinfo ) self. get _ success ( self. handler. handle _ oidc _ callback ( request ) ) self. complete _ sso _ login. assert _ called _ once _ wi...
[ 0.07016076892614365, 0.75275057554245, 0.5750308036804199, 0.5296816825866699, -0.34445205330848694, 0.8978880047798157, 0.20650136470794678, -0.058777857571840286, 1.3358800411224365, -0.40678346157073975, -1.0047845840454102, 0.04260198399424553, 0.1574239432811737, -0.5341830849647522, ...
def create _ group ( self, organization _ id, title, description, manager _ id, access _ type, logged _ in _ user _ id, access _ token, client _ token, * * kwargs ) : kwargs ['_ return _ http _ data _ only'] = true if kwargs. get ('callback') : return self. create _ group _ with _ http _ info ( organization _ id, title...
[ -0.2744268774986267, 0.45235708355903625, 0.753226637840271, 0.24735291302204132, -0.1313658207654953, 0.7506429553031921, -0.8745072484016418, -0.7338449954986572, 0.2962387204170227, 0.12469229102134705, 0.620922863483429, 1.0943934917449951, -0.535868763923645, 0.9107614755630493, 0.4...
def get _ v ( self, state ) : v = self. critic _ network. predict _ on _ batch ( state [ np. newaxis ] ) return v
[ -0.15425686538219452, -0.3932543098926544, 0.09158778935670853, 0.11829260736703873, -0.3011051416397095, 0.10024765133857727, -0.8241249918937683, -0.7439457774162292, 0.1927715241909027, 0.3658074140548706, 0.05838444456458092, 1.3380602598190308, 0.8356258273124695, -0.7931493520736694,...
def initialize _ system ( ) : print ( " welcome to elevator simulation " ) print ( " lets set up the required details. first input maximum floor in building. " ) max _ floor = 0 while true : if max _ floor > 0 : break else : max _ floor = get _ user _ input ( " please enter number of floors for the building for which e...
[ -0.21998721361160278, 0.7281373739242554, 0.49770113825798035, 1.267670750617981, 0.2782624065876007, 0.8949972987174988, 0.4473992884159088, 0.18935851752758026, -0.536331832408905, -0.5203349590301514, -0.29154911637306213, -0.46406832337379456, -0.24416226148605347, 1.467833161354065, ...
def post ( self, request, * args, * * kwargs ) : # pylint : disable = unused - argument with translate _ praw _ exceptions ( request. user ) : serializer = commentserializer ( data = request. data, context = self. get _ serializer _ context ( ) ) serializer. is _ valid ( raise _ exception = true ) serializer. save ( ) ...
[ -0.3836407959461212, -0.24158616364002228, 0.7168131470680237, 0.5553882122039795, -0.026661720126867294, 0.2446058690547943, 0.10667513310909271, -0.33579304814338684, 0.27391499280929565, -0.37426048517227173, -0.23903700709342957, -0.7887426018714905, -0.7920799851417542, -0.46013024449...
def _ flight _ connections _ today ( self, icao : str, callback : callable ) - > list [ flightconnection ] : begin, end = self. _ days _ span _ in _ timestamps try : result = callback ( icao, begin, end ) except exception as e : _ logger. error ( str ( e ) ) result = [ ] return result
[ -1.2004024982452393, -0.27819547057151794, 0.6602620482444763, 0.10633529722690582, 0.3601028621196747, -0.33074772357940674, 0.13778932392597198, -0.7625908851623535, 0.5029361844062805, -0.06274005025625229, 0.4394587278366089, -0.8048462271690369, 0.178071528673172, 0.6151390671730042, ...
def test _ slack _ url _ nosub ( self ) : value = magtape. slack _ url _ sub ( self. slack _ def _ url ) self. assertequal ( value, self. slack _ def _ url )
[ 0.7085673213005066, 0.6965874433517456, 0.3530727028846741, -0.10456366837024689, 0.2621403634548187, 1.028689980506897, 0.218392476439476, -0.5253912806510925, -0.35175821185112, -1.5901204347610474, -0.6951180100440979, 1.1063899993896484, -0.16655029356479645, -0.3248288631439209, -0....
def seteditorname ( self, editor, newname ) : if newname : if self. filenameonly : tabname = os. path. basename ( newname ) else : tabname = e5app ( ). getobject ( " project " ). getrelativepath ( newname ) if len ( tabname ) > self. maxfilenamechars : tabname = "... { 0 } ". format ( tabname [ - self. maxfilenamechars...
[ -0.7341939806938171, -1.1965914964675903, 0.41566088795661926, 0.25701814889907837, -1.0741422176361084, -0.08308739960193634, -0.04541756957769394, 0.05622366815805435, -0.9214260578155518, 1.0826380252838135, 0.0770377442240715, -0.007036241237074137, 1.049457311630249, 0.597391247749328...
def plugin _ test ( myarg = " default " ) : klass = app _ config. opt _ string ( " plugin - example ", " class " ) if klass. startswith ( '.') : klass ='myapp. myplugins'+ klass plugin = factory ( klass + '. plugin ', myarg ) plugin. do _ it ( )
[ -0.014436553232371807, -0.5259978771209717, 0.4861627221107483, 0.7383165955543518, 0.02570497989654541, -0.22103293240070343, 0.26201435923576355, 0.22753778100013733, 0.9171719551086426, -0.6131419539451599, -0.5817968845367432, 0.9317870736122131, -0.14847251772880554, 0.243582054972648...
def connections ( self ) : log. debug ( " executing volatility connections plugin on " " { 0 } ". format ( self. memdump ) ) self. _ _ config ( ) results = [ ] command = self. plugins [ " connections " ] ( self. config ) for tcp _ object in command. calculate ( ) : new = { " offset " : hex ( int ( tcp _ object. obj _ o...
[ -0.6286753416061401, -1.212053656578064, 0.5939228534698486, -1.182755947113037, 0.7904112935066223, -0.584934413433075, -0.5902318954467773, 0.24294890463352203, -0.05638251453638077, 0.6989269256591797, -0.5898727178573608, -0.2848900258541107, -0.37037110328674316, 0.2773032784461975, ...
def apply _ operation ( self, table _ name, operation ) : if type ( table _ name )! = str : table _ name = table _ name. name if not table _ name in self. _ tables : raise valueerror ('cannot apply operation to table % s because that table does not exist'% table _ name ) # the table applies the operation self. _ schema...
[ -0.11336007714271545, 0.5584169626235962, 0.4579971134662628, 1.2287086248397827, -0.3842064440250397, -0.2480723112821579, 0.3875223994255066, 1.0631320476531982, 0.10599858313798904, 0.4676513373851776, 0.03727016970515251, -0.23247672617435455, 0.008260357193648815, -0.2695462107658386,...
def datasetloss ( self, lossfunction, features, labels ) : acc = 0 for i in range ( len ( features ) ) : " " " for each example, predict the class and compute loss " " " predicted = self. feed ( features [ i ] ) acc + = lossfunction. apply ( np. array ( labels [ i ] ). reshape ( predicted. shape ), predicted ) " " " ou...
[ -1.4023035764694214, 0.05253565311431885, 0.29487982392311096, -0.9568038582801819, -0.09104655683040619, -0.27419543266296387, 0.07565855979919434, 0.5251685380935669, -0.5448535084724426, 0.17960457503795624, 0.13744869828224182, 0.7086911201477051, 0.5642223954200745, -0.124720923602581...
def _ write _ implementation ( self, c : chr ) - > none : raise notimplementederror
[ -0.8025282025337219, -0.428757905960083, 0.44635719060897827, -0.8974533081054688, 0.38324981927871704, 0.4022025167942047, 0.7916004657745361, 0.45044732093811035, -0.2962573170661926, 0.6018072366714478, -0.8765648007392883, -0.3379179835319519, 0.6027870774269104, 0.672292947769165, 0...
def insertnode ( self, node ) : if self. root = = none : self. root = node node. depth = 0 elif self. mode = = none : # todo : this would ideally be set elsewhere self. mode = node self. nodetable [ node. rowid ] = node if node. parentid in self. nodetable : self. nodetable [ node. parentid ]. addchild ( node ) node. d...
[ -0.7408788204193115, 1.2659714221954346, 0.566376805305481, -0.1859031319618225, 0.1698673516511917, 0.3706962466239929, 0.7813675999641418, 0.7516851425170898, -0.21467824280261993, -0.10209264606237411, -0.7117758989334106, -0.32131922245025635, -0.8556378483772278, 0.9325898289680481, ...
def get _ value ( self, sess, states ) : return sess. run ( self. values, { self. states _ ph : states } ) [ 0, 0 ]
[ -0.6381065845489502, 0.157516211271286, 0.19185864925384521, 0.6918433308601379, 0.5615807771682739, -0.49834737181663513, -0.534759521484375, -0.3591226637363434, 0.08582404255867004, -0.5498145222663879, 0.47068697214126587, -0.07822278141975403, 0.25394096970558167, -0.00591984856873750...
def reviews ( self ) : dict _ revs = models. storage. all ( review ) list _ revs = [ ] for value in dict _ revs. values ( ) : if value [ id ] = = self. id : list _ revs. append ( value ) return list _ revs
[ -0.4592309296131134, -0.7621025443077087, 0.2979409992694855, 0.1744508147239685, 0.5511227250099182, 0.0251493938267231, -2.036040782928467, 1.0637397766113281, 0.40539464354515076, 0.2703630030155182, -0.3105813264846802, -0.006240978371351957, 0.03277650848031044, 0.29309284687042236, ...
def call ( self ) : self. thread _ used = threading. currentthread ( ). getname ( ) self. started = time. time ( ) try : datautils. freewaymigratemulti ( self. con, self. targets, self. query, self. table, self. batchsize, self. truncate ) print ( " completed " ) except exception as ex : self. exception = ex self. comp...
[ -0.5555928945541382, 0.7325583100318909, 0.6399886012077332, 0.5651695728302002, 0.4896550476551056, -0.4065588116645813, -0.9252459406852722, -0.3105744421482086, -0.3344697952270508, 0.09479016810655594, -0.6255739331245422, -0.3854811489582062, -1.1531959772109985, 0.564032256603241, ...
def save _ checkpoint ( checkpoints _ dir, model _ name, model, epoch, epochs _ since _ last _ improvement, encoder _ optimizer, decoder _ optimizer, generation _ metric _ score, is _ best, * * kwargs ) : state = { " model _ name " : model _ name, " epoch " : epoch, " epochs _ since _ improvement " : epochs _ since _ l...
[ -0.040775399655103683, 0.21547198295593262, 0.7299516201019287, 0.32307806611061096, 0.4776221811771393, 0.32130134105682373, 0.048709411174058914, -0.045708317309617996, -0.6075566411018372, 0.3430893123149872, -1.0193365812301636, -0.4035949110984802, 0.8489774465560913, -0.1120651885867...
def write _ call _ variants ( predictions : np. ndarray, variant _ alt _ allele _ dataset : tf. data. dataset, output _ file : str ) : writer = tfrecord. writer ( output _ file ) with writer : prediction _ idx = 0 for idx, batch in variant _ alt _ allele _ dataset. enumerate ( ) : if prediction _ idx > = len ( predicti...
[ -0.15302836894989014, -0.543613612651825, 0.41641154885292053, 0.26129183173179626, 0.00005892139597563073, 0.6280559301376343, 0.15937279164791107, 0.25693660974502563, -1.0557291507720947, 0.7265215516090393, 0.19083426892757416, 0.6329131722450256, 0.7163382768630981, 0.1249599009752273...
def test _ can _ get _ driver ( self ) : api _ call ( self, " post ",'/ driver / create ', dict ( first _ name = " bill ", middle _ name = " john ", last _ name = " gates ", dob = " 11 / 05 / 1950 " ), 200 ) json _ response = api _ call ( self, " get ",'/ driver / get ', dict ( id = 1 ), 200, true ) self. assertequal (...
[ -0.34415403008461, -0.43917807936668396, 0.6243530511856079, 0.3241758644580841, 0.7469923496246338, 0.24718132615089417, -0.7581342458724976, 0.21662898361682892, -0.22291933000087738, -0.5230770111083984, -0.572837769985199, 0.05120234191417694, -0.7777787446975708, 0.3947766423225403, ...
def read _ automata _ from _ file ( ) : states, alphabet, transitions, final _ states = [ ], [ ], [ ], [ ] with open ( " automata ", " r " ) as f : states = f. readline ( ). split ( ) alphabet = f. readline ( ). split ( ) final _ states = f. readline ( ). split ( ) initial _ state = f. readline ( ) transitions = proces...
[ 0.10550025850534439, -0.8115283846855164, 0.6286659836769104, -0.7132486701011658, -0.14884455502033234, -0.07849004864692688, 0.12305477261543274, 0.5042851567268372, -1.1833381652832031, 0.3868214190006256, -0.5759762525558472, 0.23985262215137482, 0.27614226937294006, -0.277606010437011...
def process _ message ( self, connector, host, secret _ key, resource, parameters ) : # setup to default value self. dataset _ metadata = none self. terraref _ metadata = none self. experiment _ metadata = none try : # find the meta data for the dataset and other files of interest dataset _ file = none experiment _ fil...
[ 0.23443864285945892, -0.13891325891017914, 0.6041325330734253, -0.6176080703735352, 0.7798094749450684, -0.3506394922733307, -0.3424142003059387, 0.08103299885988235, -0.8423168659210205, -0.14379745721817017, 1.0432193279266357, 0.5610774755477905, 0.15510344505310059, 0.6967666149139404,...
def full _ adder ( idx, a, b, c ) : # calculation of sum a xor b xor c chrom = [ [ a, b, gene _ translation. index ( " xor " ) ] ] tmp _ ab = idx ; idx + = 1 chrom + = [ [ tmp _ ab, c, gene _ translation. index ( " xor " ) ] ] s = idx ; idx + = 1 # calculation of carry ( ( a xor b ) and c ) or ( a and b ) chrom + = [ [...
[ 0.08912907540798187, -0.21861305832862854, 0.7298657894134521, -0.45549166202545166, -0.12127849459648132, -0.2332875281572342, -0.32142725586891174, -0.3186725676059723, -0.04263861104846001, 0.9448206424713135, -0.5505069494247437, -0.13569344580173492, -0.10265733301639557, -0.941352128...
def _ isresourcereferenced ( resource ) : # all references create backreferences named * _ set, except containers, # which have no backreference ( due to circular dependency issues ). for property _ name in dir ( resource ) : if ( property _ name. endswith ('_ set') and getattr ( resource, property _ name ). get ( ) ) ...
[ -0.537276566028595, -0.37268856167793274, 0.5852569937705994, -1.1995035409927368, -0.15399472415447235, -0.5431145429611206, 0.7800595164299011, -0.9965207576751709, -0.2366795539855957, -0.019757870584726334, 0.3776017427444458, -0.09298791736364365, 0.5298953056335449, 0.494359940290451...
def pop ( self ) : self. swap ( self. root _ index ( ), self. length - 1 ) root = self. array. pop ( ) self. heapify ( self. root _ index ( ) ) return root
[ 0.4220693111419678, -0.243825301527977, 0.6522597670555115, -0.36472439765930176, -0.6317586302757263, -0.16371174156665802, 0.17875325679779053, -0.017545195296406746, 0.3783698081970215, 0.9697575569152832, 0.10922219604253769, 0.9089385867118835, -1.157744288444519, 0.1022036075592041, ...
def path ( self ) : return self. _ path
[ -0.021836400032043457, -0.856448769569397, 0.059565093368291855, 0.10778100043535233, -0.09138956665992737, 1.3597028255462646, 1.7586413621902466, -0.08601658791303635, 0.40932369232177734, -1.1676945686340332, 0.6269177794456482, -0.19238899648189545, -0.3826705813407898, -0.739530384540...
async def remove _ service _ from _ observation ( self, node _ uuid : nodeid ) - > none : async with self. _ lock : if node _ uuid not in self. _ inverse _ search _ mapping : raise dynamicsidecarnotfounderror ( node _ uuid ) service _ name = self. _ inverse _ search _ mapping [ node _ uuid ] if service _ name not in se...
[ -1.0491442680358887, 0.19823351502418518, 0.452382355928421, -0.4038797914981842, -0.31748467683792114, -0.32584089040756226, 0.1342717707157135, -0.13542450964450836, -0.838614821434021, 0.4463636577129364, 0.4425143301486969, 0.707632839679718, -0.640307605266571, -0.03459375724196434, ...
def getfeaturestate ( self, featuretag ) : return self. _ featureapplicationstates [ featuretag ]
[ -0.361812561750412, -1.0115071535110474, 0.13858139514923096, 0.6922950744628906, -0.4138435423374176, -0.3119765818119049, 0.010650224052369595, -0.36102840304374695, 0.3606172800064087, -0.47376835346221924, 0.07284323126077652, 0.01732584647834301, -0.2795601785182953, 0.730550527572631...
def clear _ routes ( self, context, resource _ data ) : self. _ send _ event ( context, resource _ data, gen _ cfg _ const. event _ clear _ routes )
[ -0.2735634446144104, 0.5714669823646545, 0.31066763401031494, -0.18506452441215515, 0.1649933010339737, -0.027210436761379242, -0.09136775881052017, -0.36425507068634033, -0.0049605718813836575, 0.8360518217086792, -0.3036563992500305, 1.1471941471099854, 0.5336161255836487, -0.07519519329...
def update _ internal _ maps ( self ) - > none : self. _ node _ id _ map = { } self. _ edge _ id _ map = { } self. _ label _ to _ id = { } self. _ id _ to _ label = { } for i, node in enumerate ( self. nodes ) : self. _ node _ id _ map [ node. get _ id ( ) ] = i if node. get _ type ( ) = = " hallway " : continue # we d...
[ -1.2396646738052368, -1.0037022829055786, 0.6730594038963318, -1.3500103950500488, 0.020607605576515198, 0.664405882358551, 0.36125656962394714, -0.4959831237792969, -0.04040339216589928, 0.3589102327823639, -0.08000759780406952, 0.4695422053337097, -0.11582966148853302, -0.267613410949707...
def generate _ certificate ( self, name, *, ca _ cert, ca _ key, cn, groups = none, hosts = none ) : if groups is none : groups = [ ] if hosts is none : hosts = [ ] result = self. _ cfssl ( ['gencert ','- ca ','ca. pem ','- ca - key ','ca - key. pem ','- config ','ca - config. json ','csr. json'], files = {'ca - config...
[ -0.5220116972923279, 0.5575272440910339, 0.542174220085144, 0.7195602655410767, -0.6739288568496704, 0.45231980085372925, -0.8706632852554321, 0.10085748136043549, -0.4035744071006775, 0.13502709567546844, -0.7877492308616638, -1.0167272090911865, 0.18342845141887665, 0.8331574201583862, ...
def get _ graph ( self, name ) : name = utils. sanitize ( name ) if not self. exists ( name ) : raise runtimeerror ( " rrd by name % s not found " % name ) if name not in self. rrds : self. rrds [ name ] = rrdfile ( name ) return self. rrds [ name ]
[ 0.20055294036865234, 0.45234328508377075, 0.5757175087928772, -1.0878944396972656, -0.4973514974117279, -0.2284468412399292, -0.09792427718639374, -0.9919772148132324, -0.021845240145921707, 0.403672993183136, 0.18049298226833344, 0.8755375742912292, -0.8262604475021362, -0.780432641506195...
def unbatchify ( data, max _ size = 1000 ) : images = [ ] labels = [ ] for i, ( image, label ) in enumerate ( data. unbatch ( ). as _ numpy _ iterator ( ) ) : images. append ( image. astype ( int ) ) labels. append ( label. astype ( int ) ) if i + 2 > max _ size : break return np. array ( images ), np. array ( labels )...
[ -1.0561552047729492, -0.43129298090934753, 0.604087233543396, -0.553035318851471, -0.6534131169319153, -0.6427947282791138, -0.4613765776157379, 0.2354924976825714, -0.1271422803401947, 0.7196506261825562, -0.42861437797546387, 0.2495177537202835, 0.14865896105766296, 0.31681951880455017, ...
def interceptor ( func ) : def classwrapper ( cls ) : def wrapper ( old ) : def inner ( self, transforms, * args, * * kwargs ) : print'invoking wrapper % s ', func ret = func ( self, transforms, * args, * * kwargs ) if ret : return old ( self, transforms, * args, * * kwargs ) else : self. _ transforms = transforms retu...
[ -0.838762640953064, -0.39878860116004944, 0.8176906704902649, -0.9639685750007629, -0.7111824154853821, -0.11328856647014618, 0.13368944823741913, 0.3346337378025055, 1.0204094648361206, -0.5395007133483887, 0.3312669098377228, -0.032427333295345306, 0.25273579359054565, -0.202350765466690...
def iter _ rules ( self ) : self. added _ package _ ids = set ( ) # this attaches the job requirement to the created rule. we need # to run it first because duplicated rules are ignored. otherwise, # we'll end up keeping the rule instance that doesn't know it should be # associated with a job. self. _ add _ job _ rules...
[ 0.2762643098831177, -0.06769391149282455, 0.2507952153682709, -0.6646825671195984, 1.3594409227371216, 0.7250608801841736, 0.27339425683021545, -0.16016227006912231, -0.3060542345046997, -0.29315119981765747, 0.8364949226379395, 0.11571832746267319, -0.3067224621772766, 0.8098061084747314,...
def save _ arbor ( arbor, filename = none, fields = none, trees = none, max _ file _ size = 524288 ) : if isinstance ( trees, types. generatortype ) : trees = list ( trees ) arbor. _ plant _ trees ( ) update, filename = determine _ save _ state ( arbor, filename, fields, trees ) filename = determine _ output _ filename...
[ -0.26265010237693787, -0.32470056414604187, 0.6842026710510254, 0.706839919090271, -0.329302579164505, -0.33679455518722534, 1.1933590173721313, -0.4090602695941925, -0.6295676231384277, -0.19340820610523224, -0.34717822074890137, -0.0006344048888422549, -0.2929852306842804, -0.15118908882...
def hex _ to _ rgba ( color ) : return tuple ( bytes. fromhex ( color. strip ( " # " ) ) )
[ -0.4248203635215759, -0.12641970813274384, 0.5618855953216553, -1.1562707424163818, 0.7759897112846375, -0.10891755670309067, -0.9793977737426758, 0.025645870715379715, -0.609507143497467, 0.5378974080085754, -0.9184320569038391, -0.3335421085357666, -0.18705131113529205, 0.721550703048706...
def reconstruct ( self, x ) : prev _ z = tf. zeros ( [ self. batch _ size, self. network _ architecture ['n _ z'] ] ) reconstruction = [ ] for time _ step in range ( self. n _ time _ steps ) : current _ frame = tf. slice ( x, [ 0, time _ step, 0 ], [ self. batch _ size, 1, self. network _ architecture [ " n _ input " ]...
[ -1.0542495250701904, 0.17593450844287872, 0.7155221700668335, 0.36222362518310547, -0.48639291524887085, -0.288933664560318, 0.3981340825557709, 0.17415058612823486, 0.06381721794605255, 0.5342501997947693, -0.8172780275344849, -0.07056840509176254, 0.31241467595100403, 0.251485675573349, ...
def reversemove ( self, movable _ statement ) : pred = movable _ statement. predicate sl = movable _ statement. terms newlist = [ pred, sl [ 0 ], sl [ 3 ], sl [ 4 ], sl [ 1 ], sl [ 2 ] ] self. makemove ( statement ( newlist ) )
[ -0.2949703633785248, -0.2423490583896637, 0.4907303750514984, -0.04605010896921158, -0.3851422071456909, -0.24856694042682648, -0.38890865445137024, 1.3246996402740479, -0.7516319155693054, 0.707792341709137, -0.6820507645606995, 0.4264811873435974, -0.23381009697914124, -0.504785060882568...
def _ module _ hash ( module = none ) - > str : if module is none : module = pywikibot. calledmodulename ( ) module = module. encode ( ) hashobj = blake2b ( module, digest _ size = 2 ) return hashobj. hexdigest ( )
[ 0.12243638932704926, -0.19851303100585938, 0.3443385362625122, -0.021170055493712425, -0.11454391479492188, 0.7964641451835632, -0.5693002343177795, -0.13884426653385162, 0.28814035654067993, 0.02932894043624401, -0.3308425545692444, 0.9057543873786926, -0.33993542194366455, 0.302493631839...
def _ _ init _ _ ( self, charm _ le, charm _ te, toc, vsp _ wing _ origin, vsp _ origin _ 2 _ wing _ origin : transmatrix, span, airfoils, geom _ id, num _ syms, flip _ rotation _ direction ) : self. charm _ le = charm _ le self. charm _ te = charm _ te self. vsp _ wing _ origin = vsp _ wing _ origin self. vsp _ origin...
[ 0.51402747631073, 0.022640997543931007, 0.41034895181655884, -0.5271120667457581, -0.061459969729185104, 0.696541428565979, -0.07448352873325348, 0.25913509726524353, -0.07587608695030212, -0.30349236726760864, -0.3442014455795288, 0.7215564250946045, 0.5308282971382141, 0.0083119412884116...
def test _ organisation ( self ) : testresult = { } testresult = dataparser _ map. advancesearch ( " 3 ", " _ id ", " 118 " ) # print ( testresult ) self. assertequal ( testresult [ 0 ] [ " _ id " ], 118, " org id not found " ) testresult = dataparser _ map. advancesearch ( " 3 ", " _ id ", " 999 " ) # print ( testresu...
[ -0.5775339007377625, 0.06253458559513092, 0.6371413469314575, -0.5016602277755737, 0.43403196334838867, 0.5508871078491211, -0.15397435426712036, 0.096742644906044, -0.9423205256462097, -0.5818439722061157, -0.8298962116241455, -0.5761989951133728, -0.2463824301958084, -0.2649351954460144,...
def run _ xcs _ full ( x _ train, y _ train, x _ test, y _ test, randseed, i, param _ grid, n _ trials, timeout, do _ plot, full _ path, use _ uniform _ fi, primary _ metric ) : # check whether hyperparameters are fixed ( i. e. no hyperparameter sweep required ) or whether a set / range of values were specified for any...
[ 0.27696216106414795, 0.6491503715515137, 1.0471757650375366, 0.8150566816329956, -0.04768313840031624, 0.16190987825393677, 0.3674817979335785, 0.26297882199287415, -0.48082590103149414, 0.06649325788021088, 0.011616278439760208, 0.8151282072067261, 0.3865433931350708, 0.1867551952600479, ...
def crout ( a : np. ndarray ) : n = np. shape ( a ) [ 0 ] u = np. identity ( n ) l = np. zeros ( ( n, n ) ) for i in range ( n ) : l [ i, i ] = ( a [ i, i ] - np. sum ( l [ i, : ] * u [ :, i ] ) ) / u [ i, i ] for j in range ( i, n ) : u [ i, j ] = ( a [ i, j ] - np. sum ( l [ i, range ( i ) ] * u [ range ( i ), j ] ) ...
[ 1.0387541055679321, 0.28464484214782715, 0.5937379598617554, -0.7033118605613708, -0.25476157665252686, -0.2737071216106415, 1.797479271888733, 0.985508918762207, 1.2368204593658447, 0.8112910985946655, 0.21105100214481354, -0.19410549104213715, 0.4328329563140869, 0.4721330404281616, 0....
def add _ gate _ params ( gate, gate _ name ) : return ( self. add _ param ( gate. w _ in, ( num _ inputs, num _ units ), name = " w _ in _ to _ { } ". format ( gate _ name ) ), self. add _ param ( gate. w _ hid, ( num _ units, num _ units ), name = " w _ hid _ to _ { } ". format ( gate _ name ) ), self. add _ param ( ...
[ -0.17037557065486908, 0.24266678094863892, 0.6200531125068665, 0.006693228613585234, 0.554045557975769, 0.28157493472099304, -0.3822210133075714, -0.29175832867622375, -0.6792827844619751, 0.8625535368919373, -0.048982780426740646, 0.48537778854370117, -1.1066861152648926, 1.70491707324981...
def _ custom _ dtype _ getter ( self, getter, name, shape = none, dtype = default _ dtype, * args, * * kwargs ) : if dtype in castable _ types : var = getter ( name, shape, tf. float32, * args, * * kwargs ) return tf. cast ( var, dtype = dtype, name = name +'_ cast') else : return getter ( name, shape, dtype, * args, *...
[ -0.5466006994247437, 0.4934689402580261, 0.3288484513759613, -0.4270532727241516, -0.7966940402984619, -1.0311788320541382, -0.4770682752132416, -0.9675971865653992, -0.3493041694164276, 0.6720613241195679, 0.041689276695251465, 0.7292215824127197, 0.48985129594802856, 0.39198991656303406,...
def _ create _ columns _ option ( self ) : js = [ self. _ coloption _ 2 _ str ( key, value ) for key, value in self. datatable _ columns. items ( ) ] return'[ { 0 } ] '. format ( ', \ n '. join ( js ) )
[ -0.653091549873352, -0.47151848673820496, 0.34050288796424866, -0.9835100173950195, 0.9584325551986694, -0.5348130464553833, -0.5328670144081116, -1.0299232006072998, -0.9064530730247498, 0.6774888038635254, -0.2519768178462982, 0.18561990559101105, 1.162079930305481, -0.36373645067214966,...
def test _ vasp _ calc _ only _ output ( run _ vasp _ process, aiida _ caplog ) : from aiida _ vasp. calcs. vasp import vaspcalculation _, node = run _ vasp _ process ( test _ case ='stdout') assert node. exit _ status = = 352 vasp _ output = node. outputs. retrieved. get _ object _ content ('vasp _ output') assert'moc...
[ 0.7613487839698792, -0.13224747776985168, 0.3274683654308319, 0.6580471396446228, -0.20759207010269165, 0.39140817523002625, 0.619458794593811, -0.3131415843963623, 0.821691632270813, 0.12304199486970901, 0.5892624855041504, -0.5202270150184631, 0.1563130021095276, 0.12736085057258606, 0...
def uct ( rootstate, itermax, verbose = false ) : rootnode = node ( state = rootstate ) for i in range ( itermax ) : node = rootnode state = rootstate. clone ( ) # select while node. untriedmoves = = [ ] and node. childnodes! = [ ] : # node is fully expanded and non - terminal node = node. uctselectchild ( ) state. dom...
[ -0.20006367564201355, 0.12253529578447342, 1.0412523746490479, -0.10290674865245819, -0.8207278251647949, -0.6149497032165527, 0.6302290558815002, -0.1846308410167694, 0.313029944896698, 0.3536064922809601, 0.6045783162117004, 0.4596860110759735, -0.2633879482746124, -0.4529862105846405, ...
def set _ filetype ( self, file _ path ) : file _ name = file _ path. split ( " / " ) [ - 1 ] file _ contents = " ". join ( self. files [ file _ path ] ) try : file _ type = guess _ lexer _ for _ filename ( file _ name, file _ contents ). name self. nvim. command ( f " set filetype = { file _ type } ", async _ = true )...
[ 0.1720123291015625, -0.8417442440986633, 0.5583013892173767, 0.6157255172729492, 1.0421432256698608, -0.5249181985855103, 0.0914827287197113, -0.27076202630996704, -0.8899602293968201, 0.2850211560726166, -0.007638741284608841, 0.4225573241710663, -0.14000287652015686, 0.8080899119377136, ...
def parsefile ( self, file _ entry, file _ object ) : # todo : move to defusedxml for safer xml parsing. try : xml = elementtree. parse ( file _ object ) except elementtree. parseerror : raise errors. preprocessfail ( u'file is not a xml file.') except ioerror : raise errors. preprocessfail ( u'file is not a xml file.'...
[ -0.004212042782455683, -0.5425746440887451, 0.3556774854660034, 0.32849013805389404, -0.30078548192977905, -0.010106978937983513, -0.4753088653087616, 0.28278717398643494, -0.46994590759277344, 0.7084590792655945, -0.43903958797454834, -0.5121569037437439, -0.22957925498485565, -0.14550504...
def testeventsdiscardedpertagafterrestartforfileversionlessthan2 ( self ) : warnings = [ ] self. stubs. set ( logger, " warning ", warnings. append ) gen = _ eventgenerator ( self ) acc = self. _ make _ accumulator ( gen ) gen. addevent ( event _ pb2. event ( wall _ time = 0, step = 0, file _ version = " brain. event :...
[ 0.751612663269043, -0.3616105616092682, 0.7100018858909607, -0.06858881562948227, -0.052577514201402664, 0.14579004049301147, 0.9914757609367371, -0.2569931447505951, -0.1978427916765213, -0.3830344080924988, -0.8191543817520142, 0.09587052464485168, 0.2892895042896271, 0.05646537989377975...
def evaluate ( self, test _ data : sequence ) - > int : results = [ ( np. argmax ( self. feed _ forward ( x ) ), y ) for ( x, y ) in test _ data ] return sum ( int ( x = = y ) for ( x, y ) in results )
[ -0.21247367560863495, -0.2835962176322937, 0.3865838646888733, -0.36004480719566345, 0.413228839635849, -0.7979548573493958, 0.03898308053612709, -0.045811306685209274, 0.16704346239566803, -0.3860412836074829, -0.28192374110221863, 0.018011512234807014, -0.5663724541664124, 0.214675337076...
def angle _ finder ( num _ start _ points, circumference, filament _ width ) : # caution, this script uses angles in radians theta = math. atan ( num _ start _ points * filament _ width / circumference ) return theta
[ 0.2708090841770172, -0.7959702610969543, 0.039965372532606125, -0.6989099979400635, -0.025597093626856804, -0.2641795873641968, 1.18297278881073, 0.9079052209854126, -0.005303795449435711, 1.0979701280593872, 0.4472508132457733, 0.4489978551864624, -0.21841667592525482, -0.4119697213172912...
def even _ odd _ count ( num ) : # please print out which line of the above program contains an error. e. g. if the bug is on line 4 then print 4 # end of context print ( " 8 " ) # end of solution
[ 0.1473018229007721, -0.731228232383728, 0.6430061459541321, 0.2983490228652954, 0.4209911525249481, 0.38002488017082214, 1.2786297798156738, 0.01078678760677576, 0.5016850233078003, -0.40387463569641113, 0.019214492291212082, 0.1311464160680771, 0.10400893539190292, 0.4104234278202057, -...
def test _ get _ user _ projects ( self ) : self. assertsetequal ( set ( self. user1. get _ user _ projects ( ) ), { self. project1 } )
[ 0.4091738164424896, 0.7378629446029663, 0.20484668016433716, 1.1740241050720215, 0.3508736789226532, 1.3217657804489136, 0.2406332939863205, -0.6518267393112183, -0.0374651700258255, -0.3245554268360138, -0.40618830919265747, 0.13752241432666779, -0.23059016466140747, -1.0332554578781128, ...
def settable ( self, maze ) : rack = [ ] for line in maze : list _ line = [ ] for caractere in line : list _ line. append ( caractere ) rack. append ( list _ line ) return rack
[ 0.032078225165605545, -0.4000326991081238, 0.29767459630966187, -0.2883875370025635, 0.132407084107399, -0.39505428075790405, -0.15679430961608887, 0.49623119831085205, -1.5017622709274292, 0.8692163228988647, -0.6318383812904358, 0.032557230442762375, -0.6041199564933777, 0.82441586256027...
def load ( self, dc : datacube, * * query : dict [ str, any ] ) - > xarray. dataset : datasets = self. query ( dc, * * query ) grouped = self. group ( datasets, * * query ) return self. fetch ( grouped, * * query )
[ -0.42030397057533264, 0.8043724894523621, 0.3571922481060028, -0.7168179750442505, -0.7979699969291687, -0.3043934106826782, -0.5312137603759766, -0.44831350445747375, 0.02510569430887699, -0.9102742671966553, 0.961883008480072, 0.5681442618370056, -0.8383153080940247, -0.3096180558204651,...
def get _ bucket _ objects ( self, bucket _ name : str ) - > dict : return self. objectdata. get _ bucket _ objects ( bucket _ name )
[ -1.1104342937469482, -0.4053686857223511, 0.5083675384521484, 0.04117082804441452, -0.34184104204177856, 0.0932210385799408, 0.022739529609680176, -0.6312157511711121, -0.7499263882637024, -0.32782164216041565, -1.5314617156982422, 0.32759761810302734, 0.3942727744579315, -0.23577642440795...
def test _ update _ event _ booking _ to _ paid ( self ) : event = baker. make _ recipe ('booking. future _ ev ', cost = 10 ) booking = baker. make _ recipe ('booking. booking ', user = self. user, event = event, paid = false ) baker. make _ recipe ('booking. block ', block _ type _ _ event _ type = event. event _ type...
[ 0.421054869890213, 0.16562430560588837, 0.6721805334091187, 1.3183207511901855, -0.6983737349510193, 0.7721025347709656, -0.10661773383617401, 0.8247934579849243, -0.06086217984557152, 0.42669677734375, -0.46013343334198, -0.5232764482498169, -0.031733252108097076, 0.4742780327796936, 0....
def exists ( self ) : return os. path. exists ( self. _ path )
[ -0.5703723430633545, -0.8602855205535889, 0.2799139618873596, -0.8148218989372253, 1.4019911289215088, 0.532736599445343, -0.13729123771190643, 0.6127498149871826, -0.675765872001648, -0.9501321315765381, 0.3905481696128845, -0.44885146617889404, 0.25236833095550537, -0.3262704610824585, ...
def bri ( id, value ) : return put _ state ( id, { " bri " : value } )
[ -0.01243909914046526, 0.36027443408966064, 0.16594620048999786, 0.40332984924316406, 0.07490302622318268, 0.32225531339645386, -0.6532275676727295, -0.26856669783592224, -0.000538191816303879, 0.3261181712150574, -1.6108500957489014, 0.33994004130363464, -0.8590307831764221, -0.78537589311...
def test _ installreactormultipleplugins ( self ) : installed = [ ] def install ( ) : installed. append ( true ) name ='fakereactortest'package = _ _ name _ _ description ='description'fakereactor = fakereactor ( install, name, package, description ) otherreactor = fakereactor ( lambda : none, " otherreactor ", package...
[ -0.313331663608551, -0.3645421862602234, 0.49255138635635376, -0.445272296667099, 1.930830955505371, -0.9846022129058838, -0.4515273869037628, 0.2859628200531006, 0.3905206322669983, 0.42105209827423096, -1.982670783996582, -0.5721001029014587, -0.8157885074615479, -0.11575352400541306, ...
def attr _ order ( self ) : return self. _ params
[ -1.0063729286193848, -1.12543523311615, 0.25688961148262024, 0.35074374079704285, 0.27449655532836914, 0.028878388926386833, -0.05005199462175369, -0.16408297419548035, -0.7571098208427429, 0.11325442045927048, -0.45084279775619507, 0.5175286531448364, 0.7217562794685364, 1.045417666435241...
def parse _ dpkg ( ) : packages = [ ] output = run _ command ('dpkg - l') p = re. compile ('\ s +') for line in output. split ('\ n') : fields = p. split ( line ) if ( len ( fields ) > = 4 ) : status = fields [ 0 ] if ( status = ='ii') : name = fields [ 1 ] version = fields [ 2 ] arch = fields [ 3 ] desc = " ". join ( ...
[ -0.9855835437774658, 0.8659924268722534, 0.7122330665588379, -0.2671225070953369, -0.5162015557289124, -0.477895051240921, -0.9322411417961121, 0.3279578685760498, -0.363614022731781, -0.03645617514848709, -1.5379565954208374, -0.8270781636238098, 0.12575247883796692, 0.5181905031204224, ...
def gameoflife ( self, board : list [ list [ int ] ] ) - > none : m, n = len ( board ), len ( board [ 0 ] ) dires = [ ( - 1, - 1 ), ( 0, - 1 ), ( 1, - 1 ), ( - 1, 0 ), ( 1, 0 ), ( - 1, 1 ), ( 0, 1 ), ( 1, 1 ) ] fina = [ ] def dfs ( i, j, cell _ 0, cell _ 1 ) : for dir in dires : if i + dir [ 0 ] in range ( 0, m ) and j...
[ -0.42302143573760986, 0.613579511642456, 1.0077663660049438, 0.7065944671630859, -0.30994096398353577, -0.45905032753944397, 0.4703470766544342, 0.2983461916446686, 0.3035832643508911, 0.36800655722618103, -0.03807837516069412, -1.2160885334014893, -0.4095965027809143, 0.21841616928577423,...
def process _ variants ( variant _ titles : list [ dict [ str, any ] ], variant _ type : str, report _ on _ match : bool ) - > none : variants : list [ datnode ] = [ ] for variant _ title in variant _ titles : if'searchterm'not in variant _ title : printwrap ( f'{ font. warning } * the following variants entry is missi...
[ -0.197591632604599, -0.0946531742811203, 0.6969999670982361, -0.3204227685928345, -0.49711257219314575, -0.20305924117565155, -0.0649142861366272, -0.5740009546279907, -0.4983316957950592, 0.8345298767089844, 0.240578293800354, 0.5583043694496155, -0.05070469528436661, -0.06390144675970078...
def stop _ continuous _ prices ( self ) : self. is _ continuous = false
[ -0.12223205715417862, -0.44813403487205505, 0.5327426195144653, 0.6041746735572815, 0.5907624959945679, 1.967872142791748, 0.35718053579330444, 0.18610170483589172, -1.3771631717681885, 1.0907589197158813, -0.3792187571525574, 0.07918127626180649, -0.7826063632965088, -0.6180208921432495, ...