text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def save ( obj, name ) : with open ( name,'wb') as f : pickle. dump ( obj, f ) | [
0.027663584798574448,
-1.0654104948043823,
0.3643472194671631,
-0.34371569752693176,
-0.39402836561203003,
0.530423104763031,
-0.1923198401927948,
-0.3928346335887909,
-0.23259027302265167,
1.021727204322815,
-2.0185189247131348,
-0.6153256297111511,
0.22658222913742065,
-0.561596333980560... |
def _ request _ json ( self, service, request, token, method ='get') : try : r = self. _ request ( service, request, token, method ) json = r. json ( ) return json if json else none except : return | [
-1.5654199123382568,
-0.34215661883354187,
0.5650671124458313,
-0.2752203643321991,
-0.5360085368156433,
-1.6299808025360107,
-1.4977877140045166,
-1.7252914905548096,
0.049136992543935776,
0.04312463104724884,
0.3589472770690918,
0.9616961479187012,
-0.20385819673538208,
-0.54066818952560... |
def substitute _ config ( self, config : any, config _ values : optional [ dict [ str, str ] ] = none ) - > any : if config _ values is none : config _ values = self. get _ values ( ) return self. _ substitutor. substitute _ all _ config _ variables ( config, config _ values ) | [
-0.12375659495592117,
-0.1166313961148262,
0.31326785683631897,
0.09439774602651596,
-0.3852179944515228,
-0.5593905448913574,
-0.7031062841415405,
1.4803227186203003,
0.2876478433609009,
-0.5295464396476746,
-0.8978610038757324,
-0.1593731790781021,
-0.18141493201255798,
1.002288103103637... |
def test _ primitive _ value ( self ) : assert [ * keys ( 5 ) ] = = [ ] | [
-1.2796902656555176,
0.7730859518051147,
0.12127458304166794,
-0.3660084009170532,
0.4237620532512665,
0.21324458718299866,
-0.7095521092414856,
-0.0642433911561966,
-0.4930828809738159,
-0.3466396927833557,
-1.1064155101776123,
0.13532696664333344,
-0.4806937873363495,
0.667664110660553,
... |
def manifest ( rgb _ p ) : return {'manifest _ version': 2,'name':'wal _ chrome ','version':'1. 0 ','theme': {'images': {'theme _ ntp _ background':'img / theme _ ntp _ background. jpg ','theme _ toolbar':'img / theme _ toolbar. png ','theme _ frame':'img / theme _ frame. png ', },'colors': {'tab _ text': rgb _ p [ 7 ]... | [
-0.4397175908088684,
-0.5220848321914673,
0.6165792942047119,
-1.0228242874145508,
-0.500072181224823,
0.3894703984260559,
-1.0625941753387451,
-0.807116687297821,
0.0324702225625515,
0.8514102697372437,
-0.6743924021720886,
0.23602335155010223,
0.2448710948228836,
0.27281874418258667,
0... |
def compute _ burger ( n2, h, f, r ) : bu = ( n2 * h * * 2 ) / ( f * * 2 * r * * 2 ) return bu | [
-0.0703357681632042,
-0.09246043115854263,
0.18963706493377686,
1.62825608253479,
0.08330617100000381,
-0.5377695560455322,
0.34574514627456665,
0.21826669573783875,
-1.7647857666015625,
-0.17154739797115326,
-0.24190297722816467,
0.31144413352012634,
-0.853668212890625,
0.7127143740653992... |
def get _ row _ count ( self ) : return self. cnt _ row | [
0.3292820453643799,
0.7738844156265259,
0.34413397312164307,
0.3193274438381195,
0.8808386325836182,
0.10509365051984787,
0.5867119431495667,
0.6857715249061584,
-0.4909540116786957,
-0.5390468835830688,
0.788534939289093,
0.0664045587182045,
0.4509575664997101,
1.1441715955734253,
0.608... |
def mar _ exp _ linear _ mc ( self, x, s, n ) : def get _ given _ data ( idx ) : val = np. array ( [ x [ idx ] ] ) val = np. tile ( val, n ) return val if len ( s )! = len ( x ) : rg, _ = self. gen _ data ( n ) rg _ data = pd. dataframe ( rg, columns = [ str ( n ) for n in self. index ] + [ str ( ca ) for ca in self. c... | [
0.3993697166442871,
-0.01426086388528347,
0.4602169394493103,
-0.20454587042331696,
-0.5704056620597839,
-0.04094773530960083,
-0.2948412001132965,
0.5153931379318237,
0.8849072456359863,
0.12899695336818695,
-0.34879550337791443,
0.733025848865509,
-0.3523405194282532,
0.5100831389427185,... |
def test _ loginform _ get ( self ) : with patch ('user _ auth. views. loginform') as form : # access the url. # loginform is mocked. self. client. get ('/ user _ auth / login /') form. assert _ called _ with ( ) | [
-0.4196719527244568,
0.19490355253219604,
0.3166254460811615,
-0.44159311056137085,
0.4439871907234192,
-0.3119255304336548,
-0.2154363989830017,
-0.20893177390098572,
0.4078226685523987,
-1.7359862327575684,
-0.6110290288925171,
0.6799297332763672,
0.28386160731315613,
-0.6953412294387817... |
def _ set _ up _ eth _ usb ( self ) : # use rndis mode # send _ val = b " \ x01 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x01 \ x00 \ x04 " # use cdc / ecm mode send _ val = b " \ x01 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x01 \ x01 \ x04 " try : ser = serial. serial ( " / dev / ttyacm0 ", 9600, serial. eightbits, serial. p... | [
-0.17123858630657196,
0.6143534183502197,
0.9346271753311157,
-0.21269330382347107,
1.3164918422698975,
0.1561874896287918,
0.8674671649932861,
-0.4283984899520874,
0.42202144861221313,
-0.46437108516693115,
-0.5812122821807861,
-0.29868054389953613,
0.02286297082901001,
0.0278741586953401... |
def _ _ init _ _ ( self, perm _ length, base = none ) : self. perm _ length = perm _ length self. number _ of _ perms = factorial ( perm _ length ) if base is not none : self. base = base else : self. base = list ( range ( perm _ length ) ) | [
0.43223947286605835,
0.07574619352817535,
0.5770739912986755,
0.432834267616272,
-0.5889180898666382,
-0.36536818742752075,
-0.04646824672818184,
1.172375202178955,
0.734538197517395,
-0.34918585419654846,
-0.7482970356941223,
0.15916015207767487,
-1.165158748626709,
0.501160204410553,
0... |
def parse ( self, data ) : headers _ end = self. get _ headers _ end ( data ) body _ raw = data [ headers _ end : ] head _ fields = data [ : headers _ end ] \. decode ('utf - 8 ', errors ='ignore') \. splitlines ( ) processed _ fields = [ head _ fields [ 0 ] ] headers = { } for field in head _ fields [ 1 : - 1 ] : try ... | [
-0.6674734354019165,
-0.26534926891326904,
0.9008979201316833,
-0.7186000943183899,
-1.1584887504577637,
-0.5558357834815979,
-0.7089674472808838,
-0.4607316851615906,
-0.713754415512085,
0.6276927590370178,
-0.5473517179489136,
0.46670812368392944,
-0.15565748512744904,
-0.311655789613723... |
def get _ queryset ( self ) : return question. objects. filter ( pub _ date _ _ lte = timezone. now ( ) ) | [
0.7628874182701111,
-0.9664198160171509,
0.634074866771698,
0.8501144051551819,
0.18597173690795898,
1.1857110261917114,
-0.7078408002853394,
-0.08528543263673782,
-0.6716973781585693,
-0.35995715856552124,
0.9430018663406372,
0.3661569058895111,
-0.36039960384368896,
0.4249247908592224,
... |
def zip ( self, * args ) - > tuple : # get the shortest length among iterables min _ arg _ length = len ( min ( args, key = len ) ) for i in range ( min _ arg _ length ) : output = [ ] for arg in args : # check if object is a dictionary if self. is _ mapping ( arg ) : keys = list ( arg. keys ( ) ) output. append ( keys... | [
-1.4736992120742798,
-0.07497309148311615,
0.8201192617416382,
0.415134996175766,
-0.01009951252490282,
0.19470998644828796,
-0.34524500370025635,
0.22297948598861694,
-0.3992902338504791,
0.034849897027015686,
-0.15619434416294098,
-0.8102784752845764,
-0.14486555755138397,
0.221942618489... |
def _ _ getitem _ _ ( self, key ) : return self. _ items [ key ] | [
-1.1783324480056763,
-0.32173433899879456,
0.21241594851016998,
-0.4717964231967926,
-0.5114990472793579,
0.04569070041179657,
-0.39547255635261536,
-0.8876264691352844,
-0.6396787166595459,
-0.06522539258003235,
0.43965816497802734,
-0.10131430625915527,
0.4129848778247833,
-1.03516960144... |
def makezipinfotuples ( ) : zipinfotuples = [ ] with open ('forecast / zipcode - clean. csv ','r') as csvfile : csvreader = csv. reader ( csvfile, delimiter = ', ', quotechar ='"') for ( csv _ zipcode, city, state, latitude, longitude, timezone, dst ) in csvreader : zipinfotuples. append ( ( csv _ zipcode, city, state,... | [
-0.6901057958602905,
-0.3864002227783203,
0.2958255708217621,
-0.41468545794487,
0.019787097349762917,
0.4664539098739624,
-0.3934471905231476,
0.2408321648836136,
-0.21498006582260132,
0.20788408815860748,
-0.7934473752975464,
-0.75048828125,
0.723493218421936,
0.03057168610394001,
-0.5... |
def getrandomrestaurant ( ) : restaurants = session. query ( restaurant ). all ( ) num _ restaurants = len ( restaurants ) rand _ restaurant _ index = randrange ( 0, num _ restaurants ) rand _ restaurant = restaurants [ rand _ restaurant _ index ] return rand _ restaurant | [
-1.5312788486480713,
-0.1108638197183609,
0.2242693156003952,
0.03238866478204727,
0.48051896691322327,
0.36994531750679016,
0.145853653550148,
0.6975385546684265,
0.33696362376213074,
-0.5343343019485474,
0.0834917426109314,
1.352641224861145,
-1.1198984384536743,
-0.8965386748313904,
-... |
def _ _ gettypes ( self, data, typenames, name ) : retval = { } for key in data : if isinstance ( data [ key ], dict ) : recusivedict = self. _ _ gettypes ( data [ key ], typenames, name ) retval. update ( recusivedict ) if isinstance ( data [ key ], dict ) and " type " in data [ key ] : if name and not key = = name : ... | [
-0.7774325013160706,
-0.06024179235100746,
0.7805211544036865,
-0.30057626962661743,
-0.5314703583717346,
-0.8190855979919434,
-0.6250613331794739,
-0.7329360246658325,
-0.9010017514228821,
0.5842454433441162,
-0.18521346151828766,
-0.18059611320495605,
-1.1130106449127197,
0.7275481820106... |
def do _ select _ all ( self, * * kwargs ) : _ hardware _ id = kwargs ['hardware _ id'] # don't use the ramstkdatamodel. do _ select _ all ( ) method because we don't # want to clear the tree or we'll only be left with the last hardware # id passed. _ session = self. dao. ramstk _ session ( bind = self. dao. engine, au... | [
0.006160975433886051,
0.539463996887207,
0.5054794549942017,
0.036043960601091385,
0.5379288196563721,
-0.3410651981830597,
-0.2831260859966278,
-0.8321602940559387,
0.05707278102636337,
-0.06638037413358688,
-0.017192116007208824,
0.14781911671161652,
-0.19867956638336182,
0.6149147748947... |
def from _ cvn ( self, cvn ='5 / g4g / sg3gs / tlg2glt / abbg1gbba / tlg2glt / sg3gs / g4g / 5 ', update = true ) : self. reset _ board ( ) # clean the board cvn = cvn. split ('/') if self. diagonals! = len ( cvn ) : raise valueerror ( f'expected { self. diagonals } diagonals, got { len ( cvn ) }') cells = 0 for k, dia... | [
-0.47272753715515137,
-0.24304313957691193,
0.6319212317466736,
-0.018365560099482536,
-0.09698877483606339,
-0.5164468884468079,
0.10836231708526611,
0.07075446099042892,
0.08631887286901474,
-0.07938192039728165,
-0.3279014825820923,
-0.35585594177246094,
-0.3290903568267822,
-0.20406845... |
def calc _ iffilt _ ratio _ value ( self, model ) : fc = model. vars. if _ frequency _ hz _ actual. value bw _ ana = model. vars. iffilt _ bandwidth _ actual. value # calculate if ( center ) frequency to bw ratio target _ ratio = float ( fc ) / bw _ ana model. vars. iffilt _ ratio. value = target _ ratio | [
-0.15692773461341858,
0.0912284329533577,
0.4711012542247772,
-0.18358099460601807,
0.0005575314862653613,
-0.796438455581665,
0.42595046758651733,
0.08563759922981262,
-0.38215014338493347,
0.4969676434993744,
0.13654179871082306,
0.03327970579266548,
-0.5913586020469666,
0.65227276086807... |
def parse ( self, data ) : # making sure there are at least some uppercase letters in the phrase if not registry. get ('np _ upper _ alpha _ regex'). search ( data ) : return data = data. split ( ) # if someone has a name longer than 7 words... they need # help. making sure each word in the phrase starts with an # uppe... | [
0.23470783233642578,
-0.200444757938385,
0.6490983366966248,
-0.16128569841384888,
-0.2555302381515503,
-0.08754681050777435,
-0.9156848192214966,
-0.4398705065250397,
0.6026197671890259,
0.23409226536750793,
-0.13891096413135529,
-0.3670606017112732,
-0.266002893447876,
0.592616081237793,... |
def _ to _ tuple _ tree ( x : pytree ) - > tuple : if isinstance ( x, ( tuple, list ) ) : return tuple ( _ to _ tuple _ tree ( x _ i ) for x _ i in x ) if isinstance ( x, dict ) : return tuple ( ( k, _ to _ tuple _ tree ( v ) ) for k, v in sorted ( x. items ( ) ) ) return x | [
-0.7818828821182251,
0.9389193654060364,
0.542280912399292,
-0.16681694984436035,
-0.7885246872901917,
-0.05013212561607361,
-1.0694544315338135,
-0.7470166683197021,
0.44086259603500366,
-0.1634375900030136,
-0.7939823269844055,
-0.47919249534606934,
0.21369847655296326,
0.606059908866882... |
def _ _ init _ _ ( _ _ self _ _, *, auto _ release _ time : optional [ pulumi. input [ str ] ] = none, data _ disks : optional [ pulumi. input [ sequence [ pulumi. input ['launchtemplatedatadiskargs'] ] ] ] = none, deployment _ set _ id : optional [ pulumi. input [ str ] ] = none, description : optional [ pulumi. input... | [
-0.013380208984017372,
-0.05985027551651001,
1.0002949237823486,
-0.27429455518722534,
-0.6628535389900208,
-0.3042099177837372,
-0.3562343716621399,
0.8313160538673401,
0.5689573287963867,
0.7542889714241028,
-0.9603606462478638,
0.35995012521743774,
-0.4079301059246063,
-0.53948527574539... |
def get _ layer _ data ( self, layer ) : return list ( self. _ data. values ( ) ) [ layer ] | [
-1.21547269821167,
-0.19621455669403076,
0.1186005100607872,
-0.01504283957183361,
-0.20495463907718658,
0.5603103637695312,
-0.9873142242431641,
-0.8191463351249695,
-0.3191814422607422,
-0.5207958817481995,
-0.48287221789360046,
1.187806248664856,
0.1473270207643509,
0.5539481043815613,
... |
def include _ paths ( self, include _ paths ) : if self. _ configuration. client _ side _ validation and include _ paths is none : raise valueerror ( " invalid value for ` include _ paths `, must not be ` none ` " ) # noqa : e501 self. _ include _ paths = include _ paths | [
0.7848259210586548,
0.4752177596092224,
0.25480788946151733,
1.6921131610870361,
-0.572492778301239,
1.8796257972717285,
1.2175092697143555,
1.1347299814224243,
0.18846550583839417,
0.3195432424545288,
-0.2845299243927002,
-0.8857197165489197,
-1.1889896392822266,
-0.6628599762916565,
0.... |
def restartsequence ( self, cmd ) : cmdkeys = cmd. cmd. keywords sequenceid = int ( cmdkeys ['id']. values [ 0 ] ) try : sequence = self. engine. registry [ sequenceid ] except keyerror : raise runtimeerror ( f'could not find sequence with sequenceid = = { sequenceid }') # make a copy using the saved cmdkeys and set th... | [
-0.39840662479400635,
-0.8537261486053467,
0.6176953911781311,
0.10093263536691666,
-0.5295069217681885,
-0.09290409088134766,
0.22334788739681244,
0.33265221118927,
0.6041663885116577,
0.4369050860404968,
-0.31170085072517395,
1.314805269241333,
-0.523813784122467,
-0.2422010451555252,
... |
def parse _ attr _ selectors ( model, attrs, resource ) : level = [ ] for attr in attrs : # this implies traversing through a related object if type ( attr ) in ( tuple, list ) : related = resolver. get _ model _ relation ( model, attr [ 0 ] ) if related is none : continue node = ( attr [ 0 ], ) + parse _ attr _ select... | [
-0.8369952440261841,
-0.1464179903268814,
0.4175819158554077,
-0.41491392254829407,
-0.0060363272204995155,
-0.5778586864471436,
0.34491464495658875,
-0.002623107982799411,
-0.3928315341472626,
0.35009604692459106,
-0.3609583377838135,
-0.7879694700241089,
0.3543258011341095,
0.02751998603... |
def get _ game ( self ) : # send the request url = self. base _ url + " game / nhl " response = self. get ( url, format ='xml') # convert xml text into object and get game id game _ id = et. fromstring ( response ) \. find ('yahoo : game ', self. _ ns ) \. find ('yahoo : game _ id ', self. _ ns ) \. text return int ( g... | [
0.22783330082893372,
0.2960692346096039,
0.8011838793754578,
0.16250218451023102,
0.6194911003112793,
0.1586953103542328,
-1.0939897298812866,
-0.3209909498691559,
0.29546061158180237,
0.2180057018995285,
0.3268008828163147,
0.19988690316677094,
-1.19135582447052,
0.1982468068599701,
0.6... |
def load _ data ( database _ uri : str, input _ data : dict ) - > pandas. dataframe : if'query'not in input _ data : error ( " no query in the input specified. exiting... " ) return pandas. read _ sql ( database _ uri, input _ data ['query'] ) | [
-0.33446937799453735,
1.1753075122833252,
0.1951168030500412,
0.05880243703722954,
-0.2384045571088791,
0.11828532814979553,
-1.1704187393188477,
0.35815319418907166,
-0.41526564955711365,
-0.46252089738845825,
1.0873838663101196,
0.2713887691497803,
-1.003448247909546,
-0.9855918884277344... |
def test _ rm _ and _ delete ( subtests, etcd _ client, prefix, func, recurse _ kwarg ) : func = getattr ( etcd _ client, func ) with subtests. test ( " removing a non - existent key should do nothing " ) : assert func ( " { } / rm / key1 ". format ( prefix ) ) is none with subtests. test ( " we should be able to remov... | [
-0.008771287277340889,
0.2095363587141037,
0.6461613774299622,
-0.6227213740348816,
-0.3227783143520355,
-0.24743224680423737,
0.3135104179382324,
0.39416152238845825,
0.6576606035232544,
-0.4657905101776123,
0.1288122981786728,
0.46187305450439453,
0.047255922108888626,
0.1251971870660781... |
def test _ query _ customer _ list _ by _ user _ name ( self ) : self. _ create _ customer ( ) self. _ create _ customer ( ) resp = self. app. get ( " / customers ", query _ string = " user _ name = ajmical " ) self. assertequal ( resp. status _ code, status. http _ 200 _ ok ) data = resp. get _ json ( ) self. asserteq... | [
0.5385617017745972,
-0.3435524106025696,
0.17744167149066925,
0.7282609343528748,
0.1810476928949356,
0.10389123857021332,
-0.23879513144493103,
0.3430668115615845,
-0.37428173422813416,
0.13933394849300385,
-0.24252547323703766,
0.1686774641275406,
0.43563178181648254,
0.17853575944900513... |
def test _ imported _ datatype ( self ) : self. asserttrue ( self. contingency _ data. circuits [ constants. excel. id ]. dtype = = object ) self. asserttrue ( self. contingency _ data. tx2 [ constants. excel. id ]. dtype = = object ) self. asserttrue ( self. contingency _ data. tx3 [ constants. excel. id ]. dtype = = ... | [
0.7488935589790344,
0.048127561807632446,
0.7161763906478882,
-0.5807472467422485,
0.2806749641895294,
0.658515453338623,
0.5113009810447693,
-0.07616839557886124,
0.5857174396514893,
0.2400653213262558,
-1.509635329246521,
1.1517637968063354,
-0.48350098729133606,
-0.2987409830093384,
0... |
def getscalarvalue ( lattice, index, scalars, scalarsindex, colouringoptions ) : if colouringoptions. colourby = = " species " or colouringoptions. colourby = = " solid colour " : scalar = lattice. specie [ index ] elif colouringoptions. colourby = = " height " : scalar = lattice. pos [ 3 * index + colouringoptions. he... | [
0.0005173216923139989,
-0.208267942070961,
0.48632702231407166,
-0.5144290924072266,
-0.05130346864461899,
-0.36464807391166687,
-0.4290088713169098,
-1.078224539756775,
-0.20669642090797424,
-0.020304732024669647,
0.06395183503627777,
1.2771034240722656,
-0.3074788749217987,
-0.1447317153... |
def clone _ vm ( content, template, vm _ name, si, datacenter _ name, vm _ folder, host _ name, resource _ pool, power _ on ) : # if none git the first one datacenter = get _ obj ( content, [ vim. datacenter ], datacenter _ name ) if vm _ folder : destfolder = get _ obj ( content, [ vim. folder ], vm _ folder ) else : ... | [
0.8686639666557312,
-0.6283252239227295,
0.6161308884620667,
0.16474482417106628,
-0.3406396210193634,
-0.07316383719444275,
-0.280999094247818,
0.5941329002380371,
-0.17179881036281586,
1.117646336555481,
-0.3107292652130127,
0.15650959312915802,
-0.16650886833667755,
-0.5392239689826965,... |
def test _ init ( self, dc _ mock ) : dd = displaydriver ( ) # assert that the displaydriver exists assert dd # assert that the display driver's database helper has been correctly set assert hasattr ( dd, " _ db _ helper " ) # assert that the display driver's display controller has been correctly set assert hasattr ( d... | [
-0.15480674803256989,
-0.18809834122657776,
0.43727996945381165,
0.23226986825466156,
0.6466343998908997,
0.5046699643135071,
0.6714480519294739,
0.19393187761306763,
0.21672417223453522,
-0.8947861194610596,
-0.11474735289812088,
-0.14604121446609497,
0.08542792499065399,
1.07425355911254... |
def _ _ init _ _ ( self, parent, * * kwargs ) : self. t = e32. ao _ timer ( ) self. parent = parent self. main = parent. main self. active = false self. fontheight = 15 self. lineheight = 17 self. font = ( u " series 60 sans ", self. fontheight ) | [
1.1760303974151611,
0.5865910053253174,
0.5571935176849365,
-0.35416075587272644,
-0.7695302963256836,
0.0771559327840805,
0.29962798953056335,
-0.7800384759902954,
0.159840926527977,
0.11087267100811005,
-0.7381772994995117,
0.22466251254081726,
0.24123506247997284,
0.9434890747070312,
... |
def _ get _ all _ str ( self ) : return " \ n ". join ( [ " \ n ". join ( [ str ( point ) for point in cm. grid _ points ] ) for cm in self. all _ results ] ) | [
1.0289888381958008,
-0.49068310856819153,
0.4712578058242798,
0.4481382369995117,
0.056691717356443405,
0.7336087822914124,
-0.6491305828094482,
-0.5146791934967041,
-0.5783631801605225,
-0.19406944513320923,
1.259473204612732,
-0.0641721859574318,
0.08267100900411606,
0.7013821005821228,
... |
def _ _ init _ _ ( self, ref, configuration, relation _ container ) : plugin. implbase. _ _ init _ _ ( self, ref, configuration ) self. relation _ container = relation _ container | [
1.2539259195327759,
0.3847564458847046,
0.5533148646354675,
-0.022645318880677223,
0.9684140086174011,
-0.5120206475257874,
1.2298626899719238,
-0.16784460842609406,
1.0367134809494019,
0.12497779726982117,
-0.11480438709259033,
0.5050926208496094,
-0.10187878459692001,
0.3445378243923187,... |
def syllablelen ( word ) : try : syllables = [ len ( list ( y for y in x if y [ - 1 ]. isdigit ( ) ) ) for x in phoenome [ word. lower ( ) ] ] except : syllables = [ 0 ] return syllables [ 0 ] | [
0.36362385749816895,
0.22317418456077576,
0.41763976216316223,
0.07146932929754257,
0.024993300437927246,
-0.4105786085128784,
0.0883917361497879,
0.675247073173523,
0.23187053203582764,
0.19877196848392487,
-0.838796079158783,
-0.34693285822868347,
-0.2927273213863373,
0.9350740909576416,... |
def _ _ init _ _ ( self, harsh _ event _ type = none, incident _ report _ url = none, download _ forward _ video _ url = none, download _ inward _ video _ url = none, download _ tracked _ inward _ video _ url = none, is _ distracted = none, location = none ) : # initialize members of the class self. download _ forward ... | [
0.2992557883262634,
-0.09809271991252899,
0.29156747460365295,
0.7859426736831665,
1.1585910320281982,
0.11062731593847275,
-0.3468411862850189,
0.657539963722229,
0.25131943821907043,
-0.6174301505088806,
-0.4672383666038513,
0.31794485449790955,
-0.08360800892114639,
0.6822296977043152,
... |
def make _ list ( arg, obj _ class ) : def _ raise _ faulty _ arg ( ) : raise typeerror ( " provided argument has to be a list [ { o } ] or a { o }, " " got'{ a }'". format ( o = obj _ class. _ _ name _ _, a = arg. _ _ class _ _. _ _ name _ _ ) ) if isinstance ( arg, obj _ class ) : return [ arg ] elif isinstance ( arg... | [
-0.5739681720733643,
-0.6963038444519043,
0.5380410552024841,
0.47834059596061707,
0.4008031487464905,
0.8199012279510498,
0.07418721914291382,
0.8820561766624451,
0.8740889430046082,
0.37427642941474915,
-0.2562538683414459,
0.46802422404289246,
-0.17615795135498047,
0.7581801414489746,
... |
def european _ option ( s : float, k : float, r : float, t : float, sigma : float, type = " c " ) - > float : if s < 1e - 4 or k < 1e - 4 : return none if type. lower ( ) = = " c " : return _ euro _ call ( s, k, t, r, sigma ) elif type. lower ( ) = = " p " : return _ euro _ put ( s, k, t, r, sigma ) else : return none | [
0.49586185812950134,
0.17839357256889343,
0.4472208023071289,
-0.19189345836639404,
0.06844929605722427,
-0.44275543093681335,
0.07019693404436111,
-0.77223801612854,
-0.16284477710723877,
0.974158525466919,
0.8508669137954712,
-0.2654998302459717,
-0.6021384000778198,
-0.5194235444068909,... |
def nowstr ( ) - > str : return dt. now ( ). strftime ( " % y % m % d _ % h % m % s _ % f " ) | [
-0.5798232555389404,
-0.6912158131599426,
0.865659773349762,
-1.0792866945266724,
-0.6677217483520508,
0.47549968957901,
-0.5556015372276306,
-0.7824913859367371,
-1.7960178852081299,
-0.09825512021780014,
-0.057879045605659485,
0.24279581010341644,
0.5838364362716675,
-0.8659625053405762,... |
def _ _ setattr _ _ ( self, key, value ) : if key not in dir ( dict ) : self [ key ] = value else : raise attributeerror ( " cannot overwrite the'% s'dict method " % key ) | [
-0.7788860201835632,
-0.056628577411174774,
0.6358925104141235,
-0.9323654174804688,
-0.9915406107902527,
-0.12034183740615845,
0.424002081155777,
0.057862844318151474,
-0.509772539138794,
0.31382089853286743,
0.4551940858364105,
-0.23994597792625427,
0.847716748714447,
1.0213980674743652,... |
def run ( self, dslfilepath ) : raise notimplementederror | [
-0.7285959124565125,
-0.0530209057033062,
0.4381628632545471,
0.4185974597930908,
-0.27240628004074097,
0.6618553400039673,
0.8992289304733276,
0.6404129862785339,
-0.0970282033085823,
-0.44289499521255493,
-1.0125211477279663,
0.23307190835475922,
0.7697281837463379,
-0.41980570554733276,... |
def is _ mesh ( self, is _ mesh ) : self. _ is _ mesh = is _ mesh | [
0.37513837218284607,
0.15589965879917145,
0.3229410946369171,
1.4544119834899902,
0.7114903330802917,
0.8153259754180908,
0.43933895230293274,
0.6332336068153381,
0.29783108830451965,
-0.8311111927032471,
-1.1521486043930054,
0.748654305934906,
0.16328676044940948,
0.4119951128959656,
-1... |
def get _ successes _ for _ task ( self, task _ id, extend _ success = true ) : success _ nodes = [ ] try : task _ dict = self. get _ task _ dict ( task _ id ) task _ status = task _ dict. get ('status ', " not specified " ) task _ result = task _ dict. get ('result') if task _ result is none : log. warning ( " task re... | [
-0.21911513805389404,
0.8894363641738892,
0.6163069009780884,
0.010200580582022667,
0.4050496220588684,
-0.027969976887106895,
0.519483745098114,
-0.016076598316431046,
-0.7435269951820374,
-0.5789123773574829,
-1.0442183017730713,
0.004238673485815525,
1.1958342790603638,
1.03443789482116... |
def test _ get _ investigations ( self ) : pass | [
0.33220139145851135,
1.597077488899231,
0.13048893213272095,
1.237230896949768,
1.6354843378067017,
0.09837505221366882,
1.1721748113632202,
-0.28801828622817993,
-0.2841343879699707,
-1.1256641149520874,
-0.49763306975364685,
-0.6459265351295471,
-1.42418372631073,
-0.4186757802963257,
... |
def get _ user ( self, user _ id ) : cur. execute ( " select * from users where id = % s ; ", ( user _ id, ) ) self. user = cur. fetchone ( ) | [
0.01783154159784317,
0.46548405289649963,
0.13402289152145386,
0.6380227208137512,
0.8979018330574036,
-0.3228190243244171,
0.01937752030789852,
-0.10013580322265625,
-0.40392276644706726,
-0.6409146189689636,
-0.4808901846408844,
0.8247289061546326,
0.0448681004345417,
0.5009536147117615,... |
def get _ items ( self ) : # get all tasks ids from the tasks collection all _ task _ ids = self. tasks. collection. distinct ( " task _ id ", { " state " : " successful " } ) # figure out which task _ ids are not in the materials collection and only process those previous _ task _ ids = self. task _ types. collection.... | [
0.3834824562072754,
0.015072275884449482,
0.744493305683136,
0.1216910183429718,
0.7423459887504578,
0.7124273777008057,
0.3023257255554199,
-0.16985179483890533,
-0.2510828673839569,
0.024811292067170143,
0.1364389806985855,
0.2503710091114044,
-0.15583322942256927,
0.7628027200698853,
... |
def check5 ( ) : if os. path. getmtime ( ".. / main / logs / pos _ app. log " ) < time. time ( ) - 120 : say ( " hypernode is frozen, stopping... " ) getoutput ( " screen - s hypernode - x at'#'stuff $'\ 003'" ) if os. path. getmtime ( ".. / main / logs / pos _ app. log " ) < time. time ( ) - 300 : print ( " hypernode ... | [
0.3418324887752533,
-0.13349585235118866,
0.8851994872093201,
0.6983770132064819,
0.35793042182922363,
0.23270384967327118,
0.3599717915058136,
-0.6528127789497375,
-0.7252970933914185,
0.7964444756507874,
-0.2198786735534668,
0.7380478978157043,
-0.47299474477767944,
0.09531877934932709,
... |
def flatten _ classes ( classes, c ) : while c : yield c c = classes. get ( c. super _ class ) | [
-0.14558425545692444,
-0.1674272119998932,
0.4443857967853546,
-0.16546674072742462,
-0.39372342824935913,
0.6827573776245117,
-0.20813260972499847,
-0.34127792716026306,
-0.017140626907348633,
-0.7270151972770691,
-0.24804376065731049,
-0.16236114501953125,
-0.385312020778656,
0.325099050... |
def feature _ selection ( self, choice, n, p ) : if choice = = 0 : selector = selectkbest ( mutual _ info _ classif, k = n ). fit ( self. data, self. target ) elif choice = = 1 : selector = selectpercentile ( mutual _ info _ classif, percentile = p ). fit ( self. data, self. target ) self. data = selector. transform ( ... | [
-0.143809974193573,
-0.376813143491745,
0.48221340775489807,
0.08041083812713623,
0.9990778565406799,
0.5728369951248169,
0.2836799919605255,
-0.23117098212242126,
0.23728224635124207,
-0.35054951906204224,
-0.009081583470106125,
0.4123120903968811,
-0.7303956151008606,
0.03432117030024528... |
def changeshape ( self, * args ) : return _ topods. topods _ hshape _ changeshape ( self, * args ) | [
-0.7126861214637756,
0.5201142430305481,
0.4655110836029053,
0.36515548825263977,
0.306210458278656,
0.10538897663354874,
0.15802107751369476,
0.2053258717060089,
-0.4965221881866455,
-0.1717403382062912,
-0.7577933073043823,
0.8101978302001953,
-0.5778135657310486,
0.6102266907691956,
0... |
def get _ weights _ for _ plot ( self ) : return self. _ _ get _ weights ( self. w _ over _ time ) | [
-0.05894193798303604,
0.5529353022575378,
0.3987830579280853,
-0.0683644637465477,
-0.6404141187667847,
-0.18271172046661377,
0.7188758254051208,
-1.06361722946167,
-1.0372878313064575,
-0.27017849683761597,
0.20785579085350037,
1.215802788734436,
0.0006183714722283185,
0.7159790992736816,... |
def peek _ back ( self ) : if self. is _ empty ( ) : return self. head current = self. head while current. next is not none : current = current. next return current. data | [
0.453077107667923,
0.7851459383964539,
1.0433788299560547,
-0.18387813866138458,
-0.14042814075946808,
-0.4078664183616638,
-0.04265392944216728,
-0.6227608323097229,
0.14657898247241974,
-0.13872478902339935,
0.3606134057044983,
1.078360676765442,
-1.3925858736038208,
-0.18853063881397247... |
def predict _ random ( self, x : np. ndarray ) - > list : prob = self. predict _ proba ( x ) x _ new = [ np. random. choice ( self. values, p = i ) for i in prob ] return x _ new | [
-0.9335929751396179,
-0.06678811460733414,
0.43606770038604736,
0.9067067503929138,
0.07420236617326736,
1.0029361248016357,
-1.0275733470916748,
0.1699109673500061,
0.41255098581314087,
0.35999393463134766,
-0.46888482570648193,
0.37248051166534424,
0.24810530245304108,
0.5464309453964233... |
def create ( self, w, h ) : self. check _ errors ( w, h ) template = [ ] template. append ( horizontal _ border _ character * ( w + 2 ) ) for height in range ( h ) : template. append ( vertical _ border _ character + background _ character * w + vertical _ border _ character ) template. append ( horizontal _ border _ c... | [
0.23020747303962708,
-0.6601651310920715,
0.5209552645683289,
0.26694029569625854,
0.17449243366718292,
-0.06756530702114105,
-0.7750030159950256,
-0.43602854013442993,
-0.8150059580802917,
-0.12319772690534592,
-1.3535808324813843,
-0.4084838330745697,
-0.40299391746520996,
0.078687779605... |
def _ createpartyeditorpage ( self ) : page = directframe ( self. frame ) page. setname ( " partyplannereditorpage " ) self. layouttitlelabel = directlabel ( parent = page, relief = none, text = ttlocalizer. partyplannereditortitle, pos = self. gui. find ( " * * / title _ locator " ). getpos ( ) + point3 ( 0. 0, 0. 0, ... | [
-0.28211748600006104,
0.06095058470964432,
0.6872743964195251,
-0.6183450222015381,
-0.019749589264392853,
0.4327038824558258,
0.4440374970436096,
0.10480669885873795,
-0.8564708828926086,
0.0701061338186264,
0.47880762815475464,
-0.6481137871742249,
-0.43919840455055237,
0.552451014518737... |
def test _ create _ table _ 1 ( ) : cat = csvcatalog. csvcatalog ( ) t = cat. create _ table ( " people ", ".. / data / people. csv " ) | [
0.7106003761291504,
0.358491450548172,
0.16729986667633057,
0.5915090441703796,
0.0459679551422596,
0.6284032464027405,
-0.006749317049980164,
0.18241707980632782,
-1.0141483545303345,
-0.6506924629211426,
-0.6329123377799988,
0.10593178123235703,
1.0048531293869019,
-0.04636974260210991,
... |
def alphabeta ( self, game, depth, alpha = float ( " - inf " ), beta = float ( " inf " ), maximizing _ player = true ) : if self. time _ left ( ) < self. timer _ threshold : raise timeout ( ) if maximizing _ player : if self. unique _ moves : value, chosen _ move = self. max _ value ( game, depth, self, alpha = alpha, ... | [
-0.9729828834533691,
-0.7573113441467285,
0.7896756529808044,
0.0618567131459713,
0.09099029749631882,
-0.6739341616630554,
-0.4711636006832123,
-0.1503249853849411,
-0.3028622269630432,
0.46142542362213135,
0.08016703277826309,
0.8631967306137085,
-0.05968104675412178,
0.6164025664329529,... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, materialupdateoperation ) : return false return self. to _ dict ( ) = = other. to _ dict ( ) | [
-0.8262730836868286,
-0.453274130821228,
0.8086439371109009,
0.052287954837083817,
-0.8892971873283386,
-0.22245341539382935,
-0.21451544761657715,
-0.4841279089450836,
0.8963488936424255,
0.4497394859790802,
-0.9095175862312317,
-0.7647842764854431,
-0.28654757142066956,
-0.55155164003372... |
def readonly ( self ) : return bool ( self. browser. get _ attribute ( " readonly ", self. textbox ) ) | [
-0.5610255599021912,
-0.14087586104869843,
0.6272536516189575,
0.1814972460269928,
-0.4039800465106964,
0.37930792570114136,
0.09275755286216736,
0.2483510971069336,
0.2955818176269531,
0.2633490264415741,
-0.008187796920537949,
0.4780599772930145,
-0.47626447677612305,
0.11397365480661392... |
def put _ object ( name, data ) : # ensures minio bucket exists make _ bucket ( bucket _ name ) stream = bytesio ( data ) minio _ client. put _ object ( bucket _ name = bucket _ name, object _ name = name, data = stream, length = len ( data ), ) | [
0.44634613394737244,
-0.23259738087654114,
0.5278576016426086,
-0.8047863245010376,
-0.5964083671569824,
0.46834835410118103,
-0.5053808689117432,
-0.28427231311798096,
0.25543293356895447,
0.34528616070747375,
-1.8520539999008179,
0.5634259581565857,
-0.5199756622314453,
-1.26242506504058... |
def isnumber ( s ) : try : float ( s ) return true except valueerror : return false | [
0.10848946869373322,
-0.026345551013946533,
0.28880998492240906,
1.4496824741363525,
0.2287600040435791,
0.2643570899963379,
-0.1305399388074875,
0.317435085773468,
0.37870433926582336,
-1.0284924507141113,
-0.6448607444763184,
-0.23673950135707855,
-0.4862191379070282,
0.23171716928482056... |
def plot _ pca _ explained _ var ( ax, pca ) : total _ var = np. sum ( pca. explained _ variance _ ) cumsum _ var = np. cumsum ( pca. explained _ variance _ ) prop _ var _ expl = cumsum _ var / total _ var ax. plot ( prop _ var _ expl, color ='black ', linewidth = 2, label ='explained variance') ax. axhline ( 0. 9, lab... | [
0.9518469572067261,
-0.06767415255308151,
0.7891145348548889,
-0.6497001051902771,
-0.5780017375946045,
0.44233381748199463,
1.4371403455734253,
0.910276472568512,
0.4892219007015228,
-0.24885021150112152,
0.6803001761436462,
1.0986703634262085,
-0.042590558528900146,
-0.20827677845954895,... |
def evaluate ( self, test _ data ) : test _ results = [ ( np. argmax ( self. feedforward ( x ) ), y ) for ( x, y ) in test _ data ] return sum ( int ( x = = y ) for ( x, y ) in test _ results ) | [
-0.05676734820008278,
-0.3692818880081177,
0.36261847615242004,
-0.1798471212387085,
0.5025701522827148,
-0.6975683569908142,
-0.24735653400421143,
-0.3937695622444153,
0.19781409204006195,
-0.4683781862258911,
-0.06622853130102158,
-0.018067624419927597,
-0.5719867944717407,
0.42772668600... |
def edit _ tile ( self, ltnum, g _ gauls, flag _ unresolved, snrcutstack, volrank, tile _ prop, tess _ sc, \ tess _ fuzzy, wts, tess _ method, plot ) : if ltnum > 1 : raise notimplementederror, " not yet implemented for ltnum > 1 " tile _ list, tile _ coord, tile _ snr = tile _ prop tr _ gaul = self. trans _ gaul ( g _... | [
-0.3013302981853485,
0.18371888995170593,
0.6208916902542114,
-0.6779209971427917,
-0.32111793756484985,
-0.16924016177654266,
0.2676459550857544,
0.15218302607536316,
-0.34393516182899475,
0.013748619705438614,
0.023033075034618378,
0.3576064109802246,
0.30592620372772217,
0.0083478866145... |
def _ findextensionbynumber ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.08534323424100876,
-0.16989891231060028,
0.47447288036346436,
0.9491811394691467,
-0.40806373953819275,
-0.7097399830818176,
0.45525628328323364,
-0.8371117115020752,
0.7361388802528381,
0.11593148112297058,
-0.17844465374946594,
-0.5507534742355347,
-0.6826998591423035,
0.5263780951499... |
def test _ addcircuit _ keras _ error ( self ) : add = elementary. addcircuit ( ) circuit = cirq. circuit ( cirq. x ( cirq. gridqubit ( 0, 0 ) ) ) with self. assertraisesregex ( typeerror, expected _ regex = " cannot be parsed " ) : add ( circuit, append ='junk') with self. assertraisesregex ( typeerror, expected _ reg... | [
-0.12528260052204132,
-0.06183752790093422,
0.6654490232467651,
-0.3445756733417511,
0.4725565016269684,
0.5806272029876709,
-0.10428908467292786,
-0.3171968460083008,
0.15148626267910004,
-0.578123927116394,
0.2789045572280884,
0.6423721313476562,
-0.44179174304008484,
0.7532051205635071,... |
def shearblity ( dst, source, dest, yoffs, stripwid, area = none, special _ flags = 0 ) : area = area or ( 0, 0, source. get _ width ( ), source. get _ height ( ) ) num _ strips = ( area [ 2 ] - 1 ) / / stripwid + 1 x, y = dest [ : 2 ] strip _ origins = [ ( i * stripwid, i * yoffs ) for i in range ( num _ strips ) ] ar... | [
0.04416695609688759,
-0.21301423013210297,
0.8034031391143799,
-1.0122214555740356,
-0.7903950214385986,
0.24943111836910248,
0.6448546648025513,
0.34816139936447144,
1.2214701175689697,
0.0007261544815264642,
0.18679238855838776,
1.2135639190673828,
0.3152533769607544,
0.8198327422142029,... |
def t _ confint ( x, p ) : x = np. array ( x ) se = scipy. stats. sem ( x ) return scipy. stats. t. interval ( p, x. size - 1, np. mean ( x ), se ) | [
0.44924965500831604,
0.21684536337852478,
0.24248181283473969,
-0.06674040853977203,
-0.5608389973640442,
0.46644923090934753,
-0.5285007953643799,
0.37865978479385376,
-0.5836434364318848,
1.7066378593444824,
0.23600687086582184,
0.221820667386055,
-0.07892264425754547,
-1.095657229423523... |
def rectangle ( x, y, w, h, fill = 255, outline = 50 ) : img = image. new ('l ', ( w + 1, h + 1 ), color = white ) rect = imagedraw. draw ( img,'l') rect. rectangle ( [ ( 0, 0 ), ( w, h ) ], fill = fill, outline = outline ) return deepcopy ( pssm. pillowimgtoscreenobject ( img, x, y ) ) | [
-0.46878302097320557,
-0.3918125033378601,
0.6011408567428589,
-0.6353767514228821,
-0.8970668911933899,
0.30509424209594727,
-0.5706405639648438,
-0.9337774515151978,
0.5145477652549744,
-0.4220536947250366,
-0.18111123144626617,
0.47187063097953796,
0.32603710889816284,
-0.06689751148223... |
def describe _ pet ( pet _ name, animal _ type ='dog') : # will default to dog unless you specify kwarg and change it print ( f " \ ni have an { animal _ type } " ) print ( f " \ nmy { animal _ type }'s name is { pet _ name. title ( ) }. " ) | [
0.5321292877197266,
-0.15908183157444,
0.502614438533783,
-0.7896460890769958,
0.4510246813297272,
0.676517903804779,
-1.3394415378570557,
-0.7773082256317139,
-0.9638636112213135,
0.2527216076850891,
0.4779205918312073,
1.573723554611206,
-0.4696308374404907,
0.039196740835905075,
0.036... |
def clean _ return _ data ( data ) : data = data [ pd. notnull ( data ['return'] ) ] data = data. loc [ ( data ['return'] > = 0. 0001 ) & ( data ['return'] < = 3000 ) ] return data. sort _ values ('return ', axis = 0, ascending = false ) | [
-0.11654459685087204,
-0.024756288155913353,
0.596156895160675,
-0.0767672136425972,
-0.620951235294342,
-0.2728024125099182,
-0.44569647312164307,
-0.585236668586731,
0.3498624265193939,
1.0262624025344849,
0.6254340410232544,
0.7825832366943359,
-0.3817504048347473,
-1.1739195585250854,
... |
def all _ unaffected ( self ) : for i in self : if self [ i ]. phenotype = = " 1 " : yield self [ i ] | [
-0.24139714241027832,
-0.6356464624404907,
0.5797528624534607,
1.2184228897094727,
-0.17719800770282745,
0.5628548264503479,
0.10560289770364761,
0.49433228373527527,
-0.09799643605947495,
0.0010906493989750743,
-0.6105949878692627,
0.32259756326675415,
-1.7675429582595825,
0.6504486799240... |
def get _ edges ( self ) : return self. edges | [
-0.4264078140258789,
-0.273261159658432,
0.32454606890678406,
0.17833085358142853,
0.696563184261322,
-0.0003538603486958891,
-1.124428391456604,
0.19423766434192657,
0.15565894544124603,
-0.6459603309631348,
-0.06989291310310364,
0.5693933963775635,
-0.7364120483398438,
-0.246517896652221... |
def getfilename ( filename ) : try : filename = db. session. query ( file ). filter ( file. name = = filename ). first ( ). map # get the filename of the file with the md5 from sqlite return filename except exception as e : print e return none | [
0.3822926878929138,
-0.20266307890415192,
0.7643808722496033,
0.049260735511779785,
-0.061056364327669144,
-0.44318872690200806,
0.3462330996990204,
0.15638096630573273,
-0.2570944130420685,
1.0121394395828247,
0.12400167435407639,
-1.38991117477417,
0.1687818169593811,
-0.0520657338201999... |
def hyperunit ( pt ) : # loop, making product # addition operations are * list * operations ( prepend ) d = len ( pt ) ang = np. array ( pt ) [ 1 : ] # drop first element xvec = [ ] while len ( ang ) > 0 : if len ( ang ) > 1 : prod _ rest = np. prod ( np. sin ( ang [ 1 : ] ) ) else : prod _ rest = 1 xvec = xvec + [ np.... | [
0.0372660830616951,
0.7081923484802246,
0.6741017699241638,
0.5003563165664673,
-0.0011822382220998406,
0.6596937775611877,
0.422637403011322,
-0.445701539516449,
1.2532644271850586,
0.4377237856388092,
-0.3163006603717804,
0.17012423276901245,
-0.2953294515609741,
-0.6738993525505066,
0... |
def parse _ file _ and _ display ( file : str ) : pandas _ hdf = false try : ms _ file = alphapept. io. ms _ data _ file ( file ) options = [ _ for _ in ms _ file. read ( ) if _! = " raw " ] except keyerror : pandas _ hdf = true ms _ file = none with pd. hdfstore ( file ) as hdf : options = list ( hdf. keys ( ) ) if pa... | [
0.8188255429267883,
-0.10569124668836594,
0.6732630133628845,
0.09099582582712173,
-0.1026395931839943,
0.4077140986919403,
0.7546964883804321,
0.49911749362945557,
0.19128862023353577,
-0.43932580947875977,
1.1144577264785767,
0.20778875052928925,
0.3041117787361145,
0.1829519122838974,
... |
def notify ( self ) : return self. _ notify | [
0.028419841080904007,
-0.2879476547241211,
0.24696530401706696,
0.3376558721065521,
0.16163483262062073,
-0.23452690243721008,
0.45943212509155273,
0.32084038853645325,
-0.4489261209964752,
-0.5992354154586792,
-1.2398905754089355,
0.33904027938842773,
0.11972694098949432,
-0.5257757902145... |
def gen _ uniform _ spherical _ surface _ coords ( self, samples ) : # transformations from a uniform variable between 0 and 1 # to uniformly distributed angles around the unit sphere. theta _ transf = lambda x : np. arccos ( 1 - 2 * x ) phi _ transf = lambda x : 2 * np. pi * x # generate'samples'uniform floats. sample... | [
-0.7660817503929138,
-0.19066037237644196,
0.4087483286857605,
-0.3188413381576538,
0.10508212447166443,
0.563985288143158,
1.5848759412765503,
0.3173161447048187,
0.6542121767997742,
-0.03973822295665741,
-0.7460216879844666,
0.4036008417606354,
-0.2850675880908966,
0.301870733499527,
-... |
def six ( ) : return [ [ 0, 1, 1, 0 ], [ 1, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 1, 1, 1, 0 ], [ 1, 0, 0, 1 ], [ 1, 0, 0, 1 ], [ 0, 1, 1, 0 ], ] | [
-0.059163350611925125,
-0.6060859560966492,
0.8236042857170105,
0.4069558084011078,
0.7975950241088867,
-0.5821258425712585,
0.502594530582428,
-0.334076851606369,
0.592621922492981,
-0.32461121678352356,
-1.9336367845535278,
-0.3491928279399872,
0.653114914894104,
-0.20240092277526855,
... |
def update _ property _ images ( cls, listing, images _ folder, images _ list _ json ) : listing. images _ folder = f " { images _ folder } / " listing. photos = images _ list _ json db. session. commit ( ) | [
-1.8430287837982178,
-0.6684351563453674,
0.22896988689899445,
-0.3382750451564789,
-0.1642419993877411,
-0.3560698330402374,
-0.14955203235149384,
1.387335181236267,
-0.13871729373931885,
0.9682279229164124,
-0.1148974820971489,
0.406893789768219,
0.09448492527008057,
0.2847819924354553,
... |
def validate _ bug _ tracker _ base _ hosting _ url ( input _ url ) : # try formatting the url using an empty tuple to verify that it # doesn't contain any format characters. try : input _ url % ( ) except typeerror : raise validationerror ( [ _ ( " the url'% s'is not valid because it contains a format " " character. f... | [
-0.5742678046226501,
-0.5960983633995056,
0.44045305252075195,
0.7347314953804016,
-0.10194405913352966,
0.5330861806869507,
0.11252860724925995,
-0.17625077068805695,
-1.0297441482543945,
-0.6189481616020203,
0.5448204278945923,
-0.2263559252023697,
-0.8513432145118713,
0.9688258767127991... |
def rungekutta4 ( r, y0, t0, t1, h = 1e - 5 ) : intervals = round ( ( t1 - t0 ) / h ) h = ( ( t1 - t0 ) / intervals ) t = np. linspace ( t0, t1, num = intervals + 1 ) u = [ 0 ] * ( intervals + 1 ) u [ 0 ] = y0 for i in range ( 1, intervals + 1 ) : f1 = ode _ func ( r, u [ i - 1 ] ) f2 = ode _ func ( r, u [ i - 1 ] + ( ... | [
-0.14259260892868042,
-0.19114144146442413,
0.6476102471351624,
-0.1487947702407837,
-0.6321613788604736,
-0.23112928867340088,
1.0435925722122192,
0.33767783641815186,
-0.9465717673301697,
0.31932947039604187,
-0.7723084092140198,
-0.27294671535491943,
-0.3398660719394684,
0.1220197528600... |
def assertequalapiresponses ( self, first, second ) : super ( testcasemixin, self ). assertequal ( first, second,'expected response code { 1 }, received { 0 } instead. '. format ( first, second ) ) | [
0.07989852130413055,
-1.1915552616119385,
0.4495491683483124,
-0.00987363699823618,
1.7046748399734497,
-0.017499685287475586,
0.1666058450937271,
-0.9532285928726196,
0.7920032143592834,
-0.8503719568252563,
-0.6610201597213745,
0.013703644275665283,
-0.4410143196582794,
0.308105856180191... |
def test _ check _ config _ params _ verbose _ wrong _ type ( gitdelver _ config _ params _ fixture : callable [ [ none ], dict [ str, str ] ] ) : config _ params = gitdelver _ config _ params _ fixture config _ params [ " verbose " ] = " test " with pytest. raises ( systemexit ) : gitdelver. _ check _ config _ params ... | [
0.21908296644687653,
0.44809484481811523,
0.3994233310222626,
0.8996212482452393,
0.825813889503479,
0.2769470512866974,
-0.5681788921356201,
0.4146730601787567,
-0.7148886919021606,
1.7626957893371582,
-0.26105374097824097,
0.4226018488407135,
-0.8118780255317688,
1.644988775253296,
0.7... |
def validatesymbol ( gene, returnmapping = false ) : path ='/ fetch / symbol / % s'% gene verified, symbol = hgncrestcall ( path ) if not verified : path ='/ fetch / prev _ symbol / % s'% gene verified, symbol = hgncrestcall ( path ) if not verified : path ='/ fetch / alias _ symbol / % s'% gene verified, symbol = hgnc... | [
-0.7589478492736816,
0.024322491139173508,
0.6611250042915344,
0.008042995817959309,
-0.6308409571647644,
0.14301596581935883,
0.5237170457839966,
0.35723042488098145,
-0.2740858495235443,
-0.19149737060070038,
-0.4177699685096741,
0.4048844277858734,
-0.27435773611068726,
0.53829044103622... |
def test _ delete _ package ( self ) : role = role. query. filter _ by ( name = " event organizer " ). first ( ) user = testmodelfactory. create _ user ( ) user. role = role venue = testmodelfactory. create _ venue ( ) event = testmodelfactory. create _ event ( " test event ", " live " ) event. user = user event. venue... | [
-0.5381076335906982,
0.4922121465206146,
1.0119538307189941,
0.28060171008110046,
0.4156494140625,
0.2958555221557617,
0.580780565738678,
0.08582642674446106,
0.7923780083656311,
-0.34890806674957275,
0.05842636525630951,
0.03301336243748665,
0.43318673968315125,
0.4315085709095001,
0.28... |
def convert _ to _ cvs ( self, queryset, modelserializer ) : from bims. tasks. collection _ record import download _ data _ to _ csv response = httpresponse ( content _ type ='text / csv') response ['content - disposition'] ='attachment ; filename = " download. csv "'if not queryset : return jsonresponse ( {'status':'f... | [
-0.8563967943191528,
-0.6996353268623352,
0.8778836131095886,
0.3644966781139374,
0.44477832317352295,
-0.2529575228691101,
0.4932610094547272,
-0.6462982296943665,
-0.47395753860473633,
-0.21536391973495483,
0.14488868415355682,
0.04455232620239258,
0.559718668460846,
-0.1029813289642334,... |
def grids _ to _ torch ( grids, size, dim = 5 ) : import torch grids = torch. tensor ( grids / size * 2. 0 - 1. 0 ) while grids. dim ( ) < dim : # 3d sampler is 5d, namely ncwhd grids = grids [ none ] return grids | [
0.7445690035820007,
0.04863838851451874,
0.3886972665786743,
0.5157477259635925,
-0.842856228351593,
-0.40014028549194336,
-0.19017134606838226,
-0.6974427700042725,
-0.10793637484312057,
0.8036298155784607,
-0.2660287916660309,
0.2785281240940094,
0.22229740023612976,
-0.3856792151927948,... |
def get _ project _ meta ( ) : if'uid'in session : user _ dir = path ( app. config ['upload _ folder'] ) / session ['uid'] project _ details = get _ project _ details ( user _ dir ) else : project _ details = none project _ details _ json = json. dumps ( project _ details ) return project _ details _ json | [
-0.6671491861343384,
0.01709984987974167,
0.4547438621520996,
0.65354984998703,
0.0818353071808815,
0.2222396284341812,
-0.2638787627220154,
-0.5116643309593201,
0.28034183382987976,
0.4782443940639496,
0.20983967185020447,
0.7593193650245667,
0.4199448525905609,
0.10020727664232254,
0.4... |
def enum ( * names ) : def _ _ init _ _ ( self, name ) : self. name = name def _ _ str _ _ ( self ) : return self. name d = { " _ _ init _ _ " : _ _ init _ _, " _ _ str _ _ " : _ _ str _ _, } bases = ( object, ) name = " enum < % s > " % ", ". join ( names ) t = type ( name, bases, d ) for name in names : setattr ( t, ... | [
-0.9609270691871643,
-0.5713014602661133,
0.7981070280075073,
-0.7162591218948364,
0.6659474968910217,
-0.23249606788158417,
0.06171038746833801,
-0.9461438655853271,
0.6303327083587646,
-0.09825723618268967,
-0.8346042037010193,
0.3547740578651428,
0.23201176524162292,
-0.0591236464679241... |
def all _ users _ requests ( ) : cur. execute ( " select * from requests " ) requests = cur. fetchall ( ) every _ request = [ ] for request in requests : requests _ labeled = {'request _ id': request [ 0 ],'title': request [ 1 ],'description': request [ 2 ],'type': request [ 3 ],'status': request [ 4 ],'feedback': requ... | [
-0.41644927859306335,
-0.8931476473808289,
0.6744798421859741,
0.31410184502601624,
0.015838300809264183,
0.883223295211792,
-1.7870742082595825,
-0.4975346624851227,
-0.36815395951271057,
-0.050133176147937775,
0.08473518490791321,
0.05276946350932121,
0.4796885848045349,
0.89950042963027... |
def get _ task _ data _ rewards _ across _ feeders ( self, reward _ name ) : # combine reward events across feeders timestamps = [ ] amount = [ ] feeder _ ids = [ ] for feeder _ id in self. task _ data ['reward'] [ reward _ name ] : timestamps + = self. task _ data ['reward'] [ reward _ name ] [ feeder _ id ] ['timesta... | [
0.33099666237831116,
-0.16675207018852234,
0.6688636541366577,
-1.0047272443771362,
-0.004432092420756817,
-0.5092517733573914,
-0.3077665865421295,
-0.5137969851493835,
-0.1312747597694397,
0.6344764232635498,
-0.7779556512832642,
0.055310189723968506,
0.7418996095657349,
0.54276734590530... |
def _ _ get _ elbow ( self ) : sil _ score = [ ] k = range ( 2, 10 ) for k in k : model = kmeans ( n _ clusters = k, max _ iter = 200 ) km = model. fit _ predict ( self. trainingdata ) sil _ score. append ( silhouette _ score ( self. trainingdata, km ) ) print ( sil _ score ) plt. figure ( figsize = ( 16, 8 ) ) plt. pl... | [
-0.26924705505371094,
0.22990097105503082,
0.5238310694694519,
-0.08031538873910904,
0.3605983853340149,
0.17598170042037964,
0.22109869122505188,
0.9880104064941406,
-0.5781992673873901,
0.6849243640899658,
0.027189796790480614,
1.0256164073944092,
0.49631133675575256,
-0.1240895241498947... |
def _ _ parse _ _ ( self ) : pass | [
-0.12392900139093399,
-1.2551794052124023,
0.5200677514076233,
-0.2651313245296478,
0.28543898463249207,
0.4014616906642914,
-0.03656500577926636,
-0.06196951866149902,
0.4906434118747711,
-1.5324548482894897,
-0.6551299095153809,
-0.2637934982776642,
-0.0949849858880043,
0.009608377702534... |
def print _ short ( sp ) : print ('% 6d % 7. 2f % 7. 2f % 2d % 2d % 2d % 9. 6f % 9. 6f % 9. 6f % 9. 6f % 9. 6f % 9. 6f % 9. 6f'% \ ( sp. index, sp. beta, sp. omega, sp. h, sp. k, sp. l, sp. dr, sp. r, sp. qv, sp. qh, sp. qt, sp. ql, sp. p ) ) | [
0.8692353367805481,
-0.599926769733429,
0.8545337915420532,
-0.769891619682312,
-0.31718239188194275,
0.6298252940177917,
0.1292268931865692,
-1.34574556350708,
0.4010302424430847,
-0.3493516147136688,
-0.1315286010503769,
0.9258343577384949,
-0.39609140157699585,
-0.3636230528354645,
-0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.