text
stringlengths
25
2.19k
embedding
listlengths
768
768
def alarmhandler ( signum, frame ) : global gtimer rndcreconfig ( ) gtimer = time. time ( ) return signal. signal ( signal. sigalrm, signal. sig _ ign )
[ 0.29552558064460754, -0.19340768456459045, 0.24151204526424408, 0.7397093176841736, -0.5762966275215149, 0.5425556898117065, -0.009258169680833817, 0.17422015964984894, 0.4478890895843506, -0.000944553641602397, -0.34200942516326904, 0.021908782422542572, -0.716461181640625, 0.758801579475...
def test _ get _ namespace _ slack _ exception _ notfound ( self, mock _ k8s _ corev1api, mock _ k8s _ config ) : mock _ k8s _ api = mock _ k8s _ corev1api. return _ value mock _ k8s _ api. read _ namespaced _ secret. side _ effect = apiexception ( reason = " not found " ) expected _ result = none value = magtape. get ...
[ 0.49800121784210205, 0.30088600516319275, 0.551105797290802, -0.11977265775203705, 0.5611391067504883, 0.46420586109161377, -0.607453465461731, -0.9654686450958252, 0.5161672830581665, -0.6793641448020935, -0.1989065557718277, 0.9145539999008179, -0.13830703496932983, 0.22176063060760498, ...
def _ topo _ to _ phi _ theta ( theta, radius ) : sph _ phi = ( 0. 5 - radius ) * 180 sph _ theta = - theta return sph _ phi, sph _ theta
[ -0.32593274116516113, -1.1123648881912231, 0.3956025242805481, -0.7016404271125793, -0.4534153938293457, 0.3127622902393341, -0.3764899969100952, 0.7549148201942444, -0.48642581701278687, 1.3392691612243652, -0.6034286022186279, 0.5137604475021362, -0.048169855028390884, -0.354666858911514...
def add _ command _ output _ from _ input ( self, input : commandinput, name ) : self. inputs. remove ( input ) self. add _ command _ output ( id = input. id. replace ( " / inputs / ", " / outputs / " ), default _ value = input. default _ value, prefix = input. prefix, position = input. position, mapped _ to = input. m...
[ -0.05249093472957611, -0.7445051074028015, 0.42656955122947693, -0.03336339071393013, -0.20801666378974915, 0.03111143782734871, -0.010399854741990566, -0.3211664855480194, 0.024988826364278793, -0.6106125712394714, -0.002358109224587679, -0.16519182920455933, -0.5508635640144348, 0.421364...
def _ update _ range ( self, data, * * kwargs ) :
[ -2.1444091796875, -1.31112539768219, 0.07548069208860397, -0.06330391764640808, -0.5553857088088989, 0.05871552601456642, -0.637206494808197, -0.05198017135262489, -0.12909075617790222, 0.6477411985397339, -0.5072768926620483, 0.1237986758351326, -0.7551752924919128, -0.07634039223194122, ...
def numeric _ palindrome ( num ) : number = str ( num ) for x in xrange ( len ( number ) / 2 ) : if number [ x ]! = number [ ( x + 1 ) * - 1 ] : return false return true
[ -0.7274530529975891, 0.4229036867618561, 0.4941699206829071, 0.1542818397283554, -0.6591983437538147, 0.6833910346031189, -0.4765416383743286, 0.16773734986782074, -0.19492179155349731, -0.08139986544847488, -0.43919453024864197, -0.6070776581764221, -1.4292038679122925, -0.607196748256683...
def draw _ sun ( x, y, inr, outr, n ) : pointlist = [ ] # list of vertices of rays. a = 2 * np. pi / n # an angular size of one ray. for i in range ( n ) : pointlist. append ( ( x + inr * np. cos ( a * i ), y - inr * np. sin ( a * i ) ) ) pointlist. append ( ( x + outr * np. cos ( a * ( i + 0. 5 ) ), y - outr * np. sin...
[ -0.5375751256942749, 0.3365129232406616, 0.6372970938682556, -0.7939050793647766, -1.014327049255371, -0.08823936432600021, -0.2862720489501953, -0.3707720637321472, 0.9415212273597717, -0.17088299989700317, -0.9659215807914734, 0.797109842300415, 0.6709577441215515, -0.09933145344257355, ...
def train _ model ( self, data, targets, train _ idx, valid _ idx, epochs = 100, cuda = false, lr = 1e - 4, batch _ size = 64, save _ folder = ". / chkpt " ) : # creation of save _ folder self. save _ folder = save _ folder if not os. path. isdir ( self. save _ folder ) : os. makedirs ( self. save _ folder, exist _ ok ...
[ 0.14469946920871735, 0.2877448499202728, 0.6408373713493347, 0.5986412167549133, 0.8759534955024719, 0.12025590986013412, -0.3639214038848877, -0.22328367829322815, -0.13224515318870544, -0.044665202498435974, -0.0962686687707901, 0.4636998772621155, 0.08386107534170151, -0.009792265482246...
def _ get _ data _ transform ( self ) : data _ transform = dict ( ) if self. dataset _ name in ['cifar10 ','cifar100'] : print ( " = > get { } data transform ". format ( self. dataset _ name ) ) data _ transform ['train'] = transforms. compose ( [ transforms. randomcrop ( 32, padding = 4 ), transforms. randomhorizontal...
[ -0.2708249092102051, 0.3477883040904999, 0.8712283968925476, -1.1042463779449463, -0.091949462890625, -0.7306840419769287, 0.059809837490320206, -0.24039500951766968, 0.12165393680334091, -0.4729686677455902, -1.389561414718628, 0.00048304491792805493, 0.840390145778656, 0.0862746164202690...
def to _ mlir _ type ( dtype : np. dtype ) - > str : if not isinstance ( dtype, np. dtype ) : # handle np. int8 _ not _ being a dtype. dtype = np. dtype ( dtype ) bits = dtype. itemsize * 8 if np. issubdtype ( dtype, np. integer ) : return f " i { bits } " elif np. issubdtype ( dtype, np. floating ) : return f " f { bi...
[ -0.3825262486934662, 0.52936851978302, 0.5410674214363098, -0.6521065831184387, -0.37482139468193054, 0.2434065043926239, 0.01505853421986103, -1.3543087244033813, 0.8709925413131714, 0.7972420454025269, 0.6510246992111206, 0.2341499924659729, -0.41439288854599, 0.9963964819908142, 1.143...
def test _ partial _ update ( self ) : recipe = sample _ recipe ( user = self. user ) recipe. tags. add ( sample _ tag ( user = self. user ) ) new _ tag = sample _ tag ( user = self. user, name ='sample tag') payload = {'title':'new title ','tags': [ new _ tag. id, ] } url = get _ detail _ url ( recipe. id ) self. clie...
[ 0.8923275470733643, -0.12215981632471085, 0.49748337268829346, -0.036719366908073425, -0.15747417509555817, 0.4828823208808899, -0.9588001370429993, -0.1294979453086853, 0.12700717151165009, -0.5626471638679504, -1.0513415336608887, 0.04178518056869507, 0.07132419943809509, 0.3764734566211...
def shortdescription ( self ) : return none
[ 1.3106772899627686, -0.3132725954055786, 0.5550438165664673, -0.007303465623408556, 0.07176948338747025, 0.6480300426483154, 0.4861788749694824, -0.19394640624523163, 0.5181426405906677, -0.6576752066612244, 0.14103247225284576, 1.618129849433899, -0.4513775110244751, 0.2027323693037033, ...
def chain _ orientation _ parameter ( curr _ coordinates _ all, ex, nc, dp, bs, topologyfilename, sidechain = false, coord _ loc = [ 3, 6 ] ) : n _ applicable _ atoms = nc * dp - nc * 2 if sidechain : bondids = get _ bonds _ atomids ( topologyfilename ) p2x = [ 0 ] * ( n _ applicable _ atoms ) orient = 0 outer _ index ...
[ -0.45594340562820435, 0.3611346185207367, 0.7869362235069275, -0.9372998476028442, -0.3407534062862396, 0.21525457501411438, 0.5560826063156128, 0.10141977667808533, -0.8553398847579956, 0.4280920922756195, 0.4554089605808258, 0.32217133045196533, -0.18443769216537476, -0.44607046246528625...
def timestamp _ age ( timestamp ) : return ( datetime. now ( ) - read _ timestamp ( timestamp ) ). days
[ -0.8444122076034546, 0.18054568767547607, 0.6836998462677002, -0.5671805143356323, 0.13272705674171448, -0.34134048223495483, -0.23400531709194183, -0.25738289952278137, 1.0831568241119385, -0.1565874069929123, 0.2866000533103943, -0.6537972688674927, 0.7465955018997192, -0.498792648315429...
def fragment ( id, offset, size ) : iterable, unionq = members ( id ), is _ union ( id ) # seek for item in iterable : ( m _ offset, m _ size ), ( m _ name, m _ cmt, m _ rcmt ) = item left, right = m _ offset, m _ offset + m _ size if ( offset > = left ) and ( offset < right ) : yield ( m _ offset, m _ size ), ( m _ na...
[ -0.3858392536640167, -0.5856240391731262, 0.6016069650650024, -1.1808971166610718, -0.38572239875793457, -0.02747456729412079, -0.33348605036735535, -0.13898730278015137, -0.04020605981349945, -0.39902496337890625, -0.5457867383956909, -0.340399831533432, -0.8656227588653564, 0.23616886138...
def detail _ view ( request ) : symbol ='spy'symbol = request. get. get ('usr _ search') template = loader. get _ template ('stocks / detail. html') stock _ data, company _ name = services. get _ stock ( symbol ) # gets stock info prediction _ data = services. generate _ predictions ( stock _ data ) # generates predict...
[ -0.5220731496810913, 0.1783335953950882, 0.7790229916572571, -0.3308480381965637, 0.14148518443107605, -0.06407464295625687, 0.35188430547714233, -0.24393369257450104, -0.43846598267555237, -0.21937543153762817, 1.07274329662323, 0.28117266297340393, 0.6588268876075745, 0.680270254611969, ...
def _ _ init _ _ ( _ _ self _ _, *, accelerators : optional [ pulumi. input ['workflowaccelerators'] ] = none, definition _ uri : optional [ pulumi. input [ str ] ] = none, description : optional [ pulumi. input [ str ] ] = none, engine : optional [ pulumi. input ['workflowengine'] ] = none, main : optional [ pulumi. i...
[ -0.3385123610496521, 0.04408980906009674, 0.7692773938179016, 0.16639256477355957, 0.627561628818512, -0.42826056480407715, -0.39592668414115906, 0.3580392897129059, -0.024041147902607918, 0.6341173052787781, -1.0158737897872925, 0.2206089198589325, 0.07864759862422943, 0.01474361494183540...
def convert _ e _ g ( self, valor ) : fator _ forca = 1 if self. parent. unidadeforca = = " [ kn ] - kilo newton " : fator _ forca = 1 elif self. parent. unidadeforca = = " [ lb ] - libra " : fator _ forca = 224. 8089431 elif self. parent. unidadeforca = = " [ klb ] - kilo libra " : fator _ forca = 0. 2248089431 elif s...
[ -0.637669563293457, 0.3019910752773285, 0.9201400279998779, -0.7741757035255432, -0.4723004102706909, 0.3782253563404083, 0.7893214225769043, -0.17795854806900024, -0.36992084980010986, 0.22603477537631989, 0.07450594753026962, 0.1867142617702484, 0.32924842834472656, 1.1757501363754272, ...
def convert _ output _ vector _ to _ nn _ format ( vector ) : converted _ vector = [ ] for result in vector : match _ result = [ 0, 0, 0 ] match _ result [ result ] = 1 converted _ vector. append ( match _ result ) return converted _ vector
[ -1.921737790107727, -1.4799610376358032, 0.46488696336746216, 1.015857458114624, 0.09969296306371689, -0.9170610904693604, 0.3708155155181885, -0.1565658301115036, 0.1717338263988495, 0.015005487948656082, -1.3027807474136353, -0.32938826084136963, 0.11470318585634232, 0.31342530250549316,...
def get _ retail _ site _ label ( retail _ site ) : return f'{ retail _ site. name } ( { retail _ site. get _ site _ url ( ) } ) '
[ -0.5941377282142639, -0.7405542731285095, 0.19452789425849915, -0.7041593194007874, 0.40566569566726685, 0.5450766682624817, 0.3006475567817688, -0.7512481212615967, 1.1026456356048584, 1.1264855861663818, 0.42213383316993713, 0.47895532846450806, 0.6303071975708008, -0.15179836750030518, ...
def mse _ from _ tgt _ indicies ( tnsr, targets ) : y _ ix = ( targets * tnsr. size ( - 1 ) ). round ( ). long ( ) tgt = torch. zeros _ like ( tnsr ) tgt. scatter _ ( 1, y _ ix. view ( - 1, 1 ), 1 ) return f. mse _ loss ( tnsr, tgt )
[ -0.8622900247573853, 0.02982650324702263, 0.3805038630962372, -0.5847660303115845, -0.30858904123306274, -0.5762584209442139, 0.23612435162067413, -0.11604827642440796, 0.4133422076702118, 0.8754189014434814, 0.4670559763908386, -0.007158489432185888, 0.5813520550727844, -0.176623761653900...
def crossing _ check ( coords _, balls _ ) : for ball _ in balls _ : if cross _ check ( coords _, ( ball _. x, ball _. y ), ball _. r + 50 ) : return true return false
[ -0.21544602513313293, -0.19802184402942657, 0.41573667526245117, 0.33696818351745605, 0.13712631165981293, 0.8364225625991821, 0.30148768424987793, 0.29553353786468506, -0.12759092450141907, 0.8284733295440674, -0.8439542055130005, -0.10643869638442993, -0.2734338641166687, -0.374377995729...
def show ( self ) : print ( text _ type ( self ) ) for child in self : child. show ( )
[ 0.4637085795402527, -0.41721850633621216, 0.4755927324295044, 0.025708522647619247, -0.2674155533313751, 0.16772644221782684, 0.6821773052215576, 0.13868239521980286, -0.2636025547981262, 0.10979096591472626, -0.23402877151966095, 0.8040896654129028, -0.17387200891971588, 1.554722785949707...
def collect _ add _ argparse ( parser, modules ) : def work _ in ( config, module, name ) : f = getattr ( module,'add _ arguments ', none ) if f is not none : f ( parser ) # this is * really handy * so we'll use it - - but it builds up a # partial config tree that we'll 100 % ignore _ walk _ config ( dict ( ), modules,...
[ -0.1079888567328453, -0.6030758023262024, 0.625560462474823, -0.11472677439451218, 0.30855873227119446, 0.3419911861419678, -0.4583202302455902, -0.5783175230026245, -0.08470850437879562, 0.14331361651420593, 0.2787306308746338, -0.3915155231952667, -0.41793158650398254, 1.1028461456298828...
def rndcreconfig ( ) : return subprocess. popen ( ['rndc ','reconfig'] )
[ -0.7912294268608093, 0.1325579285621643, 0.6205037236213684, -0.5172702670097351, -0.24236692488193512, -0.5474640727043152, 0.767674446105957, 0.09095408767461777, -0.3068216145038605, -0.15302042663097382, -0.5322679281234741, 0.47566407918930054, -0.1989840865135193, 0.6362732648849487,...
def test _ single _ boolean _ argument _ allowed ( assert _ errors, parse _ ast _ tree, argument, default _ options, ) : tree = parse _ ast _ tree ( single _ argument. format ( argument ) ) visitor = wrongfunctioncallvisitor ( default _ options, tree = tree ) visitor. run ( ) assert _ errors ( visitor, [ ] )
[ -0.32114171981811523, 1.1828670501708984, 0.4064372479915619, 0.4067901372909546, 0.6476473808288574, 0.7187866568565369, 0.6736646890640259, 0.9140394330024719, -0.09680786728858948, 0.368213415145874, 0.41738876700401306, 0.4172632694244385, 0.07226105779409409, 1.166380763053894, 0.29...
def sorted _ by ( seq : iterable [ t ], path : str, reverse = false ) - > iterable [ t ] : def key ( obj ) : return get _ path ( obj, path ) seq = list ( seq ) return sorted ( seq, key = key, reverse = reverse )
[ -0.3447001278400421, -0.6411325931549072, 0.4080030024051666, 0.4137449264526367, -0.2095623016357422, -0.702602744102478, -0.32258695363998413, 0.2873903512954712, -1.0130972862243652, 1.4537348747253418, -0.24925003945827484, 0.25175613164901733, 0.1423155665397644, -0.414018839597702, ...
def get _ project _ policies ( self, resource _ name, timestamp ) : project _ policies = { } try : cursor = self. conn. cursor ( ) cursor. execute ( select _ data. project _ iam _ policies _ raw. format ( timestamp, timestamp ) ) rows = cursor. fetchall ( ) for row in rows : try : proj _ parent = none if row [ 5 ] and ...
[ -0.05666636303067207, 0.4211857318878174, 0.5316085815429688, -0.8745538592338562, -0.6485927700996399, 0.32970163226127625, -0.8533116579055786, -0.8219241499900818, 0.020712843164801598, 0.7749961614608765, -0.29375797510147095, -0.5164522528648376, -0.04784153029322624, -0.4917089641094...
def _ _ init _ _ ( self, hass, ical _ events, sensor _ name, event _ number ) : self. _ event _ number = event _ number self. _ hass = hass self. ical _ events = ical _ events self. _ entity _ id = generate _ entity _ id ( " sensor. { } ", f " { sensor _ name } event { self. _ event _ number } ", hass = self. _ hass, )...
[ 0.353575199842453, -0.7173088192939758, 0.7045163512229919, 0.008154801093041897, 0.3535866439342499, 0.373332679271698, -0.019152766093611717, 0.4199170172214508, 0.9165657758712769, 0.03574610501527786, -0.3035329282283783, -0.2968457341194153, 0.4827835261821747, 0.02831910364329815, ...
def test _ rot _ job _ succeeded _ 3 ( self ) : phaser _ z _ score = 15 data = self. ps. _ rot _ job _ succeeded ( phaser _ z _ score ) self. asserttrue ( data )
[ 0.04266485199332237, 0.4286653995513916, 0.3528424799442291, 0.1722555011510849, -0.04166574403643608, 1.2912482023239136, -0.16681411862373352, 0.20327751338481903, -0.0007111072773113847, -0.38472166657447815, -1.056217908859253, 0.11294504255056381, -0.4874691069126129, -0.9800098538398...
def set _ hist _ fire _ firms ( self, df _ firms, centr _ res _ factor = 1. 0, centroids = none ) : self. clear ( ) # read and initialize data df _ firms = self. _ clean _ firms _ df ( df _ firms ) # compute centroids res _ data = self. _ firms _ resolution ( df _ firms ) if not centroids : centroids = self. _ firms _ ...
[ -0.4387606084346771, -0.06804491579532623, 0.4217897057533264, 0.9333125948905945, 0.482609361410141, -0.5678657293319702, 0.531711995601654, 0.6619202494621277, -0.009078407660126686, -0.42911818623542786, -0.02347617782652378, 0.06836763769388199, 0.5407027006149292, 0.8352200984954834, ...
def _ polar _ to _ cartesian ( theta, r ) : x = r * np. cos ( theta ) y = r * np. sin ( theta ) return x, y
[ -0.9466366171836853, -1.4942320585250854, 0.309882789850235, -1.7502962350845337, -0.47155919671058655, -0.3133822977542877, -0.9903636574745178, -0.2970578968524933, -0.8620280623435974, 0.3454071879386902, -0.33295580744743347, -0.510137677192688, 0.21003590524196625, -1.2930572032928467...
def post ( org _ id ) : request _ json = request. get _ json ( ) valid _ format, errors = schema _ utils. validate ( request _ json,'affiliation') bearer _ token = request. headers ['authorization']. replace ('bearer ','' ) is _ new _ business = request. args. get ('newbusiness ','false'). lower ( ) = ='true'if not val...
[ -1.0637160539627075, -0.18954741954803467, 0.793978214263916, 1.0807499885559082, 0.15509918332099915, 0.8710705041885376, 0.7674047946929932, 0.4653589725494385, 0.4028937816619873, 0.8956427574157715, -0.2915746867656708, 0.8757762908935547, -0.8847607374191284, 0.9547346234321594, 0.5...
def getallmatchingconditions ( conditions, condition _ to _ match ) : found _ matches = set ( ) # check all attributes of condition for matching values. def accepts _ all _ values ( attribute ) : return getattr ( condition _ to _ match, attribute ) = ='*'attributes _ to _ check = [ a for a in attr if not accepts _ all ...
[ -0.19117514789104462, -0.03726331889629364, 0.751079261302948, 0.4429294168949127, -0.3474794626235962, 0.048533592373132706, -0.34887048602104187, 0.51810222864151, -0.9353207945823669, -0.13428734242916107, 0.7724124789237976, -0.3036634027957916, 0.3226287364959717, 0.43978798389434814,...
def child _ by _ name ( self, name ) : for child in self. children : if child. name = = name : return child
[ 0.5691973567008972, -0.7522180080413818, 0.107986219227314, -0.17879268527030945, -1.1817090511322021, -0.06881337612867355, 0.16134929656982422, -1.3269394636154175, -1.1029349565505981, 0.2872466444969177, -0.45788949728012085, 0.012789767235517502, 0.10824474692344666, -0.68440008163452...
def print _ reg ( self, address ) : reg _ num = self. ram [ address + 1 ] print ( self. reg [ reg _ num ] )
[ -0.5154625177383423, 0.33833134174346924, 0.5987469553947449, -0.05304339528083801, -0.16142021119594574, -0.16615915298461914, 1.1432636976242065, 0.1867343932390213, 0.26478350162506104, -0.23684300482273102, -0.11811003088951111, 2.3089981079101562, -0.6926009058952332, -0.4313651323318...
def test _ media _ partner _ user _ type ( self ) : media _ partner = mediapartner. objects. get ( id = 402 ) self. login ( media _ partner. email ) response = self. client. get ('/ hudson - valley / media - partner /') self. assertequal ( response. status _ code, 200 )
[ -0.7668436765670776, 0.14300252497196198, 0.503547191619873, 0.602542519569397, 0.05992701277136803, 0.6770061254501343, 0.22646266222000122, 0.4657565951347351, 0.810379147529602, -0.3474760949611664, -0.18898093700408936, 0.09129104763269424, -1.0117213726043701, 0.2336653172969818, 0....
def simplify ( ips ) : nets = ipset ( ips ) return sorted ( nets. iter _ cidrs ( ) )
[ -0.3969840407371521, 0.7140163779258728, 0.3653174042701721, 0.07946638762950897, -0.6160350441932678, -0.637751042842865, -0.03871333599090576, -0.9178359508514404, 1.0227301120758057, 0.16196882724761963, -0.0022966223768889904, -0.8212566375732422, 0.011168048717081547, -0.9222157597541...
def test _ addcallbacksextraargumentsoncallback ( self ) : sd = synchronousdeferred ( " foo " ) l = [ ] def cb ( r, extra, more = none ) : l. append ( ( r, extra, more ) ) sd. addcallbacks ( cb, lambda ignored : none, ( 1, ), { }, { " more " : " heyo " }, { } ) self. assertequals ( l, [ ( " foo ", 1, " heyo " ) ] )
[ 0.6148032546043396, 1.1456199884414673, 0.7376105189323425, -0.005776447243988514, 0.4198545515537262, 0.2855181097984314, -0.9294490218162537, 0.28537386655807495, 0.8731987476348877, -0.7472109794616699, -1.346522331237793, -0.19531506299972534, -0.49343615770339966, 0.8050934672355652, ...
def extract _ timestamp ( self, time _ string ) : tr _ ts, iso _ ts = none, none # define helper function for parsing the string using regex def search _ regex ( self, time _ string, regex _ exprs ) : " " " hidden function used for searching a string using an array of regex expressions " " " ret _ str = none ts _ parts...
[ 0.6570696234703064, 0.06055299565196037, 0.7130749821662903, 0.2983610928058624, 0.5254009962081909, 0.0635547786951065, -0.03729301318526268, -0.24217969179153442, -0.2690126597881317, 0.48968520760536194, 0.9357945919036865, -0.25053301453590393, -0.1666877567768097, 0.6564928293228149, ...
def not ( q1, q2 ) : return openlegislationset ( q1, q2,'not')
[ -0.18252532184123993, -0.651812732219696, 0.466590940952301, -0.5750068426132202, -1.292332649230957, 0.6257949471473694, -0.8119736909866333, -0.64104163646698, -0.6566243767738342, -0.9859268069267273, 0.9408591389656067, 0.23211489617824554, -0.6786014437675476, -1.40062415599823, -0....
def table _ exists ( self, table ) : #, force = false self. _ tables _ init ( ) return table in self. tables. keys ( )
[ -1.1552554368972778, 0.6658667325973511, 0.2976645827293396, 0.4981112778186798, 0.21948055922985077, 0.3815786838531494, -0.3228127956390381, -0.04440692439675331, -0.20625635981559753, -0.0871235653758049, -0.7066687345504761, 0.11048456281423569, 0.0053240894339978695, 0.514638781547546...
def is _ valid _ move ( input _ square, grid ) : return grid [ input _ square ]! ='x'and grid [ input _ square ]! ='o '
[ -0.6762622594833374, -0.13268330693244934, 0.36670002341270447, 0.6357548236846924, -0.7706261277198792, -0.06391216069459915, -0.5800973773002625, -0.16849008202552795, 0.5498796701431274, 0.7004519104957581, -0.09984173625707626, 0.41795283555984497, -0.18421801924705505, 0.1460204124450...
def test _ parse _ empty _ http ( self ) : cpe _ string = b'' server = serverbase ( self. app ) ctx = methodcontext ( server, methodcontext. server ) ctx. in _ string = [ cpe _ string ] ctx, = server. generate _ contexts ( ctx ) if ctx. in _ error is not none : print ('in error : % s'% ctx. in _ error ) self. assertequ...
[ -0.3021758496761322, -0.03681540861725807, 0.45083221793174744, 0.08351260423660278, 0.8456960320472717, 0.5796096920967102, 0.16852009296417236, 0.03713849186897278, -0.04737956449389458, -0.7420730590820312, -0.4619678258895874, 0.5883643627166748, -0.9636589288711548, -0.127698555588722...
def predict ( self, x ) : return - 1 if np. dot ( self. weights, x ) < 0 else + 1
[ -0.9790391325950623, 0.2997962534427643, 0.6943711042404175, 0.6301447749137878, -0.7290931940078735, 0.5300988554954529, -0.04522591456770897, -0.29823148250579834, -0.11378074437379837, -0.3858584761619568, -0.36425232887268066, 0.29092955589294434, -0.33594831824302673, 0.24617680907249...
def amount ( self ) : return self. _ games _ played
[ 0.4257349669933319, -0.33396977186203003, 0.6547064185142517, -0.48905473947525024, 0.5701946020126343, 0.5212296843528748, 0.7195006012916565, -0.9911917448043823, 0.2887827754020691, 0.3885710537433624, -0.4281403720378876, 0.14255939424037933, 0.3884802460670471, -0.5219354033470154, ...
def _ max _ name _ len ( ) : return max ( [ len ( name ) for name in _ state. runs _ by _ name ] )
[ 1.0262024402618408, 0.03717465698719025, 0.43102124333381653, -0.4147728979587555, -0.47255781292915344, 0.32409918308258057, -0.9964298009872437, -0.10352592915296555, -0.1881953477859497, 0.64823317527771, -0.5399696230888367, -0.17934735119342804, 0.6766582131385803, 0.34580832719802856...
def objective _ exstracs ( trial, est, x _ train, y _ train, randseed, hype _ cv, param _ grid, scoring _ metric ) : params = {'learning _ iterations': trial. suggest _ categorical ('learning _ iterations ', param _ grid ['learning _ iterations'] ),'n': trial. suggest _ categorical ('n ', param _ grid ['n'] ),'nu': tri...
[ 0.6636056303977966, 0.5998923182487488, 0.746934175491333, 0.7698869705200195, -0.052529241889715195, -0.1236456111073494, -0.6479539275169373, 0.348097026348114, -0.5726029276847839, 1.1812978982925415, 0.5748646855354309, 0.7999956011772156, 0.5497855544090271, -0.38382670283317566, 0....
def preprocess ( self, data, attr ) : cfg = self. cfg points = np. array ( data ['point'], dtype = np. float32 ) if data. get ('label') is none : labels = np. zeros ( ( points. shape [ 0 ], ), dtype = np. int32 ) else : labels = np. array ( data ['label'], dtype = np. int32 ). reshape ( ( - 1, ) ) if data. get ('feat')...
[ 0.08396723121404648, 0.4680412709712982, 0.9285784959793091, -0.4772457778453827, -0.6369954347610474, -0.43423154950141907, 0.11426616460084915, 0.3388245701789856, 0.7686516642570496, 0.7438795566558838, 0.3866795301437378, 0.3179357647895813, 1.0162897109985352, 0.303775817155838, 0.5...
def weighted _ choice ( lst ) : n = rnd ( 0, sum ( [ x [ 1 ] for x in lst ] ) ) for item, weight in lst : if n < weight : break n - = weight return item
[ 0.2029457986354828, -0.4989752769470215, 0.6566314101219177, 1.2187575101852417, -0.5694491267204285, 0.9973147511482239, -0.036241233348846436, -0.4004959464073181, 0.3061806261539459, 0.4827567934989929, -0.45458662509918213, -0.412233829498291, -0.8615469932556152, 0.5495152473449707, ...
def test _ get _ _ unauthenticated ( self ) - > none : response = self. client. get ( self. path ) assert httpstatus. ok = = response. status _ code self. assertnotcontains ( response, " follow " ) self. assertnotcontains ( response, " unfollow " ) self. assertcontains ( response, self. first _ subject. title, count = ...
[ -0.2749936580657959, 0.2015504688024521, 0.5070333480834961, -0.019400816410779953, 0.8660358786582947, 0.8819035887718201, -0.2732904255390167, -0.6661280989646912, -0.15730124711990356, -1.2617120742797852, -0.1871747374534607, 0.32018452882766724, 0.022424088791012764, -0.35741466283798...
def tile _ label _ from _ file ( path ) : try : return np. array ( image. open ( os. path. expanduser ( path ) ) ). astype ( int ) except : return none
[ -0.3990180194377899, -1.1338772773742676, 0.6940674185752869, -0.8634471297264099, -0.6265621185302734, 0.5580031871795654, 0.6254616379737854, -1.2394293546676636, -0.0452534444630146, 1.2413220405578613, 0.09716565907001495, -0.005874766502529383, -0.36168956756591797, -0.162112802267074...
def itkimageserieswriterif3if2 _ cast ( * args ) : return _ itkimageserieswriterpython. itkimageserieswriterif3if2 _ cast ( * args )
[ -0.0885557308793068, -0.15033578872680664, -0.14529480040073395, -0.4380299150943756, 0.21189649403095245, -0.22833044826984406, -0.7155707478523254, -0.5400139093399048, -0.20905359089374542, 1.424342393875122, 0.3098633289337158, 0.03393198177218437, -0.33728352189064026, -0.047089617699...
def get _ expected _ proton _ counts ( self, fit _ function, time, * * kwargs ) : if self. proton _ migration _ matrix is none or self. proton _ effective _ area is none : return 0 return self. _ get _ expected _ counts ( fit _ function, self. proton _ migration _ matrix, self. proton _ effective _ area, * * kwargs ) *...
[ -0.42064905166625977, 0.1736575812101364, 0.5197120904922485, 0.4066120386123657, 0.6276612281799316, 0.5370128154754639, -0.5303148627281189, 0.5198676586151123, -0.646087110042572, -0.5330743193626404, 0.16092956066131592, 0.8083574175834656, 0.1811315268278122, 0.9536751508712769, 0.2...
def create _ django _ user ( tiki _ user ) : user = user ( id = tiki _ user. userid ) user. username = tiki _ user. login user. email = tiki _ user. email user. date _ joined = \ datetime. fromtimestamp ( tiki _ user. registrationdate ). isoformat ('' ) user. save ( ) return user
[ -0.5635154843330383, 0.27805155515670776, 0.2361035943031311, 0.5442743301391602, 0.34216517210006714, 0.8823636770248413, 0.48997679352760315, -0.4708515405654907, -0.5531733632087708, 0.32121944427490234, -0.9072713255882263, -0.7120737433433533, -0.2534589171409607, 0.14431864023208618,...
def split _ text _ logically _ and _ prefix ( field _ text, character _ limit = 0, prefix ='' ) : splitted _ lines = split _ text _ logically _ on _ character _ limit ( field _ text, character _ limit ) prefixed _ text = prefix _ lines _ with ( splitted _ lines, prefix ) return prefixed _ text
[ 0.7831789255142212, -0.4435599148273468, 0.2442181557416916, -0.17961260676383972, -0.3900168836116791, -1.0078843832015991, -0.9745543003082275, 0.9144667387008667, 1.1712106466293335, 0.6587364673614502, 0.1181633323431015, 0.5476564764976501, 0.42381346225738525, 0.13947202265262604, ...
def compute _ riemann _ trajectories ( states, s, riemann _ eval, wave _ types = none, i _ vel = 1, num _ left = 10, num _ right = 10, rho _ left = none, rho _ right = none, xmax = none ) : xmax _ auto = ( xmax is none ) tmax = 1. 0 if xmax _ auto : xmax = 0. for i in range ( len ( s ) ) : if wave _ types [ i ] in ['sh...
[ -0.0033372524194419384, 0.12850850820541382, 0.8294495344161987, 0.37463071942329407, -0.06221238523721695, -0.539911687374115, 0.17067652940750122, 0.4367712140083313, 0.335872083902359, 0.6087331771850586, -0.327371746301651, -0.31117531657218933, 0.13965973258018494, 0.8174960017204285,...
def simple _ receive _ udp ( ipi, porti, maxsize = 64, clean _ loop = 1 ) : buffer _ size = 2 + maxsize * 4 # 2 bytes are the header and maxsize * 4 bytes are the spikes per packet socki = socket. socket ( socket. af _ inet, # ip socket. sock _ dgram ) # udp socki. setsockopt ( socket. sol _ socket, socket. so _ reusea...
[ 0.25042399764060974, 0.716447651386261, 1.0337553024291992, 0.4670247435569763, -0.29300135374069214, -0.3163837492465973, -0.1105983555316925, -0.7209008932113647, -0.040131282061338425, -0.8056901097297668, -0.19911950826644897, 0.774314820766449, -0.3643065392971039, -0.4635294079780578...
def terminate ( self ) : self. send _ message _ to _ manager ( messages. terminationrequestmessage ( ) )
[ -0.868858814239502, 0.3509701192378998, 0.45039883255958557, 0.49892735481262207, 0.7012271285057068, -0.7356119751930237, -0.7051522731781006, -0.4206702709197998, -0.19509275257587433, -1.0124742984771729, 0.019752738997340202, 0.4210895895957947, -1.1065787076950073, 0.8613478541374207,...
def getrenderederrormessage ( errormessage ) : templatevalues = {'error _ message': errormessage } return getrenderedtemplate ( pathtoerrormessagetemplate, errormessagetemplatefilename, templatevalues )
[ -0.787431001663208, 0.3332184851169586, 0.08058460056781769, -0.43248310685157776, 0.010842053219676018, -0.15593984723091125, -0.21049374341964722, 0.24231263995170593, 0.14414554834365845, -0.43728095293045044, 0.2402360737323761, 0.28571686148643494, -0.9420093297958374, 0.0420327000319...
def _ _ init _ _ ( self, options = none, metrics = none, analytics = none, state = none, trace = none ) : self. _ options = none self. _ metrics = none self. _ analytics = none self. _ state = none self. _ trace = none self. discriminator = none if options is not none : self. options = options if metrics is not none : ...
[ 1.1554760932922363, 0.6097171306610107, 0.5817697644233704, 0.1833646595478058, 1.1332614421844482, -0.3904595375061035, 0.27678385376930237, -0.05630124360322952, 0.7843894958496094, -0.697419285774231, -0.12210539728403091, 0.5682394504547119, 0.36837565898895264, -0.03316739201545715, ...
def remover _ cancion _ sin _ guardar ( self, ruta _ cancion ) : cancion = cancion ( ruta _ cancion ) posicion = self. lista _ canciones. index ( cancion ) if posicion : self. lista _ canciones. pop ( posicion ) return true return false
[ -0.7742834687232971, -0.638296902179718, 0.7195925116539001, 0.7293204069137573, 0.0989966168999672, 0.40130674839019775, 0.06799125671386719, 0.5976245999336243, 0.16510531306266785, 0.6754724979400635, -1.3858859539031982, -0.43267568945884705, -1.3938524723052979, -0.38712775707244873, ...
def compute _ stats ( output ) : tf. logging. info ('computing aggregate statistics from % s ', output ) stat _ list = [ stats. proof _ log _ stats ( log ) for log in io _ util. read _ protos ( output, deephol _ pb2. prooflog ) ] if not stat _ list : tf. logging. info ('empty stats list.') return aggregate _ stat = sta...
[ -0.10594829171895981, 0.7139930129051208, 0.281440407037735, 0.6836360692977905, 0.6043634414672852, -0.3367958664894104, 0.735078752040863, 0.08677772432565689, -0.17398901283740997, -0.09018778800964355, -0.1359463781118393, 0.39436107873916626, 0.8390827178955078, 0.2515055537223816, ...
def remove _ benchmarked _ city ( city _ id ) : if not os. path. exists ( cache _ user _ json ) : raise exception ('no api key yet registered') with open ( cache _ user _ json,'r') as user _ file : user = json. loads ( user _ file. read ( ) ) if not'benchmarked _ cities'in user : print ('no benchmarked city yet') sys. ...
[ 0.1357087790966034, -0.17027635872364044, 0.3352636694908142, -0.31901535391807556, -0.33980798721313477, 0.4500316083431244, 0.6787600517272949, 0.3639136552810669, -0.1844024956226349, 0.636221170425415, -1.352463722229004, 0.5941017866134644, -0.46060246229171753, 0.591306209564209, -...
def echo ( request, string ) : return string
[ -0.5135451555252075, -1.0766130685806274, 0.3339229226112366, 0.40511876344680786, -1.3512499332427979, 0.5911885499954224, -0.6627100706100464, -1.1815083026885986, -0.13780395686626434, -0.8937243223190308, 0.4177871644496918, 0.3834402561187744, -0.37889155745506287, -0.9092837572097778...
def create2a ( address, appfile, outfile, dcd, csf, offset, plugin, version ) : try : boot _ image = bootimg2 ( address, offset, version, plugin ) # open and import application image with open ( appfile,'rb') as f : boot _ image. app. data = f. read ( ) # open and load / parse dcd segment if dcd is not none : if dcd. l...
[ -0.1396769881248474, -1.1030399799346924, 0.49280837178230286, 0.3790472745895386, -0.7173465490341187, 0.6558617353439331, 0.05801703408360481, -0.19777332246303558, -0.12638257443904877, -0.38797295093536377, 0.09903223812580109, 0.550270676612854, 0.3864992558956146, 0.8517717123031616,...
def remover _ cancion ( self, ruta _ cancion ) : try : resultado = self. remover _ cancion _ sin _ guardar ( ruta _ cancion ) self. guardar _ accion ( ruta _ cancion, self. removida ) return resultado except ( tinytagexception, lookuperror, oserror ) : return false
[ -0.9017507433891296, -0.2785106599330902, 0.7189183235168457, 1.0165135860443115, -0.3785272240638733, 0.10604330152273178, 0.8698057532310486, 0.06424473226070404, 0.48075389862060547, 0.32106614112854004, -0.4770509600639343, -0.4574287235736847, -1.2438863515853882, -0.38430118560791016...
def health _ check ( self ) - > bool : request = create _ heartbeat _ request ( f'health check from { self. name }') try : return self. read _ client. find ( request ) and self. store _ client. find ( request ) except runtimeerror : return false
[ 0.27568918466567993, -0.2614748775959015, 0.6490551233291626, 0.6942989826202393, 0.40110117197036743, 1.1338696479797363, -0.529943585395813, -0.14058110117912292, -0.18709075450897217, -0.7965172529220581, 1.2907062768936157, 0.45382052659988403, -0.9812257289886475, 0.07119271159172058,...
def calculate _ letter _ count ( ones, tens, hundreds ) : # less than 10, return just ones count if ( not tens ) and ( not hundreds ) : return ones _ dict [ ones ] # somewhere in the teens if ( not hundreds ) and ( tens = = 1 ) : return teens _ dict [ ones ] # greater than teens, but less than 100 if ( tens > 1 ) and (...
[ -0.7334893941879272, -0.5156692266464233, 0.5773711204528809, -1.3027336597442627, -0.4944499135017395, -0.06461299955844879, 0.5169178247451782, 0.10775240510702133, 0.5407696962356567, 0.4677315950393677, -0.8701816201210022, 0.11507607996463776, 0.45872727036476135, 0.08411811292171478,...
def test _ singletimetiffpathprocessor _ process ( self ) : pp = self. config. path _ processor _ class pp. setup ( self. config. get _ path _ processor _ params ( ) ) assert pp. process ( 0, 0, 0, 0 ) = = os. path. join ( resource _ filename ( " ingestclient ", " test / data " ), " test _ multipage. tif " )
[ 0.7385408878326416, -0.11828051507472992, 0.4400700628757477, -0.0037354999221861362, 0.8799716234207153, 0.7255058884620667, 1.0061001777648926, 0.47370511293411255, 0.32358697056770325, 0.6262025833129883, 0.35318723320961, -0.46011975407600403, -0.18727608025074005, 0.7469844222068787, ...
def confirm _ move ( self, move _ data ) : # shorter names new _ sa = move _ data. predicted _ surface _ area ( ) # probability of the new sphere p _ new = self. fitness _ function ( new _ sa ) # probability of the old sphere p _ old = self. fitness _ function ( self. current _ state. surface _ area ( ) ) # probability...
[ -0.42793726921081543, -0.016262535005807877, 0.7422221899032593, 0.40477702021598816, -0.797018826007843, 0.8589239716529846, 0.2636604309082031, 0.04773049056529999, 0.10768427699804306, 0.6781039237976074, 0.1524144560098648, 0.6176081299781799, -0.3367723524570465, 0.31920257210731506, ...
def _ compute _ fates ( self ) : # compute the convolved matrix of neighbors con = convolve ( self. cells, self. weights, mode ='wrap') # here's the trick : we assigned 10 to the central element of the # weights kernel. therefore, currently dead cells will have a value # of 0 - 8 in the convolved matrix, and currently ...
[ 0.4742036461830139, 0.6275038719177246, 0.5899573564529419, 0.697508692741394, 0.7001899480819702, -0.14918376505374908, -0.2274240404367447, 0.6579962968826294, -0.4109404683113098, -0.019768496975302696, -0.07040487229824066, -0.31844502687454224, 0.9464504718780518, 0.8715251088142395, ...
def send _ message _ over _ amb ( amb _ msg _ obj, sender _ channel, msg _ subject, message _ broker ) : writer = none status = false last _ mid = none amb _ connection = false try : writer = amb. mb _ queue _ init _ writer ( sender _ channel, _ event _ cb, none ) except exception, e : if str ( e ) = ='not connected': ...
[ -0.18500567972660065, -0.32323893904685974, 0.9791488647460938, 0.13639558851718903, 0.6794912219047546, 0.05437184497714043, 0.2921794652938843, -0.2389141321182251, -0.34225109219551086, 0.7657954096794128, -0.2673971652984619, -0.20620238780975342, -1.1148207187652588, 1.304712295532226...
def enable _ eval _ dropout ( self ) : for module in self. seg _ model. modules ( ) : if'dropout'in type ( module ). _ _ name _ _ : module. train ( )
[ -0.08692190796136856, -0.15495418012142181, 0.5922791957855225, 0.06009456142783165, 0.9311040043830872, 1.0864633321762085, 0.3059299886226654, 1.1985254287719727, -0.34660211205482483, 0.13517585396766663, -0.7034735679626465, 0.051435261964797974, 0.0573175847530365, 0.305319219827652, ...
def find _ pairs ( simname, coords _ loc = [ 3, 6 ] ) : distances = { } dist _ vec = { } coord = extract. extract _ unwrapped ( simname ) for key in coord : current _ timestep = coord [ key ] type2 = current _ timestep [ current _ timestep ['type'] = = 2 ]. iloc [ :, coords _ loc [ 0 ] : coords _ loc [ 1 ] ]. values # ...
[ -0.6418573260307312, -0.560883104801178, 0.8800470232963562, -0.4470413625240326, -0.45345449447631836, -0.36827126145362854, 1.3035725355148315, 0.12163745611906052, -0.5852313041687012, 1.1996182203292847, -0.6514614820480347, -0.26426753401756287, 0.27343520522117615, 0.654259204864502,...
def get _ window _ stats ( self, item, * identifiers ) : remaining = max ( 0, item. amount - self. storage ( ). get ( item. key _ for ( * identifiers ) ) ) reset = self. storage ( ). get _ expiry ( item. key _ for ( * identifiers ) ) return ( reset, remaining )
[ 0.10824672132730484, -0.5986464619636536, 0.33909568190574646, 0.23969435691833496, 0.004258410539478064, -0.004985767416656017, -0.3517727255821228, -0.849980354309082, 0.3178609013557434, 0.6313931345939636, -0.7535269856452942, 0.5188755989074707, -0.9871364831924438, -0.037062656134366...
def random _ string ( n : int = 10 ) - > str : chars = string. ascii _ lowercase + string. ascii _ uppercase + string. digits res = " " for _ in range ( n ) : res + = random. systemrandom ( ). choice ( chars ) return res
[ -0.5651921033859253, 0.03674805164337158, -0.02130625955760479, -0.7803320288658142, 0.6230990886688232, 0.5215709209442139, -0.5143963694572449, -0.9466459155082703, 0.2607553005218506, -0.26848286390304565, 0.29413506388664246, 0.07161134481430054, -0.1209191307425499, -0.353557854890823...
def _ downloadtofile ( url : str, localfile : path ) - > tuple [ path, int ] : total = 0 with requests. get ( url, stream = true ) as req : req. raise _ for _ status ( ) with open ( localfile,'wb') as fobj : for chunk in req. iter _ content ( chunk _ size = 8192 ) : if chunk : # filter out keep - alive new chunks fobj....
[ 0.31417667865753174, -0.46841222047805786, 0.7038472890853882, -0.5865506529808044, 0.47156664729118347, -0.26947253942489624, 0.29322385787963867, 0.3743384778499603, -0.803288996219635, 0.21856430172920227, -0.6439772844314575, -1.2016968727111816, -0.020969653502106667, -0.2300128936767...
def auth _ date ( self, auth _ date ) : if ( self. local _ vars _ configuration. client _ side _ validation and auth _ date is not none and not re. search ( r'yyyy - mm - dd hh : mm : ss ', auth _ date ) ) : # noqa : e501 raise valueerror ( r " invalid value for ` auth _ date `, must be a follow pattern or equal to ` /...
[ 0.5758688449859619, -0.23187588155269623, 0.32895976305007935, 0.6787365674972534, -0.11399083584547043, 0.9788668155670166, 0.5933417081832886, -0.22746515274047852, -0.08841375261545181, -0.34184765815734863, -0.20588275790214539, 0.8546594381332397, 0.41787785291671753, 0.69304788112640...
def read _ mask ( paths, read _ size ) : masks = np. zeros ( ( len ( paths ), read _ size [ 0 ], read _ size [ 1 ], 1 ), dtype = np. uint8 ) for i, p in enumerate ( paths ) : mask = cv2. imread ( p, cv2. imread _ grayscale ) # squeeze the third dimension if present. if len ( mask. shape ) > 2 : mask = mask [ :, :, 0 ] ...
[ -1.2387757301330566, -0.2918703854084015, 0.7513312697410583, 0.883105456829071, 0.8597554564476013, -0.3177914023399353, 0.14026464521884918, -0.48158732056617737, 0.2510976493358612, 0.6257731914520264, 0.8134346008300781, -0.5462334156036377, 0.291660338640213, -0.7523189783096313, -0...
def get _ notes ( ) : soundlist = [ ] for i in range ( 36 ) : soundlist. append ( str ( i ) ) gl. notes = easyaudio ( soundlist, " / / samples / " )
[ 0.22133737802505493, 0.2646423876285553, 0.3661550283432007, -0.38169142603874207, 1.0666273832321167, 0.15032117068767548, -0.32534971833229065, -0.8552120327949524, 0.19128108024597168, 0.04920037090778351, -0.9755117297172546, -0.09902317076921463, -0.3242112696170807, 0.017418108880519...
async def test _ form _ reauth _ invalid ( hass : homeassistant, entry : mockconfigentry ) - > none : await setup _ integration ( hass, entry ) assert entry. state = = config _ entries. configentrystate. loaded with requests _ mock. mocker ( ) as mock _ request : mock _ request. get ( " https : / / user - api. wall - b...
[ -0.581108570098877, -0.1195567324757576, 0.5353872776031494, 0.19712120294570923, 0.6065716743469238, -0.47949454188346863, -0.37642934918403625, 0.3394968509674072, 0.3682100474834442, -0.409048855304718, -0.8595823645591736, 0.044039394706487656, 0.20678427815437317, 0.19836537539958954,...
def initializecpu ( self, * args ) : self. cpu, self. sets, start, cshape = args self. start = numpy. int32 ( start ) self. cpuarray = numpy. zeros ( cshape )
[ -0.2545475363731384, 0.17505459487438202, 0.5226699113845825, 0.21410125494003296, 0.7686839699745178, 0.33267632126808167, 1.1664965152740479, -0.2337622493505478, -0.6226686239242554, -0.44468092918395996, -0.4303634762763977, 0.6956146955490112, -0.7076042890548706, 0.5008483529090881, ...
def zone ( self, zone : list [ zoneinfo ] ) : self. _ zone = zone
[ -0.7051104307174683, -0.08760090917348862, -0.25240015983581543, 0.7938655614852905, 0.672291100025177, 0.5674961805343628, 0.4841347336769104, 1.2271783351898193, 0.3179405927658081, -0.6304725408554077, -1.8438842296600342, -0.35994046926498413, 0.0030684981029480696, 1.2589569091796875,...
def _ _ init _ _ ( self, parent = none ) : # init qtgui. qgraphicsview. _ _ init _ _ ( self, parent ) # set background color self. setbackgroundbrush ( qtgui. qbrush ( qtgui. qcolor ( 126, 126, 126, 255 ) ) ) self. setrenderhint ( qtgui. qpainter. antialiasing ) # show init message self. init _ message ( ) # connect to...
[ 0.7314296960830688, -0.3951228857040405, 0.7572024464607239, -0.4072754681110382, -0.8286404609680176, -0.2542048990726471, 0.49266546964645386, -0.2664429247379303, -0.00035668580676428974, -0.7144744396209717, -0.20688548684120178, -0.16084977984428406, 0.5173312425613403, 0.522279322147...
def fit ( self, net, trgen, cvgen, criterion, optimizer, epoch, totalepoch ) : correct _ cv = 0. 0 total _ cv = 0. 0 net. eval ( ) running _ loss _ cv = 0. 0 for j, data in enumerate ( cvgen, 0 ) : images, label = data bp ( ) # label = label. astype ( numpy. int64 ) label = torch. from _ numpy ( label ) label = label. ...
[ 0.12368286401033401, -0.8828206658363342, 0.8296869397163391, 0.4542917311191559, 0.690832257270813, -0.07837460935115814, 1.0175704956054688, 0.3251463770866394, -0.6970662474632263, 0.5688874125480652, -0.46886155009269714, 0.3675525188446045, 0.049197643995285034, 0.4688175916671753, ...
def _ root ( self ) : default = os. path. join ( os. path. dirname ( _ _ file _ _ ), '.. / static') return os. path. abspath ( default )
[ 0.5836866497993469, -0.31729593873023987, 0.6350018978118896, 0.9246631264686584, 0.2512107491493225, 1.2850590944290161, 0.9021977782249451, -0.5436422228813171, -0.5450283288955688, 0.15720774233341217, 0.3039591312408447, 0.8027873039245605, -0.16346004605293274, 0.6537980437278748, -...
def generate _ maze ( self, maze _ number ) : # makes sure input is valid, if not return a maze with default index. if not maze _ number < len ( mazes. maze _ tuple ) : maze _ number = 1 return mazes. maze _ tuple [ maze _ number ]
[ -1.4684144258499146, 0.7925790548324585, 0.31775030493736267, 0.7818505764007568, 0.5537681579589844, -0.03919856622815132, 1.1891528367996216, 0.22504360973834991, 0.668874979019165, -0.6394534707069397, -0.12737210094928741, -0.876735508441925, -1.0400222539901733, 0.055843550711870193, ...
def get _ object ( self, pk ) : with self. _ cm. session _ scope ( ) as session : obj = none try : obj = session. query ( self. _ model ). get ( pk ) except exception as e : logger. error ( e ) raise finally : return obj
[ -0.4606877863407135, -0.315031498670578, 0.45253080129623413, 0.14193816483020782, 0.08474154770374298, -0.1041923239827156, 0.5514748692512512, -1.028530240058899, 0.3100832998752594, -0.01880139857530594, 0.10108686238527298, 0.15801890194416046, -0.012416483834385872, -0.955321133136749...
def get _ version ( self ) : change _ log _ relative _ path = ".. /.. / changelog. md " change _ log _ path = os. path. abspath ( os. path. join ( root _ dir, change _ log _ relative _ path ) ) try : with open ( change _ log _ path, mode = " r ", encoding = " utf - 8 " ) as file _ change _ log : txt = file _ change _ l...
[ 0.9224058389663696, -1.277925968170166, 0.6951630115509033, 0.5542231202125549, -0.6333641409873962, 0.038459379225969315, -0.005562970414757729, -0.2519419193267822, -0.9226597547531128, 0.7425581216812134, 0.455564022064209, 0.445823609828949, 0.16724756360054016, 0.25969910621643066, ...
def savedata ( self ) : data = super ( footcomponentguide, self ). savedata ( ) # data ['footctrlcrvdata'] = self. footctrl. getcurvedata ( ) data ['anklexfo'] = self. anklectrl. xfo data ['toexfo'] = self. toectrl. xfo data ['toetipxfo'] = self. toetipctrl. xfo data ['backpivotxfo'] = self. backpivotctrl. xfo data ['f...
[ -0.282503217458725, -0.33996424078941345, 0.5613692998886108, -0.7311845421791077, 0.28953292965888977, 0.33830440044403076, -0.1673227697610855, -0.35092151165008545, -0.0795426219701767, -0.1910167634487152, -1.035139799118042, -0.8730714917182922, -0.059587154537439346, 0.59261435270309...
def generate _ sentence ( word1, word2, length, vocab, model ) : reverse _ vocab = { idx : word for word, idx in vocab. items ( ) } output _ string = np. zeros ( ( 1, length ), dtype = np. int ) output _ string [ :, : 2 ] = vocab [ word1 ], vocab [ word2 ] for end in range ( 2, length ) : print ( output _ string ) star...
[ 0.12603341042995453, -0.3374958336353302, 0.7707860469818115, 0.28162524104118347, -0.033931806683540344, -0.7430204749107361, -0.3159339725971222, -0.1708633005619049, -1.2948172092437744, 1.0860389471054077, -0.5398565530776978, 0.7714413404464722, -0.5796172022819519, -0.160779654979705...
def find _ sitename ( self ) : if self. experiment _ metadata : return _ _ internal _ _. case _ insensitive _ find ( self. experiment _ metadata,'site') return none
[ 0.01973116397857666, 0.4397757351398468, 0.45170775055885315, -0.033167000859975815, 0.01127043180167675, -0.2948669195175171, 0.48438960313796997, -0.8107131123542786, -0.29538583755493164, 0.47323018312454224, 1.2916795015335083, -0.005539511330425739, -0.9846966862678528, -0.11348771303...
def get _ mt _ type _ from _ acm _ obj ( acm _ obj ) : try : return fswiftmlutils. calculate _ mt _ type _ from _ acm _ object ( acm _ obj ) except exception, e : notifier. error ( " error in calculating message type for % s : % s % s " % ( str ( type ( acm _ obj ) ), str ( acm _ obj. oid ( ) ), str ( e ) ) ) notifier....
[ 0.6159532070159912, 0.10271918028593063, 0.5137074589729309, -0.5456886291503906, -0.2773750126361847, -0.8516854643821716, 1.0108075141906738, -1.2124302387237549, 0.3702695667743683, 0.17197352647781372, 0.08068063110113144, 0.1523463875055313, -0.0875772163271904, 0.6514096856117249, ...
def area ( self, p ) : foo = np. asarray ( p ) # move points along by one : foo _ p = np. roll ( foo, - 1, axis = 0 ) ai = foo [ :, 0 ] * foo _ p [ :, 1 ] - foo _ p [ :, 0 ] * foo [ :, 1 ] # aa = np. abs ( ( 1 / 2 ) * np. sum ( ai ) ) aa = ( 1 / 2 ) * np. sum ( ai ) return aa
[ -0.5403769016265869, -0.7293912768363953, 0.8079369068145752, 0.3325863182544708, -0.23099486529827118, 0.6185200214385986, 0.8116364479064941, 0.5813465118408203, 0.6981782913208008, 0.7424076795578003, 1.1406636238098145, 0.3377423584461212, -0.1144729033112526, 0.5711581110954285, 0.1...
def note _ list _ whole _ piece ( self ) : pure _ notes = [ ] parts = self. score. getelementsbyclass ( stream. part ) for part in parts : notelist = part. flat. getelementsbyclass ( ['note ','rest'] ) for note in notelist : if note. tie is not none : if note. tie. type = ='start': note _ obj = notelistelement ( note, ...
[ -0.7032538652420044, -0.7479378581047058, 0.7018906474113464, -0.11854440718889236, 0.14717046916484833, 0.6917881369590759, 0.35797029733657837, -0.40376532077789307, 0.34459415078163147, 0.5904026031494141, -0.7410504817962646, 0.2087918370962143, -0.37413156032562256, 0.3665202260017395...
def _ _ init _ _ ( self, fastas : list or none, max _ length : int or none, save _ path : str or none = '. / seq _ data. pt') : if fastas is none : self. data = none else : self. data = [ ] for i, fasta in enumerate ( fastas ) : aln = alignio. read ( fasta, " fasta " ) for row _ num, row in enumerate ( aln ) : seq = to...
[ -0.21725203096866608, 0.23621435463428497, 0.5176371335983276, 0.7184528112411499, 0.18983615934848785, -0.44935986399650574, 0.18770819902420044, 1.0004063844680786, 0.03722594305872917, 0.3488415777683258, -0.2932402193546295, -0.6475675106048584, 0.5405981540679932, -0.14882342517375946...
def get ( self, key ) : return self. _ _ getattr _ _ ( key )
[ -1.0616605281829834, -0.735080361366272, 0.4813139736652374, -0.5445989966392517, -0.3394896686077118, -0.0025027692317962646, -0.6045532822608948, -1.1077024936676025, -0.3505527079105377, 0.21810105443000793, 0.42863473296165466, 0.4090851843357086, 0.45506981015205383, -0.06899532675743...
def _ determine _ num _ symm ( trans _ orig : transmatrix, trans _ copy : transmatrix ) : orig _ inv = trans _ orig. get _ inverse _ transform ( ) trans _ diff = transmatrix ( np. dot ( trans _ copy. mat, orig _ inv. mat ) ) # if the difference is only planar symmetries, then off diagonal elements should zero num _ sym...
[ 0.04408450052142143, 0.23383353650569916, 0.6556559205055237, -0.6013146638870239, -0.7380465269088745, -0.17422015964984894, 1.1280803680419922, 0.13145798444747925, 0.426483690738678, 0.15185417234897614, -0.6175953149795532, 0.09557098895311356, 0.5861814618110657, 0.3223157227039337, ...
def checkredirectcode ( valid _ redirect _ codes, items ) : for item in items : # skip over any blank rows where all 3 fields in the csv are not populated if ( item ['source']! = " " and item ['destination']! = " " and item ['redirect _ code']! = " " ) : if item ['redirect _ code'] not in valid _ redirect _ codes : # w...
[ -0.5191582441329956, -0.40248844027519226, 0.6229068636894226, 0.5603165626525879, 0.04281887039542198, 0.4239306151866913, 0.21042294800281525, 0.8013830184936523, 0.4368759095668793, -0.18313199281692505, 0.14124952256679535, 0.21566542983055115, 0.09280663728713989, 0.2072378396987915, ...