text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def runalgorithm ( articlereader, algrunner, outfile, headers = none ) : # write headers to output file logging. info ( " running plugin % s " % algrunner. description ) if not headers : headers = algrunner. getheaders ( ) if not headers : logging. error ( " you need to define a variable'headers'( a list ) in your pyth... | [
-0.30216655135154724,
-0.5959532260894775,
0.7215622663497925,
-0.11057674884796143,
-0.7727884650230408,
-0.369659423828125,
0.47350552678108215,
0.680610179901123,
-0.03692782670259476,
0.9100461602210999,
0.25472018122673035,
-0.015795698389410973,
0.027479590848088264,
0.55221801996231... |
def runperl ( self, view, region ) : p = subprocess. popen ( " perl ", shell = true, bufsize = - 1, stdout = subprocess. pipe, stderr = subprocess. pipe, stdin = subprocess. pipe ) output, error = p. communicate ( view. substr ( region ) ) results = view. window ( ). newfile ( ) results. setscratch ( true ) results. se... | [
0.6510903239250183,
-0.5031324028968811,
0.7850506901741028,
-0.8957772254943848,
-0.978055477142334,
0.31421801447868347,
0.8900325894355774,
-0.20806017518043518,
-0.3179336190223694,
-0.43893977999687195,
0.6854020357131958,
0.03090723790228367,
-0.7565539479255676,
0.143770232796669,
... |
def is _ connected ( self ) : return self. _ connected | [
-0.9298140406608582,
-0.618641197681427,
0.39413657784461975,
0.5149216651916504,
0.5660306215286255,
0.09946823120117188,
-0.8921991586685181,
-0.1508341133594513,
-0.25291889905929565,
0.08187980949878693,
-0.8924992084503174,
-0.19022336602210999,
-0.49730178713798523,
-0.37883874773979... |
def precision ( y _ true, y _ pred ) : true _ positives = k. sum ( k. round ( k. clip ( y _ true * y _ pred, 0, 1 ) ) ) predicted _ positives = k. sum ( k. round ( k. clip ( y _ pred, 0, 1 ) ) ) precision = true _ positives / ( predicted _ positives + k. epsilon ( ) ) return precision | [
1.0754348039627075,
-1.2424544095993042,
0.6988058090209961,
0.17861145734786987,
-0.38336583971977234,
0.09111396223306656,
-0.6658217310905457,
1.185226559638977,
-0.7183790802955627,
1.061894178390503,
0.6343544125556946,
0.020040757954120636,
0.7803400158882141,
0.23039370775222778,
... |
def normalise _ path ( path ) : if not path. startswith ('/') : return none # ignore pages within smart answers. we can identify smart answers by # looking for a url component which is exactly'y '. if'/ y /'in path : return none # ignore query parameters path = path. split ( '? ', 1 ) [ 0 ] # ignore trailing / path = p... | [
-0.10434181988239288,
-0.539058268070221,
0.6998955011367798,
-0.017602963373064995,
-0.7535520195960999,
-0.004599313717335463,
0.8956109881401062,
-0.16660471260547638,
1.2734278440475464,
-0.19646911323070526,
0.8033535480499268,
-1.0241179466247559,
-0.4295889735221863,
-0.072951368987... |
def test _ new _ user _ must _ create _ profile ( self ) : response = self. client. get ( self. url ) self. assertcontains ( response,'href = " { 0 } " '. format ( reverse ( " tasks : create _ profile " ) ), status _ code = 200, ) | [
0.5525178909301758,
0.8904237747192383,
0.4560186266899109,
0.7733184695243835,
1.1550121307373047,
1.6355143785476685,
0.505022406578064,
-0.6297626495361328,
-0.4950195252895355,
-0.5712705254554749,
-0.7428789138793945,
-0.5722061395645142,
0.14653445780277252,
0.4447714686393738,
-0.... |
def findsmallestsquare ( num ) : return ( int ( math. floor ( math. sqrt ( num / 2 ) ) ) ) | [
0.2424687147140503,
-0.6658604741096497,
0.6105359196662903,
-0.2981400191783905,
-0.8330161571502686,
-0.49312788248062134,
0.7646245956420898,
-1.388824701309204,
0.33467230200767517,
-0.9061535000801086,
0.09274065494537354,
0.1823095828294754,
-0.7623871564865112,
0.5286259651184082,
... |
def _ equals ( self, other ) : return ( type ( self ) = = type ( other ) ) and ( self. type = = other. type ) | [
-1.349082589149475,
-1.1704342365264893,
0.563860297203064,
-0.3980352580547333,
0.7516672611236572,
0.04053245112299919,
-0.4834086000919342,
-1.413338541984558,
0.5113840699195862,
0.45979365706443787,
-0.9096927046775818,
0.6519361734390259,
-0.8000237345695496,
0.06973470002412796,
0... |
def _ _ init _ _ ( self, words = none ) : words = self. sanitize _ words ( words ) self. word _ id = { w : i for i, w in enumerate ( words ) } self. id _ word = { i : w for w, i in iteritems ( self. word _ id ) } | [
0.06696439534425735,
0.22961366176605225,
0.3110778331756592,
-0.3382558226585388,
-0.102369524538517,
-0.04279152303934097,
-0.6429199576377869,
0.5257735848426819,
-0.16686461865901947,
0.4171299338340759,
-0.5184716582298279,
-0.13049592077732086,
-1.2045403718948364,
0.7568886876106262... |
def get _ submenu ( self, menu, name ) : if name not in self. _ menus : self. _ menus [ name ] = self. get _ menu ( menu ). addmenu ( name ) return self. _ menus [ name ] | [
-0.617946207523346,
0.46279993653297424,
0.7354389429092407,
1.0215296745300293,
-0.3569844961166382,
-0.3708115220069885,
-1.0730210542678833,
-0.5094414353370667,
0.3725478947162628,
-0.8158993721008301,
-0.682100772857666,
0.3469271957874298,
-1.5483629703521729,
-0.8066064715385437,
... |
def get _ parent _ partition _ keys _ for _ child ( self, partition _ key : optional [ str ], parent _ asset _ key : assetkey, child _ asset _ key : assetkey, dynamic _ partitions _ store : dynamicpartitionsstore, current _ time : datetime, ) - > upstreampartitionsresult : partition _ key = check. opt _ str _ param ( p... | [
-0.2443714439868927,
-0.39078691601753235,
0.734563946723938,
-0.33329254388809204,
-0.8680934906005859,
-0.9729676842689514,
-0.18255682289600372,
-0.32653799653053284,
-0.9317241311073303,
0.5539390444755554,
-0.2481619417667389,
-0.09584799408912659,
0.49005940556526184,
-0.124182775616... |
def set _ pump _ state ( self, pump, on ) : msg = self. device. send ( " set - pump - state ", pump, on ) return not msg. iserror ( ) | [
-0.7455973029136658,
0.7397045493125916,
0.7648144364356995,
0.36444514989852905,
-0.7739242315292358,
0.7813524007797241,
-0.8153746128082275,
0.3827977478504181,
0.5148500800132751,
0.33532997965812683,
-0.8423106670379639,
0.03612891212105751,
-1.3645806312561035,
-0.5507339239120483,
... |
def _ discover _ devices ( self, online _ only = false ) : for dev in self. _ http _ client. list _ devices ( ) : online = dev ['onlinestatus'] if online _ only and online! = 1 : # the device is not online, so we skip it. continue # if the device we have discovered is not in the list we already handle, we need to add i... | [
-0.3370390832424164,
0.45400017499923706,
0.6265194416046143,
1.7059396505355835,
1.0807523727416992,
0.03259915113449097,
0.13085778057575226,
0.3175370395183563,
0.20326745510101318,
-0.45663902163505554,
-0.2577165365219116,
-0.01173695269972086,
-0.014176582917571068,
1.172516226768493... |
def get _ cams _ list ( ) - > list [ int ] : idx = 0 arr = [ ] while true : cap = cv2. videocapture ( idx, cv2. cap _ dshow ) if not cap. read ( ) [ 0 ] : break else : arr. append ( idx ) cap. release ( ) idx + = 1 cv2. destroyallwindows ( ) return arr | [
-0.5919328331947327,
-0.6019983887672424,
0.7028601169586182,
1.3457245826721191,
-0.31287524104118347,
-0.35779306292533875,
0.29409655928611755,
-0.9668487310409546,
1.412359595298767,
0.15220633149147034,
-0.6653795838356018,
0.7441493272781372,
-0.601118266582489,
0.6251680850982666,
... |
def _ add _ root ( self, e ) : if self. _ root is not none : raise valueerror ('root already exists') self. _ size = 1 self. _ root = self. _ node ( e ) return self. _ make _ position ( self. _ root ) | [
-0.595990002155304,
0.7908952832221985,
0.5330168008804321,
-0.5168099999427795,
0.1022033616900444,
-0.3155406415462494,
0.4196998178958893,
-0.058447375893592834,
0.849749743938446,
0.6241875886917114,
-0.571533203125,
-0.3391117453575134,
-0.2472751885652542,
-0.04810365289449692,
0.4... |
def call ( self, inputs, * * kwargs ) : logger = tf. get _ logger ( ) inputs, categories, mask _ positions = inputs [ 0 ], inputs [ 1 ], inputs [ 2 ] if self. params [ " mode " ] = = " debug " : logger. debug ( inputs ) batch _ size = tf. shape ( inputs ) [ 0 ] seq _ length = tf. shape ( inputs ) [ 1 ] # reduce the dim... | [
-0.4651787579059601,
-0.1114201545715332,
0.6890865564346313,
0.46023911237716675,
0.07215753197669983,
0.24558167159557343,
-0.006208553910255432,
0.012303022667765617,
-0.2524827718734741,
0.37229546904563904,
0.08995332568883896,
-0.33978718519210815,
-0.3746279180049896,
0.070659071207... |
def _ define ( self ) : definition = [ ] q = quantumregister ( 1, " q " ) rule = [ ( u3gate ( pi, 0, pi ), [ q [ 0 ] ], [ ] ) ] for inst in rule : definition. append ( inst ) self. definition = definition | [
0.1602741777896881,
1.076067328453064,
0.32231664657592773,
0.26631566882133484,
0.9565648436546326,
-0.2972690761089325,
-0.7276602387428284,
0.8365261554718018,
0.5673021078109741,
0.09422015398740768,
-1.1953926086425781,
0.17390993237495422,
-0.18119320273399353,
1.2662676572799683,
... |
def convert _ to _ data _ frame ( decades ) : decades _ top _ words = get _ top _ results ( decades ) decades _ df = dataframe ( dict ( [ ( k, series ( v ) ) for k, v in decades _ top _ words. items ( ) ] ) ). fillna ('' ) decades _ df = decades _ df. reindex ( sorted ( decades _ df. columns ), axis = 1 ) decades _ df.... | [
-0.023756500333547592,
0.641050398349762,
0.5976017713546753,
-1.0311534404754639,
-0.9664982557296753,
0.1340302973985672,
-0.05410600081086159,
-0.2649376690387726,
-0.4891238510608673,
-0.4874608516693115,
-0.1953687071800232,
0.7785398364067078,
0.6483994722366333,
-0.42190706729888916... |
def on _ volume _ balance _ vec ( data _ df, window = 14 ) : obv _ delta = data _ df ['volume'] * np. sign ( data _ df ['close']. diff ( ) ) return obv _ delta. rolling ( window = window, center = false ). sum ( ) | [
-0.07528967410326004,
-0.5839883089065552,
0.9490719437599182,
-0.029067419469356537,
0.49008312821388245,
0.463113009929657,
0.8331451416015625,
-0.354137659072876,
0.07096517086029053,
-0.0641213208436966,
0.7092375755310059,
0.7685203552246094,
0.15834040939807892,
0.13782477378845215,
... |
def download _ levels ( self, *, prev : str = " ", was _ daily : optional [ bool ] = none, level _ types : optional [ list [ leveltype ] ] = none, ) - > levelmetamapping : query _ parameters = { " count " : " 1024 ", } if was _ daily is not none : query _ parameters [ " was _ daily " ] = " y " if was _ daily else " n "... | [
-0.6292917728424072,
0.32649287581443787,
1.012379765510559,
0.3750588595867157,
0.5791154503822327,
-0.2325437068939209,
-0.5375460982322693,
-0.9058792591094971,
-0.7057060599327087,
0.4025612771511078,
-0.20722708106040955,
0.37403443455696106,
-0.8799801468849182,
1.168761968612671,
... |
def show _ exception ( exception, * * kwargs ) : message = kwargs. get ( " message " ) trace = kwargs. get ( " traceback " ) message _ title = message if message \ else translate ( " asterstudy ", " unexpected error " ) message _ type = translate ( " asterstudy ", " type : " ) message _ value = translate ( " asterstudy... | [
0.8913037180900574,
0.11470261961221695,
1.1170573234558105,
-0.7116875648498535,
-0.8628566265106201,
-0.044477906078100204,
0.49021074175834656,
-0.059648238122463226,
0.5387416481971741,
0.0052071851678192616,
0.9667109251022339,
0.5106747150421143,
0.11736945062875748,
0.55745744705200... |
def validate _ application _ error _ event _ count ( num _ errors ) : @ function _ wrapper def _ validate _ application _ error _ event _ count ( wrapped, instace, args, kwargs ) : try : result = wrapped ( * args, * * kwargs ) except : raise else : stats = core _ application _ stats _ engine ( none ) assert len ( list ... | [
0.2988063097000122,
-0.048014361411333084,
0.575314998626709,
0.7831970453262329,
-0.18090157210826874,
0.3773672580718994,
0.28519579768180847,
-0.19223231077194214,
0.5559993386268616,
-0.13349972665309906,
0.2955949008464813,
-0.3548867702484131,
0.773331344127655,
0.029818778857588768,... |
def message ( blockers ) : if not blockers : encoding = getattr ( sys. stdout,'encoding ','' ) if encoding : encoding = encoding. lower ( ) if encoding = ='utf - 8': # party hat flair = " \ u0001f389 " else : flair ='' return [ flair +'you have 0 projects blocking you from using python 3!'] flattened _ blockers = set (... | [
-0.631227433681488,
-0.2040451020002365,
0.6779666543006897,
-0.3989512026309967,
-0.2170751690864563,
-0.06950703263282776,
-0.6222556233406067,
-0.843336284160614,
-0.7267979383468628,
1.0620988607406616,
0.08328472077846527,
0.6819551587104797,
-0.6628940105438232,
0.5352596640586853,
... |
def error _ desc ( error _ code, return _ bool = false ) : if error _ code is none or not isinstance ( error _ code, int ) : return " error code : invalid type : % d " % error _ code exit _ code _ description _ = http _ status _ desc _ dict. get ( error _ code, none ) if exit _ code _ description _ is not none : return... | [
-0.5051450133323669,
0.237428218126297,
0.8916923403739929,
-0.0022624568082392216,
0.4097146987915039,
-0.02834385447204113,
-0.12693944573402405,
0.6411125063896179,
-0.22697383165359497,
0.7508926391601562,
0.501995861530304,
0.46217289566993713,
0.1461668312549591,
0.40828171372413635,... |
def momilp _ model ( self ) : return self. _ momilp _ model | [
0.5226088166236877,
-0.4742424488067627,
0.22961832582950592,
-0.20864011347293854,
-0.6164505481719971,
1.6720412969589233,
-0.22834813594818115,
0.31975358724594116,
1.0456246137619019,
1.0014636516571045,
0.05498015135526657,
-0.7406672239303589,
-0.4190145432949066,
-0.8577675223350525... |
def num ( s ) : try : val = int ( s ) if int ( s ) = = float ( s ) else float ( s ) except valueerror : try : val = float ( s ) except valueerror : raise valueerror ( f " { s } cannot be converted into a integer or float. " ) return val | [
0.19498968124389648,
0.23649999499320984,
0.3287801742553711,
0.38296473026275635,
0.2875944674015045,
-0.3520514965057373,
0.5687142610549927,
-0.2611590027809143,
0.33702677488327026,
-0.8393077850341797,
0.393682062625885,
0.14324617385864258,
-0.3460019826889038,
-0.061227817088365555,... |
def cleanuptext ( path ) : text _ cleaned ='' try : f = open ( path ) raw = f. read ( ). lower ( ) text = raw text _ cleaned = re. sub ( r'[ -.?!, " : ; ( ) / | 0 - 9 ] ','', text ) # splitword = text _ cleaned. split ( " " ) # # for word in splitword : # if word in stop _ word : # splitword. remove ( word ) # text _ c... | [
0.5161558389663696,
-0.5180227160453796,
0.8655514121055603,
-0.22288550436496735,
-1.4425073862075806,
0.5232238173484802,
0.6577503681182861,
1.1184669733047485,
-0.12413182854652405,
0.5952198505401611,
-0.29758453369140625,
-0.31142619252204895,
-0.4108937978744507,
-0.1029657199978828... |
def test _ multiply _ array ( ctx _ factory ) : context = ctx _ factory ( ) queue = cl. commandqueue ( context ) a = np. array ( [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ). astype ( np. float32 ) a _ gpu = cl _ array. to _ device ( queue, a ) b _ gpu = cl _ array. to _ device ( queue, a ) a _ squared = ( b _ gpu * a _ gpu ). ... | [
0.10404714941978455,
0.005775159224867821,
0.9366592168807983,
0.8199065327644348,
0.9345072507858276,
0.08998210728168488,
0.2744803726673126,
-0.9932997226715088,
0.6253823041915894,
-0.3512350916862488,
-0.07719680666923523,
-0.08327082544565201,
0.4142526090145111,
0.4897580146789551,
... |
def test _ required _ field _ validation _ invalid ( ) : sut = isnumbervalidation ( field ) with pytest. raises ( typeerror ) as execinfo : sut. validate ( { field : " 1 " } ) assert execinfo = = is _ number _ error ( field ) | [
-0.6418819427490234,
0.7614432573318481,
0.3067113757133484,
0.8361053466796875,
0.15048138797283173,
1.4565681219100952,
-0.15655061602592468,
0.6816858053207397,
0.08318208158016205,
-0.14934974908828735,
-1.010068655014038,
-0.4231632351875305,
-0.6866724491119385,
0.7606539130210876,
... |
def augmentedmatrix2 ( m, i ) : a = [ i [ : ] for i in m ] for i in range ( len ( m ) ) : for j in range ( len ( i ) ) : a [ i ]. append ( i [ i ] [ j ] ) return a | [
-0.26430970430374146,
-1.3736745119094849,
0.4566764831542969,
0.3201979696750641,
-0.48487111926078796,
-0.17162896692752838,
-0.17617635428905487,
0.03966018930077553,
-0.37832000851631165,
0.21588028967380524,
0.10558421909809113,
0.49412551522254944,
-0.5255975723266602,
0.208418011665... |
def url ( self ) - > str : # remark : url address might be part of the metadata return self. _ get _ detail ( " url " ) | [
0.12004636228084564,
0.3069326877593994,
0.3454994857311249,
0.309254914522171,
1.1291230916976929,
0.640295147895813,
-0.11709144711494446,
0.6828668713569641,
0.5824295282363892,
0.1610812544822693,
0.3311319351196289,
1.2220497131347656,
0.46756231784820557,
-0.5057355165481567,
-0.75... |
def test _ velocity ( ) : assert ( velocity ( m = 1. 989e + 30, r = 1. 0 * 1. 496e + 11 ) = = 29779. 301841746023 ) | [
1.0904089212417603,
-0.2972910702228546,
0.4111887812614441,
-0.212406724691391,
0.3021911680698395,
0.8076847791671753,
0.566789984703064,
0.01681571640074253,
0.6056670546531677,
-0.3612159490585327,
0.14599139988422394,
-0.509117603302002,
-0.4200402796268463,
0.255116730928421,
0.465... |
def get _ candidate _ size _ delta ( self, candidate _ rule, rules _ to _ remove ) : delta = 0. 0 delta - = self. _ get _ rule _ size ( candidate _ rule ) for rule in rules _ to _ remove : delta + = self. _ get _ rule _ size ( rule ) return delta | [
0.32002586126327515,
-0.12682795524597168,
0.6849750876426697,
0.23230019211769104,
0.3148069977760315,
0.5894944667816162,
0.06148921698331833,
1.505721092224121,
-0.5542252659797668,
0.36005282402038574,
-0.2718837261199951,
0.18544334173202515,
-0.09015063941478729,
0.13138382136821747,... |
def _ check _ arg _ step _ function ( arg, name ) : assert isinstance ( arg, cpoexpr ) and ( arg. type = = type _ stepfunction ), " argument'" + name + "'should be a cpostepfunction " return arg | [
-0.1984502673149109,
-0.23291513323783875,
0.32710614800453186,
0.18751917779445648,
-0.594541072845459,
0.2959160804748535,
0.546088457107544,
0.9261921644210815,
-0.3186286985874176,
0.6748781800270081,
-0.42083919048309326,
0.35365942120552063,
-0.5637800097465515,
0.5110750198364258,
... |
def test _ invertible ( self ) : reward _ normalizer, strategy = self. _ setup (. 5 ) # apply update. targets = tf. range ( 20, dtype = tf. float32 ) self. _ update _ normalization _ statistics ( reward _ normalizer, strategy, targets ) # verify that update is correct. with strategy. scope ( ) : normalized = reward _ n... | [
-0.3954198956489563,
0.4386330544948578,
0.551210343837738,
0.4868725538253784,
0.3312041163444519,
0.7587071061134338,
0.45381587743759155,
0.36635810136795044,
-0.6814775466918945,
0.22324122488498688,
-0.11004963517189026,
0.11089660227298737,
-0.6386210918426514,
-0.43688711524009705,
... |
def link _ to _ cites ( case _ html, cites ) : from capdb. models import citation for cite in cites : vol _ num, reporter, page _ num = citation. parse _ cite ( cite ['cite'] ) if not reporter : continue cite _ link = " < a href ='% s'> % s < / a > " % ( reverse ('citation ', host ='cite ', args = [ slugify ( reporter ... | [
0.4264950156211853,
-0.4240802526473999,
0.5884441137313843,
0.10850989818572998,
1.0891733169555664,
0.1655522733926773,
0.5581974983215332,
0.4839540719985962,
0.2738470137119293,
0.17591693997383118,
0.9374251365661621,
-0.11124728620052338,
-0.18018436431884766,
0.3824685215950012,
-... |
def file _ type _ desc ( self ) - > str : return self. _ file _ type _ desc | [
1.0046061277389526,
-0.2931472659111023,
0.5255876183509827,
0.13621501624584198,
0.9896935820579529,
0.8844326734542847,
0.4571165442466736,
0.05710500106215477,
-0.6915553212165833,
-0.41344666481018066,
0.6448104381561279,
1.235853910446167,
0.0682181641459465,
0.28121417760849,
-0.10... |
def copy ( self ) : from copy import deepcopy return deepcopy ( self ) | [
-0.18787221610546112,
-1.0649436712265015,
0.537997305393219,
0.9637503623962402,
-0.8743492960929871,
1.0251727104187012,
0.1076652854681015,
-0.5414686799049377,
0.16469964385032654,
-0.7891181111335754,
0.15488526225090027,
1.0094226598739624,
-0.1292792111635208,
-0.9935756325721741,
... |
def circle _ frame ( self, rho, color ) : for png _ y in range ( self. image. shape [ 0 ] ) : plot _ y, _ = self. png _ to _ plot ( png _ y, 0 ) # now we need to find where the rho - circle intersects with y = # plot _ y. we have y = rho * sin ( theta ), so the intersection is # theta = arcsin ( y / rho ). theta = np. ... | [
-0.27441465854644775,
0.2163246124982834,
0.7581206560134888,
-0.4510604739189148,
0.6010996699333191,
-0.342643678188324,
0.6924244165420532,
-0.298653781414032,
-0.6118420958518982,
0.42778030037879944,
-0.2986419200897217,
0.433003693819046,
0.3601912260055542,
0.9594186544418335,
0.9... |
def preprocessedterm ( self, word ) : return self. ppr. stemwordporter ( self. ppr. tolowercase ( word. strip ( ) ) ) | [
0.7921434640884399,
-0.3290732502937317,
0.44017744064331055,
-0.9834349155426025,
-0.4105220437049866,
0.6879197955131531,
-0.18438057601451874,
-0.4023807942867279,
0.6229070425033569,
-0.22597955167293549,
0.3267958164215088,
0.3983835279941559,
-1.0326149463653564,
0.27756422758102417,... |
def make _ lens ( r1, r2, d, z _ offset, material = none, external _ material = none ) : # we handle defaults this way so that if none is passed we can fill in the default. if material is none : material = bk7 if external _ material is none : external _ material = air center1 = z _ offset + d / 2 - r1 center2 = z _ off... | [
0.06333871185779572,
-0.7735927104949951,
0.7782033681869507,
-0.0297072920948267,
-0.8010270595550537,
0.9455329179763794,
-0.386974960565567,
-0.2135062962770462,
0.981968879699707,
-0.23996710777282715,
0.43032023310661316,
0.17117637395858765,
0.2694459855556488,
-0.7989218235015869,
... |
def test _ pillar _ glob _ include ( pillar _ include _ tree, salt _ call _ cli ) : ret = salt _ call _ cli. run ( " pillar. items " ) assert ret. returncode = = 0 assert ret. data assert " glob - a " in ret. data assert ret. data [ " glob - a " ] = = [ " entry a " ] assert " glob - b " in ret. data assert ret. data [ ... | [
0.48362672328948975,
0.21509112417697906,
0.6530241370201111,
0.03797956183552742,
1.07854163646698,
1.4542368650436401,
-0.2492852360010147,
0.35275375843048096,
0.10162251442670822,
0.11088336259126663,
-0.12836205959320068,
0.37412208318710327,
-1.1220250129699707,
0.1882237046957016,
... |
def _ verify _ col _ alias ( ) : # todo make output shown only for errors errs ='' print ('verifying column alias dictionary... \ n') for ( st, sc ) in sorted ( col _ alias ) : try : dt, dc = current _ names ( st, sc ) except keyerror : errs = errs + ('- unable to complete lookup for table : column'' " % s : % s " \ n'... | [
-0.13622909784317017,
-0.28067997097969055,
0.7205972671508789,
-0.4170876145362854,
-0.18700136244297028,
0.7915608286857605,
0.30038994550704956,
-0.9741438031196594,
-1.1820062398910522,
0.5525123476982117,
-0.6334832310676575,
-0.028127852827310562,
0.8068770170211792,
0.51665222644805... |
def test _ hourly ( syear, eyear, station ) : r = eyear - syear for i in range ( r + 1 ) : year = syear + i ht = hourly _ totals ( station, year ) ht. to _ csv ('my _ hourly _ totals / { } / { } _ { } _ ht. csv '. format ( station, station, year ), index = false ) return | [
-0.5276118516921997,
-0.4257746934890747,
0.5300527215003967,
0.20439143478870392,
-0.17322617769241333,
0.6824700832366943,
0.05521509051322937,
-0.09155534207820892,
0.1334996521472931,
0.1864873766899109,
-0.5582420825958252,
-0.3491555154323578,
0.30182164907455444,
-0.0947745218873024... |
def hex _ to _ int ( hex _ color ) : hex _ color = hex _ color. replace ( " # ", " " ) red = int ( hex _ color [ : 2 ], 16 ) green = int ( hex _ color [ 2 : 4 ], 16 ) blue = int ( hex _ color [ 4 : 6 ], 16 ) return [ red, green, blue ] | [
0.19010743498802185,
-0.6664323210716248,
0.6585944294929504,
-1.299904704093933,
1.316229224205017,
0.10298939049243927,
-0.5274613499641418,
0.8936670422554016,
-0.4141945540904999,
0.1279997080564499,
-1.6645843982696533,
-0.18757425248622894,
0.21342779695987701,
0.25363847613334656,
... |
def admin _ user ( db, django _ user _ model, django _ username _ field ) : usermodel = django _ user _ model username _ field = django _ username _ field username = " admin @ example. com " if username _ field = = " email " else " admin " try : user = usermodel. _ default _ manager. get ( * * { username _ field : user... | [
0.30773475766181946,
1.0863577127456665,
0.12826287746429443,
0.10779416561126709,
0.03462516516447067,
0.7144376635551453,
-0.3607904016971588,
-0.3688499629497528,
-0.16513825953006744,
-0.1505441665649414,
-1.0368443727493286,
0.413128137588501,
-0.3172047734260559,
0.11668218672275543,... |
def as _ array ( self ) : self. _ current _ field _ is _ array = true return self | [
-0.8544275760650635,
-0.6661986112594604,
0.4712260365486145,
-0.3450583219528198,
0.9019975066184998,
0.2623685598373413,
0.7125303149223328,
0.10730214416980743,
-0.2898125648498535,
0.13479727506637573,
-0.6326406598091125,
1.6626904010772705,
-0.5807862877845764,
0.17873209714889526,
... |
def test _ get _ data ( self, mock _ generic _ frame ) : expected = " test data " mock _ instance = mock _ generic _ frame. return _ value mock _ instance. get _ results. return _ value = expected actual = abstractgenericmodel ( ). data self. assertequal ( expected, actual ) | [
-0.6690251231193542,
0.36606696248054504,
0.4161573648452759,
-0.2383706420660019,
1.675336480140686,
0.6276931762695312,
-0.019000805914402008,
-0.33926403522491455,
-0.5294882655143738,
-1.0115721225738525,
-0.5700352787971497,
-0.0488479882478714,
0.02960451878607273,
-0.108263462781906... |
def init ( ) : global flags _ load _ language _ data if flags _ load _ language _ data : return with open ( language _ data _ path +'/ text _ suffix. txt') as read _ file : for line in read _ file. readlines ( ) : text _ suffix. append ( line. strip ( ) ) with open ( language _ data _ path +'/ support _ language. txt')... | [
0.3556320369243622,
-0.3014959990978241,
0.7885182499885559,
-1.1213666200637817,
-0.2935065031051636,
1.2901304960250854,
-0.5754925608634949,
0.901614785194397,
-1.2764397859573364,
-0.14432674646377563,
-0.8816479444503784,
0.19057250022888184,
0.22029004991054535,
1.3065907955169678,
... |
def update _ activity ( activity _ id ) : with db _ session ( ) as db : activity = db. query ( models. activity ) \. filter _ by ( id = activity _ id ) \. one ( ) # activity can only be edited by its owner if activity. user _ id! = get _ user _ id ( user _ email = flask. session ['email'] ) : return flask. redirect ( f... | [
-0.6171000599861145,
-0.3184627294540405,
0.47374752163887024,
0.06385748833417892,
0.10003063827753067,
-0.09551065415143967,
1.487113118171692,
-0.15718130767345428,
1.0166889429092407,
0.48969513177871704,
0.6363275647163391,
-0.13489092886447906,
0.018318405374884605,
-0.04144855216145... |
def api _ reverse ( viewname, args = none, kwargs = none, request = none, format = none, * * extra ) : if format is not none : kwargs = kwargs or { } kwargs ['format'] = format scheme ='http'if settings. debug else'https'out = django _ hosts _ reverse ( viewname, args = args, kwargs = kwargs, host ='api ', scheme = sch... | [
-0.8825714588165283,
0.10629401355981827,
0.7309700846672058,
-0.4375111758708954,
0.0030213401187211275,
-0.7202169299125671,
-0.383075088262558,
0.3468390107154846,
-0.6605772972106934,
-0.3180589973926544,
-0.10739188641309738,
0.8101853132247925,
-0.22679544985294342,
-0.39886742830276... |
def funfitc ( fs, f, xo, xn, met ='boole ', h = 10 * * - 4, full = false ) : ans = [ ] coefs = [ ] x = sympy. symbols ('x') n = len ( fs ) for i in xrange ( n ) : if met = ='sym': ans. append ( sympy. integrate ( f ( x ) * fs [ i ] ( x ), ( x, xo, xn ) ) ) else : ans. append ( numint ( sympy. lambdify ( x, f ( x ) * fs... | [
0.9032118320465088,
0.9075071811676025,
0.6928449273109436,
-0.52286696434021,
-0.07453297078609467,
-0.8293894529342651,
-0.030589157715439796,
-0.15524892508983612,
-0.7609761357307434,
0.17489418387413025,
-0.91940838098526,
-0.5439659953117371,
0.13234427571296692,
-0.13139019906520844... |
def _ _ copytabother ( self, sourceid, sourceindex, targetindex ) : tw = self. vm. gettabwidgetbyid ( int ( sourceid ) ) if tw is not none : editor = tw. widget ( sourceindex ). geteditor ( ) neweditor, assembly = self. vm. cloneeditor ( editor, editor. getfiletype ( ), editor. getfilename ( ) ) self. vm. insertview ( ... | [
0.08935897797346115,
-0.6751779913902283,
0.5479790568351746,
-0.9444354176521301,
-0.5011672973632812,
0.6900882720947266,
0.1586611121892929,
-0.44901806116104126,
-0.010875124484300613,
0.12278616428375244,
-0.09870258718729019,
0.4067329168319702,
0.41087108850479126,
-0.25875198841094... |
def _ check _ request _ reason ( self, request = none, server = none ) : server = server or self. server request = request or self. connection. get ( server ) reason = request. reason return reason | [
-0.6755320429801941,
-0.15888164937496185,
0.5260958075523376,
0.3157540261745453,
-0.05888047814369202,
-0.22403039038181305,
-0.9772318601608276,
-0.376889705657959,
0.18711993098258972,
-0.5577775239944458,
1.0176584720611572,
1.1732711791992188,
-1.487433910369873,
0.8148135542869568,
... |
def test _ add _ seen _ feed ( self, history, entry ) : added = history. add _ seen _ feed ( entry,'http : / / example. com') assert added is true added = history. add _ seen _ feed ( entry,'http : / / example. com') assert added is false assert len ( history ) = = 1 | [
0.11647015810012817,
0.19588503241539001,
0.5872622132301331,
-0.36186107993125916,
0.9893587231636047,
0.07793593406677246,
-0.06321294605731964,
-0.25367650389671326,
0.593646228313446,
-0.625154972076416,
-0.7717282176017761,
1.0437058210372925,
-0.057861484587192535,
0.2223296463489532... |
def recall _ score _ ( y, y _ hat, pos _ label = 1 ) : tp = 0 fn = 0 for i in range ( len ( y ) ) : if y [ i ] = = pos _ label and y _ hat [ i ] = = y [ i ] : tp + = 1 elif y [ i ] = = pos _ label and y _ hat [ i ]! = pos _ label : fn + = 1 return ( tp / ( tp + fn ) ) | [
0.7364116907119751,
-0.9500479698181152,
0.6628566384315491,
-0.045045267790555954,
0.3465162217617035,
-0.25979578495025635,
-0.259872168302536,
0.1032278761267662,
0.4506044089794159,
0.6113617420196533,
-0.3972398638725281,
-0.02194320037961006,
0.21971286833286285,
-0.3385346531867981,... |
def libtech _ queue _ manager ( logger, joblist, num _ threads = 100 ) : job _ queue = queue ( maxsize = 0 ) result _ queue = queue ( maxsize = 0 ) # this is result queue i = 0 for job in joblist : job _ queue. put ( job ) for i in range ( num _ threads ) : name = f " libtechworker { i } " worker = thread ( name = name... | [
-0.5295111536979675,
0.07147414237260818,
0.6383235454559326,
-0.23543958365917206,
0.6246406435966492,
-0.6845057010650635,
-0.40780913829803467,
-0.7295240163803101,
-0.6268694400787354,
-0.9668473601341248,
-0.24960671365261078,
-0.5989101529121399,
-0.008495204150676727,
0.209919646382... |
def get _ cluster _ id ( name ) : context = none if hasattr ( ssl,'_ create _ unverified _ context') : context = ssl. _ create _ unverified _ context ( ) si = connect. connect ( host = server, user = username, pwd = password, sslcontext = context ) content = si. content container = content. rootfolder viewtype = [ vim.... | [
0.169374480843544,
-0.0884370282292366,
0.6415964365005493,
0.39705127477645874,
-0.7123925685882568,
-0.45043620467185974,
0.4279559850692749,
-0.7542462348937988,
0.9414970874786377,
0.4073215425014496,
-0.2751346528530121,
0.5787807106971741,
-1.2890647649765015,
0.2753341794013977,
-... |
def splice ( args = none ) : command, args = cline. script _ args ( args ) # get inputs with cline ( " hipercam _ env ", ". hipercam ", command, args ) as cl : # register parameters cl. register ( " input1 ", cline. global, cline. prompt ) cl. register ( " input2 ", cline. global, cline. prompt ) cl. register ( " ccd "... | [
0.28997528553009033,
-0.36496707797050476,
1.1732338666915894,
0.6805793046951294,
-0.008402637206017971,
0.20138894021511078,
1.1331559419631958,
0.16018730401992798,
-0.4810101091861725,
0.25785934925079346,
-0.02300136536359787,
1.1533546447753906,
-0.9319108724594116,
0.904973447322845... |
def initalize _ all _ tables ( db = none ) : if not db : db = get _ db ( ) shotglass. initalize _ user _ tables ( db ) # # # setup any other tables you need here.... | [
-0.01490489300340414,
0.46281179785728455,
0.5438962578773499,
2.520111322402954,
-0.16589316725730896,
0.04054935276508331,
0.7923340201377869,
0.06674005836248398,
0.9722195863723755,
-0.5366705656051636,
-1.4581224918365479,
0.1691298484802246,
-0.3090072274208069,
1.6581954956054688,
... |
def event _ listeners ( self, event : str ) - > list : # get all listeners for this particular event listeners = [ x for x in self. listeners. get ( event ) or [ ] ] # add in wildcard events for wildcard in self. wildcards : regex = wildcard if re. search ( regex, event ) : listeners. extend ( self. listeners [ wildcar... | [
-0.070835642516613,
-0.7771780490875244,
0.6838051676750183,
0.0727233737707138,
0.1646433025598526,
0.22425858676433563,
-1.0087356567382812,
0.7112007737159729,
0.9981528520584106,
-0.15760213136672974,
-0.03877345100045204,
0.5693274140357971,
-0.0678877979516983,
0.1999574452638626,
... |
def test _ set ( subtests, etcd _ client, prefix ) : with subtests. test ( " we should be able to set a single value for a non - existent key " ) : assert etcd _ client. set ( " { } / set / key _ 1 ". format ( prefix ), " value _ 1 " ) = = " value _ 1 " assert etcd _ client. get ( " { } / set / key _ 1 ". format ( pref... | [
-0.4941401481628418,
0.31428492069244385,
0.4466858208179474,
-0.7653588056564331,
0.21943959593772888,
0.04453873634338379,
-0.25997474789619446,
0.011223086155951023,
-0.24645836651325226,
0.08497152477502823,
-0.1563626080751419,
0.6799831986427307,
0.4435149133205414,
-0.09213154017925... |
def flatten _ matrix ( m ) : arr = m. flat dim = m. shape [ 0 ] index = [ i * dim + i for i in range ( 0, dim ) ] np. delete ( arr, index ) return arr | [
-0.4251697063446045,
-0.16385087370872498,
0.45102134346961975,
0.12362352758646011,
-0.752157986164093,
0.49566367268562317,
1.0260237455368042,
0.07480621337890625,
0.388421893119812,
0.13802629709243774,
0.5667233467102051,
0.6969573497772217,
-0.8466322422027588,
-0.1849057525396347,
... |
def merge _ dict ( d1, d2, immutable = false ) : d1 = { } if d1 is none else d1 d2 = { } if d2 is none else d2 d1 = deepcopy ( d1 ) if immutable else d1 for k in d2 : # if d1 and d2 have dict for k, then recurse # else assign the new value to d1 [ k ] if ( k in d1 and isinstance ( d1 [ k ], mapping ) and isinstance ( d... | [
-1.0509926080703735,
0.9100658893585205,
1.0048394203186035,
0.3084107041358948,
-1.2881371974945068,
-0.3178999722003937,
-0.7780488729476929,
0.3606875240802765,
-0.03301301226019859,
-0.24123530089855194,
0.40238073468208313,
1.1496388912200928,
0.15501172840595245,
0.6746323704719543,
... |
def setup ( self ) : self. flag _ verbose = 1 self. a = [ 1 ] self. b = [ 1, 2 ] self. c = [ 1, 2, 3 ] self. d = numpy. array ( [ 1, 2 ] ) self. e = numpy. array ( [ 1, 2, 3, 4 ] ) | [
-0.008636453188955784,
0.5491300225257874,
0.4340890049934387,
-0.14654570817947388,
1.5974935293197632,
0.11227942258119583,
0.6452581286430359,
-0.09063000231981277,
-0.24013058841228485,
0.7269130349159241,
-0.2620649039745331,
0.20344200730323792,
-0.07500506192445755,
0.95433974266052... |
def get _ distance _ indicator ( self, frame ) : try : frame _ area = frame. shape [ 0 ] * frame. shape [ 1 ] for ( _, _, w _ roi, h _ roi ), ratio in zip ( self. rois, self. distance _ ratio ) : roi _ area = w _ roi * h _ roi ratio. append ( roi _ area / ( frame _ area + 1e - 7 ) * ( 100 ) ) except runtimewarning as e... | [
-0.270296573638916,
-0.4251803755760193,
0.5011866092681885,
-0.4019030034542084,
-0.7904068231582642,
0.13408111035823822,
0.2976401746273041,
0.6734132766723633,
0.5493283867835999,
1.047448992729187,
0.10406851768493652,
-0.47446107864379883,
-0.3020455241203308,
1.0577001571655273,
0... |
def envskwargs ( task, env _ kwargs ) : t = task tmp = env _ kwargs. copy ( ) tmp ['simple _ continual _ target'] = false tmp ['circular _ continual _ move'] = false tmp ['square _ continual _ move'] = false tmp ['eight _ continual _ move'] = false if ( t = ='sc') : tmp ['simple _ continual _ target'] = true elif ( t =... | [
-0.286207914352417,
0.09413821995258331,
0.5820823907852173,
-0.32236069440841675,
-0.16482552886009216,
0.4296819567680359,
0.02914203517138958,
0.20899634063243866,
-0.31179553270339966,
1.572752594947815,
-0.4567447602748871,
0.2081775814294815,
0.13561496138572693,
0.17389149963855743,... |
def train _ model _ bfgs ( model, likelihood, x, y, learning _ rate, training _ iter = 10 ) : lbfgs = fullbatchlbfgs ( model. parameters ( ), lr = learning _ rate ) mll = gpytorch. mlls. exactmarginalloglikelihood ( likelihood, model ) def closure ( ) : model. zero _ grad ( ) output = model ( x ) loss = - mll ( output,... | [
0.057929616421461105,
-0.3338802754878998,
0.6995905041694641,
-0.08731615543365479,
-0.3008987605571747,
0.03188063204288483,
-0.9470351338386536,
0.4217468202114105,
-1.124186396598816,
0.14780324697494507,
-0.19853198528289795,
0.20688195526599884,
0.08489783853292465,
0.902002632617950... |
def django _ username _ field ( django _ user _ model ) : return django _ user _ model. username _ field | [
-0.20198950171470642,
0.4613843262195587,
0.1464919149875641,
-0.3003939390182495,
-0.5997017025947571,
0.9199489951133728,
0.29538920521736145,
0.09840226173400879,
-0.5032387375831604,
0.45353081822395325,
-1.1494855880737305,
-0.6436576843261719,
0.49028053879737854,
-0.3792506456375122... |
def cross _ check ( dot1, dot2, rad ) : dist = ( ( dot1 [ 0 ] - dot2 [ 0 ] ) * * 2 + ( dot1 [ 1 ] - dot2 [ 1 ] ) * * 2 ) * * ( 1 / 2 ) return dist < rad | [
0.25406548380851746,
-1.1348451375961304,
0.6053352952003479,
-0.39830636978149414,
-0.5866803526878357,
1.1392455101013184,
0.05582382157444954,
-0.46803975105285645,
0.29276761412620544,
0.42901062965393066,
-0.2892906069755554,
0.8841884136199951,
-0.5344281196594238,
-0.153114899992942... |
def set _ enqueue _ time ( self, enqueued _ at ) : session = meta. get _ session ( self ) self. enqueued _ at = enqueued _ at session. commit ( ) | [
-0.3101300299167633,
-0.9306880235671997,
0.5888981223106384,
-0.8802946209907532,
0.7061498165130615,
0.4296473562717438,
-1.0331295728683472,
-0.2945628762245178,
-0.7044039964675903,
0.9931067824363708,
-1.2258836030960083,
0.7105603218078613,
0.6543408632278442,
0.9953227043151855,
-... |
def get _ loader ( root, cocofile, vocab, transform = none, batch _ size = 64, shuffle = false ) : # coco caption dataset coco = cocodata ( root = root, cocofile = cocofile, vocab = vocab, transform = transform ) # look above for definition data _ loader = torch. utils. data. dataloader ( dataset = coco, batch _ size =... | [
0.8925577402114868,
-0.19247367978096008,
0.33547675609588623,
-0.27714812755584717,
-0.8297902941703796,
-0.1450362354516983,
-0.7663477659225464,
0.3696826696395874,
-0.8098729848861694,
-1.038439393043518,
-0.6317924857139587,
0.5390451550483704,
0.762991189956665,
0.025323672220110893,... |
def timesafesamplewithdistance ( self, num, timeout ) : signal. signal ( signal. sigalrm, signal _ handler ) ; signal. alarm ( timeout ) ; try : self. samplewithmoreinfo ( num ) ; except exception, msg : print msg ; print " get { 0 } samples with distances \ n ". format ( len ( self. mdistsamples ) ) ; | [
0.4117535948753357,
0.12361644208431244,
0.39820098876953125,
0.3785165250301361,
-0.7995739579200745,
0.2217130810022354,
-0.4806182384490967,
-0.44536539912223816,
0.3103131651878357,
0.7543054819107056,
-0.648154079914093,
0.13268837332725525,
-0.01344976481050253,
0.14048942923545837,
... |
def _ _ init _ _ ( self, data _ type, relation _ type = none, relation _ npartitions = none, * args, * * kwargs ) : # todo : validate data type format. self. data _ type = data _ type self. relation _ type = relation _ type self. relation _ npartitions = relation _ npartitions super ( ). _ _ init _ _ ( * args, * * kwar... | [
0.6261041164398193,
0.366421639919281,
0.5370742082595825,
-0.5020477771759033,
0.5112515687942505,
-0.026174558326601982,
-0.0023075651843100786,
0.009210958145558834,
0.268519788980484,
-0.8906546235084534,
0.10952895134687424,
0.3752974271774292,
-0.08691264688968658,
0.3344684243202209... |
def _ _ getitem _ _ ( self, i ) : assert self. _ is _ valid _ index ( i ), " invalid index value " curr = self. _ front if i < 0 : i = self. _ count + i k = 0 while k < i : # new _ node = _ list _ node ( deepcopy ( value ), none ) curr = curr. _ next k + = 1 value = deepcopy ( curr. _ value ) # your code here return va... | [
-0.7407721281051636,
0.5458433628082275,
0.4311426281929016,
0.4872433841228485,
-0.5768479704856873,
0.03201410174369812,
0.8248205780982971,
-0.2181505709886551,
0.3885982632637024,
-0.6889663934707642,
-0.21746748685836792,
0.6098505258560181,
-0.1640957146883011,
-0.7093076109886169,
... |
def _ _ setitem _ _ ( self, element, timestamp ) : assert isinstance ( timestamp, datetime ) assert isinstance ( element, basestring ) # total number of seconds relative to epoch time total _ number _ of _ seconds = ( timestamp - datetime ( 1970, 1, 1 ) ). total _ seconds ( ) self. redis _ instance. zadd ( self. set _ ... | [
-0.42828139662742615,
1.0842921733856201,
0.47704729437828064,
-0.195408895611763,
0.06206053867936134,
-0.14968658983707428,
-0.5552276968955994,
-0.5435937643051147,
0.5237201452255249,
1.0938029289245605,
-0.9006774425506592,
-0.07955557852983475,
0.3719039857387543,
-0.4103672802448272... |
def write _ json ( all _ json, search, latitude, longitude ) : with open ( " json / { }. { }. { }. json ". format ( search, latitude, longitude ), " w " ) as f : for json in all _ json : f. write ( json + " \ n " ) | [
-0.9895128607749939,
-2.0167922973632812,
0.4130815863609314,
-0.024870924651622772,
0.46923360228538513,
0.5086321234703064,
-0.3997300863265991,
0.44170457124710083,
-0.5016365051269531,
0.5125139355659485,
-0.7655006647109985,
-0.019457653164863586,
0.33913731575012207,
0.53348606824874... |
def recurse ( self, data ) : return self. _ visit _ url ( data [ self. _ input ], data ) | [
-1.332701325416565,
0.8612087368965149,
0.26502636075019836,
-0.07193244993686676,
-0.6347382664680481,
0.03288016468286514,
0.5680927634239197,
-0.919225811958313,
-0.20820622146129608,
-0.9852771759033203,
0.188490629196167,
0.8677043914794922,
-0.29843753576278687,
0.8370802998542786,
... |
def locale ( self, locale ) : if self. _ configuration. client _ side _ validation and locale is none : raise valueerror ( " invalid value for ` locale `, must not be ` none ` " ) # noqa : e501 self. _ locale = locale | [
0.682715654373169,
0.3226061761379242,
0.07151037454605103,
0.6883856654167175,
0.41183191537857056,
0.9343400001525879,
1.1597356796264648,
0.7358267307281494,
-0.3186497986316681,
-0.5699307322502136,
-0.43210434913635254,
-0.1939864158630371,
-0.5167434215545654,
0.38483208417892456,
... |
def start ( self ) : for thread in self. threads : try : self. _ _ log. info ( " starting thread : { } ". format ( thread. getname ( ) ) ) thread. start ( ) except exception, e : mte = multithreadexception ( thread. getname ( ), e ) self. _ _ log. error ( " exception in thread start { }. error : { } ". format ( thread.... | [
0.7428739666938782,
-0.19174525141716003,
0.7933475375175476,
0.7478581666946411,
0.869041383266449,
0.586951494216919,
0.5380963683128357,
0.6935362815856934,
0.3693251609802246,
0.36501410603523254,
0.6185834407806396,
0.06660433113574982,
-0.3526522219181061,
0.8092296719551086,
-0.03... |
def check _ ip _ connection ( ) : # change - n to - c for use on linux p1 = popen ( [ " ping ", " - n ", " 4 ", " google. de " ], stdout = pipe ) output = p1. communicate ( ) [ 0 ] if output. _ _ contains _ _ ( " nicht finden " ) or output. _ _ contains _ _ ( " not found " ) : print ( " not reachable " ) lcd. write _ l... | [
-0.8154449462890625,
0.22459493577480316,
0.7305537462234497,
0.41447368264198303,
-0.22942852973937988,
0.8647895455360413,
0.14008529484272003,
-0.24874989688396454,
-1.3542723655700684,
1.1895179748535156,
0.5281421542167664,
-0.00035463462700136006,
-0.8591635823249817,
0.2764832377433... |
def collimate ( aray, area, dref ) : sidelength = math. sqrt ( area ) * 10 / dref # side at 10 cm centrepoint = aray. source + aray. vector / aray. length * 10 # point at 10 cm up on the midline of the ray xvector = np. array ( [ np. sin ( aray. xangle ), 0, - np. cos ( aray. xangle ) ] ) yvector = np. array ( [ 0, np.... | [
0.6757634282112122,
0.023850562050938606,
0.9436975121498108,
-1.1268821954727173,
0.4107022285461426,
-0.3797612488269806,
-0.3140055537223816,
-0.32337790727615356,
0.5400063395500183,
0.8637520670890808,
0.34342825412750244,
0.23546874523162842,
0.26784488558769226,
0.15608273446559906,... |
def _ openfile ( self ) : self. har _ path = qfiledialog. getopenfilename ( self. app,'open har file') [ 0 ] if not self. har _ path : raise harimportexception | [
0.7829681038856506,
-0.15342551469802856,
0.4440487027168274,
0.41345536708831787,
0.10333731025457382,
1.1333293914794922,
0.9829984307289124,
0.8939293026924133,
-0.9550305604934692,
-0.8958966732025146,
0.6164523363113403,
-0.5915636420249939,
0.5691461563110352,
-0.011485685594379902,
... |
def storage _ location ( self ) - > pulumi. output ['outputs. networkpacketcapturestoragelocation'] : return pulumi. get ( self, " storage _ location " ) | [
-0.2928970158100128,
-0.439468115568161,
0.3186552822589874,
0.5340917110443115,
0.3986051678657532,
0.6116575598716736,
0.8726180791854858,
-0.3986812233924866,
0.9673789143562317,
-0.5579935908317566,
-0.8106767535209656,
-0.3987519145011902,
0.4757167100906372,
-0.33321842551231384,
-... |
def split _ data ( frame, num _ folds, tc = tkcontext. implicit ) : from pyspark. sql. functions import rand df = frame. dataframe h = 1. 0 / num _ folds rand _ col = " rand _ 1 " df _ indexed = df. select ( " * ", rand ( 0 ). alias ( rand _ col ) ) for i in xrange ( num _ folds ) : test _ lower _ bound = i * h test _ ... | [
-0.5225703716278076,
0.7698107957839966,
0.53024822473526,
0.34901314973831177,
-0.6066808700561523,
0.00996533501893282,
0.90883868932724,
0.18235217034816742,
-0.0863666981458664,
-0.4962504804134369,
-0.04909326508641243,
-0.7443357110023499,
0.20740258693695068,
-0.09873922914266586,
... |
def split _ email ( s, h ) : if not s : return'postmaster ', h else : parts = s. split ('@ ', 1 ) if len ( parts ) = = 2 : return tuple ( parts ) else : return'postmaster ', s | [
-0.8916336894035339,
0.5466723442077637,
0.4356454610824585,
-0.5028901100158691,
-0.47230708599090576,
-0.43871140480041504,
-1.2751967906951904,
0.9004123210906982,
-0.1350676268339157,
0.6381628513336182,
-0.22532613575458527,
0.5276415944099426,
-0.4786006808280945,
-0.7296991348266602... |
def product _ is _ in _ stock ( product ) : current _ date = open ('current _ date. txt'). read ( ) with open ('products. csv ', newline ='' ) as csv _ file : product _ reader = csv. dictreader ( csv _ file ) product _ id = product ['id'] # products are considered sold when they have a clearly defined # selling date. s... | [
-0.8775070309638977,
-0.5242528915405273,
0.2583613097667694,
0.5463070869445801,
-0.04770233854651451,
1.1141221523284912,
0.18478426337242126,
-0.26896244287490845,
-0.13994619250297546,
0.15835437178611755,
-0.34868937730789185,
0.40703362226486206,
-0.10721999406814575,
0.2529395520687... |
def url ( self, request ) - > str : return url _ for ( request, " challenge ", id = str ( self. challenge _ id ) ) | [
-0.3462361693382263,
-0.20004862546920776,
0.12338504195213318,
0.2594994604587555,
0.825528621673584,
0.6094825267791748,
-0.5165382623672485,
0.37729310989379883,
-0.17530886828899384,
-0.13848565518856049,
0.5158629417419434,
-0.7563073039054871,
0.9356635808944702,
0.5899020433425903,
... |
def server _ bind ( self ) : socketserver. tcpserver. server _ bind ( self ) host, port = self. server _ address [ : 2 ] self. server _ name = socket. getfqdn ( host ) self. server _ port = port | [
-0.6138076782226562,
-1.0927115678787231,
0.5003736615180969,
-0.4688844382762909,
0.1812661588191986,
-0.058916348963975906,
-0.14714570343494415,
0.5444897413253784,
-0.37141838669776917,
-0.31258323788642883,
-1.2041465044021606,
1.3455119132995605,
0.22146418690681458,
0.73389524221420... |
def getsplitorientation ( self ) : return self. _ _ splitter. orientation ( ) | [
-0.576370358467102,
0.08604972809553146,
0.3254478871822357,
0.5144128799438477,
-0.20327326655387878,
-0.43247970938682556,
1.5418846607208252,
0.3109043538570404,
-0.15894266963005066,
0.07343834638595581,
-0.7712410688400269,
-0.5791961550712585,
-1.711493730545044,
-0.42803850769996643... |
def init _ widgets ( self ) : pass | [
-0.27797389030456543,
-0.08897838741540909,
0.19462662935256958,
0.7502813935279846,
0.6412206292152405,
0.03182778134942055,
0.5149622559547424,
0.9436635971069336,
-0.34565770626068115,
-1.0931628942489624,
-1.583783745765686,
0.3272784352302551,
-0.5949780941009521,
1.1342990398406982,
... |
def load ( name =... ) : # - > list [ str ] :... | [
-0.6835235953330994,
0.33208411931991577,
0.4768310785293579,
0.3026312589645386,
-0.7098425030708313,
-0.6409081220626831,
-1.0790448188781738,
0.025212986394762993,
-0.05461062118411064,
0.6805762648582458,
-1.724183201789856,
-0.11122307181358337,
-0.15886908769607544,
-0.05515863746404... |
def _ _ add _ _ ( self, other : " translation2d " ) - > " translation2d " : if not isinstance ( other, translation2d ) : return notimplemented return translation2d ( self. x + other. x, self. y + other. y ) | [
-0.6250428557395935,
-0.03992251679301262,
0.7985602617263794,
-0.2984605133533478,
-0.934472918510437,
0.4550645053386688,
-0.7151572108268738,
-1.6758469343185425,
0.2739679515361786,
-0.3898884952068329,
-0.4628366231918335,
-0.17977778613567352,
0.673536479473114,
-0.4618854224681854,
... |
def record _ audio ( ) : with sr. microphone ( ) as source : # using the default microphone configured by own computer rec. pause _ threshold = 0. 5 # rec. adjust _ for _ ambient _ noise ( source, duration = 0. 5 ) # adapting the sensibility of audio recognition about noises print ('say something...') voice _ data ='' ... | [
0.030650440603494644,
-0.203689306974411,
0.6153265833854675,
0.2960335314273834,
-0.23182088136672974,
0.6312163472175598,
-0.4463077485561371,
-0.23636281490325928,
-0.06156647950410843,
0.34274712204933167,
-0.33044809103012085,
1.039147973060608,
-0.3399428129196167,
0.1929612606763839... |
def _ _ init _ _ ( self, x, y ) : # some color picker thing self. _ color = brick _ colors [ random. randint ( 0, len ( brick _ colors ) - 1 ) ] self. _ x = x self. _ y = y | [
-0.5777725577354431,
-0.6036005616188049,
0.6329264640808105,
0.19422125816345215,
0.44212406873703003,
-0.2163861095905304,
-0.17258556187152863,
0.0807049423456192,
-0.6064850687980652,
0.16763001680374146,
-0.9662051200866699,
0.47919249534606934,
0.05280829966068268,
0.0543515309691429... |
def test _ write _ version ( self ) : message = protocolversionmessage ( ) m _ bytes = write _ message ( message ) self. assertequal ( m _ bytes, _ proto _ version ) | [
-0.643279492855072,
-0.11684750765562057,
0.1656179577112198,
0.5410720705986023,
1.3279163837432861,
0.8878654837608337,
0.5717592835426331,
-0.23916444182395935,
-0.26151683926582336,
0.049384985119104385,
-1.0666178464889526,
-0.08823474496603012,
-1.6416796445846558,
0.0621743462979793... |
def _ reset _ episode ( self ) : self. _ init _ hyper _ paras ( ) self. start _ date = increment _ ts _ by _ one _ day ( self. start _ date ) self. prev _ timestamp = self. start _ date self. remaining _ budget _ t = self. total _ budget # remaining budget self. remaining _ budget _ t _ minus _ 1 = self. total _ budget... | [
-0.3997027277946472,
-0.4404325783252716,
0.6279205679893494,
-0.2530975341796875,
0.7230658531188965,
-0.04718479514122009,
-0.22185009717941284,
0.12079167366027832,
-0.0970241129398346,
0.8578709959983826,
-0.2984311580657959,
0.6346709132194519,
-0.16912569105625153,
-0.439032346010208... |
def project _ to _ plane ( pts, plane _ norm ) : plane _ norm = norm ( plane _ norm ) distance = pts. dot ( plane _ norm ) projected _ pts = pts - distance [ :, none ] * plane _ norm return projected _ pts, distance | [
0.0919230654835701,
-0.5461259484291077,
0.3139326274394989,
-0.032081238925457,
-0.22973500192165375,
0.4249313175678253,
-0.03065378963947296,
0.7274094223976135,
-0.1522521674633026,
1.1916515827178955,
0.7138623595237732,
-0.5435351133346558,
-0.5018424391746521,
-0.3018534779548645,
... |
def unknown _ method _ test ( self ) : # pylint : disable = no - self - use def _ fail ( ) : return filereactor ('', method ='gnusto') assert _ raises _ regexp ( valueerror, r " ^ acceptable methods are :. * $ ", _ fail ) | [
0.6205217838287354,
0.8113609552383423,
0.31722497940063477,
-0.14598976075649261,
0.1527053415775299,
-0.31796780228614807,
-0.19372792541980743,
0.5360798239707947,
-0.5271525979042053,
-0.3991067409515381,
0.09298110008239746,
0.15772172808647156,
-0.05366692319512367,
-0.12609452009201... |
def _ _ getitem _ _ ( self, key ) : edge = self. to _ edge ( key ) c = self. children [ edge ] if isinstance ( c, _ nodepp ) : original = c. original else : original = none return _ node _ pp ( c, e = edge, p = self, o = original ) | [
-0.6158916354179382,
0.11673012375831604,
0.6701865196228027,
0.16789443790912628,
-1.0473750829696655,
-0.3200490176677704,
-0.22673451900482178,
0.2926003932952881,
-0.08842694759368896,
0.7184149026870728,
0.45926418900489807,
-0.023334035649895668,
-0.3243699073791504,
-1.4702756404876... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.