text
stringlengths
25
2.19k
embedding
listlengths
768
768
def _ verify _ played _ status ( self, error _ on = false ) : if error _ on : if self. _ game _ played : raise invalidgameexception ( " game has already been played. ", self ) else : if not self. _ game _ played : raise invalidgameexception ( " game has not been played yet. ", self )
[ 0.40025874972343445, 0.010512602515518665, 0.6044342517852783, 0.2560305595397949, 0.9253261685371399, 0.867988109588623, -0.5008743405342102, -0.5388466715812683, 0.10261078923940659, 0.4452703297138214, -0.33853453397750854, 0.46550384163856506, 0.09234965592622757, 0.4995659291744232, ...
def get _ words ( content ) : words = len ( nltk. word _ tokenize ( content ) ) return words
[ 0.01769944466650486, 0.36796835064888, 0.31606829166412354, -1.0473713874816895, 0.5814175605773926, -0.8722707033157349, -0.7899812459945679, 0.3493254482746124, -0.46169325709342957, 0.4769494831562042, -1.0229970216751099, -0.7999948859214783, -0.7170352935791016, 0.874555230140686, -...
def _ test _ random _ forest _ regression ( ) : folder _ name = ". " from os import listdir files = sorted ( [ file for file in listdir ( folder _ name ) if " csv " in file ] ) for file in files : print file, test _ random _ forest _ regression ( file )
[ 0.2499847710132599, 0.04243966192007065, 0.607815146446228, 0.7878658771514893, 0.9637950658798218, -0.13618282973766327, 1.023362159729004, -0.23388513922691345, -0.2510903775691986, -0.9327954053878784, -0.18454694747924805, 0.21375584602355957, -0.42347508668899536, 0.8550589680671692, ...
def get _ next _ token ( self ) : while self. current _ char is not none : # print ( " current char : { } ". format ( self. current _ char ) ) if self. current _ char. isspace ( ) : self. skip _ whitespace ( ) continue elif self. current _ char. isdigit ( ) : yield token ( integer, self. integer ( ) ) elif self. curren...
[ -0.17385010421276093, -0.9732471108436584, 0.7826741337776184, -0.13705070316791534, -0.49262797832489014, 0.09227202087640762, 0.17939026653766632, -0.19493521749973297, -0.2783489227294922, -1.1214300394058228, -0.1028415635228157, 0.8706174492835999, -0.06815212965011597, -0.05494826659...
def correctslant ( gray ) : # convert image to black background and while foreground image # gray = blackwhiteimg ( image ) # 外 , 正 文 信 rows, cols = gray. shape if rows > 20 and cols > 20 : rowspadding = ( math. ceil ( gray. shape [ 0 ] / 20 ), math. ceil ( gray. shape [ 0 ] / 20 ) ) colspadding = ( math. ceil ( gray. ...
[ 0.5378749966621399, -0.0634874626994133, 0.9002046585083008, -1.190039873123169, -0.8776962161064148, 0.19243064522743225, 0.8181517124176025, -0.2711254358291626, 0.39750921726226807, 0.8042593598365784, 0.39165008068084717, 0.7426832318305969, -0.49361294507980347, 0.5567787885665894, ...
def monster _ encounter ( monster : dict ) : if monster ['name']! ='' : encounter _ chance = random. randint ( 1, 4 ) if encounter _ chance = = 1 : # 25 % chance of encountering a monster print ('\ nyou encountered a ', monster ['description'], ( monster ['name'] + '!') ) fight _ decision = input _ loop ('do you want t...
[ 0.2772330641746521, -0.4518767297267914, 0.791819155216217, 0.009667739272117615, 0.7779785990715027, 0.25819462537765503, 0.2649225890636444, 0.3015078604221344, -0.43413424491882324, 0.24734686315059662, 0.10925731062889099, 0.3883560001850128, -0.17953723669052124, 1.0001968145370483, ...
def test _ cumulative _ distribution ( self, scipy _ mock ) : # setup class scipywrappersubclass ( scipywrapper ) : model _ class ='mock _ model'probability _ density = none cumulative _ distribution ='cdf'percent _ point = none sample = none model _ instance _ mock = magicmock ( spec = ['cdf'] ) model _ instance _ moc...
[ -0.12273517996072769, 0.33445629477500916, 0.4256686568260193, -0.2963655889034271, 0.4149077534675598, 0.8762366771697998, -0.1764695793390274, 0.009022163227200508, 0.05926983803510666, -0.8098364472389221, -0.2327570617198944, -0.07150638103485107, -0.5130802392959595, 0.344496279954910...
def update ( self, action ) : self. handle _ events ( action ) self. check _ collisions ( ) # update entities self. _ player _ dino. update ( ) self. _ cactus _ group. update ( ) self. _ pteras _ group. update ( ) self. _ clouds _ group. update ( ) self. ground. update ( ) self. _ score _ board. update ( self. _ player...
[ -1.042127251625061, -0.40120959281921387, 0.6051768660545349, 0.5978895425796509, 0.48795175552368164, 0.224720761179924, 1.0584794282913208, -0.6434827446937561, -0.658732533454895, -0.03809817507863045, 0.11385931074619293, -0.5332177877426147, -0.15338142216205597, 0.7964380979537964, ...
def test _ valid _ data ( self ) : # send all valid form data form = self. form _ data ( note = " this is a test note ", project = self. project. pk, operator = self. staff _ user. pk, ) self. asserttrue ( form. is _ valid ( ) )
[ 0.3634013831615448, 0.5871925354003906, 0.39086949825286865, 0.3161258399486542, 0.3660186231136322, 1.657817006111145, -0.4766940772533417, 0.6140196323394775, -0.5239540338516235, -1.3116447925567627, -0.7574644088745117, -0.26997077465057373, -0.21966925263404846, -0.3063112199306488, ...
def lease _ tasks _ by _ tag _ async ( self, lease _ seconds, max _ tasks, tag = none, rpc = none ) : lease _ seconds = self. _ validateleaseseconds ( lease _ seconds ) self. _ validatemaxtasks ( max _ tasks ) request = taskqueue _ service _ pb2. taskqueuequeryandowntasksrequest ( ) response = taskqueue _ service _ pb2...
[ 0.25100967288017273, 0.47829243540763855, 0.6085523962974548, 0.39542725682258606, -0.42154422402381897, -0.46744322776794434, -0.33266252279281616, 0.04184690862894058, -0.2330637276172638, -0.24160277843475342, -0.3819209039211273, 0.3607867360115051, -0.16170068085193634, 0.648387491703...
def withdraw ( self, amount ) : if amount > self. balance : raise runtimeerror ('amount greater than available balance.') self. balance - = amount return self. balance
[ -0.33581438660621643, 0.395671546459198, 0.6158803105354309, -0.4426429867744446, -0.2650874853134155, 0.19755616784095764, 0.3516583740711212, -0.44899240136146545, 0.8711056709289551, -0.999016284942627, 0.5892351865768433, -0.4868845045566559, -0.895669162273407, 0.05486137792468071, ...
def display ( self, parent = none, position = - 1, show = true, main = false ) : if main : self. use _ layout = self. mainwindow _ layout elif parent : self. use _ layout = parent if show : self. use _ layout. insertwidget ( position, self ) self. show ( ) self. setfocus ( ) else : self. clearfocus ( ) self. hide ( ) i...
[ 1.0015610456466675, 0.49782851338386536, 0.7692872285842896, 0.004679517354816198, -1.2933200597763062, 0.3225474953651428, 0.9998113512992859, 0.4607844054698944, -0.17412011325359344, 0.25179189443588257, 0.5179272294044495, -0.2927936911582947, -0.7493642568588257, 0.3135065734386444, ...
def getoptions ( ) : version ='$ revision : 1. 1 $'; version = version. replace ('$ revision : ','' ) ver = version. replace ('$ ','' ) us ='% prog [ options ] action file _ name [ file _ name ]'desc ='implements several different actions to process fv ( frequency vector ) files.'\'an action must be defined in order fo...
[ 0.6958428621292114, -0.4641464054584503, 0.9103333950042725, 0.052012789994478226, 0.9795799255371094, -0.5708078742027283, 0.5848540663719177, -0.05526013672351837, -0.8136800527572632, -0.17585335671901703, 0.03779007866978645, 0.17762970924377441, -0.04822368919849396, 0.372337728738784...
def send ( self, protocol, command, payload ) : m = json. dumps ( {'protocol': protocol,'command': command,'payload': payload } ) self. ws. send ( m )
[ -0.5460103750228882, -0.12315496802330017, 0.3885539174079895, -0.3919345736503601, -0.13688881695270538, 0.6430033445358276, -1.268964171409607, -1.3827844858169556, -0.42452964186668396, 0.056207530200481415, -0.8356003761291504, 1.2276928424835205, -0.7639193534851074, 0.309202522039413...
def string _ to _ hex ( x : str ) - > str : x = x. encode ('iso - 8859 - 1') return str ( binascii. hexlify ( x ),'iso - 8859 - 1')
[ 0.01982053555548191, -0.4790261685848236, 0.31141752004623413, 0.6559654474258423, 0.029958516359329224, 1.0841577053070068, -1.2599130868911743, 0.12166924774646759, 0.41433799266815186, 0.8683778047561646, -0.6813045740127563, 0.5703542232513428, 0.9220540523529053, -1.5071521997451782, ...
def parse _ ipa ( data : str ) - > dict [ str, ipanetdevinfo ] : res = { } for line in data. split ( " \ n " ) : if line. strip ( )! ='' and not line [ 0 ]. isspace ( ) : rr = re. match ( r " \ d + : \ s + (? p < name > [ ^ : ] * ) :. *? mtu \ s + (? p < mtu > \ d + ) ", line ) if rr : name = rr. group ('name') res [ n...
[ -0.8013367056846619, -0.2851470708847046, 0.6415501236915588, -0.8009727597236633, -1.734188437461853, 0.11215339601039886, -0.2634228765964508, 0.23971503973007202, -0.4181801378726959, -0.10862796008586884, -0.7106640338897705, -1.109771966934204, -0.16364508867263794, -0.376393228769302...
def share _ name ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " share _ name " )
[ 0.6429625153541565, -0.10514146834611893, 0.7003664970397949, 0.6590803861618042, -0.2624852955341339, 0.8987365365028381, 0.6340806484222412, 0.3589484691619873, -0.2338155210018158, 0.22644710540771484, -0.05365312844514847, 0.670125424861908, 0.27777743339538574, -1.0495376586914062, ...
def test _ stateless _ print ( self, capfd ) : result = result ( np. array ( [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ), is _ stateful = false ) print ( result ) out, err = capfd. readouterr ( ) assert " modes = 2 " in out assert " shots = 3 " in out assert " contains state = false " in out
[ -0.15409357845783234, -0.6147770285606384, 0.3565025329589844, 0.10383354872465134, -0.0006479175644926727, -0.02738901972770691, -0.4718995690345764, -0.7629214525222778, -0.27689898014068604, -0.3120165467262268, -0.113274946808815, 0.21746565401554108, -0.6541791558265686, -0.0848558098...
def date _ exif2sql ( adate ) : # try to parse with microseconds try : bdate = datetime. datetime. strptime ( adate. decode ('utf8'), " % y : % m : % d % h : % m : % s " ) sqldate = bdate. strftime ( " % y - % m - % d % h : % m : % s. % f " ). encode ('utf8') except : sqldate = b'' return sqldate
[ 0.8564327359199524, -0.2058536857366562, 0.8557115197181702, 0.4285174310207367, -1.0752131938934326, -0.24482177197933197, -1.4298405647277832, -0.36154064536094666, 0.3095782399177551, 1.1566271781921387, -0.2855500876903534, 0.17084424197673798, 0.3525780439376831, -0.19516922533512115,...
def connectionmade ( self ) : if self. factory. tunnel _ type = ='tls - uni': # the tls - uni handshake is not completed # unlike the other tunnels, for tls - uni, the final check # for the completion of the handshake occurs in ccp _ client # pass else : print " client : connected to ct _ client " self. factory. ccp _ ...
[ 0.3030126690864563, -0.11331191658973694, 0.21815241873264313, 0.10775391012430191, 0.5224185585975647, 0.712852954864502, -0.16701821982860565, 0.16773106157779694, -0.7853456735610962, -0.17261099815368652, -0.0923827663064003, 0.11182589083909988, -0.2189927101135254, 0.2201358526945114...
def photometry ( data, centroid, wl, header ) : wcs = wcs ( header ) fwhm = get _ pixfwhm ( wl ) cent _ pix = wcs. wcs _ world2pix ( centroid [ 0 ], centroid [ 1 ], 0 ) r _ ap = 2. 5 * fwhm r _ int = 3. 5 * fwhm r _ ext = 4. 5 * fwhm # set iteration limits # x _ l - > leftend ; x _ r - > rightend # y _ u - > upend ; y ...
[ 0.3833693861961365, 0.15095430612564087, 0.8783535957336426, -0.26213788986206055, -0.8608614206314087, 0.08194367587566376, 0.5043221712112427, -0.47539469599723816, 0.43588733673095703, 1.2846485376358032, -0.42268916964530945, -0.32069477438926697, -0.43856242299079895, -0.0893883928656...
def put ( org _ id ) : request _ json = request. get _ json ( ) valid _ format, errors = schema _ utils. validate ( request _ json,'org') token _ info = g. jwt _ oidc _ token _ info if not valid _ format : return {'message': schema _ utils. serialize ( errors ) }, http _ status. http _ 400 _ bad _ request try : org = o...
[ -0.6160486340522766, -0.28636640310287476, 0.686808705329895, -0.0851171687245369, -0.188012957572937, 0.2319217324256897, 0.4171334505081177, -0.41997605562210083, -0.201715886592865, 0.9089762568473816, -0.5451851487159729, 0.8870362639427185, -0.5618630051612854, 0.22830691933631897, ...
def test _ channel _ presence _ xarray _ list ( ) : chan _ presence = mob. channel _ presence ( chmap _ xr _ list ) assert np. all ( chan _ presence = = np. array ( [ [ 0., 0. 8, 0. 2, 0. ], [ 0., 0. 6, 0. 4, 0. ], [ 0., 0. 4, 0. 6, 0. ], [ 0., 0. 2, 0. 8, 0. ] ] ) )
[ 0.3271105885505676, -1.045555830001831, 0.755631685256958, -0.23651283979415894, 1.5878525972366333, 0.590922474861145, -0.506208598613739, -0.11050788313150406, 0.5018635392189026, 0.35140281915664673, -0.4569048583507538, -0.11286008358001709, -0.49264463782310486, 0.9071855545043945, ...
def export _ parameters ( ) : return { }
[ -0.6094034910202026, -0.6997699737548828, 0.38009393215179443, -0.0448361411690712, -0.9993312954902649, -0.1451481133699417, -0.2597328722476959, -0.13765233755111694, 0.2083621323108673, 0.9106016159057617, -1.2806437015533447, 0.18389305472373962, -0.3026357591152191, 0.688176155090332,...
def rollback _ user _ options ( self ) : if self. _ _ rop is not none : self. _ _ rop. parm ( " ar _ user _ options _ enable " ). set ( self. _ _ user _ options _ enable ) self. _ _ rop. parm ( " ar _ user _ options " ). set ( re. sub ( " declare aton _ enable. * ", " ", self. _ _ user _ options _ string ) )
[ 0.6327822208404541, -0.5546837449073792, 0.663620114326477, 0.37513768672943115, 0.48346763849258423, 0.6544723510742188, 0.8870349526405334, 0.9324870705604553, 0.48358219861984253, 0.8191336989402771, 0.5838040709495544, 1.159730315208435, -1.021984338760376, -0.8813696503639221, 0.815...
def setminimumbiomassproduction ( self, reactionid ='biomass ', fractionofoptimum = 0. 95 ) : if reactionid is none or reactionid. lower ( ) in'biomass': biomassid = self. _ _ getbiomassreactionid ( ) if len ( biomassid ) > 1 : reactionid = biomassid [ 0 ] self. objectivereactionid = reactionid # block alternative biom...
[ 0.26602545380592346, -0.439853310585022, 0.6148641705513, 0.899243175983429, 0.39288201928138733, -0.2548004686832428, -0.2702465355396271, -0.5516808032989502, 0.08045928925275803, -0.19131027162075043, -0.12905289232730865, 0.3606947958469391, -0.23849909007549286, 0.35909783840179443, ...
def contains _ universal _ sink ( m ) : n = m. shape [ 0 ] row = 0 col = 0 while row < n and col < n : if m [ row, col ] : row + = 1 else : col + = 1 return row < n and is _ sink ( m, row )
[ -0.5877299308776855, 0.8373667597770691, 0.47317731380462646, 0.7170649170875549, -0.5226446390151978, -0.577734112739563, 1.2301911115646362, 0.27926623821258545, 0.39261507987976074, -0.08263389766216278, 0.11370456963777542, 0.33226415514945984, -0.6576902270317078, 0.8828914165496826, ...
def _ _ setitem _ _ ( self, name, value ) : value = self. _ hook ( value ) super ( dict, self ). _ _ setitem _ _ ( name, value )
[ -1.3457003831863403, 0.11409466713666916, 0.5537640452384949, -0.7021576166152954, -0.6947455406188965, -0.3134274482727051, 0.05706290155649185, 0.06486430764198303, -0.5001884698867798, 0.3941214680671692, -0.5874356031417847, 0.011695628985762596, 0.893945574760437, 0.2071225494146347, ...
def test _ see _ failures ( self, mock _ warning ) : tracker = device _ tracker. devicetracker ( self. hass, timedelta ( seconds = 60 ), 0, [ ] ) # mac is not a string ( but added ) tracker. see ( mac = 567, host _ name = " number mac " ) # no device id or mac ( not added ) with self. assertraises ( homeassistanterror ...
[ -0.37536323070526123, 0.9519848823547363, 0.4551929235458374, 0.10514998435974121, 0.13330672681331635, 0.1267479956150055, -0.15256240963935852, -0.25638702511787415, -0.015077733434736729, -0.28180816769599915, -0.11074823886156082, -0.06479902565479279, 0.43863487243652344, 0.9003349542...
def voclstuf ( self ) : uf = [ ('','selecione'), ('ac ', u'acre'), ('al ', u'alagoas'), ('am ', u'amazonas'), ('ap ', u'amapa'), ('ba ', u'bahia'), ('ce ', u'ceara'), ('df ', u'distrito federal'), ('es ', u'espirito santo'), ('go ', u'goias'), ('ma ', u'maranhao'), ('mg ', u'minas gerais'), ('ms ', u'mato grosso do sul...
[ -0.2602613866329193, 0.30574747920036316, 0.6375812888145447, -0.8930637836456299, -0.3700062334537506, 0.23220935463905334, 0.1816243976354599, 0.49649763107299805, -0.10933224856853485, 0.11802098900079727, -0.9375843405723572, 0.1222304254770279, 0.2587253749370575, -0.8625580072402954,...
def inorder ( self ) : stack = [ ] curr = self. root while curr or stack : if curr : stack. append ( curr ) curr = curr. left else : curr = stack. pop ( ) yield curr. data curr = curr. right
[ -0.03159843757748604, 0.2415459305047989, 0.7878761887550354, 0.07940831035375595, -0.7350150346755981, -0.3867087960243225, -0.5146430730819702, -0.20196713507175446, -0.10610264539718628, 0.04062775894999504, -0.1715974658727646, 0.22386805713176727, -0.8693239092826843, 1.23291766643524...
def test _ _ app _ manager _ can _ delete _ user _ _ succeeds ( am ) : am. create _ user ( username = " uname ", password = " passy ", email = " user @ gmail. com " ) assert len ( am. users ) = = 1 am. delete _ user ( username = " uname " ) assert len ( am. users ) = = 0
[ 0.4112635850906372, 0.5704604387283325, 0.35215264558792114, 1.276401162147522, -0.07469922304153442, 1.0118674039840698, 0.31207746267318726, 0.3367273807525635, 0.058122359216213226, -0.653232991695404, -0.3027651309967041, 0.07450421154499054, 0.17955459654331207, 1.0025323629379272, ...
def user _ to _ jwt ( user ) : assert jwt _ secret is not none return user _ and _ secret _ to _ jwt ( user, jwt _ secret )
[ -0.14039364457130432, -0.019622161984443665, 0.229575514793396, 0.35785698890686035, -0.8962041735649109, -0.5990500450134277, -0.17169933021068573, -0.735879123210907, 0.43844184279441833, -0.27167952060699463, -1.2578506469726562, 0.48882827162742615, 1.1594949960708618, 0.56121724843978...
def moved ( self, * args ) : return _ topods. topods _ shape _ moved ( self, * args )
[ -0.2502010762691498, -0.5861209034919739, 0.3827507495880127, 0.009502624161541462, 0.32630985975265503, 0.716578483581543, 0.5932734608650208, -1.194766640663147, -0.021807312965393066, 0.023183034732937813, -1.0689421892166138, -0.10122387111186981, 0.1669931709766388, -0.393452227115631...
def get _ pred _ acc ( game _ ids, model ) : client = pymongo. mongoclient ( db _ url ) db = client. attempt4 ml _ stats = db. learningstats query = { " game _ id " : { " $ in " : game _ ids } } ml _ data = ml _ stats. find ( query ) parsed _ stats = [ ] for game _ stats in ml _ data : temp _ list = [ ] del game _ stat...
[ 0.07855349034070969, -0.5213775038719177, 0.8047982454299927, -0.378388375043869, 0.3217889666557312, -0.17195869982242584, 0.14578759670257568, 0.035060249269008636, -0.8917912244796753, 0.9037730693817139, 0.4101606011390686, 0.7079038023948669, 0.3838786780834198, -0.42249879240989685, ...
def time _ step ( vel, accel, positions, masses, boxsize, delta _ t ) : positions _ new = positions + delta _ t * vel + 0. 5 * delta _ t * * 2 * accel positions _ new = reset _ particles ( positions _ new, boxsize ) vel _ star = vel + 0. 5 * delta _ t * accel accel _ new = acceleration _ calc ( positions _ new, masses,...
[ 0.5878355503082275, -0.45951640605926514, 0.5479345321655273, 0.3078955113887787, -0.042248114943504333, 0.21503803133964539, -0.23194162547588348, -0.0734047070145607, -1.2358592748641968, -0.2647894620895386, -1.119871973991394, -0.7281078696250916, 0.2756749391555786, 0.3548182845115661...
def test _ coffee _ time ( self ) : if hardwarethread. _ hardwarethread _ _ singleton is not none : hardwarethread. _ drop ( ) # get current original value ( none ) and ensure getter returns the same original _ coffee _ time = \ hardwarethread. _ hardwarethread _ _ coffee _ time self. assertequal ( original _ coffee _ ...
[ -0.3170167803764343, -0.17789609730243683, 0.6292505860328674, -0.1698850393295288, 0.6456319093704224, 0.24903474748134613, 0.02254992164671421, -0.39762866497039795, -0.518642783164978, -0.4736025631427765, -0.2580469846725464, 0.27206140756607056, -0.5735395550727844, 1.2716164588928223...
def isinstance ( self, defined ) : l _ defined = len ( defined ) l _ pattern = len ( self. pattern ) if l _ pattern = = 0 : # this should be doable more elegantly... return l _ defined = = 0 if l _ defined % len ( self. pattern )! = 0 : # need an integer multiple of pattern to match. return - 1 defined = defined. upper...
[ -0.8026523590087891, 0.5042933821678162, 0.690020740032196, 0.0635906234383583, -0.05253199115395546, -0.14240454137325287, 0.5974009037017822, 0.5484567880630493, 0.7932487726211548, -0.41964057087898254, -0.5167688131332397, 0.6982790231704712, -1.3498148918151855, 0.8270137310028076, ...
def authed ( self ) - > pulumi. output [ bool ] : return pulumi. get ( self, " authed " )
[ 0.7985799312591553, 0.6741242408752441, 0.4760039448738098, 0.7470293641090393, 0.5738128423690796, 1.4158414602279663, -0.01727166399359703, -0.39468997716903687, 0.49188143014907837, 0.11716629564762115, 0.3477282226085663, 1.117461085319519, -0.37602150440216064, -0.6641140580177307, ...
def _ train _ step ( self ) : # run a train op at the rate of self. update _ period if enough training steps # have been run. this matches the nature dqn behaviour. if self. _ replay. memory. add _ count > self. min _ replay _ history : if self. training _ steps % self. update _ period = = 0 : self. _ sess. run ( self....
[ -0.6557722091674805, 0.5556811094284058, 0.7184607982635498, 0.3017996847629547, 0.6063343286514282, -0.509429931640625, 0.7413557171821594, -0.3717665374279022, -0.29342442750930786, -0.40608054399490356, 0.1218605488538742, 0.06981218606233597, 0.558735728263855, -0.5548909902572632, -...
def setcroppingregionplanes ( self, p _ float, p _ float _ 1, p _ float _ 2, p _ float _ 3, p _ float _ 4, p _ float _ 5 ) :...
[ 0.15034502744674683, 0.7163267731666565, 0.6464218497276306, 0.9999971389770508, 0.8068509697914124, 1.5596421957015991, 0.906718909740448, -1.0191636085510254, -1.2065272331237793, -0.17765186727046967, -0.38057026267051697, -0.5781999826431274, -1.0283170938491821, -0.16320382058620453, ...
def parent ( self ) - > optional [ " sgfnode " ] : return self. _ parent
[ 1.0813047885894775, 1.0709494352340698, 0.14232008159160614, 0.6434714794158936, -0.035292599350214005, 0.3418102264404297, 0.9132834076881409, -0.8024342060089111, 0.2384440302848816, -0.8038038611412048, 0.3325313329696655, 0.0376773327589035, -0.9556120038032532, -1.1306754350662231, ...
def profile ( ) - > str : session _ id = request. cookies. get ( " session _ id " ) if session _ id : user = auth. get _ user _ from _ session _ id ( session _ id ) if user : return jsonify ( { " email " : " { } ". format ( user. id ) } ), 200 return abort ( 403 )
[ 0.6271346211433411, -0.023352213203907013, 0.9054791331291199, 1.0044500827789307, -0.42323580384254456, -0.935577392578125, 0.14145779609680176, -1.2817763090133667, 0.6387283802032471, 0.9053729176521301, 0.2312902957201004, 1.0851995944976807, 0.5024577975273132, -1.0556033849716187, ...
def test _ generated _ note _ to _ activity ( self, * _ ) : status = models. generatednote. objects. create ( content = " test content ", user = self. local _ user ) status. mention _ books. set ( [ self. book ] ) status. mention _ users. set ( [ self. local _ user ] ) activity = status. to _ activity ( ) self. asserte...
[ 0.05545879155397415, -0.41782087087631226, 0.33934375643730164, -0.14451387524604797, 1.2405297756195068, 0.8521883487701416, 0.7217006683349609, -0.4748798906803131, 0.07363706082105637, -0.10424237698316574, -0.6420058608055115, 0.4911383390426636, -0.291395902633667, -0.6041169166564941...
def load _ explanation ( path ) : pass
[ 0.35367563366889954, -0.27389490604400635, 0.18649166822433472, 0.09803792834281921, -0.6993309855461121, -0.10988256335258484, 0.8508365154266357, 1.2524858713150024, -0.5542072653770447, 0.5125790238380432, -0.48256194591522217, -0.09227021038532257, 0.2291075885295868, -0.27792477607727...
def test _ s3join ( self ) : self. assertequal ( s3join ('a ','b ','c'),'a / b / c') # double slashes should become single slashes : self. assertequal ( s3join ('a / ','/ b / ','/ c'),'a / b / c') # verify that trailing / is preserved : self. assertequal ( s3join ('a ','b ','c /'),'a / b / c /') return
[ 0.9590670466423035, 0.008548436686396599, 0.587840735912323, 0.03444942459464073, 0.3329208791255951, 1.132067322731018, 0.19466330111026764, 0.43084242939949036, 0.5437746047973633, -0.46527087688446045, -0.6724794507026672, -0.6620360612869263, -0.8296640515327454, -0.8565596342086792, ...
def ratelimiter _ stats ( redis _ host, namespace ='ratelimiter ', min _ daily _ count = none ) : conn = redis. redis ( redis _ host ) now = time. time ( ) log = logging. getlogger ('stats. ratelimiter') # remove namespace leaving key l _ namespace = len ( namespace ) all _ keys = set ( ) rl5m = collections. counter ( ...
[ -0.35099250078201294, 0.6007774472236633, 0.9102980494499207, -0.235679030418396, -0.7235991954803467, -0.2558797299861908, -0.8638119101524353, -1.258753776550293, -0.29181376099586487, 0.10807080566883087, 0.4288293719291687, 0.39029374718666077, 0.1392229199409485, 1.2201745510101318, ...
def _ _ init _ _ ( self, calibrator, amplitude _ aim, starting _ dacs = none, bad _ hv = none, illumination _ profile = none ) : from checlabpy. waveform _ reducers. average _ wf import averagewf self. calibrator = calibrator n _ pixels = calibrator. n _ pixels n _ samples = calibrator. n _ samples n _ superpixels = n ...
[ 0.3183012306690216, 0.11154431104660034, 0.6536766886711121, 0.5619528293609619, -0.6891627311706543, -0.016706135123968124, 0.574255108833313, 0.2604697644710541, 0.36306437849998474, 0.16824650764465332, -0.27474889159202576, 0.3742857575416565, 0.3855254054069519, 0.9573782682418823, ...
def _ set _ outputs ( self, new _ outputs ) : old _ outputs = self. outputs self. outputs = new _ outputs if len ( new _ outputs ) > 0 : self. output _ info. datasets = \ [ get _ tvtk _ dataset _ name ( new _ outputs [ 0 ] ) ] if old _ outputs = = self. outputs : # even if the outputs don't change we want to propagate ...
[ -0.3261251449584961, -0.4076308608055115, 0.23223240673542023, 0.0852920338511467, -0.10656315088272095, -0.6744294762611389, 0.021921878680586815, -0.33602088689804077, -0.34904107451438904, 0.024001650512218475, 0.37819427251815796, 0.04942012205719948, 0.24569842219352722, 0.62313568592...
def _ _ init _ _ ( self ) : self. _ _ created _ time = none self. _ _ modified _ time = none self. _ _ name = none self. _ _ modified _ by = none self. _ _ id = none self. _ _ created _ by = none self. _ _ key _ modified = dict ( )
[ -0.2438657581806183, -0.8683902025222778, 0.8044215440750122, -0.32479533553123474, 0.16488498449325562, -0.36594897508621216, -0.4456028938293457, 0.17898868024349213, -0.12368839979171753, -0.09694969654083252, -1.264503002166748, 0.18096990883350372, -0.0638246163725853, 1.1357060670852...
def _ cartesian _ nearest _ indices ( x, nodes, order ='c') : m, n = x. shape # m vectors of length n nums _ grids = np. empty ( n, dtype = np. intp ) for i in range ( n ) : nums _ grids [ i ] = len ( nodes [ i ] ) ind = np. empty ( n, dtype = np. intp ) out = np. empty ( m, dtype = np. intp ) step = - 1 if order = ='f...
[ -0.5939541459083557, -0.10585426539182663, 0.762276828289032, -0.33980593085289, -1.4057143926620483, -0.5428761839866638, -0.326375812292099, -0.8274006843566895, -1.4786440134048462, 0.7435152530670166, -0.060905493795871735, 0.7509201169013977, 0.7074613571166992, -0.5848751664161682, ...
def get _ row ( self, layer _ name, field _ names, where _ clause = none ) : rows _ cursors = self. iter _ rows ( layer _ name, field _ names, where _ clause = where _ clause, limit = 2 ) rows = [ r for ( r, c ) in rows _ cursors ] if len ( rows ) = = 1 : return rows [ 0 ] elif len ( rows ) = = 0 : raise objectdoesnote...
[ -0.1563182920217514, 0.3092331886291504, 0.6945777535438538, 0.5809881091117859, 0.6710364818572998, -0.6379712820053101, -0.408657431602478, -0.13105109333992004, -0.6569624543190002, 0.1900908350944519, 0.3876059353351593, 0.32760632038116455, 0.05347214639186859, 0.04534325748682022, ...
def get _ plant _ id _ for _ resources _ in _ interconnects ( resources, interconnects, grid ) : plant _ id = get _ plant _ id _ for _ resources ( resources, grid ) & get _ plant _ id _ in _ interconnects ( interconnects, grid ) return set ( plant _ id )
[ 0.30539754033088684, -0.8977518677711487, 0.5051400065422058, -0.6282415390014648, 0.7556281089782715, -0.37793442606925964, 0.34263676404953003, -0.03614995256066322, -0.3074606657028198, 0.14566947519779205, 0.043134648352861404, -0.208905428647995, -0.44642531871795654, -1.0574765205383...
def twitter _ setup ( ) : # authentication and access using keys : auth = tweepy. oauthhandler ( consumer _ key, consumer _ secret ) auth. set _ access _ token ( access _ token, access _ token _ secret ) # return api with authentication : api = tweepy. api ( auth ) return api
[ -0.3062504827976227, -1.0050435066223145, 0.5319100618362427, -0.46915191411972046, 0.445135235786438, -0.6836850047111511, -0.4965069890022278, -0.17237597703933716, -0.2750396728515625, 0.6941816806793213, -0.5941936373710632, 0.4638465940952301, 0.4134085178375244, 0.244033083319664, ...
def close ( self ) : self. log _ file. close ( )
[ 1.0135154724121094, -0.6873360872268677, 0.25445449352264404, -0.6321313977241516, 0.183275505900383, 2.0420329570770264, 0.27770891785621643, 0.5363336801528931, -1.9363917112350464, -1.0841692686080933, 1.1706467866897583, 0.366230845451355, -0.32734742760658264, 0.3930038809776306, 0....
def update ( self, request, pk = none ) : coach = coach. objects. get ( user = request. auth. user ) # do mostly the same thing as post, but instead of # creating a new instance of post, get the post record # from the database whose primary key is ` pk ` user = coach. objects. get ( pk = pk ) # user. active = request. ...
[ -1.0711352825164795, -0.8880468606948853, 0.613396942615509, 0.9979287981987, -0.5639224052429199, 0.2894740700721741, 0.8174360990524292, 0.03508668392896652, -0.007484664209187031, 0.1498885452747345, -0.7425274848937988, -0.4701915681362152, -0.20667187869548798, -0.9195364117622375, ...
def delete _ all _ jobs ( self ) : for j in self. jobs : j. delete ( )
[ 0.6156671643257141, -0.8593842387199402, 0.33563247323036194, 0.3198854625225067, 0.7477426528930664, 0.172782763838768, -0.05013073608279228, 0.44128838181495667, -0.24579669535160065, -0.7069241404533386, -0.06308019906282425, -0.10592246800661087, -0.6371524930000305, 1.1374914646148682...
def parse ( self, stream, media _ type : optional [ any ] = none, parser _ context : any = none, ) - > any : parser _ context = parser _ context or { } encoding : str = parser _ context. get ( " encoding ", settings. default _ charset ) try : data : any = stream. read ( ). decode ( encoding ) return orjson. loads ( dat...
[ -0.22197189927101135, -0.8989505767822266, 0.6923673152923584, -0.5222909450531006, -1.1622812747955322, -1.264910101890564, -0.5091797709465027, -0.5207300186157227, 0.7011629939079285, -0.24711422622203827, -0.04520426318049431, 0.08932160586118698, -0.27149179577827454, 0.07815316319465...
def _ _ init _ _ ( self, message ='', token = none, invitee _ email = none, target _ model = none, target _ id = none, target _ attrs = none, status = none, notify = true, created = none, modified = none, id = none, invitee _ id = none, inviter _ id = none, target _ team _ id = none, target _ team _ member _ id = none,...
[ -0.046067431569099426, -0.3486092984676361, 0.8539422750473022, -0.27909672260284424, 0.12335929274559021, -0.3205791115760803, -0.46258676052093506, 0.3680395483970642, -0.1626400202512741, 0.5404693484306335, -0.4007708430290222, 0.7851645350456238, -0.3174899220466614, -0.45544871687889...
def test _ multiple _ response _ types ( self ) : data = {'client _ id': self. client _ multiple _ response _ types. client _ id,'redirect _ uri': self. client _ multiple _ response _ types. default _ redirect _ uri,'response _ type':'id _ token ','scope':'openid email ','state': self. state,'nonce': self. nonce,'allow...
[ -0.31714099645614624, -0.08405957370996475, 0.6026512980461121, 0.033782798796892166, 1.2228261232376099, 0.5999690294265747, 0.08210434019565582, -0.8826830983161926, 0.6014066338539124, -0.7791528701782227, -0.9882428646087646, -0.34553200006484985, -0.15056335926055908, -0.3057223856449...
def library ( self ) : # pylint : disable = global - statement, attribute - defined - outside - init if not self. _ library : try : self. _ library = self. cache. get ( cache. cache _ library,'library') except cache. cachemiss : self. _ library = { } return self. _ library
[ -0.897871732711792, -0.6711050271987915, 0.2380068153142929, -0.4445938169956207, -0.04767750948667526, 0.1603202074766159, 0.7611209154129028, -0.8899720311164856, 0.4686284363269806, -0.36859267950057983, 0.19919553399085999, -0.5613915920257568, -0.3927749693393707, 0.10276686400175095,...
def makelogbookentry ( self, username, token, secret, message _ str ) : message = dict ( ) if not ( self. checktoken ( username, token ) ) : message [ " success " ] = false message [ " error " ] = " invalid authentication token. " return ( json. dumps ( message ) ) next _ cache = self. nextcache ( username ) if next _ ...
[ -1.0497294664382935, 0.16890227794647217, 0.6456553936004639, 0.47283935546875, -0.3430272936820984, 0.32722207903862, -0.04963230341672897, -0.7812454104423523, -0.9613944888114929, 0.1406705379486084, -0.9650156497955322, 0.008847508579492569, -0.7806439995765686, -0.060030512511730194, ...
def plot _ summary ( results _ yaml : dict, selection : str ) : files = [ os. path. splitext ( _ ) [ 0 ] for _ in results _ yaml [ " summary " ] [ " processed _ files " ] ] data = [ results _ yaml [ " summary " ] [ _ ] for _ in files ] data _ df = pd. dataframe ( data ) data _ df [ " filename " ] = files for _ in [ " f...
[ 0.07159660011529922, 0.2765766978263855, 0.761141836643219, -0.081533282995224, -0.058831505477428436, 0.0804719626903534, 0.9717308878898621, 0.3552698493003845, -0.6228512525558472, 0.14799687266349792, 0.31372612714767456, 0.5451971888542175, 0.6346279978752136, -0.02543407678604126, ...
def _ get _ target ( self, update : update ) - > optional [ tuple [ int, str ] ] : if update. message. entities : for entity in update. message. entities : if entity. user : return entity. user. id, entity. user. first _ name if update. message. reply _ to _ message : user = update. message. reply _ to _ message. from ...
[ -0.4310467541217804, -0.8928670883178711, 0.667301595211029, -0.4763946533203125, -0.25837063789367676, -0.5602230429649353, -0.2681412994861603, -0.2663660943508148, -0.37201163172721863, 0.10899410396814346, 0.8735331296920776, -0.04015282168984413, -0.6751615405082703, 0.243865668773651...
def test _ edit _ status _ code ( self ) : user. objects. create _ user ( username ='edit _ status _ code ', password ='password') self. client. login ( username ='edit _ status _ code ', password ='password') response = self. client. get ('/ user _ auth / edit /') user. objects. get ( username ='edit _ status _ code')...
[ -0.30564600229263306, -0.7215164303779602, 0.45418238639831543, 0.7401061058044434, 0.32301634550094604, 0.3319052457809448, 0.5974488258361816, 0.9782583117485046, 0.4853261709213257, -0.0686359703540802, -0.24949203431606293, 0.3878619074821472, 0.29890960454940796, -0.4511584937572479, ...
def sfc _ srsetrestorepointw ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " prestoreptspec ", " psmgrstatus " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value )
[ -0.4797680079936981, 0.2803513705730438, 0.3288116157054901, -0.5377414226531982, 0.004968505818396807, 0.22317279875278473, 0.5860865116119385, -0.6658459305763245, 0.26228001713752747, 0.07631728053092957, 0.05231114476919174, 0.0944405347108841, -1.0462514162063599, 0.6871620416641235, ...
def preprocess ( img _ dir, bbox _ dat ) : n = len ( [ f for f in os. listdir ( img _ dir ) if f. endswith ('png') and not f. startswith ( ". " ) ] ) out = np. zeros ( ( n, 3 * patch _ dim * * 2 ) ) print ( " start preprocessing... " ) with open ( os. path. join ( img _ dir, bbox _ dat ),'rb') as f : reader = csv. read...
[ -0.6072580814361572, -0.039435531944036484, 0.8135069608688354, -0.9396734833717346, 0.12509669363498688, -0.04238402843475342, 0.5565906167030334, 0.1342593878507614, 0.3634885549545288, -0.32954132556915283, 0.1336372345685959, 0.42699918150901794, 0.5470810532569885, 0.21146446466445923...
def test _ complain _ if _ date _ level _ not _ in _ index ( self ) : closes = pd. dataframe ( np. random. rand ( 3, 2 ), columns = [ " fi12345 ", " fi23456 " ], index = pd. date _ range ( start = " 2018 - 01 - 01 ", periods = 3, freq = " d " ) ) with self. assertraises ( parametererror ) as cm : get _ prices _ reindex...
[ -0.24976389110088348, 0.6901763677597046, 0.6073364019393921, 0.42730894684791565, -0.09852247685194016, 0.7106494903564453, 0.05198277160525322, -0.5181325078010559, -0.6658253073692322, -0.12758374214172363, 0.09998708218336105, 0.8052484393119812, -1.0821305513381958, 0.3151907622814178...
def part _ id ( self, part _ id ) : self. _ part _ id = part _ id
[ 1.3871692419052124, -0.7795972228050232, -0.07990589737892151, 0.30418550968170166, 0.4905235171318054, 1.55633544921875, -0.5444023609161377, 0.9754629731178284, 0.3684854507446289, 0.23113879561424255, -0.015107163228094578, 0.30318117141723633, -0.7262232899665833, 0.5843020081520081, ...
def testnonvalueevents ( self ) : gen = _ eventgenerator ( self ) acc = self. _ make _ accumulator ( gen ) gen. addscalartensor ( " s1 ", wall _ time = 1, step = 10, value = 20 ) gen. addevent ( event _ pb2. event ( wall _ time = 2, step = 20, file _ version = " nots2 " ) ) gen. addscalartensor ( " s3 ", wall _ time = ...
[ 0.237321138381958, 0.36818554997444153, 0.49874693155288696, 0.46666812896728516, 0.2118118405342102, 0.5919479727745056, 0.21609383821487427, -1.0084319114685059, -0.5475441813468933, 0.0665149912238121, -0.7899019718170166, -0.2140696495771408, 0.2921185791492462, 1.085943579673767, 0....
def get _ action ( self, state ) : try : if state. getnumagents ( ) - 1! = 1 : raise exception ( " one ghost is expected : not more not " " less! " ) v = float ( " - inf " ) bestmove = directions. stop for ( succgamestate, succaction ) in \ state. generatepacmansuccessors ( ) : self. _ visited. clear ( ) succnodestate ...
[ -0.5233367681503296, 0.19440487027168274, 0.5817533731460571, 0.51663738489151, 0.4038708209991455, -0.1233663484454155, 0.8204214572906494, -0.3720625638961792, -0.07539860159158707, 0.005184127017855644, 0.04642390087246895, 0.7048938870429993, -0.003873451380059123, 0.2973112463951111, ...
def vgg _ weight _ and _ bias ( self, name, w _ shape, b _ shape ) : if name not in self. layers : raise keyerror ( " layer missing in vgg model or mispelled. " ) else : w, b = self. vgg _ params [ self. layers. index ( name ) ] [ 0 ] [ 0 ] [ 0 ] [ 0 ] init _ w = tf. constant ( value = np. transpose ( w, ( 1, 0, 2, 3 )...
[ 0.18343478441238403, -0.6318765878677368, 0.529520571231842, -0.1205085888504982, -0.0659661814570427, -0.3746178448200226, 0.22287116944789886, -0.159597709774971, -0.9258791208267212, 1.3735958337783813, -0.5494755506515503, 0.553633451461792, -0.11252269148826599, 0.22214850783348083, ...
def variable _ bg ( images, bgres ) : backgrounds = [ ] for image in range ( len ( images ) ) : bg = np. zeros _ like ( images [ 0 ] ) if image < bgres : for i in images [ 0 : ( 2 * bgres ) + 1 ] : bg + = i bg = bg / ( ( 2 * bgres ) + 1 ) backgrounds. append ( bg ) elif image > len ( images ) - ( bgres + 1 ) : for i in...
[ -0.09428644180297852, 0.07888326793909073, 0.8044415712356567, 1.1928397417068481, 0.33215436339378357, -0.36650028824806213, 0.5332578420639038, -0.179257333278656, -0.3311831057071686, 1.4311323165893555, -0.5661205649375916, 0.3869839310646057, -0.9828211069107056, 0.8235406875610352, ...
def status ( server, buildname, debug = false ) : pass
[ -0.9638471603393555, -1.1408472061157227, 0.3394950032234192, 0.7901511192321777, -0.17448890209197998, 0.3261401653289795, 0.04665755480527878, 0.7213940620422363, -0.12353303283452988, -0.027535175904631615, -1.058488368988037, 0.5511308312416077, -0.5932954549789429, 1.0487303733825684,...
def _ setup _ learn ( self, envs, eval _ env, n _ learn _ steps, step _ states, episode _ returns, episode _ lengths, cumulative _ returns ) : if not eval _ env : print ('no evaluation environment specified. no results will be printed!!') if n _ learn _ steps is none : n _ learn _ steps = self. max _ steps assert self....
[ 0.18492135405540466, -0.4336637258529663, 0.5271325707435608, -0.35614290833473206, 0.3818468749523163, -0.3263375163078308, -0.12016457319259644, -0.02472473867237568, -0.0254601389169693, -0.07847318053245544, 0.051568444818258286, -0.08233882486820221, 0.42532598972320557, 0.53472888469...
def simplify _ position ( self, pos, isotime = false ) : data = { } if not pos : return data if pos. has _ key ( " systime " ) : if ( time. time ( ) - pos [ " systime " ] ) > 1 : # if position is more than 1 seconds old data [ " gpsage " ] = time. time ( ) - pos [ " systime " ] if isotime : data [ " systime " ] = time....
[ -0.971056342124939, 0.11214061081409454, 1.0833290815353394, -0.4023069441318512, -0.7217839360237122, -0.42724305391311646, -0.5601901412010193, 0.06236637011170387, -0.021072395145893097, 0.9659971594810486, -0.26820456981658936, -0.8032498955726624, 0.39516952633857727, 0.81967675685882...
def open _ browser ( self, uixmlfile, browser ='firefox ', alias = none, remote _ url = false, desired _ capabilities = none, ff _ profile _ dir = none, default _ frame = false, enable _ auto _ visual _ checks = false, enable _ accessibility _ checks = false ) : if remote _ url : self. seleniumlib. _ info ( " opening b...
[ -0.6389124393463135, -0.0655614584684372, 0.835368812084198, 1.1982967853546143, -0.3450113534927368, 0.4577241837978363, 0.9305005073547363, 1.1867398023605347, 0.049180638045072556, -0.3979789614677429, -0.2147599756717682, -0.3260957896709442, -0.4808332622051239, 0.7496888637542725, ...
def verify _ login _ view ( request ) : # store request parameters into respective namespaces username = request. params ['username'] password = request. params ['password'] # query database for the username user = request. dbsession. query ( user ). filter _ by ( username = username ). first ( ) # check first to see i...
[ 0.28002697229385376, -0.08538907766342163, 0.5934558510780334, 1.1584619283676147, -0.1070929691195488, -0.26923781633377075, 0.5671517848968506, -0.04477928206324577, 0.4296709895133972, -0.03910341486334801, 0.5587753057479858, 0.46774470806121826, -0.2170567363500595, 0.0485015138983726...
def user _ not _ exist ( message ) : id = message. chat. id if not db. user _ exists ( id ) and not db. isteacher ( id ) : send _ welcome ( message ) return true return false
[ -0.8743517994880676, 0.4537314474582672, 0.44393691420555115, 0.9596253037452698, 0.2553741931915283, 0.8061054348945618, -0.026372656226158142, -0.8136396408081055, -0.7089818120002747, 0.8698895573616028, -0.490018367767334, -0.22320210933685303, -0.9998437762260437, 0.8471207618713379, ...
def test _ bold ( self ) : self. assertequal ( text. assembleformattedtext ( a. bold ['hello, world.'] ),'\ x1b [ 1mhello, world.')
[ 0.823897123336792, -1.4593960046768188, 0.4840194582939148, 0.7476093769073486, 0.5365894436836243, 0.20366142690181732, -0.8068794012069702, -0.026334555819630623, 0.4787016212940216, -0.4305434823036194, -0.14993669092655182, 0.42865806818008423, -0.4630812704563141, 0.12116070091724396,...
def train ( max _ examples _ per _ lang = 1000 ) : x, y = load _ data ( max _ examples _ per _ lang = max _ examples _ per _ lang ) # todo # split loaded data into training and testing parts with ratio 0. 2 # you can use train _ test _ split ( ) function from sklearn. model _ selection or write your own function # # # ...
[ 0.3892726004123688, -0.032495252788066864, 0.7555696964263916, 0.721328854560852, 0.6220457553863525, -0.08993367105722427, -0.25980275869369507, 0.6382670998573303, -0.13298681378364563, 0.28815582394599915, -1.4080989360809326, -0.062205202877521515, 0.1909952014684677, -0.09303506463766...
def display _ sales _ data ( args ) : today = open ('current _ date. txt'). read ( ) yesterday = ( datetime. strptime ( today,'% y - % m - % d') - timedelta ( days = 1 ) ). strftime ('% y - % m - % d') if args. information = ='revenue': if args. today : revenue = get _ revenue ( today ) if revenue > 0 : rprint ( f " to...
[ -0.3492124378681183, -0.3520893156528473, 1.1026742458343506, 0.00367782823741436, 0.1654849499464035, 0.7836689352989197, 0.3939345180988312, -0.3853384852409363, -0.7969064116477966, -0.2119598090648651, 1.4298938512802124, 0.2939581274986267, 0.673596203327179, 0.6365510821342468, 0.4...
def print _ sorted ( self ) : print ( sorted ( self ) )
[ 0.4979780316352844, -1.1266684532165527, 0.21685566008090973, 0.034430090337991714, 0.06210809201002121, 0.7721306085586548, 0.27002227306365967, -1.5123629570007324, -0.8627846837043762, -1.0309576988220215, 0.07160118222236633, 1.5635793209075928, -0.3309510052204132, 0.8091627955436707,...
def main ( file, host, port, user, password ) : client = paramiko. sshclient ( ) client. set _ missing _ host _ key _ policy ( paramiko. autoaddpolicy ( ) ) client. connect ( host, port = port, username = user, password = password ) sftp = client. open _ sftp ( ) # open sftp connection for file transfer file _ name = f...
[ 1.0482888221740723, -0.7711707949638367, 0.9024642109870911, 1.0261331796646118, 0.07648012042045593, 1.1952801942825317, 0.20914115011692047, 0.6177130341529846, -1.6558021306991577, 0.3480195105075836, -0.38416537642478943, 0.23545114696025848, 0.008173931390047073, -0.11771081387996674,...
def notequalfunc ( self, data ) : return self. field. sortvalue ( data )! = \ self. field. adjustedcomparevalue ( self. value )
[ -0.5146887898445129, -0.1098981723189354, 0.3704861104488373, -0.28662246465682983, -0.008407004177570343, 0.3161463141441345, 0.07914872467517853, -1.1753791570663452, -0.21394185721874237, -0.5371621251106262, -0.6338215470314026, -0.24747714400291443, -0.5106698274612427, 0.352543532848...
def _ get _ sequence ( self, model _ name ) : start = 1 model = getattr ( models, model _ name, none ) if self. existing and model is not none : # get maximum id integer from table and start off from there query = db. select ( [ db. func. max ( model. id ) ] ) max _ = self. _ conn. execute ( query ). scalar ( ) start =...
[ -1.237380862236023, 0.2641375660896301, 0.7271282076835632, 0.7783107161521912, 0.22552025318145752, -0.5585662126541138, 0.25080573558807373, 0.10313785076141357, -0.34536632895469666, 0.3512323498725891, -0.7315553426742554, -0.7241185307502747, -0.22117018699645996, 0.19117899239063263,...
def get _ fits _ by _ previous _ fits ( birdeye _ binary, line _ l, line _ r, verbose = false ) : height, width = birdeye _ binary. shape left _ fit _ pixel = line _ l. last _ fit _ pixel right _ fit _ pixel = line _ r. last _ fit _ pixel # identify the x and y positions of all nonzero pixels in the image nonzero = bir...
[ 0.560644268989563, -0.7467328310012817, 1.0491728782653809, -0.4509279131889343, 0.5508621335029602, -0.9423120617866516, 0.15515677630901337, -0.04003848508000374, -0.10595709085464478, 0.21747110784053802, 0.004831667523831129, 0.8284660577774048, -0.4909258186817169, 1.1387193202972412,...
def findchannelinfobychannelname ( self, channelname ) : # first get the channel id, which we need to get the playlists request = requests. get ('https : / / www. googleapis. com / youtube / v3 / search ', timeout = 10. 0, params = {'key': globalstore. commandhandler. apikeys ['google'],'part':'snippet ','maxresults': ...
[ -0.1427602767944336, 0.08096597343683243, 0.8025100827217102, -0.703339695930481, 0.8579661846160889, -0.359377920627594, 0.1544152945280075, -0.9993247985839844, -0.2184782177209854, 0.2656213939189911, -0.337746798992157, 0.3824927508831024, -1.2847034931182861, 0.9276103973388672, 0.2...
def get _ raw _ explanation ( self, feature _ maps, raw _ feature _ names = none, eval _ data = none ) : raw _ kwargs = _ get _ raw _ explainer _ create _ explanation _ kwargs ( explanation = self ) raw _ kwargs [ explainparams. features ] = raw _ feature _ names raw _ kwargs [ explainparams. is _ raw ] = true raw _ kw...
[ -0.1035066768527031, -0.1239834800362587, 0.5661991834640503, -0.21671390533447266, -0.6690344214439392, -0.2270130068063736, 0.276101291179657, 1.2078049182891846, -0.08261410146951675, -0.7652643918991089, -0.3738972842693329, 0.42512086033821106, 0.5380606055259705, 0.45172497630119324,...
def _ log _ data _ linear ( self, timestamp, data, logconf ) : self. px = data ['state. px'] self. py = data ['state. py'] self. pz = data ['state. pz'] self. vx = data ['state. vx'] self. vy = data ['state. vy'] self. vz = data ['state. vz'] self. setcubeposition ( self. px, self. py, self. pz )
[ 0.30651339888572693, -0.33551108837127686, 0.3357051610946655, -1.0889911651611328, -0.37027835845947266, -0.03233971446752548, -0.7763579487800598, 0.23229841887950897, 0.38955217599868774, 0.349470853805542, -1.12486732006073, -0.0157152209430933, 0.22791509330272675, -0.8586243391036987...
def get _ hfname ( station, year, month ) : if month < 10 : fname ='station _ data / { } / { } _ { } _ hourformat / { } _ 05 _ { } - 0 { } _ hour. csv '. format ( station, station, year, station, year, str ( month ) ) else : fname ='station _ data / { } / { } _ { } _ hourformat / { } _ 05 _ { } - { } _ hour. csv '. for...
[ 0.3894570469856262, -1.1656020879745483, 1.0270452499389648, 0.16283473372459412, -0.4354458153247833, 0.7046921253204346, -0.025778602808713913, -0.1401626020669937, -0.9786689281463623, -0.025810541585087776, 0.5492412447929382, -0.48927369713783264, -0.058230623602867126, 0.658557474613...
def train ( ) : with tf. graph ( ). as _ default ( ) : global _ step = tf. contrib. framework. get _ or _ create _ global _ step ( ) # get images and labels for cifar - 10. images, labels = cifar10. distorted _ inputs ( ) # create a compression object using the compression hyperparameters compression _ obj = cifar10. c...
[ -0.17197582125663757, 0.10001340508460999, 0.587670087814331, -0.18581648170948029, 0.7925795316696167, -0.5568150877952576, 0.8422268033027649, 0.5176749229431152, -0.8533332943916321, 0.29862895607948303, -0.6944320797920227, 0.2983497083187103, 0.33526119589805603, 0.2605542242527008, ...
def validate _ histogram ( hist, factor ) : count = 0 sum = 0 for i, hi in enumerate ( hist ) : sum + = hi if hi < factor * len ( hist ) : count + = 1 print ('average amount of samples in bins : ', round ( sum / len ( hist ) ) ) print ('min bin : ', np. amin ( hist ) ) print ('max bin : ', np. amax ( hist ) ) print ('c...
[ 0.03894750773906708, -0.5109103322029114, 0.41129302978515625, 0.009999992325901985, 0.15105974674224854, 0.47371596097946167, 0.23560024797916412, -0.10869243741035461, -0.21218128502368927, 0.0987587422132492, -0.2613389492034912, 0.5794472694396973, -0.15427640080451965, 0.9828084111213...
def is _ pass ( self ) - > bool : return not self. placements and self. move and self. move. is _ pass
[ -0.7671887874603271, -0.2500767409801483, 0.39236050844192505, 1.1186785697937012, 0.17967399954795837, 1.3221745491027832, 0.519452691078186, 0.08501286804676056, 0.07729625701904297, 0.46756711602211, 0.4663233160972595, 0.009108040481805801, -0.3573658764362335, 0.4043698012828827, -1...
def _ int64 _ feature ( values ) : return tf. train. feature ( int64 _ list = tf. train. int64list ( value = values ) )
[ -0.5970506072044373, 0.08482770621776581, 0.10409141331911087, 0.24625572562217712, 0.08868268877267838, -0.42168349027633667, -0.11632931977510452, 0.5319446921348572, -0.2218133807182312, -0.489887535572052, -0.9908721446990967, 0.027210019528865814, -0.24499857425689697, -0.645403802394...
def lines ( a, b ) : result = [ ] for line in a. split ( " \ n " ) : if line in b. split ( " \ n " ) : if line! = " " : result. append ( line ) return result
[ 0.8089129328727722, -0.5626636743545532, 0.7718327641487122, 0.5640146732330322, 0.29637885093688965, -0.6769669055938721, -1.6663415431976318, 0.705886721611023, -0.36968639492988586, 0.5618834495544434, 0.40792033076286316, 0.19030210375785828, -0.36007118225097656, 0.3969683051109314, ...
def test _ index _ project _ exists _ with _ no _ milestone ( self ) : create _ project _ and _ milestones ( " title ", 0 ) response = self. client. get ( reverse ('projects : index') ) self. assertcontains ( response, " title " ) self. assertquerysetequal ( response. context ['latest _ project _ list'], ['< project : ...
[ -0.52698814868927, 0.9833954572677612, 0.20132958889007568, -0.1290406584739685, 1.3818509578704834, 1.4100536108016968, 0.23583883047103882, -0.11946488916873932, 0.6710712909698486, -0.3588443696498871, 0.050065767019987106, -0.5405951738357544, -0.900053083896637, -0.18408164381980896, ...
def show _ stats ( self, marcas, plat, cant, gasto ) : d = qdialog ( ) l = qgridlayout ( ) d. setlayout ( l ) d. setstylesheet ('background - color : # ffe2bd ;') label = qlabel ('marcas :') l. addwidget ( label, 0, 0 ) label = qlabel ('plataforma :') l. addwidget ( label, 0, 2 ) t = 1 for key, value in marcas. items (...
[ 0.6289195418357849, 0.3219432830810547, 0.9387980699539185, -1.1228182315826416, -0.4966043531894684, 0.6474766731262207, 0.5672746896743774, 0.4525086283683777, -0.46599406003952026, -0.6290119886398315, 0.5931042432785034, 0.24713709950447083, 1.2691264152526855, 0.44101205468177795, 0...
def _ check _ simulation ( self ) : if not self. evolver. can _ simulate ( ) : self. stdout. write ( self. style. notice ( _ ('evolution could not be simulated, possibly due'' to raw sql mutations \ n') ) ) return false diff = self. evolver. diff _ evolutions ( ) if diff. is _ empty ( ignore _ apps = not self. purge ) ...
[ -0.4163391590118408, 1.18307626247406, 0.9196726083755493, 0.33190107345581055, 0.09977638721466064, 0.015208721160888672, -0.09104809165000916, -0.0905391201376915, -0.5504645109176636, -0.08541513979434967, -0.5920611619949341, 0.04786165431141853, 0.12939204275608063, 0.7336885333061218...
def _ _ filltaskcommon ( self, task, task _ request, transactional ) : if self. _ app : task _ request. app _ id = self. _ app. encode ('utf8') task _ request. queue _ name = six. ensure _ binary ( self. _ _ name ) task _ request. eta _ usec = task. _ eta _ usec if task. name : task _ request. task _ name = six. ensure...
[ -0.018788298591971397, 0.4371355175971985, 0.7181335687637329, 0.37546247243881226, 0.029214544221758842, 0.6268810033798218, -0.2537657618522644, -0.40430355072021484, -0.456000953912735, 0.9391871094703674, -0.3101782500743866, -0.19870111346244812, 0.6143143773078918, 0.9655815362930298...