text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def get _ clusters ( self, uuid = none, cache = false, * * kwargs ) : if cache : clusters = self. get _ cached _ inventory ('_ _ clusters') else : clusters = self. search ( types = ['cluster'], * * kwargs ) if uuid : return [ deepcopy ( x ) for x in clusters if x ['uuid'] = = uuid ] return clusters | [
-2.0511293411254883,
0.5612569451332092,
0.36299410462379456,
1.239550232887268,
0.38422033190727234,
-0.32222607731819153,
-0.11425253748893738,
-0.02939840592443943,
0.2818208932876587,
0.5183391571044922,
0.1469067931175232,
0.8511316180229187,
-0.322832852602005,
-0.7850813865661621,
... |
def load _ weights _ to _ network ( model, weights _ dict ) : weights _ names = list ( weights _ dict. keys ( ) ) for layer in model. layers : if layer. name in weights _ names : if " bn " in layer. name : mean = weights _ dict [ layer. name ] [ " mean " ] var = weights _ dict [ layer. name ] [ " var " ] scale = weight... | [
-0.005689798388630152,
-0.3552882969379425,
0.6576429009437561,
-0.9964143633842468,
0.090803362429142,
0.3700341284275055,
-0.48971083760261536,
-0.2691826820373535,
-0.5225115418434143,
1.3517156839370728,
-0.42764437198638916,
-0.4447556436061859,
0.05232197046279907,
0.6872678995132446... |
def setreadmode ( mode ) : return none | [
-0.6793254613876343,
-0.46634623408317566,
0.542762815952301,
-0.21339835226535797,
0.07134611159563065,
1.1860359907150269,
-0.5291066765785217,
0.08784911036491394,
0.1844797134399414,
-0.7290593981742859,
0.22829385101795197,
-0.13971124589443207,
-0.6106230020523071,
-0.937950313091278... |
def input _ menu _ choice ( ) : choice = str ( input ( " which option would you like to perform? [ 1 to 6 ] - " ) ). strip ( ) print ( ) # add an extra line for looks return choice | [
-0.3359427750110626,
-0.44416359066963196,
0.24605506658554077,
0.7757600545883179,
-0.16313022375106812,
0.539201557636261,
0.5198575854301453,
-0.6414071917533875,
0.2832259237766266,
-0.8099195957183838,
0.4193335473537445,
0.5704408884048462,
-0.4849162697792053,
-0.7114195227622986,
... |
def buildray ( tablelongitudinal, tablelateral, tableheight, lrangle, ccangle, dref ) : x = 0 y = 0 z = - dref lrrads = ( lrangle / 360. ) * 2. * math. pi ccrads = ( ccangle / 360. ) * 2. * math. pi sinlr = math. sin ( lrrads ) coslr = math. cos ( lrrads ) sincc = math. sin ( ccrads ) coscc = math. cos ( ccrads ) # ful... | [
0.09299951046705246,
-0.3241111934185028,
0.6826415657997131,
-0.4575313627719879,
0.2516027092933655,
-0.25474390387535095,
-0.04147585481405258,
-0.43548497557640076,
-0.14048533141613007,
0.2973887622356415,
-0.22369523346424103,
0.23520579934120178,
-0.1339138299226761,
-0.291563749313... |
def _ get _ geo _ name ( self ) : try : result = urlfetch. fetch ('http : / / ws. geonames. org / findnearestaddressjson? lat = % f & lng = % f'% ( self. location. lat, self. location. lon ) ). content # todo handle cases when server is overloaded. except urlfetch. downloaderror : result ='unknown'except urlfetch. erro... | [
-0.49951910972595215,
-0.5735478401184082,
0.5033801794052124,
-0.8846422433853149,
-1.480659008026123,
-0.25767987966537476,
-1.512237310409546,
-0.9384043216705322,
-0.6587107181549072,
0.7782585620880127,
-0.8579973578453064,
0.15068426728248596,
0.15957018733024597,
-0.2576844394207001... |
def _ _ str _ _ ( self ) - > str : self _ as _ str = " " for channel, frames in self. frames. items ( ) : initial _ time _ point = frames [ 0 ]. time _ point self _ as _ str + = ( f " [ { channel } ] \ n " # channel name f " { frames [ 0 ]. size [ 1 ] } x { frames [ 0 ]. size [ 0 ] } x " # image size f " [ { initial _ ... | [
-0.027551423758268356,
-0.974975049495697,
0.7726151943206787,
-0.8805138468742371,
0.17609192430973053,
-0.23407815396785736,
-0.21135839819908142,
-0.7955052852630615,
-0.552647590637207,
0.4084618091583252,
0.24690592288970947,
0.15808431804180145,
0.01314837671816349,
0.656991124153137... |
def clear _ update ( self ) : # override if self. _ update _ commands is not none : self. _ update _ commands = [ ] | [
-0.45741134881973267,
-0.6081645488739014,
0.5866625905036926,
0.6491772532463074,
0.22189189493656158,
0.0444902665913105,
-0.3603188991546631,
-0.49665921926498413,
0.7166942358016968,
-0.037828229367733,
0.08215176314115524,
0.5242000818252563,
-0.5239591002464294,
0.4104212522506714,
... |
def players ( username ) : if request. method = = " post " : new _ user ( username, request. form [ " user " ] + " \ n " ) users = get _ users ( ) return render _ template ( " game. html ", username = username ) | [
-0.6202044486999512,
0.5995717644691467,
0.640471875667572,
0.8623321652412415,
0.2502690851688385,
0.41866257786750793,
0.19699785113334656,
0.016207540407776833,
-0.7050492167472839,
0.4091450572013855,
-0.037019215524196625,
-0.6063189506530762,
-0.8192172050476074,
0.6480650305747986,
... |
def get _ antipole _ regs ( self, device : str ) - > dict [ str, str ] : inverted _ regs = self. config [ " devices " ] [ device ] [ " inverted _ regs " ] return inverted _ regs | [
-1.4409948587417603,
0.8257332444190979,
0.3243067264556885,
-0.5052922368049622,
-0.022917285561561584,
0.8221974968910217,
-0.27047625184059143,
0.49773070216178894,
-0.17063750326633453,
0.14937368035316467,
-1.2061254978179932,
0.12668651342391968,
-0.9560591578483582,
0.19500812888145... |
def mirror _ tree _ dest ( self, chm _ dest _ tree, mocked _ methods ) : return chm _ dest _ tree [ " mirror " ] | [
-1.0844508409500122,
-0.21783098578453064,
0.16379648447036743,
-0.9752237796783447,
-0.5880212187767029,
0.4133545160293579,
-0.02824421040713787,
0.7321801781654358,
0.0005570302600972354,
0.5835776329040527,
-0.6602969765663147,
1.1607592105865479,
0.48998335003852844,
0.541284859180450... |
def _ stack ( self, mu, logstdev ) : params = np. concatenate ( [ mu, logstdev ], axis = - 1 ) return params | [
-0.23680071532726288,
1.09675133228302,
0.43750667572021484,
0.3997593820095062,
0.022269941866397858,
-0.39430639147758484,
-0.12446034699678421,
-0.5510575175285339,
-0.4614607095718384,
1.1029363870620728,
1.2086771726608276,
1.0643807649612427,
0.1814197301864624,
0.5224524736404419,
... |
def calculate _ merge _ output _ shapes ( operator ) : check _ input _ and _ output _ numbers ( operator, input _ count _ range = [ 1, none ], output _ count _ range = 1 ) check _ input _ and _ output _ types ( operator, good _ input _ types = [ floattensortype ] ) # [ todo ] fix reduce - like shape inference. we now a... | [
-0.8613503575325012,
0.12270651012659073,
0.6358838677406311,
0.2149130254983902,
0.10578631609678268,
-0.7443312406539917,
1.2226166725158691,
0.12900030612945557,
-0.20311057567596436,
-0.01075002271682024,
-0.5419365167617798,
-0.5844895839691162,
0.05034460127353668,
0.2660926282405853... |
def test _ post _ _ valid ( self ) - > none : self. client. force _ login ( self. user ) response : httpresponse = self. client. post ( self. path, data = {'body':'an example answer ', } ) answer : models. answer = models. answer. objects. get ( ) assert {'author _ id': self. user. pk,'created': answer. created,'id': a... | [
0.12024147808551788,
-0.19337141513824463,
0.621650755405426,
0.7700345516204834,
-0.025672603398561478,
1.3945534229278564,
0.026697801426053047,
-0.55489581823349,
0.4451536238193512,
-0.8141602277755737,
-0.5858290791511536,
-0.2515285611152649,
0.20510876178741455,
-0.4934340715408325,... |
def test _ intraday _ dataframe _ with _ intraday _ database ( self ) : def mock _ get _ prices ( * args, * * kwargs ) : dt _ idx = pd. datetimeindex ( [ " 2018 - 06 - 29 ", " 2018 - 06 - 30 " ] ) times = [ " 11 : 00 : 00 ", " 12 : 00 : 00 " ] fields = [ " close " ] idx = pd. multiindex. from _ product ( [ fields, dt _... | [
-0.6573752760887146,
0.3080887794494629,
0.9014065265655518,
-0.4232581555843353,
-0.20472931861877441,
0.042584218084812164,
0.3514033257961273,
-0.06950952112674713,
-0.1795816272497177,
-0.15592460334300995,
-0.2122378796339035,
0.10670813173055649,
-1.0043755769729614,
-0.6487089991569... |
def _ build _ actor _ network ( self, scope, trainable ) : with tf. variable _ scope ( scope ) : hid1 = tf. layers. dense ( self. states _ ph, 150, activation = tf. tanh, trainable = trainable ) hid2 = tf. layers. dense ( hid1, 200, activation = tf. tanh, trainable = trainable ) hid3 = tf. layers. dense ( hid2, 150, ac... | [
-1.1569907665252686,
-0.9192376136779785,
0.46362239122390747,
0.04341375455260277,
0.4058487117290497,
-0.6093951463699341,
0.21809792518615723,
0.6702378392219543,
0.4387050271034241,
0.5813630819320679,
-0.6911051273345947,
0.930121898651123,
0.6081332564353943,
0.19677622616291046,
0... |
def main ( argv ) : try : opts, args = getopt. getopt ( argv, " hi : o : ", [ " ifile = ", " p = " ] ) except getopt. getopterror : print'generate _ data. py - zip - date - icd'sys. exit ( 2 ) for opt, arg in opts : pass | [
-0.25950533151626587,
0.20464715361595154,
0.735723614692688,
0.4711359739303589,
1.0705839395523071,
1.0902329683303833,
0.017196515575051308,
0.7251920700073242,
-0.4381662607192993,
0.07545212656259537,
0.09036135673522949,
0.34487536549568176,
-0.447884202003479,
-0.3396115005016327,
... |
def extend _ vector ( self, p1, p2, h, w, extend = 500 ) : theta = np. arctan2 ( p1 [ 1 ] - p2 [ 1 ], p1 [ 0 ] - p2 [ 0 ] ) endpt _ x = max ( 0, min ( p1 [ 0 ] - extend * np. cos ( theta ), w ) ) endpt _ y = max ( 0, min ( p1 [ 1 ] - extend * np. sin ( theta ), h ) ) theta = np. arctan2 ( p2 [ 1 ] - p1 [ 1 ], p2 [ 0 ] ... | [
-0.08420990407466888,
-0.3796331286430359,
0.9098924994468689,
0.013336717151105404,
-0.03632038086652756,
0.5989723205566406,
-0.5372542142868042,
0.15372014045715332,
-0.48595574498176575,
0.6574077606201172,
-0.2012460082769394,
1.2754290103912354,
0.2702177166938782,
-0.034722328186035... |
def test _ hof ( a, b ) : def f ( g, x ) : return g ( x ) * g ( scala _ add ( x, 10. 0 ) ) def g ( x ) : return x * b return scala _ add ( f ( g, a ), f ( g, b ) ) | [
1.3120367527008057,
1.2944074869155884,
0.25827065110206604,
0.25402212142944336,
1.2004374265670776,
-0.1998450756072998,
0.056468673050403595,
-0.5383676290512085,
0.23655320703983307,
-0.053241170942783356,
0.07155899703502655,
0.469908744096756,
-0.03099795989692211,
-0.804544806480407... |
def get _ user _ song ( check _ func ) : hint = " enter the song number : " song _ number = input ( hint ) while not check _ func ( song _ number ) : song _ number = input ( hint ) return song _ number | [
-0.05964123457670212,
0.2822451889514923,
0.37592506408691406,
1.1295982599258423,
0.5302149653434753,
0.8220528364181519,
1.22517991065979,
-0.17046260833740234,
-0.6762601137161255,
-0.7581239342689514,
-0.17891748249530792,
0.6661972999572754,
-0.2361123114824295,
-1.0878777503967285,
... |
def test _ post _ _ author _ update ( self ) - > none : self. client. force _ login ( self. author ) path = reverse ('question - update ', kwargs = dict ( pk = self. question. pk ) ) response = self. client. post ( path, data = dict ( title ='this is a title updated ', body ='this is an updated body ', subject = self. ... | [
-0.09794849902391434,
-0.8413617014884949,
0.6456548571586609,
0.4585033357143402,
-0.21729658544063568,
1.1831839084625244,
-0.010358029045164585,
-0.13001388311386108,
0.28172045946121216,
-0.5987704396247864,
-0.45569825172424316,
-0.23364239931106567,
0.079838328063488,
-0.108360797166... |
def set _ flow _ rate ( self, syringe _ num, flow _ rate ) : self. _ check _ syringe _ number ( syringe _ num ) if syringe _ num = = 2 and self. get _ mode ( )! = self. modes [ 1 ] : raise pumperror ( " % s : syringe 2 flow rate can only be set directly in " " proportional mode " % self. name ) flow _ rate = _ format _... | [
-0.17931905388832092,
-0.6195113062858582,
0.46201151609420776,
0.1680067926645279,
-0.06931975483894348,
0.12889127433300018,
-0.18232063949108124,
-0.3936837315559387,
0.5487104654312134,
-0.5075984001159668,
0.25439393520355225,
0.07849021255970001,
-0.5418092012405396,
-0.2353009581565... |
def psf _ in _ tile ( self, image, beam, g _ gauls, cdelt, factor, snrcutstack, volrank, \ tile _ prop, plot, img ) : mylog = mylogger. logging. getlogger ( " pybdsm. " + img. log + " psf _ vary " ) tile _ list, tile _ coord, tile _ snr = tile _ prop tr _ gaul = self. trans _ gaul ( g _ gauls ) tr = [ n for i, n in enu... | [
0.23338240385055542,
0.5221523642539978,
0.6520914435386658,
-0.6111197471618652,
0.04061896353960037,
-0.6169582009315491,
0.37652871012687683,
0.18264000117778778,
-0.3822281062602997,
0.005208524875342846,
0.1773328334093094,
0.25836390256881714,
-0.05713573470711708,
0.6857718825340271... |
def get _ random _ canvas _ block ( * args, * * kwargs ) : col _ count = 16 if len ( args ) < 1 else args [ 0 ] row _ count = 16 if len ( args ) < 2 else args [ 1 ] canvas = canvas ( row _ count = row _ count, lpad _ count = col _ count ) for r in range ( row _ count ) : for c in range ( col _ count ) : canvas. rows [ ... | [
-0.06514745950698853,
0.41613292694091797,
0.8429206609725952,
-0.6911681890487671,
0.08520856499671936,
0.3434443771839142,
0.1538432091474533,
-1.424060583114624,
-0.02977011166512966,
-0.8595990538597107,
-0.20816895365715027,
0.38809800148010254,
-0.23058240115642548,
0.433200836181640... |
def fold _ change _ bohr ( bohr _ parameter ) : bot _ term = 1 + np. exp ( - bohr _ parameter ) inv _ term = 1 / bot _ term return inv _ term | [
-0.22807550430297852,
0.4129445552825928,
0.5723769068717957,
0.16318343579769135,
-0.3217666447162628,
0.22977140545845032,
0.042884573340415955,
1.15459406375885,
-0.5510450005531311,
1.2047845125198364,
-0.6433621048927307,
1.20108163356781,
-0.847263514995575,
0.44184401631355286,
0.... |
def get _ death _ data ( ) : success = 0 if os. path. exists ('ghe2015 _ deaths - 2000 - country. xls') : print ( " - - ghe2015 _ deaths - 2000 - country. xls found locally " ) success = 1 else : print ( " - - trying to download ghe2015 _ deaths - 2000 - country. xls from from the who website " ) fn = ( " http : / / ww... | [
-0.425797700881958,
-0.6806272268295288,
1.027531623840332,
-0.24571622908115387,
0.131613090634346,
0.8715934157371521,
-0.07013965398073196,
0.2683517336845398,
-0.5170140862464905,
-0.1719922423362732,
0.3757132589817047,
0.36056843400001526,
0.5217210054397583,
0.3685666024684906,
1.... |
def _ xor _ shift ( self, number ) : # shift to the right and then bitwise xor. number ^ = ( number > > self. _ xor _ a1 ) # shift to the left and then bitwise xor. number ^ = ( number < < self. _ xor _ a2 ) # shift to the right and then bitwise xor. number ^ = ( number > > self. _ xor _ a3 ) return number | [
-0.8242990374565125,
0.7758219838142395,
0.796755850315094,
0.5272988677024841,
-0.47921618819236755,
0.6145463585853577,
-0.5288427472114563,
-0.6964542865753174,
0.6975350975990295,
-0.06387174874544144,
-0.36442551016807556,
-0.5782901644706726,
-0.11096645146608353,
-0.800691545009613,... |
def check ( value ) : cnt = 0 for i in value : if i = = " ( " : cnt = cnt + 1 else : if value [ cnt - 1 ] = = " ( " : cnt - = 1 else : return " no " if cnt = = 0 : return " yes " else : return " no " | [
-0.8752445578575134,
0.25784578919410706,
0.7184168100357056,
0.007493895478546619,
-1.0146294832229614,
-0.24388493597507477,
0.5975053906440735,
-0.7106421589851379,
0.4471234381198883,
0.48158615827560425,
-0.17274683713912964,
0.36573609709739685,
-1.000404953956604,
0.5149084329605103... |
def cache _ files ( self ) : cache _ files = list _ table _ cache _ files ( self. _ data ) if self. _ indices is not none : cache _ files + = list _ table _ cache _ files ( self. _ indices ) return cache _ files | [
-0.38970255851745605,
0.5765872001647949,
0.39627137780189514,
1.3144229650497437,
0.33742594718933105,
0.3194168508052826,
0.06482362747192383,
-0.07828933000564575,
-0.15469036996364594,
0.4042242169380188,
0.04143160581588745,
-0.20073799788951874,
-0.013241116888821125,
-0.129559457302... |
def events ( self, instance, keyboard, keycode, text, modifiers ) : if keyboard in ( 1001, 27 ) : if self. manager _ open : self. file _ manager. back ( ) return true | [
-0.2763647735118866,
0.13823218643665314,
0.48584821820259094,
0.13879792392253876,
-0.126991868019104,
0.15555085241794586,
0.8331958651542664,
0.7648674249649048,
0.05326244980096817,
0.120628722012043,
0.049288708716630936,
0.04189165309071541,
-0.9689214825630188,
-0.07087602466344833,... |
def _ validate _ raw _ nc ( self ) : self. raw _ nc _ list = [ ] total _ time _ len = 0 initial _ file = true id _ dim _ name _ list = [ ] id _ len _ list = [ ] q _ var _ name _ list = [ ] self. time _ len _ array = [ ] for rapid _ output _ file in self. rapid _ output _ file _ list : raw _ nc = dataset ( rapid _ outpu... | [
0.4208170473575592,
-0.7006901502609253,
0.7547683119773865,
-0.1673375517129898,
-0.012229024432599545,
0.07924950122833252,
0.35837864875793457,
-0.37106552720069885,
-0.6557586789131165,
-0.01161329448223114,
0.04777257516980171,
0.10751909762620926,
0.16054753959178925,
0.7749765515327... |
def test _ singlecasereporting ( self ) : result = self. runner. run ( self. test ) self. assertequal ( result. _ calls, ['starttest ','addsuccess ','stoptest'] ) | [
0.3462790846824646,
1.6044507026672363,
0.4425591230392456,
0.1124911978840828,
1.4341315031051636,
0.6962602138519287,
0.7610002160072327,
0.4898715615272522,
0.47235506772994995,
-0.6390147805213928,
-0.06642267107963562,
-0.7634674906730652,
-1.1296855211257935,
0.9922643303871155,
-0... |
def home ( ) : return render _ template ('index. html ', title ='home page ', year = datetime. now ( ). year, ) | [
0.5792672634124756,
-0.06013772264122963,
0.5376025438308716,
0.695902943611145,
-0.30281862616539,
0.5794560313224792,
-0.24675677716732025,
0.4600188136100769,
0.34718212485313416,
0.9522881507873535,
0.5077548027038574,
-0.005812040530145168,
-0.20900078117847443,
0.003906263504177332,
... |
def setwidth ( self, w = 150 ) : if w in range ( 50, 300 ) : self. wid = w else : print ( " error : invalid width. width reverted to old value " ) | [
-0.15325388312339783,
-0.23867976665496826,
0.6545077562332153,
0.028442077338695526,
-0.4809771776199341,
0.4397919178009033,
-0.10408658534288406,
-0.09477561712265015,
1.0129321813583374,
-0.6033740043640137,
0.6287180185317993,
1.0217193365097046,
-0.9462057948112488,
0.908747851848602... |
def sync _ tunnel _ allocations ( tunnel _ id _ ranges ) : # determine current configured allocatable tunnels tunnel _ ids = set ( ) for tunnel _ id _ range in tunnel _ id _ ranges : tun _ min, tun _ max = tunnel _ id _ range if tun _ max + 1 - tun _ min > 1000000 : log. error ( _ ( " skipping unreasonable tunnel id ra... | [
-0.5125042796134949,
-0.12563402950763702,
0.5647968053817749,
-0.28203830122947693,
0.15468382835388184,
-0.15079133212566376,
0.6690697073936462,
-0.8031818270683289,
0.1060791090130806,
1.0934957265853882,
0.9938361048698425,
-0.7036877870559692,
0.5709870457649231,
-0.2983342409133911,... |
def rotate _ velocity _ at ( self, pos, vel, et ) : vec _ pos = np. asarray ( pos ) vec _ vel = np. asarray ( vel ) if vec _ pos. ndim < 1 : vec _ pos = np. asarray ( [ pos ] ) if vec _ vel. ndim < 1 : vec _ vel = np. asarray ( [ vel ] ) if vec _ pos. shape! = vec _ vel. shape : raise valueerror ('input velocities and ... | [
-0.2449338734149933,
-0.003314343048259616,
0.692560613155365,
-0.24304282665252686,
0.10868941247463226,
-0.09327731281518936,
-0.4881213307380676,
-0.14191830158233643,
0.7190407514572144,
0.7145058512687683,
-0.28228893876075745,
-0.13143178820610046,
-0.06297240406274796,
-0.8270166516... |
def debug _ check _ repr _ of _ data ( index, encoder _ input _ data _ train, anwer _ gen _ input _ data _ train, answer _ gen _ target _ data _ train, train _ raw _ a, train _ raw _ q, index2word _ train _ a, index2word _ train _ q ) : print ( " index = " + str ( index ) ) print ( " raw data - - - - - - " ) print ( " ... | [
-0.6271910071372986,
-0.4279070198535919,
1.0418871641159058,
-1.4802725315093994,
-0.1442941427230835,
0.09784266352653503,
0.8222119808197021,
-0.5789412260055542,
-0.3760644793510437,
-0.09966758638620377,
-0.08953335136175156,
1.0524588823318481,
-0.14992469549179077,
-0.43936553597450... |
def calc _ deskew _ factor ( dz _ stage : float, xypixelsize : float, angle : float ) - > float : deskewf = np. cos ( angle * np. pi / 180. 0 ) * dz _ stage / xypixelsize logger. debug ( f " deskew factor caclulated as { deskewf } " ) return deskewf | [
-0.8547728657722473,
0.47602275013923645,
0.18625642359256744,
-0.6227173805236816,
-0.4291067123413086,
-0.7331439852714539,
0.6124371290206909,
-0.20162738859653473,
-0.1579471379518509,
-0.3676169812679291,
-0.1063402071595192,
-0.06949485093355179,
-0.02672351896762848,
1.4429098367691... |
def _ build _ train _ specific _ graph ( self, iterator, model _ fn, params, record _ files _ placeholder, num _ train _ steps ) : def build ( ) : features, labels = iterator. get _ next ( ) estimator _ spec = model _ fn ( features, labels, tf. estimator. modekeys. train, params ) with tf. control _ dependencies ( [ es... | [
-0.9152470827102661,
0.15736156702041626,
0.5295938849449158,
0.6040129661560059,
-0.3387902081012726,
-0.36654436588287354,
0.6825039386749268,
0.7084873914718628,
-1.1078768968582153,
0.6445779800415039,
0.06325417757034302,
0.2775440812110901,
0.8443302512168884,
-0.639157235622406,
0... |
def dbscan ( self ) : model = dbscan ( eps = 40, min _ samples = 50 ) model. fit ( self. trainingdata ) res = model. fit _ predict ( self. testingdata ) print ( " db scan accuracy ", metrics. accuracy _ score ( res, self. testlabels ) ) | [
-0.45984965562820435,
0.3346417546272278,
0.4434030055999756,
0.14320769906044006,
0.561913788318634,
0.7438400983810425,
0.8011029958724976,
0.08986571431159973,
-0.11126985400915146,
-0.8652216792106628,
-0.20642895996570587,
0.5247995853424072,
-0.5055729746818542,
0.13860589265823364,
... |
def model _ baseline ( train _ data, test _ data, test _ flag, prediction _ path ='', fold _ number ='' ) : def predict ( data, filename, save = true ) : # get non - zero elements ( rows, cols, vals ) = sp. find ( data ) # do predictions for ` data ` pred = np. array ( [ ( global _ mean + item _ means [ i ] + user _ me... | [
0.028287135064601898,
0.06228749081492424,
0.7438843846321106,
0.5450564622879028,
0.6805731654167175,
0.5023717880249023,
0.5275493860244751,
0.7815167903900146,
-0.7954392433166504,
0.6136580109596252,
-0.19831295311450958,
0.4919346570968628,
0.09290444850921631,
-0.06061119586229324,
... |
def setup ( self ) : self. pkmn = buildpokemonbattlewrapper ( ) self. trap = trap ( none, " ", " " ) self. hp = 32. 0 | [
-0.2559846341609955,
-0.08658230304718018,
0.44199517369270325,
0.981459379196167,
1.0316399335861206,
0.592491090297699,
-0.911102831363678,
0.0007698156405240297,
0.0011813559103757143,
-0.8607383370399475,
-0.6988353729248047,
-0.2617768347263336,
-0.09494493156671524,
0.609511077404022... |
def interpolation ( points, queries, feat, points _ row _ splits, queries _ row _ splits, k = 3 ) : ans = knn _ search ( points, queries, k = k, points _ row _ splits = points _ row _ splits, queries _ row _ splits = queries _ row _ splits, return _ distances = true ) idx = tf. cast ( tf. reshape ( ans. neighbors _ ind... | [
0.061083342880010605,
0.5973771214485168,
0.5323435068130493,
0.2768005430698395,
-0.46541929244995117,
-0.18727365136146545,
0.035999685525894165,
0.6517727375030518,
0.11184650659561157,
0.7710056900978088,
0.1198120266199112,
-0.7314326763153076,
0.30508920550346375,
-0.6979705095291138... |
def get _ number ( s ) : s = [ c for c in s if c in " 0123456789 " ] return " ". join ( s ) | [
0.7750635147094727,
0.04030393809080124,
0.5225382447242737,
0.3853617012500763,
0.37397781014442444,
-0.8931517601013184,
0.20935580134391785,
0.6497219204902649,
0.5274970531463623,
-0.7938848733901978,
-1.273419737815857,
0.11191896349191666,
-0.19839568436145782,
-0.9677844643592834,
... |
def newgeneration1 ( self ) : for i in range ( 0, len ( self. population ) ) : " " " depending of your experiment you need to use the most suitable algorithms for : 1. select two candidates 2. apply crossover 3. apply mutation " " " ia, ib = self. randomselection ( ) # * * * * single child implementation * * * * * * * ... | [
-0.9694694876670837,
-0.23590965569019318,
0.6180756092071533,
1.1628518104553223,
0.49506402015686035,
0.9728069305419922,
1.1883798837661743,
0.36483755707740784,
-0.2520499527454376,
0.8290958404541016,
-0.9061235189437866,
-0.22195422649383545,
-0.29000353813171387,
0.2774679660797119,... |
def update ( self, point, probability = 1. 0 ) : if not len ( point ) = = 3 : raise valueerror ( " point should be tuple ( x, y, z ) " ) if not 0 < probability < 1 : raise valueerror ( " probability should be between 0. 0 and 1. 0 " ) self. root. update ( point, probability, self. origin, self. width, self. _ max _ dep... | [
-0.2601894736289978,
-0.06727322936058044,
0.42723754048347473,
0.9899477958679199,
-0.48148444294929504,
0.9538168907165527,
0.060015786439180374,
0.46252837777137756,
0.10144498944282532,
0.629558265209198,
0.35567378997802734,
0.14557604491710663,
-0.9897194504737854,
0.1475171893835067... |
def set _ visit _ queryset ( self, * * kwargs ) : visit _ model = kwargs. get ('visit _ model') subject _ identifier = kwargs. get ('subject _ identifier') visit _ code = kwargs. get ('visit _ code') visit _ instance = kwargs. get ('visit _ instance') pk = kwargs. get ('pk') if pk : return visit _ model. objects. filte... | [
-0.4229092299938202,
0.14954671263694763,
0.5636849999427795,
-0.13145461678504944,
-0.05564194172620773,
0.7600516676902771,
0.3927878439426422,
0.12839266657829285,
-0.003951840102672577,
0.8343169093132019,
0.8025487065315247,
1.3627984523773193,
-0.002934536663815379,
0.045911192893981... |
def run _ startup ( ) : geo _ home ='/ usr / local / % s'% geoserver cmd ='export java _ home = % s ; export geoserver _ home = % s ; $ geoserver _ home / bin / startup. sh'% ( java _ home, geo _ home ) os. system ( cmd ) | [
0.45087236166000366,
-0.7115211486816406,
0.6017339825630188,
1.0545258522033691,
0.0908803939819336,
0.7328028678894043,
0.4195569157600403,
0.34232592582702637,
0.27586695551872253,
0.4036327302455902,
-0.12363303452730179,
1.1677778959274292,
0.41558536887168884,
0.49317222833633423,
... |
def get _ counts ( outfile, infile, is _ compressed = true, infile _ start = 0, infile _ end = 100, nodes _ u = none, nodes _ o = none ) : num _ subgraphs = 8 num _ rg = infile _ end - infile _ start ensemble _ counts = np. zeros ( [ num _ rg, num _ subgraphs ], dtype = np. int64 ) i = 0 while i < num _ rg : nth = infi... | [
0.2066257745027542,
0.4486929476261139,
0.8025765419006348,
0.6723493337631226,
0.22048774361610413,
0.3223998248577118,
1.3546981811523438,
0.5428639054298401,
-0.8742512464523315,
0.7114032506942749,
-0.7936874032020569,
1.1545511484146118,
-0.7954868674278259,
0.03232560306787491,
0.9... |
def test _ walksdownpath ( self ) : walkerresults = list ( runner. _ qualnamewalker ( " walker. texas. ranger " ) ) self. assertequal ( walkerresults, [ ( " walker. texas. ranger ", [ ] ), ( " walker. texas ", [ " ranger " ] ), ( " walker ", [ " texas ", " ranger " ] ) ] ) | [
-0.26660144329071045,
-1.0014081001281738,
0.47113728523254395,
0.08133109658956528,
0.1633424162864685,
0.9800292253494263,
0.8167267441749573,
-0.13968011736869812,
0.05198794603347778,
-1.0465240478515625,
-0.08346138894557953,
-0.42987754940986633,
-0.8036502599716187,
0.30602201819419... |
def _ _ reduce _ _ ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.4987119436264038,
-0.3061177730560303,
0.5492987036705017,
0.5679234862327576,
1.0172137022018433,
-0.5080894827842712,
0.7559726238250732,
0.10194369405508041,
0.07181468605995178,
-0.2222210168838501,
-1.1465363502502441,
-0.6514787077903748,
-0.18261341750621796,
0.7465806603431702,
... |
def addscalartensor ( self, tag, wall _ time = 0, step = 0, value = 0 ) : tensor = tensor _ util. make _ tensor _ proto ( float ( value ) ) event = event _ pb2. event ( wall _ time = wall _ time, step = step, summary = summary _ pb2. summary ( value = [ summary _ pb2. summary. value ( tag = tag, tensor = tensor ) ] ), ... | [
0.22184647619724274,
0.6344909071922302,
0.6674365401268005,
0.3797667324542999,
-0.6447095274925232,
0.3005181849002838,
-0.07211565226316452,
-1.1138416528701782,
-0.4015965759754181,
0.3417832553386688,
-1.4214422702789307,
0.350337415933609,
-0.027116850018501282,
0.8016670942306519,
... |
def localenergy ( self, wf, st ) : iflips, mel = self. findconn ( st ) en = 0 for k in range ( len ( mel ) ) : pop = wf. pop ( st, iflips [ k ] ) if pop = = none : continue en + = pop * mel [ k ]. conj ( ) return en | [
0.13777998089790344,
-0.4321150779724121,
0.3321394920349121,
-0.23976603150367737,
-0.9731523394584656,
-0.9242976307868958,
-0.23251473903656006,
1.0764652490615845,
-0.7752215266227722,
0.8689531087875366,
0.19852221012115479,
-0.608194887638092,
-0.8484722375869751,
-0.0880591049790382... |
def find _ cfr _ part ( text ) : counts = { } for match in re. finditer ( ur " ( \ d + ) \. ( \ d + ) ", text ) : counts [ match. group ( 1 ) ] = counts. get ( match. group ( 1 ), 0 ) + 1 best, best _ count = none, 0 for part in counts : if counts [ part ] > best _ count : best = part best _ count = counts [ part ] ret... | [
0.36454343795776367,
-0.13816210627555847,
0.907585084438324,
-0.4078647196292877,
-0.1710195392370224,
-0.5667293071746826,
0.45146068930625916,
0.3796383738517761,
-0.8344683647155762,
-0.6661707162857056,
0.07318107783794403,
-0.6446654200553894,
-0.8332489728927612,
0.7687598466873169,... |
def stop ( self ) : if not self. running : return # teardown event handlers. self. _ teardown _ event _ handlers ( ) # call parent method to stop the children and set the state. super ( filter, self ). stop ( ) | [
-0.7438855171203613,
-0.3321823179721832,
0.2390998899936676,
0.11921227723360062,
0.3442786931991577,
0.22893072664737701,
1.3818856477737427,
-0.023751484230160713,
-0.5431901812553406,
-0.03317663446068764,
-0.541093111038208,
0.05163324996829033,
-0.27025389671325684,
0.106840193271636... |
def check _ amt ( self, amt ) : if ( type ( amt ) is'float'or type ( amt ) is'int') : return true else : return false | [
-0.1952372044324875,
-0.4143379032611847,
0.6171254515647888,
0.048476677387952805,
-0.42738252878189087,
1.0566539764404297,
-0.48016464710235596,
-0.7155380249023438,
0.23460105061531067,
0.6448242664337158,
0.6379110813140869,
0.04305252805352211,
-0.878875732421875,
0.8880517482757568,... |
def addtab ( self, assembly, title ) : editor = assembly. geteditor ( ) super ( tabwidget, self ). addtab ( assembly, ui. pixmapcache. geticon ( " empty. png " ), title ) self. settabsclosable ( true ) self. navigationbutton. setenabled ( true ) if editor not in self. editors : self. editors. append ( editor ) editor. ... | [
-0.4508103132247925,
-0.4281057119369507,
0.6252252459526062,
0.20891782641410828,
0.3473142087459564,
0.557239294052124,
-0.13789790868759155,
0.17778928577899933,
0.08598237484693527,
-0.2749945819377899,
-0.3639010190963745,
-0.4692150056362152,
0.03543585166335106,
0.25646230578422546,... |
async def listen _ for _ new _ responses ( self, callback _ function = none, timeout = none ) : url = " { } { } : { } / ws / responses / new / current _ operation ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port ) if callback _ function : task = await self. stream _ output ( url, callback _ function, ... | [
0.3545396327972412,
-0.3134041726589203,
0.6664299368858337,
-0.17794857919216156,
-0.27557146549224854,
-0.7640266418457031,
0.9191158413887024,
-0.6193387508392334,
0.15868449211120605,
-0.33899009227752686,
0.29107865691185,
0.3893028795719147,
-0.1942242532968521,
0.19438554346561432,
... |
def _ state _ nodes _ to _ matrices ( self, state _ nodes, actions ) : assert isinstance ( state _ nodes, list ) n _ states = len ( state _ nodes ) n _ actions = len ( actions ) state _ index = { n. state : i for i, n in enumerate ( state _ nodes ) } action _ index = { a : i for i, a in enumerate ( actions ) } tf = np.... | [
-0.19765807688236237,
0.6892044544219971,
0.515068531036377,
-0.509867250919342,
0.06157773360610008,
-0.9076048731803894,
0.2941875457763672,
0.5824506878852844,
0.18693219125270844,
0.3862190544605255,
0.002330142306163907,
0.23221896588802338,
0.6350135207176208,
-0.4836367964744568,
... |
def _ init _ jobs _ table ( ) : _ jobs _ table = sqlalchemy. table ('jobs ', _ metadata, sqlalchemy. column ('job _ id ', sqlalchemy. unicodetext, primary _ key = true ), sqlalchemy. column ('job _ type ', sqlalchemy. unicodetext ), sqlalchemy. column ('status ', sqlalchemy. unicodetext, index = true ), sqlalchemy. col... | [
0.6278177499771118,
0.22434908151626587,
0.813688337802887,
-0.9233318567276001,
-0.2659529447555542,
-0.45270296931266785,
-0.6734872460365295,
-0.4382496774196625,
-1.043810486793518,
0.1158231645822525,
0.08540590107440948,
0.12053404003381729,
0.4394284188747406,
0.08766724914312363,
... |
def validate _ configuration ( cls, configuration : optional [ expectationconfiguration ] ) - > none : # setting up a configuration super ( ). validate _ configuration ( configuration ) if configuration is none : configuration = cls. configuration center _ point = configuration. kwargs [ " center _ point " ] range = co... | [
-0.45162060856819153,
-0.407071590423584,
0.5808591246604919,
-0.16550332307815552,
0.2683413028717041,
0.6767526268959045,
0.16892486810684204,
0.9071915745735168,
0.41533544659614563,
0.1052192822098732,
0.34671685099601746,
-0.2926770746707916,
-0.2548530101776123,
1.23859703540802,
0... |
async def launch _ smart _ coin ( self, source, * * kwargs ) - > coinwrapper : amt = 1 if'amt'in kwargs : amt = kwargs ['amt'] found _ coin = await self. choose _ coin ( amt ) if found _ coin is none : raise valueerror ( f'could not find available coin containing { amt } mojo') # create a puzzle based on the incoming s... | [
-0.0014346587704494596,
0.6020557284355164,
0.5499854683876038,
-0.10864003747701645,
-0.7865048050880432,
-0.804926872253418,
0.35246390104293823,
-0.16620387136936188,
0.4572851359844208,
0.5177958011627197,
-0.5655714273452759,
1.2340503931045532,
0.04077131301164627,
-0.093955017626285... |
def disable _ ansi _ colors ( world _ default _ config ) : orig _ colormode = cf. colormode cf. disable ( ) world _ default _ config. no _ ansi = true yield cf. colormode = orig _ colormode | [
0.20600299537181854,
-0.2908180356025696,
0.5503983497619629,
0.19334493577480316,
-0.7412376403808594,
0.8283803462982178,
0.39803794026374817,
0.40839117765426636,
-0.632140576839447,
-0.08879577368497849,
-1.2491180896759033,
-0.37996038794517517,
-0.30512577295303345,
0.268392890691757... |
def precess _ j2000 _ to _ b1950 ( ra, decl, input = " sexigesimal ", output = " sexigesimal " ) : # convert equatorial coords to radians if input = = " sexigesimal " : ra = protractor. convert ( ra, " hmsstr ", " rad " ) decl = protractor. convert ( decl, " dmsstr ", " rad " ) else : ra = protractor. convert ( ra, inp... | [
-0.039253730326890945,
-1.0915831327438354,
0.8850801587104797,
-1.1744214296340942,
-0.02107631415128708,
-0.38597050309181213,
0.2495240718126297,
0.41905927658081055,
0.0765194445848465,
0.23154616355895996,
-0.5097414255142212,
0.7719598412513733,
0.0659211277961731,
0.5368802547454834... |
def add _ et _ subelement ( self, parent : et. element ) - > none : element = et. subelement ( parent, " bit _ field _ value " ) element. set ( " name ", self. name ) element. set ( " value ", self. _ get _ value _ str ( ) ) element. set ( " description ", self. description ) | [
0.40427932143211365,
0.8924638032913208,
0.6920185089111328,
-0.22977815568447113,
-0.007983994670212269,
1.5669975280761719,
-0.38917845487594604,
-0.14053599536418915,
-0.534958004951477,
-0.684131383895874,
-0.5404369831085205,
0.28832194209098816,
0.3053603172302246,
0.6594023704528809... |
def renderparticletrajectories3d ( photonwaves, electronwaves ) : fig = plt. figure ( figsize = ( 10, 10 ) ) ax = fig. add _ subplot ( 111, projection ='3d') # hide axes ticks ax. set _ xlabel ('x axis') ax. set _ ylabel ('y axis') ax. set _ zlabel ('z axis') ax. tick _ params ( bottom = false, top = true, left = true,... | [
0.7319992184638977,
-0.06575510650873184,
0.8160828948020935,
-0.8924791216850281,
-0.44253861904144287,
0.9731122255325317,
-0.20948278903961182,
0.5111314654350281,
0.2736595571041107,
0.46046748757362366,
-0.15493077039718628,
0.5865788459777832,
-0.5212733745574951,
-0.3533292710781097... |
def _ _ init _ _ ( self, layers, procspec ) : self. procspec = procspec self. _ layers = layers self. _ data = { } self. spam = { } self. _ data = { } for layer in self. _ layers : self. _ data [ layer ] = layernoisedata ( layer ) | [
1.1139161586761475,
-0.20912879705429077,
0.3729656934738159,
-0.9460829496383667,
0.5725762844085693,
0.23475903272628784,
-0.5710532665252686,
0.16608215868473053,
-0.5471341013908386,
-0.12986689805984497,
-0.9407145977020264,
0.7602132558822632,
-0.11574387550354004,
0.6292650103569031... |
def call ( self, inputs, training, * * kwargs ) : inputs, categories = inputs [ 0 ], inputs [ 1 ] with tf. name _ scope ( " transformer " ) : logger = tf. get _ logger ( ) if self. params [ " mode " ] = = " debug " : logger. debug ( " transformer inputs " ) logger. debug ( inputs ) attention _ bias = utils. get _ paddi... | [
-0.8842347860336304,
-0.06491982191801071,
0.6672282218933105,
-0.0757744163274765,
-0.030164441093802452,
-0.4164750277996063,
-0.10971888899803162,
-0.49157676100730896,
-0.005118836648762226,
-0.12373477965593338,
0.08742159605026245,
0.5333042740821838,
-0.43693432211875916,
0.78741878... |
def create _ dir ( ) : os. system ('mkdir { } '. format ( config. repository _ path ) ) os. system ('mkdir { } '. format ( config. temp _ csv _ path ) ) os. system ('mkdir { } '. format ( config. log _ path ) ) os. system ('mkdir { } '. format ( config. prediction _ csv _ path ) ) | [
-0.12104518711566925,
0.1133430227637291,
0.3917762339115143,
0.5420877933502197,
0.7794028520584106,
1.1975054740905762,
0.8139628767967224,
0.03597131744027138,
-0.8272045254707336,
-0.5019048452377319,
-0.31418997049331665,
-0.34406039118766785,
0.4890264570713043,
0.6469091773033142,
... |
def test _ import _ partial ( self ) : file _ path = os. path. join ( tests _ dir,'contingencies _ partial. xlsx') contingency _ data = testmodule. importcontingencies ( pth = file _ path ) self. asserttrue ( len ( contingency _ data. circuits ) = = 3 ) self. asserttrue ( len ( contingency _ data. tx2 ) = = 2 ) self. a... | [
1.0965944528579712,
-0.4598202109336853,
0.6104296445846558,
-0.7203627228736877,
0.15319667756557465,
0.9527381658554077,
0.6380211114883423,
0.1386292576789856,
0.3114933669567108,
-0.19594793021678925,
-1.280631422996521,
-0.015967611223459244,
-1.0078915357589722,
-0.6167146563529968,
... |
def find _ runlist ( r _ list, missing _ days, lmd ) : if lmd = = 1 : return r _ list else : if ( missing _ days [ 1 ] - missing _ days [ 0 ] ) = = 1 : r _ list. append ( 1 ) else : r _ list. append ( 0 ) return find _ runlist ( r _ list, missing _ days [ 1 : ], lmd - 1 ) | [
-0.8581172823905945,
0.21698038280010223,
0.6308459639549255,
0.5642158389091492,
0.0893036425113678,
0.45777761936187744,
-0.092613585293293,
0.36181047558784485,
0.2030433863401413,
0.3110508918762207,
0.08312275260686874,
0.5838082432746887,
-0.5432776808738708,
1.4030872583389282,
0.... |
def my _ input _ fn ( features, targets, batch _ size = 1, shuffle = true, num _ epochs = none ) : # convert pandas data into a dict of np arrays. # here we only has 1 feature, so the dict has single key ` total _ rooms ` with value is an np array features = { key : np. array ( value ) for key, value in dict ( features... | [
-0.7510808706283569,
0.07203454524278641,
0.533149778842926,
0.45310330390930176,
-0.45231667160987854,
-0.7098500728607178,
0.03763291612267494,
0.8294064998626709,
-0.2879224121570587,
-0.7652272582054138,
-0.05990762263536453,
0.7093061208724976,
0.7222949862480164,
-0.8327873945236206,... |
def _ attach ( self, p, t1, t2 ) : node = self. _ validate ( p ) if not self. is _ leaf ( p ) : raise valueerror ('position must be a leaf') if not type ( self ) is type ( t1 ) is type ( t2 ) : raise typeerror ('tree types must match') self. _ size + = len ( t1 ) + len ( t2 ) if not t1. is _ empty ( ) : t1. _ root. _ p... | [
-0.09317038953304291,
-0.04353158175945282,
0.47626131772994995,
-0.7300507426261902,
-0.20888984203338623,
0.9962461590766907,
-0.46346989274024963,
-0.14775311946868896,
-0.9579031467437744,
0.4006805717945099,
-0.2977035343647003,
0.13307932019233704,
-0.2720405161380768,
0.175379499793... |
def vox _ ngrp _ content ( node _ id : int, child _ node _ ids : list [ int ] ) - > bytes : w = bytearray ( ) w. extend ( struct. pack ('< i ', node _ id ) ) w. extend ( vox _ dict ( [ ] ) ) w. extend ( struct. pack ('< i ', len ( child _ node _ ids ) ) ) for child _ node _ id in child _ node _ ids : w. extend ( struct... | [
-0.008486829698085785,
0.18860873579978943,
0.4467623829841614,
-1.0963549613952637,
0.015933800488710403,
-0.18929240107536316,
-1.0507384538650513,
-0.9922059774398804,
-1.2152212858200073,
0.7687291502952576,
-0.003149176947772503,
-0.013620206154882908,
-0.9241775870323181,
-0.51311153... |
def test _ naive _ multiset _ and _ prefix _ based _ multiset _ equivalent ( samples ) : multiset _ 1 = naivemultiset ( ) multiset _ 2 = prefixtreemultiset ( ) for s in samples : s = tuple ( s ) multiset _ 1. add ( s ) multiset _ 2. add ( s ) multiset _ 3 = readonlyprefixtreemultiset ( { multiset _ 2. _ node, multiset ... | [
0.3468092679977417,
-0.45398253202438354,
0.6625741124153137,
-0.10155560821294785,
-0.5278357863426208,
-0.11416837573051453,
-0.06122107803821564,
-0.2051216959953308,
0.7708092331886292,
0.08687111735343933,
-0.4189305901527405,
-0.08772058039903641,
0.2706647515296936,
0.15289358794689... |
def select _ feature ( self ) : feat = { } imps = { } for f in self. x : feat [ f ] = self. split ( self. x. ix [ :, f ] ) imps [ f ] = feat [ f ] [ 0 ] self. feature _ name = min ( imps, key = imps. get ) self. categorical = feat [ self. feature _ name ] [ 3 ] # if the variable is categorical, the 4th element is true.... | [
-0.12077300250530243,
-0.3116922378540039,
0.2847059965133667,
0.34080928564071655,
0.7451147437095642,
-0.8703206181526184,
-0.055195923894643784,
0.6387217044830322,
-0.8612060546875,
-0.24425087869167328,
-0.5913456082344055,
0.9856358766555786,
0.11277689784765244,
0.004821557085961103... |
def download _ dir ( self ) : self. driver. command _ executor. _ commands [ " send _ command " ] = ( " post ",'/ session / $ sessionid / chromium / send _ command') params = {'cmd':'page. setdownloadbehavior ','params': {'behavior':'allow ','downloadpath': self. dir _ download } } command _ result = self. driver. exec... | [
-0.39046189188957214,
-0.26245275139808655,
0.538541316986084,
0.6907549500465393,
1.1045920848846436,
-0.11706890165805817,
0.7186979055404663,
-0.2146342694759369,
0.37671130895614624,
-0.2876623868942261,
0.5305309295654297,
1.1741009950637817,
-0.4449406564235687,
0.7620410323143005,
... |
def get _ lengths ( input _ list ) : # yield the length of a string for person in input _ list : yield len ( person ) | [
0.4365870952606201,
-0.10379858314990997,
0.29076817631721497,
-0.2995980381965637,
0.3840152621269226,
0.706680417060852,
-0.6134582161903381,
1.071484923362732,
0.09942136704921722,
-0.3810214400291443,
-0.802732527256012,
-0.6119402050971985,
-0.49776753783226013,
0.7938453555107117,
... |
def add _ item ( request ) : if request. user. is _ stylist = ='yes': if request. method = ='get': return render ( request,'stylist / bill / add _ item _ form. html') if request. method = ='post': if'custom'in request. post : appointment = appointment. objects. get ( pk = request. session ['appointment _ for _ bill'] )... | [
-0.24389244616031647,
0.22733189165592194,
0.7288495302200317,
0.9585344791412354,
-0.2757985591888428,
1.692039132118225,
-0.43996161222457886,
0.6276800036430359,
-0.02873358316719532,
0.1997891217470169,
0.029549110680818558,
0.011079186573624611,
-0.2313682585954666,
0.5946529507637024... |
def addcommand ( self, cmd, newstage = false ) : stage = 1 idn = 1 if len ( self. _ _ cmds ) > 0 : lastcmd = self. _ _ cmds [ - 1 ] idn = lastcmd. jobid ( ) + 1 stage = lastcmd. stage ( ) if newstage : stage = stage + 1 cmd. setstage ( stage ) cmd. setjobid ( idn ) self. _ _ cmds. append ( cmd ) | [
-0.7665613889694214,
-0.3759024143218994,
0.764200747013092,
0.5723492503166199,
-0.3130975365638733,
0.31892937421798706,
0.412095844745636,
0.006190510932356119,
0.681483805179596,
-1.17366623878479,
-0.07870958000421524,
0.03030947409570217,
-0.35170915722846985,
1.4028292894363403,
0... |
def _ check _ event _ state ( event _ state : str ) - > bool : return event _ state. lower ( ) = ='alerting ' | [
0.36892402172088623,
-0.31536349654197693,
0.4710323214530945,
0.42016109824180603,
-0.31565648317337036,
0.5894620418548584,
-0.6344971656799316,
0.056063756346702576,
0.5182109475135803,
0.5828567743301392,
0.5259032845497131,
0.6701253652572632,
0.19196242094039917,
-0.24788884818553925... |
def _ _ call _ _ ( self, inputs, state, scope = none ) : with tf. variable _ scope ( scope or type ( self ). _ _ name _ _ ) : # " basiclstmcell " # parameters of gates are concatenated into one multiply for efficiency. c, h = tf. split ( state, 2, axis = 1 ) concat = self. _ linear ( [ inputs, h ], 4 * self. _ num _ un... | [
0.3946625590324402,
-0.10005120187997818,
0.5672638416290283,
-0.11697819828987122,
-0.32850900292396545,
-0.1297360509634018,
-0.2690829336643219,
-0.43079912662506104,
-0.7860491871833801,
0.8687292337417603,
-0.6573286056518555,
0.3482596278190613,
0.22149187326431274,
-0.22987942397594... |
def set _ granularity ( self, granularity ) : assert ( granularity is none ) or ( is _ int ( granularity ) and ( granularity > = 0 ) ), " argument'granularity'should be none or positive integer " self. granularity = granularity | [
-0.25321513414382935,
0.4238892197608948,
0.7224141955375671,
0.7326071262359619,
0.8116828203201294,
0.6056550741195679,
0.4413551390171051,
0.3492773175239563,
0.022552065551280975,
0.5910388827323914,
0.6943831443786621,
0.861750602722168,
-0.924799919128418,
0.7450383901596069,
0.953... |
def kinit ( user, pswd, realm ) : try : errors = [ ] client = salt. client. localclient ( ) cmd _ to _ run ='echo " % s " | kinit % s @ % s'% ( pswd, user, realm. upper ( ) ) print'running % s'% cmd _ to _ run r1 = client. cmd ('* ','cmd. run _ all ', [ cmd _ to _ run ] ) print r1 if r1 : for node, ret in r1. items ( )... | [
-0.04840580374002457,
0.11625844240188599,
0.7644748687744141,
0.2547244131565094,
0.19366738200187683,
0.4647349417209625,
-0.5101714134216309,
-0.670129120349884,
-1.103607416152954,
0.3782087564468384,
-0.04800577834248543,
0.8860511183738708,
-0.5783718824386597,
0.655727207660675,
-... |
def jstimestamp _ to _ int ( v ) : if not is _ intstr ( v ) : raise valueerror ('deadline is invalid value') # don't care about ms return int ( v [ : - 3 ] ) | [
-0.12031088769435883,
-0.45246949791908264,
0.589966893196106,
-0.7779052257537842,
-0.7683669328689575,
0.1012379452586174,
-0.010352732613682747,
-0.3775053322315216,
0.5325560569763184,
0.94492506980896,
-0.6012725830078125,
-0.17067693173885345,
0.24432086944580078,
-0.6493478417396545... |
def _ query ( self, query, args, conn = none, thread _ state = none ) : if not conn : conn = thread _ state cursor = conn. cursor ( ) cursor. execute ( query, args ) rows = cursor. fetchall ( ) cursor. close ( ) return rows | [
0.4118613302707672,
0.0003428490599617362,
0.5846476554870605,
0.08806929737329483,
0.46524927020072937,
-0.5365403890609741,
-1.4511483907699585,
0.5092688798904419,
0.051894061267375946,
0.4105253219604492,
1.110512375831604,
-0.9285750389099121,
-0.39924606680870056,
0.1923571079969406,... |
def get _ expression _ manifest ( tcga _ id ) : payload = { " filters " : json. dumps ( { " op " : " and ", " content " : [ { " op " : " in ", " content " : { " field " : " cases. project. program. name ", " value " : [ " tcga " ] } }, { " op " : " in ", " content " : { " field " : " cases. project. project _ id ", " v... | [
-0.5029334425926208,
0.3265877366065979,
0.4270615875720978,
-0.6656686663627625,
-0.20242759585380554,
-1.0262885093688965,
-0.01403384655714035,
-0.005625430028885603,
-0.2469150722026825,
0.7197058796882629,
0.4428228735923767,
0.47617509961128235,
0.048717398196458817,
0.74882453680038... |
def manhattandistance ( x1, y1, x2, y2 ) : return abs ( x1 - x2 ) + abs ( y1 - y2 ) | [
0.18080705404281616,
-1.3763469457626343,
0.7637498378753662,
0.34678712487220764,
-0.6759411692619324,
0.7453567981719971,
-1.634204387664795,
0.2791823148727417,
-0.9130352735519409,
0.5696026682853699,
-0.12156736850738525,
0.4529024362564087,
0.9313756227493286,
-0.09308469295501709,
... |
def load _ file ( self, path ) : with open ( path, " rt " ) as pgm _ file : return self. eval ( pgm _ file. read ( ) ) | [
-0.15850570797920227,
-0.4545806050300598,
0.45501574873924255,
-1.2617647647857666,
-0.4122958183288574,
0.687199056148529,
-0.5761958360671997,
0.04712947458028793,
-2.001143217086792,
-0.20813818275928497,
0.0006400942802429199,
-0.45790085196495056,
-0.767680823802948,
-0.9306524991989... |
def _ _ init _ _ ( self, canvas, axes, spec, specres, detns, line _ lists, par, lflag _ color, slit = 0, spatid ='0 ', wv _ calib = none, pxtoler = none, specname = " ", y _ log = true, rescale _ resid = false ) : # store the axes self. axes = axes # initialise the spectrum properties self. spec = spec self. specres = ... | [
1.5497407913208008,
-0.7452526688575745,
0.7594506144523621,
-0.1715836375951767,
-0.22909632325172424,
0.28557294607162476,
-0.2133939564228058,
0.24410198628902435,
0.5374534726142883,
-1.023959755897522,
-0.24286116659641266,
0.03152165189385414,
0.016294924542307854,
0.6341220140457153... |
def coerce _ numeric ( arr ) : # already numeric type if np. issubdtype ( arr. dtype, np. number ) : return arr # numpy datetime64 format if np. issubdtype ( arr. dtype, np. datetime64 ) : return arr # convert booleans to integers if np. issubdtype ( arr. dtype, np. bool _ ) : return arr. astype ( int ) # a string dtyp... | [
-0.22770175337791443,
-0.03191109374165535,
0.9008840918540955,
1.0419584512710571,
0.24682706594467163,
0.04225604608654976,
-0.4417073428630829,
-1.0575149059295654,
0.590337336063385,
0.28181955218315125,
0.3594147264957428,
0.9076809287071228,
0.13732147216796875,
0.7292497754096985,
... |
def _ base _ dist ( self, * args, * * kwargs ) : mix = kwargs. pop ( " mix " ) return tfd. mixture ( cat = tfd. categorical ( probs = [ mix, 1. 0 - mix ] ), components = [ tfd. deterministic ( 0. 0 ), tfd. negativebinomial ( * args, * * kwargs ) ], name = " zeroinflatednegativebinomial ", ) | [
0.4011429250240326,
-0.881363570690155,
0.5594532489776611,
0.19027091562747955,
0.4653458595275879,
0.7804452180862427,
-0.04326252266764641,
0.21574173867702484,
-0.0007169099990278482,
-0.7371926307678223,
0.21080604195594788,
0.12337753176689148,
-0.7493209838867188,
0.2646562755107879... |
def update ( self, leaf _ value ) : self. _ n _ visits + = 1 # update visit count self. _ q + = 1. 0 * ( leaf _ value - self. _ q ) / self. _ n _ visits # update q, a running average of values for all visits. # there is just : ( v - q ) / ( n + 1 ) + q = ( v - q + ( n + 1 ) * q ) / ( n + 1 ) = ( v + n * q ) / ( n + 1 ) | [
-0.0786949023604393,
-0.48608943819999695,
0.4737931489944458,
0.4837193787097931,
-0.7296631932258606,
0.11415427178144455,
0.18471232056617737,
-0.39900651574134827,
-0.11448593437671661,
-0.110033318400383,
0.5971890687942505,
0.32021385431289673,
0.531008780002594,
0.525896430015564,
... |
def get _ now ( format = " % d % m % y _ % h % m % s " ) : return datetime. now ( ). strftime ( format ) | [
-0.8202357292175293,
-0.27137991786003113,
0.733250081539154,
-0.5616360902786255,
-0.6492632031440735,
-0.3209841847419739,
-1.342846155166626,
-0.45691680908203125,
-1.0600677728652954,
0.14939595758914948,
-0.02092983014881611,
0.19375604391098022,
0.5013025403022766,
-0.132269933819770... |
def generate _ submit _ button _ submit _ template ( specifics : dict, placeholders : dict, data : dataframe, element _ attrs : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders ) button _ name = template ['source'] parent _ name = '. '. join ( b... | [
-0.6364185214042664,
0.20391890406608582,
0.6845350861549377,
-0.15106193721294403,
-0.4947868585586548,
0.2821179926395416,
-0.46509504318237305,
0.17550259828567505,
-0.22114893794059753,
0.7024659514427185,
-0.5956701040267944,
0.41252878308296204,
0.6428515315055847,
0.1021001636981964... |
def greater ( a, b ) : return 1 if a > b else 0 | [
-0.7698464393615723,
0.47676998376846313,
0.5851312875747681,
0.5170813202857971,
0.17911402881145477,
0.7633612155914307,
-0.7741759419441223,
-0.22080668807029724,
-1.5512527227401733,
-0.6269088983535767,
0.4753308594226837,
0.4300467073917389,
0.5549591779708862,
0.5184473991394043,
... |
def basic _ transfer ( self, destination, payment _ id = none ) : d = destination. format _ to _ send ( ) cmd = { " destinations " : [ d ], " mixin " : 4, " unlock _ time " : 0, " priority " : 1, " get _ tx _ hex " : true, " get _ tx _ key " : true } if payment _ id : cmd [ " payment _ id " ] = payment _ id try : fee, ... | [
-0.2605685293674469,
0.43396106362342834,
0.7767396569252014,
0.5666413903236389,
-0.16167031228542328,
-0.6014269590377808,
-1.107232928276062,
-0.39299219846725464,
-0.3061276972293854,
0.6313852667808533,
-0.41769152879714966,
0.017244763672351837,
-0.028908738866448402,
-0.005962373223... |
def generate _ smb _ conf ( ) : try : d, err = cifs _ utils. get _ auth _ settings ( ) if err : raise exception ( err ) smb _ conf _ path, err = config. get _ smb _ conf _ path ( ) if err : raise exception ( err ) config _ dir, err = config. get _ config _ dir ( ) if err : raise exception ( err ) # for customer specifi... | [
0.31284967064857483,
0.22628742456436157,
0.8866837024688721,
1.2069931030273438,
-0.029207177460193634,
0.4980028569698334,
1.2616232633590698,
0.7879001498222351,
-0.5398765802383423,
0.998752772808075,
-0.8820037245750427,
0.230364128947258,
-0.4143825173377991,
0.8741430044174194,
0.... |
def step ( self, action : int ) : assert self. action _ space. contains ( action ) assert not self. done action _ offsets = [ ( 0, - 1 ), ( 1, 0 ), ( 0, 1 ), ( - 1, 0 ), ( 0, 0 ) ] self. last _ position = self. position next _ place = self. position if self. _ exists _ offset ( self. position, action _ offsets [ action... | [
-1.1296324729919434,
-0.04533948004245758,
0.6209811568260193,
-0.2753177881240845,
0.014771734364330769,
-0.4636966586112976,
0.36816245317459106,
-0.13689281046390533,
-0.2253125160932541,
0.22385954856872559,
-0.4822598397731781,
-0.5010823607444763,
-0.17016127705574036,
0.310166239738... |
def get _ public _ data _ folder ( form, subfolder _ tag ) : dir _ list = _ get _ dir _ structure ( os. path. join ( settings. data _ dir,'downloadable'), form ) return dir _ list [ subfolder _ tag ] | [
0.21997076272964478,
0.3534916341304779,
0.3904475271701813,
-0.2955268621444702,
-0.40257030725479126,
0.6101400256156921,
0.20726993680000305,
-0.1272890716791153,
-0.7435093522071838,
-1.3647520542144775,
-0.1966789960861206,
0.8204951882362366,
0.5440098643302917,
0.7269551157951355,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.