text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def preprocess _ val ( patch ) : return np. dstack ( [ scipy. ndimage. zoom ( patch [..., 0 ], ( side / patch. shape [ 0 ], side / patch. shape [ 1 ] ) ), scipy. ndimage. zoom ( patch [..., - 1 ], ( side / patch. shape [ 0 ], side / patch. shape [ 1 ] ), order = 0 ) ] ) | [
-0.08952538669109344,
0.35054096579551697,
0.648040771484375,
-0.9098027348518372,
-1.069279670715332,
-0.27564871311187744,
-0.24772804975509644,
-0.3881707787513733,
0.7580475807189941,
0.32575932145118713,
-0.08439843356609344,
0.6725936532020569,
0.9448302984237671,
0.33516207337379456... |
def test _ global _ user _ with _ default _ env ( self ) : eq _ ( normalize ( " localhost " ) [ 0 ], " satan " ) | [
-0.10078535228967667,
0.6456395983695984,
0.2659432888031006,
1.5482051372528076,
0.3890857696533203,
1.5192842483520508,
0.33894145488739014,
0.4881426692008972,
-0.23897328972816467,
-0.28277066349983215,
-0.4967060983181,
0.045099902898073196,
-0.5921778678894043,
0.41005459427833557,
... |
def update _ target _ model ( self ) : self. target _ model. set _ weights ( self. model. get _ weights ( ) ) | [
-1.0605474710464478,
-1.4500714540481567,
0.35354411602020264,
-0.3491020202636719,
0.7745769023895264,
0.3233514726161957,
-0.7793118953704834,
0.05844851955771446,
-0.8905740976333618,
0.9002402424812317,
0.1440260112285614,
0.9980028867721558,
0.3809017241001129,
-0.20724506676197052,
... |
def stop ( self, ifrom = none, block = true, callback = none, timeout = none ) : nick = usernick ( ) return self. xmpp ['xep _ 0163']. publish ( nick, node = usernick. namespace, ifrom = ifrom, block = block, callback = callback, timeout = timeout ) | [
-0.6628589034080505,
0.12403232604265213,
0.37581169605255127,
0.7061359882354736,
-0.8614972829818726,
-0.12918660044670105,
0.41406434774398804,
0.3140260577201843,
0.05283753573894501,
0.39525121450424194,
-0.5830380320549011,
0.5163673758506775,
-1.914964199066162,
-0.6910799741744995,... |
def discard _ client _ user _ tokens ( self, client _ id, user _ id ) : accesskey. delete ( client _ id, user _ id ) | [
1.8888380527496338,
-0.6421647071838379,
0.15666194260120392,
-0.1895679533481598,
-1.20785653591156,
0.6841520071029663,
-0.20996195077896118,
-0.1471778303384781,
-0.33546745777130127,
0.3633882701396942,
0.3860858380794525,
1.5611697435379028,
0.02732684835791588,
0.015997959300875664,
... |
def index ( ) : return render _ template ( " index. html " ) | [
0.7447445392608643,
0.47723549604415894,
0.055322274565696716,
0.03488700091838837,
-0.058647945523262024,
0.23840156197547913,
0.6087634563446045,
1.2701019048690796,
-0.6636966466903687,
0.44690197706222534,
0.18792791664600372,
-0.30477240681648254,
-0.13341832160949707,
-0.641508042812... |
def map _ process ( sensor, i ) : self. _ _ reset _ pathfinding _ variables ( ) # recursively find shortest path from sensor to all corners path = [ ] doors = [ ] _, _ = self. _ _ find _ shortest _ paths ( sensor, self. rooms [ sensor. room _ number ], path, doors, dr = 0 ) # initialise grids sensor. d = np. zeros ( sh... | [
0.0643087774515152,
-0.4179561138153076,
0.9071660041809082,
-0.25134438276290894,
0.2045036107301712,
0.5345215797424316,
0.7424127459526062,
-0.4515990614891052,
0.3368133306503296,
0.6859776973724365,
-0.4450821280479431,
-0.7862862348556519,
0.3205399513244629,
0.517551839351654,
-0.... |
def _ fetchall ( presto _ cur ) : return presto _ cur. fetchall ( ) | [
0.026047904044389725,
-0.32464754581451416,
0.18834277987480164,
0.5028256773948669,
-1.2226048707962036,
0.24038812518119812,
-0.7839149832725525,
-0.2832227051258087,
-0.8076235055923462,
-0.29427117109298706,
0.671186625957489,
-0.1312878429889679,
0.8605591058731079,
0.2990473210811615... |
def create _ circle ( origin, radius ) : c = circle ( ) c. origin = origin c. radius = radius return c | [
0.7099605202674866,
-1.4960931539535522,
0.3932124972343445,
-0.6393910646438599,
-0.16676098108291626,
0.152992844581604,
-0.4164367914199829,
0.4361608326435089,
-1.1763713359832764,
-0.14877288043498993,
-0.12314753234386444,
0.916662871837616,
0.05954539775848389,
-0.5152246952056885,
... |
def home ( request ) : num _ books = book. objects. all ( ). count ( ) " " " select count ( id ) from library _ bookinstance ; " " " num _ instances = bookinstance. objects. all ( ). count ( ) " " " select count ( id ) from library _ bookinstance where status ='a'; " " " num _ instances _ available = bookinstance. obje... | [
0.3685452342033386,
-0.573710024356842,
0.7347816824913025,
0.37873706221580505,
0.4597072899341583,
1.0298936367034912,
0.40705132484436035,
1.1269673109054565,
-0.1439964771270752,
0.5939579010009766,
0.794922411441803,
0.028759939596056938,
-0.0401657335460186,
0.5201202630996704,
-0.... |
def set _ value ( self, from _ state, to _ state, value ) : assert is _ int ( value ) and value > = 0, " value should be a positive integer " self. value [ from _ state ] [ to _ state ] = value | [
-0.7689246535301208,
-0.07297655194997787,
0.41516315937042236,
-0.5673201084136963,
-0.11362823098897934,
0.2179093211889267,
-0.9008050560951233,
0.052677784115076065,
-0.5709953904151917,
0.4598218500614166,
-0.4672044515609741,
0.10526757687330246,
0.615445613861084,
-0.224945485591888... |
def test _ lua _ resp3 ( ) : lua _ query = " " " redis. setresp ( 3 ) local map = redis. call ('hgetall ', keys [ 1 ] ) ['map'] ['hash2'] return map " " " name ='hashname'r. hset ( name, mapping = mapping ) lua _ result = r. eval ( lua _ query, 1, name,'hash2') assert lua _ result = = mapping ['hash2'] | [
0.5150175094604492,
-0.9410259127616882,
0.5506117343902588,
-0.37551528215408325,
-0.0649818480014801,
0.3482843339443207,
-1.075332760810852,
0.05194155126810074,
0.4464164674282074,
-0.5575040578842163,
-0.4342123866081238,
-0.3162930905818939,
-0.020561201497912407,
-1.172401785850525,... |
def _ _ hsl _ threshold ( input, hue, sat, lum ) : out = cv2. cvtcolor ( input, cv2. color _ bgr2hls ) return cv2. inrange ( out, ( hue [ 0 ], lum [ 0 ], sat [ 0 ] ), ( hue [ 1 ], lum [ 1 ], sat [ 1 ] ) ) | [
0.34637653827667236,
-0.7056631445884705,
0.459046870470047,
0.16682767868041992,
-0.2600162625312805,
-0.4054619371891022,
-0.9443559050559998,
-0.08677229285240173,
-0.16899451613426208,
-0.1415952742099762,
-0.5150467753410339,
0.6579316258430481,
0.1835612654685974,
0.11575727164745331... |
def _ _ get _ common _ tmpl _ vars ( self, configdict : dict ) - > dict : dns _ domain = configdict. get ('dns _ domain ', none ) if dns _ domain : dns _ domain = f "'{ dns _ domain }'" return {'override _ dns _ domain': configdict. get ('override _ dns _ domain ', false ),'dns _ domain': dns _ domain,'dns _ nameserver... | [
-0.7771766185760498,
0.7735899090766907,
0.27947697043418884,
-1.1920082569122314,
-0.64820396900177,
-0.1999972015619278,
-0.0391710102558136,
-0.37071043252944946,
0.3763185739517212,
0.3882408142089844,
-1.3959423303604126,
-0.217234805226326,
0.36268508434295654,
0.9397605657577515,
... |
def mias ( processed _ titles : dict [ str, set [ datnode ] ], config : config, input _ dat : dat ) - > dict [ str, set [ datnode ] ] : if input _ dat. clone _ list. mias : eprint ('* applying clone list mia tags... ', sep ='', end ='', flush = true ) report _ on _ match : bool = false warning _ given : bool = false mi... | [
0.20505520701408386,
0.10461954027414322,
0.7668125033378601,
0.024712510406970978,
-0.5022542476654053,
-0.044237662106752396,
0.018794624134898186,
-0.3865021765232086,
-0.0697987973690033,
0.6058316230773926,
-0.23338043689727783,
0.3773634433746338,
-0.10661768913269043,
0.454062819480... |
def test _ move _ after ( self ) : self. assertequal ( self. n2. order, 0 ) self. assertequal ( self. n5. order, 10 ) self. n2. move _ after ( self. n5 ) n2 = nodeorderable. objects. get ( name ='2') n5 = nodeorderable. objects. get ( name ='5') self. assertequal ( n2. order, 11 ) self. assertequal ( n5. order, 10 ) | [
-0.4834240674972534,
0.43933939933776855,
0.3442937135696411,
0.9908478260040283,
0.13510003685951233,
0.085248664021492,
0.6851688027381897,
-0.9100456833839417,
-0.7674661874771118,
-0.33764269948005676,
-1.5207990407943726,
-0.5116038918495178,
0.1322886347770691,
0.07035830616950989,
... |
def process _ map ( file _ in, validate ) : with codecs. open ( nodes _ path,'wb') as nodes _ file, \ codecs. open ( node _ tags _ path,'wb') as nodes _ tags _ file, \ codecs. open ( ways _ path,'wb') as ways _ file, \ codecs. open ( way _ nodes _ path,'wb') as way _ nodes _ file, \ codecs. open ( way _ tags _ path,'wb... | [
0.1876019984483719,
-0.22809545695781708,
0.6494128108024597,
0.19114384055137634,
-0.06465288996696472,
0.3953847587108612,
0.0651206523180008,
0.6095495223999023,
-0.6555662155151367,
-0.26850131154060364,
-0.08788503706455231,
0.01673898845911026,
0.6161558628082275,
0.7601599097251892,... |
def log _ status ( status : str ) : _ check _ experiment ( ) _ current _ experiment. log _ status ( status ) | [
-0.5558494925498962,
-0.6529968976974487,
-0.0027283173985779285,
0.5978659987449646,
-0.1533696949481964,
0.3976804316043854,
-0.8196731805801392,
0.6860190629959106,
0.24669112265110016,
0.24748733639717102,
-0.7074294686317444,
0.8976427912712097,
-0.1038118526339531,
0.5221753716468811... |
def calculate _ width _ derivative ( self ) : array = [ 0. 0 for x in range ( 6, len ( self. width _ array ), 1 ) ] for x in range ( 0, len ( array ), 1 ) : array [ x ] = self. width _ array [ x + 6 ] - self. width _ array [ x + 5 ] return numpy. asanyarray ( array ) | [
-0.4694924056529999,
-0.40855056047439575,
0.8165273666381836,
-0.44747665524482727,
-0.13769693672657013,
-0.007505351677536964,
0.9541389346122742,
-0.39209797978401184,
0.6403242349624634,
-0.3849773108959198,
0.19271469116210938,
0.06908281147480011,
-1.0139784812927246,
1.096114516258... |
def generator ( inputs, depth = 64, final _ size = 32, num _ outputs = 3, is _ training = true, reuse = none, scope ='generator ', fused _ batch _ norm = false ) : normalizer _ fn = slim. batch _ norm normalizer _ fn _ args = {'is _ training': is _ training,'zero _ debias _ moving _ mean': true,'fused': fused _ batch _... | [
-0.8349041938781738,
0.3451997935771942,
0.8788138628005981,
0.6402100920677185,
-0.6365098357200623,
-0.8276320695877075,
0.21871475875377655,
0.4527263343334198,
-0.3680947422981262,
0.3766677677631378,
-0.21347676217556,
0.2710864543914795,
0.3845883905887604,
-0.025873009115457535,
-... |
def n ( self ) : if self. interval is not none and self. unique : return self. _ n ( self. interval ) else : return np. arange ( self. _ n ( self. fmin ), self. _ n ( self. fmax ) + 1 ) | [
-1.2936502695083618,
0.16532929241657257,
0.19122056663036346,
0.9878706336021423,
-0.050812553614377975,
-0.3895827531814575,
0.44632604718208313,
-0.07657001912593842,
0.678344190120697,
-1.2187392711639404,
-0.15986649692058563,
0.5101202726364136,
-0.11436085402965546,
0.30005010962486... |
def update _ from _ desktop _ file ( self, root _ mount _ point ) : desktop _ file = self. find _ desktop _ file ( root _ mount _ point ) if desktop _ file is none : return false executable _ file = self. find _ executable ( root _ mount _ point ) if executable _ file is not none : #. desktop found and executable as we... | [
0.34512677788734436,
-1.0081005096435547,
0.8914638757705688,
0.898852527141571,
-0.38996273279190063,
-0.0699462890625,
0.24171610176563263,
-0.03671884164214134,
-0.3641146421432495,
-0.07261966913938522,
-0.02155967243015766,
-0.5346509218215942,
-0.11454521864652634,
0.9873331189155579... |
def get _ sensorlist ( station, year, file _ func, nfiles = 12, yt = true ) : if yt : ffname = file _ func ( station, year, 1 ) else : ffname = file _ func ( station, year ) fmonth = pd. read _ csv ( ffname, nrows = 1 ) # sensors slist = fmonth. columns. tolist ( ) [ 7 : - 1 ] # sensor id #'s sidlist = fmonth. iloc [ 0... | [
0.31176459789276123,
-0.8700185418128967,
0.8558626174926758,
0.44382739067077637,
-0.718166708946228,
0.6157359480857849,
0.23136231303215027,
0.16361121833324432,
0.2318992167711258,
0.001771707204170525,
-0.43283528089523315,
0.15712854266166687,
0.4213290512561798,
1.0344289541244507,
... |
async def test _ update _ reports _ light _ is _ off ( hass : core. homeassistant ) : await setup _ platform ( hass, light _ domain, ceiling _ fan ( " name - 1 " ) ) with patch ( " homeassistant. components. bond. bond. getdevicestate ", return _ value = { " light " : 0 } ) : async _ fire _ time _ changed ( hass, utcno... | [
0.22726507484912872,
0.43828269839286804,
0.47078970074653625,
0.1936228722333908,
0.5330436825752258,
0.933412492275238,
0.162467360496521,
0.193660169839859,
0.34627634286880493,
-0.7236006855964661,
-0.5155866146087646,
0.23562626540660858,
-0.8459833264350891,
0.4738231897354126,
0.2... |
def visit _ subscript ( self, node ) : self. generic _ visit ( node ) if not isinstance ( node. value, ast. name ) : return if node. value. id in { " in ", " _ ih " } : type _ = " input _ ref " elif node. value. id in { " out ", " _ oh " } : type _ = " output _ ref " else : return self. count _ simple ( " ipython " ) s... | [
-0.991676390171051,
0.07042717188596725,
0.8199522495269775,
-0.8431348204612732,
-0.043392207473516464,
-0.5213472843170166,
0.2457214593887329,
-0.9234550595283508,
-0.4472997486591339,
0.33195531368255615,
-0.6556314826011658,
1.6097972393035889,
0.6245777606964111,
0.09903623163700104,... |
def test _ singletimetifftileprocessor _ setup ( self ) : tp = self. config. tile _ processor _ class tp. setup ( self. config. get _ tile _ processor _ params ( ) ) assert tp. parameters [ " datatype " ] = = " uint16 " assert tp. parameters [ " ingest _ job " ] [ " extent " ] [ " y " ] = = [ 0, 256 ] | [
-0.004328783135861158,
0.82652348279953,
0.4316461384296417,
-0.6596348881721497,
0.6725043654441833,
0.21276141703128815,
0.4743579030036926,
0.36175861954689026,
0.14955081045627594,
1.136388897895813,
-0.2936253249645233,
0.10601387172937393,
-0.12061411142349243,
1.3118371963500977,
... |
def _ test _ device ( self ) : # mock registry. getconfig ( ) with patch. object ( registry,'getconfig ', magicmock ( return _ value = none ) ) : return device ( deveui = int ('0x0f0e0e0d00010209 ', 16 ), devaddr = int ('0x06000001 ', 16 ), appeui = int ('0x0a0b0c0d0a0b0c0d ', 16 ), nwkskey = int ('0xaeb48d4c6e9ea5c48c... | [
-0.05658620223402977,
0.5895233750343323,
0.7320023775100708,
-0.631272554397583,
-0.03819241374731064,
0.0048639425076544285,
1.0256578922271729,
-0.04148353636264801,
0.23820923268795013,
-0.8940767049789429,
0.0033790876623243093,
-0.24223193526268005,
-0.46724042296409607,
0.1389363110... |
def get _ params _ from _ url ( cls, url ) : for regex in cls. object _ id _ regexen : url _ regex = re. compile ( r'^ (? : https? : \ / \ / (? : www \. )? forums \. serebii \. net )? % s'% regex, re. u ) match = url _ regex. match ( url ) if match and match. group ( 1 ) : # the url is invalid if the object id match is... | [
-0.9110860824584961,
-0.27074551582336426,
0.6866573095321655,
0.331498920917511,
0.20551474392414093,
-0.3826380968093872,
0.0549214743077755,
0.05207689478993416,
-0.0885862186551094,
0.49822673201560974,
-0.7714214324951172,
-0.1584242284297943,
-0.14667917788028717,
0.7491572499275208,... |
def get _ commandline ( parser ) : args = sys. argv [ 1 : ] # is the command line empty? if so, bail and let argparse handle it. if not args : return [ ] # are any of the global options in the command line? if so drop everything # else. for global _ arg in parser. global _ args : for opt in global _ arg. get _ opts ( )... | [
-0.5848607420921326,
0.11073639988899231,
0.7490218877792358,
0.6085748076438904,
1.9080923795700073,
-0.08773555606603622,
-0.474185049533844,
-0.30904337763786316,
-0.32557010650634766,
1.0052034854888916,
0.0897698700428009,
0.4145504832267761,
-0.9930312633514404,
0.34675493836402893,
... |
def flip ( image ) : return image. transpose ( image. flip _ top _ bottom ) | [
-1.9104915857315063,
0.16684389114379883,
0.41187945008277893,
0.3064030110836029,
-0.1840021312236786,
-0.518574059009552,
0.20891089737415314,
0.1739148497581482,
-0.3469618260860443,
1.103337287902832,
0.21991029381752014,
-0.6696890592575073,
0.13044321537017822,
0.011184784583747387,
... |
def getexperimentsdescriptionslist ( self ) : query ='''{ experimentswithdata { name description begin end numberoftrials project { id } maps { imageurl imagename lower upper left right width height embedded } } }'''return self. _ client. execute ( gql ( query ) ) ['experimentswithdata'] | [
-0.01589786447584629,
1.1322513818740845,
0.3060278594493866,
-0.37260565161705017,
0.8297012448310852,
-0.13276535272598267,
-1.0005743503570557,
-0.21712997555732727,
-0.08723308145999908,
0.36910831928253174,
0.020798569545149803,
-0.15865354239940643,
-0.297470360994339,
0.990718066692... |
def listdir ( path, source = source _ any ) : if os. path. isabs ( path ) : return os. listdir ( path ) # not absolute, so process it. ensure _ paths ( ) output = [ ] # start with the profile. if source & source _ profile : p _ path = os. path. join ( profile _ path, path ) if os. path. isdir ( p _ path ) : for entry i... | [
-0.11434052139520645,
-0.0556127093732357,
0.6686534285545349,
0.6882736086845398,
-0.365056574344635,
-0.5272644758224487,
0.223348006606102,
-0.17015787959098816,
1.1051770448684692,
-0.3410544693470001,
-0.27299764752388,
-0.12935219705104828,
0.4757038652896881,
0.8152217268943787,
-... |
def reset ( self ) : self. bus. write _ i2c _ block _ data ( self. address, reg _ mode _ config, [ 0x40 ] ) | [
-0.5224848985671997,
0.6005613207817078,
0.41072043776512146,
-0.2625453472137451,
1.007256031036377,
-0.26306837797164917,
1.247116208076477,
0.2015887349843979,
-0.7712267637252808,
-0.09410490840673447,
-1.1453042030334473,
1.5354896783828735,
-0.7285758256912231,
-0.32617247104644775,
... |
def promjeni _ marker _ size ( self ) : velicina = self. spinmarker. value ( ) msg ='zahtjev za promjenom velicine markera. novi size = { 0 } '. format ( str ( velicina ) ) logging. debug ( msg ) self. defaultgraf [ 5 ] = velicina | [
0.33881473541259766,
0.22462137043476105,
0.2621191143989563,
0.14782316982746124,
0.12898221611976624,
-0.0852738693356514,
1.3083678483963013,
0.6000117063522339,
-0.8195914626121521,
0.2753371596336365,
-1.0860230922698975,
0.2930377423763275,
-0.9974133372306824,
0.9143615365028381,
... |
def generate _ variables ( self ) : variables _ set = set ( ) for netcdf _ file in self. netcdffiles : # replaced by the dictionary structure # for global _ attr in netcdf _ file. global _ attributes : # global _ attr _ set. add ( global _ attr ) for variable in netcdf _ file. variables : variables _ set. add ( variabl... | [
-0.10496515780687332,
0.3999945819377899,
0.41981396079063416,
-1.318571925163269,
0.6401361227035522,
0.6634909510612488,
0.3884163498878479,
0.707626461982727,
-1.4865467548370361,
-0.10652890056371689,
-0.5291566252708435,
-0.36315420269966125,
-0.1481810361146927,
0.5250031352043152,
... |
def load _ parsed _ jsons ( self, dialect _ dir ) : dialect2parsings = collections. defaultdict ( list ) for dialect _ dir in sorted ( input _ dir. glob ('*') ) : for text _ file in sorted ( dialect _ dir. glob ('*. json') ) : dialect = dialect _ dir. name text _ data = json. loads ( text _ file. read _ text ( ) ) dial... | [
-0.7415157556533813,
-0.6547744274139404,
0.710634708404541,
-0.9449142813682556,
-0.989765465259552,
0.2317192405462265,
-0.2556670904159546,
-0.1449330449104309,
-0.6925111413002014,
0.054520729929208755,
-0.6282798051834106,
-0.3674667179584503,
0.6745333075523376,
0.7391736507415771,
... |
def get _ cached _ inventory ( self, id, uuid = none, * * kwargs ) : if not self. _ _ is _ cache _ valid ( id ) : if id in self. _ _ inventory _ cache : del self. _ _ inventory _ cache [ id ] self. _ _ inventory _ cache [ id ] = { } if id = ='_ _ clusters': self. _ _ inventory _ cache [ id ] ['data'] = self. search ( t... | [
-1.795638918876648,
-0.0849403664469719,
0.888865053653717,
0.18689477443695068,
-0.030695322901010513,
-0.14689262211322784,
-0.5556440949440002,
-0.4083191752433777,
-0.20953373610973358,
0.6459440588951111,
-0.18684306740760803,
0.7169988751411438,
-0.7230098843574524,
-0.07425741851329... |
def lease ( self ) : logger ('requesting build task from queue. ', level ='debug') response = requests. get ( self. lease _ url, auth = ( self. auth _ username, self. auth _ password ), ) if response and response. status _ code = = 200 : return task ( response. json ( ), self ) return nooptask ( ) | [
-0.19834424555301666,
-0.3136388063430786,
0.600636899471283,
0.57499760389328,
0.22865547239780426,
0.020545491948723793,
-0.3813360929489136,
0.24553748965263367,
0.17341187596321106,
-0.6713745594024658,
-0.27184396982192993,
0.6886758208274841,
-0.28152650594711304,
-0.6788992285728455... |
def hypergeometric ( x, i ) : # todo : check against different numpy implementations # todo : improve documentation and add examples if len ( x )! = len ( i ) : raise valueerror ('x and i should be arrays of the same size') list _ of _ binomial _ coefficients = [ binomial _ coefficient ( x [ k ], i [ k ] ) for k in ran... | [
0.6244310736656189,
0.8748661279678345,
0.7415665984153748,
0.8051620721817017,
-0.06811399757862091,
-0.00620732456445694,
-0.5861498117446899,
-0.6092995405197144,
-0.5807274580001831,
1.0980786085128784,
-0.4797118306159973,
0.246250182390213,
-0.005354701075702906,
-0.8630852699279785,... |
def deep _ evaluate ( x _ matrix, y _ vector, classifier, folds = 5 ) : logging. info ('deep evaluating classifier { } '. format ( classifier ) ) x _ matrix = numpy. array ( x _ matrix ). squeeze ( ) # removes extra dimensions y _ vector = numpy. array ( y _ vector ) scores = {'train': [ ],'test': [ ] } for iteration _... | [
-0.394415944814682,
0.4463993310928345,
0.9273760914802551,
-0.6890910267829895,
0.3523619771003723,
-0.09820953011512756,
0.7204645276069641,
0.12730824947357178,
-1.005041480064392,
-0.0016548414714634418,
0.12283769249916077,
0.8236672282218933,
0.2566603124141693,
0.33936071395874023,
... |
def test _ line ( ) : topo, cub = check _ subset ( discr3d, xdef, [ 0., 0., 0. 8 ] ) velo = field ( domain = topo. domain, is _ vector = true, formula = v3d, name ='velo') vd = velo. discretize ( topo ) velo. initialize ( topo = topo ) i0 = cub. integrate _ field _ allc ( velo, topo ) vref = cub. real _ length [ topo ]... | [
1.4921396970748901,
0.6996752619743347,
0.4928663372993469,
0.43867620825767517,
1.0620124340057373,
1.096095085144043,
0.16045443713665009,
0.5534826517105103,
-0.012558364309370518,
-0.712017834186554,
-0.7077761292457581,
-0.10967111587524414,
-0.48768478631973267,
-0.000414493290008977... |
def getidgenerator ( self, idtype ) : return self. _ _ idgenerators. get ( idtype ) | [
-1.6467256546020508,
0.1709945797920227,
0.23295165598392487,
-0.2815471589565277,
-0.6978672742843628,
0.34248197078704834,
-0.6035515666007996,
-1.1077959537506104,
0.36449065804481506,
-0.84134840965271,
-0.2816765606403351,
-0.40783077478408813,
-1.1383938789367676,
0.47488725185394287... |
def convert _ lasot _ test ( lasot _ test, ann _ dir, save _ dir ) : records = dict ( vid _ id = 1, img _ id = 1, ann _ id = 1, global _ instance _ id = 1 ) videos _ list = osp. join ( ann _ dir,'testing _ set. txt') videos _ list = mmcv. list _ from _ file ( videos _ list ) lasot _ test ['categories'] = [ dict ( id = ... | [
-0.01001153327524662,
-0.07171259075403214,
0.8360770344734192,
-0.8486903309822083,
-0.31420621275901794,
-0.24241147935390472,
0.25304898619651794,
0.4078998565673828,
0.25925520062446594,
0.6338288187980652,
-0.15392908453941345,
0.42047929763793945,
0.795657753944397,
0.477564454078674... |
def factoreddense ( n _ modules, d _ in, d _ out, use _ bias = true, use _ bfloat16 = false ) : if d _ out % n _ modules! = 0 : raise valueerror ( f'value d _ out ( { d _ out } ) must be a multiple of arg'f'n _ modules ( { n _ modules } ).') d _ module = d _ out / / n _ modules def gatingvectors ( ) : return tl. weight... | [
0.316465824842453,
0.5292317867279053,
0.6442316770553589,
-0.459058552980423,
0.5408610701560974,
-0.3103722929954529,
0.48648327589035034,
-0.5655858516693115,
0.2048083394765854,
0.05519695207476616,
0.19177737832069397,
0.18773946166038513,
0.23906636238098145,
0.16475822031497955,
0... |
def assign _ bye ( player ) : execute _ query ( " " " update players set bye = true, points = points + 1 where player _ id = % s and tournament _ id = % s " " ", ( player, tournament _ id, ) ) | [
-0.8741347193717957,
-0.5777623057365417,
0.6302719712257385,
-0.060447148978710175,
0.6869003772735596,
-0.006044451612979174,
0.4284040629863739,
0.6666050553321838,
-0.8711629509925842,
1.0525603294372559,
-0.6254974603652954,
0.5627694129943848,
-0.495204359292984,
0.03277876228094101,... |
def create _ watchlist _ output ( slack _ id, slack _ name, channel _ id ) : def send _ empty _ watchlist _ notification ( ) : text = " you're not following any tv shows yet. use ` / tv ` to follow some shows first. " blocks = [ { " type " : " section ", " text " : { " type " : " mrkdwn ", " text " : text } } ] post _ ... | [
0.8564795255661011,
0.3776659071445465,
0.4940987527370453,
-0.5465019941329956,
-0.07657794654369354,
-0.014612932689487934,
0.11752112954854965,
-0.9538357853889465,
-0.48802003264427185,
0.29072466492652893,
-0.02988792210817337,
0.39878880977630615,
0.3625428378582001,
0.84084028005599... |
def test _ quadratic ( ) : u _ exact = lambda x, t : x * ( l - x ) * ( 1 + 0. 5 * t ) i = lambda x : u _ exact ( x, 0 ) v = lambda x : 0. 5 * u _ exact ( x, 0 ) f = lambda x, t : 2 * ( 1 + 0. 5 * t ) * c * * 2 u _ 0 = lambda t : u _ exact ( 0, t ) u _ l = none l = 2. 5 c = 1. 5 c = 0. 75 nx = 3 # very coarse mesh for t... | [
0.6748015880584717,
-0.055906858295202255,
0.6927355527877808,
-0.11167158931493759,
0.45405176281929016,
0.5210099220275879,
0.18023155629634857,
-0.7995039224624634,
-0.84153813123703,
-0.6099988222122192,
-1.4199326038360596,
-0.8172171115875244,
0.20128406584262848,
-0.0358975492417812... |
def strip _ rank ( team ) : if'( oh )'in team : team ='miami ( oh )'elif'( fl )'in team : team ='miami ( fl )'elif'('in team : team = team. split (')') [ - 1 ] team = team. replace ( u'\ xa0 ', u'' ) return team | [
0.46760037541389465,
0.09077123552560806,
0.349627286195755,
-0.6730112433433533,
-0.23462021350860596,
-0.19729353487491608,
0.10509154200553894,
1.1191492080688477,
0.46578529477119446,
0.3300899565219879,
0.27272048592567444,
0.6477980613708496,
-0.6371721625328064,
-0.4971596598625183,... |
def shipping _ callback ( update, context ) : query = update. shipping _ query # check the payload, is this from your bot? if query. invoice _ payload! ='compoter - bot': # answer false pre _ checkout _ query query. answer ( ok = false, error _ message = " что - то пошло не так... " ) return # first option has a single... | [
-0.16481535136699677,
0.25702226161956787,
0.6207761168479919,
-0.12150471657514572,
0.44357046484947205,
0.1728149950504303,
-0.45852726697921753,
-0.11520247906446457,
0.731031060218811,
1.0918406248092651,
0.029230494052171707,
-0.36131998896598816,
0.1422496885061264,
-0.13152156770229... |
def total _ value ( ) : cl = cartodbapikey ( api _ key, domain ) query ='select value from % s'% table try : data = cl. sql ( query ) except cartodbexception as e : print ( " some error ocurred ", e ) cash = sum ( [ x ['value'] for x in data ['rows'] ] ) return'{ : 10,. 2f } '. format ( cash ) | [
-0.2747979760169983,
0.013249952346086502,
0.5253393650054932,
-0.5465656518936157,
0.5197644233703613,
-0.9094854593276978,
-0.13318349421024323,
0.17933613061904907,
-0.6813466548919678,
0.6299502849578857,
-0.13364022970199585,
0.15742073953151703,
0.8512505292892456,
-0.232428669929504... |
def test _ check _ missing _ good ( self ) : args = lambda : none args. args = { " name " :'john'} args _ test = helpers. check _ missing ('args ', args,'name') self. assertequal ( args _ test,'john') lists = { " name " : " mary " } args _ test = helpers. check _ missing ('list ', lists,'name') self. assertequal ( args... | [
-0.14447417855262756,
0.15276329219341278,
0.5684778690338135,
-0.24802900850772858,
1.0313836336135864,
0.9470387697219849,
-0.9102736115455627,
-0.02282046712934971,
-0.08865105360746384,
0.1267406940460205,
-0.6623762249946594,
-0.10727229714393616,
0.20665356516838074,
1.21464693546295... |
def run _ module ( module, raw _ params = none, args = none ) : if args is none : args = { } if raw _ params is not none : args ['_ raw _ params'] = raw _ params ansible. module _ utils. basic. ansiblemodule. exit _ json = wtf _ exit _ json ansible. module _ utils. basic. ansiblemodule. fail _ json = wtf _ fail _ json ... | [
-0.8365330100059509,
-0.2550909221172333,
0.6457709074020386,
-0.4880385100841522,
-0.48933520913124084,
-0.25309091806411743,
-0.1048053652048111,
-0.2307232767343521,
-0.25643008947372437,
1.0157300233840942,
-0.6603857278823853,
0.8288992643356323,
-0.05533752217888832,
0.19708292186260... |
def test _ user _ story _ 0d ( self ) : self. blackjack. pick _ cards = magicmock ( return _ value = ['a ','q'] ) self. blackjack. deal ( ) self. asserttrue ( self. blackjack. is _ winner ( ) ) | [
0.5884184837341309,
-0.1886662095785141,
0.30636274814605713,
1.216386318206787,
0.9320975542068481,
0.5718079805374146,
0.09854118525981903,
0.6260308623313904,
0.2887575626373291,
-1.0018959045410156,
-0.24470776319503784,
-0.39587706327438354,
0.5547020435333252,
0.2941442131996155,
-... |
def test _ slow _ website ( kafka _ mock, mock _ get ) : def slow _ response ( * args ) : if args [ 0 ] = ='slow - website. com': time. sleep ( 1 ) return mockresponse ( ) mock _ get. side _ effect = slow _ response host _ configs = [ producer. healthcheckconfig ('example. com ', 5 ), producer. healthcheckconfig ('slow... | [
0.2470511943101883,
0.17266659438610077,
0.5504758954048157,
0.34435850381851196,
0.3214108347892761,
0.0046594515442848206,
0.6400648951530457,
-0.40231379866600037,
0.3581533133983612,
-0.3616367280483246,
0.354410856962204,
-0.2211812138557434,
-0.8712326288223267,
0.060874082148075104,... |
def _ _ init _ _ ( self, source : str, number _ complex _ samples : int, data _ type : str, sample _ rate : float, centre _ frequency : float ) : super ( ). _ _ init _ _ ( source, number _ complex _ samples, data _ type, sample _ rate, centre _ frequency ) global import _ error _ msg if import _ error _ msg! = " " : ms... | [
-0.4296008348464966,
-0.48283880949020386,
0.9023832678794861,
-0.16119256615638733,
0.29691922664642334,
-0.9329478740692139,
0.007008984684944153,
-0.05636889860033989,
1.060077428817749,
-0.5312442779541016,
0.38826778531074524,
-0.27989092469215393,
-0.20831376314163208,
0.907971084117... |
def test _ different _ argument ( assert _ errors, parse _ ast _ tree, argument, default _ options, ) : tree = parse _ ast _ tree ( wrong _ argument. format ( argument ) ) visitor = wrongfunctioncallvisitor ( default _ options, tree = tree ) visitor. run ( ) assert _ errors ( visitor, [ ] ) | [
-0.27457302808761597,
0.7383866906166077,
0.41763171553611755,
0.2705613076686859,
1.2119836807250977,
0.33647018671035767,
0.11581774801015854,
-0.04591873660683632,
0.11050856113433838,
-0.124458909034729,
0.02290409244596958,
0.48560619354248047,
0.4085550308227539,
1.2759068012237549,
... |
def actual _ decorator ( func : callable ) - > callable : def wrapper ( * args, * * kwargs ) - > pd. series : try : x _ in = kwargs. pop ('x _ in') y _ in = kwargs. pop ('y _ in') except keyerror : x _ in, y _ in = args [ 1 : 3 ] # model is often the first argument args = args [ : 1 ] + args [ 3 : ] if split _ on _ yea... | [
-0.9379215240478516,
0.574408233165741,
0.8815557360649109,
0.441500186920166,
-0.31022536754608154,
0.20548215508460999,
0.503659725189209,
-0.220964714884758,
0.026733646169304848,
-0.0030061746947467327,
0.6363831758499146,
0.22390124201774597,
1.204282522201538,
0.1680869609117508,
0... |
def compute _ num _ trainable _ params ( architecture _ fn ) : n _ dummy = 1 model, _, _, _ = architecture _ fn ( n _ dummy ) return sum ( p. numel ( ) for p in model. parameters ( ) if p. requires _ grad ) | [
-0.1812772899866104,
1.1983582973480225,
0.6073945164680481,
0.574737548828125,
0.20194029808044434,
-0.2513270080089569,
1.1240450143814087,
0.8859613537788391,
-0.7448986172676086,
0.4806891679763794,
-1.618957281112671,
0.015367615967988968,
0.978708028793335,
0.7968706488609314,
-0.0... |
def _ load _ cause _ risk _ metadata ( self ) : # get reis that exist in paf output existing _ reis = self. _ get _ rei _ from _ paf _ output ( ) existing _ reis = set ( existing _ reis. rei _ id. unique ( ) ) # get cause - risk metadata from the database metadata = self. _ get _ cause _ risk _ metadata _ from _ databa... | [
0.4182727336883545,
-1.2952924966812134,
0.4677901566028595,
-0.515592098236084,
0.3250345289707184,
-0.3460862338542938,
-0.5215159058570862,
-0.2190014272928238,
-0.32737997174263,
0.521446704864502,
0.23367588222026825,
0.0723421648144722,
0.02352757193148136,
-0.5777865052223206,
0.3... |
def write _ index2word _ excel ( word2index, file _ suffix ='question') : outputfilepath = " index2word _ { }. csv ". format ( file _ suffix ) df = pd. dataframe. from _ dict ( word2index, orient ='index') df. to _ csv ( outputfilepath ) print ( " $ $ wrote excel = > ", outputfilepath ) | [
0.23281483352184296,
-0.8498718738555908,
0.3297271728515625,
0.4700571596622467,
-0.08748898655176163,
1.036310076713562,
0.4213995933532715,
0.5580785870552063,
-0.39891380071640015,
-0.014520241878926754,
-0.1370847225189209,
0.9477691650390625,
0.06210232898592949,
-0.3640911877155304,... |
def test _ event _ as _ addeventlistener ( self ) : js = " document. getelementbyid ('button'). addeventlistener ('click ', function ( ) { " + self. event _ code + " } ) ; " html _ code = f " " " < html > < head > < / head > < body > < button id = " button " { reachable _ att _ name } = " true " > < / button > < script... | [
0.07215382158756256,
0.08084850013256073,
0.8459386229515076,
-0.26226484775543213,
0.23578393459320068,
0.4742705821990967,
-0.011213840916752815,
0.228714257478714,
0.942257821559906,
-0.08463387936353683,
-0.26720136404037476,
0.07047639787197113,
0.9136469960212708,
0.866278350353241,
... |
def sort _ file ( input _ filepath, lines = none, sort _ function = default _ sorting _ function, avoid _ data _ tokens = [';'], output _ filepath = none ) : assert ( callable ( sort _ function ) ) with open ( input _ filepath ) as f : sorted _ file = list ( f if not lines else islice ( f, lines ) ) sorted _ file. sort... | [
0.3060806393623352,
0.11552079766988754,
0.728930652141571,
0.2251652032136917,
-0.37468254566192627,
-0.15028248727321625,
0.1935543417930603,
-0.15450209379196167,
-0.8165062069892883,
0.5812920331954956,
0.012359709478914738,
0.22403615713119507,
0.10887616127729416,
0.3452073633670807,... |
def render _ content ( text, gfm = false, context = none, render _ offline = false, username = none, password = none ) : if render _ offline : return offline _ render ( text, gfm, context ) return github _ render ( text, gfm, context, username, password ) | [
0.3326452672481537,
0.014423934742808342,
0.35913321375846863,
0.3087441325187683,
-0.9333521723747253,
0.12616115808486938,
-0.989848256111145,
0.9884585738182068,
0.10167404264211655,
0.5673696994781494,
0.47784918546676636,
-0.26478835940361023,
-1.4124046564102173,
-0.06076490506529808... |
def get _ empty _ cell ( self, row, col ) : if self. board. content [ row ] [ col ]! = " 0 " : empty _ cells = [ ( x, y ) for x, nos in enumerate ( self. board. content ) for y in [ c for c, no in enumerate ( nos ) if no = = " 0 " ] ] distances = [ abs ( row - r ) + abs ( col - c ) for ( r, c ) in empty _ cells ] row, ... | [
0.12157875299453735,
-0.478939950466156,
0.6625092625617981,
-0.03725758194923401,
0.3696538209915161,
0.2859676778316498,
0.32073530554771423,
-0.545272946357727,
-0.5647039413452148,
0.3510200083255768,
0.2513682246208191,
0.04519779980182648,
-0.21101051568984985,
0.03662371635437012,
... |
def _ does _ quack ( cls, explanation ) : if not super ( ). _ does _ quack ( explanation ) : return false has _ global _ values _ attr = hasattr ( explanation, explainparams. global _ importance _ values ) if not has _ global _ values _ attr or explanation. global _ importance _ values is none : return false has _ glob... | [
-0.016614923253655434,
0.5224241018295288,
0.5757264494895935,
0.03536403924226761,
-0.0435856468975544,
0.43835505843162537,
1.4490677118301392,
0.9308525323867798,
0.01508729811757803,
0.6893831491470337,
0.16642886400222778,
-0.17847734689712524,
0.0019521303474903107,
1.157672166824340... |
def test _ attribute _ requirements ( self ) - > none : # userinfo lacking " test " : " foobar " attribute should fail. userinfo = { " sub " : " tester ", " username " : " tester ", } request, _ = self. start _ authorization ( userinfo ) self. get _ success ( self. handler. handle _ oidc _ callback ( request ) ) self. ... | [
-0.25220924615859985,
-0.13223686814308167,
0.46656742691993713,
0.21333742141723633,
-0.21779099106788635,
1.1589375734329224,
0.7907828092575073,
-0.49785110354423523,
0.6030170917510986,
-0.21182627975940704,
-0.5559812188148499,
-0.03466848284006119,
0.3654904067516327,
0.1527326703071... |
def getpackagename ( self, packagepath ) : # ensure package path separators are forward slashes sanitisedpath = re. sub ( r " ( \ \ | / ) ", " / ", packagepath ) # ensure if package directory is actually inside the root directory if not sanitisedpath. startswith ( self. rootdirectory ) : raise valueerror ( " path'{ }'i... | [
0.08239085972309113,
-0.0007875626324675977,
0.6144679188728333,
0.2333209365606308,
-1.0386391878128052,
-0.27597737312316895,
0.3916286826133728,
0.32245394587516785,
0.5571087002754211,
0.5291827917098999,
1.0436519384384155,
-0.3456622362136841,
-0.4302860498428345,
-0.0740763321518898... |
def _ _ init _ _ ( self, obs _ space, action _ space, num _ outputs, model _ config, name ) : tfmodelv2. _ _ init _ _ ( self, obs _ space, action _ space, num _ outputs, model _ config, name ) | [
0.517013430595398,
-0.6129175424575806,
0.5006299614906311,
0.37575390934944153,
-0.4125906229019165,
-0.6374109983444214,
0.0639500692486763,
0.1982356458902359,
-0.23896072804927826,
0.44866013526916504,
-0.8585239052772522,
-0.31899067759513855,
0.8444967865943909,
0.45462003350257874,
... |
def infer _ format ( path ) : ext = filepath. get _ extension ( path ) if not ext : raise valueerror ( " the input file has no extension, cannot infer a format. " ) format _ name = ext [ 1 : ] if format _ name in format. _ _ members _ _ : return format [ format _ name ] else : raise valueerror ( " the file's extension ... | [
0.6986631155014038,
-0.5424757599830627,
0.567158043384552,
0.496978759765625,
-0.7292773723602295,
-0.026577474549412727,
-0.20289061963558197,
-0.6452375054359436,
0.4359186887741089,
-0.4585076570510864,
0.8523969054222107,
0.5381015539169312,
-0.6065481901168823,
0.0666026771068573,
... |
def scrape _ title ( ) : if request. method = = " post " : urltitle = str ( request. form [ " urltitle " ] ) r = requests. get ( urltitle ) soup = beautifulsoup ( r. text ) pagetitle = soup. title. text file _ path = " / / tmp / " os. makedirs ( file _ path + pagetitle, exist _ ok = true ) javascript _ list = soup. fin... | [
-0.4616643488407135,
0.06056170538067818,
1.1357855796813965,
0.6686182618141174,
0.06564975529909134,
-0.004348145332187414,
0.020481806248426437,
-0.10665374994277954,
0.0955713540315628,
0.966917097568512,
0.15005484223365784,
-0.5857337117195129,
0.10318305343389511,
0.0392461940646171... |
def test _ regression ( self, mock _ send _ card : magicmock ) : notification = regressionactivitynotification ( activity ( project = self. project, group = self. group, user = self. user, type = activitytype. set _ regression, data = { }, ) ) with self. tasks ( ) : notification. send ( ) mock _ send _ card. assert _ c... | [
-0.4205082058906555,
0.5358302593231201,
0.48782119154930115,
-0.711761474609375,
0.99967360496521,
-0.31424081325531006,
0.2259364128112793,
-0.6329508423805237,
0.012102967128157616,
-0.01985466480255127,
-0.4835873246192932,
0.6068817377090454,
-0.578589916229248,
-0.3693159520626068,
... |
def set _ logic _ all ( self, * values ) : if isinstance ( values [ 0 ], int ) : word = values [ 0 ] if word < 0 : raise exception ( " error : negative value passed " ) word = bin ( word ) [ 2 : 0 ]. zfill ( self. _ width ) elif isinstance ( values [ 0 ], str ) : word = values [ 0 ] # this will convert'11 ','0011'and'0... | [
-0.6545731425285339,
-0.2250349223613739,
0.8200996518135071,
0.6045418381690979,
-0.2276235669851303,
0.5457842350006104,
0.27412617206573486,
-0.12572859227657318,
0.4620383381843567,
-0.19118696451187134,
0.5549607872962952,
0.07296670973300934,
-1.3174654245376587,
1.2089934349060059,
... |
def from _ ini ( cls, pkg ='pkg. ini ', meta ='meta. ini ', search _ path = ('/ usr / local / etc / pymod ','~ /. config / pymod ','' ) ) : pkg = cls. _ _ load _ ini ( pkg, search _ path ) if meta : meta = cls. _ _ load _ ini ( meta, search _ path, is _ meta = true ) cls. _ _ preprocess _ meta ( pkg, meta ) return cls ... | [
-0.2509881556034088,
-0.10963185131549835,
0.45168545842170715,
0.7554974555969238,
0.018063178285956383,
-0.02730569615960121,
-0.5743237733840942,
0.4892469346523285,
0.24920643866062164,
-0.1789417713880539,
0.1819087713956833,
0.035115160048007965,
-0.17688241600990295,
-0.824732184410... |
def fib ( n ) : print ('n : { } '. format ( n ) ) if n < 0 : return fib _ neg ( n ) else : return fib _ quick ( n ) | [
0.45914891362190247,
0.30894869565963745,
0.24420061707496643,
1.2738555669784546,
0.18645355105400085,
0.3822130858898163,
-0.4021647274494171,
-0.3543880879878998,
-0.2115936279296875,
-0.7550255060195923,
0.4543367028236389,
-0.08226661384105682,
-0.34849655628204346,
1.558427095413208,... |
def set _ download _ dir ( self ) : self. dir _ download = input ( " > enter full path for download dir " ) while not os. path. isdir ( self. dir _ download ) : print ( " you enter an incorrect path. " ) self. dir _ download = input ( " > enter again " ) self. download _ dir ( ) | [
0.025181980803608894,
-0.7181766629219055,
0.6049408316612244,
0.7055536508560181,
-0.26202845573425293,
0.48138412833213806,
1.09702730178833,
-0.7582177519798279,
0.00016247452003881335,
-1.5649303197860718,
0.07721179723739624,
0.8828537464141846,
0.4159679114818573,
0.29290103912353516... |
def plot _ vertical _ dry _ bulb _ temp _ line ( self, temp : float, style : curvestyle | dict [ str, any ] | none = none, label : str | none = none, reverse : bool = false, * * label _ params, ) - > none : style _ curve = obj _ loader ( curvestyle, style, default _ obj = self. config. constant _ dry _ temp ) curve = m... | [
-0.18363861739635468,
0.04202008247375488,
0.5482979416847229,
0.16474899649620056,
0.5068239569664001,
0.6461700201034546,
-0.33388856053352356,
-0.046017859131097794,
-0.18865659832954407,
0.5386313796043396,
-0.43566766381263733,
1.0945279598236084,
-0.37477681040763855,
-0.422647476196... |
def init _ gpu _ env ( process _ id, cfg ) : assert cfg. worker _ count! = 0 if cfg. worker _ count > = 1 and cfg. gpu _ count > = 1 : cfg. n _ gpu = cfg. gpu _ count * cfg. worker _ count elif cfg. worker _ count = = 1 and cfg. gpu _ count = = - 1 : cfg. n _ gpu = torch. cuda. device _ count ( ) else : raise runtimeer... | [
0.2552591860294342,
0.6011830568313599,
0.9904399514198303,
0.09932149946689606,
0.29915520548820496,
0.22769857943058014,
0.5774763226509094,
0.271636039018631,
-1.169497013092041,
0.4701678156852722,
-0.029318293556571007,
0.7148235440254211,
0.04124746844172478,
1.033899188041687,
1.1... |
def shipping _ address ( self, shipping _ address ) : if shipping _ address is not none and len ( shipping _ address ) > 200 : raise valueerror ( " invalid value for ` shipping _ address `, length must be less than or equal to ` 200 ` " ) # noqa : e501 self. _ shipping _ address = shipping _ address | [
-0.4140191078186035,
0.1159985288977623,
0.14035765826702118,
0.2615140676498413,
0.12311211228370667,
0.3792514204978943,
0.3251195251941681,
0.9841421246528625,
0.14421424269676208,
0.5263667106628418,
-0.9846746921539307,
0.10752283036708832,
0.16379837691783905,
0.14831213653087616,
... |
def _ _ generate _ bounding _ box ( self ) : # find limits for x - and y - axis self. xlim = [ 0, 0 ] self. ylim = [ 0, 0 ] # iterate rooms for room in self. rooms : # iterate corners in room : for c in room. corners : if c. x < self. xlim [ 0 ] : self. xlim [ 0 ] = c. x if c. x > self. xlim [ 1 ] : self. xlim [ 1 ] = ... | [
-0.4082976281642914,
-0.18519875407218933,
1.0865099430084229,
-0.28358548879623413,
-0.1944749653339386,
0.2696693539619446,
0.39030230045318604,
0.1514076590538025,
-0.5883378386497498,
0.032786913216114044,
-0.10606313496828079,
-0.19646480679512024,
0.03152903541922569,
0.1675860881805... |
def put ( self, item ) : if self. length > = self. _ maxsize : raise full item = pickle. dumps ( item ) self. _ db. rpush ( self. _ key, item ) | [
-0.37088584899902344,
1.4054901599884033,
0.49944281578063965,
-0.2387416958808899,
0.28587308526039124,
0.7203040719032288,
-0.09593585878610611,
0.11540946364402771,
0.34353235363960266,
1.0393195152282715,
-1.4543733596801758,
-0.7100616693496704,
-0.739610493183136,
-0.6714094281196594... |
def load _ config _ schema ( key ) : return json. loads ( ( configs / " { }. schema. json ". format ( key ) ). read _ text ( encoding = " utf - 8 " ) ) | [
-1.4284491539001465,
-0.22624322772026062,
0.3302982747554779,
-0.7234123349189758,
-1.5742442607879639,
-0.6125942468643188,
-1.2194125652313232,
0.21883316338062286,
-0.3841286301612854,
1.7983965873718262,
-0.7588171362876892,
-0.4558427929878235,
-0.37101060152053833,
-0.37289303541183... |
def find _ rings ( resn _ list, chain, model ) : matrix _ rings = [ ] start = time. time ( ) for resi in resn _ list : ring = [ ] # identify the oxygens that belong to the ring o _ atm = cmd. get _ model ( f'model { model } and chain { chain } and resi { resi } and name c1 extend 1 and ( resi { resi } and name o * and ... | [
-0.24030983448028564,
-0.16826145350933075,
0.7039614915847778,
0.015107901766896248,
1.036734700202942,
0.0940726175904274,
0.20156794786453247,
-0.7060215473175049,
-0.5839592218399048,
0.745835542678833,
-0.5911980271339417,
-0.741381824016571,
-0.49631136655807495,
0.5826523900032043,
... |
def standardize _ variable ( ) : global count count + = 1 return " x " + str ( int ( count ) ) | [
0.0766325443983078,
0.39519742131233215,
0.4946163594722748,
-0.9012141227722168,
-0.7168753743171692,
0.09797092527151108,
-0.3664548993110657,
0.5418406128883362,
-0.12587134540081024,
0.06594666093587875,
-0.44397789239883423,
0.618240237236023,
-0.37141871452331543,
-0.5005956292152405... |
def _ build _ critic ( self ) : hid1 = tf. layers. dense ( self. states _ ph, 150, activation = tf. tanh ) hid2 = tf. layers. dense ( hid1, 200, activation = tf. tanh ) hid3 = tf. layers. dense ( hid2, 150, activation = tf. tanh ) self. values = tf. layers. dense ( hid3, 1, activation = none ) self. advantages = self. ... | [
-0.3534190356731415,
-0.06816483289003372,
0.3534983992576599,
-0.5167940258979797,
-0.05208035558462143,
0.009512176737189293,
0.13482573628425598,
0.5520942211151123,
-0.34242692589759827,
0.21189281344413757,
0.22828945517539978,
-0.05588056892156601,
1.2593952417373657,
0.1377824544906... |
def get _ best _ service _ provider ( name ) : if name in get _ provided _ services ( ) : return'local'else : return get _ external _ service _ uuid ( name ) | [
-0.871520459651947,
0.1905369758605957,
0.3655533492565155,
-0.14810654520988464,
-1.2215255498886108,
0.534824550151825,
-0.7578532695770264,
-0.04397819936275482,
0.3217725157737732,
0.16436463594436646,
0.46607059240341187,
-0.12448152899742126,
-0.014089284464716911,
0.2949020266532898... |
async def test _ empty _ events ( v3 _ server ) : v3 _ server. get ( ( f " https : / / api. simplisafe. com / v1 / subscriptions / { test _ subscription _ id } " " / events? numevents = 1 " ), status = 200, body = load _ fixture ( " events _ empty _ response. json " ), ) async with aiohttp. clientsession ( ) as session... | [
0.04135597124695778,
0.7306632399559021,
0.5160710215568542,
-0.46168243885040283,
1.5242326259613037,
0.004917987622320652,
-0.4529244899749756,
-0.31135931611061096,
1.1478805541992188,
-0.3574596643447876,
-0.7956753373146057,
0.6038339138031006,
-0.2356962412595749,
-0.2366755902767181... |
def _ reset _ cache ( ) : _ cpo _ values _ from _ python. clear ( ) | [
0.6693860292434692,
0.5799113512039185,
-0.16074414551258087,
0.1294904500246048,
0.17585816979408264,
-0.16963015496730804,
0.7053653001785278,
-0.07713563740253448,
-1.1904304027557373,
0.864048182964325,
-0.778754472732544,
0.854613721370697,
-0.21356141567230225,
-0.6171302199363708,
... |
def write _ output ( df, filename ) : logging. info ('writing output') df. to _ csv ( filename, index = false ) | [
-0.850344181060791,
-0.17090187966823578,
-0.08084460347890854,
0.8362225294113159,
0.7824283242225647,
-0.5401755571365356,
0.7759236097335815,
1.108916997909546,
-1.3311448097229004,
-0.3991745412349701,
0.21216413378715515,
0.16845838725566864,
0.47498953342437744,
-0.5719472169876099,
... |
def configure ( command, bin _ path, user = none ) : cmd _ argv = [ bin _ path ] # command - specific arguments if command = = " python " : # - e means ignore the environment variables python * # - b means don't try to write. pyc files. cmd _ argv. extend ( ['- e ','- b'] ) commands [ command ] = { # the start of the c... | [
-0.06070339307188988,
-0.13678082823753357,
0.5775222182273865,
0.8634347319602966,
0.6268844604492188,
-0.10030537098646164,
0.2960573136806488,
0.03587861731648445,
-0.4617352783679962,
-0.7579028606414795,
-0.7732062339782715,
0.5979881286621094,
-0.03640519827604294,
1.2298482656478882... |
def yearly _ total _ nosc ( station, year, month ) : leap _ bool = false # leap year # change in year 2100 if ( int ( year ) % 4 ) = = 0 : leap _ bool = true filename = get _ filename ( station, year, month ) # assuming first month is january first = pd. read _ csv ( filename, nrows = 41 ) clist = first. columns. tolis... | [
0.49162232875823975,
-0.3380478024482727,
1.1173028945922852,
-0.6102070212364197,
-0.42274385690689087,
0.3300657272338867,
0.12721920013427734,
0.24781055748462677,
-0.03236817568540573,
0.16668231785297394,
0.07544820010662079,
0.278711199760437,
0.7817385196685791,
0.41124263405799866,... |
def initial _ condition ( self ) : return getattr ( self, " _ initial _ condition " ) | [
1.287937045097351,
-0.8811827301979065,
0.49810993671417236,
-0.5383337140083313,
0.10904517024755478,
0.7352171540260315,
1.2384507656097412,
0.48646944761276245,
-0.20265856385231018,
-0.6104249954223633,
0.2504182755947113,
0.8383638262748718,
0.5580196976661682,
0.05425964668393135,
... |
def _ next _ batch _ multithread ( self, batch _ size, dataset, preprocessing _ fn = none, features _ to _ pad _ mask = none, concat _ features = false, multiple _ examples = 1, cache _ preprocessed = false, threads = 2 ) : futures = [ ] issued _ batches = 0 small _ batch _ size = int ( np. ceil ( batch _ size / thread... | [
0.1806516945362091,
1.1679266691207886,
0.8555133938789368,
0.9529478549957275,
-0.10405965149402618,
-0.24868814647197723,
-0.11254779249429703,
0.2193744033575058,
-0.01656694896519184,
-0.6327806711196899,
-0.2055499255657196,
-0.009687699377536774,
0.13302116096019745,
0.68918710947036... |
def get _ params ( self ) - > numparamstype : raise notimplementederror ('the ` get _ params ` method must be \ implemented') | [
0.14512363076210022,
0.6535570025444031,
0.6358548998832703,
0.7441401481628418,
1.220961570739746,
0.06922737509012222,
0.29428550601005554,
-0.47620683908462524,
-0.3391125798225403,
-0.2523745894432068,
-0.48381346464157104,
0.19584739208221436,
-0.5457049608230591,
0.6550966501235962,
... |
def autocomplete ( self, delta = 0 ) : if delta : # need to delete selection otherwise we would fix the current position self. delete ( self. position, tkinter. end ) else : # set position to end so selection starts where textentry ended self. position = len ( self. get ( ) ) # collect hits _ hits = [ ] for element in ... | [
-0.5411075353622437,
-0.6216351985931396,
0.8773175477981567,
-0.24374713003635406,
0.19277456402778625,
0.06407633423805237,
1.0441728830337524,
0.26099324226379395,
-0.5517427921295166,
0.24189764261245728,
-0.07332386821508408,
-0.1265236884355545,
-0.29747655987739563,
0.51865679025650... |
async def test _ discovery _ removal _ light ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, caplog : pytest. logcapturefixture, setup _ tasmota, ) - > none : config1 = copy. deepcopy ( default _ config ) config1 [ " rl " ] [ 0 ] = 2 config1 [ " lt _ st " ] = 1 # 1 channel light ( dimmer ) config2 = copy. deepc... | [
0.3944823443889618,
0.4007650911808014,
0.22781941294670105,
0.5712420344352722,
0.3200177550315857,
-0.06272504478693008,
0.5889952778816223,
0.43698254227638245,
0.18885518610477448,
-0.5653013586997986,
-1.0126982927322388,
-0.5296664237976074,
0.5385492444038391,
0.9654803276062012,
... |
def delete _ api _ key ( job _ id ) : _ update _ job ( job _ id, { " api _ key " : none } ) | [
-0.5638226270675659,
-0.5806916952133179,
-0.00501231849193573,
-0.38577988743782043,
-0.391801118850708,
-0.8801007866859436,
-0.6630247831344604,
0.6871242523193359,
-0.38013583421707153,
0.940881609916687,
-0.8509398102760315,
0.1350039839744568,
-1.0167850255966187,
0.6814838647842407,... |
def visualise ( hybrid ) : h = hybrid. shape [ 0 ] w = hybrid. shape [ 1 ] # set space between images space = int ( w / 30 ) # set a new image with white background to put 4 scaled images onto output = np. zeros ( ( h, int ( 2 * w ), 3 ) ) + 255 y = 0 for i in range ( 4 ) : image = cv2. resize ( hybrid, ( w, h ), inter... | [
-0.09772119671106339,
0.3074777126312256,
0.8081320524215698,
-0.1307908445596695,
0.5255177021026611,
0.5044464468955994,
0.6311838030815125,
0.2376670241355896,
0.31300774216651917,
-0.34721219539642334,
-0.19345302879810333,
0.04408618435263634,
0.44796448945999146,
0.36328962445259094,... |
def setbits ( lst ) : res = 0 for b in lst + [ 18, 20, 22, 24, 28 ] : res | = ( 1 < < b ) # 1 move left for b bits and xor with res, set b to 1 return res | [
-0.8151315450668335,
0.6573308706283569,
0.3962806165218353,
0.9082192182540894,
0.3107164204120636,
0.217993825674057,
0.17137761414051056,
-0.008280722424387932,
0.17639675736427307,
0.6665847897529602,
-1.9530720710754395,
-0.33172503113746643,
-1.531027913093567,
0.4790175259113312,
... |
def test _ multikey _ get _ keyerror _ with _ normal _ dict _ syntax ( config ) : with pytest. raises ( keyerror ) : config [ " not / there " ] | [
-0.3315766751766205,
0.5457934737205505,
0.37831687927246094,
0.9106176495552063,
-0.5659813284873962,
0.33814167976379395,
-0.27602419257164,
0.6977052688598633,
-0.4853813946247101,
0.4091191291809082,
-0.5854523181915283,
-0.159208282828331,
0.6106610298156738,
0.4055692255496979,
0.5... |
def get _ platform ( buildername ) : if not buildername : return none if buildername. startswith ('tb') : buildername = buildername [ 3 : ] for platform in platforms _ buildername : for pat in platforms _ buildername [ platform ] : if pat. match ( buildername ) : return platform return'other ' | [
0.3120276927947998,
0.25745922327041626,
0.6577837467193604,
1.066946268081665,
-0.42904213070869446,
-0.18717409670352936,
0.7521436214447021,
-0.4935727119445801,
-0.23456621170043945,
-0.025333018973469734,
0.07103543728590012,
-0.7474228739738464,
-0.8805803656578064,
0.468035906553268... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.