text
stringlengths
25
2.19k
embedding
listlengths
768
768
def split _ file _ pool ( ( lines, infile, n ) ) : outfile = infile + ". " + str ( n ) with open ( outfile, " w " ) as w : for line in lines : w. write ( line )
[ -0.01381490658968687, -0.7990759611129761, 0.32996469736099243, 0.3010260760784149, 0.4306488633155823, 0.765851616859436, 0.6154170632362366, 0.49305012822151184, -1.0703431367874146, -0.2668003737926483, -0.2850998640060425, -0.17536813020706177, -0.4036926031112671, 0.08913250267505646,...
def keys _ to _ filters ( keys ) : return keys _ to _ filters ( keys )
[ -1.9092334508895874, 0.0742756724357605, 0.3460177481174469, 0.16733306646347046, 0.1904742270708084, -1.232348918914795, -0.45649775862693787, -0.23674117028713226, -0.692829430103302, 1.0996527671813965, -0.7643325924873352, 0.6973716616630554, 0.33746373653411865, 0.015507801435887814, ...
def auth ( self ) : credentials = sac. from _ json _ keyfile _ name ( self. creds _ path, self. scope ) return gs. authorize ( credentials )
[ -0.1862235814332962, -0.7555633783340454, 0.31612563133239746, 0.13772371411323547, 0.06249392777681351, -0.31830894947052, 0.0009700513910502195, -0.02126348577439785, -0.5977591276168823, 0.026277711614966393, 0.6267434358596802, 1.2371611595153809, 0.26370471715927124, -0.6176717877388,...
def area _ damping ( self, surface _ area ) : # the difference between the number of triangles we have and # the number of triangles we want. delta _ triangles = abs ( surface _ area - self. target _ area ) # an exponential function we can treat as a probability. return np. exp ( - abs ( self. area _ damping _ strength...
[ 0.32053104043006897, 0.024238012731075287, 0.44214263558387756, -0.6086224913597107, -0.450325608253479, 0.5587748885154724, 1.7848321199417114, 0.13875707983970642, 0.987995445728302, -0.4595412313938141, 0.4971023201942444, 0.03863606974482536, 0.3210643231868744, 0.57011479139328, 0.5...
def blank _ tile ( height = 256, width = 256, dpi = 256 ) : fig, ax = make _ tile _ figure ( height, width, dpi ) ax. set _ frame _ on ( false ) ax. set _ clip _ on ( false ) ax. set _ position ( [ 0, 0, 1, 1 ] ) with io. bytesio ( ) as out _ img : fig. savefig ( out _ img, format ='png ', dpi = dpi, pad _ inches = 0. ...
[ -0.23292793333530426, 0.903400719165802, 0.6714447736740112, 0.0227423757314682, -0.6592284440994263, 0.3816680908203125, 0.1924647092819214, -0.6050730347633362, -0.3040165305137634, 0.03503582254052162, -0.7752302289009094, 0.3986419141292572, 0.08030456304550171, -1.047522783279419, -...
def _ cache _ average _ attempts ( ) : games = game. query ( game. game _ over = = false ). fetch ( ) if games : count = len ( games ) total _ attempts _ remaining = sum ( [ game. attempts _ remaining for game in games ] ) average = float ( total _ attempts _ remaining ) / count memcache. set ( memcache _ moves _ remai...
[ -0.6117594838142395, 0.058480288833379745, 0.5151289701461792, -0.6182769536972046, 0.04956118389964104, 0.0566609688103199, -0.19702766835689545, -0.3124711215496063, -0.8356183767318726, 1.2113233804702759, -0.5120028257369995, 0.5172736644744873, -0.6231369376182556, 0.23829732835292816...
def linear _ search ( vector : list, value : union [ int, float, str ] ) - > int : try : for i in range ( len ( vector ) ) : if vector [ i ] = = value : return i return - 1 except exception as e : print ( e ) return - 1
[ -0.3665917217731476, -0.33778083324432373, 0.4652993083000183, 0.373086154460907, -0.770123302936554, 0.5605956315994263, 0.43485182523727417, -0.3701617121696472, -0.3665844798088074, 0.18734394013881683, 0.06993405520915985, -0.05390796810388565, -1.0000044107437134, 0.11864185333251953,...
def test _ one _ formatter _ for _ two _ rows ( self ) : r = get _ sheet ( file _ name = self. testfile ) r. row. format ( [ 1, 2 ], str ) c1 = r. row _ at ( 2 ) c2 = [ " 2 ", " 2 ", " 2. 2 ", " 2. 2 ", " 3 ", " 3 " ] self. assertequal ( c1, c2 ) c1 = r. row _ at ( 1 ) c2 = [ " 1 ", " 1 ", " 1. 1 ", " 1. 1 ", " 2 ", " ...
[ -0.6034989356994629, -0.8047451972961426, 0.6248372197151184, -0.059756483882665634, 0.07630466669797897, -0.1946345865726471, -0.15152636170387268, -0.6473329067230225, -0.17904137074947357, -0.403221070766449, -0.19634085893630981, 0.231824591755867, 0.6685429811477661, 1.3253253698349, ...
def movie _ id ( self ) : return self. movie _ playing. id
[ 0.3144916296005249, -1.2600560188293457, 0.5175735354423523, 1.3550463914871216, 0.7302275896072388, 1.3642632961273193, -0.13549835979938507, 0.3841375708580017, 0.32455796003341675, 0.038720738142728806, 0.25246864557266235, 1.328982949256897, -0.9385339021682739, 0.4164239764213562, 0...
def _ ast _ add _ license ( self ) - > none : with open ( " license " ) as license _ file : self. ast _ body. append ( expr ( value = constant ( value = f " \ n { license _ file. read ( ) } " ) ), )
[ 0.8852171897888184, -0.6055707931518555, 0.6602239608764648, -0.6505018472671509, -0.2756165862083435, 0.6121700406074524, -0.6448630094528198, 1.6510045528411865, 0.06962089240550995, 0.6741472482681274, -0.016631897538900375, 0.15874774754047394, 0.622890830039978, 0.6606931090354919, ...
def edit _ note ( data : dictionary ) : display _ categories ( data ) category _ choice = input ( " choose category : " ) display _ notes ( data, category _ choice ) if len ( data [ category _ choice ] ) > 0 : note _ choice = int ( input ('choose note to edit :') ) new _ note = input ( " enter new note : " ) data [ cat...
[ -0.4402710497379303, -0.1430734395980835, 0.4337623417377472, -0.45792514085769653, 0.4471536874771118, 0.26820600032806396, 0.8691278696060181, -0.33716756105422974, -0.5413908958435059, 0.11734260618686676, -0.06609806418418884, 0.9009848833084106, 0.41601115465164185, 0.1245830655097961...
def check _ init _ vect _ value _ ctr ( init _ vect : bytearray, block _ size : int ) - > bool : result = true if ( not isinstance ( init _ vect, ( bytes, bytearray ) ) ) or len ( init _ vect )! = block _ size / / 2 : result = false return result
[ 0.048274774104356766, -0.5333276987075806, 0.5185673832893372, 1.2719138860702515, -0.3612518608570099, 0.44427353143692017, 0.5834957957267761, -0.43113580346107483, -0.047482606023550034, -0.47531822323799133, -0.2430301308631897, 0.33129942417144775, -0.9132335782051086, 0.4959660768508...
def _ serialize ( self ) - > str : return str ( exprserializer ( self ) )
[ -0.4994460940361023, -1.3279297351837158, 0.09968430548906326, -1.0571479797363281, -0.8403609395027161, -0.14298349618911743, -0.34928667545318604, 0.14403188228607178, 0.5342435240745544, -0.32028359174728394, 0.5771715641021729, 0.2914954125881195, -0.4771963953971863, -0.34289410710334...
def update _ message ( self ) : need _ recall, msg = self. create _ message ( ) if need _ recall : sublime. set _ timeout ( lambda : self. update _ message ( ), 1000 ) # # calls set _ error _ calculation _ status _ message ( ) with an edit _ token if self. _ is _ view _ still _ open ( ) : debug ('errorpanel ', " error ...
[ -0.2373315989971161, -0.10792092978954315, 0.43570345640182495, -0.819134533405304, 0.1728711873292923, 0.14821921288967133, 0.1309928447008133, -0.37446585297584534, -0.19207598268985748, 0.0022885322105139494, 0.34500208497047424, 1.3215739727020264, -0.404512494802475, 0.716199755668640...
def itksmoothingrecursivegaussianimagefilteriul3iul3 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilteriul3iul3 _ cast ( * args )
[ 0.2435808777809143, 1.172583818435669, 0.43902403116226196, -0.9712662696838379, -0.582004725933075, 1.4650627374649048, -0.6061535477638245, 0.12077391892671585, 0.5324288010597229, -0.014557886868715286, 0.20363886654376984, 0.867959201335907, -0.6920940279960632, 0.07899448275566101, ...
def test _ user _ story _ 0a ( self ) : self. blackjack. pick _ cards = magicmock ( return _ value = [ 10, 9 ] ) self. blackjack. deal ( ) self. assertequal ( self. blackjack. points ( ), 19 )
[ 1.5695760250091553, -0.2160390168428421, 0.15406693518161774, 0.6342695951461792, 1.499959945678711, 0.2512316107749939, 0.48520123958587646, 1.0836352109909058, 0.2681009769439697, -0.5339246392250061, -0.09939621388912201, -0.876899003982544, 0.33099108934402466, -0.3485246002674103, 0...
def validate _ location ( self, location ) : geo _ location = re. compile ( " ^ [ 0 - 9 ] { 2 } (. ) [ 0 - 9 ] { 2 } ( ) [ 0 - 9 ] { 2 } (. ) [ 0 - 9 ] { 2 } $ " ) if not location or location. isspace ( ) : return'please enter the location of this redflag'elif not geo _ location. match ( location ) : string1 ='invalid ...
[ -0.4901295304298401, -0.33935266733169556, 0.5963882803916931, -0.3197401762008667, 0.11256411671638489, 0.9875536561012268, -0.3306584656238556, 0.25722619891166687, 0.008222409524023533, -0.20631937682628632, 0.7867627143859863, -0.027193492278456688, 0.3140057325363159, 0.83771985769271...
def page _ not _ found ( request, * args, * * kwargs ) : raise routenotfound ( )
[ -0.16729043424129486, -0.7811551690101624, 0.40752920508384705, -0.07006954401731491, 0.588272213935852, 0.5913774371147156, -0.12540334463119507, -0.2511045038700104, -0.5030733346939087, 0.3812534809112549, 0.6322788596153259, 0.01094367727637291, 0.3134748041629791, 0.46584537625312805,...
def get _ all _ units _ on _ tetrode ( self, tetrode _ nr ) : return [ unit for unit in self. units if unit ['tetrode _ nr'] = = tetrode _ nr ]
[ -0.5988388657569885, -0.7707540988922119, 0.35375264286994934, -0.28402432799339294, 0.3793562948703766, 0.04252934083342552, -1.1775259971618652, 0.0843786969780922, 0.1544215828180313, 0.9956958293914795, 0.16784463822841644, -0.20057612657546997, 0.09406339377164841, 0.7226946949958801,...
def num _ of _ inversions _ naive ( self, array ) - > int : n = len ( array ) count = 0 for i in range ( n - 1 ) : for j in range ( i + 1, n ) : if array [ i ] > array [ j ] : count + = 1 return count
[ -0.8865201473236084, 0.8035354614257812, 0.7108563780784607, 0.213791623711586, -0.3106846213340759, 0.07505864650011063, 0.3389665484428406, 0.3455563485622406, -0.3879258930683136, 0.026039401069283485, -0.6398475766181946, -0.3312233090400696, -0.25554484128952026, 0.7559550404548645, ...
def execute _ sp _ row1 ( self, sql : str, * params ) - > dict [ str, any ] : cursor = self. _ _ conn. cursor ( as _ dict = true ) cursor. execute ( sql, params ) rows = cursor. fetchall ( ) cursor. close ( ) n = len ( rows ) if n! = 1 : raise resultexception ('1 ', n, sql ) return rows [ 0 ]
[ -0.20923246443271637, 0.9204768538475037, 0.61334228515625, 1.1376867294311523, -0.29362383484840393, -0.4722675681114197, -0.6113638281822205, -0.500243604183197, 0.00359167717397213, 0.5980318784713745, 0.5819723010063171, 0.374610960483551, -0.14223307371139526, 0.7229229807853699, -0...
def is _ consumable ( self ) : for k in self. keywords : if k in self. consumable _ keywords : return true return false
[ 0.28671029210090637, -0.10334450751543045, 0.6136960387229919, 0.817891001701355, -0.4476916491985321, -0.10470055043697357, -0.9113539457321167, 0.5277559757232666, -0.9972586631774902, 1.7159605026245117, -0.140976682305336, -0.44392216205596924, -0.8616423606872559, 0.8069027066230774, ...
def vis _ nodeindep _ elements ( curr _ doc : currentdoc, el _ list ) : i = 0 for el in el _ list : el _ to _ plot = convert _ node _ indep _ type ( el ) name = " name _ str _ " + str ( i ) el _ type = el _ to _ plot. type if el _ type = = elsupenum. elsupenum. support _ fixed _ end. value : el _ type = elsupenum. elsu...
[ -0.7053245306015015, 0.4629250466823578, 0.6964760422706604, -0.29581862688064575, -0.47493916749954224, 1.327775239944458, 1.0708622932434082, 0.9544454216957092, 0.3461380898952484, 0.3400377035140991, -0.5887490510940552, 0.5429381728172302, -0.06626779586076736, 0.3705258369445801, 0...
def addsplit ( self ) : tw = tabwidget ( self ) tw. show ( ) self. _ _ splitter. addwidget ( tw ) self. tabwidgets. append ( tw ) self. currenttabwidget. showindicator ( false ) self. currenttabwidget = self. tabwidgets [ - 1 ] self. currenttabwidget. showindicator ( true ) tw. currentchanged. connect ( self. _ _ curre...
[ -0.3014316260814667, -0.39561957120895386, 0.6141034960746765, -0.24083063006401062, -0.5676906704902649, 0.3660835325717926, 0.8238686919212341, 0.5965380668640137, 0.08380644023418427, -0.20053428411483765, -1.0924081802368164, -0.6513838171958923, -0.5698369145393372, 0.753648579120636,...
def define _ nets ( self ) : self. nets. add _ net ( " gnd " ) self. nets. add _ net ( " vcc " ) self. nets. add _ net ('" net - ( c6 - pad1 ) "') self. nets. add _ net ('" net - ( c7 - pad1 ) "') self. nets. add _ net ('" net - ( c8 - pad1 ) "') self. nets. add _ net ('" net - ( j1 - pad4 ) "') self. nets. add _ net (...
[ -0.2635609805583954, 0.7741336822509766, 0.8976232409477234, 0.1975800096988678, 0.14537233114242554, -0.15330728888511658, 0.7419276833534241, -0.40309321880340576, 0.0489705428481102, -0.552560031414032, -0.512041449546814, -0.6963130235671997, 0.5762923359870911, 0.838391125202179, 0....
def load _ model ( model _ name : str ) - > topicmodel : # model _ path = os. path. join ( os. path. dirname ( os. path. abspath ( _ _ file _ _ ) ), model _ name ) model _ path = os. path. join ( '. ', model _ name ) if os. path. isdir ( model _ path ) : print ( f'the model " { model _ name } " was already downloaded b...
[ 0.4137266278266907, -0.575735867023468, 0.9840176701545715, -0.1790362149477005, -0.511454164981842, -0.23228734731674194, -0.2533283531665802, -0.942748486995697, 0.029419852420687675, 0.24132122099399567, 0.06207343935966492, -0.40713056921958923, -0.8240650296211243, -0.4089701175689697...
def enhancement _ fit ( datadict ) : data, isdict = return _ data ( all _ data ) if " enhancements " not in all _ data. keys ( ) : raise typeerror ( " please use dnpnmr. calculate _ enhancement ( ) first " ) power _ axes = all _ data [ " enhancements " ]. coords [ " power " ] input _ data = _ np. real ( all _ data [ " ...
[ 0.05325295031070709, 0.12554390728473663, 0.5789290070533752, -0.22245290875434875, -0.1368868499994278, -0.1843295693397522, -0.5705741047859192, 0.5235339403152466, -0.0769520178437233, -0.2405746728181839, -0.7751429080963135, 0.6303467750549316, -0.038696277886629105, 0.161927282810211...
def resolve _ embryo _ life _ stage ( self, embryo _ stage ) : embryo _ stage = str ( embryo _ stage ). replace ( " e ", " " ) return ( constants. efo _ embryonic _ stages [ embryo _ stage ] if embryo _ stage in constants. efo _ embryonic _ stages else " efo : " + embryo _ stage + " not _ found " )
[ -0.27618318796157837, -0.5507367253303528, 0.5223743319511414, -0.5559984445571899, -0.10723899304866791, 0.21742971241474152, -0.5542216897010803, 0.12432379275560379, -0.029562706127762794, 0.7908720970153809, 0.3601411283016205, -1.0444424152374268, 0.8700962662696838, 0.715975344181060...
def build _ groups ( self, graph ) : return cs. find _ connected ( graph ). values ( )
[ -0.7733325362205505, 0.35149946808815, 0.319047212600708, 0.6192142367362976, 0.32575663924217224, 0.16316473484039307, 0.016114888712763786, -0.4372946619987488, -1.0292595624923706, -0.08189938217401505, 0.2159857600927353, -0.17088666558265686, -0.26242128014564514, -0.32937222719192505...
def raw _ player _ attributes _ statistics ( ) : player _ attributes = pd. read _ sql ( " select * from player _ attributes ", getdata. conn ) print ('columns : ', len ( player _ attributes. columns ) ) print ('rows with nans : ', len ( player _ attributes ) - len ( player _ attributes. dropna ( ) ) ) print ( player _ ...
[ -0.2186862677335739, 0.46432578563690186, 0.575446605682373, -0.6104485988616943, -0.24694840610027313, -0.18007490038871765, 0.3272381126880646, 0.21384792029857635, -0.5165178775787354, 0.23153793811798096, 0.08037754148244858, 0.7930022478103638, 1.0203851461410522, -0.28661462664604187...
def setup _ debug _ mode ( globals _ dict = none ) : if globals _ dict : app = globals _ dict ['app'] plone = setup _ plone ( app ) globals _ dict ['plone'] = plone else : app = none n = 1 # walk up the stack looking for'app'in frame globals while n < = max _ frames : cur _ frame = sys. _ getframe ( n ) app = cur _ fra...
[ -0.33790871500968933, 1.1862365007400513, 0.820167601108551, 0.207931786775589, 0.5095621347427368, 0.5116760730743408, 0.6538070440292358, 0.14420285820960999, -0.14857128262519836, 0.8147750496864319, -0.7886447906494141, -0.15297748148441315, -0.5000529885292053, 0.48684388399124146, ...
def find _ tracked _ pairs ( distances, cut _ off ) : num _ of _ pairs = np. zeros ( len ( distances. keys ( ) ) ) index _ list = np. asarray ( np. where ( distances ['timestep _ 0'] < cut _ off ) ) for index, key in enumerate ( distances ) : num _ of _ pairs [ index ] = np. asarray ( np. where ( np. take ( distances [...
[ -0.5897256135940552, 0.5853108763694763, 0.6767980456352234, -0.3906257450580597, -0.8700550198554993, 0.23432162404060364, 0.46901971101760864, 0.3085906207561493, 0.1565498560667038, 0.9853894114494324, 0.07442251592874527, -0.7065437436103821, -0.20098958909511566, 1.024532437324524, ...
def clean _ area ( screen, origin, width, height, color ) : ox, oy = origin points = [ ( ox, oy ), ( ox + width, oy ), ( ox + width, oy + height ), ( ox, oy + height ), ( ox, oy ) ] pygame. draw. polygon ( screen, color, points, 0 )
[ -0.0801558643579483, -0.857928991317749, 0.5322691202163696, -1.0197831392288208, -0.16283459961414337, 0.5806977152824402, -0.29637765884399414, 0.12362987548112869, 0.6509891152381897, 0.8103957176208496, 0.0981357991695404, 1.1561102867126465, 0.9531266093254089, -0.08723101019859314, ...
def _ reconcile _ vios ( db _ vios, server _ vios, context, db _ session, dom _ factory ) : msg = ( ras. vif _ get _ msg ('info ','reconcile _ vios _ start') % {'host': server _ vios. get _ host _ name ( ),'vios': server _ vios. lpar _ id } ) ras. trace ( log, _ _ name _ _, ras. trace _ debug, msg ) db _ veas = db _ vi...
[ 0.14143773913383484, -0.6529545187950134, 0.6831099987030029, -0.03181138634681702, 0.7408705949783325, -0.9107521176338196, -0.11927931755781174, 0.17480316758155823, 0.9952993392944336, 0.4458966553211212, 0.040305353701114655, -0.39109405875205994, -0.2500475347042084, 0.262804150581359...
def export _ individual _ endpoint _ as _ html ( f, ri ) : deprecated, replaced _ by = is _ deprecated ( ri ) permissions = ', '. join ( [ i ['name'] for i in ri ['permission'] ] ) title _ block = title _ block. format ( * * ri ) f. write ( title _ block ) # write top - level infomation vals ='name title description ur...
[ -0.18871013820171356, 0.4887126684188843, 1.027681589126587, 0.5162187218666077, -0.494218111038208, -0.1875225454568863, 0.3367145359516144, -0.22904451191425323, -0.19970744848251343, 0.260518342256546, -0.008027438074350357, 0.14167778193950653, 0.4025324285030365, -0.08535780757665634,...
def maximum _ subarray ( arr ) : if len ( arr ) < 2 : return arr m = [ 0 ] * len ( arr ) m [ 0 ] = arr [ 0 ] prev = [ - 1 ] * len ( arr ) max _ sum = arr [ 0 ] last _ index = 0 for i, a _ i in enumerate ( arr [ 1 : ], 1 ) : local _ max _ sum = max ( m [ i - 1 ] + a _ i, a _ i ) m [ i ] = local _ max _ sum if m [ i - 1 ...
[ 0.6664624810218811, 0.038574736565351486, 1.2198840379714966, 1.1521170139312744, -0.3750839829444885, -0.3411538004875183, 0.9399523138999939, -0.08823999017477036, 0.7184141874313354, 0.29010987281799316, -0.19650347530841827, -0.12358427792787552, -0.05859001353383064, 0.461731165647506...
def nan _ calc _ sisj ( data ) : ( s, n ) = data. shape sisj = np. zeros ( n * ( n - 1 ) / / 2 ) k = 0 for i in range ( n - 1 ) : for j in range ( i + 1, n ) : sisj [ k ] = np. nansum ( data [ :, i ] * data [ :, j ] ) / \ float ( np. sum ( np. isnan ( data [ :, i ] * data [ :, j ] ) = = 0 ) ) k + = 1 return ( np. nansu...
[ 0.1574186384677887, 0.36367034912109375, 0.5664600729942322, -0.08782247453927994, -0.6576657295227051, -0.558217465877533, 1.004298448562622, 0.3192867636680603, 0.4210856556892395, 1.050453782081604, -0.6812559962272644, 0.28948524594306946, 0.17163611948490143, 0.8795322179794312, 0.3...
def _ normalize _ characterid ( self, characterid ) : try : return int ( characterid ) except ( valueerror, overflowerror ) : raise imdberror,'characterid " % s " can \'t be converted to integer'\ % characterid
[ -0.1210019513964653, -0.906860888004303, 0.1648223102092743, -0.8154466152191162, -0.8410531878471375, -0.00022282842837739736, -0.04997378587722778, -0.33194202184677124, 0.7892812490463257, 0.32356616854667664, 0.35892605781555176, 0.6727108955383301, -1.422088861465454, 0.97575074434280...
def attribute _ is _ readonly ( self, key, _ flow = _ down ) : key = self. _ attributes _ t _ keycheck ( key ) us _ key = self. _ attributes _ t _ underscore ( key ) return self. _ attributes _ i _ is _ readonly ( us _ key, _ flow )
[ -1.3383606672286987, 0.18149396777153015, 0.4656028151512146, 0.5735233426094055, -1.1329725980758667, 0.019384324550628662, 0.6049302816390991, 0.09317903965711594, 0.5216751098632812, 1.0448660850524902, 0.09049825370311737, 0.7992019653320312, 0.15797089040279388, 0.18372730910778046, ...
def camera _ image ( self ) : now = int ( time. time ( ) ) if self. _ ready _ for _ snapshot ( now ) or true : image = self. _ device. camera _ get _ image ( self. _ uuid, now ) self. _ next _ snapshot _ at = now + self. _ time _ between _ snapshots self. _ last _ image = image return self. _ last _ image
[ -1.09982430934906, 0.33751606941223145, 0.5775930881500244, 0.2438220977783203, -0.3783811628818512, -0.1255936175584793, -0.40400099754333496, -0.41363152861595154, 0.36380472779273987, -0.24958235025405884, 0.5911974310874939, -0.285264790058136, 0.05953305587172508, -0.09701602160930634...
def handle _ configure _ healthmonitor ( self, ev ) : return self. _ process _ event ( ev )
[ -0.15244445204734802, -0.3366069197654724, 0.479844331741333, 0.39311254024505615, 0.9011196494102478, -0.13048778474330902, -0.1264946460723877, -0.18412746489048004, 0.4292370080947876, -0.6516240239143372, -0.3192613422870636, -0.3160156309604645, 0.37526193261146545, 0.7772716879844666...
def parse ( self, file _ obj ) : order = 1 host = { " host " : ['*'], " config " : { }, } for line in file _ obj : line = line. rstrip ('\ n'). lstrip ( ) if line = ='' : self. _ config. append ( {'type':'empty _ line ','value': line,'host':'','order': order, } ) order + = 1 continue if line. startswith ('#') : self. _...
[ -0.22951163351535797, -0.1543319970369339, 0.7814022302627563, -0.2449110448360443, -0.05453655868768692, -0.2538406252861023, -0.030522268265485764, 0.539687991142273, -1.352678894996643, 0.0732891783118248, -0.8313573598861694, -0.1309225857257843, 0.17581990361213684, 0.522331714630127,...
async def _ async _ mock _ entity _ with _ logbook _ platform ( hass : homeassistant, entity _ registry : er. entityregistry ) - > er. registryentry : entry = mockconfigentry ( domain = " test ", data = { " first " : true }, options = none ) entry. add _ to _ hass ( hass ) entry = entity _ registry. async _ get _ or _ ...
[ -0.15361280739307404, 0.6058732271194458, 0.4713452160358429, 0.07715972512960434, 1.132904052734375, 0.03794318437576294, -0.07552077621221542, -0.11573680490255356, 0.029696820303797722, 0.12657779455184937, 0.3577943742275238, -0.10158374160528183, -0.3270866572856903, 0.487204045057296...
def format _ keyword ( opt, val, lop _ off = true ) : # transform string booleans into " " if val is true : return opt. lower ( ),'' elif val is false : return'','' # complete hack if opt. upper ( ) = ='memory': return opt. lower ( ), f'{ val } byte'elif isinstance ( val, list ) : text =''. join ( [ str ( v ) for v in ...
[ 0.8761757612228394, -0.5786972641944885, 0.49994346499443054, -0.41603314876556396, -1.368025779724121, 0.2294483631849289, -1.2821205854415894, -0.21107608079910278, 0.384705513715744, 1.316182017326355, 0.5760498046875, 0.6092158555984497, -0.4927634000778198, 0.8242698907852173, -0.00...
def get _ spread ( path _ to _ file, col1, col2 ) : table = pd. read _ csv ( path _ to _ file, index _ col = 0 ) difference = table [ col1 ] - table [ col2 ] return difference. abs ( ). idxmin ( )
[ 0.07628261297941208, -0.5382636785507202, 0.610363245010376, 0.853926420211792, 0.061019137501716614, 0.6255975961685181, -0.034834735095500946, -0.3658219575881958, -1.140364646911621, 0.04448244720697403, 0.42246213555336, 0.8038549423217773, 0.22098606824874878, -1.5032416582107544, 0...
def progress ( grid : np. ndarray ) - > none : neighbor _ cnts = count _ neighbors ( grid ) grid _ v = grid. ravel ( ) neighbor _ cnt _ v = neighbor _ cnts. ravel ( ) birth _ rule = ( grid _ v = = 0 ) & ( neighbor _ cnt _ v = = 3 ) survive _ rule = ( grid _ v = = 1 ) & ( ( neighbor _ cnt _ v = = 2 ) | ( neighbor _ cnt ...
[ -0.25530314445495605, 0.36045747995376587, 0.6158103346824646, -0.1278996616601944, 0.6360212564468384, 1.2236292362213135, 0.591532289981842, 0.2352413833141327, -0.6372998952865601, 1.1194496154785156, 0.3234131634235382, 0.020339954644441605, -0.19315533339977264, 0.8443268537521362, ...
def compute _ tsforecast _ hpo ( s3 _ args : s3args, data _ args : tsforecasthpoargs ) : args = data _ args. dict ( ) args = { key. replace ( " _ ", " - " ) : str ( value ) for key, value in args. items ( ) if value is not none } sagemaker _ response = run _ sagemaker _ hpo ( url = s3 _ args. s3 _ url, dest _ url = s3 ...
[ 0.29491984844207764, -0.28021109104156494, 0.6582030057907104, -0.4023398756980896, 0.3693782687187195, 0.16608987748622894, -0.7217018604278564, 1.2475707530975342, -0.1732465922832489, 0.7096604704856873, -0.0018305213889107108, -0.08335815370082855, 0.43535110354423523, -0.4452364146709...
def cows _ configuration _ 2 ( self, player ) : hero _ semimills = 0 villain _ semimills = 0 for l in range ( state. board _ size ) : for r in range ( state. board _ size ) : for c in range ( state. board _ size ) : # - - - - - - - - - - - - - - - - - - - - - - - [ hero ] - - - - - - - - - - - - - - - - - - - - - - - #...
[ -0.019213879480957985, -0.3995707929134369, 1.0682047605514526, -0.540340006351471, 0.0039583006873726845, -0.349734365940094, 1.1626003980636597, 0.5801401138305664, -0.48937779664993286, 0.7154058814048767, -1.0860083103179932, -0.1905260980129242, -0.2508866786956787, 0.5202428102493286...
def split ( p ) : i = p. rfind ('/') + 1 head, tail = p [ : i ], p [ i : ] if head and head! ='/'* len ( head ) : head = head. rstrip ('/') return head, tail
[ -0.8290969729423523, 0.5208512544631958, 0.44249558448791504, 0.23628664016723633, -0.2225261926651001, 0.47232136130332947, -0.1447858214378357, 0.23020580410957336, 0.4134750962257385, 0.4393087327480316, -0.46840324997901917, -0.16997361183166504, -1.7225501537322998, -0.513294398784637...
def test _ sprint _ url ( self ) : target = sprint. objects. create ( project = self. project, number = 1 ) item. objects. create ( summary ='item 1 ', priority = 1, sprint = target ) response = self. client. get ( target. get _ absolute _ url ( ) ) self. failunlessequal ( 200, response. status _ code ) self. failunles...
[ -0.9319303035736084, -0.10442271083593369, 0.5883366465568542, 0.5295716524124146, 0.6994616985321045, 0.5972104668617249, -0.9626257419586182, 0.08927161991596222, -0.0167623832821846, -0.5756087899208069, -0.15906403958797455, 0.07394413650035858, 0.7100311517715454, -0.2462628185749054,...
def test _ send _ utf8 ( self ) : c1 = self. _ new _ client ( ) c1. subscribe ('/ queue / foo') unicodemsg = u'我 下 不'utf8msg = unicodemsg. encode ('utf - 8') c2 = self. _ new _ client ( ) c2. send ('/ queue / foo ', utf8msg ) res = c1. received _ frames. get ( ) self. assertequal ( res. cmd, frames. message ) self. ass...
[ 0.6581763625144958, 0.08511799573898315, 0.4580289125442505, 0.10712096095085144, 0.6734901666641235, 0.3772675395011902, -0.008902810513973236, -0.39451301097869873, 0.05261886492371559, -0.28008830547332764, -0.6203023195266724, 0.7924410700798035, -0.8511684536933899, 0.1622296571731567...
def _ _ init _ _ ( self, name ) : # name of the database. self. _ _ name = name # name of the tables in the database. self. _ _ tables = { } # a special table used to generate primary keys for the other # tables. self. _ _ idtable = none # the idbroker that goes with the idtable. self. _ _ idbroker = none # the idgener...
[ -0.7894191145896912, 0.8332061171531677, 0.5211345553398132, 0.7818664312362671, -0.5900519490242004, -0.19710247218608856, 0.5016896724700928, -0.26534557342529297, 0.13206808269023895, -0.19728410243988037, -1.7393362522125244, -0.7666369676589966, -0.8716740012168884, 1.086485505104065,...
def compute _ node _ get _ by _ cpu _ arch ( context, cpu _ arch, session = none ) : return impl. compute _ node _ get _ by _ cpu _ arch ( context, cpu _ arch )
[ -0.863136887550354, 0.546538233757019, 0.28066888451576233, 0.2672874331474304, -0.2039760947227478, -1.0327471494674683, 0.6934293508529663, -0.4828501045703888, 0.5949394106864929, 0.3565298020839691, 0.05451285466551781, 1.181106448173523, -0.052499689161777496, -0.9403582215309143, 0...
def test _ filesystem _ create _ permissions ( self ) : pool _ name = p _ n ( ) pool _ path = make _ test _ pool ( pool _ name, stratiscertify. disks [ 0 : 1 ] ) fs _ name = fs _ n ( ) self. _ test _ permissions ( stratisdbus. fs _ create, [ pool _ path, fs _ name ], true )
[ -0.32764512300491333, 0.7304012179374695, 0.47672492265701294, 0.46895095705986023, 1.142171859741211, 0.14995871484279633, 0.626730740070343, -0.6248500347137451, -0.21274396777153015, -0.7975443005561829, 0.06069155037403107, -0.33667001128196716, 0.07524997740983963, 0.25469669699668884...
def by _ name ( self, name ) : return self. users _ by _ name. get ( name )
[ -0.622671902179718, -0.43020564317703247, 0.17056913673877716, 0.09028901159763336, -0.04542257636785507, -0.7083919644355774, -0.1376463621854782, -1.005826711654663, -0.4975256025791168, 0.7392660975456238, -0.36642029881477356, 0.43163225054740906, -0.4437417685985565, -0.37209263443946...
def search _ api ( wf, source, dest, query ) : params = {'from': source,'dest': dest,'phrase': query,'format':'json ','pretty':'true'} log. debug ('calling % s with args : % r ', api _ url, params ) r = web. get ( api _ url, params = params ) if r. error : wf. add _ item ('error contacting glosbe. com ', r. reason, val...
[ -0.8773301839828491, 0.028741102665662766, 0.6287250518798828, -0.9649972915649414, -0.24005790054798126, -0.6135542392730713, -1.566840648651123, -0.7825636267662048, -0.5497301816940308, 1.3806495666503906, -0.5251628756523132, -0.010689291171729565, -0.5672821998596191, 0.17908388376235...
def test _ random ( self ) : address = 0x87f0 _ 0000 data = bytearray ( ) random. seed ( 0 ) for _ in range ( 0, 4095 ) : data. append ( random. randint ( 0, 255 ) ) dump = xxd ( address, data ) rev _ address, rev _ data = xxd _ reverse ( dump ) self. assertequal ( rev _ address, address ) self. assertequal ( rev _ dat...
[ -0.01391921192407608, 0.11023854464292526, 0.798788845539093, -0.8491740226745605, 0.31385791301727295, 0.4220157563686371, 0.23560047149658203, 0.4312399923801422, 0.12181470543146133, -0.905913770198822, -0.35267648100852966, 0.21162699162960052, -0.11080373823642731, -0.5192997455596924...
def wavwrite ( y, fs, filename ) : # taken from xavier serra's sms tools x = copy. deepcopy ( y ) # copy array x * = int16 _ fac # scaling floating point - 1 to 1 range signal to int16 range x = np. int16 ( x ) # converting to int16 type write ( filename, fs, x )
[ -0.16558384895324707, 0.07275476306676865, 0.4513149857521057, 0.40267857909202576, 0.36848214268684387, -0.6448819041252136, 0.3394978940486908, -0.31716349720954895, 0.6716530919075012, -0.09086763858795166, -0.25242215394973755, 0.2004898488521576, 0.5309889316558838, 0.2797246277332306...
def gettensorrepresentationsfromschema ( schema : schema _ pb2. schema, tensor _ representation _ group _ name : str = _ default _ tensor _ representation _ group ) - > optional [ dict [ str, schema _ pb2. tensorrepresentation ] ] : group = schema. tensor _ representation _ group. get ( tensor _ representation _ group ...
[ -0.7260499596595764, 0.7034780979156494, 0.08319999277591705, -0.5764864683151245, -0.5233263969421387, -0.9613697528839111, 0.0852348655462265, -0.4674018323421478, -0.07042583078145981, 0.9430242776870728, -0.4778391718864441, -0.11897324025630951, -0.5386925339698792, -0.176025554537773...
def savings ( deposit, percent, time ) : result = deposit * ( 1 + percent / 100 ) * * time return result
[ 0.023147743195295334, 0.8174123764038086, 0.4081377685070038, 0.5378197431564331, -0.8095975518226624, 0.3879666030406952, 0.3501167297363281, -1.1852189302444458, -0.5326749086380005, 0.716738760471344, -0.9338663816452026, -0.5271170735359192, -0.1921946108341217, 0.1670052856206894, 0...
def hash _ password ( password ) : salt = hashlib. sha256 ( os. urandom ( 60 ) ). hexdigest ( ). encode ('ascii') pwdhash = hashlib. pbkdf2 _ hmac ('sha512 ', password. encode ('utf - 8'), salt, 100000 ) pwdhash = binascii. hexlify ( pwdhash ) return ( salt + pwdhash ). decode ('ascii')
[ 0.8859366178512573, -0.37166616320610046, 0.47328537702560425, -0.4732871353626251, -0.9215800762176514, -0.04969165474176407, -1.1200037002563477, 0.44182288646698, 1.1386768817901611, -0.012853564694523811, -0.012766176834702492, 0.139352485537529, -0.3836699426174164, 0.325022429227829,...
def get _ linear _ lr ( base _ lr, total _ epoch, spe, lr _ init, lr _ end, warmup _ epoch = 0 ) : lr _ each _ step = [ ] total _ steps = spe * total _ epoch warmup _ steps = spe * warmup _ epoch for i in range ( total _ steps ) : if i < warmup _ steps : lr = lr _ init + ( base _ lr - lr _ init ) * i / warmup _ steps e...
[ 0.16019850969314575, -0.6398548483848572, 0.6347666382789612, -0.06180078908801079, -0.1862860918045044, -0.2676911950111389, -0.8589648008346558, 0.6557990312576294, -0.36410272121429443, 0.11123497784137726, -0.7597050070762634, -0.5246672630310059, -0.04767473414540291, 0.66612845659255...
def delete _ loan ( finance _ db, user, loan _ id ) : finance _ cursor = finance _ db. cursor ( ) sql = " delete from debts where uid = % s and did = % s " val = ( user. get _ id ( ), loan _ id ) finance _ cursor. execute ( sql, val ) finance _ db. commit ( ) if finance _ cursor. rowcount > 0 : return true return false
[ 0.8516728281974792, 0.24207159876823425, 0.6252011060714722, -0.04415830969810486, -0.004775519482791424, 1.050010085105896, -0.5623577833175659, -0.035063453018665314, -0.3524506390094757, -0.4829404056072235, 0.4593871533870697, -0.22597278654575348, -0.9366044998168945, 0.69340580701828...
def test _ else _ that _ can _ be _ removed _ in _ loop ( assert _ errors, parse _ ast _ tree, template, code, default _ options, mode, ) : tree = parse _ ast _ tree ( mode ( template. format ( code, code ) ) ) visitor = ifstatementvisitor ( default _ options, tree = tree ) visitor. run ( ) assert _ errors ( visitor, [...
[ -0.1550062596797943, 1.0089375972747803, 0.3003678321838379, -0.1314029097557068, 0.16558054089546204, -0.2643178105354309, 0.3363099694252014, 0.10716219246387482, -0.16911858320236206, 0.42158278822898865, -0.15445730090141296, -0.4573602080345154, -0.4507253170013428, 0.3723160326480865...
def encrypt _ pbkdf2 _ hmac ( uinput = " ", hash _ algorithm = " sha256 ", encoding _ algorithm = " utf - 8 ", salt = os. urandom ( 32 ), iterations = 100000, digest _ key _ size = 128 ) : if type ( salt ) = = type ( int ) : # length / size of random string # generate salt text salt = os. urandom ( salt ) key = hashlib...
[ -0.3583531677722931, 0.4072507619857788, 0.6838130354881287, 0.7909738421440125, -0.35440847277641296, 0.23210175335407257, 0.4425259828567505, 0.049454979598522186, 0.41824397444725037, -0.10557769984006882, -0.0874481052160263, -0.1707562953233719, -0.5251241326332092, 0.6228600740432739...
def _ check _ keyup _ events ( self, event ) : if event. key = = pygame. k _ up : self. ship. moving _ up = false elif event. key = = pygame. k _ down : self. ship. moving _ down = false
[ -0.9247422814369202, -0.04248453304171562, 0.790743887424469, 0.49387815594673157, -0.5646639466285706, 0.5125703811645508, 0.1561676561832428, 0.15934620797634125, 0.27713701128959656, 0.9654098153114319, 0.4326130747795105, -0.18716545403003693, -0.00997751671820879, 0.33429285883903503,...
def classify _ violation ( ) : [ v _ list, vdict ] = find _ violation ( ) yl _ in = [ ] yl _ will = [ ] yl _ list = [ ] yt _ in = [ ] yt _ will = [ ] yt _ list = [ ] rl _ in = [ ] rl _ will = [ ] rt _ in = [ ] rt _ will = [ ] for msid in v _ list : [ yl, yt, rl, rt ] = vdict [ msid ] if rl = = - 1 : rl _ in. append ( m...
[ -0.09707468003034592, -1.1484358310699463, 0.8127635717391968, -0.339194118976593, -0.04146912693977356, 0.09062758833169937, 0.16358177363872528, 1.0081491470336914, 0.5029991865158081, 0.7564262747764587, -0.19713781774044037, 0.5544729232788086, -0.26740938425064087, 1.0444368124008179,...
def subsequence ( seq ) : # head [ j ] = index in'seq'of the final member of the best subsequence # of length'j + 1'yet found head = [ 0 ] # predecessor [ j ] = linked list of indices of best subsequence ending # at seq [ j ], in reverse order predecessor = [ - 1 ] for i in range ( 1, len ( seq ) ) : # # find j such th...
[ -0.10232609510421753, -0.1681823581457138, 0.7915523052215576, 0.1952359825372696, -0.5849932432174683, -0.9582037329673767, 0.8418699502944946, -0.12733565270900726, 0.8115888237953186, 1.5877755880355835, -1.1421449184417725, 0.2135670781135559, -0.5016313791275024, 0.21966856718063354, ...
def all _ discrepancies ( discrepancies, q, start = 0 ) : elements _ to _ use = len ( discrepancies ) - start if q = = 0 : return [ [ 0 ] * elements _ to _ use ] elif elements _ to _ use < = 0 : return [ ] ret = [ ] curr = discrepancies [ start ] for i in xrange ( q / curr, - 1, - 1 ) : r = all _ discrepancies ( discre...
[ -0.5404529571533203, 0.11866122484207153, 0.4989698827266693, 0.3372783362865448, -0.11729112267494202, 0.16343359649181366, 0.26293936371803284, 0.7649737000465393, 1.2161983251571655, -0.35064080357551575, -0.3252547085285187, 0.4108425974845886, -0.5050572156906128, 0.8433212637901306, ...
def quota _ create ( context, project _ id, resource, limit ) : return impl. quota _ create ( context, project _ id, resource, limit )
[ -0.26259779930114746, 0.21333783864974976, 0.3117063045501709, 0.07180661708116531, 0.5421299934387207, 0.2093704491853714, -0.4259836971759796, -0.4395813047885895, -0.2721098065376282, 0.9360737800598145, -0.18215379118919373, 0.25351065397262573, 0.7869013547897339, -1.498671531677246, ...
def time _ of _ trip ( datum, city ) : days = ['monday ','tuesday ','wednesday ','thursday ','friday ','saturday'] # your code here if city = ='nyc': d1 = datetime. strptime ( datum ['starttime'],'% m / % d / % y % h : % i : % m') # day _ of _ week = calendar. day _ name ( d1. weekday ( ) ) month = d1. day hour = datet...
[ -0.6304720640182495, -0.13545025885105133, 1.1035029888153076, -1.345807433128357, -0.4914219379425049, -0.2960735559463501, -0.8025551438331604, 0.22747227549552917, -0.4315432608127594, 1.1257452964782715, -0.5922034382820129, -0.8833127021789551, 0.23126034438610077, -0.5340520143508911...
def _ _ init _ _ ( self, row = 4, col = 4, initial = 2 ) : self. grid = grid ( row, col, initial )
[ 0.7458754181861877, 0.18602371215820312, 0.48068690299987793, 0.9398927092552185, 0.026317838579416275, -0.035611849278211594, -0.04929123446345329, 0.3695234954357147, -1.2042425870895386, -0.17641039192676544, -0.2582252621650696, 0.1518273502588272, -0.16714927554130554, 0.3444393575191...
def extract _ wait _ times ( branch, data ) : data. update ( { data ['_ eventtarget'] : branch } ) response = requests. post ( url, data = data ) soup = beautifulsoup ( response. content,'html5lib') try : table = soup. select ('table [ id * = " waittimes " ]') [ 0 ] except indexerror : return pd. dataframe ( ) else : r...
[ -0.5865564346313477, 1.0249698162078857, 0.5596733689308167, 0.358461856842041, 0.19804741442203522, -0.38629209995269775, -0.3535272479057312, 0.08829941600561142, -0.4670112729072571, 0.7283174991607666, 0.366606742143631, 0.08880086243152618, -0.20424248278141022, -0.27010247111320496, ...
def print _ log ( self, task _ results = none ) : # create new print _ line print _ line ='\ n'# appending task header / results line if task _ results is not none : print _ line + = self. delimiter. join ( task _ results ) + self. delimiter # if closed, reopen if self. fp. closed : self. fp = open ( self. raw _ data _...
[ -0.39072445034980774, -0.043573834002017975, 0.7972625494003296, 0.483870267868042, 0.027381960302591324, 0.8481857180595398, 0.2761756181716919, -0.08245235681533813, -1.0638954639434814, -1.016662836074829, -0.014319349080324173, 0.08477675169706345, 0.28030720353126526, 0.02053702622652...
def cloudfront _ zone _ id ( self ) - > str : return pulumi. get ( self, " cloudfront _ zone _ id " )
[ 1.3205795288085938, 0.012426094152033329, -0.009864591993391514, 0.20016872882843018, 0.8648708462715149, 0.8465977311134338, 0.6000186204910278, 0.2981671690940857, 1.0580555200576782, -0.5605866312980652, -0.060125987976789474, 1.0186173915863037, 0.43716442584991455, 0.16289392113685608...
def setup ( self ) : self. rows = [ { " site " : " 1 ", " stock & site " : " 1 ", " stock code " : " a ", " description " : " thing " }, { " site " : " 2 ", " stock & site " : " 2 ", " stock code " : " b ", " description " : " some " } ]
[ -0.23700682818889618, 0.5688554048538208, 0.3825508952140808, -0.656730592250824, 0.9122424721717834, -0.5155615210533142, -0.2795785367488861, 0.148142471909523, 0.10632046312093735, 0.06503770500421524, 0.0560515858232975, 0.6478443145751953, 0.46831104159355164, 0.6895920038223267, -0...
def _ get _ pipeline ( self ) - > pipeline : try : return iso _ to _ pipeline [ self. language. iso _ 639 _ 3 _ code ] ( ) except keyerror : raise unimplementedalgorithmerror ( f " valid iso language code, however this algorithm is not available for ` ` { self. language. iso _ 639 _ 3 _ code } ` `. " )
[ 0.1657710075378418, 0.46783483028411865, 0.2327997088432312, -0.07751290500164032, -0.659570038318634, 0.07092899829149246, -0.48952150344848633, 0.1421431452035904, -0.10277106612920761, 0.2113364189863205, 0.6107056140899658, -0.15889133512973785, 1.0410237312316895, -0.8798089623451233,...
def add _ horizontal _ line ( row, column0, column1, char ='-') : assert len ( char ) = = 1, _ char _ assert _ template. format ( char ) try : for column in range ( column0, column1 ) : _ grid [ row ] [ column ] = char except indexerror : if not 0 < = row < = _ max _ rows : raise rowrangeerror ( ) raise columnrangeerro...
[ 0.34487393498420715, 0.43795347213745117, 0.44122985005378723, 0.922779381275177, 0.41007381677627563, 0.7539289593696594, -0.233165442943573, 0.18024419248104095, -0.8128535151481628, -0.4091620445251465, -0.595551073551178, 0.28549742698669434, 0.2533235549926758, -0.01378837414085865, ...
def create _ scatter ( x _ degrees, y _ degrees, network _ title ) : fig = plt. figure ( ) ax = fig. add _ subplot ( 111 ) alpha = 0. 5 ax. plot ( x _ degrees, y _ degrees,'r ', ls ='', marker ='o ', ms = 5, alpha = alpha ) ax. set _ xlabel ( r'degree $ k $') ax. set _ ylabel ( r'degree $ k $') ax. set _ title ( networ...
[ 0.6563635468482971, 0.5906832218170166, 0.6347324252128601, -0.8592836856842041, -0.7610505223274231, 0.889106035232544, -0.6533409953117371, -0.03705726936459541, -0.4266495108604431, -0.12969465553760529, 0.5938248038291931, 0.40495750308036804, 0.3805561363697052, -0.6051329374313354, ...
def load _ volumes ( self, db, meta, test = false ) : " " " arguments : db : databasebrats returns : list of volumes " " " volumes = [ self. load _ volume ( db, m ) for m in db. modalities ] if not test : volumes. append ( self. load _ volume ( db,'ot') ) volumes. append ( meta. load _ brain _ mask ( db, self ) ) retur...
[ -0.08393049985170364, -0.18406426906585693, 0.30798518657684326, 0.8927388191223145, 0.4926787316799164, 0.011031556874513626, -0.4280141294002533, -0.5270795226097107, 0.590951144695282, 0.41565462946891785, 0.22820955514907837, -0.6489777565002441, -0.8895897269248962, 1.2899805307388306...
def test _ bad _ match _ should _ score _ zero ( self ) : output = match _ sites ( self. rows ) for row in output : assert row [ " match score " ] = = " 0. 0 "
[ 0.35761958360671997, -0.4463399052619934, 0.35222890973091125, 0.5601204633712769, 1.360073208808899, 0.4233969449996948, -0.05266242474317551, 0.5596666932106018, -0.08821884542703629, -0.5218387842178345, 0.43308672308921814, -0.3375241160392761, 0.07340545952320099, 0.6794706583023071, ...
def part _ type ( self, part _ type ) : self. _ part _ type = part _ type
[ 0.8859296441078186, -0.4091569781303406, -0.06819149106740952, 0.5468323230743408, 0.540565550327301, 1.486129641532898, 0.18680733442306519, 0.5950849056243896, -0.18838748335838318, 0.04092281684279442, -0.5677476525306702, -0.1649405062198639, -1.2073158025741577, 0.2637200355529785, ...
def highlight _ row ( row ) : colors _ list = [ " " ] * 7 + [ " background - color : silver " ] * 2 # color of the fixed part of the table # ( the mutation table part, first 8 columns ) mut = row [ " mut " ] ref = row [ " ref " ] for samp in row [ 9 : ] : # now color all other cells ( each column belongs to a different...
[ 0.5126144886016846, 0.012114500626921654, 0.4979899227619171, 0.42240282893180847, -0.08992597460746765, -1.1233595609664917, -0.27874740958213806, -0.5187287926673889, 1.4074562788009644, 0.5753558278083801, 0.3390214741230011, 0.5905364751815796, 0.8591048717498779, 0.7245321869850159, ...
def delete _ variables ( variable _ ids ) : " " " example variable _ ids = [ 3409643000002275025, 3409643000002275035 ] " " " # get instance of variablesoperations class variables _ operations = variablesoperations ( ) # get instance of parametermap class param _ instance = parametermap ( ) # possible parameters of del...
[ -0.4061625897884369, -0.8248826861381531, 0.9795459508895874, 0.12296374142169952, 1.0238730907440186, -0.16998161375522614, 0.4655703604221344, -0.07437849044799805, 0.285918265581131, 0.3758305609226227, 0.11777276545763016, 0.848845899105072, -0.6082197427749634, 0.48516008257865906, ...
def median ( self ) : return wrap _ df ( self. _ df. pivot ( self. by, self. pivot _ column, self. values _ column, " median " ) )
[ -0.4050053060054779, 0.5632210969924927, 0.28018221259117126, 0.7457088828086853, 0.45849427580833435, -0.046434435993433, -0.5848405957221985, -0.1700914055109024, 0.05193570628762245, -0.5470753312110901, 1.9293413162231445, -0.013982565142214298, -0.21492895483970642, -1.016375184059143...
def boltzmanninvert ( vals, temp = 300 ) : if not np. any ( vals ) : return ( 0, 0 ) mdat = np. ma. masked _ array ( vals, np. logical _ or ( np. isnan ( vals ), np. equal ( vals, np. zeros _ like ( vals ) ) ) ) mean = 180 * np. mean ( mdat ) / np. pi sdev = np. std ( mdat ) fc = 1. 987e - 3 * temp / ( sdev * sdev ) re...
[ -0.665857195854187, 0.2480984628200531, 0.5228304266929626, 0.2870185077190399, -0.43229469656944275, -0.09605860710144043, 0.14296162128448486, 0.1583106815814972, -0.40142667293548584, 0.5048038363456726, -0.6362695693969727, 0.05748019367456436, -0.1475980579853058, 0.4528962969779968, ...
def check _ dealer _ won ( player _ posn, hand _ num ) : return sum _ cards ( player _ posn, hand _ num ) < sum _ cards ( 0 ) and not check _ busted ( 0 )
[ 0.22251567244529724, -0.07971329241991043, 0.4212406277656555, 1.179589033126831, 0.1027822494506836, -0.3856140375137329, 0.08117736876010895, 0.8265257477760315, -0.26361730694770813, -0.6819415092468262, -0.16843977570533752, -0.2451283037662506, 0.658548891544342, -0.05626201629638672,...
def time _ str ( self ) : return datetime _ to _ str ( self. time )
[ -0.8547470569610596, -1.0726412534713745, 0.3858650326728821, -0.30512693524360657, 0.02641148492693901, 1.020637035369873, -1.3614472150802612, -0.944108784198761, -0.4023759663105011, 1.035485863685608, 0.5324617624282837, -0.5236896276473999, -0.157396599650383, -0.18452630937099457, ...
def _ attributes _ dump ( self, msg = none, flow = _ down ) : # make sure interface is ready to use d = self. _ attributes _ t _ init ( ) keys _ all = sorted ( d ['attributes']. iterkeys ( ) ) print " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " print str ( type ( self ) ) if msg : pr...
[ -0.5370291471481323, -0.25454986095428467, 1.2000564336776733, -1.1628845930099487, 0.23490555584430695, -0.2441381961107254, 0.6937353610992432, 0.3639180362224579, -0.5645012259483337, 0.2967076897621155, -0.3808850347995758, 0.9406812191009521, 0.38791516423225403, 0.9868373274803162, ...
def emit _ and _ record ( sock, emission _ offset ) : time _ now = int ( time. time ( ) * 1000 ) offset _ recording = 2000 start _ recording = time _ now + offset _ recording data = { " start " : start _ recording, " duration " : emission _ offset + int ( signal _ duration * 1000 ) + 500, } sock. send ( json. dumps ( d...
[ -0.438180148601532, 0.06983067095279694, 0.8158904314041138, -0.6264200210571289, -0.43115463852882385, 0.2487025111913681, -0.9828510284423828, -0.4077340364456177, -0.7093193531036377, 1.1505372524261475, -1.170351505279541, 1.2813425064086914, -0.024676010012626648, 0.6572020053863525, ...
def load _ annotations _ group ( self, group ) : annotations _ group = [ self. load _ annotations ( image _ index ) for image _ index in group ] for annotations in annotations _ group : assert ( isinstance ( annotations, dict ) ),'\'load _ annotations \'should return a list of dictionaries, received : { } '. format ( t...
[ -0.6094253063201904, 0.1783459335565567, 0.42808327078819275, -0.6192559003829956, -0.09814605861902237, -0.5565117597579956, 0.14443108439445496, -1.0417275428771973, -0.08584365248680115, 0.08690197020769119, 0.5989282131195068, -0.13424912095069885, -0.05315526947379112, 1.2427219152450...
def test _ learning _ curve _ ylimits ( ) : if _ have _ pandas : import pandas as pd # create a test data frame df _ test = pd. dataframe. from _ dict ( {'test _ score _ std': { 0 : 0. 16809136190418694, 1 : 0. 18556201422712379, 2 : 0. 15002727816517414, 3 : 0. 15301923832338646, 4 : 0. 15589815327205431, 5 : 0. 68205...
[ 0.8288897275924683, 0.2891668975353241, 1.4692786931991577, 0.23005183041095734, 0.574833869934082, 0.1620592623949051, 0.7560166120529175, -0.023170452564954758, -0.7518943548202515, -0.3618316650390625, -0.5919389128684998, 0.33284929394721985, 0.6798409223556519, -0.6138557195663452, ...
def key _ protection ( self ) : return self. _ key _ protection
[ -0.09158322215080261, 0.7762323617935181, 0.31955480575561523, 0.9062955379486084, -0.670288622379303, 0.3877621293067932, -0.17221418023109436, -0.4585826098918915, 0.15179280936717987, 0.5316670536994934, -0.6004713177680969, -0.5612221360206604, -1.1585469245910645, -1.2899270057678223,...
def invitee ( self ) : return self. _ invitee
[ 1.344511866569519, -0.6633228659629822, 0.2899680435657501, 0.7454891204833984, 0.3578944206237793, 1.22109055519104, 0.823777437210083, 0.6479482650756836, -0.7092472314834595, -0.3822409510612488, -0.25326600670814514, 0.8893916606903076, -1.1189168691635132, -0.6074678897857666, 0.632...
def _ infer _ version _ data ( self, project _ id = none ) : version = self. api _ version if version : version = version _ to _ string ( self. api _ version ) url = self. url. rstrip ( " / " ) if project _ id and url. endswith ( project _ id ) : url, _ = self. url. rsplit ('/ ', 1 ) url + = " / " return [ versiondata ...
[ -0.7585114240646362, -0.6694307327270508, 0.38791096210479736, 0.15816618502140045, 0.08952323347330093, 0.9135989546775818, -0.9784173369407654, 0.7261471152305603, -0.07356350123882294, 0.13733254373073578, -0.4087114930152893, 0.06009548902511597, 0.054600104689598083, 0.535651564598083...
def _ fake _ mirrored ( value, devices ) : devices = _ get _ devices ( devices ) values = [ ] for d in devices : with ops. device ( d ) : values. append ( array _ ops. identity ( value ) ) return distribute _ utils. regroup ( values, wrap _ class = value _ lib. mirrored )
[ -1.2736668586730957, 0.8254244923591614, 0.35058480501174927, 0.6109536290168762, 0.24598811566829681, -0.23059424757957458, 0.542084276676178, 0.1110975444316864, 0.6116948127746582, 0.5986272692680359, 0.04429197311401367, 0.11821229755878448, 0.4641406834125519, 0.6217266321182251, 0....
def save ( self ) : updates = self. obj _ get _ changes ( ) db _ obj = self. dbapi. update _ action ( self. uuid, updates ) obj = self. _ from _ db _ object ( self, db _ obj, eager = false ) self. obj _ refresh ( obj ) notifications. action. send _ update ( self. obj _ context, self ) self. obj _ reset _ changes ( )
[ -0.6588733196258545, -0.6873694062232971, 0.512920618057251, 0.2514464855194092, 0.4503239691257477, 0.18499475717544556, 0.11628271639347076, -0.4829886257648468, 0.38338232040405273, 0.3627355992794037, -1.4823590517044067, -0.08058992028236389, -0.11973363161087036, -0.16542935371398926...
def bundle _ name ( self ) : return self. bundle _ name _ re. match ( os. path. basename ( self. name ) ). group ( " name " )
[ 0.017346005886793137, -0.6766120791435242, 0.5640007257461548, -0.14746686816215515, -0.9065577983856201, 0.833913266658783, 0.579245388507843, 0.12418807297945023, -0.4125531315803528, 0.32559630274772644, 0.3288419246673584, -0.3421945571899414, -0.2249298095703125, -0.1646977663040161, ...
def to _ utm ( latitudes, longitudes ) : easting = [ ] northing = [ ] tmp = none for lat, lon in zip ( latitudes, longitudes ) : tmp = utm. from _ latlon ( lat, lon ) easting. append ( tmp [ 0 ] ) northing. append ( tmp [ 1 ] ) znumber, zletter = tmp [ 2 ], tmp [ 3 ] return np. array ( easting ), np. array ( northing )...
[ -1.4972386360168457, -0.2587472200393677, 0.4485904574394226, -0.5360620021820068, 0.5629698634147644, 0.031219301745295525, -0.7226578593254089, 0.5297796726226807, 0.5065436363220215, 0.6984544992446899, -0.6614561080932617, -0.6181713342666626, 0.4662296175956726, -0.3256477117538452, ...
def check _ title ( cls, value ) : assert type ( value ) = = str, f'title = = { value }, must be a string'return value
[ -0.2570948600769043, -0.6662823557853699, 0.40347763895988464, 0.08550067991018295, -0.7077428698539734, 0.8567522764205933, -0.7170859575271606, -1.075752854347229, 0.8066756129264832, 0.7313100695610046, 0.6171547174453735, 0.032150402665138245, -1.350724697113037, -0.3681749701499939, ...