text
stringlengths
25
2.19k
embedding
listlengths
768
768
def generate _ filtered _ csv _ at _ path ( path _ srt _ files, path _ image _ files, dist ) : import helper import logging import pysrt # get the path of the drone srt _ files = helper. get _ files _ from _ folder ( path _ srt _ files, '. srt') # the dict with the images name and their latitude and longitude images _ ...
[ -0.3050784170627594, -0.3012016713619232, 0.8615174293518066, 0.022839616984128952, -0.5834473967552185, 0.2023865282535553, -0.14119650423526764, -0.02668146975338459, -0.9203436970710754, 0.4740598797798157, 0.22895447909832, 0.8346930742263794, 0.4920945167541504, 0.7182419896125793, ...
def _ string _ to _ int ( self, string ) : number = 0 for char in string [ : : - 1 ] : number = number * self. _ alpha _ len + self. _ alphabet. index ( char ) return number
[ -0.5814239978790283, -1.064747929573059, 0.3529374599456787, -0.6609237790107727, 0.1471906155347824, -0.1930995136499405, 0.7801706194877625, -0.03465013951063156, -0.4842759668827057, 0.25073379278182983, -0.9324378967285156, 0.8468778729438782, -0.9505638480186462, -1.0734028816223145, ...
def test _ init _ checks _ y _ min _ max ( self, ymin, ymax ) : assume ( ymax < = ymin ) with pytest. raises ( valueerror ) as err : rectangulardomain ( 0, 1, ymin, ymax ) self. assertin ( " must be strictly less than ", str ( err. value ) ) self. assertin ( " ymin ", str ( err. value ) ) self. assertin ( " ymax ", str...
[ 0.14128567278385162, -0.5062084794044495, 0.5231679081916809, 0.16431422531604767, 0.47043576836586, 0.7295096516609192, -0.2883897125720978, -0.21630559861660004, -0.12747696042060852, -1.4560861587524414, -0.7746540904045105, 1.1201221942901611, 0.7744553089141846, 0.9088064432144165, ...
def build ( cls, config _ path : str, args : list ) : print ('parsing json config...') # ensure the provided config file exists if not os. path. exists ( config _ path ) : return print ('config file does not exist, please check the provided path and try again') # read the config file and convert to json with open ( con...
[ -0.6242005825042725, -0.6570649147033691, 0.8957361578941345, 0.9535501599311829, 0.3406165838241577, 0.414663165807724, 0.9836361408233643, 0.08982916176319122, -0.8235213756561279, -0.09084176272153854, -0.6109700202941895, -0.6499496698379517, 0.3995785713195801, 0.6171730160713196, 0...
def get _ gnu _ go _ response ( sgf _ filename, color ) : logging. debug ( " get _ gnu _ go _ move ( sgf _ filename ='% s ', color ='% s') " % ( sgf _ filename, color ) ) gtp _ cmd = " loadsgf % s \ ngenmove % s \ n " % ( sgf _ filename, color ) p = subprocess. popen ( ['gnugo ','- - level ','1 ','- - mode ','gtp'], st...
[ 0.22734087705612183, -0.3780103921890259, 0.9491764903068542, -0.28953665494918823, 0.06152021884918213, -0.5543161630630493, -0.1926013082265854, -0.7793464660644531, -0.553175151348114, 0.29925116896629333, 0.010704071260988712, 0.31471648812294006, -1.1694912910461426, -0.52343302965164...
def test _ register _ input _ and _ password _ do _ not _ match ( self, * _ ) : self. open ( base _ url +'/ logout') # go to main page self. open ( base _ url +'/ register') # validate that the user is taken to / login assert self. get _ current _ url ( ) = = base _ url +'/ register'self. type ('# email ','test _ front...
[ -0.9645878672599792, 0.8024142980575562, 0.5250610113143921, 1.0057920217514038, 0.6488509774208069, 0.6979640126228333, 0.16527023911476135, 0.11651226878166199, -0.3133862018585205, -0.427638977766037, -0.25314152240753174, 0.2172648310661316, -0.6513484120368958, 1.0150724649429321, -...
def _ _ call _ _ ( self, ids _ placeholder ) : # ids _ placeholder : 1d : batch _ size, 2d : time _ steps, 3d : max _ characters _ per _ token if ids _ placeholder in self. _ ops : # have already created ops for this placeholder, just return them ret = self. _ ops [ ids _ placeholder ] else : # need to create the graph...
[ -0.8394244313240051, 0.4762003421783447, 0.8865678310394287, -0.2676568329334259, -0.0871332436800003, -0.4738486111164093, -0.12939059734344482, -0.2500459849834442, -0.2439095675945282, 0.6428245306015015, -0.06561427563428879, -0.5567865967750549, -0.5849676132202148, -0.827538728713989...
def makegray ( self, msg ) : # as cv _ bridge automatically scales, we need to remove that behavior if msg. encoding. endswith ( " 16 " ) : mono16 = self. br. imgmsg _ to _ cv ( msg, " mono16 " ) mono8 = cv. createmat ( mono16. rows, mono16. cols, cv. cv _ 8uc1 ) cv. convertscale ( mono16, mono8 ) return mono8 elif " f...
[ -0.5452989339828491, 0.5295320153236389, 0.6677181124687195, 0.21663355827331543, 0.12034929543733597, 0.38784080743789673, 0.1690383106470108, -0.8644235730171204, 0.5216214656829834, -0.25911977887153625, 0.8781859278678894, 0.3572814464569092, -0.37274885177612305, 0.4071411192417145, ...
def solution _ graph ( self ) : return solutiongraph ( self )
[ 0.18188786506652832, 0.25551289319992065, 0.11344760656356812, 0.5341076254844666, -0.8059025406837463, -0.7440038919448853, 0.7455708384513855, -0.12979719042778015, 0.553034245967865, -0.6645504832267761, -0.5424401164054871, -0.20063535869121552, -0.26372402906417847, -0.930750668048858...
def dijkstra ( graph, src, dest, nodes _ count ) : unexplored = graph. copy ( ) # add the entire graph as unexplored shortest _ distances = { } # store shortest distances from two nodes predecessor = { } # store visited nodes for back - tracking min _ heap = minheap ( nodes _ count ) # min heap weights _ handler = weig...
[ 0.7472559213638306, 0.555473268032074, 0.8822163939476013, -0.13487347960472107, -0.3352166712284088, -0.23583275079727173, 0.505777895450592, 0.5074529647827148, -0.39217057824134827, 0.08773567527532578, -0.2300662100315094, 0.24671709537506104, -0.04215513542294502, -0.13197141885757446...
def test _ synergy _ score ( my _ team ) : my _ team. add _ connection ( 1, 2 ) score = synergy _ score ( my _ team ) assert set ( score. keys ( ) ) = = set ( range ( 5 ) ) for v in score. values ( ) : assert 0. < = v < = 1.
[ -0.29949814081192017, 0.20478393137454987, 0.3105678856372833, 0.891083836555481, 0.9907498359680176, -0.2767295837402344, -0.5515422821044922, -0.4498271048069, -0.6181754469871521, -0.09512189775705338, -0.6464137434959412, -0.8975918889045715, -0.6644801497459412, -0.041838206350803375,...
def _ validatedispatchdeadline ( dispatch _ deadline _ usec ) : if not isinstance ( dispatch _ deadline _ usec, int ) : raise typeerror ('deadline must be an integer') deadline _ in _ time _ delta = datetime. timedelta ( seconds = dispatch _ deadline _ usec / 1000000 ) if deadline _ in _ time _ delta > max _ dispatch _...
[ -0.13746851682662964, 0.1483527272939682, 0.8177411556243896, -0.41992756724357605, -0.44691920280456543, 1.2572466135025024, -0.04138559103012085, 0.2539640963077545, -0.35062506794929504, -0.4567064642906189, 0.004150695633143187, -0.1290571689605713, 0.8708170652389526, -0.1681730747222...
def test _ reactorparametrizationinclient ( self ) : reactor = memoryreactor ( ) factory = protocol. clientfactory ( ) t = internet. tcpclient ('127. 0. 0. 1 ', 1234, factory, reactor = reactor ) t. startservice ( ) self. assertequal ( reactor. tcpclients. pop ( ) [ : 3 ], ('127. 0. 0. 1 ', 1234, factory ) )
[ -0.22721445560455322, -0.09913241118192673, 0.22485680878162384, -1.0151318311691284, 0.6255693435668945, -0.5630468130111694, 0.06800171732902527, 0.050956178456544876, -0.2497335970401764, 0.21492590010166168, -0.09086166322231293, 0.47807765007019043, -0.8980997800827026, -0.39700442552...
def certificate _ arn ( self ) - > str : return pulumi. get ( self, " certificate _ arn " )
[ 0.30598074197769165, -0.6980401277542114, 0.47816410660743713, 0.8024564385414124, 0.9727818965911865, 0.7766066789627075, 0.2569220960140228, 1.637450933456421, 0.14967365562915802, -0.2360481321811676, 0.1695859730243683, 1.1614608764648438, 0.5857475399971008, -0.9781486988067627, 0.1...
def project ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " project " )
[ 0.5716012716293335, 0.708289623260498, 0.39897266030311584, 0.471920907497406, 1.221516728401184, 1.254810094833374, 0.14272750914096832, 0.25424838066101074, 0.8176037073135376, 0.0579870343208313, 0.6928960084915161, 0.2956552505493164, -0.23821088671684265, -1.395453691482544, -0.9755...
def wire ( self, direction, l, * args, * * kwargs ) : if direction = = none or direction = = 0 : direction = self. direction # set correct layername, but only if really set # try : layername ( self. gndlayer ) # except : # pass wire ( direction, float ( l ), self. gap, ( 0, ( self. line + self. gap ) / 2. ) ) wire ( di...
[ -0.4002377688884735, -0.31476345658302307, 0.4394478499889374, 0.01668388955295086, 0.22112159430980682, 0.8883008360862732, 0.18407878279685974, -1.0267785787582397, 0.788555920124054, -0.3907942473888397, 0.21260805428028107, 0.4363458454608917, -0.6389275193214417, 1.358530879020691, ...
def choose _ option ( ) : while true : option = input ('1. new game \ n2. load game \ nselect option :') if option. isnumeric ( ) and ( int ( option ) = = 1 or int ( option ) = = 2 ) : break dungeon _ game _ logger. logger. warning ('wrong input! it should be ` 1 ` or ` 2 `') return int ( option )
[ -0.8420307636260986, 0.13058075308799744, 0.6413694620132446, 0.628042459487915, 0.2572845220565796, 0.5126129388809204, 0.5101703405380249, -1.36475670337677, -0.39025387167930603, -0.2249995470046997, 0.44332748651504517, 0.24124017357826233, -0.41668927669525146, -0.13578572869300842, ...
def _ buildplatformforward ( name ) : def f ( self, value, * arguments, * * named ) : if self. _ frame : if self. _ context and self. _ context. platform : callinguithread ( setattr, self. _ context. platform, name, value ) return f
[ -0.2742689251899719, 0.3909473419189453, 0.47586607933044434, -0.399628609418869, -1.1353603601455688, 0.23458153009414673, 0.5256332755088806, -1.167231559753418, 0.007579014636576176, -0.5652095675468445, -0.08620618283748627, -0.09242379665374756, -0.38007381558418274, 0.251785635948181...
def expiration _ date ( self ) - > pulumi. output [ optional [ str ] ] : return pulumi. get ( self, " expiration _ date " )
[ 1.8475252389907837, 0.09991729259490967, 0.285932332277298, 0.9021927118301392, 0.34411025047302246, 0.5144678950309753, -0.8547398447990417, 0.04093155637383461, 1.0509090423583984, 0.19818927347660065, 0.21221821010112762, 0.6258316040039062, 0.49917900562286377, -0.26509711146354675, ...
def from _ json _ string ( my _ str ) : py _ obj = json. loads ( my _ str ) return py _ obj
[ -0.49170929193496704, -2.0371851921081543, 0.0802391842007637, -1.4477483034133911, -1.507279396057129, -0.030872153118252754, -0.11668190360069275, -0.7581005096435547, 0.2219415307044983, -0.8695590496063232, -0.6527181267738342, 0.3844626247882843, 0.28197744488716125, -0.98695290088653...
def average ( list ) : return sum ( list ) / float ( len ( list ) )
[ -0.986423671245575, 0.259240061044693, 0.16461671888828278, -0.027773600071668625, 0.2546541094779968, 0.7392989993095398, -0.21326911449432373, 0.847366213798523, 0.5107845664024353, 0.5261629819869995, -1.1623544692993164, -0.05531865730881691, -0.6943462491035461, 1.260107398033142, -...
def getcurrentcamera ( ) : andor _ solis. getcurrentcamera. restype = ctypes. c _ uint camerahandle = ctypes. c _ long ( ) result = andor _ solis. getcurrentcamera ( ctypes. byref ( camerahandle ) ) check _ status ( result ) return int ( camerahandle. value )
[ -0.5712754726409912, -0.5853745937347412, 0.5060139298439026, 0.8530092239379883, -0.40687432885169983, -0.5165808796882629, 1.2028648853302002, -0.21203884482383728, 0.49863824248313904, -0.4927133023738861, 0.6406490802764893, 0.6852670311927795, -0.8615912795066833, 0.41310662031173706,...
def construct _ array _ type ( # type : ignore [ override ] self, ) - > type _ t [ basestringarray ] : from pandas. core. arrays. string _ arrow import ( arrowstringarray, arrowstringarraynumpysemantics, ) if self. storage = = " python " : return stringarray elif self. storage = = " pyarrow " : return arrowstringarray ...
[ -0.6703460812568665, -0.6198605895042419, 0.4413869380950928, -0.23044301569461823, 0.9559521079063416, -0.7651168704032898, 0.30800899863243103, -1.0470240116119385, 0.7245636582374573, -0.08607655763626099, 0.034973323345184326, 1.278946042060852, 0.3142934739589691, -0.21438662707805634...
def _ getnamespace ( self, parent, nodename ) : namespace = none nsname = nodename. split ( " : " ) if ( len ( nsname ) > 1 ) : prefix = nsname [ 0 ] nodename = nsname [ 1 ] # locate the namespace for the prefix, if not found it has to be # created try : namespace = parent. searchns ( self. node, prefix ) except : name...
[ -0.26378387212753296, -0.03623468056321144, 0.5648629069328308, -0.5798362493515015, -0.140671506524086, -1.053038239479065, -0.6112486124038696, -0.30381280183792114, 0.9523512721061707, 0.06579343229532242, 0.2183058112859726, 0.3134705424308777, 0.3920484185218811, 0.4124317467212677, ...
def get _ elwise _ kernel ( context, arguments, operation, name = " elwise _ kernel ", options = [ ], * * kwargs ) : func, arguments = get _ elwise _ kernel _ and _ types ( context, arguments, operation, name = name, options = options, * * kwargs ) return func
[ -0.3382154703140259, 0.7850545048713684, 0.6592357754707336, 0.47669821977615356, -0.08020319789648056, -1.3728793859481812, -0.27336597442626953, -0.23705758154392242, 0.29306560754776, 0.4491165280342102, 0.1701623946428299, 0.5463302731513977, 0.6053926944732666, -0.2980128228664398, ...
def main ( ) : fire ( barrelecommand )
[ 0.702491044998169, 0.1420619636774063, 0.35515162348747253, 1.3078938722610474, 0.691372811794281, 0.5092620849609375, -0.022966457530856133, 0.7875245809555054, -0.9852327108383179, -1.2672213315963745, -0.31785285472869873, 0.49104630947113037, -0.29192477464675903, 0.9626865983009338, ...
def one _ hot _ 3d ( self, s ) : # one - hot encode as row vector x = np. zeros ( ( len ( s ), len ( self. alphabet ) ) ) for i, letter in enumerate ( s ) : if letter in self. aa _ dict : x [ i, self. aa _ dict [ letter ] ] = 1 return x
[ -1.1130168437957764, -0.2899106740951538, 0.4320264160633087, -0.6636689305305481, -0.28414657711982727, -0.2713000774383545, 0.014701255597174168, 0.2279883325099945, 1.7934871912002563, 0.7105060815811157, 0.009230924770236015, 0.9940718412399292, -0.34785595536231995, -0.013255805708467...
def count _ names ( self ) : for character _ id in self. allcharacters : namecode = self. allcharacters [ character _ id ]. namecode count = self. markedtext. count ( namecode ) # print ( namecode, count ) self. name _ counts [ character _ id ] = count # print ( self. name _ counts )
[ 0.10156728327274323, -1.0671719312667847, 0.3605204224586487, -1.2917803525924683, 0.03133704885840416, -0.21857544779777527, -0.5020290613174438, 0.07744123041629791, -0.13627222180366516, 0.14229340851306915, -1.8252124786376953, -0.0716099888086319, 0.031300537288188934, 1.1141773462295...
def bitstring _ to _ text ( bits, encoding ='utf - 8 ', errors ='surrogatepass') : n = int ( bits, 2 ) # get the integer reperesented by the bitstring num _ bytes = ( n. bit _ length ( ) + 7 ) / / 8 # calculate the number of bytes, # / / = = math. floor ( ) resulting _ bytes = n. to _ bytes ( num _ bytes,'big') # conve...
[ -0.23601455986499786, 0.0031803478486835957, 0.5056744813919067, 0.04572577029466629, -0.8370906710624695, -0.5319669246673584, -0.5116538405418396, -1.1679667234420776, 0.5915035605430603, -0.01673288643360138, -0.08383651077747345, 0.3576449453830719, 0.26619598269462585, -0.619352579116...
def remove _ dir ( ) : os. system ('rm - r - f { } '. format ( config. repository _ path ) ) os. system ('rm - r - f { } '. format ( config. temp _ csv _ path ) ) os. system ('rm - r - f { } '. format ( config. log _ path ) ) os. system ('rm - r - f { } '. format ( config. prediction _ csv _ path ) )
[ -0.40293994545936584, -0.11216799169778824, 0.40581420063972473, 0.08417157828807831, 0.2744598090648651, 0.6892259120941162, 0.8223244547843933, 0.708160400390625, -0.5603636503219604, -0.10327595472335815, 0.01802036724984646, -0.024109400808811188, 0.053870685398578644, 0.47739836573600...
def lookuprowid ( self, label ) : if self. label [ : - 1 ] = = label or self. label = = label : return self. rowid for childnode in self. children : rowid = childnode. lookuprowid ( label ) if rowid! = - 1 : return rowid return - 1
[ -0.18192951381206512, 0.39018872380256653, 0.8816083073616028, 0.40900546312332153, -0.10963360220193863, -0.05374367907643318, 0.23987644910812378, 0.10132798552513123, 0.6150575280189514, 0.26731055974960327, 0.7001692056655884, -0.02169274538755417, -0.4814121425151825, 0.91061204671859...
def _ init _ data ( self ) : # add all attributes to data dictionary for data _ note in self. _ maxdevice. attributenode : self. _ data. update ( { data _ note : none } ) for master _ note in self. _ maxdevice. masternode : self. _ data. update ( { master _ note : none } ) # initialize device specific data self. _ init...
[ -0.5424967408180237, 0.6148030161857605, 0.27857083082199097, -0.9002649784088135, -0.13815563917160034, 0.4960593283176422, 0.20399697124958038, 0.25481072068214417, -0.08715031296014786, -0.6690635681152344, -0.7359541058540344, 0.5902984142303467, 0.9549300670623779, 0.7037733197212219,...
def _ _ init _ _ ( self, dtype ) : self. _ dtype = np. dtype ( dtype ) self. _ arrays = deque ( ) self. _ stored _ start _ index = 0 self. _ stored _ length = 0 self. _ read _ index = 0
[ -0.09072283655405045, 0.3288925290107727, 0.3832683265209198, -0.1331527829170227, 0.4781547486782074, -0.5349738597869873, 0.7863938808441162, -0.3777807950973511, 0.3799355626106262, -0.4368581473827362, -0.992469072341919, 0.7974981665611267, 0.19778597354888916, 0.5356290340423584, 1...
def _ basic _ cols ( self, cols ) : # validate if abs ( cols [ 1 ] * cols [ 2 ] ) < = 1e - 12 or \ abs ( cols [ 3 ] * cols [ 4 ] ) < = 1e - 12 : # print'problem with the cols { 0 } '. format ( cols ) return none if self. venue = ='etf': # ib's etf size round to 100. update # vol, vbs, bs, as to be consistent with kdb f...
[ -0.48345059156417847, -0.4513580799102783, 0.7194461822509766, -0.20470371842384338, 0.5523447394371033, -0.267560750246048, 0.03507845476269722, -1.0576927661895752, 0.15887051820755005, 0.8419384360313416, -0.33482441306114197, -0.31549254059791565, -0.5937110781669617, -0.79285663366317...
def createtfsequenceexampleparserconfig ( schema : schema _ pb2. schema ) - > tuple [ dict [ str, common _ types. featurespectype ], dict [ str, common _ types. featurespectype ] ] : tensor _ representations = gettensorrepresentationsfromschema ( schema ) if tensor _ representations is none : raise valueerror ( " tenso...
[ -0.763777494430542, -0.06459513306617737, 0.4423809349536896, -0.22611410915851593, -0.03557448089122772, -1.0124003887176514, 0.4650450646877289, 0.3617611229419708, -0.3013715445995331, 0.4840831160545349, -1.1023890972137451, -0.01385120116174221, 0.12772944569587708, 0.3129989206790924...
def _ enumerable ( x ) : try : _ = enumerate ( x ) except ( typeerror, valueerror ) : return false return true
[ -0.7742300033569336, 0.48738428950309753, 0.4911946654319763, 0.29654163122177124, 0.006077198311686516, 0.37320709228515625, -0.9316827058792114, 0.22132107615470886, -0.4292066693305969, 0.2195005565881729, -0.29633381962776184, -0.5941078066825867, -0.5889909267425537, -0.87215644121170...
def main ( argv : list [ str ], default _ exit : bool = true ) - > bool : dlp = dirlistproc. directorylistprocessor ( argv, description = " convert fhir json into rdf ", infile _ suffix = ". json ", outfile _ suffix = ". ttl ", addargs = addargs, noexit = not default _ exit ) if not dlp. successful _ parse : return fal...
[ -0.04287686198949814, 0.08157424628734589, 0.933455765247345, -0.479703426361084, -0.2274371236562729, -0.34911081194877625, 0.1176314428448677, 0.4503181576728821, 0.23717442154884338, 0.49274370074272156, 0.001934713451191783, 0.1618679314851761, -0.12622129917144775, 0.15755042433738708...
def run _ migrations _ online ( ) : connectable = engine _ from _ config ( config. get _ section ( config. config _ ini _ section ), prefix ='sqlalchemy. ', poolclass = pool. nullpool ) with connectable. connect ( ) as connection : context. configure ( connection = connection, target _ metadata = target _ metadata ) wi...
[ -0.010020499117672443, -0.23478320240974426, 0.7230318188667297, 0.6515253186225891, 0.7400650382041931, 0.012310685589909554, -0.7738138437271118, 0.16673417389392853, -1.1060236692428589, 1.0509308576583862, -0.38529136776924133, 0.480447918176651, 0.15968360006809235, -0.701546370983123...
def check _ call ( * popenargs, * * kwargs ) : retcode = call ( * popenargs, * * kwargs ) cmd = kwargs. get ( " args " ) if cmd is none : cmd = popenargs [ 0 ] if retcode : raise calledprocesserror ( retcode, cmd ) return retcode
[ 0.05289655923843384, -0.09925758093595505, 0.7582687735557556, -0.33731433749198914, -0.1740441471338272, -0.25090134143829346, -1.3219906091690063, -0.4630466401576996, -0.031641121953725815, 0.11677879840135574, 0.9401248693466187, 0.19602257013320923, -1.0899875164031982, 0.725296199321...
def test _ addcallbackonlycalledonsuccess ( self ) : l = [ ] synchronousdeferred ( synchronousfailure ( runtimeerror ( ) ) ). addcallback ( l. append ) self. assertequals ( l, [ ] )
[ 0.627635657787323, 0.8906190395355225, 0.5675703883171082, 0.8513631820678711, 0.20397941768169403, 1.176814317703247, -1.3110040426254272, 0.35308516025543213, 1.2212567329406738, -1.241153597831726, -1.096353530883789, -0.028953013941645622, -0.15563155710697174, 1.5915794372558594, 0....
def printneighbors ( neighlist, full = true ) : print ( " neighbors : " ) for neigh in neighlist : neigh. setprintmode ( full ) print ( neigh )
[ 0.017237085849046707, 0.24704910814762115, 0.4500144422054291, 0.8200744390487671, -0.06422441452741623, 0.677681565284729, -0.2483454942703247, -0.19816267490386963, -0.7274209856987, 0.2716001868247986, -1.2917442321777344, 0.45265984535217285, -0.4691598415374756, 0.9511035680770874, ...
def fill ( textlist ) : try : width = max ( [ len ( x ) for x in textlist ] ) except : return [ ] returnlist = [ ] for line in textlist : returnlist. append ( line + ( width - len ( line ) ) *'' ) return returnlist
[ -0.5382699966430664, 0.4620729684829712, 0.7621591687202454, -0.055205799639225006, -0.21296143531799316, 0.32256239652633667, -1.1804999113082886, 0.4433287978172302, 0.8543179035186768, 0.16676810383796692, -0.4048178791999817, -1.2996017932891846, -0.901832103729248, 1.72877037525177, ...
def rank _ sentences ( doc, doc _ matrix, feature _ names, top _ n = 25 ) : sents = nltk. sent _ tokenize ( doc ) sentences = [ nltk. word _ tokenize ( sent ) for sent in sents ] sentences = [ [ w for w in sent if nltk. pos _ tag ( [ w ] ) [ 0 ] [ 1 ] in nouns ] for sent in sentences ] tfidf _ sent = [ [ doc _ matrix [...
[ 0.25440141558647156, 0.1173814907670021, 0.5855550765991211, 0.3190969228744507, -0.4201303720474243, -0.7022117972373962, 0.4409996271133423, -0.05446692556142807, -0.5714830756187439, 0.9796828031539917, -0.10126340389251709, 0.06263221055269241, -0.05384732782840729, 1.016477346420288, ...
def winbio _ winbiolockunit ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " sessionhandle ", " unitid " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value )
[ -0.21793951094150543, -0.626133382320404, 0.37786272168159485, 0.5247494578361511, 0.6526944637298584, 0.8728395104408264, 1.2811092138290405, -0.49609291553497314, 0.37868422269821167, 0.19568957388401031, -0.17042702436447144, 1.2371435165405273, -1.8930593729019165, 0.5109567046165466, ...
def create _ timer ( ) : now = time. time ( ) return now
[ -0.15001700818538666, -0.4082953929901123, 0.5093214511871338, -0.24961087107658386, 0.1379351019859314, -0.11331365257501602, -0.5842071771621704, 0.007061094045639038, -1.2088054418563843, 0.06953440606594086, -0.9225115776062012, -0.5680508613586426, -0.70479416847229, 0.709513008594512...
def clear _ display ( self ) : if self. _ asset : self. _ display. clear ( ) self. _ asset = none
[ 0.46770361065864563, -0.10726262629032135, 0.24744214117527008, -0.6463276743888855, -1.1439474821090698, -0.058633726090192795, 0.5457862019538879, -1.4663008451461792, 0.15176686644554138, -0.22181926667690277, 0.7525793313980103, 1.4106229543685913, 0.35174307227134705, 0.49735599756240...
def inviter ( self ) : return self. _ inviter
[ 0.8343508839607239, -0.5166970491409302, 0.2304777354001999, 0.17981669306755066, -0.3206131160259247, 0.6924768686294556, 0.7122117280960083, 0.7995951771736145, -0.2783155143260956, -0.32549989223480225, -0.3863479793071747, 1.0238409042358398, -1.1823227405548096, -0.2024766057729721, ...
def analyze ( snd, resolution, window _ width = none, verbose = false, * * config ) : partialdata = io. analyze ( snd = snd, resolution = resolution, window _ width = window _ width, verbose = verbose, * * config ) spectrum = fromarray ( partialdata ) assert isinstance ( spectrum, spectrum ) return spectrum
[ 0.48072734475135803, -0.22716856002807617, 0.44685494899749756, 0.6049292087554932, -0.7111393213272095, -0.5088087320327759, -0.30747026205062866, -0.7769449353218079, 0.9169806838035583, -0.9613503813743591, 0.2482282817363739, 0.6308098435401917, -0.6329777240753174, 0.46475425362586975...
def eval ( self, src, mesh, time _ mesh, f ) : # noqa : a003 p = self. getp ( mesh, time _ mesh, f ) f _ part = mkvc ( f [ src, self. projfield, : ] ) return p * f _ part
[ 0.5834564566612244, 0.821090042591095, 0.3000956177711487, -0.07757427543401718, -0.09892993420362473, 0.239776149392128, -0.2773243486881256, 0.12290506064891815, -0.8327862620353699, 0.02912871539592743, 0.2612951993942261, -0.2271675169467926, -0.3473937213420868, -0.018332844600081444,...
def split _ license ( df ) : def _ extract _ uri ( dl ) : dl = get _ descriptors _ uris ( dl, prefix ='https') return dl [ 0 ] if len ( dl ) > 0 else'' def _ extract _ text ( dl ) : dl = get _ descriptors _ text ( dl ) return dl [ 0 ] if len ( dl ) > 0 else'' def _ extract _ access ( dl ) : dl = get _ descriptors _ uri...
[ 0.17950047552585602, 0.4888007938861847, 0.589786171913147, -0.3248044550418854, -0.2145814299583435, -0.4082743525505066, -0.06410714983940125, 1.430966854095459, 0.21062339842319489, 0.21784000098705292, 0.4875650405883789, -0.39290255308151245, -0.25430727005004883, 0.06791368126869202,...
def get ( self, request ) : max _ update _ date = award. objects. all ( ). aggregate ( max ( " update _ date " ) ) [ " update _ date _ _ max " ] response = { " last _ updated " : max _ update _ date. strftime ( " % m / % d / % y " ) } return response ( response )
[ -0.6859391331672668, -0.7978495359420776, 0.6016942858695984, -0.2004503458738327, -0.47938060760498047, -0.03671713545918465, -1.0656952857971191, 0.966572642326355, 0.5866418480873108, 0.7279090285301208, 0.5352575778961182, 0.08818273991346359, 0.8909571170806885, 0.2904345989227295, ...
def _ binary _ flags _ to _ list ( self, flags, n _ models ) : items = [ ] for row in range ( flags. shape [ 0 ] ) : current = [ ] # we loop in reverse ( check left - most bits first ) for i in range ( n _ models, - 1, - 1 ) : # check if bit ` i ` is = = 1 if ( ( 1 < < i ) & int ( flags [ row ] ) ) > 0 : current. appen...
[ -1.3269973993301392, -0.07766198366880417, 0.5112537741661072, 0.7478119134902954, 0.7901285290718079, 0.5693036913871765, 0.45399466156959534, -0.4282105565071106, -0.7318552136421204, 0.9008449912071228, -1.1919128894805908, 0.010873951017856598, -0.8000690340995789, 0.7020647525787354, ...
def gkern ( kernlen = 21, nsig = 3 ) : # create nxn zeros inp = np. zeros ( ( kernlen, kernlen ) ) # set element at the middle to one, a dirac delta inp [ kernlen / / 2, kernlen / / 2 ] = 1 # gaussian - smooth the dirac, resulting in a gaussian filter mask return fi. gaussian _ filter ( inp, nsig )
[ -0.23663966357707977, 0.7807095050811768, 0.47033295035362244, 0.614597499370575, -0.1957935243844986, -0.17778295278549194, 0.26734352111816406, -0.40699243545532227, -0.2449949085712433, -0.3516082465648651, -0.5986358523368835, 0.3992418050765991, -0.36287248134613037, -0.11821525543928...
def get _ team _ rosters ( self ) : rosters = [ ] for team _ name, url in self. team _ roster _ urls ( ). items ( ) : logging. info ( " starting % s : % s ", team _ name, url ) response = self. _ s. get ( url, return _ object = true ) roster = self. _ p. team _ roster ( response ) logging. info ( roster ) rosters. appe...
[ -0.4143299460411072, 0.42206573486328125, 0.3378991186618805, 0.32761019468307495, 0.4953029453754425, 0.17328034341335297, -1.3153672218322754, -0.014910113997757435, -0.2683176100254059, 0.13494126498699188, -1.1489633321762085, 0.2948395311832428, -0.24414674937725067, -0.03857968375086...
def phmmer ( self, * * kwargs ) : logging. debug ( self, kwargs ) args = {'seq': kwargs. get ('seq'),'seqdb': kwargs. get ('hmmdb') } args2 = {'output': kwargs. get ('output ','json'),'range': kwargs. get ('range ', none ) } return self. _ hmmer ( " https : / / www. ebi. ac. uk / tools / hmmer / search / phmmer ", args...
[ -1.2604023218154907, -0.22579114139080048, 0.591786801815033, 0.2735694348812103, -0.38634607195854187, -0.18745559453964233, -0.7325263619422913, -0.17573584616184235, -0.4350827932357788, 0.1292586773633957, -0.34952545166015625, -0.17418280243873596, -1.291588544845581, 1.03652369976043...
def addnode ( self, name, * * opts ) : self. g. add _ node ( name ) self. node _ info [ name ] = opts return name
[ -0.8297315835952759, 0.30135035514831543, 0.5382141470909119, -0.649802029132843, 0.12571385502815247, 0.5367607474327087, -0.4464544951915741, -0.35878172516822815, 0.06936388462781906, -0.03238924965262413, -0.044423654675483704, -0.25637340545654297, -0.2572990655899048, -0.400738328695...
def recv _ event _ loop ( self ) : if not self. is _ connected or not self. conn : raise exception ( " trying to enter game net loop while not connected or no self. conn. " ) while not self. quit _ loop : try : self. recv _ event ( ) except exception, e : import traceback ; traceback. print _ exc ( ) log ( " exception ...
[ 0.7490903735160828, -0.2511809468269348, 0.5661473870277405, -0.013683165423572063, 0.12651276588439941, 0.7361176609992981, -0.3186340034008026, -0.5514363646507263, -0.534902811050415, 0.06491493433713913, 0.38988494873046875, 0.18873357772827148, 0.05601420998573303, -0.1224193945527076...
def _ create _ remove _ rule ( self, package, reason, requirements = none ) : return packagerule ( ( - self. _ pool. package _ id ( package ), ), reason, requirements = requirements )
[ 0.2477922886610031, 0.3622235953807831, 0.19981388747692108, -1.1245192289352417, 0.6804917454719543, 0.374607115983963, -0.9886592626571655, 1.0755339860916138, 0.2489699423313141, 0.41447341442108154, 0.36042582988739014, 0.0633574053645134, -0.7951696515083313, -0.5554094314575195, 0....
def make _ feed _ body ( doc ) : doi ='' if doc. doi is not none : doi = doc. doi return feed _ body. format ( title = doc. title, author = doc. author, doi = doi, upload = doc. get _ format _ date _ string ( ) )
[ 0.20280741155147552, -0.37586143612861633, 0.45800110697746277, -0.23790086805820465, 0.18895962834358215, -0.04473298043012619, -0.3038071095943451, -1.4878618717193604, -0.2431972771883011, -0.1338200718164444, 0.005812267307192087, 0.9596059322357178, 0.2167300283908844, 0.7038173079490...
def test _ psd _ error ( self ) : with self. assertraises ( linalgerror ) : bad _ nbp = singleassetvolcorrcalibration ( factors = [ factor ( 0. 1, 0. 5 ), factor ( 0. 15, 10 ) ], factor _ correlations = { ( 0, 1 ) : 0. 9 } ) bad _ inter _ asset _ correlation = { ( " ukpower _ peak ", " nbp " ) : [ [ 0. 4, 0. 5 ], [ 0. ...
[ 0.7024221420288086, 0.0892675369977951, 0.49427008628845215, -0.06016011908650398, 0.4495592415332794, 0.2392188459634781, -0.10974658280611038, 0.38529282808303833, -0.44894346594810486, -0.27200746536254883, 0.6706284284591675, -0.10197731852531433, -0.7091217637062073, 0.342813849449157...
def step _ timings ( hostname, devicename ) : filename = ('timings / % ( hostname ) s / timing1 _ % ( devicename ) s _ big. pkl'% locals ( ) ) wdb, results, rng = cpickle. load ( open ( filename ) ) return results
[ -0.9749082326889038, 1.8424447774887085, 0.2457498013973236, 0.46950966119766235, -0.5597423315048218, -0.5141501426696777, 0.6343017220497131, 0.9670785069465637, -1.190266489982605, 1.3560503721237183, -0.8210534453392029, -1.078890085220337, -0.15253891050815582, 0.21736866235733032, ...
def interleave ( n, b ) : assert n. bit _ length ( ) < = b out = 0 for i in range ( b ) : x = ( n > > i ) & 1 # x ='i'th bit of'n'row, col = divmod ( i, b / / 4 ) j = col * 4 + row # j = where'i'gets interleaved to if x : out | = 1 < < j return out
[ 0.26033082604408264, 0.6023873686790466, 0.5128597021102905, 0.4409487843513489, -0.006319743115454912, -0.2930728495121002, 0.56900954246521, -0.16474927961826324, 0.12232145667076111, -0.03081432357430458, -0.3743993043899536, -0.45156604051589966, -1.852980375289917, -0.2134532481431961...
def run _ sharectl ( * args ) : fake _ stdout = io. stringio ( ) try : with redirect _ stdout ( fake _ stdout ) : execute _ cmd ( args ) except systemexit : pass # success! return fake _ stdout. getvalue ( )
[ 0.2590700685977936, -0.22529394924640656, 0.7810861468315125, 0.5472062826156616, 0.16033166646957397, 0.35290461778640747, 0.8885192275047302, -0.544327974319458, 0.046588342636823654, -0.9502611756324768, -0.22969941794872284, -0.0793323889374733, -0.655860960483551, -0.34449681639671326...
def onassetmodified ( self, filepaths ) : for filepath in filepaths : # bail if the path is a directory. if os. path. isdir ( filepath ) : continue pandapath = pm. filename. fromosspecific ( filepath ) # test if the file path represents an asset in one of panda's # asset pools. if pm. texturepool. hastexture ( pandapat...
[ -0.4637402296066284, -0.8052945137023926, 0.4423244595527649, 0.03477781265974045, 0.7781857848167419, -0.4303946793079376, 0.6333678364753723, -0.7015479803085327, 0.07762279361486435, -0.13156142830848694, 0.33582037687301636, 0.1370282769203186, 0.6083682179450989, -0.08128491044044495,...
def predict _ ite ( self, x : np. array, t : np. array = none, y : np. array = none, return _ components : bool = false, replace _ factuals : bool = false, ) - > singlecomp : y _ 0 = self. learner _ c. predict ( x ) y _ 1 = self. learner _ t. predict ( x ) if return _ components : if t is not none and y is not none and...
[ -0.4607163071632385, -0.9114723205566406, 0.7875262498855591, -0.39611467719078064, 0.2429966926574707, 0.6915786266326904, -0.021632961928844452, 0.5921434760093689, -0.9339309930801392, 0.6415805816650391, 0.1823759824037552, 0.3221852779388428, 0.21890440583229065, -0.2260088175535202, ...
def get _ payloads ( self ) : options = self. options # payloading sources payloads _ fuzz = libs. xsscan. fuzzing. vectors. vectors payloads _ dcp = libs. xsscan. fuzzing. dcp. dcpvectors payloads _ dom = libs. xsscan. fuzzing. dom. domvectors payloads _ httpsr = libs. xsscan. fuzzing. httpsr. httprs _ vectors manual ...
[ -0.2045719176530838, 0.4484851658344269, 0.6574496626853943, -0.21673773229122162, 0.15133576095104218, -0.6947548389434814, -0.8276691436767578, -0.5071520209312439, 0.28553682565689087, -0.3187876343727112, 0.0663800835609436, -0.5074908137321472, 0.339508593082428, 1.3701480627059937, ...
def opponent ( self ) : return " w " if self. player = = " b " else " b "
[ -0.6007628440856934, -0.5068454742431641, 0.8569846749305725, 0.10770296305418015, -0.37321704626083374, 0.5314573049545288, 0.4199186861515045, 0.2549547553062439, 0.5770753622055054, 0.6896440982818604, 0.8474553823471069, -0.21713818609714508, -0.7089508771896362, -0.20312798023223877, ...
def to _ json ( self ) : attrs = ['record _ id ','creation _ time ','last _ update ','active'] json = dict ( ) for a in attrs : json [ a ] = getattr ( self, a ) json ['ehr _ records'] = [ ] for e in self. ehr _ records : json ['ehr _ records']. append ( e. to _ json ( ) ) return json
[ -0.828010082244873, -1.1787132024765015, 0.5565068125724792, -0.9948252439498901, 0.35326385498046875, -0.3625180423259735, 0.02138054557144642, 0.09110039472579956, 0.10149405151605606, 0.4267888069152832, -0.8016831278800964, 0.0946299135684967, 0.6559068560600281, 0.690848171710968, 0...
def get _ bday ( ) : valid = false while not valid : birthdate = input ( " please enter your birth date as day, month, year! " ) try : birthdate = str. split ( birthdate, ", " ) day, month, year = [ int ( n ) for n in birthdate ] calculator = birthday _ calc. birthdaycalc ( day, month, year ) check _ legit ( calculator...
[ 0.47910234332084656, -0.0929713025689125, 0.7208276987075806, 0.6500405073165894, -0.045279406011104584, 0.47840335965156555, -0.01808343641459942, -0.5643189549446106, -0.5003938674926758, -1.127450704574585, 0.533790111541748, 0.608726441860199, -0.604855477809906, 0.18197625875473022, ...
def closest _ points _ 2 ( points ) : small = distance ( points [ 0 ], points [ 1 ] ) i1 = 0 i2 = 1 for i in range ( len ( points ) ) : for j in range ( i + 1, len ( points ) ) : dist = distance ( points [ i ], points [ j ] ) if dist < small : small = dist i1 = i i2 = j return small, i1, i2
[ -0.1054220199584961, -0.7657251954078674, 0.7070899605751038, 0.40509164333343506, -1.250235676765442, 0.14846356213092804, 0.25256362557411194, -0.4193335771560669, -0.7273382544517517, 0.7897523045539856, -1.5602360963821411, -0.0003098357701674104, -0.30945149064064026, -0.4113406538963...
def filter _ data ( dfs, patient _ ids ) : logging. info ('filtering visit data') results = [ df. loc [ df. index. intersection ( patient _ ids ) ] for df in dfs ] logging. info ('results are tables with shapes { } '. format ( [ x. shape for x in results ] ) ) return results
[ -0.22625243663787842, 1.0806221961975098, 0.558151364326477, 0.1731138974428177, 0.199335977435112, -0.6649500131607056, 0.5551587343215942, 0.24604490399360657, -1.0456782579421997, 0.5545447468757629, 0.9513166546821594, -0.016187971457839012, 0.31559810042381287, -0.4098827540874481, ...
def issuer ( self ) - > optional [ str ] : return pulumi. get ( self, " issuer " )
[ 0.8997663855552673, -0.2619583010673523, 0.7035248875617981, 0.48558881878852844, 0.020379791036248207, 1.0017973184585571, 0.33673015236854553, 0.8480333089828491, 0.8389946818351746, -0.6056395769119263, 0.7896852493286133, 0.1712408810853958, 0.26770108938217163, -1.0871728658676147, ...
def calc _ temp ( velocities, positions, masses ) : n = len ( velocities ) e _ kinetic = np. zeros ( n ) for i in range ( n ) : e _ kinetic [ i ] = 0. 5 * masses [ i ] * np. dot ( velocities [ i, : ], velocities [ i, : ] ) temp = 2 / ( 3 * n ) * np. sum ( e _ kinetic ) return temp
[ 0.37003520131111145, -0.011888021603226662, 0.2680683434009552, 0.3021196126937866, 0.3480345904827118, -0.2029738873243332, 0.12713375687599182, 1.0142133235931396, -0.36413809657096863, 1.356851577758789, -0.9994911551475525, -0.9662200212478638, -0.14886362850666046, 0.28068044781684875...
def index ( request ) : user = users. get _ current _ user ( ) bookmarks = db. gqlquery ('select * from bookmark order by created desc') return respond ( request, user,'list. html ', {'bookmarks': bookmarks } )
[ 0.3590831160545349, 0.11789380013942719, 0.24999698996543884, 1.0649831295013428, 1.0378880500793457, 0.06194835156202316, 0.7583383321762085, 0.11166056990623474, -0.6398634910583496, -0.4298022985458374, 0.2259080410003662, 1.0053935050964355, 0.6312170624732971, 0.2730132043361664, -0...
def main ( ) : conn = sqlite3. connect ( tweets _ db ) cur = conn. cursor ( ) cur. execute ( " drop table if exists tweets " ) cur. execute ( " " " create table tweets ( id integer primary key, tweet _ id integer not null, target text not null, insert _ timestamp text not null, full _ text text, processed _ text text, ...
[ 0.368358850479126, -0.11846394836902618, 0.7800719141960144, -0.050941918045282364, 1.2171072959899902, -0.10915298014879227, 0.19080103933811188, 0.10480643808841705, -0.2689787447452545, 0.5082523822784424, 0.28946226835250854, -0.13266979157924652, -0.5581490397453308, -0.01651817187666...
def _ _ call _ _ ( self, function : _ callabletype ) - > _ callabletype : self. function = function def wrapped ( * args, * * kwargs ) : if self. enabled : return self. patched _ function ( * args, * * kwargs ) else : return function ( * args, * * kwargs ) async def async _ wrapped ( * args, * * kwargs ) : if self. ena...
[ -0.6485239267349243, 0.19358639419078827, 0.852877676486969, -0.4207713305950165, -0.3443889021873474, -0.07178546488285065, -0.2012297660112381, -0.05703737959265709, 0.3111521601676941, 0.203017458319664, 0.6146867871284485, 0.49736130237579346, -0.5403114557266235, 0.11323890089988708, ...
def show _ loading _ icon ( self ) : # the loading popup will remain onscreen until the stop loading function is called. call this before a large operation, and call # stop after the operation is finished. note that for these long operations, you must use a different thread # to not block the draw calls. self. master. ...
[ 0.5349935293197632, 1.2004724740982056, 0.7893245816230774, -0.5020414590835571, -0.7879770398139954, -0.05824015662074089, 0.415041446685791, 0.9894163012504578, -0.5074141621589661, 0.08807579427957535, -0.6894809603691101, 0.002308786381036043, -0.04509885609149933, -0.4727320373058319,...
def _ run _ run ( run ) : res = _ execute ( run. command ) # check return codes if ( res. returncode not in run. allowed _ return _ codes and run. allowed _ return _ codes! = [ ] ) : _ print _ warning ( " unexpected return code for command : " + res. args + " \ n " + res. stderr. strip ( ) + " " ) return if run. stdout...
[ -0.2139047533273697, -0.8306512236595154, 1.155497431755066, 0.7908186912536621, 0.18665187060832977, -0.3103264272212982, 0.570039689540863, -0.46958157420158386, -0.45190319418907166, 0.0539882592856884, 0.3364119827747345, 0.04256538674235344, -0.2361147403717041, 0.1834937483072281, ...
def _ _ eq _ _ ( self, other ) : return type ( other ) = = type ( self ) and self. n = = other. n and \ self. m = = other. m and \ self. from _ grid = = other. from _ grid and self. to _ grid = = other. to _ grid
[ -0.3747645318508148, -0.5968363285064697, 0.743586540222168, 0.3274111747741699, 0.12460488080978394, 0.08976268768310547, 0.31560516357421875, -1.0311510562896729, 0.3771872818470001, -0.07015439122915268, -0.27597901225090027, 0.4767303466796875, -0.16067515313625336, -0.0366000346839427...
def define ( self, name, value = none, choices = none ) : self. scopes [ - 1 ] [ name ] = definitionentry ( value, choices )
[ -0.423364520072937, -0.1111593097448349, 0.5280641913414001, 0.0010670415358617902, 0.5660167336463928, -0.41575148701667786, -0.5037255883216858, -0.45471805334091187, 0.47396767139434814, 0.48069700598716736, -0.7265269160270691, 0.51580810546875, -0.027261337265372276, 0.880377650260925...
def plot ( self ) : self. c _ logger. info ( " starting to plot the figure onto tk canvas. " ) canvas = figurecanvastkagg ( self. plotterobj, master = self. main _ window ) self. c _ logger. info ( " the figure has been plotted onto tk canvas successfully. " ) self. c _ logger. debug ( " the'figurecanvastkagg'object : ...
[ 0.7501847743988037, 0.9376298785209656, 0.4489396810531616, -0.3092130720615387, -0.20873256027698517, -0.0061981272883713245, 0.8048949241638184, -0.15231536328792572, -0.8624206781387329, -0.7097122073173523, -0.20804554224014282, -0.01394969504326582, 0.45423856377601624, 1.308431863784...
def keys ( self ) : return self. listexperiments ( ) ['name']
[ -0.6975597143173218, 0.1742222011089325, 0.3228055536746979, -0.07154904305934906, -0.09571196138858795, -0.019543999806046486, -0.39826861023902893, 0.23948442935943604, 0.39487871527671814, 1.1588491201400757, 0.03319640830159187, 0.37218642234802246, -0.5806364417076111, 0.2387071102857...
def get ( user _ id, self, productid ) : product = product. get _ product _ by _ id ( dict _ cursor, productid ) if product [ " user _ id " ]! = str ( user _ id ) : api. abort ( 401, " unauthorized to view this product " ) return product
[ 0.13275384902954102, -0.8127097487449646, 0.1863684058189392, 1.352778673171997, -0.030946621671319008, 0.36409416794776917, 0.06784713268280029, -1.1599090099334717, 0.7651007175445557, 0.07439121603965759, 0.9546149969100952, 1.7025240659713745, -0.2472740262746811, -0.6337203979492188, ...
def run _ turn ( self, turn _ number ) : if treatment _ movement : self. move ( ) if self. city. infected < = self. treatment _ remaining : self. treatment _ remaining - = self. city. infected self. city. cured + = self. city. infected self. city. infected = 0 else : self. city. cured + = self. treatment _ remaining se...
[ -0.45900702476501465, -1.0398364067077637, 0.5793384909629822, -0.7150916457176208, 0.4320087432861328, -0.15979793667793274, 0.8910838961601257, 0.1742081642150879, 0.3263390362262726, -0.679797887802124, -0.3659713864326477, -0.17441265285015106, -0.4935585856437683, -0.605070173740387, ...
def nodes _ in _ tree ( self ) - > list : stack = [ self ] nodes = [ ] while stack : item = stack. pop ( 0 ) nodes. append ( item ) stack + = item. children return nodes
[ -0.4843984544277191, 0.20705311000347137, 0.32907283306121826, 0.37383994460105896, 0.5687594413757324, -0.5093212127685547, -0.10666969418525696, 0.5658043026924133, -0.17117668688297272, 0.7681824564933777, -0.9551982879638672, 0.5430793762207031, -0.42219388484954834, 0.1833460330963134...
def getconnectionvertices ( side ) : connvertexdict = { } for connside in hexsideinitializer. getallconnectedsides ( side ) : if side. endpoints [ 0 ] in connside. endpoints : connvertexdict [ connside. id ] = side. endpoints [ 0 ] elif side. endpoints [ 1 ] in connside. endpoints : connvertexdict [ connside. id ] = si...
[ -0.07653611153364182, -0.5134320259094238, 0.6387143135070801, -0.48848751187324524, -0.3104136884212494, -0.31724047660827637, -0.8119868636131287, 0.051263172179460526, -0.0071403272449970245, 0.5651500225067139, -1.2231109142303467, -0.8106730580329895, -0.58787602186203, 0.198872759938...
def reveal ( self, win ) : if self. is _ mine : icon = [ gif ['mine'], gif ['flag'] ] relief = ['sunken ','raised'] self. config ( image = icon [ win ], relief = relief [ win ] ) self. clicked = true elif self. mark = = 2 : # if flagged : self. config ( image = gif ['wrong'], relief ='sunken')
[ -0.6892398595809937, 0.5735764503479004, 0.3568095862865448, -0.008678264915943146, 0.5050627589225769, 0.00013015854347031564, 0.7860265970230103, 0.8923786878585815, 0.08511240780353546, 0.3448554277420044, -0.20482365787029266, 0.501001238822937, -0.41736480593681335, 0.9712063074111938...
def valid _ values ( cls ) : return [ ]
[ -0.4662487506866455, -0.3216188848018646, 0.3210541307926178, 0.8157848715782166, 0.7682278752326965, 1.254005789756775, -0.9721748232841492, 0.5113856196403503, -0.02103467844426632, -0.7087081074714661, -1.2263505458831787, 0.10924052447080612, 0.17534297704696655, 1.0875122547149658, ...
def quasi _ constant _ features ( x _ train, x _ test, threshold = 0. 98 ) : # create empty list quasi _ constant _ feature = [ ] # loop over all the columns for feature in x _ train. columns : # calculate the ratio. predominant = ( x _ train [ feature ]. value _ counts ( ) / np. float ( len ( x _ train ) ) ). sort _ v...
[ 0.4524214267730713, -0.1542453020811081, 0.6044962406158447, -0.04797268286347389, 0.3198840022087097, -0.18499168753623962, -0.4251926839351654, 0.9462473392486572, -0.7052026987075806, 0.7857963442802429, -0.4332657754421234, 0.01687050051987171, 0.01193594466894865, -0.6582647562026978,...
def topoplot _ snr ( self, collapse _ epochs = true, flims ='stimulation ', * * kwargs ) : # find out over which range ( s ) to collapse : fmins, fmaxs = self. _ get _ flims ( flims ) if len ( fmins. flatten ( ) ) > 1 : topodata = [ np. stack ( [ self. _ get _ snr ( freq ) for freq in self. freqs if freq > fmin and fre...
[ -0.563507080078125, 0.8378869295120239, 0.9171448349952698, 0.08481579273939133, -0.5707038640975952, -0.33541256189346313, 0.24786564707756042, 0.013294528238475323, 0.13394573330879211, -0.09781347960233688, 0.10482876002788544, 0.49705204367637634, 0.32922816276550293, 0.222376093268394...
def _ _ str _ _ ( self ) : if is _ string ( self. name ) : return to _ printable _ id ( self. name ) + " = " + _ to _ string ( self ) else : return _ to _ string ( self )
[ -0.4629753828048706, -1.055491328239441, 0.5139549970626831, -0.6828839182853699, -0.48913243412971497, 0.344747930765152, -0.7611265182495117, -1.3369027376174927, 0.8547842502593994, 0.5284395217895508, 0.44921067357063293, 0.7138940095901489, -0.17998643219470978, -0.3531702160835266, ...
def test _ match _ found ( self, basic _ logfile ) : matcher = logmatcher ( log _ path = basic _ logfile ) regex _ exp = re. compile ( r " second " ) match = matcher. match ( regex = regex _ exp ) assert match is not none assert match. group ( 0 ) = = " second "
[ 1.0073940753936768, -0.3619646430015564, 0.7029237747192383, 0.12129488587379456, 0.6720584034919739, 0.1699993759393692, -0.26037731766700745, -0.0864335373044014, -0.7452016472816467, -1.4417160749435425, -0.5432223677635193, -0.3162705898284912, -0.09640584141016006, -0.0562924072146415...
def subtitles _ episode ( self, id, language ='all') : params = urllib. urlencode ( {'id': id,'language': language } ) url = self. build. url ( " / subtitles / episode ", params ) return self. build. data ( url )
[ -0.622431218624115, -0.15163268148899078, 0.4576789140701294, -0.018434099853038788, -0.37471383810043335, -0.6896176934242249, -1.9588217735290527, 0.17902475595474243, 0.09631145745515823, 0.8162055611610413, -0.7552670240402222, 0.845618486404419, -0.5865767002105713, -0.821842014789581...
def find _ squares ( self, img ) : ret, img = cv2. threshold ( img, 0, 255, cv2. thresh _ binary + cv2. thresh _ otsu ) img = cv2. gaussianblur ( img, ( 3, 3 ), 3 ) img = cv2. erode ( img, none ) img = cv2. dilate ( img, none, iterations = 2 ) squares = [ ] for thrs in range ( 0, 255, 51 ) : if thrs = = 0 : bin = cv2. ...
[ -0.4298843741416931, -0.6589963436126709, 1.051161527633667, 0.8922984004020691, -0.15888895094394684, -0.5839492082595825, 0.8461769223213196, -0.6073788404464722, 0.7026722431182861, 0.5266693234443665, -0.685983419418335, -0.7937718033790588, 0.5153137445449829, 1.1577975749969482, 0....
def transform _ local ( f, p ) : a = f [ 2 ] t = f [ 0 : 2 ] r = np. array ( [ [ cos ( a ), - sin ( a ) ], # rotation matrix [ sin ( a ), cos ( a ) ] ] ) p = r. t. dot ( p - t ) p _ x, p _ y = p x, y = t j _ f = np. array ( [ [ - cos ( a ), - sin ( a ), cos ( a ) * ( p _ y - y ) - sin ( a ) * ( p _ x - x ) ], [ sin ( a...
[ 0.3082015812397003, -1.0309290885925293, 0.6789588928222656, -0.8726205229759216, 0.37211379408836365, -0.17551280558109283, 0.09723851084709167, 0.9882665872573853, -0.9485313892364502, 0.9790745973587036, -0.5320630669593811, -0.47875410318374634, 0.12416718155145645, -0.7375720143318176...
def mark _ job _ as _ completed ( job _ id, data = none ) : update _ dict = { " status " : " complete ", " data " : json. dumps ( data ), " finished _ timestamp " : datetime. datetime. now ( ), } _ update _ job ( job _ id, update _ dict )
[ -0.6321600079536438, -0.5928508043289185, 0.4112306833267212, 0.04023106396198273, 0.09108015894889832, -0.6810511946678162, -0.5756673812866211, 0.3164622485637665, 0.19197839498519897, 0.5640798807144165, -1.3853379487991333, 0.7758351564407349, 0.1486622393131256, 0.559287965297699, 0...
def do _ update ( self, node _ id ) : _ error _ code = 0 _ msg ='' _ code, _ message = self. dtm _ hardware. do _ update ( node _ id ) if _ code! = 0 : _ error _ code + = _ code _ msg = _ msg + _ message +'\ n'_ code, _ message = self. dtm _ reliability. do _ update ( node _ id ) if _ code! = 0 : _ error _ code + = _ c...
[ -0.6052407026290894, 0.16917817294597626, 0.9560571312904358, -0.3839019238948822, 0.28338783979415894, 0.05296054854989052, 0.3248005211353302, -0.12418056279420853, -0.9812528491020203, 1.0914280414581299, 0.05089744180440903, 0.20023448765277863, -1.1231629848480225, 0.8462258577346802,...
def get _ match _ before ( row _ df _ qa, df _ diff ) : idxs = [ ] are _ correct = [ ] for i in range ( len ( df _ diff ) ) : curr _ row = df _ diff. iloc [ i ] if ( curr _ row ['id']. strip ( ) = = row _ df _ qa ['id']. strip ( ) ) or ( row _ df _ qa ['id']. strip ( ) = ='all') : if row _ df _ qa ['kata yang salah']. ...
[ -0.2127750664949417, -0.5908531546592712, 0.8626943826675415, 0.2703021764755249, -0.6993623971939087, -0.17824578285217285, 0.8661543130874634, 0.286246120929718, 0.13325706124305725, 0.269075483083725, 0.10375042259693146, 0.15619675815105438, 0.20329029858112335, 0.5240111351013184, 0...
def load _ data ( path ) : if not path. endswith ( '. yml') : path ='% s. yml'% path fullpath = os. path. join ( data _ dir, path ) with open ( fullpath ) as file : return yaml. load ( file )
[ 0.7109003663063049, -0.0006679773214273155, 0.5001642107963562, -0.7402094602584839, -0.7994791865348816, 0.1698252409696579, -0.1080755665898323, -0.18305055797100067, -0.011341148987412453, -0.39940282702445984, -0.20275747776031494, 0.9891327023506165, 0.3539537191390991, 0.001029661973...
def _ _ call _ _ ( self ) : return self. template ( )
[ -0.7702895998954773, -0.7055823802947998, 0.36675262451171875, -0.7458776235580444, -0.8121641874313354, -0.5586090087890625, -0.2705053389072418, 0.2097441703081131, 0.12591233849525452, -0.8657622337341309, -0.3159465789794922, -0.5640875697135925, -0.6763009428977966, -0.618165493011474...