text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def handle _ request ( self, request, parts ) : if len ( parts ) = = 0 : if request. method = ='get': return self. get _ tasks ( ) elif request. method = ='post': return self. create _ new _ task ( request ) elif len ( parts ) = = 1 : if validators. validate _ task _ id ( parts [ 0 ] )! = parts [ 0 ] : return webob. re... | [
-0.44469019770622253,
0.16992375254631042,
0.8943969011306763,
0.9595080614089966,
0.6746820211410522,
0.21756356954574585,
-0.4700872600078583,
-1.071205735206604,
0.027061279863119125,
-0.21564336121082306,
0.13283896446228027,
-0.6919801235198975,
-0.516883373260498,
0.42539122700691223... |
def check _ value _ rank ( self, rank : int ) - > none : for b in self : b. check _ value _ rank ( rank ) | [
-0.5439603328704834,
-0.20766524970531464,
0.3792000412940979,
1.833803415298462,
0.8160232305526733,
-0.37011757493019104,
0.566369891166687,
-0.23601628839969635,
-0.5425351858139038,
0.6403158903121948,
-0.2045389860868454,
0.5512094497680664,
-0.6384979486465454,
1.7787537574768066,
... |
def p _ y ( self, label ) : # # # # # # # # # # # # # # # # # # # # # # # # # # # * * * your code here * * * # # extract label ( prior ) probabilities from label _ counts # # # # # # # # # # # # # # # # # # # # # # # # # # return self. label _ counts [ label ] / float ( sum ( self. label _ counts. values ( ) ) ) | [
-0.22599981725215912,
0.12258206307888031,
0.8924673795700073,
-0.42597416043281555,
-0.014539395458996296,
0.8312948346138,
0.27941492199897766,
-0.5440270304679871,
-0.26773571968078613,
0.11086613684892654,
0.38087695837020874,
-0.10711441189050674,
-1.0712592601776123,
0.11144369095563... |
def describe _ ssl _ listener ( self, blb _ id, listener _ port = none, marker = none, max _ keys = none, config = none ) : path = utils. append _ uri ( self. version,'blb ', blb _ id,'ssllistener') params = { } if listener _ port is not none : params [ b'listenerport'] = listener _ port if marker is not none : params ... | [
0.18608279526233673,
-0.19628678262233734,
0.8656134009361267,
-0.45507240295410156,
0.3092151880264282,
-0.2579328715801239,
-0.4591575860977173,
0.20634357631206512,
-0.3232276141643524,
0.31437286734580994,
-0.8344345092773438,
1.362026333808899,
-0.6735135316848755,
0.24269011616706848... |
def _ _ save ( self ) - > none : self. log. info ( " saving user info " ) with concurrent. futures. threadpoolexecutor ( ) as executor : futures = [ ] for user in ( self. response ['data'] ) : if not self. mongodb _ users. is _ in ( user ['id'] ) : self. _ _ tot _ user _ saved + = 1 self. log. debug ( user ) fut = exec... | [
-0.7768765687942505,
-0.07334555685520172,
0.45836588740348816,
-0.0967414528131485,
0.6193068623542786,
-0.47214075922966003,
0.7435259819030762,
-0.3046041429042816,
-0.21969495713710785,
0.030349645763635635,
-1.4210048913955688,
-0.9084789752960205,
-0.4661768674850464,
0.4841085374355... |
def add _ spline ( self, name, cx, spline _ type ='bezier ', scaler = 1. ) : if isinstance ( name, str ) : names = [ name ] else : names = name # decode the name if names [ 0 ] in self. _ param2 _ names : self. _ add _ param2 _ spline ( names, cx, spline _ type = spline _ type, scaler = scaler ) else : self. _ add _ ma... | [
-0.2540184557437897,
0.12705905735492706,
0.4746954143047333,
0.7506488561630249,
-0.19428592920303345,
0.7845771908760071,
-0.9358788728713989,
-0.10216958075761795,
0.6584506630897522,
0.019781053066253662,
-0.7942618727684021,
0.042124949395656586,
-0.4058926999568939,
1.022578835487365... |
def card _ by _ url ( self, url ) : logging. debug ( " getting url { } ". format ( url ) ) request = self. _ session. get ( url ) return card ( self, request. text ) | [
-0.8095700144767761,
-0.5762138962745667,
0.28343334794044495,
-0.6096507906913757,
0.01496955193579197,
-0.3931427299976349,
-1.1206833124160767,
0.45232370495796204,
0.5773977041244507,
0.17586153745651245,
-0.32393866777420044,
0.21106329560279846,
-0.3532845973968506,
-0.75156348943710... |
def _ compute _ adherence _ percentage _ by _ patients ( self, window _ start, window _ finish, time, timeout ) : feedback = feedback. objects. filter ( datetime _ sent _ _ gte = window _ start, datetime _ sent _ _ lte = window _ finish, notification _ _ _ type = notification. medication ). exclude ( datetime _ sent _ ... | [
0.46175554394721985,
-0.2888195216655731,
0.5596979260444641,
0.061359845101833344,
0.12458768486976624,
0.1813715249300003,
0.08991529792547226,
0.002358168363571167,
-0.3416834771633148,
1.9753578901290894,
0.10580998659133911,
0.09006186574697495,
0.07401659339666367,
1.561303734779358,... |
def get _ vf _ list _ from _ tosca _ file ( model : str ) - > list : newlist = [ ] node _ list = get _ parameter _ from _ yaml ( " topology _ template. node _ templates ", model ) for node in node _ list : value = get _ parameter _ from _ yaml ( " topology _ template. node _ templates. " + node + ". type ", model ) if ... | [
0.006493505090475082,
-0.3063238561153412,
0.38499119877815247,
0.26212501525878906,
0.4122743606567383,
-0.6619946360588074,
0.09567714482545853,
-0.057956762611866,
-0.4870898127555847,
1.307827115058899,
-0.6372905373573303,
-0.37281015515327454,
0.11797169595956802,
0.8949938416481018,... |
def calculatefnorm ( partition ) : ret = [ ] rows = list ( partition ) normx = 0. 0 for row in rows : xi = row [ 1 ] normx = normx + np. square ( norm ( xi, 2 ) )'''( ki, i, j ) = xi. shape for i in range ( 0, i ) : for j in range ( 0, j ) : for k in range ( 0, ki ) : normx = normx + np. square ( xi. item ( ( k, i, j )... | [
-0.1342395693063736,
-0.07732801139354706,
0.8219608068466187,
1.0376888513565063,
-0.6501721143722534,
-1.525799036026001,
-0.004120313562452793,
0.8830680847167969,
0.07113587856292725,
0.1290293186903,
-0.3359232246875763,
-1.1194201707839966,
-0.29523536562919617,
0.3034433126449585,
... |
def printpath ( solutionpath ) : for result in solutionpath : printstate _ 8p ( result ) print ( ) | [
-0.11600484699010849,
-0.4630899727344513,
0.09599678218364716,
1.1081324815750122,
0.7441774010658264,
0.47852271795272827,
1.3906278610229492,
-1.0279370546340942,
0.43906402587890625,
-0.22562824189662933,
-0.12928186357021332,
-0.5833743810653687,
-0.6144788861274719,
0.347893595695495... |
def mock _ grb _ dir ( ) : with temporarydirectory ( ) as td : write _ ncfiles ( td, suffix = '. grb') yield td | [
-0.17255909740924835,
0.14689123630523682,
0.6309851408004761,
0.6626410484313965,
0.9312703013420105,
0.8136430382728577,
1.450744867324829,
-0.7276819944381714,
-0.25808146595954895,
-0.17555581033229828,
-0.24542613327503204,
-0.4895459711551666,
-0.2509605586528778,
0.33680522441864014... |
def priority ( self ) - > optional [ pulumi. input [ int ] ] : return pulumi. get ( self, " priority " ) | [
0.7141451239585876,
0.935320258140564,
0.3918941020965576,
0.5841224193572998,
1.3373368978500366,
0.6262391805648804,
0.2096276879310608,
0.07725133001804352,
1.1567871570587158,
-0.8379863500595093,
-0.2695781886577606,
0.3552873730659485,
-0.3360671401023865,
-0.8151514530181885,
0.53... |
def _ _ call _ _ ( self, global _ step, info = none, debug = false ) : cockpitctx. erase ( ) if info is not none : cockpitctx. set ( info, global _ step ) ext = self. _ get _ extensions ( global _ step ) # collect if create graph is needed and set switch self. create _ graph = any ( q. create _ graph ( global _ step ) ... | [
-0.31621068716049194,
-0.2281474471092224,
0.6142514944076538,
0.4791795015335083,
-0.3777886927127838,
0.10434018075466156,
0.04107147455215454,
-0.621079683303833,
-0.38993385434150696,
-0.382470041513443,
-0.026756135746836662,
-0.0645880401134491,
-0.5224028825759888,
0.415738612413406... |
def legalaction ( arrstate, action, position, sqrt ) : if action = = " left " and position [ 1 ] = = 0 : return false if action = = " right " and position [ 1 ] = = sqrt - 1 : return false if action = = " up " and position [ 0 ] = = 0 : return false if action = = " down " and position [ 0 ] = = sqrt - 1 : return false ... | [
-0.32058247923851013,
-1.2679377794265747,
0.5973827838897705,
0.4089459776878357,
-0.38038766384124756,
0.3900947868824005,
-0.55000901222229,
-0.41840463876724243,
1.2460938692092896,
0.40981781482696533,
-0.21798163652420044,
-0.17060969769954681,
-0.6069061756134033,
0.0494203381240367... |
def transform ( func, geom ) : if geom. is _ empty : return geom if geom. type in ('point ','linestring ','linearring ','polygon') : # first we try to apply func to x, y, z sequences. when func is # optimized for sequences, this is the fastest, though zipping # the results up to go back into the geometry constructors a... | [
0.3244635760784149,
-0.12003911286592484,
0.6049197316169739,
0.059905536472797394,
-0.3388422727584839,
-0.5861294865608215,
0.25033172965049744,
-0.3798331618309021,
0.2537529170513153,
-0.5215445756912231,
-0.31303006410598755,
0.8483038544654846,
0.01025346852838993,
-0.177071198821067... |
def test _ api _ shared _ live _ media _ delete _ active ( self ) : shared _ live _ media = sharedlivemediafactory ( nb _ pages = 5 ) video = videofactory ( active _ shared _ live _ media = shared _ live _ media, active _ shared _ live _ media _ page = 3 ) video. shared _ live _ medias. set ( [ shared _ live _ media ] ... | [
0.31204652786254883,
-0.7164656519889832,
0.6397216320037842,
0.2914070785045624,
0.40894412994384766,
0.16399171948432922,
0.7160376906394958,
0.026907119899988174,
0.8876292705535889,
0.2118440866470337,
-1.088139295578003,
0.14745426177978516,
-0.5083287358283997,
0.014349031262099743,
... |
def clear ( self ) : self. _ items = [ ] | [
-0.7132955193519592,
-0.2656494975090027,
0.01680765673518181,
-0.42556440830230713,
0.5204653143882751,
0.5583781003952026,
-0.26900720596313477,
-0.4073020815849304,
-0.49647364020347595,
-0.27836471796035767,
-0.7871723771095276,
0.9816917777061462,
0.4526001214981079,
0.159539937973022... |
def _ _ init _ _ ( self, config ) : # save the configuration parameters in the class attributes self. config = config self. model _ name = config. model _ name self. out _ dir = config. output _ dir if not os. path. exists ( self. out _ dir ) : os. makedirs ( self. out _ dir ) self. learning _ rate _ decay _ factor = c... | [
0.2760508060455322,
-0.002284715184941888,
0.5614188313484192,
0.22162386775016785,
-0.22423015534877777,
0.04031742736697197,
0.9521239399909973,
0.445508748292923,
-0.10556408017873764,
0.3331056237220764,
-0.5451687574386597,
-0.533747673034668,
0.005171517841517925,
0.30265697836875916... |
def _ backprop ( self, yhat _ batch, y _ batch ) : batch _ size = y _ batch. shape [ 0 ] update _ list = list ( ) delta = self. loss _ func ( yhat _ batch, y _ batch, backprop = true ) * self. layers [ - 1 ]. activation ( self. layers [ - 1 ]. z, backprop = true ) weight _ update = ( 1 / batch _ size ) * self. optimize... | [
0.43902379274368286,
-1.0103384256362915,
1.0212920904159546,
-0.07154037058353424,
0.3117271363735199,
-0.33238548040390015,
0.8350318670272827,
0.2672079801559448,
-0.4908227324485779,
0.7940476536750793,
-0.08482444286346436,
-0.15107230842113495,
-0.4356974959373474,
0.1115892380475997... |
def test _ outbound _ delay _ seconds ( self ) : batch _ id, all _ keys = ( yield self. msg _ seq _ helper. create _ outbound _ message _ sequence ( msg _ count = 3, delay _ seconds = 2 ) ) timestamps = [ parse _ vumi _ date ( ts ) for _, ts, _ in all _ keys ] self. assertequal ( timestamps [ 0 ] - timestamps [ 1 ], ti... | [
0.2384856790304184,
0.07869329303503036,
0.5806198716163635,
0.5032219886779785,
0.17223845422267914,
0.6694987416267395,
-0.34808605909347534,
-0.5266697406768799,
-0.778971254825592,
-0.2547186315059662,
-0.6359835267066956,
0.024713614955544472,
0.26196542382240295,
0.07997225970029831,... |
def gen _ cycle _ tags ( d, d _ trans, l _ elem, num = 1 ) : # typical tags : start _ tag ='< node > \ n'close _ tag ='< / node > \ n'l _ res = list ( ) # result list of tags l _ yet = list ( ) # list of element which used yet parent = 0 # num = 1 # order the number of elements for i in range ( len ( l _ elem ) ) : # p... | [
-0.764376163482666,
0.9146166443824768,
0.9418447613716125,
0.4367929697036743,
-0.11662157624959946,
-0.4310007691383362,
0.9226119518280029,
0.16454753279685974,
-0.11024270206689835,
0.34837907552719116,
-0.6387345194816589,
-0.11999331414699554,
0.190180242061615,
0.8448898196220398,
... |
def plotrdr ( self, grain, group, ulist, vlist, allxlist, allylist, linregresults ) : # draw window and axes self. rdrplot = plot ( ax = none, makeinteractive = true, title ='rdr calculation ', figsize = ( 21, 7 ) ) self. rdrplot. ax. axis ('off') self. rdrplot. grainax = self. rdrplot. addaxes ( ( 0. 05, 0. 07, 0. 20,... | [
0.8911103010177612,
0.771763801574707,
0.9514992833137512,
-0.9729828238487244,
-0.5214242935180664,
0.6670796871185303,
0.3168773651123047,
0.4110815227031708,
-0.02448170818388462,
-0.039993591606616974,
0.3119201064109802,
0.583989143371582,
-0.90469890832901,
0.6121227741241455,
0.64... |
def addphysicalinterfacetodevicetype ( self, typeid, physicalinterfaceid ) : req = apiclient. onedevicetypephysicalinterfaceurl % ( self. host, " / draft ", typeid ) body = { " id " : physicalinterfaceid } resp = requests. post ( req, auth = self. credentials, headers = { " content - type " : " application / json " }, ... | [
-2.127027750015259,
-0.16792166233062744,
0.5455535650253296,
-0.06431205570697784,
-0.12860478460788727,
0.3381502628326416,
-0.4979435205459595,
-1.7965785264968872,
-0.1326693892478943,
-0.05676373839378357,
-0.1731894314289093,
0.2023666799068451,
-1.9486151933670044,
0.300818115472793... |
def get _ success _ url ( self ) : return reverse _ lazy ('offers : order - offers - list ', kwargs = {'order _ pk': self. offer. order. id } ) | [
-0.25117558240890503,
0.7504627108573914,
0.40036582946777344,
-0.08078216761350632,
0.3320147693157196,
0.39755597710609436,
0.0455903597176075,
0.8330720663070679,
-0.03139868006110191,
0.20431402325630188,
-0.05691659823060036,
0.6961288452148438,
0.7036324143409729,
0.6799674034118652,... |
def update ( self ) : if self. life is true : self. position _ x + = self. change _ x # if enemy is past the wall this kills them and resets their position if self. left _ right = = " left " and self. position _ x > = 625 : self. change _ x = 0 self. position _ x = 50 self. life = false game. health - = 1 game. enemies... | [
-0.5721481442451477,
-1.0231802463531494,
0.7874961495399475,
0.10273300111293793,
0.14093326032161713,
0.23100894689559937,
-0.7074283957481384,
-0.1447962373495102,
-0.063926562666893,
1.20853853225708,
-0.08898162096738815,
-1.1163866519927979,
0.23842480778694153,
0.30394288897514343,
... |
def confirm ( self, cr, uid, ids, context = none ) : for rec in self. browse ( cr, uid, ids, context ) : if not rec. line _ id : raise osv. except _ osv ( _ ('error'), _ ('you must enter fuel delegate lines!') ) rec. write ( {'state':'confirm'} ) return true | [
0.22758331894874573,
-0.20257487893104553,
0.6121549606323242,
0.6614299416542053,
0.90553879737854,
-0.1090351939201355,
-0.5618401169776917,
0.2148331254720688,
-0.48919788002967834,
-0.04773680865764618,
0.1606733202934265,
0.05782414600253105,
-0.07048754394054413,
0.6966522932052612,
... |
def _ get _ github _ login ( self, git _ log : gitlog ) - > optional [ str ] : author _ name = git _ log. author github _ login = self. _ github _ login _ cache. get ( author _ name ) if github _ login : return github _ login if git _ log. pr _ number : pr _ info = self. _ fetch _ github _ pr ( git _ log. pr _ number )... | [
0.022064749151468277,
-0.34368613362312317,
0.648936927318573,
0.3889501094818115,
-0.4234057068824768,
0.5813765525817871,
-0.618365466594696,
0.0036552364472299814,
0.4315263032913208,
-0.013980782590806484,
0.21780860424041748,
0.42919522523880005,
0.2884193956851959,
-0.203651338815689... |
def wer _ sim ( self, t1, t2 ) : return 0 | [
-0.6332448124885559,
0.501531720161438,
0.2466259002685547,
0.029447920620441437,
-0.33149102330207825,
0.4764328598976135,
-0.21554245054721832,
-0.5051702260971069,
-1.1877710819244385,
0.9771325588226318,
-0.3310714066028595,
0.28479912877082825,
-0.407297283411026,
0.41453275084495544,... |
def test _ launch _ pod _ via _ kubectl ( copy _ test _ apps, delete _ test _ pod, controller ) : host = controller _ precheck ( controller ) with host _ helper. ssh _ to _ host ( hostname = host ) as con _ ssh : app _ path = os. path. join ( copy _ test _ apps, pod _ yaml ) log. tc _ step ('kubectl apply { }, and chec... | [
1.1319150924682617,
-0.8806267380714417,
0.4819958209991455,
0.6059601902961731,
0.18758046627044678,
0.9369102716445923,
0.12921985983848572,
0.5287114977836609,
0.9710739254951477,
-0.14060375094413757,
0.20437480509281158,
0.1794043928384781,
0.2814325988292694,
0.1547131985425949,
0.... |
def stop ( self ) : self. log. info ( " stop : stopping server. " ) # stop : if self. isrunning ( ) : self. serverprocess. terminate ( ) os. waitpid ( self. serverprocess. pid, 0 ) # make sure its actually stopped : if sys. platform. startswith ('win') : subprocess. call ( args = " taskkill / f / t / im restservice. ex... | [
-0.3818803131580353,
-1.2177611589431763,
0.518044114112854,
0.09465870261192322,
0.6749222278594971,
0.28270819783210754,
0.18366289138793945,
-0.1493774801492691,
-0.4435153901576996,
-0.3085368573665619,
-0.18741720914840698,
0.6480020880699158,
-0.7507648468017578,
0.12520040571689606,... |
def collection _ medias ( self, collection _ id : int, amount : int = 21, last _ media _ pk : int = 0 ) - > list : collection _ id = int ( collection _ id ) last _ media _ pk = last _ media _ pk and int ( last _ media _ pk ) total _ items = [ ] next _ max _ id = " " while true : if len ( total _ items ) > = float ( amo... | [
-0.6499523520469666,
-0.4121306836605072,
0.8262909054756165,
-0.20421290397644043,
0.5062419772148132,
-0.576144278049469,
-0.33180707693099976,
-0.7256381511688232,
-0.08738742768764496,
0.8973408341407776,
-0.1108417734503746,
0.47447657585144043,
-0.48808053135871887,
0.735155820846557... |
def serialize ( self, root ) : return ', '. join ( self. getpreparednodelist ( root ) ) | [
-1.040887475013733,
-0.24569496512413025,
0.4158676266670227,
-0.0739128366112709,
-0.6122819185256958,
-0.19361229240894318,
-0.33067867159843445,
-0.3074798583984375,
0.7851085066795349,
0.1838182955980301,
-0.5879168510437012,
0.6362058520317078,
0.019103022292256355,
0.7551132440567017... |
def _ get _ secret _ with _ context ( filename, secret, plugin _ settings, lines _ of _ context = 5, force = false, ) : try : file _ content = _ open _ file _ with _ cache ( filename ) if not file _ content : raise secretnotfoundonspecifiedlineerror ( secret ['line _ number'] ) file _ lines = file _ content. splitlines... | [
0.18717484176158905,
-0.11917224526405334,
0.5568755865097046,
0.15526224672794342,
0.2119983583688736,
-1.3681886196136475,
-0.9400808215141296,
0.0734560415148735,
0.028062468394637108,
0.42365971207618713,
-0.7160302400588989,
0.7705105543136597,
0.6538819670677185,
-0.08792410790920258... |
def test _ call _ instance _ func ( self ) : # makes sure any exception raised inside the function has no other # exception chained to it exp _ params = 1, 2, 3 class dispatchedclass : def dispatched _ func ( self, * params ) : raise simplexmlrpcdispatchertestcase. dispatchexc ( params ) dispatcher = xmlrpc. server. si... | [
0.2511129379272461,
0.7970300912857056,
0.7346169352531433,
-0.41715413331985474,
0.5469174981117249,
0.4141162633895874,
-0.08488796651363373,
0.08124330639839172,
0.37850573658943176,
-0.8042395710945129,
-0.6484642624855042,
-0.08075764775276184,
-0.3646019995212555,
0.09909293055534363... |
def test _ list _ decimal _ min _ length _ nistxml _ sv _ iv _ list _ decimal _ min _ length _ 1 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - minlength - 1. xsd ", instance = " nistdata / list / deci... | [
-0.3570246696472168,
-0.31723928451538086,
0.5285488367080688,
0.6484555602073669,
-0.21226102113723755,
-0.10741381347179413,
-0.24326983094215393,
0.12921346724033356,
1.4817416667938232,
-0.13538487255573273,
-0.7975466847419739,
-0.2671820819377899,
-0.437264084815979,
0.47457459568977... |
def get _ notables ( region ) : previous _ url = " notables " searches. save _ previous _ region ( region ) data = recent. region _ notable ( region ) return render _ template ('sightings _ results. html ', data = data, region = region ) | [
-0.8371362090110779,
0.9792951941490173,
0.26885291934013367,
-0.5048282146453857,
0.44900378584861755,
-0.3040267825126648,
-0.536904513835907,
-0.0621662400662899,
-0.297804057598114,
0.04515945166349411,
0.1576811671257019,
-0.12271306663751602,
0.1835285723209381,
0.7485147714614868,
... |
def arn ( self ) - > str : return pulumi. get ( self, " arn " ) | [
0.21132904291152954,
-0.8432461023330688,
0.4427156448364258,
0.6060065627098083,
1.1812334060668945,
0.5935370922088623,
-0.049606189131736755,
1.2513411045074463,
0.4099908471107483,
-0.3358882963657379,
0.2526560127735138,
1.4908242225646973,
0.9517623782157898,
-0.9014049768447876,
0... |
def test _ fail _ addresses _ contents _ invalid ( self ) : self. assertfiltererrors ( {'addresses': [ b'', true, none, b'not valid trytes ', # this is actually valid ; i just added it to make sure the # filter isn't cheating! trytestring ( self. trytes2 ), 2130706433, b'9'* 82, ], }, {'addresses. 0': [ f. required. co... | [
-0.11871319264173508,
-0.14070025086402893,
0.3943237066268921,
-0.7342690229415894,
0.00676856329664588,
-0.2987097501754761,
-0.5201159715652466,
-0.36537808179855347,
0.08690048009157181,
-0.10667840391397476,
0.09209206700325012,
0.11036256700754166,
-0.16732051968574524,
0.21134638786... |
def echopreviousword ( self, obj, offset = none ) : try : text = obj. querytext ( ) except notimplementederror : return if not offset : if text. caretoffset = = - 1 : offset = text. charactercount else : offset = text. caretoffset - 1 if ( offset < 0 ) : return [ char, startoffset, endoffset ] = \ text. gettextatoffset... | [
0.10390356928110123,
0.14771036803722382,
1.1586358547210693,
0.15995174646377563,
-0.3565808832645416,
-0.2527947425842285,
-0.09001953899860382,
-0.4161391854286194,
0.4362287223339081,
-0.1077507734298706,
0.40846484899520874,
0.7413029670715332,
-0.35805410146713257,
0.1314974278211593... |
def set _ to _ draft ( self, cr, uid, ids, context = none ) : self. write ( cr, uid, ids, {'state':'draft'}, context = context ) return true | [
-1.5237008333206177,
0.2842733561992645,
0.307199090719223,
-0.9485708475112915,
1.0761486291885376,
0.2968689203262329,
0.16675062477588654,
0.3348125219345093,
0.47882363200187683,
0.2707316279411316,
-0.4923985004425049,
0.9610980153083801,
-0.20194542407989502,
-0.6930336952209473,
-... |
def get _ secret _ value ( client, secret _ resource _ name, secret _ value _ resource _ name, show _ value = false ) : secret _ value = none if show _ value : secret _ value = client. show ( secret _ resource _ name, secret _ value _ resource _ name ) secret _ data = client. get ( secret _ resource _ name, secret _ va... | [
0.3981128931045532,
0.1449856162071228,
0.47780415415763855,
0.23072730004787445,
-0.7051147222518921,
-0.48685184121131897,
-1.1107702255249023,
-0.1867545247077942,
-0.4287610650062561,
0.4453870952129364,
-0.46360450983047485,
1.4023793935775757,
0.3875313997268677,
-0.260198175907135,
... |
async def denied ( self, chan, person ) : await chan. send ( f " { person. mention }, or the person you @ mentioned does not have a profile. create one with < > createprofile " ) | [
1.023991584777832,
0.39318692684173584,
0.5303407907485962,
0.06627339124679565,
1.3206068277359009,
0.3799971044063568,
-0.15412576496601105,
-1.0474038124084473,
0.2812364995479584,
-0.7268993854522705,
0.03388930857181549,
0.8295641541481018,
-1.197269320487976,
0.766237199306488,
-0.... |
def open _ dataset ( self ) : self. credit _ dataset = pd. read _ csv ( " movie metadata \ creditdata. csv " ) self. movie _ dataset = pd. read _ csv ( " movie metadata \ moviedata. csv " ) self. credit _ dataset. columns = [ " id ", " tittle ", " cast ", " crew " ] self. movie _ dataset = self. movie _ dataset. merge ... | [
-1.0671480894088745,
0.08209451287984848,
0.5480228662490845,
-0.5195837020874023,
0.30355679988861084,
0.7396231293678284,
-0.8738024830818176,
0.787657618522644,
-0.5590245127677917,
0.6368306279182434,
0.2460431456565857,
1.448545217514038,
-0.5495018362998962,
-0.3435567319393158,
0.... |
def runcommand ( aw ) : getcore = subprocess. popen ( aw, stdout = subprocess. pipe, stderr = subprocess. pipe, shell = true ) out, err = getcore. communicate ( ) # type : ( str, str ) return out | [
-0.5398796796798706,
-0.5781972408294678,
1.038237452507019,
-0.8219955563545227,
-0.5314532518386841,
0.30505895614624023,
0.37322649359703064,
-0.8171803951263428,
0.7653310298919678,
-0.3506060540676117,
0.47357016801834106,
0.580699622631073,
-0.050841085612773895,
0.19815140962600708,... |
def test _ env _ vars _ mutation ( ) : sample _ exe = " python " cmd = " echo " env _ vars = { " k1 " : " v1 ", " k2 " : " v2 " } orig _ env = { " k1 " : " v1 ", " k2 " : " v2 " } rs = runsettings ( sample _ exe, run _ command = cmd, env _ vars = env _ vars ) # verify initial expectations assert len ( rs. env _ vars ) ... | [
-1.2478857040405273,
-0.8328791260719299,
0.7098827362060547,
0.07733208686113358,
-0.2856864929199219,
0.8624517917633057,
-0.42161309719085693,
-0.15021324157714844,
-0.722897469997406,
0.862859845161438,
-0.35229596495628357,
0.8963335752487183,
-0.2358301728963852,
0.2815653681755066,
... |
def testcreatediskcopy2 ( self, mock _ gce _ api, mock _ get _ disk, mock _ get _ boot _ disk, mock _ block _ operation, mock _ disk _ type ) : instances = mock _ gce _ api. return _ value. instances. return _ value. aggregatedlist instances. return _ value. execute. return _ value = mock _ instances _ aggregated mock ... | [
-0.16659484803676605,
0.5180855393409729,
0.7608243227005005,
0.4944709837436676,
0.24964851140975952,
0.62322998046875,
0.8028826713562012,
-0.644118070602417,
-0.8485023975372314,
-0.15437453985214233,
-0.11306588351726532,
0.29033076763153076,
0.09724950790405273,
0.7552825808525085,
... |
def analyzesinglerun ( run _ num ) : infile = open ( os. path. join ( home _ dir, " single _ run. fsf " ), " r " ) template = infile. read ( ) infile. close ( ) template = template. replace ( " run _ num ", str ( run _ num ) ) template = template. replace ( " cur _ dir ", home _ dir ) template = template. replace ( " t... | [
0.034516554325819016,
-0.42663976550102234,
0.7893037796020508,
0.5100512504577637,
0.14363126456737518,
-0.6844695806503296,
1.5561234951019287,
0.8602543473243713,
0.17500248551368713,
-1.0939884185791016,
-0.7114012837409973,
0.6285051703453064,
0.2963785231113434,
1.1488374471664429,
... |
def parse _ event ( self, tag ) - > dict [ str, any ] : datedata = " ". join ( tag. xpath ( '. / div [ @ class = " entry - content " ]'+'/ span [ contains ( @ class, " entry - details " ) ] / span / text ( )') ) date = self. parse _ date ( datedata ) artist = " ". join ( tag. xpath ( '. / div [ @ class = " entry - cont... | [
-0.27210214734077454,
0.09401249885559082,
0.6789862513542175,
-0.3201397657394409,
-1.006951928138733,
-0.432632178068161,
0.2101764678955078,
0.005991709418594837,
-0.49385347962379456,
-0.057356830686330795,
-1.2206041812896729,
-0.6184597611427307,
0.6709856390953064,
0.876871168613433... |
def upload ( self, dest _ folder, file _ path ) : try : uploaded _ file = dest _ folder. upload ( file _ path, file _ path. name, preflight _ check = true ) logging. info ( " item " + file _ path. name + " uploaded successfully. " ) return uploaded _ file except boxapiexception as ex : if ex. code = = " item _ name _ i... | [
-0.057793088257312775,
0.09798401594161987,
0.8207155466079712,
0.21615439653396606,
0.0021159204188734293,
-0.08859928697347641,
-0.650743305683136,
-0.7304951548576355,
-1.2592408657073975,
0.6911031603813171,
0.36254259943962097,
-0.4306138753890991,
-0.5231063961982727,
-0.276659637689... |
def convert _ to _ string ( letter, num ) : return chr ( letter ) + str ( num ) | [
-0.07540237158536911,
-0.7257338166236877,
0.3307144343852997,
-0.38970375061035156,
-0.3828948736190796,
-0.0024498242419213057,
-0.9071863889694214,
-0.6456241011619568,
0.5080024003982544,
0.6077144145965576,
-0.3946133255958557,
0.33027032017707825,
-0.20750856399536133,
-1.03432381153... |
def _ add _ registry _ activity ( self ) : metadata = self. nodemetadata. copy ( ) for node in metadata : if metadata [ node ] ['node _ type'] = ='pid': if'calls'in metadata [ node ] : calls = metadata [ node ] ['calls'] # get registry writes... if self. plotregistrywrites is true : self. _ add _ registry _ writes ( no... | [
-0.11663374304771423,
0.3894193172454834,
0.6150030493736267,
-0.3605659008026123,
1.543406367301941,
-0.5334978103637695,
0.8009881377220154,
-0.4941287338733673,
0.3858352601528168,
0.2929973304271698,
0.7524518966674805,
1.237115502357483,
-0.04071627929806709,
0.30970945954322815,
0.... |
def sigmoid3 ( temperature, a, b, c ) : return 1 / ( 1 + np. exp ( a * ( ( temperature - c ) * * 2 ) + b * ( temperature - c ) ) ) | [
0.7273423075675964,
-0.12806092202663422,
0.347632497549057,
-0.5913829207420349,
0.12407338619232178,
0.7764522433280945,
-0.16583600640296936,
0.45813003182411194,
0.3397386372089386,
1.13546884059906,
-0.3418409824371338,
-0.3962065875530243,
-1.0974286794662476,
-1.34575355052948,
-0... |
def compare _ meshes ( pred _ meshes, gt _ meshes, num _ samples = 10000, scale = " gt - 10 ", thresholds = none, reduce = true, eps = 1e - 8 ) : if thresholds is none : thresholds = [ 0. 1, 0. 2, 0. 3, 0. 4, 0. 5 ] pred _ meshes, gt _ meshes = _ scale _ meshes ( pred _ meshes, gt _ meshes, scale ) if isinstance ( num ... | [
0.6117948889732361,
-0.06331561505794525,
0.7256820201873779,
0.6548066735267639,
-0.6362992525100708,
0.47943320870399475,
0.48586803674697876,
-0.06726562231779099,
-0.475323349237442,
0.8355703949928284,
0.3221430480480194,
0.33830153942108154,
0.32117000222206116,
0.24436421692371368,
... |
def test _ example _ input _ one _ delete _ cancel _ entity ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper, add _ input _ one ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) self. assert _ util ( input _ page. table. delete _ row, true, left _ args... | [
0.8911324739456177,
0.6664761900901794,
0.5493715405464172,
0.9072093367576599,
0.5203759670257568,
0.6737731695175171,
-0.2212618887424469,
0.9746251702308655,
0.843525767326355,
0.5474932789802551,
0.1379365473985672,
-0.7312597632408142,
0.40061521530151367,
0.39929577708244324,
0.109... |
def get _ bins _ range ( qgrid, tol = 0. 01 ) : bin _ range = [ ] while true : qmin = qgrid [ 0 ] dq = qgrid [ 1 ] - qgrid [ 0 ] pq = qmin + dq * np. arange ( len ( qgrid ) ) n = len ( qgrid [ np. fabs ( qgrid - pq ) < dq * tol ] ) bin _ range. append ( [ [ qmin - 0. 5 * dq, qmin + ( n - 0. 5 ) * dq ], n ] ) if n = = l... | [
-0.3411577343940735,
-0.010193143039941788,
0.3077138066291809,
0.054799892008304596,
-0.24032418429851532,
0.6726725101470947,
0.17230124771595,
-0.8076429963111877,
-0.25531771779060364,
0.04811321943998337,
-0.9490162134170532,
0.458540678024292,
-0.20027729868888855,
0.0662595480680465... |
def test _ atomic _ qname _ max _ length _ 3 _ nistxml _ sv _ iv _ atomic _ qname _ max _ length _ 4 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - maxlength - 4. xsd ", instance = " nistdata / atomic ... | [
0.2459825873374939,
0.04038836434483528,
0.2857295870780945,
0.0214962437748909,
-0.5353282690048218,
0.37330666184425354,
-0.7448943257331848,
-0.4306495189666748,
0.6451026797294617,
0.2489701509475708,
-0.39743340015411377,
-0.6340749859809875,
-0.1236535832285881,
-0.5276209115982056,
... |
def testgetvalue ( self, mock _ get _ operation ) : mock _ get _ operation. return _ value = { # https : / / cloud. google. com / compute / docs / reference / rest / v1 / instances / get'name': fake _ instance. name } self. assertequal ('fake - instance ', fake _ instance. getvalue ('name') ) self. assertisnone ( fake ... | [
-0.38415616750717163,
0.9382594227790833,
0.42430463433265686,
-0.32802340388298035,
0.5752991437911987,
-0.24166162312030792,
-0.20550407469272614,
-0.019599713385105133,
-0.21996162831783295,
0.2540684640407562,
-0.3461625874042511,
0.32732221484184265,
-0.26098620891571045,
-0.415504395... |
def extra _ init _ action ( self ) : pass | [
0.10811104625463486,
-1.0339242219924927,
0.6329784989356995,
0.5832177996635437,
0.41355836391448975,
0.6947893500328064,
0.8384820818901062,
0.05177642032504082,
0.695694625377655,
-0.24809318780899048,
-1.418169617652893,
1.066187858581543,
0.09916473180055618,
1.0365557670593262,
-1.... |
def latlon2mgrs ( lat, lon ) : utm = latlon2utm ( lat, lon ) mgrs = utm2mgrs ( utm ) return mgrs | [
-0.29814139008522034,
-0.8029834628105164,
0.28917479515075684,
-1.1941372156143188,
0.5782737731933594,
-0.500291645526886,
-2.9413340091705322,
0.454218327999115,
-0.43773216009140015,
0.13343386352062225,
-0.38006526231765747,
-0.3444431722164154,
-0.16486141085624695,
-0.03081132471561... |
def invert ( self, id = none ) : return type ( self ) ( id = id or f " { self. id } - inverted ", fg = self. hex _ bg, bg = self. hex, style = self. _ style ) | [
-1.0831472873687744,
0.19174066185951233,
0.4430083930492401,
-0.37053588032722473,
0.3524315655231476,
0.09400840103626251,
-0.47717803716659546,
-0.046942587941884995,
-0.15867576003074646,
-0.6717605590820312,
-0.46155720949172974,
0.267227441072464,
-0.9085128903388977,
0.4224324524402... |
def _ draw ( self ) : self. _ _ surface. fill ( background ) if self. _ _ image _ surface : self. _ _ surface. blit ( self. _ _ image _ surface, ( 0, 0 ) ) pygame. display. flip ( ) | [
-0.5047248601913452,
0.13732989132404327,
0.4352273643016815,
-0.1684945523738861,
0.9069733023643494,
1.1506866216659546,
0.5603445768356323,
-0.1499273031949997,
-0.2634683847427368,
-0.24843864142894745,
0.7553724050521851,
0.38598817586898804,
-0.0683603435754776,
1.3830994367599487,
... |
def _ init _ symbol _ creator _ registry ( symbol _ creator _ registry ) : _ registry = symbol _ creator _ registry return _ registry | [
-0.40753141045570374,
0.5723940134048462,
0.06806435436010361,
-0.34073424339294434,
-0.14932923018932343,
0.12754784524440765,
0.8662019968032837,
-0.6120306253433228,
0.2841663658618927,
-1.1053844690322876,
-0.63226318359375,
0.4465792775154114,
0.2492227703332901,
0.36988896131515503,
... |
def mark _ step _ as _ complete ( request ) : checkout _ utils. progresschecker ( ). step _ complete ( request ) | [
-0.641546368598938,
-0.08429192006587982,
0.30372390151023865,
1.2913755178451538,
0.6307681798934937,
-0.09323835372924805,
0.35771340131759644,
-0.3094668686389923,
-0.9253103733062744,
0.3620332181453705,
-0.32686200737953186,
-0.3091685473918915,
0.36431750655174255,
0.9958705902099609... |
def set _ current _ drawing ( self ) : return self. drawing _ list [ - 1 ] | [
-0.87901771068573,
0.019861066713929176,
0.7676646113395691,
-0.3964632451534271,
0.4265497326850891,
0.5465193390846252,
0.5152455568313599,
-0.33623701333999634,
0.27244001626968384,
-0.4099300801753998,
0.2757501006126404,
0.4139840602874756,
-0.892390251159668,
-0.011852895841002464,
... |
def combined _ flat _ anneal ( pct : float, start _ lr : float, end _ lr : float = 0, curve _ type : str ='linear') : if curve _ type = ='linear': schedanneal = schedlin if curve _ type = ='cosine': schedanneal = schedcos if curve _ type = ='exponential': schedanneal = schedexp schedule = combine _ scheds ( [ pct, 1 - ... | [
0.6015613675117493,
-0.49537113308906555,
0.5645470023155212,
0.1532871127128601,
-0.06028224527835846,
1.233632206916809,
-0.6937569975852966,
-0.10266565531492233,
0.15749786794185638,
0.27837011218070984,
1.1986784934997559,
0.7132513523101807,
0.6728420257568359,
-0.4386676549911499,
... |
def test _ atomic _ id _ pattern _ 4 _ nistxml _ sv _ iv _ atomic _ id _ pattern _ 5 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - pattern - 5. xsd ", instance = " nistdata / atomic / id / schema + instance... | [
0.1854846328496933,
-0.4763052761554718,
0.3366311490535736,
0.32620012760162354,
-0.27551743388175964,
-0.2013852298259735,
0.4952574074268341,
-0.8393962383270264,
0.10813310742378235,
0.7716924548149109,
-0.27181801199913025,
0.05897440388798714,
-0.6813962459564209,
0.06637410819530487... |
def productid _ 0 ( self, i ) : return self. productid [ i ] & 255 | [
-0.8399205803871155,
-0.5300672650337219,
0.4729115664958954,
0.24149100482463837,
-0.3278724253177643,
1.6212449073791504,
0.8202603459358215,
-1.2613965272903442,
1.3855602741241455,
0.8837937712669373,
-0.3159807026386261,
0.5035192370414734,
-0.6073135733604431,
-0.5075230002403259,
... |
def node _ class _ new ( node : list, name, extend, method ) - > none : node. append ( [ " node _ class ", name, extend, method ] ) | [
-0.6217843294143677,
1.2178394794464111,
0.6166628003120422,
0.37040024995803833,
0.3741052448749542,
0.059791743755340576,
-1.1342393159866333,
0.5808824300765991,
-0.23761072754859924,
-0.3096422255039215,
-0.9171106219291687,
0.6428523063659668,
1.2601958513259888,
0.9768016934394836,
... |
def get _ labels ( ) : with open ('retrained _ labels. txt ','r') as fin : labels = [ line. rstrip ('\ n') for line in fin ] # print ( labels ) return labels | [
-0.35494089126586914,
-1.5870916843414307,
0.2876690924167633,
-0.05362483859062195,
0.7338985204696655,
1.1832199096679688,
-0.9401475191116333,
1.023415446281433,
-1.008953332901001,
0.5446755290031433,
-0.7780029773712158,
0.6774914860725403,
-0.21927696466445923,
-0.17051607370376587,
... |
def evaluate ( reference _ onsets, estimated _ onsets, * * kwargs ) : # compute all metrics scores = collections. ordereddict ( ) ( scores ['f - measure'], scores ['precision'], scores ['recall'] ) = util. filter _ kwargs ( f _ measure, reference _ onsets, estimated _ onsets, * * kwargs ) return scores | [
0.2308657318353653,
-0.10469729453325272,
0.5347914695739746,
-0.01567532867193222,
-0.11889482289552689,
-0.18600355088710785,
-0.6284735202789307,
-0.5539959073066711,
-0.46253281831741333,
0.30717039108276367,
0.2156262993812561,
0.1390727013349533,
0.36699196696281433,
0.73810422420501... |
def display _ off ( self ) : self. _ write _ command ( [ lcdbackpack. display _ off ] ) | [
0.2764393389225006,
0.3177693486213684,
0.3837980628013611,
0.27684256434440613,
-0.1871134638786316,
1.6004120111465454,
1.2631447315216064,
0.11490532010793686,
0.04667520895600319,
-0.7830288410186768,
0.3515298068523407,
1.1825031042099,
-0.9651696681976318,
0.3873043358325958,
0.817... |
def get _ stats ( self ) : return self. compute. stats | [
-0.0733494758605957,
0.7019796371459961,
0.171487495303154,
0.22052697837352753,
0.7903410792350769,
-0.06506287306547165,
-0.3598634600639343,
-0.9565436244010925,
-0.23354974389076233,
-1.0323861837387085,
0.08021130412817001,
0.34657272696495056,
0.03951052948832512,
0.1924038976430893,... |
def describevoucherusagedetails ( self, request ) : try : params = request. _ serialize ( ) headers = request. headers body = self. call ( " describevoucherusagedetails ", params, headers = headers ) response = json. loads ( body ) model = models. describevoucherusagedetailsresponse ( ) model. _ deserialize ( response ... | [
-1.007702350616455,
0.8879001140594482,
0.6262836456298828,
-0.30984416604042053,
0.5508555173873901,
-0.9598802328109741,
-0.03522063419222832,
-0.5676617622375488,
-0.32130804657936096,
0.3992674946784973,
-0.11410126090049744,
1.1536855697631836,
-0.2807976305484772,
0.836717426776886,
... |
def log _ scope _ pop ( self, scope : str = none ) - > none : popped = self. _ log _ scopes. pop ( ) if scope is not none : assert popped = = scope, f " { popped } does not match { scope }! " | [
0.02231995388865471,
0.13369260728359222,
0.5841871500015259,
-0.5983150005340576,
-0.03558168560266495,
-0.14195914566516876,
-0.47708117961883545,
-0.12332887202501297,
0.5479932427406311,
1.1310808658599854,
0.11044573038816452,
1.2580335140228271,
-0.734512209892273,
-0.411839157342910... |
def _ add _ file _ moves ( self, node, files ) : for file in files : if file : file _ original = file [ 0 ] file _ new = file [ 1 ] nextid = len ( self. nodemetadata ) fmnodename = " file move { 0 } ". format ( nextid ) self. nodemetadata [ fmnodename ] = dict ( ) self. nodemetadata [ fmnodename ] ['pid'] = node self. ... | [
-0.693881630897522,
-0.1594456136226654,
0.7301800847053528,
-0.6576529741287231,
0.8871221542358398,
0.09091190248727798,
-0.4335266351699829,
0.495313435792923,
-0.6820691227912903,
0.5233026146888733,
0.20489884912967682,
0.166316956281662,
0.21565169095993042,
0.10400009900331497,
-0... |
def swap _ media _ order ( self, move _ from, move _ to ) : assert ( len ( self. m ['media'] ) + 1 > move _ from > 0 ), f " order { move _ from } out of bounds. " assert ( len ( self. m ['media'] ) + 1 > move _ to > 0 ), f " order { move _ to } out of bounds. " self. m ['media'] [ move _ to - 1 ], self. m ['media'] [ m... | [
-1.5991220474243164,
-0.7571710348129272,
0.5735474228858948,
-0.33281055092811584,
0.49092110991477966,
-0.35472002625465393,
-0.726768970489502,
0.09082109481096268,
-0.949518084526062,
0.6044294834136963,
-0.7140592336654663,
1.0585808753967285,
-0.011174803599715233,
-0.104748621582984... |
def ycbcr2bgr ( img : np. ndarray ) - > np. ndarray : img _ type = img. dtype img = _ convert _ input _ type _ range ( img ) * 255 out _ img = np. matmul ( img, [ [ 0. 00456621, 0. 00456621, 0. 00456621 ], [ 0. 00791071, - 0. 00153632, 0 ], [ 0, - 0. 00318811, 0. 00625893 ] ] ) * 255. 0 + [ - 276. 836, 135. 576, - 222.... | [
-0.3067483901977539,
-0.11978602409362793,
1.1809195280075073,
-0.14355355501174927,
0.39397963881492615,
-0.15856948494911194,
0.7459255456924438,
-0.5892147421836853,
0.010791060514748096,
0.5079514980316162,
-0.6324332356452942,
0.7418716549873352,
-0.6620900630950928,
1.344278693199157... |
def han _ attention ( inputs, query ) : vector _ attn = tf. reduce _ sum ( tf. multiply ( inputs, query ), axis = 2, keepdims = true ) attention _ weights = tf. nn. softmax ( vector _ attn, axis = 1 ) variable _ summaries ( attention _ weights ) weighted _ inputs = tf. multiply ( inputs, attention _ weights ) outputs =... | [
0.4074762165546417,
-0.21345901489257812,
0.5264108777046204,
0.3807674050331116,
-0.22566494345664978,
0.1047748252749443,
0.8986184000968933,
-0.16154122352600098,
-0.0893125981092453,
0.23566195368766785,
0.48585575819015503,
0.6588445901870728,
0.5815867185592651,
-0.001237085903994739... |
def seek ( self, time, device = none ) : data = { " position _ ms " : time } if device is not none : data [ " device " ] = device [ " id " ] q = urllib. parse. urlencode ( data ) url = " me / player / seek " self. put _ api _ v1 ( url, q ) | [
-1.063942790031433,
0.35221391916275024,
0.46152278780937195,
0.6347478032112122,
0.14996901154518127,
0.22433212399482727,
-0.24285469949245453,
-0.7808180451393127,
0.2987745404243469,
-0.4197083115577698,
-0.704685628414154,
0.7522626519203186,
-1.1210126876831055,
-0.28416261076927185,... |
def find _ 0 _ crossings ( sig ) : return np. where ( np. diff ( np. sign ( sig ) ) ) [ 0 ] | [
-0.18878939747810364,
0.2350887805223465,
0.518464207649231,
0.5953049063682556,
0.40900954604148865,
0.4457938075065613,
1.1249104738235474,
-0.3879680335521698,
0.35967642068862915,
0.016185849905014038,
0.020328544080257416,
-0.3022807538509369,
-0.13489897549152374,
1.0429471731185913,... |
def get _ ids ( indir, models ) : labels _ filename = { } infiles = os. path. join ( indir,'simfiles. txt') print ('reading simulation files from { } '. format ( infiles ) ) try : f = open ( infiles,'r') except filenotfounderror : print ('{ } does not exist. please run src / data / create _ list _ simfiles. py '. forma... | [
-0.44407549500465393,
-0.3905490040779114,
0.7227271199226379,
-0.0576486699283123,
0.19115962088108063,
0.37610024213790894,
0.23933514952659607,
0.13018198311328888,
-0.7469598650932312,
0.7118879556655884,
-0.21339017152786255,
-0.5837359428405762,
-0.5269885659217834,
-0.20107522606849... |
def main ( args ) : logging. basicconfig ( level = logging. debug ) parser = argparse. argumentparser ( description = " converts pictures to ascii " ) parser. add _ argument ( " picture ", action = " store ", type = str ) parser. add _ argument ( " - - width ", type = int, action = " store ", default = 80 ) parser. add... | [
-0.35189804434776306,
-0.40384989976882935,
0.9456414580345154,
-0.07620739936828613,
-0.2176736444234848,
0.4594345986843109,
0.08738323301076889,
-0.03908760845661163,
-0.3307742178440094,
0.4975869655609131,
0.0397174134850502,
-0.3052953779697418,
-0.16790778934955597,
0.03685374185442... |
def vis _ square ( data ) : # normalize data for display data = ( data - data. min ( ) ) / ( data. max ( ) - data. min ( ) ) # force the number of filters to be square n = int ( np. ceil ( np. sqrt ( data. shape [ 0 ] ) ) ) padding = ( ( ( 0, n * * 2 - data. shape [ 0 ] ), ( 0, 1 ), ( 0, 1 ) ) # add some space between ... | [
-0.08287890255451202,
0.5127478241920471,
1.1339656114578247,
-1.0005981922149658,
-0.8558498024940491,
-0.42827191948890686,
0.5029886960983276,
-0.45414048433303833,
1.037448525428772,
0.35532495379447937,
0.14825165271759033,
1.3884387016296387,
0.3828463852405548,
0.04975571483373642,
... |
def delete ( self, user _ id, force ) : userobj = self. get _ by _ ref ( user _ id ) if userobj is not none : if userobj. delete ( force ) = = 0 : return 0 else : return 1 else : print _ error ( " user with id % s not found " % user _ id ) return 1 | [
-0.30905959010124207,
0.3624921143054962,
0.6326063871383667,
1.0394666194915771,
0.4160248935222626,
-0.005774280056357384,
0.9301791787147522,
0.1043882817029953,
0.41684895753860474,
0.028460001572966576,
0.24368049204349518,
0.7473029494285583,
-0.2883235514163971,
1.293054461479187,
... |
def validate ( self, request, pk ) : version = self. get _ object ( ) comment = request. data. get ( " comment " ) try : with transaction. atomic ( ) : sender _ memberships = [ membership for membership in unitmembership. objects. filter ( unit _ _ in = version. report. referral. units. all ( ), user = request. user, )... | [
0.10420165956020355,
-0.29149913787841797,
0.7509511113166809,
0.01922053098678589,
0.3020884096622467,
0.5588102340698242,
0.72786945104599,
-0.16101230680942535,
0.22579610347747803,
0.9247389435768127,
-0.2616809904575348,
0.063654825091362,
-0.7540602684020996,
0.19879032671451569,
0... |
def build ( cls, operand : itype ) - > optional [ unaryoperation ] : return cls ( operand ) | [
-0.8360233306884766,
-0.1993468999862671,
0.2663309872150421,
0.6562200784683228,
-0.6290498971939087,
-0.3229876160621643,
0.18632233142852783,
-0.19633319973945618,
1.1916519403457642,
-0.7211474776268005,
-0.3534259796142578,
-0.1724788248538971,
-0.3694479763507843,
-1.8460911512374878... |
def is _ off _ peak _ charging _ weekday _ only ( self ) - > bool : return day _ selection _ map. get ( self. _ vehicle _ data. get ( " charge _ state ", { } ). get ( " off _ peak _ charging _ times " ) ) | [
-1.2576797008514404,
0.04988468438386917,
0.35786888003349304,
0.3954450190067291,
0.26337364315986633,
-0.1057099848985672,
-0.8786458373069763,
0.0729067474603653,
0.337015300989151,
0.5522146821022034,
0.016388937830924988,
-0.08783480525016785,
-0.16302180290222168,
0.5886815786361694,... |
def get _ account ( account : int ) : try : return account. objects ( ). get ( id = account ). to _ mongo ( ). to _ dict ( ) except : raise doesnotexist ( " account does not exists " ) | [
-0.38848164677619934,
0.9174633026123047,
0.517334520816803,
0.7755085825920105,
0.6414971351623535,
0.13204200565814972,
0.17422981560230255,
-0.49926361441612244,
0.4743057191371918,
0.9724652171134949,
-0.3345501720905304,
0.2477618306875229,
0.46479514241218567,
0.29956716299057007,
... |
def setup _ http _ cache ( ) - > bool : if not settings. http _ cache _ local : return false try : import requests _ cache except importerror : logger. error ( " request caching requires requests - cache library " ) return false requests _ cache. install _ cache ( ". opennem _ requests _ cache ", expire _ after = 300 )... | [
-0.2154693603515625,
0.48499777913093567,
0.6806361675262451,
0.40195706486701965,
-0.14790041744709015,
0.6662687659263611,
-0.9132261872291565,
-0.683060348033905,
0.0058168391697108746,
0.3705361783504486,
0.16134732961654663,
-0.6483769416809082,
-0.40230926871299744,
0.194545313715934... |
def decode ( protocolunit ) : url = protocolunit ['url'] cookies = protocolunit ['cookie'] data = [ ] if ismarket ( url ) : data. append ( decodeasmarket ( url ) ) elif isbaidu ( url ) : data. append ( decodeasbaidu ( url ) ) else : data. append ( encodeasb64 ( url ) ) # raise urlencodeerror ( " data does not match a k... | [
-1.165789246559143,
-0.1999722570180893,
0.3454741835594177,
0.2624114155769348,
-0.04651163890957832,
0.05706031247973442,
-0.23092669248580933,
0.07707852125167847,
0.41802695393562317,
-0.4755052626132965,
-0.011999182403087616,
0.641613781452179,
-1.2342199087142944,
0.0316846258938312... |
def get _ map _ layer ( self, layer ) : if layer in ( 0, 1, 10 ) : log ( log. info, " load game map layer, layer : { } ". format ( layer ) ) message = self. map. layer _ to _ json _ str ( layer ) self. clean _ events ( ) return result. okey, message else : return result. resource _ not _ found, none | [
-1.4593621492385864,
-0.344040185213089,
0.6270880699157715,
-0.5054957270622253,
-0.4897685945034027,
-0.5235952734947205,
-0.15327201783657074,
-1.265223741531372,
0.3416021466255188,
0.7174130082130432,
-0.28667548298835754,
-0.06271736323833466,
-0.5987972617149353,
0.29688507318496704... |
def noverbose ( withresult = true ) : global _ _ verbose, _ _ withresults _ _ verbose = false _ _ withresults = withresult | [
-0.009452927857637405,
0.29534173011779785,
0.39656421542167664,
0.3958829939365387,
-0.23537971079349518,
-0.7763707041740417,
0.04039202257990837,
-0.5329524874687195,
-0.4037342965602875,
-0.06908424198627472,
-0.4683378338813782,
-0.26149460673332214,
-1.3890743255615234,
1.13045561313... |
def create _ locations _ list ( general _ list ) : locations _ list = [ ] for i in general _ list : line = [ ] try : for j in i : if j : line. append ( j ) if len ( line ) > = 3 : line = line [ : 2 ] name _ year = line [ 0 ]. split ( " ( " ) line [ 0 ] = name _ year [ 0 ] line. insert ( 1, int ( name _ year [ 1 ] [ : 4... | [
-0.7975316643714905,
-0.5771060585975647,
0.7215844988822937,
0.41627293825149536,
-0.34540486335754395,
0.558261513710022,
-0.26505711674690247,
0.23228397965431213,
0.22769948840141296,
0.5361419320106506,
0.3235331177711487,
0.09609325975179672,
0.1711140125989914,
0.27150672674179077,
... |
def remove _ extra _ space ( text ) : clean _ text =''. join ( text. strip ( ). split ( ) ) return clean _ text | [
0.35771381855010986,
0.12094435840845108,
0.08072447031736374,
-0.3910171687602997,
-1.2977615594863892,
0.4640766978263855,
-0.5278033018112183,
1.1320149898529053,
0.7554430961608887,
0.4539267420768738,
-0.9162091612815857,
-0.11575097590684891,
-0.5776112079620361,
0.785975456237793,
... |
def test _ model _ time _ het ( self ) : _ data = { " human " : " atgcggctcgcggaggccgcgctcgcggag ", " mouse " : " atgcccggcgccaaggcagcgctggcggag ", " opossum " : " atgccagtgaaagtggcggcggtggctgag ", } aln = make _ aligned _ seqs ( data = _ data, moltype = " dna " ) mod = evo _ app. model ( " gn ", optimise _ motif _ pro... | [
0.672272264957428,
0.13084574043750763,
0.656549870967865,
-0.31882163882255554,
0.4728465676307678,
0.8213874101638794,
-0.6704902648925781,
-0.3936726450920105,
-0.5266740322113037,
0.6950270533561707,
-0.7417613863945007,
-0.4506540298461914,
0.10296308249235153,
0.22798657417297363,
... |
def test _ list _ decimal _ pattern _ 2 _ nistxml _ sv _ iv _ list _ decimal _ pattern _ 3 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - pattern - 3. xsd ", instance = " nistdata / list / decimal / sc... | [
-0.24886243045330048,
0.21095748245716095,
0.7199320793151855,
0.5546656847000122,
0.22247712314128876,
0.39012932777404785,
-0.6671632528305054,
0.6472463011741638,
1.4473134279251099,
0.36928093433380127,
-0.8517360687255859,
-0.4266383945941925,
0.06249365955591202,
-0.08088015764951706... |
def setdofvalues ( self, dof _ values, limits _ action = openravepy. kinbody. checklimitsaction. checklimits ) : self. getrobot ( ). setdofvalues ( dof _ values, self. getindices ( ), limits _ action ) | [
-0.4312343895435333,
0.038292866200208664,
0.36046600341796875,
0.7513717412948608,
0.8597288131713867,
0.4276221692562103,
0.24573545157909393,
-0.5014410614967346,
-0.03736186772584915,
-0.37069520354270935,
-0.5409131050109863,
0.5100386738777161,
0.221181720495224,
0.429379403591156,
... |
def vote _ on _ object ( request, model, direction, object _ id = none, slug = none, slug _ field = none ) : vote _ directions = ( ('up ', 1 ), ('down ', - 1 ), ('clear ', 0 ) ) if not request. user. is _ authenticated ( ) : return httpresponseredirect ('/ account / sign - in /') try : vote = dict ( vote _ directions )... | [
-0.9015650153160095,
-0.32932913303375244,
0.7596786022186279,
0.24879366159439087,
0.25115126371383667,
0.6145696043968201,
0.2774541974067688,
0.16270984709262848,
0.14519384503364563,
0.5869478583335876,
-0.2813122272491455,
0.6266037821769714,
0.34143614768981934,
0.050481438636779785,... |
def prepare _ batch _ samples _ for _ metadata _ export ( path, tsca _ id, google _ bucket _ id ) : # export raw data data = pd. read _ table ( path ) # rename columns to match firecloud requirements data = data. rename ( columns = {'sample _ id':'entity : sample _ id ','individual _ id':'participant _ id'} ) # locatio... | [
0.11117212474346161,
-0.12201051414012909,
0.8527354001998901,
-0.023000674322247505,
0.11336788535118103,
-0.20288044214248657,
-0.17678117752075195,
-0.15846413373947144,
-0.15124976634979248,
1.0746092796325684,
-0.28814318776130676,
0.715512216091156,
0.8664354085922241,
-0.02742906101... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.