text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def read _ toa _ file ( self, filename, process _ includes = true, top = true ) : if top : self. ntoas = 0 self. toas = [ ] self. commands = [ ] self. cdict = { " efac " : 1. 0, " equad " : 0. 0 * u. us, " emin " : 0. 0 * u. us, " emax " : 1e100 * u. us, " fmin " : 0. 0 * u. mhz, " fmax " : 1e100 * u. mhz, " info " : n... | [
-0.7048304677009583,
0.04579606279730797,
0.8537305593490601,
-0.5247557163238525,
-0.93858802318573,
-0.0470745824277401,
0.8036869764328003,
0.4705621302127838,
-0.4552191495895386,
0.2084081619977951,
0.4104900062084198,
-0.3015716075897217,
0.32739442586898804,
0.9231342673301697,
0.... |
def astar ( self, start _ vid, end _ vid ) : sql = " " " select *, v. lon : : double precision, v. lat : : double precision from pgr _ astar ('select { id } : : integer as id, { source } : : integer as source, { target } : : integer as target, { cost } as cost, { x1 } as x1, { y1 } as y1, { x2 } as x2, { y2 } as y2 { r... | [
-0.8678656220436096,
-0.6820081472396851,
0.8294824957847595,
-0.5276589393615723,
-0.9718018770217896,
-0.3114178776741028,
-0.7036895155906677,
0.01786823570728302,
-1.2137596607208252,
1.3507080078125,
-0.5163555145263672,
1.0495139360427856,
0.3530774414539337,
0.6251737475395203,
-0... |
def setup ( self ) : if debug : print ('\ nsetup algorithm : \ n') # ( sk, pk ) h = self. group. random ( g2 ) self. sk = self. group. random ( zr ) self. pk = h * * self. sk # ( msk, mpk ) g = self. group. random ( g1 ) a0 = self. group. random ( zr ) a1 = self. group. random ( zr ) b0 = self. group. random ( zr ) b1 ... | [
-0.2162596434354782,
0.3280029296875,
0.7552382349967957,
-0.2851375341415405,
-0.05488644912838936,
0.3258174657821655,
1.6199722290039062,
0.1410873383283615,
-0.6630025506019592,
0.6098363995552063,
-0.19922228157520294,
-0.976942241191864,
-0.3365620970726013,
0.9783554673194885,
-0.... |
def get _ words _ per _ sentence ( content ) : words = get _ words ( content ) sentences = get _ sentences ( content ) return words / sentences | [
0.32040733098983765,
-0.233500137925148,
0.24533864855766296,
-0.7999770641326904,
0.634025514125824,
-1.2425906658172607,
0.308247834444046,
-0.5902507901191711,
-0.5505517721176147,
1.3797394037246704,
0.7673395872116089,
-1.1831743717193604,
-1.1080228090286255,
1.287447452545166,
-0.... |
def set _ background ( char = " " ) : assert len ( char ) = = 1, _ char _ assert _ template. format ( char ) global _ background _ char old _ background = _ background _ char _ background _ char = char for row in range ( _ max _ rows ) : for column in range ( _ max _ columns ) : if _ grid [ row ] [ column ] = = old _ b... | [
0.06257086992263794,
0.33937376737594604,
0.6781678795814514,
0.21484538912773132,
0.09011305123567581,
-0.589172899723053,
1.0041189193725586,
-0.19277054071426392,
-0.06319927424192429,
0.4671252369880676,
-0.8297526836395264,
1.6622141599655151,
-0.9088805317878723,
0.48019447922706604,... |
def create _ connection ( ) : conn = none try : conn = sqlite3. connect ( vchess _ db _ path ) except error as e : print ( e ) return conn | [
0.6638291478157043,
-0.3722589910030365,
0.31224602460861206,
0.262149840593338,
0.6734820604324341,
-0.08749685436487198,
-0.7243117094039917,
0.1428886353969574,
-0.3360140323638916,
0.3047785460948944,
0.5662775635719299,
-0.40875935554504395,
-1.4732112884521484,
-0.4897845983505249,
... |
def log _ metric ( metric : str, value : any ) : _ check _ experiment ( ) _ current _ experiment. log _ metric ( metric, value ) | [
0.02430340275168419,
0.7369635105133057,
0.019495153799653053,
0.8147767186164856,
-0.5701550245285034,
0.24770548939704895,
-0.3825986981391907,
-0.5881565809249878,
-0.7838557958602905,
0.30718159675598145,
0.5242555737495422,
0.9005579948425293,
-0.18862085044384003,
-0.1181519702076911... |
def configure ( self ) : pass | [
-0.32320815324783325,
-0.5395461916923523,
0.14683957397937775,
0.9435516595840454,
0.7742154598236084,
-0.24076569080352783,
0.3588549494743347,
0.674384355545044,
-0.09876257181167603,
-0.8585100173950195,
-0.8588994741439819,
-0.554157555103302,
0.061638616025447845,
0.9091842770576477,... |
def rasterize _ mesh _ with _ f3v _ interpolant ( self, mesh, per _ vertex _ f3v = none, normals = none ) : if not ( hasattr ( mesh,'points') and hasattr ( mesh,'trilist') ) : raise valueerror ('rasterizable types have to have points and'' trilist properties.') if hasattr ( mesh,'tcoords') : images = self. _ rasterize ... | [
-0.22303681075572968,
0.22027897834777832,
0.7927772402763367,
0.33935102820396423,
-0.11411705613136292,
0.26308029890060425,
-0.6099855303764343,
0.22520309686660767,
0.1801310032606125,
0.0303121879696846,
0.05011776089668274,
-0.25878000259399414,
-0.5229496955871582,
0.941882491111755... |
def sim _ relative _ move ( self, positioner, distance ) : | [
-0.25356537103652954,
-0.10093438625335693,
0.3695085942745209,
1.4575647115707397,
-1.1400147676467896,
0.7428311705589294,
0.092333123087883,
-0.3544641435146332,
-0.17096009850502014,
0.9645704627037048,
-0.4457220733165741,
-1.0408029556274414,
-0.19950813055038452,
0.09628483653068542... |
def parse _ arguments ( args : list ) - > namespace : parser = argumentparser ( description = " a tool to combine multiple merge tools " ) parser. add _ argument ('- b ','- - base ', required = true ) parser. add _ argument ('- l ','- - local ', required = true ) parser. add _ argument ('- r ','- - remote ', required =... | [
0.1262044459581375,
0.3454975187778473,
0.5606127977371216,
0.28422248363494873,
0.39704790711402893,
-0.17794252932071686,
-0.5701769590377808,
-0.47294846177101135,
0.31773778796195984,
0.11613181978464127,
-0.5385879874229431,
-0.11069944500923157,
-0.008136114105582237,
1.0473926067352... |
def process _ command ( self, context ) : if " / start " in context [ " text " ] : self. command _ start ( context ) elif " / formats " in context [ " text " ] : self. command _ formats ( context ) elif " / register " in context [ " text " ] : self. command _ register ( context ) else : self. send _ message ( context, ... | [
-0.41756004095077515,
0.1642841249704361,
0.6540798544883728,
0.5838862061500549,
1.3491791486740112,
-0.3964702785015106,
-0.1975947618484497,
-0.5991642475128174,
0.806968092918396,
0.34132105112075806,
0.19257861375808716,
0.6087672710418701,
-0.239420548081398,
1.1690566539764404,
-0... |
def testpath ( pathparts, querypathparts, attrs ) : if type ( pathparts ) = = type ('' ) : pathparts = pathparts. split ('/') if type ( querypathparts ) = = type ('' ) : querypathparts = querypathparts. split ('/') npathparts = len ( pathparts ) match = false maymatch = true if npathparts = = len ( querypathparts ) : m... | [
-0.3006954789161682,
-0.8775628805160522,
0.5988527536392212,
-0.4639517366886139,
-0.9488162994384766,
0.3727995455265045,
0.1926204115152359,
-0.19217222929000854,
-0.04718257114291191,
-0.31473037600517273,
0.5766438245773315,
-0.2507289946079254,
-1.4444602727890015,
-0.743710458278656... |
def pressed ( self ) : try : self. groups = int ( self. num _ groups. text ( ) ) if not ( 2 < self. groups < = 10 ) : self. error _ msg _ box ( " the number of groups must be in the range [ 2, 10 ]. ", " invalid group number " ) elif not ( self. check _ valid _ lunch _ swim ( self. groups ) ) : self. error _ msg _ box ... | [
-0.3596823215484619,
0.7545086145401001,
0.5670768618583679,
-0.06689180433750153,
0.20954668521881104,
-0.28533902764320374,
1.8397752046585083,
-0.6503328680992126,
-0.3318693935871124,
-0.19516119360923767,
0.021901242434978485,
0.10752071440219879,
-0.7873966693878174,
-0.0963938012719... |
def release _ kind ( ) : # use min here as'major'<'minor'<'patch'return min ('major'if'breaking'in file. name else'minor'if'change'in file. name else'patch'for file in pathlib. path ('changelog. d'). iterdir ( ) ) | [
-0.12829893827438354,
-0.5618757009506226,
0.5013928413391113,
-0.7550454139709473,
-0.9703904986381531,
0.4755156636238098,
-0.24138009548187256,
-0.7246472835540771,
-0.24431173503398895,
0.3918953835964203,
0.26586538553237915,
0.31036272644996643,
-0.191001296043396,
0.7225221395492554... |
async def unignore _ channel ( self, ctx : commands. context, channel _ str : str ) : # searches for channel id in string like'< # 546528012430999552 >'channel _ id = re. search ( r'\ d + ', channel _ str ) if not channel _ id : return await ctx. send ( f'invalid channel : { channel _ str }') channel _ id = int ( chann... | [
0.31754153966903687,
-0.3365100920200348,
0.5814012289047241,
-1.0359081029891968,
0.2147689312696457,
0.3812866806983948,
0.03795153647661209,
0.0959145799279213,
0.6520631313323975,
0.33175209164619446,
-0.19517144560813904,
1.0232630968093872,
-1.1405272483825684,
-0.5590901970863342,
... |
def train ( self, input, expected ) : expected = np. array ( expected ). reshape ( 1, self. nclasses ) " " " first the example is feed to the network and the prediction is stored " " " result = self. feed ( input ) " " " compute the current loss using mean squared error " " " lossfunction = lossfunction. meansquareerro... | [
-0.24622857570648193,
0.16993267834186554,
0.834308922290802,
-0.13690730929374695,
0.44450074434280396,
-0.242315411567688,
0.9375960826873779,
0.12002738565206528,
-0.24731747806072235,
0.06340424716472626,
-0.42866820096969604,
0.07605103403329849,
-0.377882182598114,
0.2678464651107788... |
def delete _ school ( school _ id ) : try : current _ app. logger. info ( " delete school id : { } ". format ( school _ id ) ) return jsonify ( { " status " : school _ service. delete _ school _ by _ id ( school _ id ) } ), 200 except sqlcustomerror as error : current _ app. logger. error ( " fail to delete school _ id... | [
-0.6222213506698608,
-0.8379786610603333,
0.5039685368537903,
0.7352107763290405,
0.6687854528427124,
-0.5790720582008362,
-0.05227260664105415,
0.2875041365623474,
1.2328699827194214,
0.7859419584274292,
-0.18212245404720306,
0.8950952291488647,
-0.376188188791275,
0.7564651370048523,
-... |
def global _ temperature ( ) : # perform the sql query query = db. session. query ( globaltemperature. date, func. avg ( globaltemperature. land _ average _ temperature ). label ('avg _ land _ temperature'), func. avg ( globaltemperature. land _ and _ ocean _ average _ temperature ). label ('avg _ land _ and _ ocean _ ... | [
-0.64290851354599,
0.4818379580974579,
0.5854326486587524,
-0.43607619404792786,
-0.23011504113674164,
0.019300460815429688,
-0.13644661009311676,
0.03557107597589493,
-1.786877155303955,
1.7663360834121704,
-0.16796685755252838,
0.853398323059082,
0.35731902718544006,
0.7755091190338135,
... |
def _ on _ confirm _ account _ button ( self ) : # create regex for a valid url regex = compile ( r'^ (? : http | ftp ) s? : / /'# http : / / or https : / / r'(? : (? : [ a - z0 - 9 ] (? : [ a - z0 - 9 - ] { 0, 61 } [ a - z0 - 9 ] )? \. ) + (? : [ a - z ] { 2, 6 } \.? | [ a - z0 - 9 - ] { 2, } \.? ) |'# domain... r'\ d... | [
0.2981920540332794,
-0.21689215302467346,
0.9706977009773254,
0.34039008617401123,
-0.4505016505718231,
-0.08353829383850098,
0.6219245791435242,
0.35310032963752747,
0.2961980402469635,
0.02717708609998226,
0.511466920375824,
0.28169700503349304,
-0.30420738458633423,
0.2618136405944824,
... |
def overwrite _ ok ( self ) : if not self. experiment _ metadata is none : overwrite = _ _ internal _ _. case _ insensitive _ find ( self. experiment _ metadata,'overwrite') if not overwrite is none : return overwrite return self. overwrite | [
-0.2112230509519577,
-0.07697728276252747,
0.4350932836532593,
0.012188642285764217,
0.8838359713554382,
-0.0782877579331398,
0.9061204791069031,
-0.5460156202316284,
-0.37851178646087646,
0.8184236288070679,
1.3432574272155762,
-0.4487285614013672,
-0.977079451084137,
-0.3775348961353302,... |
def input _ with _ timeout ( seconds ) : response, _, _ = select. select ( [ sys. stdin ], [ ], [ ], seconds ) if response : return sys. stdin. readline ( ). strip ( ) else : return'' | [
0.009813745506107807,
-0.5963152050971985,
0.4450467824935913,
0.2921678423881531,
-1.003402590751648,
0.30303773283958435,
-0.7774662375450134,
-1.6540906429290771,
0.6339175701141357,
0.3184809386730194,
-0.08218682557344437,
0.34618905186653137,
-0.2238779515028,
-0.8337915539741516,
... |
async def test _ turn _ on _ light ( hass : core. homeassistant ) : await setup _ platform ( hass, light _ domain, ceiling _ fan ( " name - 1 " ) ) with patch ( " homeassistant. components. bond. bond. turnlighton " ) as mock _ turn _ light _ on : await hass. services. async _ call ( light _ domain, service _ turn _ on... | [
0.3996625542640686,
0.6069390177726746,
0.3693626821041107,
0.3293396532535553,
0.6352382302284241,
0.29957446455955505,
-0.2524057924747467,
-0.0958416610956192,
0.10742682963609695,
-0.5059406757354736,
-1.0710549354553223,
0.24811215698719025,
-0.4595797657966614,
0.22097450494766235,
... |
def clean _ thread _ title ( self ) : existing = thread. objects. filter ( slug _ _ iexact = slugify ( self. cleaned _ data ['thread _ title'] ) ) if existing. exists ( ) : raise forms. validationerror ( _ ( " thread already exist. " ) ) else : return self. cleaned _ data ['thread _ title'] | [
0.16500967741012573,
-0.3241283893585205,
0.7118070125579834,
-0.015309901908040047,
0.25329792499542236,
0.3842933177947998,
-0.5182383060455322,
-0.6314923763275146,
-0.09842447936534882,
0.7978889346122742,
0.42308712005615234,
-0.012112364172935486,
-0.8459286093711853,
-0.190151497721... |
def retrieve _ list ( self, parsed _ args ) : blazar _ client = self. get _ client ( ) body = self. args2body ( parsed _ args ) resource _ manager = getattr ( blazar _ client, self. resource ) data = resource _ manager. list _ properties ( * * body ) return data | [
0.07213491201400757,
-0.6087849736213684,
0.41721996665000916,
-0.2026580572128296,
1.270496129989624,
-0.319739431142807,
-0.39281103014945984,
0.03208974376320839,
-0.25288355350494385,
-0.5148549675941467,
-0.4518393576145172,
0.10697353631258011,
-0.5900654196739197,
0.0271680112928152... |
def source _ snapshot ( self ) - > pulumi. output [ optional [ str ] ] : return pulumi. get ( self, " source _ snapshot " ) | [
0.5375527739524841,
0.5050828456878662,
0.3844469487667084,
0.17669115960597992,
-0.8206303715705872,
0.662929117679596,
0.31612756848335266,
0.048491593450307846,
1.17270028591156,
-0.14284449815750122,
-0.41035890579223633,
0.07093250751495361,
0.9608317613601685,
-1.0136873722076416,
... |
def get _ source _ projects ( self, obj ) : return [ reverse ( " api : project ", kwargs = { " pk " : project. id } ) for project in obj. source _ projects. all ( ) ] | [
-0.7241267561912537,
0.07668773084878922,
0.25324830412864685,
-0.1577761322259903,
0.41901999711990356,
0.9349120259284973,
-0.574809193611145,
-0.07718237489461899,
0.8286769390106201,
0.6628033518791199,
-0.4864020049571991,
0.22547182440757751,
0.13258270919322968,
0.03099226951599121,... |
def conf2toconfigurable ( comp, indent = " " ) : _ log = logging. getlogger ( " conf2toconfigurable ". ljust ( 30 ) ) from athenacommon. cfelements import compname def _ _ isoldconfigurable ( c ) : from athenacommon. configurable import configurable return true if isinstance ( c, configurable ) else false if _ _ isoldc... | [
-0.04836823418736458,
-1.2593814134597778,
0.846279501914978,
0.46982505917549133,
-0.5347074270248413,
-0.6290205717086792,
0.5152137875556946,
-0.08242868632078171,
0.09066380560398102,
0.3205902576446533,
-1.1499583721160889,
0.14300701022148132,
0.5605749487876892,
-0.19122931361198425... |
def valid _ set ( subset ) : colors = [ get _ color ( card ) for card in subset ] symbols = [ get _ symbol ( card ) for card in subset ] shades = [ get _ shade ( card ) for card in subset ] numbers = [ get _ number ( card ) for card in subset ] return ( all _ same ( colors ) or all _ different ( colors ) ) and ( all _ ... | [
-0.5476000308990479,
-0.1825011819601059,
0.8161492347717285,
-0.11313821375370026,
-0.69145667552948,
0.3041818141937256,
-0.3476475477218628,
-0.4703393876552582,
-0.11062221229076385,
-0.2918756306171417,
-0.3414832353591919,
0.11142899841070175,
0.016862083226442337,
0.2078261077404022... |
def getlocatorsfrompaths ( self, locatorobjlist, pathlist, locatorindex = 0 ) : # index the input locatorobjlist rl = [ ] try : if locatorobjlist and isinstance ( locatorobjlist [ 0 ], str ) : return pathlist # locidx = { } for ii, locatorobj in enumerate ( locatorobjlist ) : if " locator " in locatorobj [ locatorindex... | [
-0.5523659586906433,
-0.5955348610877991,
0.4463540017604828,
0.45731234550476074,
-0.11557430028915405,
-0.2126091718673706,
-0.04289010539650917,
-0.11669082939624786,
0.530868649482727,
0.36666521430015564,
0.024080684408545494,
-0.46022549271583557,
-0.8083999156951904,
-0.223029255867... |
def test _ iter _ from _ resource ( ) : with open ( fixture _ location ('basic. conll'), encoding ='utf - 8') as f : expected _ ids = [ f'fr - ud - dev _ 0000 { i }'for i in range ( 1, 5 ) ] actual _ ids = [ sent. id for sent in iter _ from _ resource ( f ) ] assert expected _ ids = = actual _ ids | [
-0.16337363421916962,
-0.8148221969604492,
0.3187955915927887,
-0.3476746380329132,
0.4415258765220642,
0.21620488166809082,
0.501849353313446,
-0.5759878754615784,
-0.5599298477172852,
0.2266707718372345,
-0.4959959089756012,
-0.5032010078430176,
0.40227043628692627,
0.3939046561717987,
... |
def make _ plot _ function ( states _ list, speeds _ list, riemann _ eval _ list, wave _ types _ list = none, names = none, layout ='horizontal ', variable _ names = none, colors = ('multi ','green ','orange'), plot _ chars = none, derived _ variables = none, aux = none, cdindex = none ) : if type ( states _ list ) is ... | [
0.7620623707771301,
0.40978896617889404,
0.7304719686508179,
0.024123746901750565,
-0.3707767128944397,
-0.366498202085495,
0.3779062032699585,
0.5466339588165283,
-0.2713877856731415,
-0.38667792081832886,
-0.5287819504737854,
0.5643035769462585,
0.025145765393972397,
0.27386078238487244,... |
def handle _ sketch _ name ( hass : homeassistant, gateway _ id : gatewayid, msg : message ) - > none : _ handle _ node _ update ( hass, gateway _ id, msg ) | [
0.3911496698856354,
0.6016907095909119,
0.45875486731529236,
-0.7469140887260437,
-0.3865080177783966,
-0.7568804621696472,
-0.044574666768312454,
-0.7088909149169922,
0.7236759066581726,
0.5140600800514221,
-0.36814865469932556,
0.2829066812992096,
0.5941788554191589,
0.4164539575576782,
... |
def with _ env ( self, * * environment _ variables ) : new _ env _ vars = { str ( var ) : str ( val ) for var, val in environment _ variables. items ( ) } new _ command = copy. deepcopy ( self ) new _ command. _ env. update ( new _ env _ vars ) return new _ command | [
-0.43709778785705566,
-1.1980239152908325,
0.5203593969345093,
-0.1876499354839325,
0.24770613014698029,
0.7470121383666992,
-1.0143096446990967,
-0.4936288893222809,
-0.5840618014335632,
-0.06467318534851074,
0.009322633035480976,
1.044084072113037,
0.13318780064582825,
0.5807259678840637... |
def save _ json ( data ) : json _ data. extend ( data ) | [
-1.0091150999069214,
-0.1721252053976059,
0.4212295114994049,
-0.42057740688323975,
0.15612518787384033,
0.5086048245429993,
-1.5520509481430054,
-0.21049928665161133,
0.5403476357460022,
0.4082356095314026,
-2.0573654174804688,
0.509169340133667,
-0.15078341960906982,
0.8300055265426636,
... |
def bold ( text : str ) - > str : return f " * { text } * " if get _ interface _ type ( ) = = " slack " else f " \ 033 [ 1m { text } \ 033 [ 0m " | [
0.40284112095832825,
0.2343607246875763,
0.5542686581611633,
0.83901047706604,
0.17752492427825928,
0.8191891312599182,
-1.0174574851989746,
-0.6436401605606079,
0.2225285917520523,
-0.4862068295478821,
0.5220534801483154,
1.2080962657928467,
-0.49356311559677124,
0.40825793147087097,
0.... |
def is _ path _ exist _ in _ template ( self, template _ name : str, path : str ) : request = tsquerytemplatereq ( self. _ _ session _ id, template _ name, templatequerytype. path _ exist. value, path ) response = self. _ _ client. queryschematemplate ( request ) logger. debug ( " judge the path is in template or not {... | [
-0.670436441898346,
-0.6719067692756653,
0.5345749258995056,
-0.4060761630535126,
-0.41989728808403015,
0.32505762577056885,
-0.4059823453426361,
0.3698464035987854,
-0.7826865315437317,
0.9942082762718201,
-0.28996741771698,
-0.40669122338294983,
-1.7366293668746948,
-0.3671826422214508,
... |
async def test _ attributes _ dimmer _ tuya ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, setup _ tasmota ) - > none : config = copy. deepcopy ( default _ config ) config [ " rl " ] [ 0 ] = 2 config [ " lt _ st " ] = 1 # 1 channel light ( dimmer ) config [ " ty " ] = 1 # tuya device mac = config [ " mac " ] a... | [
-0.471216082572937,
0.12353173643350601,
0.3576182425022125,
-0.6859599351882935,
0.15682817995548248,
0.13055887818336487,
0.006178231909871101,
0.41154956817626953,
0.17917102575302124,
-0.5690028667449951,
-0.27638235688209534,
-0.07878907024860382,
0.4704054296016693,
0.701682209968566... |
def testfindchromecandidates ( self ) : unstable, stable _ ebuilds = cros _ mark _ chrome _ as _ stable. findchromecandidates ( self. mock _ chrome _ dir ) stable _ ebuild _ paths = map ( lambda eb : eb. ebuild _ path, stable _ ebuilds ) self. assertequal ( unstable. ebuild _ path, self. unstable ) self. assertequal ( ... | [
0.1303226500749588,
-0.31668907403945923,
0.4024863839149475,
0.8857006430625916,
1.303861379623413,
0.9718492031097412,
0.8963843584060669,
0.42974790930747986,
-0.07139280438423157,
-0.5044125318527222,
-0.5431798696517944,
-0.025586789473891258,
-0.20155996084213257,
0.6994680762290955,... |
def getarduinoversion ( ) : try : if os. path. isfile ( getarduinofile ( " hardware / arduino / cores / arduino / arduino. h " ) ) : return 100 except : if os. path. isfile ( getarduinofile ( " hardware / arduino / cores / arduino / wprogram. h " ) ) : return 22 | [
-0.15626560151576996,
0.1582321971654892,
0.7666833996772766,
0.20845283567905426,
-0.6190311908721924,
0.29645293951034546,
0.881008505821228,
0.6397031545639038,
0.2817775309085846,
-0.6005907654762268,
0.1952901929616928,
0.6692628860473633,
-0.022425882518291473,
0.029685670509934425,
... |
def find _ nearest _ two _ stop ( lat, lng ) : # get data from data. taipei gz _ data = requests. get ('http : / / data. taipei / youbike') json _ data = gz _ data. json ( ) # get all stop location ubike _ locations = [ ] for key, loc in json _ data ['retval']. items ( ) : stop _ info = dict ( loc ) ubike _ locations. ... | [
-0.9566291570663452,
-0.8273219466209412,
0.753923773765564,
-0.26674172282218933,
-0.8466364741325378,
0.027084387838840485,
0.043143901973962784,
-0.16136550903320312,
-1.4498564004898071,
0.040910664945840836,
-1.267369031906128,
-0.23779965937137604,
0.7034088969230652,
0.0531152449548... |
def goto _ prev _ room ( self ) : prev _ room = self. current _ room ['number'] - 1 if prev _ room < 1 : print ( " you're at the first room, you can't go any further back... " ) return # even if the current room was cleared or not, a player must be able # to move forward again after moving to previous room self. can _ ... | [
-0.28088825941085815,
0.18800589442253113,
0.6364924311637878,
0.4031737744808197,
0.3488610088825226,
0.06306370347738266,
0.8113234639167786,
0.5505843162536621,
-0.2873818576335907,
0.7794115543365479,
0.10428544878959656,
0.8673794269561768,
-0.5131086707115173,
0.28483155369758606,
... |
def id ( self, id ) : if id is none : raise valueerror ( " invalid value for ` id `, must not be ` none ` " ) # noqa : e501 self. _ id = id | [
0.5690721273422241,
0.007103970739990473,
-0.14489315450191498,
0.11761163175106049,
0.29989153146743774,
0.9288021922111511,
0.19552433490753174,
0.5888565182685852,
1.2496665716171265,
-0.017770376056432724,
-0.5226971507072449,
-0.10816481709480286,
-0.4642733037471771,
0.62695246934890... |
def _ sort _ permutations ( problemsize ) : permute = set ( permutations ( range ( 1, problemsize + 1 ) ) ) # consider ; due to lexicographic ordering in permuations : cut no of permutations to half # permute = [ p for p in permutations ( range ( 1, problemsize + 1 ) ) if p [ 0 ] < p [ - 1 ] ] gen = range ( 1, problems... | [
-0.07577208429574966,
0.08690296113491058,
0.7520864009857178,
-0.6642413139343262,
-2.30240535736084,
0.4213295876979828,
0.7465564608573914,
-0.26652684807777405,
0.14978300034999847,
-0.09599636495113373,
-0.1778573840856552,
-0.6286284923553467,
-0.38495752215385437,
0.2721375226974487... |
def show _ generator _ output ( sess, n _ images, input _ z, out _ channel _ dim, image _ mode ) : cmap = none if image _ mode = ='rgb'else'gray'z _ dim = input _ z. get _ shape ( ). as _ list ( ) [ - 1 ] example _ z = np. random. uniform ( - 1, 1, size = [ n _ images, z _ dim ] ) samples = sess. run ( generator ( inpu... | [
-0.6009607911109924,
0.09675540030002594,
0.4132874310016632,
-0.04507673531770706,
-1.0024914741516113,
-0.4245562255382538,
1.1780457496643066,
0.4070712625980377,
-0.2980174422264099,
-0.08487775176763535,
0.19786976277828217,
0.3816107511520386,
0.6536761522293091,
0.8722653985023499,
... |
def is _ executed _ by _ trac _ admin ( self ) : rv = false if len ( sys. argv ) > = 1 : rv = sys. argv [ 0 ]. find ('trac - admin')! = - 1 return rv | [
-0.04807426035404205,
0.6131501793861389,
0.4786888360977173,
0.6637226343154907,
0.9545349478721619,
0.1557437777519226,
0.6039807200431824,
-0.4862455427646637,
-0.4675118923187256,
0.42971619963645935,
-0.07304943352937698,
0.6181403398513794,
-0.3327387273311615,
0.5899027585983276,
... |
def boundaries ( axis, dimlen ) : ax = axis. astype ( np. float64 ) if ax. shape [ 0 ] = = 1 : return ax elif ax. shape [ 0 ] = = dimlen : start = ax [ 0 ] - ( ax [ 1 ] - ax [ 0 ] ) / 2 end = ax [ - 1 ] + ( ax [ - 1 ] - ax [ - 2 ] ) / 2 return np. concatenate ( ( np. atleast _ 1d ( start ), ( ax [ : - 1 ] + ax [ 1 : ] ... | [
0.051246095448732376,
-0.3426288664340973,
0.9444800019264221,
0.933978259563446,
-0.10213135182857513,
-0.07560335099697113,
0.044684767723083496,
-0.9154524207115173,
0.25235071778297424,
0.4172469675540924,
0.03550553694367409,
0.9522683620452881,
-0.5011904835700989,
-0.177017465233802... |
def print _ maze ( self, rack ) : for j in range ( 15 ) : print ( " \ n ", end ='' ) for i in range ( 15 ) : print ( rack [ j ] [ i ], end ='' ) | [
0.24839791655540466,
0.8842732310295105,
0.40697115659713745,
-0.4569147229194641,
0.41835328936576843,
0.5548044443130493,
1.3721592426300049,
-0.5871082544326782,
-0.990512490272522,
0.3010723292827606,
0.5907271504402161,
0.23352180421352386,
-0.8851874470710754,
0.5363527536392212,
0... |
def _ _ init _ _ ( self, * * kwargs ) : self. base _ directory = kwargs. get ('base _ directory ', os. path. join ( os. path. dirname ( _ _ file _ _ ), " charm _ airfoils " ) ) " " " directory of airfoil database, if this is not specified the " charm _ airfoils " directory of this package will be used " " " self. filen... | [
0.425606369972229,
-0.5532318949699402,
0.6564084887504578,
-0.19139596819877625,
-0.3295307457447052,
0.6984860897064209,
0.6690346598625183,
-0.155002623796463,
-0.3491092920303345,
-0.875885009765625,
-0.013034944422543049,
1.1755565404891968,
0.24863317608833313,
0.3442397117614746,
... |
def valid _ until ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " valid _ until " ) | [
1.2494851350784302,
0.0945798009634018,
0.3683253228664398,
0.17920607328414917,
-0.10719998180866241,
1.921116590499878,
-0.4318849742412567,
-0.15640948712825775,
0.69804847240448,
-0.527766227722168,
0.18249072134494781,
0.7549632787704468,
-0.19865542650222778,
-1.5225759744644165,
0... |
def run _ once ( self ) : definition = self. from _ location ( " { } { } / ". format ( self. _ path, self. id ) ) payload = { " jobdefinitionid " : definition. id } response = self. _ client. post ( " { } fromjobdefinition / ". format ( batchpredictionjob. _ jobs _ path ( ) ), data = payload ). json ( ) job _ id = resp... | [
0.12506619095802307,
0.3410731554031372,
0.5496607422828674,
0.43325531482696533,
0.32537204027175903,
-0.10608507692813873,
-0.2114747315645218,
0.09147562831640244,
-0.6241042613983154,
-0.6945793032646179,
-0.20176224410533905,
1.0335769653320312,
-0.9065607786178589,
0.5809102654457092... |
def test _ parameters _ converge ( batch _ size : int, normalization _ layer : type [ networks. basenorm ], ) - > none : mean = th. tensor ( [ 3, 0 ] ) var = th. tensor ( [ 6, 1 ] ) sd = th. sqrt ( var ) num _ dims = len ( mean ) running _ norm = normalization _ layer ( num _ dims ) running _ norm. train ( ) num _ samp... | [
-0.05476691946387291,
0.20603689551353455,
0.7021594643592834,
0.47116196155548096,
0.478655070066452,
0.7127208709716797,
0.6142660975456238,
-0.11233420670032501,
-0.8227241635322571,
-0.23942644894123077,
-0.0289023295044899,
0.31683146953582764,
-0.4352203905582428,
0.7271300554275513,... |
def config _ digest ( request ) - > formattedsha256 : return formattedsha256. parse ( get _ test _ data ( request, _ _ name _ _, " config. json. digest ", " r " ) ) | [
-0.7814351320266724,
-0.6980711817741394,
0.4545682966709137,
-0.22034314274787903,
0.29596251249313354,
-0.6373443603515625,
-0.036785025149583817,
-0.19174207746982574,
0.36126279830932617,
0.6049100756645203,
0.5649142265319824,
0.01128525659441948,
0.5179578065872192,
0.129631429910659... |
def importbooleanquery ( self, pathtofile ) : self. booleanqueriesdictionary = self. parsequeriesfile ( pathtofile ) | [
0.2045133113861084,
-0.4074277877807617,
0.1983059197664261,
-0.5658649206161499,
-0.367727667093277,
1.5610506534576416,
-0.21762323379516602,
0.35319384932518005,
-0.7652685046195984,
0.5017943382263184,
-0.6275990605354309,
-0.5746495127677917,
-0.21889705955982208,
-0.4867978096008301,... |
def generate _ pointcloud ( rgb _ file, depth _ file, normal _ file, ply _ file ) : rgb = cv. imread ( rgb _ file, - 1 ) rgb = cv. cvtcolor ( rgb, cv. color _ bgr2rgb ) depth = cv. imread ( depth _ file, - 1 ) depth = cv. cvtcolor ( depth, cv. color _ bgr2rgb ) normal = cv. imread ( normal _ file, - 1 ) # normal = cv. ... | [
-0.2144615352153778,
-0.04701847583055496,
1.047005534172058,
0.6493121385574341,
0.15057866275310516,
0.486368328332901,
0.452181875705719,
-0.3893890678882599,
-0.41453492641448975,
0.38064342737197876,
-0.15973573923110962,
0.3140351176261902,
-0.3898557126522064,
0.416128933429718,
-... |
def max _ sub _ seq ( arr ) : if not arr : raise exception ( " empty " ) if len ( arr ) = = 1 : return max ( arr [ 0 ], 0 ) if len ( arr ) = = 2 : return max ( arr [ 0 ], arr [ 1 ], 0 ) # init dp = [ 0 ] * len ( arr ) dp [ 0 ] = max ( arr [ 0 ], 0 ) dp [ 1 ] = max ( arr [ 0 ], arr [ 1 ], 0 ) # loop for i in range ( 2, ... | [
-0.1396859586238861,
0.22849643230438232,
1.0765210390090942,
0.8616188168525696,
-1.076858401298523,
0.31950685381889343,
-0.17883087694644928,
0.19727855920791626,
0.8611792922019958,
0.7013599872589111,
-0.6739616990089417,
-0.4598773121833801,
-0.1048668846487999,
0.2273656576871872,
... |
def get _ main _ and _ total _ effect _ indices _ from _ pce ( coefficients, indices ) : num _ vars = indices. shape [ 0 ] num _ terms, num _ qoi = coefficients. shape assert num _ terms = = indices. shape [ 1 ] main _ effects = np. zeros ( ( num _ vars, num _ qoi ), np. double ) total _ effects = np. zeros ( ( num _ v... | [
-0.03492816165089607,
-1.1145963668823242,
0.7647951245307922,
-1.0133723020553589,
0.21382825076580048,
-0.33193516731262207,
0.7042175531387329,
0.09872733056545258,
0.48491171002388,
0.5147243142127991,
-0.015097199939191341,
-0.049344662576913834,
-0.6678244471549988,
-0.53751945495605... |
def setup ( self ) : super ( testriskggrcq, self ). setup ( ) self. api = api _ helper. externalapi ( ) | [
0.94013911485672,
0.12174663692712784,
0.3646790087223053,
-0.5182459950447083,
1.2599163055419922,
-0.37006044387817383,
0.21288704872131348,
-0.14899039268493652,
0.17354518175125122,
0.4350429177284241,
-0.5997446179389954,
0.2670459449291229,
-0.8862845301628113,
-0.16500377655029297,
... |
def _ generate _ logger _ name ( obj, parent _ name = none ) : parent _ logger _ name = parent _ name if parent _ name else obj. _ _ module _ _ return " % s. % s " % ( parent _ logger _ name, getattr ( obj, " _ _ qualname _ _ ", obj. _ _ name _ _ ) ) \ if isclass ( obj ) else parent _ logger _ name | [
-0.21524587273597717,
-0.7390653491020203,
1.0082485675811768,
0.06143826246261597,
-0.6625218391418457,
0.46132466197013855,
-0.13864226639270782,
-0.4431922137737274,
0.3417663872241974,
0.43576428294181824,
0.1760241836309433,
0.16651614010334015,
0.2914334535598755,
1.2580831050872803,... |
def sku ( self ) - > optional ['outputs. skuresponse'] : return pulumi. get ( self, " sku " ) | [
0.7520978450775146,
-0.08817984163761139,
0.4062057435512543,
1.1013861894607544,
1.0158621072769165,
-0.3039033114910126,
0.7879024744033813,
0.20556144416332245,
1.3891687393188477,
-0.5708606839179993,
0.24676144123077393,
0.6825751066207886,
0.007426598574966192,
-1.0998393297195435,
... |
def test _ write _ hdf5 _ for _ directed _ scans ( self ) : with pd. hdfstore ( os. path. join ( self. job _ 1. local _ path,'data. hdf5') ) as store : data = store ['df']. to _ dict ( ) self. assertequal ( [ key for key in data. keys ( ) ], ['spc1 ','spc2 ','spc3'] ) | [
0.1148759201169014,
-0.27087143063545227,
0.2067016363143921,
0.12448180466890335,
0.7285677194595337,
0.8580566048622131,
0.7862145900726318,
0.0025538282934576273,
-0.4020349383354187,
-1.268865942955017,
-0.4187626838684082,
-0.7897300124168396,
-0.24207405745983124,
-0.322391539812088,... |
def getlowgraylevelemphasisfeaturevalue ( self ) : pg = self. coefficients ['pg'] ivector = self. coefficients ['ivector'] nz = self. coefficients ['nz'] lgle = numpy. sum ( pg / ( ivector [ none, : ] * * 2 ), 1 ) / nz return lgle | [
0.4428638815879822,
-0.06181193143129349,
0.3724028766155243,
-0.5789015889167786,
0.43764394521713257,
0.5657792091369629,
0.4299441874027252,
-0.14953462779521942,
0.4546958804130554,
0.1807405948638916,
-0.08111345022916794,
0.8211417198181152,
-1.3937857151031494,
0.39946073293685913,
... |
def _ _ enter _ _ ( self ) : self. _ file _ object = open ( self. _ path,'w ', encoding ='utf - 8') text ='\ n '. join ( ['# # # # # # # # # # # # # # # # # # # ','event log providers ','# # # # # # # # # # # # # # # # # # # ','', '.. toctree : : ',': maxdepth : 1 ','','' ] ) self. _ file _ object. write ( text ) retur... | [
0.3428948223590851,
-0.3077794909477234,
0.776314377784729,
-0.572263777256012,
0.6262881755828857,
0.1833454668521881,
0.9690804481506348,
-0.0926724299788475,
-0.6077248454093933,
-0.08567336946725845,
0.07396151125431061,
0.8179915547370911,
-0.15238332748413086,
-0.2839640974998474,
... |
def freeze ( self ) : if self. workflow _ processor _ task is none : raise workflowexception ( " can't execute workflow, processing task is not set. " " please register the task using " " ` register _ workflow _ processor ` method. " ) self. evaluate _ processing _ limit ( ) signature = self. workflow _ processor _ tas... | [
-0.6238863468170166,
0.019719960168004036,
0.6518161296844482,
-0.1092541441321373,
-0.1328413337469101,
0.00358833116479218,
0.7574838399887085,
0.7144185900688171,
-0.07684967666864395,
0.49075883626937866,
-1.0330373048782349,
0.23201335966587067,
-0.7080112099647522,
-0.115032345056533... |
def test _ md006 _ good _ not _ ordered ( ) : # arrange scanner = markdownscanner ( ) supplied _ arguments = [ " - - enable - rules ", " md006 ", " scan ", " test / resources / rules / md006 / good _ not _ ordered. md ", ] expected _ return _ code = 0 expected _ output = " " expected _ error = " " # act execute _ resul... | [
0.24337968230247498,
-0.019597096368670464,
0.5731196403503418,
0.7464608550071716,
0.4136909544467926,
0.573578953742981,
0.08643525838851929,
0.03158489987254143,
-0.7578760385513306,
0.07738570868968964,
0.1510574072599411,
0.05539614334702492,
-0.27384495735168457,
0.47410848736763,
... |
def genfilterbank ( ntheta = 8, kernel _ size = 15, phase = ( " on ", " off " ) ) : def norm ( x ) : " " " normalize input to [ - 1, 1 ]. " " " x = ( x - x. min ( ) ) / ( x. max ( ) - x. min ( ) ) return 2 * x - 1 def gengabor ( sz, omega, theta, func = np. cos, k = np. pi ) : " " " generate a single gabor filter. " " ... | [
0.2281724512577057,
0.6364507675170898,
1.0850837230682373,
0.36944442987442017,
-0.3816587030887604,
0.3364408314228058,
0.6611043214797974,
0.004448804538697004,
-0.28947484493255615,
1.08497154712677,
-0.9247856140136719,
0.058097586035728455,
-0.8558268547058105,
0.9939521551132202,
... |
def plot _ sorted _ accuracies ( results ) : freq = [ 2, 5, 10 ] temp _ list = [ ] for n _ folds in freq : for i in range ( len ( results ) ) : if ( results [ i ]. get ('min _ freq') = = n _ folds ) : temp _ list. append ( results [ i ]. get ('accuracy') ) temp _ list. sort ( ) plt. figure ( ) plt. plot ( temp _ list )... | [
0.4385242760181427,
0.15099483728408813,
0.43571820855140686,
-0.05705159157514572,
-0.24644210934638977,
0.14086061716079712,
1.5629602670669556,
-0.15568453073501587,
-0.006658739410340786,
-0.3888552188873291,
0.37827232480049133,
0.8558009266853333,
0.28914058208465576,
1.0674883127212... |
def get _ symbol _ height ( self ) : symbol _ height = 1 if self. alpha _ has _ supers ( ) : symbol _ height + = 1 if self. alpha _ has _ subs ( ) : symbol _ height + = 1 return symbol _ height | [
-0.5724632740020752,
0.8790072798728943,
0.5643015503883362,
0.40830299258232117,
-0.23618753254413605,
0.34934961795806885,
1.3045742511749268,
0.17408783733844757,
-0.42456185817718506,
-0.21219345927238464,
-1.052628755569458,
0.5323461890220642,
0.18618139624595642,
0.9884284138679504,... |
def objective _ dt ( trial, est, x _ train, y _ train, randseed, hype _ cv, param _ grid, scoring _ metric ) : params = {'criterion': trial. suggest _ categorical ('criterion ', param _ grid ['criterion'] ),'splitter': trial. suggest _ categorical ('splitter ', param _ grid ['splitter'] ),'max _ depth': trial. suggest ... | [
0.4392695426940918,
0.5284406542778015,
1.0078015327453613,
0.39334097504615784,
-0.24289533495903015,
-0.1591799408197403,
-0.3395984172821045,
0.1552683711051941,
-1.2934014797210693,
1.3863626718521118,
0.6873217821121216,
1.0110468864440918,
0.9090203046798706,
-0.5694040060043335,
-... |
def edit _ article _ button ( self ) : btn = qpushbutton ( ) btn. seticon ( qicon ( os. path. normpath ( _ _ file _ _ +'/.. /.. / img / pencil - 52. png') ) ) press _ button ( self. app, btn ) btn. settooltip ('open article edit window') btn. settooltipduration ( 1000 ) btn. pressed. connect ( self. on _ edit _ article... | [
-0.13882817327976227,
0.08824256807565689,
0.4045572578907013,
-0.5502526164054871,
-0.2482595145702362,
0.22974437475204468,
0.8552463054656982,
0.22154846787452698,
0.12397227436304092,
0.8029413223266602,
-0.4397066831588745,
0.43273022770881653,
-0.058112263679504395,
-0.31264421343803... |
def process ( self ) : log. debug ( " handling new socket % s ", self. _ websocket ) done, pending = yield from asyncio. wait ( [ self. _ read ( ), self. _ write ( ), self. _ watch _ notifications ( ), ], return _ when = asyncio. first _ completed ) log. debug ( " socket handler for % s finished ", self. _ websocket ) ... | [
0.43864935636520386,
0.4392816424369812,
0.6691061854362488,
-0.2862650752067566,
0.21571916341781616,
-0.4788067936897278,
0.9100827574729919,
-0.5431626439094543,
-0.3388201892375946,
-0.5532858967781067,
-0.176906019449234,
-0.06453942507505417,
0.24656379222869873,
0.211899995803833,
... |
def _ replacenodecontent ( self, node, value ) : if isinstance ( value, meld ) : node. children = [ value. _ tree. getelementnode ( ). clone ( ) ] else : if not isinstance ( value, str ) : value = str ( value ) node. children = self. _ nodelistfromsource ( value ) | [
-0.6329402923583984,
0.6054644584655762,
0.2890675961971283,
-0.7250865697860718,
-1.408964991569519,
0.012372261844575405,
-0.34919968247413635,
0.498447060585022,
0.3042885661125183,
0.09483255445957184,
-0.6361915469169617,
0.677853524684906,
-0.2843301594257355,
0.12971730530261993,
... |
def add _ variables ( value, value2 ) : return value + value2 | [
-0.07509273290634155,
-0.7845235466957092,
0.37391912937164307,
-0.012626901268959045,
-0.7116678357124329,
0.3193899989128113,
-0.9940106868743896,
-1.168576955795288,
-1.0754599571228027,
-0.24333864450454712,
0.19661210477352142,
1.0727617740631104,
0.046293120831251144,
-0.211772605776... |
def get _ arguments ( ) : parser = argumentparser ( description = " nilm - project " ) parser. add _ argument ( " - - settings " ) parser. add _ argument ( " - - appliance " ) parser. add _ argument ( " - - path " ) parser. add _ argument ( " - - train ", action = " store _ true " ) parser. add _ argument ( " - - tune ... | [
0.15914173424243927,
0.32590728998184204,
0.623795211315155,
-0.08887246996164322,
0.2124483287334442,
-0.16794808208942413,
-0.30354416370391846,
0.3133624196052551,
-0.6556117534637451,
0.7024487257003784,
-0.08411232382059097,
0.25121891498565674,
-0.9643334746360779,
0.4850190281867981... |
def scipy _ rankdata ( a, method = " average " ) : if method not in ( " average ", " min ", " max ", " dense ", " ordinal " ) : raise valueerror ('unknown method " { 0 } " '. format ( method ) ) a = np. ravel ( np. asarray ( a ) ) algo = " mergesort " if method = = " ordinal " else " quicksort " sorter = np. argsort ( ... | [
-0.1173471212387085,
0.5197756886482239,
0.6674898862838745,
0.11046574264764786,
0.13153508305549622,
-0.31254103779792786,
0.67283695936203,
0.32945021986961365,
0.5427539348602295,
0.44749531149864197,
1.1533288955688477,
0.8604742884635925,
0.27138185501098633,
0.24710047245025635,
-... |
def _ _ getitem _ _ ( self, item ) : return self. _ document. _ _ getitem _ _ ( item ) | [
-0.774695098400116,
-0.7622830867767334,
0.3757449686527252,
-0.3273390531539917,
-0.3908437490463257,
0.0193465668708086,
0.2737269997596741,
-1.092107892036438,
0.6077434420585632,
-0.39649203419685364,
0.12050342559814453,
0.05097106471657753,
0.1401645690202713,
-1.3002957105636597,
... |
def load _ mnist ( batch _ size, data _ path, shuffle = true, n _ use _ label = none, n _ use _ sample = none, rescale _ size = none ) : # data _ path ='/ home / qge2 / workspace / data / mnist _ data /'def preprocess _ im ( im ) : " " " normalize input image to [ - 1., 1. ] " " " if rescale _ size is not none : im = n... | [
-0.18810075521469116,
-0.39079082012176514,
0.8360599875450134,
-0.012313827872276306,
-0.7890271544456482,
0.0007320926524698734,
-0.47762438654899597,
0.3978388011455536,
0.9928171634674072,
0.10202048718929291,
0.0187846552580595,
0.3755798935890198,
-0.5380762815475464,
-0.013126596808... |
def _ _ init _ _ ( self, label = none, required = true, description = none, default = none, choices = none, allow _ custom _ choice = none, hidden = false, * args, * * kwargs, ) : self. name = none self. process = none self. label = label self. required = required self. description = description self. default = default... | [
0.5263875126838684,
-0.06343942135572433,
0.5148332715034485,
-0.11712782084941864,
-0.08119169622659683,
0.5558947920799255,
-0.7324193120002747,
-0.09262629598379135,
0.4915931522846222,
0.5438930988311768,
-0.46671003103256226,
1.3095312118530273,
-0.17062675952911377,
0.156143680214881... |
def get _ movie _ json ( movie _ id ) : conn = http. client. httpsconnection ( " api. themoviedb. org " ) api _ key ='9df6fc65ca74919ab7942a5792785196'payload = " { } " conn. request ( " get ",'/ 3 / movie /'+ str ( movie _ id ) + '? language = en - us & api _ key ='+ api _ key, payload ) res = conn. getresponse ( ) da... | [
-1.558903455734253,
-0.9172571301460266,
0.8794544339179993,
0.25038328766822815,
-0.33949604630470276,
-0.025718532502651215,
-1.401369571685791,
0.1084134504199028,
-0.4853145480155945,
1.1259284019470215,
-0.9121209979057312,
1.3585097789764404,
-0.6089107394218445,
0.7863211631774902,
... |
def noise _ standard _ deviation ( self ) : if self. _ noise _ standard _ deviation is none : raise assertionerror ( " noise standard deviation is not calculated yet. " ) return self. _ noise _ standard _ deviation | [
0.6809058785438538,
0.1848071962594986,
0.44454509019851685,
0.3805442154407501,
0.15177486836910248,
1.0804404020309448,
0.49692490696907043,
-0.7662155628204346,
0.5243319869041443,
-0.9152315855026245,
-0.732778012752533,
0.8630051016807556,
-0.4487552344799042,
0.49709734320640564,
-... |
def perform _ operation ( calc, operation, params ) : if check _ integrity ( calc ) : # check to see if operation parameter exists within calculator object if operation not in calc ['operations'] : raise invalidoperation ( ) else : if all ( [ isinstance ( parameter, ( int, float ) ) for parameter in params ] ) : result... | [
-0.5260195732116699,
0.6789158582687378,
0.8271915316581726,
0.9000921845436096,
0.21972544491291046,
-0.010074290446937084,
0.646036684513092,
-0.27737677097320557,
-0.14242474734783173,
0.4313201308250427,
0.6230878829956055,
-0.2796325087547302,
-0.2107725292444229,
0.1031138002872467,
... |
def solveequations ( verifyrules, equationdict, methoddict ) : eqs =''. join ( equationdict. values ( ) ) variables = re. findall ( findvariables, eqs ) print verifyrules var ( variables ) for table, method in sorted ( methoddict. items ( ) ) : baseequations = [ ] ds, dt = [ x [ 2 : ] for x in table. split ('_') ] for ... | [
-0.10377664119005203,
-0.2875266671180725,
0.9927478432655334,
0.10828050971031189,
0.14524106681346893,
-0.2151411771774292,
0.7591283321380615,
0.04871207848191261,
-0.0962863340973854,
0.7460891008377075,
-0.5707795023918152,
-0.7260345816612244,
0.10804395377635956,
0.8788675665855408,... |
def _ _ init _ _ ( self, partials ) : assert all ( isinstance ( partial, partial ) for partial in partials ) self. partials = list ( partials ) self. partials. sort ( key = lambda p : p. t0 ) self. reset ( ) | [
-0.4771561324596405,
-0.46034544706344604,
0.2912360727787018,
0.09762319177389145,
-0.3788190484046936,
0.4970583915710449,
0.1410725861787796,
-0.5219734907150269,
-0.3205734193325043,
-0.0879184901714325,
-0.4648730456829071,
-0.3674834072589874,
-1.0972819328308105,
0.07955770939588547... |
def process _ hits ( self ) : df = self. df [ self. df. date = = self. df. date. max ( ) ] hits = df ['hits']. sum ( ) num _ 403s = df ['hits _ 403s']. sum ( ) print ('hits ', hits ) print ('403s ', num _ 403s ) df = df [ ['referer ','hits ','hits _ 403s'] ]. copy ( ) df ['hits %'] = df ['hits'] / hits * 100 idx = df [... | [
-0.2685474455356598,
0.8077285289764404,
0.705215334892273,
-0.25876444578170776,
0.5042526721954346,
-0.1106334999203682,
0.8986731767654419,
-0.507108211517334,
-0.05867057293653488,
0.773737370967865,
0.9476418495178223,
0.49746575951576233,
0.458942174911499,
-0.2916499078273773,
1.0... |
def game _ loop ( screen, buttons ) : while true : mouse _ up = false for event in pygame. event. get ( ) : if event. type = = pygame. quit : pygame. quit ( ) if event. type = = pygame. mousebuttonup and event. button = = 1 : mouse _ up = true screen. fill ( const. background _ color ) for button in buttons : ui _ acti... | [
-0.5164496302604675,
-0.5859466791152954,
0.9430685043334961,
0.6414521336555481,
-0.1167166605591774,
0.6568664312362671,
-0.3336416780948639,
-1.042924165725708,
0.3287253677845001,
0.5034261345863342,
0.13704922795295715,
0.03705759346485138,
-0.29501113295555115,
0.004097846336662769,
... |
def test _ publish _ path ( self ) : log. info ( " = = = = = = = = = = = start qual test publish path = = = = = = = = = = = = = = = = = " ) # generated telemetered file has 1 sio block with 10 instrument # records and 1 metadata record. log. info ( " file tel _ vel3d _ l _ 1. dat qual test publish path " ) self. create... | [
1.2688970565795898,
-0.23355458676815033,
0.5823830962181091,
-0.028421128168702126,
0.6667618751525879,
0.4502762258052826,
0.2666805386543274,
0.5077459216117859,
-0.347942978143692,
0.11611193418502808,
0.035536907613277435,
0.29748299717903137,
-0.3555121421813965,
-0.2717438340187073,... |
def time _ to _ id ( time ) : return ( ( time. timestamp ( ) * 1000. ). _ _ int _ _ ( ) - discord _ epoch ) < < 22 | [
0.10282472521066666,
-0.43352535367012024,
0.6312375664710999,
-0.3861373960971832,
0.1805291324853897,
0.19339866936206818,
-0.6799630522727966,
-0.296684205532074,
0.3320577144622803,
0.7752415537834167,
-1.024393081665039,
0.5789692401885986,
-0.28959137201309204,
0.3343411386013031,
... |
def bootstrapinfections ( self, frame = none ) : if type ( frame ) = = type ( none ) : frame = self. original _ infections. copy ( ) c = frame. cohortid. unique ( ). copy ( ) rc = np. random. choice ( c, c. size ) self. infections = frame. copy ( ) # calculate index size for each cohortid in random choice cid _ size = ... | [
-0.6761773228645325,
-0.5103722214698792,
0.7819697856903076,
-0.028284581378102303,
0.2861229181289673,
-0.11889809370040894,
0.8097018599510193,
0.2875363528728485,
0.5947285890579224,
0.1093708872795105,
-0.2074064165353775,
0.8045014142990112,
-0.23139409720897675,
-0.09044904261827469... |
def _ clean _ paths ( self, paths ) : _ sent = set ( ) for path in paths : clean = tuple ( ( b, e ) for b, e in path if self. substr ( b, e ) in self. content _ admitter ) if clean not in _ sent : yield clean _ sent. add ( clean ) | [
-0.35829147696495056,
0.10400521010160446,
0.36883553862571716,
0.3168432116508484,
-0.6289238333702087,
0.2729381024837494,
0.2694326341152191,
-0.24497129023075104,
-0.9441602230072021,
1.1881059408187866,
0.20845957100391388,
-0.2439516931772232,
-0.8377098441123962,
0.7663700580596924,... |
def configure _ sensor _ params ( hostname : str ) - > none : # create empty config config = client. sensorconfig ( ) # set the values that you need : see sensor documentation for param meanings config. operating _ mode = client. operatingmode. operating _ normal config. lidar _ mode = client. lidarmode. mode _ 1024x10... | [
-0.22816604375839233,
0.11381956934928894,
0.5908729434013367,
-0.03492893651127815,
0.3221392035484314,
0.20369987189769745,
-0.2424405962228775,
0.43307948112487793,
-0.3932062089443207,
0.34088221192359924,
-0.9542715549468994,
0.5471714735031128,
-0.42980384826660156,
1.050055861473083... |
def group _ combine _ parts ( xs ) : file _ key = _ get _ combine _ key ( xs [ 0 ] ) group _ by _ out = collections. defaultdict ( list ) for x in xs : group _ by _ out [ x [ " combine " ] [ file _ key ] [ " out " ] ]. append ( x ) out = [ ] for combined _ xs in group _ by _ out. values ( ) : base = combined _ xs [ 0 ]... | [
-0.6998158693313599,
-0.21392086148262024,
0.5783218741416931,
-0.24057838320732117,
0.0938502624630928,
-0.33292466402053833,
-0.005823829211294651,
0.3629188537597656,
-0.2606290876865387,
0.7431693077087402,
-0.28557294607162476,
-0.1434001624584198,
-0.040701013058423996,
0.22605957090... |
def main ( ) : if len ( sys. argv ) = = 3 : database _ filepath, model _ filepath = sys. argv [ 1 : ] print ('loading data... \ n database : { } '. format ( database _ filepath ) ) x, y, category _ names = load _ data ( database _ filepath ) x _ train, x _ test, y _ train, y _ test = train _ test _ split ( x, y, test _... | [
0.16905678808689117,
0.16247667372226715,
0.7343870401382446,
0.2640805244445801,
1.809114933013916,
0.6977630257606506,
0.576421320438385,
1.2054991722106934,
-0.9145694375038147,
-0.010727916844189167,
-0.8891783356666565,
-0.03606303408741951,
-0.2721925973892212,
-0.04508572071790695,
... |
def launch ( self ) : out _ log, err _ log = fu. get _ logs ( path = self. path, mutation = self. mutation, step = self. step ) pdb _ list = [ ] for mol _ index, mol in enumerate ( pybel. readfile ( " sdf ", self. input _ sdf _ path ) ) : if mol _ index > = self. max _ pdbs and self. max _ pdbs! = 0 : break fname = str... | [
-0.880510151386261,
-0.3798845112323761,
0.775423526763916,
1.3967678546905518,
0.2638559341430664,
0.5615249276161194,
0.0743696466088295,
0.42192429304122925,
0.22536249458789825,
-0.40679624676704407,
-0.2954340875148773,
-0.3604062795639038,
0.36560121178627014,
0.29791921377182007,
... |
def inorder _ print _ tree ( self ) : if self. root : self. _ inorder _ print _ tree ( self. root ) | [
0.6409377455711365,
-0.4911879897117615,
0.733920693397522,
0.4248940348625183,
-0.4708022177219391,
-0.6330061554908752,
-0.3391985595226288,
-0.29835426807403564,
-0.1319303661584854,
-0.4693693518638611,
0.47111791372299194,
1.7633638381958008,
-1.1316391229629517,
1.7578887939453125,
... |
def get _ lights ( self ) - > dict [ str, any ] : try : return requests. get ( " { } / api / { } / lights ". format ( self. lightsuri, self. username ) ). json ( ) except exception : return none | [
-0.9444228410720825,
-0.05348013713955879,
0.3558483123779297,
0.5679681301116943,
-0.3142421841621399,
-1.0586165189743042,
-1.3339368104934692,
-0.8211342096328735,
0.17478401958942413,
-0.3610646426677704,
-0.9399834275245667,
0.5556809306144714,
-0.7108303904533386,
0.45391082763671875... |
def order _ children ( children ) : return children | [
-0.474354088306427,
-1.0262902975082397,
0.4719568192958832,
0.7668759822845459,
0.14516226947307587,
-0.21960100531578064,
0.018008846789598465,
-0.8806432485580444,
-0.09461445361375809,
0.12658286094665527,
-0.6995459794998169,
-1.1531550884246826,
0.2728714346885681,
0.2592025697231293... |
def pool _ forward ( a _ prev, hparameters, mode = " max " ) : # size and dimension ( m, n _ h _ prev, n _ w _ prev, n _ c _ prev ) = a _ prev. shape f = hparameters [ " f " ] stride = hparameters [ " stride " ] n _ h = int ( ( n _ h _ prev - f ) / stride ) + 1 n _ w = int ( ( n _ c _ prev - f ) / stride ) + 1 n _ c = ... | [
0.034451086074113846,
0.6413363814353943,
0.8684075474739075,
-0.2792031168937683,
0.0708804726600647,
-0.29640161991119385,
1.5715619325637817,
0.24862326681613922,
-0.8944948315620422,
1.1719233989715576,
0.3427557945251465,
0.38832831382751465,
0.07176738977432251,
0.19716499745845795,
... |
def _ deleteblobs ( blobs ) : for blob in blobs : # pylint : disable - msg = w0702 # catching all exceptions here because on the dev server, the upload # blobs are sometimes locked, and may throw exceptions of uncertain type # ( e. g. on windows it's a windowserror, on other systems it is likely to # be something else ... | [
0.34988898038864136,
-0.1847972571849823,
0.5435709953308105,
0.9108635783195496,
0.11924843490123749,
0.5446628928184509,
0.6727612018585205,
-1.3707692623138428,
-0.05262065678834915,
1.0214909315109253,
-0.20698213577270508,
-0.45240241289138794,
-1.1984153985977173,
1.1581008434295654,... |
def _ attributes _ i _ set ( self, key, val = none, force = false, flow = _ down ) : # make sure interface is ready to use d = self. _ attributes _ t _ init ( ) # if the key is not known if not key in d ['attributes'] : if key [ 0 ] = ='_'and d ['private'] : # if the set is private, we can register the new key. it # wo... | [
-1.2446285486221313,
0.1924465447664261,
0.6676962375640869,
-0.1572319120168686,
-0.4451167583465576,
-0.7744852304458618,
0.22204121947288513,
0.01573929935693741,
0.006761295720934868,
1.1955103874206543,
0.29819053411483765,
0.581188976764679,
0.11642760783433914,
0.8364681601524353,
... |
def _ _ init _ _ ( self, nscr = 0 ) : super ( self. _ _ class _ _, self ). _ _ init _ _ ( ) self. _ id = nscr self. _ type = nv _ ctrl _ target _ type _ x _ screen self. _ name ='x screen ' | [
-0.5485110282897949,
0.40545859932899475,
0.557255208492279,
1.063894271850586,
0.3886567950248718,
-0.1787855327129364,
-0.6093151569366455,
-1.0507571697235107,
0.8684788942337036,
0.28658607602119446,
-0.8866334557533264,
-0.47348931431770325,
0.017972838133573532,
1.399056077003479,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.