text
stringlengths
25
2.19k
embedding
listlengths
768
768
def test _ duplicate _ contacts ( self ) : # validate a form with duplicate ` ` name ` ` values form = self. form _ data ( name _ 0 = " david mcquire ", email _ 0 = " info @ specterops. io ", phone _ 0 = " ( 555 ) 555 - 5555 ", job _ title _ 0 = " ceo ", note _ 0 = " a note about this contact ", name _ 1 = " david mcqu...
[ -0.2257004976272583, -0.20179496705532074, 0.5453239679336548, -0.22444283962249756, 0.23718588054180145, 0.14334161579608917, 0.09878932684659958, -0.8325204253196716, 0.03577634319663048, -0.4424944221973419, -0.8314300775527954, -0.4945977032184601, 0.5442076921463013, 0.042851235717535...
def create _ label ( self, color : str = " ", alignment : int = qtcore. qt. alignleft ) - > qtwidgets. qlabel : label = qtwidgets. qlabel ( " - " ) if color : label. setstylesheet ( f " color : { color } " ) label. setalignment ( alignment ) return label
[ 0.19061075150966644, -0.7351577877998352, 0.34373942017555237, -0.7326950430870056, 0.23017963767051697, 1.3781490325927734, -1.2391151189804077, -0.4688686430454254, 0.4667486250400543, 0.1168830469250679, 0.6544259786605835, -0.3384053409099579, 0.19663535058498383, 0.1900283396244049, ...
def set _ speed ( self ) : angle = self. _ _ help. angle _ to _ radians ( self. _ _ angle ) self. _ _ speed _ x + = speed _ factor * math. cos ( angle ) self. _ _ speed _ y + = speed _ factor * math. sin ( angle )
[ 0.09844011068344116, 0.09906447678804398, 0.3089892566204071, -0.35771146416664124, 0.7913015484809875, 0.1070690006017685, 0.161441832780838, -0.34489232301712036, -0.8717127442359924, -0.23048049211502075, -0.2180907130241394, 0.4795745611190796, -0.008169061504304409, 0.1158740296959877...
def post _ replace _ jacobian ( post _ replacements ) : dim = len ( post _ replacements ) mask = post _ replacements > = 0 positions _ in = post _ replacements [ mask ] positions _ out = np. arange ( dim ) [ mask ] jacobian = np. eye ( dim ) jacobian [ positions _ out, : ] * = 0 jacobian [ positions _ out, positions _ ...
[ -0.5055393576622009, -0.8288677930831909, 0.2503301501274109, -0.3375362157821655, -0.9908686280250549, -0.13994574546813965, 0.7117593288421631, 0.8246192336082458, -0.2179383635520935, -0.1760244518518448, -0.7584672570228577, 0.46828243136405945, -0.3677956163883209, 0.00576288718730211...
def lasso _ wrapper ( df, obj, chosen _ alpha ) : coef _ data = findfeatures ( df, obj, chosen _ alpha ) tryagain ='y'while tryagain = ='y': tryagain = input ('would you like to attempt another alpha? ( y / n ) :') if tryagain = ='y': new _ alpha = float ( input ('please input the new alpha :') ) coef _ data = findfeat...
[ -0.17576101422309875, -0.7401278614997864, 0.6230648159980774, 0.9362732768058777, 0.09449083358049393, -0.19251371920108795, 0.8209881782531738, -1.0516473054885864, 0.12890861928462982, -0.22847168147563934, -0.6097707748413086, 0.7676830291748047, 0.141077920794487, -0.01912112906575203...
def runtool ( cmdln _ or _ args, catch = 1 ) : if catch not in ( 0, 1, 2, 3 ) : # invalid catch selection, will cause exception, that's good return none if isinstance ( cmdln _ or _ args, list ) : cmd = cmdln _ or _ args [ 0 ] shell = false else : import shlex cmd = shlex. split ( cmdln _ or _ args ) [ 0 ] shell = true...
[ 0.23319213092327118, -0.7419883608818054, 0.8229690194129944, 0.33385172486305237, -0.41003313660621643, -0.28619542717933655, 0.6775695085525513, 0.11208092421293259, 0.20558062195777893, -0.33573469519615173, 0.6468409895896912, -0.3237249553203583, 0.23316684365272522, 0.299679040908813...
def runtest ( self ) : self. setup ( ) self. test _ graphcutsegmentselftest1 ( )
[ -0.17845743894577026, -0.215100958943367, 0.3031940758228302, 0.974938154220581, 0.8541684150695801, -0.0017698517767712474, 2.2918686866760254, -0.785330057144165, 0.34965452551841736, -0.3660196363925934, -0.2620549499988556, -0.029177306219935417, -0.7516617774963379, -0.490933448076248...
def test _ error _ nonstrval ( self ) : obj = { 1 :'here'} self. assert _ raises ( valueerror, self. instance. serialize, obj )
[ -0.40694910287857056, 0.08728856593370438, 0.44950777292251587, -0.5733590722084045, -0.10871976613998413, 0.5299025177955627, -0.8103696703910828, -0.2604943513870239, 0.33654969930648804, 0.09372524172067642, -1.0371636152267456, 0.12080424278974533, -1.0606046915054321, 0.27048233151435...
def authentication _ callback ( request ) : code = request. get. get ('code') args = {'client _ id': settings. facebook _ app _ id,'client _ secret': settings. facebook _ app _ secret,'redirect _ uri': request. build _ absolute _ uri ( settings. site _ url +'facebook / authentication _ callback /'),'code': code, } # ge...
[ -0.09826144576072693, 0.4396553933620453, 0.8488480448722839, 0.9255043268203735, 0.6661571860313416, -0.2420399934053421, 0.6761550307273865, -0.11451985687017441, 0.5534841418266296, -0.15195751190185547, -0.5256706476211548, -0.4825815260410309, -0.10848782956600189, -0.1310966014862060...
def check _ subscription ( self, subscription _ id ) : action = " check subscription # % s " % subscription _ id db = current. db s3db = current. s3db stable = s3db. fin _ subscription row = db ( stable. id = = subscription _ id ). select ( stable. refno, stable. status, stable. status _ date, limitby = ( 0, 1 ), ). fi...
[ 0.5437580347061157, -0.5695198178291321, 0.8584197163581848, 0.36554479598999023, -0.5359927415847778, -0.23320689797401428, -0.38035646080970764, -0.5262531042098999, 0.5467982888221741, 0.4063242971897125, 0.20719003677368164, 0.2373315393924713, -0.22908933460712433, 0.4562946557998657,...
def note _ list _ all _ parts ( self, measure _ start, num _ measures ) : pure _ notes = [ ] parts = self. score. getelementsbyclass ( stream. part ) for part in parts : measures = part. getelementsbyclass ( stream. measure ) measures _ selected = [ ] for i in range ( num _ measures ) : measures _ selected. append ( me...
[ 0.14100141823291779, -0.9762153029441833, 0.7455427050590515, 0.16355234384536743, 0.3519546687602997, 0.5561281442642212, -0.14063209295272827, -0.5895093083381653, 0.423478364944458, 0.11803378909826279, 0.032530829310417175, 0.14543268084526062, -0.18366152048110962, 0.3371371924877167,...
def _ _ delitem _ _ ( self, key ) : try : return self. _ execute _ script ('delete ', self. key, key ) except responseerror : raise indexerror ( " index out of range. " )
[ -0.6085076928138733, 0.5100886225700378, 0.5216227173805237, 0.34037306904792786, -0.22641699016094208, -0.7135010957717896, -0.015361183322966099, -0.8644697070121765, 0.0979248434305191, 0.40188854932785034, 0.6140012741088867, -0.08502557128667831, -0.8130065202713013, -0.63833051919937...
def heatmap ( self, camera _ id, from _ date, to _ date, report _ type ) : log _ dir = os. getenv ('logdirectory') heatmap _ resolution = os. getenv ('heatmapresolution'). split ( ", " ) heatmap _ x = int ( heatmap _ resolution [ 0 ] ) heatmap _ y = int ( heatmap _ resolution [ 1 ] ) file _ path = os. path. join ( log ...
[ -0.19455298781394958, -0.60871821641922, 0.9269412755966187, -0.2090688794851303, 0.9286133646965027, -0.13170014321804047, -0.1394229233264923, 0.09363318979740143, -0.0535733699798584, 0.491656094789505, -0.28625887632369995, 0.3817915916442871, 0.4775052070617676, 0.25519347190856934, ...
def lemma _ sentences ( job _ description ) : sentences = sent _ detector. tokenize ( job _ description ) return [ stopword _ removal ( lemmatize ( tokenize ( sentence ), english _ lemmas ) ) for sentence in sentences ]
[ -0.11065700650215149, -0.2041437327861786, 0.503002941608429, 0.2196384072303772, -0.11934912949800491, -0.5660030245780945, -1.5284062623977661, 1.2243876457214355, -0.8337282538414001, 1.2237788438796997, -0.16124227643013, 0.042995259165763855, -0.20396797358989716, 1.3481980562210083, ...
def get ( self, author _ name, post _ id ) : # todo add check user = = comment _ author self. render _ params ['edit _ id'] = self. request. get ('cid') self. render _ params ['comments'] = comment. comment. \ by _ post ( self. render _ params ['post'] ) self. render ( " comments. html ", * * self. render _ params )
[ 0.540223240852356, -0.42730456590652466, 0.44569170475006104, 0.7606426477432251, 0.8443425893783569, -0.09878931194543839, -0.12896494567394257, 0.45382872223854065, -0.5739012360572815, 0.116177037358284, 0.8487439155578613, 0.2927829921245575, -0.038979992270469666, 0.2433759868144989, ...
def initialise ( cls, arccen, lamps, slits, slit = 0, par = none, wv _ calib _ all = none, wavelim = none, nonlinear _ counts = none, test = false, pxtoler = 0. 1, fwhm = 4., specname = " ", y _ log = true, sigdetect = none, rescale _ resid = false ) : # double check that a wavelengthsolutionpar was input par = pypeitp...
[ 0.7077646255493164, -0.7236281633377075, 0.6450628638267517, 0.1563398540019989, 0.01720385067164898, -0.25396278500556946, 0.12141434848308563, -0.028006892651319504, 0.4011782109737396, -0.31892430782318115, 0.17569023370742798, 0.17541785538196564, 0.5139249563217163, 0.8983333706855774...
def getvoxelcroppingregionplanes ( self ) :...
[ 0.39594346284866333, 0.480493426322937, 0.44204774498939514, 1.2808456420898438, -0.33134278655052185, 0.4355621039867401, -0.29551154375076294, -0.7783979773521423, 0.5016361474990845, 0.3523118197917938, 0.049283407628536224, 0.28318682312965393, -0.24484364688396454, 0.16413003206253052...
def _ feature ( values : union [ float, int, str, np. ndarray ] ) - > " tf. train. feature " : if isinstance ( values, np. ndarray ) : if values. dtype = = np. dtype ( float ) : return _ float _ feature ( values ) elif values. dtype = = np. int64 : return _ int64 _ feature ( values ) elif values. dtype = = np. dtype ( ...
[ -0.2506459951400757, -0.27552783489227295, 0.5218290090560913, 0.5117835402488708, 0.11506415158510208, -0.6058333516120911, 0.20791397988796234, -0.6984366178512573, 0.32099390029907227, -0.5516666173934937, -0.15817536413669586, 0.9738641977310181, -0.25766614079475403, 0.243280962109565...
def _ ac _ check ( r, a, start = 0, total = 0 ) : if start > = len ( a ) : return total % r = = 0 if start = = 0 : return _ ac _ check ( r, a, 1, r / / a [ 0 ] ) for i in xrange ( 1, a [ start ] ) : if gcd ( i, a [ start ] ) = = 1 : result = _ ac _ check ( r, a, start + 1, total + i * r / a [ start ] ) if result : retu...
[ -0.10536816716194153, 0.10132214426994324, 0.7774183750152588, -0.1979343593120575, -0.5616722702980042, -0.5286506414413452, 1.315752387046814, -0.4867556393146515, 0.7589936852455139, 0.9175112247467041, 0.9233458638191223, -0.2821589410305023, -0.4423934519290924, -0.07788653671741486, ...
def note _ list _ selected _ beats ( self, beats : list ) : pure _ notes = [ ] parts = self. score. getelementsbyclass ( stream. part ) for part in parts : notelist = part. flat. getelementsbyclass ( ['note ','rest'] ) for note in notelist : if note. beat in beats : note _ obj = notelistelement ( note, self. score. met...
[ -0.5802344083786011, -0.46249282360076904, 0.6120902895927429, 0.9156086444854736, 0.05542941018939018, 0.8618001341819763, 0.3873220384120941, -0.7699654698371887, 0.354208379983902, 0.21595469117164612, -0.7245880365371704, 0.5421164631843567, -0.6047560572624207, -0.09960677474737167, ...
def error _ 404 ( error ) : return'sorry, nothing at this url. '
[ -1.3158645629882812, -0.54144686460495, 0.14258728921413422, -0.4076414704322815, 0.36156508326530457, 0.027098113670945168, -0.23682428896427155, 0.033072326332330704, -0.02946019545197487, 0.15994904935359955, -0.20457182824611664, 0.13424666225910187, -0.049320973455905914, -0.232063800...
def wait _ for _ create _ menu ( self ) : return self. wait _ for _ element _ to _ be _ clickable ( self. create _ poll, message ='+ create menu is not clickable')
[ -0.9414043426513672, 0.6347966194152832, 0.2873338460922241, 0.6150122284889221, 0.6522048711776733, 0.948434054851532, 0.1423928439617157, -0.0525812953710556, -0.7610126733779907, -0.6071239709854126, 0.3111226558685303, -0.597507119178772, -0.9547812342643738, 0.35443636775016785, 0.0...
def pad _ sequence ( sequences, len _ list, pad _ to = none, padding _ value = 0 ) : max _ len = np. max ( len _ list ) if pad _ to is none else pad _ to min _ len = np. min ( len _ list ) device = sequences [ 0 ]. device if max _ len = = min _ len : result = torch. cat ( sequences, dim = 0 ). view ( - 1, max _ len ) e...
[ -0.3188323676586151, 0.5112695693969727, 0.7123639583587646, 0.5137065052986145, -0.3217381238937378, -0.27932795882225037, -0.36037713289260864, 0.7707534432411194, 1.0118520259857178, 0.5302967429161072, -0.8157351016998291, -0.2488998919725418, 0.14093005657196045, 0.40882739424705505, ...
def _ axpbz ( out, a, x, b, queue = none ) : a = np. array ( a ) b = np. array ( b ) assert out. shape = = x. shape return elementwise. get _ axpbz _ kernel ( out. context, a. dtype, x. dtype, b. dtype, out. dtype )
[ 0.8676913976669312, -0.36957430839538574, 0.5649077892303467, 0.662179172039032, -0.8562532067298889, -0.5464352965354919, -0.5109372735023499, -0.48240751028060913, -0.2302834540605545, 0.7875049710273743, 0.8414900302886963, 1.0122483968734741, 0.07820672541856766, -0.6489737033843994, ...
def evaluate _ policy _ by _ montecarlo ( self, policy ) : values = self. terminal _ states _ rewards. copy ( ) visits = self. _ return _ initial _ visits ( ) max _ number _ of _ iteration = 100 for iteration in range ( max _ number _ of _ iteration ) : i, j = self. _ return _ random _ state ( ) if iteration > max _ nu...
[ -0.5990889072418213, 0.2733616232872009, 0.6286219358444214, -0.6889612078666687, -0.2565346658229828, 0.10606806725263596, 0.03311705216765404, -0.7217251658439636, 0.11468949168920517, 0.9859339594841003, 0.13373509049415588, 0.24077355861663818, -0.15115022659301758, -0.3810766339302063...
def _ _ call _ _ ( self, * * kwargs ) : for item, value in kwargs. items ( ) : if item not in self. _ state [ " data " ] : self. _ state [ " data " ] [ item ] = value
[ -1.0055553913116455, 0.37035536766052246, 0.4639345109462738, -0.7388606071472168, 0.600417971611023, 0.6259438991546631, -1.299350619316101, -0.40307679772377014, -0.48134705424308777, -0.042938217520713806, -1.5652861595153809, -0.12471035867929459, -0.427171528339386, 0.3005008995532989...
def requesttoken ( self, request, signature ) : token = none assert isinstance ( request, tokenrequest ), \ " request object is not an instance of tokenrequest " try : # user info if request. type = = tokentype. user : logger. debug ( " token requested of type user. " ) # prep ezsecurityprincipal proxytoken = getattr (...
[ -0.45843467116355896, -0.04880743473768234, 0.7851213216781616, 1.0415458679199219, 0.16900764405727386, -0.10677100718021393, 0.5224285125732422, 0.28110185265541077, 0.7421042919158936, -0.647771954536438, -0.07626228779554367, -0.0826890766620636, 0.5837974548339844, 0.5722578167915344,...
def smaller ( x, y ) : if x < = y : return x return y
[ 0.5623078942298889, -0.3626488149166107, 0.622361421585083, -0.9456602931022644, -0.7857364416122437, 0.6949238181114197, -1.5012563467025757, -3.1351237297058105, -0.7599679231643677, -0.794567346572876, 0.6282988786697388, 0.7289631366729736, 0.2154274880886078, -0.8247756361961365, -0...
def _ pw _ encrypt ( self, password ) : if authencoding. is _ encrypted ( password ) : return password return authencoding. pw _ encrypt ( password, encoding ='pbkdf2 - sha256')
[ 0.2887232303619385, 0.44763943552970886, 0.18496589362621307, 0.5694478750228882, 0.13725601136684418, -0.9805018305778503, -0.3875432312488556, -0.3568401038646698, 1.1189969778060913, 0.43601733446121216, 0.34211039543151855, -0.3422092795372009, -0.509503185749054, 0.7344207763671875, ...
def add _ checkbox ( self, callback = none, text = none, checked = false, name = none ) : if callback is none : return partial ( self. add _ checkbox, text = text, checked = checked, name = name ) name = name or getattr ( callback,'_ _ name _ _ ', none ) or text assert name checkbox = qcheckbox ( text ) checkbox. setla...
[ -0.19294856488704681, 0.29959484934806824, 0.6732338666915894, -0.04788121208548546, -0.7037920951843262, -0.1907380074262619, 0.631561279296875, -0.3069731891155243, 0.9067068099975586, -0.8224937915802002, -0.022345099598169327, -0.5772436857223511, -0.13087815046310425, 0.15856188535690...
def can _ moderate ( self, object ) : content _ type _ object, object _ id = contenttype. objects. get _ for _ model ( object. _ _ class _ _ ), object. id return bool ( moderatedcontent. objects. filter ( content _ type = content _ type _ object ) )
[ 0.28386205434799194, -1.1885453462600708, 0.6980929374694824, -0.42880067229270935, -0.6670038104057312, 0.34469547867774963, -0.3529658615589142, -0.5716867446899414, 0.48296448588371277, 0.7440025210380554, -0.43610313534736633, 0.9900994300842285, -1.0723381042480469, 1.1477733850479126...
def transcribe _ gcs ( gcs _ uri ) : from google. cloud import speech from google. cloud. speech import enums from google. cloud. speech import types client = speech. speechclient ( ) # [ start migration _ audio _ config _ gcs ] audio = types. recognitionaudio ( uri = gcs _ uri ) config = types. recognitionconfig ( enc...
[ 0.3803541958332062, 0.30646127462387085, 0.6278056502342224, -0.1591247022151947, 0.6877905130386353, -0.20543065667152405, -0.43521878123283386, -1.1103339195251465, -0.580464243888855, 0.3251321315765381, -0.7872456908226013, 0.7815634608268738, -0.0858314260840416, 0.03107832930982113, ...
def test _ func ( self ) : post = post. objects. get ( pk = self. kwargs ['pk'] ) # allow logged in users if self. request. user. is _ authenticated : return true else : # if post is an admin post, block. else, allow. if post. admin _ post : return false return true
[ 0.1473887860774994, 0.9379695653915405, 0.49344196915626526, 1.1338145732879639, -0.36151355504989624, 1.1104308366775513, 0.2611679434776306, -0.5811102986335754, 0.09635396301746368, -0.13625407218933105, 0.16915269196033478, 0.4316505491733551, -0.6374467611312866, -0.09945710748434067,...
def to _ root ( df, path, tree _ key = " default ", mode ='w ', * kargs, * * kwargs ) : if mode = ='a': mode ='update'elif mode = ='w': mode ='recreate'else : raise valueerror ('unknown mode : { }. must be " a " or " w ". '. format ( mode ) ) from root _ numpy import array2root arr = df. to _ records ( ) array2root ( a...
[ -0.18618641793727875, 0.02031254582107067, 0.5704402923583984, 0.27891525626182556, 0.15516087412834167, -0.5081340074539185, 0.2477107048034668, -0.5625922679901123, -0.32970014214515686, 1.0895816087722778, -0.06565685570240021, 1.4032037258148193, 0.5631499886512756, -0.0464238151907920...
def status _ code ( self ) - > str : return pulumi. get ( self, " status _ code " )
[ 1.239579677581787, -0.5420354008674622, 0.35743841528892517, 0.5392116904258728, 0.9736418724060059, 0.8490639328956604, -0.3284551799297333, 1.1898950338363647, 0.6997329592704773, 0.11067277193069458, 0.5633308291435242, 0.7901919484138489, 0.6267662048339844, -1.2614972591400146, -0.2...
def test _ double _ h _ plot _ 1 ( self ) : inch _ per _ unit = 1. 0 x _ units = 8 y _ units = 4 left = [ 1, 5 ] bottom = 1 width = 2 height = 2 figsize, coords = pt. make _ coordinates ( inch _ per _ unit, x _ units, y _ units, left, bottom, width, height ) self. assertequal ( figsize, ( 8, 4 ) ) self. assertequal ( c...
[ -0.09716608375310898, 0.9099130034446716, 0.6255518198013306, 0.10004245489835739, -0.29945310950279236, 1.2973840236663818, 0.9772578477859497, -0.9456472992897034, -0.8393761515617371, -0.7748687267303467, -0.9614853858947754, 0.1761852353811264, -0.000132247107103467, -0.305296808481216...
def server _ error ( request, * args, * * kwargs ) : return httpresponseservererror ( * * exception _ response ( request, 400, exception ('server error') ) )
[ -0.631580650806427, -0.7342966794967651, 0.2716943323612213, -0.05571836978197098, 0.2388715296983719, -0.07782669365406036, -0.7310941815376282, -0.16841629147529602, 0.2896980047225952, 0.08223191648721695, -0.25716105103492737, 0.1364075243473053, -0.4586081802845001, 0.4864398837089538...
def render ( template _ normal, variables, request, template _ pdf = none ) : logger. info ( " entered " ) if'pdf'in request. get and template _ pdf : logger. debug ( " rendering to pdf " ) return render _ to _ pdf ( template _ pdf, variables, context _ instance = requestcontext ( request ) ) logger. info ( " rendering...
[ -0.8478174209594727, -0.8740472793579102, 0.4781370162963867, 0.2293800264596939, -0.11800383031368256, -0.6573758721351624, -0.2898329198360443, 0.7543889880180359, 0.3741980195045471, -0.5396333932876587, 1.1211189031600952, -0.42667651176452637, -0.7182585597038269, -0.2639182209968567,...
def _ get _ metadata ( job _ id ) : # avoid sqlalchemy " unicode type received non - unicode bind param value " # warnings. job _ id = unicode ( job _ id ) results = engine. execute ( metadata _ table. select ( ). where ( metadata _ table. c. job _ id = = job _ id ) ). fetchall ( ) metadata = { } for row in results : v...
[ -0.27268195152282715, 0.26710236072540283, 0.5744811296463013, -0.3268775939941406, -0.5888291001319885, -0.6774653792381287, -1.2357840538024902, -0.5350638628005981, -1.1024342775344849, 1.120307445526123, -0.2967339754104614, 0.6192004084587097, 0.8238039612770081, 0.7481624484062195, ...
def test _ update _ vcs _ root _ entry _ checkout _ rules ( self ) : pass
[ 0.6075217127799988, -0.34643709659576416, 0.07422669976949692, 0.7198089361190796, -0.29084697365760803, 0.5204530358314514, 0.7625829577445984, 0.9274846315383911, 0.32375234365463257, 1.0712826251983643, -0.04372672736644745, -0.27981051802635193, -0.9893710017204285, -0.5704405903816223...
def set _ keypress ( self, evt, ignore _ specials = false ) : keycode = evt. getkeycode ( ) keyname = keymap. get ( keycode, none ) if keyname is none : # regular character key if keycode < 256 : if keycode = = 0 : keyname = " nul " elif ( keycode < 27 ) & ( not ignore _ specials ) : # keycode is a special control key ...
[ 0.09232987463474274, -0.6198970675468445, 0.8698282837867737, -0.7417049407958984, -0.5441645979881287, 0.056212421506643295, -0.21465452015399933, 0.9077317118644714, 0.2365778088569641, 0.6294417381286621, -0.5969771146774292, -0.005915205925703049, 0.6849891543388367, -0.028589814901351...
def filtra ( keyvalues ) : if not keyvalues : return none ret = { } for ( key, value ) in keyvalues : ret [ unicode ( key ) ] = unicode ( value ) return json. dumps ( ret )
[ -0.38196128606796265, 0.00841699168086052, 0.45255139470100403, -0.2672191560268402, -1.4126530885696411, -0.9904789328575134, -1.0394692420959473, -0.07319875061511993, -0.07995473593473434, 0.5461323261260986, -0.7213686108589172, -0.2589755952358246, 0.47196164727211, 0.2377987504005432...
def step ( self ) : self. datacollector. collect ( self ) self. schedule. step ( )
[ -0.3431050479412079, 0.07469034940004349, 0.19163544476032257, -0.26308688521385193, 0.3050905466079712, 0.6162627339363098, 0.17679964005947113, 0.10936401039361954, -0.4284709393978119, -1.153703212738037, -0.8460467457771301, 0.12286242097616196, 0.4253893196582794, 1.0110055208206177, ...
def startassignment ( self ) : name = self. selectedname. get ( ) tkinter. messagebox. showinfo ( self. initscreen, message ='hit card now, you will hear a beep after your badge is read') lastevent = self. getdoorflowevents ( ) if lastevent = = false : print ('you didnt scan a card, try again') self. initscreen. destro...
[ -1.014809250831604, -0.4882591664791107, 0.8140826225280762, 0.5426775813102722, -0.2055428922176361, -0.06493005901575089, 0.1785600334405899, 0.06563952565193176, 0.21300089359283447, 0.2483210563659668, 0.08944035321474075, -0.050951652228832245, -0.32261577248573303, 1.1878718137741089...
def _ _ repr _ _ ( self ) : par ='' if self. parent : par = self. parent. name +'/'return'% s : % s % s'% ( self. _ _ class _ _. _ _ name _ _, par, self. name )
[ -0.13603562116622925, -1.2872716188430786, 0.8702086210250854, -0.9546691179275513, -0.979823887348175, 1.127044677734375, 0.13542042672634125, -0.46561628580093384, 0.09235197305679321, 0.025685802102088928, 0.012238402850925922, 0.5551438331604004, 0.24318437278270721, 0.0994427800178527...
def validate _ bug _ tracker ( input _ url ) : try : # ignore escaped ` % `'s test _ url = input _ url. replace ('% % ','' ) if test _ url. find ('% s') = = - 1 : raise typeerror # ensure an arbitrary value can be inserted into the url string test _ url = test _ url % 1 except ( typeerror, valueerror ) : raise validati...
[ -0.6942266225814819, -0.27838221192359924, 0.3727753162384033, 0.13995327055454254, 0.07487802952528, 0.49726563692092896, 0.3715665340423584, -0.40435734391212463, -0.20346908271312714, -0.49351608753204346, 0.08850102126598358, -0.5171806812286377, -0.5630276799201965, 0.8705490231513977...
def loadconfig ( name ) : # set path path ='config /'+ name + '. json'# load json - file if os. path. isfile ( path ) : with open ( path,'rb') as fp : data = json. load ( fp ) return data return none
[ -0.47766798734664917, -0.5448045134544373, 0.6202539205551147, -0.9356346726417542, -1.3434151411056519, -0.44885870814323425, -0.6767634749412537, -0.9674904346466064, -0.47848227620124817, 1.177990198135376, -1.0582982301712036, -0.41838976740837097, -0.12080331146717072, 0.0609451569616...
def determinant ( a ) : print ( linalg. det ( a ) )
[ 0.9227496981620789, -0.7418755292892456, 0.046753156930208206, -0.3234269320964813, -0.16682037711143494, 0.4508177638053894, 1.0448808670043945, 0.4761230945587158, 0.7359036207199097, -0.27127575874328613, 0.20761585235595703, 0.13014917075634003, 0.9280377626419067, -0.06123214587569237...
def solve _ floating _ leaves ( self ) : leaves _ to _ remove = [ ] add _ suffix _ link _ from = [ ] # for each floating _ leaf of the active _ sequence : if self. active _ points [ self. active _ sequence ]. floating _ leaves : self. active _ points [ self. active _ sequence ]. floating _ leaves. sort ( key = lambda x...
[ 0.2776293456554413, -0.9949847459793091, 0.8534571528434753, -0.5688546299934387, -0.019501544535160065, -0.3604574203491211, 0.8012168407440186, 0.666989266872406, 0.0006130536203272641, -0.14343169331550598, -0.28025588393211365, 0.20180559158325195, -0.12227442115545273, -0.103298902511...
def get _ animation _ type _ name ( self ) : return animationtype. objects. get ( type _ id = self. animated _ product ). type _ name
[ -0.04315624758601189, 0.2386266142129898, 0.4997751712799072, 0.8684976100921631, 0.48530858755111694, 0.5970438122749329, 0.49876868724823, -1.0461307764053345, 0.26731085777282715, 0.8101552128791809, -0.3430898189544678, 0.5516998171806335, 0.06774070858955383, 0.524465799331665, 0.33...
def test _ dilation _ with _ padding _ and _ stride ( ) : _ assert _ inout _ for _ expected _ output ( input _ length = 6, expected = 2, dilation = 3, kernel _ size = 3, padding = 3, stride = 3 )
[ 1.2305196523666382, 1.0547727346420288, 0.6486790776252747, 0.7393744587898254, -0.055002354085445404, 0.37566453218460083, -0.04475199431180954, -0.035548701882362366, 0.821868896484375, -0.6843075752258301, -0.49914872646331787, -0.1278344690799713, 0.48103973269462585, 0.805117726325988...
def disconnect ( self, cid ) : del self. callbacks [ cid ]
[ 0.41798022389411926, -0.4876733422279358, 0.27383744716644287, -0.2127300351858139, -0.5001945495605469, 0.12099231779575348, -0.43736088275909424, -0.6732494831085205, 0.9289222359657288, -0.025558646768331528, -0.6889509558677673, -0.3519176244735718, -1.2355802059173584, 0.4664139151573...
def search ( self, word ) : def find ( word, node ) : if not word : return none in node c, word = word [ 0 ], word [ 1 : ] if c! = '.': return c in node and find ( word, node [ c ] ) return any ( find ( word, kid ) for kid in node. values ( ) if kid ) return find ( word, self. root )
[ 0.15353310108184814, 0.3389526903629303, 0.715157687664032, 0.4022294878959656, -1.0745435953140259, -0.4170677661895752, 0.34384557604789734, -0.3805883228778839, -0.4349471628665924, -0.34813299775123596, 0.39705485105514526, 0.16332405805587769, -1.0587806701660156, 0.6540517807006836, ...
def _ ext _ cols ( self, cols ) : if len ( cols ) < 13 : return none ism1 = cols [ 12 ] if ism1 > 1e + 7 or ism1 < 0 or \ cols [ 8 ] < 0 or cols [ 9 ] < 0 or \ cols [ 10 ] < 0 or cols [ 11 ] < 0 or \ cols [ 8 ] > 1e + 7 or cols [ 9 ] > 1e + 7 or cols [ 10 ] > 1e + 7 or cols [ 11 ] > 1e + 7 : print ('found bad value in ...
[ -0.19446486234664917, -0.1475069671869278, 0.8941900730133057, -0.1319815069437027, -0.06396189332008362, -0.23748239874839783, -0.9041913747787476, -0.45931169390678406, 0.6167489290237427, 0.869504988193512, -0.15314476191997528, 0.4054597020149231, -0.6011087894439697, -0.45641085505485...
def _ get _ num _ steps ( ) : global num _ iteration _ steps tmp = num _ iteration _ steps num _ iteration _ steps = 0 return tmp
[ -0.12098552286624908, 0.5167302489280701, 0.17940428853034973, 0.0510050393640995, 0.4867381453514099, 0.14470136165618896, 0.8775030374526978, 0.2503546178340912, -0.5545967221260071, -0.523481547832489, -0.8792316913604736, 0.008784101344645023, -0.3044865131378174, 1.033249855041504, ...
def _ get _ category _ data ( self ) : # pylint : disable = no - self - use return [ " c % s " % x for x in range ( 1, 8 ) ]
[ -0.6882686018943787, 0.3967047929763794, 0.17875170707702637, -0.46149328351020813, 0.3029201328754425, 0.5879135727882385, -0.3765968382358551, -0.36245325207710266, -0.21242272853851318, -0.4019990861415863, -0.22091184556484222, 0.29857608675956726, 0.4630953371524811, 0.597244501113891...
def getrmsd ( self ) : indices = self. _ traj. _ indices traj = self. _ traj coords = self. _ getcoords ( ) if indices is none : return getrmsd ( coords, traj. _ coords, traj. _ weights ) else : if traj. _ weights is none : return getrmsd ( coords, traj. _ coords [ indices ] ) else : return getrmsd ( coords, traj. _ co...
[ 0.5911155343055725, -0.08539260923862457, 0.4759595990180969, -0.632545530796051, 0.056351255625486374, -0.6609039306640625, -0.8279334902763367, -0.9055067896842957, 0.3096451163291931, -0.6797566413879395, 0.9620323181152344, -0.593173623085022, -0.6483488082885742, 0.27727699279785156, ...
def create _ task ( * args, * * kwargs ) : return asyncio. create _ task ( * args, * * kwargs )
[ 0.284770131111145, 0.38587063550949097, 0.3647613525390625, 0.16346652805805206, 1.0121980905532837, -0.025911150500178337, -0.9183365106582642, 0.11233076453208923, -1.2279232740402222, 0.36979588866233826, -0.6215111613273621, 0.17874224483966827, 0.12533585727214813, -0.273272842168808,...
def class _ view _ decorator ( function _ decorator ) : def simple _ decorator ( view ) : view. dispatch = method _ decorator ( function _ decorator ) ( view. dispatch ) return view return simple _ decorator
[ -0.8526460528373718, 0.2381427139043808, 0.35336607694625854, -0.9841064214706421, -0.9736071825027466, -0.4942898750305176, 0.06642135977745056, 0.5607821345329285, 1.457894206047058, -1.1735901832580566, 0.6210189461708069, 0.047323208302259445, 1.865537405014038, 0.037512052804231644, ...
def setallsuccess ( self, allsuccess ) : self. isallsuccess = allsuccess
[ 0.27757418155670166, -0.6182725429534912, 0.7537723779678345, 1.3325719833374023, -0.5306193828582764, 0.9425666332244873, -0.7603089213371277, 1.028952956199646, 0.16546402871608734, 0.1018112301826477, -1.3784092664718628, -0.18612000346183777, 0.11536545306444168, 0.6722724437713623, ...
def _ get _ amount ( self ) : if self. _ amount is not none : return self. _ amount ret = np. zeros ( self. _ seg * self. _ w * self. _ h * self. _ layer, dtype = np. float32 ) ret = ret. reshape ( ( self. _ seg, self. _ w, self. _ h, self. _ layer ) ) for seg in range ( self. _ seg ) : for l in range ( self. _ layer )...
[ 0.3043482005596161, 0.0024531250819563866, 0.6500900983810425, -0.7812179327011108, 0.2781960070133209, -1.164709210395813, 0.857154369354248, -0.3540142774581909, 0.16171126067638397, 0.2034096121788025, -0.09196198731660843, -0.6745679974555969, 0.21854035556316376, 0.351550817489624, ...
def famatrix ( h ) : n = int ( len ( h ) / 2 ) print ( " famatrix n = ", n ) # fiplr : h = h [ : : - 1 ] fa = np. zeros ( ( n, n, 1 ) ) # fa [ 0 : int ( n / 2 ), 0 : int ( n / 2 ), 0 ] = - np. fiplr ( np. diag ( h [ 0 : int ( n / 2 ) ] ) ) # fa [ int ( n / 2 ) : n, 0 : int ( n / 2 ), 0 ] = - np. diag ( h [ int ( n / 2 ...
[ -0.5099745988845825, -0.45509251952171326, 0.8326583504676819, 0.4597485661506653, 0.02257496677339077, -0.7974268198013306, 0.9589884281158447, 0.27999255061149597, 0.5117794275283813, -0.02757517248392105, -0.2480265349149704, 0.16754253208637238, 0.4162452220916748, 1.02236807346344, ...
def cellfeaturenames ( self ) - > tuple : # get the cell feature names from features dictionary ( use " cell " script ) return tuple ( self. frames [ self. segm _ channel ] [ 0 ]. cells [ 0 ]. features. keys ( ) )
[ -0.5507738590240479, -0.29812753200531006, 0.49794578552246094, 0.9422065615653992, 0.918941855430603, -0.7608047127723694, -0.37265726923942566, 0.03460129722952843, -0.8952685594558716, 0.6557467579841614, -1.089634895324707, -0.3229326903820038, -0.10970111191272736, -0.0536494925618171...
def set _ position ( self ) : self. _ _ pos _ x = self. _ _ help. set _ postion _ on _ axis ( self. _ _ pos _ x, self. _ _ speed _ x, self. screen _ min _ x, self. length _ x _ axis ) self. _ _ pos _ y = self. _ _ help. set _ postion _ on _ axis ( self. _ _ pos _ y, self. _ _ speed _ y, self. screen _ min _ y, self. le...
[ 0.17870457470417023, -0.8851568698883057, 0.5957371592521667, -0.10537445545196533, 0.8500190377235413, 0.15395225584506989, 0.3655868470668793, 0.2856574058532715, -0.600256085395813, 0.09925810992717743, -0.8039662837982178, 0.06700986623764038, -0.2070271223783493, 0.09360259026288986, ...
def _ _ repr _ _ ( self ) : pass
[ -0.3165806829929352, -1.2025171518325806, 0.5935817360877991, -0.6593199372291565, -0.12100795656442642, 0.9759974479675293, 0.46463286876678467, 0.09161370992660522, 0.9809606671333313, -0.12574361264705658, -0.3127027750015259, 0.7918886542320251, 0.4748518466949463, -0.2913174629211426,...
def manage _ donors ( self ) : # create a dict of menu items / menu text / menu caller functions choices = {'1': {'option':'send a thank you ','function': self. send _ thank _ you },'2': {'option':'create a report ','function': self. collection. create _ report },'3': {'option':'send all letters ','function': self. sen...
[ -0.42486777901649475, 0.3420458436012268, 0.7526752948760986, 0.19957056641578674, 0.11843035370111465, 0.1675536334514618, 0.2872220575809479, -0.7523599863052368, 0.076545849442482, -0.4944593608379364, 0.20878376066684723, -0.52430659532547, -0.34835290908813477, 0.7046872973442078, 0...
def exec _ cmdv ( cmdv ) : try : output = subprocess. check _ output ( cmdv, stderr = subprocess. stdout ) retval = success except oserror, e : output = str ( e ) retval = none except subprocess. calledprocesserror, e : output = e. output retval = e. returncode return ( retval, output )
[ -0.044845547527074814, -1.1210553646087646, 0.7776224613189697, 0.4916963279247284, -0.8397014141082764, -0.31984156370162964, 0.48311376571655273, -0.17235659062862396, 0.22347716987133026, -0.4887094795703888, 0.24945877492427826, -0.20748579502105713, 0.22330643236637115, -0.26686856150...
def getddginsertiondelay ( ) : andor _ solis. getddginsertiondelay. restype = ctypes. c _ uint state = ctypes. c _ int ( ) result = andor _ solis. getddginsertiondelay ( ctypes. byref ( state ) ) check _ status ( result ) return int ( state. value )
[ -0.9015440940856934, 1.591343641281128, 0.7211382389068604, -0.18990688025951385, -0.24709318578243256, -0.4712381958961487, 0.42583245038986206, 0.15327204763889313, 0.25548097491264343, -0.6830695271492004, -0.9459792971611023, -0.5046880841255188, -0.5738291144371033, 0.1621621400117874...
def _ _ init _ _ ( self ) : self. stack = [ ] self. min _ stack = [ ]
[ -0.016661198809742928, 0.465232253074646, 0.29872363805770874, 0.8100355267524719, 0.0965326726436615, -0.5410776734352112, 0.07460334897041321, 0.49976646900177, 0.011164674535393715, -0.26363062858581543, -1.7014576196670532, 0.0848439633846283, -0.18955743312835693, 1.0144295692443848, ...
def home ( request ) - > dict : # noqa : dar101, dar201 # user _ id : int = 1 # user : optional [ user ] = repository. get _ user _ by _ id ( user _ id ) user = request. user if user is none : raise httpfound ( location = " / welcome " ) return { " user " : user, }
[ 0.16015036404132843, 0.4056582450866699, 0.5252673625946045, 0.9413173198699951, -0.3057567775249481, -0.16000066697597504, 0.5919056534767151, -0.9444271326065063, 0.5589085817337036, 0.5061410069465637, -0.003140109358355403, 0.4029742479324341, 0.4795570373535156, 0.2209894359111786, ...
def _ loadtxtfile ( filename, loadkwargs, arraykwargs ) : # merge the two dictionaries for the loadtxt kwargs. tempdict = dict ( ) tempdict. update ( loadkwargs, * * arraykwargs ) try : # note :. atleast _ 1d ( ) is used to deal with the edge - case of a single - line file. # using loadtxt ( ) on a single - line file w...
[ 0.2455645501613617, -0.3006191849708557, 0.7176255583763123, -0.9267774820327759, -0.16913838684558868, -0.4327165186405182, -0.9261705279350281, -0.04786527529358864, -0.6524667143821716, 0.573042631149292, 0.3208825886249542, -0.04540863633155823, -0.5347278714179993, 0.33356237411499023...
def depth ( self ) : return self. levels
[ -0.1993941366672516, -0.39731332659721375, 0.12700876593589783, 0.3751721680164337, 0.4239799380302429, 1.309556245803833, 0.6320998668670654, -0.8439376950263977, 0.09157633036375046, -1.0862106084823608, -0.8367695808410645, -0.06388034671545029, -0.4920881688594818, 0.8075758218765259, ...
def getrandom ( self ) : return random. choice ( self. _ element _ list )
[ -0.7710451483726501, -0.28016218543052673, 0.33562272787094116, 0.3980260491371155, 0.4340386390686035, 1.2775192260742188, -0.08175313472747803, 0.29210323095321655, 1.2731218338012695, -0.8821829557418823, -0.6052221059799194, 0.7909442782402039, -0.6052812933921814, 0.16217951476573944,...
def acceptable ( value, capitalize = false ) : name = regexes ['punctuation']. sub ( " ", regexes ['joins']. sub ( " _ ", value ) ) # clean up irregularities in underscores. name = regexes ['repeated _ underscore']. sub ( " _ ", name. strip ('_') ) if capitalize : # we don't use python's built in capitalize method here...
[ -0.7516069412231445, -0.5756094455718994, 0.8327964544296265, -1.1049482822418213, -1.7997236251831055, -0.367729514837265, 0.05948292464017868, 0.19789962470531464, 0.017361866310238838, 0.5849480628967285, 0.14328619837760925, -0.11378159373998642, -0.07739328593015671, 0.334715574979782...
def parse _ electiondate ( self ) : formats = ['% m / % d / % y ','% y - % m - % d % h : % m : % s. % f ', ] for fmt in formats : try : d = datetime. datetime. strptime ( self. electiondate, fmt ) self. electiondate = datetime. date ( d. year, d. month, d. day ) self. save ( ) return self except valueerror : pass raise...
[ 0.09990392625331879, -0.7181112766265869, 0.431961327791214, 0.38028836250305176, 0.055866993963718414, 0.4882337749004364, -1.013323426246643, 0.4009263813495636, 0.1039610207080841, 0.6526603102684021, 0.03897222876548767, -0.328545480966568, -0.15206517279148102, 0.18924090266227722, ...
def validate _ dataset ( self, * * kwargs ) : # check that the dataset format is parquet if not isinstance ( self. engine, parquetdatasetengine ) : msg = ( " nvtabular is optimized for the parquet format. please use " " the to _ parquet method to convert your dataset. " ) warnings. warn ( msg ) return false # early ret...
[ -0.5728919506072998, 0.2492486834526062, 0.5346574187278748, 0.011007335036993027, -0.06628125160932541, 0.33861076831817627, -0.5188416242599487, -0.5894162058830261, -0.5006400942802429, -0.6308457255363464, 0.5322730541229248, -0.1082221120595932, -0.10296864807605743, -0.06628584861755...
def stack _ spm ( spm1, spm2, finer = true ) : # channels to be in spmnew and number of layers in spmnew chanlist = list ( set ( list ( spm1. channels. keys ( ) ) + list ( spm2. channels. keys ( ) ) ) ) numlay = spm1. numlay + spm2. numlay # create spmnew spmnew = spmdata ( ) spmnew. layers = [ none ] * numlay # add al...
[ 0.6778735518455505, -0.2461823970079422, 1.2137283086776733, 0.210946723818779, -0.5198982954025269, -0.341972678899765, -0.3075965344905853, -0.317501038312912, 0.22183209657669067, 0.05704237148165703, -0.7359839677810669, 0.496293842792511, -0.19504277408123016, 0.4830121397972107, 0....
def _ _ copytab ( self, sourceindex, targetindex ) : editor = self. widget ( sourceindex ). geteditor ( ) neweditor, assembly = self. vm. cloneeditor ( editor, editor. getfiletype ( ), editor. getfilename ( ) ) self. vm. insertview ( assembly, self, targetindex, editor. getfilename ( ), editor. getnoname ( ) )
[ -0.12636971473693848, -0.43097323179244995, 0.5947372317314148, -0.3838040232658386, -0.24945798516273499, 0.751131534576416, 0.0860590711236, -0.1678873747587204, -0.32920584082603455, 0.39251190423965454, 0.00632381672039628, 0.24222464859485626, 0.3552885353565216, -1.3547965288162231, ...
def add _ url _ sns ( event, context ) : for message in event [ " records " ] : url = url _ normalize ( message [ " sns " ] [ " message " ] ) return add _ url ( url )
[ 0.08801984786987305, 0.34911006689071655, 0.4138404428958893, 0.22348275780677795, 0.6566160917282104, -0.1941889375448227, -0.5947117209434509, 0.38973334431648254, 1.1881927251815796, -0.043526362627744675, -0.3011116683483124, 0.24813468754291534, 0.42857488989830017, 0.4390618205070495...
def listen _ for _ wiimotes ( timeout, attempts = 3 ) : new _ wiimotes = [ ] while attempts : new _ wiimotes = find _ wiimotes ( timeout ) if len ( new _ wiimotes ) > 0 : break attempts - = 1 return new _ wiimotes
[ -0.8644917011260986, -0.28058767318725586, 0.30838361382484436, -0.7349551320075989, -0.6322689056396484, 0.11719417572021484, -1.000657320022583, -0.25004830956459045, -0.11569149047136307, 0.42614230513572693, -0.3455478250980377, -0.17115624248981476, -1.135449767112732, 0.4525282680988...
def get _ range _ list _ at _ offset _ ex ( self, offset ) : return struct _ parse ( self. structs. dwarf _ rnglists _ entries, self. stream, offset )
[ -1.737783670425415, 0.015658797696232796, 0.40612995624542236, -0.5702164769172668, -0.48409247398376465, 0.4399932324886322, -0.7393118739128113, 0.31974413990974426, 0.6783331036567688, 0.3889734447002411, -1.5741242170333862, 0.1998671591281891, -0.39890745282173157, 0.36450693011283875...
def pulse ( c = 1, # aximum courant number nx = 200, # spatial resolution animate = true, version ='vectorized ', t = 2, # end time loc ='left ', # location of initial condition pulse _ tp ='gaussian ', # pulse / init. cond. type slowness _ factor = 2, # wave vel. in right medium medium = [ 0. 7, 0. 9 ], # interval for...
[ 0.5568045973777771, 0.13211439549922943, 0.8148301243782043, -0.1346772462129593, -0.624702513217926, 0.27537286281585693, 0.10735990107059479, 0.08091071993112564, -0.04984554275870323, 0.7665526866912842, -0.38430431485176086, 0.22982342541217804, -0.176385760307312, 0.07393035292625427,...
def enable ( name, * * kwargs ) : cmd = " insserv { 0 } & & update - rc. d { 0 } enable ". format ( shlex. quote ( name ) ) return not _ _ salt _ _ [ " cmd. retcode " ] ( cmd, python _ shell = true )
[ -0.6970015168190002, -0.0825122743844986, 0.8428448438644409, -0.20824185013771057, -0.7051135301589966, 0.6767354607582092, -0.25438016653060913, 0.38490843772888184, 0.3373236060142517, 0.352024644613266, -0.6740143895149231, 0.456437349319458, -1.7197096347808838, -0.11676056683063507, ...
def _ item _ added ( self, key, item ) : # print ( " element added in { } : { } ". format ( id, key ) ) # add current iten into the all list self. _ items [ item ] = self [ key ] [ item ]
[ -0.7354543209075928, -0.8152847290039062, 0.23706373572349548, -0.014716900885105133, -0.16511228680610657, 0.7872182130813599, -1.1387863159179688, 0.934466540813446, 0.20334072411060333, 0.7765055298805237, -0.5949165225028992, 0.28535494208335876, -0.17448879778385162, -0.05268227681517...
def apiver _ json ( ) : return { " apiver " : " 4. 5. 0 ", " hwver " : 3, " swver " : " 4. 0. 925 " }
[ -1.28142511844635, -1.5171297788619995, 0.4245767593383789, -0.49285316467285156, -0.9949176907539368, -0.013617821037769318, -0.4246881306171417, -0.1453368365764618, -0.21406225860118866, 1.1522517204284668, -1.9444115161895752, -0.4788755476474762, -0.07777504622936249, -0.2027922719717...
def test _ attempt _ file _ write _ failed ( ) : with patch ('builtins. open') as open _ func : open _ func. side _ effect = ioerror ('fake') result = writer. attempt _ file _ write ('fake ','fake') assert result is not none
[ -0.47299814224243164, -0.24412359297275543, 0.10878835618495941, 0.06000097095966339, 0.9749743938446045, 0.28380677103996277, 0.3642297685146332, 0.07209359854459763, -1.0854195356369019, -0.4275999963283539, -0.3058023452758789, -0.4585377871990204, 0.018836185336112976, -0.8241925239562...
def check _ legit ( bday ) : if bday < datetime ( 1901, 5, 2 ) : raise tooolderror ( ) elif bday > datetime. today ( ) : raise tooyoungerror ( )
[ -0.2212810069322586, 0.392078697681427, 0.6099354028701782, 0.46505028009414673, -0.3757358193397522, 0.49155372381210327, -0.19285455346107483, -0.35414600372314453, -0.5931443572044373, -0.09608221054077148, 0.4987407624721527, 0.025857284665107727, -0.21765783429145813, 0.92261582612991...
def test _ dimensions _ of _ matrix ( self ) : self. assertequals ( ( 2, 2 ), self. matrix. dimensions ( ) ) self. assertequals ( ( 2, 3 ), matrix ( [ [ 1, 2, 3 ], [ 4, 3, 3 ] ] ). dimensions ( ) ) self. assertequals ( ( 3, 2 ), matrix ( [ [ 4, 5 ], [ 4, 7 ], [ 4, 9 ] ] ). dimensions ( ) )
[ 0.0497598722577095, 0.41355979442596436, 0.2086750864982605, 0.1363566666841507, 0.46410325169563293, -0.16840657591819763, 1.0596047639846802, -0.20347879827022552, 0.4523604214191437, -0.9524387717247009, 0.17897291481494904, -0.6526547074317932, 0.005455296486616135, 0.38375958800315857...
def get _ all _ news _ articles ( categories ) : all _ inshorts = [ ] for category in categories : all _ category _ articles = get _ articles ( category ) all _ inshorts = all _ inshorts + all _ category _ articles df = pd. dataframe ( all _ inshorts ) return df
[ 0.14242486655712128, 0.23767057061195374, 0.21907354891300201, 0.7303439378738403, -0.06956811249256134, 0.22486324608325958, -0.6187862157821655, -0.7071788907051086, -0.7048349380493164, -0.8433908820152283, 0.01563679240643978, 0.29735812544822693, 0.2527783513069153, 0.1022498458623886...
def init _ weights _ and _ state ( self, input _ signature ) : if isinstance ( input _ signature, ( list, tuple ) ) : input _ signature = input _ signature [ 0 ] self. weights = ( ) self. state = ( jnp. zeros ( input _ signature. shape, dtype = jnp. int32 ), {'running _ second _ time': ( ) } )
[ -0.42028313875198364, 0.32815319299697876, 0.2859407663345337, 0.9292089939117432, 0.36092516779899597, -0.6055020689964294, 0.24370117485523224, 0.43183037638664246, 0.08150920271873474, 0.23421050608158112, -1.2629081010818481, -0.0997590571641922, 0.20600324869155884, 1.2780592441558838...
def post _ processing _ v2 ( prediction, conf _ thresh = 0. 95, nms _ thresh = 0. 4 ) : output = [ none for _ in range ( len ( prediction ) ) ] for image _ i, image _ pred in enumerate ( prediction ) : # filter out confidence scores below threshold image _ pred = image _ pred [ image _ pred [ :, 8 ] > = conf _ thresh ]...
[ -0.4817078411579132, -0.23766712844371796, 0.8215544819831848, 0.6809750199317932, -0.054776012897491455, -0.26280784606933594, 0.6877360939979553, -0.6392128467559814, -0.33252057433128357, 0.6970259547233582, 0.012682252563536167, -0.020007196813821793, 0.5251334309577942, 0.371566027402...
def divisors ( n ) : fac = n. factor ( ) l = [ ] foo ( l, 1, 0, fac ) return l
[ -0.6923226118087769, 0.5271222591400146, 0.22847536206245422, 0.032600995153188705, 0.6594859957695007, -0.9028224945068359, -0.08673238754272461, 0.1245821863412857, 0.47751638293266296, -0.6946768164634705, -0.7758563160896301, -0.5250908136367798, 0.11375760287046432, 1.2456434965133667...
def removeinput ( self, index ) : if len ( self. inputs ) - 1 < 2 : raise exception ( " error : too few inputs left after removing " ) if index > len ( self. inputs ) : raise exception ( " error : index value out of range " ) self. history _ active = 0 self. inputs. pop ( index ) self. _ updateconnections ( ) self. _ u...
[ -0.6937710046768188, 0.14146795868873596, 0.6325418949127197, -0.27927085757255554, -0.2558920681476593, 0.5749682784080505, 0.9227662086486816, -0.30889275670051575, 0.41717880964279175, -0.04149463400244713, -0.002387827495113015, 0.0031374862883239985, -1.5070053339004517, -0.3857882022...
def setup _ platform ( hass, config, add _ devices, discovery _ info = none ) : from miio import airqualitymonitor, deviceexception host = config. get ( conf _ host ) name = config. get ( conf _ name ) token = config. get ( conf _ token ) _ logger. info ( " initializing xiaomi air quality monitor with host % s ( token ...
[ 0.1660340130329132, 0.21636638045310974, 0.4846634566783905, 0.35161668062210083, 1.0830613374710083, -0.05709023028612137, -0.26269540190696716, -0.46359339356422424, 0.21866820752620697, 0.05807178467512131, -0.6405603289604187, -0.43961840867996216, -0.06668629497289658, 0.5350799560546...
def get _ logging _ level ( ) : levels _ dict = { 10 : " debug ", 20 : " info ", 30 : " warning ", 40 : " error ", 50 : " critical " } print ( " the current logging level is : ", levels _ dict [ logger. geteffectivelevel ( ) ] )
[ -0.12349770963191986, -0.44339612126350403, 0.6141807436943054, -0.3899952173233032, 0.1479382961988449, 0.1674407720565796, -0.5418325662612915, 0.22559580206871033, -1.0156044960021973, 0.19258244335651398, -0.6374268531799316, 0.3492017686367035, -0.06368579715490341, 0.313860148191452,...
def daemonize ( self ) : try : pid = os. fork ( ) if pid > 0 : # exit with non error sys. exit ( 0 ) except oserror as e : sys. stderr. write ( " fork # 1 failed : % d ( % s ) \ n " % ( e. errno, e. strerror ) ) sys. exit ( 1 ) # decouple from second parrent os. chdir ('/') os. setsid ( ) os. umask ( 0 ) # try do secon...
[ -0.2288893163204193, -0.8405103087425232, 1.0692371129989624, -0.03452388197183609, 0.7375357151031494, 0.13390350341796875, 0.9697639346122742, -0.10510089248418808, -0.2919738292694092, -0.5182908773422241, 0.1572714000940323, 0.342398077249527, 0.33033043146133423, 0.42449718713760376, ...
def fit ( self, x, y = none ) : x = self. _ check _ fit _ input _ and _ variables ( x ) self. encoder _ dict _ = { } # learn encoding maps for var in self. variables : if self. encoding _ method = = " count " : self. encoder _ dict _ [ var ] = x [ var ]. value _ counts ( ). to _ dict ( ) elif self. encoding _ method = ...
[ -0.6155280470848083, -0.07516472786664963, 0.4160826802253723, 0.5828973650932312, -0.7937684059143066, -0.05846118927001953, 0.20314335823059082, -0.36438852548599243, -0.14973896741867065, -0.726902425289154, -0.43129104375839233, 0.30325618386268616, 0.2027597576379776, 0.97428053617477...
def sql ( self, sqlstr, * args, * * kwargs ) : if args and kwargs : raise valueerror ( " cannot specify both args and kwargs " ) if args : parms = args else : parms = kwargs self. curs. execute ( sqlstr, parms ) if ( self. curs. description is none ) : return self. curs. rowcount else : return self. pack _ rows ( self....
[ 0.31519198417663574, 0.38369929790496826, 0.6786972880363464, 0.532491147518158, -0.25256186723709106, -0.5068172216415405, -1.1578924655914307, 0.41883158683776855, 0.37511488795280457, -0.0850444957613945, 0.6481552720069885, 0.34391146898269653, -0.3056510090827942, 0.882219135761261, ...
def _ assemble _ sampler _ docstring ( dynamic ) : common = " " " parameters - - - - - - - - - - loglikelihood : function function returning ln ( likelihood ) given parameters as a 1 - d ` ~ numpy ` array of length ` ndim `. prior _ transform : function function translating a unit cube to the parameter space according ...
[ 0.36677736043930054, -0.7702250480651855, 0.9304571151733398, 0.07138042151927948, -1.0200401544570923, -0.19945062696933746, 0.4293406903743744, -0.4854431450366974, -0.46186983585357666, 0.3354800343513489, 0.04240686818957329, 0.4446094036102295, 0.4559304118156433, 0.16056892275810242,...
def am ( request ) : am = appmanager ( ). instance # delete app manager after every single test def teardown ( ) : appmanager. instance = none request. addfinalizer ( teardown ) return am
[ 0.02613851986825466, -0.8246393203735352, 0.3993029296398163, 0.17485487461090088, -0.658225417137146, 0.08494310081005096, 0.2619606554508209, -0.1841801553964615, 1.1802295446395874, -1.1693594455718994, 0.7930874228477478, -0.2393510937690735, -0.6304969787597656, 0.8725982308387756, ...