text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def run _ sts _ benchmark ( session ) : emba, embb, scores = session. run ( [ sts _ encode1, sts _ encode2, sim _ scores ], feed _ dict = { sts _ input1 : text _ a, sts _ input2 : text _ b } ) return scores | [
0.06343986839056015,
0.23078197240829468,
0.3733988404273987,
0.34615734219551086,
0.4570600986480713,
-0.26697176694869995,
-0.04651913791894913,
-0.4908774793148041,
-0.32687658071517944,
0.35511767864227295,
-0.7389273047447205,
0.7602975368499756,
-0.6646780967712402,
0.404534012079238... |
def predict _ data ( args ) : predict _ file = args. predict _ file metadata _ file = args. metadata _ file checkpoint _ dir = args. checkpoint _ dir vocab = args. vocab fun = args. fun # do some checks try : assert os. path. exists ( predict _ file ), " eval _ file must exist " assert os. path. exists ( metadata _ fil... | [
-0.3863676190376282,
-0.09181243926286697,
0.6263023614883423,
0.40973910689353943,
1.5207757949829102,
0.029877634719014168,
-0.3469972014427185,
0.9546226263046265,
-1.0005320310592651,
0.09267935901880264,
0.18737535178661346,
0.5730463266372681,
0.40929746627807617,
0.04439442604780197... |
def kl ( self, dists, priors = none ) : dist _ params = dists ['sequential'] priors = [ none for _ in range ( len ( dist _ params ) ) ] if priors is none else priors assert len ( priors ) = = len ( dist _ params ) kl = none for param, prior, reparam in zip ( dist _ params, priors, self. reparameterizers ) : reparam _ o... | [
0.4431041479110718,
0.18510353565216064,
0.4403449594974518,
-0.05339707061648369,
-0.22002027928829193,
-0.09566391259431839,
-0.07189858704805374,
0.6518567204475403,
0.6080493927001953,
0.5460541844367981,
0.22056658565998077,
-0.11114374548196793,
0.20482134819030762,
0.234731495380401... |
def get _ entity ( cls, method _ name ) : if not method _ name : return cls method = cls. find _ single _ method ( method _ name ) return method | [
-0.24498867988586426,
0.09847135096788406,
0.33735376596450806,
0.2936853766441345,
1.091193437576294,
-0.585038959980011,
0.6395521759986877,
-0.19543372094631195,
0.3840509355068207,
0.12319772690534592,
0.9141331315040588,
0.23231036961078644,
0.03267684951424599,
0.9456016421318054,
... |
def test _ _ _ bytes _ _ ( image _ config : imageconfig, image _ config _ signed : imageconfig, json _ bytes : bytes, json _ bytes _ signed : bytes, ) : assert bytes ( image _ config ) = = json _ bytes assert bytes ( image _ config _ signed ) = = json _ bytes _ signed | [
-0.3063245117664337,
-0.32473841309547424,
0.5154020190238953,
-0.2257777750492096,
0.38834869861602783,
0.20460262894630432,
-0.22399750351905823,
-1.0445780754089355,
1.0289477109909058,
-0.2343982458114624,
-1.1968926191329956,
0.09982018172740936,
0.6040480732917786,
0.5424153804779053... |
def fetch _ data ( config ) : start _ time = time ( ) sources = [ os. path. join ( os. getcwd ( ), config ['paths'] ['output'], d ['name'],'data. csv') for d in config ['sources'] ] # generate a data frame with all indicators df = pd. concat ( ( pd. read _ csv ( f ) for f in sources ), sort = false, ignore _ index = tr... | [
0.025635408237576485,
-0.010782896541059017,
0.48815640807151794,
-0.6496663093566895,
-0.42013734579086304,
0.3836067020893097,
-0.07256466895341873,
-0.1432628333568573,
-0.47004690766334534,
0.22276665270328522,
0.5453387498855591,
0.5628066658973694,
0.5810571312904358,
0.1274146735668... |
def build _ row ( table, cols ) : class datarow : " " " generic data row class, specialized by surrounding function " " " def _ _ init _ _ ( self, data ) : " " " uses data and column names to inject attributes " " " assert len ( data ) = = len ( self. cols ) for colname, dat in zip ( self. cols, data ) : setattr ( self... | [
-0.13393601775169373,
0.45094025135040283,
0.7614260315895081,
-0.13493287563323975,
-0.6827463507652283,
-0.03977658599615097,
-0.7994150519371033,
-0.11242646723985672,
-0.4025655686855316,
-1.038427710533142,
0.18454290926456451,
0.14565494656562805,
0.9638347625732422,
0.29448825120925... |
def getarchivedgame ( self, id ) : return self. getgame ( id, self. game _ type _ archive ) | [
-0.20805512368679047,
-0.0216636061668396,
0.4572822153568268,
-0.034132812172174454,
0.3273029923439026,
-0.029098782688379288,
-1.4902547597885132,
-0.7012555003166199,
0.449707567691803,
0.5844641923904419,
0.33139222860336304,
0.9691919684410095,
-0.28772035241127014,
-0.02536009810864... |
def load _ features ( names, data = none, side = none, bool _ val = false, exercise = " shoulderpress " ) : output1 = [ ] # list of upper arm torso angles output2 = [ ] # list of forearm upper arm angles for filename in names : if not bool _ val : ps = load _ ps ( f " poses _ compressed / { exercise } / " + filename ) ... | [
-0.5091238021850586,
-0.28249695897102356,
1.0775766372680664,
0.18890725076198578,
-0.09688294678926468,
-0.18747226893901825,
0.2145826816558838,
0.42015573382377625,
0.18313108384609222,
0.1848529726266861,
-0.68160080909729,
0.15350060164928436,
-0.4131737947463989,
0.07005246728658676... |
def process _ rtetripid ( rowlist, bustrplen, fulldate ) : " " " this method has been further improved as some times different routes are assigned to same trajectories " " " predict = { } tripdict = { } act _ tripdict = { } stime = none ; etime = none try : for row in rowlist : [ acttime, vel, rte, str, end, trpn ] = r... | [
-0.5979395508766174,
-0.42223021388053894,
0.6985629796981812,
-0.8483754992485046,
-0.47248396277427673,
-0.0739285796880722,
-0.32412365078926086,
0.10928699374198914,
-0.27797451615333557,
0.7730704545974731,
-0.454942524433136,
-0.401007741689682,
0.316601425409317,
0.7105131149291992,... |
def metrics ( self, y _ predicted, y _ true, metrics ) : results = { } for metric in metrics : metric _ str = metric. _ _ name _ _ metric _ score = metric ( ). score ( y _ predicted, y _ true ) print ( " % s : % f " % ( metric _ str, metric _ score ) ) results [ metric _ str ] = metric _ score return results | [
-0.42623624205589294,
-0.06504034996032715,
0.3843080997467041,
0.3495798408985138,
-0.39404869079589844,
0.5284762382507324,
-0.10984325408935547,
-0.2987534999847412,
-1.6542819738388062,
0.43475666642189026,
-0.46037185192108154,
-0.33011290431022644,
0.4184797406196594,
0.2731522619724... |
def get _ db _ type ( self ) : return self. db _ type | [
-0.27834194898605347,
1.4120839834213257,
0.3588947355747223,
0.9074141979217529,
1.2541298866271973,
0.5329954624176025,
0.24453280866146088,
-0.13473926484584808,
0.3916824460029602,
-0.31209972500801086,
-0.10548986494541168,
1.006577968597412,
-1.8487086296081543,
0.6813267469406128,
... |
def main ( ) : open ( log _ file,'w'). close ( ) logging. basicconfig ( filename = log _ file, level = logging. info, format ='% ( asctime ) s % ( message ) s') logging. info ( " stockwatcher - start program " ) stock _ list = [ " msft ", " goog ", " aapl ", " amzn " ] for i in range ( len ( stock _ list ) ) : stock = ... | [
0.6027337312698364,
-0.5381948351860046,
0.7485498785972595,
0.7324502468109131,
1.2235918045043945,
0.36502397060394287,
0.8917884826660156,
-0.5283987522125244,
-0.8680476546287537,
0.01727668195962906,
-0.21518690884113312,
0.9692152738571167,
-0.5505214929580688,
1.0060147047042847,
... |
def _ flatten _ params ( params ) : def get _ string ( value ) : if isinstance ( value, six. text _ type ) : return value. encode ('utf8') elif isinstance ( value, six. binary _ type ) : return value else : return six. ensure _ binary ( str ( value ) ) param _ list = [ ] for key, value in six. iteritems ( params ) : ke... | [
-1.1031924486160278,
-0.42601555585861206,
0.5131620764732361,
-0.17850598692893982,
0.01820138469338417,
-0.09431160241365433,
-0.3886714279651642,
0.02133355848491192,
-0.4298538863658905,
1.175126075744629,
-0.10300812870264053,
0.05917852744460106,
-0.839722752571106,
0.864046156406402... |
def _ solve ( self ) : raise notimplementederror ( " this is just an abstract interface " ) | [
-0.9116529822349548,
0.1477305293083191,
0.6220031380653381,
0.04978431388735771,
0.4606507420539856,
0.632119357585907,
0.3476353883743286,
-0.5295866131782532,
-0.34233298897743225,
-0.3116423487663269,
-0.26496967673301697,
-0.8395488858222961,
0.169505774974823,
0.33830535411834717,
... |
def write _ to _ file ( self, filename ) : assert ". json " in filename import json hstrings = { } for band, exps in self. headers. items ( ) : hstrings [ band ] = { } for expid, hdr in exps. items ( ) : hstrings [ band ] [ expid ] = hdr. tostring ( ) with open ( filename, " w " ) as f : json. dump ( hstrings, f ) if l... | [
-0.6278480291366577,
-1.2817193269729614,
0.6150000095367432,
-0.8332110643386841,
0.6606885194778442,
0.2185763269662857,
0.061149269342422485,
0.09645617753267288,
-0.34753313660621643,
0.027185624465346336,
0.08660496026277542,
0.21655060350894928,
0.40751326084136963,
0.856349050998687... |
def get _ ranked _ local _ names ( self, top _ k = none ) : if self. is _ local _ sparse : return _ sparse _ order _ imp ( self. _ local _ importance _ values, values _ type = _ features, features = self. _ features, top _ k = top _ k ) else : if self. _ features is not none : self. _ ranked _ local _ names = _ sort _ ... | [
-0.11195453256368637,
-0.501417338848114,
0.8254073858261108,
0.15853968262672424,
0.22110068798065186,
0.15090781450271606,
0.08974268287420273,
0.4389617145061493,
0.057784296572208405,
0.125962033867836,
-0.37009933590888977,
1.2859034538269043,
0.3741067349910736,
0.08124879002571106,
... |
def get _ rows ( t _ id ) : data = pd. read _ excel ( " sample. xlsx " ) for r in range ( data. shape [ 0 ] ) : if data. at [ r, " territory number " ] = = t _ id : yield { " address " : data. at [ r, " address " ], " donotcall " : data. at [ r, " status " ] = = " do not call ", " coords " : [ data. at [ r, " latitude ... | [
0.04253732040524483,
0.41159409284591675,
0.6023291945457458,
-1.661273717880249,
-0.801369845867157,
-0.13693569600582123,
-1.5784329175949097,
-0.4299732744693756,
-0.21009370684623718,
0.3609239459037781,
0.15185140073299408,
-0.1531551629304886,
0.9846049547195435,
-0.05002469941973686... |
def test _ mixed _ rebalance ( self ) : super ( rebalancetests, self ). test _ eperf _ mixed ( ) | [
0.46459683775901794,
-0.4721723794937134,
0.4318786561489105,
0.1767049878835678,
1.6742889881134033,
1.3489772081375122,
0.6860856413841248,
0.04831409081816673,
1.1102505922317505,
-0.6046880483627319,
-0.08918828517198563,
-0.6051339507102966,
-1.161370038986206,
0.5607049465179443,
0... |
def get _ name ( self ) : return " test _ func _ { } _ { } _ { } ". format ( self. func, self. farg, self. invoke ) | [
0.24358563125133514,
-1.0126957893371582,
0.6288668513298035,
-0.6170549392700195,
0.3318603038787842,
-0.47804778814315796,
0.5853660702705383,
-0.18989190459251404,
-0.7823176980018616,
-0.20423290133476257,
0.1861926168203354,
0.9106661081314087,
-0.46102452278137207,
0.2269023209810257... |
def _ isparamsequal ( self, params0, params1 ) : if params0 = = params1 : return true elif params0 is none or params1 is none : return false try : dict0 = parse _ qs ( params0 ) dict1 = parse _ qs ( params1 ) for param in dict0 : if param not in dict0. keys ( ) : return false val0 = dict1 [ param ] [ 0 ] val1 = dict0 [... | [
-0.40228578448295593,
-1.1507023572921753,
0.753494918346405,
-0.44094622135162354,
-0.11717099696397781,
0.31651365756988525,
-1.241111159324646,
-0.004534602165222168,
-0.7228139042854309,
0.55009526014328,
-0.43237224221229553,
0.33631038665771484,
-0.48210880160331726,
1.20279777050018... |
def init _ data ( self ) : return self. _ convert _ to _ list ( self. _ init _ data ) | [
-1.5370287895202637,
-0.658937931060791,
0.43861275911331177,
0.11758456379175186,
0.37775740027427673,
0.32161304354667664,
-1.201646327972412,
0.2679421901702881,
0.3379426896572113,
0.2749577760696411,
-1.6862444877624512,
0.6201601624488831,
0.3286595046520233,
0.4235500693321228,
-0... |
def check _ timeout ( self ) - > bool : if self. _ last _ change : return self. auto _ off _ time < time. time ( ) - self. _ last _ change else : return false | [
0.04518600180745125,
0.11792527884244919,
0.6946780681610107,
0.06759002059698105,
-0.5788686871528625,
0.1736014187335968,
-0.45632651448249817,
-0.07122739404439926,
-0.45910826325416565,
0.6414951086044312,
0.5807175636291504,
0.44325828552246094,
-0.45257851481437683,
0.367157965898513... |
def expand _ pattern ( patt ) : # patt = patt. replace ('[ ] ', r'\') for alias in regex _ aliases : patt = expand _ charclass ( patt, alias ) return patt | [
0.29291337728500366,
0.2884843647480011,
0.6176546812057495,
-0.6989026069641113,
0.3605503439903259,
0.6924023032188416,
0.2616202235221863,
0.6056355834007263,
0.7269603610038757,
-0.09296122193336487,
-0.0868944525718689,
0.24387408792972565,
0.6842561960220337,
0.0944768637418747,
0.... |
def _ update _ probability ( self, probability ) : self. _ log _ odds + = math. log ( probability / ( 1 - probability ) ) | [
-0.7858357429504395,
-0.07303041219711304,
0.5810554623603821,
0.014409707859158516,
-0.5942660570144653,
1.0025895833969116,
-0.5013545751571655,
-0.021768873557448387,
0.2241048514842987,
0.4111264944076538,
0.6336700916290283,
0.07612667977809906,
-0.6277069449424744,
-0.278272390365600... |
def rec _ jacobi ( n, a, b ) : from scipy. special import gamma nu = ( b - a ) / float ( a + b + 2 ) mu = 2 * * ( a + b + 1 ) * gamma ( a + 1 ) * gamma ( b + 1 ) / gamma ( a + b + 2 ) if n = = 1 : alpha = nu beta = mu else : n = np. arange ( 1. 0, n ) nab = 2 * n + a + b alpha = np. hstack ( ( nu, ( b * * 2 - a * * 2 )... | [
0.013424385339021683,
-0.5916934609413147,
0.7260648608207703,
-0.5600976943969727,
0.0034559350460767746,
-0.33180519938468933,
0.29461467266082764,
-0.4649182856082916,
-0.47071442008018494,
0.4571627378463745,
-0.4351945221424103,
0.025922801345586777,
-0.3733421862125397,
0.29422575235... |
def verify _ entry _ roundtrip ( crud _ client, entryx, result _ acc ) : entryxsv = crud _ client. create _ entry ( entryx ) result _ acc. add _ report _ line ( " posted entry : " + str ( entryxsv ) ) if entryxsv is none : result _ acc. add _ report _ line ( " create entry x failed " ) result _ acc. set _ success ( fal... | [
0.22283847630023956,
0.16739521920681,
0.6401858329772949,
-0.12653745710849762,
1.2757833003997803,
0.21836940944194794,
-0.07194584608078003,
-1.0014817714691162,
0.6650869250297546,
-0.5664881467819214,
0.008182222954928875,
0.6517391204833984,
-0.19671693444252014,
0.22513186931610107,... |
async def to _ core _ openapi _ request ( request : web. request ) - > openapirequest : body : union [ bytes, str, none ] = none if request. body _ exists and request. can _ read _ body : raw _ body = await request. read ( ) # if it possible, convert bytes to string try : body = raw _ body. decode ( " utf - 8 " ) # if ... | [
-1.008175015449524,
-0.3262200653553009,
0.5006252527236938,
-0.9848267436027527,
-0.28574350476264954,
-0.37429800629615784,
-0.4935407042503357,
-0.7154127955436707,
0.8580579161643982,
0.5574391484260559,
0.4632413983345032,
0.23180244863033295,
-0.6174979209899902,
-0.22275394201278687... |
def render _ to _ reportlab _ canvas ( rl _ canvas, papersize _ tuple, manager ) : rl _ canvas. setpagesize ( papersize _ tuple ) manager. render ( datatypes. rectangle ( 0, 0, * papersize _ tuple ), dict ( output = rl _ canvas ) ) | [
-0.23469744622707367,
0.3123452663421631,
0.41606810688972473,
-1.404313325881958,
0.3667020797729492,
0.6680828928947449,
-0.24626657366752625,
-0.5197845697402954,
0.359431654214859,
0.0255813580006361,
0.35891857743263245,
-0.7098745107650757,
-0.39188656210899353,
-0.007544465828686953... |
def fit _ online ( self, x, y ) : if len ( x. shape ) = = 1 : x = x. reshape ( 1, - 1 ) self. y _ train = np. concatenate ( ( self. y _ train, y ), axis = 0 ) if self. x _ train is none : self. fit ( x, y ) else : initial _ size = self. x _ train. shape [ 0 ] self. x _ train = np. concatenate ( ( self. x _ train, x ), ... | [
-0.11102700978517532,
-0.2347983568906784,
1.0016077756881714,
1.1110057830810547,
0.24722975492477417,
-0.43743187189102173,
-0.9238169193267822,
0.7438230514526367,
-0.405480295419693,
-0.1456538587808609,
0.27204078435897827,
0.1572161763906479,
-0.4325776994228363,
0.47882071137428284,... |
def read ( self, file _ name ) : return self. zip. read ( file _ name ) | [
-0.5860714912414551,
-1.0594701766967773,
0.4859226644039154,
-0.0966062918305397,
-0.42870375514030457,
-0.09973069280385971,
-0.5088714957237244,
0.2625662386417389,
-0.7802311778068542,
-0.15193434059619904,
0.7294739484786987,
-0.450179785490036,
-0.1976975053548813,
-0.905488848686218... |
def run ( self ) : def callback ( message ) : if not message is none : # convert bytes to string and slice string # http : / / stackoverflow. com / questions / 663171 / is - there - a - way - to - substring - a - string - in - python json _ string = str ( message. data ) [ 3 : - 2 ] json _ string = json _ string. repla... | [
-0.12814775109291077,
-0.26689040660858154,
0.8232825994491577,
-0.17460519075393677,
-0.13422241806983948,
-0.09227937459945679,
0.35050278902053833,
-0.17977261543273926,
0.31652218103408813,
0.06716197729110718,
0.19290846586227417,
0.5347391963005066,
-0.625889778137207,
0.021541032940... |
def gethtml ( year ) : return requests. get ( url. replace ('% year % ', str ( year ) ) ). text. encode ('utf - 8') | [
-0.5474128723144531,
0.4342347979545593,
0.4246843457221985,
0.07174646109342575,
-1.250166416168213,
0.35970431566238403,
-1.1827528476715088,
0.2724360227584839,
1.111274242401123,
0.6242544651031494,
0.139476478099823,
0.36383256316185,
-0.3011340796947479,
-0.2936411201953888,
0.3537... |
def read _ phrases ( self ) : base _ dir = os. path. abspath ( os. getcwd ( ) ) file _ path = os. path. join ( base _ dir, self. phrases _ file ) with open ( file _ path, " r ", encoding = " utf - 8 " ) as f : self. logger. info ( f " { self. phrases _ file } is read " ) return json. load ( f ) | [
-0.2037954181432724,
-1.4330143928527832,
0.5897788405418396,
-1.6510324478149414,
-0.600964367389679,
0.6556094288825989,
-0.7443520426750183,
-0.18545842170715332,
-0.4297879636287689,
0.8879916667938232,
0.22668753564357758,
0.02170724608004093,
-0.9604038596153259,
-0.6638231873512268,... |
def out _ waiting ( self ) : if not self. is _ open : raise serialutil. portnotopenerror return self. command _ queue. qsize ( ) | [
-0.5084714889526367,
0.3997684419155121,
0.5386592745780945,
-0.7894579172134399,
-0.25076454877853394,
0.06232329457998276,
0.2306368499994278,
0.2532821595668793,
-0.40127766132354736,
-1.1574996709823608,
0.17056016623973846,
0.06955617666244507,
-0.39153918623924255,
-0.100216649472713... |
def load _ config _ key ( ) : global api _ token try : api _ token = os. environ ['fulbito _ cli _ api _ token'] except keyerror : home = os. path. expanduser ( " ~ " ) config = os. path. join ( home, ". fulbito. ini " ) if not os. path. exists ( config ) : with open ( config, " w " ) as cfile : key = get _ input _ key... | [
-0.40716657042503357,
-0.35523802042007446,
0.7017311453819275,
-0.022774476557970047,
-0.0054834745824337006,
-0.5440871715545654,
0.6555922627449036,
0.3773091733455658,
-1.3548203706741333,
0.49321046471595764,
-0.5516377091407776,
-0.13472412526607513,
-0.6532832980155945,
0.0192818529... |
async def xp ( self, ctx, *, member = none, xpamount : int = none ) : author = ctx. message. author server = ctx. message. server channel = ctx. message. channel usage ='usage : ` $ xp [ role / member ] [ amount ] `'isrole = false if member = = none : await self. bot. send _ message ( ctx. message. channel, usage ) ret... | [
0.06608711183071136,
0.5095935463905334,
1.0455188751220703,
0.1586860716342926,
-0.626684308052063,
-0.3961598575115204,
-0.47553274035453796,
-0.5550525188446045,
0.4219812750816345,
0.03335531800985336,
0.0783693939447403,
0.7714368104934692,
-1.1402355432510376,
0.4273312985897064,
0... |
def run _ test _ login _ required ( self ) : response = client ( ). get ( self. url ) self. assertequal ( response. status _ code, 302 ) | [
-0.5286862254142761,
-0.20834949612617493,
0.3117196559906006,
0.2548086643218994,
0.6392368674278259,
2.157966136932373,
0.5036989450454712,
-0.1487654447555542,
0.05423339456319809,
-1.4525175094604492,
-0.24935488402843475,
0.7924386262893677,
-0.09285537153482437,
-0.6959635615348816,
... |
def match _ semantic _ types ( self, mapping _ term _ dict ) : mapping _ result = [ ] position _ list = [ ] # set the semantic types list for concept _ name, info in mapping _ term _ dict. items ( ) : source _ set = list ( set ( info [ 2 ] ) ) # check if the term is needed and matched semantic _ type _ needed = self. c... | [
-0.9990079402923584,
-0.4221002161502838,
0.5927239060401917,
-0.32397201657295227,
-0.19548211991786957,
-0.16287870705127716,
-0.26316145062446594,
0.5840281844139099,
0.2166820764541626,
0.6076452136039734,
0.18584021925926208,
-0.8570359349250793,
0.2239837944507599,
0.4658623039722442... |
def get _ incomplete _ variables ( ) : pass | [
-0.3510805666446686,
-1.356109619140625,
0.38948363065719604,
0.738501250743866,
-0.13082687556743622,
-0.24838176369667053,
0.8672938346862793,
-0.8524390459060669,
-0.7162516713142395,
-0.3750573992729187,
-0.9617655873298645,
0.3319973945617676,
-0.9991226196289062,
0.3437387943267822,
... |
async def setxp ( self, ctx, *, member = none, xpamount : int = none ) : author = ctx. message. author server = ctx. message. server channel = ctx. message. channel isadmin = author. permissions _ in ( channel ). administrator # only allow admins to change server stats if not isadmin : await self. bot. send _ message (... | [
0.3122374415397644,
0.20679700374603271,
0.7833870649337769,
0.18409673869609833,
-0.3334725499153137,
0.17678575217723846,
-0.6451855897903442,
-0.37695297598838806,
0.6131349205970764,
0.229921355843544,
-0.8218862414360046,
1.0445146560668945,
-1.3179173469543457,
0.30852019786834717,
... |
def test _ get _ success _ url ( self ) : self. assertequal ( profilecreateview ( ). get _ success _ url ( ), reverse ('tasks : home') ) | [
0.626827597618103,
0.8096967339515686,
0.18984633684158325,
1.4402390718460083,
0.9612104296684265,
1.0752806663513184,
0.8371601700782776,
-0.08889253437519073,
-0.44503793120384216,
-1.0219024419784546,
-0.6404857635498047,
0.11676282435655594,
0.7892223000526428,
-0.26141008734703064,
... |
def _ getdimsfromfixedshape ( shape : schema _ pb2. fixedshape ) - > list [ int ] : return [ dim. size for dim in shape. dim ] | [
0.16185113787651062,
0.2873166799545288,
0.20364020764827728,
0.5015813708305359,
0.4565559923648834,
0.2813037037849426,
0.23407399654388428,
0.0004215879016555846,
0.11650718748569489,
-0.21813474595546722,
-1.281840205192566,
-0.2576735019683838,
0.25347790122032166,
0.9969745874404907,... |
def go _ home ( ) : return render _ template ( " homepage. html " ) | [
0.8359789848327637,
0.6193189024925232,
0.30123451352119446,
1.0512815713882446,
1.0201566219329834,
-0.08616475015878677,
0.017307043075561523,
0.6962288618087769,
-0.4196080267429352,
1.4520645141601562,
0.19090355932712555,
-0.26501280069351196,
-0.5584003329277039,
-0.17836804687976837... |
def save ( self ) : vals = [ ] sets = [ ] for f in self. columns : vals. append ( getattr ( self, f ) ) sets. append ( " % s = % s " ) if self. id > 0 : sql = " update % s set ", ", ". join ( sets ), " where id = % s " % ( self. table, self. id ) else : # sql = " insert into % s ( ", ", ". join ( self. columns ), " ) v... | [
-0.626545786857605,
0.21003009378910065,
0.6742051839828491,
0.4689962565898895,
0.12040212750434875,
0.06295425444841385,
0.07459515333175659,
-0.30701085925102234,
-0.7278503179550171,
0.17048883438110352,
-0.6679524183273315,
-1.0820695161819458,
-0.5189272165298462,
0.6969239711761475,... |
def _ _ init _ _ ( self, connect : callable [ [ ], leapprotocol ] ) : self. devices : dict [ str, dict ] = { } self. buttons : dict [ str, dict ] = { } self. lip _ devices : dict [ int, dict ] = { } self. scenes : dict [ str, dict ] = { } self. occupancy _ groups : dict [ str, dict ] = { } self. areas : dict [ str, dic... | [
-0.48551487922668457,
0.22194188833236694,
0.6777819395065308,
-0.5972055196762085,
-0.5599801540374756,
-0.529320478439331,
-0.6267615556716919,
-0.36173564195632935,
-0.23708973824977875,
-0.5180273056030273,
-0.7270945906639099,
-0.6477444171905518,
0.5570603609085083,
0.282259583473205... |
def user _ stats ( df, city ) : print ('\ ncalculating user stats... \ n') start _ time = time. time ( ) # to do : display counts of user types cus, sub = df. groupby ( ['user type'] ). size ( ) print ('users counts : customer, subscriber ', cus, sub ) # to do : display counts of gender if city. lower ( )! ='washington... | [
0.22940212488174438,
1.0945020914077759,
0.691760778427124,
-0.30279314517974854,
-0.7635914087295532,
0.4460669457912445,
1.3688464164733887,
-1.0005831718444824,
-0.4269617795944214,
-0.6048181056976318,
0.053912512958049774,
0.8632451891899109,
0.5113930106163025,
0.20419706404209137,
... |
def _ _ init _ _ ( self, master = none ) : super ( ). _ _ init _ _ ( master ) self. createwidgets ( ) # configure the frame's resize behaviour master. columnconfigure ( 0, weight = 1 ) master. rowconfigure ( 0, weight = 1 ) self. grid ( sticky = ( n, s, e, w ) ) # configure resize behaviour for the frame's children sel... | [
0.3926596939563751,
1.1239819526672363,
0.7395939230918884,
0.7005478143692017,
-0.6752827167510986,
-0.9461451768875122,
0.3953953981399536,
0.6212762594223022,
0.5326665639877319,
-0.3756260871887207,
-0.814739465713501,
-0.8480076193809509,
-0.26401349902153015,
1.9952625036239624,
0.... |
def get _ ordered _ ckpts _ by _ dbname ( sess, imdb _ name, net _ name, save _ epoch = true ) : # find previous snapshots if there is any to restore from ckpts _ dir = cfg. get _ ckpts _ dir ( net _ name, imdb _ name ) if save _ epoch : save _ interval ='epoch'else : save _ interval ='iter'sfiles = os. path. join ( ck... | [
0.3919558525085449,
0.8984711170196533,
0.7927209734916687,
0.676530122756958,
0.19294986128807068,
-0.46984344720840454,
0.017231890931725502,
0.09364297240972519,
-0.12118875235319138,
1.3243008852005005,
-0.15761876106262207,
-0.3250987231731415,
0.09337443113327026,
0.12492096424102783... |
def hand _ positions ( hour, minute, second ) : r _ 60 = sym. rational ( 60, 1 ) return ( 360 * ( hour + minute / r _ 60 + second / ( r _ 60 * r _ 60 ) ) / 12, 360 * ( minute + second / r _ 60 ) / r _ 60, 360 * second / r _ 60 ) | [
-0.13282857835292816,
-0.39247360825538635,
0.5790110230445862,
-0.21917377412319183,
0.32407259941101074,
0.4125480651855469,
-0.8310692310333252,
-0.3620092272758484,
-0.6161960959434509,
0.023098958656191826,
-0.6914216876029968,
-0.911104679107666,
-0.11780194193124771,
-0.000170447616... |
def _ update _ ic ( self ) : return self | [
-0.44189196825027466,
-1.4781497716903687,
0.22851701080799103,
-0.019411571323871613,
-1.3872684240341187,
0.22931315004825592,
0.6663703322410583,
-0.44278544187545776,
0.09859726577997208,
0.2917364239692688,
0.365136981010437,
-0.30902430415153503,
-0.8030202984809875,
-1.4292975664138... |
def get _ angle _ max ( filename = " aaf _ map. yaml ", suppress _ message = false ) : tic = time. time ( ) # turn off warnings pd. options. mode. chained _ assignment = none # default ='warn'context = get _ context ( filename, suppress _ message = true ) adjacent = get _ adjacent ( filename, suppress _ message = true ... | [
-0.1722729206085205,
-0.2287372201681137,
0.7172192335128784,
-0.2855382561683655,
-0.38268083333969116,
-0.24322150647640228,
0.05401167273521423,
0.4261639714241028,
-0.799886167049408,
1.1059434413909912,
0.15656112134456635,
0.2506202757358551,
0.17685773968696594,
-0.04058044031262398... |
def test _ basic _ tuple ( ) : ver = _ version. version ( " 1. 2. 3 ", false, 4 ) assert ver = = ( 1, 2, 3 ) ver = _ version. version ( " 1. 2. 3 ", true, 4 ) assert ver = = ( 1, 2, 3 ) ver = _ version. version ( " 1. 2 ", true, 4 ) assert ver = = ( 1, 2, 0 ) | [
-1.2175710201263428,
-0.019271235913038254,
0.3864094614982605,
0.10908786207437515,
0.0764084979891777,
0.7355772852897644,
-0.117537721991539,
-0.04289691150188446,
-0.8658173084259033,
0.5540088415145874,
-1.5536335706710815,
-1.8242416381835938,
-0.306001216173172,
-0.926338255405426,
... |
def _ _ messages ( self, dump ) : return sum ( [ elem [ 1 ] for elem in dump ], [ ] ) | [
-1.6957539319992065,
0.13878725469112396,
0.38167884945869446,
-1.2067232131958008,
0.5095282196998596,
-0.3304700553417206,
0.21266649663448334,
-0.37041717767715454,
0.7373840808868408,
0.1289004236459732,
-1.222733497619629,
-0.15758955478668213,
-0.12135165184736252,
0.7873758673667908... |
async def delete ( self, path, confirm _ delete = 0, * * kwargs ) : if path. is _ root : if not confirm _ delete = = 1 : raise exceptions. deleteerror ('confirm _ delete = 1 is required for deleting root provider folder ', code = 400 ) if path. is _ file : query _ parameters = {'bucket': self. bucket. name,'key': path.... | [
-0.4190029799938202,
0.6127755641937256,
0.8133927583694458,
1.5833598375320435,
0.2959730625152588,
0.026547055691480637,
0.2960813343524933,
-0.12672464549541473,
0.3612881600856781,
0.14623373746871948,
0.10854049026966095,
0.39105212688446045,
-0.7390830516815186,
0.37956783175468445,
... |
def test _ delete _ artifact _ dep ( self ) : pass | [
0.6319324374198914,
-0.452157586812973,
0.06252826750278473,
0.6002988815307617,
0.07202278822660446,
0.6118301749229431,
2.1057446002960205,
0.048558998852968216,
0.8643457889556885,
-0.585918664932251,
-0.2722623646259308,
-0.08315038681030273,
0.32132044434547424,
-0.17584532499313354,
... |
def least _ squares _ sgd ( y, tx, initial _ w, max _ iters, gamma ) : n = int ( y. shape [ 0 ] ) w0 = initial _ w for n _ iters in range ( max _ iters - 1 ) : i = np. random. randint ( 0, n ) w0 = least _ squares _ gd ( y [ i : i + 1 ], tx [ i : i + 1 ], w0, 1, gamma, computeloss = false ) i = np. random. randint ( 0,... | [
0.23947180807590485,
-0.2011854648590088,
0.7418776750564575,
-0.6773779988288879,
-0.9457592964172363,
-0.11870044469833374,
0.3076382577419281,
-0.6159194111824036,
0.1431015580892563,
0.928836464881897,
0.7865042090415955,
0.7202005982398987,
-0.10047324001789093,
1.2116724252700806,
... |
def init _ deep _ collection ( dim, n, num _ boxes _ per _ step, num _ cells, rng, betas = none ) : lhs = [ [ ] ] deep _ ps _ collection = [ ] deep _ cs _ collection = [ ] for i in range ( num _ boxes _ per _ step ) : l, h = choose _ cell ( rng, num _ cells = num _ cells, d = dim ) rng, _ = random. split ( rng, 2 ) lhs... | [
-1.0996454954147339,
0.5534846186637878,
0.6818844079971313,
0.5805438756942749,
0.09497548639774323,
0.42201611399650574,
0.0635555237531662,
-0.2781887352466583,
-0.9678076505661011,
-0.22528521716594696,
-0.8668797016143799,
0.1751893311738968,
0.11837021261453629,
0.8954175710678101,
... |
def install _ requires ( dev = false ) : try : cfg = configparser ( ) cfg. read ('pipfile') section _ name = " % spackages " % ( " dev - " if dev else " " ) requires = [ _ compact _ ver ( name, cfg. get ( section _ name, name ) ) for name in cfg. options ( section _ name ) ] if not dev : with open ( " requirements. txt... | [
-0.5393003821372986,
-0.549008846282959,
0.5078845024108887,
0.9285387396812439,
0.0004857410385739058,
0.6750035285949707,
-0.22346088290214539,
0.28092238306999207,
-0.07024364173412323,
1.0721323490142822,
-0.40489858388900757,
-1.266037940979004,
-0.06756722927093506,
1.467869281768798... |
def embed ( self, * * kwargs ) : all _ embeddings _ out = [ ] for k, embedding in self. embeddings. items ( ) : x = kwargs. get ( k, none ) embeddings _ out = embedding. encode ( x ) all _ embeddings _ out. append ( embeddings _ out ) word _ embeddings = tf. concat ( values = all _ embeddings _ out, axis = 2 ) return t... | [
-0.5035566091537476,
0.963430643081665,
0.5649570822715759,
0.42203500866889954,
-0.32503706216812134,
0.5897395610809326,
-0.3782307505607605,
0.0858331248164177,
0.021082481369376183,
0.37716054916381836,
0.15368516743183136,
-0.3244316577911377,
-0.5135179162025452,
-0.03006238490343094... |
def value _ at ( self, index ) : if index > = self. size : raise indexerror ( " list index out of range " ) current = self. head for num in range ( index ) : current = current. next return current. data | [
-0.6443053483963013,
0.4772911071777344,
0.42824554443359375,
-0.41145655512809753,
0.3223239779472351,
0.2626968324184418,
-0.13800999522209167,
-1.090717077255249,
0.46594977378845215,
-0.8387021422386169,
-0.5192246437072754,
0.9167982935905457,
-0.14115343987941742,
0.04038415849208832... |
def cmp _ content _ response ( self, datafile, system _ name, response, expected _ api _ response, expected _ response _ type, comparison _ mode ) : if expected _ response _ type in response. headers ['content - type'] : extracted _ response = response. content if comparison _ mode : path _ list = [ comparison _ mode ]... | [
-0.08024905622005463,
-1.4327718019485474,
0.7845022678375244,
-0.4032227098941803,
0.45545896887779236,
0.4597349762916565,
0.09452804177999496,
-0.39885473251342773,
0.14853189885616302,
-0.014923195354640484,
0.0037412780802696943,
-0.5284453630447388,
-0.7315269112586975,
-0.3312900066... |
def plot _ progress ( train _ progress, devel _ progress, out _ filename = none ) : fig, ax1 = plt. subplots ( figsize = ( 8, 6 ), dpi = 100 ) ax1. plot ( train _ progress ['steps'], train _ progress ['ccr'],'b ', label ='training set ccr') ax1. plot ( devel _ progress ['steps'], devel _ progress ['ccr'],'r ', label ='... | [
0.40469545125961304,
0.42477089166641235,
0.9922765493392944,
-0.274646520614624,
-0.7975732088088989,
0.5122537016868591,
0.6061959266662598,
0.2423635721206665,
-0.8492940664291382,
-0.21209317445755005,
-0.0243317149579525,
0.16492120921611786,
0.4503665268421173,
0.42104098200798035,
... |
def get _ subset ( container, subset _ bounds ) : subset = [ ] for bound in subset _ bounds : subset + = container [ bound [ 0 ] : bound [ 1 ] ] return subset | [
0.41780194640159607,
-1.1147117614746094,
0.4123954772949219,
1.0229179859161377,
0.19424161314964294,
0.221185564994812,
-0.7107508778572083,
-0.6684678196907043,
-0.5291829109191895,
0.1310472935438156,
-0.2998286783695221,
1.113372564315796,
0.5599600076675415,
-1.0323007106781006,
0.... |
def convert _ opi _ gate2node ( verilog _ path, opi _ path, out _ path ) : gate2node, node2gate = convert _ gate _ node ( verilog _ path ) infile _ op = open ( opi _ path ) outfile = open ( out _ path, " w " ) for line in infile _ op : words = line. strip ( ). split ( ) gate = words [ 3 ]. split ( " / " ) [ 0 ] node = ... | [
0.21895676851272583,
-1.0340815782546997,
0.7235908508300781,
-0.12037727236747742,
-0.09013334661722183,
0.3730636239051819,
0.6037442088127136,
0.1458480954170227,
-0.6317710280418396,
1.538896918296814,
-0.35798099637031555,
0.8141703009605408,
-0.262717604637146,
-0.6624264121055603,
... |
def delete _ inbox _ message ( ser, index ) : ser. write ('at + cmgd = % s \ r'% index ) res = wait _ for _ strs ( ser, ['ok ','error'] ) if'error'in res : return false return true | [
-0.7622430920600891,
-0.03871455416083336,
0.4782809913158417,
-0.2953495383262634,
-0.02864450216293335,
0.5637186169624329,
-0.4764997661113739,
-0.9906097650527954,
0.1564997434616089,
-0.3758145570755005,
-0.08362580090761185,
0.43913179636001587,
-1.6907416582107544,
-0.67361027002334... |
def read _ train _ dir ( train _ dir ) : train _ dir _ imgs = list ( ) train _ dir _ labels = list ( ) img _ dirs = [ " grass ", " ocean ", " redcarpet ", " road ", " wheatfield " ] for fil in os. listdir ( train _ dir ) : if fil in img _ dirs : images, labels = find _ images ( train _ dir + " / " + fil, fil ) train _ ... | [
-1.726339340209961,
-0.1253965198993683,
0.5772255659103394,
-0.3820854127407074,
0.072822205722332,
0.013095765374600887,
0.7712532877922058,
0.08146589249372482,
-0.4903533160686493,
0.6323638558387756,
-0.047283876687288284,
0.10058743506669998,
0.6987830400466919,
0.6023710370063782,
... |
def export _ spec ( ns _ builder, new _ data _ types ) : if len ( new _ data _ types ) = = 0 : warnings. warn ( " no data types specified. exiting. " ) return if ns _ builder. name is none : raise runtimeerror ( " namespace name is required to export specs " ) project _ dir = os. path. abspath ( os. path. join ( os. pa... | [
0.5120155215263367,
0.2315177470445633,
0.7786086201667786,
0.6089911460876465,
-0.08197073638439178,
0.41507187485694885,
-0.10689006745815277,
-0.19528906047344208,
0.16734081506729126,
0.5074307918548584,
-0.10582976043224335,
0.8898516297340393,
0.26094740629196167,
0.6252564191818237,... |
def test _ create _ user ( self ) : url = reverse ('user - create') data = {'username':'chet ','password':'chet ','email':'chet @ chethall. com ','format':'json'} response = self. client. post ( url, data, format ='json') self. assertequal ( response. status _ code, status. http _ 201 _ created ) self. assertnotequal (... | [
0.453006386756897,
0.6043896079063416,
0.5210567712783813,
0.12122415006160736,
0.7952777743339539,
0.900658130645752,
-0.7525551915168762,
-0.49539920687675476,
-0.461848646402359,
-1.024715781211853,
-0.795317530632019,
-0.3811354637145996,
0.6539481282234192,
-0.20200279355049133,
0.7... |
def get _ uploads ( self, request, field _ name = none, populate _ post = false ) : if hasattr ( request,'_ _ uploads') = = false : request. meta ['wsgi. input']. seek ( 0 ) fields = cgi. fieldstorage ( request. meta ['wsgi. input'], environ = request. meta ) request. _ _ uploads = { } if populate _ post : request. pos... | [
-0.5842602849006653,
0.22296564280986786,
0.6654636859893799,
0.41275081038475037,
0.4611079692840576,
-0.2478402853012085,
-0.46046048402786255,
-0.933482825756073,
-0.5170013904571533,
0.27712351083755493,
-0.22929750382900238,
-0.846834123134613,
-0.28422811627388,
1.4433058500289917,
... |
def delete _ tasks _ by _ name ( self, task _ name ) : return self. delete _ tasks _ by _ name _ async ( task _ name ). get _ result ( ) | [
-0.4410424828529358,
0.7360897064208984,
0.5766746401786804,
1.0088889598846436,
-0.01698969677090645,
-1.1227562427520752,
0.591823160648346,
-0.013814634643495083,
0.22876231372356415,
0.8000800609588623,
-1.2092136144638062,
-0.14926376938819885,
-0.1600571572780609,
0.3018215596675873,... |
def extract _ variables ( self ) : self. var _ map = { } for idx in range ( len ( self. predicates ) ) : for arg _ id, arg in enumerate ( self. predicates [ idx ]. args ) : if is _ variable ( arg ) : if arg in self. var _ map : self. predicates [ idx ]. args [ arg _ id ] = self. var _ map [ arg ] else : new _ arg = sta... | [
-0.43037715554237366,
-0.19071607291698456,
0.49760472774505615,
-0.3464718163013458,
-0.057658299803733826,
-0.382276713848114,
-0.26701101660728455,
1.263861060142517,
-0.5147388577461243,
0.5054746270179749,
-0.336221307516098,
0.5907442569732666,
-0.6053821444511414,
0.8143461346626282... |
def get _ normalized _ probs ( self, net _ output, log _ probs ) : logits = self. get _ logits ( net _ output ) if log _ probs : return utils. log _ softmax ( logits. float ( ), dim = - 1 ) else : return utils. softmax ( logits. float ( ), dim = - 1 ) | [
1.1827410459518433,
-0.32661235332489014,
0.507239580154419,
0.45199668407440186,
-0.43562230467796326,
-0.733849287033081,
-0.7951319813728333,
-0.2528190612792969,
0.3728927969932556,
0.19496269524097443,
0.7640488147735596,
0.025079479441046715,
-0.4551234543323517,
-0.7338606715202332,... |
def place _ symbol ( grid, player, token ) : input _ square = get _ user _ input ( player, token, grid ) grid [ input _ square ] = token return grid | [
-0.9947857856750488,
0.15850895643234253,
0.18542756140232086,
-0.558089017868042,
-0.04672401025891304,
-0.7261967062950134,
0.6166058778762817,
-0.1289762407541275,
-0.38503992557525635,
0.056269194930791855,
-0.8449010252952576,
0.27658167481422424,
-0.12885406613349915,
-0.458846151828... |
def prior ( self, batch _ size, * * kwargs ) : prior = self. reparameterizers [ 0 ]. prior ( batch _ size ) if len ( self. reparameterizers ) > 1 : for reparam in self. reparameterizers [ 1 : ] : prior, _ = reparam ( prior ) return prior | [
-0.29140669107437134,
0.3020392060279846,
0.5901087522506714,
-0.1287500411272049,
-0.01704310066998005,
-0.4657261073589325,
0.35306963324546814,
-0.06561809778213501,
-0.11326534301042557,
-0.4410151541233063,
-0.05537073314189911,
0.3262023627758026,
-0.8003860116004944,
0.7156097292900... |
def change _ paths ( mayafilepath, rootpath, checkexist = false, skippathconfirmation = true, searchformayafiles = false, forceospaths = none, seek = false, passunknownpaths = false ) : logger ( ). info ( " using maya file % s... " % mayafilepath ) pathmatch = r'" ( [ ^ " ] * ) "'fmatch _ re = re. compile ( pathmatch )... | [
0.17182886600494385,
0.08211294561624527,
1.0300532579421997,
1.6315679550170898,
-0.41058996319770813,
0.37184417247772217,
1.2776321172714233,
0.3054811656475067,
-0.36390578746795654,
0.23176313936710358,
0.5494850277900696,
-0.017574146389961243,
-0.31317806243896484,
0.593967676162719... |
def readcsv ( mongocollection, infilepath, geomfield = " geom _ text ", delimiterchar = " ; ", outcsvpath = none ) : print ( " reading csv path % s and loading records " % ( infilepath ) ) badgeom = [ ] # if outcsvpath : # print ( " writing out mongodb geocsv " ) # outfile = open ( outcsvpath,'w ', newline = " \ n " ) ... | [
0.48731961846351624,
-0.29694196581840515,
0.6574698686599731,
0.7548953890800476,
0.22050639986991882,
0.9394615292549133,
0.5183270573616028,
-0.048015046864748,
-0.0954960361123085,
0.4618380069732666,
0.13749153912067413,
0.11362415552139282,
-0.5021091103553772,
-0.07170385122299194,
... |
def get _ buttons ( self ) - > dict [ str, dict ] : return self. buttons | [
-0.9274308681488037,
-0.5391445755958557,
0.3475002348423004,
-0.12742319703102112,
-0.7886485457420349,
-0.12939520180225372,
-0.8710995316505432,
-0.24362535774707794,
0.09348476678133011,
-0.348951518535614,
-1.671331763267517,
0.30564987659454346,
0.23599041998386383,
0.241061046719551... |
def create _ trade _ info _ table ( self, symbol, start, end ) : for i in range ( start, end + 1 ) : table _ name = " trade _ of _ { } _ { } ". format ( symbol, i ) sql = " create table if not exists { } ". format ( table _ name ) sql + = " ( exch _ name varchar ( 255 ), id varchar ( 255 ), price double, qty double, qu... | [
0.07218541949987411,
0.20143170654773712,
0.5170401334762573,
0.1726469248533249,
0.9926155805587769,
-0.03797304257750511,
0.5580890774726868,
-1.0534133911132812,
-1.1248574256896973,
0.24359005689620972,
-0.4884973466396332,
0.162753626704216,
0.3428352177143097,
0.19903503358364105,
... |
def test _ api _ video _ instructor _ initiate _ upload _ in _ read _ only ( self ) : video = factories. videofactory ( ) jwt _ token = instructororadminltitokenfactory ( playlist = video. playlist, permissions _ _ can _ update = false, ) response = self. client. post ( f " / api / videos / { video. id } / initiate - u... | [
-0.42359599471092224,
0.41236981749534607,
0.6286762356758118,
0.5727781057357788,
0.3258623480796814,
0.3565506041049957,
0.46700236201286316,
0.005600267089903355,
-0.01264308113604784,
0.3612942099571228,
-0.22550664842128754,
1.1743927001953125,
-0.582146167755127,
0.023795809596776962... |
def test _ info _ working _ flight ( c, users : list [ user ], flights : list [ flight ] ) : mock _ data = { " fake " : " exists ", " anotherfake " : " alsoexists ", " dummycount " : 100 } httpretty. register _ uri ( httpretty. get, f " http : / / container - nodeodm : 3000 / task / { flights [ 0 ]. uuid } / info ", bo... | [
-0.691903829574585,
0.7644146680831909,
0.8490070700645447,
-0.20067566633224487,
1.0474447011947632,
0.39037591218948364,
-0.34227171540260315,
-0.3048524856567383,
-0.6329603791236877,
-0.7084944248199463,
-0.2855505049228668,
-0.11262700706720352,
-0.09991703927516937,
0.025152498856186... |
def _ transformation ( self, x : np. ndarray ) - > np. ndarray : eps = np. finfo ( np. float64 ). eps return 1 / ( 1 + ( self. half _ saturation / ( x + eps ) ) * * self. exponent ) | [
-0.8932396769523621,
0.4684760272502899,
0.5122027397155762,
-0.3658491373062134,
-0.48212581872940063,
-0.3616034984588623,
-0.09970811754465103,
0.10424990952014923,
0.5068851709365845,
0.7074460387229919,
-0.7796860337257385,
0.1503334790468216,
0.2894069254398346,
0.03979605808854103,
... |
def origin ( self, index, origin, width ) : hwidth = width / 2 ; return ( origin [ 0 ] + ( hwidth if index & 1 else 0 ), origin [ 1 ] + ( hwidth if index & 2 else 0 ), origin [ 2 ] + ( hwidth if index & 4 else 0 ) ) | [
-0.5235683917999268,
-0.7063868045806885,
0.5149471759796143,
-0.18262788653373718,
0.14251069724559784,
-0.07300349324941635,
-0.3318454623222351,
0.33760231733322144,
1.252720594406128,
0.3548717498779297,
-0.3908483684062958,
0.18427859246730804,
-0.6261802911758423,
-0.5059614181518555... |
def do _ update ( self, node _ id ) : _ error _ code, _ msg = ramstkdatamodel. do _ update ( self, node _ id ) if _ error _ code! = 0 : _ error _ code = 2006 _ msg ='ramstk error : attempted to save non - existent'\'designelectric record id { 0 : d }. '. format ( node _ id ) return _ error _ code, _ msg | [
-0.3775408864021301,
0.19570060074329376,
0.5505169630050659,
-0.14533530175685883,
0.5655887722969055,
-0.10361233353614807,
0.04124109819531441,
-0.010970368050038815,
-0.423364520072937,
0.8906358480453491,
-0.355595201253891,
0.0291740782558918,
-0.12585702538490295,
0.0890212208032608... |
def index ( ) : return render _ template ('index. html') | [
0.6503291130065918,
0.4519205093383789,
0.027740590274333954,
-0.027164287865161896,
-0.09195702522993088,
0.21939018368721008,
0.5763280987739563,
1.2399687767028809,
-0.6618441343307495,
0.4215790629386902,
0.14496943354606628,
-0.3240973949432373,
-0.08366081118583679,
-0.64679813385009... |
def _ determinant ( tri _ mat ) : return np. diagonal ( tri _ mat ). prod ( ) | [
0.5769492387771606,
0.11878292262554169,
0.03472491353750229,
-0.2547057271003723,
0.5101830959320068,
0.36858052015304565,
0.7457234263420105,
-0.28532513976097107,
0.4475151002407074,
0.16317981481552124,
0.9827436804771423,
-0.46916115283966064,
0.24646881222724915,
-1.4495782852172852,... |
def create _ machine _ state ( conn ) : machine _ id = get _ dbus _ machine _ id ( ) boot _ id = get _ boot _ id ( ) my _ ip = get _ global _ ip ( ) try : inserted = r. db ('wanwipe'). table ('machine _ state'). insert ( {'machine _ id': machine _ id,'boot _ id': boot _ id,'ip': my _ ip,'updated _ at': r. now ( ) } ). ... | [
-0.8419943451881409,
0.3253079950809479,
0.5651706457138062,
-0.20828381180763245,
-0.44225239753723145,
0.3854547142982483,
-0.8128049969673157,
0.009911851026117802,
-1.455861210823059,
-0.4279310703277588,
-0.44181323051452637,
-0.8935163021087646,
-1.0570460557937622,
0.381041526794433... |
def unfollow _ group ( self, group _ id, logged _ in _ user _ id, access _ token, client _ token, * * kwargs ) : kwargs ['_ return _ http _ data _ only'] = true if kwargs. get ('callback') : return self. unfollow _ group _ with _ http _ info ( group _ id, logged _ in _ user _ id, access _ token, client _ token, * * kwa... | [
-0.4132865369319916,
0.38602885603904724,
0.5570879578590393,
0.1228884682059288,
-0.9295637011528015,
0.06505726277828217,
0.5469732284545898,
-1.0541982650756836,
0.3555339276790619,
-0.05542296916246414,
0.5402854084968567,
1.0067449808120728,
-0.6915786266326904,
0.9128237366676331,
... |
def _ parse _ centroid ( center ) : coordinates = json. loads ( center ) [ " coordinates " ] return coordinates [ 0 ], coordinates [ 1 ] | [
-0.06529742479324341,
-1.1931865215301514,
0.3692307472229004,
-0.8152310252189636,
-0.2774912714958191,
-0.7080168724060059,
-0.8371030688285828,
0.4107183516025543,
0.29509952664375305,
1.1509932279586792,
-0.6941641569137573,
-0.6554049253463745,
-0.0337199792265892,
-0.5528936982154846... |
def add _ func ( self, f ) : self. global _ funcs. add ( f ) | [
-0.2681195139884949,
0.9031277298927307,
0.4737899601459503,
0.37763988971710205,
1.2324601411819458,
0.9232411980628967,
0.895929753780365,
0.09709923714399338,
-0.35944241285324097,
-0.8944867849349976,
-0.9750261902809143,
1.02202308177948,
-0.03525364398956299,
0.3018856942653656,
-0... |
def calcdistance ( self, locationarray ) : self. dist = distance. euclidean ( self. start, locationarray [ 0 ] ) + distance. euclidean ( self. start, locationarray [ - 1 ] ) # distance from start to first stop and last to first stop for i in range ( len ( locationarray ) - 1 ) : # all other distances self. dist + = dis... | [
-1.004909634590149,
-1.0348999500274658,
0.5459635257720947,
-0.10025729984045029,
0.4137412905693054,
0.5666550397872925,
0.7355920076370239,
0.6283235549926758,
0.7437078356742859,
0.5303442478179932,
-0.11865391582250595,
-0.6531749963760376,
-0.8557066321372986,
0.6754125952720642,
-... |
def seven ( ) : return [ [ 1, 1, 1, 1 ], [ 1, 0, 0, 1 ], [ 0, 0, 0, 1 ], [ 0, 0, 1, 0 ], [ 0, 0, 1, 0 ], [ 0, 1, 0, 0 ], [ 0, 1, 0, 0 ], ] | [
-0.37172555923461914,
-0.5137541890144348,
0.8977500796318054,
0.08495838195085526,
0.6413270235061646,
-0.4370240867137909,
0.04669142886996269,
-0.014579467475414276,
1.0273298025131226,
0.060031719505786896,
-1.2273300886154175,
-0.7509750723838806,
0.7059180736541748,
0.070874631404876... |
def write ( self, b ) : return 0 | [
-1.4252222776412964,
0.10536358505487442,
0.37188920378685,
0.9322962760925293,
1.3974308967590332,
0.48603543639183044,
0.7453165650367737,
0.6200588345527649,
-0.07310590893030167,
-0.33676648139953613,
-0.5603316426277161,
-0.2663535177707672,
-1.4698984622955322,
0.19314062595367432,
... |
def sitemap _ xml ( self ) : if self. should _ noindex ( ) : return [ ] return self. main _ menu ( ) | [
-1.2267321348190308,
-0.3453484773635864,
0.35324323177337646,
0.7401086688041687,
-0.6468138694763184,
0.09503741562366486,
-0.13716399669647217,
0.5189622640609741,
1.4625287055969238,
-0.4235110878944397,
0.6101301908493042,
-0.42631521821022034,
-0.8367346525192261,
0.5508471131324768,... |
def _ _ init _ _ ( self, kinematics, cycle _ time = 0. 008, log _ cart = false ) : trajectorygenerator. _ _ init _ _ ( self, kinematics, cycle _ time = cycle _ time ) self. _ log _ cart = log _ cart self. _ twist _ update _ time = time. time ( ) self. _ start _ pose = none self. _ target _ pose = none self. _ interpola... | [
0.012084044516086578,
-0.2508104145526886,
0.8986368775367737,
0.3304312229156494,
-0.21453818678855896,
-0.21931682527065277,
-0.027549374848604202,
0.05249136686325073,
-0.38369929790496826,
0.11176364868879318,
-0.31533482670783997,
-0.4071631133556366,
0.08904432505369186,
0.3743878602... |
def get _ data _ from _ archive ( msid, start, stop, glim, step = 3600. 0 ) : # # - - - week long data 5 min step # wtime = [ ] wdata = [ ] wmed = [ ] wstd = [ ] wmin = [ ] wmax = [ ] wyl = [ ] wyu = [ ] wrl = [ ] wru = [ ] wcnt = [ ] step2 = 86400 wstart = stop - 86400. 0 * 14. 0 # - - - - two weeks ago # # - - - one ... | [
0.3807320296764374,
-0.4846612811088562,
0.8790366053581238,
-0.2743612825870514,
-0.923730194568634,
-0.17007488012313843,
-0.4977533221244812,
-0.06718846410512924,
0.15709225833415985,
0.2653512954711914,
-0.34748995304107666,
0.5231518745422363,
-0.3509877026081085,
0.707396388053894,
... |
def _ pre _ concat _ forward _ fn ( cls, cell, inputs : torch. tensor, state : torch. tensor, context : torch. tensor ) : out = torch. cat ( [ inputs, context ], dim = 1 ) out = cell ( out, state ) return out | [
0.4652310311794281,
0.6108103394508362,
0.36869776248931885,
0.24151891469955444,
-0.21127472817897797,
-0.410183310508728,
0.07072820514440536,
0.05085941404104233,
0.0005241594044491649,
-0.2846395969390869,
1.1959115266799927,
-0.026557933539152145,
0.8570922017097473,
-0.21985933184623... |
def adjacency ( dist, idx, sigma = none ) : m, k = dist. shape assert m, k = = idx. shape assert dist. min ( ) > = 0 # weights. if sigma is none : sigma = np. mean ( dist [ :, - 1 ] ) * * 2 dist = np. exp ( - dist * * 2 / sigma ) # weight matrix. i = np. arange ( 0, m ). repeat ( k ) j = idx. reshape ( m * k ) v = dist... | [
0.17688830196857452,
0.04601484537124634,
0.6526263356208801,
0.32149139046669006,
-0.7435493469238281,
-0.34298402070999146,
0.5867751836776733,
-0.1547846794128418,
0.5233916640281677,
0.1509476751089096,
1.080358624458313,
0.44478654861450195,
-0.3159395456314087,
-0.5080727338790894,
... |
def test _ read _ success ( self ) : request = self. factory. get ('/ buildings') response = buildings ( request ) self. assertequal ( response. status _ code, 200 ) b = buildings. objects. get ( pk = 1 ) self. assertequal ( b. name, " test _ name " ) | [
0.042208652943372726,
0.0863611027598381,
0.4986915588378906,
0.4697483777999878,
0.3137129545211792,
1.1228108406066895,
-0.0742810070514679,
0.14388684928417206,
-0.0233676228672266,
-0.9505115151405334,
0.24576622247695923,
-0.45087534189224243,
0.03909919038414955,
-0.8777086734771729,... |
def _ _ on _ click ( self ) - > noreturn : if workspaceview. selection is not none : startbuttonview. interrupt _ mp ( ) workspaceview. selection. delete ( ) self. clearfocus ( ) | [
0.7677103281021118,
-0.2573973834514618,
0.2842823266983032,
0.3982577919960022,
-0.20819926261901855,
-0.290473073720932,
1.0694174766540527,
-0.3671620786190033,
1.4769861698150635,
0.06339581310749054,
0.24040573835372925,
0.1649017035961151,
-0.7198790311813354,
-0.0072362469509243965,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.