text
stringlengths
25
2.19k
embedding
listlengths
768
768
def unfollow _ group _ with _ http _ info ( self, group _ id, logged _ in _ user _ id, access _ token, client _ token, * * kwargs ) : all _ params = ['group _ id ','logged _ in _ user _ id ','access _ token ','client _ token ','fields'] all _ params. append ('callback') all _ params. append ('_ return _ http _ data _ o...
[ -0.35737815499305725, 0.5862082839012146, 0.7788891196250916, -0.3310680091381073, -0.6203504204750061, -0.01733071729540825, 0.4779159724712372, -1.0389667749404907, -0.8864980936050415, 0.3739997446537018, 0.38899242877960205, 0.7401459217071533, -0.6736207008361816, 0.8926758170127869, ...
def blur _ motion _ h ( im : np. ndarray, fac : float ) - > np. ndarray : w, h = im. shape [ : 2 ] [ : : - 1 ] k = max ( 1, int ( ( fac * 0. 01125 ) * max ( w, h ) ) ) # 0. 01, 0. 016 # k = max ( 1, int ( ( fac * 0. 05 ) * max ( w, h ) ) ) # 0. 01, 0. 016 k = k + 1 if k % 2 else k kernel _ h = np. zeros ( ( k, k ) ) ke...
[ 0.7477179765701294, 0.4366248548030853, 0.8614928722381592, 1.5557031631469727, -0.5695778727531433, -0.2862914800643921, 0.5714294910430908, -0.24835431575775146, -0.014561600983142853, 0.5111725330352783, 0.7403032779693604, 0.43051061034202576, 0.32201480865478516, 0.6740462183952332, ...
def _ create _ submission ( ids, predictions, path ) : # generating the submission file submission = pd. dataframe ( columns = ['id ','prediction'], data = {'id': ids,'prediction': predictions } ) # for many models the labels are 0 or 1. replacing 0s with - 1s. submission ['prediction']. replace ( 0, - 1, inplace = tru...
[ -0.863148033618927, -0.7037646174430847, 0.2643389105796814, 0.7163224816322327, 0.31733813881874084, 0.42192256450653076, -0.3612155318260193, 0.7254494428634644, -1.1827012300491333, 0.2129090428352356, 0.008396698161959648, -0.1438390612602234, 0.26115351915359497, 0.2803885042667389, ...
def test _ str ( self ) : mapper = attributetypemapper ( create _ group ( ) ) mapper [ " x " ] = 1 mapper [ " y " ] = { " a " : " b " } assert str ( mapper ) = = str ( { " x " : datasetscalar ( 1 ), " y " : { " a " : " b " } } )
[ -0.9130464792251587, -0.4716640114784241, 0.35065600275993347, -0.9998319745063782, -1.2408087253570557, 0.6214451193809509, -0.6007246971130371, -0.9870996475219727, -0.0869014635682106, -0.12333114445209503, 0.510972261428833, 0.2869469225406647, 0.7093780636787415, -0.2994299530982971, ...
def sirt ( input, pattern _ length ) : sirt = stereo _ sirt ( input. read ( ), pattern _ length ) click. echo ( sirt )
[ 0.49002519249916077, -0.03901102393865585, 0.06958499550819397, -0.33385294675827026, -0.009754987433552742, -0.410342812538147, 0.5390839576721191, -0.48327362537384033, 0.34550273418426514, -0.0004905031528323889, -0.7734012603759766, 0.7814185619354248, -0.46817928552627563, -1.34244477...
def gbobject _ channel ( request, query, * ka, * * kw ) : queryset = gbobject. published. search ( query ) return object _ list ( request, queryset = queryset, * ka, * * kw )
[ -0.5378467440605164, -0.6022067666053772, 0.2206936925649643, 0.28277868032455444, 0.5650837421417236, 0.03793541342020035, -0.5391597151756287, -0.23130358755588531, -0.37781068682670593, -0.06146003678441048, 0.4799056351184845, 0.9643711447715759, -0.18506282567977905, -0.74550414085388...
def _ base _ dist ( self, * args, * * kwargs ) : low = kwargs. pop ( " low " ) high = kwargs. pop ( " high " ) probs = np. ones ( high - low ) / ( high - low ) return tfd. transformeddistribution ( distribution = tfd. categorical ( probs = probs ), bijector = tfp. bijectors. affinescalar ( shift = low ), name = " discr...
[ 0.4291711747646332, -0.026424521580338478, 0.3296158015727997, -0.582855761051178, 1.0691527128219604, 0.03950062766671181, -0.08907603472471237, 0.4547876715660095, -0.30448049306869507, -0.5708268880844116, 0.10360243171453476, 0.7424392104148865, 0.03468562290072441, -0.7538590431213379...
def shownormaldistr ( x, mu, sigma ) : y = stats. norm. pdf ( x, 0, 1 ) # print ( y ) plt. plot ( x, y ) plt. title ('normal : $ \ mu $ = %. 1f, $ \ sigma ^ 2 $ = %. 1f'% ( mu, sigma ) ) plt. xlabel ('x') plt. ylabel ('probability density ', fontsize = 15 ) plt. show ( )
[ 0.6940829753875732, -0.19583983719348907, 0.5474711656570435, -0.3231545686721802, -1.9156711101531982, 0.5322768688201904, 0.18886932730674744, 0.7032436728477478, 0.26079311966896057, -0.3607577383518219, 0.8825578093528748, 1.8301360607147217, -0.1119966208934784, -0.4835365414619446, ...
def update _ webpack _ mix ( self ) : shutil. copyfile ( self. get _ template _ path ( " webpack. mix. js " ), base _ path ( " webpack. mix. js " ) )
[ -0.07422854006290436, -2.24161958694458, 0.6502811908721924, 0.09043176472187042, -0.5844847559928894, 0.5455624461174011, 1.055402159690857, 0.2863447070121765, 0.6426022052764893, 0.06408428400754929, -0.2546936273574829, 0.42988935112953186, -0.4846811294555664, 0.7048378586769104, 0....
def get _ query _ parameter ( self, original _ name : optional [ str ] = none ) - > str : if not original _ name : raise typeerror ( " original _ name cannot be null. " ) if original _ name = = " count " : return " % 24count " if original _ name = = " filter " : return " % 24filter " if original _ name = = " orderby " ...
[ -0.9040947556495667, -0.5262119174003601, 0.646864652633667, -0.6517698168754578, -1.0717686414718628, 0.637279748916626, 0.12193513661623001, 0.21313494443893433, -0.019712159410119057, 0.23696079850196838, 0.42559224367141724, 0.15639318525791168, 0.3285193145275116, -0.39961543679237366...
def get _ group _ stats ( self, uuid, stats _ filter = none, start _ date = none, end _ date = none, * * kwargs ) : if stats _ filter is none : return self. request ( f'groups / { uuid } / stats ', * * kwargs ) dto = { } if stats _ filter : dto ['statistics'] = self. _ stats _ filter ( stats _ filter ) if start _ date ...
[ -1.402571201324463, 1.061506748199463, 0.37914273142814636, 0.20414841175079346, 0.014019276015460491, -0.4497174918651581, -0.22299788892269135, -0.603198230266571, -0.7181897163391113, -0.40351566672325134, -0.22270986437797546, 1.1931519508361816, -0.30062055587768555, -0.10591565072536...
def test _ update _ customer ( self ) : # create a customer to update new _ customer = self. _ create _ customer ( ) # update the customer logging. debug ( new _ customer ) new _ customer [ " password " ] = " unknown " resp = self. app. put ( " / customers / { } ". format ( new _ customer [ " id " ] ), json = new _ cus...
[ -0.48024430871009827, -0.9406530261039734, 0.5701829791069031, 0.2044602781534195, 0.020490732043981552, 0.1437883973121643, -0.49684587121009827, 0.27978068590164185, -0.3935636281967163, 0.12407637387514114, -0.9273562431335449, 0.13585525751113892, -0.0664258822798729, -0.43903616070747...
def multi _ dim _ grid ( * arrs ) : temp = multi _ dim _ flatgrid ( * arrs ) return np. transpose ( np. array ( temp ) )
[ -0.3520740568637848, 0.14715202152729034, 0.45961156487464905, 0.8267394304275513, -0.14348609745502472, -0.8261323571205139, -0.27856016159057617, 0.29010921716690063, -0.2619565725326538, 0.7979632019996643, 0.39252787828445435, 0.18386538326740265, -0.18006856739521027, 1.10003399848937...
def _ _ init _ _ ( self, source, output ) : path = os. getcwd ( ) self. source = source self. output = os. path. join ( path, output )
[ 0.42951059341430664, -0.9990450739860535, 0.2641083002090454, 0.22605305910110474, -1.165987491607666, -0.11495260894298553, 1.0285463333129883, 0.782257616519928, -0.4374949336051941, -0.923492431640625, -0.05128105357289314, 0.25594666600227356, 0.3652602732181549, 0.5514360666275024, ...
def _ _ eq _ _ ( self, other ) : devisor = self. num / other. num if devisor = = self. den / other. den : return true else : return false
[ -0.29778701066970825, 0.1548992544412613, 0.7070127725601196, 0.5696913003921509, -0.006612016353756189, 0.6377116441726685, 0.8704290390014648, -1.237233281135559, 0.24088796973228455, -0.9171268343925476, 0.10720426589250565, -1.0971735715866089, -0.07805119454860687, -0.2907052636146545...
def callback _ query _ share _ result ( self, bot : bot, update : update ) - > none : self. logger. info ( " callback query'share _ result'from % s ", self. _ log _ user ( update. callback _ query. from _ user ) ) bot. answer _ callback _ query ( callback _ query _ id = update. callback _ query. id, ) with self. db _ s...
[ 0.042663101106882095, -0.09814297407865524, 0.5265321731567383, 0.7390334606170654, -0.2957240045070648, 0.06252381950616837, 1.2032302618026733, -0.48693761229515076, 0.22043810784816742, -0.18319271504878998, -0.06215125694870949, -0.07212050259113312, -1.178242564201355, -0.140089944005...
def vtk _ split ( filename ) : basename, ext = splitext ( filename ) if ext! = '. vtk'or'-'not in basename : raise valueerror ( ) level, base = ( s [ : : - 1 ] for s in basename [ : : - 1 ]. split ('- ', maxsplit = 1 ) ) return base, int ( level )
[ -0.7889423966407776, -0.3744366765022278, 0.7021077275276184, 1.0061705112457275, -0.24584779143333435, -0.0663633793592453, 0.33417317271232605, 0.3402871787548065, -0.9324514865875244, 0.990882933139801, -0.5725314021110535, 0.03709854558110237, -0.4775846600532532, 0.22250482439994812, ...
def get _ is _ showing ( self ) - > bool : return self. _ _ is _ showing
[ -0.020062776282429695, 0.5726810693740845, 0.606261670589447, 0.6262008547782898, 0.05848456546664238, 0.6254141330718994, -0.2022857517004013, 0.3743845224380493, 0.4217776358127594, 0.2699548602104187, -0.20904181897640228, 0.9186918139457703, -0.4686731994152069, -0.14333130419254303, ...
def links ( self, links ) : self. _ links = links
[ -0.598645031452179, 0.6183827519416809, -0.1758676916360855, 0.10941239446401596, 0.6202441453933716, 0.6288353204727173, -0.03698290139436722, 1.0550099611282349, -0.26271218061447144, -1.7037323713302612, -0.5768996477127075, 0.050066184252500534, -0.26183345913887024, 0.5186941027641296...
def end _ episode _ ( self, reward, total _ reward, step _ number ) : if not self. eval _ mode : # for dqn self. _ store _ transition ( self. _ observation, self. action, reward, true ) # replay buffer for rpg. self. replay _ buffer _ temp. add ( self. _ observation, self. action, reward, true ) count = step _ number w...
[ -0.2527458071708679, -0.08939376473426819, 0.6531568169593811, -0.6948150992393494, 0.8285178542137146, -0.04131610691547394, 0.16754357516765594, 0.10875595360994339, -0.13462604582309723, 0.7004756927490234, -0.7124943137168884, -0.16086751222610474, -0.04772065952420235, -0.592770814895...
def choose _ random ( self ) : # first get random weight where we will stop random _ weight = random. random ( ) * self. total _ weight for position, actual _ weight in enumerate ( self. weights ) : random _ weight - = actual _ weight if random _ weight < 0 : return self. items [ position ]
[ -0.005312408786267042, -0.9878948926925659, 0.6092315912246704, 0.26776227355003357, -0.007832911796867847, 0.6116353869438171, 0.11742401123046875, -0.5834251642227173, -0.2641652226448059, 0.19513775408267975, 0.4973996877670288, -0.6147955060005188, -0.9305994510650635, -0.0501230843365...
def check _ backends ( config _ file, backend _ timeout = 30 ) : app = load _ app _ from _ config ( config _ file ) # these dicts will hold the pids of any child processes that we fork. # a try - finally is used to ensure they're cleaned up at function exit. running _ procs = { } hung _ procs = { } try : # dicts to hol...
[ 0.27118590474128723, -0.07892167568206787, 0.7034865617752075, 0.43903425335884094, 0.5129098296165466, -0.12387502193450928, -0.01822943612933159, -0.12741447985172272, -0.7925247550010681, 0.8950817584991455, -0.37724149227142334, 0.28780218958854675, -0.3599027991294861, -0.004340413957...
def get _ transition _ matrix ( self ) : return self. trmtx
[ -0.9982985258102417, -0.24570319056510925, 0.15309534966945648, -0.27353188395500183, 0.11760173738002777, 0.06941325962543488, 0.02147563174366951, -0.18501843512058258, 0.01324230432510376, -0.11783033609390259, -0.9473729729652405, 0.29984384775161743, -0.2724991738796234, -0.5594177246...
def _ path _ relative _ to _ root ( self, path ) - > str : absolute _ path = get _ absolute _ path ( path, base = self. directory ) return cast ( str, get _ relative _ path ( absolute _ path, base = self. working _ dir, strict = true ) )
[ -0.17950314283370972, -0.5405188202857971, 0.489262193441391, 0.1787470430135727, -1.0970267057418823, 0.5042756795883179, -0.14741015434265137, -1.5196735858917236, 0.34750235080718994, 0.5600707530975342, 0.9687220454216003, 0.34939607977867126, -0.3415108323097229, 0.028182560577988625,...
def calc _ edge _ exp _ pr ( subj _ df, q _ state _ idx ) : edge _ count _ d = get _ edge _ count _ d ( subj _ df, q _ state _ idx ) row = subj _ df. iloc [ q _ state _ idx ] if not row ['question'] : assert false, " not a question state " edge = row ['edge'] altedge = row ['altedge'] edge _ count = edge _ count _ d [ ...
[ 0.4782836139202118, 0.29295119643211365, 0.6520896553993225, -0.6965672373771667, -0.05351033806800842, 0.9078896641731262, -0.049587078392505646, 0.5228217840194702, 1.3209339380264282, 0.42366543412208557, 0.9292860627174377, -0.055288124829530716, -0.08499432355165482, -0.55093389749526...
def turn _ off ( self, * * kwargs ) - > none : if not self. _ node. fastoff ( ) : _ logger. debug ('unable to turn on light.')
[ 0.30118483304977417, 0.8983092904090881, 0.16592949628829956, 0.1592532843351364, 0.6778619885444641, 0.09426921606063843, 0.28701335191726685, 0.04387697950005531, -0.9602205157279968, -0.9573124647140503, -0.6099944114685059, 0.49056458473205566, -0.015937408432364464, 0.6944496035575867...
def bayesian _ quad _ lesbegue ( f, n _ dim, ranges, sample _ size, kernel = none, random _ samples = true, verbose = true ) : start = datetime. datetime. now ( ) if verbose : print start if kernel is none : kernel = gpy. kern. rbf ( n _ dim, ard = true ) # generate sample points assert n _ dim = = len ( ranges ) if ve...
[ 0.9317090511322021, 0.5218098163604736, 1.0230408906936646, 0.6783552169799805, 0.36654505133628845, -0.5317522883415222, -0.693146288394928, -0.18609075248241425, -1.1872371435165405, 0.0615483894944191, -0.48880574107170105, 0.0516342855989933, -0.7568700313568115, 0.7526635527610779, ...
def attack ( attacker : dict, defender : dict ) - > int : miss _ chance = random. randint ( 1, 10 ) if miss _ chance = = 1 : # 10 % chance to miss print ('the attack from ', attacker ['name']. title ( ),'missed!') return 0 else : damage = random. randint ( 1, ( attacker ['hit _ die'] ) ) print ( attacker ['name']. titl...
[ -0.8243547081947327, -0.2777865529060364, 0.8385248780250549, -0.818918764591217, 0.3747587203979492, -0.25601518154144287, -0.028568973764777184, 0.9614741802215576, -0.2545982897281647, 0.6220623850822449, 1.1227706670761108, 0.1682891845703125, 0.05893279239535332, -0.28023454546928406,...
def _ _ init _ _ ( self, p, eps, device = none, tol = 1e - 5 ) : self. p = p self. eps = eps self. tol = tol self. device = device if device is not none \ else torch. device ('cuda : 0'if torch. cuda. is _ available ( ) else'cpu')
[ 0.7021626830101013, 0.6031003594398499, 0.5692726969718933, 0.7105719447135925, -0.3430676758289337, 0.45383045077323914, 0.13477230072021484, 0.9478294849395752, 0.14006544649600983, -0.4649537205696106, 0.42934632301330566, -0.44138461351394653, 0.05344643071293831, -0.8254916667938232, ...
def delete _ field ( field _ uri ) : root = t. deleteitemfield ( t. fielduri ( fielduri = field _ uri ) ) return root
[ -0.06479714065790176, 0.35477980971336365, 0.2666914463043213, -0.44875702261924744, 0.055310677736997604, 0.17931248247623444, 0.14509959518909454, 0.12282954901456833, 0.7463943362236023, -0.5269420742988586, -0.3240815997123718, -0.5140092968940735, -0.8943656086921692, -1.2328869104385...
def scooting _ player ( ) : menu = { " cases " : [ ], " string " : " " } listing = db. table ( " players " ). all ( ) for i in range ( len ( listing ) ) : menu [ " cases " ]. append ( str ( i + 1 ) ) menu [ " string " ] + = f " { listing [ i ] ['lastname'] } { listing [ i ] ['firstname'] } ( { i + 1 } ) \ n " if menu [...
[ -0.7504029870033264, -0.0590083934366703, 0.529857337474823, -0.14258554577827454, -0.20219232141971588, -0.36727839708328247, -0.285983681678772, 0.5691201686859131, -0.2470065802335739, 0.5965911149978638, 0.3129214644432068, -0.5128381252288818, -0.4764569103717804, 1.0393623113632202, ...
def plot _ psd ( self, collapse _ epochs = true, collapse _ electrodes = false, * * kwargs ) : ydata = self. psd # average over axes if necessary ydata = ydata. mean ( axis = tuple ( [ x for x in range ( 2 ) if [ collapse _ epochs, collapse _ electrodes ] [ x ] ] ) ) self. _ plot _ spectrum ( ydata, * * kwargs )
[ -0.5783680081367493, 0.8112003803253174, 0.5050542950630188, 0.10757707059383392, -0.3773958384990692, 0.07523034512996674, 0.41434183716773987, 0.46178770065307617, -0.38868749141693115, -0.8161371946334839, 0.7575543522834778, 0.3560938239097595, 0.024553760886192322, 0.8022415041923523,...
def _ _ init _ _ ( self, redis _ instance ) : super ( zset, self ). _ _ init _ _ ( ) self. redis _ instance = redis _ instance self. set _ key =''. join ( [ choice ( string. ascii _ letters + string. digits ) for n in xrange ( 5 ) ] )
[ -0.6887155771255493, 0.8850072622299194, 0.3280593454837799, -0.8669757843017578, -0.9995155334472656, -0.5551760792732239, 0.1650885045528412, -0.23767705261707306, 0.4587789475917816, 0.40107813477516174, -0.6402180790901184, -0.052862562239170074, -0.18632885813713074, 0.290345460176467...
def add _ tool ( self, key, func = none, bitmap = none, info ='', widget = none, * * args ) : # print'add _ tool ', self, key, func id = wx. newid ( ) if not args. has _ key ('name') : name = string. capitalize ( key ) else : name = args ['name'] if widget is not none : # tool is a widget self. toolbar. addcontrol ( wi...
[ -0.18042223155498505, 0.3738993704319, 0.6362413167953491, -0.2139602154493332, -0.42051583528518677, 0.21026407182216644, 0.5458747148513794, -0.4077247977256775, -0.2481599897146225, -0.5595031976699829, -0.7110244035720825, -0.844605565071106, -0.10096638649702072, 0.8187555074691772, ...
def remove _ crud ( string ) : if ". " in string : string = string. rstrip ( " 0 " ) string = string. lstrip ( " 0 " ) string = string. rstrip ( ". " ) return string
[ 0.8961578011512756, -0.9812173843383789, 0.6106321811676025, -0.3888581693172455, -0.45426541566848755, 0.07497004419565201, 0.5944259166717529, 0.46215298771858215, 0.6035115718841553, -0.36476370692253113, 0.3763827085494995, 0.34881797432899475, -0.33447182178497314, -0.2437876164913177...
def gen _ simple _ job _ string ( model, data _ params, unique _ id ) : job _ string = data _ params ['dataset'] job _ string + = " _ pytorch _ " job _ string + = model. type if model. sparsity : job _ string + = " _ sparse " if model. convolve _ patterns : job _ string + = " _ convpat " if model. final _ pwm _ scale :...
[ -0.3349631726741791, -0.3036973178386688, 0.6604721546173096, -0.4455207586288452, -0.20058318972587585, 0.7795587778091431, -0.23326753079891205, 0.279755562543869, -0.48532119393348694, -0.20183932781219482, -0.7251071929931641, -0.23728284239768982, 0.17973385751247406, -0.2312248945236...
def _ expand _ global _ features ( b, t, g, bct = true ) : if g is none : return none g = g. unsqueeze ( - 1 ) if g. dim ( ) = = 2 else g if bct : g _ bct = g. expand ( b, - 1, t ) return g _ bct. contiguous ( ) else : g _ btc = g. expand ( b, - 1, t ). transpose ( 1, 2 ) return g _ btc. contiguous ( )
[ 0.7699989080429077, 0.9441511631011963, 0.9195331931114197, 0.6408162713050842, 0.21454261243343353, -0.038809265941381454, 0.4900171458721161, 0.5749717950820923, -0.8248156905174255, 0.8986013531684875, -0.1257869005203247, 0.7659600377082825, -1.010936975479126, -0.4582032263278961, -...
def read _ indirect _ parameters ( working _ dir ) : path = get _ indirect _ parameters _ path ( working _ dir ) if not path. exists ( ) : return { } data = yaml. safe _ load ( path. read _ text ( ) ) if not isinstance ( data, dict ) : raise errors. operationerror ( " run parameters must be a dictionary. " ) return dat...
[ -0.501937747001648, -0.47507280111312866, 0.5364187955856323, -1.090571641921997, -0.783452033996582, 0.4451514184474945, 0.179295614361763, -0.1996263563632965, -1.1217836141586304, 1.4400304555892944, -0.1495395302772522, 1.423804759979248, -0.24891817569732666, 0.04171696677803993, 0....
def predict _ submissions ( model, write _ masks = true, submission _ file = none, patches _ predicted = false ) : # load 608x608 test images images608 = load _ test _ images ( ) # split each of them into 4 400x400 images images400 = split _ 608 _ to _ 400 ( images608 ) # predict their mask print ( " predicting test im...
[ -0.265440970659256, -0.7722011208534241, 0.6031684279441833, 0.6914669871330261, -0.10018259286880493, 0.1309663951396942, 0.7980158925056458, -0.13446040451526642, -0.10829709470272064, -0.05939836427569389, -0.2347160428762436, 0.06581025570631027, 0.1750999540090561, 0.5818031430244446,...
def flash _ led ( self ) : raise notimplementederror ( " the method not implemented " )
[ 0.37170007824897766, 0.07342490553855896, 0.4349907338619232, 0.4445909559726715, -0.44944748282432556, 1.5908066034317017, 0.5132455825805664, -0.21923589706420898, 0.46588099002838135, 0.019144803285598755, -1.0779567956924438, 0.5785818099975586, -0.369899719953537, 1.3611818552017212, ...
def diff _ keys ( self, other ) : # type : ( udmofficeobject ) - > set [ str ] assert type ( self ) = = type ( other ) result = { } fieldls = other. udm _ object _ reference. oldattr. keys ( ) for field in fieldls : own _ value = self. udm _ object _ reference. oldattr. get ( field, none ) other _ value = other. udm _ ...
[ -0.569304347038269, -0.20195481181144714, 1.0038295984268188, -0.6437748074531555, -0.1310441941022873, -0.5347873568534851, 0.04349684342741966, -1.1756024360656738, -0.5018392205238342, 0.03589605912566185, -0.681810200214386, 0.48696890473365784, 0.17102943360805511, 0.11712178587913513...
def six _ with _ metaclass ( meta, * bases ) : # this requires a bit of explanation : the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass ( type ) : def _ _ new _ _ ( cls, name, this _ bases, d ) : return meta ( name, bases...
[ 0.010105526074767113, 0.42235246300697327, 0.7155774831771851, 0.217094287276268, -0.7366107106208801, -0.4582219421863556, -0.2958300709724426, -0.7332068681716919, 0.6086847186088562, 0.05452911928296089, -0.5799591541290283, -0.5032342672348022, 0.95804762840271, 0.19760745763778687, ...
def render ( template, readme, user, verbose ) : if verbose : click. secho ( " render the'{ }'template... \ n ". format ( template ), bold = true, fg = " green " ) width = max ( len ( template ), len ( readme ), len ( user ) ) + 20 click. secho ( " template.......... { } ". format ( click. style ( template, fg = " yell...
[ 0.28846168518066406, 0.5260193943977356, 0.8360781073570251, 0.29463431239128113, -0.08889135718345642, -0.02513951063156128, -0.1415034979581833, 0.8734453320503235, -0.6200706362724304, 0.5163230299949646, -0.1682993322610855, -0.01648661121726036, -0.9868314862251282, 0.2060811966657638...
def test _ _ get _ covars _ from _ kwargs _ works ( covars ) : covars _ candidate _ float _ tensor = _ _ get _ covars _ from _ kwargs ( covars ) # cases where covars is a list if isinstance ( covars, list ) : for i in range ( len ( covars ) ) : assert covars _ candidate _ float _ tensor [ 0, i ]. item ( ) = = covars [ ...
[ -0.8577643632888794, -0.17374280095100403, 0.4083669185638428, 0.21145567297935486, 0.19217237830162048, 0.5610736608505249, 0.5655044913291931, -0.777364194393158, 0.07403004169464111, 0.06495226174592972, -0.40465423464775085, 0.366050124168396, -0.6641408205032349, 0.010734190233051777,...
def read _ envi ( hdr _ file ) : # read in parameter list in the header file params = [ ] with open ( hdr _ file,'r ', encoding ='utf - 8 ', errors ='ignore') as header : for line in header : params. append ( line. split ('=') [ 0 ]. strip ( ) ) # if parameter'byte order'is not found, append'byte order = 0'to the heade...
[ -0.0779678001999855, -0.5080517530441284, 0.7857868075370789, -0.17545920610427856, 0.03475246578454971, 0.4876432716846466, -0.3885352909564972, 0.5039979815483093, -0.8957502245903015, 0.9639864563941956, 0.6156771183013916, 0.1880674958229065, -0.22464148700237274, 0.7756878733634949, ...
def _ exec _ intern ( self, command ) : if command = = interns. exit : self. return _ load _ section = true self. _ running = false return true elif command = = interns. help : console. writedln ( self. _ actions. get ('_ helptext ','' ) ) return true elif command = = interns. save : save ( self. curr _ sec ) console. ...
[ -0.9270856976509094, 0.06590651720762253, 0.8976817727088928, 0.15934763848781586, 0.07932216674089432, 0.5330575108528137, -0.27001073956489563, -0.08623248338699341, -0.5397089123725891, -0.08485666662454605, -0.3206903338432312, -0.034675728529691696, -0.7729895710945129, 0.371194273233...
def normalize _ val ( self, val ) : if val < self. min _ time : return ( self. min _ time ) elif val > self. max _ time : return ( self. max _ time ) else : return ( int ( round ( ( val - self. min _ time ) / self. time _ step ) ) )
[ -0.35328209400177, 0.5728527903556824, 0.5008693337440491, 0.5677099227905273, -1.3168888092041016, 0.040749985724687576, -0.4511219263076782, -0.8271706700325012, 0.1994093656539917, 0.2399597465991974, 0.25711071491241455, 0.11602631956338882, -0.38184240460395813, 0.8075307011604309, ...
def prevsplit ( self ) : aw = self. activewindow ( ) _ hasfocus = aw and aw. hasfocus ( ) ind = self. tabwidgets. index ( self. currenttabwidget ) - 1 if ind = = - 1 : ind = len ( self. tabwidgets ) - 1 self. currenttabwidget. showindicator ( false ) self. currenttabwidget = self. tabwidgets [ ind ] self. currenttabwid...
[ 0.0372447595000267, -0.5773263573646545, 0.508071780204773, -0.7460341453552246, -0.8691949248313904, 0.5036828517913818, 1.8882710933685303, 0.6830366849899292, 0.1779337078332901, 0.2016357034444809, 0.1916496604681015, -0.1958070993423462, -0.7287330031394958, -0.020870890468358994, 0...
def condition _ yaw ( heading, speed, direction, relative = true ) : if relative : is _ relative = 1 # yaw relative to direction of travel else : is _ relative = 0 # yaw is an absolute angle # create the condition _ yaw command using command _ long _ encode ( ) msg = vehicle. message _ factory. command _ long _ encode ...
[ 0.3048865795135498, -0.7512896060943604, 0.7983909845352173, 0.029285477474331856, -0.30522844195365906, 0.06947518140077591, 0.3878496289253235, 0.7004979252815247, 0.07218290865421295, 0.25472989678382874, 0.3893233835697174, 0.4435838758945465, 0.09552691876888275, 0.5807986855506897, ...
def add _ path ( self, path ) : if not path. startswith ( " / " ) : path = " / { } ". format ( path ) return uribuilder ( scheme = self. scheme, userinfo = self. userinfo, host = self. host, port = self. port, path = normalizers. normalize _ path ( path ), query = self. query, fragment = self. fragment, )
[ -0.394034206867218, -0.07493017613887787, 0.5960162281990051, 0.6986268162727356, -0.6350207924842834, 0.8247345089912415, 0.14077356457710266, 0.3658093810081482, 1.0553841590881348, -1.4294520616531372, 0.5713548064231873, -0.8419253826141357, -1.4553245306015015, -0.7964548468589783, ...
def not _ found _ 404 ( request : request, exception : notfound ) - > json : return json ( { " message " : " oooooops! not found! ",'status': exception. status _ code,'error': exception. args [ 0 ],'results': none, }, status = exception. status _ code )
[ -1.2044179439544678, -1.1536847352981567, 0.4379844069480896, -0.4356124997138977, 0.4144526422023773, -0.6196563839912415, -0.055360447615385056, -0.4013698697090149, 0.13502533733844757, 0.7412971258163452, -0.2786656618118286, 0.3514131009578705, 0.10950314998626709, 0.16389787197113037...
def delete ( self ) : self. _ method _ not _ allowed ( )
[ 0.4866204559803009, 0.5756376385688782, 0.3369849622249603, 1.403975248336792, 0.4639246165752411, 0.4240027070045471, 1.076220154762268, -0.04539831355214119, 0.37357863783836365, -0.6219817399978638, 1.4407566785812378, 1.0082080364227295, -0.8413993716239929, 0.4174761176109314, 0.283...
def print _ images ( images, titles ) : for i in range ( 1, len ( images ) + 1 ) : tmp = plt. subplot ( 1, len ( images ), i ) tmp. set _ title ( titles [ i - 1 ] ) plt. imshow ( images [ i - 1 ], cmap ='gray') plt. show ( )
[ -0.30710524320602417, 0.5619281530380249, 0.4050920307636261, 0.015131168067455292, 0.007282283157110214, 0.47608068585395813, 0.14231447875499725, -0.12085509300231934, -0.24265822768211365, 0.07469848543405533, 0.864300012588501, 1.0180615186691284, -0.14304612576961517, 0.38821429014205...
def mi ( x, y, z = none, k = 3, base = 2 ) : assert len ( x ) = = len ( y ), " arrays should have same length " assert k < = len ( x ) - 1, " set k smaller than num. samples - 1 " x, y = np. asarray ( x ), np. asarray ( y ) x = add _ noise ( x ) y = add _ noise ( y ) points = [ x, y ] if z is not none : points. append ...
[ 0.7850872874259949, -0.11962141841650009, 0.7531414031982422, 0.5842514038085938, -0.7019674181938171, -0.48650604486465454, -0.34286266565322876, 0.00043387353071011603, 0.18099939823150635, 0.8586786389350891, 0.14714981615543365, -0.09879427403211594, -0.8040843605995178, -0.27988493442...
def calc _ container _ class _ factory ( contract _ type : contracttype ) - > calculationcontainer : if str ( contract _ type ) = = " 1 " : return employmentcalculationcontainer ( ) elif str ( contract _ type ) = = " 2 " : return mandatecalculationcontainer ( ) else : raise notimplementederror ( f " no specific impleme...
[ 0.17103980481624603, -0.07231515645980835, 0.7687754034996033, 0.04511762037873268, -0.20087584853172302, 0.2444150596857071, 0.6020007133483887, -0.9944804906845093, 0.2870328426361084, -0.692230761051178, 0.7108055949211121, -0.48256048560142517, 0.6685563921928406, 1.2314589023590088, ...
def getfeaturelist ( self ) : if self. _ featuretags is none : featurelist = self. featurelist featurerecords = featurelist. featurerecord self. _ featuretags = [ ] for featurerecord in featurerecords : tag = featurerecord. featuretag if tag not in self. _ featuretags : self. _ featuretags. append ( tag ) return self. ...
[ 0.2730615437030792, -0.4055197536945343, 0.3466339111328125, 0.6738631725311279, 0.5922279953956604, -0.759166955947876, -0.6780943870544434, 0.24318423867225647, -0.25340622663497925, -0.10755768418312073, -1.408293604850769, 0.47541964054107666, -0.5739839673042297, 1.5883370637893677, ...
def coarse _ stress _ pattern ( self ) - > sequence [ coarsestress ] : return [ word. pf. coarse _ stress _ pattern for word in self. words ]
[ 0.43095365166664124, -0.10243677347898483, 0.33433884382247925, 0.06403287500143051, 0.42969536781311035, 0.546845018863678, 0.4960157573223114, -0.09616073966026306, 0.3250362277030945, 0.6189410090446472, -1.520223617553711, 0.41121038794517517, -0.8876721262931824, 0.1730378121137619, ...
def sum _ nums ( n1, n2 ) : return n1 + n2
[ -0.549309253692627, 0.14166900515556335, 0.4114747941493988, 0.9282394051551819, 0.02738909423351288, 0.35733869671821594, -0.5101349353790283, -0.6849564909934998, -0.6290004253387451, -0.15348562598228455, -0.4788717031478882, 0.9820985198020935, 0.4557974338531494, -0.09347320348024368,...
def post ( self, request, id ) : new _ password = models. user. objects. make _ random _ password ( ) user = models. user. objects. get ( pk = id ) user. set _ password ( new _ password ) user. save ( ) messages. success ( request, f " { user. get _ full _ name ( ) }'s password has been reset. " ) return render ( reque...
[ -0.25210246443748474, 0.15676377713680267, 0.39062073826789856, 0.5177105665206909, 0.18984004855155945, -0.0809350535273552, 0.3062945008277893, -0.0613967590034008, 0.18941929936408997, 0.5033441781997681, -0.8162271976470947, 0.18310491740703583, 0.05203462764620781, 0.21857327222824097...
def count ( self, item ) : return self. _ execute _ script ('count ', self. key, self. client. encode ( item ) )
[ -0.7300792932510376, 0.08941405266523361, 0.4354919195175171, 0.39470145106315613, 0.30279380083084106, -0.3753446042537689, -0.3902808427810669, -0.6998019218444824, -0.15072712302207947, 0.8998645544052124, -1.5932822227478027, 0.0026327897794544697, -0.8452858924865723, -0.5186513066291...
def is _ correct ( date ) : try : date = datetime. datetime. strptime ( date,'% y - % m - % d'). date ( ) today = datetime. datetime. today ( ). date ( ) if date < today : print ('this date is overdue! unable to process flight search.'' please select today or a future date for travel.') return none return date except v...
[ -0.2678380608558655, 0.08950156718492508, 0.7142052054405212, 0.11738816648721695, -0.4926222264766693, 0.18531771004199982, -0.5492069125175476, -1.1821229457855225, 0.23460142314434052, -0.30520156025886536, 1.2188299894332886, 0.1232655867934227, -0.019903866574168205, 0.326112478971481...
def test _ connection _ do _ ping _ exception ( self, mock _ g, mock _ event _ logger, mock _ get _ sqla _ engine ) : database = get _ example _ database ( ) mock _ g. user = security _ manager. find _ user ( " admin " ) mock _ get _ sqla _ engine. return _ value. dialect. do _ ping. side _ effect = exception ( " an er...
[ -0.16232456266880035, 1.001438856124878, 0.3157370686531067, 0.47565650939941406, 0.7021517753601074, 0.6663404107093811, 0.1342313438653946, 0.18871866166591644, -0.019163506105542183, 0.5076931715011597, -0.23302800953388214, -0.5284135937690735, -0.28946733474731445, 0.325083464384079, ...
def test _ config _ build _ recognizer ( ) : repo _ dir = osp. dirname ( osp. dirname ( osp. dirname ( _ _ file _ _ ) ) ) config _ dpath = osp. join ( repo _ dir,'configs / recognition') if not osp. exists ( config _ dpath ) : raise exception ('cannot find config path') config _ fpaths = list ( glob. glob ( osp. join (...
[ -0.6171390414237976, -0.47908297181129456, 0.4277424216270447, 0.5128548741340637, 0.13769227266311646, 0.7861473560333252, 0.8014190196990967, 0.4033169746398926, -0.2381470948457718, 0.17316772043704987, -0.9079511165618896, -0.22535720467567444, 0.1835252046585083, 0.7238803505897522, ...
def tokenize _ text ( text, typeinput, maxlen, padding ='post') : tok = tokenizer ( ) tok. fit _ on _ texts ( text ) # integer encode the queries encoded _ text = tok. texts _ to _ sequences ( text ) # pad queries to a max length with zeros padded _ text = pad _ sequences ( encoded _ text, maxlen = maxlen, padding = pa...
[ -0.3471599221229553, 0.21764427423477173, 0.5672578811645508, -0.10985486954450607, -0.45693066716194153, 0.23457401990890503, -0.24718543887138367, -0.3752700388431549, 0.04876493662595749, -0.21726356446743011, -0.28845158219337463, 0.5124488472938538, -0.6567848324775696, 0.109671354293...
def finalize ( obj, up ) : res = up ( obj ) if isinstance ( res, schema ) : res = res. data if isinstance ( res, dict ) : res. pop ('_ notnull ', none ) return res
[ -1.2634806632995605, 0.018950659781694412, 0.48360010981559753, 0.0023300042375922203, -0.9021188616752625, -1.3149521350860596, -0.4573395252227783, -0.14700540900230408, 1.1192607879638672, 0.25462785363197327, -0.38599351048469543, 0.18829697370529175, -0.3466447591781616, -0.7729711532...
def wordsuggestion ( self, prefix : str ) - > list [ str ] : node = self. trie for w in prefix : if w not in node : return [ ] node = node [ w ] res = [ ] self. dfs ( prefix, res, node ) return res
[ -0.7523965835571289, 0.7228015661239624, 0.7455720901489258, -0.38537460565567017, -0.0684371069073677, -0.7052991390228271, -0.3870522975921631, 0.2917598783969879, -0.09813103824853897, 1.4604623317718506, 0.7165761590003967, 0.5494692325592041, -0.9819741249084473, 1.1301367282867432, ...
def read _ paper _ file ( ) : paper _ file = ". / 580 _ paper _ sample / master. csv " columns = [ " year ", " with ", " num _ auth ", " num _ coms ", " num _ con ", " num _ sem " ] df = pd. read _ csv ( paper _ file, usecols = columns, encoding = " utf8 " ) df = df [ df [ " with " ] = = 1 ]. drop ( " with ", axis = 1 ...
[ -0.5055447816848755, -0.054167307913303375, 0.5312080979347229, -0.1935867816209793, -0.5573210716247559, 0.3011474013328552, -0.18005216121673584, 0.63323974609375, 0.4649485647678375, 0.7820245027542114, 0.21245314180850983, 0.06677229702472687, 0.33129552006721497, -0.5235713124275208, ...
def dropout ( rate ) : def init _ fun ( rng, input _ shape ) : return input _ shape, ( ) def apply _ fun ( params, inputs, is _ training, * * kwargs ) : rng = kwargs. get ('rng ', none ) if rng is none : msg = ( " dropout layer requires apply _ fun to be called with a prng key " " argument. that is, instead of ` apply ...
[ -0.317293256521225, 0.357693076133728, 0.6024355292320251, 0.08136631548404694, 0.17238210141658783, -0.003527763532474637, 0.5131772756576538, 0.08407612144947052, 0.18146705627441406, 0.36076608300209045, 0.23524704575538635, -0.04134729132056236, -0.02479509823024273, 0.4327434599399566...
def shannon _ entropy ( row, rarefy = 0 ) : row _ sum, h = sum ( row ), 0 for val in row : val = val / row _ sum if val = = 0 : continue h + = val * math. log2 ( val ) if h < 0 : h * = - 1 return h
[ -0.5043094754219055, 0.6269354820251465, 0.413562148809433, 0.18336310982704163, -0.27021828293800354, -0.8472718596458435, -0.05906253680586815, 0.4199985861778259, 0.7542177438735962, 0.41027000546455383, 0.16719894111156464, 0.008950927294790745, 0.4358772337436676, -0.15694087743759155...
def get _ required _ manager ( self, manager _ type : type [ tmanager ] ) - > tmanager : manager = self. get _ manager ( manager _ type ) if not manager : raise keyerror ( manager _ type ) return manager
[ -0.7993837594985962, -0.5326007604598999, 0.18331529200077057, -0.4099356532096863, 0.3586389124393463, 0.12042470276355743, -0.48799607157707214, -1.118874192237854, 0.05979776754975319, -0.3069484531879425, 0.45659327507019043, 0.8946832418441772, -0.37523654103279114, 1.3419336080551147...
def apply _ mask ( bit, mask ) : id _ 01x, mask _ arr = process _ mask ( mask ) idx = id _ 01x [ - 1 ] bit = relabel _ bit ( bit, idx, mask _ arr [ idx ] ) return bit
[ -0.2111392766237259, -0.823085606098175, 0.4372826814651489, 0.8340152502059937, 0.16730207204818726, 0.14295443892478943, -0.2133788764476776, -0.5739428997039795, 0.24948737025260925, 0.0818602442741394, 0.6359440684318542, 0.9991106986999512, -0.5399699211120605, -0.2906832993030548, ...
def _ _ call _ _ ( self, img : union [ np. ndarray, torch. tensor ], mask : optional [ union [ np. ndarray, torch. booltensor ] ] = none, ) - > union [ np. ndarray, torch. tensor ] : if isinstance ( img, torch. tensor ) : img = img. repeat ( 3, 1, 1 ) img = img. permute ( 1, 2, 0 ) elif isinstance ( img, np. ndarray ) ...
[ -0.3219473659992218, 0.24397705495357513, 0.866584062576294, 1.5628223419189453, -0.47641104459762573, -0.1577899307012558, 0.6419587731361389, -0.3665392994880676, 0.5733833312988281, 0.5924009680747986, 0.8492168188095093, 0.35802990198135376, -0.6908911466598511, -0.11679205298423767, ...
def setnumberaccumulations ( number ) : return none
[ 0.465207040309906, 0.41471314430236816, 0.6107844114303589, -0.13297805190086365, -0.20707392692565918, -0.012137770652770996, 1.527098536491394, -0.6445345878601074, 1.2789695262908936, -0.8174044489860535, -0.3800615966320038, -0.060944389551877975, 1.0068045854568481, -0.037333674728870...
def get _ files ( self, file _ paths ) : results = [ ] def get _ file _ thunk ( path, interface ) : result = error = none try : result = interface. get _ file ( path ) except exception as err : error = err # important to print immediately because # errors are collected at the end print ( err ) content, encoding = resul...
[ -0.1339789479970932, 0.2694309651851654, 0.5960057973861694, 0.8807608485221863, 0.9140507578849792, -0.9840446710586548, 0.25002455711364746, -0.25576847791671753, -0.8648102879524231, 0.17338639497756958, 0.10720017552375793, -1.5007463693618774, -1.3864808082580566, 0.5164170861244202, ...
def find _ shortest _ path ( self, source _ index ) : return self. djikstra _ algo ( source _ index )
[ -0.2806558609008789, 0.6860705614089966, 0.009422855451703072, -0.0401444174349308, -0.8716562986373901, -0.6045264601707458, 0.9041071534156799, -0.12518350780010223, 0.753716766834259, 0.12852855026721954, -0.6039322018623352, -0.35876205563545227, -0.07603372633457184, -0.02763985097408...
def integer _ var _ dict ( keys, min = none, max = none, name = none, domain = none ) : dom = _ build _ int _ var _ domain ( min, max, domain ) res = { } if name is none : for k in keys : res [ k ] = cpointvar ( dom ) elif is _ string ( name ) : name = name + " _ " for i, k in enumerate ( keys ) : res [ k ] = cpointvar...
[ -1.081802487373352, 0.4989939332008362, 0.4024287462234497, -0.5032702684402466, -1.3180469274520874, -0.5844419002532959, -0.49018698930740356, -0.4160768687725067, -0.7820485234260559, 0.6604543924331665, -1.0928490161895752, 0.0327640138566494, -0.5136714577674866, -0.03940744325518608,...
def compute _ logsumexp _ loss ( feats _ type, logits ) : # nb batch _ size = logits. size ( 0 ) gold = v ( torch. zeros ( batch _ size ). long ( ) ) loss = nn. crossentropyloss ( ) # scores = nb x ncands loss = loss ( input = logits, target = gold ) return loss
[ -0.12617965042591095, 0.20682860910892487, 0.3309527635574341, 0.049573127180337906, 0.14652687311172485, 0.03954533487558365, -0.5704407095909119, 0.4532148241996765, 1.547460913658142, 0.21848641335964203, -0.03851703926920891, 0.44688308238983154, -0.12992048263549805, -0.77862727642059...
def italic ( text ) : return wrap _ html ( text, " i " )
[ -0.32021620869636536, -0.3724215030670166, 0.17086011171340942, 0.407656192779541, -0.477872371673584, 0.9862182140350342, -0.4294578731060028, 0.8184711933135986, -0.7880700826644897, 0.5866186618804932, 0.10971861332654953, -0.27771076560020447, -0.6965704560279846, -1.2924785614013672, ...
def test _ cancelling _ after _ cancellation _ period ( self, mock _ tz ) : mock _ tz. now. return _ value = datetime ( 2015, 2, 1, tzinfo = dt _ timezone. utc ) event = baker. make _ recipe ('booking. future _ ev ', date = datetime ( 2015, 2, 2, tzinfo = dt _ timezone. utc ), cancellation _ period = 48 ) booking = bak...
[ 0.9464325308799744, 0.8597894310951233, 0.5089759826660156, 0.7848222255706787, -1.1349725723266602, 1.547410488128662, -0.024487892165780067, 0.9723013043403625, 0.30666032433509827, -0.37862929701805115, 0.4306007921695709, -0.5626178979873657, 0.00705434987321496, 0.29809460043907166, ...
def move ( self ) - > optional [ move ] : moves = self. moves if len ( moves ) = = 1 : return moves [ 0 ]
[ -0.07189694046974182, 0.42513754963874817, 0.547075092792511, 1.0295195579528809, 1.1842676401138306, -0.44578540325164795, -0.2518155574798584, -0.7986560463905334, 0.7767325639724731, -0.3021525740623474, 0.5450738668441772, 0.2091812640428543, -0.9643226861953735, -0.20782320201396942, ...
def display ( self, y _ pos = 0, x _ pos = 0 ) : if not self. note _ state. exists ( ) : return false popped = self. note _ stack. pop ( ) if popped : index, note = popped [ 0 ], popped [ 1 ] note, height, width = self. dimensions ( note ) if not self. is _ clear ( y _ pos, x _ pos, height, width ) : return false self....
[ -0.13429321348667145, 0.5263974070549011, 0.9677416682243347, -1.0539216995239258, -0.14421850442886353, 0.6485974788665771, 0.024848785251379013, -0.8930034041404724, 0.39938902854919434, 1.2754805088043213, -0.4241301715373993, 0.3771597146987915, -0.23213812708854675, -0.877079665660858...
def test _ get _ villager _ statements ( ) - > none : player _ index = 0 result = villager. get _ villager _ statements ( player _ index ) assert result = = ( statement ( " i am a villager. ", ( ( 0, frozenset ( { role. villager } ) ), ) ), )
[ -0.3152253329753876, -0.5252339839935303, 0.10314645618200302, -0.032882917672395706, 0.40318092703819275, -0.6641055941581726, -0.2038571685552597, -0.5990056991577148, 0.30079731345176697, 0.34921565651893616, 0.4634593725204468, -0.3648395538330078, -1.105477213859558, -0.22578379511833...
def predictionsse ( self, trial, a, b ) : err = 0. 0 for t, element in enumerate ( trial ) : pred = element disc = 1. 0 for i in range ( 1, min ( self. predcount, len ( trial ) - t - 1 ) ) : pred = np. dot ( a, pred ) + b err + = np. dot ( pred - trial [ t + i ], pred - trial [ t + i ] ) * disc disc * = self. discount ...
[ 0.2558251619338989, 0.11237996816635132, 0.6507298350334167, -0.030145704746246338, 0.27680036425590515, 0.24950683116912842, -0.05898599699139595, 0.6984995603561401, 0.12256059050559998, 0.7566384673118591, 0.5563317537307739, 0.7087021470069885, -0.058748070150613785, 0.3018108904361725...
def add _ to _ parser ( self, parser, hidden = false ) : if hidden : self. _ kwargs ['help'] = argparse. suppress else : self. _ kwargs ['help'] = self. _ original _ help return parser. add _ argument ( * self. _ args, * * self. _ kwargs )
[ -0.1754494458436966, -0.5582481026649475, 0.8021357655525208, -0.62355637550354, -0.16556116938591003, 0.9733045697212219, -0.4400193691253662, -0.11011265963315964, -0.21254242956638336, -0.02020946703851223, -0.4081212282180786, 0.9638423919677734, -0.12488333135843277, 0.923541545867919...
def _ is _ selected ( name ) : if name in sys. argv : return true for group, names in _ state. groups. items ( ) : if group in sys. argv and name in names : return true return false
[ -1.1795021295547485, -0.3343937397003174, 0.42670878767967224, -0.06990151852369308, -0.1482151746749878, -0.9701167345046997, -0.1579049676656723, -0.5220154523849487, 0.08870081603527069, 0.22293490171432495, -0.5153351426124573, 0.3669675290584564, -0.32818788290023804, 0.88732898235321...
def shift _ tableau ( tableau, shape ) : return np. append ( np. roll ( tableau [ :, : - 1 ], shape [ 0 ], axis = 1 ), np. ones ( ( shape [ 0 ], 1 ) ), axis = 1 )
[ -0.43584907054901123, -0.037349265068769455, 0.8947867751121521, 0.41387489438056946, 0.13979162275791168, 0.8490429520606995, -0.7809731960296631, -0.45260435342788696, 0.0891387015581131, 0.7628651857376099, -0.024594755843281746, 0.6125951409339905, -0.06550013273954391, -0.046152718365...
def init ( uri, echo = false ) : global engine, _ metadata, jobs _ table, metadata _ table, logs _ table engine = sqlalchemy. create _ engine ( uri, echo = echo, convert _ unicode = true ) _ metadata = sqlalchemy. metadata ( engine ) jobs _ table = _ init _ jobs _ table ( ) metadata _ table = _ init _ metadata _ table ...
[ -0.4309559166431427, 0.7538657188415527, 0.7805793285369873, 0.8271204233169556, 0.9414013028144836, 0.1737045794725418, -0.1840679943561554, -0.03728540241718292, -1.478666067123413, -0.017424235120415688, -0.46616241335868835, 0.3536587357521057, 0.3362849950790405, 0.43668973445892334, ...
def lower _ xlim ( self ) : return self. axes. viewlim. intervalx
[ 1.0313825607299805, -0.24933628737926483, 0.4359138309955597, 0.023556219413876534, -1.0664700269699097, 0.8197327852249146, 0.24375006556510925, -0.8677535057067871, 0.6159327626228333, -1.1504048109054565, 0.18385744094848633, 0.9136751890182495, -1.2612663507461548, -1.0011425018310547,...
def save _ to _ obj ( self, path, scale = 1 ) : if not self. verts is none : verts = self. verts. copy ( ) * scale with open ( path,'w') as fp : for v in verts : fp. write ('v % f % f % f \ n'% ( v [ 0 ], v [ 1 ], v [ 2 ] ) ) for f in self. faces + 1 : fp. write ('f % d % d % d \ n'% ( f [ 0 ], f [ 1 ], f [ 2 ] ) ) if ...
[ -0.4429919421672821, -0.5739868879318237, 0.9105435609817505, -0.36188995838165283, -0.3815813660621643, 0.18392443656921387, 0.6089008450508118, -1.5340014696121216, -0.6597673892974854, 0.8383256793022156, -1.1998519897460938, -0.5545290112495422, 0.325932115316391, 0.15332676470279694, ...
def nextcache ( self, username ) : lastlogbook = self. lastlogbookentrybyuser ( username ) nextcache = none if lastlogbook is none : # todo : maybe this could be made less static. nextcache = geocache. select ( ). where ( geocache. cachename = = " bib - eingang " ). get ( ) elif lastlogbook. cache = = lastlogbook. cach...
[ -0.02371908724308014, -0.28415918350219727, 0.5428798198699951, 0.7625272274017334, -0.7384607791900635, -0.08624044805765152, 0.1582733541727066, -0.6445584893226624, -0.05398325249552727, 0.36776503920555115, 0.7144071459770203, -0.3679962158203125, -0.7417585849761963, 0.048793286085128...
def ask _ action ( username, my _ input ) : if my _ input = = " sleep " or my _ input = = " sleep " : # good choice sleep ( delay ) print ( " amazing! good job, ", username, "! you have found their weakness! goblins can't see sleeping people... " ) sleep ( delay ) print ( " as you awake, you notice some golden coins on...
[ -0.3614261746406555, -0.7193479537963867, 0.6707659959793091, 1.0646657943725586, 0.31828612089157104, 0.7500508427619934, 0.39175817370414734, -0.4410262107849121, 0.12136711180210114, 0.024547461420297623, 0.0790465921163559, 0.9558876156806946, -0.4002939760684967, -0.296258807182312, ...
def sell _ product ( request ) : if request. method = ='get': product _ form = productform ( ) template _ name ='create. html'return render ( request, template _ name, {'product _ form': product _ form, } ) elif request. method = ='post': form = productform ( request. post, request. files ) form _ data = request. post ...
[ -0.6276578307151794, -0.45418068766593933, 0.8363783359527588, 0.3533075749874115, 0.5787903070449829, 1.1561927795410156, 0.6012885570526123, 0.17567051947116852, 0.308639794588089, -0.33879685401916504, 0.22693122923374176, -0.27520015835762024, 0.1366119533777237, 0.5862584114074707, ...
def store _ to _ cloudinary ( image _ path ) : try : cloudinary. config ( cloud _ name = settings. cloud _ name, api _ key = settings. api _ key, api _ secret = settings. api _ secret ) cloudinary _ response = cloudinary. uploader. upload ( image _ path ) response = {'error':'','status': true,'cloudinary _ response': c...
[ -1.1544479131698608, -0.12713761627674103, 0.6468289494514465, -0.4940966069698334, 0.6231449842453003, -0.2636185884475708, -0.08047719299793243, -1.0841199159622192, 0.3162834942340851, 0.563386082649231, -1.0617929697036743, -0.3887549936771393, -0.8886380195617676, 0.67042076587677, ...
def fitsol _ deriv ( self, xfit = none, idx = none ) : if xfit is none : xfit = self. _ detns if self. _ fitdict ['coeff'] is not none : cder = np. polyder ( self. _ fitdict [ " coeff " ] ) if idx is none : return np. polyval ( cder, xfit / self. _ fitdict [ " scale " ] ) / self. _ fitdict [ " scale " ] else : return n...
[ 0.2461768090724945, -0.7666327953338623, 0.8498271107673645, -0.5779465436935425, -0.5200809836387634, 0.15129710733890533, -0.8952184915542603, -0.8946000337600708, 0.23030853271484375, -0.8847941756248474, 0.17807137966156006, 0.9505956768989563, -0.6773517727851868, -0.4880920648574829,...
def check _ qmk _ firmware ( ) : qmk _ firmware = path ( os. environ ['qmk _ home'] ) qmk _ cli = qmk _ firmware /'bin'/'qmk'if qmk _ firmware. exists ( ) and not qmk _ cli. exists ( ) : cli. log. error ( " { fg _ red } can't find % s / bin / qmk! you need to ` git pull `. ", os. environ ['qmk _ home'] ) return false e...
[ 0.4923475384712219, 0.4914636015892029, 0.49127838015556335, -0.09589371830224991, -0.34147539734840393, 0.24358929693698883, -0.15367722511291504, -0.48057982325553894, -0.4004179835319519, -0.4802915155887604, 0.1933353692293167, -0.5608168244361877, -0.6116807460784912, 1.29450082778930...
def write _ model ( self, experiment _ name : str, model : str, total _ folds : int, fold : int = none ) : pass
[ -0.965936005115509, 0.12593603134155273, 0.4565814137458801, 0.5545047521591187, 0.3109431266784668, 0.4617515206336975, 0.3264124393463135, 0.666968584060669, -0.03728335723280907, 0.31925153732299805, -0.6543135046958923, -0.49868232011795044, 0.12757830321788788, -0.21921919286251068, ...
def cast ( * args ) : return _ itkimageserieswriterpython. itkimageserieswriterid3id2 _ cast ( * args )
[ -0.49297621846199036, -0.7888428568840027, 0.2595618963241577, -0.5828294157981873, 0.0971812829375267, 1.1626768112182617, -0.7323893904685974, -0.3859131336212158, 0.33343634009361267, 1.5628483295440674, -0.10573399066925049, 0.5932848453521729, -0.9196571111679077, -0.10573317855596542...
def get _ washrooms ( ) : results = [ ] query = washroom. query try : query = apply _ filters ( query, request. args ) except valueerror as err : return jsonify ( err. args [ 0 ] ), 400 for w in query. all ( ) : results. append ( parse _ washroom ( w ) ) return jsonify ( results )
[ -1.268452763557434, 0.568510890007019, 0.7885163426399231, 0.4941164553165436, 0.23270545899868011, -0.5596520304679871, -0.04403344914317131, -0.6895575523376465, -0.25215551257133484, 0.14151836931705475, -0.4156303405761719, 0.2675668001174927, 0.18702130019664764, 1.4790332317352295, ...
def register _ blueprints ( app ) : app. register _ blueprint ( general. general ) app. register _ blueprint ( verification. verification _ bp, url _ prefix ='/ v1') # all done! app. logger. info ( " blueprints registered " )
[ 0.5967881679534912, 0.10682479292154312, 0.40841779112815857, 2.0196001529693604, 1.643519639968872, 0.7826775312423706, -0.2836664617061615, -0.2340351939201355, 0.3668743968009949, 0.3406743109226227, -0.5654106140136719, 1.098333477973938, 0.08316957950592041, 0.7827090620994568, 0.35...
def loopforever ( self ) : while not rospy. is _ shutdown ( ) : if self. dbw _ enabled : # calculate and publish dbw commands. throttle, brake, steering = self. controller. control ( self. linear _ vel, self. angular _ vel, self. current _ vel ) self. publish ( throttle, brake, steering ) else : # the controller needs ...
[ 0.8711745142936707, 0.2028413712978363, 0.268718421459198, 0.5894893407821655, 1.1639034748077393, -0.2835720181465149, 0.20712710916996002, -0.9243530631065369, -0.0822402834892273, -0.8042808771133423, 0.8507881760597229, 0.1720452755689621, -1.0510984659194946, 0.6159254908561707, 0.6...