text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def resnet152 ( pretrained = false ) : model = resnet ( bottleneck, [ 3, 8, 36, 3 ] ) if pretrained : model. load _ state _ dict ( model _ zoo. load _ url ( model _ urls ['resnet152'] ) ) return model | [
0.3054409623146057,
0.2569565773010254,
0.12834075093269348,
0.36006972193717957,
-0.4840952157974243,
-0.19345541298389435,
0.025007715448737144,
0.05163492634892464,
0.26033830642700195,
-0.9029224514961243,
-0.6986458897590637,
-0.45253387093544006,
0.047420017421245575,
-0.723388135433... |
async def test _ text _ set _ value ( hass ) : text = mocktextentity ( native _ min = 1, native _ max = 5, pattern = r " [ a - z ] " ) text. hass = hass with pytest. raises ( valueerror ) : await _ async _ set _ value ( text, servicecall ( domain, service _ set _ value, { attr _ value : " " } ) ) with pytest. raises ( ... | [
-0.27661070227622986,
0.8177462816238403,
0.43102896213531494,
-0.5185351967811584,
-0.06894545257091522,
-0.26630523800849915,
-0.45366671681404114,
-0.2034902125597,
-0.03932412713766098,
0.24703966081142426,
-0.20854854583740234,
0.5566532611846924,
0.5953590273857117,
0.453779160976409... |
def cross _ product ( self, other ) : return self. _ return _ cross _ product ( self, other ) | [
-0.12522436678409576,
0.5749570727348328,
0.6383812427520752,
0.9763954281806946,
-0.3750170171260834,
-0.2382783442735672,
0.157815083861351,
-1.5834494829177856,
0.7392680048942566,
0.5057510137557983,
-0.07049605250358582,
-0.5341496467590332,
-0.7504720687866211,
-0.29695701599121094,
... |
def rerank _ nbests ( nbests, func ) : for nbest in nbests : rerank _ nbest ( nbest, func ) | [
-0.6895542144775391,
0.3938198685646057,
0.30773988366127014,
1.3110991716384888,
0.3356676697731018,
-0.15902626514434814,
-0.01173075009137392,
0.08758050948381424,
-0.24250686168670654,
0.26205384731292725,
-0.8887063264846802,
1.732397198677063,
1.0242574214935303,
0.4629749357700348,
... |
def build _ write4 _ gadget ( addr, data ) : if len ( data ) > 4 : raise valueerror ('data length greater than 4 bytes') buf = struct. pack ('< i ', write _ gadget ) buf + = b'b'* 4 buf + = data buf + = struct. pack ('< i ', addr ) return buf | [
-0.4137912392616272,
0.19279935956001282,
0.3098061680793762,
-0.1937016248703003,
-0.3118683695793152,
-0.02399567700922489,
-0.19957707822322845,
-0.6962431073188782,
0.6568898558616638,
-0.3507264256477356,
-0.28146740794181824,
0.14727434515953064,
-0.9405351877212524,
-0.6996099948883... |
def start ( self ) : if self. running : raise runtimeerror ( " engine already running " ) self. running = true yield defer. deferred ( ) | [
0.4878231883049011,
-0.21691489219665527,
0.5990476608276367,
0.5036658644676208,
0.5595510005950928,
0.017502250149846077,
-0.6158009171485901,
0.6244564056396484,
-0.47166886925697327,
-1.074162244796753,
-0.20824790000915527,
0.16803492605686188,
0.07139212638139725,
1.1020115613937378,... |
def match _ bachelors ( self, bachelors : dict [ id, person ], bachelorettes : dict [ id, person ], marital _ tradition : callable ) - >'generation': bachelor _ stats = _ dict _ to _ statslist ( bachelors ) bachelorette _ stats = _ dict _ to _ statslist ( bachelorettes ) groom _ order, bride _ order = marital _ traditi... | [
-1.0266847610473633,
0.02065357379615307,
0.6802313923835754,
0.425841361284256,
-0.8720373511314392,
0.5025744438171387,
-0.1809883713722229,
0.4733533561229706,
-0.8125008940696716,
-0.10739602148532867,
-0.7271377444267273,
-0.20986586809158325,
0.17950724065303802,
0.08440129458904266,... |
def test _ insert _ record ( self, device _ id, timestamp, measurements, data _ types, values ) : data _ types = [ data _ type. value for data _ type in data _ types ] request = self. gen _ insert _ record _ req ( device _ id, timestamp, measurements, data _ types, values ) status = self. _ _ client. testinsertrecord (... | [
-0.744691789150238,
1.7396994829177856,
0.5279141068458557,
-0.2060520499944687,
1.486730933189392,
0.875886857509613,
0.5797001719474792,
-0.14680486917495728,
-0.19165267050266266,
-0.3563555181026459,
-0.5938924551010132,
-0.07411057502031326,
-1.4432131052017212,
0.4086449444293976,
... |
def _ get _ file _ md5 ( self, input _ file ) : hash _ md5 = hashlib. md5 ( ) with open ( input _ file, " rb " ) as f : for chunk in iter ( lambda : f. read ( 4096 ), b " " ) : hash _ md5. update ( chunk ) file _ hash = hash _ md5. hexdigest ( ) return file _ hash | [
0.5993754863739014,
-0.5305026769638062,
0.4495575726032257,
-0.3792901039123535,
0.23869645595550537,
0.722984254360199,
0.7202204465866089,
0.7722769975662231,
-1.8089163303375244,
0.0261556264013052,
-0.47637423872947693,
-0.6008867621421814,
-0.035930778831243515,
-0.21796658635139465,... |
def _ getphysicalname ( self ) : if hasattr ( self, " _ boundedentityport " ) : return self. _ boundedentityport. name else : return self. _ getfullname ( ). replace ( '. ', self. _ name _ separator ) | [
0.4520778954029083,
-1.153067708015442,
0.8489572405815125,
-0.2726166844367981,
-0.7700754404067993,
0.8508212566375732,
-0.7012689709663391,
-1.3279826641082764,
-0.5383592247962952,
0.2439391314983368,
1.0765637159347534,
-0.7976298332214355,
0.09881366789340973,
-0.03613978251814842,
... |
def find _ number ( self, key _ list ) : number _ list = [ ] for i in key _ list : number _ list. append ( i [ - 1 ] ) count = 0 for i in range ( len ( number _ list ) ) : if str ( i ) in number _ list : # print ('number is finded') count + = 1 else : # print ('number is not finded') return str ( i ) break if count = =... | [
-0.7884068489074707,
-0.5098834037780762,
1.021695613861084,
0.44769400358200073,
-0.025604642927646637,
0.19961132109165192,
0.007066179998219013,
0.050271205604076385,
-0.5629450082778931,
0.7143809199333191,
-0.39974671602249146,
-0.5670231580734253,
-1.2644449472427368,
0.8531944751739... |
def _ get _ oracle _ rdbms ( self, table _ list : list [ tuple [ str, str ] ] ) : schema _ tables = { } for table _ obj in table _ list : schema _ name = table _ obj [ 0 ] table _ name = table _ obj [ 1 ] if schema _ name not in schema _ tables : schema _ tables [ schema _ name ] = [ ] if table _ name : schema _ tables... | [
-0.31663963198661804,
1.0995657444000244,
0.6356924176216125,
0.28775572776794434,
-0.07239983975887299,
0.12933459877967834,
-0.44970229268074036,
0.22038660943508148,
0.8186277747154236,
0.5071565508842468,
-0.8151266574859619,
-0.16494150459766388,
-0.09174685180187225,
0.95694935321807... |
def register ( self, req ) : if req. method = = " post " : data = json. loads ( req. data ) email = data ['email'] pwd = data ['password'] if check _ email ( email ) = = none : response _ object = {'status':'fail ','message':'invalid email ', } return response _ object, 409 if check _ pwd ( pwd ) = = none : response _ ... | [
-1.147890329360962,
0.7197138071060181,
1.0944716930389404,
0.6313117146492004,
0.9493528604507446,
0.22860881686210632,
0.3759037256240845,
-0.30407091975212097,
0.1193901002407074,
0.47106191515922546,
-0.5145716071128845,
-0.6469177603721619,
-0.7091869115829468,
-0.06297034025192261,
... |
async def lower _ cover ( self, device _ id : str ) : await self. _ send _ zone _ create _ request ( device _ id, " lower " ) # if set _ value is called, we get an optimistic callback right # away with the value, if we use lower we have to set it # as one won't come unless stop is called or something goes wrong. self. ... | [
0.38199153542518616,
-0.03468351438641548,
0.4579572081565857,
0.5787543654441833,
0.5093408823013306,
0.4020169675350189,
0.8358873128890991,
-0.8322296738624573,
1.2011710405349731,
-0.3485470116138458,
0.20313863456249237,
0.2500247657299042,
-1.163123369216919,
0.8294429779052734,
-0... |
def get _ gabor _ filter _ kernel ( theta, frequency, sigma _ x, sigma _ y, size ) : y, x = np. mgrid [ - int ( size / 2 ) : int ( size / 2 ) + 1, - int ( size / 2 ) : int ( size / 2 ) + 1 ] rot _ x = x * np. cos ( theta ) + y * np. sin ( theta ) rot _ y = - x * np. sin ( theta ) + y * np. cos ( theta ) g = np. zeros (... | [
0.2143210619688034,
-0.26308679580688477,
0.6323004961013794,
-0.18974876403808594,
-0.7794204354286194,
-0.6894584894180298,
0.5209559798240662,
-0.55780029296875,
-0.4246608018875122,
1.0553017854690552,
0.2388775795698166,
0.9447327852249146,
-0.13179217278957367,
0.009395509026944637,
... |
def start ( self ) : self. logger. info ( " starting agent... " ) self. receiver. start ( ) self. nanny. start ( ) try : while not self. _ check _ stopped ( ) : time. sleep ( 10 ) except keyboardinterrupt : self. stop ( ) | [
0.3439491093158722,
-0.927191436290741,
0.30823376774787903,
-0.03517140820622444,
0.8782157897949219,
-0.13953156769275665,
-0.09803102165460587,
0.6201111674308777,
0.5220176577568054,
-0.023525705561041832,
-0.11001551151275635,
0.18665288388729095,
-0.08925247937440872,
0.3265739977359... |
def start _ serialize _ data ( self ) : self. log. debug ('start serialize _ data thread...') thd = threading. thread ( target = self. serialize _ data ) thd. setdaemon ( true ) thd. start ( ) | [
0.15914680063724518,
-0.1452164351940155,
0.31512340903282166,
-0.057121939957141876,
0.5907838344573975,
0.41360875964164734,
-0.13760867714881897,
1.013809323310852,
0.1560249626636505,
-1.3242709636688232,
-0.37301477789878845,
1.9311894178390503,
-0.5493690371513367,
-0.146699860692024... |
def test _ create _ salary ( self ) : salary = salary. objects. get ( capital _ user _ _ email ='teste @ teste. com ', salary _ date = date. today ( ) ) self. assertequal ( salary. salary _ value, decimal ('2000. 12') ) self. assertequal ( salary. salary _ discount, decimal ('120. 12') ) | [
0.705376386642456,
0.027800658717751503,
0.4256138503551483,
0.4370367228984833,
0.7821608781814575,
1.2200027704238892,
-0.5969129800796509,
-0.18965566158294678,
-0.5743376612663269,
-0.9643478393554688,
-0.12508195638656616,
-0.21820588409900665,
0.7142090797424316,
0.6752568483352661,
... |
def coards _ to _ netcdf ( ds, *, lat _ name = " lat ", lon _ name = " lon " ) : from numpy import arange, meshgrid lon = ds [ lon _ name ] lat = ds [ lat _ name ] assert lon. ndim = = lat. ndim = = 1 lons, lats = meshgrid ( lon, lat ) x = arange ( len ( lon ) ) y = arange ( len ( lat ) ) ds = ds. rename ( { lon _ name... | [
-0.393004447221756,
-0.2453647255897522,
0.5585429668426514,
-1.6772013902664185,
-0.10364148765802383,
-0.5632703900337219,
-0.7336186766624451,
0.5512478947639465,
0.32377249002456665,
0.21273387968540192,
-0.5166046023368835,
0.8765234351158142,
0.830203652381897,
-0.09645012021064758,
... |
def mat _ rotate ( vecx, vecy, angle ) : vecx _ rot = cos ( angle ) * vecx - sin ( angle ) * vecy vecy _ rot = sin ( angle ) * vecx + cos ( angle ) * vecy return vecx _ rot, vecy _ rot | [
0.2542189061641693,
0.06994926929473877,
0.3659385144710541,
-1.1901507377624512,
0.9917891621589661,
-0.44695234298706055,
-0.56324303150177,
-0.11712826788425446,
0.5194279551506042,
0.5139022469520569,
0.01814756914973259,
-0.0972989872097969,
0.09599687159061432,
-1.0502680540084839,
... |
def request ( self, path, method ='get ', query ='', dto = none, * * kwargs ) : # attempt to detect a misdirected post if dto is not none and method = ='get': method ='post'# assign and then remove non - requests kwargs fetch _ all = kwargs. get ('fetch _ all ', self. fetch _ all ) filter = kwargs. get ('filter ', none... | [
-1.0678155422210693,
0.39673325419425964,
1.0358176231384277,
-0.04799586534500122,
0.08910267055034637,
-0.7527301907539368,
-0.25844356417655945,
-0.4581489861011505,
0.07899852097034454,
-0.32530078291893005,
0.5437137484550476,
-0.12928465008735657,
-0.055454134941101074,
-0.0268570221... |
def login _ required ( f ) : @ wraps ( f ) def decorated _ function ( * args, * * kwargs ) : if session. get ( " user _ id " ) is none : return redirect ( " / login " ) return f ( * args, * * kwargs ) return decorated _ function | [
-0.8155182600021362,
-0.600165605545044,
0.805878221988678,
0.6877679228782654,
-0.015980321913957596,
0.36598947644233704,
-0.4105893075466156,
-0.34681570529937744,
1.2263299226760864,
-0.136030375957489,
0.7236289978027344,
0.718989908695221,
0.8725468516349792,
0.06341591477394104,
0... |
def visit ( self, node : ast. assignment ) : source = self. visit ( node. expr ) vinfo = self. visit ( node. identifier ) for lvar in self. globalvars [ self. local _ index : ] : if lvar. vinfo. name. endswith ( vinfo. name ) : self. register _ instruction ( cil. cilassign, lvar. vinfo, source ) return lvar else : # pr... | [
-0.9502467513084412,
-0.7461687326431274,
0.9253155589103699,
-0.4265884757041931,
-0.9842388033866882,
-0.19456876814365387,
0.6058811545372009,
0.5899330377578735,
0.36494651436805725,
0.31035858392715454,
-0.19823907315731049,
0.6745671033859253,
-0.02741372026503086,
0.6669111251831055... |
def _ _ init _ _ ( self, shape = ( 10, 10 ), num _ keys = 1, max _ fuel _ level = 20, max _ fuel _ dist = 10, loop _ factor = 0. 05, seed = none, randomize _ on _ reset = false, * args, * * kwargs ) : super ( fuelmazeenv, self ). _ _ init _ _ ( shape = shape, * args, * * kwargs ) num _ spaces = shape [ 0 ] * shape [ 1 ... | [
-0.2653273642063141,
0.02517898753285408,
0.7622969150543213,
-0.14612826704978943,
0.03728824481368065,
-0.6402324438095093,
0.47946327924728394,
0.4967813491821289,
-0.6412601470947266,
-0.013605495914816856,
0.2821422815322876,
-0.6508774757385254,
0.676042377948761,
0.5610135197639465,... |
def directory _ organizer ( root _ dir _ images, root _ dir _ masks, dir _ to _ save ) : img _ prefix = [ ] extension ='ome. tif'if os. path. exists ( root _ dir _ images ) : img _ prefix = [ os. path. splitext ( file ) for file in os. listdir ( root _ dir _ images ) ] img _ prefix. sort ( ) index = 0 # initialize ztag... | [
-0.9469388127326965,
-0.7047634124755859,
0.8396673202514648,
0.01998968981206417,
0.3449501097202301,
-0.1192675232887268,
1.5584518909454346,
0.14293038845062256,
0.03781156986951828,
0.5171665549278259,
-0.06660319119691849,
-0.056237343698740005,
0.4217785596847534,
0.09719867259263992... |
def test _ melts _ compute ( self ) : result = melts _ compute ( self. dict ) | [
-0.7613129615783691,
0.4595496654510498,
0.25633904337882996,
-0.3737632930278778,
0.20755545794963837,
-0.6929019093513489,
-0.33068668842315674,
0.5450332760810852,
0.6579899787902832,
-0.2767498195171356,
-1.078216791152954,
0.34636107087135315,
-0.6014463901519775,
0.3597794771194458,
... |
def generate _ p _ star ( num _ groups ) : p _ star = np. eye ( num _ groups, num _ groups ) np. random. shuffle ( p _ star ) return p _ star | [
-1.433233618736267,
0.32812225818634033,
0.32894715666770935,
-0.15339651703834534,
-0.37787163257598877,
0.8546017408370972,
-0.15757329761981964,
0.46523556113243103,
0.8888567686080933,
0.42665860056877136,
0.5363937616348267,
-0.10058307647705078,
-1.4251431226730347,
-0.21996909379959... |
def getmyconfig ( _ id ) : if _ id in cmyconfig. _ all _ config _ list : return cmyconfig. _ all _ config _ list [ _ id ]. _ config config = cmyconfig ( ) config. _ config = configparser. configparser ( ) cmyconfig. _ all _ config _ list [ _ id ] = config return cmyconfig. _ all _ config _ list [ _ id ]. _ config | [
-0.34642767906188965,
-0.8196772336959839,
0.6307069063186646,
0.041595201939344406,
-0.4839268624782562,
-1.511664628982544,
-0.6633336544036865,
0.3736253082752228,
0.41901645064353943,
-0.0967065617442131,
-1.491568684577942,
-0.07285704463720322,
-0.3452450633049011,
1.3888505697250366... |
def _ _ init _ _ ( self, sequence _ string, rollover = false ) : self. sequence _ string = sequence _ string self. sequence _ length = len ( sequence _ string [ 0 ] ) self. rollover = rollover self. last _ item = sequence _ string [ - 1 ] self. _ _ name _ _ = " % s ('% s') " % ( self. _ _ class _ _. _ _ name _ _, seque... | [
-0.3816229999065399,
-1.1078962087631226,
0.45179441571235657,
-0.2633443772792816,
-0.7762266993522644,
-0.2898617088794708,
0.19756421446800232,
0.7096141576766968,
0.569591760635376,
0.643323540687561,
-0.8864652514457703,
-0.10210227966308594,
-0.4207656681537628,
0.12009328603744507,
... |
def call ( self, x, training = false ) : x = lambda ( self. identity _ func, name = " input " ) ( x ) with tf. gradienttape ( persistent = true ) as hess _ tape : hess _ tape. watch ( x ) with tf. gradienttape ( ) as grad _ tape : grad _ tape. watch ( x ) y = self. input _ layer ( x ) # y = self. bn ( y, training = tru... | [
-0.6051627993583679,
0.5584939122200012,
0.9578419327735901,
-0.01165428664535284,
0.19925472140312195,
0.7121901512145996,
-0.020000571385025978,
-0.7636582851409912,
-0.5507526397705078,
-0.23339839279651642,
-0.5939063429832458,
-0.43431979417800903,
0.6957250237464905,
1.46850776672363... |
def delete _ instance ( self, metadata : dict ) - > none : name = metadata. get ( " name " ) resource = metadata. get ( " resource " ) if resource : # since multiple folders are in play, we only allow removal if the resource is in # the first directory in the list ( i. e., most " near " the user ) if not self. _ remove... | [
-0.38120707869529724,
0.18630312383174896,
0.5502746105194092,
0.14662325382232666,
-0.4643417298793793,
0.6239672303199768,
0.15823788940906525,
0.8604915738105774,
0.2759527564048767,
0.4932544529438019,
0.7698971033096313,
0.2370968759059906,
-0.4972326457500458,
0.07683930546045303,
... |
def get _ message ( self ) : from random import choice message = choice ( self. messages ) return message | [
-0.5340787172317505,
-0.3748677968978882,
0.33299967646598816,
-0.1151350662112236,
0.8560251593589783,
0.6098300814628601,
0.24203872680664062,
-1.717342495918274,
0.6106782555580139,
-0.5528713464736938,
0.9115690588951111,
0.7105332016944885,
-1.3084594011306763,
0.15549208223819733,
... |
def setupfields ( self, nodeformat ) : for condition in self. conditionlist [ : ] : condition. setupfields ( nodeformat ) if not condition. field : self. conditionlist. remove ( condition ) | [
-0.1468939632177353,
-0.1863916665315628,
0.24322275817394257,
-0.5833435654640198,
0.2672891318798065,
-0.4472346603870392,
0.306726336479187,
0.6034911870956421,
0.02272827923297882,
0.30678677558898926,
0.053106628358364105,
-0.9322476387023926,
-0.3953739106655121,
0.8541634678840637,
... |
def build _ abbreviation ( agency _ name ) : abbreviation ='' for ch in agency _ name : if ch in string. ascii _ uppercase : abbreviation + = ch return abbreviation | [
-0.7303031086921692,
-1.4122545719146729,
0.46640145778656006,
-0.18402811884880066,
0.1434786319732666,
0.1871463507413864,
-0.3097856044769287,
0.6195895671844482,
0.9472932815551758,
0.8324299454689026,
0.6155616044998169,
0.634169340133667,
0.18473894894123077,
-0.18958823382854462,
... |
def export ( self, simulation, ip = false ) : url = self. base _ api + " / simengine / rest / export / { } ". format ( simulation ) url + = "? running - configs = config " if ip : url + = " & updated = true " r = self. get ( url ) return r | [
-0.9326352477073669,
0.7846237421035767,
0.3668517470359802,
1.353928565979004,
-0.6536253690719604,
-0.943196177482605,
-0.6823767423629761,
-0.10096736997365952,
0.7599850296974182,
0.8323980569839478,
-0.2875445485115051,
-0.23829323053359985,
-1.5643407106399536,
-0.2195930927991867,
... |
def find _ wallpapers ( find _ dir _ name, copy _ dir _ name ) : file _ scanner = filescanner ( [ find _ dir _ name ], is _ qfiles = false, recurse = true ) for file in file _ scanner. files : if ". jp " in file. lower ( ) or " *. pn " in file. lower ( ) : # optimization. if the file is in destination already skip it _... | [
0.07589717954397202,
-0.16966962814331055,
0.7896384596824646,
0.3629038333892822,
-0.2953634262084961,
0.4086437523365021,
0.8335296511650085,
-0.7396613955497742,
-0.040269333869218826,
1.643394947052002,
0.38358360528945923,
-0.11292198300361633,
-0.2527582049369812,
0.8984464406967163,... |
def accuracy _ score _ ( y, y _ hat ) : score = y = = y _ hat return np. average ( score ) | [
0.20279870927333832,
-1.3497895002365112,
0.4682784676551819,
0.5769462585449219,
0.5613811612129211,
-0.16087386012077332,
0.5569438338279724,
-0.7294389009475708,
0.31877681612968445,
1.0847699642181396,
-0.05053666606545448,
1.3728411197662354,
1.1963043212890625,
0.17757198214530945,
... |
def test _ trapreturns ( self ) : failure = synchronousfailure ( runtimeerror ( ) ) self. assertequals ( failure. trap ( zerodivisionerror, runtimeerror ), runtimeerror ) | [
-0.5252349376678467,
0.41229692101478577,
0.14854708313941956,
0.015455042012035847,
0.2217576801776886,
0.276267945766449,
0.07600685209035873,
-0.5009276270866394,
0.1697811782360077,
-1.2931970357894897,
-0.20418694615364075,
-0.0913967713713646,
-0.12059838324785233,
-0.333830177783966... |
def _ _ init _ _ ( self, shape, max _ size, batch _ size, n _ classes ) : # code. interact ( local = locals ( ) ) self. buffer = none # np. zeros ( 1 ) # np. zeros ( shape = shape ) self. labels = none # np. zeros ( 1 ) # np. zeros ( shape = ( shape [ 0 ], n _ classes ) ) # # this will be overwritten by add to buffer f... | [
-0.16627538204193115,
-0.2598598003387451,
0.7574018239974976,
0.46607470512390137,
0.7105675935745239,
0.08352097868919373,
0.18198272585868835,
-0.1517437994480133,
0.22340816259384155,
-0.45507994294166565,
-0.37354403734207153,
0.3447098731994629,
0.2536843419075012,
1.1649527549743652... |
def jsonapi _ exception _ handler ( exc, context ) : if isinstance ( exc, http404 ) : exc = resourcenotfound ( ) elif isinstance ( exc, permissiondenied ) : exc = exceptions. permissiondenied ( str ( exc ) ) elif isinstance ( exc, exceptions. validationerror ) : excs = manyexceptions ( [ ] ) for field, errors in exc. d... | [
-0.8276283144950867,
-0.6073624491691589,
0.9016143679618835,
-0.2341780662536621,
-0.20666325092315674,
-0.9404590129852295,
-0.24377086758613586,
-0.23677746951580048,
0.7710129618644714,
-0.045516569167375565,
0.06901470571756363,
-0.33940139412879944,
-0.3312961161136627,
-0.2148061841... |
def variables ( cls, index = none ) : # get the search object s = cls. search ( ) # parse the indices if index is not none : s = s. index ( ) s = s. index ( index. split ( ',') ) # aggregate, use a term aggregation on variable s. aggs. bucket ('variables ','terms ', field ='variable. raw ', size = 1000 ) # todo size ha... | [
-0.5538357496261597,
1.2285579442977905,
0.6474758386611938,
-0.2987792491912842,
0.13727973401546478,
-0.7580792903900146,
-0.12440543621778488,
-0.5253903865814209,
-0.24286754429340363,
-0.04985659569501877,
-0.21149517595767975,
-0.14059767127037048,
-0.2946817874908447,
-1.09115350246... |
def to _ list ( self ) - > list [ countattribute ] : return self. _ attributes | [
-0.5308569073677063,
-0.8476293683052063,
0.23404888808727264,
0.0364757776260376,
1.0532442331314087,
0.19320127367973328,
-0.012833761051297188,
1.151696801185608,
0.8300497531890869,
0.4562547504901886,
-0.49029529094696045,
-0.40602824091911316,
0.18451276421546936,
-0.1928645074367523... |
def init _ deep _ test _ collection ( dim, num _ boxes _ per _ step, num _ cells, rng ) : lhs = [ [ ] ] deep _ ps _ collection = [ ] deep _ cs _ collection = [ ] for i in range ( num _ boxes _ per _ step ) : l, h = choose _ cell ( rng, num _ cells = num _ cells, d = dim ) rng, _ = random. split ( rng, 2 ) lhs. append (... | [
-0.9771064519882202,
0.4438043236732483,
0.5643134713172913,
0.7283356189727783,
0.29815420508384705,
0.47161775827407837,
0.5257101058959961,
-0.2898353934288025,
-0.4948354661464691,
-0.2801375091075897,
-1.0661025047302246,
0.09783443808555603,
-0.24009284377098083,
0.6317663788795471,
... |
async def wait _ for _ task _ status _ change ( self, task _ id, status, timeout = none ) : if timeout is none : timeout = self. global _ timeout url = " { } { } : { } / ws / task / { } ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port, str ( task _ id ) ) headers = self. get _ headers ( ) try : async ... | [
-0.17685608565807343,
-0.078252874314785,
0.5612106323242188,
-0.2851448059082031,
-0.9840565323829651,
0.17609161138534546,
-0.3987860381603241,
-0.15019281208515167,
-0.1649121642112732,
0.4080234169960022,
-0.1824399083852768,
1.2196502685546875,
0.10473227500915527,
0.5300679802894592,... |
def get _ organism _ info _ from _ db ( self, org _ name : str ) - > pd. dataframe : current _ organims = self. get _ all _ unique _ organims _ in _ db ( ) if org _ name not in current _ organims : raise valueerror ( f'the provided organims is not in the database : { org _ name }') return self. _ database. loc [ self. ... | [
-0.4499056041240692,
0.518284022808075,
0.29506972432136536,
0.16912125051021576,
-0.2789384126663208,
-0.2703280448913574,
0.07085547596216202,
-0.12067820876836777,
-0.7230575084686279,
0.31569650769233704,
0.3248847424983978,
0.42910170555114746,
-0.07248759269714355,
-0.663280546665191... |
def prepare _ dynamic _ sim ( self, monitored _ variables, sim _ type ='rms ', start _ time = 0. 0, step _ size = 0. 01, end _ time = 10. 0 ) : # get results file self. res = self. app. getfromstudycase ('*. elmres') for elm _ name, var _ names in monitored _ variables. items ( ) : # get all network elements that match... | [
-0.19942927360534668,
-0.10478395968675613,
0.6085587739944458,
0.8893105387687683,
0.7318797707557678,
-0.05363762378692627,
0.2639239728450775,
-0.18222583830356598,
-0.04427232965826988,
0.007052183151245117,
0.07970502227544785,
-0.08323810994625092,
0.03408003970980644,
0.462355196475... |
def get _ entity _ by _ remoteid ( self, remote _ id, target _ name = none, target _ uuid = none, * * kwargs ) : entities = [ deepcopy ( x ) for x in self. get _ entities ( * * kwargs ) if x. get ('remoteid') = = remote _ id ] if target _ name and entities : entities = [ deepcopy ( x ) for x in entities if x ['discover... | [
-0.4132457673549652,
-1.0601935386657715,
0.4656318128108978,
0.14414513111114502,
0.19148236513137817,
0.07173222303390503,
-1.0461468696594238,
0.5563012957572937,
-0.19006416201591492,
0.6965228915214539,
0.22510118782520294,
1.2115833759307861,
-0.04751737788319588,
0.3617631494998932,... |
def getpipe4 ( command ) : import popen2 try : cls = popen2. popen4 except attributeerror : cls = _ dummypopen4 return cls ( getsuitablecommandline ( command ) ) | [
-0.28334683179855347,
-0.48691526055336,
0.48414233326911926,
0.3173707127571106,
-0.2229403406381607,
-0.29389873147010803,
-0.40370112657546997,
-0.2793738842010498,
-0.6122732162475586,
-0.6222560405731201,
0.033527929335832596,
-0.11235281080007553,
-0.5794073343276978,
-0.022585568949... |
def transform ( self, x, y = none ) : x _ copy = x. copy ( ) not _ contacted = x _ copy. query ('{ } = = - 1 '. format ( sg. nb _ day _ last _ contact ) ). copy ( ) not _ contacted [ sg. result _ last _ campaign ] = not _ contacted [ sg. result _ last _ campaign ]. fillna ( " not contacted " ) index = list ( not _ cont... | [
-1.0629876852035522,
0.2197887897491455,
0.45602959394454956,
-0.6197094321250916,
0.2072959542274475,
-0.4590577483177185,
-0.08808223903179169,
-0.35398775339126587,
0.4157894551753998,
0.19043423235416412,
0.35266995429992676,
0.3249022662639618,
0.127823606133461,
-1.2098677158355713,
... |
def test _ complain _ no _ data _ single _ db ( self ) : def mock _ get _ history _ db _ config ( db ) : return { " bar _ size " : " 1 day ", " universes " : [ " usa - stk " ], " vendor " : " ibkr ", " fields " : { " close " : " float ", " open " : " float ", " high " : " float ", " low " : " float ", " volume " : " fl... | [
-0.19609980285167694,
1.0841681957244873,
0.7650907635688782,
-0.14603669941425323,
0.6165328621864319,
0.14197930693626404,
0.5027431845664978,
0.1637769490480423,
-0.03550945594906807,
-0.24303166568279266,
-0.16250799596309662,
0.17990605533123016,
-0.5007055997848511,
0.776101946830749... |
def has _ pending _ messages ( self ) - > bool : return self. pending _ count > 0 | [
-0.04297008365392685,
-0.3220873177051544,
0.5916722416877747,
-0.2720901370048523,
0.9778135418891907,
0.008228949271142483,
-0.7576591968536377,
0.43112799525260925,
-0.8361679315567017,
-0.6408724188804626,
0.1281614899635315,
-0.2341005951166153,
-0.6478204131126404,
1.7694251537322998... |
def logout ( ) : # clear email from session data session. pop ('user _ email ', none ) # inform the user of the login status and redirect to login page flash ('you been logged out successfully') return redirect ('/') | [
0.2430589646100998,
-0.06554636359214783,
0.30429086089134216,
0.11785933375358582,
-0.2402397096157074,
0.2813154458999634,
0.17752033472061157,
1.0662037134170532,
0.301772803068161,
0.06354708969593048,
-0.1531180590391159,
0.34505537152290344,
0.6641320586204529,
-1.1414034366607666,
... |
def init _ configs ( self ) : self. configs = [ dgram. dgram ( ) for i in range ( len ( self. ds. xtc _ files ) ) ] self. smd _ configs = [ dgram. dgram ( ) for i in range ( len ( self. ds. smd _ files ) ) ] | [
-0.5903781056404114,
0.9157310128211975,
0.37339118123054504,
-0.03835228085517883,
-0.24980221688747406,
-0.4280748665332794,
0.159750834107399,
0.4659595489501953,
-0.4728534519672394,
0.4938984513282776,
-0.6198638677597046,
0.3182300627231598,
0.8661584258079529,
1.1317040920257568,
... |
def _ transformation ( self, x : np. ndarray ) - > np. ndarray : return 1 - np. exp ( - self. exponent * x ) | [
-1.0394601821899414,
0.15134796500205994,
0.3791656494140625,
-0.892744779586792,
0.16672725975513458,
0.01938503049314022,
-0.37795042991638184,
0.36827364563941956,
1.0762956142425537,
0.4532321095466614,
-0.5993759036064148,
0.48350173234939575,
-0.14036262035369873,
-0.2188366353511810... |
def is _ iterable _ type ( tp : type ) - > bool : # all type hints for iterables satisfy : # * being an instance of the typing. _ genericalias class # * having an _ _ origin _ _ that extends collections. abc. iterable # * the element type is the first item in _ _ args _ _ return ( isinstance ( tp, typing. _ genericalia... | [
-1.313017725944519,
0.14316849410533905,
0.7207895517349243,
0.05662817507982254,
0.3387625515460968,
1.2693670988082886,
0.6769462823867798,
-0.9166566729545593,
-0.5525298714637756,
1.249336838722229,
-0.4743330776691437,
0.08453625440597534,
-0.8300495743751526,
0.8492379188537598,
-0... |
def test _ http _ set ( self ) : target = sprint. objects. create ( project = self. project, number = 1, velocity = 6 ) response = self. client. post ('/ backlog / sprint / % d /'% target. id, {'item [ ]': [ self. i3. id, self. i2. id, self. i1. id ] } ) self. failunlessequal ( 200, response. status _ code ) self. fail... | [
-0.5950129628181458,
0.058141861110925674,
0.558195948600769,
0.0435325913131237,
1.0738170146942139,
0.6032536625862122,
-0.665253221988678,
-0.7401240468025208,
-0.8446767926216125,
0.15463043749332428,
-0.6719856858253479,
0.4832872152328491,
-0.702427089214325,
-0.7352281212806702,
-... |
def _ handle _ request ( self, request ) : response = webob. response ( request = request ) path = request. path _ info parsed = self. _ urlmap ( path ) if parsed : path _ params, resource = parsed else : path _ params, resource = { }, self. not _ found _ resource instance = resource ( request = request, response = res... | [
-0.20414283871650696,
-0.9311281442642212,
0.6872045397758484,
0.1921815276145935,
0.1257864385843277,
0.48279011249542236,
0.2747897505760193,
-0.38484498858451843,
0.7467411160469055,
-0.8609151244163513,
0.6893646717071533,
-1.114952802658081,
-0.0987728014588356,
-0.24141961336135864,
... |
def start ( detached = none ) : if production : print " run'/ etc / init. d / rabbitmq - server start'to start server " while not yn _ choice ( " is rabbitmq running? ",'n') : print " please start rabbitmq - server. " else : progress. next ( ) print if detached is none : rabbit _ env ['detached'] = " - detached " # log... | [
0.12255868315696716,
-1.3923367261886597,
0.6584919691085815,
-0.04874034225940704,
0.21947330236434937,
1.2431132793426514,
0.11955124139785767,
0.7516878843307495,
0.17657557129859924,
-0.1361151933670044,
-0.7199777960777283,
1.8005057573318481,
-1.1862868070602417,
0.12370817363262177,... |
def remove _ duplicate ( n ) : if not n. is _ empty ( ) : curr = n. head dic = { curr. value : true } while curr. next is not none : if curr. next. value in dic : curr. next = curr. next. next else : dic [ curr. next. value ] = true curr = curr. next | [
-0.42958709597587585,
0.9866062998771667,
0.6359342336654663,
-0.3757263720035553,
-0.7005794048309326,
-0.612210750579834,
0.594856321811676,
1.12703275680542,
0.742480456829071,
0.5900605916976929,
-1.2860432863235474,
-0.003245786763727665,
-0.5399624109268188,
1.4255340099334717,
0.1... |
def sh ( command, check _ return _ code = true, strip _ output = true, return _ stderr = false ) : # command _ string is just for log messages. if isinstance ( command, list ) : shell = false command _ string =''. join ( command ) else : shell = true command _ string = command logger. debug ('running : { 0 } '. format ... | [
0.41326281428337097,
-0.6296594738960266,
0.9944733381271362,
-0.05578126758337021,
-0.6349983215332031,
-0.09973954409360886,
-0.80384361743927,
0.5802529454231262,
0.15876246988773346,
-0.07344065606594086,
0.512509286403656,
0.6382466554641724,
0.09521819651126862,
0.659408450126648,
... |
def find _ name _ in _ mbean _ with _ model _ name ( wlst _ name, lower _ case _ map ) : _ method _ name ='find _ name _ in _ mbean _ with _ model _ name'_ _ logger. entering ( wlst _ name, class _ name = class _ name, method _ name = _ method _ name ) result = wlst _ name found = false if result in lower _ case _ map.... | [
-0.7429494261741638,
-1.09749174118042,
0.97654128074646,
-0.1704186350107193,
-1.3596196174621582,
-0.052187297493219376,
0.2472396343946457,
-0.9406026601791382,
-0.3536777198314667,
0.5261786580085754,
-0.4508393704891205,
-0.3759121298789978,
-1.0190118551254272,
1.4324254989624023,
... |
def rotation _ 90 ( self ) : if self. config. displayorientation = = win32con. dmdo _ 180 or \ self. config. displayorientation = = win32con. dmdo _ default : self. swap _ pels ( ) self. config. displayorientation = win32con. dmdo _ 90 self. apply _ config ( ) | [
-0.3356364071369171,
0.8978843688964844,
0.4991067945957184,
-0.25011423230171204,
-0.6369075179100037,
0.45417821407318115,
1.3270080089569092,
-0.24734856188297272,
0.5725218057632446,
0.28928235173225403,
-0.0027191368862986565,
0.2597346901893616,
-0.34417855739593506,
0.15064229071140... |
def next ( term ) : return add ( term, 1 ) | [
-1.0289329290390015,
0.2375086396932602,
0.3632293939590454,
0.8065006732940674,
-1.1738742589950562,
-0.016674509271979332,
-0.36414793133735657,
-0.3535846471786499,
0.32976266741752625,
-0.2905604839324951,
-0.38134637475013733,
0.4680141806602478,
-0.33128806948661804,
-0.8560332059860... |
async def createmergerequestgreeting ( gl, event, jsonstr ) : webhook _ payload = json. loads ( jsonstr ) merge _ iid = webhook _ payload ['data'] ['object _ attributes'] ['iid'] url = f " / projects / { event. project _ id } / merge _ requests / { merge _ iid } / notes " message = f " merge request created succesfully... | [
-0.14904016256332397,
-0.07071377336978912,
0.8419508934020996,
0.16166236996650696,
0.9520880579948425,
0.5001806616783142,
-0.8860714435577393,
-0.23757994174957275,
-0.2669658362865448,
-0.23317977786064148,
-0.4094313383102417,
0.4944440424442291,
-1.2210049629211426,
0.730523586273193... |
def get _ schedule _ delay ( schedule : str ) - > tuple : now = datetime. datetime. now ( ) minutes, hours, days, months, weekdays = schedule. split ('' ) delta = datetime. datetime. now ( ) if not weekdays = ='*': if ','in weekdays : weekdays = weekdays. split ( ',') if weekdays [ 0 ] in days _ of _ week : weekdays = ... | [
-0.5295532941818237,
-0.38116946816444397,
1.0700733661651611,
-0.30798861384391785,
-0.8540441393852234,
0.06500294059515,
-0.06764025241136551,
0.4577155113220215,
0.21317118406295776,
-0.08299364894628525,
-0.16330145299434662,
-0.311575323343277,
0.0857672169804573,
-0.0077768634073436... |
def rating _ handler ( sender, instance, created, * * kwargs ) : media = instance. media # only new rating created if created : media. rating _ count = f ('rating _ count') + 1 media. save ( ) | [
-0.3026634752750397,
0.41195887327194214,
0.3261076807975769,
0.21444284915924072,
1.0971282720565796,
0.35838252305984497,
0.29563650488853455,
0.6507602334022522,
-0.924828290939331,
0.636536717414856,
-0.76519775390625,
-0.743150532245636,
-0.26594090461730957,
0.7112420201301575,
-0.... |
def to _ json ( self ) : return json. dumps ( self. raw ) | [
-1.4153409004211426,
-1.548140287399292,
0.5951780080795288,
-0.9753182530403137,
-0.8782588839530945,
-0.050830937922000885,
-0.013788111507892609,
-0.04856662079691887,
0.629397988319397,
-0.4795379042625427,
-1.1203935146331787,
1.0277234315872192,
0.3122318387031555,
-0.078077845275402... |
def _ mgui _ set _ choices ( self, choices : iterable [ tuple [ str, any ] ] ) - > none : current = self. _ mgui _ get _ value ( ) for btn in self. _ btn _ group. buttons ( ) : self. _ remove _ button ( btn ) for c in choices : self. _ add _ button ( * c ) self. _ mgui _ set _ value ( current ) | [
-1.3245022296905518,
0.40529051423072815,
0.5425539016723633,
0.48010221123695374,
0.43349489569664,
0.6006225347518921,
0.12826384603977203,
-0.6438009738922119,
-0.09933680295944214,
0.6343475580215454,
-0.4733480215072632,
-0.009185826405882835,
-0.083146832883358,
0.6321530938148499,
... |
def flatten _ image ( img ) : s = img. shape [ 0 ] * img. shape [ 1 ] img _ wide = img. reshape ( 1, s ) return img _ wide [ 0 ] | [
-0.7857347130775452,
0.6082790493965149,
0.5044412016868591,
0.13139641284942627,
-0.11789155751466751,
-0.7653361558914185,
0.4866354465484619,
0.40146663784980774,
0.7316128611564636,
-0.17763294279575348,
1.0771911144256592,
-0.28993216156959534,
-0.586873471736908,
0.2648475766181946,
... |
def _ _ init _ _ ( self, dataset = " ", alignment _ file = " ", focus _ seq _ name = " ", calc _ weights = true, working _ dir = ". ", theta = 0. 2, load _ all _ sequences = true, alphabet _ type = " protein " ) : np. random. seed ( 42 ) self. dataset = dataset self. alignment _ file = alignment _ file self. focus _ se... | [
0.14363205432891846,
-0.41174834966659546,
1.0139074325561523,
0.13281512260437012,
-0.6955830454826355,
0.3563556373119354,
-0.3630569875240326,
0.5118485689163208,
0.08000895380973816,
0.3663300573825836,
-0.0229966938495636,
0.05170593038201332,
-0.0008911736658774316,
0.451790273189544... |
async def update _ credential ( self, credential : credential ) - > mythicresponse : url = " { } { } : { } / api / v { } / credentials / { } ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version, str ( credential. id ), ) resp = await self. put _ json ( url, data = await obj... | [
-1.1998449563980103,
-1.2087492942810059,
0.5355902314186096,
-0.16835804283618927,
0.1932276338338852,
-0.340815007686615,
-0.48497286438941956,
0.46250051259994507,
0.6249402761459351,
0.6931381821632385,
-1.4653366804122925,
0.47231200337409973,
-0.6595382690429688,
-0.7590237259864807,... |
def testflatw0 ( self ) : h0 = 96. 0 for om0 in numpy. arange ( start = 0. 1, stop = 0. 95, step = 0. 4 ) : for w0 in numpy. arange ( start = - 1. 5, stop = - 0. 49, step = 1. 0 ) : universe = cosmologyobject ( h0 = h0, om0 = om0, w0 = w0 ) og0 = universe. omegaphotons ( redshift = 0. 0 ) onu0 = universe. omeganeutrino... | [
0.28826096653938293,
-0.6022449135780334,
0.791771411895752,
-0.2659008204936981,
0.08878283947706223,
0.45196831226348877,
0.6550067067146301,
-0.2546745240688324,
0.10556044429540634,
-0.8055321574211121,
-0.40076375007629395,
-0.3867891728878021,
-0.08719968050718307,
1.9635279178619385... |
def move _ files ( glob _ search, destination _ dir ) : # make sure inputs are lists before proceding, even if # they are only singletons. if type ( glob _ search )! = type ( [ ] ) : glob _ search = [ glob _ search ] if type ( destination _ dir )! = type ( [ ] ) : destination _ dir = [ destination _ dir ] for i in rang... | [
-0.9292759895324707,
0.6522538065910339,
1.0031636953353882,
0.45178723335266113,
0.6171458959579468,
0.02147143892943859,
1.0385223627090454,
0.7311379313468933,
0.24923422932624817,
0.416586697101593,
0.7362170815467834,
-0.3951813578605652,
-0.594994306564331,
0.36324939131736755,
0.0... |
def parse _ options ( options ) : # normalize different ways to specify the dict items : # attribute : option ( ) # attribute : ('_ _ init _ _ arg ','config variable') # attribute : ('config variable,') # attribute :'config variable'result = { } for internal, external in options. items ( ) : if not isinstance ( externa... | [
-1.017859935760498,
0.28324034810066223,
0.5567275881767273,
-0.5352799296379089,
-0.07261838763952255,
-0.5243045091629028,
-0.2790246903896332,
-0.32413873076438904,
0.12107472121715546,
0.009809945710003376,
-0.48745882511138916,
-0.8240839838981628,
-0.42709290981292725,
0.023239843547... |
def get _ absolute _ url ( self ) : return urllib. quote ( " / results / % s / % s " % ( self. job. id, self. name ) ) | [
0.3643084764480591,
-0.556370735168457,
0.39809250831604004,
-0.18124891817569733,
0.3794669508934021,
0.7479386925697327,
-0.7974717020988464,
-0.5925837755203247,
-1.1622273921966553,
-0.8009868860244751,
-0.20212022960186005,
0.37417441606521606,
-0.20018421113491058,
0.5351278781890869... |
def jwt _ to _ user ( token ) : assert jwt _ secret is not none return jwt _ and _ secret _ to _ user ( token, jwt _ secret ) | [
-0.4065409302711487,
-0.172806516289711,
0.23914332687854767,
-0.18851204216480255,
-0.14719262719154358,
-0.7491042613983154,
-0.35532620549201965,
-1.6478685140609741,
0.2562549114227295,
0.18224698305130005,
-1.4093592166900635,
0.4986923635005951,
0.8813719749450684,
-0.204680249094963... |
def generate _ radio _ buttons _ check _ template ( specifics : dict, placeholders : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders ) template ['action - type'] ='check'return template | [
-0.6386663317680359,
-0.002218707464635372,
0.26849061250686646,
-0.5421273112297058,
0.18025127053260803,
0.5252318382263184,
-0.4296330213546753,
0.24895846843719482,
-0.10585003346204758,
1.0999226570129395,
-0.4106762111186981,
-0.2468024492263794,
-0.32945889234542847,
0.0319662168622... |
def service _ url ( self ) - > optional [ str ] : return pulumi. get ( self, " service _ url " ) | [
0.24869030714035034,
0.0586770698428154,
0.43187153339385986,
0.39919888973236084,
1.259994626045227,
1.4863520860671997,
0.13164743781089783,
-0.1100194901227951,
0.5084696412086487,
-0.11657723039388657,
0.29654091596603394,
0.8651726841926575,
-0.08001774549484253,
-0.662387490272522,
... |
def _ _ euclidean _ map _ debug ( self ) : # iterate sensors for i, sensor in enumerate ( self. sensors ) : # initialise sensor distance map sensor. emap = np. zeros ( shape = self. x. shape ) # reset room corner distances self. _ _ reset _ pathfinding _ variables ( ) # recursively find shortest distance to all valid c... | [
-0.06200749799609184,
-0.2692107558250427,
1.0670924186706543,
-0.5114778876304626,
-0.14877136051654816,
0.6583819389343262,
0.4645180404186249,
-0.3792983293533325,
0.05897025018930435,
0.4960789084434509,
0.5209627151489258,
0.07669282704591751,
0.38616517186164856,
1.2973254919052124,
... |
def to _ str ( self ) : import simplejson as json if six. py2 : import sys reload ( sys ) sys. setdefaultencoding ( " utf - 8 " ) return json. dumps ( sanitize _ for _ serialization ( self ), ensure _ ascii = false ) | [
-0.6866001486778259,
-1.3946291208267212,
0.5078098773956299,
0.17171405255794525,
-0.8505599498748779,
-0.07489015907049179,
-0.4976533055305481,
-1.081451654434204,
-0.018918734043836594,
0.11467403918504715,
-0.7030025124549866,
0.39311400055885315,
-0.1876772791147232,
-0.5203585624694... |
def readin _ whole _ file ( filename : str ) - > str : with open ( filename,'r') as fh : lines = " ". join ( fh. readlines ( ) ) fh. close ( ) return lines | [
0.31009629368782043,
-0.5727123618125916,
0.7838131785392761,
-0.21369294822216034,
-0.17164649069309235,
1.1293761730194092,
-0.37310609221458435,
1.0320242643356323,
-0.9092634320259094,
-0.040058232843875885,
0.6086152195930481,
-0.11365406215190887,
-0.18057706952095032,
0.226401284337... |
def test _ cg ( n, etol ) : a = diag ( 2 * ones ( n ) ) - diag ( ones ( n - 1 ), 1 ) - diag ( ones ( n - 1 ), - 1 ) x = arange ( n ) b = dot ( a, x ) x0 = 0. 0 * b xs, rvals = cg. solve _ cg ( a, b, x0, rtol = 1. 0e - 5, maxits = 10000 ) assert ( max ( abs ( x - xs ) ) < etol ) | [
-0.23546470701694489,
0.6800847053527832,
0.5188068747520447,
0.03414873406291008,
0.13703809678554535,
0.21312648057937622,
0.3741908073425293,
-0.023998413234949112,
0.1051480770111084,
0.5809857249259949,
-0.22667355835437775,
-1.4473329782485962,
0.2883917987346649,
0.5056184530258179,... |
def init _ weights _ and _ state ( self, input _ signature ) : if isinstance ( input _ signature, ( list, tuple ) ) : input _ signature = input _ signature [ 0 ] self. weights = ( ) if self. _ mode = ='predict': shape = list ( input _ signature. shape ) shape [ 1 ] = self. _ n _ items _ to _ remember self. state = ( jn... | [
-0.7781703472137451,
0.2501128315925598,
0.4176664650440216,
0.5176981687545776,
0.28023356199264526,
-0.2620304226875305,
0.3814745247364044,
0.5755247473716736,
-0.1283390372991562,
0.13064678013324738,
-1.3213423490524292,
-0.04369411617517471,
0.5946024656295776,
1.200395107269287,
0... |
def host _ phylogenetic _ distance ( g, n1, n2 ) : from bio. seqrecord import seqrecord rrna _ 1 = g. node [ n1 ] ['18s _ rrna _ sequence'] rrna _ 2 = g. node [ n2 ] ['18s _ rrna _ sequence'] assert isinstance ( rrna _ 1, seqrecord ),'{ 0 } does not have a valid rrna sequence. '. format ( n1 ) assert isinstance ( rrna ... | [
0.03776143491268158,
-0.025053124874830246,
0.5580224394798279,
0.06953730434179306,
0.23491913080215454,
0.21256986260414124,
-0.41982170939445496,
0.3082950711250305,
-0.9197961091995239,
0.7974507808685303,
-0.32118743658065796,
0.5789183378219604,
-0.5002117156982422,
-0.63784080743789... |
def test _ 020 _ numerical _ jacobian _ sigmoid ( caplog ) : u : type _ float = gradient _ diff _ acceptance _ value # y = sigmoid ( x ) - > dy / dx = y ( 1 - y ) # 0. 5 = sigmoid ( 0 ) - > dy / dx = 0. 25 for _ in range ( num _ max _ test _ times ) : x = np. random. uniform ( low = - boundary _ sigmoid, high = boundar... | [
-0.12599453330039978,
0.601997971534729,
0.44397830963134766,
1.0032657384872437,
-0.560126781463623,
0.8041727542877197,
0.6009353399276733,
-0.3189268410205841,
-0.4670892655849457,
0.09889718145132065,
-0.16261731088161469,
0.49721506237983704,
0.22564703226089478,
0.8210970759391785,
... |
def actioncleanupafter ( self ) : frc = true ; if'execute'not in self. asactions and'all'not in self. asactions : frc = self. _ executesubdriver ( ['cleanup - after ', ], fmayskip = false ) ; if not self. _ killallvboxprocesses ( ) : frc = false ; if not self. _ uninstallvbox ( self. _ persistentvarexists ( self. ksvar... | [
0.3821771442890167,
-0.062120046466588974,
0.7138916850090027,
1.1910868883132935,
0.06657291203737259,
-0.3595796227455139,
0.7002214193344116,
-0.13157913088798523,
0.3657248914241791,
-0.13346758484840393,
-0.2029666006565094,
-0.36497095227241516,
-0.7625917196273804,
0.523236155509948... |
def subplot _ array ( self, hsize, vsize = ( 1. 0, ), figsize = ( 10, 10 ) ) : nx = ( len ( hsize ) + 1 ) / 2 ny = ( len ( vsize ) + 1 ) / 2 fig, axx = plt. subplots ( ny, nx, squeeze = false, figsize = figsize ) # just to make the axes, will move them sizer = lambda x, i : axes _ size. scaled ( x ) if i % 2 = = 0 else... | [
0.5720858573913574,
0.21114899218082428,
0.6414812803268433,
0.27730801701545715,
-0.4667969346046448,
0.4048876464366913,
0.4784987270832062,
-0.17085154354572296,
0.42248785495758057,
0.3124227523803711,
0.027471276000142097,
0.15878146886825562,
-0.328196257352829,
0.08626668155193329,
... |
def e ( tag, message ) : # pylint : disable = invalid - name date = _ _ get _ date ( ) if log _ level _ stdout > = 1 : _ _ log _ to _ stdout ( colors. color _ err, date, tag + " / e ", message ) if log _ level _ file > = 1 : _ _ log _ to _ file ( date, tag + " / e ", message ) | [
-0.2321087121963501,
0.2692163586616516,
0.6252866983413696,
0.34083425998687744,
0.5079089403152466,
-0.12608212232589722,
0.6289455890655518,
-0.20507872104644775,
-1.2628402709960938,
0.06075526401400566,
0.6548045873641968,
0.566602349281311,
0.5399706959724426,
1.3654184341430664,
0... |
def precmd ( self, line ) : # handle line continuations - - line terminated with \ # beware of null lines. line =''. join ( line. split ( ) ) self. buff = line while line and line [ - 1 ] = = " \ \ " : self. buff = self. buff [ : - 1 ] line = line [ : - 1 ] # strip terminal \ temp = input ( '...') self. buff + ='\ n'+ ... | [
0.3497374951839447,
-0.09497807919979095,
0.9815223813056946,
0.25778770446777344,
-0.1033061221241951,
0.23964639008045197,
0.5592989325523376,
-0.6625115871429443,
0.22110803425312042,
-0.8570547103881836,
-0.023736758157610893,
0.050619665533304214,
-0.3695835769176483,
-0.1203622072935... |
def metadata ( self ) - > optional [ any ] : return pulumi. get ( self, " metadata " ) | [
0.6762951612472534,
0.62310391664505,
0.503268301486969,
0.8353797793388367,
1.8750499486923218,
0.949454665184021,
-0.7560688853263855,
-0.19162200391292572,
0.43995368480682373,
0.17711517214775085,
0.4744057357311249,
1.0873138904571533,
0.5052623748779297,
-1.0754982233047485,
-1.236... |
def get _ image ( self, i = none ) : if ( len ( self. neuron _ images. shape ) = = 3 ) : i = self. time _ nav. stime. val if i is none else i else : i = 0 if i! = self. _ cur _ img _ time : cur _ image = self. _ cur _ img if ( len ( self. neuron _ images. shape ) = = 3 ) : cur _ img = self. neuron _ images [ i ] else :... | [
-0.8312111496925354,
-0.12865307927131653,
0.8025299310684204,
0.5149340629577637,
0.33907565474510193,
-0.09743467718362808,
0.42867299914360046,
-0.18883448839187622,
-0.5284050703048706,
0.8744787573814392,
0.4809860587120056,
0.002971239387989044,
-0.5758464932441711,
0.430123835802078... |
def mapping _ to _ lisp ( mapping _ name, corpus _ weights = { }, scenario = " ", character _ set = " ", full _ mapping = false ) : if scenario! = " " and character _ set! = " " : set _ scenario _ files ( scenario, character _ set ) mapping = get _ mapping ( mapping _ name ) azerty = get _ azerty ( ) letters = get _ le... | [
-0.3138038218021393,
-0.6681358218193054,
0.90207439661026,
-0.8186207413673401,
-0.7895538806915283,
-0.3818105161190033,
0.06337666511535645,
0.5225814580917358,
0.4266640543937683,
0.8569607138633728,
-0.1239098533987999,
0.2549980580806732,
0.3734724819660187,
0.07726411521434784,
1.... |
def percentile ( p, vec, p _ vec = none ) : if p _ vec is none : p _ vec = percentilize ( vec ) if len ( p _ vec ) = = 0 : return none p _ vec _ cpy = copy. deepcopy ( p _ vec ) p _ vec = set ( p _ vec ) p _ vec. discard ( none ) p _ vec = sorted ( list ( p _ vec ) ) if isinstance ( p, ( int, float ) ) : index = binary... | [
0.3161781430244446,
0.05051979050040245,
0.8128433227539062,
0.6548550724983215,
0.06543349474668503,
0.07426196336746216,
0.5199910402297974,
-0.07568385452032089,
-0.1960085779428482,
0.020000124350190163,
0.41805243492126465,
-0.3011411726474762,
-1.0312323570251465,
-0.0820955410599708... |
def _ _ call _ _ ( self, inputs, state, scope = none ) : # run the rnn as usual output, new _ state = self. _ cell ( inputs, state, scope ) # apply the multiplication to everything output = tf. matmul ( output, self. w _ out ) + self. b _ out return output, new _ state | [
-0.6698647737503052,
-0.09616683423519135,
0.5907106399536133,
0.45767703652381897,
0.12029221653938293,
-0.6847741603851318,
0.273732990026474,
0.12214898318052292,
0.04253073409199715,
-0.009689782746136189,
-0.4333321154117584,
-0.13071796298027039,
0.20433656871318817,
0.02075882814824... |
def wrapped ( * args, * * kwargs ) : import cprofile import pstats from io import stringio profiler = cprofile. profile ( ) text = stringio ( ) profiler. enable ( ) wrap _ func = func ( * args, * * kwargs ) profiler. disable ( ) stats = pstats. stats ( profiler, stream = text ). sort _ stats ( sort ) stats. print _ sta... | [
1.1444171667099,
0.08701629936695099,
0.4769648015499115,
-0.11478850245475769,
-0.652805745601654,
0.04356236755847931,
0.38527384400367737,
-0.9914944767951965,
0.015428529120981693,
-0.31617471575737,
0.3263477087020874,
0.7059301137924194,
0.30874887108802795,
0.07031156867742538,
-0... |
async def get _ operation ( self, operation : operation ) - > mythicresponse : if operation. id is none : resp = await self. get _ all _ operations ( ) if resp. response _ code = = 200 and resp. status = = " success " : for o in resp. response : if o. name = = operation. name : resp. response = o return resp raise exce... | [
-0.6541226506233215,
-0.18106308579444885,
0.8219632506370544,
0.40740111470222473,
0.8395105004310608,
-1.330277919769287,
0.2874439060688019,
-0.2558955252170563,
0.9704040288925171,
0.5007507801055908,
0.029959002509713173,
-0.34230872988700867,
-0.29665499925613403,
-0.7329323887825012... |
def test _ wrong _ target ( ) - > none : test _ file = " tests / wf / scatter - wf4. cwl " exit _ code = main ( [ " - - target ", " dummy _ target ", get _ data ( test _ file ), " - - inp1 ", " inp1 ", " - - inp2 ", " inp2 ", ] ) assert exit _ code = = 1 | [
-0.5296007394790649,
0.10767663270235062,
0.5064111948013306,
0.47991523146629333,
1.334925651550293,
0.7566889524459839,
0.07410848140716553,
0.06614641845226288,
-0.8332731127738953,
0.17719577252864838,
0.2512574791908264,
1.168502688407898,
-0.0998367890715599,
-0.3995288908481598,
-... |
def create ( self, validated _ data ) : # validating data user = funcionarios ( first _ name = validated _ data ['first _ name'], last _ name = validated _ data ['last _ name'], email = validated _ data ['email'], cargo = validated _ data ['cargo'], idade = validated _ data ['idade'], username = validated _ data ['user... | [
-0.19965235888957977,
0.09747429192066193,
0.4753151535987854,
0.42252323031425476,
-0.023284466937184334,
-0.19080649316310883,
-0.8180971741676331,
-0.16648796200752258,
-0.3591874837875366,
-0.8791921138763428,
-0.6587476134300232,
-0.6753203272819519,
-0.2616676986217499,
-0.5849972963... |
def sort _ prefixes ( orig, prefixes ='@ +') : new ='' for prefix in prefixes : if prefix in orig : new + = prefix return new | [
0.326625257730484,
-0.8750958442687988,
0.5232798457145691,
-0.043370313942432404,
-1.5575815439224243,
0.11222565174102783,
-0.9925540685653687,
-0.4586394727230072,
-0.03426830843091011,
0.6651303172111511,
0.1692301332950592,
0.6430288553237915,
-0.3312823176383972,
-0.298961341381073,
... |
def _ build _ caption _ reading _ net ( caption _ input, reuse = true, keep _ ph = none ) : with tf. variable _ scope ('caption / reading ', reuse = reuse ) : embedded _ input = tf. nn. embedding _ lookup ( input _ embeddings, caption _ input ) output = _ build _ caption _ processing _ net ( embedded _ input, reuse = r... | [
-0.5999043583869934,
-1.1145025491714478,
0.6234409809112549,
0.604534924030304,
0.26116469502449036,
0.7106353044509888,
0.4643756151199341,
0.2622264623641968,
0.22766855359077454,
-0.21094433963298798,
0.35714179277420044,
0.08172077685594559,
0.6078678965568542,
-0.6419582366943359,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.