text
stringlengths
25
2.19k
embedding
listlengths
768
768
def periodic _ distance ( x, y, z, x2, y2, z2, sidehx, sidehy, sidehz, bs ) : dx = x2 - x dy = y2 - y dz = z2 - z if ( dx < - sidehx ) : dx = dx + bs [ 0 ] if ( dx > sidehx ) : dx = dx - bs [ 0 ] if ( dy < - sidehy ) : dy = dy + bs [ 1 ] if ( dy > sidehy ) : dy = dy - bs [ 1 ] if ( dz < - sidehz ) : dz = dz + bs [ 2 ] ...
[ 0.301219642162323, -0.8832469582557678, 0.6660703420639038, -0.0046303765848279, -0.4377828538417816, 0.3893389105796814, -0.7891926765441895, -0.019442647695541382, -0.2784499526023865, -0.38975790143013, -0.29341089725494385, -0.14193488657474518, -0.4328022301197052, 0.03301811963319778...
def apriori ( data, min _ support ) : print " running apriori algorithm on { } elements ". format ( len ( data ) ) # get the initial data set candidate _ count = 1 freq _ 1 _ items = set ( ) curr _ candidate = set ( ) # # # # need to prune the dataset # use set. update, not set. union for sub in data : freq _ 1 _ items...
[ -0.22518499195575714, -0.7852340340614319, 0.7341427206993103, 0.6012336611747742, -0.6506209969520569, -0.12618863582611084, -0.2466423213481903, 0.4725722670555115, 0.3108665645122528, -0.42254629731178284, -0.28645408153533936, 0.04399462789297104, -1.1010020971298218, -0.58999294042587...
def download _ level _ files ( self ) - > none : try : os. mkdir ( os. path. join ( self. dataset, " levels " ) ) except fileexistserror : pass for levelinfo in self. levels. values ( ) : atlas _ id = levelinfo [ " atlas _ id " ] if not atlas _ id : continue self. download _ atlas _ level ( atlas _ id )
[ 0.3634571433067322, -0.6599951386451721, 0.35840699076652527, 0.3727271258831024, 1.1568446159362793, 1.0051237344741821, -0.022840900346636772, -0.36388808488845825, -0.5448103547096252, -0.7211415767669678, -0.23681305348873138, -0.7017940282821655, -0.05607936158776283, 0.82840752601623...
def download _ url ( url, root, filename = none, md5 = none ) : from six. moves import urllib root = os. path. expanduser ( root ) if not filename : filename = os. path. basename ( url ) fpath = os. path. join ( root, filename ) makedir _ exist _ ok ( root ) # downloads file if check _ integrity ( fpath, md5 ) : print ...
[ 0.18094122409820557, 0.27410897612571716, 0.5864623188972473, 1.649254560470581, 0.1016804575920105, 0.7709278464317322, 0.7609990835189819, 0.2917991578578949, -0.1860903650522232, -0.5791754126548767, 0.20788945257663727, -0.42290401458740234, -0.1413974165916443, 0.6344254612922668, -...
def create _ folder _ inside _ img _ if _ not _ exists ( folder _ name ) : if not os. path. exists ( '. / img') : os. makedirs ( '. / img') if not os. path. exists ( '. / img /'+ folder _ name ) : os. makedirs ( '. / img /'+ folder _ name )
[ -0.47102659940719604, -0.024811899289488792, 0.5534748435020447, -0.5263053178787231, -0.14969541132450104, 0.7927981615066528, 0.5578754544258118, 0.07604719698429108, -0.43900182843208313, -0.7249027490615845, 0.20336487889289856, 0.10124988853931427, -0.35303008556365967, 1.696676492691...
def realtime ( ) : return render _ template ('realtime. html')
[ 1.344709038734436, 0.6454843878746033, 0.5611225962638855, 0.21512703597545624, -0.688292384147644, -0.32694268226623535, -0.020958581939339638, 0.99498051404953, 0.24722521007061005, 0.8054898381233215, -0.5025813579559326, -0.8160443305969238, -0.6956044435501099, 0.5234940648078918, -...
def tokenize ( text ) : # convert text to lowercase and remove punctuation text = re. sub ( r " [ ^ a - za - z0 - 9 ] ", " ", text. lower ( ) ) # tokenize words tokens = word _ tokenize ( text ) # stem word tokens and remove stop words lemmatizer = wordnetlemmatizer ( ) stop _ words = stopwords. words ( " english " ) l...
[ -0.25918492674827576, -0.8566280603408813, 0.5337876677513123, -0.3491400182247162, -0.16069483757019043, 0.09262204170227051, -1.3935436010360718, 1.154155969619751, 0.7272714376449585, 0.4502177834510803, -1.2444422245025635, -0.07784118503332138, -0.44046854972839355, 0.9634897112846375...
def _ search _ not _ empty ( self, user ) : if self. search is not none : if self. search. get ( " login " ) = = user : return self. search. get ( " data " ) try : return self. ldap _ search ( user ). get ( " data " ) except attributeerror : return none
[ -0.9830377697944641, 0.7611908912658691, 0.6376160979270935, -0.12988556921482086, -0.5642611384391785, 0.2273099422454834, -0.40588006377220154, -1.3241348266601562, 0.20135536789894104, -0.5593510866165161, -0.047783490270376205, 0.09809388965368271, -0.6265682578086853, 0.07000755518674...
def vanderpol _ jax ( t0 = 0. 0, tmax = 30, y0 = none, params = 1e1 ) : jax, jnp = _ import _ jax ( ) if isinstance ( params, float ) : mu = params else : ( mu, ) = params if y0 is none : y0 = np. array ( [ 2. 0, 0. 0 ] ) def vanderpol _ rhs ( y ) : return jnp. array ( [ y [ 1 ], mu * ( 1. 0 - y [ 0 ] * * 2 ) * y [ 1 ]...
[ 0.6174437999725342, -0.38811197876930237, 0.7599591016769409, -0.2799564301967621, -0.6514967083930969, -0.0867326408624649, -0.4280618727207184, -0.30306166410446167, -0.2546010911464691, 0.5003902316093445, 0.4112907648086548, 0.19935862720012665, 0.7701961994171143, -0.5834740996360779,...
def dict _ remove _ keys ( d ) : filter = ( " lastmove ", " sflow ", " flowcontrol _ send ", " flowcontrol _ receive ", " routeaction ", " hardwareprogrammed ", " kernelprogrammed ", " directlyconnected ", " ttl ", " type ", " entrytype ", " moves ", " updowntime ", " msgsent ", " inmsgqueue ", " undermaintenance ", " ...
[ -0.617398738861084, 0.0970575362443924, 0.6199855208396912, -0.6884840726852417, -0.9711360931396484, 0.07079178839921951, 0.5070554614067078, 0.05942921340465546, 0.2797640562057495, 0.6035590171813965, 0.303368479013443, 0.0454665943980217, -0.22635307908058167, 0.22545550763607025, 0....
def export _ data ( request, * * kwargs ) : export _ tag = _ export _ tag _ or _ bust ( request ) resp = export _ data _ shared ( export _ tag, format = request. get. get ( " format ", format. xls _ 2007 ), filename = request. get. get ( " filename ", none ), previous _ export _ id = request. get. get ( " previous _ ex...
[ -0.0013460185145959258, 0.020321747288107872, 0.6338697075843811, 0.7567402720451355, -0.27037423849105835, -0.5235393643379211, -0.2987249493598938, -0.6245796084403992, -0.09114658832550049, 0.017472602427005768, 0.6093268990516663, -0.36097702383995056, -0.3035784363746643, 0.2546815872...
def crawl ( ) : global driver while true : # should be changed later. while img _ exits time. sleep ( 1 ) _ overlap _ photos = driver. find _ elements _ by _ class _ name ( " yi5aa " ) if not _ overlap _ photos : img _ name = _ save _ image ( ) else : img _ name = _ save _ images ( len ( _ overlap _ photos ) ) _ hashta...
[ -0.9754855036735535, 0.4314654767513275, 0.6922928094863892, 0.597914457321167, 0.6520522236824036, -0.22286741435527802, 1.4290049076080322, 0.28513336181640625, -0.2584473788738251, -0.005129617638885975, -0.553840160369873, -0.4785156548023224, -0.12008573859930038, 1.1599246263504028, ...
def list _ files _ in _ google _ drive ( self, credentials = none ) : if self. credentials is not none : credentials = self. credentials service = build ('drive ','v3 ', credentials = credentials ) results = service. files ( ). list ( fields = " nextpagetoken, files ( id, name, mimetype ) " ). execute ( ) items = resul...
[ -0.5687850713729858, -0.6300638914108276, 0.42009103298187256, -1.0576605796813965, -0.08914339542388916, -0.3421860635280609, -1.1884751319885254, 0.21379488706588745, -0.9144765138626099, 0.5144895315170288, -1.339927077293396, 0.006103969179093838, -1.4500153064727783, 0.737228929996490...
def _ int64 _ feature ( value ) : return tf. train. feature ( int64 _ list = tf. train. int64list ( value = [ value ] ) )
[ -0.7626135945320129, -0.055655404925346375, 0.19894549250602722, 0.17773693799972534, -0.35408568382263184, -0.6276116371154785, 0.07634218037128448, 0.5652114152908325, 0.04868156090378761, -0.1433284878730774, -1.2157931327819824, 0.060124073177576065, -0.20400771498680115, -0.5591651797...
def test _ addcallbackscallserrback ( self ) : failure = synchronousfailure ( runtimeerror ( ) ) sd = synchronousdeferred ( failure ) successes = [ ] failures = [ ] sd. addcallbacks ( successes. append, failures. append ) self. assertequals ( successes, [ ] ) self. assertequals ( failures, [ failure ] )
[ 0.6413488984107971, 1.2886055707931519, 0.620068371295929, 0.7069568037986755, 0.9294975399971008, 0.3481764793395996, -0.7986116409301758, -0.18865184485912323, 0.9686472415924072, -1.6226081848144531, -1.0346558094024658, -0.4242575168609619, -0.5071385502815247, 1.143985629081726, 0.7...
def parse _ names ( names, inputlist ) : if not names : snames = [ os. path. split ( x ) [ 1 ] for x in inputlist ] return ( snames ) else : return ( names )
[ -0.8523848056793213, 0.39876115322113037, 0.42761147022247314, 0.5951443910598755, 0.3729307949542999, -0.11096443235874176, -0.5264012217521667, 0.31108900904655457, 0.1504160761833191, 0.4189733564853668, -0.6989926695823669, -0.6978890299797058, -1.0417293310165405, 1.1071282625198364, ...
def _ method _ not _ allowed ( self ) : raise exception. oauth2othererror ( int ( http. client. method _ not _ allowed ), http. client. responses [ http. client. method _ not _ allowed ], _ ('the method is not allowed for the requested url.') )
[ -0.3658437430858612, 0.650188148021698, 0.4857238829135895, -0.15297646820545197, -0.6058652400970459, -1.0707383155822754, -0.25198933482170105, -0.8171975016593933, -0.3108064830303192, -0.010339144617319107, 1.0496658086776733, 0.6923146843910217, 0.17200867831707, 0.06752550601959229, ...
def getdatacitequeuelength ( ) : return ezidapp. models. async _ queue. datacitequeue. objects. count ( )
[ 0.156315878033638, -0.7411832213401794, 0.179276704788208, -1.0421706438064575, 0.635796844959259, -0.007269140798598528, -0.5613396167755127, 0.5437657833099365, -0.20396651327610016, 0.0778871476650238, -0.5643289089202881, 0.3317281901836395, 0.8003570437431335, 0.5810407996177673, 0....
async def fetch _ async ( self ) - > hostednumberorderinstance : payload = await self. _ version. fetch _ async ( method = " get ", uri = self. _ uri, ) return hostednumberorderinstance ( self. _ version, payload, sid = self. _ solution [ " sid " ], )
[ 0.314921498298645, 0.23305751383304596, 0.26341620087623596, 0.29844123125076294, -0.6343256831169128, 0.46129006147384644, -0.7997038960456848, -0.13945570588111877, 0.14178892970085144, -0.777545154094696, -0.42497214674949646, 0.44545915722846985, 0.1147712767124176, -0.2050864398479461...
def get _ current _ workspace ( ) : workspaces = [ w for w in i3. get _ workspaces ( ) if w ['focused'] ] assert len ( workspaces ),'only one workspace should be focused at time'return workspaces [ 0 ] ['name']
[ -0.23177967965602875, -0.6339739561080933, 0.45957857370376587, 0.19110755622386932, -0.35856908559799194, 0.04968758299946785, 1.0644378662109375, -1.1535907983779907, 0.46133798360824585, -0.1578441709280014, 0.6801010966300964, 1.0303939580917358, -1.1349589824676514, -0.169158935546875...
def solveall ( self ) : print ( " solving the whole board... " ) measurestart ( " solveall " ) countsidesset = 0 while true : nextmove = self. getnextmove ( dosort = false ) if nextmove is none : break countsidesset + = 1 side = self. game. sides [ nextmove. sideid ] self. game. setsidestatus ( nextmove ) self. inspect...
[ 0.5423901677131653, 0.9784383773803711, 0.7026904821395874, 0.455585241317749, 0.802688479423523, -0.3917115032672882, 0.11999951303005219, 0.10987044870853424, -0.1809840202331543, -0.08969032019376755, 0.19445665180683136, -0.18717500567436218, -0.3033381700515747, 1.3199876546859741, ...
def test _ editing _ report ( self ) : updated _ report = copy. deepcopy ( self. report _ form _ sample _ duplicate ) report _ airflow _ variable = variable. get ( " rb _ status _ " + self. report _ form _ sample _ duplicate. report _ title. data, deserialize _ json = true, ) report _ saver = reportformsaver ( updated ...
[ 0.33665791153907776, -0.05380982160568237, 0.4261183738708496, 0.08964791148900986, 0.7086648941040039, -0.4041682183742523, 0.2637224495410919, 0.2780113220214844, 0.19132108986377716, -0.3333902060985565, -0.7104219198226929, 0.4129631519317627, 0.013296072371304035, -0.8730124831199646,...
def to _ representation ( self, obj, envelope ='data') : context = self. context return apioauth2personaltokenserializer ( instance = obj, context = context ). data
[ -1.3354811668395996, -0.4600749909877777, 0.5025492310523987, -0.8624225854873657, -0.739805281162262, 0.0770203173160553, -0.7190913558006287, -0.46976444125175476, 1.206452488899231, -0.4159948527812958, -0.8793836236000061, 0.9168938994407654, 0.025811422616243362, -0.3146243989467621, ...
def strip _ zeros ( x ) : xx = x. sum ( axis = 1 ) return x [ np. where ( xx! = 0 ) ]
[ 0.41220623254776, -0.5176379680633545, 0.5768441557884216, 0.7572498321533203, -0.3545664846897125, 0.5078063011169434, 0.32515084743499756, 0.567533016204834, 0.8208860158920288, -0.14022435247898102, -0.11690832674503326, 0.5016093254089355, 0.26857489347457886, -0.6357995867729187, 0....
def random _ start ( ) : return ( r ( ) - 0. 5 ) * 20, ( r ( ) - 0. 5 ) * 20
[ 0.0072609069757163525, -0.6291171312332153, 0.3059764504432678, -0.9486746191978455, 0.05722638964653015, 0.7572247385978699, 0.565626323223114, -0.3688030242919922, 0.6072074174880981, 0.17649942636489868, -1.184485673904419, 0.26466095447540283, -0.35487884283065796, 0.24404262006282806,...
def patch _ hold ( submission : domain. submission, row : models. submission ) - > domain. submission : if not row. is _ new _ version ( ) : raise valueerror ('only applies to new and replacement rows') if row. status = = row. on _ hold : created = row. get _ updated ( ) creator = domain. agent. system ( _ _ name _ _ )...
[ 0.6480613946914673, -0.6651673316955566, 0.47773653268814087, 0.13009010255336761, -0.2557392418384552, 0.9213672280311584, -0.8487920165061951, -0.6705607175827026, 0.9623697400093079, -0.4289170205593109, 0.7188385725021362, 0.5227879881858826, 0.2139047384262085, 0.20945750176906586, ...
def _ edges ( self ) : return [ edge ( self, x ) for x in self. redis. smembers ( self. edges _ key ) ]
[ -0.6754948496818542, -0.3755957782268524, 0.05100034922361374, -0.4011908173561096, 0.5952555537223816, -0.5750675201416016, -1.9881398677825928, 0.765601634979248, 0.7752671241760254, 0.5280908942222595, -0.13367211818695068, -0.10446865111589432, -0.42868077754974365, -0.1614177972078323...
def entropy ( x, k = 3, base = 2 ) : assert k < = len ( x ) - 1, " set k smaller than num. samples - 1 " x = np. asarray ( x ) n _ elements, n _ features = x. shape x = add _ noise ( x ) tree = ss. ckdtree ( x ) nn = query _ neighbors ( tree, x, k ) const = digamma ( n _ elements ) - digamma ( k ) + n _ features * log ...
[ -0.4184156358242035, 0.5308035612106323, 0.5621708631515503, 0.23261669278144836, -1.202811598777771, -0.127155140042305, -0.48785582184791565, 0.5389057993888855, -0.21320512890815735, 0.9860764741897583, -0.3310660123825073, -0.32990366220474243, 0.14072859287261963, -0.41758087277412415...
def getnextstatedestructively ( self, state, moves ) : if self. thebackingmachine = = none : return none try : return self. thebackingmachine. getnextstatedestructively ( state, moves ) except transitiondefinitionexception as te : raise te except exception as e : self. failgracefully ( e, none ) except threaddeath as d...
[ 0.08825285732746124, 0.9114831686019897, 0.5959877371788025, 0.385757178068161, -0.5053804516792297, -0.29318803548812866, -0.5002391934394836, -0.2785874605178833, 0.2984338402748108, -0.5608276724815369, 0.1850404441356659, 0.280396968126297, 0.056867070496082306, -0.5492656826972961, ...
def fill _ year ( df ) : df. year = df. year. fillna ( method ='ffill ', downcast ='infer') return df
[ 0.7767266035079956, 0.6403254270553589, 0.49812179803848267, -0.01969732902944088, 0.44017115235328674, 0.22145238518714905, 0.7706192135810852, -0.4703892767429352, 0.7984627485275269, -0.16363731026649475, 0.12905743718147278, 0.15493199229240417, 0.7361582517623901, 1.0015926361083984, ...
def add _ vertical _ line ( column, row0, row1, char ='|') : assert len ( char ) = = 1, _ char _ assert _ template. format ( char ) try : for row in range ( row0, row1 ) : _ grid [ row ] [ column ] = char except indexerror : if not 0 < = row < = _ max _ rows : raise rowrangeerror ( ) raise columnrangeerror ( )
[ 0.33424144983291626, 0.041971758008003235, 0.48906877636909485, 0.9684040546417236, 0.1622769832611084, 0.1091344878077507, -0.04322811961174011, -0.0672193095088005, -0.8403379321098328, 0.15849563479423523, -0.7990931272506714, 0.39098483324050903, 0.10290370881557465, 0.4160465300083160...
def won ( self ) : return self. _ wins
[ -0.602500319480896, -0.24796843528747559, 0.3304915726184845, 0.8472241759300232, 0.28448429703712463, 0.10519463568925858, 1.054042935371399, 0.2951035797595978, -0.07279904186725616, -1.6927920579910278, -1.1334784030914307, 0.5369401574134827, 0.53128582239151, -0.49956491589546204, -...
def masked _ kld ( inp _ logits, trg _ logits, lengths, tau = 1, mask _ ids = [ ] ) : input _ logp = f. log _ softmax ( inp _ logits / tau, - 1 ) target _ p = f. softmax ( trg _ logits / tau, - 1 ) # zero padded timesteps mask = sequence _ mask ( lengths ). unsqueeze ( - 1 ). float ( ) # shape : batch x seq _ length x ...
[ 0.48874735832214355, -0.7669594287872314, 0.4982539117336273, -0.14991028606891632, -0.5832481980323792, -0.36265096068382263, -0.05533193424344063, -0.05281040444970131, 0.1570180356502533, 1.1088324785232544, -0.12515966594219208, -0.05681424215435982, 0.13138434290885925, 0.042501561343...
async def _ test _ split _ light ( hass, mqtt _ mock, config, num _ lights, num _ switches ) : mac = config [ " mac " ] async _ fire _ mqtt _ message ( hass, f " { default _ prefix } / { mac } / config ", json. dumps ( config ), ) await hass. async _ block _ till _ done ( ) async _ fire _ mqtt _ message ( hass, " tasmo...
[ 0.4561973214149475, 0.4986022710800171, 0.4273887276649475, -0.11534367501735687, 0.24760489165782928, -0.12039794027805328, -0.17988017201423645, 0.33413922786712646, 0.12297946959733963, -0.02897624485194683, -0.448729932308197, -0.16374579071998596, -0.06160008907318115, 0.4443037509918...
async def nowplaying ( self, ctx ) : if self. _ now _ playing : await send ( ctx, self. _ now _ playing ) else : await send ( ctx, " not currently playing! " )
[ -0.10665259510278702, 0.41034945845603943, 0.4924958348274231, 0.7673133611679077, 0.8099232316017151, 0.4663819968700409, 0.12622343003749847, -0.17921105027198792, 0.15026813745498657, 0.27587082982063293, 0.3764311969280243, 1.2761428356170654, -0.7095659375190735, -0.008467158302664757...
def learn ( self, x, weights, labels ) : i = 0 converged = false total _ iteration = 0 no _ data _ points = len ( x ) self. weights = weights while i < no _ data _ points : if np. sign ( np. dot ( weights. t, x [ i ] ) )! = labels [ i ] : # < 0 : # misclassified, adjust weight weights = weights + labels [ i ] * x [ i ]...
[ 0.0327041819691658, 0.008399581536650658, 0.6201112866401672, 0.5042561888694763, -0.026551246643066406, 0.18875040113925934, -0.09500747174024582, -0.4888623356819153, -0.6536985635757446, -0.045557901263237, -0.026024259626865387, 0.14467379450798035, -1.0098856687545776, 0.7854951024055...
def marginal _ prob ( chars ) : frequencies = dict ( counter ( chars. values ( ) ) ) sum _ frequencies = sum ( frequencies. values ( ) ) return { char : freq / sum _ frequencies for char, freq in frequencies. items ( ) }
[ 0.20337626338005066, -0.3657565414905548, 0.4553242027759552, -1.7221040725708008, -0.8368520736694336, 0.35077008605003357, 0.5321592688560486, 0.21097257733345032, 0.1634746640920639, 0.7229386568069458, 0.8179374933242798, 0.021356340497732162, -0.35655492544174194, -0.6009057760238647,...
def init _ logger ( self ) : root = logging. getlogger ( ) root. setlevel ( logging. debug ) # log to stderr handler1 = logging. streamhandler ( sys. stderr ) handler1. setlevel ( logging. debug ) # and to our gui handler2 = logging. streamhandler ( self. logbox ) handler2. setlevel ( logging. debug ) formatter = loggi...
[ 0.003072516294196248, -0.9326143264770508, 1.055336356163025, -0.49193572998046875, -0.045616474002599716, -0.07076121866703033, -0.8255755305290222, -0.3668586015701294, -0.4635928273200989, -1.108195424079895, -0.30303165316581726, 0.8058063387870789, 0.15222178399562836, 2.0833542346954...
def birth _ before _ death _ of _ parents ( self ) : status = true query1 ='select indi. indi, indi. sex, indi. deat, indi. name from indi where indi. deat! = " na "'# dead people deads = self. tool. query _ info ( query1 ) for person in deads : death = person [ 2 ] if person [ 1 ] = ='m': query2 ='select fam. chil fro...
[ 0.23993253707885742, -0.14631572365760803, 1.0077763795852661, 0.1883469671010971, -0.44789978861808777, 0.8179560899734497, 0.7091279029846191, -0.5110910534858704, -0.8520258069038391, -0.35781610012054443, -0.27485600113868713, -0.3502297103404999, -0.09148603677749634, 0.59092354774475...
def test _ inheritance _ matches _ parental _ affected _ status _ biparental ( self ) : cnv = self. create _ variant ( " female " ) cnv. child. format ['inheritance'] = " unknown " cnv. child. format ['cifer _ inheritance'] = " biparental " self. assertfalse ( self. inh. inheritance _ matches _ parental _ affected _ st...
[ 0.1576927751302719, -0.7870737314224243, 0.8291749954223633, -0.02497822418808937, 0.11285630613565445, 1.0754852294921875, 0.2012510895729065, 0.4152713119983673, -0.23426595330238342, -0.9132280945777893, -1.1958409547805786, 0.518695056438446, -0.19124625623226166, 0.6485244631767273, ...
def three ( ) : return [ [ 0, 1, 1, 0 ], [ 1, 0, 0, 1 ], [ 0, 0, 0, 1 ], [ 0, 1, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 1 ], [ 0, 1, 1, 0 ], ]
[ -0.42878058552742004, -0.09633193910121918, 0.8377018570899963, -0.011539153754711151, 0.890852689743042, 0.3175877332687378, -0.4890902042388916, -0.20869189500808716, 0.5382655262947083, 0.2271900177001953, -1.7170320749282837, -0.2254384309053421, 0.05448095500469208, -0.538866996765136...
def update _ or _ create ( document _ id, data ) : # to avoid duplicates - this will create new document if same id not exist document = collection. update _ one ( {'_ id': objectid ( document _ id ) }, { " $ set " : data }, upsert = true ) return document. acknowledged
[ -0.23808841407299042, -0.24888530373573303, 0.6773253679275513, -0.2074684351682663, -0.20128534734249115, 1.0021802186965942, -0.302884578704834, -0.004122418351471424, 0.9882389307022095, 1.2241885662078857, -0.11537682265043259, -0.20081134140491486, -0.8496349453926086, 0.6883627772331...
def note _ list _ incremental _ offset ( self, min _ offset ) : pure _ notes = [ ] for part in self. score. getelementsbyclass ( stream. part ) : counter = 0 while counter < self. score. highesttime - min _ offset : stuff _ at _ offset = part. flat. getelementsbyoffset ( counter, mustbegininspan = false, mustfinishinsp...
[ -0.7618376612663269, -1.0683374404907227, 0.9869093298912048, -0.12573261559009552, -0.3293127715587616, 1.123194932937622, -0.009640238247811794, -0.39935582876205444, 0.6096137762069702, 0.060677722096443176, -0.8079488277435303, 0.3972840905189514, -0.02487344853579998, -0.0062649198807...
def fmax ( self ) : if self. _ fmax is not none : return self. _ fmax elif self. _ interval is not none : return self. interval. max ( )
[ 0.03970790654420853, -0.1189199909567833, 0.5256598591804504, 1.1157774925231934, 0.010182753205299377, -0.2026793509721756, -0.7253581881523132, -0.05277677997946739, 0.48226645588874817, -1.3024176359176636, 0.43416935205459595, 0.0831708312034607, -0.6324235796928406, 0.6992782950401306...
def print _ chat ( self, message ) : prefix = getattr ( self. _ local. server,'chat _ prefix ', default _ message _ prefix ) for line in message. replace ( " \ r \ n ", " \ n " ). split ( " \ n " ) : self. _ local. comms. clientqueue. put ( mcpackets. encode ('s2c ', 0x03, {'message': prefix + line } ) )
[ 0.33315104246139526, -0.06052872911095619, 0.5142034888267517, -0.31331750750541687, -0.09975709021091461, -0.4948132336139679, -0.21856948733329773, -0.41781020164489746, -0.3255656957626343, -0.1083189845085144, -0.13875864446163177, 1.083444595336914, -0.838552713394165, 1.2526861429214...
def assemble _ data ( data _ dfs, concat _ direction ) : if concat _ direction = = " horiz " : # concatenate the data _ dfs horizontally all _ data _ df = pd. concat ( data _ dfs, axis = 1 ) # sanity check : the number of columns in all _ data _ df should # correspond to the sum of the number of columns in the input df...
[ 0.016628218814730644, -0.2941024601459503, 0.7837275266647339, 0.49409380555152893, 0.29292041063308716, 0.20187100768089294, 0.1253678947687149, 0.031574442982673645, -0.4161038100719452, -0.11951080709695816, 0.9743168950080872, 0.3006076216697693, -0.10309368371963501, 0.149960517883300...
def search _ term ( cls, key, value ) : temp = [ ] temp. append ('(') temp. append ( str ( key ) ) temp. append (':') temp. append ( py _ to _ solr ( value ) ) if cls. boost : temp. append ('^ % s'% str ( cls. boost ) ) temp. append (')') return''. join ( temp )
[ -0.3215280771255493, -0.18301838636398315, 0.6845334768295288, -0.33424240350723267, -0.8476986289024353, 0.11749837547540665, -1.4742116928100586, -0.566744327545166, -0.08357127010822296, 0.9325311779975891, 0.042236849665641785, -0.006460738368332386, -0.3877120614051819, -0.67922174930...
def evaluate ( data = none, y _ true = none, y _ pred = none, scores = [ r2 _ score, mean _ squared _ error, mean _ absolute _ error ], score _ names = ['r2 ','mse ','mae'] ) - > pd. series : if ( y _ true is none ) or ( y _ pred is none ) : y _ true = data [ :, 0 ] y _ pred = data [ :, 1 ] assert y _ true. size = = y ...
[ -0.27146682143211365, -0.30325186252593994, 0.6056032180786133, -0.04107992351055145, -0.04942214861512184, -0.1274082064628601, -0.1611166000366211, 0.1659417599439621, -0.5477336049079895, 0.30283206701278687, 0.3244250416755676, 1.116289734840393, 0.27762070298194885, 0.4979537129402160...
def is _ invite _ code ( text ) : return ( invite _ code _ rp. fullmatch ( text ) is not none )
[ 0.725093424320221, -0.6249492168426514, 0.44696399569511414, 0.9034804701805115, -0.07397126406431198, 0.01677612029016018, -0.40156352519989014, 1.333227276802063, 0.7795298099517822, 1.15093994140625, -0.5964639782905579, 0.3505834937095642, -2.160623550415039, -0.20868779718875885, -0...
def try _ to _ rebuild ( self ) : if self. max _ occupancy > self. occupancy _ tol : new _ cps = int ( ( self. n + 1 ) * self. growth _ factor ) self. _ _ init _ _ ( points = self. index, cells _ per _ side = new _ cps ) else : pass
[ -0.4808070659637451, 0.5340195894241333, 0.4818499982357025, 0.6441388726234436, -0.1294197142124176, -0.039403121918439865, 0.5910332798957825, -0.4794239103794098, -0.3689485192298889, -0.8255751729011536, 0.3503865897655487, -0.23312914371490479, -0.12360399961471558, -0.842885017395019...
def _ best _ shift _ linspace ( self, lpx _ hist, lpx _ mid, segments = 1000, order = 2, verbose = false ) : totcnt = len ( lpx _ hist ) minsample = max ( 1800, totcnt / segments ) if totcnt < minsample : return np. array ( [ [ 0, totcnt ] ] ), np. array ( [ 0 ] ) segs = int ( totcnt / minsample ) ix = ( np. linspace (...
[ -0.03758564591407776, -0.7596083283424377, 0.5110310912132263, -0.2355090081691742, 0.1746431142091751, 0.07162174582481384, -0.924753725528717, -0.11578809469938278, 0.7492578625679016, 0.03312923014163971, 0.10818103700876236, 0.4228852391242981, -0.20759274065494537, 0.24930138885974884...
def _ _ init _ _ ( self, csdfilename = none ) : ctcsound. csound. _ _ init _ _ ( self ) self. pt = none # if csdfilename and os. path. exists ( csdfilename ) : if csdfilename : self. csd = csdfilename self. startthread ( ) else : self. csd = none
[ 1.2944835424423218, -1.1662455797195435, 0.5681688785552979, 0.6925027966499329, 0.0129522904753685, 1.169930100440979, 0.39862629771232605, 0.3889467418193817, 0.030893320217728615, -0.622480571269989, 0.2955318093299866, -0.23514708876609802, -0.7137899994850159, 0.5930823087692261, 0....
def bounded _ loss _ nogt ( rs, rt, m, v ) : # tf. cond ( ( ( l2 ( rs, rt ) < ( l2 ( rs, rt ) + m ) ) or ( l2 ( rs, rt ) > ( l2 ( rs, rt ) - m ) ) ), lambda : tf. assign ( lb, 0 ), lambda : tf. assign ( lb, l2 ( rs, rt ) ) ) # if ( ( l2 ( rs, rt ) < ( l2 ( rs, rt ) + m ) ) or ( l2 ( rs, rt ) > ( l2 ( rs, rt ) - m ) ) )...
[ -0.31022459268569946, -1.3629405498504639, 0.5641720294952393, -0.9894299507141113, -0.8597410321235657, 0.3448699116706848, -0.04645664244890213, -0.8474711179733276, -0.2671389579772949, 0.19069814682006836, -0.5093210339546204, 0.8046454787254333, -0.5769808888435364, 0.4420661330223083...
def registerlisttype ( type ) : oc _ pythonarray = lookupclass ('oc _ pythonarray') oc _ pythonarray. depythonifytable ( ). append ( type )
[ -0.7495364546775818, 0.34564656019210815, 0.6096510887145996, -0.2962197959423065, 1.676638126373291, -0.43889835476875305, -0.7586721181869507, -0.6682261228561401, 0.4710809290409088, -0.144746795296669, -1.8501341342926025, 0.625542402267456, -0.5048519968986511, 1.2304160594940186, 1...
def test _ get _ vcs _ root _ entry _ checkout _ rules ( self ) : pass
[ 1.0503809452056885, 0.2459787130355835, 0.05675286799669266, 1.0768232345581055, 0.34265246987342834, 0.18018129467964172, 0.3697039783000946, 0.5665006041526794, 0.247734934091568, 0.7290064692497253, 0.3637445867061615, 0.323302686214447, -0.9305804371833801, -0.452605664730072, -0.943...
def home ( request ) : # get a list of rooms, ordered alphabetically games = game. objects. order _ by ( " title " ) rooms = room. objects. filter ( player _ one _ _ isnull = true ) | room. objects. filter ( player _ two _ _ isnull = true ) # render that in the index template return render ( request, " battle / home. h...
[ -0.2231496274471283, -0.5128476619720459, 0.7034593224525452, 0.6038853526115417, 0.16541419923305511, 0.6708730459213257, -0.40840157866477966, 0.23083262145519257, -0.08341117948293686, 0.9826967120170593, 0.11767081916332245, 0.20245420932769775, -0.26016223430633545, 0.2004623413085937...
def get _ status ( self ) : return self. status
[ -0.4795304238796234, -1.2127426862716675, 0.15062183141708374, 0.3640693128108978, 0.21043913066387177, 0.3943530023097992, -0.3657512962818146, 0.5816819667816162, 0.19414116442203522, -0.9914300441741943, -1.1395339965820312, 0.5836083292961121, -0.18684034049510956, -0.00237580132670700...
def _ getkeys ( self, xml _ root, key _ name ) : match = { } generator = xml _ root. iter ( ) for key in generator : if'key'in key. tag and key _ name in key. text : value _ key = generator. next ( ) value ='' for subkey in value _ key. iter ( ) : if'string'in subkey. tag : value = subkey. text match [ key. text ] = va...
[ -0.03322507068514824, -0.2731176018714905, 0.5269919037818909, -0.13516013324260712, -1.5793269872665405, -0.9745290279388428, -1.214647650718689, 0.250397264957428, -1.2401893138885498, -0.05369513854384422, 0.06558872014284134, -0.3322121798992157, -0.40074622631073, 0.30127114057540894,...
def apply _ stem ( data, stemmer ) : # loop through each word in the vector for i in range ( len ( data ) ) : # apply the stemmer and replace the original value with the new value data [ i ] = stemmer. stem ( data [ i ] ) return data
[ -0.06659532338380814, -0.13751329481601715, 0.3386301100254059, -0.22469013929367065, -0.954635500907898, -0.21228982508182526, -0.8279550075531006, 0.9038873910903931, -0.03304268419742584, 0.46754294633865356, -0.19514787197113037, 0.28663596510887146, -0.6057212352752686, 0.525241017341...
def weighted _ capacity ( self ) - > optional [ pulumi. input [ float ] ] : return pulumi. get ( self, " weighted _ capacity " )
[ 1.217750072479248, 0.2771660089492798, 0.6045336127281189, 0.8084021806716919, 0.8583356142044067, 0.9998369216918945, 1.2249115705490112, -0.3865131139755249, -0.3005228042602539, 0.08381565660238266, 0.6077517867088318, 0.09378238767385483, -0.29715219140052795, -0.12927834689617157, -...
def binomial _ coefficient ( n _, k _ ) : n = float ( n _ ) k = float ( k _ ) if ( n = = - 1 and k > 0 ) : return - 1. 0 * * k if ( n = = - 1 and k < 0 ) : return ( - 1. 0 * * k ) * - 1. 0 if ( n = = - 1 and k = = 0 ) : return 1. 0 if ( n = = k ) : return 1. 0 if n > = k : if k > n - k : # take advantage of symmetry k ...
[ 0.06564389914274216, -0.6800826787948608, 0.8149871826171875, 0.2894401252269745, 0.36857426166534424, -0.6629710793495178, 0.15562951564788818, -0.36044690012931824, -0.1869076043367386, 0.2151353806257248, 0.3691548705101013, 0.16368211805820465, 0.061557743698358536, 0.7092146873474121,...
def ussd _ send ( ser, command, timeout = 0 ) : print ('ussd : : command : % s'% command ) ser. write ('at + cusd = 2 \ r') print ('ussd : : clear : % s'% ser. readall ( ) ) err, res = ussdsend ( ser, command ). run ( timeout ) print ('ussd : : error : % s'% err ) print ('ussd : : result : % s'% res ) return {'success'...
[ -0.8192499279975891, -0.4953923225402832, 0.8840147256851196, -0.23235635459423065, -0.984729528427124, -0.15090054273605347, -0.05857193470001221, -0.24437215924263, -0.07685244083404541, 0.040898047387599945, -0.8409496545791626, 0.758644163608551, -0.07250706851482391, 0.143143877387046...
def testperformorderaction ( self ) : action = {'type':'approveorders'} filter _ statement = {'query':'where status = \'draft \'' } self. assert _ ( isinstance ( self. _ _ class _ _. service. performorderaction ( action, filter _ statement ), tuple ) )
[ -1.0546221733093262, 0.7932603359222412, 0.5010274648666382, -0.16107796132564545, 0.4530535340309143, -0.11385057866573334, 0.1376589834690094, -0.21064700186252594, 0.08990359306335449, 0.6386122703552246, 0.5119637250900269, 0.0052857729606330395, -0.169052854180336, -0.0452743805944919...
def make ( self ) : self. write ( " " )
[ 0.21299010515213013, 0.48096105456352234, -0.009802217595279217, -0.5062220692634583, 1.3025929927825928, 0.6464776396751404, 1.099650263786316, 0.07252299785614014, -0.4758906066417694, -1.1869760751724243, -0.41683533787727356, 0.5477641820907593, 0.15029676258563995, -0.4367638230323791...
def parse _ deps ( self, infile, classpath _ indexer ) : raise notimplementederror ( )
[ -1.00912344455719, -0.6753464937210083, 0.3632935881614685, 0.3586233854293823, -0.053602322936058044, 0.8206507563591003, 1.098389983177185, -0.13740409910678864, 0.06310032308101654, -0.00676152715459466, -0.2587340474128723, -0.5876651406288147, -0.2983255088329315, -0.06527815014123917...
def _ maybe _ convert _ timedelta ( self, other ) - > int | npt. ndarray [ np. int64 ] : if isinstance ( other, ( timedelta, np. timedelta64, tick, np. ndarray ) ) : if isinstance ( self. freq, tick ) : # _ check _ timedeltalike _ freq _ compat will raise if incompatible delta = self. _ data. _ check _ timedeltalike _ ...
[ -0.8581541776657104, -0.012400143779814243, 0.7235108017921448, -0.19518454372882843, -0.6374783515930176, 0.04236932098865509, 0.4050152599811554, -1.1828268766403198, 0.7591696381568909, -0.6586121916770935, 0.9173969626426697, -0.12014688551425934, -0.28845858573913574, 0.85466843843460...
def get _ loads _ from _ file ( self ) : path = r " c : \ users \ olive \ pycharmprojects \ power _ factory \ nominal _ loads " # read nominal active loads from directory active _ reader = csv. reader ( open ( path + r'\ active _ nominal. csv ','r') ) active _ loads = { } for k, v in active _ reader : active _ loads [ ...
[ 0.43217733502388, -1.1488845348358154, 0.44737303256988525, -1.2404367923736572, -0.3647100627422333, 0.6572989225387573, -0.8096259832382202, -1.411454200744629, -1.6301380395889282, 0.35951313376426697, 0.16534894704818726, 0.3899982273578644, 0.04587968811392784, 0.13523471355438232, ...
def band _ of _ frequency ( f, order = 1, ref = reference ) : return np. round ( ( np. log2 ( f / ref ) - 1. 0 / order ) * order )
[ -0.03404039144515991, 0.1997140347957611, 0.2462129443883896, 0.6201843619346619, -0.05573864281177521, -0.38735315203666687, 0.27829477190971375, -1.1445587873458862, 0.12735125422477722, -0.268341600894928, 0.9447375535964966, 0.9535696506500244, 0.1973329335451126, 0.7934114933013916, ...
def createuserdatalink ( obj, name, link, parentgroup = none, shortname = none ) : if obj is none : return false # if there is no object stop the function if shortname is none : shortname = name # short name is name bc = c4d. getcustomdatatypedefault ( c4d. dtype _ baselistlink ) # initialize user data bc [ c4d. desc _...
[ -0.0360296256840229, 0.04888416454195976, 0.651509702205658, 0.2028253674507141, -0.640739917755127, 1.0664527416229248, 0.36169180274009705, -0.22877925634384155, -0.10941004008054733, -0.7873456478118896, -0.8105224967002869, 0.6647522449493408, -0.4819469153881073, 0.03594970703125, 0...
async def eventcommand ( self, ctx : commands. context ) : if ctx. invoked _ subcommand is none : await ctx. send ( " todo : add explanations " )
[ 1.496081829071045, 0.46107038855552673, 0.7268337607383728, 0.5932325124740601, 1.3668912649154663, 0.6309868097305298, -0.18524348735809326, 0.7395971417427063, 0.7613071799278259, -1.2723050117492676, -0.006749489810317755, 0.9799104928970337, 0.10078062117099762, 0.21880997717380524, ...
def extract _ title ( html ) : # list of xpaths for html tags that could contain a title # tuple scores reflect confidence in these xpaths and the preference used for extraction xpaths = [ ('/ / header [ @ class = " entry - header " ] / h1 [ @ class = " entry - title " ] / / text ( ) ', 4 ), ('/ / meta [ @ property = "...
[ 0.5173217058181763, 0.6432114839553833, 0.9802607297897339, 0.31748324632644653, -0.3030341863632202, -0.6916981339454651, 0.15758384764194489, -0.6515728235244751, 0.13054360449314117, 0.4718148410320282, 0.02467930130660534, -0.7985424995422363, -0.7728439569473267, -0.7029954791069031, ...
def email _ body _ template _ external ( self, email _ body _ template _ external ) : self. _ email _ body _ template _ external = email _ body _ template _ external
[ -0.7668783664703369, -0.3427591025829315, 0.8871078491210938, -0.44028663635253906, -0.9281347393989563, 1.218281626701355, -0.9752706289291382, 0.15167665481567383, -0.5908303260803223, 0.8314885497093201, -1.6495020389556885, -0.8847971558570862, -0.04660102725028992, 0.5083485841751099,...
def add _ sub _ menu _ item ( self, menu _ text, solmenu, ext _ objects, acm _ obj, component ='' ) : submenu = solmenu. addsubmenu ( menu _ text ) for ext _ obj in ext _ objects : if ext _ obj. integrationsubtype ( ) and ext _ obj. integrationsubtype ( ) not in ['mt699'] : submenu. additem ( self. view _ mt _ settl _ ...
[ 0.6474803686141968, -0.08214084804058075, 0.645063579082489, 0.6775282025337219, -0.7912902235984802, 0.469173789024353, -0.002953491173684597, 0.6091452836990356, 0.09183056652545929, -0.445604532957077, -0.4755338728427887, 0.041706882417201996, -0.3467390239238739, 0.2621115744113922, ...
def totext ( self ) : text = ['< % s'% self. tag ] attributes = self. attributes. items ( ) attributes. sort ( ) for attribute, value in attributes : text. append ('% s = " % s "'% ( attribute, value ) ) childtext = self. childrentotext ( ) if childtext or nonselfclose. has _ key ( self. tag ) : text. append ('>') text...
[ 0.11482252180576324, -0.38749852776527405, 0.8787986636161804, -0.1888563483953476, -0.2960677146911621, 0.45407813787460327, -0.09841132164001465, -0.04759194701910019, -0.2683863639831543, 0.08762257546186447, -0.2734059989452362, -0.4952494204044342, -0.3568108379840851, 0.4510408043861...
def print _ order _ type _ data ( smirks _ order _ types, print _ all = true ) : for o _ type, order _ smirks in smirks _ order _ types. items ( ) : final _ print ='' all _ passed = true for label, output in order _ smirks. items ( ) : if not output. checks : final _ print + ='% - 23s failed to make smirks \ n'% label ...
[ -0.3550044596195221, -0.7143343687057495, 0.9681930541992188, 0.5834378600120544, 0.4236024022102356, 0.7936167120933533, 0.016638122498989105, -1.0295965671539307, -0.6099047660827637, 0.11513067036867142, 0.7330666780471802, 0.7947854995727539, -0.012817628681659698, 0.8823671340942383, ...
def get _ labels ( self ) : return self. model. labels _
[ -0.9788720607757568, -0.36858782172203064, 0.2739620804786682, 0.12272778898477554, 0.5443900227546692, 1.0025514364242554, -0.9310777187347412, -0.4461321532726288, -0.21551236510276794, 0.1146213561296463, -0.5165324211120605, -0.42079830169677734, -0.5375584959983826, 0.1995372772216797...
def get _ bounding _ boxes ( self, room, cap = false ) : def get _ bbox ( node, transform ) : bbox _ min = np. dot ( np. asarray ( [ node. xmin, node. zmin, node. ymin, 1 ] ), transform ) bbox _ max = np. dot ( np. asarray ( [ node. xmax, node. zmax, node. ymax, 1 ] ), transform ) if cap : bbox _ min = np. maximum ( bb...
[ -0.5498880743980408, -0.3690241277217865, 1.0348539352416992, -0.30007490515708923, -0.2164115458726883, -0.3225190341472626, 0.0383666455745697, -0.5910798907279968, 0.5634070634841919, 0.14381086826324463, -1.038813829421997, 0.27601754665374756, 0.2979044020175934, 0.687904417514801, ...
def test _ does _ not _ abort _ with _ password _ and _ host _ with _ abort _ on _ prompt ( self ) : env. abort _ on _ prompts = true env. password = passwords [ env. user ] # env. host _ string is automatically filled in when using server ( ) run ( " ls / simple " )
[ 0.0502353236079216, -1.3541259765625, 0.6091331243515015, 1.2309151887893677, -0.518746018409729, 1.8388649225234985, -0.041318900883197784, -0.08322609961032867, -0.042077384889125824, -0.360029399394989, 0.32398977875709534, 0.39923226833343506, 0.15309664607048035, 0.4242844581604004, ...
def test _ cant _ create _ car _ missing _ invalid _ params ( self ) : json _ response = api _ call ( self, " post ", " / car / create ", dict ( ), 200, true ) self. assertequal ( json _ response [ " status _ code " ], 400 ) self. assertequal ( json _ response [ " message " ],'missing make') json _ response = api _ cal...
[ -0.8679095506668091, -0.2716282606124878, 0.931094765663147, -0.04625300318002701, 0.3591246008872986, 0.791817843914032, -0.42795294523239136, -0.4962160587310791, -1.2238942384719849, 0.21439361572265625, -0.8409606218338013, 0.020502950996160507, 0.15313245356082916, 1.003849744796753, ...
def sample _ reads ( self, count = 1 ) : targ _ gi _ count = self. select _ targets ( count ) reads = [ ] for gi, n _ occur in targ _ gi _ count. iteritems ( ) : pos _ freq = np. random. multinomial ( n _ occur, pvals = self. sel _ targ _ pos _ probs [ gi ] ) for pos in xrange ( len ( self. sel _ targ _ pos _ probs [ g...
[ -1.1517924070358276, -0.9335575103759766, 0.5349494814872742, -0.4140053391456604, -0.146217480301857, -0.2966572344303131, -0.16997234523296356, 0.301492840051651, 0.47821274399757385, 0.5526317358016968, 1.3911467790603638, -0.07131895422935486, 0.09254620224237442, -0.3469485938549042, ...
def poisson _ ratio ( simname ) : df1, df2 = extract. extract _ def ( simname ) df3, df4 = extract. extract _ def ('cg _ 256c _ 128dp _ v20 _ deform _ lj _ kg _ uk _ 2 _ x') df1 = df1. values df2 = df2. values df3 = df3. values deformation _ along = np. argmax ( np. array ( [ np. std ( df1 [ :, 1 ] ), np. std ( df1 [ :...
[ -0.07197538018226624, 0.3173522353172302, 1.0416022539138794, -1.0104405879974365, -0.3258140981197357, -0.15338732302188873, 0.28529226779937744, 0.10350201278924942, -0.790996789932251, 0.339598685503006, -0.38504472374916077, -0.11946483701467514, -0.8054637312889099, -0.448799014091491...
async def stop ( self, terminate = false, wait = true ) : # if the process is running if self. is _ running : # stop the process by force or gracefully if terminate : self. process. terminate ( ) else : self. process. send _ signal ( signal. ctrl _ break _ event if server. is _ windows else signal. sigint ) # and wait ...
[ -0.17559969425201416, -0.41747939586639404, 0.2768982946872711, 0.5582883358001709, 0.596885621547699, 0.20876510441303253, -0.3906075656414032, 0.8301023840904236, -0.11680451780557632, -0.4529227316379547, -0.3986697494983673, -0.11845232546329498, -0.6039727926254272, 0.508545458316803,...
def to _ builddir ( self ) : from wasp import ctx if self. is _ subpath ( ctx. builddir ) : return self. copy ( ) return directory ( ctx. builddir. join ( self. _ path ) )
[ -0.30179736018180847, -0.45238304138183594, 0.4043915569782257, 0.6226709485054016, -0.15944981575012207, 0.8530430197715759, 0.6467382311820984, -0.3847563862800598, 0.8464395403862, -0.8911636471748352, 0.3349318206310272, 0.9627587199211121, -0.06661973893642426, -0.4390139579772949, ...
async def open ( self ) - > none : if not self. closed : raise clientinvalidoperation ( " client is already open. " ) logger. info ( " opening client with connection types % r... ", [ t. value for t in self. _ connection _ types ] ) self. _ transport = await self. _ negotiate _ transport ( ) response = await self. _ tr...
[ -0.8877443671226501, 0.4066052734851837, 0.32353320717811584, -0.020084982737898827, 0.5327032804489136, -0.05939913168549538, 0.8334658145904541, -0.2722807228565216, -0.35602444410324097, -0.6913232803344727, -0.12844116985797882, 0.20771954953670502, -0.46181800961494446, -0.44626981019...
def _ load _ letter ( self, image _ files, min _ num _ images ) : x = np. ndarray ( shape = ( len ( image _ files ), self. image _ size, self. image _ size ), dtype = np. float32 ) # y = np. zeros ( shape = ( len ( image _ files ), 10 ), dtype = np. int8 ) y = np. zeros ( shape = ( len ( image _ files ) ), dtype = np. ...
[ -0.6228262186050415, -0.38504087924957275, 0.8078855276107788, -0.7883667945861816, 0.23137697577476501, -0.20126457512378693, 0.8774572014808655, -0.0236123688519001, -0.12978678941726685, 0.5523788928985596, 0.05850747972726822, 0.41309675574302673, 0.5336436629295349, 0.0216280445456504...
def cow _ dead ( cow, herd ) : cow. image = pygame. image. load ('images /'+ cow. size _ phenotype +'/ ghost _ cow. png') if cow. rect. top < = cow. screen _ rect. top : # remove cow herd. remove ( cow ) else : cow. rect. top - = 1
[ -0.692906379699707, -0.34926852583885193, 0.6739394664764404, 0.6207972168922424, 0.11935257911682129, 0.6251198649406433, 0.431167334318161, -0.6803851127624512, -0.28071603178977966, 0.790642499923706, -0.09552377462387085, 0.3945966064929962, 0.059322137385606766, 0.7369881272315979, ...
def pretty _ print ( expr, out = none, mxdepth = none, mxargs = none, adsize = false, indent = " ", curdepth = 0 ) : # check file output if is _ string ( out ) : with open _ utf8 ( os. path. abspath ( out ), mode ='w') as f : pretty _ print ( expr, out, mxdepth, mxargs, adsize, indent, curdepth ) return # check default...
[ 0.4765334725379944, 0.42291802167892456, 0.9427110552787781, 0.7845949530601501, -1.4375183582305908, -0.13724520802497864, 0.6539804339408875, 0.12705214321613312, -0.32114848494529724, 0.5519968271255493, 0.22211194038391113, 0.3054840862751007, -0.11123494058847427, 0.459248811006546, ...
def cardstolist ( cardvalues ) : # some mapping function here string _ values = [ " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 ", " t ", " j ", " q ", " k ", " a " ] values = [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ] value _ map = dict ( zip ( string _ values, values ) ) # run dictionary new _ list = [ ] f...
[ -0.7443110942840576, -1.8323941230773926, 0.7536236047744751, -0.5859760046005249, -0.375448614358902, 0.4802490174770355, -0.5944393873214722, 1.1039915084838867, 0.08659772574901581, 0.5911122560501099, -1.1112476587295532, 0.1033816859126091, 1.0527348518371582, 0.2948918640613556, -0...
def aff _ kl _ div ( means, covars ) : aff _ table = np. empty ( [ means. shape [ 0 ], means. shape [ 0 ] ] ) # iterate through the components for i, ( mean _ 1, covar _ 1 ) in enumerate ( zip ( means, covars ) ) : # find the probability for every mean point in the current component for j, ( mean _ 2, covar _ 2 ) in en...
[ 0.34849244356155396, -0.11526960134506226, 0.7163991332054138, 0.07398765534162521, -0.18619558215141296, -0.2345983237028122, 0.23417052626609802, 0.2755568027496338, -0.8656190633773804, 1.38907790184021, 1.0443977117538452, 0.5835577845573425, 0.8170643448829651, 0.32663843035697937, ...
def generate _ rooms ( dungeon ) : roomnum = randint ( 7, 14 ) maxtries = 10 tries = 0 actual _ rooms = 0 dungeon. logview. post ( " roomnum : { } ". format ( roomnum ), msgtype. info ) dungeon. logview. post ( " maxtries : { } ". format ( maxtries ), msgtype. info ) map _ w, map _ h = dungeon. map. get _ width _ heigh...
[ -1.4903959035873413, 0.5542798638343811, 0.8692883849143982, -0.08504830300807953, 0.17377233505249023, 0.24005116522312164, 0.6278178095817566, 0.0886242613196373, 0.8446782231330872, -0.11238013207912445, 0.03378473222255707, -0.37349435687065125, -0.24031193554401398, 1.067112922668457,...
def tangent _ modulus ( simname, strain ) : df1, df2 = extract. extract _ def ( simname ) df1 = df1. values df2 = df2. values deformation _ along = np. argmax ( np. array ( [ np. std ( df1 [ :, 1 ] ), np. std ( df1 [ :, 2 ] ), np. std ( df1 [ :, 3 ] ) ] ) ) # for index, element in enumerate ( strain ) : # print ( index...
[ -0.30106982588768005, 0.26757729053497314, 0.7324756979942322, -0.4855358302593231, -0.14305196702480316, 0.1947775036096573, 0.4888192415237427, -0.2607952952384949, -0.0027286019176244736, -0.19084499776363373, 0.4225732088088989, -0.03183892369270325, -0.4299187958240509, -0.70967715978...
def permission _ denied ( request, exception, * args, * * kwargs ) : return httpresponseforbidden ( * * exception _ response ( request, 400, exception ) )
[ 0.31091853976249695, -0.30406031012535095, 0.49757084250450134, 0.7572375535964966, -0.4793684780597687, -0.33651307225227356, -0.6574667096138, -0.47082823514938354, 0.31628599762916565, -0.916576087474823, 0.9473973512649536, 0.31155410408973694, -0.7384862303733826, -0.9162752032279968,...
def key _ vault _ arm _ id ( self ) - > str : return pulumi. get ( self, " key _ vault _ arm _ id " )
[ 1.233506202697754, -0.003328293561935425, 0.08146122843027115, 1.1215035915374756, 0.2951376736164093, 1.6834585666656494, -0.6922679543495178, 0.2567606568336487, 0.7155959010124207, 0.06892551481723785, 0.5719835162162781, 1.3111871480941772, -0.361846923828125, -0.22577418386936188, -...
def partition _ list ( pred, l ) : t = [ ] f = [ ] pred = to _ predicate ( pred ) for e in l : if pred ( e ) : t. append ( e ) else : f. append ( e ) return t, f
[ -0.05223929509520531, 0.08852498978376389, 0.3950742781162262, -0.3077191114425659, -0.6919952630996704, -0.7091582417488098, -0.884436309337616, 2.5408213138580322, -0.19844086468219757, 0.890773594379425, -0.5803894996643066, -0.5028579831123352, 0.3787618577480316, 0.983817458152771, ...
def plot ( self, x ) : x = x [ :, 1 ] y = x [ :, 2 ] plt. axis ( [ np. amin ( x ) - 5, np. amax ( x ) + 10, np. amin ( y ) - 5, np. amax ( y ) + 10 ] ) plt. scatter ( x, y ) intercept, slope = self. weights [ 0 ], self. weights [ 1 ] plt. plot ( x, ( ( x * slope + intercept ) * 1. 0 ) / ( - self. weights [ 2 ] ),'r')
[ 1.0153833627700806, 0.5121051073074341, 0.5209888815879822, -0.4440751373767853, -0.16523979604244232, 0.6461151242256165, -0.0320218987762928, -0.11333411931991577, 0.43809008598327637, 0.028462570160627365, -0.22417306900024414, 0.9091291427612305, 0.23875433206558228, -0.229583606123924...
def endpoint _ type ( self ) - > str : return pulumi. get ( self, " endpoint _ type " )
[ 0.41427916288375854, 0.5160544514656067, 0.3685441315174103, 1.0596951246261597, 1.6316264867782593, 1.4042177200317383, -0.35207152366638184, 0.05350720137357712, 0.6124909520149231, 0.7773800492286682, 0.6511299014091492, 0.7719280123710632, -0.6645722389221191, -1.1280057430267334, 0....
def reached _ finish _ line ( self ) : if self. ycor ( ) > self. finish _ line _ y : self. reset _ position ( ) return true else : return false
[ -0.7398994565010071, 0.08534397184848785, 0.5836447477340698, 0.7659666538238525, 0.5140672326087952, 0.12354996055364609, -0.07679194957017899, -1.3192428350448608, -1.6069802045822144, 0.7983424067497253, -1.0130352973937988, -0.8077820539474487, 0.20014256238937378, 0.0987529531121254, ...
def core _ view ( request ) : context = { } if " post " = = request. method : # get the updated character data from the userform chardata = yaml. safe _ load ( request. post ['chardata'] ) # get the old world ( before the update ) world = b. get _ world ( request. user. get _ username ( ) ) context ['old _ location'] =...
[ -0.5484275817871094, -0.2698924243450165, 1.1429781913757324, 0.0946505218744278, 0.29357394576072693, 0.2789749205112457, 1.095530390739441, -0.3324905037879944, 0.3477838337421417, 0.35195767879486084, 0.18190601468086243, 0.2705105245113373, 0.17653009295463562, 0.06718405336141586, -...
def _ _ init _ _ ( self, tournament, turn, is _ new ) : self. _ app = none self. tournament = tournament self. viewer = editturnviewer ( ) if is _ new : already _ exists = true while already _ exists : name _ new = input ( " enter your turn name : " ) if name _ new in tournament. turns : print ( " this name is already ...
[ -0.3959309160709381, -0.6294564604759216, 0.609627902507782, 0.5827109813690186, 0.03385992720723152, -0.573946475982666, 0.0912034884095192, -0.47411754727363586, 0.07946347445249557, -0.3213636577129364, -0.16473926603794098, -0.176375612616539, 0.2543221712112427, -0.06882358342409134, ...
def on _ reset _ clicked ( self ) : # todo : not implemented yet self. frequency. clear ( ) self. freqnumber. clear ( ) self. interval. clear ( ) self. udpportsfrom. clear ( ) self. udpportsto. clear ( ) self. tsid. clear ( ) self. add. setenabled ( true ) self. append. setdisabled ( true ) self. serviceid _ start. set...
[ 0.261526495218277, 0.24196948111057281, 0.40381649136543274, -0.2816653847694397, 0.030798446387052536, -0.2663377821445465, 0.46298709511756897, -0.5380801558494568, 0.237909734249115, 0.2922026515007019, -0.41408655047416687, 0.21346677839756012, -0.1203259825706482, -0.26532140374183655...