text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def get _ albums _ from _ artist ( self, artist, type = ( " album ", " single ", " appears _ on ", " compilation " ), market = none ) : q = { " include _ groups " : ", ". join ( type ), " market " : market or self. user _ market ( ), " limit " : 50 } url = " artists / { } / albums ". format ( artist ['id'] ) page = sel... | [
-0.7210893034934998,
0.12829485535621643,
0.4613657295703888,
0.7208927273750305,
-0.12374326586723328,
0.3176180124282837,
-0.3189370036125183,
-0.9707204699516296,
0.11219105124473572,
0.9710135459899902,
-0.8303022980690002,
0.23881420493125916,
-0.6266999244689941,
0.030375206843018532... |
def non _ dominated _ sort ( objectives ) : extended = np. tile ( objectives, ( objectives. shape [ 0 ], 1, 1 ) ) dominance = np. sum ( np. logical _ and ( np. all ( extended < = np. swapaxes ( extended, 0, 1 ), axis = 2 ), np. any ( extended < np. swapaxes ( extended, 0, 1 ), axis = 2 ) ), axis = 1 ) return objectives... | [
-0.330387145280838,
-0.7441748976707458,
0.8873156905174255,
0.4243111312389374,
-1.1130783557891846,
0.5127135515213013,
0.4697667062282562,
-0.16032901406288147,
0.217493936419487,
0.5465676188468933,
0.43450066447257996,
0.11917673051357269,
0.06401162594556808,
0.4886234402656555,
0.... |
def extract _ article ( self ) : # get an article html = self. download _ page ( ) soup = beautifulsoup ( html, " html5lib " ) if not soup : raise valueerror ( " sorry, i could not parse that page properly " ) # get author, title and name author _ tag = soup. find ( rel = " author " ) self. author = author _ tag and au... | [
0.1682806760072708,
-0.4968503713607788,
0.7773685455322266,
0.06946185231208801,
-0.6362085342407227,
-0.6975380778312683,
0.006625432521104813,
0.40769317746162415,
0.11640220880508423,
0.5395914316177368,
0.3778519332408905,
-0.13964024186134338,
-0.4712356626987457,
0.27101677656173706... |
def test _ atomic _ id _ pattern _ nistxml _ sv _ iv _ atomic _ id _ pattern _ 1 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - pattern - 1. xsd ", instance = " nistdata / atomic / id / schema + instance / n... | [
0.26570925116539,
-0.39547160267829895,
0.3966532051563263,
0.4098685085773468,
-0.014715109951794147,
0.08723331987857819,
0.47929471731185913,
-0.31813618540763855,
0.5504741072654724,
0.6739025712013245,
0.039721645414829254,
-0.08637847751379013,
-0.28155457973480225,
-0.02358929440379... |
def test _ atomic _ language _ max _ length _ nistxml _ sv _ iv _ atomic _ language _ max _ length _ 1 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / language / schema + instance / nistschema - sv - iv - atomic - language - maxlength - 1. xsd ", instance = " nistdata /... | [
0.19292712211608887,
-0.11410900205373764,
0.2877945303916931,
0.9625077843666077,
-0.5735697150230408,
0.2667210102081299,
-0.16850778460502625,
0.3342224955558777,
0.7606223225593567,
0.906294047832489,
-0.21966762840747833,
-0.1751202940940857,
-0.06951513141393661,
0.17697396874427795,... |
def _ is _ colour _ valid ( self, tag : str ) : colour _ to _ check = tag. replace ('','' ). replace ('< ','' ). replace ('> ','' ). upper ( ) return colour _ to _ check in colour _ dict | [
-0.37476006150245667,
-0.2495487481355667,
0.46739327907562256,
-1.1725783348083496,
-0.6964278221130371,
0.17038142681121826,
-0.8503472805023193,
0.9233656525611877,
-0.4795406460762024,
-0.13225826621055603,
-0.17895719408988953,
-0.10144425928592682,
-0.5208384394645691,
1.025472640991... |
def connects ( r1, s1, r2, s2, topology ) : for pkt, out _ port in r1. apply ( r1. pattern ) : new _ switch, in _ port = topology. node [ s1 ] ['port'] [ out _ port ] if new _ switch = = s2 : if r2. pattern. intersects ( pkt ) : return true return false | [
-0.5510249733924866,
-0.31934854388237,
0.6912877559661865,
0.353097140789032,
0.09364491701126099,
0.21935662627220154,
0.30992528796195984,
-0.2231912463903427,
-0.5550252795219421,
0.018142912536859512,
0.11319125443696976,
-0.061421409249305725,
-0.42954981327056885,
-0.974733531475067... |
def connect ( self, address = none, port = none ) : if not self. address : self. address = ( address, port ) elif not address and not port and not self. address : raise exception ( " address and port must be specified in " " constructor or in connect ( ) " ) self. control _ socket = ssl. wrap _ socket ( self. control _... | [
-0.033811915665864944,
-0.07078375667333603,
0.742683470249176,
-0.20651037991046906,
-0.39802101254463196,
-0.11448908597230911,
-0.16608180105686188,
0.026089929044246674,
0.6819545030593872,
-0.0428159236907959,
-0.3324888050556183,
0.7802598476409912,
-0.5060444474220276,
-0.2018079757... |
def reviewspellcurrentcharacter ( self, inputevent ) : self. _ reviewcurrentcharacter ( inputevent, 2 ) return true | [
-0.7980320453643799,
-1.2879847288131714,
0.2279476374387741,
-0.39663824439048767,
-1.3075263500213623,
1.3654098510742188,
0.16395704448223114,
-0.16433489322662354,
-0.3237684667110443,
0.023717492818832397,
-0.3682795464992523,
1.1627389192581177,
-0.8761436343193054,
-0.53150856494903... |
def geo _ clustering _ dbscan ( df, min _ dist = 0. 6, min _ samples = 3 ) : x = df [ ['latitude ','longitude'] ]. copy ( ) distance _ matrix = squareform ( pdist ( x, ( lambda u, v : haversine ( u, v ) ) ) ) db = dbscan ( eps = min _ dist, min _ samples = min _ samples, metric ='precomputed') y _ db = db. fit _ predic... | [
-0.15294764935970306,
1.123950719833374,
0.6587475538253784,
0.36023181676864624,
0.32038959860801697,
0.5256088376045227,
-0.24608203768730164,
0.18735072016716003,
0.05540258064866066,
0.10797619074583054,
0.05219558626413345,
0.632661759853363,
-0.23298421502113342,
-0.7631566524505615,... |
def do _ postprocesses ( self, job ) : # denoise # if self. settings. denoise _ enabled : denoise = denoise ( job = job ) denoise _ proc = self. do _ process ( obj = denoise, job = job ) if not denoise _ proc : return false # multicolumnskew # if self. settings. denoise _ enabled and self. settings. multi _ column _ sk... | [
-0.02147260494530201,
-0.2784251868724823,
0.8977808356285095,
-0.6105776429176331,
-0.5371809005737305,
0.10191179066896439,
0.17056357860565186,
-1.3992860317230225,
0.14364834129810333,
-0.2727648913860321,
-0.41976818442344666,
-0.5822306871414185,
-0.5397249460220337,
0.85858094692230... |
def poll _ for _ updates ( ) : logbuffer = next ( x for x in logging. getlogger ( ). handlers if isinstance ( x, logging. handlers. bufferinghandler ) ). buffer get _ props = lambda x : { k : v for k, v in x. _ _ dict _ _. iteritems ( ) if not k [ 0 ] = ='_'} old _ workflows = { workflow. id : get _ props ( workflow ) ... | [
-0.6892126202583313,
-0.78375244140625,
0.7899293899536133,
0.20734918117523193,
-0.2902581989765167,
-0.44525909423828125,
0.16865871846675873,
-1.4501473903656006,
0.32067564129829407,
-0.035851966589689255,
-0.026010602712631226,
0.20672066509723663,
-0.30175304412841797,
0.385088443756... |
def compare _ training _ plot ( df : dataframe ) : _ start _ index _ from _ one ( df ) fig, axes = plt. subplots ( nrows = 1, ncols = 2, figsize = ( 12. 8, 4. 8 ) ) for i in range ( 2 ) : sns. lineplot ( data = df [ compare _ training _ columns [ i ] ], markers = ['o ','o'], ax = axes [ i ] ) axes [ i ]. set ( title = ... | [
0.585578203201294,
0.6427816152572632,
0.743657648563385,
0.07425708323717117,
0.000861218897625804,
0.4487169682979584,
0.9973022937774658,
0.05211086943745613,
-0.5724124312400818,
-0.22044163942337036,
-0.08105088025331497,
1.160192608833313,
0.873832643032074,
-0.6153228878974915,
0.... |
def mandatory _ rebalance ( self, day, taxes, does _ broker _ liquidation _ sell _ tax _ favored _ first ) : return self. rebalance ( day, taxes, self. _ _ broker _ max _ margin _ to _ assets _ ratio, does _ broker _ liquidation _ sell _ tax _ favored _ first ) | [
-0.10429081320762634,
0.5700668692588806,
0.4774160385131836,
-0.03860417380928993,
0.5476742386817932,
0.21664687991142273,
-0.6919600367546082,
-1.0032166242599487,
-0.31072717905044556,
-0.03084697015583515,
1.3655085563659668,
-0.11520422995090485,
-0.11532975733280182,
0.0749558508396... |
def move ( self, x, y ) : self. _ x = x self. _ y = y | [
-1.4232662916183472,
-0.6121141910552979,
0.4212086498737335,
-0.6800587177276611,
-0.10333383083343506,
0.2864004969596863,
-0.9801547527313232,
-0.9530315399169922,
-0.41403189301490784,
0.14356786012649536,
-1.1573139429092407,
0.9091659784317017,
0.4146097004413605,
-1.0800656080245972... |
def name ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " name " ) | [
0.5996610522270203,
-0.47791606187820435,
0.4736770689487457,
0.08874538540840149,
-0.4275035560131073,
0.3480296730995178,
0.1574808806180954,
-0.024846583604812622,
-0.18589520454406738,
0.7590891122817993,
0.08242655545473099,
0.3790670931339264,
0.5259250402450562,
-0.723107635974884,
... |
def _ _ init _ _ ( self, input _ size : tuple, num _ classes : tuple, hidden _ size : int = 128, discrete _ networks _ num _ layers : int = 1, discrete _ optimization _ strategy : str ='gumbel - sigmoid ', filter _ discrete _ updates : bool = false, message _ humans _ to _ human : bool = false, message _ human _ to _ o... | [
0.08836399763822556,
0.18955184519290924,
0.9182024598121643,
0.3832911550998688,
0.029818082228302956,
0.20050399005413055,
0.7173099517822266,
-0.33606991171836853,
-0.6081677675247192,
0.4808943569660187,
0.21165883541107178,
0.025119870901107788,
0.0468856506049633,
0.36105668544769287... |
def _ _ exit _ _ ( self, * exc _ args ) : self. close ( ) self. data. seek ( 0 ) if self. outfile : self. outfile. write ( self. data. getvalue ( ) ) | [
-0.016867995262145996,
-0.6847412586212158,
0.6305102109909058,
-0.3456346094608307,
0.10262390226125717,
0.6324416399002075,
0.8912602663040161,
-0.016358787193894386,
-0.6127873063087463,
-0.7239117622375488,
0.6639904379844666,
-0.4306901693344116,
-0.6823979020118713,
0.290344923734664... |
def get _ commits _ for _ all _ repos ( out ) : names _ of _ repos = next ( os. walk ( ". / " + str ( out ) ) ) [ 1 ] commits = [ ] for repo in names _ of _ repos : with porcelain. open _ repo _ closing ( ". / " + str ( out ) + " / " + str ( repo ) ) as repo : walker = repo. get _ walker ( reverse = true ) for entry in... | [
0.06613173335790634,
-0.7662238478660583,
0.6119589805603027,
0.4391164183616638,
-0.4352032542228699,
0.4132254719734192,
0.07064711302518845,
-0.27865707874298096,
-0.4823969602584839,
0.1101776510477066,
0.17135940492153168,
0.0844668373465538,
-0.22354935109615326,
1.368242859840393,
... |
def gen _ carina _ times ( ) : # list of mjds to start on. # xxx - - temp mjds = [ 60347. 04577312805, 60348. 04506823188, 60349. 044350427575, 60350. 04362015519, 60351. 04287783196, 60352. 04212389188, 60353. 041358765215, 60731. 03080681572, 60732. 0299360645, 60733. 02906059101, 60734. 02818073612, 60735. 027296853... | [
-0.629815936088562,
-0.08410384505987167,
1.4908703565597534,
0.08382604271173477,
-0.6972046494483948,
0.10771755129098892,
0.48048603534698486,
0.23133866488933563,
-0.6596214175224304,
0.9514851570129395,
-1.0211763381958008,
-0.0792698860168457,
0.5434731245040894,
0.859957218170166,
... |
def _ _ init _ _ ( self, master ) : super ( ). _ _ init _ _ ( master,'my movies ', 1, 4, true, false ) self. master = master self. master. title ('my movies') self. master. geometry ('600x500 + 25 + 25') database = database ( ) user _ id = database. run _ select ( " select userid from users where logged _ in = 1 ; " ) ... | [
-0.25074759125709534,
0.16500920057296753,
0.7108628153800964,
-0.2029445618391037,
-0.12935256958007812,
0.4468602240085602,
0.4964919984340668,
0.42899325489997864,
-0.8032830357551575,
-0.08356764912605286,
0.3654876947402954,
0.949858546257019,
-0.02861078269779682,
1.3860034942626953,... |
def test _ atomic _ hex _ binary _ length _ 1 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ length _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - length - 2. xsd ", instance = " nistdata / ... | [
0.052477408200502396,
-0.21421673893928528,
0.485809326171875,
0.637896716594696,
0.11889313906431198,
0.5526558756828308,
-0.4148716926574707,
0.34222647547721863,
-0.16848981380462646,
0.14079004526138306,
-0.7040995955467224,
-0.42865511775016785,
0.15030139684677124,
0.672067403793335,... |
def merge _ s3 _ files ( start, end ) : try : path = temp _ folder ( cleanup = false ) s3 = s3tasks ( start, end, path ) s3. prepare _ files ( ) s3. download _ files ( ) file _ id = s3. upload _ sorted _ file ( ) except exception as exp : raise exp return file _ id | [
0.736456573009491,
0.05157991126179695,
0.8053940534591675,
0.7616437673568726,
0.3249574303627014,
0.7904666662216187,
0.031135911121964455,
-0.0006165759987197816,
-0.3771328330039978,
0.2717481255531311,
-0.7348368763923645,
-0.6248626708984375,
-0.4441060423851013,
-0.7128281593322754,... |
def categorical _ agg _ dict _ features ( n, n _ feats, ks ) : features = [ ] for k in range ( ks ) : features. append ( categorical _ dict _ features ( n, n _ feats ) ) return features | [
-0.8016373515129089,
0.7468485236167908,
0.32740309834480286,
1.221478819847107,
-0.06098756566643715,
-0.4492240250110626,
-1.213040828704834,
1.2076501846313477,
-0.6845043301582336,
-0.34607160091400146,
-0.3666580319404602,
0.10686600208282471,
1.011117935180664,
1.2709691524505615,
... |
def parentfolders ( folder ) : folderpath = " " depth = 5 while folder. name! = " vm " : if depth! = 0 : folderpath = folder. name + " / " + folderpath folder = folder. parent depth = depth - 1 else : print " error : specified folder is nested in too many subdirectories ( max : 5 ) " exit ( ) return folderpath | [
-0.2088773250579834,
1.023095965385437,
0.7393398284912109,
0.8383209109306335,
-0.6501250267028809,
0.39498400688171387,
1.400478720664978,
-0.9246052503585815,
-0.3419431746006012,
0.5200793147087097,
0.30304425954818726,
-0.23787952959537506,
-1.18570876121521,
0.6120052337646484,
0.0... |
def gcd ( a, b ) : import warnings warnings. warn ('fractions. gcd ( ) is deprecated. use math. gcd ( ) instead. ', deprecationwarning, 2 ) if type ( a ) is int is type ( b ) : if ( b or a ) < 0 : return - math. gcd ( a, b ) return math. gcd ( a, b ) return _ gcd ( a, b ) | [
0.5264735221862793,
0.6422824263572693,
0.6966710090637207,
0.11525649577379227,
-0.4562746286392212,
-0.1264418214559555,
-0.4087781012058258,
-1.4470702409744263,
-0.6217724680900574,
-0.6061673164367676,
1.4938486814498901,
0.2770251929759979,
-0.23900562524795532,
0.10419247299432755,
... |
def test _ atomic _ qname _ length _ nistxml _ sv _ iv _ atomic _ qname _ length _ 1 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / qname / schema + instance / nistschema - sv - iv - atomic - qname - length - 1. xsd ", instance = " nistdata / atomic / qname / schema + ... | [
0.2311573475599289,
-0.3749547004699707,
0.3192317485809326,
-0.1432439237833023,
-0.5499145984649658,
0.2115645408630371,
0.22628675401210785,
-0.552797257900238,
0.22848710417747498,
0.713772714138031,
-0.7864986062049866,
-0.36611637473106384,
-0.07965243607759476,
0.2284441590309143,
... |
def get _ state ( env, idx ) : v2i _ abs = ( env. v2i _ channels _ abs [ idx * size _ platoon ] - 60 ) / 60. 0 v2v _ abs = ( env. v2v _ channels _ abs [ idx * size _ platoon, idx * size _ platoon + ( 1 + np. arange ( size _ platoon - 1 ) ) ] - 60 ) / 60. 0 v2i _ fast = ( env. v2i _ channels _ with _ fastfading [ idx * ... | [
-0.8319088816642761,
-0.7671798467636108,
0.8441517353057861,
-1.1661403179168701,
-0.0018214734736829996,
-0.6292635202407837,
-0.30529990792274475,
-0.8245978951454163,
0.3991454839706421,
0.8025036454200745,
0.36799174547195435,
0.39303332567214966,
0.011135052889585495,
-0.161482021212... |
def print _ profile _ data ( ) : stream = stringio ( ) statistics = stats ( profiler, stream = stream ) statistics. sort _ stats ('cumulative') statistics. print _ stats ( ) print ( stream. getvalue ( ) ) | [
1.698075532913208,
-0.21799509227275848,
0.5386672019958496,
0.37034571170806885,
0.15637321770191193,
0.3242602050304413,
0.3972352147102356,
-1.7186638116836548,
-0.5707758665084839,
-0.5910836458206177,
-0.02591191977262497,
0.9462307691574097,
0.3427054286003113,
0.3160683214664459,
... |
def _ handle _ reply ( self, cmd ) : _ log. debug ( " processing reply. % s ", cmd ) if self. running _ cmd and self. running _ cmd. is _ reply ( cmd ) : err = self. running _ cmd. validate _ reply ( cmd ) if err : self. _ set _ error ( err ) else : self. _ set _ result ( cmd ) | [
0.11606105417013168,
-0.22024968266487122,
0.5963116884231567,
0.08639393001794815,
0.36156606674194336,
-0.2399071604013443,
-0.08225985616445541,
-0.42069125175476074,
1.2452253103256226,
-0.5086608529090881,
0.18008089065551758,
0.29954224824905396,
-0.3325057029724121,
0.33568361401557... |
def gen _ greedy _ surveys ( nside = 32, nexp = 2, exptime = 30., filters = ['r ','i ','z ','y'], camera _ rot _ limits = [ - 80., 80. ], shadow _ minutes = 60., max _ alt = 76., moon _ distance = 30., ignore _ obs ='dd ', m5 _ weight = 3., footprint _ weight = 0. 75, slewtime _ weight = 3., stayfilter _ weight = 3., r... | [
-0.18114779889583588,
0.5033599138259888,
1.0631905794143677,
0.5133854746818542,
0.01963522844016552,
0.6921963691711426,
-0.006648089736700058,
-0.8917458057403564,
0.40381529927253723,
-0.6101117134094238,
-0.16288869082927704,
0.8041194081306458,
-0.13194580376148224,
0.802899003028869... |
def strobe _ ellipsoid ( model _ obj, n _ tracks, dz = 0. 7, loc _ error = 0. 0, exclude _ outside = true, n _ gaps = 0, ellipse _ dim = [ 10. 0, 5. 0, 5. 0 ], bleach _ prob _ per _ frame = 0 ) : # half the observation slice width hz = dz * 0. 5 # ellipsoid squared radii ellipse _ dim = np. asarray ( ellipse _ dim ) e2... | [
0.6177053451538086,
0.30728188157081604,
1.0911672115325928,
-0.11746741831302643,
-0.7916144728660583,
0.9702073335647583,
-0.28687790036201477,
-0.06816153228282928,
0.46962612867355347,
1.0254732370376587,
-0.6494731307029724,
-0.5102605223655701,
-0.09392894804477692,
-0.59943419694900... |
def async _ caches ( request, tmp _ path, redis _ server, redis _ sentinel _ server, memcache _ server ) : if request. param = ='redissentinel'and os. getenv ('travis ','no') = ='yes': pytest. skip ( " unfortunately on travis redis sentinel currently can't be installed " ) # build a dict of caches for each eviction str... | [
-0.1324324905872345,
0.885604202747345,
0.5495869517326355,
0.7915014624595642,
0.23941561579704285,
0.013373888097703457,
-0.28752705454826355,
-0.02542075142264366,
0.010424827225506306,
0.8126705884933472,
0.7258151173591614,
-0.7037672996520996,
0.9212955832481384,
0.42075327038764954,... |
def update _ pair _ attrs ( namespace, workspace, pairs, attrs ) : for idx, row in pairs. iterrows ( ) : attr _ update = [ { " op " : " addupdateattribute ", " attributename " : attr, \ " addupdateattribute " : row [ attr ] } for attr in attrs ] res = firecloud _ api. update _ entity ( namespace, workspace, " pair ", r... | [
-2.143383026123047,
-0.2423895001411438,
0.41661974787712097,
-0.18924103677272797,
-0.6283588409423828,
-0.3327724039554596,
-0.2609604001045227,
0.3892520070075989,
0.2980005443096161,
0.6659837365150452,
0.1614299714565277,
-0.4939645528793335,
-0.47099900245666504,
0.8424447774887085,
... |
def compute _ exact _ multipliers ( loss, constraints, parameters, return _ timing = false, allow _ unused = false, warn = true, ) : # multipliers = ( j ( g ( s ) ) j ( g ( s ) ) ^ t ) ^ { - 1 } ( g ( s ) - j ( g ( s ) ) j ( f ( s ) ) ^ t ) # where f is the loss, g is the constraints vector, and s is the # paramters of... | [
-0.11136777698993683,
-0.07554952055215836,
1.0140960216522217,
0.027591420337557793,
-0.3226217031478882,
-1.0975420475006104,
0.5801811218261719,
0.2055455595254898,
-0.5249788761138916,
1.4418631792068481,
-0.33966901898384094,
0.5040804743766785,
0.35053274035453796,
0.1664079278707504... |
async def get _ user ( self, user _ id : uuid4 ) - > user : await self. connect _ to _ database ( ) user : user = await user _ db. get ( id = uuid ( user _ id ) ) return user | [
-0.6118634343147278,
0.45421668887138367,
0.2907951772212982,
0.8678975701332092,
0.9499502182006836,
-0.38969945907592773,
-0.7612848281860352,
-0.3657929301261902,
-0.04701951891183853,
-0.18711629509925842,
-0.3996905982494354,
0.4386458396911621,
0.013457601889967918,
-0.33923354744911... |
def remove _ dul ( entitylst ) : entitylst = [ tuple ( entity ) for entity in entitylst ] entitylst = set ( entitylst ) entitylst = [ list ( entity ) for entity in entitylst ] return entitylst | [
-0.8865790367126465,
0.05731331184506416,
0.8061686158180237,
-0.8184248208999634,
-0.6683016419410706,
0.4547767639160156,
-0.14641374349594116,
0.9583026170730591,
0.557003915309906,
1.3193374872207642,
-1.202795386314392,
-0.1262068748474121,
0.6925563216209412,
0.3481138050556183,
-0... |
def generatetraindata ( voc, qa _ pairs ) : qa _ pairs. sort ( key = lambda x : len ( x [ 0 ]. split ( " " ) ), reverse = true ) q _ batch, a _ batch = [ ], [ ] for pair in qa _ pairs : q _ batch. append ( pair [ 0 ] ) a _ batch. append ( pair [ 1 ] ) q _ batch, lengths = convertbatch ( q _ batch, voc ) a _ batch, mask... | [
-0.042545467615127563,
-0.15840795636177063,
0.6685333251953125,
-0.15453438460826874,
-0.056617606431245804,
-0.0939878299832344,
0.12485922127962112,
-0.011746027506887913,
-0.5245829224586487,
0.3656841814517975,
-0.619322657585144,
-0.2408667802810669,
0.38597163558006287,
-0.114848591... |
def bitstring ( self ) : return list ( self. _ digits ) | [
-0.5645824670791626,
-0.5435521602630615,
0.5271847248077393,
0.035709530115127563,
0.9626617431640625,
1.0140801668167114,
-0.5242328643798828,
-0.46910178661346436,
0.7762438058853149,
0.05132419615983963,
-0.7295873165130615,
0.9735181331634521,
-0.015471234917640686,
-0.218162328004837... |
def getdevicefromserial ( android _ device _ serial ) : devices = device _ utils. deviceutils. healthydevices ( ) for device in devices : if device. adb. _ device _ serial = = android _ device _ serial : return device raise devicesetupexception ('device { } not found '. format ( android _ device _ serial ) ) | [
0.4674486815929413,
-0.37580135464668274,
0.6044835448265076,
0.22847653925418854,
0.2869032919406891,
-0.5367064476013184,
0.8290635347366333,
-1.1931322813034058,
1.490064024925232,
-0.24341794848442078,
1.0979409217834473,
0.7164270877838135,
1.0039738416671753,
-0.13194023072719574,
... |
def test _ transform _ different _ number _ of _ columns ( df ) : test = drophighpsifeatures ( ) test. fit ( df ) # define new dataframe with additional column data = df. copy ( ) data [ " a " ] = [ 1 ] * 1000 with pytest. raises ( valueerror ) : test. transform ( data ) | [
0.7661421895027161,
1.1827731132507324,
0.45203182101249695,
0.9029749035835266,
1.5501757860183716,
-0.3541369140148163,
0.2765161097049713,
0.22832338511943817,
0.26328137516975403,
-0.4416094720363617,
-1.5777294635772705,
0.2153930366039276,
0.1505509316921234,
-0.051421623677015305,
... |
def window _ gen ( sequence, n ) : low = 0 high = n for element in sequence : window = sequence [ low : high ] if len ( window ) < n : break low + = 1 high + = 1 yield tuple ( window ) | [
-1.4964326620101929,
0.3968232274055481,
0.6078912019729614,
0.4674513638019562,
-0.5197632908821106,
-0.14079897105693817,
0.41713759303092957,
-0.24706827104091644,
-0.19057247042655945,
0.06769775599241257,
-0.8656899929046631,
0.12202553451061249,
-0.6064993143081665,
0.906048238277435... |
def updatething ( self, thingtypeid, thingid, name, description, aggregatedobjects, metadata = none ) : thingurl = apiclient. thingurl % ( self. host, thingtypeid, thingid ) payload = {'name': name,'description': description,'aggregatedobjects': aggregatedobjects,'metadata': metadata } r = requests. put ( thingurl, aut... | [
-1.8241009712219238,
-0.5916666984558105,
0.6853892207145691,
-0.4783027172088623,
-0.17505544424057007,
-0.12212514132261276,
-0.8441083431243896,
-0.7158591747283936,
-0.6528801321983337,
0.9758189916610718,
-0.4562970697879791,
1.1355960369110107,
-1.1835267543792725,
-0.170255973935127... |
def test _ list _ decimal _ pattern _ 2 _ nistxml _ sv _ iv _ list _ decimal _ pattern _ 3 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - pattern - 3. xsd ", instance = " nistdata / list / decimal / sc... | [
-0.5621666312217712,
0.2107083648443222,
0.7556505799293518,
0.9523006081581116,
0.11378831416368484,
0.5525532960891724,
-0.5707516670227051,
0.809837818145752,
1.4174854755401611,
0.6554530262947083,
-0.7475759983062744,
-0.1773282289505005,
0.1787274032831192,
-0.20198047161102295,
-0... |
def drawframe ( self ) : g = nx. graph ( ) edges = [ ] for key in self. nodes : node = self. nodes [ key ] color ='r'shape ='o'if node. hasliked : color ='g'if node. hasconsulted : shape ='s'g. add _ node ( node. id, shape = shape, color = color ) if not self. edges : for dest in node. connections : edge = [ key, dest.... | [
0.10266726464033127,
0.7512843608856201,
1.0431684255599976,
-0.8708721995353699,
-0.7424067258834839,
0.21664635837078094,
0.7870360016822815,
-0.09564502537250519,
-0.13205470144748688,
-0.36458730697631836,
-0.3375071883201599,
0.4212695062160492,
0.14078694581985474,
0.5874521732330322... |
def reviewer _ required ( func ) : def _ wrapper ( request, * args, * * kwargs ) : if not utils. can _ review _ proposal ( request. user ) : return create _ 403 ( request, _ ( " you have to be a reviewer in order to access this page. " ) ) return func ( request, * args, * * kwargs ) return _ wrapper | [
-0.9661098718643188,
0.3605497181415558,
0.6423180103302002,
-0.1270633488893509,
-1.377655029296875,
0.7396420240402222,
-0.051458630710840225,
0.4847956597805023,
0.008644232526421547,
0.4874016344547272,
1.2840969562530518,
-0.16504721343517303,
-0.382921040058136,
0.012087417766451836,... |
def get _ base _ uri ( self ) : return self. environments [ self. environment ] | [
-0.9064310789108276,
-0.9658964276313782,
0.5320339202880859,
0.1425928771495819,
0.8551832437515259,
0.9734373092651367,
0.07924304902553558,
0.4656885266304016,
-1.0546538829803467,
-0.16884788870811462,
0.9465972781181335,
0.8926995992660522,
-0.9477101564407349,
0.09815645962953568,
... |
def _ write ( self, command, * * kwargs ) : self. connection. write ( command, * * kwargs ) | [
-1.1655789613723755,
-0.30930814146995544,
0.08301141113042831,
-0.2485629767179489,
1.3065253496170044,
0.11329763382673264,
-0.6752378344535828,
0.008503735065460205,
-0.44733214378356934,
-0.19401060044765472,
-0.15209117531776428,
-0.07704892754554749,
-0.8893368244171143,
0.3652237057... |
async def test _ socks5 _ request _ connect _ failed ( ) : network _ backend = httpcore. asyncmockbackend ( [ # the initial socks connect # v5 noauth b " \ x05 \ x00 ", # v5 no rsv ip4 0. 0. 0. 0 : 00 b " \ x05 \ x05 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 ", ] ) async with httpcore. asyncsocksproxy ( proxy _ u... | [
-0.40691813826560974,
0.6752209067344666,
0.41114383935928345,
-0.3285454511642456,
0.5650116801261902,
-0.20662981271743774,
-0.14318668842315674,
-0.9152236580848694,
-1.0356861352920532,
-0.518291175365448,
0.15279708802700043,
-0.021926380693912506,
-0.9830188751220703,
-0.023665219545... |
def _ populate _ project ( project : dict, employees : list ) - > dict : for employee in employees : project ['employees']. append ( { " name " : employee, " value " :'xxx'} ) return project | [
-1.0534483194351196,
0.8500508666038513,
0.25232306122779846,
-1.2095422744750977,
0.33361145853996277,
1.0198110342025757,
-2.0844924449920654,
0.5894894599914551,
-0.5419366955757141,
1.2866904735565186,
0.06741081923246384,
-0.6278645396232605,
0.236381396651268,
0.1980617493391037,
-... |
def only _ choice ( values ) : for unit in unitlist : for digit in'123456789': dplaces = [ box for box in unit if digit in values [ box ] ] if len ( dplaces ) = = 1 : values [ dplaces [ 0 ] ] = digit return values | [
-0.6603206396102905,
0.25522753596305847,
0.41545647382736206,
-0.15743550658226013,
0.448405921459198,
0.5640081763267517,
0.7596584558486938,
0.2955774664878845,
1.2501723766326904,
-0.14564752578735352,
-0.4448085427284241,
-0.23421846330165863,
0.2460487186908722,
0.7668761610984802,
... |
def terminating ( self ) : self. running = false self. stop _ event. set ( ) | [
-0.07027651369571686,
-0.28766363859176636,
0.13271155953407288,
-0.36450663208961487,
0.5817297697067261,
0.6728150248527527,
-0.4341434836387634,
1.2690041065216064,
-0.7748490571975708,
-0.28226789832115173,
-0.9526765942573547,
0.2375166118144989,
-0.9618498682975769,
0.385867714881897... |
def test _ atomic _ hex _ binary _ white _ space _ nistxml _ sv _ iv _ atomic _ hex _ binary _ white _ space _ 1 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - whitespace - 1. xsd ", instance =... | [
-0.4451793134212494,
-0.12724535167217255,
0.44567057490348816,
0.30676892399787903,
-0.1352461725473404,
0.32678017020225525,
0.3280917704105377,
-0.3674297332763672,
0.11601250618696213,
0.42526623606681824,
-0.3740977644920349,
-0.26240989565849304,
-0.21775786578655243,
1.3198612928390... |
def test _ future _ moves _ dbm ( self ) : from future. moves import dbm dbm. ndbm from future. moves. dbm import dumb try : # is gdbm available on py2? if so, ensure dbm. gnu is available too : import gdbm except importerror : pass else : from future. moves. dbm import gnu from future. moves. dbm import ndbm | [
-0.3683484196662903,
1.2504104375839233,
0.4983868896961212,
0.6837440133094788,
0.47628551721572876,
-0.05946731939911842,
-0.47734761238098145,
-1.004193902015686,
0.24618704617023468,
-0.1844179332256317,
-0.6955310702323914,
0.23492060601711273,
-0.010735946707427502,
0.845145106315612... |
def _ _ init _ _ ( self, master, entry, widget _ names ) : super ( ). _ _ init _ _ ( master,'register ', 9, 2, false, true ) self. master = master self. master. title ('register') self. master. geometry ('900x460 + 25 + 25') self. drop _ options = [ " select a question : ", " where were you born? ", " what was the name... | [
0.0840112715959549,
0.3937067687511444,
0.9065631031990051,
0.16639110445976257,
0.0009556153090670705,
0.14560459554195404,
0.35318419337272644,
0.3614538013935089,
0.2819508910179138,
0.5917513966560364,
-0.5422734022140503,
-0.37028568983078003,
-0.6750902533531189,
0.6487839221954346,
... |
def default _ metadata ( ) : return pkg _ resources. resource _ filename ( _ _ name _ _, ".. / metadata. json " ) | [
0.3310021162033081,
0.03580997511744499,
0.48123398423194885,
-0.021092010661959648,
1.1615550518035889,
0.710265576839447,
-0.09282069653272629,
0.31662479043006897,
-0.7039315700531006,
0.5094206929206848,
-0.0747259110212326,
-0.07551470398902893,
0.917894721031189,
0.04222401976585388,... |
def adjust ( self ) : # adjust the keys, move all none key at the end for i in range ( len ( self. keys ) ) : if self. keys [ i ] is none : j = i + 1 while j < len ( self. keys ) : if self. keys [ j ] is not none : self. keys [ i ] = self. keys [ j ] self. keys [ j ] = none break j + = 1 # adjust the childs, move all e... | [
-0.7915505170822144,
-0.392538845539093,
0.7369021773338318,
-1.0856059789657593,
-0.5632022023200989,
-1.1714661121368408,
0.28779128193855286,
0.67880779504776,
-0.3642658591270447,
0.17062316834926605,
0.17035001516342163,
0.5123762488365173,
-0.8207396864891052,
0.32921868562698364,
... |
def clean _ events ( self ) : for train in self. map. train. values ( ) : train. event = [ ] for post in self. map. post. values ( ) : post. event = [ ] | [
0.18338371813297272,
-0.7705177664756775,
0.5831751823425293,
-0.183358296751976,
0.03638919070363045,
0.6618843078613281,
0.08030199259519577,
0.9657086730003357,
-0.8356360793113708,
0.0674055889248848,
-0.34309130907058716,
0.4648374915122986,
0.29354795813560486,
1.1117815971374512,
... |
def test _ toofast ( self ) : self. verify _ not _ root ( ) loader = threading. thread ( target = self. loader ) loader. start ( ) success = false try : for i in range ( 100 ) : if success : break self. ep. get ( " system / state ", 1 ) except krest. httperror as err : if err. response. status _ code = = 429 : success ... | [
0.4811331033706665,
0.8200146555900574,
0.6258423328399658,
1.0063955783843994,
0.573373556137085,
0.6671404838562012,
-0.7548258304595947,
-0.8371441960334778,
0.26025402545928955,
-0.911362886428833,
0.852990984916687,
0.0844649225473404,
-0.5490038394927979,
0.4948589503765106,
0.3078... |
def read _ konect _ graph ( filename ) : # reading phase filereader = open ( filename ) # graph properties graph _ info = filereader. readline ( ). strip ( " \ n " ). split ( " " ) assert graph _ info [ 0 ] = = " % " assert graph _ info [ 1 ] = = " sym " assert graph _ info [ 2 ] = = " unweighted " graph = nx. graph ( ... | [
0.3580701947212219,
-0.8111220002174377,
0.42542046308517456,
-0.420735239982605,
-1.3711111545562744,
-0.19026726484298706,
-0.23270003497600555,
0.5668473839759827,
-0.3491464853286743,
1.1049085855484009,
0.34406113624572754,
-0.49935227632522583,
-0.5785393714904785,
-0.971743106842041... |
def connect _ sql ( path ) : global connection, cursor connection = sqlite3. connect ( path ) cursor = connection. cursor ( ) connection. commit ( ) cursor. execute ( " create table if not exists archive _ urls ( archiveid int, urlid int, date text, url text, " " foreign key ( archiveid ) references collection _ name (... | [
0.4124789237976074,
0.10330399870872498,
0.6972034573554993,
-0.41777464747428894,
0.490383505821228,
0.04503001272678375,
-0.1954977959394455,
-0.0612989142537117,
-0.5595870614051819,
0.9369521141052246,
0.24804061651229858,
-0.1412603110074997,
-0.12961801886558533,
0.43072542548179626,... |
def test _ fields _ get ( self ) : v = self. ep. get ( " volumes ", 1, _ _ fields = [ " id ", " name " ] ) self. assertequal ( set ( v. _ current. keys ( ) ), set ( [ " id ", " name " ] ) ) | [
-1.0938820838928223,
0.17381806671619415,
0.32875508069992065,
-1.222760558128357,
0.743439793586731,
0.1129031777381897,
-1.1118603944778442,
-0.5629485845565796,
-0.872761070728302,
-0.5458256602287292,
-0.5882664918899536,
-0.23269210755825043,
-0.45584914088249207,
-1.5574514865875244,... |
def test _ atomic _ hex _ binary _ pattern _ 4 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ pattern _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - pattern - 5. xsd ", instance = " nistdata... | [
-0.20118197798728943,
-0.5731328129768372,
0.4380752444267273,
0.748239278793335,
-0.4564093351364136,
0.08585099130868912,
-0.006022542715072632,
-0.36326900124549866,
-0.8708711266517639,
0.428541898727417,
-0.9874222278594971,
-0.2917356789112091,
-0.30837929248809814,
0.675622045993804... |
def addimageinput ( model, reader, batch _ size, img _ size, data _ type, cpu _ based, mean = 128., std = 128., scale = 256, mirror = 1, is _ test = false ) : data, label = brew. image _ input ( model, reader, [ " data ", " label " ], batch _ size = batch _ size, output _ type = data _ type, use _ gpu _ transform = not... | [
-1.019749641418457,
-0.06572256982326508,
0.6152511239051819,
-0.39329957962036133,
-0.8512811064720154,
0.6373852491378784,
0.19144423305988312,
-0.25047001242637634,
-0.45411959290504456,
0.46082454919815063,
0.2425900399684906,
0.5181155800819397,
0.09974423795938492,
0.4034788012504577... |
def test _ atomic _ any _ uri _ pattern _ 4 _ nistxml _ sv _ iv _ atomic _ any _ uri _ pattern _ 5 _ 4 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - pattern - 5. xsd ", instance = " nistdata / atomic / ... | [
-0.22552253305912018,
-0.43914932012557983,
0.44286325573921204,
0.8858233690261841,
-0.3086862564086914,
-0.30445972084999084,
0.46092087030410767,
-0.5695922374725342,
-0.36374205350875854,
-0.07124441117048264,
-0.008083105087280273,
-0.41786327958106995,
-0.938787579536438,
0.193217694... |
def chi2betapolarfunc ( params, xc, yc, r, th, nmax, im, nm ) : beta = params [ 0 ] if beta < 0. : print'warning : beta going negative, setting to 0. 0'beta = 0. print'beta : % f'% ( beta ) size = im. shape bvals = genpolarbasismatrix ( beta, nmax, r, th ) coeffs = solvecoeffs ( bvals, im ) mdl = np. abs ( img. constru... | [
0.16703587770462036,
-0.7017875909805298,
0.4527405798435211,
-0.4520455002784729,
0.7358748316764832,
0.1349141150712967,
-0.3562304675579071,
-0.6237285733222961,
-0.7059369087219238,
0.40533095598220825,
-0.5147109627723694,
0.2816338539123535,
-0.3098902106285095,
-0.12162662297487259,... |
def download ( ) : return response. download ( request, db ) | [
-0.037152886390686035,
-0.1380595862865448,
0.2984254062175751,
0.9521248936653137,
0.18304051458835602,
-0.7023032307624817,
-0.5359123349189758,
-0.44700971245765686,
0.14363490045070648,
-0.5366700887680054,
-0.36272886395454407,
-0.8455992341041565,
-0.6238225102424622,
-0.110281296074... |
def test _ atomic _ hex _ binary _ length _ 2 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ length _ 3 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - length - 3. xsd ", instance = " nistdata / ... | [
0.29994818568229675,
-0.08555418998003006,
0.45678356289863586,
0.4413241446018219,
0.013697133399546146,
0.6974229216575623,
-0.25746390223503113,
0.27229374647140503,
-0.2761947810649872,
0.6569920182228088,
-0.9754338264465332,
-0.3507055640220642,
0.04548272117972374,
0.416379481554031... |
def butter _ bandpass _ filter ( voltage, lowcut, highcut, fs, order = 5 ) : b, a = butter _ bandpass ( lowcut, highcut, fs, order = order ) filtdat = lfilter ( b, a, voltage ) return filtdat | [
-0.2274172157049179,
-0.6265209317207336,
0.4040761888027191,
0.0560908205807209,
-0.24298304319381714,
-0.5142519474029541,
-0.32530462741851807,
-0.17478546500205994,
-0.3242100179195404,
-0.8394548892974854,
-0.10868438333272934,
0.8423176407814026,
-0.13659265637397766,
0.1685001254081... |
def copy _ authorized _ keys ( target _ user ) : print ( green ('checking if the target user exists.') ) if run ('id - u { } '. format ( target _ user ), warn _ only = true ). failed : print ( red ('user does not exist.') ) return print ( green ('creating ssh directory with proper permissions if not present.') ) cmd ='... | [
-0.04414933919906616,
0.5593901872634888,
0.9392105340957642,
0.4598104953765869,
-0.5839365124702454,
0.5981196761131287,
0.011876854114234447,
-0.18923506140708923,
0.035125136375427246,
0.07486934959888458,
0.7633755803108215,
1.1033302545547485,
0.5801154971122742,
0.305230975151062,
... |
def process _ address ( self, address ) : self. process _ citation _ ref _ list ( address ) self. process _ notes ( address ) | [
-0.26172342896461487,
-0.6274908185005188,
0.35827234387397766,
-0.7935391664505005,
0.6482800841331482,
0.020946327596902847,
0.38338857889175415,
0.4970656633377075,
0.8098471760749817,
-0.15519683063030243,
0.11005902290344238,
0.6902115941047668,
0.09576182812452316,
0.9890661835670471... |
def split ( self, some _ property = none, split _ ids = none ) : assert split _ ids is none or some _ property is none, ( " can split either based on ids or based on some property " ) if split _ ids is none : split _ ids = _ split _ ids ( self. info, some _ property ) else : split _ ids = { split _ i : split for split ... | [
-0.4055590033531189,
0.09575090557336807,
0.42151832580566406,
0.11114515364170074,
-1.0254250764846802,
-0.6863887906074524,
-0.05760982632637024,
0.6649013757705688,
0.24523384869098663,
-0.2661796510219574,
-0.01639488898217678,
-0.14194004237651825,
0.08076276630163193,
-0.690082490444... |
def load ( path ) : image = cv. imread ( path, cv. imread _ unchanged ) if image is not none : return cv. cvtcolor ( image, cv. color _ bgr2gray ) else : print ('error : ( file not found ) :'+ str ( path ) ) sys. exit ( 0 ) | [
0.1340002864599228,
0.2584717869758606,
0.7975887060165405,
-0.07194337993860245,
-0.24514378607273102,
0.7437005639076233,
-0.04747588559985161,
-0.6056936383247375,
0.05346386134624481,
1.0177996158599854,
1.1720154285430908,
0.38741007447242737,
-0.4785062372684479,
-0.13251657783985138... |
def gameover ( self ) : if haswon ('x') or haswon ('o') or self. count > = 8 : return true else : return false | [
-0.811568021774292,
0.29275763034820557,
0.538103461265564,
0.349308580160141,
-0.3172009587287903,
0.326715886592865,
-0.8350545763969421,
-0.0603109747171402,
-0.38810187578201294,
0.42620524764060974,
-0.023719439283013344,
-0.5560569763183594,
-0.29967427253723145,
-0.00981671456247568... |
def parent _ id ( self ) - > pulumi. output [ str ] : return pulumi. get ( self, " parent _ id " ) | [
1.612596869468689,
0.08412669599056244,
0.21480730175971985,
0.46129223704338074,
0.2813355028629303,
1.0096750259399414,
0.5546717643737793,
-0.31680750846862793,
0.28552621603012085,
-0.07297259569168091,
0.5265750288963318,
0.9971104860305786,
-0.41166001558303833,
-0.8406676054000854,
... |
def set _ input ( self, ext _ current ) : # if i is scalar, cast to array if isinstance ( ext _ current, float ) : ext _ current = np. ones ( ( self. n _ points, ) ) * ext _ current # input must have correct shape : at least n _ points assert len ( ext _ current ) > = self. n _ points self. ext _ current = ext _ curren... | [
-0.9908247590065002,
0.15699337422847748,
0.6202638149261475,
0.6195525527000427,
-0.5132480263710022,
0.9376847743988037,
0.4638506770133972,
-0.009622426703572273,
0.6507944464683533,
0.6719534993171692,
-0.3298718333244324,
0.9553699493408203,
-0.49177584052085876,
0.03419140353798866,
... |
def _ process _ logic _ operators ( self, preds : str ) : op = all res _ list = [ ] preds =''. join ( c for c in preds if c not in " ) ( " ) self. to _ print = preds if " or " in preds : # all ors, per specification op = any res _ list = preds. split ( " or " ) elif " and " in preds : # all ands op = all res _ list = p... | [
-0.5544797778129578,
-1.1541955471038818,
0.6463848948478699,
-0.5016068816184998,
-0.3689740300178528,
-0.6455753445625305,
-0.5403081774711609,
1.2313703298568726,
0.23885366320610046,
0.48640599846839905,
0.3286627233028412,
-0.12366793304681778,
0.05179737135767937,
0.02597555704414844... |
def on _ epoch _ end ( self, epoch, logs = none ) : if not logs : return self. _ next _ step = epoch + 1 train _ loss = logs [ " loss " ] val _ loss = logs [ " val _ loss " ] mlflow. log _ metrics ( { self. train _ loss : train _ loss, self. val _ loss : val _ loss }, step = epoch ) # if val _ loss < self. _ best _ val... | [
-0.4892636835575104,
-0.8501894474029541,
0.5715383291244507,
0.44648516178131104,
0.18589402735233307,
0.12555311620235443,
-0.775567889213562,
0.4311560392379761,
-1.1839404106140137,
-0.4709737300872803,
-0.6180076599121094,
0.13967293500900269,
1.1791874170303345,
0.9500952363014221,
... |
def delete ( self, org, sddc, network _ id, ) : return self. _ invoke ('delete ', {'org': org,'sddc': sddc,'network _ id': network _ id, } ) | [
0.21336401998996735,
0.6339878439903259,
0.2968777120113373,
0.538709282875061,
0.9399306774139404,
-0.11824387311935425,
-0.41514459252357483,
-0.12469804286956787,
0.9445127248764038,
-0.9084958434104919,
0.09569638967514038,
0.13575494289398193,
-0.5033603310585022,
0.1359875351190567,
... |
def start ( cls ) : if cls in mongo. contexts : raise nestedconnection ( " do not nest a connection within itself, it " " may cause undefined behavior. " ) if ( pyconfig. get ('humbledb. allow _ explicit _ request ', true ) and _ version. _ lt ('3. 0. 0') ) : cls. connection. start _ request ( ) mongo. contexts. append... | [
-0.6319577097892761,
0.5237202048301697,
0.8826035857200623,
1.019724726676941,
0.6833967566490173,
0.5598998665809631,
-0.10413690656423569,
0.1968384087085724,
0.23676887154579163,
-0.6577041149139404,
0.20274902880191803,
0.8887974619865417,
-0.4347248077392578,
0.5570592284202576,
-0... |
def rescale _ annotations ( self, new _ resolution ) : scale _ factor = float ( new _ resolution [ 0 ] ) / self. _ video _ resolution [ 0 ] self. _ video _ resolution = new _ resolution for i in range ( self. _ num _ objects ) : for j in range ( self. _ annotations [ i ]. length ( ) ) : bb = self. _ annotations [ i ]. ... | [
-0.35349607467651367,
-0.6685918569564819,
0.603265106678009,
0.49555787444114685,
-0.02197234332561493,
-0.5239277482032776,
-0.3850089907646179,
-0.19489210844039917,
-0.14187753200531006,
1.3235194683074951,
-0.6098184585571289,
0.46127191185951233,
-0.30508267879486084,
0.9754922389984... |
def test _ atomic _ id _ pattern _ 3 _ nistxml _ sv _ iv _ atomic _ id _ pattern _ 4 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - pattern - 4. xsd ", instance = " nistdata / atomic / id / schema + instance... | [
0.008822954259812832,
-0.4754740297794342,
0.42092153429985046,
0.3441157341003418,
-0.6112315058708191,
0.15465858578681946,
-0.13809166848659515,
-0.2660970985889435,
0.036445148289203644,
0.8132181167602539,
-0.3225301206111908,
0.06117742508649826,
0.13852530717849731,
-0.3977848887443... |
def get _ many ( self, query : mapping [ str, any ], context : pipelinecontext = none, streaming : bool = false ) - > iterable [ t ] : result = self. _ source. get _ many ( self. _ source _ type, deepcopy ( query ), context ) logger. info ( " got results \ " { result } \ " from query \ " { query } \ " of source \ " { s... | [
-1.3455020189285278,
1.109847068786621,
0.8956684470176697,
-0.3324454724788666,
0.4024781286716461,
-1.0450150966644287,
-0.5948765277862549,
-0.6466032266616821,
0.22366130352020264,
-0.46199551224708557,
0.053793054074048996,
0.5969116687774658,
-0.3223276436328888,
0.9724968075752258,
... |
def addnewcompositefilter ( self ) : name = " composite " idx = 1 while len ( [ c for c in self. _ compositefilters if c. getname ( ) = = name ] ) > 0 : idx + = 1 name = f " composite _ { idx } " compositefilter ( name, self ) return name | [
-1.4062268733978271,
-0.563918948173523,
0.7908394932746887,
-0.21477171778678894,
0.2414623200893402,
-0.09233786165714264,
0.7198298573493958,
-0.5632965564727783,
-0.3162520229816437,
-0.5245711207389832,
-0.5286926031112671,
-0.7590358853340149,
-0.6888284683227539,
0.23314642906188965... |
def get _ source ( self, event _ name : str ) - > dict : return lapi. get _ source ( self. lasif _ comm, event _ name, self. comm. project. current _ iteration ) | [
-0.03761837258934975,
0.9741349816322327,
0.30855563282966614,
-0.6480750441551208,
-0.9831225872039795,
-0.4326452314853668,
-0.17035743594169617,
-0.030170893296599388,
-0.3528984785079956,
0.7787524461746216,
-0.9996559023857117,
-0.3739178776741028,
-0.150583416223526,
0.40320670604705... |
def getthing ( self, thingtypeid, thingid ) : thingurl = apiclient. thingurl % ( self. host, thingtypeid, thingid ) r = requests. get ( thingurl, auth = self. credentials, verify = self. verify ) status = r. status _ code if status = = 200 : self. logger. debug ( " thing instance was successfully retrieved " ) return r... | [
-1.3999053239822388,
-0.6475173830986023,
0.7847347259521484,
-0.340918630361557,
-0.21120361983776093,
-0.2645460069179535,
-1.302983045578003,
-0.7409456372261047,
-0.6472430229187012,
0.3906547725200653,
0.022015642374753952,
1.4639102220535278,
-1.1614229679107666,
-0.391311913728714,
... |
def collect _ send ( ) : condition = realtime ( ) print " starting to collect data... " while condition! ='end': if try _ connection ( ) = = false : print " connection error. could not open webpage server. " elif condition! = none : sensordata1 = { " _ id " : startid, " sensordata " : condition } while true : try : soc... | [
-0.0544612854719162,
-0.6254122257232666,
0.7109423875808716,
0.12673141062259674,
0.006250799633562565,
0.5516385436058044,
0.06327464431524277,
-1.0768966674804688,
-0.8589959740638733,
0.4480675756931305,
-0.12076698988676071,
0.8160983920097351,
0.08994011580944061,
0.8982294797897339,... |
def move ( location, option = none ) : new _ location = option if new _ location! = none : location = room _ finder ( new _ location ) print ( ) print ('you are now in ', location. name ) print ( location. descript ) print ( ) location. been + = 1 else : print ( ) print ('you are in the ', location. name ) print ( ) pr... | [
-1.2830966711044312,
-0.4546075463294983,
0.8243243098258972,
0.44910603761672974,
-0.6590467691421509,
0.11570343375205994,
0.8246025443077087,
0.05609249696135521,
0.06651337444782257,
0.3056738078594208,
-0.29697564244270325,
0.46203094720840454,
-0.6975060105323792,
0.708228349685669,
... |
def test _ record _ rejection _ in _ rejected _ state _ no _ replacedby ( ) : with open ( '. / src / test / cve _ tests / cve _ record _ fixtures / rejectexisting. json') as json _ file : data = json. load ( json _ file ) res = requests. put ( f'{ env. awg _ base _ url } { cve _ url } / cve - 1999 - 0008 / reject ', he... | [
0.104859359562397,
0.19767305254936218,
0.4642512798309326,
-0.5966065526008606,
0.3414904773235321,
0.5351117849349976,
-0.004636652301996946,
0.9145343899726868,
-0.16258971393108368,
0.6675253510475159,
-0.7734062075614929,
0.8122064471244812,
-0.11193275451660156,
-0.9108852744102478,
... |
def renameapp ( self, oldname, newname ) : if oldname! = newname : self. _ checkuniquename ( self. _ applications, newname ) self. applicationbyname ( oldname ). setname ( newname ) self. setdirty ( true ) | [
-0.5562164783477783,
-1.3399678468704224,
0.49601510167121887,
0.31486421823501587,
-0.6102800965309143,
0.3985777497291565,
-0.5163467526435852,
-0.25775012373924255,
0.12385516613721848,
1.4839646816253662,
-0.19741016626358032,
0.9247028231620789,
0.388192743062973,
0.41484346985816956,... |
def test _ atomic _ id _ enumeration _ 2 _ nistxml _ sv _ iv _ atomic _ id _ enumeration _ 3 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - enumeration - 3. xsd ", instance = " nistdata / atomic / id / schem... | [
-0.20341874659061432,
-0.4023149013519287,
0.5696779489517212,
0.21866632997989655,
-0.1749284714460373,
0.5177236199378967,
-0.24586190283298492,
-0.15705189108848572,
0.8697454929351807,
1.0672959089279175,
-0.16813157498836517,
0.18977035582065582,
0.13900010287761688,
-0.49086168408393... |
def prepare _ request ( city, checkin = none, checkout = none, price _ min = none, price _ max = none, currency ='usd') : url = f'https : / / www. airbnb. com / s / { city } / homes /?'if checkin and checkout : url + = f'& checkin = { checkin } & checkout = { checkout }'if price _ min and price _ max : url + = f'& pric... | [
-0.2382640242576599,
0.34487810730934143,
0.8112161755561829,
0.8637041449546814,
0.18979811668395996,
0.49741047620773315,
-1.507353663444519,
-0.21887575089931488,
0.19194424152374268,
0.01586880348622799,
0.1923239529132843,
0.561482846736908,
0.09501498192548752,
0.10055124014616013,
... |
def test _ _ validate _ keyword _ presets _ _ 1 ( ) : for input _ value in ( 12. 6, ) : with vampytest. assert _ raises ( typeerror ) : validate _ keyword _ presets ( input _ value ) | [
-0.0420830212533474,
0.7467409372329712,
0.46758612990379333,
1.4753146171569824,
-0.44184041023254395,
0.794661283493042,
0.16349446773529053,
-1.0744996070861816,
0.12615828216075897,
0.18371039628982544,
0.018213974311947823,
-0.4082321524620056,
-0.9805888533592224,
1.1218353509902954,... |
def test _ atomic _ base64 _ binary _ max _ length _ 4 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ max _ length _ 5 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - maxlength - 5. xsd ... | [
0.19729557633399963,
-0.030064238235354424,
0.23933984339237213,
1.1337422132492065,
-0.2851143181324005,
-0.13042446970939636,
0.02226961962878704,
-0.4323398768901825,
-0.30356094241142273,
0.6842005252838135,
-0.8620986342430115,
-0.10943949222564697,
-0.8100507259368896,
0.292074352502... |
def successors ( self ) : # list of successors neighbors = [ ] # getting name of cities in the problem cities = self. names ( ) # swapping the neughbors cities to create successor for i in range ( len ( cities ) ) : neighbor = cities. copy ( ) temp = cities [ i ] if i < len ( cities ) - 1 : neighbor [ i ] = neighbor [ ... | [
-0.7807725071907043,
-0.5354526042938232,
0.6841029524803162,
0.1212104931473732,
-0.32191652059555054,
0.8809244632720947,
-0.22753503918647766,
0.30627724528312683,
0.4030762314796448,
0.7659892439842224,
-1.2170454263687134,
0.2901771366596222,
-0.5965437889099121,
0.24111521244049072,
... |
def recognize ( self, wav ) : # making a file temp for manipulation handle, flac _ file _ name = mkstemp ('tmpspeechfile. flac') try : # convert wav to flac audio. save _ flac ( self. cfg, flac _ file _ name, wav ) json _ hypotheses = self. get _ asr _ hypotheses ( flac _ file _ name ) except ( urllib2. httperror, urll... | [
-0.7033000588417053,
-0.0697227194905281,
0.5858165621757507,
-0.019752172753214836,
0.5348145365715027,
0.2234938144683838,
-0.08469647169113159,
0.3251451253890991,
0.5847612023353577,
0.36527177691459656,
-0.8939473032951355,
0.4015079736709595,
-0.6501721739768982,
1.0650800466537476,
... |
def stop ( self ) : self. _ osc. stop ( ) | [
-0.28339603543281555,
-0.40372008085250854,
0.12390998005867004,
-0.25924795866012573,
0.9030120372772217,
0.3296022415161133,
1.0030673742294312,
0.025167342275381088,
-1.6256260871887207,
-0.6338218450546265,
-0.06109033524990082,
0.511698305606842,
-0.6669322848320007,
-0.03716726228594... |
def vector2angles ( gaze _ vector ) : gaze _ angles = np. empty ( ( 1, 2 ), dtype = np. float32 ) gaze _ angles [ 0, 0 ] = np. arctan ( - gaze _ vector [ 0 ] / - gaze _ vector [ 2 ] ) # phi = arctan2 ( x / z ) gaze _ angles [ 0, 1 ] = np. arcsin ( - gaze _ vector [ 1 ] ) # theta = arcsin ( y ) return gaze _ angles | [
-0.8877793550491333,
-0.27730584144592285,
0.34894758462905884,
0.0459047369658947,
-0.10696889460086823,
0.3679352402687073,
0.23443616926670074,
-0.18587277829647064,
0.1689213663339615,
1.0066399574279785,
-0.9869118928909302,
0.858077883720398,
-0.14664658904075623,
0.13781236112117767... |
def getoidsfromservice ( self, url, querytext, usecustomheaders = false, additionalparameters = none ) : # data to be sent to api - " where 1 = 1 " pulls all features, we want objectids only params = {'f':'pjson ','where': querytext,'outsr':'4326 ','returnidsonly':'true ','returngeometry':'false ','orderbyfields':'obje... | [
-0.8855637311935425,
-0.2044149786233902,
0.9594416618347168,
-0.2434803694486618,
-0.3400690257549286,
0.027479924261569977,
-0.3121897280216217,
-0.49144020676612854,
0.010068564675748348,
0.03105819970369339,
-0.3734400272369385,
0.5700255036354065,
-0.7436536550521851,
-0.2881496548652... |
def _ get _ axes _ mapping ( ops ) : max _ shape = [ 1 ] * max _ axes avg _ stride = [ 0 ] * max _ axes avg _ denom = 0. 0 axes = range ( max _ axes ) reduction _ axis = none take _ axes = [ ] # find maximum shape and check for reductions for op in ops : if op [ 0 ] = = " take " : assert reduction _ axis! = op [ 4 ] ta... | [
0.38220903277397156,
0.5387352108955383,
1.2460129261016846,
0.025082988664507866,
-0.8875007629394531,
0.11264931410551071,
1.7042235136032104,
-0.5633683800697327,
-0.016840018332004547,
0.6609315276145935,
-0.08218397945165634,
-0.29978591203689575,
0.14185231924057007,
0.20602375268936... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.