text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def analyze _ samplers _ rw ( sampler _ results, args, folder _ name, stochastic _ process, policy = none, analytic = none ) : panel _ size = plotting. determine _ panel _ size ( len ( sampler _ results ) ) plt. close ( ) fig _ dists = plt. figure ( figsize = ( 8, 9 ) ) # the posterior fig _ traj = plt. figure ( figsiz... | [
0.7486889362335205,
0.18292401731014252,
0.880615234375,
0.49192190170288086,
0.03684097155928612,
0.31392258405685425,
0.5546834468841553,
-0.09284010529518127,
-0.015710948035120964,
0.4877375066280365,
0.31298282742500305,
0.28142020106315613,
0.6847583055496216,
1.3941681385040283,
-... |
def calc _ fittest ( self, list ) : index = 0 temp = math. inf for count, i in enumerate ( list ) : if i < temp : temp = i index = count return index | [
-0.22017274796962738,
-0.5434567332267761,
0.3430190980434418,
0.4798421263694763,
-0.06324489414691925,
0.24340228736400604,
0.7837537527084351,
1.074245810508728,
-0.02636302262544632,
-0.5031599998474121,
-1.43293297290802,
-0.09902989119291306,
-1.13539719581604,
0.643199622631073,
-... |
def _ provider _ organisation ( element, trans ) : org = trans. provider _ organisation provider _ org _ element = etree. subelement ( element, " provider - org " ) if trans. provider _ organisation _ activity : provider _ org _ element. attrib ['provider - activity - id'] = trans. provider _ organisation _ activity if... | [
0.0707901194691658,
0.8825539946556091,
0.6105151176452637,
-1.1952190399169922,
-0.19473224878311157,
0.2467256635427475,
-0.2807503044605255,
0.5312063694000244,
0.5633822083473206,
1.2216017246246338,
0.5937266945838928,
0.18584893643856049,
0.7774495482444763,
-0.8253825902938843,
1.... |
def save _ to _ revit ( self, doc = revit. doc ) : # type : ( document ) - > autodesk. revit. db. familyparameter # create any new shared family parameter if self. is _ new and self. is _ shared : return doc. familymanager. addparameter ( self. definition, self. group. enum _ member, self. is _ instance ) # create any ... | [
-0.8522598147392273,
-0.126598060131073,
0.6935062408447266,
-0.4790891408920288,
-0.08990602195262909,
0.15628831088542938,
1.0378129482269287,
-0.10328380763530731,
-0.024376263841986656,
0.30936363339424133,
0.08787711709737778,
0.17758561670780182,
-0.7175725102424622,
0.87876015901565... |
def get _ stream _ backlog ( self, stream, local = false ) : if self. persistent : url _ endpoint ='/ streams / persistent / stream / { } / backlog? local = { } '. format ( stream, local ) # else : # url _ endpoint ='/ streams / non - persistent / stream / { } / backlog? local = { } '. format ( stream, local ) request ... | [
-0.4506920576095581,
-0.015062813647091389,
1.0000821352005005,
0.1750531941652298,
-0.39701542258262634,
-0.976712167263031,
-0.49359622597694397,
-0.8684468865394592,
-0.41628167033195496,
0.4290124475955963,
-0.24545133113861084,
1.2477591037750244,
-1.0733340978622437,
-0.4577515125274... |
def _ properties _ model _ to _ dict ( properties ) : result = { } for attr in properties. _ _ dict _ _ : value = getattr ( properties, attr ) if hasattr ( value, " _ _ module _ _ " ) and " models " in value. _ _ module _ _ : value = _ properties _ model _ to _ dict ( value ) if not ( value is none or ( isinstance ( va... | [
-0.6563670635223389,
-0.7450832724571228,
0.43204671144485474,
-0.30445119738578796,
-0.5244678854942322,
-0.5924893021583557,
0.0647445023059845,
-0.7113202214241028,
-0.4035663902759552,
-0.2615261375904083,
-0.16405700147151947,
-0.8082641363143921,
0.23543724417686462,
0.72389715909957... |
def test _ check ( self ) : failure = synchronousfailure ( runtimeerror ( ) ) self. assertequals ( failure. check ( zerodivisionerror, runtimeerror ), runtimeerror ) | [
0.5262860059738159,
0.5467557907104492,
0.1869109570980072,
0.8103974461555481,
0.5760957598686218,
0.05939231812953949,
0.3804554343223572,
0.5702412724494934,
-0.8915393948554993,
-1.5204370021820068,
0.22873780131340027,
0.012778948061168194,
-0.8129604458808899,
0.6556798219680786,
0... |
def spatial _ join ( gdf, iou _ threshold = 0. 4, buffer _ size = 1, client = none ) : # turn buffered points into boxes gdf [ " bbox " ] = [ box ( left, bottom, right, top ) for left, bottom, right, top in gdf. geometry. buffer ( buffer _ size ). bounds. values ] # for each overlapping image results = [ ] if client : ... | [
0.3534441590309143,
0.568313717842102,
0.7075645923614502,
0.3150913715362549,
-0.21168428659439087,
0.157198965549469,
0.034331705421209335,
-0.06138494610786438,
-0.9667973518371582,
-0.2517775893211365,
0.5702576637268066,
0.5604641437530518,
-0.7452816963195801,
-0.15601187944412231,
... |
def delete _ media ( self, media _ id ) : return self. bynder _ request _ handler. delete ( endpoint ='/ api / v4 / media / { 0 } / '. format ( media _ id ) ) | [
-0.18635854125022888,
-0.4228101670742035,
0.3200204372406006,
0.36229798197746277,
0.6909569501876831,
-0.7259718775749207,
0.04667104408144951,
-0.01947089098393917,
0.6292071342468262,
-0.02439645305275917,
0.11470772325992584,
0.9651169180870056,
-1.3623703718185425,
1.2140895128250122... |
def daily _ recurrence _ time ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " daily _ recurrence _ time " ) | [
0.37566083669662476,
0.1498291790485382,
0.5409250259399414,
0.601656436920166,
0.8678849339485168,
0.17274847626686096,
0.2699248194694519,
-0.27788713574409485,
-0.07887660712003708,
-0.1596127450466156,
0.35479170083999634,
0.46928876638412476,
0.24685457348823547,
-0.7244750261306763,
... |
def test _ get _ timezones _ by _ countries ( self ) : pass | [
-0.30443453788757324,
0.9804772734642029,
-0.259653240442276,
1.6988393068313599,
0.4562537670135498,
0.4687340259552002,
2.0508551597595215,
-0.6892406344413757,
0.4538170397281647,
0.22570915520191193,
-0.7972912788391113,
-1.2138557434082031,
-1.2465124130249023,
0.10084963589906693,
... |
def env ( self ) : env _ vars = os. environ. copy ( ) env _ vars. update ( self. _ env ) new _ path = " : ". join ( self. _ paths + [ env _ vars [ " path " ] ] if " path " in env _ vars else [ ] + self. _ paths ) env _ vars [ " path " ] = new _ path for env _ var in self. _ env _ drop : if env _ var in env _ vars : del... | [
-0.899705171585083,
-1.194736123085022,
0.7255148887634277,
-0.43331024050712585,
-0.08242030441761017,
0.6300878524780273,
0.08250506222248077,
-0.21156609058380127,
-0.39172473549842834,
0.8421105742454529,
-0.4964829683303833,
0.3437899649143219,
0.5120527148246765,
0.18389327824115753,... |
def binarymatrixrank ( matrix : list [ int ] ) - > int : # todo ( bleichen ) : this function performs a gauss elimination. # if binary matrices are useful for other purposes then this function # should be refactored, and maybe put into a class for binary matrices. for r in matrix : if r < 0 : raise valueerror ( " rows ... | [
-0.4748137593269348,
0.999316394329071,
0.33650508522987366,
0.3284984827041626,
-0.5368561148643494,
-0.4584682583808899,
0.27364060282707214,
0.24797242879867554,
0.5884135961532593,
0.2497125267982483,
0.029799094423651695,
0.6024045944213867,
-0.780646800994873,
1.0844532251358032,
-... |
def convert _ list ( self, list _ object ) : json _ list = [ ] for i in list _ object : json _ list. append ( self. default ( i ) ) return json _ list | [
-1.1813018321990967,
-0.6139352917671204,
0.5246303677558899,
0.7182243466377258,
1.092392086982727,
-1.1414772272109985,
-1.0470222234725952,
0.43179917335510254,
0.6473903656005859,
0.9681597948074341,
-2.315110683441162,
-0.38474568724632263,
-0.0232901182025671,
1.079412817955017,
-0... |
def file _ exists ( self ) : if self. html is none : self. download _ html ( ) if re. search ( r " dieses video ist nicht verfugbar. ", self. html ) is not none or \ re. search ( r " this video is unavailable. ", self. html ) is not none : return false else : return true | [
-0.18965156376361847,
-0.4525018334388733,
0.700128436088562,
0.718535304069519,
0.8653414845466614,
0.0863039493560791,
-0.4959665834903717,
0.7063481211662292,
-0.15197984874248505,
0.1432436853647232,
0.3199608027935028,
0.0879409983754158,
-0.3429203927516937,
1.2398477792739868,
-0.... |
def get ( self, request, slug ) : item = get _ object _ or _ 404 ( track, slug = slug ) context = self. get _ context _ data ( item = item ) context. update ( {'track': item } ) return self. render _ to _ response ( context ) | [
-1.0173382759094238,
0.04711148515343666,
0.5300468802452087,
-0.3163469731807709,
0.46058201789855957,
0.26204821467399597,
-0.28107351064682007,
0.1579718291759491,
-0.04420875012874603,
-0.1375928372144699,
0.45834290981292725,
0.6766737699508667,
-0.3986161947250366,
-0.807893872261047... |
def test _ cant _ get _ car _ invalid _ params ( self ) : json _ response = api _ call ( self, " get ",'/ car / get ', dict ( ), 200, true ) self. assertequal ( json _ response [ " status _ code " ], 400 ) self. assertequal ( json _ response [ " message " ], " invalid request " ) json _ response = api _ call ( self, " ... | [
-0.8698081970214844,
-0.32993581891059875,
0.9959808588027954,
-0.16578510403633118,
0.5862721800804138,
0.3606449365615845,
-0.612907886505127,
-0.5194369554519653,
-1.2887665033340454,
-0.3931708335876465,
-0.5571437478065491,
0.40716949105262756,
-0.20082062482833862,
0.4818228185176849... |
def exo ( self, save = false, prob = true, texcmd = false ) : f = plt. figure ( figsize = ( 6, 8 ) ) f. subplots _ adjust ( hspace = 0. 0001 ) ax1 = plt. subplot ( 211 ) elements = ['o ','c ','fe'] nel = len ( elements ) sol _ abnd = [ 8. 7, 8. 5, 0 ] ax = [ ] # empty list to store axes outex = [ ] statdict = {'host': ... | [
0.5107413530349731,
0.0034762700088322163,
0.9139204621315002,
0.5669770240783691,
-0.8021548986434937,
1.1273581981658936,
0.36290737986564636,
0.7584460973739624,
0.17040930688381195,
-0.29603028297424316,
-0.17150439321994781,
0.4452546238899231,
-0.09063930064439774,
0.7444549202919006... |
def test _ write _ array _ submit _ script ( self ) : self. job _ 1. write _ submit _ script ( ) with open ( os. path. join ( self. job _ 1. local _ path, submit _ filenames [ servers [ self. job _ 1. server ] ['cluster _ soft'] ] ),'r') as f : lines = f. readlines ( ) array, hdf5 = false, false for line in lines : if'... | [
-0.21753175556659698,
-0.8022353649139404,
0.5315402746200562,
0.6432197093963623,
0.9638132452964783,
0.41004034876823425,
0.356830358505249,
-0.02301563322544098,
-0.9263342022895813,
0.3992308974266052,
-0.2243773639202118,
1.1389590501785278,
-0.32430464029312134,
0.8900853395462036,
... |
def init _ workflows _ storage _ path ( default = false ) : try : uri = current _ app. config ['workflows _ file _ location'] if uri. startswith ('/') and not os. path. exists ( uri ) : os. makedirs ( uri ) loc = location ( name = current _ app. config [ " workflows _ default _ file _ location _ name " ], uri = uri, de... | [
0.11611923575401306,
0.22982922196388245,
0.53426593542099,
0.26064467430114746,
0.3713991045951843,
0.29271000623703003,
1.0353766679763794,
-0.05949682742357254,
-0.46194830536842346,
0.10458345711231232,
-0.0680791512131691,
-1.1288659572601318,
-0.9777029752731323,
-0.7312835454940796,... |
def move2 ( self, nodes ) : nodes = nodes [ : : - 1 ] stepcounter = 0 for nodepath in nodes : tx = nodepath. x ty = nodepath. y print ( f'x : { nodepath. x }, y : { nodepath. y }') cmdvel = twist ( ) ww = math. atan2 ( ( ty - self. sy ), ( tx - self. sx ) ) ww = math. degrees ( ww ) print ( " move turn " ) dist = 100 s... | [
-0.28745535016059875,
-0.9630315899848938,
0.5309589505195618,
0.493495911359787,
0.3481740653514862,
0.18887828290462494,
0.7204702496528625,
-0.41951170563697815,
-0.10341835767030716,
0.10049007833003998,
-0.05520470440387726,
0.2182728499174118,
0.10581764578819275,
0.13511624932289124... |
def run _ pipeline ( prover _ tasks : list [ proof _ assistant _ pb2. provertask ], prover _ options : deephol _ pb2. proveroptions, path _ output : text ) : if flags. output. split ( '.') [ - 1 ]! ='textpbs': tf. logging. warn ('output file should end in ". textpbs "') prover. cache _ embeddings ( prover _ options ) t... | [
0.18932417035102844,
-0.0508064441382885,
0.46930357813835144,
1.3642635345458984,
-0.11886939406394958,
0.6292846202850342,
0.912812352180481,
0.22210650146007538,
-0.22042430937290192,
0.04087073728442192,
-0.3228166103363037,
-0.11765439063310623,
0.12439217418432236,
0.7421689629554749... |
def update _ line _ id ( self ) : if self. _ detns _ idx! = - 1 : self. _ lineids [ self. _ detns _ idx ] = self. _ lines [ self. _ slideval ] self. _ lineflg [ self. _ detns _ idx ] = 1 | [
-0.10105248540639877,
-0.8415959477424622,
0.2520020008087158,
-0.46344470977783203,
0.5811452269554138,
0.3425254821777344,
-0.5545073747634888,
-0.061335813254117966,
0.023273330181837082,
-0.6149717569351196,
-0.7193823456764221,
0.49901774525642395,
0.340268611907959,
0.808766007423400... |
def main ( ) : global control _ flag # control flag, true, robot run, false, robot stop global robot # robot structure t = threading. thread ( target = robot _ control, args = ( ) ) # create an robot control threading t. setdaemon ( true ) t. start ( ) key. add _ hotkey ('enter ', flag _ change, args = [ 1 ] ) key. add... | [
0.6485053896903992,
0.11964584141969681,
0.6090442538261414,
0.5131889581680298,
0.6163033246994019,
0.7471945285797119,
0.21807372570037842,
0.41633298993110657,
-0.564780592918396,
-0.4185415208339691,
-0.2570773661136627,
0.202379509806633,
-0.16418451070785522,
0.6391261219978333,
1.... |
def print _ attendance _ percentage ( cls ) : student _ id = input ('insert student id \ n') student _ id = student. get _ student _ from _ list _ by _ id ( student _ id ) if student _ id is not none : attendance _ dict = cls. count _ attendance _ values ( student _ id. id ) if attendance _ dict ['day _ sum'] = = 0 : p... | [
-0.24064922332763672,
-0.08459584414958954,
0.8361841440200806,
0.02921128459274769,
-0.5260633826255798,
0.8502099514007568,
0.5024741888046265,
0.26282206177711487,
-0.3610638678073883,
0.7329734563827515,
0.3799120783805847,
-0.033898595720529556,
-0.18677936494350433,
0.802950084209442... |
def multiplicativemodularsparsedense ( sparsity, d _ feature ) : assert d _ feature % sparsity = = 0 d _ module = d _ feature / / sparsity return tl. serial ( # weight below is used for per - head preprocessing of an embedding. tl. weights ( init. randomnormalinitializer ( stddev = 0. 5 ), shape = [ sparsity, d _ featu... | [
0.08563397079706192,
0.04931941255927086,
0.8801796436309814,
-0.03564123809337616,
0.08925899118185043,
-0.5106282234191895,
0.41859346628189087,
-0.025800347328186035,
1.297056794166565,
0.051958806812763214,
-0.4722777307033539,
-0.2669657766819,
0.1814669370651245,
-0.02394947223365307... |
def objective _ xgb ( trial, est, x _ train, y _ train, randseed, hype _ cv, param _ grid, scoring _ metric ) : posinst = sum ( y _ train ) neginst = len ( y _ train ) - posinst classweight = neginst / float ( posinst ) params = {'booster': trial. suggest _ categorical ('booster ', param _ grid ['booster'] ),'objective... | [
0.10446671396493912,
0.3973173499107361,
0.977473258972168,
0.7846585512161255,
0.0849304348230362,
-0.10498172789812088,
-0.13489298522472382,
-0.33340176939964294,
-1.1653978824615479,
1.3748819828033447,
0.3461706042289734,
0.8932916522026062,
0.26545652747154236,
0.16516543924808502,
... |
def test _ yearly _ totals ( syear : int, eyear : int, station ) : r = eyear - syear for i in range ( r + 1 ) : year = str ( syear + i ) yt = yearly _ totals ( station, year ) yt. to _ csv ('my _ daily _ totals / { } / { } _ { } _ yt. csv '. format ( station, station, year ), index = false ) return none | [
-0.5399903059005737,
-0.5181699395179749,
0.5950807332992554,
0.17602308094501495,
-0.1727989763021469,
-0.11206400394439697,
0.5017423629760742,
-0.6159050464630127,
0.4186258316040039,
-0.3029766380786896,
-0.5241583585739136,
0.03105842135846615,
0.6788613200187683,
-0.19429823756217957... |
def _ add _ to _ command _ register ( self, command _ string, func ) : if command _ string in self. command _ register : raise keyerror ('this command string is already used on a different function.') self. command _ register [ command _ string ] = {'function': func,'arg _ names': func. _ _ code _ _. co _ varnames [ : ... | [
0.09174709767103195,
0.08911414444446564,
0.46254798769950867,
-0.30768710374832153,
1.0759700536727905,
-0.8787965774536133,
-0.15861734747886658,
-0.15690670907497406,
-0.5336927175521851,
-0.9167531132698059,
-0.24370908737182617,
1.013664960861206,
-0.007657420355826616,
0.811974585056... |
def is _ channel _ mention ( text ) : return channel _ mention _ rp. fullmatch ( text ) is not none | [
0.963097095489502,
-1.201270580291748,
0.3587689697742462,
-0.04088061675429344,
0.43196627497673035,
-0.295574426651001,
-0.1476077139377594,
0.5568734407424927,
0.3889370262622833,
0.8587316870689392,
0.20680208504199982,
0.9063435196876526,
-1.3020306825637817,
0.7805587649345398,
-0.... |
def finalize _ arguments ( self ) : pass | [
-0.5711751580238342,
-0.6575746536254883,
0.22591371834278107,
-0.33646711707115173,
0.8961418271064758,
0.33739468455314636,
0.2793794274330139,
-0.3304104506969452,
-0.6782947778701782,
0.19530841708183289,
-0.3593425154685974,
0.22359566390514374,
-0.39592793583869934,
1.064915180206298... |
def action _ command _ confirm _ sent ( self ) : self. ensure _ one ( ) template = self. env. ref ('theme _ chocolat. choco _ email _ template _ sale _ order _ confirm ', false ) compose _ form = self. env. ref ('mail. email _ compose _ message _ wizard _ form ', false ) ctx = dict ( default _ model ='sale. order ', de... | [
0.16849616169929504,
-0.3665946424007416,
0.7127764225006104,
0.2748628854751587,
0.21675609052181244,
-0.8649027943611145,
1.2970291376113892,
-0.6025485396385193,
-0.6481696963310242,
0.5212610363960266,
-0.598745584487915,
0.8643859028816223,
0.9647834300994873,
0.6007753610610962,
-0... |
def format _ filename ( switch ) : now = datetime. datetime. now ( ) return str ( now. strftime ( " % y - % m - % d " ) ) + " _ " + str ( switch ) + " _ " + str ( now. strftime ( " % h _ % m " ) ) + ". txt " | [
-0.32192012667655945,
-1.392254114151001,
1.1374760866165161,
-0.4394221305847168,
-0.5956597328186035,
0.42188066244125366,
-0.633030116558075,
0.19978834688663483,
-0.5368128418922424,
0.44012296199798584,
0.9852260947227478,
0.04734227806329727,
0.7763195037841797,
0.6168842911720276,
... |
def test _ complain _ if _ tick _ db ( self ) : def mock _ list _ history _ databases ( ) : return [ " usa - stk - 1d ", " japan - stk - 1d ", " usa - stk - 15min ", " demo - stk - 1min ", " japan - stk - 15min " ] def mock _ list _ realtime _ databases ( ) : return { " demo - stk - taq " : [ " demo - stk - taq - 1h " ... | [
0.2875637412071228,
1.2910289764404297,
0.5590093731880188,
0.35799044370651245,
0.5125909447669983,
0.034463200718164444,
0.599636971950531,
-0.26877260208129883,
0.1288701891899109,
0.7408615350723267,
-0.14356547594070435,
0.04444802924990654,
-0.768125057220459,
1.0981088876724243,
-... |
def test _ everythingthere ( self ) : trans ='tcp unix ssl udp unixdatagram multicast '. split ( ) for tran in trans [ : ] : if not getattr ( interfaces, " ireactor " + tran ) ( reactor, none ) : trans. remove ( tran ) for tran in trans : for side in'server client '. split ( ) : if tran = = " multicast " and side = = "... | [
-0.38483649492263794,
0.3755265474319458,
0.491897314786911,
0.006711890920996666,
0.9222514033317566,
-0.5688242316246033,
0.19148105382919312,
-0.07116466760635376,
0.3199908137321472,
-0.9651882648468018,
-0.3031179904937744,
-0.1075737401843071,
-0.4712851643562317,
0.116335429251194,
... |
def played ( self ) : return self. _ played | [
0.293147474527359,
-0.7291753888130188,
0.405775249004364,
-0.14321459829807281,
0.9539132714271545,
1.0752278566360474,
1.0448932647705078,
-0.5317285656929016,
0.5408604145050049,
-0.5316739082336426,
-0.5370895266532898,
0.1528448909521103,
-0.016565116122364998,
-0.8322257399559021,
... |
def mem _ limit ( ) : tf. config. gpu. set _ per _ process _ memory _ growth ( true ) | [
1.2469013929367065,
0.6959118247032166,
0.6301481127738953,
0.5320533514022827,
0.3017589747905731,
0.8669341802597046,
0.631925642490387,
0.3756309449672699,
-0.358530730009079,
-0.3500080108642578,
0.43600931763648987,
1.1001259088516235,
-0.2665848433971405,
0.018274350091814995,
0.52... |
def construct _ global _ stiffness _ matrix ( n, basis, d, p, eps, mu ) : p = len ( basis ) eigendata = read _ eigendata ('expansion - data. csv') lambdas = [ val ['lambda'] for val in eigendata ] betas = [ val ['beta'] for val in eigendata ] ast = [ [ none for s in range ( p ) ] for t in range ( p ) ] for s in range (... | [
-0.15248174965381622,
0.1902966946363449,
0.6719900369644165,
-0.30814990401268005,
-0.4493909776210785,
0.25330305099487305,
0.36977678537368774,
0.5607571601867676,
0.07269801199436188,
0.11881215125322342,
0.2873094379901886,
0.6464108824729919,
-0.4841000735759735,
0.4125466048717499,
... |
def scan _ bus ( self ) : for ap in range ( 256 ) : idr = self. read _ ap ( ap, 0xfc ) if idr! = 0x0 and idr! = 0xffffffff : print ( f " 0x { ap : 02x } : 0x { idr : 08x } " ) | [
-0.6031531691551208,
-0.08372122049331665,
0.4362357556819916,
0.6414682269096375,
-0.3867871165275574,
0.5231956243515015,
-0.11357521265745163,
-0.21833448112010956,
1.0398679971694946,
-0.5950273871421814,
-0.012693929485976696,
0.24032139778137207,
-1.4030609130859375,
0.14536103606224... |
def benchmark _ functions ( functions, save _ outputs = false, datasets = none, common = none, outer _ loops = 3, inner _ loops = 3 ) : if datasets is none : datasets = {'single dataset': { } } if common is none : common = collections. ordereddict ( ) # initialize times times = collections. ordereddict ( ) for data _ n... | [
0.14843156933784485,
1.3287111520767212,
0.8755064606666565,
-0.692505955696106,
0.741589367389679,
-0.4364233911037445,
0.3132929503917694,
-0.3439030051231384,
-1.1404844522476196,
1.1109102964401245,
-0.14665137231349945,
0.15139536559581757,
-0.4886878430843353,
1.0927131175994873,
0... |
def update ( self, sess, states, actions, discounted _ rewards ) : # copy current policy network params to old policy network params sess. run ( self. update _ oldpi _ op ) # calculate advantages advantages = sess. run ( self. advantages, { self. states _ ph : states, self. discounted _ reward _ ph : discounted _ rewar... | [
-0.8862823247909546,
-1.0898569822311401,
0.5266437530517578,
-0.45696377754211426,
-0.014637698419392109,
0.5467386245727539,
0.0861465334892273,
0.28231972455978394,
0.53324294090271,
0.5935369729995728,
0.2959837019443512,
0.1440979242324829,
0.7678855657577515,
0.08153117448091507,
0... |
def test _ validate _ postcode _ bad ( self ) : bad _ postcode = " gu24 " with self. assertraises ( exception ) as context : helpers. validate _ postcode ( bad _ postcode ) exception = context. exception self. assertequal ( exception. args [ 0 ] [ " status _ code " ], 400 ) self. assertequal ( exception. args [ 0 ] [ "... | [
0.03668800741434097,
0.10282938927412033,
0.8708707690238953,
0.40564337372779846,
0.8384509682655334,
0.4632423222064972,
-0.3533252775669098,
0.18372757732868195,
0.03777604550123215,
-0.09688413143157959,
-0.32558292150497437,
0.23773084580898285,
-0.41627514362335205,
0.501375377178192... |
def wipe _ drive ( self, drive ) : # wipe the partition superblocks. for ii in range ( 5, 5 + num _ arrays ) : self. zero _ superblock ( " % s % d " % ( drive, ii ) ) # remove any partitions from the existing drives. self. delete _ partitions ( drive ) | [
-0.0536247082054615,
-0.3324345648288727,
0.2123752236366272,
-0.01591091975569725,
-0.08810803294181824,
-0.005606089718639851,
0.7451331615447998,
0.15123911201953888,
0.6572416424751282,
-0.18194754421710968,
0.10381194204092026,
0.6884479522705078,
-0.6635506749153137,
-0.1092303246259... |
async def delete _ event _ manager _ app ( self, message _ id : int ) - > none : mycursor, db = await the _ database ( ) await mycursor. execute ( " delete from eventmanagerapplication where message _ id = % s ", ( message _ id, ) ) await db. commit ( ) await mycursor. close ( ) | [
0.8261148929595947,
-0.4200061857700348,
0.3056105375289917,
0.14497287571430206,
-0.04689034819602966,
0.20645448565483093,
0.1092982217669487,
0.005530453287065029,
-0.11075811088085175,
0.6797351241111755,
0.7539883255958557,
0.09157104790210724,
-0.7040887475013733,
1.1799896955490112,... |
def get _ context _ data ( self, * * context ) : if not in _ some _ groups ( self. request. user. pk or 0, [ group _ admin _ pk ] ) : self. permission _ denied ( self. request ) try : timestamp = int ( self. request. query _ params. get ( " timestamp ", 0 ) ) except valueerror : raise validationerror ( { " detail " : "... | [
-0.6579486131668091,
0.7187142372131348,
0.7036669850349426,
-0.22290751338005066,
-0.5965667366981506,
-0.3195241391658783,
0.32538604736328125,
-0.5836803913116455,
0.5871400833129883,
0.7046082615852356,
-0.22288429737091064,
0.16804549098014832,
0.22335760295391083,
0.10479818284511566... |
def get _ sections _ for _ learner ( self, svc, course ) - > optional [ list ] : # pragma : nocover return none | [
0.3629128336906433,
-0.20686697959899902,
0.3523913025856018,
0.18358516693115234,
0.3653906583786011,
0.06585181504487991,
-0.17687056958675385,
-1.4838595390319824,
0.31109553575515747,
-0.750171422958374,
0.1214171051979065,
-0.38241028785705566,
0.3197580575942993,
0.8758471608161926,
... |
def get _ context _ data ( self, * * kwargs ) : context = super ( ). get _ context _ data ( * * kwargs ) context ['user'] = self. request. user context ['profile'] = self. request. user. profile return context | [
-0.35574784874916077,
0.19799822568893433,
0.4791841208934784,
0.7024129033088684,
0.0075340066105127335,
0.7080996036529541,
-0.15740062296390533,
-0.6888809204101562,
0.4043916165828705,
-0.28992196917533875,
-0.7886432409286499,
0.2043483704328537,
0.19843988120555878,
-0.18749018013477... |
def _ fit ( self, x _ train, x _ test, num _ parameters, sigma, alpha _ 0 = none ) : num _ parameters = num _ parameters if type ( num _ parameters ) = = float : num _ parameters = int ( x _ test. shape [ 0 ] * num _ parameters ) self. _ select _ param _ vectors ( x _ test = x _ test, sigma = sigma, num _ parameters = ... | [
0.22832722961902618,
0.003966178745031357,
0.7540234327316284,
0.11816946417093277,
-0.2665911018848419,
-0.7376097440719604,
0.7368609309196472,
0.7317354083061218,
-0.2098352015018463,
0.31274697184562683,
0.01992570422589779,
0.02999201789498329,
-0.37972062826156616,
0.4184643626213074... |
def _ _ init _ _ ( self, feature _ columns, trainable = true, name = none, * * kwargs ) : super ( densefeatures, self ). _ _ init _ _ ( feature _ columns = feature _ columns, trainable = trainable, name = name, expected _ column _ type = fc. densecolumn, * * kwargs ) | [
0.25154417753219604,
0.5862698554992676,
0.6231088638305664,
1.3742797374725342,
0.7772570252418518,
-0.8902881145477295,
0.7692362666130066,
0.11724105477333069,
-0.4276730716228485,
-0.8951255083084106,
-1.300667405128479,
-0.5474613308906555,
0.0884123221039772,
-0.3469650149345398,
-... |
def sendandwaitforresponse ( self, stanza, timeout = defaulttimeout ) : return self. waitforresponse ( self. send ( stanza ), timeout ) | [
-0.40159282088279724,
-0.25987958908081055,
0.36243531107902527,
0.2869139611721039,
-0.5282778143882751,
-0.052020113915205,
-0.355243444442749,
-0.7733983993530273,
0.3622448742389679,
0.02942482754588127,
-0.12779328227043152,
-0.9640255570411682,
-0.2684687674045563,
-0.610230505466461... |
def playnew ( self, url ) : # set media object to play url # set window title to url # update track time self. mediaobject. setcurrentsource ( phonon. mediasource ( url ) ) self. setwindowtitle ( os. path. basename ( url ) ) self. mediaobject. play ( ) # print ( self. mediaobject. metadata ( ) ) | [
-0.6215131282806396,
-0.6591246128082275,
0.4439767003059387,
0.21563376486301422,
-0.23723886907100677,
0.6715530157089233,
0.007706720847636461,
-0.460618793964386,
-0.15046745538711548,
-0.281936377286911,
-0.42779144644737244,
0.5432849526405334,
-0.04025671258568764,
0.457894086837768... |
def base _ commands ( ) : return [ cmd for cmd in templates [ " base " ] [ " containers " ]. split ('\ n') ] | [
-0.3381005823612213,
-0.9458401203155518,
0.5441566109657288,
0.6219990253448486,
1.1190444231033325,
-0.8916690349578857,
-0.8240872025489807,
-0.34399935603141785,
-0.2941901385784149,
-0.44515514373779297,
-0.5759296417236328,
-0.05070066824555397,
0.33628061413764954,
0.760200738906860... |
def disconnect ( self ) : self. _ owner _ send ('< / stream : stream >') while self. process ( 1 ) : pass | [
0.21095813810825348,
0.14928577840328217,
0.640708327293396,
0.47532159090042114,
0.120024174451828,
-0.2296862155199051,
0.5046412944793701,
-1.0999436378479004,
-0.010535786859691143,
-0.42972704768180847,
-0.29680442810058594,
0.5181750059127808,
-0.7824417948722839,
0.2895652949810028,... |
def _ process _ ports ( self, ports, decrement = false ) : for dvs _ uuid, port _ list in six. iteritems ( _ ports _ by _ switch ( ports ) ) : for port in port _ list : sg _ set = sg _ util. security _ group _ set ( port ) if not sg _ set : log. debug ( " port { } has no security group set, skipping processing. ". form... | [
-0.16435687243938446,
0.6133077144622803,
0.6380565166473389,
-0.13476213812828064,
0.43629905581474304,
-0.6109628081321716,
0.1984296292066574,
-0.34480252861976624,
-0.06227557733654976,
0.7227607369422913,
0.5666652917861938,
-0.09108559787273407,
0.03549846634268761,
0.883663296699523... |
def get _ config _ from _ fparameter ( fparameter _ name ) : return fswiftmlutils. parameters ( fparameter _ name ) | [
-0.24687965214252472,
0.2709031105041504,
0.26248952746391296,
0.39852383732795715,
-0.7978253960609436,
-1.1096452474594116,
-0.026176637038588524,
-0.008282502181828022,
-0.45816555619239807,
0.612448513507843,
0.025877542793750763,
-0.4286061227321625,
-0.08577954024076462,
1.1596182584... |
def load _ image _ from _ file ( self, filename, shape ) : if not tf. gfile. exists ( filename ) : tf. logging. error ('cannot find file : { } '. format ( filename ) ) return none try : # ensure image has no transparency channel img = np. array ( pil. image. open ( tf. gfile. open ( filename,'rb') ). convert ('rgb'). r... | [
0.0891135036945343,
-0.3353084921836853,
0.726658821105957,
-0.4746764302253723,
0.00814979337155819,
0.610843300819397,
-0.23628196120262146,
-0.21491044759750366,
-0.9030835628509521,
0.9801299571990967,
0.7646946907043457,
-0.14617452025413513,
-0.21100793778896332,
-0.5153430104255676,... |
def use _ cores ( nr _ cores ) : global _ cores _ cores = nr _ cores | [
-0.28653326630592346,
1.1438237428665161,
0.5124209523200989,
-0.4013742208480835,
0.5475289225578308,
-0.3007524013519287,
0.6914430856704712,
-0.15076696872711182,
0.01811636984348297,
0.6227089762687683,
-0.15614357590675354,
0.39976778626441956,
-1.4874111413955688,
0.5541216135025024,... |
def parse ( self, response ) : # html elements selectors link _ selector = " li > a : : attr ( href ) " # path to. txt file links _ file _ path = path ( ".. /.. /.. / links / correio _ braziliense. txt " ) links _ file _ path. touch ( exist _ ok = true ) # parse and save with open ( links _ file _ path, " a " ) as link... | [
0.11466937512159348,
-0.8961696028709412,
0.41921040415763855,
0.019639432430267334,
1.4857722520828247,
0.8766236305236816,
0.7709393501281738,
1.1467764377593994,
-0.22853587567806244,
-0.5393507480621338,
-0.7594964504241943,
-0.8783848285675049,
0.04856893792748451,
-0.1845723390579223... |
def sca ( ) : print ( " loading wrf data " ) wrfdata = load _ wrf ( [ 2008 ] ) print ( " loading modscag data " ) modsca = modscag. load ( " modscag / fsca2008. dat " ) geo = wrfdata [ 0 ] latsub = np. where ( ( geo. lat > = comparison _ domain. lat [ 0 ] ) & ( geo. lat < = comparison _ domain. lat [ 1 ] ) ) [ 0 ] lats... | [
-0.5241606831550598,
0.12168566882610321,
0.9383265972137451,
-0.7415366172790527,
0.07071763277053833,
-0.13374640047550201,
0.28831014037132263,
0.486191064119339,
0.08310378342866898,
0.2396828830242157,
0.7347902059555054,
2.103693962097168,
0.3609243333339691,
0.5947720408439636,
0.... |
def callinguithread ( callable, * arguments, * * named ) : alreadyput = 0 for scene in scenes : context = getattr ( scene,'_ context') if context and not alreadyput : context. eventcascadequeue. put ( ( callable, arguments, named ) ) alreadyput = 1 if context : context. triggerredraw ( 1 ) | [
-0.7020808458328247,
0.7050092816352844,
0.6202638149261475,
0.34656432271003723,
0.5097617506980896,
-0.22126169502735138,
0.12980683147907257,
-1.1529808044433594,
0.3447869122028351,
0.13963903486728668,
-0.30190175771713257,
-0.19742518663406372,
-0.2615892291069031,
0.4431822597980499... |
def get _ plugins ( ) : path = geoserver _ rest _ plugin _ url archive = workdir +'/'+ geoserver _ rest _ plugin print'archive ', archive if not os. path. isfile ( archive ) : # fixme : should also check integrity of zip file. cmd ='cd % s ; wget % s'% ( workdir, path ) run ( cmd, verbose = true ) # unpack into geoserv... | [
0.2734568119049072,
-0.8962000608444214,
0.5987584590911865,
-0.07211374491453171,
0.8953614830970764,
-0.40134504437446594,
0.1723802089691162,
0.17407700419425964,
0.7024806141853333,
-0.033675022423267365,
-0.3979009687900543,
0.5184370279312134,
-0.1656983643770218,
-0.1261753886938095... |
def hidesystemmsgackgui ( self ) : if self. systemmsgackgui! = none and not self. systemmsgackgui. isempty ( ) : self. systemmsgackgui. hide ( ) | [
1.1495238542556763,
0.5967442393302917,
0.7241305708885193,
-0.019732458516955376,
0.1764814406633377,
0.6280209422111511,
0.6774453520774841,
-0.16832630336284637,
-0.5755162835121155,
0.06313581764698029,
0.12580494582653046,
0.276577353477478,
-1.2679039239883423,
1.8644672632217407,
... |
def fix _ temp ( sensor _ d ) : t1 = false t2 = false if'temperature'in sensor _ d : t1 = true if'temperature'in sensor _ d : t2 = true if t1 : for i in range ( len ( sensor _ d ['temperature'] [ 1 ] ) ) : sensor _ d ['temperature'] [ 1 ] [ i ] + = sensor _ d ['temperature'] [ 1 ] [ i ] sensor _ d ['temperature'] [ 1 ]... | [
-0.0852745920419693,
-0.4081111550331116,
0.6918017268180847,
-0.861726701259613,
0.36042410135269165,
0.9270803928375244,
0.4363968074321747,
0.57657390832901,
-0.44952866435050964,
0.8476740121841431,
-0.6186795830726624,
-0.3188232183456421,
0.0756947323679924,
0.5392875671386719,
0.4... |
def post ( self, author _ name, post _ id ) : self. post _ params ( author _ name, post _ id ) comment _ id = self. request. get ('comment _ id') uri = self. uri _ for ('post - comments ', author _ name = author _ name, post _ id = post _ id ) action = self. request. get ('action _ comment') # if action is perfomed by ... | [
-0.044189244508743286,
-0.3566589057445526,
0.8801872134208679,
0.9784840941429138,
0.5663474798202515,
0.05189628526568413,
0.46023130416870117,
0.4400540590286255,
0.19279079139232635,
-0.2311590313911438,
0.3956710398197174,
-0.6259955763816833,
0.031879860907793045,
-0.0047298138961195... |
def parse _ header ( header : list ) : html = [ ] for headertag in header : if len ( headertag ) > 0 and headertag [ 0 ] = ='#': hashes = 0 while hashes < len ( headertag ) and headertag [ hashes ] = ='#': hashes + = 1 if hashes > 6 : hashes = 6 html _ h ='h'+ str ( hashes ) headertag = headertag. strip ('#') headertag... | [
0.15587466955184937,
0.257647305727005,
0.6304568648338318,
0.8595189452171326,
-0.22956785559654236,
-0.10772527754306793,
-0.6713706254959106,
0.21737761795520782,
-0.21917182207107544,
0.05327489972114563,
-0.5730676651000977,
-1.1427600383758545,
0.26212236285209656,
0.5393664240837097... |
def played _ dominoes ( played ) : length = len ( played ) if length < 7 : print ( * played ) elif length > 6 : abbr _ played = [ ] one = played [ 0 ] two = played [ 1 ] three = played [ 2 ] six = played [ - 1 ] five = played [ - 2 ] four = played [ - 3 ] middle = '...'abbr _ played. append ( one ) abbr _ played. appen... | [
0.22604487836360931,
-0.6884095668792725,
1.053906798362732,
-0.20680367946624756,
0.16185162961483002,
0.17738962173461914,
0.4756549894809723,
-0.025423232465982437,
0.9322566390037537,
0.793087899684906,
-0.4978201687335968,
0.20522800087928772,
-0.27477148175239563,
-0.4731734097003937... |
def file _ infodata _ file _ ending ( self ) : return'_ info. json ' | [
-0.0989425852894783,
-1.3791900873184204,
0.5615053772926331,
-0.9821401834487915,
0.3544882535934448,
1.6001499891281128,
-0.6688986420631409,
-0.4187704026699066,
-2.0304412841796875,
0.5416686534881592,
-0.2822839915752411,
-0.0892343819141388,
1.290030598640442,
0.14123579859733582,
... |
def print _ confusion _ matrix ( confusion _ matrix, class _ names, figsize = ( 10, 7 ), fontsize = 14 ) : df _ cm = pd. dataframe ( confusion _ matrix, index = class _ names, columns = class _ names, ) fig = plt. figure ( figsize = figsize ) try : heatmap = seaborn. heatmap ( df _ cm, annot = true, fmt = " d " ) excep... | [
0.3956248462200165,
0.6509299874305725,
0.6222792267799377,
-0.33716049790382385,
-0.6401736736297607,
0.2982858121395111,
0.3079882264137268,
0.07646240293979645,
0.03293723985552788,
0.12716341018676758,
0.5177832841873169,
0.5476979613304138,
0.12161961942911148,
-0.22131572663784027,
... |
def testupdatevaluesforquerieswithnonevalue ( self ) : securetagapi ( self. user ). create ( [ ( u'username / bar ', u'description') ] ) objectid = uuid4 ( ) # fixme replace this with securetagvalueapi once the index is # integrated values = { objectid : { u'username / bar': 42 } } valuesapi = securetagvalueapi ( self.... | [
-0.6186666488647461,
0.06642153859138489,
0.3597247004508972,
-0.18054310977458954,
0.19631356000900269,
0.4210844337940216,
-0.21030880510807037,
-0.5738604664802551,
-0.18209372460842133,
-0.7325677275657654,
-0.34825605154037476,
-0.2676248848438263,
-0.4745282828807831,
0.0585386082530... |
def site _ id ( self, site _ id ) : self. _ site _ id = site _ id | [
0.7151519656181335,
0.03739723190665245,
-0.3123345673084259,
0.2505321800708771,
0.6046726107597351,
0.5410427451133728,
0.22287841141223907,
0.7908931970596313,
0.8471004366874695,
0.28685590624809265,
-0.24569706618785858,
0.163642019033432,
-0.17068123817443848,
0.8640105724334717,
-... |
def forward ( self, concat _ repr : torch. tensor ) - > torch. tensor : x = self. dense1 ( concat _ repr ) x = self. relu ( x ) x = self. dense2 ( x ) x = self. relu ( x ) logit = self. dense3 ( x ) return logit | [
-0.045198626816272736,
0.24413752555847168,
0.3783259987831116,
-0.40337273478507996,
-0.30093660950660706,
0.338120698928833,
-0.2648809254169464,
0.2829004228115082,
0.3724098801612854,
0.04578827694058418,
0.09240962564945221,
0.22479699552059174,
-0.4312160313129425,
-0.782346546649932... |
def due _ date ( self ) : due = self. _ _ card. due _ date if due : return due. astimezone ( tz = pytz. utc ) return none | [
1.0407283306121826,
-0.2973707318305969,
0.4502938389778137,
0.24928931891918182,
0.23163747787475586,
-0.2480921745300293,
-1.0825027227401733,
-0.7572113871574402,
0.4351651668548584,
0.16142702102661133,
0.6515556573867798,
-0.41296520829200745,
-0.5068486928939819,
-0.39402180910110474... |
def _ get _ gallery _ folder ( self, folderid, page _ idx ) : return self. _ api ( f " / gallery / { folderid } ", get _ data = { " username " : self. user, " mode " : " newest ", " offset " : page _ idx * daexplorer. max _ items _ per _ request, " limit " : daexplorer. max _ items _ per _ request, " mature _ content "... | [
-1.411112666130066,
0.3623984158039093,
0.39089491963386536,
-0.06774545460939407,
0.01706015132367611,
-0.7343491315841675,
-0.42016294598579407,
-0.8326449394226074,
0.04190812632441521,
-0.3529999554157257,
0.289244145154953,
0.7529363036155701,
-0.0024964450858533382,
0.682049334049224... |
def dvar ( self, shape = ( 1, ), vtype ='c ', name = none, aux = false ) : new _ var = self. rc _ model. dvar ( shape, vtype, name, aux ) return new _ var | [
-0.33466005325317383,
0.44177767634391785,
0.5781707763671875,
-0.44902679324150085,
-0.9981781244277954,
0.24690288305282593,
0.0666424110531807,
-0.5260185599327087,
-0.3335006833076477,
0.008641930297017097,
-0.9935747981071472,
0.8259572982788086,
-0.2650354504585266,
-0.29879799485206... |
def query _ backend ( self, criteria ) : # distribute our search query to several fields limit = criteria. get ('per _ page ', 15 ) sort = [ ] if criteria. get ('sort _ order') = ='oldest': sort = [ {'changetime': {'order':'asc'} } ] elif criteria. get ('sort _ order') = ='newest': sort = [ {'changetime': {'order':'des... | [
0.23276641964912415,
0.43490320444107056,
1.0383381843566895,
-0.7765589356422424,
-0.43844011425971985,
-0.5517095923423767,
-0.43270114064216614,
0.3919450342655182,
-0.4439263343811035,
-0.13143177330493927,
0.21532313525676727,
-0.021815642714500427,
-0.005063316784799099,
0.2698175013... |
def main ( argv : list [ str ] = none ) - > int : # # build main arg parser # def get _ formatter ( prog ) : return helpformatter ( prog, max _ help _ position = 40 ) parser = argumentparser ( formatter _ class = get _ formatter, description ='the sentence ( sam ) pler tool suite') sub _ parsers = parser. add _ subpars... | [
-0.0629483237862587,
0.16889658570289612,
1.3897348642349243,
0.024515671655535698,
-0.16655535995960236,
0.028085997328162193,
0.7972608208656311,
0.09555323421955109,
-0.0891585424542427,
-0.33354154229164124,
-0.2823898494243622,
0.15856271982192993,
-0.33105969429016113,
0.714952349662... |
def test _ get _ agent _ requirement ( self ) : pass | [
-0.7967398762702942,
-1.017685055732727,
0.4429190456867218,
1.3599112033843994,
0.6069390177726746,
0.4176357686519623,
0.2728041410446167,
-0.06232850253582001,
0.553770899772644,
-0.3970775604248047,
-0.31183379888534546,
0.5295456647872925,
-0.33516639471054077,
0.4658542275428772,
0... |
def handle _ incoming _ messages ( self ) : for bus in self. buses : bus. handle _ incoming _ messages ( ) | [
-0.5186911821365356,
-0.02672802470624447,
0.30396944284439087,
0.8579148650169373,
1.0777209997177124,
0.5623235106468201,
1.4053953886032104,
-0.09532630443572998,
-0.5521053671836853,
-0.5502616167068481,
0.016921978443861008,
-0.9324585199356079,
-1.111314296722412,
1.1726500988006592,... |
def test _ lth _ 2 ( self ) : # unpolarized case self. assertequal ( lth _ 2 ( r1 = sp. s ( 2 ) / 5, r2 = sp. s ( 2 ) / 5 ), 0 ) # maximally negative self. assertequal ( lth _ 2 ( r1 = 0, r2 = 0 ), - sp. s ( 3 ) / 5 ) # maximally positive self. assertequal ( lth _ 2 ( r1 = 0, r2 = 1 ), 1 ) # | jz | = 1 pure state has l... | [
0.6267221570014954,
-1.0244948863983154,
0.49770450592041016,
0.5903046727180481,
0.027981603518128395,
1.0998772382736206,
-0.8403154015541077,
-0.19105082750320435,
-0.08380218595266342,
-0.6466781497001648,
-0.8272799253463745,
-0.37207773327827454,
0.18665511906147003,
0.62990307807922... |
def _ _ len _ _ ( self ) : return len ( self. obj _ dict ) | [
0.03956669941544533,
-0.6774782538414001,
0.3066214621067047,
-1.850746750831604,
0.17229895293712616,
0.4556771218776703,
0.3739667534828186,
1.1722246408462524,
0.4437260925769806,
-0.16543853282928467,
-0.9409786462783813,
-0.4929029047489166,
0.8227787017822266,
-0.277214378118515,
0... |
def get _ ann _ ypos ( self, scale = 1. 02 ) : ypos = np. zeros ( self. _ detns. size ) for xx in range ( self. _ detns. size ) : wmin = np. argmin ( np. abs ( self. specx - self. _ detns [ xx ] ) ) ypos [ xx ] = scale * np. max ( self. specdata [ wmin - 1 : wmin + 2 ] ) return ypos | [
-0.13820402324199677,
-0.9406985640525818,
0.7472172379493713,
-0.2185373455286026,
-0.26559555530548096,
0.30145642161369324,
-0.0758448913693428,
-0.8305753469467163,
-0.6063375473022461,
0.22581303119659424,
-0.37534084916114807,
0.5477080941200256,
0.42044004797935486,
0.25535431504249... |
def test _ create _ multiple _ alumno _ curso _ distintos ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) alumno _ 1 = alumno. objects. get ( apellido = " 1 " ). pk alumno _ 2 = alumno. objects. get ( apellido = " 2 " ). pk curso _ 1 = curso. objects. get ( nombre = " curso2 " ). pk curso _ ... | [
0.19653885066509247,
-0.44474685192108154,
0.796125590801239,
-0.11849366873502731,
0.7996630072593689,
0.9405882954597473,
0.08305578678846359,
-0.1639886349439621,
-0.17326582968235016,
0.1984381526708603,
-1.5808866024017334,
0.1531074047088623,
0.8094774484634399,
0.4636407792568207,
... |
def run _ base ( self, context ) : log. debug ( " drydock operator for action % s ", self. action _ id ) # if continue processing is false, don't bother setting up things. if self. _ continue _ processing _ flag ( ) : # retrieve config values from shipyard configuration. config = configparser. configparser ( ) config. ... | [
-0.6798453330993652,
0.4090804159641266,
0.6676790714263916,
-0.09150756150484085,
0.35144200921058655,
-0.5969213843345642,
1.2016617059707642,
-0.48253974318504333,
-0.3373810052871704,
0.3342096507549286,
0.2209366410970688,
0.03404441475868225,
0.5091053247451782,
-0.06976718455553055,... |
def tst _ spec _ suite _ parsing ( ) : for fname in sorted ( os. listdir ( get _ spec _ suite _ dir ( ) ) ) : if fname. lower ( ). endswith ( '. wast') : do _ func ( fname ) | [
0.18622258305549622,
-0.19608142971992493,
0.6667131185531616,
0.5021741390228271,
0.3374801576137543,
-0.10086946934461594,
0.8777598142623901,
0.18762412667274475,
-0.48407527804374695,
0.19144676625728607,
0.13108834624290466,
0.4643518328666687,
0.8155136704444885,
0.81396484375,
-0.... |
async def async _ setup _ platform ( hass, config, async _ add _ entities, discovery _ info = none ) : api = hass. data [ domain ] [ " api " ] cameras = [ ] _ logger. info ( " adding nest camerass " ) for camera in api [ " cameras " ] : _ logger. info ( f " adding nest camera uuid : { camera } " ) cameras. append ( nes... | [
-0.6346932053565979,
0.556879460811615,
0.5032871961593628,
0.6783063411712646,
1.5373367071151733,
0.006769929081201553,
-0.07712632417678833,
-0.17730574309825897,
0.6075562834739685,
0.37269163131713867,
-0.6303184628486633,
-0.1887439787387848,
-0.17164084315299988,
1.3927254676818848,... |
def spew ( path, data, owner = none ) : with open ( path,'w') as f : f. write ( data ) if owner : try : chown ( path, owner ) except : raise exception ( " unable to set ownership of { } ". format ( path ) ) | [
0.45611390471458435,
0.2034076750278473,
0.6996740102767944,
0.9563780426979065,
-0.007225502282381058,
0.6816688179969788,
-0.17626401782035828,
0.26621946692466736,
0.5046165585517883,
-0.9655559062957764,
0.09915712475776672,
0.4631726145744324,
0.04762320592999458,
-0.4495454728603363,... |
def exactlinesearch ( func _ alpha ) : alpha = 1 alpha = optimize. minimize ( func _ alpha, alpha, method ='nelder - mead') return alpha. x | [
-0.08418519794940948,
-0.45976918935775757,
0.34199026226997375,
0.10197174549102783,
0.5858263373374939,
-0.0931219533085823,
0.09475364536046982,
0.40152961015701294,
-0.010399119928479195,
0.08587843924760818,
-0.15583346784114838,
-0.5240874886512756,
-0.14415600895881653,
1.1240459680... |
def parsetargets ( targetfile ) : x = [ ] f = open ( targetfile, " r " ) for line in f : items = line. strip ( ). split ( " \ t " ) if len ( items )! = 4 : message ( " invalid target file. should have 4 columns ", error ) chrom, start, end, name = items region = " % s : % s " % ( chrom, start ) x. append ( { " name " :... | [
-0.20974211394786835,
-1.184089183807373,
0.5513754487037659,
-0.840082049369812,
0.04018484801054001,
0.4488691985607147,
-0.5539394021034241,
0.09801147878170013,
-1.2221653461456299,
0.6743791103363037,
-0.4435233473777771,
0.01122745405882597,
0.5756175518035889,
-0.5227982997894287,
... |
def error _ rate ( predictions, labels ) : assert len ( predictions ) = = len ( labels ) return 100. 0 - ( 100. 0 * np. sum ( np. argmax ( predictions, 1 ) = = np. argmax ( labels, 1 ) ) / predictions. shape [ 0 ] ) | [
-0.681464433670044,
0.1580514758825302,
0.1508702039718628,
0.039048317819833755,
0.5991638898849487,
0.11345288902521133,
-0.9034426212310791,
0.6050252914428711,
-0.6005443930625916,
1.0545092821121216,
1.148480772972107,
-0.22281579673290253,
-0.09393524378538132,
0.01772402599453926,
... |
def simulate _ from _ mvn _ covariance _ structure ( nobs, nvars, mean _ vector, covariance _ matrix ) : simulated _ data = random. normal ( 0, 1, nobs * nvars ). reshape ( nobs, nvars ). dot ( cholesky ( covariance _ matrix ). t ) + mean _ vector return simulated _ data | [
-0.28289133310317993,
0.2737538516521454,
0.3609886169433594,
0.10813044756650925,
-0.6783295273780823,
-0.045463599264621735,
-0.28728803992271423,
-0.1684732288122177,
0.5796847343444824,
1.0613682270050049,
-0.44672447443008423,
0.6045725345611572,
0.21264731884002686,
-0.29513353109359... |
def epsilonnet ( self, generator = none, n = 1000, epsilon = 5 ) : x = self. sample ( 1 ) while true : z = self. sample ( n = n ) # print ('x = ', x ) # print ('z = ', z ) _ dist = self. distances ( x, z ) # compute matrix where entry i, j is the distance between center i and candidate j # print ('dist = ', _ dist ) mi... | [
-0.26586687564849854,
-0.9241023659706116,
0.7165610790252686,
-0.11673104017972946,
-0.08336324244737625,
-0.19290727376937866,
-0.12666261196136475,
0.3086060583591461,
0.504515528678894,
0.5301957726478577,
-0.47168996930122375,
0.1410350799560547,
0.16451221704483032,
0.242707803845405... |
def _ make _ file _ path ( self, context, type _ name, payload ) : inc _ id = context. inc _ id if type _ name = ='incident': name _ part ='incident _ { }. json '. format ( inc _ id ) else : name _ part ='incident _ { } _ { } _ { }. json '. format ( inc _ id, type _ name, payload ['id'] ) return os. path. join ( self. ... | [
0.13829584419727325,
-0.8268763422966003,
0.5372742414474487,
-0.8277668356895447,
0.17257413268089294,
0.451294481754303,
0.33779287338256836,
-0.6755706071853638,
-0.9654254913330078,
0.10173157602548599,
1.146233320236206,
-0.4472026824951172,
-0.007534595672041178,
-1.1722748279571533,... |
def unrestricted _ orbitals ( basis, labels, coords, charge = 0, spin = 0, niter = 100, ethresh = 1e - 12, rthresh = 1e - 9 ) : molecule = pyscf. gto. mole ( atom = zip ( labels, coords ), unit = " bohr ", basis = basis, charge = charge, spin = spin ) molecule. build ( ) uhf = pyscf. scf. uhf ( molecule ) uhf. max _ cy... | [
-0.07293739914894104,
0.3363822400569916,
0.6112961769104004,
-0.3601549565792084,
-0.11352701485157013,
-0.005100343842059374,
-0.635195255279541,
0.1947518140077591,
0.013665002770721912,
-0.3555118441581726,
0.1880459189414978,
0.04627571627497673,
-0.1309366375207901,
-0.91810870170593... |
def is _ dict ( obj ) : return type ( obj ) = = type ( { } ) | [
-0.703180730342865,
0.30094918608665466,
0.46749147772789,
0.5987963676452637,
-0.9840126037597656,
0.3839874267578125,
0.3666022717952728,
-1.1596413850784302,
1.1821889877319336,
-0.264603853225708,
-0.5073081254959106,
0.324684739112854,
-0.07069449126720428,
0.3458259701728821,
-0.70... |
def processframerange ( self ) : self. startframe = int ( self. ui. input _ startframe. toplaintext ( ) ) self. endframe = int ( self. ui. input _ endframe. toplaintext ( ) ) self. state = str ( self. ui. statestring. text ( ) ) print ('you chose frame { } - { } '. format ( self. startframe, self. endframe ) ) print ( ... | [
-0.6150239706039429,
-0.7355274558067322,
0.6365746259689331,
0.05695289745926857,
0.04141386225819588,
-0.6774479150772095,
1.3395888805389404,
-0.5358677506446838,
0.22563430666923523,
-0.8240531086921692,
-0.07425602525472641,
0.6094086170196533,
-0.26319420337677,
1.1211247444152832,
... |
def unsubscribe ( self, topic ) : topic _ list = none if topic is none : raise valueerror ('invalid topic.') if isinstance ( topic, str ) : if len ( topic ) = = 0 : raise valueerror ('invalid topic.') topic _ list = [ topic. encode ('utf - 8') ] elif isinstance ( topic, list ) : topic _ list = [ ] for t in topic : if l... | [
-0.22290043532848358,
0.17302420735359192,
0.5263656377792358,
0.49854356050491333,
-0.42538368701934814,
-0.30913907289505005,
-0.29120689630508423,
0.11703701317310333,
-0.10129518061876297,
0.19947098195552826,
0.07056766003370285,
-0.0869494080543518,
-1.0082941055297852,
0.21736444532... |
def _ binarymatrixranklarge ( matrix : list [ int ] ) - > int : if not matrix : return 0 m = matrix [ : ] rows = len ( m ) cols = max ( r. bit _ length ( ) for r in m ) # determines the number of columns that are eliminated in one step. # this number is based on experiments. if rows < 32 : step = max ( 1, rows. bit _ l... | [
0.037483423948287964,
0.9158375263214111,
0.9753918051719666,
-0.07295582443475723,
-0.6103137731552124,
-0.7963265180587769,
0.5849511027336121,
0.37610581517219543,
-0.0831221491098404,
0.754079282283783,
-0.5097813606262207,
-0.06478485465049744,
-0.6061469316482544,
-0.0486465245485305... |
def getpage ( url, contextfactory = none, * args, * * kwargs ) : scheme, host, port, path = client. _ parse ( url ) factory = client. httpclientfactory ( url, * args, * * kwargs ) factory. noisy = false if scheme = ='https': from twisted. internet import ssl if contextfactory is none : contextfactory = ssl. clientconte... | [
-0.29706159234046936,
0.3994033932685852,
0.6941836476325989,
0.016291845589876175,
0.12977862358093262,
-0.3531738817691803,
-0.6458675265312195,
-0.11834387481212616,
0.08916214853525162,
-0.5719566941261292,
0.5582393407821655,
-0.0846453458070755,
-0.4502165913581848,
-0.26491010189056... |
def get _ final _ name ( self ) : return self. final _ name | [
-0.6295812726020813,
-1.1438524723052979,
0.5132860541343689,
0.18575243651866913,
-0.9635496139526367,
0.7019498348236084,
-0.19753670692443848,
0.30558082461357117,
-0.4965515732765198,
-0.24626149237155914,
-0.014886083081364632,
0.029793329536914825,
0.32562875747680664,
0.510161161422... |
def main ( pool, * args ) : # read in parameters from input file with open ( args [ 0 ] ) as f : input _ dict = read _ input ( f, * args [ 1 : ] ) interpret _ input ( input _ dict ) # identify number of steps to take in each direction lx = input _ dict ['alat'] * np. linalg. norm ( input _ dict ['axes _ 1'] [ 0 ] ) lz ... | [
0.38015225529670715,
0.18806146085262299,
1.040297031402588,
-0.29422590136528015,
0.11526529490947723,
0.5599177479743958,
0.4098384976387024,
0.03821168094873428,
-1.0096832513809204,
-0.16572582721710205,
0.06328965723514557,
0.5704948306083679,
-0.8582989573478699,
0.20317810773849487,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.