text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def total _ labour ( self ) - > float : return sum ( [ c. e for c in self. cs ] ) | [
0.2871820032596588,
-0.20100222527980804,
0.26860925555229187,
-0.7529630064964294,
0.5847174525260925,
0.7106260061264038,
-0.018570972606539726,
0.2200780212879181,
0.24839869141578674,
0.14170058071613312,
-0.5522541403770447,
-0.5505803823471069,
-0.31700366735458374,
0.055412009358406... |
def save _ conv2d _ outputs ( model, image, base ) : cmap = plt. get _ cmap ( amfconfig. get ('colormap') ) submodels = amfmodel. get _ feature _ extractors ( model ) zipf ='{ } _ layer _ outputs. zip '. format ( os. path. splitext ( base ) [ 0 ] ) zipf = os. path. join ( amfconfig. get ('outdir'), zipf ) with zf. zipf... | [
-0.3131807744503021,
-0.8263015747070312,
0.7275978922843933,
0.28031569719314575,
-0.5231979489326477,
-0.47796785831451416,
0.45833733677864075,
-0.32654115557670593,
-0.6159145832061768,
0.3730882406234741,
-0.6871093511581421,
-0.21303799748420715,
0.42559242248535156,
0.71924692392349... |
def _ interface _ up ( self, interface ) : interface _ addrs = psutil. net _ if _ addrs ( ). get ( interface ) or [ ] inet6 = socket. af _ inet6 in [ snicaddr. family for snicaddr in interface _ addrs ] inet4 = socket. af _ inet in [ snicaddr. family for snicaddr in interface _ addrs ] return ( inet4 or inet6 ) | [
-0.5753877758979797,
0.7169709205627441,
0.5917749404907227,
-0.17978686094284058,
-0.27340513467788696,
-1.2321962118148804,
-0.023905405774712563,
-0.15802441537380219,
0.47336557507514954,
0.2715989649295807,
0.116328664124012,
-0.9434020519256592,
-0.8081598281860352,
-0.04776397347450... |
def socket ( self ) : return self. _ sock | [
-0.004934199620038271,
0.2272842973470688,
0.27284547686576843,
0.12226960808038712,
-0.3813421130180359,
0.7740917205810547,
1.1994599103927612,
0.00007217851816676557,
0.9660701751708984,
-2.224771738052368,
0.7178283929824829,
1.6677147150039673,
-0.39250418543815613,
-0.874826848506927... |
def get _ min _ num ( self, request, obj = none, * * kwargs ) : return 0 | [
-1.4027771949768066,
-0.6322397589683533,
0.589863121509552,
1.2289600372314453,
0.4074721038341522,
0.126448854804039,
0.5793672800064087,
-0.41545137763023376,
0.8378731608390808,
-1.638490080833435,
-0.25640273094177246,
0.2466338574886322,
-0.3960476517677307,
0.38022738695144653,
-0... |
def patch ( org _ id, membership _ id ) : # pylint : disable = unused - argument role = request. get _ json ( ). get ('role') membership _ status = request. get _ json ( ). get ('status') notify _ user = request. get _ json ( ). get ('notifyuser') updated _ fields _ dict = { } origin = request. environ. get ('http _ or... | [
-0.017359640449285507,
-1.0113786458969116,
0.8888729810714722,
0.15860652923583984,
-0.40848594903945923,
0.028892170637845993,
0.0649481937289238,
0.22552339732646942,
0.5288647413253784,
0.7909471988677979,
0.0031147843692451715,
1.0224738121032715,
-0.3408668339252472,
0.13886354863643... |
def simulatecomptonscenario ( particlecount, particleenergy, nocomptroneventsperparticle, material = " water " ) : " " " prepare containers to save particles trajectories and newly generated particles " " " photonwaves = [ ] electronwaves = [ ] " " " generate n particles with uniform distribution of angles and gamma di... | [
0.539231538772583,
0.19841808080673218,
0.8271954655647278,
-0.17057843506336212,
-0.22740472853183746,
0.11396612972021103,
0.686866283416748,
0.005309603177011013,
-0.10306308418512344,
0.04933090880513191,
-0.1849304437637329,
-0.04334408789873123,
-0.2875674068927765,
0.499094516038894... |
def fast _ jl _ transform ( a, k ) : ( d, n ) = a. shape q = np. min ( [ 1, np. log ( d ) * * 2 / n ] ) d _ act = nextpow ( d ) sc _ ft = np. sqrt ( d _ act / float ( d * k ) ) d = random. randint ( 0, 2, size = ( d, 1 ) ) * 2 * sc _ ft - sc _ ft da = np. zeros ( ( d _ act, n ) ) da [ 0 : d, : ] = a * d print ( d. shap... | [
0.2857225239276886,
-0.204992413520813,
0.8111205101013184,
-0.7307661175727844,
-1.2731910943984985,
-0.456443190574646,
0.5790302157402039,
0.47832444310188293,
1.0964609384536743,
0.315769761800766,
0.4160137176513672,
0.07877855747938156,
0.8706746697425842,
0.14168833196163177,
-0.3... |
def slope ( x0, y0, x1, y1 ) : if x0 = = x1 : return 0 return 1. 0 * ( y0 - y1 ) / ( x0 - x1 ) | [
0.5842190980911255,
-0.5611628293991089,
0.5445999503135681,
0.2759021818637848,
0.3386589586734772,
0.012995591387152672,
-0.6435122489929199,
-0.3370719254016876,
-0.8710552453994751,
-0.13264834880828857,
-0.04924093559384346,
0.3122386634349823,
0.16431115567684174,
0.35843509435653687... |
def notify ( self, event ) : if isinstance ( event, tickevent ) : if self. state = = game. state _ preparing : self. start ( ) | [
0.2158534675836563,
0.6655847430229187,
0.7221864461898804,
1.1014788150787354,
0.23465751111507416,
-0.20842809975147247,
0.23348870873451233,
-0.027947256341576576,
0.646816611289978,
0.04196338355541229,
-0.5644024610519409,
-0.06697145849466324,
0.678027331829071,
0.8130797743797302,
... |
def test _ errorraisingcallback ( self ) : sd = synchronousdeferred ( " foo " ) def callback ( ignored ) : 1 / 0 sd. addcallback ( callback ) l = [ ] sd. adderrback ( l. append ) self. assertequals ( len ( l ), 1 ) self. asserttrue ( l [ 0 ]. check ( zerodivisionerror ) ) | [
0.7891427874565125,
1.186802625656128,
0.5591053366661072,
0.29223185777664185,
0.8603886365890503,
0.499810129404068,
0.021282166242599487,
0.39245370030403137,
0.6596734523773193,
-1.0262473821640015,
-0.5906981825828552,
-0.3395170271396637,
-0.6880744099617004,
1.306173324584961,
1.1... |
def test _ prepare _ attribute _ values _ prefer _ the _ slug _ match ( color _ attribute ) : # given existing _ value = color _ attribute. values. first ( ) second _ val = color _ attribute. values. create ( name = existing _ value. slug, slug = f " { existing _ value. slug } - 2 " ) attr _ values _ count = color _ at... | [
0.0585300512611866,
0.018404480069875717,
0.5426745414733887,
-0.4452686011791229,
0.9051967263221741,
-0.3889419436454773,
-0.04152083769440651,
-0.06737986952066422,
-0.7373360991477966,
-0.6197016835212708,
-0.2214614450931549,
0.08494651317596436,
0.9206068515777588,
0.5699090361595154... |
def linear _ gmm _ mar _ shap ( self, x, monte _ carlo = false, n = 50000 ) : m = len ( x ) va _ id = list ( range ( m ) ) if self. c [ 0 ]! = [ ] : for c in self. c : m - = len ( c ) va _ id = list ( set ( va _ id ) - set ( c ) ) m + = len ( self. c ) for c in self. c : va _ id + = [ c ] phi = np. zeros ( len ( x ) ) ... | [
0.781230628490448,
0.2630510926246643,
0.6351765990257263,
0.003481102641671896,
-0.7791621088981628,
0.3317381739616394,
-0.24181269109249115,
0.6110240817070007,
0.9809796214103699,
0.6038888692855835,
-0.5605655908584595,
0.27694758772850037,
-1.0695583820343018,
0.4303152859210968,
-... |
def remove _ field ( self, field ) : if not field or not isinstance ( field, field ) : raise valueerror ( " need to supply a field to remove element " ) self. _ datasourcetree. getroot ( ). remove ( field. xml ) self. _ refresh _ fields ( ) | [
-0.541390597820282,
1.2662471532821655,
0.24076402187347412,
-0.6265747547149658,
-0.4518446922302246,
0.3390786945819855,
-0.04060099646449089,
0.6227392554283142,
0.7238144874572754,
-0.31077972054481506,
-0.9211149215698242,
-0.36373698711395264,
-0.5619099736213684,
0.34477588534355164... |
def release ( ctx, version, # type : str dir, # type : str verbose # type : bool ) : ctx. verbose = verbose unreleased _ path = os. path. realpath ( os. path. join ( os. getcwd ( ), dir,'unreleased') ) version _ path = os. path. realpath ( os. path. join ( os. getcwd ( ), dir,'released') ) os. makedirs ( version _ path... | [
-0.08226662129163742,
-0.5070611834526062,
0.759261965751648,
-0.15767209231853485,
0.011868161149322987,
0.23188035190105438,
0.6145914196968079,
1.252221703529358,
0.2773439586162567,
0.5905498266220093,
-0.4450216293334961,
0.347308874130249,
0.12247943133115768,
0.6608471870422363,
-... |
def _ as _ np _ array ( self, json _ or _ tuple ) : if isinstance ( json _ or _ tuple, str ) : # json - serialized in the case of redis try : # return the point stored as list, without the extra data tuples = json. loads ( json _ or _ tuple ) [ 0 ] except typeerror : print ( " the value stored is not json - serilizable... | [
-1.603167176246643,
0.1275389939546585,
0.6090878844261169,
-0.8509302735328674,
0.22746571898460388,
0.16626755893230438,
-0.5745466947555542,
-0.3671204745769501,
0.6460408568382263,
0.46742838621139526,
0.19132791459560394,
0.7550818920135498,
-0.0073041594587266445,
-0.1719000786542892... |
def disambiguate ( self, word ) : matches = re. match ( r'^ ( [ bcdfghjklmnpqrstvwxyz ] ) em ( [ aiueo ] ) (. * ) $ ', word ) if matches : return matches. group ( 1 ) + matches. group ( 2 ) + matches. group ( 3 ) | [
-0.3303559720516205,
0.21088111400604248,
0.45341452956199646,
-0.2708614766597748,
0.49274560809135437,
0.5082942843437195,
-0.14498674869537354,
-0.18085810542106628,
0.6368205547332764,
0.3468770682811737,
-0.17823250591754913,
0.3470388650894165,
-0.7508018016815186,
-0.322971194982528... |
def detalles _ producto ( request, id ) : producto = producto. objects. get ( pk = id ) context = {'producto': producto } return render ( request,'gestion _ stock / detalles _ producto. html ', context ) | [
1.3425540924072266,
0.3935549557209015,
0.2764984667301178,
0.46192842721939087,
-0.10284649580717087,
0.736764669418335,
0.14225324988365173,
-0.4295670688152313,
0.3186003565788269,
0.2307477444410324,
0.017868390306830406,
0.5845717787742615,
1.1907166242599487,
0.1180410087108612,
-0... |
def duplicatezeros ( self, arr : list [ int ] ) - > none : # i = 0 # while i < len ( arr ) : # if arr [ i ] = = 0 : # if i + 1 < len ( arr ) : # arr. pop ( ) # arr. insert ( i + 1, 0 ) # i + = 2 # continue # i + = 1 tmp = arr [ : ] index = 0 for x in tmp : if x = = 0 and index < len ( tmp ) : arr [ index ] = x index + ... | [
-0.38986068964004517,
0.19329693913459778,
0.7399415969848633,
0.7299887537956238,
-0.25948795676231384,
0.4775976836681366,
1.7206310033798218,
0.3171185851097107,
1.1655436754226685,
0.06629334390163422,
-0.8841179013252258,
-0.14548316597938538,
-0.14511387050151825,
1.5613988637924194,... |
def prompt ( text ) : try : userresponse = int ( raw _ input ( text ) ) if ( userresponse < 1 ) or ( userresponse > 5 ) : return prompt ( " invalid choice enter 1 - 5 : " ) else : return userresponse except valueerror : return prompt ( " invalid choice enter 1 - 5 : " ) | [
-0.5631682872772217,
-0.5769102573394775,
0.4144020080566406,
0.44820988178253174,
-1.180985689163208,
0.5107125639915466,
0.8687191605567932,
-1.2471203804016113,
0.8458189964294434,
-0.20965397357940674,
-0.14995470643043518,
-0.4450405538082123,
-1.2646567821502686,
-0.5281816124916077,... |
def _ act _ undo ( self ) : previous _ state _ tree = self. _ current _ tree. find _ parent ( self. _ tree ) if previous _ state _ tree is not none : self. _ current _ tree = previous _ state _ tree [ 0 ] self. _ puzzle = previous _ state _ tree [ 1 ] return self. state ( ), false else : return'you have not made any mo... | [
-0.4344492554664612,
-0.4089948236942291,
0.7075416445732117,
-0.5150692462921143,
-0.2541891634464264,
-0.6037343740463257,
1.1295006275177002,
0.5969784259796143,
0.01758832484483719,
0.7092393040657043,
0.25906312465667725,
0.475850909948349,
-0.1503390371799469,
-0.9912319183349609,
... |
def assignpoints ( tbl, ctrs ) : points = [ ] for point in tbl : probs = [ ] for ctr in ctrs : sigma = 10 prob = np. exp ( - ( np. linalg. norm ( point - ctr ) / sigma ) * * 2 ) probs. append ( prob ) probs = np. array ( probs ) / sum ( probs ) points. append ( ( point, probs ) ) return points | [
0.36601126194000244,
-0.5707221627235413,
0.4068654477596283,
0.9154657125473022,
0.8887492418289185,
0.30274397134780884,
0.11785725504159927,
1.5924826860427856,
0.719321608543396,
0.9274607300758362,
0.0504409559071064,
-0.674697756767273,
0.26586151123046875,
0.3580901622772217,
-0.2... |
def code ( self ) - > optional [ str ] : return pulumi. get ( self, " code " ) | [
1.0800632238388062,
0.293192595243454,
0.43532341718673706,
0.6482032537460327,
1.1083507537841797,
0.9425557851791382,
-0.14316093921661377,
0.3042336106300354,
0.9570316076278687,
0.06336316466331482,
0.8378358483314514,
0.3133322596549988,
0.10863332450389862,
-1.0125336647033691,
-0.... |
def test _ redirect _ to _ user _ page _ if _ logged _ in ( self, * _ ) : # make sure we're logged out self. open ( base _ url +'/ logout') # open / login self. open ( base _ url +'/ login') # type in login info self. type ('# email ','test _ frontende @ test. com') self. type ('# password ','testfrontend #') # click t... | [
0.12385018169879913,
0.32442647218704224,
0.7079058289527893,
0.9013580679893494,
0.6079597473144531,
0.19039922952651978,
0.4421769380569458,
-0.22341935336589813,
0.37097808718681335,
-0.9375842809677124,
-0.4424273371696472,
0.4086584448814392,
0.14938251674175262,
-0.15303191542625427,... |
def get _ context _ data ( self, * * kwargs ) : context = super ( ). get _ context _ data ( * * kwargs ) try : comp _ pk = int ( kwargs ['comp _ pk'] [ : 6 ] ) # afkappen voor de veiligheid comp = ( competitie. objects. exclude ( is _ afgesloten = true ). get ( pk = comp _ pk ) ) except ( valueerror, competitie. doesno... | [
-0.0689460039138794,
0.23065215349197388,
0.8404380679130554,
0.19970455765724182,
-0.13747242093086243,
0.5122838616371155,
1.30048668384552,
-0.6085214018821716,
0.17056585848331451,
0.6080141663551331,
-0.28553327918052673,
0.1017521396279335,
-0.14059515297412872,
0.711916446685791,
... |
def _ _ init _ _ ( self, name, low, high, * args, * * kwargs ) : kwargs. update ( { " low " : low, " high " : high } ) super ( discreteuniform, self ). _ _ init _ _ ( name, * args, * * kwargs ) | [
-0.324711412191391,
0.659527599811554,
0.587826669216156,
-0.346754789352417,
0.8420419096946716,
0.37383973598480225,
-0.43011710047721863,
0.4046700894832611,
-0.04203229397535324,
-0.8222918510437012,
-1.2313036918640137,
0.17211656272411346,
0.5054547190666199,
0.4079892933368683,
0.... |
def get _ bov ( self, sentence ) : sentence = sentence. strip ( ) words = sentence. split ('' ) vec = [ 0 for _ in range ( self. vocab _ size ) ] for word in words : vec [ self. word _ dict [ word ] ] = 1 return vec | [
-0.2524929940700531,
0.5246216654777527,
0.5928667187690735,
0.04921606928110123,
0.41417261958122253,
-0.8846955895423889,
0.23043373227119446,
-0.046517349779605865,
0.07016316801309586,
0.7545948028564453,
-0.6063634753227234,
0.9865647554397583,
-0.09334027767181396,
0.3007513284683227... |
def test _ get _ module _ non _ exosims _ ok _ 1 ( self ) : module = " tests. testmodules. timekeeping. timekeepingmodified " modtype = " timekeeping " m = get _ module ( module, modtype ) self. validate _ module ( m, modtype ) | [
-0.570070743560791,
0.21175222098827362,
0.30016687512397766,
0.3280191421508789,
1.0854928493499756,
1.1615777015686035,
-0.45339733362197876,
-0.5336369872093201,
1.0036869049072266,
0.6999650597572327,
0.17444634437561035,
0.8979096412658691,
-0.17069044709205627,
0.6523466110229492,
... |
def insert ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.4815104305744171,
0.5301226377487183,
0.29141154885292053,
0.4188263714313507,
0.908989429473877,
0.560754120349884,
0.9434981346130371,
0.30331575870513916,
-0.5708160400390625,
-0.32311558723449707,
-1.349940299987793,
-0.34666600823402405,
-1.462061882019043,
0.24397680163383484,
-... |
def waveform _ sampling _ rate ( self ) : if self. _ waveform _ sampling _ rate is none and not ( self. units is none ) : for unit in self. units : if not ( unit is none ) and'sampling _ rate'in unit : self. _ waveform _ sampling _ rate = unit ['sampling _ rate'] break return self. _ waveform _ sampling _ rate | [
0.44232177734375,
0.10798613727092743,
0.2533367872238159,
-0.2675768733024597,
0.006502985954284668,
-0.38249292969703674,
-0.4455413818359375,
0.030839115381240845,
0.2685442268848419,
0.0906485915184021,
0.04874503239989281,
-0.31580114364624023,
-0.4996616244316101,
0.9271267056465149,... |
def bitwisenot ( a ) : # we don't use pythons ~ bc it is for signed integers and we receive # a wrong result return constants. wordmaxvalue - a | [
0.09112401306629181,
0.257515013217926,
0.4550154209136963,
-0.6113163828849792,
-0.779980480670929,
0.2508598268032074,
0.2829909324645996,
-0.36094802618026733,
0.285933256149292,
-0.13967978954315186,
-0.23412275314331055,
0.4958927035331726,
-0.8382413983345032,
0.6503577828407288,
-... |
def handle ( self, msg _ type ) : def wrap ( callback ) : self. _ handlers [ msg _ type ] = callback return callback return wrap | [
-0.6417176723480225,
-0.2202901840209961,
0.3419305086135864,
-0.08679664134979248,
0.316071480512619,
0.43242377042770386,
0.33629170060157776,
-0.8161006569862366,
0.7824047207832336,
-0.9070978760719299,
-0.0008738749893382192,
-0.03798454999923706,
-0.28438228368759155,
0.9218975901603... |
def first _ index ( x, y ) : for i, v in enumerate ( y ) : if numpy. array _ equal ( v, x ) : return i return - 1 | [
-0.21363838016986847,
-0.6040623784065247,
0.32866695523262024,
0.14487411081790924,
0.08070561289787292,
-0.2727711498737335,
-0.2976628839969635,
-0.7303361892700195,
0.18060773611068726,
0.8811600208282471,
0.11765100806951523,
0.9725995063781738,
0.11424446105957031,
0.1100180298089981... |
def build _ template _ error _ formatters ( ) : formatters = [ ] # formatter for mako import mako. exceptions def mako _ html _ data ( exc _ value ) : if isinstance ( exc _ value, ( mako. exceptions. compileexception, mako. exceptions. syntaxexception ) ) : return mako. exceptions. html _ error _ template ( ). render (... | [
-0.8551325798034668,
-0.8276312947273254,
0.628771185874939,
0.16536402702331543,
-0.23802176117897034,
-0.5244957208633423,
-0.1970711201429367,
0.5379971861839294,
0.065424844622612,
-0.4147120416164398,
-0.45630860328674316,
0.056325532495975494,
0.37962964177131653,
1.0774641036987305,... |
def delete _ portfoliohaircut ( request ) : if request. user. is _ stylist = ='yes': if request. method = ='post': haircut = portfoliohaircut. objects. get ( pk = request. post. get ('portfolio _ haircut _ pk') ) haircut. delete ( ) return redirect ( request. meta. get ('http _ referer') ) else : return redirect ('core... | [
0.021699251607060432,
-0.05260573327541351,
0.3764753043651581,
0.6709889769554138,
-0.1661161631345749,
0.8994554877281189,
0.538130521774292,
-0.0632777288556099,
0.6154394745826721,
0.42119917273521423,
0.6180800795555115,
0.42274078726768494,
-0.40531420707702637,
0.6359198093414307,
... |
def make _ cup _ name ( radunit, outercup, innercupser, innercupnum ) : return clinical. make _ cup _ name ( radunit, outercup, innercupser, innercupnum ) | [
-1.4596341848373413,
-0.7858790755271912,
0.6030750870704651,
-0.35403910279273987,
-0.5732663869857788,
0.24177969992160797,
-0.6650903820991516,
0.04602935537695885,
-0.37014690041542053,
-0.22040800750255585,
0.979816198348999,
0.17448222637176514,
0.5485341548919678,
-1.332488417625427... |
def check _ query ( cls, query ) : if not isinstance ( query, dict ) : raise badrequest ( " query type dict expected, not : % s " % type ( query ) ) if not " query _ args " in query : raise badrequest ( " query _ args expected in query " ) if query [ " queryexp " ]! = query _ exp _ id : raise badrequest ( " unknown que... | [
-0.639948844909668,
-0.030145151540637016,
0.3640224039554596,
-0.021250320598483086,
-0.11146208643913269,
0.41519901156425476,
-1.3083281517028809,
-0.08940411359071732,
0.1908784955739975,
0.2685585021972656,
0.7351800203323364,
0.19281993806362152,
-0.14555701613426208,
0.8706552982330... |
def nfvipop _ to _ internal ( pop ) : host = { } host [ " host _ name " ] = pop [ " id " ] host [ " gw _ ip _ address " ] = pop [ " gw _ ip _ address " ] # copied as - is, ignored by ga host [ " failure _ rate " ] = pop [ " failure _ rate " ] meccapable = false if " mec " in pop [ " capabilities " ] : meccapable = pop ... | [
-0.5323742032051086,
-0.33774080872535706,
0.5906555652618408,
-0.5598400235176086,
-1.302541732788086,
-0.04609484225511551,
0.13107873499393463,
-0.3029167652130127,
-0.5188613533973694,
1.193065881729126,
-0.152672678232193,
-0.09036312997341156,
0.19311290979385376,
-0.7496349811553955... |
def _ _ init _ _ ( self, args ) : super ( client, self ). _ _ init _ _ ( args = args ) self. heartbeat _ failure _ interval = 2 | [
0.62551349401474,
0.26515159010887146,
0.4515937864780426,
0.6022300124168396,
0.4082134962081909,
1.4234734773635864,
0.01344796922057867,
-0.16472359001636505,
-1.3542523384094238,
-0.48421794176101685,
-0.6394586563110352,
0.08646903932094574,
-0.4968898296356201,
0.3830550014972687,
... |
def update ( self, user _ request : str, model ) : if user _ request = = " gostartmenu " : model. sound. play ( ) game _ status [ " go _ start _ menu " ] = true | [
-0.85003662109375,
-0.09022248536348343,
0.38067853450775146,
0.9201415777206421,
0.33876800537109375,
0.8838833570480347,
-0.34768182039260864,
0.028904316946864128,
-0.20932529866695404,
0.5788068771362305,
-0.4154667556285858,
0.19088740646839142,
-0.3011555075645447,
0.7072920203208923... |
def _ _ init _ _ ( self, word _ count = none ) : if isinstance ( word _ count, dict ) : word _ count = iteritems ( word _ count ) sorted _ counts = list ( sorted ( word _ count, key = lambda wc : wc [ 1 ], reverse = true ) ) words = [ w for w, c in sorted _ counts ] super ( countedvocabulary, self ). _ _ init _ _ ( wor... | [
1.107554316520691,
-0.029104100540280342,
0.5354645252227783,
0.2694165110588074,
0.2747526466846466,
-0.4812609553337097,
-0.02516801282763481,
0.33740073442459106,
-0.22392278909683228,
0.021982334554195404,
0.4134952127933502,
0.1290576308965683,
0.3069867491722107,
1.487720251083374,
... |
def grid _ native ( self, npts ) : raise exception ( " this is the base region class! use a subclass " ) | [
-0.2617315351963043,
-0.3924243748188019,
0.30855363607406616,
0.5124359726905823,
-0.13379605114459991,
0.1999974250793457,
0.0932103618979454,
-0.5896849036216736,
-0.10230792313814163,
-0.2966369688510895,
0.07970107346773148,
0.0032189616467803717,
-0.4697897732257843,
1.11565935611724... |
def driver ( grid : np. ndarray, handler : callable [ [ np. ndarray, int ], none ], max _ gen : int = 100, ) - > none : for gen in range ( max _ gen ) : handler ( grid, gen ) progress ( grid ) | [
-0.6403082609176636,
0.7116358876228333,
0.5111894011497498,
0.4339692294597626,
0.14009873569011688,
-0.06589069217443466,
0.5651532411575317,
0.2684192955493927,
-1.0935072898864746,
-0.44968661665916443,
0.21216686069965363,
-0.037273913621902466,
0.33404019474983215,
0.8644639253616333... |
def callback _ query _ prev ( self, bot : bot, update : update ) - > none : self. logger. info ( " callback query'prev'from % s ", self. _ log _ user ( update. callback _ query. from _ user ) ) bot. answer _ callback _ query ( callback _ query _ id = update. callback _ query. id, ) with self. db _ session ( ) as sessio... | [
0.27046751976013184,
-0.1328098475933075,
0.7194899916648865,
0.2746826112270355,
-0.5507539510726929,
-0.2952328622341156,
1.0219643115997314,
-0.482626348733902,
0.7618775963783264,
0.2766170799732208,
0.49466487765312195,
0.13092805445194244,
-0.7390030026435852,
-0.5824766159057617,
... |
def broadcast _ arrays _ minimal ( * arrays ) : return np. broadcast _ arrays ( * [ unbroadcast ( array ) for array in arrays ] ) | [
0.7075793147087097,
-0.6140859127044678,
0.5803020596504211,
0.7115947604179382,
0.2706226110458374,
0.6082518100738525,
-0.16239342093467712,
-0.267442524433136,
0.9881621599197388,
0.43299785256385803,
0.42767107486724854,
1.062039852142334,
-0.6266164779663086,
-0.13884611427783966,
-... |
def generate _ random _ vector ( n ) : v = np. random. randint ( 2, size = n ) v [ v = = 0 ] = - 1 return v | [
-1.8362901210784912,
-0.3921986222267151,
0.4254533350467682,
-0.3924134373664856,
0.9829612970352173,
0.5892712473869324,
0.16430212557315826,
0.09568014740943909,
0.2178310751914978,
-0.5586405396461487,
-0.36811211705207825,
0.6713518500328064,
0.12532798945903778,
1.2691617012023926,
... |
def test ( self, file _ name, file _ data ) : results = [ ] # # the big plot. we will go through every key of file _ data # and check if there is a doc flag # for key in bb. data. keys ( file _ data ) : flag = bb. data. getvarflag ( key, " doc ", file _ data ) if flag = = none : results. append ( testitem ( file _ name... | [
0.44699227809906006,
0.25127673149108887,
0.42871132493019104,
0.25552403926849365,
0.3490374982357025,
-0.13471363484859467,
0.1104438304901123,
0.15204191207885742,
-1.0151844024658203,
-0.11664934456348419,
0.3221167325973511,
-0.07620210200548172,
-0.1850835531949997,
1.009620547294616... |
def getsubkeys ( self ) : if not self. _ registry _ key and self. _ registry : self. _ getkeyfromregistry ( ) return iter ( self. _ subkeys. values ( ) ) | [
-0.13253851234912872,
0.5602691769599915,
0.42941322922706604,
0.5221545696258545,
-0.09937163442373276,
0.6678903102874756,
0.014732709154486656,
-0.38826844096183777,
-0.00037623406387865543,
-0.2047533392906189,
-0.7463751435279846,
2.273930549621582,
-0.5118470788002014,
-0.26911532878... |
def combine _ similarities ( list1, list2, list2 _ to _ list1 _ ratio = 1, linear _ growth = false ) : weight = { module [ 0 ] : module [ 1 ] for module in list1 } ratio = list2 _ to _ list1 _ ratio * ( min ( 1, vote. objects. count ( ) / 2000 ) if linear _ growth else 1 ) for module in list2 : if module [ 0 ] in weigh... | [
-0.2070435732603073,
-0.07240503281354904,
0.7580229043960571,
0.7869572639465332,
-0.05761393904685974,
0.332513689994812,
-0.30828148126602173,
0.08962682634592056,
-0.3368719518184662,
0.9674040079116821,
-0.5062209963798523,
0.3853945732116699,
-0.4949857294559479,
1.0386404991149902,
... |
def komi ( self ) - > float : return float ( self. root. get _ property ( " km ", 6. 5 ) ) | [
1.6482021808624268,
0.0883200615644455,
0.2964191436767578,
1.7379343509674072,
-0.46960771083831787,
-0.5323890447616577,
-0.281538188457489,
-0.19857653975486755,
-0.10647878050804138,
0.3405650854110718,
-0.12690313160419464,
-0.3949746787548065,
-0.41027525067329407,
0.0654961019754409... |
def extend _ vector ( v1, v2 ) : return merge _ weighted _ vectors ( v1, 1. 0, v2, 0. 0 ) | [
1.2047877311706543,
-0.06425449997186661,
0.551565408706665,
0.7935448884963989,
-0.027323294430971146,
0.02187020145356655,
-1.4798872470855713,
-0.2352076917886734,
0.6998677253723145,
0.5296704769134521,
0.39428016543388367,
1.2903064489364624,
-0.49887269735336304,
0.20745126903057098,... |
def _ _ init _ _ ( self, initial _ list ) : self. initial _ list = initial _ list self. nb _ of _ individuals = 100 self. l = len ( initial _ list ) self. individuals = 0 # useless to put it here since it will be defined with generateindividuals method, but we want to keep a list of all the attributes of population cla... | [
-1.1552927494049072,
-0.5927587151527405,
0.5601831674575806,
0.5198666453361511,
0.07050276547670364,
1.3407385349273682,
-0.14800088107585907,
1.3999440670013428,
0.24652273952960968,
0.02078264020383358,
-1.1299618482589722,
-0.43125659227371216,
-0.014084254391491413,
1.177462697029113... |
def _ copy _ streamflow _ values ( self, input _ flow _ var _ name ) : q _ var = self. cf _ nc. createvariable ( self. output _ flow _ var _ name,'f4 ', ( self. output _ id _ dim _ name,'time') ) q _ var. long _ name ='discharge'q _ var. units ='m ^ 3 / s'q _ var. coordinates ='time lat lon z'q _ var. grid _ mapping ='... | [
-0.0031869017984718084,
-1.064105749130249,
0.6023632287979126,
-0.3577624261379242,
-0.11778736859560013,
0.36797788739204407,
0.7923007607460022,
-0.2971189022064209,
-1.0094761848449707,
0.10794787108898163,
0.05221208930015564,
0.30523309111595154,
-0.09988513588905334,
0.5201774835586... |
def write ( self, samples ) : if samples. dtype! = self. _ dtype : raise valueerror ( ('numpy dtype " { } " of samples does not match sample'' buffer dtype " { } ".'). format ( str ( samples. dtype ), str ( self. _ dtype ) ) ) else : # ` samples ` dtype matches buffer dtype if len ( samples )! = 0 : self. _ arrays. app... | [
-0.5267941355705261,
-0.24222411215305328,
0.24384045600891113,
-0.12312458455562592,
1.2265281677246094,
0.5820561647415161,
0.42256447672843933,
-0.7634375095367432,
0.9991796612739563,
-0.2735256850719452,
-0.9933730363845825,
0.5792667865753174,
-0.73337721824646,
0.33019471168518066,
... |
def payment ( request, format = none ) : stripe _ = stripeclass ( request. data ) stripe _. createpaymentmethod ( ) stripe _. createcustomer ( ) stripe _. updatepaymentmethod ( ) sub = stripe _. createsubscription ( ) to _ save = { " username " : request. user, " paymentmethod " : sub ['payment _ method'] ['card'] ['br... | [
-0.2919212877750397,
-0.2690045237541199,
0.9340153932571411,
0.4400342106819153,
-0.33733174204826355,
-0.3345099985599518,
-0.27833303809165955,
0.13039717078208923,
0.3838585317134857,
0.13197864592075348,
-0.08864857256412506,
-0.5097982883453369,
0.32248541712760925,
0.057971306145191... |
def bt _ init ( ) : dev _ id = 0 try : sock = bluez. hci _ open _ dev ( dev _ id ) except : print " error accessing bluetooth device... " return false try : mode = bt _ read _ inquiry _ mode ( sock ) except exception, e : print " error reading inquiry mode. " print e return false if mode! = 1 : try : result = bt _ writ... | [
-0.6629248261451721,
0.20399928092956543,
0.7606267333030701,
0.5303574800491333,
-0.019530005753040314,
0.6885278820991516,
0.7372972369194031,
-0.1406361162662506,
-0.4962877333164215,
-0.49239689111709595,
0.8873043060302734,
0.11052776873111725,
-1.3678123950958252,
-0.1424375325441360... |
def deserialize ( self, str ) : try : if self. header is none : self. header = std _ msgs. msg. header ( ) end = 0 _ x = self start = end end + = 12 ( _ x. header. seq, _ x. header. stamp. secs, _ x. header. stamp. nsecs, ) = _ get _ struct _ 3i ( ). unpack ( str [ start : end ] ) start = end end + = 4 ( length, ) = _ ... | [
0.40114444494247437,
-0.03849926218390465,
0.9292779564857483,
-0.587137758731842,
-0.6412174701690674,
0.18878552317619324,
-0.21043053269386292,
-0.7796714305877686,
-0.015915118157863617,
-0.8825839161872864,
-0.7695450186729431,
-0.20928460359573364,
-0.8658982515335083,
-0.30750238895... |
def transition _ matrix ( self, x1 : jaxarray, x2 : jaxarray ) - > jaxarray : raise notimplementederror | [
-0.6125929951667786,
-0.15690986812114716,
0.45517611503601074,
0.12753060460090637,
0.04215600714087486,
-0.5863797664642334,
-0.7694253921508789,
-0.3897082209587097,
-0.6151329874992371,
0.8155875205993652,
-0.22572574019432068,
0.8914518356323242,
0.8191607594490051,
-0.319287776947021... |
def characterise _ dust ( pixels ) : dust _ this _ frame = { " x0s " : [ ], " y0s " : [ ], " x1s " : [ ], " y1s " : [ ], " widths " : [ ], " lengths " : [ ], " pixels " : [ ], " brightness " : [ ] } dust _ lengths = len ( pixels ) * [ 0 ] # set placeholder positions and dimensions dust _ widths = len ( pixels ) * [ 0 ]... | [
0.46341556310653687,
-0.24530185759067535,
0.7497723698616028,
-0.44687914848327637,
-0.28973668813705444,
-0.13642838597297668,
0.814885139465332,
-0.22917605936527252,
0.39985716342926025,
-0.04605400934815407,
-0.5987682938575745,
0.5771528482437134,
-0.07005150616168976,
1.639970898628... |
def get _ test _ authdb ( tmpdir ) : if not isinstance ( tmpdir, py. path. local ) : tmpdir = py. path. local ( tmpdir ) dbpath = str ( tmpdir. join ( " test - email. authdb. sqlite " ) ) authdb. create _ sqlite _ authdb ( dbpath ) authdb. initial _ authdb _ inserts ( " sqlite : / / / % s " % dbpath ) return " sqlite :... | [
0.48475557565689087,
-0.03882769122719765,
0.4133707880973816,
-0.31177446246147156,
-0.03098090924322605,
0.5991955995559692,
1.1754651069641113,
0.3287893235683441,
0.9252803325653076,
-0.15667197108268738,
0.4622996151447296,
0.12905685603618622,
-1.2035826444625854,
-0.0593556500971317... |
def action _ confirm ( self, cr, uid, ids, context = none ) : for order in self. browse ( cr, uid, ids, context = context ) : valid = self. validate _ product _ pack ( cr, uid, order. bom _ id. id, order. product _ qty, context = context ) if valid : return super ( productvalidation, self ). action _ confirm ( cr, uid,... | [
-0.06667818129062653,
-0.4189392626285553,
0.6016193628311157,
1.258433222770691,
0.4382166564464569,
-0.9231953024864197,
0.2907658517360687,
-1.4080430269241333,
0.20493696630001068,
0.1309700459241867,
-0.07980933785438538,
-0.044791948050260544,
0.16528041660785675,
0.5784522294998169,... |
def read _ neurone _ data _ hdf5 ( fpath ) : # read the protocol protocol = read _ neurone _ protocol ( fpath ) # read the signal data data = read _ neurone _ data ( fpath, session _ phase = 1, protocol = protocol ) # create a time vector timevec = np. array ( range ( data. shape [ 0 ] ) ) / float ( protocol ['meta'] [... | [
-0.5283041000366211,
-0.2611132860183716,
0.531919002532959,
-0.4170018434524536,
-0.33872535824775696,
-0.10115636140108109,
-0.20436929166316986,
0.012928858399391174,
-0.9278696179389954,
1.1508208513259888,
-0.3907855451107025,
-0.2339491844177246,
-0.27456599473953247,
0.0862011983990... |
def encode ( text ) : # define vowels vowels = " aeiou " decoded, consonants = " ", " " for character in text : if character. isalpha ( ) and character. lower ( ) not in vowels : # add character to group of consecutive vowels consonants + = character else : # if a group of consecutive vowels was formed, add the group t... | [
0.10163753479719162,
-0.7567786574363708,
0.36469122767448425,
0.008862080983817577,
-0.8986371755599976,
-0.021328113973140717,
0.12116465717554092,
0.38214635848999023,
0.8912427425384521,
0.10921096801757812,
-0.4086608290672302,
0.2629754841327667,
-1.0521633625030518,
-0.5000574588775... |
def get _ boundary _ positions ( self ) : offset _ x = self. x _ length / 2. 0 x, y = self. position return [ [ x - offset _ x, y - self. y _ length * 1 / 5. 0 ], [ x - offset _ x, y + self. y _ length * 4 / 5. 0 ], [ x + offset _ x, y + self. y _ length * 4 / 5. 0 ], [ x + offset _ x, y - self. y _ length * 1 / 5. 0 ]... | [
-0.17548412084579468,
-0.9848491549491882,
0.8117514252662659,
-0.21043744683265686,
0.6676366329193115,
0.7155975103378296,
0.2311396449804306,
-0.26987457275390625,
0.5319172143936157,
0.14986366033554077,
-1.491394281387329,
-0.009012347087264061,
-0.6290473937988281,
0.0463884063065052... |
def get _ body ( src : pdffilereader ) - > str : num _ pages = src. getnumpages ( ) pages = [ get _ page ( src, i ) for i in range ( num _ pages ) ] return'\ n '. join ( pages ) | [
-0.4133981168270111,
-0.21271581947803497,
0.7298519015312195,
0.030446818098425865,
0.17621856927871704,
-0.4608498811721802,
-0.7561722993850708,
-0.7437610030174255,
0.3953039050102234,
-0.08836133033037186,
0.4775388538837433,
-0.10786176472902298,
0.04232010245323181,
0.62133860588073... |
def run _ sgd ( lr, nof _ steps ) : # set up problem, model, loss problem = toyproblem ( f _ objective, apply _ noise ) model, loss _ func = problem. make _ modules ( theta _ init. clone ( ) ) model = model. to ( device ) loss _ func = loss _ func. to ( device ) # define optimizer optimizer = torch. optim. sgd ( model.... | [
0.09788035601377487,
0.06137092411518097,
0.7344998121261597,
-0.2458408772945404,
-0.11492225527763367,
0.13701485097408295,
0.1532173901796341,
-0.2166542261838913,
-1.0407615900039673,
-0.2784510552883148,
-0.31979334354400635,
-0.08714530616998672,
0.8801183700561523,
0.557769179344177... |
def gramschmit ( a ) : redo = 6 nf = len ( a ) nc = len ( a [ 0 ] ) a = [ i [ : ] for i in a ] q = [ i [ : ] for i in a ] r = [ [ 0. 0 ] * nc for i in range ( nc ) ] print q for k in range ( nc ) : e1 = [ row [ k ] for row in q [ 0 : ] ] e3 = [ row [ k ] for row in q [ 0 : ] ] for i in range ( k ) : e2 = [ row [ i ] fo... | [
0.42844676971435547,
-0.057378120720386505,
0.6295143365859985,
-0.9760903120040894,
-0.2763350009918213,
-0.0922730416059494,
0.032249510288238525,
0.22835244238376617,
0.7402829527854919,
1.262427806854248,
0.03775700926780701,
-0.5651601552963257,
-0.19108259677886963,
1.096678495407104... |
def createregistereddllincludefile ( registered _ dll _ list, header _ output _ dir ) : output _ file = os. path. join ( header _ output _ dir, generated _ dll _ include _ file _ name ) dll _ array _ string = " " for dll in registered _ dll _ list : dll. replace ( " \ \ ", " \ \ \ \ " ) if dll _ array _ string : dll _ ... | [
-0.1301589459180832,
-1.0577980279922485,
0.698745846748352,
-0.1024787500500679,
0.10165480524301529,
-0.02368786931037903,
0.30167636275291443,
0.6700076460838318,
0.09674128890037537,
0.5685632824897766,
-0.3508071005344391,
0.4505147337913513,
-0.5860200524330139,
0.007539093494415283,... |
def identity _ matrix ( dim ) : mat _ space = matrixspace ( combinatorialscalarring ( ), dim ) prnt = mat _ space. base _ ring ( ) l = list ( ) for i in range ( dim ) : l. append ( list ( ) ) for j in range ( dim ) : if i = = j : l [ i ]. append ( prnt. _ one ( ) ) else : l [ i ]. append ( prnt. _ zero ( ) ) return mat... | [
-0.10360672324895859,
0.2770189940929413,
0.5536457896232605,
0.9899795055389404,
0.3836289644241333,
0.0857616662979126,
0.8163131475448608,
0.13397668302059174,
1.2389010190963745,
-0.3215702176094055,
-0.19648084044456482,
0.022967765107750893,
-0.4226589798927307,
0.16977393627166748,
... |
def get _ main _ git _ path ( ) : try : repository _ basepath = subprocess. check _ output ('git config - - get remote. origin. url '. split ('' ) ) except subprocess. calledprocesserror as err : setup _ dir _ path = os. path. dirname ( os. path. realpath ( _ _ file _ _ ) ) err _ msg = " " " \ " % s \ " is not a git re... | [
0.13323543965816498,
-0.7416201233863831,
0.7222825884819031,
0.5173922181129456,
-0.07841973751783371,
-0.08414250612258911,
0.4090171158313751,
0.41933566331863403,
-0.3548867404460907,
0.30460795760154724,
0.5699029564857483,
0.2580701410770416,
-0.7939974069595337,
0.23961693048477173,... |
def merge _ agent _ info ( session, host _ info, instance _ info ) : try : # try to get host _ id, based on hostname host _ info ['host _ id'] = get _ host _ id ( session, host _ info ['hostname'] ) except exception : # host not found pass host = host. from _ dict ( host _ info ) # insert or update host information ses... | [
-0.1373254656791687,
-0.6730920672416687,
0.8285821080207825,
-0.24552474915981293,
0.13927891850471497,
0.6352614760398865,
-0.45434287190437317,
0.6600531339645386,
0.31977131962776184,
0.27337872982025146,
0.4465837776660919,
-0.6540127992630005,
-0.2311483472585678,
-0.19620381295681,
... |
def to _ previous ( self ) : # submit should not happen a second time, since then we don't want # the widgets data to be written to the model form = self. findchild ( qtgui. qwidget,'form') if form : form. submit ( ) form. to _ previous ( ) | [
-0.09005472809076309,
0.7231245040893555,
0.8267447352409363,
-0.6109020709991455,
0.8106480240821838,
-0.1301131248474121,
0.5070503950119019,
-0.09235931932926178,
-0.5573976039886475,
-0.2330499142408371,
-0.6656104326248169,
0.06507359445095062,
-0.4597139358520508,
0.9138965606689453,... |
def orientable ( self, * args ) : return _ topods. topods _ shape _ orientable ( self, * args ) | [
-0.15984277427196503,
0.1330745965242386,
0.34705373644828796,
-0.06347816437482834,
0.44604337215423584,
0.559123158454895,
0.9692926406860352,
-0.8080140352249146,
-0.7256441712379456,
0.5442343354225159,
0.04087456688284874,
-0.2753962278366089,
-1.1487963199615479,
-1.1955689191818237,... |
def modify ( self, disk _ name = none, description = none, delete _ with _ instance = none ) : params = { } if disk _ name and disk _ name! = self. disk _ name : params ['disk _ name'] = disk _ name if description! = self. description : params ['description'] = description if delete _ with _ instance is not none and de... | [
-1.058730125427246,
-0.01691889576613903,
0.9457939863204956,
-0.17962370812892914,
-0.40766581892967224,
-0.05689757317304611,
-0.121237613260746,
0.7856086492538452,
-0.12479319423437119,
0.17427079379558563,
0.2764153480529785,
0.5274850130081177,
-1.2938114404678345,
0.788444995880127,... |
def midd ( x, y, base = 2 ) : assert len ( x ) = = len ( y ), " arrays should have same length " return entropyd ( x, base ) - centropyd ( x, y, base ) | [
-0.22435899078845978,
-0.4508148729801178,
0.5015662908554077,
-0.3837926387786865,
-0.4481310248374939,
0.5286573171615601,
-1.6753978729248047,
-1.0778875350952148,
0.21177981793880463,
0.3427833020687103,
0.5928292870521545,
0.476060688495636,
-0.6330418586730957,
-0.5463395714759827,
... |
def pc2 _ to _ octree ( point _ cloud, octree, resolution = 0. 01, point = point ( 0. 0, 0. 0, 0. 0 ) ) : if isinstance ( point _ cloud, pointcloud2 ) : # sensor _ msgs. pointcloud2 to array p = [ ] for points in pypc2. read _ points ( point _ cloud, field _ names = ( " x ", " y ", " z " ), skip _ nans = true ) : p. ap... | [
0.6047378182411194,
-0.7278486490249634,
0.7999300956726074,
0.04752219468355179,
0.7156662940979004,
0.18984276056289673,
-1.090990662574768,
-0.1572108119726181,
0.2768414318561554,
0.19759969413280487,
0.12155470252037048,
-0.14917591214179993,
-0.6377788782119751,
-0.20426304638385773,... |
def _ _ add _ _ ( self, other ) : if isinstance ( other, array ) : # add another vector result = self. _ new _ like _ me ( _ get _ common _ dtype ( self, other, self. queue ) ) self. _ axpbyz ( result, self. dtype. type ( 1 ), self, other. dtype. type ( 1 ), other ) return result else : # add a scalar if other = = 0 : ... | [
-0.24192799627780914,
-0.038563892245292664,
0.9996262192726135,
0.6754381656646729,
-0.49448361992836,
0.24526382982730865,
0.39804428815841675,
-1.3753392696380615,
0.9892250299453735,
-0.12838013470172882,
0.38675203919410706,
1.2089112997055054,
-0.6669381260871887,
0.3196433484554291,... |
def timing ( name ='', logger = none, format ='timing % - 18s %. 3fs ', * * kwargs ) : return timer ( name, logger, format, * * kwargs ) | [
0.6275955438613892,
0.11132851243019104,
0.7341493368148804,
-0.2764429450035095,
-0.8113996386528015,
-0.8362019062042236,
-1.2097971439361572,
0.12268216907978058,
-0.25179046392440796,
0.28692004084587097,
-0.6460909247398376,
-0.5530286431312561,
-0.25670841336250305,
0.020676307380199... |
def all _ survey _ packages ( self, client ) : all _ survey _ packages = client. all _ survey _ packages ( ) return all _ survey _ packages | [
-0.4385150372982025,
0.07949164509773254,
0.22841720283031464,
1.3070812225341797,
-0.7047458291053772,
0.7775974869728088,
-0.8689230680465698,
-0.961117684841156,
1.1272406578063965,
0.10286566615104675,
-0.2635050117969513,
0.27523088455200195,
-0.23561829328536987,
0.06385874003171921,... |
def from _ raw ( cls, connection, outgoing, raw, * * kwargs ) : parser _ kwargs = parse _ raw ( raw ) parser _ kwargs. update ( kwargs ) return cls. _ _ new _ _ ( cls, connection, outgoing, raw = raw, * * parser _ kwargs ) | [
0.0762067660689354,
-0.37830817699432373,
0.7282314300537109,
-0.35746100544929504,
-1.3041789531707764,
-0.18072684109210968,
-1.4909021854400635,
0.2970353066921234,
-0.018874555826187134,
-0.6018064618110657,
-0.7004184126853943,
0.23345813155174255,
0.20441478490829468,
-0.243461996316... |
def is _ running ( self ) - > bool : return self. _ start _ time is not none | [
-0.24425198137760162,
-0.3688398599624634,
0.5529550909996033,
0.6229716539382935,
0.6928756237030029,
0.03435090556740761,
-0.7321458458900452,
1.0156140327453613,
-0.3535971939563751,
0.16933631896972656,
-0.7251638174057007,
0.21614694595336914,
-0.5866502523422241,
-0.01524433586746454... |
def _ removeallviews ( self ) : for win in self. editors : self. _ removeview ( win ) | [
-0.19630920886993408,
-0.33582746982574463,
0.3243647813796997,
0.7610394358634949,
-0.8912104964256287,
-0.23323826491832733,
0.6091622710227966,
0.20958144962787628,
0.10294702649116516,
-0.8919947743415833,
0.6543641686439514,
-0.10712187737226486,
-0.6370373368263245,
1.528102397918701... |
def list _ corpus _ helper ( ) : corpora = read _ corpus ( ) return corpora | [
0.4469413757324219,
-1.251107931137085,
0.31819939613342285,
-0.47661036252975464,
0.3603472113609314,
-0.6961889863014221,
-0.5976266264915466,
0.07903357595205307,
-0.3356989920139313,
-0.007513213902711868,
0.234587162733078,
0.67606121301651,
0.3330298364162445,
-0.25192171335220337,
... |
def report ( message = " ", error = false ) : message = str ( message ) if len ( message ) > = 70 and not error : message = message [ : 67 ] + "... " sys. stdout. write ( " \ r { : 70 } { } ". format ( message, " \ n " if error else " " ) ) sys. stdout. flush ( ) | [
0.5539567470550537,
1.1164246797561646,
0.8029381632804871,
-0.01316625252366066,
0.08740147948265076,
-0.2562657594680786,
0.36264318227767944,
-0.2304556667804718,
-0.37910735607147217,
-0.5567836165428162,
0.864837110042572,
0.6037072539329529,
-0.5805742144584656,
0.40181732177734375,
... |
def _ _ init _ _ ( self, symbol, bar _ file, dbar _ repo ) : self. symbol = symbol self. venue = l1. venue _ by _ symbol ( symbol ) self. hours = l1. get _ start _ end _ hour ( symbol ) self. bar _ file = bar _ file if bar _ file [ - 3 : ] = = '. gz': os. system ('gunzip - f'+ bar _ file ) self. bar _ file = bar _ file... | [
-0.23845776915550232,
0.04568180441856384,
0.5562795996665955,
0.44929152727127075,
0.15576116740703583,
0.497165322303772,
0.6919198632240295,
0.25368165969848633,
-0.8353064060211182,
0.3026556372642517,
-0.07201594114303589,
-0.2785797715187073,
-0.03966166824102402,
0.5476769208908081,... |
def test _ fourier _ synthesis _ linescan _ hrms _ more _ wavevectors ( ) : h = 0. 7 hrms = 4. n = 4096 s = n * 4. ls = 8 np. random. seed ( 0 ) realised _ rms _ heights = [ ] for i in range ( 50 ) : t = fourier _ synthesis ( ( n, ), ( s, ), rms _ height = hrms, hurst = h, rolloff = 0, long _ cutoff = s / 8, short _ cu... | [
0.4798653721809387,
0.1824992299079895,
0.4508795440196991,
0.1348615437746048,
0.10835621505975723,
0.19296999275684357,
0.14061656594276428,
-0.5357016324996948,
-0.021674446761608124,
-1.4075969457626343,
-0.21175214648246765,
0.15774311125278473,
0.1908242553472519,
1.0557873249053955,... |
def checkuser ( self, username ) : with self. con : self. cur. execute ( " select name from users where name ='" + username + "'; " ) i = len ( self. cur. fetchall ( ) ) if i = = 1 : return true else : return false | [
-1.0755454301834106,
0.45580679178237915,
0.5929991602897644,
0.9029131531715393,
0.010398505255579948,
0.42706236243247986,
-0.07834985852241516,
0.35386502742767334,
-0.5714048743247986,
0.3622722625732422,
-0.71929532289505,
-1.021571159362793,
-1.1526234149932861,
0.46570825576782227,
... |
def random _ dataset _ split _ eval ( classifier, peptides _ test, classification _ test, test _ size _ percent ) : log. info ( " evaluating a random subset of size : " + str ( test _ size _ percent ) + " of the training data " ) classification _ pred = classifier. predict ( peptides _ test ) log. info ( " successfully... | [
0.0638185441493988,
0.1954900473356247,
0.2240973711013794,
-0.9554973840713501,
0.27047157287597656,
0.5504711270332336,
0.23182189464569092,
0.7794186472892761,
-0.19973281025886536,
-0.24417148530483246,
-0.2166866809129715,
1.3135347366333008,
0.4572440981864929,
-0.7578675150871277,
... |
def _ load _ files _ from _ s3 ( self, tempo ) : # load relevant bucket bucket _ provider = s3bucket ( _ _ s3 _ buckets _ _ [ " training - sets " ], create _ if _ absent = true ) # download files from s3 logger. info ( " get training sets from folder % s, and download them in % s " % ( _ _ training _ set _ folder _ nam... | [
-0.05294281989336014,
0.8553811311721802,
0.6951277256011963,
-0.48494622111320496,
-0.5690487027168274,
0.5276233553886414,
0.17587241530418396,
-0.3203743100166321,
-0.5682580471038818,
0.07001486420631409,
-0.1591949760913849,
-0.4540427029132843,
0.19025766849517822,
-0.898639023303985... |
def location ( self ) - > optional [ str ] : return pulumi. get ( self, " location " ) | [
0.47828373312950134,
-0.13253501057624817,
0.43950843811035156,
0.3122273087501526,
1.0299009084701538,
1.0267300605773926,
0.3161546289920807,
0.0481734499335289,
0.7872151732444763,
0.05244184285402298,
0.6639619469642639,
0.35598522424697876,
0.5503166317939758,
-1.509136438369751,
-1... |
def target _ template ( self ) : return self. _ target _ template | [
-0.8037561774253845,
-0.7154369354248047,
0.24704426527023315,
-0.35857754945755005,
0.041810810565948486,
0.38500067591667175,
0.07602907717227936,
-0.13161195814609528,
0.518592119216919,
-0.030768414959311485,
0.2896408140659332,
0.052169069647789,
-0.2452787309885025,
-1.62525880336761... |
def sleep ( seconds ) : time. sleep ( seconds ) | [
0.7956634163856506,
0.5148594975471497,
0.016716789454221725,
0.6739000678062439,
-0.4594046175479889,
0.6203144788742065,
0.4397238790988922,
-1.8344076871871948,
-0.8132209181785583,
-0.3933379650115967,
-0.939094066619873,
0.40995773673057556,
0.3767260015010834,
-0.6920817494392395,
... |
def get _ object ( self ) : try : return ( self. get _ queryset ( ). filter ( * * self. kwargs ). order _ by ( " - created " ). first ( ) ) except subscription. doesnotexist : raise http404 | [
0.9223805665969849,
-0.15376263856887817,
0.6330044269561768,
0.7333863377571106,
0.3911643326282501,
-0.2760430574417114,
-0.2767029404640198,
-1.5677822828292847,
-0.4517615735530853,
-0.7770665884017944,
0.692935049533844,
0.5287200212478638,
0.13056112825870514,
-0.34164685010910034,
... |
def load _ data _ from _ dat ( file, data _ type ) : # add. dat extension if needed if ( len ( file ) < 4 or file [ - 4 : ]! = ". dat " ) : file = file + ". dat " file _ object = open ( file, mode ='rb') loaded _ data = np. fromfile ( file _ object, dtype = data _ type ) file _ object. close ( ) print _ log ('data load... | [
0.11233929544687271,
-0.40863853693008423,
0.6217417120933533,
-0.4743136465549469,
0.15484873950481415,
1.0160465240478516,
-0.3588126599788666,
-0.8315715193748474,
-0.29853659868240356,
-0.2802896201610565,
-0.14999639987945557,
1.324889063835144,
0.4314548969268799,
0.03823542222380638... |
def parse ( self, request ) : return none | [
-1.2202786207199097,
-0.5259897708892822,
0.48452699184417725,
0.07163949310779572,
0.2952863574028015,
-0.1362174153327942,
-0.6082342267036438,
-0.7372933030128479,
0.7510296106338501,
-1.8282151222229004,
0.3072613477706909,
-0.6308299899101257,
-0.6464256048202515,
0.007867547683417797... |
async def get _ all _ tasks _ and _ responses _ grouped _ by _ callback ( self ) - > mythicresponse : url = " { } { } : { } / api / v { } / task _ report _ by _ callback ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version ) resp = await self. get _ json ( url ) if resp. re... | [
-0.05285068228840828,
-0.05878227949142456,
0.5800362825393677,
-0.07302918285131454,
0.23693831264972687,
-1.0485485792160034,
1.0051027536392212,
-0.08558039367198944,
0.24836114048957825,
-0.3724620044231415,
-0.1248367503285408,
0.03379184007644653,
-0.7267327904701233,
0.4226914942264... |
def inviter _ id ( self, inviter _ id ) : self. _ inviter _ id = inviter _ id | [
0.5906145572662354,
-1.1758248805999756,
-0.08446358144283295,
0.5794498920440674,
-0.11910295486450195,
0.8884481191635132,
-0.14183539152145386,
1.9757041931152344,
-0.23519781231880188,
0.6747432947158813,
-0.36170798540115356,
0.7856823801994324,
-0.7814680337905884,
1.2457363605499268... |
def order ( self ) : return ( 1 if self. aura else 0 ), self. oop | [
-1.2737187147140503,
-0.2387397438287735,
0.4151438772678375,
0.11127140372991562,
0.8301523923873901,
0.23910261690616608,
0.024884864687919617,
-0.3627033233642578,
0.902863621711731,
0.29749566316604614,
-0.26673048734664917,
0.1008484736084938,
0.11738014221191406,
0.4394552707672119,
... |
def intersection ( self, other ) : x1 = max ( self. pt1. x, other. pt1. x ) y1 = max ( self. pt1. y, other. pt1. y ) x2 = min ( self. pt2. x, other. pt2. x ) y2 = min ( self. pt2. y, other. pt2. y ) return rectangle ( x1, y1, x2, y2 ) | [
0.3663589358329773,
-0.3050566613674164,
1.1829091310501099,
0.7649797201156616,
-0.49269211292266846,
0.3727179765701294,
0.005827441345900297,
-0.541022539138794,
-0.31772929430007935,
0.01334582082927227,
0.3711046278476715,
-0.25332415103912354,
-0.4098165035247803,
-0.149303138256073,... |
def go _ to _ registration _ page ( self ) : self. wait _ and _ click ( locator _ type = by. xpath, locator = self. constants. registration _ button _ xpath ) self. log. info ('go to registration page') return registrationandsigninpage ( self. driver ) | [
-0.5236580967903137,
0.5904968976974487,
0.33269762992858887,
0.41115567088127136,
1.0683414936065674,
-0.10058274120092392,
0.30631062388420105,
0.7101587057113647,
-0.3298633098602295,
1.0685724020004272,
-0.13336670398712158,
-0.6080101728439331,
-0.22541433572769165,
-0.208498477935791... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.