text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def _ evaluate _ for _ shape ( self ) : child _ eval = self. children [ 0 ]. evaluate _ for _ shape ( ) vec = pybamm. evaluate _ for _ shape _ using _ domain ( self. domains [ " tertiary " ] ) return np. outer ( vec, child _ eval ). reshape ( - 1, 1 ) | [
0.20266170799732208,
-0.5257530808448792,
0.47579488158226013,
-1.3698867559432983,
0.883192241191864,
-0.48375242948532104,
0.2592652440071106,
0.4604105055332184,
-0.5277724266052246,
-0.610089898109436,
-0.016828041523694992,
0.7762542963027954,
0.5940943956375122,
0.11237762868404388,
... |
def load _ data ( self ) : self. busy _ indicator ( ) qtwidgets. qapplication. processevents ( ) qtwidgets. qapplication. processevents ( ) try : self. spts _ clusters _ flag = spotsorclusters. getflag ( ) self. raw _ data _ fname = str ( qtwidgets. qfiledialog. getopenfilename ( none, " select raw data file to analyze... | [
-0.48229533433914185,
-0.27812841534614563,
0.6863921880722046,
-0.6676698923110962,
-0.33956179022789,
0.3805585205554962,
0.4455963671207428,
-0.21441881358623505,
0.4086737632751465,
-0.6885301470756531,
-0.4583442211151123,
0.05196331441402435,
0.5442854762077332,
0.5711484551429749,
... |
def clean ( ) : if path ('products'). exists ( ) : shutil. rmtree ('products') | [
0.37599337100982666,
-0.38188880681991577,
0.5581287741661072,
0.47626855969429016,
0.5014363527297974,
1.3987627029418945,
0.9740844964981079,
-0.6810005903244019,
0.20027302205562592,
0.7024981379508972,
-0.08011436462402344,
-0.12014282494783401,
-0.07052850723266602,
0.7965609431266785... |
def fullname ( self ) : if self. _ fullname = = " " : return self. username return self. _ fullname | [
0.39773568511009216,
0.024183910340070724,
0.4360668659210205,
0.3333675265312195,
-0.6833374500274658,
-0.17745615541934967,
0.39345741271972656,
0.06320301443338394,
0.9659987688064575,
-0.5126030445098877,
-0.0016712156357243657,
-0.38795357942581177,
-0.38294821977615356,
0.29846316576... |
def unfix _ mass _ centre ( self, result : af. result, mass _ prior _ model : af. priormodel ( mp. massprofile ) ) - > af. priormodel : if self. mass _ centre is not none : mass _ prior _ model. centre. centre _ 0 = af. gaussianprior ( mean = self. mass _ centre [ 0 ], sigma = 0. 05 ) mass _ prior _ model. centre. cent... | [
0.5863622426986694,
-0.8580638766288757,
0.5579140186309814,
-0.8861664533615112,
0.15815722942352295,
0.05072719231247902,
0.4314381182193756,
0.1929582953453064,
0.06333460658788681,
0.08410980552434921,
0.16100022196769714,
0.04241809993982315,
-0.5951957106590271,
0.6181425452232361,
... |
def test _ atomic _ hex _ binary _ max _ length _ 3 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ max _ length _ 4 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - maxlength - 4. xsd ", instance ... | [
0.020264023914933205,
0.5664295554161072,
0.4186353385448456,
0.7226563096046448,
-0.14518634974956512,
0.5257248282432556,
-0.9014447927474976,
0.16216975450515747,
0.36443793773651123,
0.1628538817167282,
-0.5208311676979065,
-1.017043948173523,
-0.2707569897174835,
0.008540550246834755,... |
def get _ similarity ( word _ list1, word _ list2 ) : # remove the duplicate ones words = list ( set ( word _ list1 + word _ list2 ) ) vec1 = [ float ( word _ list1. count ( word ) ) for word in words ] vec2 = [ float ( word _ list2. count ( word ) ) for word in words ] vec3 = [ vec1 [ i ] * vec2 [ i ] for i in range (... | [
0.6663177013397217,
0.5962919592857361,
0.9042308330535889,
-0.21037018299102783,
-0.032604724168777466,
-0.10283952951431274,
-0.20579445362091064,
0.5686999559402466,
-0.13909760117530823,
0.9101788997650146,
-0.5370416045188904,
0.5806026458740234,
-1.2687968015670776,
0.631255447864532... |
def _ _ init _ _ ( self, api _ key, is _ sandbox = false ) : self. api _ key = api _ key # the api key is needed to make any request if is _ sandbox : self. base _ url = " https : / / appsapi. edmodobox. com / % s / " % self. version else : self. base _ url = " https : / / appsapi. edmodo. com / % s / " % self. version... | [
-1.0766602754592896,
0.22098469734191895,
0.6073533892631531,
0.8481395840644836,
0.6025683283805847,
0.022580958902835846,
-1.4932986497879028,
0.7168082594871521,
0.25890466570854187,
0.22116459906101227,
-0.17658326029777527,
-0.14027833938598633,
0.0636855810880661,
1.439375877380371,
... |
def extract _ file ( file _ path ) : if os. path. isdir ( file _ path ) : return file _ path if tarfile. is _ tarfile ( file _ path ) : tmp _ dir = tempfile. mkdtemp ( ) destination = os. path. join ( tmp _ dir,'repo') tar = tarfile. open ( file _ path,'r : gz') tar. extractall ( destination ) tar. close ( ) return des... | [
0.8562082648277283,
0.49847403168678284,
0.43862980604171753,
0.09625180810689926,
0.18773207068443298,
0.3009586036205292,
0.714607834815979,
0.2945474088191986,
-0.12829481065273285,
0.3408944010734558,
0.4970982074737549,
-1.167851448059082,
0.3798981308937073,
0.07116124778985977,
-0... |
def chunks ( l, n ) : for i in range ( 0, len ( l ), n ) : yield l [ i : i + n ] | [
-0.28746387362480164,
0.5728985071182251,
0.39129555225372314,
-0.017833421006798744,
-0.16806411743164062,
0.5943106412887573,
-1.019998550415039,
-0.4482986330986023,
-0.38011443614959717,
-0.7051392793655396,
-0.6505395174026489,
-0.3429281711578369,
0.0986400693655014,
0.60941970348358... |
def test _ tools ( self, test _ json, repositories = none, log = none, test _ user _ api _ key = none, test _ user = " ephemeris @ galaxyproject. org ", parallel _ tests = 1, test _ all _ versions = false, client _ test _ config _ path = none, ) : tool _ test _ start = dt. datetime. now ( ) tests _ passed = [ ] test _ ... | [
0.08679700642824173,
0.25246694684028625,
0.49760013818740845,
-0.032631129026412964,
0.6872802376747131,
-0.2071170061826706,
0.6606034636497498,
-0.2291666716337204,
-0.5375311970710754,
0.19366270303726196,
0.15680111944675446,
-0.14059089124202728,
0.23783570528030396,
0.48656550049781... |
def test ( material, size, ta, tg ) : mat = { " steel " : 1, " aluminum " : 2 }. get ( material ) asf = computeasf ( mat, size, ta / 25. 4, tg / 25. 4 ) # we round to 6 significant digits here to avoid floating - point mismatches print round ( asf, 6 ), round ( computeprobfail ( mat, asf ), 6 ) | [
1.3220101594924927,
0.24045535922050476,
0.13329432904720306,
-0.20975619554519653,
0.09223765134811401,
-0.5319266319274902,
0.368929922580719,
-0.818210780620575,
-0.18396033346652985,
0.05506445840001106,
0.7519757151603699,
0.12407774478197098,
0.29946762323379517,
0.17894478142261505,... |
def test _ atomic _ qname _ min _ length _ 3 _ nistxml _ sv _ iv _ atomic _ qname _ min _ length _ 4 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - minlength - 4. xsd ", instance = " nistdata / atomic ... | [
0.42212292551994324,
-0.5452245473861694,
0.3628060519695282,
0.01288985088467598,
-0.48355019092559814,
0.3910384476184845,
-0.3960379660129547,
-0.6270471215248108,
0.6188121438026428,
0.21443462371826172,
-0.25836893916130066,
-0.3030274212360382,
-0.5424358248710632,
-0.652326226234436... |
def selectnode ( self ) : chosennode = rd. choice ( list ( self. nodes. keys ( ) ) ) self. introduceinfo ( ) self. nodes [ chosennode ]. tosend = self. informations [ - 1 ] self. nodes [ chosennode ]. send ( ) | [
-0.6206093430519104,
-0.04209243878722191,
0.31726375222206116,
-0.481728732585907,
0.47855615615844727,
-0.75115567445755,
0.46574413776397705,
-0.443046897649765,
-0.25892385840415955,
0.392811119556427,
-0.27474334836006165,
1.4269179105758667,
-0.6196513175964355,
-0.2492203265428543,
... |
def get _ package _ data ( ) : package _ data = {'' : ['*. xml'],'js': ['*. js'], locales _ directory : ['*'] } for directory in os. listdir ( locales _ directory ) : package _ data [ locales _ directory + '.'+ directory ] = ['*. json'] return package _ data | [
-0.48416954278945923,
-0.12892422080039978,
0.4983839988708496,
-0.5512617230415344,
-0.2910982370376587,
0.2685702443122864,
-0.4723745882511139,
0.5619161128997803,
0.16325710713863373,
0.38128137588500977,
-0.4699878394603729,
0.006022315006703138,
1.4649633169174194,
0.3431668579578399... |
def putch ( self, * args ) : return _ snap. trstr _ putch ( self, * args ) | [
-0.17484430968761444,
0.8167670369148254,
0.3405248522758484,
0.08730005472898483,
0.11355895549058914,
1.5482614040374756,
1.3284056186676025,
0.15137061476707458,
-0.8234128952026367,
0.23520752787590027,
-0.04022331163287163,
-0.5737611055374146,
-0.30014514923095703,
-0.796750009059906... |
def getlang ( self ) : return self. _ lang | [
0.2879941165447235,
0.11506874114274979,
0.16279976069927216,
0.4113665521144867,
0.011323030106723309,
0.8551144599914551,
0.9428815245628357,
-0.09876023977994919,
0.43738147616386414,
-1.502026915550232,
-0.08200933784246445,
0.2343825101852417,
0.2650464177131653,
-0.42713233828544617,... |
def equalgridcrossing ( self, c1, c2, n ) : if not isinstance ( n, int ) : raise typeerror ( " number of individuals to swap must be of type int " ) grid1, grid2 = self. communities [ c1 ]. grid, self. communities [ c2 ]. grid if n > grid1. size or n > grid2. size : raise valueerror ( " number of individuals must be le... | [
-0.5845386981964111,
-0.036889199167490005,
0.9380868673324585,
-0.5993651151657104,
-0.11172082275152206,
0.109247587621212,
0.11948803067207336,
-0.011654391884803772,
-0.259218692779541,
1.2755824327468872,
-0.2397068440914154,
0.451978474855423,
-1.1809732913970947,
0.2983973026275635,... |
def list _ arbitrary _ actions ( self ) : action _ items = list ( self. _ actions. items ( ) ) shuffle ( action _ items ) return action _ items | [
-1.5328418016433716,
-0.8632776737213135,
0.3483007848262787,
0.37905779480934143,
0.7311288714408875,
-0.020384836941957474,
-0.48126187920570374,
-0.4177504777908325,
0.9549638032913208,
0.0438687801361084,
-0.6105282306671143,
0.5530205965042114,
0.5907779932022095,
0.10305644571781158,... |
def get _ travel _ times ( tids, startdate ='1970 - 01 - 01 ', enddate ='3000 - 01 - 01 ', local _ tz ='us / pacific') : from _ zone = dateutil. tz. gettz ('utc') to _ zone = dateutil. tz. gettz ( local _ tz ) startdate = _ format _ date _ as _ string ( startdate, local _ tz ) enddate = _ format _ date _ as _ string ( ... | [
-0.16040974855422974,
-0.30282288789749146,
0.7449714541435242,
-0.20253555476665497,
-1.0436203479766846,
-0.40305349230766296,
0.001287825871258974,
-0.8126859664916992,
-0.9882653951644897,
1.9036039113998413,
-0.040523163974285126,
-0.014618268236517906,
-0.6506814956665039,
-0.6751748... |
def get _ one ( self, configfile _ uuid ) : check _ policy ( pecan. request. context,'get _ one') rpc _ configfile = objects. configfile. get _ by _ uuid ( pecan. request. context, configfile _ uuid ) return configfile. convert _ with _ links ( rpc _ configfile ) | [
-0.8012682795524597,
0.6774339079856873,
0.26302507519721985,
-0.25516438484191895,
0.764003336429596,
-0.22185495495796204,
0.26882702112197876,
0.4952511191368103,
-1.0614534616470337,
0.5880639553070068,
0.3720044493675232,
-0.0618608258664608,
-1.1713051795959473,
-0.12689943611621857,... |
def getinterface ( setting ) : return ( setting. getclass ( ), setting. getsubclass ( ), setting. getprotocol ( ) ) | [
-1.71274733543396,
0.5589093565940857,
0.5144413709640503,
0.012236731126904488,
0.17078691720962524,
-0.11733316630125046,
0.4454915523529053,
-1.5505578517913818,
-0.01831902004778385,
1.1148875951766968,
-0.655430793762207,
-0.2949603199958801,
-0.9129316806793213,
0.03922457993030548,
... |
def set _ log _ level ( level ='verbose') : configuration _ file ='/ etc / ssh / sshd _ config'# patterns before ='^ loglevel. * $'after ='loglevel { } '. format ( level ) sed ( configuration _ file, before, after, use _ sudo = true ) print ( green ('log level set to : { } '. format ( level ) ) ) | [
0.6426956653594971,
0.14045403897762299,
0.6766148805618286,
-0.2694702446460724,
0.32784906029701233,
1.2313079833984375,
-0.7303938865661621,
1.0733392238616943,
-1.1151148080825806,
0.23373782634735107,
-1.1561321020126343,
1.2361193895339966,
-0.33938950300216675,
0.5475844740867615,
... |
def addtoindex ( self, page, author ) : # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # xxx : should we add a link to the index, to the page itself? # seems like a template file header would be a better solution # all glossary pages would then ... | [
-0.6017259955406189,
-0.8882061839103699,
0.8526131510734558,
-0.8301935195922852,
0.1282956600189209,
-0.5139518976211548,
0.045611053705215454,
0.06733282655477524,
0.33986055850982666,
0.45848196744918823,
-0.04188170284032822,
0.27616116404533386,
-0.7763246893882751,
0.273212134838104... |
def get _ value ( self, name, kwargs = { }, default ='_ _ unspecified _ _ ', required = false ) : if ( name in kwargs ) : return kwargs [ name ] if ( name in self. defaults ) : return self. defaults [ name ] if ( default! ='_ _ unspecified _ _') : return default if required : raise exception ( " you are missing a requi... | [
-0.5573363304138184,
0.16050489246845245,
0.29063794016838074,
-0.19938349723815918,
-0.1581045240163803,
-0.43010595440864563,
-1.3454196453094482,
-0.44826269149780273,
-0.308889776468277,
0.35254910588264465,
-0.20738022029399872,
0.24035950005054474,
-0.41138148307800293,
0.36321845650... |
def binaryintervalindexsearch ( self, query, searchspace ) : left = 0 right = len ( searchspace ) - 1 mid = ( right - left ) / / 2 while true : if right - left < 2 : if right = = left : mid = right elif abs ( searchspace [ left ] - query ) < abs ( searchspace [ right ] - query ) : mid = left else : mid = right break if... | [
-0.4811195433139801,
-0.7770653963088989,
0.6629252433776855,
-0.015982870012521744,
-0.6819132566452026,
0.5253129601478577,
-0.5742021799087524,
-1.6025761365890503,
0.6782656908035278,
-0.016908610239624977,
-0.2739028036594391,
0.7686817049980164,
-1.857707142829895,
0.5168696641921997... |
def percentiles _ tree ( node, outcomes, percentiles = [ 1, 25, 50, 75, 99 ] ) : # extra _ info = { name :''. join ( [ str ( int ( p ) ) for p in numpy. percentile ( outcomes [ name ], percentiles ) ] ) for name in outcomes. keys ( ) } percentiles _ format = ( " { : > 3 } " * len ( percentiles ) ) extra _ info = { name... | [
0.3389919102191925,
0.2768636643886566,
0.8851104974746704,
-1.4255690574645996,
-1.241180419921875,
0.39635398983955383,
-0.5735936164855957,
-0.056581124663352966,
-0.09685210138559341,
0.790524423122406,
1.6337480545043945,
-0.21369807422161102,
-0.28350040316581726,
-0.1562450230121612... |
def test _ remove _ animals _ callable ( self ) : self. cell. animals. append ( self. herbivore ) self. cell. remove _ animals ( [ self. herbivore ] ) | [
-0.12294545769691467,
0.3258451521396637,
0.31098949909210205,
0.15398749709129333,
0.5040324926376343,
-0.7259082198143005,
-0.05603857338428497,
-0.3184299170970917,
-0.5791870355606079,
0.4000829756259918,
-0.5842230319976807,
0.25310376286506653,
0.09317514300346375,
-0.103537127375602... |
def get _ groups ( self, obj ) : groups = obj. groups. all ( ) return self. _ get _ pk ( groups ) | [
-0.19274015724658966,
1.2013540267944336,
0.2614327073097229,
0.30987876653671265,
0.5126632452011108,
-0.18527643382549286,
0.7058735489845276,
-1.267693042755127,
-0.09658022969961166,
0.09462510049343109,
0.6661653518676758,
-0.23534482717514038,
-0.64140784740448,
-0.37844157218933105,... |
def export _ statics ( self ) : dbmarshal. talk ('export _ statics') try : conn = self. _ _ get _ db _ connection ( ) cursor = conn. cursor ( ) statics = self. _ _ get _ statics ( ) for sproc in statics ['sprocs'] : cursor. execute ('show create procedure % s'% sproc [ 0 ] ) sproc _ info = cursor. fetchone ( ) f = open... | [
0.23327261209487915,
0.0813545361161232,
0.8624249696731567,
0.3191777467727661,
-0.14350135624408722,
0.2028142809867859,
0.6132431626319885,
-0.4291195571422577,
0.3117569088935852,
0.275139182806015,
-0.6476883888244629,
0.13064073026180267,
0.08823174238204956,
0.39425504207611084,
0... |
def helo ( self, name ='' ) : self. putcmd ( " helo ", name or self. local _ hostname ) ( code, msg ) = self. getreply ( ) self. helo _ resp = msg return ( code, msg ) | [
0.006576098036020994,
0.18040548264980316,
0.5943296551704407,
-0.08225832134485245,
0.3153764009475708,
-0.011921199969947338,
-0.23619578778743744,
0.3064447343349457,
-0.4281560480594635,
0.8543248176574707,
-0.9314831495285034,
-0.06594494730234146,
-1.1749846935272217,
0.5822880864143... |
def create _ train _ jtr ( trainfacts, tuples ) : instances = [ {'support': [ ],'questions': [ {'question': fact [ 0 ] [ 0 ],'candidates':'# / globals / candidates ','answers': [ {'text': fact [ 0 ] [ 1 ] } ] } ] # only add true facts for training ( data should be consistent with that ) } for fact in trainfacts if fact... | [
-0.7926570177078247,
0.38472145795822144,
0.376926451921463,
-1.0747140645980835,
-0.37593942880630493,
0.2747979760169983,
-0.20773179829120636,
0.45351147651672363,
-1.6397497653961182,
0.7940189838409424,
-0.05589733272790909,
-0.606566846370697,
0.4825413227081299,
-0.6191231608390808,... |
def div _ no _ nan ( x, y, name = none ) : with ops. name _ scope ( name, " div _ no _ nan ", [ x, y ] ) as name : if not tensor _ util. is _ tf _ type ( x ) and tensor _ util. is _ tf _ type ( y ) : # treat this case specially like divide ( ) does above. y = ops. convert _ to _ tensor ( y, name = " y " ) x = ops. conv... | [
-0.2984977066516876,
0.4609108567237854,
0.7944316267967224,
-0.11677151918411255,
-0.9496665596961975,
0.03379299119114876,
0.11000023037195206,
-0.8336954116821289,
-0.7575663924217224,
0.473906010389328,
-0.23043538630008698,
0.6442358493804932,
0.7236073613166809,
-0.13226017355918884,... |
def decimal _ fp ( self ) : sign = ( 1, ) if self. _ negative else ( 0, ) mantissa = tuple ( self. _ mantissa ) exponent = tuple ( str ( self. _ exponent ) ) return ( sign, mantissa, exponent ) | [
-0.2768639028072357,
-0.42890220880508423,
0.6274728775024414,
0.34448903799057007,
0.5718945860862732,
-0.7190163135528564,
-0.7290544509887695,
-0.0867949053645134,
-0.3030855357646942,
-0.42751073837280273,
-0.9088039994239807,
-1.0036107301712036,
-0.30896493792533875,
0.09715130925178... |
def _ _ radd _ _ ( self, other ) : op = " add _ single " if self. node and ( len ( self. attrs ) > 1 or cmds. attributequery ( self. attrs [ 0 ], node = self. node, at = true ). endswith ('3') ) : op = " add " elif not self. node and isinstance ( self. attrs, ( list, tuple ) ) : op = " add " if op = ='add': return _ cr... | [
-1.0275250673294067,
0.8165719509124756,
0.889596700668335,
0.49262580275535583,
0.15386883914470673,
0.9338271021842957,
-0.21380093693733215,
-0.09710928797721863,
0.9221490621566772,
0.4636097252368927,
0.3775348961353302,
0.009791006334125996,
-0.5791991949081421,
-0.08203382045030594,... |
def set _ local _ position ( self, vec ) : # todo : complete parameter documentation self. local _ position = _ convert2tvec3 ( vec ) | [
0.35571736097335815,
-0.821761965751648,
0.14152997732162476,
-0.27269840240478516,
-0.1179947555065155,
0.19963529706001282,
0.8134832382202148,
0.03267611190676689,
0.11592560261487961,
0.2899787425994873,
-1.4288218021392822,
0.14089331030845642,
-0.06726451963186264,
0.1165803372859954... |
def patch ( self, configfile _ uuid, patch ) : check _ policy ( pecan. request. context,'update') rpc _ configfile = objects. configfile. get _ by _ uuid ( pecan. request. context, configfile _ uuid ) try : cf = configfile ( * * jsonpatch. apply _ patch ( rpc _ configfile. as _ dict ( ), jsonpatch. jsonpatch ( patch ) ... | [
-1.0940780639648438,
-0.7836924195289612,
0.4661576747894287,
-0.8379807472229004,
-0.6131834983825684,
0.3368998169898987,
0.04410822317004204,
0.6821935772895813,
-0.6123597025871277,
0.44182607531547546,
-0.5329191088676453,
-0.25995010137557983,
-0.9936857223510742,
-0.4508644044399261... |
def list _ user _ pools ( nexttoken = none, maxresults = none ) : pass | [
-0.8186022043228149,
0.3903506100177765,
0.2288726419210434,
0.8178874850273132,
-0.06803864985704422,
-0.11456010490655899,
0.7670576572418213,
-1.3762470483779907,
1.1162171363830566,
-0.4305005371570587,
-0.47818535566329956,
1.4920357465744019,
-0.6400680541992188,
-0.7787163257598877,... |
def teardown ( self ) : rv = self. app. post ('/ weblab / login ', data = dict ( username ='any ', password ='password') ) self. assertequal ( rv. status _ code, 302, " login post with right pass does not return 302 " ) self. handler. stop ( ) | [
-0.00111838907469064,
-0.12838996946811676,
0.5829554796218872,
0.39417803287506104,
0.41047048568725586,
2.1388463973999023,
0.5164912939071655,
0.029161738231778145,
-0.22207951545715332,
-1.171898603439331,
-0.15943987667560577,
0.18566203117370605,
-0.5652689933776855,
-0.3657367825508... |
def _ _ eq _ _ ( self, other : object ) - > bool : if isinstance ( other, self. _ _ class _ _ ) : return other. pr _ number = = self. pr _ number return false | [
-0.4778502285480499,
-0.5580890774726868,
0.6680328249931335,
-0.053324613720178604,
1.0941176414489746,
1.0789337158203125,
-0.18103469908237457,
-0.4559553563594818,
1.4402574300765991,
-0.2395482212305069,
-0.6286917328834534,
0.7051225900650024,
-0.331241250038147,
-0.5656516551971436,... |
def get _ latex _ env ( directory ) : # modify jinja environment to work with latex files # http : / / eosrei. net / articles / 2015 / 11 / latex - templates - python - and - jinja2 - generate - pdfs latex _ jinja _ env = environment ( block _ start _ string ='\ block { ', block _ end _ string ='} ', variable _ start _... | [
-0.17602428793907166,
-0.890569269657135,
0.6917743682861328,
-0.6392483711242676,
-0.9451097846031189,
-0.11101223528385162,
-0.1931585967540741,
-0.3994366228580475,
-0.3021184504032135,
0.21169336140155792,
0.646112322807312,
0.7206716537475586,
0.21959616243839264,
0.263394832611084,
... |
def get _ url ( self ) : self. log. debug ('completed the ` ` ` ` _ find _ image _ link _ in _ flicker _ html ` ` method') url = false urldoc = singlewebdocumentdownloader ( url = self. url, downloaddirectory = " / tmp ", log = self. log, timestamp = 1, credentials = false ) if not urldoc : return url import codecs pat... | [
-0.3566686809062958,
-0.24907532334327698,
0.728150486946106,
-0.13802994787693024,
-0.3191565275192261,
-0.3200351297855377,
1.39704430103302,
0.7977156639099121,
-0.7964693307876587,
0.12741614878177643,
0.5120076537132263,
-0.3229602575302124,
-0.26442497968673706,
0.6928887963294983,
... |
def small _ config ( ) : config = { } config ['d _ ff'] = 32 config ['output _ dropout'] = 0. 1 config ['num _ experts'] = 2 config ['expert _ d _ ff'] = 33 config ['expert _ dropout _ rate'] = 0. 1 config ['jitter _ noise'] = 0. 1 config ['train _ capacity _ factor'] = 1. 0 config ['eval _ capacity _ factor'] = 1. 0 c... | [
0.2944623529911041,
0.5142560601234436,
0.7778374552726746,
-0.9299125671386719,
-0.9569128155708313,
-0.09084725379943848,
0.42688384652137756,
-0.14467601478099823,
-0.5733630061149597,
0.15388724207878113,
-1.2502654790878296,
-0.002745171310380101,
0.392251193523407,
0.6365923285484314... |
def format _ data ( in _ d ) : for i in in _ d : if type ( i ['musical _ pieces'] ) = = list : i ['musical _ pieces'] = format _ musical _ pieces ( i ['musical _ pieces'] ) if type ( i ['image _ link'] ) = = dict : i ['image _ link'] = format _ image _ link ( i ['image _ link'] ) if i ['performance _ duration'] : i ['p... | [
-0.8705578446388245,
-0.3734801113605499,
0.7723771929740906,
-1.0380280017852783,
-0.32758089900016785,
0.6882227063179016,
-0.2379305511713028,
0.23125271499156952,
0.3808610439300537,
0.09415841102600098,
0.4522382915019989,
1.0099976062774658,
0.18081343173980713,
0.7543966770172119,
... |
def save _ plots ( filepath, plot, class _ report, filenames ) : if not os. path. exists ( filepath ) : os. makedirs ( filepath ) plot. figure _. savefig ( filepath + " / " + filenames [ 0 ] ) df = pd. dataframe ( class _ report ). t. reset _ index ( ) df. to _ csv ( filepath + " / " + filenames [ 1 ] + ". csv " ) | [
0.10652918368577957,
0.22231297194957733,
0.25128233432769775,
0.6444766521453857,
1.255556344985962,
0.40561771392822266,
1.0999552011489868,
0.2671414911746979,
-0.9171811938285828,
-0.12286913394927979,
-0.38924315571784973,
0.16609054803848267,
0.11483484506607056,
-0.02114760689437389... |
def test _ remove _ stop _ words _ bad _ input ( self ) : bad _ inputs _ first = [ { }, ( ), none, 9, 9. 34, true ] bad _ inputs _ second = [ { }, ( ), none, 9, 9. 34, true ] expected = [ ] for bad _ input in range ( 0, 5 ) : actual _ 1 = remove _ stop _ words ( bad _ inputs _ first [ bad _ input ], bad _ inputs _ seco... | [
-0.29089808464050293,
-0.09625838696956635,
0.7649369239807129,
0.27113163471221924,
0.33642396330833435,
0.24600282311439514,
0.000970865017734468,
-0.40211495757102966,
-0.9802184700965881,
0.2573200762271881,
-0.8880071043968201,
-0.5485785007476807,
-0.5919406414031982,
0.3126197755336... |
def _ packs ( self, i, elements ) : for m in elements : yield self. pack ( i, m ) | [
-1.0194791555404663,
0.2346286028623581,
0.24652324616909027,
0.3124866485595703,
-0.5556135773658752,
0.3135291635990143,
0.26112452149391174,
-0.8619667291641235,
0.340383380651474,
-0.29805076122283936,
-0.32224392890930176,
-1.3554354906082153,
-1.2160106897354126,
0.631939709186554,
... |
def getname ( self ) : return self. _ name | [
-0.579397976398468,
-1.074144959449768,
0.3432619571685791,
-0.2154548317193985,
-0.47413578629493713,
0.6602898240089417,
0.10897460579872131,
-0.44771966338157654,
-0.0935296043753624,
-0.0020234386902302504,
-0.7235135436058044,
0.18703098595142365,
0.20544849336147308,
-0.3010006844997... |
def test _ invalid _ auth _ url _ v2 ( self ) : def fake _ do _ request ( * args, * * kwargs ) : resp = webob. response ( ) resp. status = http. bad _ request return fakeresponse ( resp ), " " self. mock _ object ( auth. keystonestrategy,'_ do _ request ', fake _ do _ request ) bad _ creds = {'username':'user1 ','auth ... | [
-0.6001781225204468,
-0.6225934624671936,
0.5286808013916016,
1.0933401584625244,
0.03438948839902878,
-0.06740527600049973,
-0.9760296940803528,
-0.12428922206163406,
0.06453066319227219,
-0.09940824657678604,
-0.23377907276153564,
0.6665397882461548,
0.4192628860473633,
-0.10011110454797... |
def abs ( x, name = none ) : # pylint : disable = redefined - builtin with ops. name _ scope ( name, " abs ", [ x ] ) as name : x = ops. convert _ to _ tensor ( x, name = " x " ) if x. dtype. is _ complex : return gen _ math _ ops. complex _ abs ( x, tout = x. dtype. real _ dtype, name = name ) return gen _ math _ ops.... | [
-1.0005214214324951,
-0.056597694754600525,
0.9215489029884338,
0.990755021572113,
-1.0771623849868774,
0.034077238291502,
0.2825319766998291,
-0.5175160765647888,
-0.002433707471936941,
0.46570828557014465,
-0.2979154586791992,
0.7741860151290894,
1.439959168434143,
-0.8228999376296997,
... |
def sequentialize ( inputs ) : # first get sorted list of unique characters in the input unique _ chars = sorted ( set ( inputs ) ) # generate the result list that we can fill in with values as we go result = [ none ] * len ( inputs ) counter = count ( ) for unique _ char in unique _ chars : current _ chars = filter ( ... | [
-0.8117570877075195,
0.4194754958152771,
0.5940293073654175,
0.020556755363941193,
0.3959265947341919,
-0.9769654273986816,
1.2508482933044434,
-0.06315485388040543,
0.46215811371803284,
-0.27303749322891235,
-1.4568603038787842,
0.6034927368164062,
-0.2727760076522827,
-0.0853890776634216... |
def run _ model ( self, config _ run _ edit _ model, dataloader, postprocessor ) : logging. info ( " editing the sentences and generating results. " ) log _ data = { # a dictionary storing information about the model _ run for logging purpose. " batches _ len " : [ ], " edit _ traces _ len " : [ ], " filtered _ candida... | [
0.1950756013393402,
0.2696464955806732,
0.7088582515716553,
-0.5374553799629211,
-0.04994307830929756,
-0.46222764253616333,
1.0575405359268188,
0.17470641434192657,
-0.853089451789856,
0.3229433000087738,
-0.5046632885932922,
0.4097200632095337,
0.2944875657558441,
0.5266143679618835,
0... |
def get _ etag _ hash _ from _ query ( queryset, sql = none, params = none ) : if not isinstance ( queryset, emptyqueryset ) : if sql is none : sql, params = queryset. query. sql _ with _ params ( ) sql = ( " select md5 ( string _ agg ( date _ modified : : text,'' ) ) " " from ( select date _ modified " + sql [ sql. fi... | [
0.04868577420711517,
0.5343993902206421,
0.6055490970611572,
-0.15726423263549805,
-0.7003538012504578,
0.07436303049325943,
-0.2968125641345978,
-0.33695974946022034,
-0.4182041585445404,
1.1546692848205566,
0.7266747951507568,
-0.1709357649087906,
0.8654543161392212,
0.3420610725879669,
... |
def header _ print ( s ) : # print ( clear _ screen ) # too much wasted space print ( " \ n \ n " ) print ( header _ style + " running " + bold _ style + s + header _ style + "... " + cancel _ style ) | [
0.23266643285751343,
-0.8492160439491272,
0.5786624550819397,
0.6895418167114258,
-0.6334168910980225,
-0.17373977601528168,
-0.1913120001554489,
-0.33954405784606934,
-0.08886396884918213,
0.33863040804862976,
0.5946639776229858,
1.0768260955810547,
-0.4726112186908722,
-0.494537681341171... |
def isreportdate ( self, firm, date ) : return date in self. report _ date [ firm ] | [
0.5163712501525879,
0.6214119791984558,
0.40275391936302185,
1.1244109869003296,
0.3420964479446411,
-0.2244536280632019,
-0.880510151386261,
-0.5842896699905396,
-0.2804349362850189,
-0.23188896477222443,
0.30518025159835815,
0.691338062286377,
-0.6327463388442993,
0.5338813662528992,
-... |
def has ( self, name, field ) : for bpm, fld in self. bpm : if bpm = = name and fld = = field : return true for cor, fld in self. cor : if cor = = name and fld = = field : return true return false | [
0.6179006099700928,
-1.2765231132507324,
0.48670172691345215,
-0.5238096117973328,
-0.003169627860188484,
0.6437358260154724,
-0.07749710977077484,
0.08041785657405853,
-1.0783368349075317,
-0.4252593219280243,
-0.6577455401420593,
0.1077745333313942,
-1.8982012271881104,
0.088843487203121... |
def modules _ to _ freeze ( self ) - > union [ nn. module, iterable [ union [ nn. module, iterable ] ] ] : return list ( self. backbone. children ( ) ) | [
-1.7463563680648804,
-0.13112212717533112,
0.3213598430156708,
0.2141454517841339,
1.6412475109100342,
1.05645751953125,
0.18562763929367065,
-0.8563584089279175,
0.9786611795425415,
0.4503702223300934,
-0.5053096413612366,
0.5011130571365356,
-0.5673984289169312,
0.39982855319976807,
-1... |
def has _ player _ won ( game _ board, symbol ) : winner _ sequence = symbol * 3 # check for horizontal wins for r in range ( len ( game _ board ) ) : row _ symbols ='' for c in range ( len ( game _ board [ r ] ) ) : row _ symbols + = game _ board [ r ] [ c ] if row _ symbols = = winner _ sequence : return true # check... | [
-0.44877713918685913,
-0.02625255286693573,
0.7992668747901917,
0.3445841670036316,
-0.41468438506126404,
-0.3134186267852783,
0.655458927154541,
0.6870997548103333,
-0.27028757333755493,
0.025544729083776474,
-0.5986533761024475,
-0.2822738587856293,
0.30779218673706055,
0.129909023642539... |
def _ _ getitem _ _ ( self, idx ) : ft = self. audio _ feat [ self. filenames [ idx ] ] if ft. shape [ 1 ]! = 20 : ft = np. transpose ( ft, ( 1, 0 ) ) if ft. shape [ 0 ] > self. frame _ length : ft = ft [ : self. frame _ length, : ] elif ft. shape [ 0 ] < self. frame _ length : ft = np. block ( [ [ ft ], [ np. zeros ( ... | [
-0.3711678087711334,
-0.6227946281433105,
0.5371904373168945,
-0.8917491436004639,
0.08539313822984695,
-0.9984254837036133,
0.10509736835956573,
-0.3553183674812317,
0.03009338118135929,
-0.09291315078735352,
0.17325244843959808,
0.7054725885391235,
0.137446790933609,
-0.17032141983509064... |
def test _ reevaluate _ centers ( ) : inputs = {'a': ( 4, 0, 0, 0 ),'b': ( 0, 4, 0, 0 ),'c': ( 0, 0, 4, 0 ),'d': ( 0, 0, 0, 4 ), } clusters = { ( 4, 4, 0, 0 ) : ['a ','b'], ( 0, 0, 4, 4 ) : ['c ','d'], } # the result is always deterministic from the input result = _ reevaluate _ centers ( clusters, inputs ) assert sort... | [
-0.3521016538143158,
-0.5252529978752136,
0.6300679445266724,
-0.1549399495124817,
0.8720811605453491,
-0.3368139863014221,
-0.03585512191057205,
-0.39137962460517883,
0.29643046855926514,
-0.24081330001354218,
-0.3688026964664459,
-0.25509414076805115,
-0.37871474027633667,
-0.04438199475... |
def actual _ state ( self ) : attr = self. _ meta ['state _ attribute _ name'] return getattr ( self, attr ) | [
-0.5546172857284546,
-1.0034531354904175,
0.38926413655281067,
0.08184441179037094,
-0.6276538968086243,
0.23245519399642944,
0.726793646812439,
-0.34209340810775757,
0.30157470703125,
0.45322805643081665,
0.8487681150436401,
-0.35211417078971863,
0.809603214263916,
0.10070637613534927,
... |
def create _ ciph _ dict ( alphabet, cipher _ alphabet _ no _ duplicates ) : final _ key = dict ( zip ( alphabet, cipher _ alphabet _ no _ duplicates ) ) return final _ key | [
-0.8739138841629028,
-0.5367565155029297,
0.4362274706363678,
-0.8325727581977844,
-0.4731360673904419,
0.26407191157341003,
0.7949123382568359,
0.36518245935440063,
-0.303699791431427,
1.314660668373108,
-1.6016565561294556,
-0.24154461920261383,
-0.9851837158203125,
0.4984728693962097,
... |
def _ histogram ( self, name : str, value : float, bucket _ tag : str, buckets : list [ int ], bucket _ unit : str ='', tags : dict [ str, str ] = none, documentation : str ='' ) : try : self. _ get _ metric ( phistogram, name, tags, documentation, buckets = buckets ). observe ( value ) except valueerror : pass | [
0.5581923127174377,
0.7354955673217773,
0.5503276586532593,
-0.6725782155990601,
0.0868520438671112,
-0.08699288964271545,
-0.33694401383399963,
-0.35680389404296875,
-0.8780243992805481,
0.08534688502550125,
0.00019619842350948602,
0.361532986164093,
0.6347414255142212,
0.216846764087677,... |
def uploadovf ( folderpath, vm, download ) : global esxpath args = get _ args ( ) host = args. host user = args. user pwd = args. password # requires ovftool to be installed bashcommand = " ovftool - - skipmanifestcheck - - nosslverify - - disableverification - - datastore = awc - 004 - - network ='mgmt'- - name = " + ... | [
0.40368887782096863,
-0.21704739332199097,
0.702756941318512,
0.060171570628881454,
0.40750470757484436,
0.159781813621521,
0.15204989910125732,
-0.1442471295595169,
-0.4439721405506134,
0.42063403129577637,
0.4186554551124573,
0.5633880496025085,
-0.2634871304035187,
-0.34602999687194824,... |
def getgausslegendre ( ndof ) : if ndof < 1 : raise valueerror ( " order must be positive " ) if ndof > 10 : raise valueerror ( " order is currently limited to 9 " ) if ndof = = 1 : return [ 1. 0000000000000000 ], [ 0. 5000000000000000 ] if ndof = = 2 : return [ 0. 5000000000000000, 0. 5000000000000000 ], \ [ 0. 211324... | [
1.1693722009658813,
0.33429238200187683,
1.126165509223938,
-1.2816410064697266,
0.25082847476005554,
-0.31827667355537415,
0.7634834051132202,
-0.6288175582885742,
-0.24141579866409302,
0.30203133821487427,
-0.4746098518371582,
0.6325962543487549,
0.2446359246969223,
0.8189204931259155,
... |
def check _ accuracy ( predictions, targets ) : correct = len ( [ i for i, j in zip ( predictions, targets ) if i = = j ] ) accuracy = correct / len ( targets ) return " { } / { } correct - { :. 1f } % accuracy ". format ( correct, len ( targets ), accuracy * 100 ) | [
-0.03349076583981514,
-0.9750247597694397,
0.5494729280471802,
-0.14912495017051697,
0.28542375564575195,
-0.13460007309913635,
0.44622400403022766,
0.4341108500957489,
-0.3102063238620758,
1.4560458660125732,
1.6911700963974,
0.4813133478164673,
0.3638036549091339,
0.3136487603187561,
0... |
def updatecategory ( self, increase _ by ) : self. genre _ index + = increase _ by if self. genre _ index < 0 : self. genre _ index = len ( self. movie _ genres ) - 1 elif self. genre _ index > = len ( self. movie _ genres ) : self. genre _ index = 0 self. label _ variables [ " genres " ]. set ( self. movie _ genres [ ... | [
-1.735910177230835,
-0.04823823273181915,
0.5648072361946106,
0.6009357571601868,
0.4059933125972748,
-0.05414445325732231,
0.10264623910188675,
0.3107161223888397,
-1.0411903858184814,
0.14436957240104675,
0.4942246377468109,
1.1331043243408203,
0.10995332151651382,
0.7744436264038086,
... |
def getallipv6accesslists ( self ) : query ='' conn = self. get _ connection ( ) headers = {'content - type':'application / json ','authorization':'a10 % s'% self. sessionid } conn. request ('get ', self. get _ path ( ) +'/'+ query, headers = headers ) response = conn. getresponse ( ) expected _ status = 200 errors = {... | [
-0.7822266221046448,
-0.8509215712547302,
0.6655876636505127,
0.02789967693388462,
-0.8474413156509399,
-0.7398450374603271,
-0.5773042440414429,
0.14347584545612335,
0.8444933295249939,
0.6883959770202637,
0.09235493093729019,
0.2130216360092163,
-0.27106258273124695,
0.06068020686507225,... |
def eax _ b ( self ) : return self [ 1 ] | [
0.06996970623731613,
0.1501363068819046,
0.3935265839099884,
0.723002016544342,
0.1340942233800888,
0.9309176206588745,
-0.14062286913394928,
0.09511959552764893,
1.1226211786270142,
0.578575074672699,
-0.17602185904979706,
0.8990470170974731,
-0.28705331683158875,
-1.0382270812988281,
0... |
def mscoco _ to _ headless _ umpm _ 2d ( detections2d ) : n = len ( detections2d ) assert detections2d. shape [ 1 ] = = 18 assert detections2d. shape [ 2 ] = = 3 result = np. zeros ( ( n, 12, 3 ) ) translation = [ # ( umpm - 2, coco ) ( 0, 5 ), ( 1, 6 ), ( 2, 7 ), ( 3, 2 ), ( 4, 3 ), ( 5, 4 ), ( 6, 11 ), ( 7, 12 ), ( 8... | [
-0.3484283983707428,
-0.6011702418327332,
0.7203555703163147,
-0.2812681794166565,
-0.39512503147125244,
-0.23951156437397003,
0.7430697083473206,
-0.6367279291152954,
0.33027946949005127,
0.25393643975257874,
-0.7495546936988831,
0.10558855533599854,
0.16405242681503296,
-0.31528988480567... |
def createboard ( width, height ) : a = [ ] for row in range ( height ) : a. append ( createonerow ( width ) ) return a | [
-0.5769465565681458,
0.543628990650177,
0.6517854332923889,
1.2622509002685547,
0.40576595067977905,
-0.5167479515075684,
-0.22082766890525818,
0.02115681581199169,
0.20346537232398987,
-0.8916114568710327,
-0.30406931042671204,
-0.8356675505638123,
-1.0741699934005737,
1.4524606466293335,... |
def export _ postprocessdict ( datadict ) : | [
0.0569266751408577,
-0.6736560463905334,
0.178537979722023,
-1.5086419582366943,
-1.5943326950073242,
-0.4552425742149353,
-0.2718924582004547,
-0.014792556874454021,
0.9244145154953003,
-0.046959903091192245,
-0.9930037260055542,
0.25209593772888184,
0.18745194375514984,
0.543662250041961... |
def _ _ init _ _ ( self, name, password, discount _ code, discount _ percent, role ) : self. name = name self. password = password self. discount _ cod = discount _ code self. discount _ percent = discount _ percent self. role = role | [
0.9139916896820068,
-0.43807339668273926,
0.5766221284866333,
0.4300768971443176,
0.15181925892829895,
0.2636319398880005,
-0.8611558675765991,
0.1927865743637085,
-0.2291051596403122,
0.3991495370864868,
-0.2934134304523468,
-0.41758036613464355,
0.32454970479011536,
0.5866170525550842,
... |
def find _ prefixsum _ idx ( self, prefixsum ) : assert 0 < = prefixsum < = self. sum ( ) + 1e - 5 idx = 1 while idx < self. _ capacity : # while non - leaf if self. _ value [ 2 * idx ] > prefixsum : idx = 2 * idx else : prefixsum - = self. _ value [ 2 * idx ] idx = 2 * idx + 1 return idx - self. _ capacity | [
-0.12762583792209625,
-0.5341407060623169,
0.8179445266723633,
0.5571898221969604,
-1.060913324356079,
-0.09587624669075012,
1.0221108198165894,
-0.6479665040969849,
0.6491538882255554,
-0.13166958093643188,
0.20197391510009766,
-0.06885434687137604,
-0.770248532295227,
-0.1466143429279327... |
def image _ to _ text ( image _ url ) : ocr _ lock. acquire ( ) image = imageprocessor. _ _ get _ image ( image _ url ) if image : image = imageprocessor. _ _ optimize ( image ) text = pytesseract. image _ to _ string ( image, lang = " eng " ) del image ocr _ lock. release ( ) return text else : ocr _ lock. release ( )... | [
-0.9284499287605286,
-0.16664190590381622,
0.44908252358436584,
0.24100267887115479,
-0.08139235526323318,
-1.1017420291900635,
0.2173621505498886,
-0.5763242244720459,
0.8066420555114746,
1.4271637201309204,
0.17492355406284332,
-0.16541552543640137,
-0.3560914695262909,
-0.34756779670715... |
def test _ list _ integer _ max _ length _ 4 _ nistxml _ sv _ iv _ list _ integer _ max _ length _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - maxlength - 5. xsd ", instance = " nistdata / list / ... | [
-0.5204684138298035,
-0.39037320017814636,
0.1587553173303604,
0.5038205981254578,
-0.9355360269546509,
-0.23584593832492828,
-0.3233659565448761,
-0.16817142069339752,
0.46751686930656433,
0.819640040397644,
-1.3917741775512695,
-0.30261513590812683,
-0.5293084979057312,
0.878685891628265... |
def new _ ones ( tensor, size, dtype = none ) : pass | [
-1.3598904609680176,
1.044515609741211,
0.2535243630409241,
1.088622808456421,
0.11005999147891998,
-0.8938847780227661,
0.7198780179023743,
-0.2324690818786621,
0.17113374173641205,
-0.17055170238018036,
-2.027228355407715,
0.3110007047653198,
0.19904187321662903,
-0.2249915450811386,
-... |
def get _ tc ( ) : load _ dotenv ( ) globus _ client _ id = os. getenv ( " globus _ client _ id " ) client = globus _ sdk. nativeappauthclient ( globus _ client _ id ) client. oauth2 _ start _ flow ( ) authorize _ url = client. oauth2 _ get _ authorize _ url ( ) print ('please go to this url and login : { 0 } '. format... | [
0.43660709261894226,
-0.7153521776199341,
0.682643473148346,
-0.01655079424381256,
-0.34670475125312805,
-0.15484558045864105,
-0.0973309651017189,
-0.4438725411891937,
-0.1913452297449112,
-0.166631281375885,
0.09694861620664597,
1.1018331050872803,
0.10314571112394333,
-0.712899625301361... |
def breadth _ traversal ( graph, root _ key ) : # track which edges of each vertex have been visited visited = [ ] # initialise the stack, pushing the root vertex onto the stack queue = [ ] queue. append ( root _ key ) while len ( queue ) > 0 : # get the item from the front of the queue vertex = queue [ 0 ] # if there ... | [
0.6172101497650146,
0.6564480662345886,
0.9837119579315186,
1.110432505607605,
0.3229355216026306,
-1.1341592073440552,
0.6027302742004395,
0.00984790176153183,
0.2115837186574936,
1.3850854635238647,
-0.5591955184936523,
1.0327552556991577,
-0.26652783155441284,
0.6743360161781311,
-0.2... |
def encode ( self, longurl : str ) - > str : s = " " for i in range ( len ( longurl ) - 1, - 1, - 8 ) : val = " ". join ( choices ( self. alp, k = 2 ) ) while ( val in self. s ) : val = " ". join ( choices ( self. alp, k = 2 ) ) self. s [ val ] = longurl [ max ( i - 7, 0 ) : i + 1 ] s = val + s # print ( s ) return s | [
-0.5388772487640381,
0.16330842673778534,
0.4510217607021332,
-0.17942161858081818,
-0.5152757167816162,
0.5786926746368408,
-0.06158795207738876,
-0.46086955070495605,
0.6935888528823853,
0.5250216126441956,
-0.6923704147338867,
0.4022749066352844,
0.14413391053676605,
-0.2614238262176513... |
def wordstoseed ( words ) : # concatenate the letters, convert them to numbers s = int (''. join ( [ str ( ord ( char ) - 96 ) for char in''. join ( words ). lower ( ) ] ) ) # random seeds have to be less than 2 ^ 32 - 1 # so we cut it down until it fits. dividing by seven seems to give good # " randomness ". while s >... | [
0.054552190005779266,
0.9590618014335632,
0.5654767751693726,
-1.4259333610534668,
-0.4217701852321625,
-0.5580955147743225,
0.7471279501914978,
-0.5600640773773193,
0.940743625164032,
0.3960056006908417,
-0.18017667531967163,
0.17903387546539307,
-0.8996995091438293,
0.2491530478000641,
... |
def _ get _ new _ bucket _ content ( self ) - > list [ float ] : costs = ( ( 1 if bucket. is _ request _ bucket ( ) else self. units _ per _ request ) for bucket in self. policy _ buckets ) return [ bucket. content - cost for bucket, cost in zip ( self. policy _ buckets, costs ) ] | [
-0.7776762843132019,
0.08009104430675507,
0.5312492847442627,
0.8196902871131897,
-0.04195837676525116,
0.6107996106147766,
-0.34187567234039307,
-1.0293892621994019,
-0.31863170862197876,
0.10444378852844238,
-0.285888671875,
-0.28206613659858704,
0.41754764318466187,
0.15947672724723816,... |
def entry _ point _ env ( args ) : if args. environment is none : raise valueerror ('environment config is not given') env _ config = load _ config ( args. environment ) env = luchador _ rl. env. get _ env ( env _ config ['typename'] ) ( * * env _ config ['args'] ) app = luchador _ rl. env. remote. create _ env _ app (... | [
0.1976635754108429,
-0.8844392895698547,
0.8214816451072693,
0.25100886821746826,
1.1125043630599976,
1.3221522569656372,
0.2910043001174927,
0.3254247009754181,
-0.48957836627960205,
0.8717076182365417,
0.19900909066200256,
0.8222286105155945,
-0.07774494588375092,
0.19626972079277039,
... |
def utm2latlon ( utm ) : utm =''. join ( e for e in utm if e. isalnum ( ) ) izonenum = int ( utm [ : 2 ] ) strzonelet = utm [ 2 ] dbleasting = float ( utm [ 3 : 9 ] ) dblnorthing = float ( utm [ 9 : ] ) # # check the zone number / letter are correct if izonenum < 1 or izonenum > 61 : print " invalid utm zone number! " ... | [
0.2142006903886795,
-0.24575473368167877,
0.6949763298034668,
-1.0518639087677002,
-0.5383066534996033,
-0.4886976182460785,
0.7580491304397583,
0.07134848088026047,
0.24621659517288208,
-0.1666797697544098,
-0.5713826417922974,
-0.4799991846084595,
-0.039530202746391296,
-0.37735295295715... |
def _ _ str _ _ ( self ) : # pragma : no cover return f'[ { self. full _ name } | { self. element } ] ' | [
-0.20403224229812622,
-1.6949344873428345,
0.3157936632633209,
-0.6733389496803284,
-0.2390412837266922,
0.699504554271698,
-0.38585519790649414,
-0.1095626950263977,
0.49971523880958557,
-0.17563322186470032,
0.3936271071434021,
0.6799452900886536,
0.5629212856292725,
0.6168252229690552,
... |
def find _ synonyms ( word ) : # is the word capitalized? capital = word [ 0 ]. isupper ( ) ending ='' # if the word ends with a weird symbol, take it away and save it as variable'ending'to add back later if word [ - 1 ] not in set ( string. ascii _ letters ) : ending = word [ - 1 ] word = word [ : - 1 ] # if the secon... | [
-0.09779871255159378,
0.7173954844474792,
0.9114406108856201,
0.13404597342014313,
-0.3926204442977905,
-0.9329929947853088,
0.03612591698765755,
0.450723797082901,
0.4059227406978607,
0.408020555973053,
0.20549604296684265,
0.3905199468135834,
-0.848741352558136,
0.8320825695991516,
0.6... |
def _ _ enter _ _ ( self ) : print ( f " \ nsetting up for { self. root } " ) self. failed _ suites = [ ] | [
0.539695680141449,
0.211684450507164,
0.2995540499687195,
0.2776375412940979,
0.5153666734695435,
0.4499405324459076,
0.517454981803894,
-0.3884902894496918,
-0.19690097868442535,
-0.177705317735672,
0.31116193532943726,
1.9138964414596558,
-0.2901894152164459,
0.6955457329750061,
0.7405... |
def get _ output _ contexts _ array ( self ) - > list [ dict [ str, any ] ] : return [ * self ] | [
-1.4332669973373413,
-0.7434829473495483,
0.5243350267410278,
0.23189668357372284,
0.15469537675380707,
-0.34062713384628296,
-0.07191649824380875,
-0.8802756071090698,
-0.1547047644853592,
0.05195625498890877,
-0.010624468326568604,
0.7471730709075928,
-0.4615512788295746,
0.5101544857025... |
def _ _ init _ _ ( self ) : super ( tree, self ). _ _ init _ _ ( ) self. type = ='tree'self. _ _ items = { } | [
-0.13717608153820038,
0.3226009011268616,
0.47917357087135315,
-0.08466870337724686,
0.3270811438560486,
0.22489316761493683,
-0.4568362832069397,
0.7948914766311646,
-0.17731797695159912,
-0.41961511969566345,
-1.0109707117080688,
0.02821996435523033,
-0.5356217622756958,
1.32485175132751... |
def onrowreordered ( self, event ) : parenttable = self. utilities. ancestorwithrole ( orca _ state. locusoffocus, [ pyatspi. role _ table ], [ pyatspi. role _ frame ] ) if event. source! = parenttable : return self. presentmessage ( messages. table _ reordered _ rows ) | [
0.8299744129180908,
-0.11734972894191742,
0.5308646559715271,
0.26349833607673645,
0.3707972466945648,
-0.8905080556869507,
0.4353584051132202,
-0.004539498593658209,
0.8232080936431885,
0.16799765825271606,
-0.013134362176060677,
0.3706821799278259,
0.7585608959197998,
0.9616294503211975,... |
def save _ conf ( hosts, file _ name ='conf. yaml') : with open ( file _ name,'w +') as _ f : _ f. write ( yaml. safe _ dump ( {'hosts': hosts }, default _ flow _ style = false ) ) return true | [
-0.24965667724609375,
-0.04827786982059479,
0.4480196535587311,
-0.032889820635318756,
0.35484352707862854,
0.35842156410217285,
0.25889718532562256,
1.2799113988876343,
-1.316644310951233,
0.49346834421157837,
-1.8167484998703003,
-0.8276652097702026,
0.04257642477750778,
0.77807044982910... |
def is _ unitary ( self ) : ans = true for kind in self. kind _ list ( ) : if is _ unitary _ gate ( kind ) is false : ans = false break return ans | [
-1.4193103313446045,
-0.05256624519824982,
0.7671056985855103,
0.7882972359657288,
0.22732417285442352,
0.3380829691886902,
0.37241461873054504,
0.3351581394672394,
0.045472852885723114,
0.055274564772844315,
-0.12672927975654602,
0.988109827041626,
-1.8636630773544312,
1.1499866247177124,... |
def print _ close _ docs ( doc _ em, corpus _ emb, df1 ) : fs _ dis = [ cosine ( corpus _ emb [ i ], doc _ em ) for i in range ( len ( corpus _ emb ) ) ] fs _ 0 = np. argsort ( np. array ( fs _ dis ) ) for i in fs _ 0 [ : 10 ] : print ( [ df1. title. iloc [ i ] + " - - - - " + df1. date. iloc [ i ] ] ) print ( " = = = ... | [
0.06995441764593124,
-0.5961838960647583,
0.9245648384094238,
0.1848788559436798,
0.10408762097358704,
0.8212695717811584,
0.8691909909248352,
-0.09584536403417587,
-0.9382452368736267,
0.2609962522983551,
0.9299405813217163,
0.3512691855430603,
-0.6856215000152588,
0.5586743354797363,
0... |
def request _ access ( ) : try : body = getcollaboratorrequestvalidator ( ). load ( request. json ) except marshmallow. exceptions. validationerror : raise searchspacerequestvalidationerror ( msg ='invalid email ', status = 400 ) first _ name = body. get ('firstname') last _ name = body. get ('lastname') email = body. ... | [
-0.7303194403648376,
0.27810177206993103,
0.9341142773628235,
0.15853753685951233,
0.325879842042923,
-0.43558505177497864,
0.1707206666469574,
0.09478449821472168,
0.2429107278585434,
-0.13676871359348297,
0.6558331847190857,
1.5857481956481934,
-0.6154261231422424,
0.335600346326828,
1... |
def installed _ repositories ( self ) : return gitotoolyaml ( gi = self. gi, skip _ tool _ panel _ section _ name = false, get _ data _ managers = true, get _ all _ tools = true ). tool _ list. get ( " tools " ) | [
0.4862494170665741,
0.17407000064849854,
0.2115318477153778,
-0.34202703833580017,
0.5380655527114868,
-0.03406169265508652,
0.15763717889785767,
-0.03442319482564926,
-0.13546746969223022,
0.715630054473877,
-0.3850875794887543,
-0.021292023360729218,
0.5084881782531738,
0.776917457580566... |
def analyzegradients ( self, x, y ) : m, _ = self. w. shape h _ init = np. zeros ( ( m, 1 ) ) dv _ num, du _ num, dw _ num, db _ num, dc _ num = self. computegradsnumslow ( x, y ) h0, a, h, p = self. train ( x, self. v, self. u, self. w, self. b, self. c, h _ init ) dv _ an, du _ an, dw _ an, db _ an, dc _ an = self. b... | [
0.6104602813720703,
0.2914637327194214,
0.9676569700241089,
-0.3064943253993988,
0.3651743233203888,
0.2531351149082184,
0.6402684450149536,
-0.8841521143913269,
-1.0618724822998047,
0.025686128064990044,
0.2783564031124115,
0.9171642661094666,
-0.04241929575800896,
0.6278597712516785,
0... |
def compute _ homography _ overlap ( self ) : source _ geom = self. source. handle. pixel _ polygon destination _ geom = self. destination. handle. pixel _ polygon # project using the homography vertices _ to _ project = destination _ geom. vertices for i, v in enumerate ( vertices _ to _ project ) : vertices _ to _ pr... | [
-0.2818033695220947,
0.20926028490066528,
0.6490141153335571,
0.6310291886329651,
-0.1746106892824173,
-0.0034283041022717953,
-0.04579656943678856,
0.40303659439086914,
-0.143899604678154,
0.9036967754364014,
-0.09493391215801239,
0.2489025741815567,
-0.07111504673957825,
-0.6342517733573... |
def parse _ extinst _ operands ( lexer, module, type _ id ) : set _ id = parse _ extinst _ set ( lexer, module ) lexer. get _ next _ token ( ',') instruction = parse _ extinst _ instruction ( lexer, set _ id ) lexer. get _ next _ token ( ',') operands = parse _ operand ( lexer, module,'variableid ', type _ id ) return ... | [
-0.552467405796051,
-0.6518517732620239,
0.47523394227027893,
-0.04602328687906265,
-0.8377827405929565,
-0.2284831702709198,
-0.8307749629020691,
0.09300145506858826,
0.9021872878074646,
1.7811126708984375,
-0.35086777806282043,
0.37194007635116577,
-1.1261165142059326,
0.0187217555940151... |
def validmoves ( self, selectedpiece ) : row, col = selectedpiece. row, selectedpiece. col validmoves = { } # left and right columns. left = col - 1 right = col + 1 if selectedpiece. color = = color. white or selectedpiece. isking : validmoves. update ( self. _ traverse _ left ( row + 1, min ( row + 3, rows ), 1, selec... | [
-0.9559401869773865,
0.22424177825450897,
0.6667050123214722,
-0.4829064607620239,
-1.302464246749878,
-0.5295055508613586,
0.5591290593147278,
-0.5897350907325745,
0.34044206142425537,
1.0234397649765015,
-0.3804401159286499,
0.14596153795719147,
-0.1886378675699234,
0.8020132184028625,
... |
def get _ redirect _ uri ( self, token, request ) : raise notimplementederror ( " subclasses must implement this function. " ) | [
-1.3933185338974,
-0.12387053668498993,
0.8154622912406921,
0.3480507433414459,
-0.1638413518667221,
0.4704113006591797,
0.014744330197572708,
0.11390186101198196,
-0.04080380126833916,
-0.8128699064254761,
0.17644734680652618,
0.45776739716529846,
0.5179048776626587,
-0.7025689482688904,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.