text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
async def retrieve _ service _ inputs ( self, node _ uuid : nodeid, port _ keys : list [ str ] ) - > retrievedataoutenveloped : if node _ uuid not in self. _ inverse _ search _ mapping : raise dynamicsidecarnotfounderror ( node _ uuid ) service _ name = self. _ inverse _ search _ mapping [ node _ uuid ] scheduler _ dat... | [
-0.6845958232879639,
0.49052220582962036,
0.546637773513794,
-0.3108370900154114,
0.31284698843955994,
-0.3568367063999176,
-0.19349637627601624,
-0.8660354018211365,
-0.6566753387451172,
0.20039451122283936,
0.09495501220226288,
1.083679437637329,
-0.7525453567504883,
-0.22969838976860046... |
def scott _ adventure ( ) : global dead # you'll need this to be able to modify the dead variable direction = input ( " which direction would you like to go? [ north / south / east / west ] " ) if direction = = " north " : # good choice! print ( " you are still trapped in the dark, but someone else is there with you no... | [
-0.38598906993865967,
-0.15581607818603516,
0.6707484126091003,
0.8735733032226562,
0.023390138521790504,
0.31868863105773926,
0.1888369917869568,
-0.6077654361724854,
-0.023881610482931137,
0.32483774423599243,
0.41767579317092896,
0.7878590226173401,
0.4804897904396057,
-0.18648108839988... |
def normalize _ text ( text ) : text = tf. strings. lower ( text ) text = tf. strings. regex _ replace ( text, "'(. * )'", r " \ 1 " ) return text | [
0.6707398891448975,
-0.5650545954704285,
0.42874008417129517,
-0.4046364724636078,
-0.36723005771636963,
-0.3309451937675476,
0.2506263852119446,
0.8887062668800354,
0.2653181850910187,
1.026368498802185,
-0.316591739654541,
0.33863547444343567,
-1.363115906715393,
-0.3590181767940521,
-... |
def translate ( context, source _ text, disambiguation = none, num = - 1 ) : return q. qapplication. translate ( context, source _ text, disambiguation, num ) | [
0.18404895067214966,
0.13471344113349915,
0.2712380886077881,
0.31157049536705017,
-0.6866450905799866,
-0.33806484937667847,
-0.15156736969947815,
1.0322319269180298,
1.1108659505844116,
-0.5939795970916748,
-1.1943546533584595,
-1.0551549196243286,
0.35121116042137146,
-0.620158731937408... |
def count _ rows ( self, layer _ name, where _ clause = none ) : # todo : investigate whether using select by attributes would be more # efficient. return len ( list ( self. iter _ rows ( layer _ name, ['oid @'], where _ clause = where _ clause ) ) ) | [
0.05823126435279846,
0.5019446015357971,
0.5541353821754456,
-0.5682731866836548,
-0.03043302334845066,
-0.9389564990997314,
-0.016403712332248688,
0.23672233521938324,
0.05680057406425476,
0.6312058568000793,
-0.15041720867156982,
-0.2545212507247925,
0.19087202847003937,
0.57131409645080... |
def adjust _ learning _ rate ( opt, optimizer, epoch ) : lr = opt. learning _ rate * ( 0. 5 * * ( epoch / / opt. lr _ update ) ) for param _ group in optimizer. param _ groups : param _ group ['lr'] = lr opt. learning _ rate = lr | [
0.3617331385612488,
-0.443471223115921,
0.41068071126937866,
0.08617653697729111,
-0.31823891401290894,
-0.027754945680499077,
-0.5774131417274475,
0.7575016021728516,
-0.44252070784568787,
0.7638504505157471,
0.47566816210746765,
0.4903358817100525,
-0.20166015625,
0.7495242953300476,
-... |
def iter _ cus ( self ) : if self. version < 5 : raise dwarferror ( " cu iteration in rnglists is not supported with dwarf < 5 " ) structs = next ( self. _ dwarfinfo. iter _ cus ( ) ). structs # just pick one return _ iter _ cus _ in _ section ( self. stream, structs, structs. dwarf _ rnglists _ cu _ header ) | [
-0.8220940232276917,
-0.18239134550094604,
0.4536266624927521,
-0.12561924755573273,
-0.3145906329154968,
0.25018206238746643,
0.8853006362915039,
-0.6011413931846619,
-0.002946660155430436,
0.2153950333595276,
0.20667125284671783,
0.10701248794794083,
-0.6077284216880798,
0.31696802377700... |
def time _ initialize _ bins ( self ) : lc. bins ( n _ bins = 100, bin _ range = ( 0, 1 ) ) | [
-0.2908051013946533,
0.3936760425567627,
0.3536168038845062,
0.15529662370681763,
0.593752920627594,
0.5178442597389221,
0.14577053487300873,
-0.42512091994285583,
-0.05142738297581673,
-0.018423305824398994,
-1.2055333852767944,
0.5943315625190735,
0.5846306085586548,
1.0355310440063477,
... |
def _ _ contextmenumoveleft ( self ) : self. movetab ( self. contextmenuindex, self. contextmenuindex - 1 ) | [
-0.30261126160621643,
-0.8304879069328308,
0.5392136573791504,
0.612479567527771,
0.6677585244178772,
0.5128373503684998,
0.14624054729938507,
-0.4551970064640045,
0.0336274728178978,
0.7402178049087524,
-0.11514997482299805,
-0.27825114130973816,
-0.3092532157897949,
-0.8072065114974976,
... |
def _ load _ pbxproj _ as _ json ( path : str ) - > dict [ str, any ] : content = subprocess. run ( [ " plutil ", " - convert ", " json ", os. path. join ( path, " project. pbxproj " ), " - o ", " - ", ], stdout = subprocess. pipe, check = true, ). stdout return cast ( dict [ str, any ], json. loads ( content ) ) | [
-0.4899096190929413,
-0.3820989429950714,
0.6087490916252136,
-0.7685512900352478,
-1.3662340641021729,
-0.0932508185505867,
-0.9899495244026184,
-0.9727243781089783,
-0.5837893486022949,
0.6009297966957092,
-0.683777928352356,
-0.2999541163444519,
-0.7171552181243896,
-0.7498530745506287,... |
def signout ( request ) : if request. method = = " get " : if request. user. is _ authenticated : logout ( request ) return httpresponseredirect ( " / auth / signin " ) return httpresponse ( " not logged in ", status = 200 ) return httpresponse ( " method not allowed on auth / signout ", status = 405 ) | [
-1.2184585332870483,
-0.4605838656425476,
0.6804961562156677,
0.6650335192680359,
-0.3265165388584137,
0.6262204647064209,
0.6777713894844055,
0.16295811533927917,
0.05250939354300499,
0.012072216719388962,
0.687554121017456,
-0.13433055579662323,
0.18058723211288452,
-0.198323592543602,
... |
def search _ user _ by _ username ( username : str ) : _ cursor = g. blogyy _ conn. cursor ( ) _ cursor. execute ( " " " select ` uuid `, ` password _ hash ` from ` user ` where ` username ` =? ; " " ", ( username, ) ) _ db _ rsp = _ cursor. fetchone ( ) if _ db _ rsp is none : return none return { " uuid " : _ db _ rs... | [
-0.7125128507614136,
0.15010966360569,
0.4046478271484375,
-0.4707964062690735,
-0.5376054048538208,
-0.7753801345825195,
-0.13947206735610962,
-0.42700016498565674,
-1.2454437017440796,
0.5353016257286072,
-0.897952675819397,
-1.0590519905090332,
-0.5807230472564697,
-0.12269598990678787,... |
def _ _ init _ _ ( self, sourcecollection = none ) : abstractcollection. _ _ init _ _ ( self, sourcecollection ) | [
-0.359080970287323,
0.2366967499256134,
0.46044406294822693,
0.0982758104801178,
-0.5415782332420349,
0.26917293667793274,
-0.023298485204577446,
0.8022615313529968,
0.35024699568748474,
-0.5176408290863037,
-0.5031120181083679,
-0.07560358196496964,
0.43325075507164,
1.540893793106079,
... |
def get _ next _ job _ budget ( self ) : if self. sh _ bracket [ self. get _ budget ( ) ] > 0 : # the current rung still has unallocated jobs ( > 0 ) return self. get _ budget ( ) else : # the current rung has no more jobs to allocate, increment it rung = ( self. current _ rung + 1 ) % self. n _ rungs if self. sh _ bra... | [
-0.024248648434877396,
-0.23813514411449432,
0.6848487854003906,
0.20197296142578125,
-0.6576389074325562,
-0.6322054266929626,
0.06739292293787003,
-0.4841408133506775,
0.5030584335327148,
-1.2810750007629395,
0.444330096244812,
0.37997525930404663,
-0.8003167510032654,
0.7177658081054688... |
def sign _ data ( self ) : sk = ed25519. signingkey ( self. private _ key ) return sk. sign ( self. msg ) | [
-0.5688295960426331,
-0.014328735880553722,
0.2089209258556366,
-0.5286701917648315,
0.09367230534553528,
-0.1975875198841095,
-0.27868735790252686,
0.6524768471717834,
-0.09681782126426697,
-0.3480469286441803,
-0.24517939984798431,
0.40331631898880005,
-1.0967066287994385,
0.797532141208... |
def test _ category _ created ( self ) : response = self. app. post ('/ api / v1 / category ', data = json. dumps ( self. data2 ), content _ type ='application / json') result = json. loads ( response. data. decode ( ) ) self. assertequal ( result [ " message " ], " category added successfully. add another category " ) | [
-0.23886790871620178,
0.5401754975318909,
0.3546900451183319,
0.1671082228422165,
1.1619319915771484,
0.28033456206321716,
-0.6847496628761292,
-0.19630464911460876,
-0.4121658504009247,
-1.2004142999649048,
-0.5605419278144836,
0.444221168756485,
0.27413690090179443,
0.8017231225967407,
... |
def c ( self ) : return self. current | [
0.20618918538093567,
-1.4155981540679932,
0.6081026196479797,
-0.2875119149684906,
0.042010288685560226,
1.4855648279190063,
1.980718970298767,
-0.4266968369483948,
-0.5926145315170288,
-0.8350006937980652,
0.7289596796035767,
0.8192235827445984,
-0.22633004188537598,
-0.7839261889457703,
... |
def softmax ( x ) : e _ x = np. exp ( x - np. max ( x ) ) return e _ x / e _ x. sum ( ) | [
0.7796108722686768,
0.46160387992858887,
0.5463999509811401,
0.7412365674972534,
-0.834380030632019,
-0.10227616876363754,
-0.8193026781082153,
0.8551045060157776,
1.5991946458816528,
0.3088579475879669,
-0.36623579263687134,
0.5906962752342224,
0.37615346908569336,
-0.1736929565668106,
... |
def train _ one _ epoch ( model, trainloader, optimizer, device ) : model. train ( ) avg _ loss = averagemeter ( " average - loss " ) for batch _ idx, ( img, target ) in enumerate ( trainloader ) : img = variable ( img ). to ( device ) target = variable ( target ). to ( device ) # zero out the gradients optimizer. zero... | [
-1.1142220497131348,
0.42036545276641846,
0.6390401721000671,
-0.12498114258050919,
-0.6033529043197632,
-0.3555346429347992,
0.17741771042346954,
0.23779930174350739,
-0.9805651307106018,
0.781358003616333,
-0.6484219431877136,
0.07115310430526733,
0.02203371934592724,
0.8346498608589172,... |
def legendsandfigwords ( text, parabnd = default _ para _ bnd, # string that means paragraph boundary numwords = 50, # num words around fig / tbl refs to keep blurbjoin = '.. ', # text to join paragraph parts ) : for p in paragraphs ( text, parabnd = parabnd ) : if legendre. match ( p ) : # have figure / table legend y... | [
1.6441348791122437,
-0.26953357458114624,
0.4344733655452728,
0.14303183555603027,
-0.8063318729400635,
0.6669801473617554,
-0.3397437036037445,
0.4111466109752655,
-0.03526998311281204,
0.6151325106620789,
0.04276147484779358,
-0.09306413680315018,
-0.29927414655685425,
0.4714747667312622... |
def notify _ not _ logged _ in ( function = none ) : def wrapper ( request, * * kwargs ) : if ( not request. user or not request. user. is _ authenticated ( ) ) : # add message to the user messages. add _ message ( request, messages. info, _ ( " you need to login in order to make any changes " ) ) return function ( req... | [
-1.1005377769470215,
-0.010323180817067623,
0.5212970972061157,
0.3403565585613251,
0.08898983895778656,
-0.09861069172620773,
-0.023830700665712357,
-0.3547283113002777,
0.5308088064193726,
-0.14046208560466766,
0.48565590381622314,
0.9375308156013489,
0.4029533267021179,
0.38060948252677... |
def compute _ joint _ posterior ( cluster, associations ) : assert len ( cluster. ld _ snps ) = = cluster. ld _ matrix. shape [ 0 ], ( len ( cluster. ld _ snps ), cluster. ld _ matrix. shape [ 0 ], cluster. ld _ matrix. shape [ 1 ] ) assert len ( cluster. ld _ snps ) = = cluster. ld _ matrix. shape [ 1 ], ( len ( clust... | [
0.4485296905040741,
0.044944752007722855,
0.5704556107521057,
-0.17671073973178864,
-0.23564866185188293,
-0.4920728802680969,
0.26292768120765686,
0.9272915720939636,
-0.5987114906311035,
0.5422101616859436,
-0.1321224570274353,
0.34674960374832153,
-0.19445596635341644,
0.066263183951377... |
def introduce _ error ( alphabet, seq, errorrate ) : new _ seq = seq. copy ( ) for i in range ( len ( seq ) ) : if uniform ( 0, 1 ) < = errorrate : new _ seq [ i ] = choice ( alphabet ) return new _ seq | [
-1.0225321054458618,
-0.576960563659668,
0.2744179368019104,
-0.3362540006637573,
-0.38344091176986694,
0.2972094714641571,
-0.022261688485741615,
0.07278382033109665,
0.8719944357872009,
1.3686184883117676,
-0.4090803861618042,
0.8747032880783081,
-0.6737781763076782,
0.307745099067688,
... |
def provider _ name ( self ) : return self. resource _ class. name | [
-0.5643775463104248,
-0.5483720302581787,
0.3378567099571228,
-0.28093352913856506,
-1.0004278421401978,
1.4904894828796387,
-0.028976641595363617,
-0.14823657274246216,
0.9831607937812805,
0.7880336046218872,
0.248163640499115,
-0.08873220533132553,
0.7701910138130188,
-0.0652875453233718... |
def prepare _ for _ run ( self, configuration _ path = none, config = none, run _ id = none ) : run _ manager = self. get _ run _ manager ( ) if run _ id is not none : config = run _ manager. get _ resources _ for _ run _ id _ from _ history ( run _ id = run _ id ) else : if configuration _ path is not none : config = ... | [
-0.13716132938861847,
-0.31116536259651184,
0.5634415745735168,
0.5558940172195435,
-0.2225489765405655,
-0.3896026313304901,
0.5615898370742798,
0.15097370743751526,
0.28890958428382874,
0.23680132627487183,
0.03367228806018829,
0.4747064709663391,
-0.031863708049058914,
0.671151399612426... |
def create _ dataset ( self, name, shape = none, dtype = none, data = none, chunks = none, compression = none, fillvalue = 0, n _ threads = 1, * * compression _ options ) : if not self. _ handle. mode ( ). can _ write ( ) : raise valueerror ( " cannot create dataset with read - only permissions. " ) if name in self : r... | [
-0.08707556873559952,
0.33210352063179016,
0.5346991419792175,
0.16754035651683807,
-0.23824571073055267,
-0.3198826014995575,
-0.32232803106307983,
-0.6526536345481873,
-0.45616474747657776,
-0.48832905292510986,
0.1300625205039978,
0.13623611629009247,
-0.3825540840625763,
-0.48492962121... |
def show _ score ( self ) : self. prep _ wallet ( ) self. prep _ bet ( ) self. screen. blit ( self. wallet _ image, self. wallet _ rect ) self. screen. blit ( self. bet _ image, self. bet _ rect ) | [
-0.3971707820892334,
-0.16758988797664642,
0.8006061315536499,
-0.48871558904647827,
0.3471332788467407,
0.4550159275531769,
0.5291839241981506,
-0.1588537096977234,
0.2590133845806122,
1.2712087631225586,
0.6869015097618103,
0.10631896555423737,
0.6012696027755737,
0.9382995367050171,
-... |
def test _ key _ check _ keys ( self ) : passed, bad _ keys = xutil. _ key _ check ( subject, {'foo':'bar'} ) self. assertfalse ( passed ) self. assertin ('foo ', bad _ keys ) | [
-0.3195692002773285,
0.7968320846557617,
0.2377626746892929,
0.19470487534999847,
0.09799587726593018,
0.6935985088348389,
-1.0068442821502686,
0.42764896154403687,
-1.0184521675109863,
-0.2830628454685211,
0.28813353180885315,
0.3031938970088959,
-0.35030606389045715,
0.03048028238117695,... |
def getsubkeybypath ( self, key _ path ) : if not self. _ registry _ key and self. _ registry : self. _ getkeyfromregistry ( ) subkey = self for path _ segment in key _ paths. splitkeypath ( key _ path ) : subkey = subkey. getsubkeybyname ( path _ segment ) if not subkey : break return subkey | [
0.21869885921478271,
-0.08999064564704895,
0.3881036937236786,
1.0286325216293335,
0.01921664923429489,
0.4322303831577301,
0.8454370498657227,
-0.7016441822052002,
-0.23785880208015442,
0.3277364671230316,
-0.7366387248039246,
0.6021345257759094,
-0.8798930048942566,
-0.42111092805862427,... |
async def listen _ for _ responses _ for _ task ( self, task _ id, callback _ function = none, timeout = none ) : url = " { } { } : { } / ws / responses / by _ task / { } ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port, str ( task _ id ) ) if callback _ function : task = await self. stream _ output (... | [
0.37619951367378235,
-0.09881704300642014,
0.5745089054107666,
-0.5899645686149597,
-0.1599351316690445,
-1.0175001621246338,
0.92928147315979,
-0.8524395823478699,
0.42952120304107666,
-0.36382636427879333,
0.1398227959871292,
0.6116349697113037,
0.3046865165233612,
0.49860960245132446,
... |
def create _ time _ series ( self, ts _ path, data _ type, encoding, compressor, props = none, tags = none, attributes = none, alias = none, ) : data _ type = data _ type. value encoding = encoding. value compressor = compressor. value request = tscreatetimeseriesreq ( self. _ _ session _ id, ts _ path, data _ type, en... | [
-0.980911374092102,
0.5259231925010681,
0.4237908720970154,
-0.12875203788280487,
0.23745064437389374,
0.2966494858264923,
-0.6961185336112976,
-0.7483515739440918,
-0.1461327224969864,
-0.06641887873411179,
-1.1123791933059692,
-0.14241373538970947,
-0.6369370222091675,
-0.683283627033233... |
async def async _ connect ( self ) : kwargs = {'username': self. _ username if self. _ username else none,'client _ keys': [ self. _ ssh _ key ] if self. _ ssh _ key else none,'port': self. _ port,'password': self. _ password if self. _ password else none,'known _ hosts': none, } self. _ client = await asyncssh. connec... | [
-0.1486091911792755,
0.3584492802619934,
0.48545244336128235,
0.1242927610874176,
-0.02849479950964451,
-0.3868180513381958,
-0.8873284459114075,
0.18656031787395477,
-1.1353119611740112,
-0.04212815314531326,
-0.4099143147468567,
0.6267979145050049,
0.29092666506767273,
0.1210191100835800... |
def with _ transform ( self, transform : optional [ callable ], columns : optional [ list ] = none, output _ all _ columns : bool = false, ) : dataset = copy. deepcopy ( self ) dataset. set _ transform ( transform = transform, columns = columns, output _ all _ columns = output _ all _ columns ) return dataset | [
-0.2718014717102051,
-0.013182328082621098,
0.4418327510356903,
0.06502426415681839,
-0.9437537789344788,
-0.727139413356781,
-0.4796649217605591,
0.0302320197224617,
0.23667897284030914,
-1.1595104932785034,
-0.36907288432121277,
0.53931725025177,
0.45672792196273804,
-0.337689608335495,
... |
def blocking _ heuristic ( board ) : # check if the goal car is at goal place : ( 2, 4 ) for car in board. cars : if car. is _ goal : if car. var _ coord = = 4 : return 0 end = 0 b = 0 for point in board. grid [ 2 ] : if point = ='>': end = 1 if end : if point = ='|'or point = ='^'or point = ='v': b + = 1 return b + 1 | [
-0.4808676242828369,
0.741007387638092,
0.6419703960418701,
1.2728993892669678,
-0.1786176860332489,
-0.18317589163780212,
-0.014566089026629925,
1.022599458694458,
-1.2589631080627441,
0.29340749979019165,
-0.10214022547006607,
-0.5229436755180359,
-0.31856030225753784,
-0.093382075428962... |
def stack _ frame ( stacked _ frames, frame, is _ new ) : if is _ new : stacked _ frames = np. stack ( arrays = [ frame, frame, frame, frame ] ) stacked _ frames = stacked _ frames else : stacked _ frames [ 0 ] = stacked _ frames [ 1 ] stacked _ frames [ 1 ] = stacked _ frames [ 2 ] stacked _ frames [ 2 ] = stacked _ f... | [
-0.06257453560829163,
0.9101427793502808,
0.7675329446792603,
0.630779504776001,
1.0394223928451538,
-0.8869697451591492,
-0.2596152126789093,
-0.2025863379240036,
0.15804368257522583,
1.2132004499435425,
-0.4059975743293762,
0.8230909109115601,
-0.5893990397453308,
0.19837108254432678,
... |
def prepend ( self, item ) : self. insert ( 0, item ) | [
0.002257045591250062,
0.3922874629497528,
0.423094242811203,
0.37967896461486816,
0.8449928164482117,
1.1459389925003052,
-0.1593024879693985,
0.027049604803323746,
0.874426007270813,
0.2560754716396332,
-0.883309543132782,
-0.426982581615448,
-0.22927890717983246,
0.22365343570709229,
-... |
def _ _ call _ _ ( self, description : str ) : english _ description _ remover = englishdescriptionremover ( ) description = english _ description _ remover. process ( description ) address = address ( district = self. _ match _ locations ( self. address _ provider. districts, description ), estate = self. _ match _ lo... | [
-0.3984450697898865,
0.08125323057174683,
0.9283390641212463,
-0.5924651622772217,
-0.3594987988471985,
-0.30571362376213074,
0.5094636082649231,
0.6489565968513489,
0.9700214266777039,
0.48948174715042114,
0.2974860668182373,
0.4992484450340271,
-0.1423119455575943,
-0.559665322303772,
... |
def augmentedmatrix ( m, b ) : a = [ i [ : ] for i in m ] for i in range ( len ( m ) ) : a [ i ]. append ( b [ i ] ) return a | [
-0.02123388834297657,
-0.7427466511726379,
0.5690556168556213,
0.4573120176792145,
0.3427099287509918,
-0.06950396299362183,
-1.1969231367111206,
0.3450194299221039,
-0.25609514117240906,
0.2571811378002167,
0.6870062947273254,
1.1284455060958862,
-0.825354278087616,
0.14533637464046478,
... |
def run ( params : params, data : pd. dataframe ) - > pd. dataframe : with open ( params. model _ path, " rb " ) as f : model _ obj = pickle. loads ( f. read ( ) ) resp = np. where ( data [ " score " ] > model _ obj [ " cutpoint " ], 1, 0 ) data [ " class _ estimada " ] = resp return data | [
-0.6068403720855713,
-0.40364086627960205,
0.3620866537094116,
0.2746289074420929,
1.0570731163024902,
0.13956314325332642,
0.16296064853668213,
-0.29508864879608154,
-0.23267261683940887,
0.7585375905036926,
0.35235610604286194,
0.6694905757904053,
0.20937886834144592,
-0.2858718931674957... |
def game _ by _ id ( self, game _ id : int ) - > optional [ game ] : s = self. _ session return s. query ( game ). filter _ by ( id = game _ id ). first ( ) | [
0.6971533298492432,
-0.008544339798390865,
0.26229819655418396,
-0.2401253581047058,
1.072800636291504,
-0.699573814868927,
-1.421687364578247,
-1.7258460521697998,
0.5374173521995544,
0.9198096394538879,
0.640576183795929,
-0.15195626020431519,
-0.7473167181015015,
0.15972484648227692,
... |
def add _ player ( self, user ) : if not user. is _ authenticated ( ) : raise valueerror if user = = self. host : raise owneventerror if len ( self. players. all ( ) ) > = self. max : raise eventfullerror if user in self. players. all ( ) : return self. players. add ( user ) self. save ( ) | [
-0.4826206862926483,
0.594444215297699,
0.6389212608337402,
0.9728081226348877,
0.06728503853082657,
0.7708215117454529,
0.148610919713974,
-0.39475297927856445,
0.3615073263645172,
0.2321702539920807,
-0.5437788963317871,
0.03535785526037216,
-0.8990687131881714,
-0.06910254061222076,
0... |
def test _ _ constant _ cumulative _ distribution ( self ) : # setup instance = univariate ( ) instance. constant _ value = 3 x = np. array ( [ 1, 2, 3, 4, 5 ] ) expected _ result = np. array ( [ 0, 0, 1, 1, 1 ] ) # run result = instance. _ constant _ cumulative _ distribution ( x ) # check compare _ nested _ iterables... | [
0.05149400979280472,
0.5302733778953552,
0.5483183264732361,
0.34372326731681824,
-0.04072820395231247,
0.5964372158050537,
0.3009890913963318,
0.8442785143852234,
-0.27176693081855774,
0.15311700105667114,
-0.5913499593734741,
-0.35060539841651917,
-0.12180714309215546,
0.3168955743312835... |
def symbol _ to _ path ( symbol, base _ dir = " documents / mc1 _ p1 / data " ) : return os. path. join ( os. path. expanduser ('~'), base _ dir, " { }. csv ". format ( str ( symbol ) ) ) | [
-0.32461684942245483,
-0.042093634605407715,
0.14921775460243225,
0.3634624481201172,
-0.5274922847747803,
0.3942715525627136,
1.1572743654251099,
0.11963701248168945,
0.0005553310620598495,
-0.05089132860302925,
0.2738785743713379,
0.5821110010147095,
0.31527313590049744,
-0.0718155205249... |
def increment _ combat _ attempted ( self ) : self. combat _ attempted + = 1 | [
-0.9527651071548462,
-0.8054637908935547,
0.416799932718277,
-0.11609671264886856,
0.20237195491790771,
0.2778266370296478,
-0.01850861683487892,
-0.7484349012374878,
-0.821973443031311,
-1.2011257410049438,
0.017315881326794624,
-0.04728788137435913,
-0.5672773122787476,
0.039485938847064... |
def get _ result _ type ( action ) : msg _ type = rostopic. get _ topic _ type ( " { } / result ". format ( action ) ) [ 0 ] # replace'actionresult'with'result '. return msg _ type [ : - 12 ] + " result " | [
-0.22447143495082855,
0.2688365578651428,
0.3459448516368866,
0.03781135380268097,
1.7304648160934448,
-0.6104688048362732,
0.46155884861946106,
-1.3953295946121216,
0.39361172914505005,
-0.24505800008773804,
0.060376789420843124,
0.3909420967102051,
0.03150217980146408,
-0.111115440726280... |
def throttling _ burst _ limit ( self ) - > optional [ int ] : return pulumi. get ( self, " throttling _ burst _ limit " ) | [
1.4203200340270996,
1.3885701894760132,
0.7337045669555664,
0.9605238437652588,
0.42567020654678345,
1.2512221336364746,
0.23460738360881805,
-0.20007972419261932,
0.49305951595306396,
0.3039528727531433,
-0.9495794773101807,
0.4800029397010803,
-0.04104865714907646,
-1.4293142557144165,
... |
def _ getvboxinstallpath ( self, ffailifnotfound ) : shost = utils. gethostos ( ) ; if shost = ='win': sprogfiles = os. environ. get ('programfiles ','c : \ \ program files') ; aslocs = [ os. path. join ( sprogfiles,'oracle ','virtualbox'), os. path. join ( sprogfiles,'oraclevm ','virtualbox'), os. path. join ( sprogfi... | [
0.3855254650115967,
-0.3099365532398224,
0.6909687519073486,
0.153871551156044,
0.585424542427063,
-0.17121577262878418,
0.9665952324867249,
-0.489289790391922,
0.24603162705898285,
0.6023906469345093,
0.7434420585632324,
0.14974471926689148,
-0.4602048099040985,
0.5921928286552429,
-0.5... |
def _ get _ header _ type _ lambda ( self, header _ type ) : if header _ type = = " string " : return lambda x : str ( x ) if x else none elif header _ type = = " integer " : return lambda x : int ( x ) if x else none elif header _ type = = " float " : return lambda x : float ( x ) if x else none elif header _ type = =... | [
-0.2799986004829407,
-1.1098151206970215,
0.5724728107452393,
-0.3858838975429535,
0.20315051078796387,
-0.7580219507217407,
-0.770083487033844,
-0.7380125522613525,
0.05837938189506531,
0.15610076487064362,
-0.5676217079162598,
0.6545833945274353,
-0.3268318176269531,
-0.15845026075839996... |
def process _ media ( self, context ) : if " document " in context : self. logger. debug ( " document detected " ) file _ id = context [ " document " ] [ " file _ id " ] old _ path = self. document _ converter. find _ file _ by _ id ( self. database. get _ filepath ( context [ " from " ] [ " id " ] ) ) try : os. remove... | [
-0.0172632597386837,
-0.9352389574050903,
0.9359080195426941,
0.9494777321815491,
0.6032851338386536,
-0.15413422882556915,
0.0909760519862175,
-0.2206858992576599,
0.4599003791809082,
0.2823096513748169,
0.6481090784072876,
0.2984892725944519,
-0.675998866558075,
1.3390686511993408,
0.1... |
def train _ model ( model, train _ loader, test _ loader, device, epochs = 10 ) : # optimize with adam and use cross entropy loss optimizer = adam ( model. parameters ( ), lr = 0. 001 ) # define lists that will contain loss and accuracy values obtained during training and validation loss _ trn _ list = [ ] loss _ val _... | [
-0.5428414940834045,
-0.02361830323934555,
0.5684158205986023,
0.08049661666154861,
-0.19326865673065186,
-0.35412147641181946,
0.19745837152004242,
-0.03225104138255119,
-0.5402871370315552,
0.603396475315094,
-0.47765010595321655,
-0.1966574341058731,
0.8748620748519897,
0.47597172856330... |
def get _ pid ( self, module : str ) - > int : return pid if self. modules [ self. _ module _ hash ( module ) ] > 1 else 0 | [
-0.015507073141634464,
-0.23900696635246277,
0.5639110207557678,
0.08491354435682297,
0.12239468097686768,
0.9711514711380005,
-0.24837394058704376,
-0.15853096544742584,
0.324586421251297,
0.8835088014602661,
0.5133447051048279,
0.12696564197540283,
-1.348061203956604,
0.3520994484424591,... |
def load _ no _ echo ( self, filename ) : vals = numpy. load ( filename ) for p in self. params : if p. name in vals : if p. get _ value ( ). shape! = vals [ p. name ]. shape : raise exception ('shape mismatch : { 0 }! = { 1 } for { 2 } '. format ( p. get _ value ( ). shape, vals [ p. name ]. shape, p. name ) ) p. set ... | [
-0.22593504190444946,
-0.21851801872253418,
0.7389081120491028,
-0.15284363925457,
0.5804263353347778,
0.788489580154419,
-0.20381365716457367,
-0.13572180271148682,
-1.0280096530914307,
0.45703446865081787,
-0.22618995606899261,
0.2845395803451538,
-0.05836229771375656,
1.4858627319335938... |
def my _ customize _ compiler ( compiler ) : retval = distutils _ customize _ compiler ( compiler ) try : compiler. compiler _ so. remove ('- wstrict - prototypes') except ( attributeerror, valueerror ) : pass return retval | [
0.020971914753317833,
0.01479032076895237,
0.23634205758571625,
-0.1785925179719925,
-0.9671694040298462,
-1.117562174797058,
0.5803008079528809,
-0.10816486179828644,
0.24175015091896057,
0.3167974650859833,
0.24641922116279602,
0.5484949946403503,
-0.6467447280883789,
0.8566647171974182,... |
def mkdir _ p ( path ) : try : os. makedirs ( path ) except oserror as exc : # python > 2. 5 if exc. errno = = errno. eexist and os. path. isdir ( path ) : pass else : raise | [
0.18325670063495636,
0.33978351950645447,
0.836829662322998,
-0.0014141574501991272,
-0.5951251983642578,
1.2091565132141113,
0.5005403757095337,
-0.25695040822029114,
0.38693463802337646,
0.1948316991329193,
0.40224355459213257,
-1.0098555088043213,
-0.2880643606185913,
-0.081469193100929... |
def _ translate _ _ interfaces _ state _ interface _ ipv4 ( input _ yang _ obj, translated _ yang _ obj = none ) : if input _ yang _ obj. forwarding. _ changed ( ) : input _ yang _ obj. forwarding = input _ yang _ obj. forwarding if input _ yang _ obj. mtu. _ changed ( ) : input _ yang _ obj. mtu = input _ yang _ obj. ... | [
-0.9225555062294006,
0.10125481337308884,
0.28685587644577026,
-0.9557780027389526,
-0.7734597325325012,
-0.015026088804006577,
1.1762723922729492,
-0.4531327486038208,
0.5812748074531555,
0.07217765599489212,
-0.2684750556945801,
-0.7419759631156921,
-0.7409393191337585,
-0.31801989674568... |
def grad ( foo, var _ list, init _ values, tol = 1e - 5, max _ iter = 10000 ) : # initial definitions and variables declaration alpha = symbols ( " alpha " ) n = 0 current _ values = asarray ( init _ values ) previous _ values = none previous _ replacements = none gradient _ vector = list ( ) gradient _ values = list (... | [
0.38813453912734985,
0.1788802444934845,
0.7969701886177063,
-0.17962200939655304,
-0.020701885223388672,
0.13835281133651733,
-0.38500019907951355,
0.34202688932418823,
-1.0182617902755737,
0.07230053097009659,
0.03230014815926552,
0.4941166937351227,
-0.16265429556369781,
1.1703056097030... |
def dashboard ( request ) : if request. user. is _ stylist = ='yes': pending _ appointments = appointment. objects. filter ( stylist = request. user, status = appointment. status _ pending ) accepted _ appointments = appointment. objects. filter ( stylist = request. user, status = appointment. status _ accepted ) compl... | [
0.1726340800523758,
0.10983923077583313,
0.8505974411964417,
-0.03691606596112251,
-1.1232898235321045,
0.8235644698143005,
0.30489039421081543,
1.0835188627243042,
-0.29676344990730286,
0.2820151746273041,
0.4056331515312195,
-0.2439473271369934,
0.08295635879039764,
0.631140947341919,
... |
def _ unregister _ event _ listener ( self, url ) : if self. _ rsn _ oms is none : raise platformconnectionexception ( " cannot _ unregister _ event _ listener : _ rsn _ oms object required ( created via connect ( ) call ) " ) try : result = self. _ rsn _ oms. event. unregister _ event _ listener ( url ) except excepti... | [
-0.6132810115814209,
0.18800343573093414,
0.49213728308677673,
-0.2820134162902832,
-0.21972240507602692,
-0.6406150460243225,
0.3816828429698944,
0.43012693524360657,
-0.3687116801738739,
0.15582959353923798,
-0.39385706186294556,
-0.08470296859741211,
-0.1763586550951004,
0.6135208010673... |
def _ pass ( self ) : # disable hit and pass buttons self. _ hitbutton [ " state " ] = disabled self. _ passbutton [ " state " ] = disabled # hit dealer and refresh card pane outcome = self. _ model. hitdealer ( ) self. _ dealerimages = list ( map ( lambda card : photoimage ( file = card. getfilename ( ) ), self. _ mod... | [
-1.1865172386169434,
-0.5063791275024414,
0.48250335454940796,
-0.1776324361562729,
-0.11065994203090668,
0.7466169595718384,
0.5899679660797119,
0.806606113910675,
-0.7607809901237488,
0.4839475154876709,
0.272609680891037,
-0.7299191355705261,
0.7242808938026428,
0.22645840048789978,
0... |
def update _ backlog _ tuple ( self, classification _ result, classified _ by, proposed _ directory, backlog _ tuple, document _ information _ dict, move _ docs = false ) : # only move, if in moving mode and if document existant if proposed _ directory! = " notfound " : if not os. path. exists ( proposed _ directory ) ... | [
-1.539834976196289,
-0.5691165924072266,
0.952628493309021,
-0.5371357202529907,
-0.23753312230110168,
0.6785642504692078,
0.6649223566055298,
-0.24413099884986877,
-0.9652730226516724,
1.4373403787612915,
0.06480938196182251,
0.16839177906513214,
-0.4007304906845093,
-0.3869949281215668,
... |
def concat ( self, out, hunks, * * kw ) : | [
0.10348914563655853,
0.09823395311832428,
0.30257609486579895,
1.3719797134399414,
-0.7335435748100281,
-0.8077215552330017,
-0.2841797173023224,
-0.08000791817903519,
-0.8351030349731445,
-0.41738590598106384,
1.1541261672973633,
-0.37646484375,
0.5312375426292419,
0.5664758086204529,
-... |
def profile ( request ) : if request. user. is _ stylist = ='yes': full _ name = request. user. get _ full _ name ( ) portfolio _ haircuts = portfoliohaircut. objects. filter ( stylist = request. user ) stylist _ options = stylistmenu. objects. filter ( stylist = request. user ) return render ( request,'stylist / styli... | [
0.3729727864265442,
0.3607330620288849,
0.4961342513561249,
0.31576550006866455,
-0.5883760452270508,
0.4142356812953949,
0.33567294478416443,
-0.08686073869466782,
0.49662789702415466,
0.7968943119049072,
0.10609117895364761,
-0.034309785813093185,
-0.3562942445278168,
0.2986295819282532,... |
def status _ message ( self ) : return str ( self. _ status _ bar. currentmessage ( ) ) | [
-0.3060959577560425,
-1.196299433708191,
0.04388871043920517,
0.2783117890357971,
0.20126628875732422,
0.7454243898391724,
0.07854066789150238,
-0.6683743000030518,
-0.35345765948295593,
-0.08785931766033173,
0.6617745757102966,
0.14106617867946625,
-1.1116728782653809,
0.7468922138214111,... |
def writefile ( path, content ) : fileobj = open ( path,'a +') fileobj. write ( content +'\ n') fileobj. close ( ) | [
0.3891907036304474,
-1.0119026899337769,
0.13982883095741272,
-0.3804555833339691,
0.17856448888778687,
1.1257872581481934,
-0.28694450855255127,
-0.03294958546757698,
-0.7473621964454651,
-0.17436499893665314,
-0.22609801590442657,
-0.5527779459953308,
-0.04223232716321945,
-0.50845932960... |
def home ( ) : return render _ template ('home. html') | [
0.9454221129417419,
-0.018598729744553566,
0.19696290791034698,
1.1173579692840576,
0.041857264935970306,
0.3446125388145447,
0.0020601358264684677,
0.7961413860321045,
-0.24736635386943817,
0.722185492515564,
0.04061613976955414,
-0.31619545817375183,
-0.3494706451892853,
-0.0856526643037... |
def symbolic _ mutual _ information ( symx, symy ) : if len ( symx )! = len ( symy ) : raise valueerror ('all arrays must have same length') symx = np. array ( symx ) symy = np. array ( symy ) symbols = np. unique ( np. concatenate ( ( symx, symy ) ) ). tolist ( ) jp = symbolic _ joint _ probabilities ( symx, symy ) px... | [
0.18135479092597961,
0.05735292658209801,
0.67692631483078,
-0.22417446970939636,
-0.1074882447719574,
-0.26606884598731995,
0.2597237527370453,
-0.14051243662834167,
-0.01865268312394619,
0.6026222109794617,
-0.0317949578166008,
0.03685719519853592,
-0.6251556873321533,
0.0572693571448326... |
def test _ module _ level _ tree ( subtests, etcd _ client, prefix ) : with subtests. test ( " the tree of a non - existent key should be none " ) : assert tree ( etcd _ client, prefix ) is none with subtests. test ( " the tree of an file should bey { key : value } " ) : etcd _ client. set ( " { } / 1 ". format ( prefi... | [
0.12287452071905136,
-0.0710015520453453,
0.5101454854011536,
-1.285139560699463,
0.3103407919406891,
-0.008639924228191376,
-0.5240875482559204,
0.5447070598602295,
-0.27906885743141174,
-0.11111963540315628,
-0.07128097862005234,
0.9821871519088745,
-0.4778594970703125,
0.574934601783752... |
def lmfit _ iprint ( res, myinput ) : if ( myinput. iprint > 0 ) & ( myinput. verbose ) : if myinput. aprint = = myinput. iprint : print ( " chi2 = % g " % ( ( res * res ). sum ( ) ) ) myinput. aprint = 0 myinput. aprint + = 1 | [
0.5739803314208984,
-0.7553824782371521,
0.3508990705013275,
-0.5585450530052185,
-0.28058335185050964,
-0.04289563000202179,
-0.12498974800109863,
-0.38491541147232056,
-0.2557685077190399,
-0.5517240762710571,
-0.027165377512574196,
0.6385148763656616,
-1.9430878162384033,
-0.23478659987... |
def remove _ watermark ( frame, template _ bw, surround _ bw ) : # gray value around template surround _ intensity = frame [ surround _ bw ]. mean ( ) # subtract demark = np. select ( [ ~ template _ bw ], [ frame ], default = surround _ intensity ) return demark | [
-0.5149975419044495,
-0.12263960391283035,
0.483205109834671,
-0.6317557096481323,
-0.9065970778465271,
0.14104396104812622,
1.3455721139907837,
1.0396734476089478,
0.08249407261610031,
0.5005804300308228,
-0.41336074471473694,
1.243471622467041,
-1.0808435678482056,
0.13201500475406647,
... |
def add _ service ( service, provider, name ) : if service in _ external _ services : if provider not in _ external _ services [ service ] : _ external _ services [ service ]. append ( provider ) else : return false else : _ external _ services [ service ] = [ provider ] add _ service _ name _ binding ( service, provid... | [
-0.8936362862586975,
-0.3075048327445984,
0.9192757606506348,
-0.3692626655101776,
-0.6509318947792053,
0.601331353187561,
-0.046089157462120056,
-0.004138109739869833,
0.5648700594902039,
-0.19180458784103394,
-0.4385850131511688,
-0.04072779417037964,
-0.6783954501152039,
0.7578629851341... |
def testrewritebuiltinfunctionname ( self ) : _, errors = self. inferwitherrors ( " x = len ( none ) " ) self. asserterrorlogis ( errors, [ ( 1, " wrong - arg - types ", r " built - in function len " ) ] ) | [
-0.061223212629556656,
0.21632248163223267,
0.34501200914382935,
-0.043301962316036224,
1.2111696004867554,
-0.7001363635063171,
0.3457525372505188,
0.42697006464004517,
-0.4816860854625702,
-0.23679108917713165,
-1.389093279838562,
0.6361451745033264,
-0.23144204914569855,
-0.266243368387... |
def find _ modular _ inverse ( x, n ) : # - - - - - - - - - - 1. input validation - - - - - - - - - - if not isinstance ( x, int ) or not isinstance ( n, int ) : raise exception ( " either m or n is not of integer type! " ) if n < = 1 : raise exception ( " the indicated modulus is smaller than 1! " ) if x < = 0 or x > ... | [
-0.20652765035629272,
-0.16443614661693573,
0.5843219757080078,
-0.5519871711730957,
-0.9992194175720215,
-0.011377811431884766,
-0.6270285844802856,
-0.2566782534122467,
0.06572196632623672,
-0.18599925935268402,
0.07901717722415924,
0.9432996511459351,
-1.458685278892517,
0.3377975523471... |
def save _ matfile ( self, filepath, path = none ) : if path is none : path ='/ pp'dim = self. dim coeffs = self. coeffs coefs = coeffs. reshape ( ( self. order, - 1 ) ). transpose ( ) pp = dict ( form ='pp ', order = self. order, pieces = self. pieces, dim = dim, breaks = self. breaks. reshape ( ( 1, - 1 ) ), # ensure... | [
0.31529003381729126,
0.17197291553020477,
0.5119795799255371,
-0.25826793909072876,
-0.2503330707550049,
0.4356653094291687,
0.6428602933883667,
0.20601452887058258,
-0.4197206199169159,
0.01636132411658764,
-0.43906858563423157,
-0.6762279272079468,
-0.4430065453052521,
0.0939610674977302... |
def execute ( self, cmd, * args, * * kwargs ) : if cmd = = rsnplatformdriverevent. turn _ on _ port : result = self. turn _ on _ port ( * args, * * kwargs ) elif cmd = = rsnplatformdriverevent. turn _ off _ port : result = self. turn _ off _ port ( * args, * * kwargs ) elif cmd = = rsnplatformdriverevent. set _ port _ ... | [
-0.23036545515060425,
-0.653827965259552,
0.9029303789138794,
0.09636180847883224,
0.4352600872516632,
-0.2541023790836334,
-0.18876726925373077,
-0.25751835107803345,
-0.06827214360237122,
-0.47402679920196533,
0.38004598021507263,
-0.958460807800293,
-0.4890812635421753,
0.36704716086387... |
def spec _ validator ( spec ) : for col _ spec in spec : # - - hack : the presence of those fields is enforced by another # - - schema validation that happens before this one kicks in, but # - - unfortunately when one validators fails it doesn't break the # - - validation but just reports its errors and another validat... | [
-0.424852579832077,
-0.7390480041503906,
0.49227645993232727,
-0.025525355711579323,
0.7966619729995728,
-0.17436501383781433,
0.8498750329017639,
-0.05254426971077919,
-0.5256827473640442,
0.1992475688457489,
0.06153770163655281,
-0.4304998517036438,
0.7077783942222595,
0.5860541462898254... |
def _ _ getitem _ _ ( self, key ) : return dict. get ( self, key ) or'' | [
-0.46241986751556396,
0.2503618001937866,
0.6273430585861206,
-1.0030134916305542,
-0.5048890709877014,
-0.2570077180862427,
-1.5201295614242554,
-0.6348497867584229,
0.004215591587126255,
0.5076099038124084,
0.7048904299736023,
-0.4893665909767151,
0.38863155245780945,
-0.4428754150867462... |
def do _ insert ( self, cmd, params ) : try : self. cur. execute ( cmd, params ) self. conn. commit ( ) except exception as e : logger. error ( e ) logger. error ( e. message ) return self. cur | [
-0.2379045933485031,
-0.023650754243135452,
0.6351463794708252,
0.3360413908958435,
0.2844930589199066,
0.2820911705493927,
0.19190430641174316,
0.40553128719329834,
-1.2293592691421509,
0.43183740973472595,
0.6733165383338928,
-0.6419861912727356,
-1.5903465747833252,
-0.27023977041244507... |
def get _ version ( self ) : return self. version | [
-0.04118768498301506,
-1.1493908166885376,
-0.004451429005712271,
0.6510132551193237,
0.5317979454994202,
1.040554404258728,
0.7739481925964355,
0.01748061738908291,
-0.4758811891078949,
-0.2470063716173172,
-0.7167475819587708,
0.2890859544277191,
-0.3604874610900879,
-0.1641813963651657,... |
def generate ( self, n = 1 ) : out = [ ] for _ in xrange ( n ) : out. extend ( [ self. _ randomnucleotide ( b ) for b in self. pattern ] ) return seq (''. join ( out ) ) | [
-1.2022138833999634,
1.1521090269088745,
0.6094300746917725,
0.49736860394477844,
0.001328048063442111,
0.3779962360858917,
-0.5979599952697754,
0.25760966539382935,
0.6476839184761047,
-0.0036213488783687353,
-1.072998046875,
-0.6515604257583618,
-0.21844926476478577,
0.4641467332839966,
... |
def make _ key ( iden, * a, * * kw ) : h = hashlib. md5 ( ) def _ conv ( s ) : if isinstance ( s, str ) : return s elif isinstance ( s, unicode ) : return s. encode ('utf - 8') elif isinstance ( s, ( tuple, list ) ) : return ', '. join ( _ conv ( x ) for x in s ) elif isinstance ( s, dict ) : return ', '. join ('% s : ... | [
-0.8016943335533142,
0.20116502046585083,
0.5456365346908569,
-0.41436463594436646,
-1.2701467275619507,
-0.3319455087184906,
-1.0529714822769165,
-0.16667766869068146,
0.283387154340744,
0.31923454999923706,
-0.29614704847335815,
-0.11869785934686661,
0.22307851910591125,
-1.0743685960769... |
def gmm _ esteps ( x, pi _ k, k, cova _ old, mu _ old ) : # compute pi _ k = nk / n # compute con _ k # compute mu _ k ( n, d ) = np. shape ( x ) cova _ list = cova _ old mean _ k _ list = mu _ old # for ith group # mean _ k = np. mean ( member _ k [ i ], 0 ) # print'members # ', len ( member _ k [ i ] ) " " " diff = [... | [
-0.288270503282547,
0.47033870220184326,
0.8105018138885498,
-0.47978273034095764,
-0.029467547312378883,
0.0905119925737381,
-0.2721198499202728,
0.958068311214447,
0.18574659526348114,
1.7953671216964722,
0.3764667510986328,
-0.5468979477882385,
-0.11107224971055984,
-0.05273578688502312... |
def ac _ check ( r, br, disc, ret ) : a = [ ] for idx _ x, x in enumerate ( br ) : if r! = idx _ x + 1 : a + = ( [ r / ( idx _ x + 1 ) ] * x ) for idx _ x, x in enumerate ( ret ) : if r! = idx _ x + 1 : a + = ( [ r / ( r - disc [ idx _ x ] ) ] * x ) return _ ac _ check ( r, sorted ( a, reverse = true ) ) | [
0.17001114785671234,
-0.014848859049379826,
0.7112014293670654,
0.06433228403329849,
-0.012817714363336563,
0.0704931691288948,
0.90980064868927,
-0.9917386770248413,
0.026386266574263573,
0.5631580948829651,
0.794685959815979,
-0.18284541368484497,
-0.48453289270401,
-0.02487475425004959,... |
def solve ( self ) : equations, variables = self. generate _ sympy _ equations ( ) solutions = sympy. solve ( equations, variables ) state _ solutions = { } for symbol, value in solutions. items ( ) : state _ solutions [ symbol. name ] = value return state _ solutions | [
-0.9860795736312866,
0.2508421838283539,
0.4828343987464905,
-0.4955281615257263,
0.06635543704032898,
-1.351728916168213,
0.17392438650131226,
-0.39820945262908936,
-0.04736749082803726,
0.14356106519699097,
-1.7838917970657349,
-1.2945117950439453,
0.7364066243171692,
0.4258365035057068,... |
def area ( self ) : return abs ( ( self. pt2. y - self. pt1. y ) * ( self. pt2. x - self. pt1. x ) ) | [
-0.023310096934437752,
-1.5631248950958252,
0.7533819675445557,
0.09043829143047333,
0.015701046213507652,
0.9641589522361755,
0.2616841197013855,
-0.07662555575370789,
0.04065866023302078,
0.21539786458015442,
0.7939315438270569,
0.7192193865776062,
0.05195510759949684,
0.2166667580604553... |
def find _ stop _ codon ( exons, cds _ position ) : if cds _ position. is _ forward _ strand : stop _ pos = cds _ position. chrom _ stop else : stop _ pos = cds _ position. chrom _ start cdna _ pos = 0 for exon in exons : exon _ start = exon. tx _ position. chrom _ start exon _ stop = exon. tx _ position. chrom _ stop ... | [
-0.3228936791419983,
-0.8795533180236816,
0.8146045804023743,
-0.9805111289024353,
-0.129882350564003,
-0.16969279944896698,
-0.29022228717803955,
0.3283942639827728,
-0.49080419540405273,
0.7343207001686096,
-0.4687226414680481,
-0.12540742754936218,
0.11173824965953827,
-0.56853801012039... |
def draw _ header ( canvas ) : canvas. setstrokecolorrgb ( 0. 9, 0. 5, 0. 2 ) canvas. setfillcolorrgb ( 0. 2, 0. 2, 0. 2 ) canvas. setfont ('helvetica ', 16 ) canvas. drawstring ( 18 * cm, - 1 * cm,'invoice') canvas. drawinlineimage ( settings. inv _ logo, 1 * cm, - 1 * cm, 25, 25 ) # logo size : 25x25 canvas. setlinew... | [
0.4462110102176666,
-0.14494456350803375,
1.140688180923462,
-1.158048391342163,
-0.29140371084213257,
0.6098996996879578,
-0.9066037535667419,
-0.5541224479675293,
-0.5519676804542542,
-0.2352646291255951,
0.055981315672397614,
0.4788644015789032,
-0.31933876872062683,
-0.925666093826294,... |
def add ( self, element : svgelement ) - > none : self. elements. append ( element ) self. boundary _ box = self. boundary _ box * element. boundary _ box | [
0.01089771743863821,
0.8889774084091187,
0.5205287337303162,
1.0251803398132324,
0.4057594835758209,
1.379111409187317,
-0.39464932680130005,
-0.053352758288383484,
0.70343017578125,
-0.5516337156295776,
-0.13406263291835785,
0.7204482555389404,
-0.41592687368392944,
0.41912227869033813,
... |
def consume ( self, length, offset = 0 ) : start = self. _ read _ head + offset self. _ read _ head. assign ( tf. math. floormod ( start + length, self. _ buffer _ size ) ) self. _ data _ size. assign ( self. _ data _ size - length ) | [
0.017685556784272194,
-0.1540667563676834,
0.5535162687301636,
-1.2093316316604614,
-0.19985726475715637,
0.3551345765590668,
0.14289438724517822,
0.14459720253944397,
-0.6069670915603638,
-0.10357996821403503,
-0.9228273630142212,
0.8832995295524597,
0.3823881149291992,
-0.491704076528549... |
def sharpness _ din _ perseg ( signal, fs = none, weighting = " din ", nperseg = 4096, noverlap = none, field _ type = " free ", is _ sdt _ output = false, ) : # manage input type if datatime is not none and isinstance ( signal, datatime ) : time = signal. get _ along ( " time " ) [ " time " ] fs = 1 / ( time [ 1 ] - t... | [
0.23176611959934235,
-0.20130762457847595,
0.6542542576789856,
-0.04429743066430092,
-0.3463926911354065,
-0.579900324344635,
0.14712730050086975,
-0.5353528261184692,
0.7146651744842529,
0.08993957191705704,
-0.5873445272445679,
0.2131081074476242,
0.23975196480751038,
0.4870623052120209,... |
def ratio _ to _ frac ( r ) : return float ( r. num ) / float ( r. den ) if r. den is not 0 else float ('nan') | [
0.2799174189567566,
0.23223185539245605,
0.32368192076683044,
-0.09975671768188477,
-0.3287429213523865,
-0.48539313673973083,
0.5409054160118103,
-1.1549965143203735,
0.5011059045791626,
-0.4422173500061035,
1.083717942237854,
-0.7704100608825684,
0.5028665661811829,
0.005538077559322119,... |
def test _ get _ trigger ( self ) : pass | [
-0.03060663305222988,
0.8763946294784546,
0.22007884085178375,
1.3887368440628052,
1.2233392000198364,
-0.8038739562034607,
0.8751936554908752,
0.17996329069137573,
-0.17162151634693146,
-1.6167716979980469,
-1.373931884765625,
0.327485054731369,
-1.104860782623291,
-0.43854644894599915,
... |
def wrapper ( context : union [ context, click. core. context ], * args : any, * * kwargs : any ) - > callable : ctx = _ cast _ ctx ( context ) try : return func ( context, * args, * * kwargs ) except click. clickexception as e : _ rmdirs ( * ctx. clean _ paths ) raise e | [
-0.7889726758003235,
0.21194249391555786,
0.6066629886627197,
0.3525783121585846,
-0.17947319149971008,
-0.2718311846256256,
0.5759165287017822,
-0.6330602169036865,
1.1197264194488525,
0.25689181685447693,
0.9236360192298889,
0.41167834401130676,
0.28426438570022583,
-0.20968207716941833,... |
def getbestbidandask ( orderbook, ticker ) : return orderbook. get _ best _ price ( ticker = ticker ) | [
-0.2779324948787689,
-0.3137197196483612,
0.39526137709617615,
1.984209656715393,
-0.3587381839752197,
-0.26413455605506897,
-0.2809704542160034,
-0.18278630077838898,
-0.6565330028533936,
0.7907798290252686,
-0.07725122570991516,
0.6910297274589539,
-0.06399991363286972,
0.905197441577911... |
def create _ logger ( level = logging. debug ) : logger = logging. getlogger ( ) logger. setlevel ( level ) handler = logging. streamhandler ( sys. stdout ) handler. setformatter ( jsonformatter ( ) ) logger. addhandler ( handler ) # add info _ with and friends to logger for name in ['critical ','fatal ','error ','warn... | [
-0.15228688716888428,
-0.8007197380065918,
0.7123981714248657,
-0.2883217930793762,
-0.3324132263660431,
-0.3699597716331482,
-0.9460231065750122,
-0.7576135396957397,
-0.6067777872085571,
-0.9396632313728333,
-0.04945586621761322,
-0.8715340495109558,
0.2822827696800232,
1.031253814697265... |
def test _ project _ plan _ view ( self ) : target = project. objects. create ( name ='test project ', slug ='test _ project') items = [ ] for i in range ( 10 ) : items. append ( item. objects. create ( project = target, summary ='item % d'% i, complexity = i % 6 or 1 ) ) delta = timedelta ( 30 ) now = datetime. now ( ... | [
0.19524098932743073,
0.7140839695930481,
0.5914633274078369,
-0.04565123841166496,
0.5003626346588135,
1.15059232711792,
0.06386622786521912,
0.014683528803288937,
0.08302129060029984,
-0.913336992263794,
-0.019888635724782944,
0.020929837599396706,
0.02198919467628002,
-0.5092337727546692... |
def searchduplicateplugins ( edmpluginfile ) : cmd = " cat % s | awk'{ print $ 2 \ " \ " $ 1 }'| sort | uniq | awk'{ print $ 1 }'| sort | uniq - c | grep'2'| awk'{ print $ 2 }'" % edmpluginfile output = commands. getoutput ( cmd ). split ('\ n') for line in output : if ignoreedmdp. has _ key ( line ) : continue line = ... | [
-0.2996838390827179,
-0.3377440273761749,
0.9629777669906616,
0.030484838411211967,
0.16363945603370667,
-0.15613315999507904,
0.7207692265510559,
-0.38498786091804504,
-0.09165500849485397,
0.43579646944999695,
-0.4724228084087372,
0.7403542995452881,
-0.33563360571861267,
0.4424522519111... |
def initialize _ settings ( settings ) : def setconfig ( parameter ) : environment _ variable ='nx _'+ parameter. upper ( ) if environment _ variable in os. environ : value = os. environ [ environment _ variable ] elif settings. has _ option ('settings ', parameter ) : value = settings. get ('settings ', parameter ) el... | [
-1.1575157642364502,
0.7125738859176636,
0.49967241287231445,
0.46278202533721924,
0.937030553817749,
-0.3759952187538147,
-0.06914675980806351,
-1.2387220859527588,
0.14786666631698608,
1.1956812143325806,
-1.3520158529281616,
-0.9000660181045532,
-0.19288106262683868,
1.1988705396652222,... |
def away _ team ( self ) : return self. _ teams ['away'] | [
0.44477272033691406,
-0.39896562695503235,
0.26781877875328064,
-0.4132691025733948,
-0.8432839512825012,
1.5330289602279663,
-0.2882768213748932,
-0.16092917323112488,
-0.16164319217205048,
-0.6817634105682373,
0.4298595190048218,
1.0712809562683105,
0.16189298033714294,
-1.3560791015625,... |
def forward ( self, full _ traj ) : # turn np arrays into tensors if type ( full _ traj [ 0 ] [ 0 ] [ 0 ] ) is np. ndarray : full _ traj = [ [ ( torch. floattensor ( o ). to ( self. device ), torch. floattensor ( s ). to ( self. device ), torch. floattensor ( a ). to ( self. device ) ) for o, s, a in traj ] for traj in... | [
-0.7028793692588806,
0.6738733053207397,
0.7526138424873352,
0.694071352481842,
0.3011276423931122,
-0.5531124472618103,
1.2215982675552368,
0.05821990966796875,
0.017198393121361732,
0.34611737728118896,
0.09030847996473312,
-0.3982947766780853,
0.45894911885261536,
0.7976059913635254,
... |
def remove _ dups ( df ) : # # sort values # df = df. sort _ values ( by = ['subject _ id ','hadm _ id ','admittime ','charttime ','resistant _ yn'], # ascending = [ true, true, true, true, false ] ) # # remove duplicates # df = df. drop _ duplicates ( subset = ['subject _ id ','hadm _ id ','admittime'], keep ='first')... | [
0.406997412443161,
0.560827910900116,
0.6367363333702087,
-0.63722163438797,
-0.18631432950496674,
0.21626389026641846,
0.43102750182151794,
0.0959654450416565,
-0.1299079954624176,
0.569647490978241,
0.0695570558309555,
0.9817125201225281,
0.5527911186218262,
0.20951306819915771,
0.7161... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.