text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def bundletype ( self ) : return b'zstd ', b'zs ' | [
0.2745913565158844,
-0.09399889409542084,
0.38874348998069763,
0.39108899235725403,
0.3021143078804016,
0.8490673303604126,
0.9192293286323547,
0.08796346187591553,
0.7552887201309204,
0.2143210917711258,
-0.3827003538608551,
0.47890377044677734,
-0.39409130811691284,
0.5942306518554688,
... |
def c2k ( c ) : return _ np. asanyarray ( c ) + zero _ celsius | [
0.2698640823364258,
-0.9249677062034607,
0.42860984802246094,
0.5081300139427185,
0.11496954411268234,
-0.27085912227630615,
-0.20514041185379028,
-0.24663294851779938,
-0.42545458674430847,
0.42532050609588623,
0.21579241752624512,
0.052175503224134445,
0.29326221346855164,
-0.31315588951... |
def get _ match _ results ( matches ) : matches _ outcome _ array = [ ] home _ goals = matches ['home _ team _ goal']. to _ numpy ( ) away _ goals = matches ['away _ team _ goal']. to _ numpy ( ) for pos in range ( len ( home _ goals ) ) : if home _ goals [ pos ] > away _ goals [ pos ] : matches _ outcome _ array. appe... | [
-0.5093624591827393,
-0.695835530757904,
0.6168821454048157,
0.08835595846176147,
0.35280147194862366,
0.1496102660894394,
0.22972524166107178,
-0.11870048195123672,
-0.725093424320221,
0.3034358620643616,
-0.08338847011327744,
-0.3546636700630188,
0.6276415586471558,
-0.41883227229118347,... |
def headerreceived ( self, line ) : nameval = line. split (': ', 1 ) if len ( nameval )! = 2 : raise badresponseerror, " no':'in header. " name, val = nameval val = val. lstrip ('\ t') self. inheaders [ name ] = val | [
0.11178769916296005,
-0.5111979842185974,
0.6209635138511658,
-0.5159428715705872,
-0.248099222779274,
0.04801389202475548,
-0.4836188554763794,
0.06936972588300705,
-0.4384436309337616,
-0.12008285522460938,
-1.0967788696289062,
-0.4499909281730652,
-0.07149271667003632,
-0.48499044775962... |
def build _ pose _ optimizer ( cfg, model ) - > torch. optim. optimizer : norm _ module _ types = ( torch. nn. batchnorm1d, torch. nn. batchnorm2d, torch. nn. batchnorm3d, torch. nn. syncbatchnorm, # naivesyncbatchnorm inherits from batchnorm2d torch. nn. groupnorm, torch. nn. instancenorm1d, torch. nn. instancenorm2d,... | [
0.18054461479187012,
-0.02451947331428528,
0.8106056451797485,
0.3055863380432129,
-0.7122513055801392,
0.06248052418231964,
-0.30220094323158264,
-0.13389338552951813,
-0.5368472337722778,
0.5656094551086426,
0.2127983570098877,
-0.5230531096458435,
0.04224943742156029,
0.75797438621521,
... |
def consider _ event ( activity _ id, event _ id ) : # user login required if'username'not in flask. session : response = flask. make _ response ( json. dumps ('user login required'), 401 ) response. headers ['content - type'] ='application / json'return response try : with db _ session ( ) as db : user _ attending = d... | [
0.14076077938079834,
-0.5291544198989868,
1.100891351699829,
-0.13724900782108307,
-0.005150378216058016,
0.17831991612911224,
-0.09035258740186691,
-0.15909309685230255,
0.2076888531446457,
1.057928204536438,
0.42157599329948425,
0.2677941918373108,
0.0307040736079216,
0.18157629668712616... |
def test _ missing _ objective ( self ) : # validate a form with a missing ` ` objective ` ` value form = self. form _ data ( deadline _ 1 = " 2020 - 06 - 22 ", objective _ 1 = " ", ) errors = form. errors [ 0 ] [ " objective " ]. as _ data ( ) self. assertequal ( len ( errors ), 1 ) self. assertequal ( errors [ 0 ]. c... | [
0.18534201383590698,
0.07294707000255585,
0.5383585095405579,
-0.27990663051605225,
0.021746352314949036,
0.7701648473739624,
-0.5912996530532837,
0.09902939200401306,
-0.6724626421928406,
0.2692360579967499,
-0.40484821796417236,
-0.5944011211395264,
0.9435549378395081,
-0.155808553099632... |
def put _ char ( self, char, y = none, x = none, insert = true ) : if y is none : y = self. cursor _ y if x is none : x = self. cursor _ x if 0 < = y < self. height and self. cursor _ y + self. top _ line < len ( self. textlist ) and 0 < = x < self. width : self. textlist [ self. cursor _ y + self. top _ line ] = self.... | [
-0.5003207921981812,
-0.0394100658595562,
0.7807311415672302,
-0.9453267455101013,
-0.8316547870635986,
0.22059981524944305,
0.500208854675293,
0.3857266306877136,
-0.07177925109863281,
0.452984482049942,
-0.6782428026199341,
0.22871994972229004,
-1.1877344846725464,
0.25299522280693054,
... |
def vnfs _ from _ nsd ( nsd ) : vnfs = [ ] for vnf in nsd [ " vnfs " ] : vnfs. append ( vnf _ to _ internal ( vnf ) ) return vnfs | [
-0.9899970293045044,
-0.2620168924331665,
0.11622905731201172,
0.5452640056610107,
-0.7724450826644897,
-0.8195152878761292,
-1.164892554283142,
-0.8388035893440247,
0.8959049582481384,
0.8908913731575012,
-0.48435768485069275,
0.21801528334617615,
0.017278851941227913,
0.7536377310752869,... |
def log _ report ( predictions, y _ test ) : target _ names = ['claim ','majorclaim ','none ','premise'] logging. info ('\ nclassification report') logging. info ( classification _ report ( y _ test, predictions, digits = 3, target _ names = target _ names ) ) logging. info ('macro metrics : { } '. format ( precision _... | [
0.505540132522583,
0.10325942933559418,
0.5688213109970093,
0.1171226054430008,
0.5754407644271851,
0.1305205076932907,
-0.03647252544760704,
0.9119977355003357,
-0.9392001032829285,
-0.6583364605903625,
0.13719211518764496,
0.07523781061172485,
0.8019284605979919,
0.7306259274482727,
0.... |
def clear _ session _ after _ test ( ) : yield if k. backend ( ) = ='tensorflow'or k. backend ( ) = ='cntk': k. clear _ session ( ) | [
0.6736396551132202,
0.2973436713218689,
0.3803338408470154,
0.9111777544021606,
-0.25529900193214417,
-0.24503763020038605,
0.4500513970851898,
-1.4130069017410278,
0.9766944050788879,
0.951147198677063,
0.5025705099105835,
0.07380262017250061,
-0.11038166284561157,
-0.3974249064922333,
... |
def test _ post _ slow _ score ( self, test _ client, login _ response ) : quote _ id = " " while quote _ id! = " ea9d502e - a9b6 - 4d67 - ab35 - 5cae050af38b " : quote _ id = json. loads ( test _ client. get ( " / quote " ). data. decode ( " utf - 8 " ) ) [ " quote _ id " ] highscore _ response = test _ client. post (... | [
0.7307320237159729,
0.029640428721904755,
0.4638163149356842,
-0.37044891715049744,
1.098132848739624,
-0.028828905895352364,
-0.5831032395362854,
-0.6576839089393616,
0.36292779445648193,
-0.48449960350990295,
-0.8676224946975708,
0.41008031368255615,
-0.8085912466049194,
0.19898933172225... |
def _ get _ available _ course _ modules ( dept _ modules, course _ id, query _ params ) : modules = get _ cache ( " crscompmodules " ) modules = get _ cache ( " crsavailmodules " ) for available in modules. objects \. filter ( courseid = course _ id, setid = _ setid ) \. only ('moduleid') : for module in get _ cache (... | [
-1.0283055305480957,
-0.1775246560573578,
0.4767499566078186,
-1.4563547372817993,
0.4820045232772827,
0.834299623966217,
-0.25059372186660767,
-0.3819696009159088,
-0.12735405564308167,
1.1899842023849487,
-0.23023481667041779,
0.6979937553405762,
0.16531407833099365,
0.9459453225135803,
... |
def back ( self ) : self. ptr = self. ptr. parent | [
0.591804027557373,
-0.6299206018447876,
0.7808260321617126,
-1.222387671470642,
-0.04648389667272568,
0.5119576454162598,
1.9445078372955322,
-0.3451077938079834,
0.04776594042778015,
0.07626055181026459,
0.5236247181892395,
1.4747356176376343,
-0.961945116519928,
-0.8159056305885315,
-0... |
def uniform _ to _ cell ( zs, low _ corner, high _ corner, eps = 1e - 4 ) : zs = zs * ( 1 - eps ) + 0. 5 * eps low _ corner _ array = np. array ( low _ corner ) high _ corner _ array = np. array ( high _ corner ) side _ lengths = high _ corner _ array - low _ corner _ array shifted _ cell _ points = ( zs * side _ lengt... | [
-0.09850946813821793,
-0.41925621032714844,
0.4007492959499359,
-0.5828526616096497,
1.0948235988616943,
-0.49420782923698425,
0.10295164585113525,
-0.23394057154655457,
0.7599661946296692,
0.31565359234809875,
-0.07275617122650146,
0.4384061396121979,
0.48123928904533386,
-0.3818665146827... |
def calculate _ gradient ( y, tx, w, pred ) : gradient = tx. t. dot ( pred - y ) print gradient. shape return gradient | [
-0.41157057881355286,
0.19126039743423462,
0.17013323307037354,
-0.7766878604888916,
-0.7442750334739685,
0.22275559604167938,
1.0436549186706543,
0.7800381779670715,
-1.1685800552368164,
0.5478277206420898,
-0.9962051510810852,
0.4204621911048889,
0.3570411205291748,
0.42466166615486145,
... |
def suggest _ nn2 ( df, model, vectorizer ) : string _ input = keras. input ( shape = ( 1, ), dtype = " string " ) x = vectorizer ( string _ input ) preds = model ( x ) end _ to _ end _ model = keras. model ( string _ input, preds ) probabilities = end _ to _ end _ model. predict ( df [ " ptext " ] ) predictions = [ 1 ... | [
-0.974859893321991,
-0.46065884828567505,
0.5695112943649292,
0.6388987898826599,
-0.702722430229187,
-0.4919407069683075,
-0.7634174227714539,
-0.5895224213600159,
-1.5809444189071655,
0.7895431518554688,
-0.07175349444150925,
0.23336276412010193,
-0.14147306978702545,
0.3543967008590698,... |
def test _ patch _ survey _ package _ instance _ failure ( self, client, all _ survey _ package _ instances ) : package = client. single _ survey _ package _ instance ( " 23b4fd48 - ba41 - 4c9b - baef - d5c3dd5f8e5c " ) old _ status = package [ " locked " ] target _ status = not old _ status fake _ id = " 23b4fd48 - ba... | [
-0.32785436511039734,
0.34613844752311707,
0.5162283182144165,
-0.4492068588733673,
-0.2136954516172409,
1.0642988681793213,
0.00005287366730044596,
0.5217408537864685,
0.49762919545173645,
0.7907722592353821,
-0.3075677156448364,
0.3204542100429535,
-0.4683515727519989,
-0.126097857952117... |
def set _ agnocomplete ( self, klass _ or _ instance, user ) : # if string, use register to fetch the class if isinstance ( klass _ or _ instance, str ) : registry = get _ agnocomplete _ registry ( ) if klass _ or _ instance not in registry : raise unregisteredagnocompleteexception ( " unregistered agnocomplete class :... | [
-0.2519151568412781,
0.0859210342168808,
0.7903763055801392,
0.025062909349799156,
-0.16635794937610626,
0.20105190575122833,
0.07759129256010056,
-0.24773496389389038,
0.14773575961589813,
0.5526766180992126,
-0.26303714513778687,
0.5856607556343079,
-0.14293786883354187,
0.39280739426612... |
def fill ( self, value ) : current _ date = self. read ( ) if current _ date and value. date ( ) = = current _ date. date ( ) : return false if not self. readonly : date = datetime. strftime ( value, self. strptime _ format ) self. textbox. fill ( date ) self. date _ pick. _ elements [ self. date _ pick. active ]. clic... | [
-0.5841049551963806,
0.4757089614868164,
0.8226756453514099,
-0.5054634213447571,
-0.2805195450782776,
1.157852292060852,
0.373146653175354,
-0.649199366569519,
0.33461445569992065,
0.003948924597352743,
0.11234423518180847,
-0.335557222366333,
-0.23198743164539337,
0.7482876777648926,
-... |
def build _ optimizer ( model : nn. module, args : trainargs ) - > optimizer : params = [ {'params': model. parameters ( ),'lr': args. init _ lr,'weight _ decay': 0 } ] return adam ( params ) | [
0.278328001499176,
-1.0342328548431396,
0.32888513803482056,
-0.3040198087692261,
-0.02588941715657711,
0.003883918048813939,
-0.692010223865509,
0.028344906866550446,
-0.5217621326446533,
-0.4011150598526001,
-0.17978641390800476,
0.5735852122306824,
-0.1817161589860916,
0.374187409877777... |
def compute _ player _ ranks ( self ) - > none : self. level _ ranks, self. player _ ranks = compute _ ranks ( self. levels, self. solvers ) self. rank _ gen _ time = time. time _ ns ( ) with open _ and _ swap ( os. path. join ( self. dataset, " ranks. json " ), " w " ) as franks : json. dump ( { " level _ ranks " : se... | [
-1.4813363552093506,
-0.29854387044906616,
0.564917802810669,
0.21125635504722595,
1.205510139465332,
0.04505328834056854,
0.2507988214492798,
0.9704611301422119,
-1.1445155143737793,
0.3292815685272217,
-0.7342463731765747,
0.3935583233833313,
0.2733354866504669,
0.7704281210899353,
0.6... |
def new _ game ( ) : global deck global exposed global state global turns # builds deck deck = range ( deck _ size / 2 ) + range ( deck _ size / 2 ) # and shuffles random. shuffle ( deck ) # every card starts hidden exposed = [ false ] * deck _ size state = 0 turns = 0 label. set _ text ( " turns = " + str ( turns ) ) | [
-0.4168179929256439,
0.33823609352111816,
0.4545539319515228,
-0.5787394046783447,
0.5995305180549622,
0.3813202679157257,
-0.006048222538083792,
0.422187477350235,
0.1908324956893921,
0.15993598103523254,
-0.010013459250330925,
0.5352469086647034,
0.3099895417690277,
0.5024057626724243,
... |
def find _ parse _ metadata ( infile, annotations = false ) : # handle pathlib. path astrdict = none infile = str ( infile ) if infile. endswith ( '. safe') : mstr = metafile. read _ manifest _ safe ( infile ) if annotations : astrdict = metafile. read _ annotations _ safe ( infile ) elif infile. endswith ( '. zip') : ... | [
-0.15392759442329407,
-0.18166841566562653,
0.6751970052719116,
-0.6164900660514832,
-0.75441974401474,
0.02305344119668007,
-0.22869007289409637,
-0.09588323533535004,
-0.48371532559394836,
0.25686341524124146,
0.03707798197865486,
0.1243269219994545,
0.09771429747343063,
0.19236266613006... |
def filter _ by _ z ( network, inds, z = 1 ) : inds = np. array ( inds ) coordination = find _ coordination ( network ) hits = coordination = = z inds = inds [ hits [ inds ] ] return inds | [
-0.9416208863258362,
-0.3270769417285919,
-0.03305007889866829,
0.571049690246582,
-0.17384643852710724,
-0.5553819537162781,
1.0835437774658203,
0.05941087380051613,
0.9222883582115173,
0.28968971967697144,
0.14031389355659485,
0.2391791045665741,
-0.5992412567138672,
-1.5165609121322632,... |
def version _ pid ( self, version _ pid ) : self. _ version _ pid = version _ pid | [
0.958129346370697,
-2.016127586364746,
-0.102116659283638,
0.49207592010498047,
0.11200101673603058,
2.1777257919311523,
-0.36084604263305664,
1.081766963005066,
-0.1693086475133896,
0.917759358882904,
-0.8226556181907654,
0.13482199609279633,
0.1515369564294815,
-0.4067592918872833,
-0.... |
def notify ( uniqueid, message ) : _ _ mqttc _ _. publish ( os. environ. get ('mqtt _ topic ','dimmers / { }'). format ( uniqueid ), message ) | [
0.4861386716365814,
0.18181084096431732,
0.04849677532911301,
-0.7428292632102966,
-0.05957329645752907,
-0.1045834943652153,
-0.3578677773475647,
0.9528143405914307,
-0.09272002428770065,
0.23088999092578888,
-0.4068288505077362,
1.1297968626022339,
-0.6862450838088989,
1.1180198192596436... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, pageloadresponse ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _ | [
-0.35649722814559937,
-1.1188147068023682,
0.6657004356384277,
-0.5869618654251099,
-0.27402380108833313,
0.17193646728992462,
-0.36089569330215454,
-1.2711663246154785,
1.5359680652618408,
-0.38236427307128906,
-1.0247840881347656,
-0.5710830688476562,
-0.13421852886676788,
-0.04943707585... |
def clean ( self, value ) : if not self. create : # no new value can be created, use the regular clean field return super ( ). clean ( value ) # we have to do this here before the call to " super ". # it'll be called again, but we can't find a way to " pre _ clean " the # field value before pushing it into the parent c... | [
-1.04891037940979,
0.6318919062614441,
0.6837525367736816,
0.3872479796409607,
-0.6952480673789978,
0.3645156919956207,
0.12889529764652252,
-0.5928906798362732,
0.049531444907188416,
-0.1851149946451187,
-0.30831876397132874,
-0.7386777997016907,
-0.14562352001667023,
1.4190011024475098,
... |
def banded ( aa, va, up, down ) : # copy the inputs and determine the size of the system a = np. copy ( aa ) # create copies using numpy v = np. copy ( va ) n = len ( v ) # gaussian elimination ( gaussian - jordan gaussian jordan ) for m in range ( n ) : # normalization factor div = a [ up, m ] # update the vector firs... | [
0.3584650754928589,
0.057076744735240936,
0.8150632977485657,
-0.5403578281402588,
-0.2951149046421051,
0.18963609635829926,
1.0192071199417114,
0.1905636042356491,
1.0662124156951904,
1.2294930219650269,
0.8392297029495239,
0.7169679403305054,
-0.5357446670532227,
0.14154596626758575,
-... |
def listallcontacts ( self ) : feed = self. gd _ client. getcontacts ( ) self. printpaginatedfeed ( feed, self. printcontactsfeed ) | [
0.5124931931495667,
-1.4211996793746948,
0.38175854086875916,
-0.4018392860889435,
0.4259319603443146,
-0.6231110692024231,
-0.2095486968755722,
-1.3327577114105225,
0.011889536865055561,
-0.8075270652770996,
0.6475576758384705,
0.9041609168052673,
-0.09817846864461899,
0.4843437075614929,... |
def test _ addobservers ( self ) : originalcount = len ( self. _ getobservers ( ) ) self. runner. run ( self. test ) newcount = len ( self. _ getobservers ( ) ) self. assertequal ( newcount, originalcount ) | [
-0.10463060438632965,
0.4662298560142517,
0.567218542098999,
-0.32503119111061096,
1.152308702468872,
0.8377329111099243,
0.5642393827438354,
-0.048220183700323105,
0.08282653242349625,
-0.8699192404747009,
-0.9429800510406494,
-0.19360627233982086,
-0.2834060490131378,
0.06236231327056885... |
def save ( self, filepath, with _ stats = true ) : self. _ verify _ played _ status ( error _ on = false ) saved = { " game " : self, " teams " : { " home " : self. _ teams ['home'], " away " : self. _ teams ['away'] }, " winner " : " home " if self. _ teams ['home'] is self. _ stats ['winner'] else " away ", " score "... | [
-0.80483078956604,
-0.5376346707344055,
0.6790543794631958,
-0.622283399105072,
0.43852776288986206,
0.15203456580638885,
0.2793164849281311,
-1.1043336391448975,
-0.333810955286026,
0.6500760316848755,
-1.5416516065597534,
-0.26330631971359253,
0.5272077918052673,
0.35799768567085266,
-... |
def test _ multiple _ instance ( self ) - > none : id _ gen _ 1 = self. _ create _ id _ generator ( " first ", writers = [ " first ", " second " ] ) id _ gen _ 2 = self. _ create _ id _ generator ( " second ", writers = [ " first ", " second " ] ) async def _ get _ next _ async ( ) - > none : async with id _ gen _ 1. g... | [
-1.2476445436477661,
0.6510619521141052,
0.9271001219749451,
-0.4384177327156067,
1.108690619468689,
0.17495334148406982,
0.8179832100868225,
-0.2286009043455124,
-0.9254951477050781,
-0.1403324455022812,
-0.8981991410255432,
-0.6578859090805054,
-0.1453024446964264,
0.7332243919372559,
... |
def simulate _ gaintable _ from _ pointingtable ( vis, sc, pt, vp, vis _ slices = none, scale = 1. 0, order = 3, use _ radec = false, * * kwargs ) : nant = vis. vis. shape [ 1 ] gaintables = [ create _ gaintable _ from _ blockvisibility ( vis, * * kwargs ) for i in sc ] nchan, npol, ny, nx = vp. data. shape real _ spli... | [
0.5855233073234558,
0.32141345739364624,
0.8626651763916016,
0.4111030101776123,
-0.0289812870323658,
0.5175991654396057,
0.36065685749053955,
-0.16398270428180695,
0.28211525082588196,
1.1877847909927368,
0.1271326243877411,
0.4513341784477234,
0.5826717615127563,
0.5811939239501953,
0.... |
def getstaticmap ( layer, extension ='png ', ignore _ cached = false ) : start _ time = time ( ) mimetype, format = layer. gettypebyextension ( extension ) cache = layer. config. cache if not ignore _ cached : # start by checking for a tile in the cache. body = cache. read ( layer, layer. staticmap, format ) tile _ fro... | [
-0.3706684410572052,
-0.16025935113430023,
0.8559965491294861,
-0.04048607125878334,
-0.5710033178329468,
-0.4177814722061157,
0.5302072763442993,
-0.5091593265533447,
0.29036596417427063,
-0.15128730237483978,
-0.5387517809867859,
0.21234124898910522,
0.13352937996387482,
0.35946080088615... |
def get _ tiff _ page ( tiff _ file, page _ num, out _ dir ) : output _ file = os. path. join ( out _ dir,'obj. tiff') adjusted _ page = page _ num - 1 if os. path. exists ( output _ file ) and os. path. isfile ( output _ file ) and options. overwrite : os. remove ( output _ file ) logger. debug ( " { } exists and we a... | [
0.3147207200527191,
-0.5489665865898132,
0.7704259753227234,
0.4387264549732208,
-0.2884148061275482,
-0.017530882731080055,
0.5970267653465271,
0.2824346125125885,
-0.008529020473361015,
0.8547652959823608,
0.7424893975257874,
-0.02349613606929779,
-0.3238867223262787,
0.1364767849445343,... |
def handle _ starttag ( self, tag, attrs ) : self. path. append ( tag ) attrs = { k : v for k, v in attrs } # pylint : disable = r1721 if tag in self. cur : if isinstance ( self. cur [ tag ], list ) : self. cur [ tag ]. append ( { " _ _ parent _ _ " : self. cur } ) self. cur = self. cur [ tag ] [ - 1 ] else : self. cur... | [
-0.29238489270210266,
-0.827195405960083,
0.6785666346549988,
-0.7104647159576416,
-0.3126652240753174,
-0.591158390045166,
0.36317384243011475,
0.8030256628990173,
-0.2062274068593979,
-0.5974892377853394,
0.03287557512521744,
0.05509063974022865,
0.2513672411441803,
0.7163382768630981,
... |
def transform ( self, x, y = none ) : check _ is _ fitted ( self,'_ coverers') xt = check _ array ( x, ensure _ 2d = false ) # reshape filter function values derived from functiontransformer if xt. ndim = = 1 : xt = xt [ :, none ] n _ features _ fit = self. _ n _ features _ fit n _ features = xt. shape [ 1 ] if n _ fea... | [
-0.41909468173980713,
-0.13201318681240082,
0.6515201926231384,
0.7133400440216064,
0.05431023985147476,
-0.41856884956359863,
-0.2651654779911041,
-0.8702149987220764,
0.1399652063846588,
-0.35511672496795654,
-0.5794710516929626,
0.5745080709457397,
0.3741179406642914,
0.1948765963315963... |
def poly _ area ( p ) : # close the polygon if not p [ 0 ] [ 0 ] = = p [ - 1 ] [ 0 ] and p [ 0 ] [ 1 ] = = p [ - 1 ] [ 1 ] : p. append ( p [ 0 ] ) try : p = p. tolist ( ) except exception : pass def segments ( p ) : return zip ( p, p [ 1 : ] + [ p [ 0 ] ] ) return 0. 5 * abs ( sum ( x0 * y1 - x1 * y0 for ( ( x0, y0 ), ... | [
-0.3014870285987854,
-1.3320879936218262,
0.7881357669830322,
0.3803841471672058,
-0.18406212329864502,
0.42203596234321594,
0.5840775966644287,
-0.04806573688983917,
1.344377040863037,
0.4320937693119049,
0.09054067730903625,
-0.4440821707248688,
-0.7513821721076965,
-0.18464499711990356,... |
def binned _ phase _ plot ( prop, snaps, bin _ nums = 200, labels = none, color _ map = config. base _ cmap, foutname ='phase _ plot. png') : fig, axes, dims = plt _ set. setup _ figure ( len ( snaps ), sharey ='row') for i, snap in enumerate ( snaps ) : # set up for each plot axis = axes [ i ] plt _ set. setup _ axis ... | [
-0.2099219709634781,
-0.6605762243270874,
0.9941052198410034,
0.001839717268012464,
-0.3815902769565582,
0.5915814638137817,
0.6062543988227844,
0.18309232592582703,
0.0518970787525177,
-0.17630606889724731,
0.11175331473350525,
-0.11104748398065567,
0.3870866596698761,
0.0988466814160347,... |
def dust _ data _ vs _ time ( params, data _ objs, stat ='median ', subsample ='all ', foutname ='dust _ data _ vs _ time. png ', labels = none, style ='color - linestyle ', redshift = false, outside _ legend = false ) : # get plot stylization linewidths, colors, linestyles = plt _ set. setup _ plot _ style ( len ( dat... | [
0.7668516039848328,
0.24266919493675232,
0.7644681930541992,
0.26835352182388306,
0.08113619685173035,
0.6993768215179443,
0.31570953130722046,
-0.16317757964134216,
-0.12661001086235046,
-0.034726452082395554,
-0.213018536567688,
1.102851390838623,
0.488185852766037,
1.2417290210723877,
... |
def spark _ describe _ 1d ( config : settings, series : dataframe, summarizer : basesummarizer, typeset : visionstypeset, ) - > dict : # make sure pd. na is not in the series series = series. fillna ( np. nan ) # get ` infer _ dtypes ` ( bool ) from config if config. infer _ dtypes : # infer variable types vtype = type... | [
-0.6366477012634277,
0.6177491545677185,
0.5448079109191895,
-0.5134368538856506,
-0.38794633746147156,
-0.9238565564155579,
-0.18987803161144257,
-0.3945823609828949,
0.2525993585586548,
0.02341620810329914,
0.09902413934469223,
1.2912449836730957,
0.5266770720481873,
0.8422774076461792,
... |
def test _ get _ next _ txn ( self ) - > none : # prefill table with 7 rows written by'master'self. _ insert _ rows ( " master ", 7 ) id _ gen = self. _ create _ id _ generator ( ) self. assertequal ( id _ gen. get _ positions ( ), { " master " : 7 } ) self. assertequal ( id _ gen. get _ current _ token _ for _ writer ... | [
-0.25987446308135986,
0.6635192036628723,
0.6822839975357056,
-0.2057235985994339,
0.18802550435066223,
-0.7768009305000305,
0.46965718269348145,
-0.24782352149486542,
0.21983081102371216,
-0.6534562110900879,
-0.6322312355041504,
-0.8095026612281799,
0.09936252236366272,
-0.13785915076732... |
def undefine ( self, name ) : if name not in self. scopes [ - 1 ] : raise preprocessexception ( f'cannot undefine " { name } " ; it does not exist in the current scope. ', self. l ) del self. scopes [ - 1 ] [ name ] | [
-0.5343796610832214,
0.26713481545448303,
0.8480108976364136,
-1.0298494100570679,
0.1718841791152954,
-0.8598994016647339,
0.10741767287254333,
-0.05428844690322876,
-0.25067466497421265,
0.9979233741760254,
-0.4158223867416382,
1.3488298654556274,
-0.6294180750846863,
0.8700724840164185,... |
def data ( self ) : return self ['data'] | [
-0.6768079996109009,
-0.3401278853416443,
-0.05338745564222336,
-0.6098877191543579,
0.21300217509269714,
1.010585904121399,
-0.7187410593032837,
-0.33343416452407837,
0.6879361867904663,
-0.9570704698562622,
-0.5249341130256653,
0.4950958490371704,
0.44356316328048706,
-0.5497624278068542... |
def on _ delete _ 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 ='qu... | [
-0.3216426372528076,
-0.16773062944412231,
0.7311840653419495,
-0.41778817772865295,
-0.7070749998092651,
-0.25742945075035095,
0.6701267957687378,
-0.6885513663291931,
0.1998254805803299,
-0.07270051538944244,
0.2958393096923828,
0.25756171345710754,
-1.010789394378662,
0.5492503643035889... |
def init ( self, * args ) : return _ stepap209. stepap209 _ construct _ init ( self, * args ) | [
-0.9107444286346436,
-1.1074289083480835,
0.3084929883480072,
0.29381880164146423,
-0.33780163526535034,
-0.05517788603901863,
0.9771504402160645,
0.7864699363708496,
-0.47292065620422363,
-1.439871072769165,
-0.5458353757858276,
-0.2885819375514984,
0.27022725343704224,
0.4683308601379394... |
def data _ disks ( self ) - > pulumi. output [ optional [ sequence ['outputs. launchtemplatedatadisk'] ] ] : return pulumi. get ( self, " data _ disks " ) | [
-0.1771945357322693,
0.45971599221229553,
0.5412974953651428,
0.11224833875894547,
0.7502989172935486,
0.4601203203201294,
-0.2101869136095047,
0.35064923763275146,
0.6677751541137695,
-0.6923255920410156,
-1.0722407102584839,
0.8241989612579346,
0.8412859439849854,
-0.28749439120292664,
... |
def did _ save ( ls, params : didsavetextdocumentparams ) : config. setup ( ls ) if config. not _ frappe ( ) : return send _ diagnostics ( ls, params ) config. update _ doctype _ intellisense ( params ) | [
-0.4516463279724121,
-0.06891688704490662,
0.3880831003189087,
0.1998041719198227,
0.42736291885375977,
-0.4904903769493103,
0.18424579501152039,
0.3154700696468353,
0.3908517062664032,
0.8263245820999146,
-1.2563927173614502,
-0.5030960440635681,
-0.24310867488384247,
0.736122727394104,
... |
async def put _ missing _ discriminator ( self, complex _ body : " models. salmon ", * * kwargs ) - > " models. salmon " : cls = kwargs. pop ('cls ', none ) # type : clstype [ " models. salmon " ] error _ map = { 404 : resourcenotfounderror, 409 : resourceexistserror } error _ map. update ( kwargs. pop ('error _ map ',... | [
-1.2420248985290527,
-0.5975137948989868,
0.8330416083335876,
-0.44259968400001526,
-0.11973170936107635,
-0.3380392789840698,
0.4193044900894165,
0.26950812339782715,
0.3729429543018341,
0.054445140063762665,
-1.3886561393737793,
0.8765664100646973,
-0.6389756798744202,
-0.758542954921722... |
def addchild ( self, child ) : self. children. append ( child ) | [
0.1234462782740593,
0.2936619520187378,
0.3312947452068329,
0.2540842592716217,
-0.13402408361434937,
1.606666922569275,
-1.0320508480072021,
-0.08007728308439255,
-0.25323164463043213,
-1.353567123413086,
-1.2473869323730469,
0.004054592922329903,
0.08579429239034653,
0.06633662432432175,... |
def expansion _ coefficients ( self, f ) : # according to http : / / mathworld. wolfram. com / chebyshev - gaussquadrature. html the expansion # coefficients are obtained by chebyshev gauss quadrature for the integral # # / + 1 2 - 1 / 2 # a = 2 / pi | dx ( 1 - x ) f ( x ) t ( x ) # i / - 1 i # n # = 2 / pi sum w f ( x... | [
0.2761745750904083,
0.12352392822504044,
0.7961578965187073,
-0.15420642495155334,
-0.8671889901161194,
-0.4126136302947998,
-0.15958145260810852,
0.4992218017578125,
0.40146979689598083,
0.6572168469429016,
-0.06724144518375397,
-1.0817269086837769,
0.08416642248630524,
-0.069019444286823... |
def _ get _ nitro _ response ( self, service, response ) : try : result = service. payload _ formatter. string _ to _ resource ( nsacl6 _ response, response, self. _ _ class _ _. _ _ name _ _. replace ('_ stats ','' ) ) if ( result. errorcode! = 0 ) : if ( result. errorcode = = 444 ) : service. clear _ session ( self )... | [
-0.0008785171085037291,
-0.5061017274856567,
0.6011013984680176,
-0.4017521142959595,
-0.33188313245773315,
-1.2473373413085938,
0.1275816112756729,
-1.829549789428711,
0.6245315074920654,
-0.2199425846338272,
0.2471505105495453,
-0.5239076614379883,
-0.578205406665802,
-0.6184499859809875... |
def _ remove _ gaps ( df ) : logging. info ('removing gaps in scores') g = df. groupby ('subjectid') return g. apply ( _ remove _ gaps _ patient ). reset _ index ( drop = true ) | [
0.1052556112408638,
0.11901600658893585,
0.31783440709114075,
-0.45578011870384216,
-0.27066683769226074,
0.8604483604431152,
1.3475488424301147,
0.21569094061851501,
0.010412640869617462,
0.11029453575611115,
1.5420775413513184,
0.3055926263332367,
-0.5356072187423706,
-0.1457480341196060... |
def simulation _ wrapper ( t, p, question, discard, save ) : print'p is now :'+ str ( p ) cij = izhikevichmodularnetwork ( num _ neurons, num _ modules, num _ excitory _ per _ module, num _ connections _ e _ to _ e, num _ inhibitory ) net = generatenetwork ( cij, num _ excitory _ per _ module, num _ inhibitory, num _ e... | [
0.5507142543792725,
0.5028989911079407,
1.0813957452774048,
-0.1543455570936203,
0.2652904689311981,
0.3073762357234955,
0.8056421875953674,
0.17408733069896698,
0.06915246695280075,
0.39443591237068176,
0.3512917459011078,
0.08710448443889618,
-0.2716241478919983,
-0.5461868643760681,
0... |
def tmax2nodes _ op ( self, tmax _ fname ) : mstr = re. compile ( r " (? : (? : [ a - z ] + \ d * \ _ \ d + ) | (? : [ a - z ] + \ d + ) ) \ / [ a - z ] + " ) op _ list = [ ] infile = open ( tmax _ fname ) lines = infile. readlines ( ) for l in lines : mlist = re. findall ( mstr, l ) op _ list. extend ( mlist ) infile.... | [
-1.4573270082473755,
-0.7930831909179688,
0.669450044631958,
-0.2642492651939392,
-0.45253267884254456,
0.12120715528726578,
0.49504655599594116,
1.2653651237487793,
-0.5321168899536133,
1.7785625457763672,
-0.8536691069602966,
-0.5243050456047058,
0.5439888834953308,
-0.6591126322746277,
... |
def test _ cannot _ cancel _ after _ cancellation _ period ( self ) : event = baker. make _ recipe ('booking. future _ ev') url = reverse ('booking : cancellation _ period _ past ', kwargs = {'event _ slug': event. slug } ) self. client. login ( username = self. user, password = " test " ) resp = self. client. get ( ur... | [
0.3335539698600769,
0.5817087888717651,
0.4287518560886383,
1.2040283679962158,
-0.5568428039550781,
1.428755521774292,
-0.3729335069656372,
0.8960551619529724,
-0.4893094599246979,
-0.4665818512439728,
0.10510976612567902,
-0.31137603521347046,
0.2140990048646927,
0.17918218672275543,
1... |
def testprepareforexport ( self ) : with apitestcase. usingcloudapi ( ) : base _ collection = ee. imagecollection ( ee. image ( 1 ) ) collection, params = base _ collection. prepare _ for _ export ( {'something':'else'} ) self. assertequal ( base _ collection, collection ) self. assertequal ( {'something':'else'}, para... | [
-0.49200406670570374,
0.3218400478363037,
0.5285930037498474,
-0.41796374320983887,
0.8141136765480042,
-0.5884939432144165,
-0.212037593126297,
-0.532095193862915,
0.4569779336452484,
-0.11595387756824493,
-0.6050690412521362,
-0.13214929401874542,
0.2519823908805847,
0.46137118339538574,... |
def train ( self, inputs : [ np. array ], targets : [ np. array ], epochs : int, lr : float, momentum : float, decay : float ) - > list : errors = [ ] for epoch in range ( epochs ) : error = 0 for input _, target in zip ( inputs, targets ) : self. _ train _ pattern ( input _, target, lr, momentum, decay ) for input _, ... | [
-1.1667561531066895,
-0.0938355028629303,
0.8241695165634155,
0.41564056277275085,
0.7074993848800659,
-0.4099060297012329,
0.45973122119903564,
0.41098013520240784,
-0.6971073746681213,
0.07509570568799973,
-0.024986376985907555,
0.4643128514289856,
0.45201659202575684,
0.6000128388404846... |
def color ( modifier : str, color : str ) - > _ color : if ( modifier, color ) in _ colors : return _ colors [ ( modifier, color ) ] return _ color ( modifier, color ) | [
-0.6721643209457397,
-0.31961682438850403,
0.21613559126853943,
-0.466430127620697,
0.1587306559085846,
-0.6350160837173462,
-1.2633031606674194,
0.22829462587833405,
0.4567619264125824,
0.007071554660797119,
0.308196097612381,
1.65395188331604,
-0.13423645496368408,
0.5093715786933899,
... |
def setup _ camera ( ) : # make the base directory # dir _ util. mkpath ( photo _ dir ) # define physical input variables preview _ button = button ( 14 ) photo _ button = button ( 15 ) camera = picamera ( ) camera. preview _ fullscreen = false prev _ width = int ( size * ratio ) horizontal _ offset = int ( ( screen _ ... | [
-0.6272631287574768,
0.015542046166956425,
0.5453383326530457,
0.18294231593608856,
-0.724928617477417,
-0.2114361822605133,
0.7726530432701111,
-0.22818224132061005,
0.2800811529159546,
-0.2579897344112396,
-0.9235695600509644,
-0.6430495381355286,
0.3439824879169464,
1.1745020151138306,
... |
def disconnect ( self ) : # remove all normal callbacks for name in self. _ disconnectnames : mxs. callbacks. removescripts ( id = _ n ( name ) ) self. _ scenemergefinishedtimer. stop ( ) # undefine the add callback function mxs. cross3daddcallback = none # remove the callback pointer to cross3d mxs. cross3d = none # r... | [
0.14832031726837158,
0.3491169214248657,
0.5434203147888184,
0.058487940579652786,
-0.11139952391386032,
0.05751907080411911,
-0.435484379529953,
-0.2941615581512451,
1.0639979839324951,
-0.14575150609016418,
-0.5257702469825745,
-0.6726614832878113,
-1.0597230195999146,
0.7547707557678223... |
def spell _ tokenizer ( text ) : tokens = [ ] corrector = jamspell. tspellcorrector ( ) corrector. loadlangmodel ('model _ en. bin') for word in casual _ tokenize ( rm _ punctuation ( text ), preserve _ case = false, reduce _ len = true, strip _ handles = true ) : if not ( bool ( re. search ( r'\ d ', word ) ) ) : corr... | [
-0.6437405943870544,
-0.8973645567893982,
0.4606943428516388,
0.07231343537569046,
-0.8191189169883728,
0.12183044105768204,
0.010205637663602829,
1.2804313898086548,
0.5203659534454346,
0.13773487508296967,
-0.6206222176551819,
-0.13388928771018982,
-0.39700382947921753,
0.995858013629913... |
def get _ descriptive _ name ( self ) : long _ name = str ( self. year ) +'' + self. make +'' + self. model return long _ name. title ( ) | [
0.3345046043395996,
-0.4570463299751282,
0.7742927670478821,
-0.8036664724349976,
-0.8023822903633118,
1.0761717557907104,
-1.127629041671753,
-0.3581741154193878,
0.014799265190958977,
0.47589918971061707,
0.3332749605178833,
0.4172672927379608,
1.2979954481124878,
0.3136419355869293,
-... |
def initialize _ dock ( ) : # register dock via mac return uuid. getnode ( ) | [
-0.18354786932468414,
0.8066794872283936,
0.33231309056282043,
0.9341641068458557,
0.23508015275001526,
0.05612004175782204,
0.8466954827308655,
0.975168764591217,
-0.08683833479881287,
-0.4549132287502289,
-0.26149338483810425,
0.5238197445869446,
-0.002838722663000226,
0.2602985799312591... |
def update ( self, e =..., * * f ) : # - > none :... | [
-1.0508259534835815,
-0.21522624790668488,
0.27194949984550476,
0.7113044261932373,
0.40728840231895447,
0.2654385566711426,
0.33106517791748047,
0.3912782669067383,
-1.004284381866455,
-0.279651015996933,
-0.7278545498847961,
-0.12301641702651978,
0.031227463856339455,
0.04186564683914184... |
def genes ( ) : query = request. args. get ('query ','' ) if'|'in query : hgnc _ id = int ( query. split ('| ', 1 ) [ 0 ] ) return redirect ( url _ for ( '. gene ', hgnc _ id = hgnc _ id ) ) gene _ q = store. all _ genes ( ). limit ( 20 ) return dict ( genes = gene _ q ) | [
-0.2432565987110138,
0.6566018462181091,
0.49309560656547546,
0.02811727114021778,
-0.02251291275024414,
-0.4132598340511322,
-0.38198310136795044,
0.509479820728302,
-0.6306187510490417,
-0.34143388271331787,
0.11202625185251236,
-0.03180317580699921,
0.28012144565582275,
0.83000254631042... |
def run ( self ) : while true : self. _ check _ events ( ) if self. stats. game _ active : self. target. update _ target ( ) self. ship. update _ ship ( ) self. _ update _ bullets ( ) self. _ update _ display ( ) | [
-0.464915007352829,
-1.0722618103027344,
0.644529402256012,
-0.15366359055042267,
0.38950541615486145,
-0.08151320368051529,
0.45736122131347656,
-0.9413179755210876,
0.04593806713819504,
0.06833887845277786,
-0.13557246327400208,
0.1914527416229248,
-0.4084030091762543,
-0.634688317775726... |
def promptoperationshouldcontinue ( self ) : while true : input = raw _ input ( " continue [ y / n ]? " ) if input is'n'or input is'n': return false elif input is'y'or input is'y'or input is'' : return true | [
0.3446134030818939,
0.248998761177063,
0.8455407619476318,
1.2374844551086426,
-1.073133111000061,
0.7955865859985352,
0.21272647380828857,
-0.5837699174880981,
0.2998719811439514,
-0.6250863671302795,
0.13290345668792725,
-0.9636091589927673,
-0.4636526107788086,
-0.6717504858970642,
-0... |
def logout _ view ( request ) : headers = forget ( request ) next _ url = request. route _ url ('login') return httpfound ( location = next _ url, headers = headers ) | [
-0.7573327422142029,
0.010982713662087917,
0.6785430908203125,
-0.6787960529327393,
-0.6706141829490662,
-0.46021077036857605,
0.3851441442966461,
-0.029010692611336708,
0.02756390906870365,
-0.6962658762931824,
1.2418410778045654,
0.09686186164617538,
0.27149876952171326,
-0.8782033920288... |
def export _ to _ csv ( self, request, queryset ) : # get access to the model meta class. # this usually defined at the end of the model class opt = self. model. _ meta # create content _ disposition, that is to be passed to the response. # here we tell that the response contains a file attachment and the # name of the... | [
-0.5882629752159119,
-0.5659207701683044,
0.6249968409538269,
0.25416210293769836,
0.27904805541038513,
-0.25210297107696533,
0.3667217195034027,
-0.9307425022125244,
-0.3244990408420563,
-0.06805717200040817,
0.3090674579143524,
-0.2669031023979187,
0.5320115089416504,
-0.1826253533363342... |
def cid _ oldnewsurvival ( self, bootstrap = false, n _ iter = 200 ) : def cid _ cat _ count ( x, mix = true ) : return ( x ['true _ new'] + 1 ). unique ( ). sum ( ) def date _ cat _ count ( x ) : return x. cohortid. drop _ duplicates ( ). shape [ 0 ] def calculate _ percentages ( df ) : mix _ counts = df. \ groupby ( ... | [
0.3699524998664856,
0.09296255558729172,
0.8552395701408386,
0.00656033493578434,
-0.4064564108848572,
0.21968649327754974,
0.27157077193260193,
0.027867775410413742,
-0.356101393699646,
0.5910084247589111,
0.3320988714694977,
0.17312529683113098,
0.6146878600120544,
0.2896832227706909,
... |
def show _ ind _ plot ( u ) : # plotting the trajectory, let's get the x and y values out! x, y = u [ :, 2 ], u [ :, 3 ] # visualization of the path pyplot. figure ( figsize = ( 8, 6 ) ) pyplot. grid ( true ) pyplot. xlabel ( r'x ', fontsize = 18 ) pyplot. ylabel ( r'y ', fontsize = 18 ) pyplot. title ('glider trajecto... | [
0.6518957614898682,
1.013806700706482,
0.6124072074890137,
-0.3556210398674011,
-0.9580367803573608,
0.6546627283096313,
0.859391450881958,
0.8089768886566162,
0.05420520529150963,
-0.1476181000471115,
0.25369057059288025,
0.7445049285888672,
0.23671093583106995,
0.03353295475244522,
0.6... |
def test _ second ( self ) : where ['record'] = os. getcwd ( ) | [
1.6141632795333862,
0.018561286851763725,
0.2791129946708679,
0.281058669090271,
0.7997220754623413,
-0.36394816637039185,
1.542816162109375,
-0.6773657202720642,
-0.919424295425415,
-0.6077114343643188,
-0.1789829581975937,
0.7882477045059204,
0.29370972514152527,
-0.07036986947059631,
... |
def search ( problem, h ) : h = memoize ( h,'h') return best _ first _ graph _ search ( problem, lambda n : n. path _ cost + h ( n ) ) | [
-0.11058569699525833,
0.8662786483764648,
0.29897069931030273,
1.645024061203003,
0.09822197258472443,
-0.17844171822071075,
-0.23240719735622406,
0.032753389328718185,
-0.4355946481227875,
0.06415422260761261,
0.09070165455341339,
0.05573106184601784,
-0.566533088684082,
0.454906255006790... |
def blur _ bilateral ( im : np. ndarray, fac : float ) - > np. ndarray : fac = np. interp ( fac, [ 0. 0, 1. 0 ], [ 0. 0, 0. 1 ] ) dim _ max = max ( im. shape [ : 2 ] ) k = max ( 1, int ( fac * dim _ max ) ) k = k if k % 2 else k + 1 radius = k / / 5 # blur = cv2. bilateralfilter ( img, 9, 75, 75 ) im _ dst = cv. bilate... | [
0.736579418182373,
-0.27625399827957153,
0.7015438079833984,
1.0787415504455566,
-0.324395090341568,
0.17984363436698914,
1.3131351470947266,
-0.9956119060516357,
-0.1181347668170929,
-0.1433449536561966,
0.4884423613548279,
1.4216264486312866,
0.45444971323013306,
-0.2889445722103119,
0... |
def _ _ init _ _ ( self, size = 0, position = ( 0, 0 ) ) : self. size = size self. position = position | [
0.27684494853019714,
-0.9045714139938354,
0.5150852799415588,
-0.14465978741645813,
-0.11719752848148346,
-0.051790639758110046,
-0.8145109415054321,
0.18284763395786285,
0.4291955232620239,
-0.3742460310459137,
-0.9496942758560181,
-0.11846145987510681,
-0.21012482047080994,
0.43196997046... |
def upload _ remote _ file ( request ) : response = apiresponse ( ) response. data = { " status " : " failed " } response. code = 302 if request. method = ='post': # check if the post request has the file part if'file'in request. files : file = request. files ['file'] print ( file. name ) # if user does not select file... | [
-0.6039236187934875,
-0.1253361701965332,
0.8524479866027832,
-0.20479907095432281,
-0.18962523341178894,
0.7356767058372498,
0.15805958211421967,
0.3880595862865448,
-0.31175023317337036,
0.4029313623905182,
-0.3518773913383484,
0.19751395285129547,
-0.6798031330108643,
0.5732247233390808... |
def make _ app ( ) : application = web. application ( [ ( " / ", runselecthandler ), ( " / metricselect ", metricselecthandler ), ( " / metricresults ", metricresultspagehandler ), ( " / getdata ", datahandler ), ( " / configparams ", configpagehandler ), ( " / summarystats ", statpagehandler ), ( " / allmetricresults ... | [
0.4306342899799347,
-0.49329468607902527,
0.5706005692481995,
0.7383205890655518,
-0.39564257860183716,
1.164637804031372,
1.0799353122711182,
-0.5501323342323303,
0.17328335344791412,
-0.7737314701080322,
-0.18357285857200623,
-0.13949823379516602,
0.3860657215118408,
0.17798486351966858,... |
def _ _ init _ _ ( self ) : self. scheme ='http'self. netloc ='nota. real. netloc'self. apiloc ='nota. real. apiloc'self. imgloc ='nota. real. imgloc ' | [
-0.4286821186542511,
-1.1990034580230713,
0.23318946361541748,
-0.3458250164985657,
0.4052765965461731,
0.05007980763912201,
0.4914536774158478,
0.16156549751758575,
0.38601911067962646,
-0.10402348637580872,
-0.8675919771194458,
-0.23121377825737,
0.9973602294921875,
0.778542697429657,
... |
def _ add _ vea ( server _ vea, db _ vio _ server, context, db _ session, dom _ factory ) : msg = ( ras. vif _ get _ msg ('info ','reconcile _ vea _ add _ start') % {'host': db _ vio _ server. get _ host _ name ( ),'vios': db _ vio _ server. lpar _ id,'adpt': server _ vea. name } ) ras. trace ( log, _ _ name _ _, ras. ... | [
-0.14538711309432983,
-0.48141294717788696,
0.7465996146202087,
-0.27997341752052307,
0.895904004573822,
-0.018502095714211464,
0.3564925491809845,
0.6185892820358276,
0.6321292519569397,
0.24916620552539825,
-0.14394022524356842,
0.1541011482477188,
0.25489506125450134,
0.5803330540657043... |
def start _ response ( self, status, headers, exc _ info = none ) : # noqa : wps238 # " the application may call start _ response more than once, # if and only if the exc _ info argument is provided. " if self. started _ response and not exc _ info : raise runtimeerror ('wsgi start _ response called a second'' time wit... | [
-0.5723017454147339,
-1.0254219770431519,
0.4526335299015045,
0.4170524477958679,
0.18104366958141327,
-0.6253859400749207,
0.2409932166337967,
-0.2929699420928955,
-0.02557932585477829,
-0.1907370239496231,
-0.2523975074291229,
-0.3260582983493805,
-0.5058717131614685,
0.3110917806625366,... |
def setupclass ( cls ) : file _ path = os. path. join ( tests _ dir,'contingencies _ full. xlsx') cls. contingency _ data = testmodule. importcontingencies ( pth = file _ path ) | [
1.1206387281417847,
-0.8875035643577576,
0.4528498947620392,
-0.3137272894382477,
0.7584646940231323,
0.9346386194229126,
1.1104131937026978,
1.3694401979446411,
0.24931474030017853,
0.0666782557964325,
-0.7209988832473755,
-0.27832555770874023,
0.08626729995012283,
-0.42021793127059937,
... |
def binary _ search ( val, vec, exact = true ) : validate _ input ( isinstance ( val, ( float, int ) ), " val must be numeric " ) validate _ input ( isinstance ( vec, list ), " vec msut be a list " ) return binary _ search _ helper ( val, vec, 0, exact ) | [
-0.3548746705055237,
0.30203312635421753,
0.5441931486129761,
0.7949340343475342,
0.27098870277404785,
0.7263039946556091,
0.2337108999490738,
-0.7186877131462097,
-0.8911145925521851,
0.45490485429763794,
-0.08194880187511444,
0.6239640116691589,
-0.4829622805118561,
0.5367431044578552,
... |
def is _ superpanel ( self ) : return self. superpanel | [
0.33466434478759766,
0.23113831877708435,
0.2847554385662079,
0.8617068529129028,
-0.47780391573905945,
0.5818536281585693,
-0.2173687070608139,
-0.06881018728017807,
0.8803904056549072,
-0.5255177021026611,
-1.1115031242370605,
0.809943437576294,
-1.0982942581176758,
0.16930949687957764,
... |
def natural _ sort ( vals ) : all _ str = all ( isinstance ( x, ( str, unicode ) ) for x in vals ) sv = sorted ( vals, key = sortkey _ natural ) if all _ str else sorted ( vals ) return sv | [
-1.097830057144165,
0.19175973534584045,
0.31698569655418396,
0.5119211673736572,
-0.791449785232544,
-0.17014184594154358,
-1.350389838218689,
-0.7390711307525635,
-1.0951073169708252,
-0.1783415824174881,
0.2751704752445221,
0.3255093991756439,
-0.53958660364151,
0.8130086660385132,
-1... |
def minimax ( board ) : if terminal ( board ) : return none else : if player ( board ) = = x : return maxvalue ( board ) [ 1 ] elif player ( board ) = = o : return minvalue ( board ) [ 1 ] raise notimplementederror | [
0.018853411078453064,
-0.35305798053741455,
0.6307960152626038,
0.7527543902397156,
-1.1301865577697754,
-0.256820410490036,
-0.40118443965911865,
-0.35878509283065796,
0.6994765996932983,
-0.048725105822086334,
0.050125852227211,
0.6799870729446411,
-0.18159343302249908,
-0.64874804019927... |
def toggle ( self, key ) : if self. toggables. has _ key ( key ) : self. toggables [ key ] = not self. toggables [ key ] appuifw. note ( u " toggle % s is not implemented yet! " % key,'error') else : appuifw. note ( u " togglekey % s is not found! " % key,'error') | [
-1.6415389776229858,
0.4492601752281189,
0.5438987612724304,
-0.02231026627123356,
-0.16312569379806519,
0.3113677501678467,
0.3708498477935791,
0.6483674049377441,
0.0073139481246471405,
1.2772318124771118,
-0.15238511562347412,
0.1928505301475525,
-1.19594407081604,
1.0351167917251587,
... |
def _ _ gettoptendnsserver ( ) : dbc = connection _ handler. getconnection ( ) labels, sizes = [ ], [ ] for server in dbc. gettoptendnsserver ( ) : labels. append ( server [ 0 ] ) sizes. append ( server [ 1 ] ) return labels, sizes | [
-2.009572744369507,
0.1325543373823166,
0.6874293684959412,
-1.5005908012390137,
0.18020784854888916,
-0.08520076423883438,
-0.34818750619888306,
-0.09523774683475494,
0.07125990837812424,
0.4886493980884552,
-1.265872597694397,
0.4480257034301758,
-0.1912962645292282,
0.45098817348480225,... |
def getsmalldependencelowgraylevelemphasisfeaturevalue ( self ) : ivector = self. coefficients ['ivector'] jvector = self. coefficients ['jvector'] nz = self. coefficients ['nz'] sdlgle = numpy. sum ( self. p _ gldm / ( ( ivector [ none, :, none ] * * 2 ) * ( jvector [ none, none, : ] * * 2 ) ), ( 1, 2 ) ) / nz return ... | [
0.4926484227180481,
-0.02448277547955513,
0.5387471318244934,
-0.5244988799095154,
-0.4581364095211029,
0.7021123170852661,
0.757487416267395,
-0.15716342628002167,
0.40212732553482056,
-0.09119763225317001,
-0.16626375913619995,
0.3914237916469574,
-0.722250759601593,
0.5454210638999939,
... |
def pdf ( self, state1, state2, * * kwargs ) : # calculate difference before to handle custom types ( mean defaults to zero ) # this is required as log pdf coverts arrays to floats likelihood = multivariate _ normal. logpdf ( ( state1. state _ vector - self. function ( state2, * * kwargs ) ). ravel ( ), cov = self. cov... | [
0.345941960811615,
-0.7236376404762268,
0.6064382791519165,
0.05298657715320587,
-0.3976101577281952,
0.1417095959186554,
-1.0842398405075073,
0.010610749013721943,
0.025429867208003998,
0.01748551055788994,
0.44287362694740295,
0.6669648885726929,
0.2631571292877197,
-0.5872031450271606,
... |
def start ( self ) : # do nothing if we are already running. if self. running : return # setup event handlers. self. _ setup _ event _ handlers ( ) # update the pipeline. self. update _ pipeline ( ) # call parent method to start the children and set the state. super ( filter, self ). start ( ) | [
-0.08708783239126205,
-0.29456695914268494,
0.24077630043029785,
0.37265896797180176,
0.44553741812705994,
-0.4879523515701294,
0.8812408447265625,
0.3429199159145355,
-0.30998319387435913,
-0.2212553173303604,
-0.40793493390083313,
0.5317818522453308,
0.2613738477230072,
0.208684295415878... |
def fromwaves ( cls, waves, unk02 = 0 ) : obj = cls ( unk02 = unk02 ) obj. waves = waves return obj | [
0.9664722084999084,
-0.6199358701705933,
0.38996422290802,
0.12254521995782852,
-1.295345425605774,
0.5158290266990662,
0.5912630558013916,
-0.43227314949035645,
0.8093190789222717,
-0.7395660281181335,
-1.06929349899292,
-0.3359203338623047,
-0.5438544750213623,
1.0639922618865967,
-0.6... |
def get _ blos _ score ( matrix, a, b ) : a = a. upper ( ) b = b. upper ( ) if a not in matrix or b not in matrix [ a ] : raise invalidpairexception ('[ % s, % s ]'% ( a, b ) ) return int ( matrix [ a ] [ b ] ) | [
0.37306803464889526,
-0.32446160912513733,
0.7999491691589355,
-0.3255844712257385,
-0.7287703156471252,
-0.1668865829706192,
-0.2220427244901657,
-0.9574248194694519,
-0.7247233390808105,
0.39010322093963623,
1.1192997694015503,
0.6829204559326172,
-0.7273499369621277,
-0.6470966339111328... |
def _ solve _ search _ problems ( self, iteration _ index, search _ problems ) : # search problems are sorted based on the regions from north - west to south - east in the x - y plane # x - axis : the criterion at index 0 of the projected space criteria # y - axis : the criterion at index 1 of the projected space crite... | [
-0.14545504748821259,
-0.11764658987522125,
0.608628511428833,
-0.17763495445251465,
0.5790905952453613,
0.8856204748153687,
-0.28803592920303345,
-0.14823569357395172,
-0.010401706211268902,
0.46888047456741333,
-0.14864306151866913,
-0.6432669758796692,
-0.7019189596176147,
-0.4565644860... |
def _ get _ df _ dys _ and _ dy _ dws ( fn : callable [ [ pytree ], pytree ], params : pytree, _ j _ rules : bool, _ s _ rules : bool, _ fwd : optional [ bool ] ) - > tuple [ pytree, pytree ] : def primals _ out _ and _ pullback ( mode : _ mode ) - > pytree : return _ get _ primals _ out _ and _ pullback ( fn, mode, _ ... | [
-1.0329169034957886,
0.6623718738555908,
0.5705956816673279,
-0.23683232069015503,
0.2278362512588501,
-0.7596603631973267,
0.4683513641357422,
0.15372058749198914,
-0.5417115092277527,
-0.7654330730438232,
0.1915135532617569,
-0.04960862919688225,
1.0616763830184937,
0.7874419093132019,
... |
def parserangednumber ( string ) : try : # 0 - 0 val = int ( string ) return [ val ] except valueerror : if string. startswith ( " [ " ) and string. endswith ( " ] " ) : # range representation r = re. compile ( " \ [ ( [ 0 - 9 ] + ) - ( [ 0 - 9 ] + ) \ ] " ) m = r. search ( string ) if m : first _ number = m. group ( 1... | [
-0.423668771982193,
-0.7926788330078125,
0.6918145418167114,
0.3115386664867401,
-0.06603063642978668,
-0.17178627848625183,
0.7282121181488037,
0.30877432227134705,
0.0894361063838005,
-0.5087165832519531,
-0.8710225224494934,
0.38909149169921875,
-0.8804416060447693,
-0.29049620032310486... |
def shortcuts _ file ( self ) : return os. path. join ( self. _ user _ config _ directory ( ), " shortcuts. vdf " ) | [
0.9068834185600281,
-0.010906368494033813,
0.2741215229034424,
0.6098228096961975,
0.15814334154129028,
0.8269283771514893,
1.1154968738555908,
0.59312504529953,
-0.25457364320755005,
0.5193316340446472,
0.7621690630912781,
0.7582919597625732,
0.1967342495918274,
-0.6818820238113403,
-0.... |
def test _ profile _ status _ code ( self ) : # user must be logged in. user = user. objects. create _ user ( username ='test _ profile _ user ', password ='password') self. client. login ( username ='test _ profile _ user ', password ='password') response = self. client. get ('/ user _ auth / profile /') user. objects... | [
0.4078424870967865,
-0.11329775303602219,
0.43261823058128357,
1.2721202373504639,
0.7021586894989014,
0.6237508654594421,
0.3858627378940582,
0.2513609528541565,
0.37219130992889404,
-0.1727055013179779,
-0.7594549655914307,
-0.30976396799087524,
0.29225239157676697,
-0.3212127089500427,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.