text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def save _ credentials _ to _ session ( self, credentials ) : self. session ['credentials'] = credentials | [
-1.3151710033416748,
-1.1833462715148926,
-0.024434387683868408,
-0.5507199764251709,
0.5525904893875122,
0.10092546790838242,
-0.1297430694103241,
-0.7905328273773193,
1.0482112169265747,
0.43763697147369385,
-1.6423314809799194,
-0.2989930808544159,
-0.41343382000923157,
-0.1365140527486... |
def setupclass ( cls ) : super ( frrtest, cls ). setupclass ( ) | [
0.15347741544246674,
0.24778181314468384,
0.4013882577419281,
0.3288372755050659,
1.1249505281448364,
-0.4686528444290161,
1.5778888463974,
0.5058654546737671,
1.4877575635910034,
-1.2792696952819824,
-0.13085785508155823,
-0.7221136689186096,
-0.5043630003929138,
0.8527847528457642,
-0.... |
def ortho _ init ( scale = 1. 0 ) : # _ ortho _ init ( shape, dtype, partition _ info = none ) def _ ortho _ init ( shape, * _, * * _ kwargs ) : " " " intialize weights as orthogonal matrix. orthogonal matrix initialization [ 1 ] _. for n - dimensional shapes where n > 2, the n - 1 trailing axes are flattened. for conv... | [
0.3183004856109619,
-0.21947017312049866,
0.9095930457115173,
-0.6974786520004272,
-0.4430488049983978,
-0.2707679271697998,
0.4599135220050812,
-0.4561785161495209,
-0.8073791265487671,
0.5200225114822388,
-0.2947656810283661,
-0.19640827178955078,
0.8717358708381653,
0.049920279532670975... |
def serve ( coordinator : coordinator, host : str = " [ : : ] ", port : int = 50051 ) - > none : terminate _ event = threading. event ( ) monitor _ thread = threading. thread ( target = monitor _ heartbeats, args = ( coordinator, terminate _ event ) ) server = grpc. server ( futures. threadpoolexecutor ( max _ workers ... | [
-0.30333778262138367,
0.34334811568260193,
0.6419906616210938,
0.16751079261302948,
0.754461407661438,
0.23902878165245056,
-0.2753623425960541,
-0.15099474787712097,
-0.8961973786354065,
-0.1753435730934143,
-0.14210563898086548,
0.33402982354164124,
-0.7110158801078796,
0.051729109138250... |
def featureslabel ( data ) : features = data. drop ('sol ', axis = 1 ) label = data ['sol'] return features, label | [
-0.8092155456542969,
-0.5741840600967407,
0.263978511095047,
-0.39549699425697327,
0.46755251288414,
0.2474047690629959,
0.0015836497768759727,
-0.13712608814239502,
0.781023383140564,
0.6053104400634766,
0.23505589365959167,
-0.3785914182662964,
0.7192832231521606,
-0.7888948917388916,
... |
def posts ( ) : token = flask. request. args ['access _ token'] resp = facebook. get ( f'me / feed ', headers = {'authorization': f'bearer { token }'}, ) if not resp. ok : return f'unexpected resp from facebook : { resp }'return flask. jsonify ( analyze ( resp. json ( ) ) ) | [
0.4113481640815735,
0.018193131312727928,
0.649519145488739,
0.6888604760169983,
0.3567448556423187,
-1.652967929840088,
-1.3849517107009888,
-0.5956456065177917,
-0.584160566329956,
-0.7637017369270325,
0.0009501787717454135,
0.1189219057559967,
0.11688090860843658,
0.07907436043024063,
... |
def test _ parse _ command _ line ( self ) : from ots. worker. conductor. conductor import _ parse _ command _ line ( options, parser ) = _ parse _ command _ line ( args = [ ] ) self. assertequals ( options. testrun _ id, none ) self. assertequals ( options. image _ url, none ) self. assertequals ( options. content _ i... | [
0.18480375409126282,
-0.29521530866622925,
0.6027451157569885,
-0.09886021912097931,
1.453365445137024,
0.36423060297966003,
0.3477162718772888,
-0.6644002795219421,
-0.12027087062597275,
-0.911328136920929,
-0.9768761396408081,
-0.5072916746139526,
-0.6292915344238281,
0.3288794457912445,... |
def test _ example _ input _ two _ required _ field _ example _ multiple _ select ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) input _ page. create _ new _ input. select ( " example input two " ) in... | [
-0.9371233582496643,
-0.07821045070886612,
0.651904284954071,
0.21798008680343628,
0.6776864528656006,
0.9834626317024231,
-0.5246745347976685,
-0.6915119290351868,
-0.158675417304039,
0.5919855237007141,
-1.4959771633148193,
-0.23378905653953552,
0.10196266323328018,
0.3351074159145355,
... |
def show _ dual _ plot ( im1, im2 ) : fig = plt. figure ( ) f, ( ax1, ax2 ) = plt. subplots ( 2, 1, sharex ='col') ax1. imshow ( im1, cmap ='gray') ax2. imshow ( im2, cmap ='gray') plt. show ( ) | [
0.19092890620231628,
-0.15696626901626587,
0.7636302709579468,
-0.18379253149032593,
-0.8808466792106628,
0.913806140422821,
0.6272916197776794,
0.6065064072608948,
-0.17675721645355225,
-0.18454566597938538,
0.8972692489624023,
1.7171037197113037,
0.8432035446166992,
0.5824241042137146,
... |
def _ _ init _ _ ( self, col, choices, function, impute _ rules, order = none, op _ in _ name = false, coltype = none, * * kwargs ) : if none in choices : kwargs [ " include _ null " ] = true choices. remove ( none ) elif type ( choices ) is dict and none in choices. values ( ) : ks = [ k for k, v in choices. items ( )... | [
-0.06588936597108841,
0.5738934874534607,
0.7936602830886841,
0.35772356390953064,
0.041270434856414795,
-0.29664671421051025,
-0.4483451247215271,
0.29367831349372864,
-0.2851890027523041,
1.1500489711761475,
-0.1692332923412323,
0.25472888350486755,
0.1109292134642601,
0.1619924157857895... |
def mm _ move ( board, player ) : result = minimax ( board, player ) # if player = = provided. playerx : # result = sorted ( result, reverse = true ) # # else : # result = sorted ( result ) return result | [
-0.7504112124443054,
0.07093197107315063,
0.5680391788482666,
1.4281305074691772,
-1.1642736196517944,
-0.8623948097229004,
-0.24977117776870728,
0.1438160240650177,
0.2700706124305725,
0.7536731362342834,
-0.21192267537117004,
0.39449799060821533,
-1.310851812362671,
-0.7120861411094666,
... |
def average _ gradients ( tower _ grads ) : average _ grads = [ ] for grad _ and _ vars in zip ( * tower _ grads ) : # note that each grad _ and _ vars looks like the following : # ( ( grad0 _ gpu0, var0 _ gpu0 ),..., ( grad0 _ gpun, var0 _ gpun ) ) grads = [ ] for g, _ in grad _ and _ vars : # add 0 dimension to the g... | [
-0.5313611030578613,
-0.48341286182403564,
0.3626428544521332,
-0.39066797494888306,
0.40153124928474426,
0.04757453873753548,
0.5326918959617615,
-0.3632720112800598,
-0.8285389542579651,
1.2263232469558716,
-0.26617076992988586,
0.7392773628234863,
-0.6084237694740295,
0.859290361404419,... |
def parse _ response ( self, response ) : if not response. headers. get ('content - type ','' ). startswith ('text / csv') : msg ='non - csv response from server'if self. service. verbosity > 0 : msg + ='( use verbose mode to see it )'raise requesterror ( msg, code = response. status _ code, text = response. text, resp... | [
0.36819925904273987,
-0.5998895168304443,
0.5434795618057251,
-0.030655844137072563,
-0.7365427613258362,
-0.6571155190467834,
-1.1392258405685425,
-0.24675047397613525,
0.40812408924102783,
-0.7889518141746521,
0.4143608510494232,
-0.09508787095546722,
-0.474578857421875,
-0.3395884931087... |
def get _ psf _ center ( orig _ cube, refchan = 26, fine = false ) : cube = orig _ cube. copy ( ) orig _ shape = cube. shape img _ flag = true if len ( cube. shape ) = = 2 else false if img _ flag : cube = cube [ np. newaxis, :, : ] shape = cube. shape nchan = shape [ 0 ] if nchan < refchan : refchan = nchan - 1 init _... | [
0.3053363263607025,
-0.5215688347816467,
0.8074089884757996,
0.4401177167892456,
-0.2878877520561218,
-0.8699670433998108,
-0.07656760513782501,
0.1576986461877823,
0.15627562999725342,
0.2932058572769165,
0.42885956168174744,
0.22832609713077545,
-0.9667181372642517,
1.0109597444534302,
... |
def oneqbit _ load ( self, download = true ) : self. oneqbit _ df = self. load _ dataset ('1qbit') | [
-0.40007728338241577,
0.053436677902936935,
0.26551124453544617,
0.08657540380954742,
-0.7640357613563538,
0.4550483524799347,
-0.1538739800453186,
-0.7880228757858276,
0.20073804259300232,
-0.2355489730834961,
0.2615213394165039,
0.4578584134578705,
-0.9747039079666138,
-0.075019262731075... |
def classify _ url ( self, url ) : t1 = timeit. timeit ( ) success = { cls : t. predict _ success ( url ) for ( cls, t ) in self. trees. items ( ) } t2 = timeit. timeit ( ) logging. info ( " filtering " + url + " : abs = % s, pdf = % s in % s " % ( str ( success ['abs'] ), str ( success ['pdf'] ), str ( t2 - t1 ) ) ) r... | [
-1.9659507274627686,
-0.5737041234970093,
0.7228536009788513,
-0.26277464628219604,
-0.19400131702423096,
-0.2714582085609436,
-0.3154383897781372,
0.0812394991517067,
-0.6390952467918396,
0.21193565428256989,
-0.008990957401692867,
0.660770058631897,
0.26469963788986206,
0.877345144748687... |
def make _ context ( self, url, * * kwargs ) : request = apirequestfactory ( ). get ( url ) request. version = self. namespace request. versioning _ scheme = namespaceversioning ( ) context = {'request': request } context. update ( * * kwargs ) return context | [
-1.3375033140182495,
-0.20725427567958832,
0.4107933044433594,
-0.24779444932937622,
-0.6285198330879211,
0.2052694708108902,
-1.1463714838027954,
-0.14959414303302765,
0.9940526485443115,
0.03487139940261841,
-0.7661458253860474,
-0.01098368875682354,
-0.06776420027017593,
-0.331027030944... |
def test _ hyp _ init ( self ) : opt _ args = dict ( max _ evaluations = 25, limit _ action = " ignore " ) model1 = evo _ app. model ( " f81 ", opt _ args = opt _ args ) model2 = evo _ app. model ( " hky85 ", opt _ args = opt _ args ) # defaults to using null for init hyp = evo _ app. hypothesis ( model1, model2 ) _ da... | [
-0.14568597078323364,
-0.10819506645202637,
0.7166061401367188,
0.534290611743927,
0.8934353590011597,
0.3359396755695343,
-0.16682006418704987,
0.0697668120265007,
-0.47315993905067444,
-0.4834107756614685,
-0.39193251729011536,
0.833626389503479,
0.5183969140052795,
-0.009296472184360027... |
def testblockoperation ( self, mock _ gcb _ api ) : build _ operation _ object = mock _ gcb _ api. return _ value. operations. return _ value. get build _ operation _ object. return _ value. execute. return _ value = mock _ gcb _ builds _ success block _ build _ success = fake _ gcb. blockoperation ( mock _ gcb _ build... | [
-0.3583453893661499,
1.0849074125289917,
0.6816157698631287,
0.9851773977279663,
0.8606358766555786,
0.7031710743904114,
0.7245963215827942,
-0.8818420767784119,
-0.6486541032791138,
0.020186271518468857,
-0.766594648361206,
-0.3500022888183594,
-1.037021279335022,
-0.22715498507022858,
... |
def siblings ( self ) : return self. symbol. instances | [
-0.5457067489624023,
0.7687418460845947,
0.42260757088661194,
-0.4378587007522583,
-0.07818210124969482,
0.45497432351112366,
0.9514120221138,
-0.5557315349578857,
0.2843816876411438,
-0.42032885551452637,
-1.3187447786331177,
0.6691365838050842,
-1.124436616897583,
0.5002071857452393,
-... |
def greet _ users ( names ) : for name in names : msg = " hello " + name. title ( ) + "! " print ( msg ) | [
-0.24781611561775208,
0.7330136299133301,
0.4957881271839142,
0.2870801091194153,
0.4130669832229614,
0.6258533596992493,
-0.8359049558639526,
-0.14916813373565674,
-0.6186209321022034,
0.058496180921792984,
-0.49665093421936035,
0.571265697479248,
-0.021868912503123283,
1.4649749994277954... |
def print _ comments ( ) : def _ print _ comments ( method ) : def wrapper ( self, ctx : parserrulecontext ) : assert hasattr ( self,'output _ stream'), \'print _ comments decorator applied to method { 0 }. { 1 } : missing required method { 0 }. output _ stream '. \ format ( self. _ _ class _ _. _ _ name _ _, method. _... | [
0.10524586588144302,
-0.8810837864875793,
1.0247615575790405,
-1.2012298107147217,
0.37143823504447937,
-0.3816896975040436,
-0.13490872085094452,
-0.9737588167190552,
-0.4417785108089447,
0.22850418090820312,
0.7102862596511841,
0.6159207820892334,
-0.23666802048683167,
0.2651471495628357... |
def test _ atomic _ any _ uri _ enumeration _ 1 _ nistxml _ sv _ iv _ atomic _ any _ uri _ enumeration _ 2 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - enumeration - 2. xsd ", instance = " nistdata... | [
-0.670322835445404,
-1.2307826280593872,
0.5308118462562561,
0.898512065410614,
-0.14537250995635986,
-0.43915337324142456,
0.13244226574897766,
-0.3507171869277954,
-0.31611117720603943,
-0.3104717433452606,
0.1297435462474823,
-0.21426375210285187,
-0.20786675810813904,
0.318840831518173... |
def flush ( self, timeout = none ) : self. producer. flush ( timeout = timeout ) | [
-0.12881752848625183,
0.4261842370033264,
0.43425849080085754,
0.480119526386261,
-0.07238445430994034,
0.7694576382637024,
0.08750595897436142,
0.29627788066864014,
-0.09768873453140259,
0.48300817608833313,
0.644116222858429,
1.5633080005645752,
-0.5829300880432129,
0.31372058391571045,
... |
def main ( input, granularity ) : if input = ='' : print ('input should contain a filename.') else : metrics. metric _ to _ csv ( input + '. csv ', granularity ) | [
0.48797905445098877,
0.5669501423835754,
0.2772424519062042,
1.7341758012771606,
0.5698676109313965,
0.6382967233657837,
0.7811304926872253,
0.7835766673088074,
-0.4560413956642151,
0.14644202589988708,
1.256509780883789,
0.5978777408599854,
-0.02542690932750702,
0.17162877321243286,
-0.... |
def get _ fd _ lm _ allmodes ( template = none, * * kwargs ) : input _ params = props ( template, lm _ allmodes _ required _ args, * * kwargs ) # get required args mfinal = input _ params ['mfinal'] sfinal = input _ params ['sfinal'] lmns = input _ params ['lmns'] # the following may not be in input _ params delta _ f ... | [
0.3334351181983948,
-0.12556205689907074,
0.6837564706802368,
0.2596181333065033,
0.037387438118457794,
0.07220419496297836,
-0.22699089348316193,
0.22279632091522217,
-0.35685452818870544,
-1.129608392715454,
0.3052559196949005,
-0.3146759569644928,
0.10779272764921188,
0.7695069909095764... |
def scriptinfo ( self ) : memory _ usage = resource. getrusage ( resource. rusage _ self ). ru _ maxrss self. log ( " the script " + str ( self. appname ) + " was ran at " + str ( datetime. datetime. now ( ) ) ) self. log ( " script ran on host : " + str ( self. dbhost1 ) ) self. log ( " updating attribute _ id : " + s... | [
-0.03329058364033699,
-1.1679147481918335,
0.7150177955627441,
-0.7055410146713257,
-0.0030916149262338877,
0.2563702166080475,
0.17548829317092896,
-0.09051726758480072,
-1.1623151302337646,
0.11550434678792953,
-0.08480644226074219,
1.300194501876831,
0.5434360504150391,
1.07942938804626... |
def beginloop ( self, setup ) : self. counters = counters ( ) self. averages = averages ( ) self. mainlogger. info ('beginloop'+ self. cfg _ ana. name ) self. beginloopcalled = true | [
0.5083397030830383,
0.2916117310523987,
0.2216597944498062,
-0.1099005788564682,
-0.3137057423591614,
0.7757669687271118,
1.791087031364441,
-0.8475070595741272,
-0.20742546021938324,
-0.16799868643283844,
0.6998252868652344,
0.389065682888031,
0.7384430766105652,
1.0593020915985107,
-0.... |
def build _ animation ( self, * args, * * kwargs ) : self. cockpit _ plotter. build _ animation ( * args, * * kwargs ) | [
-1.2827727794647217,
0.006365351378917694,
0.3225901126861572,
0.8364484906196594,
0.22389759123325348,
0.3043306767940521,
0.19872716069221497,
-0.14364057779312134,
-0.8730598092079163,
-1.047749400138855,
-0.5477384328842163,
1.0731091499328613,
-0.26874932646751404,
0.8625170588493347,... |
def confirm ( self ) : return self. _ _ swift. confirm ( ) | [
0.7959321737289429,
0.3285602629184723,
0.37909606099128723,
0.8414710760116577,
0.4008982479572296,
0.275351881980896,
-0.6978501081466675,
-0.5790941119194031,
-0.8259035348892212,
-0.24650821089744568,
-0.09710335731506348,
0.275298535823822,
-0.9373080730438232,
0.03766220808029175,
... |
def calc _ lightpath _ state ( self, open _ limit : int, closed _ limit : int ) : self. _ inserted = bool ( closed _ limit ) self. _ removed = bool ( open _ limit ) trans = 0. 0 if self. _ inserted else 1. 0 return lightpathstate ( inserted = self. _ inserted, removed = self. _ removed, output = { self. output _ branch... | [
0.1298081874847412,
-0.453461229801178,
0.4964059591293335,
-0.22215069830417633,
-1.2921603918075562,
-0.23540186882019043,
0.3951800763607025,
0.43914565443992615,
0.4786694645881653,
-0.25174495577812195,
-0.36420491337776184,
-0.44370967149734497,
-0.8355386257171631,
-0.62540453672409... |
def add _ authorized _ key ( key _ name = none, pub _ key _ file = '. ssh / id _ rsa. pub') : mkdir _ ssh ( ) if key _ name : repo ='git @ bitbucket. org / magnet - cl / keygen. git'local ('git archive - - remote = ssh : / / { } master { } | tar - x '. format ( repo, key _ name ) ) pub _ key = open ( key _ name ). read... | [
0.5965389609336853,
0.22486233711242676,
0.590700626373291,
0.49202966690063477,
0.03205017000436783,
0.7513027787208557,
-0.47226929664611816,
1.2955334186553955,
-0.8025846481323242,
0.3064088523387909,
0.28095749020576477,
0.504650354385376,
-0.2086658626794815,
1.4147897958755493,
0.... |
def create _ archive _ object ( self, data, extract _ archive _ param, upload _ path ='', headers = none, requestslib _ kwargs = none ) : url ='{ 0 } / { 1 } '. format ( self. storage _ url, upload _ path ) params = { " extract - archive " : extract _ archive _ param } response = self. put ( url, data = data, headers =... | [
-0.8664169311523438,
-0.45721516013145447,
0.7411797642707825,
0.3769083321094513,
0.08256711065769196,
-0.2708446681499481,
-0.11378196626901627,
-0.49354100227355957,
0.024286244064569473,
0.25271883606910706,
-0.798348605632782,
0.412334144115448,
-0.6998865604400635,
-0.622315049171447... |
def extra _ water _ added ( self ) : # 1 kg sugar = = 0, 55 l added # todo : adjust this index for dry / extracts total = 0. sugar _ index = 0. 55 total + = float ( self. get _ total _ grain ( {'malt _ type _ _ in': ['sugar ','extract ','dryextract'] } ) ) * sugar _ index return total | [
0.5155172944068909,
0.11781138926744461,
0.5821654796600342,
-0.7234928011894226,
-0.3229379653930664,
0.26102375984191895,
0.5339630246162415,
0.06985732167959213,
0.7508391737937927,
-0.12296491861343384,
0.2848462164402008,
1.0261662006378174,
-0.3671608865261078,
1.2597240209579468,
... |
def forward ( self, x _ human, x _ objects, objects _ mask ) : # initial embeddings x _ human, x _ objects = self. human _ embedding _ mlp ( x _ human ), self. object _ embedding _ mlp ( x _ objects ) # frame - level birnns hx _ hfr = self. _ process _ frame _ level _ rnn ( x _ human, self. human _ bd _ rnn ) hx _ ofr ... | [
-0.15435056388378143,
0.394785076379776,
0.9405277371406555,
0.39563220739364624,
0.34779268503189087,
0.061119213700294495,
0.9078763723373413,
-0.5312871932983398,
-0.5807040333747864,
-0.4242089092731476,
-0.695495069026947,
0.2958376109600067,
0.4194665849208832,
-0.1625199019908905,
... |
def generate _ blobs ( nside, nexp = 2, exptime = 30., filter1s = ['u ','u ','g ','r ','i ','z ','y'], filter2s = ['g ','r ','r ','i ','z ','y ','y'], pair _ time = 33., camera _ rot _ limits = [ - 80., 80. ], n _ obs _ template = 3, season = 300., season _ start _ hour = - 4., season _ end _ hour = 2., shadow _ minute... | [
-0.4557573199272156,
0.5681774020195007,
1.2308542728424072,
0.22327031195163727,
-0.918779730796814,
0.5789551734924316,
0.08274704962968826,
-0.5879555344581604,
0.08540598303079605,
0.8526207804679871,
-0.6113478541374207,
0.1522795706987381,
-0.1618303507566452,
0.38619929552078247,
... |
def set _ gpio _ high ( self, gpio ) : self. _ write _ command ( [ lcdbackpack. gpio _ high, gpio ] ) | [
0.20197325944900513,
1.2693252563476562,
0.5766553282737732,
1.05344820022583,
0.26769739389419556,
0.8194294571876526,
0.010203887708485126,
0.1742297261953354,
0.2003774642944336,
-0.19272960722446442,
-1.0469774007797241,
1.3214892148971558,
-0.14364361763000488,
-0.12101347744464874,
... |
def _ unwrapresponse ( cls, response ) : if response. status _ code = = httplib. not _ found : raise excs. notfounderror ('object in request cannot be found') # all 300s and 100s should be resolved by the requests library. elif response. status _ code > = 400 : raise excs. requesterror ('{ } error : { } '. format ( res... | [
-0.7750062346458435,
-1.0602927207946777,
0.7286319136619568,
-0.7285107970237732,
-0.4622544050216675,
-0.6063475012779236,
-0.38930854201316833,
-0.2633061707019806,
0.6314631104469299,
-0.09061599522829056,
0.1324903517961502,
0.05191216617822647,
0.23771099746227264,
-1.204705834388733... |
def test _ atomic _ language _ pattern _ nistxml _ sv _ iv _ atomic _ language _ pattern _ 1 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / language / schema + instance / nistschema - sv - iv - atomic - language - pattern - 1. xsd ", instance = " nistdata / atomic / la... | [
0.10295961052179337,
-0.34672701358795166,
0.41265416145324707,
0.5844526290893555,
-0.48006153106689453,
0.2999424636363983,
0.49407845735549927,
0.09966005384922028,
0.13222314417362213,
1.0726226568222046,
-0.3448140621185303,
-0.15725842118263245,
-0.2813049852848053,
0.052607137709856... |
def compile _ folder ( self, directory, write = true, package = true, * args, * * kwargs ) : if not isinstance ( write, bool ) and os. path. isfile ( write ) : raise coconutexception ( " destination path cannot point to a file when compiling a directory " ) filepaths = [ ] for dirpath, dirnames, filenames in os. walk (... | [
-0.6797308325767517,
0.3656730651855469,
0.9244076013565063,
0.7435159683227539,
-0.3664008378982544,
-0.41616788506507874,
0.8054981231689453,
-0.10948678851127625,
0.030101198703050613,
0.42229005694389343,
0.3814413845539093,
-0.3091214895248413,
-0.47231170535087585,
0.944010317325592,... |
def close _ trade ( self, trade _ id ) : url = " { 0 } / { 1 } / accounts / { 2 } / trades / { 3 } ". format ( self. domain, self. api _ version, self. account _ id, trade _ id ) try : return self. _ client _ _ call ( uri = url, method = " delete " ) except requestexception : return false except assertionerror : return... | [
-0.9602371454238892,
0.4309132397174835,
0.45821434259414673,
-0.5705062747001648,
0.08874659985303879,
0.9535775780677795,
0.3709598779678345,
-1.4504876136779785,
0.38124391436576843,
-0.0042816936038434505,
0.05685395002365112,
0.6004208326339722,
-1.2601128816604614,
0.1107511520385742... |
def get _ current _ ms _ time _ utc ( self ) : return int ( ( datetime. utcnow ( ) - datetime ( 1970, 1, 1 ) ). total _ seconds ( ) * 1000 ) | [
-0.06888635456562042,
-0.7197556495666504,
0.7510934472084045,
-0.20127834379673004,
-0.7514497637748718,
0.16597041487693787,
0.5231401920318604,
1.1755539178848267,
-0.03556754067540169,
-0.14286351203918457,
0.4417879283428192,
0.22533391416072845,
-0.2840561270713806,
0.285202860832214... |
def connect ( self ) : self. _ ser = serial. serial ( self. _ serial _ device, self. _ baud _ rate, timeout = 1 ) | [
0.027371099218726158,
-0.1955152451992035,
0.41001972556114197,
0.08346197754144669,
0.6264446377754211,
-0.08981350809335709,
0.1673206388950348,
0.35360512137413025,
-0.07585033774375916,
-0.609138548374176,
-0.08294276148080826,
0.5984176397323608,
0.14788216352462769,
-0.09909120202064... |
def from _ dump ( dump _ path : str ) : with open ( dump _ path,'rb') as f : return pickle. load ( f ) | [
0.21627451479434967,
-0.23866614699363708,
0.12925706803798676,
-1.2250494956970215,
-0.30576595664024353,
-0.0425906777381897,
0.0023139750119298697,
0.04788428917527199,
0.4753120541572571,
-0.2713278830051422,
-0.2443884164094925,
-0.7511465549468994,
0.13969586789608002,
-1.83353316783... |
def prepare _ export _ update _ product _ attribute _ vals ( self, template, new _ product ) : if len ( template. shopify _ product _ ids ) > 1 : attribute _ list = [ ] attribute _ position = 1 product _ attribute _ line _ obj = self. env [ " product. template. attribute. line " ] product _ attribute _ lines = product ... | [
-1.0755597352981567,
-0.6568558812141418,
0.5879145264625549,
-0.2739946246147156,
0.005970616824924946,
0.05326835438609123,
-0.2304999828338623,
-0.4577774107456207,
-0.1269223392009735,
0.7130967378616333,
-0.6998098492622375,
-0.5227347016334534,
0.9289049506187439,
0.42564257979393005... |
def test _ atomic _ language _ max _ length _ 3 _ nistxml _ sv _ iv _ atomic _ language _ max _ length _ 4 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / language / schema + instance / nistschema - sv - iv - atomic - language - maxlength - 4. xsd ", instance = " nistda... | [
0.5156980752944946,
0.06218701973557472,
0.24738448858261108,
0.4575558304786682,
-0.748604953289032,
0.38179507851600647,
-0.21272391080856323,
0.048192333430051804,
-0.20730708539485931,
0.681358277797699,
-0.8674451112747192,
-0.5009568333625793,
-0.13483810424804688,
-0.322617918252944... |
def test _ atomic _ hex _ binary _ enumeration _ nistxml _ sv _ iv _ atomic _ hex _ binary _ enumeration _ 1 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - enumeration - 1. xsd ", instance = " ... | [
-0.5566793084144592,
-0.7347167730331421,
0.5460901856422424,
0.7399544715881348,
-0.18946945667266846,
0.3427429795265198,
0.46982571482658386,
0.05110630393028259,
-0.28454291820526123,
0.6243281960487366,
-0.7070770859718323,
-0.5032896399497986,
-0.12727299332618713,
0.5879552364349365... |
def limit _ angle ( self, angle ) : if angle > np. pi : angle - = 2 * np. pi elif angle < - np. pi : angle + = 2 * np. pi return angle | [
-0.01868869736790657,
0.07385186851024628,
0.5333030223846436,
-0.0523742213845253,
-0.1136389672756195,
0.86673903465271,
-0.38571491837501526,
-0.03208287060260773,
0.6582481265068054,
0.051867105066776276,
0.9008535146713257,
0.2129782736301422,
-0.811083197593689,
-0.5793009996414185,
... |
def filesystemstorage ( tmpdir, settings ) : settings. media _ root = tmpdir. strpath settings. media _ url ='/ media /'return filesystemstorage ( ) | [
-0.1117718368768692,
-0.4248073399066925,
0.16118767857551575,
0.10105648636817932,
-0.2019859254360199,
-0.7821450233459473,
0.3429078161716461,
-0.8999437093734741,
0.614138662815094,
-0.8278576731681824,
0.2350430190563202,
-0.3567441403865814,
-0.20994967222213745,
0.8922749757766724,
... |
def update _ record _ files _ async ( object _ version ) : # convert to string to be able to serialize it when sending to the task str _ uuid = str ( object _ version. bucket _ id ) return update _ record _ files _ by _ bucket. delay ( bucket _ id = str _ uuid ) | [
-0.38343584537506104,
-0.6695317625999451,
0.7788479924201965,
0.027789996936917305,
0.1503453254699707,
-0.27016890048980713,
0.5114123821258545,
0.82243812084198,
-0.52882319688797,
0.8229987025260925,
-1.1542706489562988,
0.39877256751060486,
0.10432574152946472,
-1.20193350315094,
-0... |
def getmappingsonthingtypeforlogicalinterface ( self, thingtypeid, logicalinterfaceid, draft = false ) : if draft : req = apiclient. onethingtypemappingurl % ( self. host, " / draft ", thingtypeid, logicalinterfaceid ) else : req = apiclient. onethingtypemappingurl % ( self. host, " ", thingtypeid, logicalinterfaceid )... | [
-1.119265079498291,
-0.16711589694023132,
0.5540798306465149,
-1.010337233543396,
-0.6582784056663513,
0.0457926020026207,
-1.176021933555603,
-1.13348388671875,
0.29595762491226196,
0.19437159597873688,
0.021107574924826622,
0.33115217089653015,
-1.1991697549819946,
0.5593029260635376,
... |
def test _ add _ exe _ args _ list _ of _ str _ lists ( ) : exe _ args = [ [ " 1 ", " 2 ", " 3 " ], [ " 4 ", " 5 ", " 6 " ] ] settings = runsettings ( " python " ) with pytest. raises ( typeerror ) as type _ error : settings. add _ exe _ args ( exe _ args ) # note that this behavior differs from sending constructor arg... | [
-0.234592467546463,
0.4023316502571106,
0.6856589317321777,
0.5307214856147766,
1.0573481321334839,
0.6944247484207153,
-0.11101672798395157,
-0.30540731549263,
-0.15842661261558533,
0.8194860219955444,
-0.6999337673187256,
-0.3163743317127228,
-0.9070513248443604,
0.985227108001709,
0.1... |
def get _ start _ channel ( self ) : return self. channels [ 0 ] | [
-0.1251179724931717,
-0.5720773339271545,
0.6038052439689636,
-0.024212976917624474,
0.8400731086730957,
0.30044984817504883,
0.3174377679824829,
-0.43803343176841736,
0.09856875985860825,
-0.6079061627388,
0.9036307334899902,
1.629908561706543,
-0.0016954531893134117,
-0.6038276553153992,... |
def get _ rabbit _ user _ password ( self ) : logger. debug ( " get rabbitmq credentials from nova config file. " ) nova _ cfg _ f ='/ etc / nova / nova. conf'controller = random. choice ( self. env. get _ nodes _ by _ role ('controller') ) with controller. ssh ( ) as remote : with remote. open ( nova _ cfg _ f ) as f ... | [
-0.1527823805809021,
-0.9634311199188232,
0.4514108896255493,
-0.11144744604825974,
-0.5003494620323181,
0.6088632345199585,
-0.07235891371965408,
0.579862117767334,
-0.9956070184707642,
0.6732436418533325,
-1.1042448282241821,
0.6480348110198975,
-0.5700124502182007,
0.36528024077415466,
... |
def test _ remove _ peaks _ around _ precursor _ mz _ no _ params ( spectrum _ in ) : spectrum = remove _ peaks _ around _ precursor _ mz ( spectrum _ in ) assert spectrum = = spectrum _ in, " expected no changes. " | [
0.21105609834194183,
-0.14113952219486237,
0.302918940782547,
0.05774271860718727,
-0.19266214966773987,
0.8498214483261108,
0.6573232412338257,
1.1556288003921509,
0.5027227401733398,
-0.7362789511680603,
-0.5807178616523743,
0.5481656789779663,
-0.75531405210495,
1.340094804763794,
-0.... |
def event _ id ( self, event _ id ) : self. _ event _ id = event _ id | [
1.0184468030929565,
-0.7822074294090271,
-0.18826866149902344,
0.6533054709434509,
1.032910943031311,
1.3128691911697388,
-0.024541575461626053,
1.7066551446914673,
0.8312441110610962,
-0.15007661283016205,
-0.36269399523735046,
0.9015140533447266,
0.35994914174079895,
1.408382773399353,
... |
def kde _ scipy ( x, x _ grid, bandwidth = 0. 2, * * kwargs ) : # x _ grid = np. linspace ( - 4. 5, 3. 5, 1000 ) # note that scipy weights its bandwidth by the covariance of the # input data. to make the results comparable to the other methods, # we divide the bandwidth by the sample standard deviation here. kde = gaus... | [
1.271353840827942,
0.013874844647943974,
0.5730090141296387,
0.3289901912212372,
0.06974321603775024,
-0.11045107245445251,
-1.0797456502914429,
0.10988054424524307,
0.4796053171157837,
0.67618328332901,
0.8282051086425781,
0.39686450362205505,
-0.8954399228096008,
-0.04502552002668381,
... |
def _ resize _ and _ pad ( img, desired _ size ) : old _ size = img. shape [ : 2 ] # old _ size is in ( height, width ) format ratio = float ( desired _ size ) / max ( old _ size ) new _ size = tuple ( [ int ( x * ratio ) for x in old _ size ] ) if new _ size [ 0 ] = = 0 : new _ size = ( new _ size [ 0 ] + 1, new _ siz... | [
0.019475363194942474,
-0.21959275007247925,
0.9383431077003479,
0.5705371499061584,
0.018652938306331635,
-0.08038544654846191,
-0.04164186120033264,
-0.32613253593444824,
0.4378536343574524,
-0.29606229066848755,
0.13775774836540222,
0.5481356382369995,
0.3833003044128418,
0.6269242167472... |
def get _ patch ( img, kernel _ size = 3, stride = 1, padding = 1 ) : patcher = nn. unfold ( kernel _ size = kernel _ size, padding = padding, stride = stride ) patches = patcher ( img ) return patches. transpose ( 1, 2 ). squeeze ( ) | [
0.3513662815093994,
0.6170377135276794,
0.4074929654598236,
0.013355731964111328,
-1.0210257768630981,
-0.8746684789657593,
0.04755476117134094,
0.09440124034881592,
0.3357652723789215,
-0.045396286994218826,
-0.07280349731445312,
-0.36523088812828064,
0.4381208121776581,
0.058419566601514... |
def node _ config ( self ) - >'outputs. nodeconfigresponse': return pulumi. get ( self, " node _ config " ) | [
0.44447946548461914,
0.421760618686676,
0.190522700548172,
-0.17932787537574768,
0.5399104356765747,
-0.15834566950798035,
0.09264521300792694,
0.6240227222442627,
0.0867575854063034,
0.5432252883911133,
-0.34011393785476685,
0.9440199732780457,
0.34348219633102417,
-0.3669455647468567,
... |
def test _ atomic _ qname _ length _ 1 _ nistxml _ sv _ iv _ atomic _ qname _ length _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - length - 2. xsd ", instance = " nistdata / atomic / qname / schem... | [
0.06623996049165726,
-0.32148006558418274,
0.4084407389163971,
-0.01619592495262623,
-0.33677783608436584,
0.38663986325263977,
-0.5823298096656799,
-0.43512824177742004,
0.07304342091083527,
0.3091212809085846,
-0.7550492882728577,
-0.15341413021087646,
0.24981696903705597,
-0.06501184403... |
def addbinary ( self, a : str, b : str ) - > str : # this approch is very time consuming as it has o ( n + m ) complexity. # return'{ 0 : b } '. format ( int ( a, 2 ) + int ( b, 2 ) ) " " " this approch is bit manipulation : start from carry = 0. if number a has 1 - bit in this lowest bit, add 1 to the carry. the same ... | [
0.14760500192642212,
-0.6193784475326538,
1.242740511894226,
0.8287262320518494,
-0.1456645429134369,
-0.24888096749782562,
0.030463440343737602,
-1.1370303630828857,
0.19366946816444397,
-0.011625624261796474,
0.15211240947246552,
0.3518070876598358,
-0.32847926020622253,
0.50607949495315... |
def rest _ thread _ work ( self ) : logger. info ( " rest thread started % s % s % s dbg : % s " % ( os. getpid ( ), os. getppid ( ), threading. current _ thread ( ), self. debug ) ) try : self. worker _ loop = asyncio. new _ event _ loop ( ) self. rest _ loop = asyncio. new _ event _ loop ( ) asyncio. set _ event _ lo... | [
-0.09278558939695358,
-0.8648127913475037,
0.9304783344268799,
0.3239161968231201,
0.9934878349304199,
0.41136282682418823,
-0.20016831159591675,
-0.19680479168891907,
-0.23965510725975037,
-0.5639347434043884,
-0.08128981292247772,
0.7371102571487427,
-0.5866007208824158,
0.19241374731063... |
def conv2d _ block ( input _ tensor, n _ filters, kernel _ size = 3, batchnorm = true, secondlayer = true ) : # first layer x = conv2d ( filters = n _ filters, kernel _ size = ( kernel _ size, kernel _ size ), \ kernel _ initializer ='he _ normal ', padding ='same') ( input _ tensor ) if batchnorm : x = batchnormalizat... | [
0.1126953735947609,
-0.31472188234329224,
0.8266655206680298,
1.0035905838012695,
-0.9045729041099548,
0.27135154604911804,
-0.7911264896392822,
-0.39130547642707825,
-0.34986376762390137,
-0.4643459618091583,
-0.5148367285728455,
0.5015460848808289,
0.18269573152065277,
0.6604024767875671... |
def std ( self ) : return self. data. std ( ) | [
0.9077969789505005,
-0.6321180462837219,
0.2557533383369446,
-0.5756253004074097,
-0.5701203346252441,
0.7639330625534058,
0.045863837003707886,
0.10339692234992981,
0.11505407094955444,
-1.5926622152328491,
-0.3357083797454834,
0.7057312726974487,
-0.1243378296494484,
-0.5595011115074158,... |
def results ( request ) : form = crawlerform ( request. post ) if form. is _ valid ( ) : url = form. cleaned _ data ['url'] depth = form. cleaned _ data ['depth'] search _ text = form. cleaned _ data ['search _ text'] urls _ with _ search _ text = [ ] logging. info ( " url : " + str ( url ) ) logging. info ( " depth : ... | [
-0.9305859208106995,
0.3577660620212555,
0.6217875480651855,
-0.10115968436002731,
0.16348953545093536,
0.05938437581062317,
0.4644358158111572,
0.2924920916557312,
-0.9814855456352234,
-0.6987985372543335,
-0.1410922110080719,
-0.281871497631073,
-0.38702526688575745,
1.3673690557479858,
... |
def reversestring ( s : list [ str ] ) - > none : stringlength = len ( s ) s [ : stringlength : 1 ] = s [ stringlength : : - 1 ] | [
-0.5284877419471741,
-0.11944609880447388,
0.30926191806793213,
-0.9538688659667969,
0.5993158221244812,
-0.7180178761482239,
-0.2640526592731476,
1.0673714876174927,
-0.1505415290594101,
0.25458624958992004,
-0.9703688621520996,
1.362492561340332,
-0.7063573002815247,
-1.0262577533721924,... |
def test _ atomic _ any _ uri _ pattern _ 1 _ nistxml _ sv _ iv _ atomic _ any _ uri _ pattern _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - pattern - 2. xsd ", instance = " nistdata / atomic / ... | [
-0.40267154574394226,
-0.30658844113349915,
0.5853806138038635,
1.1278302669525146,
-0.16076913475990295,
0.20573116838932037,
-0.11100460588932037,
0.22959905862808228,
-0.13817179203033447,
-0.18847224116325378,
0.1152142733335495,
-0.20113196969032288,
-0.10435851663351059,
-0.080778628... |
def connect _ db ( dbname ) : conn = pg. connect ( dbname = dbname, user = cfg. psql _ user, password = cfg. psql _ pass, host = cfg. psql _ host, port = cfg. psql _ port ) return conn | [
-0.3704739809036255,
0.15795373916625977,
0.7047837376594543,
0.43016210198402405,
-0.49317479133605957,
0.4109947085380554,
-0.6501201391220093,
0.05541202425956726,
-0.7459152340888977,
-0.0049785892479121685,
-0.04802180826663971,
-0.4587160646915436,
-0.9659255743026733,
0.217401191592... |
def removeoldfile ( self, filepath ) : fileexists = os. path. exists ( filepath ) if ( fileexists = = true ) : os. remove ( filepath ) file _ create = open ( filepath,'w') file _ create. write ('' ) file _ create. close ( ) reponse ='- - > deleting old file and recreating'else : # create a blank file. file _ create = o... | [
0.30683115124702454,
0.25622543692588806,
0.5109419226646423,
-0.37302058935165405,
0.775382399559021,
0.2135489135980606,
0.9307544827461243,
0.21006834506988525,
0.03925037756562233,
0.4224395751953125,
0.23784217238426208,
-0.4725448191165924,
-0.11995428055524826,
0.5992559790611267,
... |
def hijackers _ assault _ on _ tick ( self ) : rand _ percent = random. randint ( 1, 100 ) if rand _ percent < = game _ config. hijackers _ assault _ probability : hijackers _ power = random. randint ( * game _ config. hijackers _ power _ range ) log ( log. info, " hijackers assault happened, hijackers power : { } ". f... | [
0.015495356172323227,
-0.5004478096961975,
0.5587432384490967,
0.8578656911849976,
0.596220076084137,
0.2692086398601532,
-0.18472018837928772,
-0.4387568235397339,
-0.17803893983364105,
0.9108238816261292,
-0.29174041748046875,
0.18451765179634094,
0.06029649078845978,
0.18660300970077515... |
def dbscan _ cluster ( x ) : y _ pred = dbscan ( eps = 10, min _ samples = 10 ). fit _ predict ( x ) print ( metrics. calinski _ harabasz _ score ( x, y _ pred ) ) return y _ pred | [
0.16123655438423157,
0.9441877603530884,
0.4420361816883087,
0.2925809919834137,
0.04956939443945885,
0.24073486030101776,
0.05408097803592682,
-0.3632832467556,
0.4743596613407135,
-0.7093639969825745,
-0.3445053696632385,
0.923780620098114,
0.5061313509941101,
-0.39477038383483887,
1.0... |
def main ( _ ) : # dataset = get _ record _ dataset ( flags. record _ path, num _ samples = 79573, num _ classes = 54 ) # data _ provider = slim. dataset _ data _ provider. datasetdataprovider ( dataset ) # image, label = data _ provider. get ( ['image ','label'] ) # data augumentation # image = tf. image. random _ fli... | [
-0.8303830623626709,
0.4400074779987335,
0.8062894940376282,
-0.13716323673725128,
0.8287382125854492,
0.22744789719581604,
0.845675528049469,
0.19279739260673523,
-0.6012975573539734,
0.4375077188014984,
-0.6052606105804443,
-0.1280507892370224,
0.14724910259246826,
0.004803702235221863,
... |
def write _ dictionary _ list ( dictionary _ list, file _ path, encoding ='utf - 8 - sig ', appending = false ) : if not appending : style = " w " else : style = " a " with codecs. open ( file _ path, style, encoding = encoding ) as csv _ file : write _ list ( csv _ file = csv _ file, dictionary _ list = dictionary _ l... | [
-0.4607127010822296,
0.2830177843570709,
0.31774476170539856,
-0.11649110168218613,
0.284117728471756,
-0.2806325852870941,
-0.992750883102417,
1.098364233970642,
0.043035637587308884,
0.5803871154785156,
-0.5168073773384094,
-0.5395894050598145,
0.4810034930706024,
1.2777702808380127,
-... |
def group _ init ( self, group _ name ) : self. add _ group ( group _ name ) while true : try : fixed _ price = int ( input ( " set fixed price : " ) ) except valueerror : print ( " enter a valid integer. " ) else : self. set _ fixed _ price _ in _ cogs ( group _ name, fixed _ price ) break while true : try : endpoints... | [
-0.7996715307235718,
0.932583749294281,
0.5501929521560669,
0.04842085391283035,
0.1193995401263237,
-0.1908247321844101,
0.8064978718757629,
-1.4895095825195312,
-0.5571804046630859,
0.030990274623036385,
-0.12459136545658112,
0.2227533459663391,
-0.5740768909454346,
0.8924529552459717,
... |
def _ _ init _ _ ( self, master ) : super ( ). _ _ init _ _ ( master,'rate a movie ', 1, 4, true, false ) self. master = master self. master. title ('movie details') self. master. geometry ('600x200 + 25 + 25') e _ search = entry ( self. main _ frame, background = " white ", width = 30 ) e _ search. grid ( row = 1, col... | [
-0.11099132895469666,
1.0117528438568115,
0.6749368906021118,
0.21637029945850372,
0.286235511302948,
0.38793620467185974,
0.11287852376699448,
0.2240014523267746,
-0.24957209825515747,
0.048913441598415375,
-0.46541181206703186,
0.3228037357330322,
-0.12906765937805176,
1.6765984296798706... |
def base _ clean ( cls, document, cleaner = none ) : if cleaner is none : cleaner = basecleaner ( ) return cls. lxml _ clean ( document, cleaner ) | [
-0.19533474743366241,
-0.715304970741272,
0.40631720423698425,
0.9890381097793579,
-1.2384231090545654,
0.12152242660522461,
-0.4975613057613373,
-0.16342076659202576,
-0.5428389310836792,
-0.472184419631958,
-0.09468450397253036,
-0.04426340386271477,
-0.4996448755264282,
0.96332007646560... |
def branches _ next _ to _ pants _ curve ( self, pants _ curve, side ) : switch = self. pants _ curve _ to _ switch ( pants _ curve ) if self. get _ pants _ curve _ turning ( pants _ curve ) = = left : if side = = left : return self. outgoing _ branches ( - switch, right ) [ 1 : ] else : return self. outgoing _ branche... | [
-0.41880419850349426,
-0.7114643454551697,
0.812434196472168,
-0.46476373076438904,
-0.2479330599308014,
0.2085583209991455,
-0.693802535533905,
-1.1510348320007324,
-0.383701354265213,
0.023777374997735023,
-0.18359309434890747,
1.0441944599151611,
-0.5472261309623718,
0.223763108253479,
... |
def get _ encircled _ energy _ cube ( orig _ cube, frac = 0. 5 ) : cube = orig _ cube. copy ( ) if len ( cube. shape ) = = 2 : cube = cube [ np. newaxis, :, : ] nchan = cube. shape [ 0 ] centers = get _ psf _ center ( cube, fine = true ) ee _ data = pd. dataframe ( [ _ get _ encircled _ energy _ image ( im, center, fra... | [
-0.4044986963272095,
-0.3330504894256592,
0.5939860343933105,
-0.008992758579552174,
-0.14639389514923096,
-0.37482360005378723,
1.249954342842102,
-0.11901721358299255,
-0.2532469928264618,
-0.1309867650270462,
0.8109461665153503,
0.45292797684669495,
-0.6891845464706421,
0.14005850255489... |
def draw _ preview ( self, surface, game _ blocks ) : body = self. body. copy ( ) while next _ move _ available ( body, game _ blocks ) : for i, piece in enumerate ( body ) : body [ i ] = int ( piece [ 0 ] ), int ( piece [ 1 ] ) + 1 for piece in body : surface. blit ( self. preview _ image, board _ pos ( piece ) ) | [
-0.7138111591339111,
0.42624568939208984,
0.49381738901138306,
-0.5937424302101135,
-0.9513856768608093,
0.5885222554206848,
0.44808775186538696,
0.014449614100158215,
0.09767259657382965,
0.036607831716537476,
-0.3128573000431061,
0.5965132713317871,
-0.07457790523767471,
0.34053665399551... |
def test _ list _ decimal _ min _ length _ 2 _ nistxml _ sv _ iv _ list _ decimal _ min _ length _ 3 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - minlength - 3. xsd ", instance = " nistdata / list / ... | [
0.01185040082782507,
-0.3279605805873871,
0.5476216673851013,
0.2121877372264862,
-0.31952106952667236,
0.1276894509792328,
-0.5233415365219116,
-0.16154558956623077,
0.9205778241157532,
0.1433081179857254,
-1.3794126510620117,
0.009746029041707516,
-0.2459549605846405,
0.16723500192165375... |
def quadratic _ check2 ( test _ coeff, intervals, tol = 1e - 12 ) : if test _ coeff. ndim > 2 : return [ true ] * len ( intervals ) padding = [ ( 0, max ( 0, 3 - i ) ) for i in test _ coeff. shape ] test _ coeff = np. pad ( test _ coeff. copy ( ), padding, mode ='constant') # very similar to quadratic _ check _ 1, but ... | [
0.5226022005081177,
-1.0161484479904175,
0.9116772413253784,
0.4060269892215729,
-0.6938115358352661,
0.35594016313552856,
0.12071899324655533,
-0.7112383842468262,
-0.03810292109847069,
0.21706213057041168,
-0.7054963707923889,
-0.07163385301828384,
-0.12702251970767975,
-0.56916791200637... |
def to _ dict ( self ) : result = { } for attr, _ in six. iteritems ( self. swagger _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ att... | [
-0.29314908385276794,
0.04168744757771492,
1.027540683746338,
-0.5924469828605652,
-0.6212778687477112,
-0.6817338466644287,
0.4856830835342407,
-0.17571842670440674,
-0.011034160852432251,
0.39687788486480713,
-0.13833589851856232,
-0.02098962292075157,
0.20030997693538666,
1.024694681167... |
def update ( self, x = none, y = none, rotation = none, scale = none, scale _ x = none, scale _ y = none ) : if x is not none : self. _ x = x if y is not none : self. _ y = y if rotation is not none : self. _ rotation = rotation if scale is not none : self. _ scale = scale if scale _ x is not none : self. _ scale _ x =... | [
-0.755059540271759,
-0.916326642036438,
0.7587676048278809,
-0.5032402873039246,
0.05286749079823494,
-0.3629468083381653,
-0.9644408226013184,
-0.7931302189826965,
-0.3153991103172302,
0.3057117164134979,
-0.9656912088394165,
-0.29068121314048767,
-0.03839132562279701,
0.0872051939368248,... |
def recognize _ speech _ from _ audio ( recognizer : speech _ recognition. recognizer, audio : speech _ recognition. audiodata ) - > str : # check that recognizer argument are appropriate type if not isinstance ( recognizer, speech _ recognition. recognizer ) : raise typeerror ('` recognizer ` must be ` recognizer ` in... | [
0.04821137711405754,
-0.7994502186775208,
0.17974884808063507,
0.24893806874752045,
-1.133888602256775,
0.6407293677330017,
-0.5536579489707947,
-0.3245818614959717,
0.14221860468387604,
0.700153648853302,
-0.3093513250350952,
0.7916849851608276,
0.3487023413181305,
0.6873265504837036,
1... |
def extra _ blocks ( self ) - > tuple [ block,... ] : return self. _ extra _ blocks | [
-0.7300084233283997,
0.495365172624588,
0.3566740155220032,
0.533389687538147,
0.2783307731151581,
0.7144297361373901,
-0.1427096724510193,
-0.22543096542358398,
0.11215288192033768,
0.10213018953800201,
-1.8403637409210205,
0.018503379076719284,
-0.6197103261947632,
0.8952257633209229,
... |
def test _ list _ integer _ max _ length _ 1 _ nistxml _ sv _ iv _ list _ integer _ max _ length _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - maxlength - 2. xsd ", instance = " nistdata / list / ... | [
-0.6160159707069397,
-0.21711140871047974,
0.3173934817314148,
0.8805131912231445,
-0.4602411687374115,
0.32905444502830505,
-0.8353156447410583,
0.4004809260368347,
0.9504464268684387,
0.5047430992126465,
-1.0426201820373535,
-0.1414748728275299,
-0.16046492755413055,
0.7540069222450256,
... |
def example _ 1 ( ) : def plus ( a, b ) : return a + b plus. _ _ name _ _ = " + " x : list [ int ] = [ i for i in range ( 1, 4 ) ] x0 = 0 res = fold ( x, plus, x0, debug = true ) print ( f " fold ( { x }, { plus. _ _ name _ _ }, { x0 } ) = { res } " ) | [
0.0007649329490959644,
0.17134490609169006,
0.5629642009735107,
0.1870434433221817,
-1.3755961656570435,
0.24612277746200562,
-0.06773509085178375,
0.6809895038604736,
0.9268296957015991,
-0.24607551097869873,
-1.4451472759246826,
-0.11981212347745895,
1.0933364629745483,
0.554405987262725... |
def merge ( _ list, begin, middle, end ) : # divide list into two sublists left = _ list [ begin : middle + 1 ] right = _ list [ middle + 1 : end + 1 ] i, j = 0, 0 # merge two sublists for k in range ( begin, end + 1 ) : # if reach end of first sublist - merge the second list if i = = len ( left ) : _ list [ k ] = righ... | [
-0.46441829204559326,
0.0915672704577446,
0.7802589535713196,
0.7060805559158325,
-0.9259240031242371,
0.8351612091064453,
-0.5216472148895264,
0.3476358652114868,
-0.6488084197044373,
0.04513360932469368,
-1.2617003917694092,
-0.2578948736190796,
-0.5209401845932007,
0.13292646408081055,
... |
def test _ json _ response _ cached ( self ) : class counturiaccess ( bliptvnodownloadstorage ) : count = 0 def _ urlopen _ read ( self, uri ) : self. count + = 1 return super ( counturiaccess, self ). _ urlopen _ read ( uri ) cache. clear ( ) backend = counturiaccess ( ) embed = backend. serve ( self. resource ) embed... | [
-0.2884241044521332,
-0.264046311378479,
0.6398937106132507,
0.3474405109882355,
0.2695794403553009,
0.2771657705307007,
0.8379313349723816,
-0.175782710313797,
0.8228391408920288,
-0.5226341485977173,
-0.6143495440483093,
0.060204360634088516,
0.010862081311643124,
-0.35296550393104553,
... |
def imagetransformer2d _ base _ 8l _ 8 _ 64 _ 64by64 ( ) : hparams = image _ transformer2d _ base ( ) hparams. num _ heads = 8 hparams. hidden _ size = 512 hparams. filter _ size = 2048 hparams. num _ decoder _ layers = 8 hparams. batch _ size = 1 hparams. layer _ prepostprocess _ dropout = 0. 1 hparams. query _ shape ... | [
-0.8320283889770508,
-0.24411611258983612,
0.6886845827102661,
-0.24063053727149963,
-0.08668358623981476,
-0.8540663719177246,
-0.31601765751838684,
-0.002487653400748968,
-0.23795166611671448,
0.23550601303577423,
-0.6735070943832397,
0.11872456222772598,
-0.07342939078807831,
0.76010632... |
def get _ namespace _ authorization _ rule _ output ( name : optional [ pulumi. input [ str ] ] = none, namespace _ name : optional [ pulumi. input [ str ] ] = none, resource _ group _ name : optional [ pulumi. input [ str ] ] = none, opts : optional [ pulumi. invokeoptions ] = none ) - > pulumi. output [ getnamespacea... | [
0.7125656604766846,
0.3476814329624176,
0.2760526239871979,
0.07497350871562958,
-0.5230754017829895,
-0.07672961056232452,
-0.24205610156059265,
-0.5787345170974731,
0.6014581918716431,
0.3172420263290405,
1.353324055671692,
1.254894495010376,
-0.55140221118927,
-0.46436551213264465,
0.... |
def xpressblock _ size ( fmm, offset ) : fmm. seek ( offset ) if fmm. read ( 8 )! = xpress _ sig : return none fmm. read ( 1 ) xsize = roundit ( ( ( unpack ('< i ', fmm. read ( 4 ) ) [ 0 ] / 4 ) + 1 ), 8 ) fmm. seek ( offset ) # sig8 + 1 + size4 + 19 return ( 32 + xsize ) | [
0.18988491594791412,
0.22176843881607056,
0.7559391260147095,
-0.581942617893219,
-0.7805500030517578,
-0.6318134069442749,
-0.09243691712617874,
-0.8304930925369263,
0.3548421561717987,
-0.40104809403419495,
-0.8889226317405701,
-0.49855706095695496,
-1.1448663473129272,
-0.41827321052551... |
def secure _ http _ tiledir ( secure _ http _ testdata _ dir ) : return secure _ http _ testdata _ dir / " cleantopo " | [
-0.2028234899044037,
0.08206402510404587,
0.2926150858402252,
-0.14670899510383606,
-0.023680830374360085,
1.1462442874908447,
0.8553641438484192,
-0.6218865513801575,
0.3575131595134735,
-0.4568275511264801,
0.0899774432182312,
1.2290204763412476,
0.665878176689148,
-0.589480996131897,
... |
def get _ cart _ total ( self ) : self. total = self. orderitems. aggregate ( sum ('orderitem _ total') ) ['orderitem _ total _ _ sum'] or 0 if self. total < settings. free _ delivery _ threshold : self. delivery _ cost = self. total settings. standard _ delivery _ percentage / 100 else : self. delivery _ cost = 0 self... | [
-0.7442565560340881,
-0.10082586109638214,
0.6705468893051147,
-0.17789502441883087,
0.2980557382106781,
-0.48373520374298096,
-0.17727912962436676,
-0.6936755180358887,
-0.5459116101264954,
0.6099475622177124,
-1.1395635604858398,
-0.6154474020004272,
1.054651141166687,
-0.889049768447876... |
def animate ( self, i, event ) : cmd = " / system / library / privateframeworks / apple80211. framework / versions / current / resources / airport - i | grep ctl " rslt = list ( ( str ( runcommand ( cmd ),'utf - 8'). lstrip ( ) ). split ('\ n') ) sig _ value = 100 - ( ( ( - 30. 0 - ( int ( rslt [ 0 ]. split ( " : " ) [... | [
0.14166812598705292,
0.020331192761659622,
0.8676128387451172,
-0.12450822442770004,
-0.4369119703769684,
0.39453747868537903,
0.7351725697517395,
-0.09755785018205643,
-0.2967982888221741,
0.11149577796459198,
-0.07399488240480423,
0.3683306574821472,
-0.4161141812801361,
0.26787099242210... |
def _ _ init _ _ ( self, identifier : optional [ str ] = none ) - > none : if identifier : self. _ identifier = identifier self. _ g = graph ( ) | [
-0.26049551367759705,
0.2212965041399002,
0.42173337936401367,
0.36339831352233887,
-0.7927507758140564,
0.19170717895030975,
0.5304259657859802,
0.7477695941925049,
0.6985277533531189,
-0.40177100896835327,
-1.0342804193496704,
0.4060461223125458,
0.12978380918502808,
-0.15465687215328217... |
def _ convert2tquat ( rot ) : if type ( rot ) is glm. tquat : return rot elif type ( rot ) is iter or type ( rot ) is tuple or type ( rot ) is glm. tvec3 or type ( rot ) is np. ndarray : if len ( rot ) = = 3 : return glm. tquat ( glm. vec3 ( rot [ 0 ], rot [ 1 ], rot [ 2 ] ), dtype = c _ float ) elif len ( rot ) = = 4 ... | [
-0.5470264554023743,
-0.2857811748981476,
0.6980783343315125,
-1.151936411857605,
-0.33342328667640686,
-0.41146209836006165,
0.6450456380844116,
-1.6372175216674805,
0.42715004086494446,
0.5501672029495239,
0.37868520617485046,
-0.13608986139297485,
-0.6900085210800171,
-1.192655801773071... |
def test _ list _ integer _ pattern _ 4 _ nistxml _ sv _ iv _ list _ integer _ pattern _ 5 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - pattern - 5. xsd ", instance = " nistdata / list / integer / sc... | [
-0.597578227519989,
-0.315871924161911,
0.3826272189617157,
0.2798268795013428,
-0.41631096601486206,
-0.31448137760162354,
0.2889759838581085,
-0.07965176552534103,
0.7121790647506714,
0.7743521928787231,
-1.054479718208313,
-0.4888158440589905,
-1.0128724575042725,
0.6451080441474915,
... |
def test _ par _ parent _ mp _ spawn _ par _ child _ par _ parent ( self ) : body = " " " if 1 : x = np. arange ( 1000000. ) y = np. arange ( 1000000. ) q = multiprocessing. queue ( ) # start openmp runtime and run on parent via parallel function z = busy _ func ( x, y, q ) procs = [ ] ctx = multiprocessing. get _ cont... | [
0.7101196050643921,
-0.6602169871330261,
1.123608946800232,
-0.03261157497763634,
0.07614496350288391,
0.40411463379859924,
0.27032265067100525,
-0.8138560056686401,
-0.41659054160118103,
-0.6553694605827332,
-0.7375242114067078,
0.7884020805358887,
-0.45180630683898926,
0.5099600553512573... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.