text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def keystone _ auth ( self, user, password, auth _ url, service, tenant _ name ) : # normalize uri to ensure / tokens is in it. if'tokens'not in auth _ url : auth _ url = auth _ url. rstrip ('/') +'/ tokens'creds = {'auth': {'passwordcredentials': {'username': user,'password': password, },'tenantname': tenant _ name, }... | [
-0.7273138761520386,
-0.5294973850250244,
0.6968193054199219,
0.640762209892273,
-0.6960302591323853,
-0.23661644756793976,
-0.9592776894569397,
-0.2547244429588318,
-0.2942279279232025,
-0.2776838541030884,
0.33687645196914673,
0.9578934907913208,
0.34704962372779846,
-0.1063668355345726,... |
def set _ import _ groups ( self, preset : str = none ) : if preset is not none : if preset in import _ presets : groups = import _ presets [ preset ] self. import _ groups = sorted ( groups, key = lambda grp : len ( grp [ 0 ] ), reverse = true ) | [
-0.5393794775009155,
0.8575382232666016,
0.5183566808700562,
-0.2205653339624405,
-0.12051231414079666,
-0.17273394763469696,
0.41942673921585083,
-0.40318623185157776,
-0.5465925335884094,
0.47945189476013184,
-0.6013606786727905,
1.208463191986084,
-0.6740319132804871,
0.4801868796348572... |
def fromyaml ( cls, yamlfile, cache, platforms, arches ) : with open ( yamlfile ) as y : config = yaml. safe _ load ( y ) return cls ( config, cache, platforms, arches ) | [
0.7488075494766235,
0.15281584858894348,
0.1363360583782196,
1.0276741981506348,
-0.7521684169769287,
0.053841859102249146,
0.41264817118644714,
0.5095484256744385,
0.23098288476467133,
0.32405176758766174,
-0.062480852007865906,
-0.3087484538555145,
0.17359164357185364,
0.0525559931993484... |
def is _ user _ online ( self, username : str ) - > bool : pass | [
-0.4432487487792969,
-0.18465080857276917,
0.48129698634147644,
1.7922731637954712,
-0.3075081408023834,
0.7824419140815735,
-0.4362002909183502,
0.593196451663971,
0.021694893017411232,
-0.04561059921979904,
-1.2715835571289062,
-0.11928306519985199,
-0.4561946392059326,
-0.43322050571441... |
async def webhook _ handle ( self, request ) : if request. headers. get ( " x - telegram - bot - api - secret - token " )! = self. _ webhook _ uuid : logger. warning ( " probably, a malicious request! " + request ) return web. response ( status = 403 ) update = await request. json ( loads = self. json _ deserialize ) s... | [
-0.2582055330276489,
-0.27031126618385315,
0.7083390355110168,
0.6520455479621887,
0.0291837677359581,
0.06969757378101349,
-0.6113412976264954,
-0.43853265047073364,
-0.07234092056751251,
0.37808406352996826,
0.09188126027584076,
-0.3069634437561035,
-0.5113011598587036,
-1.14450025558471... |
def truststore _ version ( self ) - > optional [ str ] : return pulumi. get ( self, " truststore _ version " ) | [
1.068058967590332,
-0.43698662519454956,
0.283523291349411,
-0.014141052961349487,
0.21966803073883057,
1.7275360822677612,
0.6495510935783386,
-0.4086587131023407,
0.5087295174598694,
1.1462150812149048,
-0.2621537148952484,
0.1907975673675537,
-0.1454017162322998,
-1.377335786819458,
-... |
def generate _ trajectory ( group _ membership, num _ levels = 4 ) : delta = compute _ delta ( num _ levels ) # infer number of groups ` g ` and number of params ` k ` from # ` group _ membership ` matrix num _ params = group _ membership. shape [ 0 ] num _ groups = group _ membership. shape [ 1 ] # matrix b - size ( g... | [
-0.1689339578151703,
0.22527660429477692,
0.8655849099159241,
0.6234986782073975,
-0.3319762349128723,
-0.11062527447938919,
0.9123873114585876,
-0.04820604622364044,
-0.2139207124710083,
0.2515033185482025,
-0.03807830438017845,
-0.11126047372817993,
-0.6137877702713013,
0.151995196938514... |
def winbio _ winbioenumdatabases ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " factor ", " storageschemaarray ", " storagecount " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value ) | [
-0.8029288649559021,
0.18966414034366608,
0.5103939175605774,
0.6394965648651123,
0.49500784277915955,
0.9399629235267639,
1.1747459173202515,
-0.22677825391292572,
0.21168866753578186,
0.41939079761505127,
-0.7627437114715576,
0.1012757420539856,
-1.7459352016448975,
1.412583827972412,
... |
def get _ pdf _ page ( pdf, page, out _ dir ) : output _ file = os. path. join ( out _ dir,'pdf. pdf') if os. path. exists ( output _ file ) and os. path. isfile ( output _ file ) and options. overwrite : # delete the file if it exists and we set - - overwrite os. remove ( output _ file ) logger. debug ( " { } exists a... | [
0.06363964825868607,
-0.05444521829485893,
0.8701901435852051,
-0.026708679273724556,
0.2434898316860199,
-0.40634721517562866,
0.5618870854377747,
-0.3415476679801941,
-0.2546129822731018,
0.0909399464726448,
1.2853705883026123,
-0.6132792830467224,
-0.5748446583747864,
-0.237362325191497... |
def dns _ spf ( self, domain ) : # for performance, check for most common case of txt first a = [ t for t in self. dns _ txt ( domain ) if isspf ( t ) ] if len ( a ) > 1 : raise permerror ('two or more type txt spf records found.') if len ( a ) = = 1 and self. strict < 2 : return a [ 0 ] # check official spf type first... | [
0.5915294885635376,
-0.025809897109866142,
0.7161935567855835,
-0.14896544814109802,
-0.5462959408760071,
-0.4766632914543152,
0.5801827311515808,
-0.006627116817981005,
0.5067102909088135,
0.1228148564696312,
0.2525257468223572,
0.63265460729599,
-1.0944321155548096,
-0.39282840490341187,... |
def _ _ getitem _ _ ( self, item ) : if item = = 0 : return self. x elif item = = 1 : return self. y else : raise indexerror ( " index out of range : vector 2d has x [ 0 ] and y [ 1 ] items. item calls greater than 1 " " not permitted " ) | [
-1.3673492670059204,
-0.28883790969848633,
0.6717719435691833,
0.7324317097663879,
-0.10551558434963226,
0.3344208300113678,
0.7011070847511292,
-1.4864147901535034,
-0.288232684135437,
-0.6570133566856384,
0.8988255262374878,
0.2627430558204651,
0.2888069748878479,
-0.5694480538368225,
... |
def test _ get _ worker _ containertask _ child ( self ) : for i in range ( len ( self. container _ task. subtasks ) ) : returned = self. container _ task. subtasks [ i ]. task. get _ worker ( ) self. assert _ ( returned,'no worker was returned') self. assertequal ( returned, self. worker,'worker retrieved was not the ... | [
0.6969394683837891,
0.4849855303764343,
0.6406700611114502,
0.6062881350517273,
0.9762901663780212,
0.49931004643440247,
0.3812119662761688,
-0.5432941317558289,
-0.1463671326637268,
-1.256484866142273,
-1.4429596662521362,
-0.46606147289276123,
0.014275748282670975,
-0.5807774662971497,
... |
async def get _ one _ payload _ info ( self, payload : union [ payload, dict ] ) - > mythicresponse : url = " { } { } : { } / api / v { } / payloads / { } ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version, str ( payload. uuid if isinstance ( payload, payload ) else paylo... | [
-1.0363255739212036,
-0.152328222990036,
0.6425197124481201,
-0.4540470242500305,
-0.061925724148750305,
-0.7626935243606567,
-0.3862455189228058,
-0.361646831035614,
0.27412545680999756,
-0.00455428333953023,
-0.041135773062705994,
-0.04724418371915817,
-0.14561104774475098,
-0.3140659630... |
def get _ title ( info : documentinformation ) - > str : try : title = info. title if title is not none : return title except attributeerror : pass try : return info ['/ title'] except keyerror : pass return'' | [
-0.09837264567613602,
0.31504008173942566,
0.4537653625011444,
0.37178027629852295,
0.27955251932144165,
-0.6248757243156433,
-0.921341598033905,
-1.0711393356323242,
-0.10050273686647415,
0.061950601637363434,
1.2207562923431396,
-1.148616909980774,
-0.43021339178085327,
-0.14960269629955... |
def reader ( self, fp, encoding ) : _, suffix = os. path. splitext ( fp. name ) if suffix = = '. gz': fp. close ( ) return gzip. open ( fp. name ) elif suffix = = '. json': return json. load ( fp ) elif suffix = = '. csv'or self. delimiter : return csvreader ( fp, encoding, delimiter = self. delimiter or ',') elif suff... | [
0.33147701621055603,
-0.6998505592346191,
0.6714298129081726,
-0.140022411942482,
-1.0529117584228516,
0.7445680499076843,
-0.6402685046195984,
-0.1075238287448883,
-0.013413479551672935,
-0.6578693389892578,
0.2886163294315338,
-0.028512176126241684,
0.6181337237358093,
-0.709364116191864... |
def _ create _ user ( self, email, password, is _ superuser, * * extra _ fields ) : now = timezone. now ( ) groups = extra _ fields. pop ('groups ', [ ] ) email = self. normalize _ email ( email ) user = self. model ( email = email, is _ active = true, is _ superuser = is _ superuser, date _ joined = now, * * extra _ f... | [
0.07290928810834885,
0.8838682770729065,
0.4325549900531769,
0.7470551133155823,
0.10491281747817993,
0.8761606216430664,
0.06486484408378601,
0.46524539589881897,
-0.5919703245162964,
0.21362155675888062,
-0.7332462668418884,
-0.7334979772567749,
-0.3665417730808258,
-0.8917863368988037,
... |
def write _ header _ sam ( infile, outfile, legal ) : goodcount, badcount = int ( 0 ), int ( 0 ) with open ( infile,'r') as fhin, open ( outfile,'a') as fhout : for line in fhin : if line. startswith ( " @ " ) : fhout. write ( line ) if not line. startswith ( " @ " ) and len ( line. split ( ) ) > 5 : if good _ cigar ( ... | [
0.16597658395767212,
-1.1424869298934937,
0.6563702821731567,
0.38118594884872437,
-0.5782296657562256,
-0.03887394070625305,
0.06700826436281204,
0.5000630617141724,
-0.49589547514915466,
0.3870669901371002,
-0.28877371549606323,
0.5047038793563843,
-0.2750738263130188,
-0.032433293759822... |
def _ _ del _ _ ( self ) : if hasattr ( self, " client " ) and isinstance ( self, client ) : self. client. close ( ) | [
0.48546481132507324,
-0.742836594581604,
0.6060037016868591,
-0.5535314679145813,
-0.8399866223335266,
0.6629094481468201,
0.7721399664878845,
-0.735515296459198,
0.6083258390426636,
-1.0754213333129883,
0.9233885407447815,
0.3605426549911499,
-1.1438950300216675,
0.7868361473083496,
0.0... |
def lnprob ( self, val ) : return self. rv. logpdf ( val ) | [
0.5490295886993408,
0.10904882103204727,
0.28843826055526733,
-1.031277060508728,
-0.6832465529441833,
-0.048742230981588364,
-1.1496998071670532,
-1.2414309978485107,
0.2321566492319107,
-0.09524659812450409,
0.8522596955299377,
-0.23936395347118378,
-0.2479759156703949,
-0.82490026950836... |
def transactions ( self, market _ id : str ) : return self. _ transactions ( market _ id, " transactions " ) | [
0.596192479133606,
0.5803391337394714,
0.0721958577632904,
0.029765132814645767,
0.21211419999599457,
-1.682909369468689,
-0.3825026750564575,
-0.7799468636512756,
0.3908315598964691,
0.3251579701900482,
-0.16667167842388153,
0.06029309704899788,
-0.14471742510795593,
-0.19225844740867615,... |
def load _ file _ into _ model ( filename, fmt = " rdfxml " ) : # create an empty model model = create _ empty _ model ( ) # create a parser try : parser = rdf. parser ( name = fmt ) except : print " failed to create rdf. parser. " return none # create a file : uri for the filename to load file _ uri = " file :. / % s ... | [
0.1833467185497284,
-0.27816998958587646,
0.514043390750885,
-0.5395588278770447,
0.3738325536251068,
0.555178701877594,
-0.5970413088798523,
0.3980627655982971,
-0.6960632801055908,
-0.8125092387199402,
-0.29412010312080383,
-0.8348191976547241,
-0.17183363437652588,
-0.6148016452789307,
... |
def scanvardetector ( pentadlist = [ ], debugmode = false ) : i = 0 for i in range ( len ( pentadlist ) ) : pentadlist [ i ]. text = pentadlist [ i ]. text. replace ( " getchar ( ) ", " 0 " ) pentadlist [ i ]. text = pentadlist [ i ]. text. replace ( " getchar ( ) ", " 0 " ) pentadlist [ i ]. text = pentadlist [ i ]. t... | [
-0.28071147203445435,
-0.5609894394874573,
0.9961629509925842,
0.10485116392374039,
-1.1549025774002075,
-0.7991669774055481,
-0.33108600974082947,
-0.09584220498800278,
-0.05456456542015076,
0.5843932628631592,
-0.5318706631660461,
0.03215231001377106,
-0.3506581485271454,
1.1980305910110... |
def _ _ init _ _ ( self, * args, * * kwargs ) : super ( sent, self ). _ _ init _ _ ( * args, * * kwargs ) self. kivy _ state = kivy _ state _ variables ( ) if self. kivy _ state. selected _ address = ='' : if app. get _ running _ app ( ). identity _ list : self. kivy _ state. selected _ address = app. get _ running _ a... | [
-0.4571093022823334,
-0.18190376460552216,
0.46933436393737793,
0.4892364740371704,
0.573284387588501,
-0.973271906375885,
-0.14888721704483032,
0.28872886300086975,
0.6315826177597046,
0.7323118448257446,
-0.1197676882147789,
0.2474139928817749,
-0.2773571014404297,
0.5819673538208008,
... |
def prime _ generator ( num ) : lst = [ ] i = 2 while len ( lst ) < num : if is _ prime ( i ) : lst. append ( i ) i + = 1 return lst | [
-1.0157837867736816,
0.8704918622970581,
0.4801971912384033,
0.3810187578201294,
-0.3777408301830292,
0.3189707100391388,
-0.17538772523403168,
0.48137763142585754,
0.692405641078949,
-0.5061952471733093,
-0.9800112247467041,
-0.485564261674881,
-1.0877254009246826,
0.6112337112426758,
-... |
def create _ connection ( boto _ ses : boto3. session. session, aws _ region : str, oss _ endpoint : str, test : bool = true, ) - > opensearch : # ensure that the endpoint doesn't have the ` ` https : / / ` ` part if oss _ endpoint. startswith ( " https : / / " ) : oss _ endpoint = oss _ endpoint. replace ( " https : /... | [
-0.5287942290306091,
-0.4035088121891022,
0.5613222122192383,
0.051219694316387177,
-0.2921813726425171,
-0.11027507483959198,
-0.6589682698249817,
-0.7430541515350342,
0.6081466674804688,
-0.48154962062835693,
0.3931601047515869,
-0.18023456633090973,
-0.29744601249694824,
-0.652116119861... |
def generate _ email _ server ( tmpdir ) : if not isinstance ( tmpdir, py. path. local ) : tmpdir = py. path. local ( tmpdir ) cert _ file, key _ file = generate _ cert _ and _ key ( tmpdir ) ctx = ssl. create _ default _ context ( ssl. purpose. client _ auth ) ctx. load _ cert _ chain ( cert _ file, keyfile = key _ fi... | [
0.12543033063411713,
-0.461103230714798,
0.5215008854866028,
-0.6068980693817139,
-0.6552456617355347,
0.33670464158058167,
0.7043315172195435,
0.06216525658965111,
0.6389015316963196,
-0.5885590314865112,
-0.8126420974731445,
0.3745216131210327,
0.07256961613893509,
0.2747102379798889,
... |
def myreshape ( x ) : return tf. reshape ( x, [ - 1, 28, 28, 1 ], name = " re " ) | [
-0.5646165013313293,
0.42331749200820923,
0.5670204162597656,
-0.13747374713420868,
-0.08183936029672623,
-0.28269898891448975,
-0.23356878757476807,
0.6572298407554626,
0.5396607518196106,
0.2017592042684555,
-0.10570614784955978,
-0.23117588460445404,
-0.539384663105011,
-2.2185320854187... |
def prepare _ mnist _ data ( filename ) : # in format label, pixels... data = spark. read. format ( " csv " ). option ('header ','false'). option ('inferschema ','true'). load ( filename ) data = data. withcolumnrenamed ('_ c0 ','label') # get columns that represent features features _ list = data. columns # pop last c... | [
-0.2684025764465332,
-0.985670804977417,
0.5249875783920288,
-0.1836411952972412,
-0.8044739961624146,
-0.2763706147670746,
-0.12380187958478928,
1.1704187393188477,
0.352151095867157,
-0.268178790807724,
-0.4903562664985657,
0.665677011013031,
0.5691142678260803,
-0.06715161353349686,
-... |
def _ _ iter _ _ ( self ) : # separately process each sentence and form a new one for sent in self. sents : new _ sent = [ ] for word in sent : new _ sent. extend ( self. grammer ( word ) ) yield new _ sent | [
-0.056370414793491364,
-0.8240414261817932,
0.5137868523597717,
-0.478348970413208,
-0.2643006145954132,
-0.1819327473640442,
-0.6467182636260986,
-0.3578353226184845,
-0.15159128606319427,
0.2538645267486572,
0.28287050127983093,
0.26589399576187134,
-0.7372267246246338,
1.055924773216247... |
def target _ attrs ( self, target _ attrs ) : self. _ target _ attrs = target _ attrs | [
-1.626086711883545,
-0.061717648059129715,
-0.19378623366355896,
-0.2716211974620819,
0.03571570664644241,
0.4802076518535614,
-0.09318053722381592,
0.7442367672920227,
-0.5852524638175964,
0.143645241856575,
-0.2870390713214874,
-0.14559955894947052,
0.280731201171875,
-0.8495495915412903... |
async def download _ payload ( self, payload : union [ payload, dict ] ) - > bytes : url = " { } { } : { } / api / v { } / payloads / download / { } ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version, str ( payload. uuid if isinstance ( payload, payload ) else payload [ "... | [
-0.9289793372154236,
0.18198417127132416,
0.5406264066696167,
-0.33039867877960205,
-0.4998077154159546,
-0.5042913556098938,
-0.5778809189796448,
-0.33926910161972046,
-0.11700237542390823,
0.05320129171013832,
-0.015061561018228531,
0.07205960899591446,
-0.6292863488197327,
-0.5116550922... |
def _ pointonfence _ ( self, point, fence ) : segmentpoint1 = ( fence. x, fence. y ) segmentpoint2 = ( fence. x2, fence. y2 ) intersection = pointmath. perpendicularintersection ( point, segmentpoint1, segmentpoint2 ) if pointmath. pointinsegment ( intersection, segmentpoint1, segmentpoint2 ) : return diagramdata. _ po... | [
1.1142610311508179,
-0.6675915122032166,
0.867950439453125,
0.08542727679014206,
-0.015263019129633904,
0.6235608458518982,
-0.6743889451026917,
-0.6083035469055176,
-0.4243902862071991,
0.5446862578392029,
0.7224409580230713,
-0.611497700214386,
-0.3584471642971039,
-0.4216890335083008,
... |
def run ( ) : verified _ us _ dollars = getdollars ( ) print'''you will be converting'' ', verified _ us _ dollars,'''dollars to euros. \ n'''print'''the current exchange rate is'' ', euro _ conversion _ rate,'' ', euros to $ 1. 00 us dollar.'''print " $ ", verified _ us _ dollars,'''converted to euros is'' ', convertd... | [
0.07388907670974731,
0.015505356714129448,
0.4735048711299896,
0.5266730785369873,
0.6565898656845093,
0.013972642831504345,
0.1752864122390747,
0.3195503354072571,
0.03453441336750984,
-0.15690022706985474,
-0.12049007415771484,
1.0919758081436157,
0.1446360945701599,
0.5935657620429993,
... |
def getaction ( self, gamestate ) : util. raisenotdefined ( ) | [
-0.4715360999107361,
-0.6126406788825989,
0.3818473815917969,
0.4310820400714874,
0.6535759568214417,
-0.3055453300476074,
-0.12795057892799377,
-1.6091444492340088,
0.470071941614151,
0.1362677961587906,
-0.35848918557167053,
1.2609204053878784,
0.37210869789123535,
-0.3625361919403076,
... |
def get _ wlst _ mode _ as _ string ( model _ context ) : return wlstmodes. from _ value ( model _ context. get _ target _ wlst _ mode ( ) ) | [
-0.5138322114944458,
-1.2261874675750732,
0.23194962739944458,
-0.9602848291397095,
-0.2639630138874054,
0.1386265754699707,
-1.200534701347351,
-0.9605829119682312,
0.261324405670166,
1.4654242992401123,
-0.17736996710300446,
0.5664915442466736,
0.2482748180627823,
-0.4305383861064911,
... |
def total _ no _ slice ( value ) : no _ 4160 = np. multiply ( np. nansum ( value [ 25 : 45, :, : ], axis = 0 ), ocean _ mask _ cesm ) ; no _ 4160 [ no _ 4160 = = 0 ] = np. nan no _ 8100 = np. multiply ( np. nansum ( value [ 75 : 95, :, : ], axis = 0 ), ocean _ mask _ cesm ) ; no _ 8100 [ no _ 8100 = = 0 ] = np. nan ret... | [
-0.5859787464141846,
-0.055290404707193375,
0.7090654373168945,
-0.41529354453086853,
-0.08000754565000534,
-0.13861703872680664,
1.3146624565124512,
-0.6704282164573669,
0.697593629360199,
1.0708948373794556,
-0.4234037697315216,
0.16536611318588257,
1.0946831703186035,
0.4139624238014221... |
def return _ line _ profile ( self, imdata, src, dst, lw, plotflag = false ) : linewidth = lw output = profile _ line ( imdata, src, dst ) # voxel values along specified line # plot profile line output vs. voxel sampled if plotflag : plt. figure ( ) plt. plot ( output ) plt. xlabel ('voxels') plt. ylabel ('signal') plt... | [
0.7149288654327393,
0.23205450177192688,
0.9776490330696106,
-0.4717923700809479,
-0.48249104619026184,
-0.11486748605966568,
-0.000012577281268022489,
-0.10277999192476273,
0.5233952403068542,
0.22863706946372986,
0.4265633523464203,
-0.03749873861670494,
0.014968732371926308,
-0.41992712... |
def execute _ query ( connection : mysqlconnection, query : str ) - > none : cursor = connection. cursor ( ) try : cursor. execute ( query ) connection. commit ( ) print ( " dbquery executed successfully " ) except error as e : print ( f " the error'{ e }'occurred " ) | [
0.36089253425598145,
0.11105417460203171,
0.49286729097366333,
0.22101841866970062,
0.9273777604103088,
0.6017223596572876,
-1.1162141561508179,
0.2726535499095917,
-0.3354768455028534,
0.5163605809211731,
0.6199087500572205,
-0.01002921536564827,
-0.5623653531074524,
-0.44920289516448975,... |
def calc _ topos ( t _ obs : np. ndarray, site _ name : str ) : # convert site _ name to lower case site _ name = site _ name. lower ( ) # only look up splined topos if t _ obs is passed and site name is not geocenter if t _ obs is not none and site _ name! ='geocenter': try : # try to find the spline for this site nam... | [
-0.4483841359615326,
0.6846639513969421,
0.79642653465271,
-0.3992219567298889,
-0.5292338728904724,
-0.06932937353849411,
0.2910972833633423,
0.12184540927410126,
0.4259933829307556,
0.4386691153049469,
-0.44912415742874146,
-0.4483214020729065,
1.125369668006897,
-0.32696568965911865,
... |
def sample _ hyperparameters ( num _ of _ sub _ experiments, grid ) : print ( " creating { } sub - experiments... ". format ( num _ of _ sub _ experiments ) ) created _ hps = { } while len ( created _ hps ) < num _ of _ sub _ experiments : hps = { } for hp _ name, hp _ values in grid. items ( ) : hps [ hp _ name ] = ra... | [
-0.17865020036697388,
0.7515376806259155,
0.5827770829200745,
0.07920687645673752,
-0.34378522634506226,
0.4885078966617584,
-0.1315898597240448,
-0.16114774346351624,
-0.5919605493545532,
0.34469884634017944,
-0.5000287890434265,
0.10167664289474487,
0.10397930443286896,
0.544329643249511... |
def _ _ init _ _ ( self, object _ id, subject _ id, predicate ) : self. object _ id = object _ id self. subject _ id = subject _ id self. predicate = predicate | [
1.2684762477874756,
-0.7169893980026245,
0.6082276701927185,
0.43857839703559875,
-0.17511118948459625,
0.5576230883598328,
-0.7355273365974426,
1.165634274482727,
-0.4098794758319855,
0.09079624712467194,
0.15135802328586578,
1.596785545349121,
0.45188435912132263,
0.01161094382405281,
... |
def grad ( self, a, b, c, d, e ) : grada = np. zeros ( a. shape ) gradb = np. zeros ( b. shape ) gradc = np. zeros ( c. shape ) gradd = np. zeros ( d. shape ) grade = np. zeros ( e. shape ) ai = [ np. eye ( len ( b ) ) ] for i in xrange ( self. predcount ) : ai. append ( np. dot ( a, ai [ - 1 ] ) + np. eye ( len ( b ) ... | [
0.11670952290296555,
0.30109143257141113,
0.9219079613685608,
-1.1076971292495728,
0.449989914894104,
1.0102484226226807,
0.27631980180740356,
0.25598350167274475,
-1.312744140625,
0.6623605489730835,
0.589486837387085,
0.48423662781715393,
0.019555428996682167,
0.40695875883102417,
0.11... |
def _ _ getitem _ _ ( self, index ) : img _ basename = self. list _ sample [ index ] path _ img = os. path. join ( self. root, img _ basename + '. jpg') path _ seg = os. path. join ( self. root, img _ basename +'_ seg. png') assert os. path. exists ( path _ img ),'[ { } ] does not exist '. format ( path _ img ) assert ... | [
-1.4643818140029907,
-0.3288346230983734,
0.8995199203491211,
-0.98552405834198,
-0.21349874138832092,
-0.5436956882476807,
0.5358209013938904,
-0.36703982949256897,
0.579632580280304,
0.790740966796875,
-0.19576933979988098,
-0.5068303346633911,
0.6772791147232056,
0.29681193828582764,
... |
def modularcausalattention ( d _ feature, n _ heads = 1, sparsity = none, dropout = 0. 0, max _ inference _ length = 2048, kernel _ size = 1, mode ='train') : n _ modules = n _ heads if sparsity is none else sparsity @ assert _ shape ( '... a - >... b') def processinglayer ( ) : assert d _ feature % n _ modules = = 0 r... | [
0.6195183992385864,
0.02522103488445282,
0.63344407081604,
-0.4346154034137726,
-0.6132306456565857,
-0.4912472069263458,
0.7338153719902039,
0.4762052595615387,
1.1010377407073975,
0.2752610146999359,
0.4406134784221649,
0.014634340070188046,
0.09920957684516907,
0.12429756671190262,
0.... |
def _ _ init _ _ ( self, number _ of _ agents ) : super ( ). _ _ init _ _ ( number _ of _ agents ) self. _ strat _ bind = dict ( ) | [
0.2302141636610031,
0.22394010424613953,
0.47357937693595886,
-0.22165381908416748,
-0.786563515663147,
-0.28778576850891113,
0.14525127410888672,
-0.2317424863576889,
0.11593159288167953,
0.13489313423633575,
-0.7011600732803345,
-0.3864154815673828,
0.17710961401462555,
0.428658783435821... |
def preprocess _ image ( img, means, stds ) : img = img. astype ( np. float32 ) img = ( img - means ) / stds return img | [
-0.1806301474571228,
1.038744330406189,
0.25986260175704956,
-0.7861428260803223,
0.03328792378306389,
0.5567418336868286,
-0.057449325919151306,
-0.421806663274765,
0.3435695171356201,
0.32964903116226196,
1.2372875213623047,
0.8626289367675781,
0.4184624254703522,
0.6226201057434082,
0... |
def filter _ id ( request, id : str = none ) - > httpresponse : if id is none : articles = _ _ default _ articles _ query ( request. user. is _ superuser ) logger. debug ( " no filter given " ) elif not id. isnumeric ( ) : articles = [ ] logger. error ( " filter is not a numeric " ) else : articles = _ _ default _ arti... | [
0.08109834790229797,
0.2038763463497162,
0.48121321201324463,
0.8876030445098877,
-0.97340989112854,
0.13209253549575806,
-0.13334813714027405,
0.6145792007446289,
0.2026847004890442,
-0.19452306628227234,
0.8535044193267822,
-0.0678621158003807,
-0.4388512969017029,
-0.0010961624793708324... |
def test _ check _ input _ invalid _ basevalues ( ) : with pytest. raises ( typeerror ) : mob. check _ inputs ( chmask, basevalues = 0, window _ idx ='invalid') | [
0.11726605147123337,
0.19418437778949738,
0.37423890829086304,
1.5903085470199585,
0.7726000547409058,
1.0229666233062744,
0.11041203141212463,
-0.1610751450061798,
-0.2880001366138458,
-0.662693440914154,
-0.10850691795349121,
0.5211619138717651,
-0.9909752607345581,
0.9352220892906189,
... |
def add _ segment ( self, new _ edge ) : if self. valid _ next _ segment ( new _ edge ) : self. segments. append ( new _ edge ) pass | [
-0.8165655136108398,
0.0814608782529831,
0.4160318970680237,
0.1604013442993164,
1.0699429512023926,
0.7035630345344543,
-0.5463572144508362,
0.023050295189023018,
0.507506251335144,
0.12957926094532013,
-0.07242486625909805,
-0.8422816395759583,
-0.6811932921409607,
0.1835344284772873,
... |
def auto _ assign _ uid ( self ) : map = uidmap. query. filter ( uidmap. used = = false ). order _ by ( asc ( uidmap. uid ) ). limit ( 1 ) [ 0 ] self. uid = map. uid self. gid = map. uid map. used = true # db. session. add ( self ) db. session. add ( map ) # db. session. commit ( ) | [
-0.988921046257019,
-1.2851005792617798,
0.5837000608444214,
0.05906406044960022,
0.4905523359775543,
0.34574469923973083,
1.086891531944275,
0.9451470971107483,
0.14727026224136353,
-0.4692862033843994,
0.2230585813522339,
0.29446184635162354,
-0.6222866773605347,
0.9873055219650269,
-0... |
def serialize ( self, root ) : if ( root = = none ) : return " { } " ; queue = [ root ] index = 0 while index < len ( queue ) : if queue [ index ]! = none : queue. append ( queue [ index ]. left ) queue. append ( queue [ index ]. right ) index + = 1 while queue [ - 1 ] = = none : queue. pop ( ) return " { % s } " % ', ... | [
0.13793151080608368,
-0.2625386416912079,
0.7387882471084595,
-0.400438129901886,
-0.8298585414886475,
-0.677790105342865,
-0.33510032296180725,
-0.43049418926239014,
0.4959864616394043,
0.6826484799385071,
-0.2513302266597748,
0.5102506875991821,
-0.07479508221149445,
0.9411068558692932,
... |
def plot _ confusion _ matrix ( cm, classes, normalize = false, title ='confusion matrix ', cmap = plt. cm. blues ) : if normalize : cm = cm. astype ('float') / cm. sum ( axis = 1 ) [ :, np. newaxis ] print ( " normalized confusion matrix " ) else : print ('confusion matrix, without normalization') # print ( cm ) plt. ... | [
-0.09455278515815735,
0.16798889636993408,
0.6570551991462708,
0.1348978579044342,
-0.7410715222358704,
0.0240949634462595,
1.135524868965149,
0.12065578252077103,
0.42435210943222046,
0.294864684343338,
1.0734190940856934,
0.47990986704826355,
-0.13875211775302887,
0.1991478055715561,
0... |
def get ( cls, batch _ prediction _ job _ id ) : batch _ job = super ( batchpredictionjob, cls ). get ( none, batch _ prediction _ job _ id ) batch _ job. id = batch _ prediction _ job _ id return batch _ job | [
0.3866412043571472,
-0.3261330723762512,
0.3323827087879181,
0.4643988609313965,
0.01223413273692131,
0.34319499135017395,
-1.052380919456482,
0.6080663800239563,
-0.903261125087738,
-0.44061478972435,
-0.3247130215167999,
1.28135085105896,
0.061714962124824524,
0.3295758068561554,
0.004... |
def baseline _ user _ item _ specific ( data, mean, set _ num = 0 ) : if mean = = " user " : flag = 1 inv _ flag = 0 else : flag = 0 inv _ flag = 1 # number of elements for which the baseline is computed num = max ( set _ num, data. shape [ flag ] ) # obtain r _ demeaned ( ratings minus global avg ) global _ mean = bas... | [
-0.22525806725025177,
0.6067197918891907,
0.8018163442611694,
0.6033759713172913,
-0.05847704038023949,
0.497249573469162,
0.08387013524770737,
0.7239269018173218,
-0.14233344793319702,
0.9055750966072083,
-0.5120769143104553,
1.3750219345092773,
-0.9201585054397583,
-0.5359221696853638,
... |
def get _ csv _ files ( isodate, form ) : for subform, info in form _ data [ form ]. items ( ) : dbf _ filename = make _ dbf _ filename ( isodate, info ['postfix'], form ) csv _ filename = make _ csv _ filename ( dbf _ filename, info ['db _ table'] ) csv _ dir = get _ public _ data _ folder ( form,'csv') csv _ path = o... | [
-0.22993704676628113,
0.12350619584321976,
0.47040683031082153,
0.5962445139884949,
0.24819307029247284,
0.5110612511634827,
-0.25356224179267883,
0.2492583990097046,
-1.093947172164917,
-0.9372264742851257,
0.049676548689603806,
-0.40893977880477905,
0.948245108127594,
0.4775314927101135,... |
def get _ random _ alnum ( length : int ) - > str : alnum _ chars = string. ascii _ letters + string. digits return''. join ( random. choice ( alnum _ chars ) for _ in range ( length ) ) | [
-0.661858856678009,
-0.855323314666748,
0.3525049686431885,
-1.2591910362243652,
-0.7305409908294678,
0.7404848337173462,
-0.1267402470111847,
-0.055082060396671295,
1.3685168027877808,
-0.1594298928976059,
-0.2418859750032425,
1.1088820695877075,
0.22519563138484955,
-1.0084530115127563,
... |
def get _ mapping _ value _ type ( tp : type ) - > type : if not is _ mapping _ type ( tp ) : raise valueerror ('get _ mapping _ value _ type ( ) called with non - mapping type.') return tp. _ _ args _ _ [ 1 ] | [
-1.0623902082443237,
0.49567094445228577,
0.5796723365783691,
0.34104248881340027,
0.23783992230892181,
0.7324123382568359,
0.7638342380523682,
-0.578102707862854,
0.26570209860801697,
0.35152921080589294,
0.27106451988220215,
-0.015130934305489063,
0.4687896966934204,
0.6152709126472473,
... |
def jinc _ bracewell ( rho ) : return ( _ math. pi / 2. 0 ) * jinc ( _ math. pi * rho, false ) | [
0.8703591823577881,
-0.6627554297447205,
0.31362712383270264,
0.6849508285522461,
-0.6065493822097778,
0.5064589381217957,
0.7216759324073792,
-1.618589997291565,
-0.25436052680015564,
-0.13429266214370728,
-0.1771164834499359,
0.1722002774477005,
-1.0495309829711914,
0.8090903162956238,
... |
def readgrammar ( rulesfile, lexiconfile, start, backtransformfile = none ) : global grammar, backtransform rules = ( gzip. open if rulesfile. endswith ( '. gz') else open ) ( rulesfile ). read ( ) lexicon = codecs. getreader ('utf - 8') ( ( gzip. open if lexiconfile. endswith ( '. gz') else open ) ( lexiconfile ) ). r... | [
0.46150079369544983,
-0.14831435680389404,
0.7400784492492676,
-0.1746954321861267,
-0.2284809648990631,
0.018870724365115166,
0.14197298884391785,
0.8108201026916504,
-1.2679928541183472,
0.1293584406375885,
0.09514643251895905,
0.9949278831481934,
-0.5511218309402466,
-0.2314792275428772... |
def note _ list _ no _ unisons ( self ) : pure _ notes = [ ] for score, path in zip ( self. scores, self. paths ) : parts = score. getelementsbyclass ( stream. part ) for part in parts : notelist = part. flat. getelementsbyclass ( ['note ','rest'] ) prev _ pitch = none for note in notelist : if not note. isrest and not... | [
-0.4294693171977997,
-0.7129497528076172,
0.731395959854126,
0.23447991907596588,
0.6955693364143372,
0.853100061416626,
0.9279686808586121,
-0.525967001914978,
0.28251340985298157,
0.23403437435626984,
-0.5317211747169495,
-0.09206642210483551,
-0.29132911562919617,
-0.004100803751498461,... |
def _ check _ cron ( self, now ) : for i in range ( 5 ) : #'*'should match no matter what if self. _ cron _ specs [ i ] = ='*': now [ i ] ='*'# todo : handle more interesting cron settings than just numbers and'*'return now = = self. _ cron _ specs | [
-0.17554664611816406,
-0.12669122219085693,
0.5076037645339966,
0.7958019971847534,
-0.14954592287540436,
-0.25146713852882385,
-0.1718035191297531,
-0.010686105117201805,
-0.782507598400116,
0.4775864779949188,
-0.10299023240804672,
0.020751647651195526,
-0.8855763673782349,
0.59297740459... |
def test _ save ( self ) : self. state. save ( ) self. assertisinstance ( self. state. created _ at, datetime. datetime ) | [
-0.46424049139022827,
0.5361975431442261,
0.4392377734184265,
0.2569469213485718,
1.3275432586669922,
0.7769424319267273,
-0.359285831451416,
-0.2051791101694107,
0.23950093984603882,
-0.27198517322540283,
-1.0673861503601074,
-0.7164419293403625,
0.4328897297382355,
-0.1470118910074234,
... |
def process _ payloads _ ipfuzzing _ octal ( self, payloads ) : # ip fuzzing ( octal ) if self. options. doo : resulting _ payloads = [ ] for payload in payloads : payload [ " payload " ] = self. process _ ipfuzzing _ octal ( payload [ " payload " ] ) resulting _ payloads. append ( payload ) return resulting _ payloads... | [
-1.256622314453125,
-0.2080906331539154,
0.5848149061203003,
-0.03870619088411331,
-0.0648752748966217,
-0.24561937153339386,
-0.3794138431549072,
-1.1674675941467285,
0.46814823150634766,
0.043187662959098816,
0.16376417875289917,
-1.1675711870193481,
-0.18116527795791626,
0.5224278569221... |
def check _ if _ exist ( string ) : global dead available _ inputs = [ " right ", " left ", " backwards ", " forwards " ] # directions the user can choose given _ input = string. lower ( ) if given _ input in available _ inputs : if given _ input = = " right " : # good choice! print ( " you rush into the nearby trees f... | [
-0.47861412167549133,
-0.5073322057723999,
0.8337998986244202,
0.6218631863594055,
-0.06382786482572556,
0.5977609157562256,
0.28308600187301636,
-0.12484121322631836,
0.04119190573692322,
0.1241798847913742,
-0.0930008813738823,
0.5456537008285522,
-0.2088077962398529,
0.34886598587036133... |
def move _ to _ center ( self ) : screen = qdesktopwidget ( ). screengeometry ( ) size = self. geometry ( ) self. move ( ( screen. width ( ) - size. width ( ) ) / 2, ( screen. height ( ) - size. height ( ) ) / 2 ) | [
-0.14104461669921875,
-0.26351040601730347,
0.5668185353279114,
0.49648362398147583,
-0.3187316656112671,
-0.005231291987001896,
0.1537066549062729,
-0.7349904775619507,
0.48247474431991577,
0.6382728815078735,
0.15363796055316925,
0.29425930976867676,
0.20918256044387817,
0.29320895671844... |
def user ( self ) : return self ['user'] | [
-0.5665954351425171,
-0.4860364496707916,
-0.06155698001384735,
0.5107755064964294,
0.07691621035337448,
0.667441725730896,
0.6078451871871948,
-0.4221775233745575,
0.4703109562397003,
-1.1926167011260986,
-0.38513022661209106,
0.368935227394104,
0.6854778528213501,
-1.0341265201568604,
... |
def _ read _ behav _ file ( self, file _ path, sep, index _ col, * * kwargs ) : df = pd. read _ csv ( file _ path, sep = sep, index _ col = index _ col, * * kwargs ) df. index = [ str ( i ) for i in df. index. tolist ( ) ] return df | [
0.026869941502809525,
0.036541324108839035,
0.42755937576293945,
0.16604682803153992,
0.9767591953277588,
0.09569759666919708,
0.028522895649075508,
0.5950963497161865,
-0.9336626529693604,
-0.16227267682552338,
1.0106444358825684,
1.092943787574768,
0.05053672939538956,
-1.565430164337158... |
def average _ reward ( benchmark _ data, episodes = 0 ) : if not isinstance ( benchmark _ data, list ) : benchmark _ data = [ benchmark _ data ] array = np. array ( [ experiment _ data ['results'] ['episode _ rewards'] [ - episodes : ] for experiment _ data in benchmark _ data ] ) return array. mean ( ), array. std ( ) | [
-0.38199305534362793,
0.061861131340265274,
0.3582707643508911,
-0.4561629593372345,
0.7624492645263672,
0.13805405795574188,
-0.6459736227989197,
0.611050009727478,
-0.2259027659893036,
1.7900333404541016,
0.2077658325433731,
1.4225916862487793,
-0.5363459587097168,
-0.028358852490782738,... |
async def get _ file ( self, file _ id ) : json = await self. api _ call ( " getfile ", file _ id = file _ id ) return json [ " result " ] | [
-0.4244174659252167,
0.6906676888465881,
0.17465904355049133,
0.2526220381259918,
1.5064853429794312,
-0.9629411101341248,
-1.0156607627868652,
-0.07529879361391068,
-0.6500117778778076,
-0.42979270219802856,
0.14436101913452148,
0.6182968616485596,
-0.5338017344474792,
0.6452850699424744,... |
def atomic _ streamed _ file _ process ( in _ path, out _ path, process _ func ) : with open ( in _ path,'r') as in _ file, open ( out _ path + '. temp ','w') as out _ file : success = process _ func ( in _ file, out _ file ) if success : if os. path. exists ( out _ path ) : os. chmod ( out _ path, s _ iwusr | s _ irea... | [
1.1258255243301392,
-0.18506814539432526,
0.7701154947280884,
0.28743335604667664,
-0.35510769486427307,
0.020833948627114296,
0.6830063462257385,
0.4514911472797394,
-0.6052789688110352,
0.8817914128303528,
0.6535800695419312,
0.834647536277771,
-0.03349661827087402,
-0.2501808702945709,
... |
def setup _ superpanel ( self ) : self. superpanel = false self. subpanels = set ( ) if self. data [ " genes " ] : if " panel " in self. data [ " genes " ] [ 0 ] : self. superpanel = true self. subpanels. update ( [ ( gene [ " panel " ] [ " id " ], gene [ " panel " ] [ " name " ], gene [ " panel " ] [ " version " ] ) f... | [
0.33358997106552124,
-0.31218859553337097,
0.6491100788116455,
-1.111506462097168,
-0.21679285168647766,
0.2596105635166168,
-0.8661041855812073,
0.30465495586395264,
-0.6029533743858337,
-0.1959455907344818,
-1.0005245208740234,
0.7362412214279175,
-0.6430638432502747,
0.6579280495643616,... |
async def metadata ( self, path, revision = none, * * kwargs ) : if path. is _ dir : return ( await self. _ metadata _ folder ( path ) ) return ( await self. _ metadata _ file ( path, revision = revision ) ) | [
-0.12583789229393005,
0.47338828444480896,
0.4483543038368225,
0.6181102395057678,
-0.09305655211210251,
-0.06793925911188126,
-0.8338308930397034,
-0.19328096508979797,
-0.22082220017910004,
0.1980268806219101,
0.919806957244873,
0.6919765472412109,
0.14943668246269226,
-0.251091420650482... |
def use _ discriminator _ logits _ layer ( block _ conv, flatten _ layer, logits _ layer, params ) : print _ obj ( " \ nuse _ discriminator _ logits _ layer ", " block _ conv ", block _ conv ) # set shape to remove ambiguity for dense layer. block _ conv. set _ shape ( [ block _ conv. get _ shape ( ) [ 0 ], params [ " ... | [
-0.3248896598815918,
-0.5984112024307251,
0.7428030967712402,
-0.196607306599617,
0.16282029449939728,
-0.5186716914176941,
0.09105296432971954,
0.07580310106277466,
0.08012062311172485,
-0.26762786507606506,
-0.021842708811163902,
0.6718107461929321,
-0.545051634311676,
0.0762122124433517... |
def _ shell _ in ( self, host, username, keyfile ) : self. ssh. connect ( host, username = username, key _ filename = keyfile ) # alternate for key or password login #... | [
-0.33832499384880066,
-0.5426123738288879,
0.5226168036460876,
0.5816470384597778,
-0.5243372321128845,
1.423898458480835,
-0.6601337194442749,
0.7472857236862183,
-1.5678848028182983,
0.02783655747771263,
-0.5342614054679871,
0.20987312495708466,
-0.24341709911823273,
0.03677400201559067,... |
def store _ olst ( self, gname, lst ) : self. olst. append ( ( gname, lst ) ) | [
-0.5172821283340454,
-0.1771206259727478,
0.23123452067375183,
-1.0590934753417969,
-0.17094510793685913,
0.9073353409767151,
-1.5175230503082275,
-0.18153950572013855,
0.38373368978500366,
0.3891359269618988,
-1.87269926071167,
0.2955835461616516,
-0.4172276556491852,
-0.03743240237236023... |
def _ wait _ until _ connected ( self, interfaces ) : res = none for iface in interfaces : retry = 0 print ( f " connecting to { iface } ", end = " ", flush = true ) while ( not self. _ interface _ up ( iface ) ) and retry < 50 : time. sleep ( 0. 3 ) retry + = 1 print ( ". ", end = " ", flush = true ) if self. _ interf... | [
-1.3136229515075684,
0.6584815382957458,
0.546877920627594,
0.2763478457927704,
-0.3978467881679535,
0.49533990025520325,
0.41605329513549805,
-1.1823256015777588,
-0.15893900394439697,
0.1658230721950531,
0.21766844391822815,
-0.4904966950416565,
-1.6195616722106934,
-0.09057366102933884,... |
def set _ scenario ( self, s ) : self. s = s self. cols = [ chr ( x ) for x in range ( ord ('a'), ord ('a') + self. s. house. roof _ columns ) ] self. rows = range ( 1, self. s. house. roof _ rows + 1 ) self. set _ fragility _ thresholds ( s. fragility _ thresholds ) self. s. house. clear _ sim _ results ( ) | [
-0.22737444937229156,
0.6439536809921265,
0.2354457676410675,
0.6399822235107422,
-0.19604434072971344,
-1.009190320968628,
0.21421141922473907,
0.39584076404571533,
0.08574657887220383,
-0.14219698309898376,
-0.8354438543319702,
0.08919412642717361,
0.5046237111091614,
0.132358118891716,
... |
def large _ poisson ( lam, thresh = 1e6 ) : large = lam > thresh small = ~ large # use normal approximation if the number of photons is large n = np. zeros ( lam. shape ) n [ large ] = np. round ( lam [ large ] + np. random. normal ( size = np. sum ( large ) ) * np. sqrt ( lam [ large ] ) ) n [ small ] = np. random. po... | [
0.5045161843299866,
0.8883309364318848,
0.6602721214294434,
-1.4910407066345215,
-0.34079548716545105,
-0.14559228718280792,
-0.3889000713825226,
-0.33812662959098816,
1.298189640045166,
-0.6035833358764648,
-0.11990582942962646,
-0.16963857412338257,
0.10540525615215302,
-0.18205201625823... |
def _ run _ once ( self ) : try : metrics = self. queue. get ( timeout = 10 ) if metrics is not none : self. logger. debug ( " publishing metrics : % s " % \ metrics. serialize ( ) ) self. publisher. publish ( [ metrics ] ) self. channel. complete ( [ metrics ] ) except empty : pass except : self. logger. warn ( " nann... | [
0.36256280541419983,
0.47261568903923035,
0.3253856897354126,
-0.6195316314697266,
1.2708877325057983,
0.27411890029907227,
0.2863693833351135,
-0.5519241690635681,
-0.7612457275390625,
-0.052025385200977325,
0.5099378824234009,
0.3226609528064728,
-0.752909243106842,
0.781919538974762,
... |
def convolution ( input _ tensor, weights _ dict, strides, padding, name ) : weights = weights _ dict [ name ] ['weights'] layer = tf. keras. layers. conv2d ( filters = weights. shape [ 3 ], kernel _ size = weights. shape [ 0 : 2 ], name = name, strides = strides, padding = padding, use _ bias = true if " bias " in wei... | [
0.7621930837631226,
-0.23626714944839478,
0.30092087388038635,
-0.19371792674064636,
-1.0183990001678467,
0.38559839129447937,
-0.7691669464111328,
0.04095775634050369,
-0.723729133605957,
0.6585240960121155,
0.1344318985939026,
0.26335999369621277,
0.4546060562133789,
-0.080906443297863,
... |
def json _ init _ state _ for _ manager ( name _ list, level _ js, initial _ p _ and _ a _ position _ list ) : players = [ ] adversaries = [ ] for i in range ( len ( name _ list ) ) : name = name _ list [ i ] players. append ( { " type " : " player ", " name " : name, " position " : initial _ p _ and _ a _ position _ l... | [
-1.1970010995864868,
-0.9531913995742798,
0.5850682854652405,
-0.9176260232925415,
-0.5749083757400513,
-0.587516188621521,
-0.34823480248451233,
-0.1940840482711792,
-0.07635091990232468,
0.9237304329872131,
-1.0761072635650635,
0.1684393286705017,
0.06552446633577347,
0.7474634051322937,... |
def remove _ edge ( self, edge ) : edge. db _ element. delete ( ) | [
-0.5005518198013306,
0.6166839599609375,
0.22852833569049835,
0.2574279308319092,
0.33837711811065674,
0.5371190905570984,
-0.2783852219581604,
1.2919175624847412,
0.3186718821525574,
0.719692587852478,
-0.3508409857749939,
-0.5232135653495789,
-1.3903003931045532,
0.7830137610435486,
0.... |
def namelist ( ) : name = ( open ( '. / resources / names. txt ','r'). read ( ) ) names = re. findall ( r'\ w + ', name ) name _ counts = counter ( names ) return name _ counts | [
-0.06865657866001129,
-0.699770450592041,
0.5217402577400208,
-1.3544514179229736,
-0.40324875712394714,
0.47139772772789,
-0.26408860087394714,
0.3651072680950165,
-0.5130759477615356,
0.7656115293502808,
-1.6154744625091553,
-0.799943208694458,
0.19334185123443604,
0.7775611281394958,
... |
def rm _ caption _ special _ tokens ( caption, word _ map ) : rev _ word _ map = { v : k for k, v in word _ map. items ( ) } return [ tok for tok in caption if not ( tok in { word _ map [ token _ start ], word _ map [ token _ end ], word _ map [ token _ pad ] } or rev _ word _ map [ tok ]. startswith ( " _ " ) ) ] | [
-0.40365007519721985,
-0.8591170310974121,
0.6089657545089722,
0.15603475272655487,
-1.010553240776062,
0.24120119214057922,
-0.8299529552459717,
0.876519501209259,
0.06481320410966873,
0.4814176857471466,
-0.8139978051185608,
1.2311136722564697,
0.20633704960346222,
-0.2096341848373413,
... |
def read ( self ) : return self. _ get _ data ( self. _ elements. values ( ) ) | [
-0.9858494400978088,
-0.8560666441917419,
0.26346203684806824,
-0.5185309648513794,
-0.23237846791744232,
0.5550531148910522,
-0.8841438293457031,
-0.6741657853126526,
-0.048767101019620895,
-1.2269446849822998,
0.12898433208465576,
0.7172254323959351,
-0.10180331021547318,
-0.515350937843... |
def get _ predecessors ( self, u ) : return self. predecessors. get ( u, [ ] ) | [
-1.0741556882858276,
0.7843165993690491,
0.5290231108665466,
0.827667236328125,
-0.40930241346359253,
-0.16735367476940155,
-0.786913275718689,
0.14628712832927704,
0.30980274081230164,
0.15365681052207947,
-1.2576848268508911,
0.3490878939628601,
-0.6423547863960266,
0.4108666479587555,
... |
def _ init _ file ( self, filef : str ) - > none : with open ( filef,'r') as f : self. all = f. read ( ) self. prolix = scan ( self. all ) self. featured = add _ observables ( self. prolix, self. language ) self. prolixtokenization = self. _ prolix _ pass ( self. all, self. prolix ) | [
0.438801109790802,
-1.0217822790145874,
0.36541396379470825,
0.46944770216941833,
-0.3529139459133148,
0.7508313655853271,
-0.23488585650920868,
0.9918631911277771,
-1.3121825456619263,
-0.7952736020088196,
-0.4051053524017334,
0.05373593792319298,
0.9121068120002747,
1.3122707605361938,
... |
def send _ message ( username, message ) : user _ input ( username, message ) return redirect ( username ) | [
-1.1751829385757446,
0.6474438905715942,
0.38776281476020813,
1.2036482095718384,
-0.37159886956214905,
0.8678461909294128,
1.221899151802063,
-0.649008572101593,
-0.5582498908042908,
-0.5737622380256653,
-0.039898186922073364,
0.08908004313707352,
-0.5455219745635986,
0.3622470498085022,
... |
def _ _ get _ door _ candidates ( self, start, room ) : # initialise list candidates = [ ] # iterate corners in room for door in self. doors : # skip visisted if not door. unused : continue # check if we have los to either offset offset _ start = mcl. point ( start. x + start. dx, start. y + start. dy ) if self. _ _ ha... | [
-1.030443549156189,
-1.571303367614746,
0.8596406579017639,
-0.02623511105775833,
-0.4245261549949646,
0.31316274404525757,
-0.32196876406669617,
-0.021787123754620552,
0.1585744470357895,
1.0747113227844238,
-0.18590198457241058,
1.3655345439910889,
-0.25789961218833923,
1.045749783515930... |
def flattenlists ( ast ) : if not isinstance ( ast, ast ) : return [ ast ] children = [ ] for child in ast. children : children + = flattenlists ( child ) if ast. islist ( ) and ast. parent. islist ( ) and ast. name = = ast. parent. name : return children else : return [ ast ( ast. name, children, ast. linenum ) ] | [
-0.21389083564281464,
-0.13870735466480255,
0.6406784057617188,
0.10652057081460953,
-1.3273217678070068,
0.07314811646938324,
0.3178730309009552,
0.13990361988544464,
1.7340763807296753,
-0.16252051293849945,
-0.6178544163703918,
-0.32993680238723755,
0.18783245980739594,
1.56496560573577... |
def _ extract _ resource _ tags ( span : readablespan, max _ tag _ value _ length : optional [ int ] ) - > sequence [ model _ pb2. keyvalue ] : tags = [ ] for key, value in span. resource. attributes. items ( ) : tag = _ translate _ attribute ( key, value, max _ tag _ value _ length ) if tag : tags. append ( tag ) retu... | [
0.06361763179302216,
0.5722174048423767,
0.25287535786628723,
0.29886046051979065,
-0.3098226487636566,
-0.4632236957550049,
-0.7317017316818237,
-0.10477551817893982,
-0.5496652722358704,
0.5659855604171753,
-0.8130142092704773,
-0.6566388607025146,
0.8849371075630188,
0.4216887652873993,... |
def custom _ mutant _ matrix ( self, input _ filename, model, n _ pred _ iterations = 10, \ minibatch _ size = 2000, filename _ prefix = " ", offset = 0 ) : # get the start and end index from the sequence name start _ idx, end _ idx = self. focus _ seq _ name. split ( " / " ) [ - 1 ]. split ( " - " ) start _ idx = int ... | [
-0.5254674553871155,
-1.3013108968734741,
0.6975715160369873,
0.046145662665367126,
-1.309245228767395,
0.04807063937187195,
0.342655748128891,
0.5550887584686279,
0.21130110323429108,
0.7148204445838928,
-0.21330510079860687,
0.7033739686012268,
0.07146365940570831,
0.2532825171947479,
... |
def isnormaldistr ( pointslist ) : distlist = [ ] lenlist = len ( pointslist ) if lenlist = = 0 or lenlist = = 1 or lenlist = = 2 : return 0 index = 0 while index < lenlist - 1 : cur = pointslist [ index ] next = pointslist [ index + 1 ] dist = getdistance ( cur [ 1 ], cur [ 2 ], next [ 1 ], next [ 2 ] ) dist = round (... | [
-0.6393325328826904,
-0.4046611785888672,
0.7973384261131287,
0.6916411519050598,
-1.1947805881500244,
0.8056998252868652,
0.5992826223373413,
0.7031294107437134,
0.548862099647522,
0.7198994159698486,
-0.5092862248420715,
0.280266135931015,
-0.914669930934906,
1.2194571495056152,
-0.933... |
def sts _ to _ pi ( texts, sts _ labels, max _ nonparaphrase, min _ paraphrase ) : return texts, sts _ labels | [
-0.8315162062644958,
-0.5117046236991882,
0.12712346017360687,
-0.6618452072143555,
-0.8416988253593445,
0.48627790808677673,
-1.3514649868011475,
0.4306715726852417,
0.40958261489868164,
1.124213695526123,
0.07123573124408722,
-0.059822551906108856,
-0.6847160458564758,
-0.602556049823761... |
def change _ in _ infected _ numbers ( self ) : if self. infected > 5 : cases _ resolved = max ( int ( self. infected / / average _ duration ), 5 ) elif self. infected > 0 : cases _ resolved = self. infected else : cases _ resolved = 0 cases _ die = int ( cases _ resolved * mortality _ rate ) self. infected - = cases _... | [
-0.5553446412086487,
-0.5589327216148376,
0.6667155027389526,
0.41509363055229187,
0.00018462908337824047,
0.27926167845726013,
0.5746613144874573,
0.4515625834465027,
-0.5792409777641296,
0.2924363911151886,
-0.20776602625846863,
-0.18247400224208832,
0.15413127839565277,
-0.0873142704367... |
def getkitbyid ( self, session, kit _ id ) : self. getlogger ( ). debug ('retrieving kit id [ % s ]'% ( kit _ id ) ) dbkit = session. query ( kits ). get ( kit _ id ) if not dbkit : raise kitnotfound ('kit id [ % s ] not found.'% ( kit _ id ) ) return dbkit | [
0.41175100207328796,
0.34447717666625977,
-0.049685366451740265,
0.22560642659664154,
0.3597894608974457,
-0.35560303926467896,
-0.11695840954780579,
-0.6825141310691833,
0.352586567401886,
0.1710931658744812,
1.0112475156784058,
0.5284003615379333,
0.022085079923272133,
0.6772360801696777... |
def bin2addr ( addr ) : return socket. inet _ ntoa ( struct. pack ( "! l ", addr ) ) | [
-0.35731327533721924,
-0.3981401026248932,
0.5683889985084534,
-0.9161050319671631,
-1.0318603515625,
-0.39490973949432373,
0.14402006566524506,
-0.24453124403953552,
1.23008394241333,
-0.4057885408401489,
-0.48888710141181946,
1.0507822036743164,
-0.10481788963079453,
-0.7912217378616333,... |
def on _ add _ clicked ( self ) : # todo : not implemented yet def testconnection ( ip, port, service _ name ) : url _ origin = u'http : / /'+ ip + u':'+ port + u'/ ws - gateway / gateway / ws /'+ service _ name + '? wsdl'url = str ( url _ origin ) auth = httpauthenticated ( username ='administrator ', password ='quati... | [
-0.38163039088249207,
0.016422126442193985,
0.7444082498550415,
-0.4644901752471924,
-0.6803140044212341,
-0.382386714220047,
0.430063396692276,
-1.3030768632888794,
0.11980502307415009,
-0.2800782024860382,
0.3111177384853363,
0.146640345454216,
-0.6166815161705017,
0.7557165026664734,
... |
def test _ create _ pfe _ stand _ alone _ deliverysystem ( self, context ) : # these could come from a data file id = " post _ vedevices _ allconfigadminmulticasttrue " pfe _ name = " post _ vedevices _ allconfigadminmulticasttrue " devicehost = " post _ vedevices " # define a test step with pytest. allure. step ( " cr... | [
0.16676339507102966,
0.5789385437965393,
0.5264289379119873,
0.6555340886116028,
0.5296322107315063,
0.9970754384994507,
0.22112277150154114,
0.011834640055894852,
0.5922346711158752,
-0.40726354718208313,
-1.0956470966339111,
-0.048261504620313644,
0.5321075916290283,
0.7311239242553711,
... |
def getattributesum ( x, y ) : output = [ ] for field1, field2 in zip ( x, y ) : output. append ( field1 + field2 ) return output | [
-0.6325944662094116,
-0.10822378844022751,
0.6953787803649902,
0.0682382583618164,
0.09011184424161911,
-0.4130856692790985,
-0.6622795462608337,
-0.5488545894622803,
-0.4259721040725708,
0.5873613357543945,
-0.8845967650413513,
0.553763210773468,
0.6022204756736755,
-0.8940044045448303,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.