text
stringlengths
25
2.19k
embedding
listlengths
768
768
def extract _ file _ name ( self ) : # the directory is generated from the path - filename. filename = os. path. basename ( self. path ) file _ name = filename path = self. path. replace ( filename,'' ) return file _ name, path
[ -0.10682862997055054, -1.0849329233169556, 0.5289808511734009, -0.15502728521823883, -0.11357216536998749, -0.5831726789474487, 0.66695636510849, 1.0246360301971436, -0.4497928023338318, 0.17959819734096527, -0.20672756433486938, -0.6574336886405945, 0.5470740795135498, -0.3204591870307922...
def time _ stats ( df ) : print ('\ ncalculating the most frequent times of travel... \ n') start _ time = time. time ( ) # display the most common month months = ['january ','february ','march ','april ','may ','june'] common _ month = df ['month']. mode ( ) [ 0 ] common _ month = months [ common _ month - 1 ] print (...
[ 0.37168771028518677, 0.19945558905601501, 1.036325454711914, 0.0219756830483675, 0.3265060484409332, -0.2236001044511795, 0.7289526462554932, -0.5788745880126953, -0.34469616413116455, 0.2897183895111084, 0.021480724215507507, -0.08757378160953522, 0.40535813570022583, 1.116925835609436, ...
def renumber _ tracks ( self, low = 1, step = 1 ) : track = low # start numbering from here levels = self. get _ levels ( ) # conversion = { } # holds new set of levels for level in levels : # starting at low... conversion [ track ] = self. tracks [ level ] # add old tracks to new set conversion [ track ]. track _ leve...
[ -0.4855630695819855, -0.031064733862876892, 0.7208386063575745, 0.39061492681503296, -0.3660094439983368, -0.17808474600315094, 0.22269602119922638, 0.15950722992420197, -1.5820465087890625, -0.687859296798706, -0.4151385426521301, 0.3366883397102356, -0.2654300928115845, 0.656946003437042...
def apply _ patch ( doc, patch, in _ place = false ) : if isinstance ( patch, basestring ) : patch = jsonpatch. from _ string ( patch ) else : patch = jsonpatch ( patch ) return patch. apply ( doc, in _ place )
[ -0.04410867020487785, -0.45611026883125305, 0.4377390444278717, -0.2652299404144287, -2.0288941860198975, 0.260825514793396, -0.9178632497787476, 1.2592129707336426, 0.9093593955039978, -0.564284086227417, 0.044446635991334915, 1.0956820249557495, -0.6691597700119019, -0.42026281356811523,...
def printresultofeachontologyinlatex ( ontologyname, reasonerlist, resultfileofallreasonersdict, finalresultfile ) : queries = [ ] resultofallreasonersdict = { } with open ( finalresultfile, mode ='a ', encoding ='utf - 8') as afile : # print ontology name afile. write ( ontologyname. replace ( " _ ", " - " ) ) # get r...
[ 0.383976012468338, -0.34021857380867004, 0.9158225059509277, -0.30885109305381775, 0.05417778342962265, 0.7490957975387573, -0.008742505684494972, -0.2143205851316452, -0.7637368440628052, -0.010340702719986439, -0.20095965266227722, -0.3175337016582489, -0.5219891667366028, 0.880360662937...
def split _ edge ( self, old _ edge, active _ point ) : # set up length and edge depending on the type of active _ point if active _ point. _ _ class _ _. _ _ name _ _ = ='activepoint': length = active _ point. active _ length edge = active _ point. active _ edge else : length = active _ point. length edge = active _ p...
[ -0.0030787561554461718, -1.4025747776031494, 0.7527973055839539, -0.2629348039627075, -0.02972249500453472, -0.036022964864969254, 0.4000936448574066, 1.0541929006576538, 0.21887539327144623, 1.026081919670105, 0.014907442033290863, 0.3560826778411865, -0.6365708708763123, -0.8615162372589...
def packer ( * args, * * kwargs ) : return msgpack. packer ( * args, default = _ encode _ ext _ type, use _ bin _ type = true, * * kwargs )
[ 0.22135202586650848, 0.3602170944213867, 0.654460608959198, 0.7136280536651611, -0.7063611745834351, -0.04419862851500511, -0.5692453384399414, -0.7257199883460999, -0.1809556633234024, -0.4421854019165039, -0.5463498830795288, 0.2898426055908203, -1.4325932264328003, 1.2875195741653442, ...
def get _ protein _ info _ from _ db ( self, protein _ id ) - > pd. dataframe : return self. _ database. loc [ self. _ database. protein = = protein _ id, ]
[ -0.1849890649318695, 0.203359916806221, 0.044875383377075195, 0.3219129145145416, 0.20103386044502258, -0.31223297119140625, -1.145706057548523, -0.2599589228630066, -0.7612302303314209, -0.41878002882003784, 0.060470517724752426, 0.45325690507888794, -0.5518612265586853, -0.52611559629440...
def _ _ contains _ _ ( self, * args, * * kwargs ) : # real signature unknown pass
[ 0.4994141757488251, -0.6756860613822937, 0.49685487151145935, 0.8152580857276917, 0.2708805501461029, 0.28591033816337585, 0.12435946613550186, -0.49281585216522217, -0.021418696269392967, -0.7624571323394775, -0.5245551466941833, -0.14031840860843658, -0.35117676854133606, 0.3733758628368...
def run ( ) : from gunicorn. app. wsgiapp import wsgiapplication wsgiapplication ( " % prog [ options ] app _ module " ). run ( )
[ 0.7123480439186096, -0.6289276480674744, 0.4258311688899994, 1.0793254375457764, 1.0608787536621094, 1.1116418838500977, 0.34140533208847046, -0.5105505585670471, -0.26110902428627014, 0.4437180459499359, -0.084930419921875, 1.4310052394866943, -0.028129903599619865, -0.05750061571598053, ...
def test _ get _ containers _ include _ no _ exclude ( self ) : expected _ ids = [ " e511aaf76add81d41c1536b2a93a17448d9f9d3c6a3f8a5abab1d9a582c397fc ", " cfcb7f7d1481c805f91fd6c8c120300a586978fa2541a58026bd930eeeda3e36 ", " 58ded582ebf14063bff3b15cd3962035be9904b73318796f1119d71472801d23 ", " c4eacccbf687f408c708b12fa...
[ 0.6085681915283203, 0.033747609704732895, 0.9578068256378174, -0.019753076136112213, -0.051512982696294785, 0.23426476120948792, 0.2548758387565613, 0.9115648865699768, -0.20670482516288757, -0.013631721958518028, -0.7554411292076111, 0.010373834520578384, -0.8535621166229248, 0.2373648583...
def solve ( people : list ) - > tuple : initial _ state = state ( ( ), people ) fringe = [ initial _ state ] best = initial _ state while len ( fringe ) > 0 : state = fringe. pop ( ) if state. fixed _ skill > best. fixed _ skill : best = state succs = branch ( state ) for s in succs : if bound ( s ) > best. fixed _ ski...
[ 0.0744541808962822, -0.2060382217168808, 0.6426016092300415, 0.9128414988517761, -0.26085615158081055, 0.2869924008846283, -0.12301485985517502, -0.284875750541687, 0.1046285480260849, -0.15406301617622375, -0.8625224232673645, -0.17764578759670258, -0.9804612398147583, 0.6901082992553711,...
def predict ( self, movie _ data ) : neighbors = self. knn. kneighbors ( movie _ data, return _ distance = true ) return neighbors
[ -0.779330313205719, -0.2017545998096466, 0.36935538053512573, 1.6653627157211304, -0.2885708808898926, 0.29852765798568726, -0.7172864675521851, -0.06760076433420181, -0.1843920350074768, 0.7538684010505676, -0.11688832193613052, 0.6145375370979309, -0.39393123984336853, 0.2630240619182586...
def get _ action _ list ( ) : master = rosgraph. master ( " / rosaction " ) # get list of subscriptions from ros master. _, subscriptions, _ = master. getsystemstate ( ) # separate topic names from node names. registered _ topics, _ = zip ( * subscriptions ) # all actions must have both'/ goal'and'/ cancel'topics. acti...
[ 0.3778994679450989, -0.6631741523742676, 0.47806790471076965, 1.3402591943740845, 0.6721749901771545, -0.22954972088336945, 0.15714362263679504, -0.41654032468795776, 0.10505767166614532, 0.5214650630950928, 0.23481230437755585, 0.9400269389152527, 0.6150937080383301, 0.13399839401245117, ...
def _ _ init _ _ ( self, pub, a, b, k = none, m = none ) : self. pub = pub self. a = a self. b = b self. k = k self. m = m if _ _ debug _ _ : self. self _ check ( )
[ 0.6951823830604553, -0.2184392511844635, 0.3767337203025818, 0.8194581270217896, 0.2312568873167038, 0.09542137384414673, -0.10349078476428986, 0.7224205732345581, -0.31102052330970764, -0.17097409069538116, 0.4856526851654053, -0.11686734110116959, -1.1733890771865845, 0.07295186072587967...
def _ _ init _ _ ( self, request = none, * args, * * kwargs ) : self. request = request self. user _ cache = none super ( ). _ _ init _ _ ( * args, * * kwargs ) # set the max length and label for the " username " field. self. username _ field = usermodel. _ meta. get _ field ( usermodel. username _ field ) username _ m...
[ -0.30052393674850464, 0.5844853520393372, 0.5702562928199768, 0.1339920312166214, -0.015542285516858101, -0.18714869022369385, -0.0465255044400692, 0.18624775111675262, 0.5686821937561035, -0.3642905652523041, -0.7766939401626587, 0.14687737822532654, 0.4881126880645752, 0.6407120227813721...
def task _ opendata ( ) : yield pull _ crimes ( ) yield pull _ violations ( )
[ 0.288155734539032, 0.49970418214797974, 0.2702067792415619, -0.554641842842102, 0.3966081738471985, 0.4797861874103546, 0.4374888837337494, 0.7748429179191589, -0.2838539779186249, -1.0144898891448975, 0.3562394976615906, 0.18546470999717712, 0.7849519848823547, -0.20164909958839417, -0....
async def send _ message _ in ( self, msg : message, timeout = 1. 0 ) : if not self. _ check _ pool _ healthy ( ) : self. logger. warning ( " raising poolunhealthyerror! " ) raise poolunhealthyerror await self. _ _ q _ in. put _ async ( msg, timeout )
[ -0.5703863501548767, 0.6198784708976746, 0.41509270668029785, 0.012634770944714546, 0.2529093027114868, 0.7371730804443359, 0.22029979526996613, -0.22610481083393097, -0.41320499777793884, 0.08555053174495697, 0.2122359573841095, 1.0116136074066162, -1.0551254749298096, 0.360698938369751, ...
def value ( self ) : return self. get ( )
[ -0.6253792643547058, -0.7878968119621277, 0.15003760159015656, -0.6611440777778625, 0.20622102916240692, 0.341909795999527, -0.07919038087129593, -0.7006962895393372, -0.1584431380033493, -1.0665820837020874, 0.25216516852378845, 0.4685228765010834, 0.343542218208313, -0.2879529297351837, ...
def corner _ wall _ to _ vert _ groups ( obj, vert _ locs, native _ subdivisions ) : select ( obj. name ) mode ('edit') deselect _ all ( ) ctx = {'object': obj,'active _ object': obj,'selected _ objects': [ obj ] } # make vertex groups obj. vertex _ groups. new ( name ='leg 1 end') obj. vertex _ groups. new ( name ='le...
[ 0.4923151135444641, -0.5888832211494446, 0.7455120086669922, -0.18682095408439636, -0.33029690384864807, 0.2839577794075012, 0.9227799773216248, -0.7564970850944519, -0.6667329668998718, 0.4040122628211975, -0.48706507682800293, 0.3003019690513611, -0.1355389803647995, -0.12690715491771698...
def test _ list _ reverse ( ) : print " computed : ", list _ reverse ( [ ] ), " expected : [ ] " print " computed : ", list _ reverse ( [ 1 ] ), " expected : [ 1 ] " print " computed : ", list _ reverse ( [ 1, 2, 3 ] ), " expected : [ 3, 2, 1 ] " print " computed : ", list _ reverse ( [ 2, 3, 1 ] ), " expected : [ 1, 3...
[ -0.3630259037017822, 0.37143972516059875, 0.5672237873077393, 0.19460980594158173, 0.7415574789047241, -0.036097992211580276, -0.22211049497127533, 1.776751160621643, 0.09291935712099075, -0.3895179033279419, -1.4763141870498657, 0.09333649277687073, 0.23084494471549988, -0.095709174871444...
def icon ( self ) : return icon
[ 0.45078277587890625, -0.2932169437408447, 0.01382642425596714, 0.06412666290998459, -0.3569713830947876, 0.3558006286621094, 0.9586836695671082, 1.0023002624511719, -0.11825568974018097, -0.8490117788314819, -0.6607657670974731, 0.06517094373703003, 0.42895233631134033, -1.0203235149383545...
def autodetect ( ) : # always true, since this is the fallback solution # this helps new user for a quick start return true # return false to avoid any accidental errors # return true return false
[ 1.1048461198806763, -0.4473336637020111, 0.7842013239860535, 1.5471100807189941, 0.416138231754303, -0.15910816192626953, 0.6468096971511841, 0.3529677391052246, 0.33089742064476013, -1.3593193292617798, -0.5887976884841919, -0.6116943955421448, -1.1417391300201416, 0.515238881111145, -1...
def _ mgui _ get _ min _ width ( self ) - > int : return self. _ qwidget. minimumwidth ( )
[ 0.10789984464645386, -0.2367858588695526, 0.450959175825119, -0.0780002772808075, -0.5804271101951599, -0.20331241190433502, -0.14648495614528656, -0.6015477180480957, 0.5604451894760132, -1.5083450078964233, 0.48411259055137634, -0.2573503851890564, -1.120673418045044, 1.0658156871795654,...
def fugue ( epi _ file, phase _ file, magnitude _ file, delta _ te, dwell _ time, unwarp _ direction, manufacturer, outdir, fsl _ sh, verbose = 0 ) : # extract brain avgmagnitude _ file = os. path. join ( outdir, " avgmag. nii. gz " ) average _ timeserie ( magnitude _ file, avgmagnitude _ file, fslconfig = fsl _ sh ) o...
[ 0.08567308634519577, -0.8805565237998962, 0.7885898947715759, 0.35122281312942505, 0.11450792104005814, -0.530306339263916, 0.4178452491760254, 0.4679969847202301, -0.01986411027610302, 0.3404478430747986, -0.06761474907398224, 0.16113604605197906, 0.0682254284620285, 0.6223350763320923, ...
def _ extract ( self, v ) : return ( isinstance ( v, ( ast. classdef, ast. functiondef ) ) and ( v. name [ 0 ]! ='_') )
[ -0.994533360004425, -0.1692742556333542, 0.47397300601005554, -0.22756175696849823, -0.9510719180107117, -1.1372188329696655, -0.19403183460235596, -0.4941130578517914, 0.6228109002113342, 0.513871967792511, -0.8141711354255676, 0.6023929119110107, -0.19155888259410858, 0.968839168548584, ...
def discardtiles ( self, tilebag, movedtiles ) : for i in range ( len ( self. placements ) ) : assert none = = self. placements [ i ] [ len ( self. placements [ i ] ) - 1 ], " the last item of each row must be a none! " if movedtiles [ i ]! = none : tilebag. addtodiscard ( self. placements [ i ] [ : len ( self. placeme...
[ 0.11289934068918228, -0.09777102619409561, 0.7117809057235718, -0.7283070087432861, -0.05826929584145546, 0.18006554245948792, 0.6501007080078125, 0.34267643094062805, 0.6292138695716858, 0.5854537487030029, 0.21853838860988617, -0.2147856205701828, -0.6562605500221252, 0.8400798439979553,...
def test _ connection ( ) : print ( " testing connection to server. " ) # import parameter from con file : # try connection with mysqlalchemy conn = use _ mysqlalchemy ( " mysql + pymysql : / / microaccounts _ dev : r783qjklddsiu @ localhost : 3306 / elixir _ beacon _ testing " ) if conn : print ( " connection to db es...
[ -0.24656687676906586, -0.12621541321277618, 0.5660913586616516, 0.4288717210292816, 0.48961034417152405, 0.6025995016098022, 0.823555052280426, -0.3437804877758026, 0.005617989227175713, -0.43092411756515503, -0.341307669878006, -0.14850442111492157, -0.3829790949821472, 0.4017013609409332...
def create ( self, base _ state, alchemical _ states, positions, displacement _ sigma = none, mc _ atoms = none, options = none, metadata = none, fully _ interacting _ expanded _ state = none, noninteracting _ expanded _ state = none ) : # if an empty set is specified for mc _ atoms, set this to none. if mc _ atoms is ...
[ 0.5282646417617798, 0.7036967873573303, 0.7765449285507202, 0.04611370339989662, 0.2923952043056488, 0.3455989956855774, 0.2547116279602051, 0.07407676428556442, 0.16686390340328217, 0.774193525314331, -0.4572744071483612, -0.1148749515414238, -0.07636819034814835, -0.28467392921447754, ...
def get _ context _ klass _ from _ registry ( self, alert _ name ) : if alert _ name not in self. data : raise keyerror ( f " context for the alert is not defined : { alert _ name } " ) return self. data [ alert _ name ]
[ 0.48759815096855164, -0.3362455368041992, 0.44788938760757446, 0.1121189296245575, -0.054873742163181305, 0.1932504028081894, -0.15327058732509613, -0.6731669306755066, 0.654094398021698, 0.7125416994094849, 0.5885587334632874, 1.5818753242492676, 0.22533932328224182, 0.023838583379983902,...
def predict ( self, x ) : data = minibatches ( x, self. batch _ size, 0 ) if theano. config. device = ='gpu': raise notimplementederror ('prediction not possible on gpu with conv net yet, please implement : )') total = np. concatenate ( [ super ( cnn, self ). predict ( element ) for element in data ], axis = 0 ) return...
[ -0.16573089361190796, -0.016567861661314964, 0.6358716487884521, 1.1420801877975464, -0.22631961107254028, 0.18038468062877655, -0.755572497844696, -0.026622915640473366, 0.3724166452884674, 0.09664926677942276, -0.8207422494888306, -0.08155304193496704, -0.008548407815396786, 0.6353659033...
def delete _ all ( self ) : self. inspections = { }
[ 0.5245155692100525, 0.13756608963012695, 0.34909161925315857, -0.40997976064682007, 0.3313450813293457, 0.5584679245948792, 0.4599502682685852, 0.7232356667518616, -0.4655663073062897, -0.36268192529678345, -0.677593469619751, 0.000782144081313163, -0.2850722372531891, 1.2052006721496582, ...
def run _ main ( argv ) : del argv kwargs = {'num _ epochs': 5000,'buffer _ size': 512,'batch _ size': 32,'datasets _ path': ". / data ", #'directory to store the dataset'' output _ resolution': 512,'max _ load _ resolution': 640,'num _ classes': 1,'num _ gpu': none, } main ( * * kwargs )
[ -0.05515206977725029, 0.48148298263549805, 0.7779779434204102, 0.7563474178314209, -0.013957499526441097, 0.18719415366649628, 0.32731154561042786, 0.6714195609092712, -0.19825322926044464, -0.6369271278381348, -0.3150242567062378, 0.9104124307632446, -0.29776039719581604, 0.33118841052055...
def result ( board, action ) : i, j = action if board [ i ] [ j ] is not empty : raise nameerror ('notvalidaction') new _ board = copy. deepcopy ( board ) new _ board [ i ] [ j ] = player ( board ) return new _ board
[ -0.4800166189670563, -0.11409517377614975, 0.4291290044784546, 0.8360423445701599, -0.0014472247567027807, 0.056674450635910034, 0.4360005259513855, -0.5639680027961731, 0.5338471531867981, 0.9129751920700073, -0.26072248816490173, 0.7687545418739319, -0.8505822420120239, -1.21010351181030...
def get _ license _ qid ( name : str ) - > optional [ str ] : return load _ licenses ( ). get ( _ norm ( name ) )
[ 1.337670087814331, -0.758847177028656, 0.499054491519928, -0.6875512599945068, -1.3743423223495483, 0.1977297067642212, -0.8651112914085388, 0.27697229385375977, 0.6418337821960449, 0.8068200349807739, 0.605564534664154, -0.02539743296802044, -1.01121187210083, 0.029588093981146812, -0.8...
def net _ total ( self ) : return self. total _ sold - self. total _ bought
[ -0.34187549352645874, -0.5172137022018433, 0.6176926493644714, -0.7735260725021362, 0.7209742069244385, 0.5140902400016785, 1.0825560092926025, -0.7365689277648926, 0.46448707580566406, -0.2043706625699997, -0.6171630620956421, -0.20677366852760315, 0.5973740816116333, -0.3519943654537201,...
def compress _ jpg ( im : np. ndarray, fac : float ) - > np. ndarray : return compress ( im, fac, " jpeg " )
[ 0.6540865302085876, 0.573291003704071, 0.21728388965129852, 0.8988945484161377, -0.9059813618659973, -1.5383515357971191, 0.7299939393997192, -0.6287159323692322, -0.12948143482208252, 0.7226595878601074, 0.5434148907661438, 0.16798540949821472, 0.4593903720378876, 0.808099091053009, -0....
def test _ update _ with _ block _ from _ shopping _ basket ( self ) : block = baker. make _ recipe ('booking. block _ 10 ', user = self. user, block _ type _ _ event _ type = self. pole _ class _ event _ type, paid = true, start _ date = timezone. now ( ) ) event = baker. make _ recipe ('booking. future _ cl ', cost =...
[ 0.04459712281823158, 0.5888568758964539, 0.8214092254638672, 1.654599905014038, -0.09002136439085007, 0.8127039074897766, 0.1268143355846405, 0.47326043248176575, 0.33438530564308167, 0.2617260813713074, -0.5136350393295288, 0.012883802875876427, -0.12032850086688995, 0.6636644005775452, ...
def sdc ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " sdc " )
[ 0.7507990002632141, 0.22629830241203308, 0.670295238494873, 0.4205898344516754, 0.6725237369537354, 0.913685142993927, 0.5910768508911133, -0.7187273502349854, 0.800593912601471, -0.6676741242408752, 0.3456374704837799, 0.4024117588996887, 0.8856139183044434, -0.746068000793457, -1.10669...
def disambiguate ( self, word ) : matches = re. match ( r'^ ( [ bcdfghjklmnpqrstvwxyz ] ) ( em [ aiueo ] ) (. * ) $ ', word ) if matches : return matches. group ( 1 ) + matches. group ( 2 ) + matches. group ( 3 )
[ -0.35661575198173523, 0.17896777391433716, 0.4610617160797119, -0.3729209303855896, 0.5100941061973572, 0.523177444934845, -0.19044238328933716, -0.1720094233751297, 0.6841650009155273, 0.35995933413505554, -0.17504620552062988, 0.3522712290287018, -0.7639521956443787, -0.32127100229263306...
def begintransaction ( self, callback ) : if self. _ connection _ pool : conn = self. _ connection _ pool. pop ( ) callback ( conn ) else : self. _ waiting _ on _ connection. append ( callback )
[ 0.358908474445343, -0.26403871178627014, 0.7436457276344299, 0.39671555161476135, -0.18585354089736938, -0.8244074583053589, -0.13616500794887543, 0.2983573079109192, -0.02314854972064495, 0.7630793452262878, -0.5436441898345947, -0.18468274176120758, -0.6824221611022949, 0.122307486832141...
def test _ lmdb _ delete ( ) : with temporarydirectory ( ) as dbpath : n = 100 env = lmdb. open ( dbpath ) with env. begin ( write = true ) as txn : for i in range ( n ) : key ='key - { } '. format ( i ). encode ('utf8') value = os. urandom ( 16 ) txn. put ( key, value ) with env. begin ( write = true ) as txn : for i ...
[ -0.21053113043308258, -0.007084741722792387, 0.47770988941192627, -0.31117069721221924, 0.3500547409057617, 0.16652566194534302, 0.017825672402977943, 0.6378303170204163, -0.29221776127815247, -0.15332214534282684, -0.36000972986221313, -0.26121005415916443, -1.2655868530273438, 0.27242782...
def sort _ by _ priority ( lines ) : return list ( reversed ( [ status _ line ( tpl ) for tpl in sorted ( [ status _ tuple ( line ) for line in get _ status _ lines ( lines ) ], cmp = compare _ priority, key = itemgetter ( 1 ) ) ] ) )
[ -0.027477296069264412, -1.302367925643921, 0.4562390148639679, 0.48965421319007874, 0.13111534714698792, 0.1260150521993637, -1.2057523727416992, 0.4818113148212433, 0.02947228215634823, -0.3523104786872864, 0.09240405261516571, -0.5586978197097778, 0.35104718804359436, 0.5343959927558899,...
def from _ response ( raw _ response ) : json _ response = raw _ response. json ( ) # todo add error codes to api response # code = error _ info. get ( " code ", " " ) try : error _ cls = _ error _ map [ raw _ response. status _ code ] except keyerror : raise notimplementederror ( " unknown error please contact custome...
[ -0.5522240996360779, -1.1735939979553223, 0.3498314917087555, -0.46362969279289246, -0.348618745803833, -0.43215304613113403, -0.3289453387260437, 0.3609088957309723, 0.9985721707344055, -0.17129851877689362, -0.6811115741729736, -0.41860273480415344, 0.6847920417785645, -0.772150754928588...
def exit _ screen ( self ) : print ( " \ nexiting. \ n " ) return
[ -0.31485748291015625, -0.20972251892089844, 0.1746618002653122, 0.19694800674915314, 0.4550797641277313, 0.7113593220710754, -0.666271448135376, -0.41208815574645996, -0.7828795313835144, 0.95654296875, -0.1967376470565796, 0.2478705644607544, -0.29085400700569153, 0.6075267791748047, 0....
def _ _ converttosubsystems ( self, inputdata, defsubsystem ) : if " subsystem " in inputdata : subsystem = inputdata [ " subsystem " ] else : subsystem = defsubsystem processeddata = { } processeddata [ subsystem ] = { } for key in inputdata : # if file, load file and walk if isinstance ( inputdata [ key ], dict ) and...
[ -0.4065013527870178, 0.42183735966682434, 0.7556068301200867, -0.33269238471984863, -0.5808467864990234, 0.24453240633010864, 0.09239860624074936, -0.15959124267101288, -0.11677851527929306, -0.6239392161369324, -0.3103392720222473, 0.4493419826030731, 0.000629365211352706, 1.0736442804336...
def _ _ len _ _ ( self ) : return self. _ size
[ -0.12691649794578552, -0.6661685109138489, 0.29100316762924194, -1.798009991645813, 0.436826229095459, 0.18146581947803497, 0.6518471837043762, 0.16756293177604675, 0.8039458990097046, -1.0270609855651855, -1.0933301448822021, -0.3838566839694977, 0.6342904567718506, -0.5727577805519104, ...
def exclude _ dir _ with _ filename ( self, exclude _ dir _ with _ filename ) : self. _ exclude _ dir _ with _ filename = exclude _ dir _ with _ filename
[ -0.11857353150844574, -1.008241891860962, 0.15773595869541168, 0.4797687530517578, -1.2776609659194946, 1.084712028503418, 0.7718826532363892, 0.5249631404876709, 0.29753756523132324, -0.4816683828830719, 0.04062039777636528, 0.23559200763702393, -0.21042916178703308, 0.600368320941925, ...
def iterable ( obj ) : try : iter ( obj ) except typeerror : return false return true
[ -0.4996599853038788, 0.1908445656299591, 0.6114776134490967, 0.4337291121482849, -0.2269280105829239, 1.2676893472671509, 0.342164546251297, -0.3754875957965851, -0.557610809803009, 0.0800996646285057, 0.026750069111585617, -0.9014710783958435, -0.7462027668952942, -0.6818169355392456, -...
def data2q _ res ( mol ='', data _ file ='' ) : data2b _ res ( mol, data _ file, property ='q')
[ 0.3988540470600128, -0.6777496337890625, 0.16001787781715393, -0.6175563931465149, 0.6788720488548279, -0.5252270698547363, -0.3088316321372986, 0.0013072907458990812, -0.3358484208583832, -0.7687907218933105, -0.7695239186286926, 0.17563757300376892, -0.14035825431346893, -1.2148523330688...
def pixellate _ bboxes ( im : np. ndarray, bboxes, cell _ size = ( 5, 6 ), expand _ per = 0. 0 ) : if not bboxes : return im elif not type ( bboxes ) = = list : bboxes = list ( bboxes ) for bbox in bboxes : if expand _ per > 0 : bbox = bbox. expand _ per ( expand _ per ) x1, y1, x2, y2 = bbox. xyxy _ int im _ roi = im ...
[ 0.19689057767391205, 0.31144949793815613, 0.943835437297821, 1.0996854305267334, -0.59981369972229, 0.040206506848335266, -0.5050283670425415, -0.5108959674835205, 0.9021090269088745, 0.5927339792251587, 0.8311734199523926, -0.8105788826942444, -0.7192019820213318, 0.1677475869655609, -0...
def _ partial _ fit _ base _ estimators ( self, x, y, classes, sample _ weight = none ) : for index, base _ estimator in enumerate ( self. base _ estimators ) : try : if self. active _ learning is true : self. base _ estimators [ index ] = base _ estimator. partial _ fit ( x, y, classes, sample _ weight ) else : try : ...
[ -0.6993191242218018, -1.124455451965332, 0.5250405669212341, 0.6230037212371826, 0.614915668964386, -0.14592228829860687, -0.4768074154853821, -0.5229341387748718, -0.04552493244409561, 0.3962484896183014, 0.08926669508218765, 0.8256208896636963, -0.4394979178905487, 0.10651466995477676, ...
def bead _ ranges _ in _ region ( region, genome _ version, resolution ) : bead _ ranges _ chr = bead _ ranges _ in _ chromosome ( chromosome = region [ 0 ], genome _ version = genome _ version, resolution = resolution ) if int ( region [ 2 ] ) < = bead _ ranges _ chr [ - 1 ] [ - 1 ] : for i in range ( len ( bead _ ran...
[ 0.2227000892162323, -0.8375526666641235, 0.6630004048347473, 0.16755349934101105, -0.1735772043466568, 0.6804538369178772, 0.7525829076766968, -0.24661371111869812, 0.08588516712188721, 0.6553767919540405, -0.9322248101234436, 1.2733105421066284, -1.229246735572815, 0.5669751167297363, 0...
def is _ initial ( cls, word ) : if len ( word ) > 2 : return false if len ( word ) = = 1 : return word [ 0 ]. isalpha ( ) if len ( word ) = = 2 : return word [ 1 ] = = '.'and word [ 0 ]. isalpha ( )
[ -0.21288076043128967, -0.4252411127090454, 0.8157366514205933, 0.5047678351402283, -0.6171858906745911, 0.196840301156044, 0.090799480676651, 0.5578622817993164, 0.8295692205429077, 0.2117360383272171, -0.09628020226955414, 0.9954625368118286, -0.23591497540473938, 0.9024423956871033, -0...
def outputload ( self, task ) : return self. tasks [ task ]. outputload ( as _ dict = true )
[ -1.5693086385726929, -0.22033870220184326, 0.35785338282585144, -0.8999181389808655, -1.5326787233352661, -1.2552284002304077, -0.6941527724266052, -1.352805495262146, -0.8894734382629395, 0.7136451005935669, -0.16383574903011322, -0.45417314767837524, 0.5176453590393066, 0.068746358156204...
def test _ get _ quarterly _ null _ previous _ submission ( tas _ balances _ data ) : sub1 = submissionattributes. objects. get ( previous _ submission _ _ isnull = true ) quarters = appropriationaccountbalances. get _ quarterly _ numbers ( ) for q in quarters : if q. submission = = sub1 : # qtrly values for year's fir...
[ 1.27814519405365, -0.4052298069000244, 0.5294280648231506, -0.2890265882015228, 0.6330733895301819, -0.437418669462204, 0.0029601850546896458, -0.4277580976486206, 0.9178654551506042, -0.9139485955238342, 0.10510723292827606, 0.07791680097579956, 0.24484241008758545, 0.9949636459350586, ...
def pop _ smallest ( self ) : smallest = heapq. heappop ( self. heap ) del self. set [ smallest. state ] return smallest
[ 1.2053991556167603, -0.4005027711391449, 0.6478770971298218, -0.8981544971466064, -1.265277624130249, -0.37486571073532104, -0.8930104970932007, -1.3668781518936157, -0.3921828866004944, -0.625346302986145, -0.19005264341831207, 0.2420254945755005, -0.9958027601242065, -0.648084819316864, ...
def _ _ init _ _ ( self, * args ) : _ topods. topods _ twire _ swiginit ( self, _ topods. new _ topods _ twire ( * args ) )
[ -0.2484045773744583, 0.7649941444396973, 0.41567930579185486, -0.3006691634654999, -0.13102580606937408, 0.34757593274116516, 0.013373175635933876, -0.21950605511665344, -0.5839350819587708, 0.4688090980052948, -0.8218144774436951, -0.7359315752983093, -0.8841450214385986, 1.22067725658416...
def init _ ui ( self, dt = 0 ) : self. loadsent ( ) print ( dt )
[ -0.08239133656024933, 0.18843883275985718, 0.11699989438056946, 0.3601089417934418, 0.0012274202890694141, 0.4892689287662506, 0.18325285613536835, -1.353689193725586, -0.42252498865127563, -0.658039927482605, -0.13863709568977356, 0.6147024035453796, -0.3648957908153534, 1.337146282196045...
def get _ order _ totals ( self, basket = none, shipping _ method = none, * * kwargs ) : calc = ordertotalcalculator ( self. request ) if not basket : basket = self. request. basket if not shipping _ method : shipping _ method = self. get _ shipping _ method ( basket ) total _ incl _ tax = calc. order _ total _ incl _ ...
[ -0.5465901494026184, 0.7010129690170288, 0.8934363722801208, 0.39265063405036926, -0.574335515499115, -0.48719024658203125, 0.1337922066450119, -0.17500673234462738, 0.7003331780433655, 0.27827203273773193, -0.23049335181713104, 0.4753330647945404, 0.016923081129789352, 0.34901461005210876...
def position ( self, value ) : if not isinstance ( value, tuple ) or len ( value ) is not 2 : raise typeerror ( " position must be a tuple of 2 positive integers " ) if not isinstance ( value [ 0 ], int ) or not isinstance ( value [ 1 ], int ) : raise typeerror ( " position must be a tuple of 2 positive integers " ) if...
[ -2.0467920303344727, -0.3552440106868744, 0.5904198288917542, -0.18658602237701416, 0.1764986366033554, 0.6809282302856445, 0.32402974367141724, -0.5086525082588196, -0.7129826545715332, 0.5966677069664001, -0.23481212556362152, -1.3318419456481934, -0.8632818460464478, 0.04583331942558288...
async def async _ setup _ racelandshop _ websockt _ api ( ) : racelandshop = get _ racelandshop ( ) racelandshop. log. info ( " setup task % s ", racelandshopsetuptask. websocket ) websocket _ api. async _ register _ command ( racelandshop. hass, racelandshop _ settings ) websocket _ api. async _ register _ command ( r...
[ 0.2872645854949951, 0.11357777565717697, 0.7111123204231262, -0.305498331785202, 0.6786379814147949, -0.6251999735832214, 0.5446356534957886, -0.29005134105682373, 1.0337284803390503, 0.7361006140708923, -0.5942392945289612, 0.7144362330436707, 0.7506667971611023, 1.117310881614685, -0.2...
def amountchange ( ) : changefunc = float ( money % cost ) return changefunc
[ -0.24929973483085632, -0.25168469548225403, 0.29796963930130005, 0.4402877688407898, -0.6930126547813416, -0.7488477826118469, 0.8152872920036316, 0.1654641479253769, -0.1384878158569336, 0.4386307895183563, -0.01470951922237873, 0.2986225485801697, 0.5958070158958435, 0.6614693999290466, ...
def _ delete ( app _ name, region _ name = " us - west - 2 ", assume _ role _ arn = none, archive = false, synchronous = true, timeout _ seconds = 300, ) : import boto3 if ( not archive ) and ( not synchronous ) : raise mlflowexception ( message = ( " resources must be archived when ` delete ( ) ` is executed in non - ...
[ 0.3613434433937073, -0.19443023204803467, 0.6552335619926453, 0.12755213677883148, 0.2227599322795868, -0.5763281583786011, -0.06028955057263374, 0.4166901111602783, 0.5281860828399658, 0.8254873156547546, 0.2588643431663513, 0.6811234354972839, 0.7168371081352234, -0.23514428734779358, ...
def test _ valid _ update ( self ) : data = {'first _ name':'jane ','last _ name':'doe ', } profilefactory ( user = self. user ) response = self. client. post ( self. url, data = data ) self. assertequal ( response. status _ code, 302 ) self. user. refresh _ from _ db ( ) self. assertequal ( self. user. first _ name,'j...
[ 1.0280824899673462, 0.30864208936691284, 0.6072893142700195, 0.7785428166389465, -0.3329576253890991, 1.536912202835083, -0.19701363146305084, -0.23615829646587372, 0.3059893846511841, -0.9463075399398804, -0.9397138357162476, -0.5999915599822998, -0.08118319511413574, -0.5539872646331787,...
def _ get _ team _ league ( code ) : for team in team _ data : if team [ " code " ] = = code : return team [ " league " ] [ " id " ] break else : return null
[ 0.5834828019142151, -0.3123242259025574, 0.43224990367889404, -1.2033826112747192, 0.31092965602874756, -0.43181517720222473, -1.2807101011276245, -0.6816580295562744, 0.36446329951286316, 1.0190848112106323, -0.28850191831588745, 0.033535636961460114, 0.3240759074687958, -0.58843785524368...
def decode _ response ( response : optional [ response ], request : httpx. request ) - > optional [ httpx. response ] : if response is none : return none status _ code, headers, stream, ext = response return httpx. response ( status _ code, headers = headers, stream = stream, ext = ext, request = request )
[ 0.5547385215759277, -1.1454336643218994, 0.3660966753959656, 0.36276936531066895, -0.13559098541736603, -1.1440811157226562, -1.0243124961853027, -0.04871957004070282, 1.8684648275375366, -0.9542350769042969, -0.3039162755012512, 0.052219681441783905, -0.04331298545002937, -1.0081535577774...
def _ _ init _ _ ( self, all _ grid _ search _ results, averages, verbose = false ) : self. all _ results = all _ grid _ search _ results self. averages = averages self. verbose = verbose
[ 0.24789832532405853, 1.0627834796905518, 0.5515884757041931, 0.6605671644210815, 0.3746904134750366, 0.38002562522888184, -0.2476547509431839, -0.29998430609703064, -0.8936604261398315, 0.7714530229568481, 0.9493182897567749, 0.140035942196846, 0.3016311526298523, 1.1609772443771362, -0....
def visit _ functiondef ( self, node : functiondef ) : self. _ visit _ helper ( node )
[ 0.058260127902030945, 0.5007848143577576, 0.3784405589103699, -0.4350622594356537, 0.4398237466812134, -0.49824073910713196, 0.7501497864723206, -0.38611575961112976, -0.8154997229576111, 0.19653216004371643, -0.01304405927658081, 1.6738669872283936, 1.0636135339736938, 1.169205665588379, ...
async def delete _ image ( self, image _ id, skill _ id = none, oauth _ token = none ) : skill _ id, oauth _ token = self. _ check _ auth ( skill _ id, oauth _ token ) url = api. methods. api _ url ( skill _ id, api. methods. images ) + image _ id result = await api. request ( self. session, oauth _ token, request _ me...
[ -1.0467416048049927, 0.1939321607351303, 0.3955343961715698, 0.0033586223144084215, 0.6720432043075562, -0.47840365767478943, -0.9247929453849792, -0.4816952645778656, 0.5396187901496887, 0.5738446712493896, 0.0812426507472992, 0.8182265758514404, -0.3157076835632324, 0.5439494848251343, ...
def _ update _ nauth _ token ( self, action ) : if not self. _ private _ key : return self. _ timestamp = int ( datetime. now ( ). timestamp ( ) ) self. _ auth _ token = _ hmac ( self. _ private _ key,'{ 0 } " { 1 } { 2 } " '. format ( self. _ timestamp, action _ base _ url, action ) ) _ logger. debug ('generated new t...
[ -1.6390351057052612, -0.679857075214386, 0.2833757996559143, -0.23333659768104553, 0.0305017102509737, -0.15141329169273376, -0.28562793135643005, 0.2541872560977936, 0.364001989364624, 0.45754778385162354, -0.5946371555328369, 1.124808430671692, 1.0473606586456299, 0.3319299519062042, 0...
def photo _ detail ( request, pk ) : photo = get _ object _ or _ 404 ( photo, pk = pk ) return render ( request, template _ name ='photos / photo _ detail. html ', context = { " item " : photo } )
[ -0.32733193039894104, 0.41243797540664673, 0.19079594314098358, 0.6657801270484924, -0.0848608985543251, 0.632949948310852, 0.7588112950325012, 0.8733389377593994, 0.5677134990692139, -0.19649337232112885, 0.381065309047699, 0.013883920386433601, 0.8458376526832581, 0.2830427289009094, -...
def test _ get _ quarterly _ numbers ( tas _ balances _ data ) : # retrieve all quarterly numbers and test results quarters = appropriationaccountbalances. get _ quarterly _ numbers ( ) # number of quarterly adjusted records should = number of records # in appropriationaccountbalances assert len ( list ( quarters ) ) =...
[ 0.9195064306259155, -0.2244984209537506, 0.6905344128608704, -0.3987443447113037, 0.7118149995803833, -0.29447662830352783, 0.34695589542388916, -0.3120015263557434, 0.7341125011444092, -1.3974899053573608, 0.03342396020889282, 0.11228610575199127, 0.166148379445076, 0.6676355004310608, ...
def write _ yaml ( self, yaml _ dir ) : piece _ dict = self. dump ( ) piece _ path = os. path. join ( yaml _ dir,'piece. yaml') for mi, m in zip ( range ( len ( self. movements ) ), self. movements ) : for i in range ( len ( m. instruments ) ) : del piece _ dict ['movements'] [ mi ] ['instruments'] [ i ] ['notation'] f...
[ -0.29297974705696106, -0.27973589301109314, 0.699253499507904, -0.5733551979064941, 0.29369276762008667, 0.609850287437439, 1.6505976915359497, 0.8203642964363098, -0.04155201464891434, -0.026474613696336746, -0.4600430727005005, 0.2700495421886444, 0.4331914484500885, 0.9241154193878174, ...
async def save _ moderator _ app ( self, message _ id : int, moderator _ id : int ) - > none : mycursor, db = await the _ database ( ) await mycursor. execute ( " " " insert into moderatorapplication ( message _ id, moderator _ id ) values ( % s, % s ) " " ", ( message _ id, moderator _ id ) ) await db. commit ( ) awai...
[ -0.38889840245246887, -0.45080578327178955, 0.4672798812389374, -0.4047597050666809, 0.3613111674785614, 0.3173586130142212, -0.37287983298301697, -0.24216175079345703, -0.08313453197479248, 1.1088917255401611, -0.12649646401405334, 0.25422704219818115, -1.581066608428955, 0.89378958940505...
def load ( url, delay ='0') : popen ( [ join ( dirname ( _ _ file _ _ ),'load. scpt'), url, delay ], stdout = open ( devnull ) )
[ 0.6446407437324524, 0.18130801618099213, 0.6816334128379822, -0.12166815996170044, -0.1602891981601715, 0.18620122969150543, 0.4475359320640564, 0.5422993898391724, -0.25103697180747986, -0.4132564067840576, -0.39327073097229004, 0.20360812544822693, -0.3074507415294647, -0.269007354974746...
def test _ get _ locale _ path ( self ) : existing _ locales = ('af ','ar - sa ','ar - sasa ','de ','et ','pl ','pl - pl ','ru ','pt - br ','zh - tw') for language in existing _ locales : self. assertisnotnone ( get _ locale _ path ( language ) ) nonexisting _ locales = ('ga ','en ','en - us ','martian ', ) for languag...
[ 0.567640483379364, 0.04616203159093857, 0.6009913682937622, 0.6903332471847534, 1.2610588073730469, 0.2291664481163025, 0.26332810521125793, 0.1410415917634964, -0.03177731856703758, -0.06308020651340485, -0.28875353932380676, -0.46537211537361145, -0.1469441056251526, 0.14289408922195435,...
def from _ refresh _ token ( self, client _ id, refresh _ token, scope ) : token = refreshtoken. find ( client _ id, refresh _ token ) if token is not none : data = json. loads ( token. data ) # validate scope and client _ id if ( scope = ='' or scope = = data. get ('scope') ) and \ data. get ('client _ id') = = client...
[ 1.076951503753662, -1.1752161979675293, 0.39603984355926514, -0.3876233696937561, -1.002282977104187, -0.4479619860649109, -1.3288739919662476, -1.42513906955719, 0.45274606347084045, 0.3345798850059509, 0.042833779007196426, 1.2999976873397827, 0.21578961610794067, -0.4781669080257416, ...
async def upload _ image ( self, image _ url _ or _ bytes, skill _ id = none, oauth _ token = none ) : skill _ id, oauth _ token = self. _ check _ auth ( skill _ id, oauth _ token ) json = none file = none if isinstance ( image _ url _ or _ bytes, str ) : json = {'url': image _ url _ or _ bytes } else : file = image _ ...
[ -1.096075177192688, 0.017424969002604485, 0.4607677757740021, 0.08265786617994308, 0.5076112151145935, -0.36840835213661194, -0.9946577548980713, -0.41540277004241943, 0.4613010883331299, -0.08743076026439667, 0.09691253304481506, 0.5130465626716614, -0.44311729073524475, 0.347412824630737...
def makeresponselikelihood ( self, * argv, * * kwargs ) : current = kwargs [ " predict " ] ( true, argv [ 0 ] ) current = tf. cast ( tf. clip _ by _ value ( current, 1e - 8, 1 - 1e - 7 ), kwargs [ " dtype " ] ) # prediction distribution dist = tfd. bernoulli ( probs = current ) result = dist. log _ prob ( tf. transpose...
[ 0.20334237813949585, -0.7124496102333069, 0.3511272072792053, -0.5813315510749817, -0.40381506085395813, 0.7651599049568176, 0.45401954650878906, -0.10091450810432434, 0.26613888144493103, -0.06616862118244171, -0.34413638710975647, 0.35883501172065735, -0.5085666179656982, -0.594202518463...
def list _ reverse ( my _ list ) : if my _ list = = [ ] : return [ ] else : first _ elem = my _ list [ 0 ] rest _ reversed = list _ reverse ( my _ list [ 1 : ] ) return rest _ reversed + [ first _ elem ]
[ -0.8565822839736938, 0.27040979266166687, 0.40182986855506897, 1.579861044883728, 0.892061173915863, -0.06207028403878212, -0.9143791794776917, 1.8659546375274658, 0.4731733798980713, -0.4086383581161499, -1.5792163610458374, 0.48981499671936035, -1.0127439498901367, 0.7460843324661255, ...
def get _ dataxy ( filename, x, y, nx, ny ) : ds = gdal. open ( filename, gdal. ga _ readonly ) band = ds. getrasterband ( 1 ) data = np. float64 ( band. readasarray ( int ( x ), int ( y ), nx, ny ) ) ds = none return data
[ -0.22413694858551025, 0.02987177111208439, 0.6151995658874512, -0.43136677145957947, 0.17007151246070862, 0.5566657781600952, -0.8951570391654968, -1.2243582010269165, -0.6618765592575073, -0.4946790039539337, 0.11830919981002808, 0.6327587962150574, 0.2194160521030426, -0.5590607523918152...
def check _ threshold ( self, object ) : content _ type _ object, object _ id = contenttype. objects. get _ for _ model ( object. _ _ class _ _ ), object. id total _ weight = sum ( [ x. weight for x in self. model. objects. filter ( content _ type = content _ type _ object, object _ id = object _ id ) ] ) moderation _ ...
[ -0.14892975986003876, -0.3539179861545563, 1.0379120111465454, -0.09500273317098618, -1.2453559637069702, 0.2100626528263092, -0.31285199522972107, -0.6772736310958862, -0.24281778931617737, 0.8881713151931763, -0.13989119231700897, 0.597876787185669, -0.956656277179718, 0.6151077747344971...
def best _ arm ( self ) : return np. argmax ( self. _ q _ values )
[ 0.6822046637535095, -0.5910356044769287, 0.3819340765476227, 0.39169588685035706, 0.3148556351661682, 1.155884861946106, -0.5328602194786072, 0.04382419213652611, -0.4007214605808258, -1.2255396842956543, 1.2168793678283691, 1.0536519289016724, -0.14599688351154327, 0.48276251554489136, ...
def load _ registry ( self, fname ) : with open ( fname ) as fin : for linenum, line in enumerate ( fin ) : elements = line. strip ( ). split ( ) if len ( elements )! = 2 : raise valueerror ( " expected 2 elements in line { } but got { }. ". format ( linenum, len ( elements ) ) ) file _ name, file _ sha256 = elements s...
[ -0.16551823914051056, -0.04991275817155838, 0.32204121351242065, -0.4146662652492523, 0.6742315292358398, -0.3242459297180176, 0.5981125235557556, 1.4013127088546753, -0.6212515234947205, 0.5630248785018921, -1.0400842428207397, -0.07082420587539673, 0.29165491461753845, 0.4946780204772949...
def read _ list ( filename ) : # create an empty list that will store # the lines of text from the text file. text _ list = [ ] # open the text file for reading and store a reference # to the opened file in a variable named text _ file. with open ( filename, " rt " ) as text _ file : # read the contents of the text # f...
[ -0.04323233664035797, -0.7006722688674927, 0.42037835717201233, -0.2894355356693268, -0.08978201448917389, 0.09633761644363403, -0.7200491428375244, 1.3207783699035645, 0.24829471111297607, 0.3357314467430115, -0.269405722618103, 0.056571900844573975, 0.12805846333503723, 0.676297903060913...
def begin _ create _ order _ item ( self, order _ item _ name : str, resource _ group _ name : str, order _ item _ resource : union [ _ models. orderitemresource, io ], * * kwargs : any ) - > lropoller [ _ models. orderitemresource ] : api _ version = self. _ get _ api _ version ('begin _ create _ order _ item') if api...
[ -1.2461094856262207, -0.5456492900848389, 0.8470048904418945, 0.2875499129295349, -0.6384398341178894, 0.38575127720832825, 0.032898835837841034, -0.9748231768608093, -0.07694985717535019, 0.4973631203174591, -0.2349151372909546, 0.3324677646160126, -0.21668237447738647, 0.3065229952335357...
def get _ home _ page _ data ( ) : total _ frts = utils. get _ total _ frts ( ) total _ frts _ states, total _ frts _ national = utils. get _ count _ frt _ jurisdiction ( ) result = {'total _ frts': utils. _ sum _ frts ( total _ frts ),'total _ frts _ national': total _ frts _ states,'total _ frts _ states': total _ fr...
[ 0.7731730341911316, 0.2549809217453003, 0.4618504047393799, -0.8438302874565125, 0.4318292737007141, -0.07339273393154144, 0.18914926052093506, -0.6890836954116821, 0.3118053078651428, -0.049665506929159164, -0.09306443482637405, -0.31001901626586914, 0.42669758200645447, 0.059752706438302...
def read ( self ) : return self. text
[ -0.35414639115333557, -1.2805202007293701, 0.4784584939479828, -0.6145088076591492, -1.0063745975494385, 0.6479162573814392, -0.5986406207084656, -0.5825475454330444, 0.153190016746521, -1.074052095413208, 0.4918685853481293, 0.530066192150116, -1.0477254390716553, -1.515859842300415, -0...
def profile ( request, athleteid = none ) : client = client ( ) try : strava _ user = stravauser. objects. get ( uid = request. user ) client. access _ token = strava _ user. access _ token curr _ athlete = client. get _ athlete ( athlete _ id = athleteid ) athlete _ friends = client. get _ athlete _ friends ( athlete ...
[ 0.03740670904517174, 0.3658764958381653, 0.8520509004592896, 0.5905813574790955, -0.2855631113052368, 0.2583666443824768, 0.7026546597480774, -0.5251138210296631, 0.15314751863479614, 0.8506312370300293, 0.8195223212242126, 0.2759450078010559, 0.3850034773349762, -0.567740797996521, 0.32...
def search ( self, start, end, * args, * * kwargs ) : ret = ramannarrator ( self, self. basedir, self. datatype, start, end ) zoo = self. zoo if zoo is none and not kwargs. pop ('filenames ', false ) : from lg _ dpl _ toolbox. dpl. netcdfzookeeper import generictemplateremapnetcdfzookeeper zoo = generictemplateremapnet...
[ -0.05665446072816849, -0.7734429836273193, 0.46048054099082947, -0.1721762716770172, -0.00273098680190742, -0.40909796953201294, 0.031100137159228325, -0.062323156744241714, -0.4714297652244568, -1.0897399187088013, 0.04215630143880844, 0.5056027770042419, -1.002502679824829, 0.33506458997...
def container ( self, node, type _ ) : return temporary ( self,'container _ id ', self. create _ code _ block ( node, type _ ), ( self. nested, node. name ) )
[ 0.13138346374034882, 0.2834194302558899, 0.275449275970459, -0.29158881306648254, -0.17814266681671143, -0.6428766846656799, 0.24932678043842316, -0.90501469373703, -0.16833800077438354, -0.41390231251716614, 0.21033619344234467, 0.8029306530952454, 0.04456872120499611, 1.031327724456787, ...
def request _ airbnb ( destination _ city, input _ departure _ date, input _ return _ date ) : # the url to send request api _ key = os. environ ['airbnb _ key'] url = " https : / / api. airbnb. com / v2 / search _ results? client _ id = % s " % ( api _ key ) # the search parameters to pass into request body search _ p...
[ -1.2248003482818604, 0.28979864716529846, 0.9659525752067566, 0.5688326954841614, -0.2130727618932724, 0.6078771948814392, -0.8644586205482483, -0.7260079979896545, -0.8698978424072266, 0.016060810536146164, -0.22950467467308044, 0.7184938192367554, -0.6894899010658264, 0.4475958049297333,...
def test _ subscription _ api _ with _ no _ of _ tickets _ greater _ than _ tickets _ left ( self ) : data = { " event _ id " : self. event. id, " user _ id " : self. user _ id, " no _ of _ tickets " : 1000, " card _ number " : 5039303342356004, " expiry _ year " : 2022, " expiry _ month " : 7, " amount " : 10000, " di...
[ 0.9020916819572449, -0.23722118139266968, 1.1041674613952637, -0.2015092968940735, 0.41028666496276855, 0.709882378578186, -1.0835169553756714, -0.6987189054489136, -0.30101391673088074, -0.7650474309921265, -1.1413195133209229, -0.04252688214182854, -0.3048572242259979, 0.9562333822250366...
def _ parse _ args ( ) : paths = [ ] try : applitools. eyes. eyes. api _ key = sys. argv [ 1 ] except indexerror : _ usage _ and _ exit ( 1 ) i = 2 while i < len ( sys. argv ) : overwrite = false if sys. argv [ i ] in ['- o ','- - overwrite'] : i + = 1 overwrite = true elif sys. argv [ i ] in ['- h ','- - help'] : _ us...
[ -1.3827824592590332, -0.08060944825410843, 0.5506224632263184, 0.23833933472633362, 0.6168354749679565, -0.9800702333450317, 0.1743660420179367, -0.2288811206817627, -0.4521626830101013, 0.8844379186630249, 0.587660551071167, -0.6975114345550537, 0.013573640957474709, 0.9919911623001099, ...
def test _ percent _ point ( self, scipy _ mock ) : # setup class scipywrappersubclass ( scipywrapper ) : model _ class ='mock _ model'probability _ density = none cumulative _ distribution = none percent _ point ='ppf'sample = none model _ instance _ mock = magicmock ( spec = ['ppf'] ) model _ instance _ mock. ppf. re...
[ 0.08130080252885818, 0.002450997941195965, 0.5926306843757629, 0.04790526255965233, 0.4566192626953125, 1.4218343496322632, -0.1470288187265396, -0.055601999163627625, 0.009980026632547379, -0.43526777625083923, -0.022180169820785522, -0.17782820761203766, -1.1077202558517456, 0.1028634756...
async def delete _ moderator _ app ( self, message _ id : int ) - > none : mycursor, db = await the _ database ( ) await mycursor. execute ( " delete from moderatorapplication where message _ id = % s ", ( message _ id, ) ) await db. commit ( ) await mycursor. close ( )
[ 0.23667645454406738, -0.22548091411590576, 0.24694649875164032, -0.04103681072592735, -0.19192416965961456, 0.11082088202238083, -0.1248948872089386, -0.2506495714187622, 0.16275860369205475, 0.8944018483161926, 0.8546736240386963, 0.4293953776359558, -1.2632290124893188, 1.121034979820251...
def configure _ interfaces ( device, neighbors ) : command _ list = ['enable ','configure'] for neighbor in neighbors : local _ interface = neighbor ['port'] if local _ interface. startswith ('eth') : # excluding management as it has multiple neighbors description ='connects to interfaces { } on neighbor { } '. format ...
[ -0.6681605577468872, 0.17611408233642578, 0.4776129722595215, 0.44253143668174744, 0.9942553639411926, -0.3669045567512512, -0.43956518173217773, -0.23713837563991547, 0.008382393978536129, 0.352566123008728, 0.34597286581993103, -0.08807843923568726, -0.570602297782898, 1.3456687927246094...
def visit _ classdef ( self, node : classdef ) : self. _ visit _ helper ( node )
[ -0.44588133692741394, 0.15196560323238373, 0.48683303594589233, -0.15451623499393463, 0.4683392643928528, 0.11607441306114197, 0.9419620037078857, -0.4916194677352905, -0.47322481870651245, 0.595699667930603, 0.10348503291606903, 1.4373602867126465, 1.2983568906784058, 1.4710596799850464, ...
def train _ adaboost ( self, choice = 0 ) : if choice = = 0 : # best param for synthea _ imputed _ train. csv clf = adaboostclassifier ( n _ estimators = 200 ) elif choice = = 1 : # best param for synthea _ common _ vars _ v2. csv clf = adaboostclassifier ( n _ estimators = 50 ) elif choice = = 2 : # best param for uci...
[ -0.4813271164894104, 0.21146441996097565, 0.4455179274082184, 0.7482386827468872, 0.6834619045257568, 0.45955657958984375, 0.09763514250516891, 0.07437688112258911, -0.4892975091934204, -0.4758610129356384, -0.4214543402194977, 1.0446218252182007, 0.35345539450645447, 0.03429238870739937, ...