text
stringlengths
25
2.19k
embedding
listlengths
768
768
def register ( module, decorator = bredala _ signature, names = none, decorator _ type = " signature ", * * kwargs ) : if decorator _ type not in ( " signature ", " inputs ", " outputs " ) : raise valueerror ( "'{ 0 }'decorator type not recognized. ". format ( decorator _ type ) ) if module not in bredala. _ modules : ...
[ -1.2824041843414307, 0.5160083174705505, 0.3918924331665039, 0.32206639647483826, 0.6299064755439758, -0.16597481071949005, -0.8157939910888672, 0.1607244908809662, 0.18893615901470184, -0.32263419032096863, -1.1412171125411987, 0.6096040606498718, -0.05876082181930542, 1.8213202953338623,...
def _ _ init _ _ ( self, registration _ type ='auto') : taskdefinitioncontroller. _ _ init _ _ ( self ) self. registration _ type = registration _ type
[ 0.1612016260623932, 1.2296346426010132, 0.3431028127670288, 1.949847936630249, 0.67356938123703, -0.1178554967045784, 1.346541166305542, 0.9088518619537354, -0.046578433364629745, 0.5264987349510193, -1.3170149326324463, 0.017434503883123398, 0.4200281798839569, 1.5327831506729126, 0.653...
def computegrammatrix ( a, b ) : assert ( a. dim ( ) = = 3 ) assert ( b. dim ( ) = = 3 ) assert ( a. size ( 0 ) = = b. size ( 0 ) and a. size ( 2 ) = = b. size ( 2 ) ) return torch. bmm ( a, b. transpose ( 1, 2 ) )
[ 0.6887938380241394, 0.21271662414073944, 0.7883021235466003, -0.05024415999650955, -0.30099472403526306, -0.4484388828277588, -0.2989199459552765, 0.33020317554473877, 0.13825151324272156, 1.0466268062591553, 0.4024236798286438, 0.7713526487350464, -0.26720038056373596, -1.3557569980621338...
def generate _ sec _ key ( self ) : min _ char = 20 max _ char = 28 allchar = string. ascii _ letters + string. digits rand _ string = " ". join ( choice ( allchar ) for x in range ( randint ( min _ char, max _ char ) ) ) print ( " sec _ key generated is : - ", rand _ string ) return rand _ string
[ -0.3238305151462555, -0.5956092476844788, 0.46232566237449646, -0.31005802750587463, 0.06818246096372604, 1.058899164199829, -0.3055057227611542, -0.23069356381893158, -0.04751928150653839, 0.2359895259141922, -0.7989284992218018, 0.9658144116401672, -0.5145007967948914, -0.249497309327125...
def repeat _ pattern ( self, pattern _ json ) : pattern _ json ['freq _ type'] = self. schedule _ freq _ type schedule _ pattern = schedulepattern ( self. _ pattern ) self. _ pattern = schedule _ pattern. create _ schedule _ pattern ( pattern _ json ) self. _ modify _ task _ properties ( )
[ -1.4254900217056274, 0.4924542307853699, 0.6372473835945129, -0.20863103866577148, 0.09976229071617126, 0.3646904528141022, 0.41675931215286255, 0.07590516656637192, 0.5439456105232239, 0.013094425201416016, -0.9713503122329712, 0.5092834234237671, 0.3953295946121216, -0.6594945192337036, ...
def _ load _ task _ config ( self, task _ id ) : return json. loads ( file ( self. _ task _ config _ file ( task _ id ),'rb'). read ( ) )
[ -0.8199051022529602, -0.22266624867916107, 0.5549364686012268, -0.7708988785743713, -1.4207533597946167, -0.5567964315414429, -0.24130386114120483, -0.25024691224098206, -0.9402196407318115, 1.921391248703003, -1.0480201244354248, -0.20582035183906555, 0.47437718510627747, 0.21892426908016...
def test _ request _ do _ select ( test _ dao, test _ configuration ) : dut = dtcsimilaritem ( test _ dao, test _ configuration, test ='true') dut. request _ do _ select _ all ( revision _ id = 1 ) assert isinstance ( dut. request _ do _ select ( 2 ), ramstksimilaritem )
[ -0.21459734439849854, 0.8206765651702881, 0.4462110698223114, 1.138566493988037, 0.44244006276130676, -0.210745170712471, -0.3350367844104767, -0.43353191018104553, 0.4316991865634918, -0.16780924797058105, -0.4169289469718933, 0.5862472653388977, 0.22970961034297943, -0.8523988723754883, ...
def lbfgsb ( fun, x0, args = ( ), jac = none, disp = false, gtol = 1e - 05, maxiter = 15000, bounds = none, maxls = 20, callback = none, maxcor = 10, maxfun = np. inf, ftol = 2. 2204460492503131e - 09 ) : return scipy. optimize. minimize ( fun = fun, x0 = x0, args = args, method ='l - bfgs - b ', jac = jac, bounds = bo...
[ 1.0974596738815308, 0.32941707968711853, 0.7927166819572449, 0.4205319285392761, -0.2854717969894409, -0.8340204954147339, -0.4504590928554535, -0.3034222722053528, -0.3140256106853485, -0.06469246745109558, -0.7102414965629578, 0.07193535566329956, -1.0983805656433105, 0.7433649897575378,...
def update ( self ) - > none : if not self. enabled : return if not self. _ session. valid _ token or self. _ spotify is none : run _ coroutine _ threadsafe ( self. _ session. async _ ensure _ token _ valid ( ), self. hass. loop ). result ( ) self. _ spotify = spotify ( auth = self. _ session. token [ " access _ token ...
[ -0.27429667115211487, -0.9242817759513855, 0.41687217354774475, -0.060103148221969604, 0.05681177228689194, 0.0031603234820067883, -0.1485729068517685, 0.043305449187755585, 0.3797932267189026, 0.2300349324941635, -0.06833755224943161, 0.6351184844970703, -0.8547413945198059, -0.5008768439...
def _ randomize ( block _ size ) : key = [ ] iv = [ ] for i in range ( block _ size ) : key. append ( randint ( 0, 255 ) ) iv. append ( randint ( 0, 255 ) ) key = bytearray ( key ) iv = bytearray ( iv ) return key, iv
[ -1.2491828203201294, -0.09364784508943558, 0.5315820574760437, -0.5471306443214417, -0.2399565428495407, -0.5734442472457886, -0.3887033760547638, -0.6288790106773376, 0.6103410720825195, 0.643883466720581, -0.9687601327896118, -0.05759671702980995, -0.8645032644271851, 0.9285432696342468,...
def _ _ init _ _ ( self, name, namespace, segment ) : super ( subsegment, self ). _ _ init _ _ ( name ) if not segment : raise segmentnotfoundexception ( " a parent segment is required for creating subsegments. " ) self. parent _ segment = segment self. trace _ id = segment. trace _ id self. type ='subsegment'self. nam...
[ 0.6505664587020874, 0.16435974836349487, 0.39995279908180237, 0.268160879611969, 0.18783463537693024, 0.2347314953804016, 0.05357997491955757, -0.4630458950996399, 0.17625954747200012, -0.25833699107170105, -1.1755189895629883, -0.2005356252193451, -0.11292669922113419, 0.29775872826576233...
def enable _ kombu _ compression ( self, admin _ remote ) : logger. debug ( " enable kombu compression inside env config for nodes. " ) admin _ remote. execute ('rm - rf / root / deployment _ 1') admin _ remote. check _ call ('fuel deployment - - env 1 - - default') admin _ remote. check _ call ( " for i in " " $ ( fin...
[ 0.1371820718050003, 0.09415087103843689, 0.5710130333900452, 0.7027100324630737, 0.8853245377540588, 0.0643729493021965, -0.3058796226978302, 0.18871267139911652, -1.0159019231796265, 1.654830813407898, -0.41586539149284363, 0.4283863604068756, -0.9085077047348022, 0.8541825413703918, 0....
def push _ metrology ( self, history ) : activity _ keys = [ obj for obj in storage. list _ keys ( settings. metrology _ bucket, self. metrology _ path ) ] history _ dumped = dump _ history _ to _ json ( history ) history = json. loads ( history _ dumped ) for key in activity _ keys : if not key. key. startswith ( os. ...
[ -0.2022736519575119, 0.4873141348361969, 0.5864874124526978, 0.10449394583702087, 0.08733998239040375, 0.002257109619677067, 0.2780608534812927, -0.8141877055168152, -0.3026973307132721, 1.1599464416503906, -0.4192982017993927, 0.3333803117275238, 0.16676363348960876, 0.2797945737838745, ...
def create _ authorization _ code ( self, request ) : grant = {'code': common. generate _ token ( ) } if hasattr ( request,'state') and request. state : grant ['state'] = request. state log. debug ('created authorization code grant % r for request % r. ', grant, request ) return grant
[ -0.4111595153808594, 0.24524077773094177, 0.4678942561149597, -0.09016899764537811, -0.4000047743320465, -0.38600805401802063, 0.13802112638950348, 0.30955156683921814, 0.3781707286834717, -0.23401767015457153, 0.5116347074508667, -0.2874542474746704, 0.44741877913475037, 0.808373868465423...
def create _ token _ response ( self, request, token _ handler ) : headers = {'content - type':'application / json ','cache - control':'no - store ','pragma':'no - cache ', } try : self. validate _ token _ request ( request ) log. debug ('token request validation ok for % r. ', request ) except errors. oauth2error as e...
[ -0.4850017726421356, -0.7779024243354797, 0.43733054399490356, 0.19335350394248962, -0.341168075799942, -0.43168655037879944, 0.000014381792425410822, -0.12791754305362701, -0.01760718785226345, -0.26978686451911926, -0.6499247550964355, 0.00025536425528116524, 0.7415714859962463, 0.062767...
def _ _ format _ event _ start _ time ( t ) : strftime _ format = " % - i : % m % p " return t. strftime ( strftime _ format ). replace ( " : 00 ", " " )
[ 0.6088085770606995, -1.8928242921829224, 0.645285427570343, -0.836251437664032, -0.06093618646264076, 0.43958643078804016, -0.6929969787597656, 0.7554356455802917, 0.17174537479877472, 1.6044306755065918, 0.47113996744155884, -0.03769926726818085, -0.2819249927997589, -0.6087929010391235, ...
def command _ oncall ( self, brain, args = none ) : url = " http : / / isops1. corp. yahoo. com / pager? list = prod - dns - tier3 & func = cal " soup = soup ( self. fetchurl ( url ) ) tds = soup. findall ('td') current = tds [ 4 ]. contents [ 0 ] until1 = tds [ 2 ]. contents [ 0 ] [ 5 : - 4 ] next = tds [ 9 ]. content...
[ -0.28324663639068604, -0.1471065878868103, 1.0156761407852173, -0.04550257697701454, -0.01996767334640026, 0.6368860006332397, -0.7964958548545837, -0.5550947785377502, 0.062424588948488235, 0.21357646584510803, 0.5833276510238647, 0.5968171954154968, -0.049726326018571854, 0.5421580672264...
def get _ next _ name ( input _ file ) : name = " " next _ char = get _ next _ character ( input _ file ) while not next _ char. isalpha ( ) : next _ char = get _ next _ character ( input _ file ) if next _ char = = " " : name = none break next _ non _ alnum = " " if name is not none : str = next _ char while next _ ch...
[ -0.8666284680366516, -1.288076400756836, 0.8638933300971985, -0.47386202216148376, -1.5624719858169556, 0.5257863998413086, -0.008954755961894989, 0.3329789936542511, -0.1306317150592804, 0.5879629254341125, -0.6810486912727356, 0.02894379012286663, -0.36683282256126404, 0.3535010218620300...
def palindromo _ cercano ( n ) : # aca empiezan los calculos para ver cual es el palindromo mas cercano hacia abajo del numero target _ abajo = n contador _ abajo = 0 while true : if es _ palindromo ( target _ abajo ) : break target _ abajo - = 1 contador _ abajo + = 1 # chequeamos cual es el palindromo mas cercano hac...
[ 0.5063501596450806, -0.8239697217941284, 0.8349803686141968, 0.5546801090240479, 0.5604467391967773, 0.14769063889980316, -0.13415198028087616, -0.4489040970802307, -0.3386518061161041, -0.5149131417274475, -0.13093620538711548, 0.7583203911781311, 0.011947858147323132, 0.34473946690559387...
def plotcobt ( nodepath, point, polygon, scale, steplength, rgba = [. 5,. 5,. 5, 1 ] ) : # plot cobt = stb. genminkovpnt ( polygon, point ) polygonlist = [ ] for height in range ( 0, int ( 360 * scale ), steplength ) : rotedcobt = stb. rotate ( cobt, height / scale ) polygonlist. append ( rotedcobt ) cobtnp = stb. genc...
[ 0.5365269780158997, -0.31832724809646606, 0.6018611788749695, 0.28926557302474976, -0.014731869101524353, 0.7009759545326233, -0.1276654154062271, -0.4332232177257538, 0.0701090469956398, 0.13524337112903595, -0.7381429076194763, 0.2224557101726532, -0.1330588161945343, -0.0270593967288732...
def test _ remove _ peaks _ around _ precursor _ with _ wrong _ precursor _ mz ( spectrum _ in ) : spectrum _ in. set ( " precursor _ mz ", " 445. 0 " ) with pytest. raises ( assertionerror ) as msg : _ = remove _ peaks _ around _ precursor _ mz ( spectrum _ in ) assert " expected'precursor _ mz'to be a scalar number. ...
[ 0.8987463712692261, -0.2777286767959595, 0.288655549287796, 0.4198966920375824, -0.508222222328186, 0.7674530148506165, 0.8902065753936768, 1.036773920059204, 0.42550504207611084, 0.14387845993041992, -0.6460573673248291, 0.5297772288322449, -1.046980381011963, 1.291486144065857, 0.63045...
def copy ( self ) : return duplicatetask. from _ dict ( self. to _ dict ( ) )
[ -0.25960853695869446, -0.8220857381820679, 0.5540915131568909, 0.2769712209701538, -0.8320192694664001, 0.6483282446861267, 0.2947337031364441, -0.13368532061576843, 0.5693065524101257, 0.3292410373687744, -1.4968963861465454, 0.8519287109375, 1.0332914590835571, -0.5192352533340454, -1....
def trapezerror ( func, b, a, h ) : xsi = ( - 1 ) * ( math. pi / 2 ) print ( " ƒ ( x ) : ", func ) f2 = sp. diff ( func, x, 2 ) print ( " ƒ'' : ", f2 ) diff _ 2 = lambdify ( x, f2 ) print ( " ƒ'' ( ", xsi, " ) = ", diff _ 2 ( xsi ) ) return h * * 2 / 12 * ( b - a ) * diff _ 2 ( xsi )
[ 0.32071736454963684, 0.5620865225791931, 0.4061737060546875, -0.20108160376548767, 0.03723806142807007, 0.26877349615097046, 0.026775648817420006, 0.018105560913681984, -0.33350658416748047, 0.0817699283361435, 0.39010539650917053, 0.7403650879859924, 0.12076301127672195, 0.682723581790924...
def is _ active ( self ) : return self. created + self. deadline > datetime. datetime. now ( )
[ -0.1641104519367218, -1.0223326683044434, 0.8368085622787476, 0.4585128426551819, -0.3977191746234894, 0.9829439520835876, -0.8630461096763611, 0.4567950963973999, -0.73216313123703, -0.36394932866096497, -0.24526573717594147, 0.598202109336853, 0.4065387547016144, -0.40448543429374695, ...
def create _ massage ( telegram _ id ) : question _ id = db. check _ for _ questionid _ db ( telegram _ id ) if question _ id < = db. get _ amout _ of _ questions _ db ( ) : question = db. look _ for _ question _ db ( question _ id ) if db. get _ attempt ( telegram _ id ) > attempts _ allowed : return question. upper (...
[ -0.09605441242456436, -0.16476967930793762, 0.4647030234336853, -0.07281364500522614, -0.40862759947776794, 0.9767297506332397, -0.4797201454639435, -1.2648484706878662, 0.27838170528411865, 0.04781385138630867, 0.9439603090286255, -0.6113589406013489, -0.745344340801239, 0.292845070362091...
def median _ mad ( data ) : median = np. median ( data ) mad = np. median ( np. abs ( data - median ) ) * mad _ coeff return median, mad
[ 0.06297772377729416, -1.1869513988494873, 0.3416401445865631, -0.46026021242141724, -0.3769267499446869, 0.3599582314491272, -1.2673288583755493, 0.33873456716537476, 0.9930122494697571, -0.3029314875602722, 0.7503741979598999, 0.7321980595588684, 0.23180453479290009, -0.13584919273853302,...
def upload _ specific _ files _ in _ order ( ) : try : _ verify _ is _ file _ multipart ( ) except badfileuploadexception as e : return jsonify ( { " error " : str ( e ) } ), 400 try : group _ 1 = request. files. getlist ( " group _ 1 " ) if len ( group _ 1 )! = 2 : raise exception ( f " expected 2 files in group 1, go...
[ -0.9111555814743042, -0.33293792605400085, 0.9420623183250427, 0.5949029326438904, 0.2605750560760498, -0.6729543209075928, 0.3047334849834442, -0.7071714401245117, -1.1689790487289429, 0.7662849426269531, 0.03946817293763161, 0.3889850676059723, -0.16654033958911896, 0.5311060547828674, ...
def select ( self, * column _ names ) : if not column _ names : return self columns, functions = [ ], [ ] for item in column _ names : if isinstance ( item, str ) : columns. append ( item ) elif isinstance ( item, tuple ) : functions. append ( item ) else : raise typeerror ( type ( item ) ) original = { name for index,...
[ -0.7015838027000427, -0.2883307635784149, 0.6049585342407227, -0.25365960597991943, 0.039090193808078766, -0.25210443139076233, 0.3481469452381134, -1.3530112504959106, -0.04506193473935127, -0.13867923617362976, -0.5756660103797913, 0.5533861517906189, -0.2175358533859253, -1.088139414787...
def learn _ best _ threshold ( self, xval, yval ) : assert ( xval is not none and yval is not none ) pval = multi _ variant _ gaussian ( xval, self. mu, self. sigma2 ) p _ max = np. max ( pval ) p _ min = np. min ( pval ) intv = ( p _ max - p _ min ) / 1e6 best _ f1 = - 1e - 8 best _ eps = 0. 0 for epsilon in np. arang...
[ 0.5711629986763, -0.05968772619962692, 0.7116563320159912, 0.6165832877159119, -0.594504177570343, -0.18411846458911896, -0.8405479788780212, -0.05432400107383728, -0.4457966387271881, 0.04180184379220009, -0.19337202608585358, 1.229729175567627, 0.2954969108104706, -0.017175987362861633, ...
def test _ atomic _ hex _ binary _ max _ length _ 4 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ max _ length _ 5 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - maxlength - 5. xsd ", instance ...
[ 0.18837067484855652, 0.05789077654480934, 0.2603583335876465, 0.7427414059638977, -0.336454302072525, 0.14052799344062805, -0.49711874127388, -0.372662752866745, -0.1941026896238327, 0.32914528250694275, -0.7635802626609802, -0.7044743299484253, -0.609167218208313, 0.6065431237220764, 0....
def _ list _ subfolders ( path ) : subfolders = [ ] for f in tf. io. gfile. listdir ( path ) : full _ path = os. path. join ( path, f ) if tf. io. gfile. isdir ( full _ path ) : subfolders. append ( f ) return subfolders
[ 0.29982879757881165, -0.03566080331802368, 0.622063934803009, 0.32276591658592224, -0.72459876537323, 0.17718441784381866, 0.7445321679115295, -0.2839827537536621, -0.033844903111457825, -0.005610855761915445, -0.7917004823684692, 0.1391797959804535, 0.04481495916843414, -0.101093724370002...
def test _ signature _ method _ validation ( self ) : body = ('oauth _ signature = a & oauth _ consumer _ key = b & oauth _ nonce = c &'' oauth _ version = 1. 0 & oauth _ signature _ method = % s &'' oauth _ timestamp = 1234567890') uri ='https : / / example. com /'class hmacvalidator ( requestvalidator ) : @ property ...
[ -0.6999345421791077, 0.10952137410640717, 0.6056208610534668, 0.8504254221916199, 0.22961531579494476, 0.013504003174602985, 0.11346568912267685, -0.4082438349723816, -0.02147313952445984, 0.26340997219085693, -0.4053874909877777, -0.4236920475959778, -0.26310309767723083, 0.87508410215377...
def mindistance ( closest1t _ r, closest1i _ r ) : distance = [ 1 ] * 9 for i in range ( 3 ) : for j in range ( 3 ) : distance [ i * 3 + j ] = pow ( closest1t _ r [ i ] [ 0 ] - closest1i _ r [ j ] [ 0 ], 2 ) + pow ( closest1t _ r [ i ] [ 1 ] - closest1i _ r [ j ] [ 1 ], 2 ) d = copy. deepcopy ( distance ) d. sort ( ) #...
[ -0.03482307866215706, -0.40806615352630615, 0.6909590363502502, -0.2641705274581909, -0.6784505248069763, 0.6691532731056213, 0.30306094884872437, -0.5467519760131836, 0.35338571667671204, 0.9419854879379272, -0.3132189214229584, -0.08533832430839539, -0.8843403458595276, -0.38958054780960...
def distance ( self, first _ atoms = none, second _ atoms = none, cutoff = none, use = none ) : if cutoff : cutoff = float ( cutoff ) if cutoff < = 0. 0 : raise valueerror ( " must give a cutoff greater than 0 " ) self. _ distance ['cutoff'] = cutoff if first _ atoms : self. _ distance ['first _ atoms'] = first _ atoms...
[ 0.030620872974395752, 0.05226338282227516, 0.7389329671859741, -0.8511462211608887, -0.2760521471500397, 0.3165179491043091, -0.13148799538612366, 0.7994116544723511, -0.6847612857818604, 0.7155916690826416, -0.8569143414497375, -0.012052502483129501, -0.058152537792921066, 0.3093948960304...
def _ generate _ lease _ request _ status _ updates ( machine _ type, swarming _ server ) : lease _ requests = [ ] for request in machine _ type. leases : if not request. hostname : # we don't know the hostname yet, meaning this request is still pending. lease _ requests. append ( machine _ provider. leaserequest ( dim...
[ -0.4730358421802521, -0.1519845426082611, 0.33392003178596497, 0.06426464021205902, -0.03848319500684738, 0.34172213077545166, -1.1310839653015137, 0.7903907895088196, -0.2683163583278656, 0.1927935779094696, -0.21397458016872406, 0.4274235665798187, 0.476521760225296, 1.4261996746063232, ...
def remove _ sim ( ) : pass
[ 0.4595354199409485, 0.607207179069519, 0.1301242709159851, 0.9883188009262085, -0.3715551793575287, -0.33344727754592896, 0.8593432307243347, 0.43846529722213745, -0.016217142343521118, 0.45389628410339355, -1.2876460552215576, 0.05097576975822449, -0.948492705821991, -0.5293461084365845, ...
def test _ can _ hook _ request _ data _ header ( self ) : time _ st = str ( time. time ( ) ) class myapiclient ( apiclient ) : @ apiclienthook. hook _ client _ header ( client ='httpbin ', requests = ['get _ my _ headers ','get _ my _ ip'] ) def set _ dynamic _ data _ on _ header ( self, data, * * kwargs ) : data ['ti...
[ -0.944551408290863, -0.4212273955345154, 0.8540633916854858, 0.6070458889007568, 0.21266137063503265, 0.4430667459964752, -0.3279178738594055, -0.37488269805908203, -0.501853883266449, -0.6394834518432617, -0.509537398815155, 0.42963436245918274, 0.19752398133277893, -0.2311057448387146, ...
def states _ list ( ) : new _ dict = storage. all ( state ) return render _ template ('7 - states _ list. html ', states = new _ dict )
[ -0.20551304519176483, 0.2890934944152832, 0.10725526511669159, -0.7058626413345337, -0.2798134386539459, -0.6365394592285156, -0.5351654291152954, 0.9924300909042358, 0.7259646654129028, 0.000318121921736747, 0.03218600153923035, -1.1411211490631104, 1.4993407726287842, 0.3206544518470764,...
def dump _ datetime ( value ) : if value is none : return none return [ value. strftime ( " % y - % m - % d " ), value. strftime ( " % h : % m : % s " ) ]
[ -0.9838584661483765, -0.3884044885635376, 0.823828935623169, -0.635857880115509, -0.006294444669038057, -0.14321595430374146, -1.0622743368148804, -0.4065098166465759, 0.1766539365053177, 1.2080556154251099, -0.9086994528770447, -0.17546142637729645, 0.3618558347225189, 0.6775568723678589,...
def isatty ( stream ) : fn = getattr ( stream,'isatty ', none ) if fn is none : return false return fn ( )
[ -0.19356660544872284, -0.12450376152992249, 0.6503075361251831, 0.3679196238517761, 0.10877907276153564, -1.2294063568115234, 0.026188679039478302, -0.9810259342193604, -0.06766483187675476, -0.5190754532814026, -0.18863099813461304, -0.3331446647644043, 0.44082197546958923, 0.097849287092...
def load _ v2 ( self, data _ dir, extension, datadim, instanceisonefile, data _ dir _ child, channel _ size = none, view = none ) : #???? if data _ dir _ child = = " labeled " : child _ dirs = os. listdir ( data _ dir ) self. _ num _ classes = len ( child _ dirs ) child _ dirs. sort ( ) data _ dir _ child _ path = [ os...
[ -0.30436837673187256, -0.13463208079338074, 0.9129042625427246, -0.3588479161262512, -0.5006240010261536, 0.04155924916267395, 0.247935488820076, 0.5659854412078857, -0.1264774054288864, 0.27051517367362976, -0.8651992082595825, 0.9393062591552734, 0.6874080896377563, 0.1900712251663208, ...
def _ _ str _ _ ( self ) : return " % s " % self. title
[ -0.1665576994419098, -2.013144016265869, 0.7897408604621887, -1.1548062562942505, -0.6788745522499084, 0.9994418025016785, -1.2304353713989258, -0.48342910408973694, 0.29279494285583496, -0.13247857987880707, 0.9074136018753052, 0.8926197290420532, 0.06441657245159149, -0.8609870672225952,...
def update _ stack ( stackname : str, params : list [ _ param ], tags : list [ _ tag ] ) : try : _ cf. update _ stack ( stackname = stackname, useprevioustemplate = true, parameters = params, capabilities = ['capability _ named _ iam'], tags = tags ) except clienterror as err : errmsg = str ( err ) if not re. search ( ...
[ -0.6472142934799194, 0.6528384685516357, 0.6342265009880066, 0.157884418964386, 0.2115471065044403, -1.0982595682144165, 0.23660999536514282, -0.7690091133117676, -0.7894188165664673, 0.9116191267967224, -0.5120164752006531, 0.4064595699310303, -0.8632973432540894, 0.0022896721493452787, ...
def vp _ u ( cps, pv, alpha, regfunction = 0, regparam = 0 ) : u = np. zeros ( cps. shape ) # todo perform numpy vectorization for i, cp in enumerate ( cps ) : u [ i, : ] = vp _ u _ raw ( cp, pv, alpha, regfunction, regparam ) return u
[ -1.0897961854934692, 0.24891485273838043, 0.46047094464302063, 0.5271852016448975, 0.46822211146354675, -0.1054370328783989, 0.7346206903457642, 1.28546941280365, 0.29517874121665955, 0.3251055181026459, 0.18147559463977814, 0.16408587992191315, -0.39500904083251953, -0.463113009929657, ...
def test _ validate _ rdp _ version ( self ) : rdp22 _ fp = " / applications / rdp _ classifier _ 2. 2 / rdp _ classifier - 2. 2. jar " self. assertequal ( validate _ rdp _ version ( rdp22 _ fp ), 2. 2 ) invalid _ fp = " / applications / rdp _ classifier _ 2. 2 / rdp _ classifier. jar " self. assertraises ( runtimeerro...
[ 0.021165499463677406, -1.1855545043945312, 0.6587877869606018, 0.19879350066184998, -0.6214308738708496, 1.2360643148422241, 0.1632758229970932, -0.1617882251739502, -0.6852084994316101, 0.12216570228338242, -0.8967235088348389, 0.3226303458213806, -0.25232234597206116, 0.36051514744758606...
def get _ group _ id ( group _ name, group _ name _ id _ connector ) : # todo : vectorize this search to make it quicker for i in np. arange ( 0, np. shape ( group _ name _ id _ connector ) [ 0 ] ) : if str ( group _ name _ id _ connector [ i ] [ 0 ] ) = = str ( group _ name ) : return group _ name _ id _ connector [ i...
[ 0.16500350832939148, -0.6500710844993591, 0.5039793252944946, -0.3424580991268158, -0.26854121685028076, -0.6658172011375427, -0.36457881331443787, -1.1740386486053467, -0.22381380200386047, 0.49443358182907104, 0.7546933889389038, 0.5368683338165283, -1.2297643423080444, -0.12712116539478...
def _ _ str _ _ ( self ) : return self. plot _ no
[ 0.008073098957538605, -1.0225234031677246, 0.6086379885673523, -1.056954264640808, -1.2783018350601196, 0.7512591481208801, 0.8129949569702148, -0.31612658500671387, -0.5502208471298218, -0.4566471576690674, -0.24475641548633575, 1.117967963218689, 0.6510051488876343, -0.5427326560020447, ...
def move _ to _ beginning ( arr, item ) : if item in arr : arr. insert ( 0, arr. pop ( arr. index ( item ) ) )
[ 0.009946702048182487, -0.4229204058647156, 0.561187744140625, 0.20871460437774658, 0.3583803176879883, -0.03862065449357033, 0.5069760084152222, 0.07217594236135483, 0.8551827669143677, 1.6736748218536377, -0.3545864224433899, 0.4795462191104889, 0.09624725580215454, -0.27678853273391724, ...
def _ collect _ chunks ( self ) : if len ( self. _ chunks ) : return self. _ chunks if self. verbose : print _ stderr ( " collecting chunks for bitrate calculation " ) aggregation _ types = { " gop " : self. _ get _ aggregation _ chunks _ gop, " time " : self. _ get _ aggregation _ chunks _ time } aggregation _ chunks ...
[ -0.009368094615638256, 0.341570109128952, 0.5945665240287781, -0.31531038880348206, 0.9097490906715393, -0.338264524936676, -0.10946439951658249, -1.3234126567840576, -0.9053114056587219, 0.5010744333267212, 1.0767028331756592, 0.7532984018325806, 0.2144157588481903, 1.5479490756988525, ...
def test _ atomic _ qname _ enumeration _ 3 _ nistxml _ sv _ iv _ atomic _ qname _ enumeration _ 4 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - enumeration - 4. xsd ", instance = " nistdata / atomic ...
[ -0.36773961782455444, -0.7821396589279175, 0.5019277334213257, 0.0838351920247078, -0.5392456650733948, 0.30058303475379944, 0.1233484223484993, -0.7066161632537842, -0.26385167241096497, 0.4523613154888153, -0.8368493318557739, -0.468551903963089, -0.16369926929473877, -0.4423214197158813...
def mappingderivation ( cls, record ) : # make a managed dependent yield from cls. manageddependentderivation ( ) # if the record has anything to say if record. mapping : # this is its spot yield record. mapping # my mappings know how to compute their values yield cls. mapping # and whatever else my superclass says yie...
[ -0.028213372454047203, 0.22942553460597992, 0.7736144065856934, 0.19441060721874237, -0.8053762316703796, 0.09614452719688416, 0.48403283953666687, 0.40514013171195984, 0.7593891024589539, -0.9933005571365356, 0.2157781720161438, -0.18015803396701813, 0.4543394446372986, 0.8233413100242615...
def update ( self, table, columns, * * kw ) : c1 ='and '. join ( [ k +'= :'+ k for k, v in kw. items ( ) ] ) c2 = ', '. join ( [ k +'= :'+ k for k in columns ] ) print c1 print c2 print " " " update " " " + table +'set'+ c2 + " where " + c1 try : self. cursor. execute ( " " " update " " " + table +'set'+ c2 + " where "...
[ -0.27593156695365906, -0.43203410506248474, 0.9061856269836426, 0.2988266348838806, -1.1363153457641602, 0.39121025800704956, -0.5559312105178833, -0.4489043056964874, -1.2811423540115356, 0.26701536774635315, 0.4647197127342224, -0.4982858896255493, -0.9385858178138733, -0.076000109314918...
def add _ dir ( self, path, depth = 1 ) : # sanity checks if depth < 1 : return false if not os. path. isdir ( path ) : return false for entry in os. listdir ( path ) : entry _ path = os. path. join ( path, entry ) if os. path. isfile ( entry _ path ) : if not self. _ in _ whitelist ( entry ) : print ('% s is not in th...
[ -1.1472101211547852, 1.4170435667037964, 1.0777329206466675, 0.06904909014701843, -0.31925657391548157, 0.6140693426132202, 0.4554189443588257, 0.009499161504209042, 0.599321722984314, -0.5785455107688904, 0.45389196276664734, 0.10773669928312302, -0.7951475977897644, 0.9284380674362183, ...
def test _ correct _ namespaces ( self ) : reporter = yield self. get _ reporter _ with _ suite _ run ( ) result = self. get _ result _ by _ test _ name ( reporter. errors,'statustest _ nested _ raise') globals, locals = self. get _ globals _ and _ locals _ from _ frame _ in _ result ( result ) self. assertnotin ('foo ...
[ 0.6171129941940308, 0.45298120379447937, 0.5073129534721375, -0.03900177404284477, 0.18567125499248505, 0.7894896864891052, 0.2215595841407776, -0.09989965707063675, 0.22907835245132446, -0.30994221568107605, -0.48108869791030884, 0.13543596863746643, -0.5496779084205627, 0.932143628597259...
def synthesize _ text ( text, output _ file ='output. mp3') : client = texttospeech. texttospeechclient ( ) # print ( client. list _ voices ( ) ) input _ text = texttospeech. types. synthesisinput ( text = text ) # note : the voice can also be specified by name. # names of voices can be retrieved with client. list _ vo...
[ 0.05800844728946686, -0.24613335728645325, 0.511083722114563, 0.2443465292453766, 0.08111433684825897, -0.14048200845718384, -0.2805461287498474, -0.020744526758790016, -0.30615678429603577, 0.28778502345085144, -0.9472188353538513, 0.24505850672721863, -0.1888400912284851, -0.525666117668...
def objective _ dir ( objective, theta ) : # empty list to store components of objective function derivative s = np. zeros ( len ( theta ) ) # compute objective function at theta s0 = objective ( theta ) # amount by which to increment parameter dtheta = 10 * * - 3 # for each parameter for i in range ( len ( theta ) ) :...
[ -0.06607841700315475, -0.626503586769104, 0.7987146973609924, -0.3733871877193451, -0.01814837008714676, 0.15114645659923553, 0.8476093411445618, -0.13491247594356537, 0.4940531849861145, 0.7214690446853638, 0.5553295612335205, 0.5736942291259766, 0.4486532211303711, -0.9137499928474426, ...
def test _ atomic _ base64 _ binary _ max _ length _ 4 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ max _ length _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - maxlength - 5. xsd ...
[ 0.17144805192947388, -0.2063402235507965, 0.21667928993701935, 1.149433970451355, -0.4850209057331085, -0.24092575907707214, -0.07068166136741638, -0.5011452436447144, -0.5215098857879639, 0.6525507569313049, -0.9435976147651672, 0.005182676017284393, -0.6209388971328735, 0.405082762241363...
def class _ to _ successes ( self, cls ) : successes = { } for clas in positive _ classifications : successes [ clas ] = false if cls = ='absft': successes ['abs'] = true successes ['absft'] = true elif cls = ='abs': successes ['abs'] = true successes ['absft'] = none elif cls = ='pdf': successes ['pdf'] = true elif cl...
[ -1.3142423629760742, -0.6770548820495605, 0.7331423759460449, -0.9699761867523193, -0.34338149428367615, 0.3090910315513611, -0.8620948195457458, -0.28390979766845703, -0.5499783158302307, 0.3573586046695709, -1.0174022912979126, -0.16638819873332977, 1.1170692443847656, 0.7556685209274292...
def current _ cover _ position ( self ) - > int : if self. _ zone [ " state " ] = = advantage _ air _ state _ open : return self. _ zone [ " value " ] return 0
[ -0.7360233068466187, -0.8638051152229309, 0.6113512516021729, 0.6171665787696838, -0.7473249435424805, 0.7308066487312317, 0.9282539486885071, 0.0545579269528389, 0.5330331921577454, 0.08507040143013, 0.5704207420349121, -0.4544377624988556, -0.4735068380832672, 0.2203107625246048, 1.053...
def test _ atomic _ language _ min _ length _ nistxml _ sv _ iv _ atomic _ language _ min _ length _ 1 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / language / schema + instance / nistschema - sv - iv - atomic - language - minlength - 1. xsd ", instance = " nistdata /...
[ 0.24476441740989685, -0.5406168103218079, 0.3915294110774994, 0.5747988224029541, -0.5772984623908997, 0.09711238741874695, -0.06328442692756653, -0.11533737182617188, 0.9258992075920105, 0.6615041494369507, -0.12014024704694748, 0.006133111193776131, -0.5068643689155579, 0.045382656157016...
def _ install ( self ) : # todo : log this print'installing...'pre _ paths = set ( util. list _ files ( self. _ target _ dir ) ) self. _ run _ cmds ( self. _ xpd. _ data ['install'] ) post _ paths = set ( util. list _ files ( self. _ target _ dir ) ) new _ paths = post _ paths - pre _ paths return new _ paths
[ -0.8573761582374573, -0.722505509853363, 0.5331059694290161, 0.29641541838645935, 0.6006840467453003, -1.1030522584915161, 0.32006317377090454, 0.4450848400592804, -0.5017864108085632, 0.6601108312606812, 0.06221873313188553, -0.6012283563613892, 0.07801302522420883, 0.428203284740448, -...
def get _ input ( self, more = false ) : received = none try : received = self. prompt. input ( more ) except keyboardinterrupt : print ( ) printerr ( " keyboardinterrupt " ) except eoferror : print ( ) self. exit _ runner ( ) else : if received. startswith ( exit _ chars ) : self. exit _ runner ( ) received = none ret...
[ -0.566343367099762, 0.46834224462509155, 0.6000853776931763, 0.40301513671875, -0.4197731912136078, 0.06664633005857468, 0.05402971804141998, -0.5186851620674133, 0.06184981018304825, -0.44298624992370605, -0.26713261008262634, -0.10960230231285095, -1.3870846033096313, -0.7149698138237, ...
def generate _ board ( self, marbles ) : board _ out = {'a': [ ],'b': [ ],'c': [ ],'d': [ ],'e': [ ],'f': [ ],'g': [ ],'h': [ ],'i': [ ] } rows = ['a15 ','b16 ','c17 ','d18 ','e19 ','f29 ','g39 ','h49 ','i59'] for marble in marbles : tile = tile. generate _ tile ( marble ) board _ out [ marble [ 0 ] ]. append ( tile ) ...
[ -0.6052106618881226, 0.4294207692146301, 0.6801708340644836, -0.3809456527233124, -0.05920333415269852, 0.22903074324131012, 0.7051886320114136, 0.42735597491264343, -0.21885927021503448, 0.42472222447395325, -1.070388674736023, -0.6559233665466309, -0.7054365277290344, 0.5745805501937866,...
def on _ message ( self, channel, method _ frame, header _ frame, body ) : # transform message try : self. reply _ to = header _ frame. reply _ to self. recv _ func ( body, self. publish ) # acknowledge that this message has been handled channel. basic _ ack ( delivery _ tag = method _ frame. delivery _ tag ) self. rep...
[ 0.7269365191459656, 0.08908248692750931, 0.6509202718734741, -0.738951563835144, 0.9800887703895569, -1.00571608543396, -0.48524370789527893, 0.17331646382808685, 0.11080662161111832, -0.3600938618183136, -0.19021065533161163, 1.0694384574890137, -0.19729003310203552, 0.20973432064056396, ...
def get _ command _ spec ( cmd ) : args, vararg, varkwarg, defvals = inspect. getargspec ( cmd ) assert varkwarg is none,'variable kwargs are not allowed in commands.'if args is none : args = tuple ( ) if defvals is none : defvals = tuple ( ) # avoid the self argument. if isinstance ( cmd, types. methodtype ) : args = ...
[ -0.3277953863143921, 0.9043288826942444, 0.39116525650024414, 0.2029363512992859, 0.619106113910675, -0.8546542525291443, -0.17626407742500305, -0.23397305607795715, -0.4524783492088318, 0.44156622886657715, 0.3192887306213379, 0.3005637228488922, -0.1400611400604248, 1.3262807130813599, ...
def create ( self, cr, uid, vals, context = none ) : if'vehicle _ id'in vals : onchange _ vals = self. onchange _ vehicle _ id ( cr, uid, [ ], vals ['vehicle _ id'], context ) ['value'] vals. update ( {'employee _ id': onchange _ vals ['employee _ id'],'degree _ id': onchange _ vals ['degree _ id'],'license _ plate': o...
[ -0.6320482492446899, -0.4782639145851135, 0.5834102630615234, -0.09949938207864761, 0.07473982870578766, -1.1141622066497803, -1.0392706394195557, 0.3754578232765198, -0.4751780331134796, 0.4960266053676605, 0.35292765498161316, -0.08218129724264145, 0.05489330366253853, 0.2591627836227417...
def triangulate ( geom, tolerance = 0. 0, edges = false ) : func = lgeos. methods ['delaunay _ triangulation'] gc = geom _ factory ( func ( geom. _ geom, tolerance, int ( edges ) ) ) return [ g for g in gc. geoms ]
[ 0.5768582224845886, 0.7704887390136719, 0.43147680163383484, -0.15412534773349762, -0.14839661121368408, -0.5123892426490784, -0.6715782284736633, -0.08284149318933487, 0.7541744112968445, -0.2681255340576172, -0.4663110077381134, -0.0663892850279808, 0.11999544501304626, -0.8747518658638,...
def query1 ( connection ) : current = time. time ( ) cursor = connection. cursor ( ) cursor. execute ( " " " select b. name as retired _ beer _ name, round ( avg ( r. overall ), 2 ) as beer _ rating from beer as b inner join reviews as r on b. id = r. beer where b. retired and b. abv > = 10. 0 group by ( b. id ) having...
[ 0.1302381157875061, 0.018328094854950905, 0.5000764727592468, 0.6184401512145996, -0.1316577047109604, 0.13535954058170319, -0.23981544375419617, 0.49159595370292664, -1.3594906330108643, 1.1438637971878052, 0.528580904006958, 0.2712930142879486, -0.6516733765602112, 0.03245927765965462, ...
def from _ slices ( cls, slices ) : new = cls ( slices [ 0 ]. p ) for attr in slices [ 0 ]. components ( ) : setattr ( new, attr, deep _ loft ( [ getattr ( s, attr ) for s in slices ] ) ) return new
[ 1.0021779537200928, -0.6109049320220947, 0.6142242550849915, -0.3648020923137665, -1.2421159744262695, 0.26523861289024353, -0.549416720867157, 0.2022705078125, 0.23431946337223053, 0.25255635380744934, -0.1297970414161682, -0.23736558854579926, 0.5444074273109436, 0.32643356919288635, -...
def special _ test _ function ( params, realm = none ) : return'oauth'+ ', '. join ( ['= '. join ( [ k, v ] ) for k, v in params ] )
[ -0.06119384616613388, -0.45629388093948364, 0.2926071882247925, -0.10438564419746399, 0.4309987723827362, -0.46851563453674316, -0.21678003668785095, 0.5919705033302307, 0.47199273109436035, 0.715653657913208, 1.1393715143203735, 0.9843389987945557, -0.24805936217308044, -0.282135456800460...
def push _ to _ master ( sender, template = none, * * kwargs ) : # if template and template. sync is true : # template. push ( ) pass
[ -0.12854833900928497, 0.8060563802719116, 0.5262090563774109, 0.683259129524231, -0.7201541066169739, -0.2806794345378876, 0.07395579665899277, 0.35648050904273987, 0.20815257728099823, 0.7201499938964844, -1.7180147171020508, 0.43915674090385437, -0.2737765610218048, 0.756598949432373, ...
def required _ credentials ( self ) : return [ " username ", " password " ]
[ -1.2935585975646973, -0.8725246787071228, 0.3539063334465027, 0.5573374032974243, 0.23666051030158997, 0.9858189821243286, -0.7378023266792297, 0.18901710212230682, -0.1620439738035202, 0.19872283935546875, -1.3171840906143188, -0.10330114513635635, -0.4909394383430481, 1.0474475622177124,...
def consume _ arguments ( ) - > namespace : parser = argumentparser ( description = _ _ doc _ _, formatter _ class = rawtexthelpformatter ) # if you do not provide these values, they will default to # " falcon - client - id " and " falcon - client - secret ". parser. add _ argument ( " - k ", " - - client _ id _ parame...
[ 0.44094395637512207, -0.0031413654796779156, 0.5571094751358032, 0.1396876573562622, 0.1505572497844696, -0.39420604705810547, -1.307132601737976, -0.3400247395038605, -0.3851749002933502, 0.03378831222653389, 0.18427674472332, 0.19191305339336395, 0.15893737971782684, 0.46674099564552307,...
def test _ list _ insert _ key _ is _ none ( self ) : try : testlistinsert. client. list _ insert ( none, " age ", 1, 45 ) except e. paramerror as exception : assert exception. code = = - 2 assert exception. msg = = " key is invalid "
[ -1.1097867488861084, 0.39835959672927856, 0.44595661759376526, -0.20007480680942535, 0.5966398119926453, -0.5030796527862549, -0.6364898681640625, 0.46293145418167114, -0.0681549534201622, 0.9139757752418518, -1.106696367263794, -0.08922502398490906, -1.6360832452774048, 1.2981798648834229...
def serialize ( value : any ) - > influxdatatypes : raise notimplementederror ( " must be implemented by subclass " )
[ -0.48727136850357056, -0.06855207681655884, 0.6037178039550781, 0.5794218182563782, 0.06628839671611786, 0.3511408567428589, 0.3072713315486908, -1.2855371236801147, 0.6841009855270386, -0.8901147842407227, -1.4334897994995117, 0.1304394155740738, 0.2680622637271881, 0.5599576234817505, ...
def prep ( es ) : global index # print ('\ ncluster health :') # printjson ( es. cluster. health ( ) ) # print ('\ nindices :') # print ( es. cat. indices ( ) ) # delete index print ('\ ndeleting index'+ index + '...') printjson ( es. indices. delete ( index = index, ignore = [ 400, 404 ] ) ) # load index mapping and s...
[ -1.1138911247253418, -0.0938643366098404, 0.5014899969100952, -0.6642221808433533, 0.40221601724624634, 0.3490714430809021, 0.5038803219795227, 0.15390783548355103, 0.593573272228241, 0.33577609062194824, 0.019913120195269585, 0.5613842010498047, 0.9621896147727966, -0.45636340975761414, ...
def test _ shape ( self, varname, varshape, ndim ) : if len ( varshape )! = ndim : raise shapeerror ('shape = % s. expected % i - d array for % s'% ( repr ( varshape ), ndim, varname ) )
[ 0.8253576159477234, 0.37189799547195435, 0.3236035704612732, -0.5121010541915894, 0.4433451294898987, 0.4906521439552307, 0.11729861795902252, -0.03440498188138008, 0.11299782991409302, 0.17967689037322998, 0.5129867792129517, 0.5489723086357117, -0.14977800846099854, 0.9106938242912292, ...
def sum _ of _ squared _ diffs ( self ) : if self. sd is not none : return ( self. sd * * 2 ) * ( self. n if self. is _ population else ( self. n - 1 ) ) elif self. members : return sum ( [ ( x - self. mean ) * * 2 for x in self. members ] ) else : return - 1
[ -0.4047069251537323, -0.1661684215068817, 0.756112277507782, 0.7739211916923523, -0.2214081734418869, 0.3752947747707367, 0.3216484487056732, -1.049739956855774, 0.3919014036655426, -0.6041732430458069, -0.3866160213947296, 0.61383056640625, -0.31594422459602356, 0.41204833984375, -0.607...
def new ( * args, * * kargs ) : obj = itksubtractconstantfromimagefilteriuc2diuc2 _ superclass. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ 0.6692327260971069, -0.11822914332151413, 0.30901965498924255, -0.2692634165287018, -1.3292471170425415, 0.21190598607063293, 0.5685940384864807, 1.3685672283172607, -0.8749380111694336, -1.5130553245544434, -0.8243098258972168, -0.3730286955833435, 0.9214204549789429, 0.15113654732704163,...
def preprocess _ douban _ data ( input _ dir, embeddings _ file, target _ dir, lowercase = false, ignore _ punctuation = false, num _ words = none, stopwords = [ ], labeldict = { } ) : if not os. path. exists ( target _ dir ) : os. makedirs ( target _ dir ) # retrieve the train, dev and test data files from the dataset...
[ -0.3921617269515991, 0.1494978666305542, 1.080520510673523, -0.25486817955970764, 0.6119701266288757, 0.3572885990142822, 0.4775533974170685, -0.16389812529087067, 0.16764134168624878, -0.09182221442461014, -0.8028630018234253, 0.2303236722946167, 0.033947378396987915, -0.31763216853141785...
def split _ words ( in _ str, delim, to _ lower ) : if delim = ='-': delim = r'\ -'# make a copy. out _ str = " % s " % in _ str # search on word boundaries ; we're looking for sequences of : # * a lower - case followed by an upper - case character # * two or more upper - case followed by a lower - case character # * a...
[ 0.05370825156569481, 0.08320752531290054, 0.7675264477729797, -0.11224748939275742, -0.6237443685531616, -0.6941222548484802, -0.6490740776062012, 0.4981645941734314, 0.09601539373397827, 0.5110213756561279, 0.09236650913953781, 0.5872141718864441, -0.9183877110481262, -0.8601218461990356,...
def test _ postswithtextxmlcontenttype ( self ) : d = self. observer. _ postexception ('< not - real - xml / >') self. successresultof ( d ) self. assertequal ( self. agent. request. call _ count, 1 ) ( name, args, kwargs ) = self. agent. request. mock _ calls [ 0 ] self. assertequal ( kwargs ['headers']. getrawheaders...
[ 0.5084405541419983, 0.5818122029304504, 0.6064122915267944, 0.14087538421154022, -0.05341944471001625, 0.07822781801223755, -0.938145637512207, 0.03454175591468811, -0.21103769540786743, -0.04849642142653465, -0.0692722275853157, -0.9123691320419312, -0.4499604105949402, 0.714816689491272,...
def get _ all _ version _ manager _ except _ user _ id ( user _ id, _ cls = true ) : return templateversionmanager. get _ all _ version _ manager _ except _ user _ id ( user _ id, _ cls )
[ -0.6683022975921631, -0.8112614750862122, 0.4578757882118225, 1.3214356899261475, -1.1296125650405884, 1.0515888929367065, -0.3383658230304718, -0.30628153681755066, 0.8111841678619385, -0.3747182786464691, -1.021396517753601, 0.5995231866836548, -0.256380170583725, 1.3167897462844849, 0...
def drawhero ( self, hero : hero, top : bool ) : image = pygame. transform. scale ( hero. image, ( int ( configuration. hero _ width * configuration. hero _ scale ), int ( configuration. hero _ height * configuration. hero _ scale ) ) ) health = self. main _ font. render ( str ( hero. health ), true, configuration. mai...
[ -1.0769922733306885, -0.18944023549556732, 1.067075252532959, -0.08310496807098389, -0.042325153946876526, 0.47744473814964294, 0.07157737016677856, 0.3984370827674866, 0.4942130744457245, 0.5344765186309814, 0.2315843552350998, 0.6591394543647766, -0.22465211153030396, 0.5596947073936462,...
def proportion ( nb _ pts ) : print ( " starting thread : ", threading. current _ thread ( ). name ) nb _ in = 0 for _ in range ( nb _ pts ) : if random ( ) * * 2 + random ( ) * * 2 < 1 : nb _ in + = 1 return nb _ in
[ -0.016628190875053406, -0.0723443329334259, 0.3862721621990204, 0.6331453919410706, 0.6042121052742004, 0.5629434585571289, 1.0334008932113647, 0.2997075021266937, 0.1373271495103836, -0.21134662628173828, -0.18136274814605713, -0.3943857252597809, -1.111539602279663, 0.6032477617263794, ...
def onewaycross ( g1, g2 ) : if not isinstance ( g1, individual ) or not isinstance ( g2, individual ) : print'must pass individual to crossover'raise exception c = np. random. choice ( g1. genes ) cgenes = [ i for i in g2. genes ] for index, val in enumerate ( g1. genes ) : if val = = c : cgenes [ index ] = val return...
[ -0.04378131404519081, -0.2628084123134613, 0.6643280982971191, 0.6613483428955078, -0.9179966449737549, 1.1190295219421387, -0.10630925744771957, -0.10524357855319977, 0.02108384668827057, 0.41081222891807556, 0.1230851411819458, 1.9794918298721313, -1.067484736442566, -0.36619535088539124...
def deletedevicemanagementrequest ( self, requestid ) : mgmtrequests = apiclient. mgmtsinglerequest % ( self. host, requestid ) r = requests. delete ( mgmtrequests, auth = self. credentials, verify = self. verify ) status = r. status _ code if status = = 204 : self. logger. debug ( " request status cleared " ) return t...
[ -1.9402976036071777, 0.08335461467504501, 0.884320855140686, 0.09288754314184189, -0.3592644929885864, 0.24334567785263062, -0.03042593039572239, -0.30051475763320923, 1.0143499374389648, 0.4917285740375519, 0.8227402567863464, 0.7337672710418701, -0.7352421879768372, 0.7230429649353027, ...
def polytogld ( p, q ) : # get fractions and power factors f, pf = getfracandpf ( p, q ) # initialize return out = { } # get fractions and power factors into gridlab - d named parameters. note : # this depends on the array elements from getfracandpf being in the correct # order : impedance, current, power. this order n...
[ 0.06417836993932724, -0.6181750297546387, 0.5219982862472534, -1.5773342847824097, -0.10405204445123672, 0.3790382444858551, -0.7797377109527588, -0.6462492346763611, -0.5234273076057434, 0.09813886135816574, -0.16717639565467834, 0.12997394800186157, 0.02448679320514202, -0.50312387943267...
def initialize ( fast, orb, camera _ matrix, min _ parallax = 60. 0 ) : pose _ graph = nx. graph ( ) # stores keyframe poses and data ( keypoints, orb descriptors, etc. ) # edges stores neighbor relationships between keyframes map _ points = mappoints ( ) # stores 3d world points # get first key frame frame, frame _ na...
[ 0.705733597278595, 0.27236512303352356, 1.093564748764038, 0.9891366958618164, -1.2493735551834106, -0.3013666868209839, 0.3235297203063965, 0.41721227765083313, 0.575432300567627, 0.8249331712722778, -0.3108835220336914, 0.23733772337436676, -0.037272095680236816, -0.2468177229166031, 0...
def get _ degrees ( c ) : degrees = vfunc ( tang ( c ['x'], c ['z'] ) ) if ( c ['x'] < 0 and c ['z'] > 0 ) : degrees = 180 + degrees if ( c ['x'] < 0 and c ['z'] < 0 ) : degrees = 180 + degrees if ( c ['x'] > 0 and c ['z'] < 0 ) : degrees = 360 + degrees return degrees
[ 0.6076690554618835, -0.310428261756897, 0.4116547405719757, -0.615679919719696, -0.04916016384959221, -0.3048984706401825, -0.24801667034626007, -0.20869478583335876, -0.2836900055408478, 0.727394163608551, -0.5658636093139648, -0.1512686014175415, -0.24140664935112, -0.23906221985816956, ...
def total _ players ( self ) - > int : return len ( self. players )
[ -0.3090153932571411, -0.09586407989263535, 0.5533897876739502, -0.9067327976226807, 1.3711891174316406, 0.3340500295162201, 0.26153257489204407, 0.6767856478691101, 0.3023805022239685, 0.796436071395874, -0.8969370722770691, 0.2438381463289261, -0.6225045323371887, -0.6360848546028137, 0...
def load _ works _ threaded ( self ) : threads = [ ] self. _ works = [ ] for page in range ( self. _ works _ pages ) : threads. append ( self. _ load _ works ( page = page + 1, threaded = true ) ) for thread in threads : thread. join ( )
[ -0.6712318062782288, 0.5222555994987488, 0.6004567742347717, -0.3156900405883789, 1.0150189399719238, 0.46622955799102783, 0.25685158371925354, -1.3353685140609741, 0.02475905790925026, -0.39355507493019104, -0.6332398056983948, -0.5850873589515686, -1.1392849683761597, 0.516938328742981, ...
def get _ global _ link _ analytical _ jacobian ( self, link : str, q : arraytype ) - > casadiarraytype : return cs. vertcat ( self. get _ global _ link _ linear _ jacobian ( link, q ), self. get _ global _ link _ angular _ analytical _ jacobian ( link, q ), )
[ 0.7625307440757751, -0.28575992584228516, 0.3395141661167145, 0.38851961493492126, 0.04542938247323036, 0.06505092233419418, -0.2573002874851227, -0.9280899167060852, 0.0425945483148098, -0.14763236045837402, 0.14367486536502838, 1.8866897821426392, 0.3743636906147003, 0.4384464919567108, ...
def check _ within _ limits ( self ) : ok = true for par in self. pars ( ) : ok & = self. check ( par, " within _ limits ", verbose = true ) return ok
[ 0.35450589656829834, -0.33132123947143555, 0.6914170384407043, 0.3575436472892761, -0.1355648785829544, 1.2747693061828613, -0.7694681882858276, -0.5281657576560974, -1.108614444732666, 0.03881259635090828, 0.5853329300880432, 0.6590688824653625, -1.2487214803695679, 0.4654074013233185, ...
def getcataloguexml ( self ) : node = elementtree. element ( " catalogue " ) node. append ( self. root. toxml ( ) ) return node
[ -0.15475928783416748, 0.4421714246273041, 0.2205335646867752, 0.08816343545913696, -0.7773197293281555, 0.4807371497154236, -0.7378537058830261, 0.5327703356742859, 0.6184150576591492, -0.898345947265625, 0.6545347571372986, 0.2791115939617157, -0.4118426442146301, -0.05060139670968056, ...
def checkclick ( self, pos ) : if self. button. checkclick ( pos ) : self. board. changeturn ( )
[ 0.6293367147445679, -0.033692166209220886, 0.4220389723777771, 0.6240853071212769, 0.4683327376842499, -0.6394455432891846, -0.06463171541690826, 0.4172261953353882, 0.7950473427772522, 0.32182881236076355, -0.3889797329902649, -0.026196587830781937, 0.04648363217711449, -0.098269976675510...
def test _ atomic _ qname _ min _ length _ 1 _ nistxml _ sv _ iv _ atomic _ qname _ min _ length _ 2 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - minlength - 2. xsd ", instance = " nistdata / atomic ...
[ 0.39923951029777527, -1.0549910068511963, 0.3854626417160034, 0.019953511655330658, -0.4977878928184509, -0.05830619856715202, -0.430002897977829, -1.0182586908340454, 0.10345427691936493, -0.13426294922828674, -0.4403287470340729, 0.15357539057731628, -0.3281497061252594, 0.11478586494922...
def compute _ num _ flips ( stack ) : stack = list ( stack. strip ( ) ) height = len ( stack ) # naive strategy : try flipping the bottom - most not flipped each time stack. reverse ( ) # now the start of the list is the bottom of the stack num _ flips = 0 while true : try : last _ blank = stack. index ( " - " ) except...
[ -1.0562663078308105, 1.1375720500946045, 0.7973594069480896, 0.07543390244245529, -0.8953614234924316, -0.7733167409896851, 0.6525239944458008, 0.6824461817741394, 0.3293800950050354, -0.3197856545448303, -1.1010953187942505, -0.14283537864685059, -0.02106599323451519, -0.07215611636638641...
def perform ( client, unit ) : status = client. get _ status ( ) # it would be nice to use status. get _ unit, but it does not yet support # python 3. for i _ unit, data in status. iter _ units ( ) : if i _ unit = = unit : unit _ machine = data ['machine'] break else : raise lookuperror ( unit ) client. juju ('remove -...
[ -0.7783533930778503, 0.4729764759540558, 0.44369202852249146, -0.2722187340259552, -0.04916531965136528, 0.0016759387217462063, 0.28370803594589233, 0.588975727558136, -0.5399225354194641, 0.05772547051310539, 0.062499865889549255, 0.3483158349990845, -0.5845209360122681, -0.42222461104393...
def nb _ ll _ row ( params, data _ row ) : p = params [ 0 ] r = params [ 1 ] n = len ( data _ row ) ll = np. sum ( gammaln ( data _ row + r ) ) - np. sum ( gammaln ( data _ row + 1 ) ) ll - = n * gammaln ( r ) ll + = np. sum ( data _ row ) * np. log ( p ) ll + = n * r * np. log ( 1 - p ) return - ll
[ 0.9642902612686157, 0.566510796546936, 0.561782956123352, -0.5938647985458374, 0.5051541924476624, 0.602405846118927, -0.19624502956867218, 0.1709609478712082, 0.5044593214988708, 0.13451983034610748, 0.17627975344657898, 0.3569185733795166, 0.04797333851456642, 0.4170222878456116, -0.16...