text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def getdisplaylooks ( self, display, view ) : pass | [
-0.18056389689445496,
-0.5224904417991638,
0.3545619547367096,
0.7318717837333679,
-0.42451566457748413,
0.4111267626285553,
0.5794035196304321,
-1.382190465927124,
0.20637854933738708,
-0.2549593448638916,
1.6020443439483643,
1.0906951427459717,
0.0030329078435897827,
0.6497606039047241,
... |
def tft _ wallet _ init ( prefab, passphrase, recovery _ seed = none ) : cmd ='curl - a " rivine - agent " " localhost : 23110 / wallet "'rc, out, err = prefab. core. run ( cmd, die = false, showout = false ) if rc : raise runtimeerror ('failed to unlock tft wallet. error { } '. format ( err ) ) json _ out = json. load... | [
-0.5889330506324768,
-0.22044575214385986,
0.6301314830780029,
-0.8696846961975098,
0.3915395736694336,
-0.5017439723014832,
-0.18121731281280518,
0.4819369912147522,
-0.05028262734413147,
0.6630389094352722,
-0.1070365458726883,
0.004852540325373411,
-0.09107621759176254,
0.65058547258377... |
def createadding203entities ( self, * args ) : return _ stepap209. stepap209 _ construct _ createadding203entities ( self, * args ) | [
-1.2709723711013794,
-0.3777715563774109,
0.4212336838245392,
0.019639432430267334,
0.5715588927268982,
1.0636965036392212,
0.293582946062088,
0.7110282182693481,
0.33464956283569336,
-0.46906155347824097,
-0.2728656828403473,
-0.80916428565979,
0.2395789474248886,
0.4748983085155487,
-0... |
def parsegeometry ( self, geometry ) : # get w xsplit = geometry. split ('x') w = int ( xsplit [ 0 ] ) rest = xsplit [ 1 ] # get h, x, y plussplit = rest. split ('+') h = int ( plussplit [ 0 ] ) x = int ( plussplit [ 1 ] ) y = int ( plussplit [ 2 ] ) return w, h, x, y | [
-0.4056006073951721,
-0.07866220921278,
0.7635788917541504,
-0.09256204217672348,
-0.619774341583252,
-0.17017102241516113,
0.36751681566238403,
-0.1618463695049286,
-0.350077360868454,
-0.02292751520872116,
-0.6714606881141663,
-0.4166150987148285,
-0.044418126344680786,
-0.54220992326736... |
def pauseproducing ( self ) : for proto in self. connections. itervalues ( ) : try : proto. transport. pauseproducing ( ) except exception, err : self. log. warn ( " unexpected exc ( % s ) ", str ( err ) ) | [
-0.9215806722640991,
-0.2892906665802002,
0.44633981585502625,
0.2887323498725891,
0.8750998377799988,
0.22831404209136963,
0.6541444063186646,
-0.04713631421327591,
-0.6335682272911072,
0.042453646659851074,
0.5942025184631348,
-0.09936521202325821,
-1.4415088891983032,
-0.280842840671539... |
def get ( identifier ) : if isinstance ( identifier, collections. callable ) : return identifier if identifier = ='difference': return difference raise valueerror ('identifier { } cannot be identified. '. \ format ( ( identifier, ) ) ) | [
-0.30104923248291016,
0.34037595987319946,
0.6200920343399048,
0.24114784598350525,
0.18976818025112152,
0.27046096324920654,
0.44933733344078064,
-0.7564709782600403,
0.7949701547622681,
-0.7970483303070068,
-0.4582473635673523,
0.7169873714447021,
-0.6117655038833618,
0.08908595889806747... |
def process ( self, packet ) : raise notimplemented ( self. _ _ class _ _. _ _ name _ _ + " must implement a process method " ) | [
-0.6779813766479492,
-0.14054685831069946,
0.8839215636253357,
-0.24316908419132233,
0.1569344401359558,
0.9592456221580505,
0.31326740980148315,
-0.49742838740348816,
0.8441427946090698,
-0.3742501735687256,
-0.42071571946144104,
0.08950076997280121,
0.3168179392814636,
0.5236612558364868... |
def purge _ empty _ lines ( self, line _ from = 0, line _ to = none ) : if not line _ to : line _ to = len ( self. textlist ) - 1 deleted = 0 for y in reversed ( range ( line _ from, line _ to + 1 ) ) : if not self. textlist [ y ]. strip ( ) : self. textlist = self. textlist [ 0 : y ] + self. textlist [ y + 1 : ] delet... | [
0.3049677908420563,
0.2978213131427765,
0.5795183777809143,
-0.3327378034591675,
0.5999806523323059,
0.28016266226768494,
-0.9430548548698425,
0.5518419742584229,
-0.10086887329816818,
-0.2695693373680115,
-0.6012519001960754,
0.30241090059280396,
-0.16921474039554596,
0.7214932441711426,
... |
def get _ itersneeded ( param _ tuple ) : num _ nodes, graph _ type, max _ iters, param, target, subp, dim = param _ tuple # unpack csubp = subp clean _ coef _ mat = get _ input _ coefficients ( num _ nodes, dim, graph _ type,'dp ', param ) coef _ mat = np. copy ( clean _ coef _ mat ) fin = clean _ coef _ mat [ 0, 0 ] ... | [
-0.7005927562713623,
0.8461037278175354,
0.8172070980072021,
-0.5500814318656921,
0.08231031149625778,
0.1322195678949356,
0.9471653699874878,
0.4955642819404602,
-0.9979127645492554,
0.9638593196868896,
0.027396488934755325,
0.5347103476524353,
0.05250122398138046,
-0.6712539792060852,
... |
def formular _ add ( ) : conn = get _ db ( ) cursor = conn. cursor ( ) mode = request. form [ " mode " ] name = request. form [ " name " ] adress = request. form [ " adress " ] phone = request. form [ " phone " ] mail = request. form [ " mail " ] website = request. form [ " website " ] contact _ person = request. form ... | [
-0.13278642296791077,
-0.6729846000671387,
0.9946076273918152,
0.8452744483947754,
-0.2072402685880661,
0.5170601606369019,
-0.33599767088890076,
-0.2327088862657547,
-0.699510395526886,
-0.03930862247943878,
0.2871522009372711,
-0.23857586085796356,
0.04452604427933693,
0.9389657974243164... |
def add ( self, movie ) : try : print ( " successfully connected to sqlite db - movies " ) insert _ sql = " " " insert into movies ( title ) values ('{ }') " " ". format ( movie ) self. execute ( insert _ sql ) self. commit ( ) except sqlite3. error as error : print ( " failed to insert python variable into sqlite tabl... | [
-0.9367468357086182,
0.40745073556900024,
0.8158369660377502,
0.3634011447429657,
0.40974605083465576,
0.9633258581161499,
-0.9035212397575378,
-0.3954797685146332,
-0.13495399057865143,
0.5015862584114075,
0.09471210837364197,
-0.15500660240650177,
-1.6578205823898315,
0.49915486574172974... |
def parseinput ( self ) : # iterate through list version of input for line in range ( 0, len ( self. input ) ) : # add the start node if line = = 0 : # the first line self. startnode = self. input [ line ] # add the end node elif line = = 1 : self. endnode = self. input [ line ] # add an edge else : # create an edge ( ... | [
-0.781041145324707,
0.4032909870147705,
0.6894311904907227,
0.13552671670913696,
-0.3505684733390808,
0.4721788763999939,
0.5524358749389648,
0.32203561067581177,
-0.27455079555511475,
-0.043460965156555176,
0.00009576459706295282,
-0.4107333719730377,
-0.6337209343910217,
-0.2218335270881... |
def validate ( term ) : regex ='^ [ wsf ] [ 0 - 9 ] { 4 } $'return re. match ( regex, term ) is not none | [
-0.3671301603317261,
-0.2485656440258026,
0.69735187292099,
0.45481932163238525,
-0.39280539751052856,
0.01887606829404831,
-0.26057007908821106,
-0.09839291125535965,
-0.03859909623861313,
-0.17337387800216675,
-0.26556429266929626,
-0.4935135543346405,
-0.436077356338501,
-0.124990783631... |
def get _ output _ for ( self ) : with tf. name _ scope ( self. name ) as scope : output = tf. reshape ( self. input _ layer, self. output _ shape, name = scope ) tf. add _ to _ collection ( berrykeys. layer _ outputs, output ) return output | [
-0.5742833018302917,
-0.25538012385368347,
0.27515706419944763,
-0.5820913910865784,
0.44495564699172974,
-0.8808128237724304,
0.35073232650756836,
-0.056828439235687256,
-0.8852430582046509,
0.20117466151714325,
-0.4155205488204956,
0.12214607000350952,
-0.3591887652873993,
-0.35258716344... |
def additional _ services ( self ) - > pulumi. output [ optional [ sequence [ str ] ] ] : return pulumi. get ( self, " additional _ services " ) | [
0.3593670725822449,
-0.2846747934818268,
0.6287934184074402,
0.08108874410390854,
0.2952102720737457,
1.1091365814208984,
0.16766493022441864,
-1.2921249866485596,
1.4422391653060913,
-0.5396714210510254,
-0.5887882709503174,
0.1713821440935135,
-0.17803125083446503,
-0.4052113890647888,
... |
def find _ strings ( self, strs, lst ) : suspicious _ found _ strings = [ ] found _ strs = [ s. lower ( ) for s in strs ] if strs is none : strs = self. strings ( ) for suspicious _ string in lst : template = ". * % s. * " % suspicious _ string. lower ( ) for s in found _ strs : if re. match ( template, s ) is not none... | [
0.09133678674697876,
-0.5284485220909119,
0.5247804522514343,
-0.3579425811767578,
-0.6541142463684082,
-0.4426247179508209,
-0.7451027035713196,
0.2445305585861206,
-0.45626598596572876,
0.295136958360672,
-0.4981343746185303,
0.29987093806266785,
-0.5395796298980713,
0.8381276726722717,
... |
def n _ to _ m ( num, base _ from, base _ to, numerals _ to = " 0123456789abcdefghijklmnopqrstuvwxyz " ) : if not 2 < = base _ from < = 36 : raise valueerror ( " the base _ from parameter must be between 2 and 36 " ) if not 2 < = base _ to < = len ( numerals _ to ) : raise valueerror ( " the base _ to parameter must be... | [
-0.8559280633926392,
-0.17405273020267487,
0.6780145168304443,
-0.5160691142082214,
0.15073472261428833,
-0.1315412074327469,
-1.1223596334457397,
-0.3406711518764496,
-0.6660990118980408,
0.1787145435810089,
-0.4970535337924957,
0.11987176537513733,
-0.444427490234375,
-0.1065084189176559... |
def check ( schema, expr, engine, context ) : rest = [ true ] while rest : if ( isinstance ( expr, expressions. binaryoperator ) and expr. operator = ='and') : rest = expr. args [ 1 ] expr = expr. args [ 0 ] else : rest = [ ] res = extract _ pattern ( expr, engine, context ) if res is not none : schema. data. update ( ... | [
-0.7378057241439819,
0.20188160240650177,
0.6143804788589478,
0.4595988392829895,
-0.41947564482688904,
-0.6560744643211365,
0.010786917991936207,
1.301666498184204,
0.41302958130836487,
0.7563978433609009,
-0.11302941292524338,
0.4090690016746521,
-0.9058616757392883,
-0.31687822937965393... |
def get _ next _ token ( self ) : if self. has _ more _ tokens ( ) : self. _ _ next _ token = self. _ _ token _ list [ self. _ _ token _ index ] return self. _ _ next _ token [ 0 ] return none | [
-0.35550934076309204,
-0.1664113849401474,
0.41016626358032227,
0.22371399402618408,
-0.06641404330730438,
-0.37659403681755066,
0.0020072925835847855,
-0.06617076694965363,
0.2500216066837311,
-1.2764489650726318,
-0.4674064517021179,
1.0409808158874512,
-0.31799864768981934,
-0.456723034... |
def to _ dict ( self ) : result = { } for attr, _ in six. iteritems ( self. swagger _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ att... | [
-0.32144734263420105,
-0.14004240930080414,
0.8712786436080933,
-0.3636336326599121,
-0.5042498707771301,
-0.6365073323249817,
0.402418851852417,
-0.8178066611289978,
0.36071455478668213,
0.1353691816329956,
-0.7278217673301697,
-0.1222672313451767,
-0.1310010403394699,
0.6441593766212463,... |
def _ _ str _ _ ( self ) : title = " game ( { \ n \ n ( % s and % s ) vs ( % s and % s ) " % \ ( self. _ p1, self. _ p2, self. _ p3, self. _ p4 ) return title + " \ n \ n } ) " | [
-0.48722609877586365,
-1.2066479921340942,
0.7443450093269348,
-1.0040091276168823,
-0.27085617184638977,
0.9153357744216919,
-1.0902506113052368,
-0.7938535809516907,
-0.4910081624984741,
0.6608353853225708,
0.7263641953468323,
-0.6553947329521179,
-0.5319774150848389,
-0.6220815181732178... |
def users _ get _ all ( ) : return ( jsonify ( [ x. to _ dict ( ) for x in storage. all ( " user " ). values ( ) ] ) ) | [
-0.9834497570991516,
-0.8229125142097473,
0.46661943197250366,
0.3306429386138916,
-0.19571170210838318,
-0.24321573972702026,
-1.6901148557662964,
-0.1787259578704834,
-0.7635325193405151,
0.13016322255134583,
-0.7228365540504456,
0.7526399493217468,
0.7159371376037598,
0.3510046899318695... |
def mod _ relu ( z, scope ='', reuse = none ) : with tf. variable _ scope ('mod _ relu'+ scope, reuse = reuse ) : b = tf. get _ variable ('b ', [ ], dtype = tf. float32, initializer = urnd _ init ( - 0. 01, 0. 01 ) ) modulus = tf. sqrt ( tf. real ( z ) * * 2 + tf. imag ( z ) * * 2 ) rescale = tf. nn. relu ( modulus + b... | [
-0.8090918064117432,
-1.1166788339614868,
0.6282364726066589,
-0.25792115926742554,
-0.4096507728099823,
-0.6801963448524475,
0.9028139710426331,
0.7966237664222717,
0.7918009757995605,
0.0361640565097332,
-0.40852275490760803,
0.2729554772377014,
-0.3246777057647705,
-0.2319084107875824,
... |
def get _ dependency _ from _ conflict _ free _ matrix ( mut1, mut2, matrix ) : pairs = [ [ 0 for i in range ( 2 ) ] for j in range ( 2 ) ] for cell _ id in list ( matrix. keys ( ) ) : a = int ( matrix [ cell _ id ] [ mut1 ] ) b = int ( matrix [ cell _ id ] [ mut2 ] ) if a not in [ 0, 1 ] or b not in [ 0, 1 ] : continu... | [
0.06224394217133522,
-0.5104770660400391,
1.0324082374572754,
0.5542891025543213,
-0.7622105479240417,
-0.29934293031692505,
0.6784176230430603,
-0.4148419499397278,
-0.26802971959114075,
0.18121394515037537,
0.9837071299552917,
0.6628196239471436,
-0.33773529529571533,
0.24510571360588074... |
def test _ prepare _ attribute _ values _ that _ gives _ the _ same _ slug ( color _ attribute ) : # given existing _ value = color _ attribute. values. first ( ) attr _ values _ count = color _ attribute. values. count ( ) new _ value = " red " new _ value _ 2 = " red " values = attrvaluesinput ( global _ id = graphen... | [
-0.0951041653752327,
-0.01706605777144432,
0.6532671451568604,
-0.3538627326488495,
1.024935007095337,
-0.17806638777256012,
0.018531421199440956,
-0.11376187950372696,
-0.41458821296691895,
-0.35647115111351013,
-0.5700502395629883,
-0.012577297165989876,
1.0641366243362427,
0.72854322195... |
def loadagent ( args, device, state _ dim, action _ num, action _ list, verbose = true ) : print ( " \ n = = agent information = = " ) modelfolder = os. path. join ( args. modelfolder, " model " ) configfile = os. path. join ( modelfolder, " config. pkl " ) with open ( configfile, " rb " ) as handle : tmpconfig = pickl... | [
0.03537377342581749,
-0.27850353717803955,
0.5196253061294556,
-0.41402342915534973,
0.05897156521677971,
-0.11798343062400818,
0.37937143445014954,
0.2549945116043091,
0.5763410329818726,
0.000015321385944844224,
-0.6578164100646973,
0.030545629560947418,
0.1740381270647049,
-0.5275977253... |
def getparentdirlist ( path ) : import posixpath path = posixpath. normpath ( " / % s " % path ) if path [ : 2 ] = ='/ /': path = path [ 1 : ] dirs = [ ] path = posixpath. dirname ( path ) while path! ='/': dirs. append ( path ) path = posixpath. dirname ( path ) dirs. append ('/') return dirs | [
-0.47366681694984436,
-0.011611809022724628,
0.8423076272010803,
0.40957561135292053,
-1.018686056137085,
-0.21710573136806488,
0.4292756915092468,
0.1396593600511551,
0.9116727709770203,
0.16290225088596344,
-0.24073179066181183,
-1.2346950769424438,
-0.2720412611961365,
0.333329349756240... |
def cast ( * args ) : return _ itkimageserieswriterpython. itkimageserieswriteriuc3iuc2 _ cast ( * args ) | [
-0.34134748578071594,
-0.2678312659263611,
0.2523406147956848,
-0.2302662581205368,
0.3444637656211853,
1.2277247905731201,
-0.02168763242661953,
0.06646481156349182,
-0.09819171577692032,
0.6683571338653564,
0.27745845913887024,
0.2261245846748352,
-0.41259995102882385,
-0.411471009254455... |
def test _ tz _ aware _ index ( self ) : def mock _ get _ prices ( * args, * * kwargs ) : dt _ idx = pd. datetimeindex ( [ " 2018 - 03 - 31 ", " 2018 - 06 - 30 " ] ) fields = [ " eps " ] idx = pd. multiindex. from _ product ( [ fields, dt _ idx ], names = [ " field ", " date " ] ) prices = pd. dataframe ( { " fi12345 "... | [
-0.4171593189239502,
0.05759193375706673,
0.783875584602356,
-0.5764199495315552,
0.03665531426668167,
0.11038784682750702,
0.2373189628124237,
-0.19962894916534424,
-0.18332765996456146,
-0.06467463821172714,
-0.3111844062805176,
-0.04042927548289299,
-0.2397734373807907,
-0.1677382141351... |
def closeevent ( self, e ) : if self. _ closed : return _ wait ( 250 ) res = emit ('close ', self ) # discard the close event if false is returned by one of the callback # functions. if false in res : # pragma : no cover e. ignore ( ) return super ( gui, self ). closeevent ( e ) self. _ closed = true # save the state t... | [
0.23122884333133698,
0.5572649240493774,
0.5545229911804199,
0.028783055022358894,
-0.5140020251274109,
0.46343326568603516,
0.5707260966300964,
0.03875153884291649,
-0.001270999084226787,
-0.8121148347854614,
-0.42220425605773926,
-0.47194287180900574,
0.011347288265824318,
0.941061258316... |
def get _ reference _ prefix ( libraries, library _ id ) : prefix _ name ='reference _ prefix'prefix _ default ='chr'if prefix _ name not in libraries. columns : return prefix _ default prefix = libraries. loc [ library _ id, prefix _ name ] if pandas. isnull ( prefix ) : return prefix _ default return prefix | [
0.6337453722953796,
-0.1562146097421646,
0.24714906513690948,
0.1223282665014267,
1.2448242902755737,
-0.5617658495903015,
-0.5505513548851013,
-0.33802375197410583,
0.32803595066070557,
0.9385460019111633,
0.2971128523349762,
0.23263266682624817,
-0.4901828169822693,
0.18859706819057465,
... |
def load _ resource _ data ( self ) : result _ data = dict ( ) resources = [ " node ", " device ", " source ", " flow ", " sender ", " receiver " ] for resource in resources : with open ( " test _ data / controller / v1. 3 _ { }. json ". format ( resource ) ) as resource _ data : resource _ json = json. load ( resource... | [
-0.6051800847053528,
-0.26100799441337585,
0.46288904547691345,
-1.4818987846374512,
-0.47245511412620544,
0.11484505981206894,
0.10976400971412659,
-0.4151051640510559,
-0.2862147092819214,
0.5244446992874146,
-1.0314000844955444,
-0.5551818609237671,
-0.5183079838752747,
-0.2153551280498... |
def get _ topics ( self, project ) : url = self. get _ url ( " topics ", none, project ) return self. get _ resource ( url ) | [
-0.6830716133117676,
0.4177251160144806,
0.03978994861245155,
0.325058251619339,
0.5614674091339111,
-0.2618248164653778,
-1.0054813623428345,
-0.700766384601593,
0.2177962213754654,
0.19770941138267517,
0.4854472875595093,
0.3315412998199463,
-0.7450231909751892,
-0.0712544247508049,
-0... |
def pearsoncorrelation ( input _ batch, weights, verbose ) : with tf. variable _ scope ('pearsoncorrelation') : # there is a formal identity between the correlation coefficient, and the cosine of the angle between two # random vectors when x and y have zero mean # person _ r _ per _ map = tf. div _ no _ nan ( tf. reduc... | [
0.47244447469711304,
-0.48462334275245667,
0.9469906687736511,
0.15637634694576263,
-0.29307106137275696,
0.10194980353116989,
0.607158362865448,
0.08151472359895706,
0.2662653923034668,
0.566882848739624,
0.5134321451187134,
-0.06344510614871979,
-0.17759516835212708,
-0.3878534734249115,... |
def _ _ init _ _ ( self ) : self. parameters = none | [
0.021067610010504723,
-0.7113714218139648,
0.3260590434074402,
-0.5278453826904297,
0.7280921936035156,
-0.4188423752784729,
-0.17244258522987366,
0.42439723014831543,
-0.24547719955444336,
-0.25074395537376404,
-0.5939615964889526,
0.4622785449028015,
-1.0539159774780273,
1.40693211555480... |
def process ( url ) : print ( url ) req _ url = url req = request ( url = req _ url, headers = headers ) soup = beautifulsoup ( urlopen ( req ). read ( ), " xml " ) ret = [ ] itemlist = soup. find _ all ('item') for i in itemlist : guid = uuid. uuid4 ( ) if i. title = = none : title = str ( " empty " ) else : title = i... | [
-0.6765291690826416,
0.07050430774688721,
0.5922137498855591,
-0.10933792591094971,
0.46087104082107544,
0.2072952836751938,
-1.140058994293213,
-0.3777254819869995,
-0.40232136845588684,
-0.4747917056083679,
-0.5685907602310181,
-0.26094213128089905,
0.08666756004095078,
0.432905495166778... |
async def test _ security _ warnings _ vulnerabilities _ only ( self ) : response = await self. collect ( get _ request _ json _ return _ value = self. vulnerabilities _ json ) self. assert _ measurement ( response, value = " 2 ", total = " 100 ", entities = self. vulnerability _ entities, landing _ url = " https : / /... | [
0.25231656432151794,
0.1629335582256317,
0.32148393988609314,
0.6147767305374146,
0.9852996468544006,
0.6673646569252014,
-0.1688525378704071,
-0.30396345257759094,
0.1898786574602127,
-0.26363781094551086,
-0.009756666608154774,
-0.12869907915592194,
0.3195018768310547,
0.6878610849380493... |
def aff _ js _ 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.0564904622733593,
-0.14163672924041748,
0.7239559292793274,
-0.3401820957660675,
-0.08896249532699585,
-0.7141895294189453,
0.5642341375350952,
-0.23940861225128174,
-0.7676672339439392,
1.177693486213684,
0.8105131387710571,
1.1562730073928833,
1.1222254037857056,
0.3368447422981262,
... |
def ispartner ( self, * args ) : return _ topods. topods _ shape _ ispartner ( self, * args ) | [
-0.5875256061553955,
0.4132196009159088,
0.7004457712173462,
0.22603151202201843,
-0.21483010053634644,
0.25063803791999817,
0.7032545804977417,
-0.18465185165405273,
0.42531824111938477,
0.023979395627975464,
0.12982219457626343,
-0.33725571632385254,
-1.3526216745376587,
0.38812109827995... |
def run _ dampednewton ( damping, lr, nof _ steps ) : # set up problem, model, loss problem = toyproblem ( f _ objective, apply _ noise ) model, loss _ func = problem. make _ modules ( theta _ init. clone ( ) ) model = extend ( model. to ( device ) ) loss _ func = extend ( loss _ func. to ( device ) ) # define optimize... | [
0.5990630388259888,
0.19285379350185394,
0.8487505912780762,
-0.1595851629972458,
0.13655196130275726,
-0.35364386439323425,
0.6600679159164429,
-0.5522601008415222,
-0.7519219517707825,
-0.07766164094209671,
-0.4447128474712372,
0.24780826270580292,
0.5409957766532898,
0.5412775874137878,... |
def handler _ refresh _ save _ task ( update : update, context : callbackcontext ) : global save _ timer # use bot. py's save _ task obj global user _ map # use boy. py's user _ map obj if save _ timer is not none : save _ timer. cancel ( ) print ( " save _ timer cancelled " ) save _ timer. join ( ) print ( " save time... | [
0.10201391577720642,
-0.6463798880577087,
0.4505489766597748,
1.0596736669540405,
-0.028845064342021942,
0.37528756260871887,
-0.12983791530132294,
0.30244457721710205,
-0.07194246351718903,
0.9641187191009521,
-1.3016144037246704,
-0.35406413674354553,
-0.48886147141456604,
0.579029977321... |
def encrypt ( self, data : bytearray ) - > bytearray : if not isinstance ( data, ( bytes, bytearray ) ) : self. clear ( ) raise gostciphererror ('invalid plaintext data') gamma = bytearray ( ) result = bytearray ( ) for i in range ( get _ num _ block ( data, self. block _ size ) ) : gamma = self. _ cipher _ obj. encryp... | [
-0.5766252875328064,
0.6747473478317261,
0.8871889114379883,
0.19379647076129913,
0.18865442276000977,
-0.3982095420360565,
1.0158836841583252,
-0.7739139199256897,
0.4193023145198822,
0.41959401965141296,
-1.0167933702468872,
0.11638178676366806,
-1.3798174858093262,
0.3014366924762726,
... |
def record _ sales _ data ( args ) : today = open ('current _ date. txt'). read ( ) yesterday = ( datetime. strptime ( today,'% y - % m - % d') - timedelta ( days = 1 ) ). strftime ('% y - % m - % d') if args. today : costs = get _ costs ( today ) revenue = get _ revenue ( today ) profit = get _ profit ( today ) new _ ... | [
-0.1297566294670105,
0.033005714416503906,
1.0961205959320068,
0.26573634147644043,
0.4896029531955719,
0.43895646929740906,
-0.09037050604820251,
0.1451404094696045,
-1.0168440341949463,
-0.36206087470054626,
0.5497117042541504,
0.21685895323753357,
0.48485082387924194,
0.5258240699768066... |
def out _ edges ( self ) : return [ edge ( self. graph, e ) for e in self. graph. redis. smembers ('{ } : oe '. format ( self. name ) ) ] | [
-0.5212153792381287,
-0.14889225363731384,
0.4298979938030243,
-0.11513663083314896,
0.428056001663208,
-0.2701520025730133,
-1.3512706756591797,
0.4460342824459076,
0.6328161358833313,
0.7030432820320129,
-0.04460529610514641,
0.10247037559747696,
-0.7008659839630127,
-0.15255218744277954... |
def compute _ derivatives ( x, y, z, p, v, rho ) : p, v = boundary _ conditions ( p, v ) # linear momentum conservation dvdx = space _ scheme ( v, x, axis = 0 ) dvdy = space _ scheme ( v, y, axis = 1 ) dvdz = space _ scheme ( v, z, axis = 2 ) vdv = np. zeros ( v. shape ) vdv [ :, :, :, 0 ] = np. multiply ( dvdx [ :, :,... | [
0.5054589509963989,
-0.14465993642807007,
1.4172989130020142,
-0.19569537043571472,
-0.3247459828853607,
0.5194494128227234,
0.17107421159744263,
0.9021565318107605,
-0.6218957901000977,
0.9298101663589478,
-0.08196792751550674,
0.15254950523376465,
-0.5048139691352844,
-0.0392824485898017... |
def create _ united _ way _ report _ html ( self, request, start _ date, end _ date, visit _ types ) : visit _ type _ ids = [ v. id for v in visit _ types ] visit _ questions = [ ] # contianing tuples ( prompt, count, distinct users ) for question in visitquestion. objects. all ( ) : responses = question. visitresponse... | [
-0.9693899154663086,
0.046825431287288666,
0.8676535487174988,
-0.15478721261024475,
0.0571342408657074,
0.8269297480583191,
1.702341079711914,
-0.38259971141815186,
-0.666279137134552,
0.4919848144054413,
0.4445763826370239,
-0.2401151806116104,
0.8937658071517944,
0.5686436295509338,
-... |
def _ _ init _ _ ( self ) - > none : self. _ discovery _ info : bluetoothserviceinfobleak | none = none self. _ discovered _ devices : dict [ str, bluetoothserviceinfobleak ] = { } self. _ lock _ cfg : validatedlockconfig | none = none self. _ reauth _ entry : config _ entries. configentry | none = none | [
0.016762888059020042,
0.12200451642274857,
0.2854449450969696,
1.1405248641967773,
0.8388854265213013,
-0.7390909790992737,
0.5035336017608643,
-0.1253967136144638,
-0.14867553114891052,
-1.0556994676589966,
-0.618628203868866,
0.3311336934566498,
0.06712061166763306,
0.8417208790779114,
... |
def emptycopy ( self, * args ) : return _ topods. topods _ shape _ emptycopy ( self, * args ) | [
-1.133832335472107,
-0.21468058228492737,
0.5932337641716003,
0.194847971200943,
-0.21938103437423706,
1.3988631963729858,
0.9822299480438232,
-0.9940864443778992,
-0.009529978036880493,
-0.022740140557289124,
-0.20162427425384521,
0.16588786244392395,
-0.4382203221321106,
-0.8154138326644... |
async def generate _ metadata ( gl, event, jsonstr ) : webhook _ payload = json. loads ( jsonstr ) project _ id = event. project _ id gitlab _ clone _ url = webhook _ payload ['data'] ['object _ attributes'] ['source'] ['git _ http _ url'] namespace = webhook _ payload ['data'] ['object _ attributes'] ['source'] ['name... | [
0.07610611617565155,
-0.45247188210487366,
0.7635765671730042,
-0.5698835849761963,
0.6981311440467834,
0.2581934630870819,
-0.7665880918502808,
-0.007735803723335266,
-0.22692295908927917,
1.255035400390625,
-0.7345412373542786,
0.14370746910572052,
0.4919987916946411,
0.3292236328125,
... |
def construct _ feature _ mapping _ approx ( feature _ mapping, weights ) : # here is a function that is created on the fly from the input feature # mapping and weights def prediction _ function ( xs ) : designmtx = np. matrix ( feature _ mapping ( xs ) ) return linear _ model _ predict ( designmtx, weights ) # we retu... | [
0.22884917259216309,
-0.8760735988616943,
0.36154985427856445,
0.31594184041023254,
-0.6928059458732605,
-0.0245148204267025,
-0.09832184761762619,
1.0467233657836914,
-0.5054957866668701,
-0.510316014289856,
0.33544012904167175,
-0.18835777044296265,
0.8383165597915649,
0.2774713337421417... |
def step ( self, action ) : logging. debug ('executing a step, action = { } '. format ( action ) ) previous _ observation = self. _ observe ( ) self. _ take _ action ( action ) observation = self. _ observe ( ) reward = 0 episode _ over = false if self. _ should _ end _ testing ( previous _ observation, observation ) :... | [
-0.8865287899971008,
0.2560562193393707,
0.5863468647003174,
-0.1449410319328308,
0.2793552279472351,
0.09185630828142166,
0.1832267940044403,
-0.19474384188652039,
-0.07411465793848038,
0.5901892185211182,
-0.26458287239074707,
-0.5590196847915649,
-0.3201812207698822,
-0.2240165323019027... |
def random _ unique _ camel ( ) : while true : camel = random _ word ( 2 ). title ( ) + random _ word ( 2 ). title ( ) if camel not in _ random _ unique _ camels : break _ random _ unique _ camels. append ( camel ) return camel | [
-0.8549954295158386,
-0.41117367148399353,
0.4624566435813904,
-0.4109177589416504,
-0.37175071239471436,
1.019097089767456,
-0.0028560427017509937,
-0.583641767501831,
0.8830960988998413,
-0.5567790269851685,
-0.4358667731285095,
0.539310872554779,
-0.5511871576309204,
-0.2359320968389511... |
def _ _ init _ _ ( self, col, threshold, new _ name = none ) : self. col = col self. threshold = threshold self. new _ name = new _ name or col + " _ bin " | [
0.5146523714065552,
-0.4737872779369354,
0.5485842227935791,
0.8061132431030273,
-0.8791544437408447,
-0.4262392222881317,
-0.7456761002540588,
-0.08935224264860153,
-0.8502166271209717,
0.19460450112819672,
-0.8223279714584351,
0.7612572312355042,
1.1980259418487549,
0.19919003546237946,
... |
def test _ interface _ attribute ( ) : assert _ equal ( d. interface, " direct " ) | [
-0.4442482888698578,
0.24713008105754852,
0.29482588171958923,
-0.08669525384902954,
0.365557998418808,
1.820207118988037,
1.7410579919815063,
-0.08974552154541016,
0.041656188666820526,
-0.5572041273117065,
0.3210586905479431,
0.16750510036945343,
0.1620064675807953,
0.47282928228378296,
... |
def get _ edges ( self, * * kwargs ) : return [ edge ( self, x ) for x in self. redis. sinter ( ['{ } : i : e : { } : { } '. format ( self. name, k, kwargs [ k ] ) for k in kwargs ] ) ] | [
-0.7401248812675476,
-0.02129920944571495,
0.3971511721611023,
0.2840527594089508,
0.8588069677352905,
-0.18551723659038544,
-2.0203614234924316,
0.08123898506164551,
0.03451284393668175,
0.3059404194355011,
-0.7990053296089172,
0.024762140586972237,
-0.7401604056358337,
0.1779615581035614... |
def owner _ users ( self ) : url = self. _ data. get ('related ', { } ). get ('owner _ users') return entitymanager ( self. _ tower, entity _ object ='user ', primary _ match _ field ='username ', url = url ) | [
-0.5250943899154663,
0.24885597825050354,
0.18145997822284698,
0.5747600793838501,
0.4702502191066742,
-0.18928369879722595,
0.45108145475387573,
0.2031719982624054,
0.11007516086101532,
-1.5380083322525024,
0.37337610125541687,
-0.00043974060099571943,
0.0609513558447361,
-0.3184325695037... |
def calculateshortestroute ( self, srcpoint, dststreetsegmentid ) : srcsegmentid = self. getstreetidfromnodesimple ( srcpoint, " fnode _ " ) # print ( " the home { } work { } ids have been identified ". format ( srcsegmentid, dststreetsegmentid ) ) if ( srcsegmentid! = - 1 and dststreetsegmentid! = - 1 ) : start = time... | [
0.11959114670753479,
-0.5584375858306885,
0.7508246898651123,
-0.15676824748516083,
-0.3974805176258087,
-0.41302230954170227,
-0.10321361571550369,
-0.270494669675827,
0.14079293608665466,
0.05646967887878418,
0.05221346393227577,
-0.09921785444021225,
-0.45456045866012573,
0.613242208957... |
def properties ( self ) : return self. prop. _ properties ( ) | [
-0.5178672075271606,
-1.6137105226516724,
0.10922335088253021,
0.6174363493919373,
0.5224360823631287,
0.0437314473092556,
-0.11553163826465607,
-0.0932307243347168,
0.22866033017635345,
-0.9157246351242065,
0.32247689366340637,
0.2475706785917282,
-0.12214259803295135,
-0.775377631187439,... |
def get _ loadjson ( ) : argspec = inspect. getargspec ( json. load ) if'object _ pairs _ hook'not in argspec. args : return json. load return functools. partial ( json. load, object _ pairs _ hook = multidict ) | [
-0.5250604152679443,
-0.7652018070220947,
0.581849217414856,
-0.8734321594238281,
-0.9004544019699097,
-1.004601001739502,
0.20666366815567017,
-0.7426458597183228,
0.031240705400705338,
0.13123375177383423,
0.13668698072433472,
0.11483955383300781,
0.2610906660556793,
0.20002548396587372,... |
def makewire ( self, * args ) : return _ topods. topods _ builder _ makewire ( self, * args ) | [
-0.8844688534736633,
0.6515305042266846,
0.3243422508239746,
0.15828172862529755,
-0.13460329174995422,
0.7912541627883911,
-0.24889592826366425,
-0.23755893111228943,
-0.47390422224998474,
-0.6940789818763733,
-0.2915215790271759,
0.278984397649765,
-1.2795295715332031,
0.3558741807937622... |
def test _ withdraw _ over _ balance ( self ) : with pytest. raises ( runtimeerror ) as re : c = customer ( 50. 00 ) c. withdraw ( 60. 00 ) assert str ( re. value ). startswith ( " amount greater " ) | [
0.5147239565849304,
0.2632204592227936,
0.42019712924957275,
-0.4973515570163727,
0.23738592863082886,
0.3878067135810852,
-0.5133048295974731,
-0.45869114995002747,
0.42233768105506897,
-0.8161276578903198,
-0.30695974826812744,
-0.14897359907627106,
0.07504167407751083,
0.557736098766326... |
def get _ mu ( self ) : if self. is _ tors ( ) : raise typeerror ( " mode ", self. n, " is torsional! " ) elif self. mu : return self. mu else : raise valueerror ( " reduced mass undefined for mode ", self. n ) | [
-0.4026365876197815,
0.22594405710697174,
0.826938807964325,
0.08424602448940277,
0.5371881723403931,
1.3360763788223267,
0.00902103167027235,
-0.03568987175822258,
0.39214569330215454,
-0.6078775525093079,
1.2862663269042969,
0.4491578936576843,
-0.9888153076171875,
0.5833404064178467,
... |
def delete _ corpus _ helper ( corpus = none, force = false ) : if corpus is none : if force or query _ yes _ no ('do you want to delete every working directory?') : corpora = read _ corpus ( ) write _ corpus ( { } ) for _, value in corpora. iteritems ( ) : rmtree ( value ) else : corpora = read _ corpus ( ) if corpus ... | [
-0.24640440940856934,
-0.024657899513840675,
0.7611395120620728,
-0.038576047867536545,
0.48776763677597046,
-0.28417617082595825,
0.5960416793823242,
0.32965874671936035,
0.023139793425798416,
0.08676886558532715,
0.5300564765930176,
0.07201852649450302,
-0.5640233755111694,
0.61774146556... |
def _ scale _ enum ( anchor, scales ) : w, h, x _ ctr, y _ ctr = _ whctrs ( anchor ) ws = w * scales hs = h * scales anchors = _ mkanchors ( ws, hs, x _ ctr, y _ ctr ) return anchors | [
-0.5102137923240662,
-0.750980794429779,
0.39970922470092773,
-1.0337756872177124,
0.4072209894657135,
-0.4154191017150879,
-0.6581449508666992,
-1.6461234092712402,
0.771736204624176,
0.6429502367973328,
0.17507584393024445,
0.21131935715675354,
0.6980255246162415,
-0.042623165994882584,
... |
def waitcircuittask ( self, fetchmeasure : bool, downloadresult : bool ) - > dict : if settings. outputinfo : print ( f'task { self. taskid } is running, please wait...') req = { " token " : define. hubtoken, " taskid " : self. taskid } stepstatus = _ status. waiting stepstatusname = _ status ( stepstatus ). name while... | [
-0.12321105599403381,
-0.5146673917770386,
0.6975950598716736,
0.5352464914321899,
-0.3282567858695984,
0.6113874912261963,
-0.5158513188362122,
-0.1950671672821045,
-0.8730952143669128,
0.1409095972776413,
-0.6760002970695496,
0.08641807734966278,
0.06390918791294098,
1.2071940898895264,
... |
def main ( argv ) : args = parse _ args ( argv ) file _ name = str ( args. filename ) sample _ size = int ( args. size ) num _ samples = int ( args. number _ sets ) print " subsetting your file % s into % d samples of % d rows... " % ( file _ name \, num _ samples, sample _ size ) wd ='/ users / emily. dahlberg / docum... | [
0.8204166889190674,
-0.14636223018169403,
0.7390538454055786,
0.6311066746711731,
-0.1241435632109642,
0.05456532910466194,
0.8348535299301147,
0.4969482123851776,
-0.23096080124378204,
0.1997326910495758,
-0.13887950778007507,
0.5280380845069885,
0.26198917627334595,
-0.2058144211769104,
... |
def new _ items ( self, items ) : self. clear ( ) if items : for i in items : self. _ widget. additem ( i ) self. _ items + = items | [
-1.2261343002319336,
0.5611920952796936,
0.3378255367279053,
-0.16553424298763275,
1.047505259513855,
0.3833346664905548,
-0.5911568403244019,
-0.2054758071899414,
0.22427250444889069,
0.04284808039665222,
-1.2903954982757568,
-0.5744849443435669,
0.0011796497274190187,
0.601760983467102,
... |
def clean ( self ) : connection = self. _ db _ pool. connect ( ) cursor = connection. cursor ( ) cursor. execute ( " delete from sessions where expires < = now ( ) " ) connection. commit ( ) | [
0.15238849818706512,
-0.7473230957984924,
0.8929453492164612,
0.047388579696416855,
-0.141745463013649,
0.2775663435459137,
-0.27765485644340515,
-0.5649389028549194,
-0.14472611248493195,
1.2598819732666016,
-0.05790381878614426,
-0.22027288377285004,
-0.1460055261850357,
0.17757776379585... |
async def gag ( self ) - > none : response = get ( " https : / / 9gag. com / random " ) await self. bot. say ( response. url ) | [
-0.4595727324485779,
1.1417187452316284,
0.4169716536998749,
-0.20625028014183044,
1.2518141269683838,
0.08532970398664474,
-1.5614173412322998,
0.254097044467926,
-0.5193455815315247,
-0.3649653494358063,
0.04448304325342178,
0.9704948663711548,
-0.8409026265144348,
0.4628853499889374,
... |
def mlp _ weights ( num _ registers, layer _ sizes, gates ) : # the first layer has one input per register. prev _ layer = num _ registers # weights for making the hidden layers. for layer _ size in layer _ sizes : # weights. yield init _ weight ( prev _ layer, layer _ size ) # biases. yield init _ weight ( 1, layer _ ... | [
0.8870120048522949,
0.5743516683578491,
0.7004193067550659,
0.06596780568361282,
0.0023375307209789753,
-0.5970383286476135,
0.8879169821739197,
-0.5231594443321228,
-0.28193625807762146,
0.5172849297523499,
-0.7406780123710632,
0.641525149345398,
-0.33859390020370483,
0.37785276770591736,... |
def getboundaryconfigs ( self, num = 0 ) : retset = [ ] if ( num = = 0 ) : num = self. mradius / 5 + 5 ; dlt _ ang = ( 2 * math. pi ) / float ( num ) ; # increment of angle ; for i in range ( 1, int ( num ) + 1 ) : ang = dlt _ ang * i ; newx = self. msample [ 0 ] + ( self. mradius + 1. 3 ) * math. cos ( ang ) ; newy = ... | [
-0.9768816232681274,
0.30692169070243835,
0.7661057710647583,
0.4264015257358551,
-0.4598158001899719,
-0.26974114775657654,
0.29042544960975647,
0.1044144257903099,
0.3381938338279724,
0.3625089228153229,
-0.22621184587478638,
-0.19842568039894104,
-1.0025047063827515,
-0.0558598563075065... |
def get _ json _ body ( self ) : if not self. request. body : return none body = self. request. body. strip ( ). decode ( " utf - 8 " ) try : model = json. loads ( body ) except exception : app _ log. debug ( " bad json : % r ", body ) app _ log. error ( " couldn't parse json ", exc _ info = true ) raise httperror ( 40... | [
-0.29512131214141846,
-0.311604380607605,
0.7736101150512695,
-0.17344285547733307,
0.17574754357337952,
-0.15514153242111206,
-1.049222469329834,
-0.9942994117736816,
0.5128229856491089,
0.5492895245552063,
-0.03153635188937187,
0.3296775221824646,
-0.17888925969600677,
-0.011447116732597... |
def show _ serving _ release ( dev _ project : str, project : str, env : str ) - > none : serving _ versions = appengine. appengineadmin ( project ). get _ serving _ versions ( ) versions _ to _ tags = gcs. gcsclient ( dev _ project ). get _ releases _ by _ versions ( env, serving _ versions ) print ( f'{ project } :')... | [
0.260507196187973,
0.0946519672870636,
0.6077287793159485,
-0.4164047837257385,
0.43798741698265076,
0.5810462832450867,
-0.5393939018249512,
-0.4999602735042572,
-1.6361294984817505,
1.178680658340454,
-0.1387871652841568,
1.1118983030319214,
0.41925889253616333,
1.062731385231018,
0.20... |
def set _ initial _ conds ( self, array = none, n _ s0 = none, n _ i0 = none, n _ r0 = none ) : if array : arr = np. array ( array, dtype = float ) else : arr = np. array ( [ n _ s0, n _ i0, n _ r0 ], dtype = float ) _ validate _ params ( arr, sir _ num _ ic ) self. pop = np. sum ( arr ) self. w0 = arr / self. pop retu... | [
0.2782694697380066,
-0.10331479460000992,
0.5949407815933228,
0.6553952097892761,
-0.1864263266324997,
0.15214398503303528,
0.9863333702087402,
0.9483166933059692,
-0.054420944303274155,
0.6455379128456116,
0.3422029912471771,
-0.09658406674861908,
-0.6763749718666077,
1.294140338897705,
... |
async def create ( cls, session _ id : str, address : str ) - > " workermetaapi " : worker _ meta _ store _ manager _ ref = await mo. actor _ ref ( uid = workermetastoremanageractor. default _ uid ( ), address = address ) worker _ meta _ store _ ref = ( await worker _ meta _ store _ manager _ ref. new _ session _ meta ... | [
0.010646023787558079,
-0.9710452556610107,
0.4849872291088104,
-0.013263942673802376,
-0.26250025629997253,
0.08023285865783691,
-0.4214688241481781,
-0.21773971617221832,
1.4598153829574585,
0.2737200856208801,
-0.5547019839286804,
1.3652278184890747,
-0.3629732131958008,
-0.5589797496795... |
def mis _ step _ parallel ( self, init _ samples, init _ sample _ lens, init _ sample _ tars, log _ p _ probs, log _ q _ probs, batch _ size, ) : accept _ rate = 0 if init _ samples is none : new _ samples, new _ lens, new _ targets = self. getnoise ( noise _ num = batch _ size ) with torch. no _ grad ( ) : self. noise... | [
0.5983368754386902,
-0.47325849533081055,
0.8530686497688293,
-0.021764539182186127,
-0.032183028757572174,
-0.5537376999855042,
-0.7497979402542114,
0.7157318592071533,
0.10112859308719635,
0.2173127681016922,
0.11818161606788635,
0.4733273684978485,
-0.4975249171257019,
0.367691099643707... |
def percentage ( self ) - > int | none : return self. _ percentage | [
0.5076606273651123,
0.02681262046098709,
0.30828237533569336,
0.4793623983860016,
0.4553937315940857,
-0.4274843633174896,
0.4580644369125366,
-0.719520092010498,
0.4480595290660858,
-0.9038975834846497,
0.5009058713912964,
-1.0298149585723877,
-0.591865062713623,
-0.6209937334060669,
0.... |
def end _ story ( user ) : print ( " congratulations, " + user + ", you have made it to the end of this... strange... adventure. i hope you feel accomplished. " ) print ( ) print ( ) print ( ) sleep ( delay * 5 ) print ( " now go play again. " ) | [
0.8893975615501404,
0.29004159569740295,
0.5281054973602295,
0.6965553164482117,
-0.25717589259147644,
0.5708807706832886,
0.39927640557289124,
-0.7069583535194397,
-0.8477595448493958,
0.18133950233459473,
-0.5158938765525818,
0.7235873341560364,
-0.28213632106781006,
-0.02793630957603454... |
def main ( ) : return render _ template ('index. html') | [
0.42481592297554016,
0.6872170567512512,
0.17694006860256195,
0.5023906230926514,
-0.16269496083259583,
0.2274087518453598,
0.3928971290588379,
1.0080599784851074,
-0.6715036630630493,
0.38564029335975647,
0.4993198812007904,
-0.6472824811935425,
-0.40966808795928955,
-0.5304048657417297,
... |
def iteration ( self, z, c, n _ max ) : for v in range ( n _ max ) : with np. errstate ( all ='ignore') : # catches overflow and invalue value errors z = z * * 2 + c return z | [
0.08206377923488617,
-0.3614274859428406,
0.21854959428310394,
1.0026276111602783,
0.2453470379114151,
0.0434749536216259,
0.47501662373542786,
-1.0421476364135742,
-0.3349132835865021,
0.15419621765613556,
0.11629066616296768,
0.21378165483474731,
0.3108084499835968,
0.6323373913764954,
... |
def parse _ od ( rdata ) : lines = rdata. split ('\ n') # parse input file into list of lines data = [ ] for line in lines [ : - 1 ] : d1 = line. split ( " : " ) d2 = [ int ( d1 [ 1 ] [ : - 7 ] ) ] ods = d1 [ 2 ] [ 2 : - 6 ]. split ( ", " ) for od in ods : d2. append ( float ( od ) ) data. append ( tuple ( d2 ) ) retur... | [
-0.4229963421821594,
-0.07023901492357254,
0.6649940013885498,
-0.6800534129142761,
-0.2556251585483551,
0.7891448736190796,
0.0060041300021111965,
0.012839439325034618,
-0.3294915556907654,
0.5491644144058228,
0.24446935951709747,
-1.0767786502838135,
0.15146878361701965,
-0.1515399962663... |
def pullsnapshot ( self, tablename ) : snapshot = requests. get ( f " { self. snapshoturl } / { tablename } ", auth = httpbasicauth ( self. user, self. pswrd ) ) if snapshot. status _ code = = 200 : snapshot _ df = pd. read _ csv ( stringio ( snapshot. content. decode ('utf - 8') ) ) # replace bad nones and characters ... | [
-1.4505767822265625,
-0.07450688630342484,
0.5034674406051636,
0.44749999046325684,
-1.008549451828003,
-0.8139256238937378,
-1.0848888158798218,
0.47090768814086914,
0.30701395869255066,
-0.6500834822654724,
0.09525536745786667,
0.3472140431404114,
-0.29539042711257935,
-1.282232522964477... |
def measure ( func ) : @ wraps ( func ) def _ time _ it ( * args, * * kwargs ) : start = int ( round ( time ( ) * 1000 ) ) try : return func ( * args, * * kwargs ) finally : end _ = int ( round ( time ( ) * 1000 ) ) - start print ( " total execution time : { } ms ". format ( end _ ) ) return _ time _ it | [
0.08193305879831314,
0.015386995859444141,
0.8328315615653992,
-0.8558425307273865,
-0.30843642354011536,
-0.0015094232512637973,
0.33980271220207214,
0.03299926966428757,
0.15779563784599304,
0.6834461092948914,
0.1890190839767456,
0.24597465991973877,
-0.03583565354347229,
0.429069757461... |
def uct _ score ( self, parent _ playouts : int ) - > float : assert parent _ playouts > 0 # explore - vs - exploit parameter c = sqrt ( 2 ) explore = self. wins / self. playouts exploit = c * sqrt ( log ( parent _ playouts ) / self. playouts ) return explore + exploit | [
0.8242897987365723,
0.02744208090007305,
0.6041121482849121,
0.2437538504600525,
0.08484506607055664,
-0.11051461845636368,
0.7578821778297424,
-0.5529371500015259,
0.1360308676958084,
0.7873972654342651,
0.35240739583969116,
-0.19917264580726624,
-0.34574657678604126,
-0.7852137684822083,... |
def test _ borderline _ cases ( ) : # change of whitespace handling between terms ; no whitespace # between the terms html = u'< body > hallo < span style = " white - space : pre " > echo < / span > versus'assert get _ text ( html, config ) = = u'halloecho versus'# change of whitespace handling between terms ; one whit... | [
0.5896657705307007,
0.5097330808639526,
0.8592483997344971,
0.1384495198726654,
0.517954409122467,
0.40040573477745056,
-0.028141627088189125,
-0.5449721813201904,
0.7991799712181091,
-0.46520015597343445,
-0.2560058534145355,
0.23601049184799194,
-0.2368653565645218,
0.7815220355987549,
... |
def update _ v _ offpolicy ( self, s0, s1, r, a, beh _ pi, target _ pi, theta = none, * * kwargs ) : rho = target _ pi [ s0, a ] / beh _ pi [ s0, a ] kwargs [ " rho " ] = rho return self. update _ v ( s0, s1, r, theta = theta, * * kwargs ) | [
-0.04923639073967934,
-1.4949235916137695,
0.21018686890602112,
-0.41695839166641235,
0.14954087138175964,
0.6944838762283325,
-0.5047320127487183,
1.0306154489517212,
0.740580677986145,
0.9686023592948914,
0.30899491906166077,
0.8163229823112488,
-0.64411461353302,
-0.39347749948501587,
... |
def is _ valid _ string ( self ) : if self. datatype = = " string " : pattern = re. compile ( r " ^ ( [ ^ # \ \ \ \ ] | ( \ \ \ \ [ 0 - 9 ] [ 0 - 9 ] [ 0 - 9 ] ) ) * $ " ) result = re. match ( pattern, self. value ) if result! = none : return true return false | [
-0.08816038072109222,
-0.3472999930381775,
0.8216511607170105,
0.19270530343055725,
-0.46684685349464417,
0.2108994871377945,
0.2777459919452667,
0.06649227440357208,
0.03709188103675842,
-0.5003055334091187,
0.6664141416549683,
0.4301988482475281,
-0.5454089045524597,
-0.4664239287376404,... |
def post _ discovery _ hook ( parser, options ) : # loop through the devices discovered for d in parser. get _ devices ( ) : # if the device has this category c = d. get _ device _ category ( " categoryorderpage ", strict = false ) if c! = none : url = c. get _ value ( ) genericparserport. add _ next _ parser ( digikey... | [
-0.17788101732730865,
0.058436691761016846,
0.40390095114707947,
-0.08944940567016602,
0.9148890972137451,
-0.5787792801856995,
0.5314345955848694,
-0.1802329123020172,
0.21594908833503723,
-0.44354596734046936,
-0.028892097994685173,
-0.3108765184879303,
0.4858005940914154,
0.686388194561... |
def testquery ( self ) : res = self. db. query ( " select 1 " ) self. assertequal ( res [ 0 ] [ 0 ], 1 ) | [
-0.31109991669654846,
0.1264459192752838,
0.027221644297242165,
0.5829886198043823,
0.6656943559646606,
0.1699477732181549,
-0.2444770336151123,
0.15200582146644592,
0.8953281044960022,
-1.0820598602294922,
0.2510310411453247,
0.07562386244535446,
-0.9393478631973267,
-0.7649003267288208,
... |
def close ( self, force : bool = true ) : if self. proc. is _ alive ( ) and force : # signal to napari process that it should be closed try : self. data _ channel. put ( ( " close ", none ) ) except runtimeerror : pass self. data _ channel. close ( ) self. data _ channel. join _ thread ( ) if self. proc. is _ alive ( )... | [
0.21515069901943207,
-0.23520712554454803,
0.72105872631073,
-0.45801249146461487,
0.9383528828620911,
1.497212290763855,
-0.16308194398880005,
-0.6436200141906738,
-0.6601369380950928,
-0.5911529064178467,
0.42111799120903015,
0.3756727874279022,
-1.1137784719467163,
1.2234768867492676,
... |
def _ _ getstate _ _ ( self ) : state = {'normals': { },'queues': { } } self _ dict = self. _ _ dict _ _. copy ( ) for name, item in self _ dict. items ( ) : if ('_ _ thread _ executor'in name or'_ _ processes'in name or'_ _ manager'in name or'logger'in name ) : # we don't want unpickable objects continue elif isinstan... | [
-0.2616674304008484,
-1.162596344947815,
0.6430280804634094,
-0.6562955379486084,
-1.2975236177444458,
-0.25285011529922485,
0.02281949296593666,
-0.6456634402275085,
0.40195968747138977,
-0.41424039006233215,
-0.3523426651954651,
-0.07121048867702484,
0.09884931892156601,
0.43841245770454... |
def create _ knowledge _ base ( self ) - > list [ fact ] : facts = [ ] if not self. map _ proxy. player _ have _ base ( self. player ) : facts. append ( fact ('player _ dont _ have _ base') ) facts. append ( fact ('surrounded ', eval _ function = self. all _ fuzzy _ surrounded, data = self. all _ fuzzy _ surrounded ) )... | [
-0.2507324516773224,
-1.0234766006469727,
0.5228152871131897,
0.08525680750608444,
1.420640230178833,
0.32773786783218384,
-0.06095075234770775,
0.29512694478034973,
-0.4008971154689789,
-0.1810520887374878,
-0.1841573417186737,
0.3562433421611786,
-0.4157780706882477,
0.7539266347885132,
... |
def urlsafe ( value ) : if ( isinstance ( value, datetime. date ) or isinstance ( value, datetime. time ) ) : return value. isoformat ( ) if isinstance ( value, ndb. key ) : return value. urlsafe ( ) if isinstance ( value, list ) : return [ restrule. urlsafe ( v ) for v in value ] if isinstance ( value, set ) : return ... | [
-0.6087667942047119,
0.5448238849639893,
0.7322943806648254,
-0.6085862517356873,
-0.36168378591537476,
0.08232124149799347,
-0.36375856399536133,
-1.0418062210083008,
-0.13595250248908997,
-0.03962765634059906,
0.1850665807723999,
0.11663152277469635,
-0.37160658836364746,
0.9792250394821... |
def page _ to _ events ( self, * * kw ) : for post in self. posts ( * * kw ) : yield self. post _ to _ event ( post ) | [
-0.05720551684498787,
-0.054946016520261765,
0.6564692258834839,
0.460974782705307,
0.3853936195373535,
0.05999144911766052,
-0.254797101020813,
0.20211882889270782,
-0.43281328678131104,
-0.41283541917800903,
-0.016692347824573517,
-0.1908974051475525,
0.4038144052028656,
0.81308656930923... |
def test _ horizontal _ geodesic ( self ) : curve _ b = gs. transpose ( gs. stack ( ( gs. zeros ( self. n _ sampling _ points ), gs. zeros ( self. n _ sampling _ points ), gs. linspace ( 1. 0, 0. 5, self. n _ sampling _ points ), ) ) ) horizontal _ geod _ fun = self. quotient _ srv _ metric _ r3. horizontal _ geodesic ... | [
0.9220982789993286,
0.3251974284648895,
0.6793069243431091,
0.481217622756958,
0.4448476731777191,
0.6412789225578308,
-0.04388788715004921,
-0.34992730617523193,
-0.14847473800182343,
0.28511279821395874,
0.11397992074489594,
-0.10392054915428162,
-0.05568191781640053,
-0.0195845980197191... |
def create _ user ( user : usermodel ) : if ( user ) : controller = usercontroller ( ) return controller. create ( user ) return {'msg':'body is required!'} | [
-0.4380798041820526,
0.33653023838996887,
0.2732221782207489,
1.4552667140960693,
0.05772041901946068,
0.9597081542015076,
0.5077998638153076,
-0.7306073904037476,
0.4673985540866852,
-0.1232682541012764,
-1.2727525234222412,
-0.7506961226463318,
-0.19502900540828705,
0.9609333276748657,
... |
def set _ links _ to _ column ( self, link _ col, target _ col, new _ page = true ) : # hide the link column try : # pragma : no cover self. datatable _ columns [ link _ col ] ['visible'] ='false'except keyerror : # pragma : no cover keys = self. datatable _ columns. keys ( ) logger. warning ( f " keyerror : column nam... | [
-0.42697885632514954,
-0.04219043627381325,
0.7061398029327393,
-0.9852079749107361,
0.9809529781341553,
-0.30265381932258606,
-0.047707412391901016,
0.4201294481754303,
-0.6271205544471741,
-0.2624407112598419,
-0.043313492089509964,
1.026871919631958,
0.5362284779548645,
0.17455111443996... |
def test _ vasp _ calc _ exit _ codes ( run _ vasp _ process, test _ case, expected, has _ notification ) : results, node = run _ vasp _ process ( test _ case = test _ case ) # check that the standard output is there assert'retrieved'in results assert'misc'in results assert'remote _ folder'in results misc = results ['m... | [
0.5414966344833374,
0.3640803098678589,
0.41139522194862366,
0.06298239529132843,
0.4458159804344177,
0.4174327552318573,
0.023276520892977715,
1.0979820489883423,
0.01864534243941307,
-0.34549862146377563,
-0.963249921798706,
-0.8924266695976257,
0.16887524724006653,
0.4830390214920044,
... |
def _ _ init _ _ ( self, path = none, material _ data = none, material _ spec = none, reference = none, local _ vars _ configuration = none ) : # noqa : e501 # noqa : e501 if local _ vars _ configuration is none : local _ vars _ configuration = configuration ( ) self. local _ vars _ configuration = local _ vars _ confi... | [
1.0628491640090942,
-0.6355865597724915,
0.443348228931427,
-0.36928802728652954,
-0.10599080473184586,
-0.10903674364089966,
0.1712333858013153,
0.6592981815338135,
0.18721376359462738,
-0.1965935081243515,
0.10045649856328964,
0.5726025700569153,
-0.13122431933879852,
0.4895913004875183,... |
def set _ ahead ( self, x, y, z = 0 ) : self. ahead = ( x, y, z ) | [
-0.7973642945289612,
0.18275482952594757,
0.31153157353401184,
-0.10784614831209183,
-0.5879700183868408,
1.346206545829773,
-0.33958378434181213,
-0.18764454126358032,
-0.0058393036015331745,
-0.25877469778060913,
-1.3047232627868652,
0.6483442783355713,
-0.1951834112405777,
-0.5088316202... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.