text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def _ spawn1 ( command, fd _ in, fd _ out, fd _ err ) : pid = fork ( ) if pid! = 0 : return pid # child process # standard input if fd _ in! = 0 : dup2 ( fd _ in, 0 ) close ( fd _ in ) # standard output if fd _ out! = 1 : dup2 ( fd _ out, 1 ) close ( fd _ out ) # standard error if fd _ err! = 2 : dup2 ( fd _ err, 2 ) c... | [
0.39810487627983093,
-0.8229848146438599,
0.8029155731201172,
0.9151425361633301,
-0.8674730658531189,
0.4116972088813782,
0.3571387827396393,
0.30445489287376404,
-0.22831031680107117,
-0.26920270919799805,
0.5019657611846924,
0.48253944516181946,
-0.022118059918284416,
0.1251284629106521... |
def show _ empty _ board ( self ) : self. canvas. delete ( tk. all ) self. canvas _ wid = self. canvas. winfo _ width ( ) self. canvas _ hgt = self. canvas. winfo _ height ( ) self. col _ wid = self. canvas _ wid / self. num _ cols self. row _ hgt = self. canvas _ hgt / self. num _ rows for row in range ( self. num _ r... | [
-0.07390162348747253,
0.5692774057388306,
0.7761739492416382,
-0.9961389303207397,
-0.14714649319648743,
0.19266678392887115,
1.071462869644165,
0.46303293108940125,
0.3543233275413513,
-0.30993127822875977,
0.4645759165287018,
0.017092524096369743,
0.12395665794610977,
1.3133544921875,
... |
def testcreateorders ( self ) : orders = [ {'advertiserid': self. _ _ class _ _. advertiser _ id,'currencycode':'usd ','name':'order # % s'% utils. getuniquename ( ),'traffickerid': self. _ _ class _ _. trafficker _ id }, {'advertiserid': self. _ _ class _ _. advertiser _ id,'currencycode':'usd ','name':'order # % s'% ... | [
-0.7282010316848755,
0.8788914680480957,
0.4087257981300354,
-0.33300191164016724,
0.8394058346748352,
-0.03659694269299507,
-0.5424167513847351,
-0.509310781955719,
-0.153559610247612,
0.4935556650161743,
-0.7999750971794128,
-0.8673475980758667,
-0.6361587643623352,
0.08945898711681366,
... |
def _ create _ operation ( oper, params ) : # assert isinstance ( oper, cpooperation ) # convert arguments in cpo expressions args = tuple ( map ( build _ cpo _ expr, params ) ) # search corresponding signature s = _ get _ matching _ signature ( oper, args ) if s is none : raise cpoexception ( " the combination of para... | [
-0.10739519447088242,
-0.17754486203193665,
0.6216129660606384,
0.5109094381332397,
-0.5329316258430481,
-0.10108693689107895,
0.7172056436538696,
-0.023611506447196007,
-0.8978056907653809,
1.3640480041503906,
0.09265577048063278,
-0.6541596055030823,
-0.2646118700504303,
-0.6047068834304... |
def send _ message ( self, message ) : with app ( " rabbit " ) as rabbit : rabbit. basic _ publish ( exchange = self. _ exchange, routing _ key = self. browser _ uuid, body = dumps ( message ) ) | [
-1.0542320013046265,
0.305652916431427,
0.38401713967323303,
0.8969425559043884,
0.6021751165390015,
0.27482670545578003,
-0.4650008976459503,
-0.010414964519441128,
0.42684656381607056,
0.6555972695350647,
-0.3405064046382904,
1.2762469053268433,
-1.1962928771972656,
0.903326690196991,
... |
def total _ operation ( self, path ) : ret = 0 for x in self. _ games : if self. _ games [ x ]. score _ kind = = path [ 7 : ] : ret + = self. _ games [ x ]. played return ret | [
-0.46151289343833923,
0.5595057010650635,
0.8167657256126404,
-0.5056350231170654,
0.6843168139457703,
-0.39202678203582764,
0.9701510667800903,
-1.192077398300171,
0.28112852573394775,
1.4484984874725342,
0.21114537119865417,
-0.4768173098564148,
-0.7907545566558838,
-1.533076286315918,
... |
def _ _ init _ _ ( self, file _ type _ code : str = none, file _ type _ desc : str = none ) : # noqa : e501 self. swagger _ types = {'file _ type _ code': str,'file _ type _ desc': str } self. attribute _ map = {'file _ type _ code':'file _ type _ code ','file _ type _ desc':'file _ type _ desc'} self. _ file _ type _ ... | [
0.3278821110725403,
-0.6077044010162354,
0.6161597371101379,
-0.19832217693328857,
0.5890054702758789,
0.1022086814045906,
0.18471720814704895,
0.24776428937911987,
-0.3969443440437317,
-0.1998331993818283,
-0.17346055805683136,
0.7618333101272583,
0.24211296439170837,
0.6542608141899109,
... |
def remove _ outlier ( sym _ arr, repo _ path, sday, eday ) : for sym in sym _ arr : print ( sym ) dbar = repo. repodailybar ( sym, repo _ path = repo _ path ) repo. remove _ outlier _ lr ( dbar, sday, eday ) | [
-0.5519384145736694,
0.743358850479126,
0.3303104639053345,
-0.22087551653385162,
0.19590860605239868,
0.6418058276176453,
0.5029603838920593,
0.5370456576347351,
-0.07086843252182007,
0.19514092803001404,
0.17504097521305084,
-0.13517598807811737,
-0.2994484603404999,
1.4783942699432373,
... |
def get _ element _ type ( element _ name ) : return ( f " / / a [ contains ( @ title,'{ element _ name }') ] ", by. xpath ) | [
-0.006434746086597443,
-0.260172963142395,
0.31885218620300293,
0.04352628067135811,
0.4009955823421478,
0.06634695827960968,
0.047346081584692,
0.15781494975090027,
0.6336351037025452,
0.3853834867477417,
0.4567670226097107,
-0.09372030943632126,
0.062367603182792664,
-0.17983661592006683... |
def format _ datetime ( dt : datetime. datetime ) - > str : epoch = default _ epoch if dt. tzinfo is not none : epoch = datetime. datetime ( 1970, 1, 1, tzinfo = dt. tzinfo ) dt = epoch + datetime. timedelta ( seconds = dt. timestamp ( ) ) return dt. replace ( microsecond = 0, tzinfo = pytz. utc ). isoformat ( ) | [
0.41193196177482605,
0.6796069741249084,
0.4698662757873535,
0.5071085095405579,
-0.7089537382125854,
0.3224169909954071,
-0.34554073214530945,
0.2737922966480255,
0.68113112449646,
0.8004149198532104,
0.5371639728546143,
-0.7926048636436462,
0.8838818073272705,
0.21776381134986877,
-0.7... |
def trace ( self, trace ) : self. _ trace = trace | [
0.23979909718036652,
0.790716290473938,
-0.1630256474018097,
0.38340815901756287,
0.7551957368850708,
0.48714032769203186,
0.20210346579551697,
0.058180127292871475,
0.03716335818171501,
-0.5338712334632874,
-1.0707675218582153,
-0.8202161192893982,
-0.5919150114059448,
0.2766513228416443,... |
def avatar _ ids ( self, avatar _ ids ) : self. _ avatar _ ids = avatar _ ids | [
-0.7374293208122253,
-0.36865025758743286,
-0.3027459979057312,
0.1446836143732071,
-0.5005860924720764,
0.9679876565933228,
-0.159276083111763,
0.14863339066505432,
0.48008620738983154,
0.7282139658927917,
-0.6082335114479065,
0.500296950340271,
0.204411581158638,
-0.47164610028266907,
... |
def solve ( self, state _ map ) : self. next _ state. state _ map = state _ map self. output. state _ map = state _ map state _ bit _ on = { } state _ bit _ off = { } for i in xrange ( self. state _ word _ len ) : state _ bit _ on [ i ] = [ ] state _ bit _ off [ i ] = [ ] for k, v in state _ map. iteritems ( ) : if v &... | [
-0.8089647889137268,
0.31040671467781067,
0.7223161458969116,
0.3288898766040802,
-0.5717518329620361,
-1.0694975852966309,
0.9623007774353027,
0.35762348771095276,
0.25718989968299866,
0.3278973698616028,
-1.2958182096481323,
-1.0184688568115234,
-0.8085042834281921,
0.4193554222583771,
... |
def _ read ( self, fp, fpname ) : elements _ added = set ( ) cursect = { } sectname ='_ _ none _ sect'self. _ sections [ sectname ] = cursect self. _ set _ proxies ( sectname ) optname = none lineno = 0 indent _ level = 0 e = none # none, or an exception for lineno, line in enumerate ( fp, start = 1 ) : comment _ start... | [
0.09033597260713577,
-0.4781116247177124,
0.9920563697814941,
-0.5050796866416931,
-0.6972334384918213,
-0.501211941242218,
0.3067774176597595,
0.04493274167180061,
-0.6676791310310364,
0.2598807215690613,
0.8757099509239197,
-0.4706505239009857,
0.23160789906978607,
0.2561621367931366,
... |
def df ( self, x, u ) : x1, x2 = x theta _ dot = x2 theta _ ddot = self. grav / self. l * np. sin ( x1 ) - self. mu / ( self. m * self. l * * 2 ) * x2 + 1. / ( self. m * self. l * * 2 ) * u dx1 = self. grav / self. l * np. cos ( x1 ) dx2 = - self. mu / ( self. m * self. l * * 2 ) du = 1. / ( self. m * self. l * * 2 ) #... | [
-0.4664124548435211,
0.12404085695743561,
0.6548416614532471,
-0.7537239193916321,
-0.19128456711769104,
0.34450671076774597,
0.42221859097480774,
0.5142244696617126,
-0.7147127985954285,
-0.6049929261207581,
-0.1957944631576538,
1.2841204404830933,
0.49013233184814453,
-0.2489486783742904... |
def is _ layer _ field ( uri : str ) - > bool : return uri in _ layer _ fields | [
-0.1788131445646286,
0.4715667963027954,
0.2976382076740265,
-0.19033360481262207,
0.18776512145996094,
0.7276298999786377,
0.07540047913789749,
-0.2887149155139923,
-0.03702952712774277,
-0.4723381996154785,
-0.7536923289299011,
-0.014660220593214035,
-0.9063156843185425,
0.25153499841690... |
def getstddev ( self ) : # - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | return binomialdistbase. getstddev ( self ) | [
-0.22337086498737335,
-0.519838809967041,
0.7713498473167419,
0.44284141063690186,
-0.33026430010795593,
-0.18060293793678284,
-0.2116287350654602,
0.09270717203617096,
-0.5374884009361267,
-0.8338025808334351,
-1.0704432725906372,
0.4616798162460327,
-0.6934936046600342,
0.230172470211982... |
def api _ method ( self ) : raise notimplementederror | [
-0.8660433888435364,
-0.5398679971694946,
0.4860193133354187,
-0.18492373824119568,
0.21911835670471191,
0.3202909231185913,
0.3277876377105713,
-0.25191235542297363,
-0.0466916561126709,
0.06398485600948334,
-0.03461103141307831,
0.2731195092201233,
0.447103887796402,
0.33850163221359253,... |
def itksmoothingrecursivegaussianimagefilterius3ius3 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilterius3ius3 _ cast ( * args ) | [
-0.3411768972873688,
0.6585604548454285,
0.17496296763420105,
-0.7793788909912109,
0.08580361306667328,
0.8268461227416992,
-0.5600133538246155,
-0.8288614153862,
0.3528195321559906,
0.14089761674404144,
0.5652515888214111,
0.15850138664245605,
-1.5955195426940918,
0.9207819700241089,
0.... |
def fix _ hidden ( h ) : h = torch. cat ( [ h [ 0 : h. size ( 0 ) : 2 ], h [ 1 : h. size ( 0 ) : 2 ] ], 2 ) return h | [
0.36027416586875916,
-0.4208119213581085,
0.6206901669502258,
0.1805219203233719,
0.2547895014286041,
0.5877273678779602,
-0.06460422277450562,
0.07101878523826599,
-1.1316508054733276,
0.28633153438568115,
-1.2314239740371704,
0.5965990424156189,
-0.11549168080091476,
-0.4374478757381439,... |
def test _ set _ file _ paths ( self ) : self. assertequal ( self. job _ 1. local _ path, os. path. join ( self. job _ 1. project _ directory,'calcs ','species ', self. job _ 1. species _ label, self. job _ 1. job _ name ) ) self. assertequal ( self. job _ 1. remote _ path, os. path. join ('runs ','arc _ projects ', se... | [
1.1483385562896729,
-0.2959422767162323,
0.3756956458091736,
0.25409314036369324,
0.7824318408966064,
1.3917862176895142,
0.39687207341194153,
0.3286447525024414,
-1.7399061918258667,
-0.2197224199771881,
-0.06462263315916061,
-0.06097910925745964,
-0.2270371913909912,
-0.2158215194940567,... |
def increment _ defensive _ skillbook _ used ( self ) : self. defensive _ skillbook + = 1 | [
-1.0074702501296997,
0.061187077313661575,
0.47461095452308655,
0.6627100706100464,
0.6374413967132568,
0.7092475891113281,
0.8214361071586609,
-0.7621424198150635,
-0.2798519432544708,
-0.8326625823974609,
-0.5437811017036438,
0.31386351585388184,
0.5000725388526917,
0.2266610860824585,
... |
def reformat _ scores _ for _ rendering ( scores, score _ types, feedback _ types ) : success = false if len ( scores ) = = 0 : # this is a dev _ facing _ error log. error ( " score length is 0 when trying to reformat rubric scores for rendering. " ) return success, " " if len ( scores )! = len ( score _ types ) or len... | [
-0.9330950975418091,
0.9940136671066284,
0.8985382914543152,
-0.39486682415008545,
0.6278197169303894,
0.23574212193489075,
1.1106014251708984,
-0.5882356762886047,
-0.03294697776436806,
1.1324151754379272,
0.2875795364379883,
-0.1514931172132492,
-0.890465497970581,
-0.03524034470319748,
... |
def make _ movie _ file ( self ) : # make html movie in a subdirectory directory = self. casename if os. path. isdir ( directory ) : shutil. rmtree ( directory ) # rm - rf directory os. mkdir ( directory ) # mkdir directory # mv frame _ *. png directory for filename in glob. glob ('frame _ *. png') : os. rename ( filen... | [
-0.005125817377120256,
0.37354379892349243,
1.0551186800003052,
0.8594985008239746,
-0.29901617765426636,
0.30163371562957764,
0.5753904581069946,
-0.3786713778972626,
-0.020616397261619568,
0.09713679552078247,
0.5997987985610962,
0.8690893650054932,
0.4703662395477295,
0.6581548452377319... |
def get _ content ( html ) : soup = beautifulsoup ( html, " html. parser " ) new _ video = str ( soup. find _ all ( " div ", {'class':'intro'} ) ). split ( ) new _ video = new _ video [ 8 ] [ 6 : new _ video [ 8 ]. find ( '. html') + 5 ] return new _ video | [
-0.19407017529010773,
-0.05465323477983475,
0.8488035202026367,
0.9357503056526184,
-0.5495103001594543,
-0.37112680077552795,
0.9817147254943848,
-0.3288661241531372,
0.14185167849063873,
0.7616986036300659,
0.0315299816429615,
0.5813478231430054,
-0.19416989386081696,
0.0969938263297081,... |
def test _ get _ media _ group _ this _ site ( self ) : # media _ group _ partner = mediapartner. objects. get ( id = 402 ) self. login ( media _ group _ partner. email ) response = self. client. get ('/ hudson - valley / media - partner /') self. assertequal ( response. status _ code, 200 ) | [
-0.8851028084754944,
0.6449881792068481,
0.3330365717411041,
0.034043267369270325,
-0.38083651661872864,
-0.42848271131515503,
0.2812439203262329,
0.24583633244037628,
0.38009917736053467,
-0.4719589948654175,
-0.26255562901496887,
0.5699105858802795,
-0.8540607690811157,
0.615315675735473... |
def arn ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " arn " ) | [
0.20569594204425812,
-0.7274563312530518,
0.34914469718933105,
0.6968464851379395,
1.3851077556610107,
0.5421022772789001,
0.34137770533561707,
1.0425776243209839,
0.8396877646446228,
-0.5267665386199951,
0.07459182292222977,
1.4436564445495605,
0.4793280065059662,
-0.8951220512390137,
0... |
def applysettings ( self, userdata, config _ version, settings, comment = " " ) : self. object = config _ version existing _ settings = self. get _ settings ( self. object, { } ) debug _ print ( " existingsettings for config _ version - ", self. object,'- ', existing _ settings ) debug _ print ( " settings. items ( ) "... | [
-0.8121379613876343,
-0.28468284010887146,
0.7447015643119812,
0.47890377044677734,
0.24117513000965118,
-0.008633855730295181,
0.14947251975536346,
0.13403820991516113,
-0.16421975195407867,
1.1950064897537231,
-0.37288710474967957,
-0.44260478019714355,
0.2787674367427826,
0.831585705280... |
def get _ group _ list ( ) : ret = none try : ret, err = _ get _ user _ or _ group _ list ( " groups " ) if err : raise exception ( err ) except exception, e : return none,'error retrieving group list : % s'% str ( e ) else : return ret, none | [
-0.8067259192466736,
0.47829103469848633,
0.4831983149051666,
0.6972499489784241,
0.6877999901771545,
-0.8559063673019409,
-0.13237249851226807,
-0.12030208110809326,
0.2587720453739166,
0.16826388239860535,
0.07361140847206116,
0.18421387672424316,
-0.38709303736686707,
0.486683189868927,... |
def _ duration _ from _ two _ time _ stamps ( start : timestamp, end : timestamp ) - > duration : duration = duration ( seconds = end. seconds - start. seconds, nanos = end. nanos - start. nanos, ) # pylint : disable = chained - comparison if duration. seconds < 0 and duration. nanos > 0 : duration. seconds + = 1 durat... | [
0.6704990267753601,
-0.11723807454109192,
0.6621934175491333,
0.2987878918647766,
-0.04312353581190109,
-0.23855438828468323,
-0.2241971790790558,
-1.0662498474121094,
0.07429084181785583,
-0.12057219445705414,
-0.26181507110595703,
0.191343292593956,
1.1800259351730347,
-0.068582922220230... |
def protocol ( self ) - > pulumi. input [ str ] : return pulumi. get ( self, " protocol " ) | [
0.5508196353912354,
0.46596986055374146,
0.17160817980766296,
0.051314640790224075,
0.538017213344574,
1.77299964427948,
0.17873170971870422,
0.08247442543506622,
0.59792560338974,
0.01291023101657629,
0.34673112630844116,
0.6078084707260132,
-0.3432336747646332,
-1.8017117977142334,
-0.... |
def test _ nodegroup _ create _ missing _ required _ arg ( self ) : arglist = [ self. nodegroup. name ] verifylist = [ ('name ', self. nodegroup. name ) ] self. assertraises ( magnum _ fakes. magnumparseexception, self. check _ parser, self. cmd, arglist, verifylist ) | [
-0.3057961165904999,
0.4622195065021515,
0.19994919002056122,
-0.6831309199333191,
0.09723756462335587,
0.6631699800491333,
-0.37987416982650757,
-0.26755207777023315,
-1.2017099857330322,
0.5119900703430176,
-0.7704215049743652,
0.22747568786144257,
-0.475675106048584,
2.1761703491210938,... |
def testupdateorders ( self ) : if not self. _ _ class _ _. order1 or not self. _ _ class _ _. order2 : self. testcreateorders ( ) notes ='spoke to advertiser. all is well.'self. _ _ class _ _. order1 ['notes'] = notes self. _ _ class _ _. order2 ['notes'] = notes orders = self. _ _ class _ _. service. updateorders ( [... | [
-1.2557092905044556,
0.3083626329898834,
0.5900859236717224,
-0.10317052155733109,
0.667086660861969,
0.1704522669315338,
-0.5526419878005981,
-0.8502694964408875,
0.21759089827537537,
0.6581751704216003,
-0.7796085476875305,
-0.05312643200159073,
-1.0901745557785034,
-0.053675439208745956... |
def read ( self, file _ name : optional [ path ] = none, conversion : real = 1. 0 ) : if file _ name is none : if self. file _ name is not none : file _ name = self. file _ name else : raise valueerror ('file _ name must be specified') with open ( file _ name,'r') as shape _ file : # get the grid size for each cube fac... | [
0.15629997849464417,
0.49773621559143066,
0.8307940363883972,
-0.05386747419834137,
0.09140074253082275,
0.17128761112689972,
0.459911048412323,
0.0752069354057312,
-1.1884464025497437,
0.5901353359222412,
-0.33685755729675293,
0.21964778006076813,
0.22568975389003754,
-0.01344278082251548... |
def form _ for _ request ( request, formclass, * args, * * kwargs ) : return formclass ( request. post if request. method = ='post'else none, * args, * * kwargs ) | [
-0.7812982201576233,
-0.04816318303346634,
0.5353878736495972,
-0.05400129780173302,
0.3912825882434845,
-0.12728054821491241,
-1.2648907899856567,
-0.5001802444458008,
-0.0023370522540062666,
-1.812666416168213,
0.5119038224220276,
-0.3558169901371002,
0.4764196574687958,
0.99218708276748... |
def test _ attempt _ json _ write _ failed ( ) : with patch ('builtins. open') as open _ func : open _ func. side _ effect = ioerror ('fake') result = writer. attempt _ json _ write ('fake ', { } ) assert result is not none | [
-1.012037754058838,
-0.4740813076496124,
0.26717522740364075,
-0.3306867182254791,
0.13847456872463226,
-0.0831037238240242,
0.3338492810726166,
-0.48173806071281433,
-0.622650146484375,
-0.20668937265872955,
-0.6248192191123962,
-0.07323276996612549,
0.06718383729457855,
-0.76576864719390... |
def highest _ priority ( lines ) : return sort _ by _ priority ( get _ status _ lines ( lines ) ) [ 0 ] | [
1.160991907119751,
-1.001949429512024,
0.3590969145298004,
0.6635527610778809,
0.17272138595581055,
-0.2655417025089264,
-1.4482213258743286,
0.7436237335205078,
0.15603458881378174,
-0.5528537034988403,
1.2795356512069702,
-0.4584880769252777,
0.17883481085300446,
0.2686137557029724,
-0... |
def remove _ stop _ words ( document ) : document =''. join ( [ i for i in document. split ( ) if i not in stop ] ) return document | [
-0.6921350955963135,
-0.06678562611341476,
0.3455233573913574,
0.00022339820861816406,
-1.4188578128814697,
0.5838834643363953,
-0.2805088460445404,
0.45958811044692993,
-0.5206536650657654,
1.644243836402893,
-0.33748871088027954,
-0.3145761489868164,
-0.9009774327278137,
-0.8346123099327... |
def apply _ chunked ( f : callable, in _ axes = 0, *, chunk _ size : optional [ int ] ) - > callable : _, argnums = _ parse _ in _ axes ( in _ axes ) return _ chunk _ vmapped _ function ( f, chunk _ size, argnums ) | [
0.7810376882553101,
0.13047972321510315,
0.5484099984169006,
-0.08820377290248871,
-0.43832871317863464,
-0.5848842263221741,
0.4195083677768707,
0.7665730714797974,
-0.22444133460521698,
-0.16815362870693207,
0.3749698996543884,
0.8265378475189209,
0.6532452702522278,
-0.7662192583084106,... |
def _ _ len _ _ ( self ) : return len ( self. vec ) | [
-0.010625777766108513,
-0.7222266793251038,
0.1838136911392212,
-1.4431679248809814,
0.7020351886749268,
0.17147749662399292,
0.9095997214317322,
0.48794418573379517,
0.6246291995048523,
-0.8676840662956238,
-1.15873384475708,
-0.05166054517030716,
0.7053285837173462,
-0.32826077938079834,... |
def correct _ sfs ( sfs _ i, sfs _ d, e _ i = 0. 0110086484429, e _ d = 0. 0166354937984, n = 20 ) : # convert to counts sfs _ i = sfs2counts ( sfs _ i, n ) sfs _ d = sfs2counts ( sfs _ d, n ) freq _ keys = [ round ( y / float ( n ), 3 ) for y in range ( 1, n ) ] corrected _ i = [ ] corrected _ d = [ ] # loop per frequ... | [
-0.43288493156433105,
0.17267486453056335,
0.6294971704483032,
-0.957410454750061,
-0.2610592842102051,
-0.4145328104496002,
0.9011051654815674,
0.6686336994171143,
-0.05335031822323799,
0.10294592380523682,
0.9789364337921143,
0.2438490241765976,
0.6601752042770386,
0.6595039963722229,
... |
def switch _ frame ( self, frame _ class ) : new _ frame = frame _ class ( self ) if self. _ frame is not none : self. _ frame. destroy ( ) self. _ frame = new _ frame self. _ frame. pack ( ) | [
-0.7029710412025452,
0.4362872838973999,
0.6132220029830933,
0.30202212929725647,
0.4994559586048126,
-0.41300928592681885,
-0.448895126581192,
0.2748278081417084,
0.848406195640564,
0.16785025596618652,
-0.981130838394165,
0.724597156047821,
-0.3620302081108093,
0.48082587122917175,
1.1... |
def maxperformance ( self, n : int, speed, efficiency, k : int ) - > int : m = 10 * * 9 + 7 n = len ( speed ) if k = = 1 : return max ( efficiency [ i ] * speed [ i ] for i in range ( n ) ) % m engineers = sorted ( [ i for i in range ( n ) ], key = lambda x : ( speed [ x ], efficiency [ x ] ), reverse = true ) print ( ... | [
0.07294835150241852,
0.8596080541610718,
0.9716045260429382,
0.13299110531806946,
0.08811463415622711,
-1.078590989112854,
0.17312631011009216,
0.4997099041938782,
0.39653655886650085,
0.4684288799762726,
-0.3314310908317566,
-0.8257859945297241,
-0.8722609281539917,
1.2938470840454102,
... |
def data _ gen ( data, batch _ size, nb _ samples ) : n = 0 while true : curr _ size = batch _ size if n + curr _ size > = nb _ samples : curr _ size = nb _ samples - n n = 0 x _ batch = np. zeros ( ( curr _ size, seq _ length, vocab _ size ) ) y _ batch = np. zeros ( ( curr _ size, seq _ length, vocab _ size ) ) for i... | [
-0.1273738592863083,
-0.5027071237564087,
0.6244595050811768,
-0.006475070491433144,
-0.004699714947491884,
0.19431377947330475,
-0.15024711191654205,
-0.29939040541648865,
-0.0698588564991951,
-0.19373629987239838,
0.07837078720331192,
0.28384050726890564,
0.28592392802238464,
0.096431173... |
def _ _ init _ _ ( self, config ) : ampioentity. _ _ init _ _ ( self, config ) | [
0.7681133151054382,
-0.9459234476089478,
0.30889105796813965,
0.5992094278335571,
0.2760235667228699,
0.7680552005767822,
0.20818530023097992,
0.472109317779541,
0.5887414813041687,
0.093685083091259,
-1.1879360675811768,
-0.6790711283683777,
0.35757458209991455,
0.9519209861755371,
0.72... |
def set _ activating _ widget ( self, activating _ widget : qwidget ) : activating _ widget. setcontextmenupolicy ( qt. customcontextmenu ) activating _ widget. customcontextmenurequested. connect ( self. show _ menu ) | [
0.26417964696884155,
-0.3738648593425751,
0.183416485786438,
-0.019625147804617882,
0.24226555228233337,
0.30307018756866455,
-0.6656094193458557,
1.649487018585205,
0.35753747820854187,
-0.35667064785957336,
-0.1454724222421646,
1.2094001770019531,
-0.14362502098083496,
0.4269539117813110... |
def getusers ( self ) : message = dict ( ) users _ select = " " " select * from user " " " users _ query = user. raw ( users _ select ) usernames = [ ] for user in users _ query : usernames. append ( user. username ) message [ " users " ] = usernames message [ " success " ] = true return ( json. dumps ( message ) ) | [
-1.2578740119934082,
0.3707095980644226,
0.5451201796531677,
0.055607713758945465,
-0.05505051836371422,
-0.6150287985801697,
-0.5501896739006042,
-0.28806519508361816,
-0.7482806444168091,
0.9014970660209656,
-0.7107152938842773,
0.25479429960250854,
0.0677328035235405,
0.3745468258857727... |
def disconnect ( self, * connectors ) : for connector in connectors : if isinstance ( connector, connector ) : try : self. taps. remove ( connector ) connector. state = none connector. connections ['output']. remove ( self ) connector. trigger ( ) except : print ( " the specified connector is not tapped to this ground ... | [
-1.6818280220031738,
-0.5161569118499756,
0.42549484968185425,
0.5258414149284363,
-0.5324133038520813,
0.33580613136291504,
0.7336304187774658,
-0.06428112834692001,
1.0143882036209106,
-0.35569894313812256,
0.12391765415668488,
-1.4737637042999268,
-0.8163079619407654,
0.2266709506511688... |
def bellman _ ford ( self, startnode ) : # get destination & path dictionaries destination, path = self. destination _ predecessors ( startnode ) number _ vertices = len ( self. vertices ) # iterate v - 1 times for bellman ford for i in range ( number _ vertices - 1 ) : # for each currency ( token ) in graph for token ... | [
-0.3404761552810669,
-0.1672600507736206,
0.71551913022995,
-0.13998474180698395,
-0.8690432906150818,
-0.9834641218185425,
0.3034728169441223,
-0.25862768292427063,
-0.28514498472213745,
-0.0057253288105130196,
-0.12094733119010925,
0.8090598583221436,
-1.404181957244873,
-0.0731519311666... |
def get _ function ( self, minterms ) : if isinstance ( minterms, str ) : return minterms def parentheses ( glue, array ) : if len ( array ) > 1 : return''. join ( ['( ', glue. join ( array ),')'] ) else : return glue. join ( array ) or _ terms = [ ] for minterm in minterms : and _ terms = [ ] for j in range ( len ( se... | [
-0.8975095748901367,
-0.9314109683036804,
0.5642834901809692,
-0.9669024348258972,
-0.27416563034057617,
-0.7448851466178894,
-0.8783533573150635,
-0.8267481327056885,
0.4574175179004669,
0.511337399482727,
0.1621430665254593,
-0.09013158828020096,
-0.5902528762817383,
0.22292619943618774,... |
def get ( self, item, default ) : return self. _ df. get ( item, default ) | [
-0.6432013511657715,
0.8001446723937988,
0.16038137674331665,
1.0765491724014282,
1.2784206867218018,
-0.9139911532402039,
-0.8025693297386169,
-0.6323906183242798,
-0.7572792172431946,
-0.5181377530097961,
-0.047103747725486755,
0.41598784923553467,
-0.31558889150619507,
-2.38889169692993... |
def _ _ init _ _ ( self, journey : objectify. objectifiedelement, now : datetime ) - > none : self. journey : objectify. objectifiedelement = journey self. now : datetime = now self. attr _ types = self. journey. journeyattributelist. xpath ( " * / attribute / @ type " ) self. name : str = self. _ extract ( " name " ) ... | [
-0.9653303027153015,
-0.39762595295906067,
0.8137316703796387,
0.4835726320743561,
-0.38307806849479675,
0.26196783781051636,
-0.2832619249820709,
0.14106625318527222,
-0.35893118381500244,
0.2801947295665741,
-0.727482795715332,
-0.8573165535926819,
0.9973772168159485,
0.5194182395935059,... |
def do _ delete ( self, node _ id ) : _ error _ code, _ msg = ramstkdatamodel. do _ delete ( self, node _ id ) # pylint : disable = attribute - defined - outside - init # it is defined in ramstkdatamodel. _ _ init _ _ if _ error _ code! = 0 : _ error _ code = 2005 _ msg = _ msg +'ramstk error : attempted to delete non ... | [
0.45633187890052795,
0.4637375771999359,
0.8224037885665894,
-0.5075817704200745,
1.2950210571289062,
-0.6752020716667175,
0.14249815046787262,
0.25062069296836853,
-0.12683722376823425,
0.8937870860099792,
0.11058669537305832,
0.7322053909301758,
-0.24826592206954956,
0.7558644413948059,
... |
def process _ change _ line ( self, change _ line ) : ( change _ line, rev, seq ) = super ( basedocchangesprocessor, self ). process _ change _ line ( change _ line ) original _ doc = change _ line. get ('doc') if original _ doc is none : if change _ line. get ('deleted') : doc = {'_ id': change _ line ['id'],'_ delete... | [
-0.31876614689826965,
-0.5769282579421997,
0.5451624989509583,
-0.015094761736690998,
-0.019871503114700317,
-0.5940709114074707,
-0.5036581158638,
0.7228447794914246,
0.21115462481975555,
0.8211662173271179,
-0.20780612528324127,
-0.08982518315315247,
0.06275518238544464,
-0.1446845382452... |
def _ _ init _ _ ( self, command, on _ complete, on _ progress = none, working _ dir = " ", fallback _ encoding = " " ) : threading. thread. _ _ init _ _ ( self ) self. command = command self. on _ complete = on _ complete self. on _ progress = on _ progress self. working _ dir = working _ dir self. fallback _ encoding... | [
0.859046995639801,
0.09903552383184433,
0.5070317983627319,
0.7942676544189453,
-0.16374348104000092,
-0.18027931451797485,
0.001422303612343967,
-0.042091526091098785,
0.15409015119075775,
-0.4120032489299774,
-0.5783182382583618,
0.008649667724967003,
-1.1577184200286865,
1.0157456398010... |
def goldsteincondition ( alpha _ 0, alpha _ u, alpha _ l, func _ alpha, grad _ alpha, rho = 0. 1 ) : lc = ( func _ alpha ( alpha _ 0 ) > = func _ alpha ( alpha _ l ) + \ ( 1 - rho ) * ( alpha _ 0 - alpha _ l ) * grad _ alpha ( alpha _ l ) ) rc = ( func _ alpha ( alpha _ 0 ) < = func _ alpha ( alpha _ l ) + \ rho * ( al... | [
0.7688062787055969,
-0.8243909478187561,
0.7717217803001404,
-0.6398504376411438,
-0.7951287031173706,
0.43459245562553406,
0.42893272638320923,
0.36962777376174927,
-0.457513689994812,
0.0874193012714386,
-0.2766110599040985,
0.19082869589328766,
-0.2405509650707245,
1.9110678434371948,
... |
def max _ sine ( start, end ) : if start < = ( np. pi / 2. 0 ) < = end : return + 1. 0 return max ( np. sin ( start ), np. sin ( end ) ) | [
0.829011082649231,
-0.754699170589447,
0.5041860938072205,
1.3205105066299438,
-0.4587090313434601,
0.09928189963102341,
-1.2759864330291748,
-0.03973456472158432,
-0.3737178146839142,
-0.007218804210424423,
0.6716331243515015,
0.8999298214912415,
-0.7784196734428406,
-0.0084365950897336,
... |
def add _ missing _ rels ( f ) : import bs4 with open ( f,'r +') as fi : # this is going to take forever. b = bs4. beautifulsoup ( fi, " xml " ) ways = b. find _ all ('way') relations = b. find _ all ('relation') max _ id = max ( relations, key = lambda r : int ( r. attrs ['id'] ) ) _ id = int ( max _ id. attrs ['id'] ... | [
0.22939178347587585,
-0.013717249035835266,
0.9498206377029419,
-0.5098322629928589,
0.3365704119205475,
0.01341420691460371,
0.04033539816737175,
0.11956001818180084,
0.15027037262916565,
0.14729520678520203,
-0.27208372950553894,
-0.34593331813812256,
-0.1989031285047531,
0.8880409002304... |
def get _ bearer _ token ( event : dict ) - > str : try : return event [ " headers " ] [ " authorization " ] except keyerror : raise requestparseerror ( ) | [
0.09333758801221848,
-0.5534700155258179,
0.6849521398544312,
1.0209202766418457,
-0.6565895080566406,
-0.4031979739665985,
-0.349582701921463,
0.7026575207710266,
0.2795751690864563,
-0.34505322575569153,
0.38324645161628723,
0.16516529023647308,
1.094248652458191,
-0.2435685694217682,
... |
def date _ time ( ) : now = datetime. now ( ) time = now. strftime ( " % d / % m / % y % h : % m : % s " ) return time | [
-0.20602765679359436,
-0.7164477705955505,
0.7476289868354797,
-0.46557044982910156,
0.1392182558774948,
0.9895366430282593,
-0.667159914970398,
0.015668563544750214,
-0.711511492729187,
1.0684090852737427,
-0.09959760308265686,
-0.7649681568145752,
0.026974521577358246,
-0.249847501516342... |
def _ detect _ one _ object ( self, classifier, image, search _ rect, image _ size _ to _ min _ size _ ratio ) : x, y, w, h = search _ rect min _ size = utils. widthheightdividedby ( image, image _ size _ to _ min _ size _ ratio ) sub _ image = image [ y : y + h, x : x + w ] sub _ rects = [ ] try : sub _ rects = classi... | [
-0.8199436664581299,
-0.4134694039821625,
0.8736064434051514,
0.2407766580581665,
0.26045316457748413,
-0.05360875651240349,
-0.15354959666728973,
-0.6701321005821228,
-0.13100551068782806,
-0.008022447116672993,
-0.7037955522537231,
-0.18217211961746216,
0.12971675395965576,
0.63879090547... |
def _ set _ auth ( self ) : if self. auth _ version = ='v3': auth _ func = self. identity _ auth _ v3 else : auth _ func = self. keystone _ auth self. token, self. base _ url = ( auth _ func ( self. user, self. password, self. auth _ url, self. service, self. tenant _ name ) ) | [
-0.8296419382095337,
-0.5241321921348572,
0.15628387033939362,
1.317832112312317,
0.002010426949709654,
-0.35531094670295715,
-0.8283579349517822,
0.15800032019615173,
-0.19365063309669495,
-0.17019140720367432,
-0.2582540214061737,
1.0070875883102417,
1.10627281665802,
-0.5426275730133057... |
def to _ dict ( self ) - > dict : dict _ monitor : dict = { " adapter " : { " deviceid " : self. adapter. deviceid, " devicekey " : self. adapter. devicekey, " devicename " : self. adapter. devicename, " devicestring " : self. adapter. devicestring, " size " : self. adapter. size, " stateflags " : self. adapter. statef... | [
-0.5948184728622437,
-0.49183720350265503,
0.5846187472343445,
-1.0199466943740845,
-0.699868381023407,
-0.5623753666877747,
0.43516406416893005,
-0.9842653870582581,
0.26224637031555176,
-0.21633975207805634,
-0.6976191401481628,
-0.5261314511299133,
-0.08810974657535553,
0.78113090991973... |
def unique _ id ( self ) : if self. unique _ id is none : self. unique _ id = self. generate _ unique _ id ( ) return self. unique _ id | [
0.43142247200012207,
-0.1632741391658783,
0.5138306617736816,
-0.3325955271720886,
0.7181060314178467,
0.2017051726579666,
0.56914883852005,
1.2457187175750732,
0.9033874869346619,
-0.9924632906913757,
-0.004488132428377867,
0.6755439639091492,
-0.675908625125885,
-0.3423854410648346,
-0... |
def _ is _ dagmc ( filename ) : fr = open ( filename,'r') line = fr. readline ( ) # skips title card line = fr. readline ( ). strip ( ). lower ( ) # skip current and subsequent lines if they are comments, # until non - comment line is found while line [ : 2 ] = ='c'or line = ='c': line = fr. readline ( ). strip ( ). lo... | [
-0.497332900762558,
-0.30077600479125977,
0.7056716084480286,
-0.501455545425415,
-0.8629438877105713,
0.30661502480506897,
0.5207018852233887,
0.1317170113325119,
-0.5195004940032959,
-0.32891711592674255,
0.6283779144287109,
0.14964504539966583,
-0.2857142388820648,
0.17570705711841583,
... |
def get _ gene _ params ( gpmodel ) : return gpmodel. rbf. variance, gpmodel. rbf. lengthscale, gpmodel. gaussian _ noise. variance | [
-0.20456385612487793,
-0.16520355641841888,
0.5001827478408813,
0.09604725241661072,
1.3159828186035156,
0.7447531819343567,
-0.6812597513198853,
-0.43641993403434753,
-1.4190984964370728,
0.9459820985794067,
-1.1745165586471558,
0.4009728729724884,
-0.5307522416114807,
1.377584457397461,
... |
def link _ lint ( output _ dir, results _ dir ) : linklint = distutils. spawn. find _ executable ('linklint') if linklint : subprocess. check _ call ( [ linklint,'- no _ anchors ','- orphan ','- root ', output _ dir,'/ @ ','- doc ', results _ dir ], cwd = output _ dir ) with open ( os. path. join ( results _ dir,'index... | [
0.8527030348777771,
-0.34578937292099,
0.7413998246192932,
-0.46728014945983887,
0.9387633800506592,
0.6092382669448853,
0.20729979872703552,
-0.2304716259241104,
0.17639578878879547,
-0.3869529664516449,
0.9315654039382935,
0.8909799456596375,
-0.33372780680656433,
0.7072048783302307,
-... |
def register _ athlete ( self, strava _ athlete : sm. athlete, access _ token : str ) - > athlete : session = meta. scoped _ session ( ) athlete = session. query ( athlete ). get ( strava _ athlete. id ) if athlete is none : athlete = athlete ( ) athlete. id = strava _ athlete. id athlete _ name = f " { strava _ athlet... | [
0.19419440627098083,
-0.3474218547344208,
0.7565587759017944,
-0.27364763617515564,
-0.870673418045044,
-0.48535624146461487,
-0.3222339451313019,
-0.400442510843277,
0.4999793767929077,
0.8535205125808716,
-0.19741572439670563,
0.9652922749519348,
0.053382791578769684,
-0.561376690864563,... |
def tokenize _ text ( doc ) : # tokenize and make lowercase. words = nltk. word _ tokenize ( doc ) words = [ w. lower ( ) for w in words ] return words | [
0.13169141113758087,
-0.4647693634033203,
0.28507310152053833,
0.477218896150589,
0.19450479745864868,
-0.44659602642059326,
-0.35850411653518677,
0.8199869990348816,
0.19916318356990814,
0.058355044573545456,
-0.4868513345718384,
0.14884814620018005,
-0.7107736468315125,
0.900321304798126... |
def max _ coord ( target _ arr, background _ arr, mask _ list, threshold ) : if target _ arr. shape [ 0 ]! = background _ arr. shape [ 1 ] : if np. prod ( target _ arr. shape )! = np. prod ( background _ arr. shape ) : raise exception ( " shapes of target and background arrays are inconsistent : { } vs { } ". format ( ... | [
0.3875698149204254,
-0.5008832812309265,
0.9376497864723206,
0.7399970889091492,
-0.2483726441860199,
-0.08601569384336472,
0.7322006821632385,
0.0008396429475396872,
-0.43038561940193176,
0.8015556335449219,
0.38585811853408813,
1.2270433902740479,
-0.18306000530719757,
-0.424147039651870... |
def nat _ gateway _ id ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " nat _ gateway _ id " ) | [
0.6784603595733643,
0.19221219420433044,
0.2690798044204712,
0.334401398897171,
-0.006499180104583502,
0.8898169994354248,
-0.5744711756706238,
-0.2517733573913574,
0.28533339500427246,
0.7869332432746887,
-0.37090739607810974,
1.3982105255126953,
-0.2602885961532593,
0.7076942324638367,
... |
def import _ data ( filename, wd ) : file _ path = os. path. join ( wd, filename ) data = pd. read _ csv ( file _ path ) return data | [
0.4745272397994995,
-0.43646931648254395,
0.5581074357032776,
-0.12779413163661957,
-0.1508490890264511,
1.024375081062317,
0.22094152867794037,
0.2065293937921524,
-0.8133372664451599,
-0.2588001489639282,
0.7851084470748901,
0.9339879155158997,
-0.21666903793811798,
-0.6513814330101013,
... |
def parse _ options ( defaults, newvalues, encoding ) : assert type ( defaults ) = = dict assert type ( newvalues ) = = dict for key, value in newvalues. iteritems ( ) : if not defaults. has _ key ( key ) : raise usageexception ( _ ( " unknown option " ) + format _ key ( key ) ) try : t = type ( defaults [ key ] ) if t... | [
-0.7327829003334045,
0.09987027198076248,
0.5880562663078308,
-0.407922625541687,
0.06316932290792465,
-0.6264942288398743,
-0.7115441560745239,
-0.5119429230690002,
-0.38416483998298645,
0.4557437300682068,
0.07692642509937286,
0.020296886563301086,
0.048443809151649475,
0.997274160385131... |
def get _ embeddings ( self, model, update _ num, filename _ prefix = " ", verbose = false, minibatch _ size = 2000 ) : embedding _ filename = self. working _ dir + " / embeddings / " + filename _ prefix + " _ seq _ embeddings. csv " # append embeddings to file if it has already been created # this is useful if you wan... | [
-0.20883728563785553,
-0.44505566358566284,
0.8452214002609253,
0.6180587410926819,
-0.7638420462608337,
-0.19105352461338043,
-0.3196709156036377,
0.7126078009605408,
0.027119165286421776,
0.31947386264801025,
-0.6458727717399597,
0.09958899766206741,
0.5775105357170105,
0.186198279261589... |
def is _ palindrome _ 3 ( head : node ) : stack = node slow = head fast = head while fast is not none : fast = fast. next if fast : curr = slow slow = slow. next curr. next = stack stack = curr fast = fast. next else : slow = slow. next head = slow # to reconstruct the list as it was while slow is not none : if slow. v... | [
-0.041400253772735596,
0.5567682981491089,
0.7304192781448364,
-0.06596570461988449,
-0.3585147559642792,
-0.20448830723762512,
0.8651462197303772,
0.8224923610687256,
0.4165438115596771,
0.2668865919113159,
-1.0179282426834106,
-0.25232118368148804,
-1.9339760541915894,
0.3160916864871979... |
def timestr _ 2 _ timedelta ( t _ str ) : ttype = t _ str [ - 1 : ] val = int ( t _ str [ : - 1 ] ) assert ttype in ['h ','m ','s'] assert ( val > 0 and val < = 12 and ttype = ='h') \ or ( val > 0 and val < = 60 and ttype = ='m') \ or ( val > 0 and val < = 60 and ttype = ='s') import datetime as dt if ttype = ='s': ret... | [
-0.6265137195587158,
-0.786186695098877,
0.48365840315818787,
0.19176779687404633,
0.05439215525984764,
0.34513503313064575,
0.07931843400001526,
-0.680248498916626,
-0.5687437653541565,
-0.1539766490459442,
0.11586140841245651,
0.5761743187904358,
0.03967757150530815,
-0.30323103070259094... |
def parseline ( line ) : print ( findnumdoublesquares ( int ( line ) ) ) | [
0.2811000347137451,
0.2694912552833557,
0.5645936727523804,
0.315962553024292,
0.28753361105918884,
-0.4465655982494354,
0.8901498317718506,
-0.8715596199035645,
-0.25068724155426025,
-0.1670246571302414,
-1.2984944581985474,
-0.17008544504642487,
0.4369848370552063,
0.554524838924408,
-... |
def check _ type ( self ) : valid _ properties = true for item in self. file _ content : if not is _ property ( self. file _ content [ item ] ) : continue definition = ontology. get _ definition ( self. file _ content [ item ] [ _ id ] ) if definition [ _ type ]! = self. file _ content [ item ] [ _ type ] : self. write... | [
-0.13504666090011597,
-1.1450958251953125,
0.5297722816467285,
-0.10883636772632599,
1.0483152866363525,
0.035425521433353424,
0.19747355580329895,
-0.8583482503890991,
-1.1669647693634033,
0.55253666639328,
1.1293563842773438,
0.3000851571559906,
-1.0049291849136353,
0.5438185930252075,
... |
def get _ frequency _ dict ( sequence ) : # freqs : dictionary ( element _ type - > int ) freq = { } for x in sequence : freq [ x ] = freq. get ( x, 0 ) + 1 return freq | [
-1.051503300666809,
0.30747827887535095,
0.4161621034145355,
0.006537043955177069,
-0.7970412969589233,
-1.340429663658142,
1.0146877765655518,
0.0578729547560215,
0.4135330021381378,
-0.5855069756507874,
-1.2855019569396973,
-0.9059615731239319,
0.3077007532119751,
1.063666582107544,
0.... |
def _ solve ( self, problem ) : pass | [
-0.7295615673065186,
0.016348276287317276,
0.020843708887696266,
0.30248716473579407,
1.19010329246521,
0.3150028586387634,
-0.18427588045597076,
-0.04552006721496582,
-0.2526523172855377,
-0.7874401807785034,
-0.39312711358070374,
-0.9559417963027954,
-0.15028555691242218,
0.0205628778785... |
def area _ circle ( r ) : return r * r * pi | [
-0.25040584802627563,
-0.6449376940727234,
0.07034750282764435,
-1.1809155941009521,
-0.5918935537338257,
0.03826490789651871,
0.7648447751998901,
-0.4258902966976166,
1.2510160207748413,
0.9770036935806274,
0.5746683478355408,
-0.5235214829444885,
0.45517730712890625,
0.3090117275714874,
... |
def load _ banned _ levels ( self ) - > none : try : with open ( os. path. join ( self. dataset, " banned _ levels. json " ), " r " ) as fbanned : self. banned _ levels = set ( json. load ( fbanned ) ) except filenotfounderror : self. banned _ levels = set ( ) logger. info ( " found no banned _ levels. json file " ) | [
0.4608559310436249,
-0.5994373559951782,
0.563430905342102,
-0.11991620063781738,
-0.1582433581352234,
0.5950746536254883,
-0.22120261192321777,
-0.342193067073822,
-1.161516547203064,
0.5866597294807434,
-0.34845656156539917,
0.6681663990020752,
-0.3699969947338104,
0.018951663747429848,
... |
def _ kind ( recipe ) : candidates = [ key for key in list ( recipe ) if key in ['product ','transform ','collate ','juxtapose ','aggregate'] ] if len ( candidates )! = 1 : raise virtualproductexception ( " ambiguous kind in recipe : { } ". format ( recipe ) ) return candidates [ 0 ] | [
0.3396568298339844,
0.616978108882904,
0.5688018798828125,
0.7006930112838745,
0.22414568066596985,
0.15475808084011078,
0.2732601463794708,
-0.2700585722923279,
0.5055644512176514,
0.6891316175460815,
1.1070362329483032,
0.5536896586418152,
-0.2728347182273865,
0.08060646802186966,
-0.0... |
def make _ file _ name _ v4 ( self, final _ sweep, starttime, order _ 5 _ damping, order _ 6 _ damping ) : outstring = output _ prefix \ + " ta0 " + str ( self. target _ area ) \ + " _ std0 " + str ( self. target _ std ) \ + " _ i0 " + str ( self. current _ sweep ) \ + " _ f0 " + str ( final _ sweep ) \ + convergence _... | [
0.1747443974018097,
-1.3453713655471802,
0.5976425409317017,
-0.8802313804626465,
-0.4889872670173645,
-0.08716992288827896,
-0.008362241089344025,
-0.17925189435482025,
-0.5442909598350525,
0.264463871717453,
0.391184538602829,
0.07562489807605743,
0.9153366684913635,
0.07271761447191238,... |
def view _ cart ( request ) : coupon _ apply _ form = couponapplyform ( ) return render ( request,'cart / cart. html ', {'coupon _ apply _ form': coupon _ apply _ form } ) | [
0.3703812062740326,
-0.5912531018257141,
0.4500967860221863,
-0.8276429176330566,
-0.15433330833911896,
-0.30794617533683777,
-0.22774803638458252,
0.5440419912338257,
-0.03561639040708542,
-0.5849242806434631,
0.2846354842185974,
0.31789976358413696,
0.9717373251914978,
0.1654228419065475... |
def farm _ distribute _ menu ( self ) : pass | [
0.039050981402397156,
-0.5304467678070068,
0.3935941755771637,
0.9111161828041077,
0.8100063800811768,
0.6886835694313049,
1.4493286609649658,
-0.11923486739397049,
0.38196754455566406,
-0.5398488640785217,
1.2209967374801636,
-0.27218273282051086,
0.05568239837884903,
0.6498642563819885,
... |
def get _ lcc _ size ( g, seed _ nodes ) : # getting subgraph that only consists of the black _ nodes g = nx. subgraph ( g, seed _ nodes ) if g. number _ of _ nodes ( )! = 0 : # get all components components = nx. connected _ components ( g ) return len ( components [ 0 ] ) else : return 0 | [
1.0073493719100952,
0.5985606908798218,
0.8226428031921387,
-0.9548158645629883,
0.34155577421188354,
-0.3598015010356903,
0.21045126020908356,
0.5316240191459656,
0.449862539768219,
-0.5159366726875305,
0.22233030200004578,
0.45388346910476685,
-0.31470823287963867,
0.4191528856754303,
... |
def insert _ rows ( self, table _ name, rows ) : table _ ref = self. _ dataset. table ( table _ name ) chunk _ size = 1000 try : table = self. _ client. get _ table ( table _ ref ) for i in range ( 0, len ( rows ), chunk _ size ) : self. _ insert _ rows ( table, rows [ i : i + chunk _ size ] ) except valueerror as e : ... | [
-0.2531828284263611,
1.3526781797409058,
0.2869580388069153,
0.20564472675323486,
0.41160261631011963,
-0.5593839287757874,
-0.259275883436203,
0.38157570362091064,
-0.3038742244243622,
0.23592714965343475,
0.0786566212773323,
-0.12493149936199188,
-0.539596438407898,
0.7051956653594971,
... |
def mk _ paginator ( request, items, num _ items ) : paginator = paginator ( items, num _ items ) try : page = int ( request. get. get ( " page ",'1') ) except valueerror : page = 1 try : items = paginator. page ( page ) except ( invalidpage, emptypage ) : items = paginator. page ( paginator. num _ pages ) return items | [
-1.1952241659164429,
-0.4662564694881439,
0.43097755312919617,
0.3059285879135132,
-0.02062857896089554,
-0.6310847401618958,
-0.6948959827423096,
0.07108889520168304,
0.624190628528595,
-0.3722262680530548,
0.4538860619068146,
-1.0756275653839111,
0.008831414394080639,
0.05138199403882027... |
def _ _ init _ _ ( self, label = none ) : super ( ). _ _ init _ _ ( " x ", 1, [ ], label = label ) | [
-0.22699397802352905,
1.011940360069275,
0.47974181175231934,
1.2685985565185547,
0.38508516550064087,
0.1642909198999405,
-0.4388726055622101,
0.6298086047172546,
0.7691444158554077,
-0.39186757802963257,
-1.1070722341537476,
-0.008185899816453457,
-0.10067518055438995,
-0.058618556708097... |
def test _ increment _ self _ with _ multiplication _ by _ scalar ( self ) : self. vector * = 3 self. assertequals ( self. vector, [ 3. 0, 6. 0, 9. 0 ] ) self. vector * = - 1 self. assertequals ( self. vector, [ - 3. 0, - 6. 0, - 9. 0 ] ) self. vector * = 0 self. assertequals ( self. vector, [ 0. 0, 0. 0, 0. 0 ] ) self... | [
-0.6261101961135864,
-0.32937830686569214,
0.8901751041412354,
0.8750213384628296,
-0.0068844580091536045,
0.6024954319000244,
0.7871328592300415,
-0.4545941650867462,
0.8969642519950867,
-0.4053259491920471,
-0.6246362328529358,
-0.06345856189727783,
0.16547012329101562,
0.529839694499969... |
def get _ code _ special _ keys ( self, event, sep ='+') : code ='' if event. controldown ( ) : code + ='control'+ sep if event. shiftdown ( ) : code + ='shift'+ sep if event. altdown ( ) : code + ='alt'+ sep return code | [
0.31212368607521057,
-0.18845400214195251,
0.8881654739379883,
0.6435866355895996,
-0.7428632974624634,
0.4478425681591034,
-0.24183622002601624,
0.1117204949259758,
0.37762802839279175,
0.08483991026878357,
-0.8871098160743713,
-0.25593772530555725,
0.2548925578594208,
0.17894752323627472... |
def convert _ file _ names ( ) : try : confnames = listdir ( netconfdir ) except ioerror as ex : print " failed to list files in'% s': % s " ( netconfdir, ex ) else : for confname in confnames : if not confname. endswith ( '. conf') : continue if'\ \'in confname : old, new = confname, quote _ plus ( confname. replace (... | [
-0.116520956158638,
-0.5142956376075745,
0.7504218220710754,
-0.18669767677783966,
-0.09400678426027298,
-0.4307898283004761,
0.25346049666404724,
0.6326658725738525,
-0.7224621176719666,
0.9606392979621887,
-0.3033968210220337,
-0.6221295595169067,
0.1389153003692627,
0.7691428065299988,
... |
def fetch _ imgs _ files ( main _ img _ data _ uri, secondary _ imgs _ data _ uri ) : main _ image = none if main _ img _ data _ uri : try : with rq. urlopen ( main _ img _ data _ uri ) as response : data = response. read ( ) main _ image = contentfile ( data ) except : pass secondary _ imgs = [ ] for data _ uri in sec... | [
0.5647489428520203,
-0.40205320715904236,
0.5722699165344238,
-0.2905765771865845,
0.3234061896800995,
0.23451024293899536,
-0.41586437821388245,
-0.23619669675827026,
-0.6473238468170166,
0.0199767854064703,
0.7719523906707764,
0.3534851670265198,
-0.3422257900238037,
0.542525589466095,
... |
def get _ flowpath ( cursor, huc12, fpath ) : cursor. execute ( " " " select fid from flowpaths where huc _ 12 = % s and fpath = % s and scenario = % s " " ", ( huc12, fpath, scenario ), ) if cursor. rowcount = = 0 : cursor. execute ( " " " insert into flowpaths ( huc _ 12, fpath, scenario ) values ( % s, % s, % s ) re... | [
0.5479620695114136,
-0.018020933493971825,
0.6022420525550842,
0.5625418424606323,
0.37262260913848877,
0.015281674452126026,
1.0502849817276,
0.15149448812007904,
-0.1773599088191986,
-0.15439103543758392,
0.16249984502792358,
-0.8946080803871155,
-0.8542817831039429,
-0.1999177485704422,... |
def make _ population _ df ( ) : df _ pop = pd. read _ csv ('https : / / raw. githubusercontent. com / ratatoskragnarok / covid _ app / master / data / pop _ data / population. csv') df _ pop = df _ pop. dropna ( how ='all') return df _ pop | [
-0.6737698912620544,
0.27702435851097107,
0.42009037733078003,
0.14115849137306213,
-0.006636414676904678,
0.4520820379257202,
-0.05613157898187637,
0.5603269338607788,
-0.4128575623035431,
0.16738887131214142,
0.0087377754971385,
0.1586453765630722,
0.9185530543327332,
-1.5745664834976196... |
def get _ mixture _ and _ gt ( self, metadata, curr _ dir, target _ angle, curr _ window _ size ) : target _ pos = np. array ( [ far _ field _ radius * np. cos ( target _ angle ), far _ field _ radius * np. sin ( target _ angle ) ] ) random _ perturb = randomaudioperturbation ( ) # iterate over different sources all _ ... | [
-0.4718007743358612,
-0.615331768989563,
0.7537243366241455,
-0.6328895688056946,
0.1682692915201187,
0.28435057401657104,
0.2425679862499237,
0.0719035193324089,
-0.03973163664340973,
0.12864336371421814,
0.5029314756393433,
0.9833232760429382,
-0.425773024559021,
0.6980892419815063,
0.... |
def test _ add _ message ( self ) : # since we need to change the session to mimic logging in, # we need to use the changing - session trick : with self. client as c : with c. session _ transaction ( ) as sess : sess [ curr _ user _ key ] = self. testuser. id # now, that session setting is saved, so we can have # the r... | [
-0.1820291131734848,
0.8664537668228149,
0.4714970588684082,
0.09324217587709427,
1.0662552118301392,
0.6966190934181213,
0.04924531280994415,
-0.7207387089729309,
0.47176915407180786,
-0.9391660094261169,
-0.13241462409496307,
0.040533971041440964,
-0.4487552344799042,
0.5023510456085205,... |
def addnamevariant ( self, name _ variant ) : self. namevariants. append ( name _ variant ) | [
-0.9516692161560059,
-0.2893834114074707,
0.4734053611755371,
-0.38152045011520386,
-1.4321746826171875,
0.8566847443580627,
-0.9493427276611328,
-0.6289175748825073,
0.051914870738983154,
-0.011343223974108696,
-1.762934684753418,
-0.08452943712472916,
-0.019758310168981552,
-0.0646947696... |
def _ invokebackend ( target : str, params : object ) - > dict : try : ret = requests. post ( f " { define. quantumhubaddr } / { target } ", json = params ). json ( ) except exception : raise error. networkerror ( traceback. format _ exc ( ), moduleerrorcode, fileerrorcode, 1 ) if ret ['error'] > 0 : errcode = ret ['er... | [
-0.36259669065475464,
-0.08192790299654007,
1.0891786813735962,
-0.7182551622390747,
0.07853596657514572,
-0.7052164077758789,
-0.7488789558410645,
-0.0316212959587574,
-0.4678688645362854,
0.6676700711250305,
0.1852715164422989,
1.400411605834961,
-1.0912586450576782,
0.014098274521529675... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.