text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def is _ rectangle ( coords ) : # look for four segments defined by five points has _ four _ segments = ( len ( coords ) = = 5 ) if has _ four _ segments : # the fifth point should be the same as the first is _ closed = ( coords [ 0 ] = = coords [ 4 ] ) if is _ closed : # test sides for both clockwise or counterwise or... | [
-0.19231268763542175,
0.7137395739555359,
0.6059248447418213,
0.12430541217327118,
0.29775941371917725,
-0.07221624255180359,
0.3974301218986511,
-0.41093918681144714,
0.7388827204704285,
-0.3051832914352417,
0.009000618010759354,
-1.0290769338607788,
-0.8154823780059814,
-0.30745282769203... |
def test _ atomic _ boolean _ white _ space _ 2 _ nistxml _ sv _ iv _ atomic _ boolean _ white _ space _ 3 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / boolean / schema + instance / nistschema - sv - iv - atomic - boolean - whitespace - 3. xsd ", instance = " nistdat... | [
-0.22816278040409088,
0.04842490330338478,
0.5074418783187866,
0.3761983811855316,
-0.2181859314441681,
0.5142592191696167,
0.22866478562355042,
-0.5106525421142578,
-0.03884279727935791,
1.2001171112060547,
-0.39897364377975464,
0.4357641637325287,
-0.063776396214962,
0.2730306386947632,
... |
def powerlaw ( x, y ) : lnx = np. log ( x ) lny = np. log ( y ) xmat = linear ( lnx ) return linearregression ( xmat, lny ) | [
1.3408180475234985,
-0.23146377503871918,
0.5880805253982544,
-1.0050463676452637,
-0.21825715899467468,
0.04498062655329704,
-2.230963945388794,
-0.15256854891777039,
-0.26243340969085693,
0.15769262611865997,
0.5363510847091675,
0.3192957937717438,
0.1559174507856369,
-0.6848902702331543... |
def run _ cmd ( * args, * * kwargs ) : myprint ('cmd : ', * args ) subprocess. check _ call ( * args, * * kwargs ) | [
0.504213809967041,
-0.5643260478973389,
0.7616077065467834,
-0.042529795318841934,
0.2786425054073334,
0.769780695438385,
-0.9641367793083191,
-0.024891652166843414,
-0.36475464701652527,
-0.8563631176948547,
0.35831156373023987,
1.289937973022461,
-0.4371349513530731,
-0.14761605858802795... |
def conjugate _ gradient ( b, cg _ iters, residual _ tol ) : p = b. clone ( ). data r = b. clone ( ). data x = np. zeros _ like ( b. data. cpu ( ). numpy ( ) ) rdotr = r. double ( ). dot ( r. double ( ) ) for _ in range ( cg _ iters ) : z = hessian _ vector _ product ( variable ( p ) ). squeeze ( 0 ) v = rdotr / p. dou... | [
0.3159812092781067,
0.3782423734664917,
0.7050307989120483,
0.04183295741677284,
-0.8203279972076416,
0.6897706985473633,
0.23948240280151367,
0.7092260122299194,
-0.2990126311779022,
0.554302453994751,
0.5551098585128784,
-0.07231896370649338,
-1.238460659980774,
-0.5705476403236389,
0.... |
def readrdf ( filename ) : g = rdflib. conjunctivegraph ( ) result = g. parse ( filename, format ='trig') # for subj, pred, obj in g : # print ( subj, pred, obj ) # if ( subj, pred, obj ) not in g : # raise exception ( " it better be! " ) # print ( len ( result ) ) rdf _ string = g. serialize ( format = " trig " ). dec... | [
0.2203426957130432,
-1.0999916791915894,
0.6221457123756409,
-1.0768438577651978,
-0.5887823700904846,
0.3052779734134674,
0.45869383215904236,
0.45127078890800476,
-0.7197262644767761,
0.14475776255130768,
-0.02653428353369236,
0.05093066021800041,
-0.4754702150821686,
-0.3319680690765381... |
def update ( self, request, * args, * * kwargs ) : version = self. get _ object ( ) if len ( request. files. getlist ( " files " ) ) > 1 : return response ( status = 400, data = { " errors " : [ " referral version documents cannot be created with more than one file. " ] }, ) try : file = request. files. getlist ( " fil... | [
-0.13625332713127136,
-0.5410387516021729,
0.596446692943573,
-0.04956959933042526,
0.30971020460128784,
0.44679775834083557,
0.5372010469436646,
-0.0044006360694766045,
-0.3012477457523346,
1.0851489305496216,
-0.44331392645835876,
-0.3718360364437103,
-1.0455186367034912,
0.1294548362493... |
def get _ absolute _ url ( self ) : return reverse ('project _ detail ', args = [ self. id ] ) | [
0.15381385385990143,
0.1234101802110672,
0.48738357424736023,
0.003371111350134015,
1.1603373289108276,
1.4887250661849976,
-0.1881340891122818,
0.5822889804840088,
-0.6056764125823975,
-0.37925392389297485,
0.6509811282157898,
0.805697500705719,
0.17411400377750397,
0.2915070652961731,
... |
def exclude _ coords ( self, rule ) : for cls in self. classes : if not hasattr ( rule, cls ) : continue base _ set = [ tuple ( c ) for c in self. mask _ coords [ cls ] ] for exclude in getattr ( rule, cls ) [ " excludes " ] : exclude _ set = [ tuple ( c ) for c in self. mask _ coords [ exclude ] ] base _ set - = exclu... | [
-0.7271002531051636,
0.08229660242795944,
0.7341123819351196,
-0.30365386605262756,
0.21782167255878448,
1.258522629737854,
1.1873372793197632,
-0.25929129123687744,
0.2288370132446289,
-0.016142556443810463,
-0.2037520706653595,
-0.07634323835372925,
0.09309136867523193,
0.110871277749538... |
def _ _ delitem _ _ ( self, job _ name ) : retry = 3 while job _ name in self and retry : try : delete _ job _ url = self [ job _ name ]. get _ delete _ url ( ) self. jenkins. requester. post _ and _ confirm _ status ( delete _ job _ url, data ='some random bytes...') self. jenkins. poll ( ) except exception. jenkinsap... | [
-0.058769069612026215,
0.07218365371227264,
0.4470275938510895,
0.8021234273910522,
0.2587638795375824,
0.14484471082687378,
-0.45827481150627136,
-0.025087885558605194,
0.38793855905532837,
-0.21942076086997986,
-0.4423259496688843,
0.10748708993196487,
-1.1491446495056152,
0.091014221310... |
def _ nll ( p, gp, y, priorfn = none ) : # apply priors on gp hyperparameters if priorfn is not none : if not np. isfinite ( priorfn ( p ) ) : return np. inf # catch singular matrices try : gp. set _ parameter _ vector ( p ) except np. linalg. linalgerror : return np. inf ll = gp. log _ likelihood ( y, quiet = true ) r... | [
0.269722580909729,
-0.1117406040430069,
0.5407665371894836,
-0.027204185724258423,
-0.44582316279411316,
0.08502496778964996,
-0.6922058463096619,
0.5142399668693542,
0.22066658735275269,
-0.31654417514801025,
0.852641761302948,
0.18507182598114014,
-0.17501868307590485,
0.476596474647522,... |
def new _ vera _ device ( cls, device _ id : int ) - > veradevice : vera _ device = magicmock ( spec = cls ) # type : veradevice vera _ device. device _ id = device _ id vera _ device. name = f " dev $ { device _ id } " return vera _ device | [
0.029558632522821426,
0.17119725048542023,
0.26054683327674866,
0.5947386622428894,
-0.2781735956668854,
0.5803118944168091,
-0.060298945754766464,
0.2537941038608551,
0.4775198698043823,
-1.1297221183776855,
-0.08181687444448471,
0.2675098478794098,
0.5283688306808472,
0.9755503535270691,... |
def all ( mtx, datecol, astcol, bmkcol, risk _ free _ rate ) : results = {'daily': treynor ( mtx, datecol, astcol, bmkcol, risk _ free _ rate, utl. math. interp. linear, utl. date. day ),'weekly': treynor ( mtx, datecol, astcol, bmkcol, risk _ free _ rate, utl. math. interp. linear, utl. date. week ),'monthly': treynor... | [
0.7323344945907593,
0.8148443102836609,
0.6398643851280212,
-1.1474215984344482,
-0.42830178141593933,
-0.6088271141052246,
-0.6655932664871216,
-0.6683884859085083,
-0.9200182557106018,
0.22799773514270782,
-0.08877961337566376,
-0.5527896881103516,
0.8530368804931641,
-0.0898070186376571... |
def execute _ task ( task, * * kw ) : spec = {'cmd':'python ', } | [
-0.059704963117837906,
-0.1512240469455719,
0.1961195319890976,
1.140193223953247,
0.9676252007484436,
0.39773106575012207,
0.016554169356822968,
0.48261162638664246,
-0.619515597820282,
-0.2822495996952057,
-0.47058814764022827,
0.39787018299102783,
1.2361961603164673,
0.12352228164672852... |
def get ( self, name ) : full _ path _ to _ trashinfo _ file = os. path. join ( self. trashinfo _ path, name ) trashinfo = none with open ( full _ path _ to _ trashinfo _ file,'r') as trashinfo _ file : trashinfo = json. load ( trashinfo _ file ) return trashinfo | [
0.42021286487579346,
-1.141626000404358,
0.5208933353424072,
-1.7198340892791748,
-0.4257444441318512,
-0.26410964131355286,
-0.4921632707118988,
-0.9678419232368469,
-0.5724690556526184,
-0.41690415143966675,
-1.5928202867507935,
-0.09442649036645889,
0.41587990522384644,
-0.7705844640731... |
def ids _ updated _ sd ( cls, date, freq = " w " ) : _ tmtp = date. timetuple ( ) if freq = = " w " : _ sql _ base = " select distinct fund _ id from fund _ nv \ where statistic _ date ='{ date }'and { nv } > 0. 2 and statistic _ date > ='1970 - 01 - 02'". format ( date = date, nv = cls. _ nv ) _ criteria = " and fund ... | [
-0.28700363636016846,
0.11441497504711151,
0.9283555746078491,
0.25595831871032715,
-0.557422935962677,
-0.2192832976579666,
0.38663923740386963,
-0.545672595500946,
-0.01645965687930584,
-0.43608659505844116,
0.4257034361362457,
0.2704911231994629,
0.45305898785591125,
0.44811880588531494... |
def download _ userscript ( self ) - > none : try : print ('installing the hcaptcha solver userscript. ', end ='' ) self. window _ handles ( 1 ) # wait that tampermonkey tab loads. self. driver. get ('https : / / greasyfork. org / en / scripts / 425854 - hcaptcha'' - solver - automatically - solves - hcaptcha - in - br... | [
-0.3516075611114502,
-0.7816248536109924,
0.44823092222213745,
0.2616511881351471,
0.2806130349636078,
-0.265847772359848,
0.9358587265014648,
-0.3478640913963318,
-0.07623163610696793,
0.4765758812427521,
-0.5862419605255127,
0.06660138070583344,
0.0648484081029892,
0.34062090516090393,
... |
def bad _ header ( testlines ) : i = 3 while i < len ( testlines ) : if testlines [ 0 ]. strip ( )! = " p3 " : print ( " the files first line should be p3. " ) errorfile = true return errorfile break if testlines [ 2 ]. strip ( )! = " 255 " : print ( " the color depth must be 255. " ) errorfile = true return errorfile ... | [
0.33050471544265747,
-0.7403449416160583,
0.7988782525062561,
0.027590671554207802,
0.006337034050375223,
1.1837841272354126,
-0.08782821893692017,
-0.3219297230243683,
-0.6376451849937439,
-0.22255656123161316,
0.7180615067481995,
0.08464810997247696,
-0.8541151881217957,
0.22739273309707... |
def remove _ track _ from _ playlist ( self, track, playlist ) : # add the track. if playlist ['uri'] = = common. saved _ tracks _ context _ uri : q = { " ids " : [ track ['id'] ] } url = " me / tracks " self. delete _ api _ v1 ( url, data = q ) else : q = { " uris " : [ track ['uri'] ] } url = " playlists / { } / trac... | [
-0.3307293653488159,
0.3029996156692505,
0.43933606147766113,
0.8651124835014343,
-0.42540228366851807,
-0.07756588608026505,
-1.0963904857635498,
-0.24590586125850677,
-0.02971768192946911,
0.7062975764274597,
0.08150485157966614,
-0.2294400930404663,
-1.6516783237457275,
-0.5665774941444... |
def external _ ref ( self ) : return self. _ external _ ref | [
0.885003387928009,
-0.14313343167304993,
0.37060636281967163,
-0.03049817867577076,
-0.5803391933441162,
1.5347521305084229,
0.6244280338287354,
0.03114011511206627,
0.16241584718227386,
-0.2091781347990036,
0.4726933240890503,
0.8938001990318298,
-0.4476544260978699,
-0.22459080815315247,... |
def get _ readiness ( ) : if model _ mgr. model is none : raise httpexception ( status _ code = 503, detail = " model not ready " ) return { " isready " : " true " } | [
-1.256113052368164,
-0.04614734649658203,
0.43602028489112854,
-0.6374539136886597,
0.12119392305612564,
-0.5569567680358887,
-0.6518170237541199,
0.45391035079956055,
-0.2361731231212616,
1.1329914331436157,
-1.4559413194656372,
0.22101756930351257,
0.08679325878620148,
0.675865650177002,... |
def test _ add ( c, x1, y1, x2, y2, x3, y3 ) : p1 = point ( c, x1, y1 ) p2 = point ( c, x2, y2 ) p3 = p1 + p2 print _ ( " % s + % s = % s " % ( p1, p2, p3 ), end ='' ) if p3. x ( )! = x3 or p3. y ( )! = y3 : raise failedtest ( " failure : should give ( % d, % d ). " % ( x3, y3 ) ) else : print _ ( " good. " ) | [
0.5735884308815002,
-0.0362069196999073,
0.6519473791122437,
0.06914614886045456,
0.7090508937835693,
1.3946444988250732,
-0.36753299832344055,
-0.5915116667747498,
0.21563410758972168,
-0.1914713829755783,
-0.18870912492275238,
-0.28005608916282654,
-0.25414034724235535,
-0.60466873645782... |
def bokeh _ pr _ curve _ from _ y _ proba ( y _ proba : iterable [ float ], y _ true : iterable [ bool ], fig : figure = none, color : str ='blue ', legend = " default " ) - > layoutdom : precision, recall, thresholds = soft _ precision _ recall _ curve ( y _ true, y _ proba ) return bokeh _ pr _ curve _ raw ( precisio... | [
1.1550947427749634,
0.13407322764396667,
0.7546913027763367,
0.42151394486427307,
-0.5923238396644592,
-0.11372417211532593,
-0.18353362381458282,
0.5858598947525024,
-0.15361237525939941,
0.05009467154741287,
0.3032898008823395,
0.7569608092308044,
0.3811671733856201,
-0.9421804547309875,... |
def recall ( test _ set, recs, k = 10, userid _ subset = [ ] ) : if userid _ subset is none : userid _ subset = [ ] userid _ subset = set ( userid _ subset ) hits = [ pageid in recs [ userid ] [ : k ] for pageid, userid in zip ( test _ set. pageid, test _ set. userid ) if ( len ( userid _ subset ) = = 0 ) or ( userid i... | [
0.4318602383136749,
-0.02361348085105419,
0.3496536910533905,
-0.5122677683830261,
-0.3239388167858124,
-0.24214448034763336,
0.2417348325252533,
0.6750409603118896,
0.2978459298610687,
0.7229272723197937,
0.8935299515724182,
1.0814366340637207,
-0.7237476110458374,
-0.22328363358974457,
... |
def _ extract _ username _ from _ line ( self, line ) : if line : split _ by _ colon = line. split (':') if len ( split _ by _ colon ) > 1 : username _ segment = split _ by _ colon [ 1 ] split _ by _ exclamation = username _ segment. split ( '!') if split _ by _ exclamation : return split _ by _ exclamation [ 0 ] retur... | [
0.1152130588889122,
0.2861045300960541,
0.6292071342468262,
0.995546281337738,
-0.1337946504354477,
-0.42839115858078003,
0.054444458335638046,
1.183154821395874,
-0.1533915251493454,
0.7782449126243591,
-0.2989247441291809,
-0.35542455315589905,
-0.8169522881507874,
-0.8916857838630676,
... |
def get _ create _ load _ balancer _ flow ( self, topology, listeners = none ) : f _ name = constants. create _ loadbalancer _ flow lb _ create _ flow = linear _ flow. flow ( f _ name ) lb _ create _ flow. add ( lifecycle _ tasks. loadbalanceridtoerroronreverttask ( requires = constants. loadbalancer _ id ) ) # attachi... | [
0.9282755255699158,
-0.8970925807952881,
0.4396781027317047,
0.6048892140388489,
0.48224523663520813,
1.1267918348312378,
0.007706431206315756,
-0.4447854161262512,
0.35944443941116333,
0.10891776531934738,
-0.6742818355560303,
-0.4305574595928192,
-0.32899945974349976,
1.1151142120361328,... |
def int _ to _ char ( cmd _ x ) : i = 0 cmd _ r = ['~'] while ( i < len ( cmd _ x ) ) : cmd _ r + = chr ( int ( cmd _ x [ i ] ) ) i + = 1 return cmd _ r [ 1 : ] | [
-1.3432352542877197,
-1.01173996925354,
0.6905375719070435,
0.13852499425411224,
0.24982918798923492,
0.45302021503448486,
1.002562165260315,
-0.5290995836257935,
0.08252725005149841,
0.5410586595535278,
-0.15106749534606934,
-0.03649178892374039,
-0.289668470621109,
-0.20525455474853516,
... |
def run ( self, inputs : optional [ dict [ text, any ] ] = none, targets : optional [ list [ text ] ] = none, ) - > dict [ text, any ] :... | [
-0.8122183680534363,
-0.04904939979314804,
0.41093435883522034,
0.013674951158463955,
0.14045867323875427,
-0.7227872610092163,
-0.8434093594551086,
0.6376805305480957,
-0.24117349088191986,
-0.48312908411026,
-0.27292531728744507,
0.8001916408538818,
-0.29061561822891235,
0.07344255596399... |
def resolve ( value, replacements ) : if isinstance ( value, basestring ) : return resolve _ string ( value, replacements ) elif isinstance ( value, list ) : resolved = [ ] for v in value : resolved. append ( resolve ( v, replacements ) ) return resolved elif isinstance ( value, dict ) : for key, v in value. iteritems ... | [
-0.21484582126140594,
0.23364900052547455,
0.7041345238685608,
-0.15821292996406555,
-0.2476043552160263,
-1.0912458896636963,
-1.36394202709198,
0.8013438582420349,
0.21491596102714539,
-1.1510263681411743,
-0.8648231029510498,
-0.32757046818733215,
-0.5046945214271545,
0.4640948176383972... |
def pytest _ collection _ modifyitems ( config, items ) : if config. getoption ( " - - installation " ) : return skip _ install = pytest. mark. skip ( reason = " need - - installation option to run " ) for item in items : if " install " in item. keywords : item. add _ marker ( skip _ install ) | [
-0.3797149360179901,
0.026909366250038147,
0.529264509677887,
0.9278286695480347,
1.4481197595596313,
0.6906664967536926,
0.8778551816940308,
0.4629538357257843,
0.24100099503993988,
1.2301075458526611,
-0.20150244235992432,
-0.66607666015625,
-0.3228253424167633,
1.092236876487732,
0.39... |
def activate ( self ) : _ settingsmanager. loadappsettings ( self ) braille. setupkeyranges ( list ( self. braillebindings. keys ( ) ) ) speech. updatepunctuationlevel ( ) | [
-0.055259447544813156,
-0.9709256291389465,
0.3683106303215027,
0.5346867442131042,
0.1316700577735901,
-0.07684480398893356,
0.30420631170272827,
0.5727072954177856,
-0.1616964191198349,
0.833759605884552,
-0.9191860556602478,
0.48605236411094666,
-0.3124319314956665,
0.49651166796684265,... |
def deal ( self, players, num _ cards = 999 ) : for dummy in range ( 0, num _ cards ) : for player _ num in range ( len ( players ) ) : if self. is _ empty ( ) : break player = players. get _ player ( player _ num ) card = self. pop ( ) player. hand. push ( card ) players. set _ player ( player _ num, player ) | [
-0.4491313695907593,
0.22615060210227966,
0.6874557733535767,
0.7656724452972412,
1.7570334672927856,
-0.23295870423316956,
-0.018054187297821045,
0.4073334038257599,
0.15325064957141876,
0.9542790055274963,
-0.6640284657478333,
-0.39995402097702026,
-0.6514452695846558,
-0.041510406881570... |
def _ most _ recent _ embeddings _ dump ( embedding _ filenames, prefix _ dir ) : # filenames are the result of ` listdir `, so they should just be integers. # be sure to sort by value, and not lexigraphically, so that 100 > 99. return [ os. path. join ( prefix _ dir, str ( f ) ) for f in sorted ( embedding _ filenames... | [
-0.6313710808753967,
0.20381636917591095,
0.6453589200973511,
0.001562414807267487,
0.2279733270406723,
-0.2090354859828949,
0.5388761758804321,
0.6265894174575806,
0.3479727506637573,
0.45446133613586426,
0.5798037052154541,
-0.05371982976794243,
0.7936050295829773,
0.45252466201782227,
... |
def async _ trigger _ discovery ( hass : homeassistant, discovered _ devices : list [ sensemedevice ], ) - > none : for device in discovered _ devices : if device. uuid : discovery _ flow. async _ create _ flow ( hass, domain, context = { " source " : config _ entries. source _ integration _ discovery }, data = { conf ... | [
0.029797306284308434,
0.7184195518493652,
0.1805414855480194,
1.1450268030166626,
1.2209255695343018,
-0.7149144411087036,
0.6714940071105957,
0.7967022061347961,
0.6454576849937439,
-0.24691526591777802,
-0.8752743005752563,
0.12879952788352966,
0.7848612666130066,
0.5909728407859802,
-... |
def read _ lines ( filename = " ", nb _ lines = 0 ) : with open ( filename, encoding ='utf - 8') as fi : if nb _ lines : for countr in range ( nb _ lines ) : print ( fi. readline ( ), end ='' ) else : for line in fi : print ( line, end ='' ) | [
0.8943204879760742,
0.2006516009569168,
0.5779426693916321,
0.7078654766082764,
0.6872409582138062,
0.7283297181129456,
-0.5239508152008057,
0.6707819700241089,
-0.846618115901947,
-0.20101182162761688,
0.9467491507530212,
-0.25512591004371643,
0.3884851932525635,
0.39311084151268005,
-0... |
def _ map _ start _ sites ( ( chrom, strand ) ) : inbams = [ pysam. samfile ( infile,'rb') for infile in opts. bamfiles ] offset _ tallies = np. zeros ( ( opts. maxrdlen + 1 - opts. minrdlen, opts. maxrdlen ), np. uint32 ) for gcoord in gcoorddict [ ( chrom, strand ) ] : for read in _ get _ reads ( chrom, strand, gcoor... | [
0.6570336818695068,
-0.7060007452964783,
0.5785025954246521,
-0.8551903963088989,
-0.8209595084190369,
0.6392210721969604,
1.0475389957427979,
-0.08210576325654984,
0.44365230202674866,
0.08891887962818146,
0.04888981580734253,
0.9735546112060547,
0.1342543363571167,
-0.33327075839042664,
... |
def group _ items ( item _ list, groupid _ list, sorted _ = true ) : pair _ list _ = list ( zip ( groupid _ list, item _ list ) ) if sorted _ : # sort by groupid for cache efficiency try : pair _ list = sorted ( pair _ list _, key = op. itemgetter ( 0 ) ) except typeerror : # python 3 does not allow sorting mixed types... | [
-0.7834866046905518,
0.5850242972373962,
0.43580305576324463,
-0.10210056602954865,
0.3701387047767639,
-0.0717252567410469,
-0.04311641305685043,
0.2587803900241852,
-0.8275609612464905,
1.0691386461257935,
-0.6069441437721252,
-0.3427385687828064,
-0.9729097485542297,
0.5952427983283997,... |
def migrate ( self ) - > " whoisjson2csvmigrator " : file _ helper = filehelper ( self. source _ file ) if file _ helper. exists ( ) : self. dataset. set _ authorized ( true ) dataset = { " subject " : none, " idna _ subject " : none, " expiration _ date " : none, " epoch " : none, } delete _ file = true with file _ he... | [
-0.6177241206169128,
0.002435410162433982,
0.582825779914856,
-0.30871614813804626,
0.12051664292812347,
-0.3022019863128662,
-0.4757564067840576,
0.08737076073884964,
-0.05464290827512741,
-0.6580060720443726,
-0.2434045821428299,
0.4189399778842926,
0.2501588463783264,
-0.284865140914917... |
def get _ contact ( self, response : response ) - > dict : contact = {'email':'','phone':'','website': response. url,'meet':'' } contact ['email'] = response. xpath ( " string ( / / * [ @ id ='email'] ) " ). get ( ) phone = extract _ phone ( response. xpath ( " / / * [ @ id ='phonenumber'] / @ onclick " ). get ( ) ) if... | [
0.11429023742675781,
-0.694862961769104,
0.6063543558120728,
0.08421234041452408,
-0.1903875470161438,
-0.5471798181533813,
-0.03951249644160271,
-0.9266595840454102,
0.5607423782348633,
0.13512952625751495,
-0.16128407418727875,
-1.0857681035995483,
-0.24488769471645355,
0.328471839427948... |
def clean _ a _ tag _ attrs ( root, base _ url ) : for a _ tag in root. find _ all ( " a " ) : a _ tag. attrs = { " href " : urljoin ( base _ url, a _ tag. get ( " href ", " " ) ) } | [
0.04724135622382164,
-0.4752398729324341,
0.5182822346687317,
-0.8270957469940186,
-0.2255161553621292,
-0.3951896131038666,
-0.1321074366569519,
1.25307297706604,
-0.391856849193573,
0.11941204220056534,
0.1003657802939415,
-0.09236258268356323,
0.7305826544761658,
1.2476732730865479,
0... |
def _ normalize ( self, input _ df ) : # find scaling factor scaling _ factor = ( input _ df [ self. _ column _ names ] ). abs ( ). max ( ) # rescale values to between - 1 and 1 scaled = ( input _ df [ self. _ column _ names ] ) / scaling _ factor scaled * = self. _ column _ negations # rescale values to between 0 and ... | [
-0.9959639310836792,
-0.15850836038589478,
0.6574782729148865,
0.208131343126297,
-0.5734736323356628,
0.7652656435966492,
-0.24273312091827393,
0.07277218997478485,
-0.7674664855003357,
0.5449344515800476,
0.5995219945907593,
-0.04647940769791603,
-0.35273516178131104,
-0.0227145627140998... |
def _ list ( self, bucket _ name : str, versions : bool | none = none, max _ results : int | none = none, prefix : str | none = none, delimiter : str | none = none, match _ glob : str | none = none, user _ project : str | none = none, ) - > list : client = self. get _ conn ( ) bucket = client. bucket ( bucket _ name, u... | [
0.15170377492904663,
-0.6040085554122925,
0.8191822171211243,
0.10525017976760864,
0.09772557765245438,
-0.18134213984012604,
-0.8327199816703796,
0.12610478699207306,
0.3615662455558777,
0.7449907064437866,
-0.6786413192749023,
0.06309767812490463,
-0.21327394247055054,
-0.108579643070697... |
def escape _ combat ( self ) : if self. special _ ability = = " light " : escape _ chance = 80 # 20 - 100 : you gucci else : escape _ chance = self. dexterity * 10 escape = random. randrange ( 0, 100 ) if escape < = escape _ chance : return true else : return false | [
-0.5515936613082886,
0.2968222498893738,
0.651139497756958,
0.1569170206785202,
0.022489242255687714,
0.037728164345026016,
-0.6281325817108154,
-0.23885054886341095,
0.12471568584442139,
0.0718376412987709,
-0.06375187635421753,
-0.17440134286880493,
-0.14674246311187744,
0.05303283035755... |
def cleanworkspace ( ) : for filename in glob. glob ('*. zip') + glob. glob ('*. csv') : os. remove ( filename ) | [
0.2005094736814499,
-0.8129147887229919,
0.7030542492866516,
0.3644261360168457,
-0.15802446007728577,
0.39333102107048035,
0.6543489694595337,
0.008430163376033306,
0.38201671838760376,
-0.26087281107902527,
0.18694360554218292,
0.22148969769477844,
0.08954750746488571,
0.9467507004737854... |
def validate _ prestage ( subcloud, payload ) : log. debug ( " validating subcloud prestage'% s'", subcloud. name ) installed _ loads = [ ] software _ version = none if payload. get ( consts. prestage _ request _ release ) : software _ version = payload. get ( consts. prestage _ request _ release ) installed _ loads = ... | [
-0.16721391677856445,
0.6759264469146729,
0.8047511577606201,
0.619074821472168,
-0.42016327381134033,
0.6680997014045715,
0.6729123592376709,
-0.2578344941139221,
-0.0453181117773056,
-0.017241638153791428,
0.21936585009098053,
0.061692677438259125,
-0.751629650592804,
0.5937007665634155,... |
def sort ( li ) : sortedlist = [ ] miheap = minheap ( ) for i in li : miheap. append ( i ) for i in xrange ( len ( li ) ) : sortedlist. append ( miheap. pop ( ) ) return sortedlist | [
-0.07997086644172668,
-0.45350921154022217,
0.7463110089302063,
0.46787339448928833,
-0.7791675329208374,
0.3497358560562134,
-1.13569974899292,
-0.5828442573547363,
1.0033100843429565,
0.1805121898651123,
-1.4352561235427856,
-0.17983317375183105,
-1.5566489696502686,
0.6296716928482056,
... |
def add _ new _ quizset ( data ) : quizset = quizset ( test _ name = data ['test _ name'], teacher _ id = data ['teacher _ id'], test _ type _ id = data ['test _ type _ id'], student _ section _ id = data ['student _ section _ id'], time _ full _ test = data ['time _ full _ test'], student _ batch _ id = data ['student... | [
-0.8608477115631104,
-0.7084394693374634,
0.73493492603302,
-0.2961862087249756,
-0.11784854531288147,
0.3864358067512512,
0.18755300343036652,
-0.751734733581543,
0.3352351486682892,
-0.3315660357475281,
-0.06158867105841637,
-0.030694400891661644,
-1.4082618951797485,
-0.1516781598329544... |
def proposal _ target _ layer ( rpn _ rois, rpn _ scores, gt _ boxes, _ num _ classes, parsing _ labels = none ) : # proposal rois ( 0, x1, y1, x2, y2 ) coming from rpn # ( i. e., rpn. proposal _ layer. proposallayer ), or any other source all _ rois = rpn _ rois # ( 2000, 5 ) rpn _ post _ nms _ top _ n = 2000 rpn _ po... | [
-0.7983039021492004,
-0.14921098947525024,
0.8941825032234192,
0.18306200206279755,
0.37531784176826477,
0.04254697263240814,
0.0970659852027893,
-0.1738404631614685,
0.3336949050426483,
-0.3597303330898285,
0.11775773763656616,
0.4008922278881073,
0.2671935558319092,
-0.1822517216205597,
... |
def _ num _ days ( self, dt ) : return ( dt - date ( 2001, 1, 1 ) ). days | [
-0.6175886988639832,
1.0304644107818604,
0.43418997526168823,
-0.3136172890663147,
-1.3367125988006592,
0.552990198135376,
0.4911571741104126,
-0.9300621151924133,
0.052996668964624405,
-0.46178582310676575,
-0.596853494644165,
-0.32702410221099854,
1.206254482269287,
0.1610584557056427,
... |
def save _ model ( model, model _ filepath ) : pickle. dump ( model, open ( model _ filepath,'wb') ) | [
0.144057035446167,
-0.7072663903236389,
-0.1443483531475067,
0.010689521208405495,
1.3309953212738037,
1.2288682460784912,
0.15536393225193024,
-0.16722802817821503,
-0.7226673364639282,
1.397824764251709,
-1.6055797338485718,
-0.5998643636703491,
0.3100157380104065,
-0.10351315140724182,
... |
def test _ ack _ delay _ seconds ( self ) : batch _ id, msg _ id, all _ keys = ( yield self. msg _ seq _ helper. create _ ack _ event _ sequence ( event _ count = 3, delay _ seconds = 2 ) ) timestamps = [ parse _ vumi _ date ( ts ) for _, ts, _ in all _ keys ] self. assertequal ( timestamps [ 0 ] - timestamps [ 1 ], ti... | [
0.8873234391212463,
-0.054227475076913834,
0.5655819773674011,
0.529862105846405,
-0.05155664309859276,
0.20092956721782684,
0.15247300267219543,
0.22660388052463531,
-0.7894190549850464,
-0.06670157611370087,
-0.4001525342464447,
0.2450602799654007,
0.7840859293937683,
-0.0664842128753662... |
def prep _ image ( img, inp _ dim ) : orig _ im = img dim = orig _ im. shape [ 1 ], orig _ im. shape [ 0 ] img = letterbox _ image ( orig _ im, ( inp _ dim, inp _ dim ) ) img _ = img [ :, :, : : - 1 ]. transpose ( ( 2, 0, 1 ) ). copy ( ) img _ = torch. from _ numpy ( img _ ). float ( ). div ( 255. 0 ). unsqueeze ( 0 ) ... | [
-0.4558373987674713,
-0.6718435883522034,
0.6138863563537598,
-0.4143105447292328,
-0.795611560344696,
-0.06145203486084938,
0.3712463974952698,
0.43081241846084595,
-0.26098114252090454,
0.5035668015480042,
-0.1602858155965805,
0.43914657831192017,
0.7685158848762512,
-0.4185759127140045,... |
def add _ parameter _ update ( model ) : # this counts the number if iterations we are making iter = brew. iter ( model, " iter " ) # adds a lr to the model, updated using a simple step policy every 10k steps ; gamma is an update parameter lr = model. learningrate ( iter, " lr ", base _ lr = - args. base _ learning _ r... | [
-0.0014296658337116241,
-0.6891342997550964,
0.9121667146682739,
-0.27918022871017456,
0.1766800433397293,
0.675110399723053,
-0.5577422380447388,
0.34162014722824097,
-0.4577544629573822,
0.553798258304596,
-0.05521874502301216,
-0.20965148508548737,
-0.4102042615413666,
1.049742817878723... |
def path _ transformer ( vcr _ path ) : vcr _ path = path _ cassette _ dirname ( vcr _ path ) vcr _ path = _ vcr. vcr. ensure _ suffix ( ". yaml " ) ( vcr _ path ) return vcr _ path | [
0.6153791546821594,
-0.7109686136245728,
0.5327394604682922,
0.030428793281316757,
-0.07312178611755371,
-0.6208453178405762,
1.0285078287124634,
0.9748441576957703,
0.47087863087654114,
0.08010885864496231,
-0.056382615119218826,
-0.28707462549209595,
0.15224802494049072,
-0.0766539499163... |
def install _ dev ( session, extras, dilibraries = dilibraries ) : session. log ( f'run install _ dev in { lib _ name }') common _ setup ( session, extras = extras, dilibraries = dilibraries ) | [
-0.5773018002510071,
0.07656282931566238,
0.5430667400360107,
0.3381718099117279,
0.3038363456726074,
0.2691609859466553,
0.7029251456260681,
-0.03333641216158867,
0.8224507570266724,
-0.05183621123433113,
-0.052911531180143356,
-0.8868051767349243,
0.4511057734489441,
0.3174011707305908,
... |
async def async _ reload _ package _ platforms ( hass : homeassistant ) - > bool : for domain in [ auto _ domain, in _ bool _ domain, in _ dt _ domain, in _ num _ domain, in _ txt _ domain, script _ domain, template _ domain, timer _ domain, ] : try : await hass. services. async _ call ( domain, service _ reload, block... | [
-1.2456343173980713,
1.4938013553619385,
0.5487109422683716,
0.7347788214683533,
0.3326997756958008,
-0.0016275005182251334,
0.2040574848651886,
-0.8427777886390686,
-0.49576738476753235,
0.1493016630411148,
-0.41700467467308044,
0.4766066074371338,
-0.16666476428508759,
0.2749315202236175... |
def score _ determine ( self, j ) : division = j / / 2 score = division * 10 + 10 return score | [
-0.46640631556510925,
0.20174679160118103,
0.4636858105659485,
0.016845006495714188,
0.5708553194999695,
-0.8682366013526917,
0.6698556542396545,
-0.6410141587257385,
0.04009590297937393,
0.2841346859931946,
-0.6235955357551575,
-1.0756633281707764,
-0.03837483376264572,
0.7754848599433899... |
def scale _ up ( self ) : self. _ _ scale = min ( 1024, self. _ _ scale * 2 ) | [
0.049267902970314026,
-0.7394688725471497,
0.8015392422676086,
0.025545693933963776,
0.7128517627716064,
-0.11112785339355469,
-0.3127112090587616,
0.03202143684029579,
-0.549761950969696,
0.4887203276157379,
-0.10055384784936905,
0.7052069902420044,
-0.27213242650032043,
0.280591636896133... |
def delete _ bucket ( self, bucket _ name : str, force : bool = false, user _ project : str | none = none ) - > none : client = self. get _ conn ( ) bucket = client. bucket ( bucket _ name, user _ project = user _ project ) self. log. info ( " deleting % s bucket ", bucket _ name ) try : bucket. delete ( force = force ... | [
0.027842797338962555,
0.8056008815765381,
0.4271053969860077,
0.8465343713760376,
0.7371136546134949,
0.7976433038711548,
0.21705985069274902,
0.2540121376514435,
0.13391971588134766,
-0.2855217754840851,
-0.2393181174993515,
1.0886558294296265,
-0.028873275965452194,
0.14711712300777435,
... |
def train _ step ( x _ batch, y _ batch ) : feed _ dict = { cnn. input _ x : x _ batch, cnn. input _ y : y _ batch, cnn. dropout _ keep _ prob : flags. dropout _ keep _ prob, } _, step, summaries, loss, accuracy = sess. run ( [ train _ op, global _ step, train _ summary _ op, cnn. loss, cnn. accuracy ], feed _ dict ) t... | [
0.05087115988135338,
0.07941775023937225,
0.5578207969665527,
0.6031421422958374,
0.31125280261039734,
0.044756628572940826,
0.5777619481086731,
0.29788967967033386,
-1.340425729751587,
0.3319384455680847,
-0.7392959594726562,
0.656217098236084,
0.7016492486000061,
0.0761619433760643,
0.... |
def after _ login ( user _ id ) : # keep asking for input till true user _ input = input ( " select an action... \ npost question ( p ), search for posts ( s ), logout ( l ), exit ( e ) : " ) while user _ input. lower ( ) not in ['p ','s ','l ','e'] : user _ input = input ( " invalid input \ nselect an action... " " \ ... | [
-0.23863114416599274,
0.22305075824260712,
0.699219286441803,
0.4607073962688446,
-0.7072954773902893,
0.910728394985199,
0.45832592248916626,
-0.6584382653236389,
0.35399121046066284,
-0.40545976161956787,
-0.6853536367416382,
-0.23745658993721008,
-0.2851022779941559,
-0.0667737275362014... |
def save _ calibration _ image ( sys _ params, datetime _ string, centroids ) : filename = " calibration _ image _ " + datetime _ string + ". png " print print " saving calibration image in " + filename green = array ( [ 0, 255, 0 ], dtype = uint8 ) blue = array ( [ 0, 0, 255 ], dtype = uint8 ) def make _ center _ dot ... | [
-0.364532470703125,
-0.0609743669629097,
0.6662925481796265,
0.12886491417884827,
-0.2051212638616562,
-0.09516918659210205,
0.13204163312911987,
-0.6405169367790222,
-0.0917876809835434,
1.288055419921875,
-0.21230708062648773,
-0.20295147597789764,
0.5819665193557739,
0.8555189371109009,... |
def check _ aliens _ bottom ( stats, aliens, bullets, ai _ settings, ship, screen, sb ) : screen _ rect = screen. get _ rect ( ) for alien in aliens. sprites ( ) : if alien. rect. bottom > = screen _ rect. bottom : # gives same results as if aliens hits hip ship _ hit ( stats, aliens, bullets, ai _ settings, ship, scre... | [
-0.12883329391479492,
-0.3584030270576477,
0.6305888295173645,
0.6769371032714844,
0.7716563940048218,
-0.2673529386520386,
-0.14420431852340698,
-1.239617943763733,
0.05786668136715889,
-0.018943022936582565,
0.18345560133457184,
0.5133687257766724,
-0.021110165864229202,
0.39082667231559... |
def reviewpreviouscharacter ( self, inputevent ) : context = self. getflatreviewcontext ( ) moved = context. goprevious ( flat _ review. context. char, flat _ review. context. wrap _ line ) if moved : self. _ reviewcurrentcharacter ( inputevent ) self. targetcursorcell = self. getbraillecursorcell ( ) return true | [
-0.3191720247268677,
-0.6578366756439209,
0.6841038465499878,
-0.26552245020866394,
-0.3262726664543152,
0.38812509179115295,
0.7310625314712524,
-0.33798688650131226,
0.21579252183437347,
-0.06645341962575912,
-0.1922975331544876,
0.7355875968933105,
-0.686387836933136,
-0.106347389519214... |
def migration _ mode ( self ) - > optional [ str ] : return pulumi. get ( self, " migration _ mode " ) | [
0.2334192842245102,
1.175133466720581,
0.3846837878227234,
0.3889022171497345,
1.0598609447479248,
1.9385966062545776,
-0.8132272362709045,
-0.25682389736175537,
0.04417598247528076,
0.5860776305198669,
-0.16447752714157104,
-0.10891061276197433,
0.30435746908187866,
-0.8741051554679871,
... |
def _ _ init _ _ ( self, user = none, loop = none, auto _ start = true ) : if user is none : user = os. getenv ( " user " ) self. cron = crontab. crontab ( user = user ) self. file = _ _ file _ _ if " / " in _ _ file _ _ else os. path. dirname ( os. path. realpath ( _ _ file _ _ ) ) + " / " + _ _ file _ _ self. tasks =... | [
0.5056902170181274,
-0.32177734375,
0.6329857110977173,
1.2203142642974854,
-0.34351351857185364,
0.34264400601387024,
0.7959643602371216,
0.3926069736480713,
-0.8877204656600952,
-0.2697610557079315,
-0.5424114465713501,
0.2156689167022705,
0.2230295091867447,
0.6360957026481628,
0.4091... |
def rotkehlchen _ server ( cli _ args, username, blockchain, accountant, start _ with _ logged _ in _ user, start _ with _ valid _ premium, function _ scope _ messages _ aggregator, db _ password, rotkehlchen _ api _ key, rotkehlchen _ api _ secret, ) : with patch. object ( argparse. argumentparser,'parse _ args ', ret... | [
-0.06336319446563721,
-0.5835325717926025,
0.625432550907135,
-0.09260162711143494,
0.2606950104236603,
0.78455650806427,
0.12612417340278625,
-0.06338983029127121,
-0.21013043820858002,
0.2532046139240265,
0.02862650342285633,
0.602993369102478,
-0.9636390805244446,
0.03395864740014076,
... |
def id ( self ) : return self. _ id | [
0.8240097165107727,
-1.1357076168060303,
0.13086582720279694,
0.0036135695409029722,
0.9138023853302002,
1.698555827140808,
0.6586772799491882,
0.3193376362323761,
1.3688215017318726,
-1.044265627861023,
-0.312282532453537,
0.6268338561058044,
-0.4173087179660797,
-0.44475528597831726,
0... |
def xcountdistribution ( self ) : self. printstatus ( ) print " " " # # num : number of units / sequences per family # nunits : number of families with x units # nseq : number of families with x sequences # " " " print " num \ tnunits \ tnseq " sys. stdout. flush ( ) histograms = [ ] statement = " select nunits, count ... | [
0.8622530698776245,
0.4170452952384949,
0.5539544224739075,
-0.2059122771024704,
0.25865429639816284,
0.333812415599823,
0.5286816358566284,
0.08315350115299225,
0.08679483085870743,
-0.27676913142204285,
0.19565728306770325,
0.08344605565071106,
0.4906332790851593,
0.8767739534378052,
0... |
def test _ stats _ speed ( self ) : if self. system _ state. state! = " online " : self. skiptest ( " can not test stats speed while system is online " ) mapnum = self. ep. search ( " mappings ", _ _ limit = 0 ). total if mapnum < 50 : self. skiptest ( " stats speed testing requies at least 50 mapped volumes " ) should... | [
0.047437287867069244,
-0.30025774240493774,
0.7807962894439697,
0.1312822848558426,
0.4688376188278198,
0.17295096814632416,
0.30559036135673523,
-1.0824732780456543,
0.3383311629295349,
-0.9256492853164673,
0.30454158782958984,
-0.547886312007904,
0.11304134130477905,
0.5765265226364136,
... |
def traverse _ subtree _ post _ order ( self, position : _ position ) - > generator : if not position. is _ owned _ by ( self ) : raise valueerror ( " position doesn't belong to this tree " ) for i in self. get _ children ( position ) : for j in self. traverse _ subtree _ post _ order ( i ) : yield j yield position | [
-0.15569178760051727,
-0.24678383767604828,
0.5788936614990234,
0.38002482056617737,
-0.7488703727722168,
-0.26329532265663147,
-0.24366942048072815,
-0.9099348783493042,
-0.22534073889255524,
-0.25075259804725647,
-0.7470282316207886,
-0.5770889520645142,
-0.12047625333070755,
0.597600817... |
def calculate _ station _ weights ( self, event : str ) : # name weight set after event to know it weight _ set _ name = event # if set exists, we don't recalculate it if self. lasif _ comm. weights. has _ weight _ set ( weight _ set _ name ) : self. print ( f " weight set already exists for event { event } ", emoji _ ... | [
-0.33586612343788147,
0.2543553411960602,
0.3347571790218353,
-0.0816938653588295,
-0.41204753518104553,
-0.20585063099861145,
0.07331139594316483,
-0.7255943417549133,
-0.3639829158782959,
0.7350356578826904,
-0.4623412489891052,
-0.37986260652542114,
-0.5227555632591248,
0.81267702579498... |
def covered ( r, config ) : # fixme : we cheat for optimization here. i know that i never split rules, so a rule is covered exactly when there is a new rule with the exact same pattern and action return config. contains _ matching _ rule ( r ) # return set _ covers ( covers ( r, config ), r ) | [
0.345883846282959,
-0.08586931973695755,
0.48801958560943604,
0.9309591054916382,
-0.14989161491394043,
0.26000338792800903,
0.8856713175773621,
0.2154313176870346,
0.8202716708183289,
0.8189466595649719,
-0.32591965794563293,
-0.05563357472419739,
-0.16761349141597748,
0.3990943729877472,... |
def items ( self ) : return self. _ items | [
-1.0500119924545288,
-0.5457432270050049,
-0.009487077593803406,
-0.16103027760982513,
0.4017395079135895,
0.6133051514625549,
-0.13666261732578278,
-0.21719366312026978,
-0.02107986994087696,
-0.913513720035553,
-0.714752733707428,
-0.3215440511703491,
0.10993701964616776,
-0.616571187973... |
def get _ timestep ( self, id ) : return " dataset : " + str ( self. id ) + " \ ntimestep : " + str ( id ) + " \ n " | [
-0.42502936720848083,
-0.07719992101192474,
0.35997381806373596,
-1.1907603740692139,
-0.1483217477798462,
-0.4131934940814972,
-1.7726801633834839,
-0.2846280038356781,
-0.30645468831062317,
0.24284575879573822,
-0.535266101360321,
-0.04661067575216293,
0.40472760796546936,
0.723032236099... |
def watch ( self ) : self. _ client. fetch ( httpclient. httprequest ( self. _ url, if _ modified _ since = self. _ last _ modified ), self. _ handle ) | [
0.04996722191572189,
0.04192007705569267,
0.23306900262832642,
-0.24952270090579987,
0.9449269771575928,
0.13521042466163635,
-0.24055853486061096,
-0.4652121961116791,
-1.0806204080581665,
-0.9788129925727844,
0.2174171358346939,
1.6019231081008911,
0.10068432241678238,
-0.015991825610399... |
def wait ( self ) : if self. returned is none : self. thread. join ( ) if self. returned! = 0 : raise ioerror ( " gnupg exited non - zero, with code % d " % ( self. returned > > 8 ) ) | [
0.7174572944641113,
0.4649893343448639,
0.4592115581035614,
-0.15567834675312042,
1.120066523551941,
0.4334699809551239,
-0.3243505656719208,
-0.35471633076667786,
-1.2489739656448364,
-0.8910475969314575,
0.46555647253990173,
0.35788488388061523,
-1.53425133228302,
0.19356563687324524,
... |
def compress _ plaintext _ ballot ( ballot : plaintextballot ) - > compactplaintextballot : selections = _ get _ compact _ selections ( ballot ) extended _ data = _ get _ compact _ write _ ins ( ballot ) return compactplaintextballot ( ballot. object _ id, ballot. style _ id, selections, extended _ data ) | [
0.5397036671638489,
-0.5320389270782471,
0.1964987963438034,
-1.020932912826538,
-1.4778289794921875,
0.893869936466217,
-0.8441597819328308,
-0.6777953505516052,
0.6777306199073792,
-0.23860043287277222,
-0.7228983640670776,
0.36227619647979736,
-0.7113489508628845,
-0.4770117998123169,
... |
def teardown ( self ) - > none : pass | [
0.7798516750335693,
-0.7126468420028687,
0.10726147145032883,
0.0337580069899559,
1.313681721687317,
1.174445390701294,
2.0761988162994385,
0.44263312220573425,
0.376868337392807,
-1.1412506103515625,
-0.12788237631320953,
0.6646232008934021,
-0.8516342043876648,
0.1547846645116806,
-0.6... |
def embedding _ training ( self ) : logger. debug ( '.') if opt. save _ embed _ feat : return k _ train = self. _ k if opt. bg : k _ train = self. _ k + 1 if opt. resume : self. _ embedding = embedding ( embed _ dim = opt. embed _ dim, feature _ dim = opt. feature _ dim, n _ subact = k _ train ) self. _ embedding. load... | [
0.09093932062387466,
0.18750408291816711,
0.7215431928634644,
0.5781348347663879,
0.291443794965744,
0.10663870722055435,
0.6619815230369568,
0.8042022585868835,
-0.13094627857208252,
-0.23936857283115387,
-0.9312220811843872,
0.609861433506012,
0.07528655230998993,
-0.05966917425394058,
... |
async def get _ product _ as _ end _ user _ async ( self, request : servicecatalog _ 20210901 _ models. getproductasenduserrequest, ) - > servicecatalog _ 20210901 _ models. getproductasenduserresponse : runtime = util _ models. runtimeoptions ( ) return await self. get _ product _ as _ end _ user _ with _ options _ as... | [
-1.7268599271774292,
0.23661229014396667,
0.37606751918792725,
0.9670678377151489,
0.19227929413318634,
-0.1747799664735794,
0.2568090558052063,
-1.5258761644363403,
0.30049434304237366,
-0.1472071260213852,
0.5548433661460876,
1.7676715850830078,
-0.36100637912750244,
-0.4736347198486328,... |
def read _ and _ call _ until ( uhandle, method, * * keywds ) : nlines = 0 while 1 : line = safe _ readline ( uhandle ) # if i've met the condition, then stop reading the line. if not _ fails _ conditions ( * ( line, ), * * keywds ) : uhandle. saveline ( line ) break method ( line ) nlines = nlines + 1 return nlines | [
-0.4220864176750183,
0.6535807251930237,
0.3007197976112366,
0.501110315322876,
-0.27173149585723877,
-0.013867823407053947,
-0.5509656667709351,
-0.5651992559432983,
-0.4622667729854584,
-0.40379956364631653,
0.463140070438385,
-0.6813780069351196,
-0.34855917096138,
0.054898299276828766,... |
def project ( shape, camera ) : points = [ camera. project ( p ) for p in shape. points ] return shape ( points, shape. edges, shape. surfaces ) | [
0.6040083169937134,
0.019724184647202492,
0.16316981613636017,
1.1841951608657837,
0.20809908211231232,
0.19373652338981628,
-0.5396059155464172,
-0.2846054434776306,
0.9305303692817688,
0.7555747628211975,
-0.11556050926446915,
-0.3346419930458069,
-0.34563368558883667,
-0.443827182054519... |
def single _ customer ( customer _ name, invoice _ file ) : rental _ items = pd. dataframe ( ) rental _ items = invoice _ file. loc [ invoice _ file ['customer _ name'] = = customer _ name ] functools. partial ( return _ single _ customer, rental _ items ) | [
0.48489296436309814,
-0.68122398853302,
0.25091448426246643,
0.6728675365447998,
-0.30680274963378906,
-0.5260899662971497,
-0.30342796444892883,
1.1549490690231323,
-1.4763834476470947,
0.20058462023735046,
0.5445844531059265,
0.3402827978134155,
-0.1837819665670395,
-1.108839750289917,
... |
def repeat ( self ) - > str | none : repeat _ state = self. _ currently _ playing. get ( " repeat _ state " ) return repeat _ mode _ mapping _ to _ ha. get ( repeat _ state ) | [
-0.5854182243347168,
0.17132674157619476,
0.5996487736701965,
0.664267361164093,
0.36452916264533997,
0.5956511497497559,
0.5312711000442505,
-0.8527949452400208,
0.48235926032066345,
0.32611748576164246,
0.20166124403476715,
0.19169914722442627,
0.4743697941303253,
-1.1415756940841675,
... |
def expand _ units ( self, simplify _ full = true ) : used _ units = { } # need to multiply units with variable, # so that we can devide by the symbolic equation later : for variable in self. arguments ( ) : used _ units [ variable ] = variable * variable. _ _ units _ _ [ variable ] result = baseequation ( sr, self. su... | [
-0.36897584795951843,
0.7242452502250671,
0.704651951789856,
-0.09522973746061325,
0.013750635087490082,
-0.6348230242729187,
0.4843592047691345,
0.4022761583328247,
0.35479241609573364,
-0.4183838367462158,
-0.11041750758886337,
-0.8133336901664734,
-0.24119414389133453,
0.559034585952758... |
def finalized _ call ( self ) : kwargs = self. kwargs kwargs [ " temp _ dir " ] = " % ( temp _ dir ) " return [ ( str ( field ) % kwargs ) for field in self. call ] | [
-1.1579079627990723,
0.3357131779193878,
0.5783629417419434,
-0.7312390804290771,
0.4238690137863159,
-0.03163670375943184,
-0.9851716756820679,
-0.4001464545726776,
-0.014745884574949741,
0.607730507850647,
-0.07764270156621933,
-0.40189284086227417,
-0.3749583065509796,
1.436942577362060... |
def extract _ bboxes ( self, mask ) : boxes = np. zeros ( [ mask. shape [ - 1 ], 4 ], dtype = np. int32 ) for i in range ( mask. shape [ - 1 ] ) : m = mask [ :, :, i ] # bounding box. horizontal _ indicies = np. where ( np. any ( m, axis = 0 ) ) [ 0 ] vertical _ indicies = np. where ( np. any ( m, axis = 1 ) ) [ 0 ] if... | [
-1.046323537826538,
-0.13827605545520782,
0.9559177160263062,
0.5962733030319214,
0.6209231615066528,
-0.8241347670555115,
0.7401838898658752,
-1.0578566789627075,
-0.00800666306167841,
-0.25142818689346313,
-0.339162677526474,
-0.35845065116882324,
-0.16127324104309082,
-0.122899584472179... |
def tint ( self, percent, id = none ) : fg, bg, style = decode _ ansi ( self. _ ansi ) if fg is not none : fg = rgb _ tint ( fg, percent ) if bg is not none : bg = rgb _ tint ( bg, percent ) if not id : * previous _ tint, id = self. id. split ('tinted') if len ( previous _ tint ) = = 1 : try : p, * _ = previous _ tint ... | [
0.009972612373530865,
-0.43825748562812805,
0.629795253276825,
0.03526774421334267,
-0.7992722392082214,
0.08786827325820923,
-0.7162050008773804,
-0.7154519557952881,
0.158172145485878,
-0.24527369439601898,
-0.13419108092784882,
0.19069842994213104,
-0.9460035562515259,
-0.25232911109924... |
def get _ average _ ai _ move ( ) : global current _ player if current _ player = ='x': otherplayer ='o'else : otherplayer ='x'for set in win _ set : # check if other player is about to win using check _ set ( ). chk = check _ set _ for _ player ( set, otherplayer ) if chk is not - 1 : return chk # then make the move t... | [
-0.970282793045044,
0.1857997477054596,
0.5383302569389343,
0.33850809931755066,
-0.09042051434516907,
0.09832707047462463,
1.0033700466156006,
-0.5838711857795715,
-0.31501123309135437,
1.265062928199768,
0.9735184907913208,
0.7560139894485474,
-0.10672308504581451,
-0.3288520574569702,
... |
def idealshape ( self, x, y, annulus, dr1 = 0, dr3 = 0, dk1 = 0, dk3 = 0 ) : nr = x. shape mr = y. shape if ( nr! = mr ) : print ('idealm1m3. m : x is [ % d ] while y is [ % d ]. exit. \ n'% ( nr, mr ) ) sys. exit ( ) c1 = 1 / ( self. r1 + dr1 ) k1 = self. k1 + dk1 c3 = 1 / ( self. r3 + dr3 ) k3 = self. k3 + dk3 r2 = x... | [
-0.03110545314848423,
0.29711008071899414,
0.8305928707122803,
-0.03729814663529396,
-0.37574002146720886,
0.877618670463562,
-0.011217284016311169,
0.1697387397289276,
-0.14602608978748322,
0.5740156769752502,
0.14594990015029907,
0.6360747218132019,
-1.039848804473877,
-0.146324813365936... |
def test _ create _ course ( self ) : parameters = ['config ','database ','semester ','course'] environment ='course'module _ text ='migration for a given submitty course database.'parameter _ text = " " " : param config : object holding configuration details about submitty : type config : migrator. config. config : pa... | [
0.3928990662097931,
-0.022884411737322807,
0.6765761375427246,
-0.06519830971956253,
1.4890912771224976,
1.0083645582199097,
0.25422203540802,
-0.13302050530910492,
0.039744775742292404,
0.12078826874494553,
0.07442038506269455,
0.11964904516935349,
-0.1618078351020813,
0.6595891118049622,... |
def gccmi _ 1d _ ccd ( x, y, z, biascorrect = true, demeaned = false ) : x, y = np. atleast _ 2d ( x ), np. atleast _ 2d ( y ) x = copnorm _ cat _ nd ( x, z, axis = - 1 ) y = copnorm _ cat _ nd ( y, z, axis = - 1 ) return cmi _ 1d _ ggd ( x, y, z, biascorrect = biascorrect, demeaned = true ) | [
0.8429452776908875,
-0.41943973302841187,
0.6365413069725037,
0.11183648556470871,
-1.1112194061279297,
0.6818071007728577,
-0.030066782608628273,
-0.7267640829086304,
-0.501962423324585,
0.028886472806334496,
1.0052032470703125,
0.6016220450401306,
-1.1609842777252197,
0.3299131691455841,... |
def test _ n _ user _ dir ( self ) - > none : # warning : following lists depend on the account under which tests are run defined _ dirs = ['desktop ','documents ','downloads ','music ','pictures ','publicshare ','templates ','videos'] for dir _ key in user _ dirs _ xdg : if dir _ key in defined _ dirs : user _ dir _ p... | [
-0.021276844665408134,
0.48078107833862305,
0.4316805303096771,
1.090158462524414,
0.3575635850429535,
0.2809409499168396,
0.6335251927375793,
-0.16495022177696228,
0.4959167242050171,
0.0273919515311718,
-0.5967578887939453,
-0.24851715564727783,
0.1476673185825348,
0.7911247611045837,
... |
def asal _ sayi ( a ) : i = 1 while i < a : i = i + 1 k = 1 while k < i : k = k + 1 if i % k = = 0 and i = = k : print i if i % k = = 0 and i! = k : break | [
0.07738246768712997,
-0.0937066301703453,
0.5694981217384338,
0.651016891002655,
-0.8866974115371704,
0.3236282169818878,
0.9889216423034668,
-0.39399996399879456,
0.6021885871887207,
0.3959974944591522,
0.13207995891571045,
0.016086898744106293,
-1.0236135721206665,
0.35845500230789185,
... |
def log _ out ( ) : site = urllib2. urlopen ( " https : / / acs. hin. no / logon? logon _ action = logoff " ) logoffpage = site. read ( ) if logoffpage. rfind ( " <! - - logged _ off " ) > - 1 : print " you are now logged off... " else : print " hmmm... not logged off... strange... " sys. exit ( ) | [
-0.017308274284005165,
-0.37195634841918945,
0.466415137052536,
0.1093381941318512,
0.12047868221998215,
-0.006103889551013708,
-0.00885039009153843,
0.3174006938934326,
0.4306843876838684,
-0.3327292799949646,
-0.3173249363899231,
0.750785768032074,
-0.38943207263946533,
-0.50699591636657... |
def confirm _ user ( cls, usern, passw ) : for user in cls. user _ list : if cls. find _ user ( usern ) : password _ match = user. password if password _ match = = passw : return true else : return false else : return false | [
0.06393086165189743,
-0.3853914141654968,
0.48688554763793945,
1.4423328638076782,
0.3346462547779083,
0.19094893336296082,
-0.43736764788627625,
-0.03592466935515404,
-0.33396071195602417,
0.415607213973999,
-0.5815111398696899,
-0.40136146545410156,
-0.11381606757640839,
0.66247332096099... |
def updatemappingsondevicetype ( self, thingtypeid, logicalinterfaceid, mappingsobject, notificationstrategy = " never " ) : req = apiclient. onethingtypemappingurl % ( self. host, " / draft ", thingtypeid, logicalinterfaceid ) try : mappings = json. dumps ( { " logicalinterfaceid " : logicalinterfaceid, " notification... | [
-2.137125253677368,
-0.4869903028011322,
0.5271346569061279,
-0.6060157418251038,
-1.0866249799728394,
0.02745235711336136,
-0.19598136842250824,
-0.8224660158157349,
0.480324923992157,
0.6871799826622009,
-0.6262214779853821,
0.24322198331356049,
-0.6942943334579468,
-0.07631834596395493,... |
def test _ atomic _ any _ uri _ pattern _ 2 _ nistxml _ sv _ iv _ atomic _ any _ uri _ pattern _ 3 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - pattern - 3. xsd ", instance = " nistdata / atomic / ... | [
-0.4829157292842865,
-0.055962078273296356,
0.6520882844924927,
1.3966796398162842,
-0.16808034479618073,
0.5425206422805786,
-0.19985611736774445,
0.4530978798866272,
0.35974082350730896,
0.41082367300987244,
0.3820820450782776,
0.009589109569787979,
-0.16418667137622833,
-0.4920255839824... |
def _ _ checked ( self, incl _ pos : stroritert ) - > tuple [ str,... ] : if hasattr ( incl _ pos,'_ _ iter _ _') and not isinstance ( incl _ pos, str ) : return self. _ _ check ( * incl _ pos ) return self. _ _ check ( incl _ pos ) | [
-0.622317373752594,
0.09132138639688492,
0.6764606833457947,
-0.28408288955688477,
-1.1128065586090088,
-0.0330938920378685,
-0.3185439109802246,
-0.30408328771591187,
-0.1342681497335434,
0.9062303304672241,
0.7591453194618225,
-0.6146043539047241,
-0.8736205697059631,
0.33980104327201843... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.