text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def _ get _ full _ department _ name ( department _ code ) : if department _ code in _ department _ name _ cache : return _ department _ name _ cache [ department _ code ] else : departments = get _ cache ( " departments " ) try : dept = departments. objects. get ( deptid = department _ code ) _ department _ name _ cac... | [
-0.7030534744262695,
0.2831222712993622,
0.5627198815345764,
-0.7687162756919861,
-0.3726896345615387,
0.12631279230117798,
-0.2824288308620453,
-0.5011197328567505,
1.4154354333877563,
0.7963985800743103,
0.2965170741081238,
-0.4034655690193176,
1.2179269790649414,
0.5750783085823059,
0... |
def gf _ factor ( f, p, * * flags ) : lc, f = gf _ monic ( f, p ) if gf _ degree ( f ) < 1 : return lc, [ ] factors = [ ] for g, k in gf _ sqf ( f, p ) [ 1 ] : n = gf _ degree ( g ) if n = = 0 : continue for h in gf _ factor _ sqf ( g, p ) [ 1 ] : factors. append ( ( h, k ) ) def compare ( ( f _ a, e _ a ), ( f _ b, e ... | [
0.46317756175994873,
0.02518121898174286,
0.6670851707458496,
-0.10125254839658737,
0.24028298258781433,
0.14676721394062042,
0.034123655408620834,
0.11929880827665329,
-0.6724586486816406,
0.27390432357788086,
-0.07106666266918182,
-0.16210028529167175,
-0.5489935278892517,
0.181988120079... |
def test _ basic _ style _ ok ( gitrepo ) : # create file'a'file _ a = util. write _ file ( gitrepo,'a. ml ','' ) assert githooks. precommit _ hook ( util. install _ path ( ) ) # add'a'util. cmd ( gitrepo,'git add'+ file _ a ) assert githooks. precommit _ hook ( util. install _ path ( ) ) # commit'a'util. cmd ( gitrepo... | [
0.4101209342479706,
0.4609264135360718,
0.5452316403388977,
-0.134006068110466,
1.2903597354888916,
0.9934712052345276,
0.3621531128883362,
-0.1900838315486908,
-0.19779162108898163,
0.27589356899261475,
0.5662550330162048,
-0.40507277846336365,
-0.4348798990249634,
-0.1696862131357193,
... |
def _ get _ trigger _ check _ function ( self ) : passed _ args = self. _ get _ passed _ arguments _ str ( ) if len ( passed _ args ) = = 0 : check _ trigger _ function = self. _ no _ arg _ check _ trigger _ function elif'fields'in passed _ args : check _ trigger _ function = self. _ fields _ arg _ check _ trigger _ fu... | [
-0.16508683562278748,
-0.4805033504962921,
0.7360400557518005,
0.04971145838499069,
0.33915844559669495,
-0.5150201320648193,
0.6082687377929688,
0.27536284923553467,
-1.1772408485412598,
-0.34855812788009644,
0.21848225593566895,
0.39994537830352783,
-0.7217220664024353,
0.559877812862396... |
def isvalidtoopen ( targetcell, sidedir ) : # the side bordering the targetcell and the 5 - cell ( will become blank ). # if it is already active, then obviously it cannot be opened. borderside = targetcell. sides [ sidedir ] if borderside. isactive ( ) : return false # set of sides that will become active ( or are alr... | [
-0.8494904637336731,
-0.03031773492693901,
0.7944381237030029,
-0.4494064152240753,
-0.7294703722000122,
-0.1062418594956398,
0.4793735444545746,
0.4030885100364685,
0.26235172152519226,
-0.01566253788769245,
0.4789811372756958,
-0.07765328139066696,
-0.4791814386844635,
-0.406952619552612... |
def bisect ( function, a, b, tol ) : fa = function ( a ) fb = function ( b ) if fa * fb > zero : raise exception ( " limits { 0 } and { 1 } may not enclose a root. ". format ( a, b ) ) while ( abs ( a - b ) > tol ) : c = 0. 5 * ( a + b ) fc = function ( c ) if fb * fc < = zero : a = c fa = fc else : b = c fb = fc if ab... | [
1.3607839345932007,
-0.3661443293094635,
0.6181120872497559,
0.22790741920471191,
-0.6736271977424622,
-0.4264748990535736,
0.31807610392570496,
-0.6834713816642761,
-0.5716145038604736,
0.3307221829891205,
0.8785401582717896,
0.8996176719665527,
-0.45635196566581726,
-1.210479497909546,
... |
def user _ api _ autofill ( request ) : text = request. get ['q'] log. debug ( u'' + text +'%') if text : query = dbsession. query ( user ). filter ( user. user _ name. like ( text +'%') ). order _ by ( user. user _ name ) [ 0 : 10 ] res = dict ( ) res ['success'] = 1 res ['users'] = ( {'name': user. user _ name } for ... | [
-0.6814041137695312,
0.045200541615486145,
0.524909496307373,
-0.5524759292602539,
-0.6320313811302185,
-0.019579630345106125,
0.0184076726436615,
-0.6175183653831482,
0.039720769971609116,
0.2254527509212494,
-0.7837038636207581,
-0.5477151870727539,
-0.4373511075973511,
0.584833443164825... |
def character _ cnn ( char _ ids, num _ chars = char _ utils. num _ chars, emb _ size = 32, kernel _ width = 5, num _ filters = 100 ) : char _ ids, flatten = tensor _ utils. flatten ( char _ ids ) embeddings = tf. get _ variable ( " char _ emb ", [ num _ chars, emb _ size ], initializer = tf. truncated _ normal _ initi... | [
-0.10551588982343674,
-0.4950486123561859,
0.6483314633369446,
0.3233889043331146,
-0.6728377938270569,
-0.16456687450408936,
0.41862162947654724,
0.2495146542787552,
0.3768227994441986,
0.354164183139801,
-0.4885718524456024,
0.9243979454040527,
0.13309350609779358,
-0.5039418935775757,
... |
def volume _ maps ( ticket _ data, streetvolume ) : print ('creating volume map') choice = int ( input ('how many tickets would you like to add?') ) choice2 = input ('would you like to project the address data onto the street? ( y or n )') times = ['am ','pm ','ev ','ea'] for time in times : streetvolume ['totalinv _'+... | [
0.722649097442627,
-0.19208399951457977,
0.9159064292907715,
-0.24513383209705353,
-0.5928283929824829,
0.5925286412239075,
0.4124649167060852,
0.5735606551170349,
-0.06369596719741821,
0.15547525882720947,
0.3499657213687897,
-0.19266803562641144,
0.20684923231601715,
-0.41160112619400024... |
def _ vg _ exists ( self ) : exists = false cmd = lvm. lvm _ cmd _ prefix + ['vgs ','- - noheadings ','- o ','name ', self. vg _ name ] ( out, _ err ) = self. _ execute ( * cmd, root _ helper = self. _ root _ helper, run _ as _ root = true ) if out is not none : volume _ groups = out. split ( ) if self. vg _ name in vo... | [
0.07927199453115463,
0.2555517256259918,
0.6697499752044678,
-0.5542942881584167,
0.04986758530139923,
-0.40236806869506836,
-1.329367756843567,
-0.039604511111974716,
-0.7296614646911621,
1.0522067546844482,
0.47012192010879517,
0.07091964781284332,
-0.7048884034156799,
0.6406359076499939... |
def read _ shape ( self ) : byte = self. info [ self. p2shape ] return [ ( byte & 16 )! = 0, ( byte & 32 )! = 0, ( byte & 64 )! = 0, ( byte & 128 )! = 0 ] | [
-0.6617273688316345,
-0.6961266398429871,
0.5680351853370667,
0.16008678078651428,
0.6459935903549194,
1.0109103918075562,
-0.9954038858413696,
-0.24592022597789764,
-0.5185151696205139,
0.24323289096355438,
-0.6763932704925537,
-0.23889563977718353,
-0.5995672345161438,
-0.236044064164161... |
def build _ branch ( self, build _ branch ) : self. _ build _ branch = build _ branch | [
-0.7967169284820557,
-0.8454790115356445,
0.1924094259738922,
1.3788233995437622,
0.6547253131866455,
1.7375165224075317,
0.04932231828570366,
0.38909485936164856,
-0.8016674518585205,
-0.7006739974021912,
-1.1639328002929688,
-0.2667387127876282,
0.2335769534111023,
0.16701070964336395,
... |
def write ( self, vals ) : hr _ fields = { field for field _ name, field in self. _ fields. items ( ) if field. related _ field and field. related _ field. model _ name = ='hr. employee'and field _ name in vals } can _ edit _ self = self. env ['ir. config _ parameter']. sudo ( ). get _ param ('hr. hr _ employee _ self ... | [
-1.3387829065322876,
-0.1345379501581192,
0.6429332494735718,
-0.12411753833293915,
0.056943703442811966,
0.12394662946462631,
0.3713788390159607,
0.15436887741088867,
-0.8208914399147034,
0.2447933703660965,
-0.5959966778755188,
0.2837372422218323,
-0.25708499550819397,
0.6657023429870605... |
def read _ from _ revit _ doc ( cls, doc = revit. doc ) : # type : ( document ) - > iter iterator = doc. parameterbindings. forwarditerator ( ) # type : definitionbindingmapiterator for binding in iterator : # type : elementbinding definition = iterator. key yield cls ( definition, binding ) | [
-0.3657287657260895,
-0.7263022065162659,
0.3691374957561493,
0.33168748021125793,
-0.8068813681602478,
0.6649359464645386,
0.6220307350158691,
-0.2250291258096695,
-0.03858853504061699,
0.24968813359737396,
0.6616204380989075,
0.20160594582557678,
0.12883806228637695,
0.8741810321807861,
... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, site ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _ | [
-0.9414757490158081,
-0.22465786337852478,
0.453707218170166,
-0.40347763895988464,
-0.47874191403388977,
0.5252276062965393,
0.5702333450317383,
-0.7770634889602661,
1.4139608144760132,
-0.3659992218017578,
-0.8589035272598267,
0.06276263296604156,
-0.33727672696113586,
-0.129236668348312... |
def count ( self ) - > dataframe : if self. downsample : return wrap _ df ( self. _ df. downsample ( self. by, self. rule, self. n, " count " ) ) return wrap _ df ( self. _ df. groupby ( self. by, self. selection, " count " ) ) | [
0.2092665582895279,
0.3002398610115051,
0.341992050409317,
0.12398519366979599,
0.4528208076953888,
-0.5880088806152344,
1.061486840248108,
-0.21291153132915497,
-0.20724934339523315,
-0.11510898172855377,
1.2242499589920044,
0.5346618294715881,
0.2081383466720581,
-0.7297738790512085,
0... |
def volume _ max ( ) : key. volume _ set ( 100 ) | [
0.22756370902061462,
0.19444230198860168,
0.23175077140331268,
0.6038047671318054,
0.8417297601699829,
-0.772662341594696,
-1.4844810962677002,
0.1379493623971939,
-0.5172241926193237,
1.0038560628890991,
0.19955037534236908,
0.6069458723068237,
0.6337602138519287,
-0.6096912622451782,
1... |
def _ _ init _ _ ( self, args ) : self. game _ completed = false self. game _ file = args ['game _ file'] self. game = self. _ setup _ game ( ) self. current _ room = self. game ['rooms'] [ str ( self. game ['current _ room _ id'] ) ] self. can _ continue = true if self. game ['highest _ room _ id'] > self. game ['curr... | [
-0.28246888518333435,
-1.0556309223175049,
0.6428325772285461,
0.5066953897476196,
0.5147786736488342,
0.6871490478515625,
-0.04387037456035614,
0.17308653891086578,
-1.5151609182357788,
1.0932070016860962,
0.313614159822464,
-0.46095699071884155,
-0.31570032238960266,
0.4427352547645569,
... |
def test _ protlig _ ilrmsd ( protlig _ caprimodule ) : protlig _ caprimodule. calc _ ilrmsd ( ) assert round _ two _ dec ( protlig _ caprimodule. ilrmsd ) = = 0. 49 | [
1.083620548248291,
-1.26018226146698,
0.264224112033844,
-0.562558114528656,
0.26179903745651245,
0.8739558458328247,
-0.8443637490272522,
0.14178147912025452,
0.33737486600875854,
-1.071563720703125,
-0.10822872072458267,
0.30093780159950256,
-0.8470901250839233,
0.13866043090820312,
0.... |
def predict _ test _ set ( test _ df _ : pd. dataframe, pred _ dims : tuple, test _ dims : tuple, model _, pixel _ threshold : float = 0. 5, prediction _ batch _ size : int = 32, output _ dir : str ='test _ pred') - > none : os. makedirs ( output _ dir, exist _ ok = true ) for img _ dx, df _ in test _ df _. groupby ( l... | [
-0.7196202874183655,
-0.009956467896699905,
0.897177517414093,
0.13202376663684845,
-0.09464078396558762,
-0.3492588996887207,
1.125616431236267,
-0.4070502817630768,
-0.6033960580825806,
0.3923230767250061,
0.7276560068130493,
0.3619319498538971,
1.0965687036514282,
-0.1510690301656723,
... |
def _ repr _ str _ terminal _ ( self ) : string = " " categorystrings = [ ] for category, attributes in self. _ repr _ dict _. items ( ) : # get all the attribute key / value pairs for this category lined up # into individual per - line strings stored in a list. attributestrings = [ ] for attribute in attributes : attr... | [
-0.12631551921367645,
-0.41385817527770996,
0.7297967672348022,
-1.5739563703536987,
-0.867279052734375,
0.34287890791893005,
-1.1121128797531128,
-0.18452060222625732,
-0.1177869588136673,
-0.06804776936769485,
0.676304817199707,
0.06043793261051178,
0.935023307800293,
-0.1758251339197158... |
def fit _ predict _ evaluate ( model : callable, x _ in, y _ in, x _ val = none, y _ val = none, n _ folds = 10, split _ on _ year = true, balance _ training : str = none, compare _ val _ train : bool = true, properties _ too : bool = false, evaluate _ kwds : dict = dict ( ) ) - > pd. series : if properties _ too : ass... | [
-0.47967344522476196,
-0.08143595606088638,
0.9522256255149841,
0.5305675268173218,
0.45591989159584045,
-0.24333131313323975,
-0.4983137249946594,
-0.25878530740737915,
-0.3790150582790375,
-0.23802581429481506,
0.33515745401382446,
0.2660634219646454,
0.15294772386550903,
0.4229805767536... |
def udp _ iterator ( pc ) : for time, pkt in pc : eth = dpkt. ethernet. ethernet ( pkt ) if eth. type = = dpkt. ethernet. eth _ type _ ip : ip = eth. data # if the ip protocol is udp, process it further if ip. p = = dpkt. ip. ip _ proto _ udp : udp = ip. data yield ( ip. src, udp. sport, ip. dst, udp. dport, udp. data ... | [
-1.3209103345870972,
0.5673069953918457,
0.7917460203170776,
-0.47690749168395996,
-0.578156054019928,
0.4398283064365387,
-0.41464200615882874,
-0.7702548503875732,
0.4880838692188263,
0.13576503098011017,
0.46281713247299194,
-0.9869256019592285,
0.15196800231933594,
-0.397678941488266,
... |
async def test _ get _ last _ event ( v3 _ server ) : v3 _ server. get ( ( f " https : / / api. simplisafe. com / v1 / subscriptions / { test _ subscription _ id } " " / events? numevents = 1 " ), status = 200, body = load _ fixture ( " latest _ event _ response. json " ), ) async with aiohttp. clientsession ( ) as ses... | [
0.5711703300476074,
0.060917507857084274,
0.646018922328949,
0.16962677240371704,
1.3735451698303223,
0.12839902937412262,
-0.3868236839771271,
0.005191971082240343,
1.5067895650863647,
-0.8301278352737427,
-0.3609430193901062,
0.6360330581665039,
-0.07883049547672272,
-0.29546594619750977... |
def autonomousinit ( self ) : # documented by encoders self. encoder _ counts _ per _ rev = 256. 0 self. wheel _ dia = 0. 1524 self. wheel _ circum = self. wheel _ dia * math. pi # space between left and right wheels self. body _ width = 0. 6985 # gets rate for velocity self. update _ rate = 50 # raw encoder ticks self... | [
0.26386478543281555,
-1.1072089672088623,
0.8285626173019409,
-0.3852195143699646,
-0.11113052070140839,
0.007040519267320633,
-0.08968868106603622,
-0.517940878868103,
0.21596461534500122,
0.37300002574920654,
-0.705164909362793,
0.11714435368776321,
-0.04709215834736824,
0.81707072257995... |
def get _ cuda _ version ( cuda _ path = none ) : if cuda _ path is none : cuda _ path = find _ cuda _ path ( ) version _ file _ path = os. path. join ( cuda _ path, " version. txt " ) if not os. path. exists ( version _ file _ path ) : # debian / ubuntu repackaged cuda path version _ file _ path = os. path. join ( cud... | [
-0.3818964660167694,
-0.39453795552253723,
0.9237417578697205,
0.4444958567619324,
-0.261884868144989,
-0.1505814790725708,
0.04989588260650635,
-0.21964053809642792,
-1.0431013107299805,
1.1581811904907227,
-0.3505474627017975,
-0.2765340805053711,
-0.4529348909854889,
-0.0012008959893137... |
def get _ limits ( self, lim _ type ) : x _ vals = [ ] y _ vals = [ ] for key, src in self. plots. items ( ) : limits = src. get _ limits ( lim _ type ) x _ vals. append ( limits. t [ 0 ] ) y _ vals. append ( limits. t [ 1 ] ) x _ vals = np. array ( x _ vals ). flatten ( ) y _ vals = np. array ( y _ vals ). flatten ( )... | [
-0.13491380214691162,
-0.6048777103424072,
0.7207373380661011,
-0.16080695390701294,
0.3442351520061493,
0.0986519381403923,
-0.500491738319397,
-0.4717464745044708,
-0.197601780295372,
0.33700573444366455,
-0.18983185291290283,
0.7287999987602234,
-0.1744971126317978,
0.6492692232131958,
... |
def reset _ python _ short _ timeout ( self ) : pythonshellbase. set _ short _ timeout ( self. _ original _ short _ timeout ) | [
1.1366761922836304,
-0.3369300961494446,
0.3323826789855957,
0.17252293229103088,
0.2651044726371765,
0.27924618124961853,
0.6582741737365723,
-0.13806834816932678,
-0.22398336231708527,
0.1387813836336136,
-0.9121413826942444,
2.141676664352417,
-0.03099876455962658,
-0.15916185081005096,... |
def proc _ info ( self ) : if self. is _ running : with self. process _ info. oneshot ( ) : return { " pid " : self. process. pid, " cpu " : self. process _ info. cpu _ percent ( ), " mem " : self. process _ info. memory _ info ( ). rss, " build " : dict ( self. build ) } else : return none | [
0.42826947569847107,
-1.1197618246078491,
0.38029173016548157,
-0.591751754283905,
-0.25363510847091675,
-0.22598238289356232,
-0.9902411103248596,
-0.8760392069816589,
-0.44169941544532776,
-0.2769451141357422,
-0.2630101144313812,
0.41414567828178406,
-0.5562770962715149,
0.2568718791007... |
def _ get _ bool _ key _ value ( key : str, value : bool ) - > model _ pb2. keyvalue : return model _ pb2. keyvalue ( key = key, v _ bool = value, v _ type = model _ pb2. valuetype. bool ) | [
0.1857873648405075,
-0.3397369980812073,
0.30190354585647583,
0.43899768590927124,
-0.5107367038726807,
0.362898051738739,
-1.354422926902771,
-0.1148308515548706,
-1.5535401105880737,
1.4624395370483398,
0.03744902089238167,
0.8132535815238953,
0.4563010334968567,
-0.888670802116394,
0.... |
def remove _ map _ line ( samples _ list, debug ) : if ( samples _ list [ - 1 ] [ - 2 ] < 0 ) : # remove the last line del samples _ list [ - 1 ] if ( debug > 0 ) : print ( " the last sample line has been deleted as it contained the map values " ) | [
0.4422314763069153,
-1.0689817667007446,
0.7082475423812866,
0.2940232753753662,
0.044064003974199295,
0.49108538031578064,
-0.5408682823181152,
0.7299146056175232,
0.06426925212144852,
-0.15243913233280182,
0.780052900314331,
-0.18882936239242554,
-0.5687718391418457,
0.8094926476478577,
... |
def toogle _ bom ( self, e ) : for item in self. footprint _ list. getselections ( ) : row = self. footprint _ list. itemtorow ( item ) ref = self. footprint _ list. gettextvalue ( row, 0 ) fp = get _ footprint _ by _ ref ( self. board, ref ) toggle _ exclude _ from _ bom ( fp ) self. populate _ footprint _ list ( ) se... | [
-0.17941996455192566,
0.522552490234375,
0.44650983810424805,
0.25395727157592773,
0.5669997334480286,
0.03947553411126137,
1.0494048595428467,
0.6777952909469604,
0.20797105133533478,
0.20535580813884735,
0.2597094476222992,
0.009701033122837543,
-0.558806300163269,
0.628519594669342,
0... |
def _ forward ( self, input _ dict : nesteddict, * * kwargs ) - > nesteddict : raise notimplementederror | [
-0.47491753101348877,
0.42323043942451477,
0.4160272181034088,
-0.7750983238220215,
-0.6183347105979919,
0.8434472680091858,
-0.06481463462114334,
0.24566788971424103,
-0.3424568772315979,
-0.7779814600944519,
-0.12051492184400558,
0.1981484293937683,
0.35769742727279663,
0.452325046062469... |
def supportsnode ( self, nodename ) : return bool ( nodename ) | [
-1.2374411821365356,
0.9008385539054871,
0.3573877811431885,
-0.4676809310913086,
-0.49962055683135986,
0.5717417597770691,
-0.9563198089599609,
1.110338807106018,
-0.024048788473010063,
0.2709306478500366,
-0.3178280293941498,
-0.40965786576271057,
-0.6666027903556824,
0.23178444802761078... |
def consolidate _ sharded _ state _ dicts ( state _ dict _ list, shard _ metadata ) : assert len ( state _ dict _ list ) = = shard _ metadata [ " world _ size " ] full _ state _ dict = ordereddict ( ) buffer _ info = shard _ metadata. get ( " buffer _ info ", { } ) # consolidate the sharded parameters for name, p in st... | [
0.14317075908184052,
-0.18411795794963837,
0.8665910363197327,
-1.2782343626022339,
0.24789711833000183,
-0.12053418159484863,
0.12824831902980804,
-0.05073348432779312,
0.08645423501729965,
0.31053394079208374,
-0.19095441699028015,
0.43023189902305603,
0.6546040177345276,
0.9838879108428... |
def check _ events ( self, touchcontrol = false ) : for event in pygame. event. get ( ) : if touchcontrol! = false : if event. type = = pygame. fingerdown : self. fingers [ event. finger _ id ] = {'x': event. x * self. display _ w,'y': event. y * self. display _ h,'fresh _ pressed': true } elif event. type = = pygame. ... | [
-0.15154409408569336,
0.24717311561107635,
0.8641121983528137,
0.650118350982666,
-0.29712069034576416,
0.09501592814922333,
0.6151204705238342,
-0.09758540987968445,
-0.49487197399139404,
0.3087898790836334,
-0.44737356901168823,
-0.5272070169448853,
-0.584723949432373,
1.3964608907699585... |
def randomly _ seed _ numpy ( ) : np. random. seed ( seed = int ( time. time ( ) ) ) | [
0.7600868940353394,
0.240071639418602,
0.2154226005077362,
-0.30230382084846497,
0.7994794249534607,
0.4278981387615204,
0.648995041847229,
-0.41111549735069275,
0.8351640701293945,
-0.10702739655971527,
0.1581813246011734,
1.5916435718536377,
-0.06092730537056923,
0.803059995174408,
-0.... |
def test _ cancel _ unpaid _ booking ( self ) : event = baker. make _ recipe ('booking. future _ pc') booking = baker. make _ recipe ('booking. booking ', event = event, user = self. user, paid = false ) self. assertequal ( booking. objects. all ( ). count ( ), 1 ) url = reverse ('booking : delete _ booking ', args = [... | [
0.7616868019104004,
0.8487500548362732,
0.41634368896484375,
1.3945950269699097,
-0.35773131251335144,
1.2910280227661133,
0.09720460325479507,
1.2663151025772095,
0.10799518972635269,
-0.7571858167648315,
0.1296999305486679,
-0.9069406986236572,
-0.30532121658325195,
0.8670396208763123,
... |
def update _ target _ network ( self ) : alpha = self. target _ update _ alpha actor _ weights = np. array ( self. actor _ network. get _ weights ( ) ) actor _ tartget _ weights = np. array ( self. actor _ old _ network. get _ weights ( ) ) new _ weights = alpha * actor _ weights + ( 1 - alpha ) * actor _ tartget _ wei... | [
-1.184809923171997,
-1.8404122591018677,
0.6804999113082886,
-0.5361990332603455,
0.5512614250183105,
0.3983021378517151,
0.3569939434528351,
0.8107823729515076,
-0.06359654664993286,
0.24513575434684753,
0.733810305595398,
1.087988018989563,
0.1911654770374298,
0.4327443838119507,
-0.05... |
def download ( ) : app. logger. info ( " download called " ) data = request. get _ json ( force = true ) return post _ download ( data ) | [
0.08590909838676453,
-0.218257337808609,
0.6253219842910767,
1.0195810794830322,
0.08987291157245636,
-0.7542535066604614,
-0.8019232749938965,
-0.47195786237716675,
-0.26464375853538513,
-0.08679326623678207,
-0.45709672570228577,
0.49067214131355286,
-0.2920147776603699,
0.04934688284993... |
def dft ( x : list [ float ] ) - > numpy. ndarray : return numpy. abs ( scipy _ fft. fft ( x ) ) | [
-0.36599668860435486,
0.7429825067520142,
0.44509458541870117,
0.22592639923095703,
0.9272404909133911,
0.2515861392021179,
-1.2519097328186035,
-0.47411003708839417,
0.42422547936439514,
-0.1352984607219696,
-0.264165461063385,
0.24528586864471436,
-0.0010012909770011902,
1.28068542480468... |
def get _ city _ error ( self ) - > str : logging. info ( " get error message from'city'field. " ) return self. driver. find _ element ( * addaddresslocators. city _ error ). text | [
-0.15669943392276764,
0.12009228765964508,
0.25252091884613037,
-0.07768792659044266,
-0.16229674220085144,
0.39540284872055054,
0.3558730483055115,
-0.046292442828416824,
0.06970711052417755,
0.1952931433916092,
0.17052747309207916,
-0.16393473744392395,
-0.5050561428070068,
0.04974737763... |
def removebraces ( self, position, equation ) : eq = equation if position! = - 1 : eq = equation [ : position ] stack = 0 for i in equation [ position : ] : if ( i = ='(') and ( stack! = - 1 ) : stack + = 1 eq + = i # print i, stack, eq elif ( i = =')') and ( stack! = - 1 ) : stack - = 1 if stack = = 0 : # if the curre... | [
0.511737048625946,
0.4114106595516205,
0.9041915535926819,
0.5156227946281433,
-0.5991436243057251,
-0.6030678749084473,
1.395196557044983,
-0.08252527564764023,
0.22200898826122284,
1.2748749256134033,
-0.6509650945663452,
-0.4143557846546173,
-2.0152599811553955,
-0.2456105798482895,
0... |
def _ validate _ next _ parameter ( request, next ) : parsed = urlparse. urlparse ( next ) if parsed and parsed. path : return parsed. path return none | [
-0.1747538298368454,
-0.13721702992916107,
0.600489616394043,
-0.09453964233398438,
-0.06826040148735046,
0.3311220407485962,
-0.05957484617829323,
-0.18841998279094696,
0.1567719578742981,
-0.3818753957748413,
1.0680979490280151,
0.06426031142473221,
-0.8035739660263062,
0.855369031429290... |
def get _ state _ current _ population ( state ) : config = dotenv _ values ( '.. /.. /.. /. env') fred = fred ( api _ key = config ['fred _ api _ key'] ) state _ code = state. upper ( ) population = fred. get _ series ( f'{ state _ code } pop') return population. iloc [ - 1 ] * 1000 | [
-1.5604442358016968,
0.389575719833374,
0.4939829111099243,
-0.2243502140045166,
0.8367481827735901,
-0.4093656539916992,
0.5416173338890076,
-0.5784383416175842,
0.08536095172166824,
1.073885440826416,
-0.11140334606170654,
0.3072371780872345,
0.3852010667324066,
-0.1551511138677597,
0.... |
def _ calc _ img _ weights ( roidbs ) : imgs _ cls = [ ] num _ per _ cls = { } img _ weights = [ ] for i, roidb in enumerate ( roidbs ) : img _ cls = set ( [ k for cls in roidbs [ i ] ['gt _ class'] for k in cls ] ) imgs _ cls. append ( img _ cls ) for c in img _ cls : if c not in num _ per _ cls : num _ per _ cls [ c ... | [
-1.069758415222168,
-0.28734642267227173,
0.8363757729530334,
0.13386350870132446,
0.45121437311172485,
-0.08584556728601456,
1.1535049676895142,
0.27295583486557007,
-0.34110918641090393,
1.1586560010910034,
-0.2279660999774933,
-0.3313676118850708,
-0.1852072924375534,
1.541908621788025,... |
def paint ( self, surface ) : pass | [
-0.22161370515823364,
-0.2508350908756256,
0.2680108845233917,
0.5562750697135925,
0.09349628537893295,
1.1689887046813965,
1.2304178476333618,
-0.012599993497133255,
0.017035135999321938,
-1.2116788625717163,
0.12306729704141617,
0.501499354839325,
-0.9831761121749878,
1.7037307024002075,... |
def feed ( ) : feed = create _ feed ( ) return feed. get _ response ( ) | [
0.5344193577766418,
-0.43631792068481445,
0.09005912393331528,
0.3081657588481903,
1.0714194774627686,
-1.2274284362792969,
-1.0605109930038452,
-1.1185178756713867,
-0.43861865997314453,
-1.4965131282806396,
-0.4725033640861511,
0.8976583480834961,
-0.8761938214302063,
-1.0292632579803467... |
def learn _ and _ forward ( self, dpid, inport, packet, buf, bufid ) : # initial hub behavior : flood packet out everything but input port. # comment out the line below when starting the exercise. self. send _ openflow ( dpid, bufid, buf, openflow. ofpp _ flood, inport ) # starter psuedocode for learning switch exercis... | [
0.06773095577955246,
-0.11271462589502335,
0.5343977808952332,
-0.18882809579372406,
0.2435806691646576,
0.3967234790325165,
0.7986038327217102,
0.012576030567288399,
0.8690629005432129,
-1.220632553100586,
-0.0017059051897376776,
0.4635848104953766,
0.560428261756897,
-0.13868515193462372... |
def scheduletasks ( self, options, tickets ) : | [
0.10590081661939621,
0.10761982202529907,
0.32886284589767456,
1.4404878616333008,
0.41174790263175964,
-0.008655558340251446,
0.7524971961975098,
0.9114102721214294,
0.2972111999988556,
-0.18553392589092255,
-0.8912070393562317,
-1.2822858095169067,
-0.22825777530670166,
-0.36788478493690... |
def current _ symbol ( self ) : if self. head _ pos < 0 or self. head _ pos > len ( self. contents ) - 1 : return self. blank return self. contents [ self. head _ pos ] | [
-1.3775728940963745,
-1.188499093055725,
0.6447089314460754,
-0.6100305914878845,
0.32159945368766785,
-0.16677924990653992,
0.8806304931640625,
-1.2576842308044434,
-0.25534889101982117,
-0.2542998492717743,
0.516334056854248,
0.753000795841217,
-0.35647374391555786,
-0.02392037957906723,... |
def _ create _ delete _ ro _ access _ rule ( self, version ) : if utils. is _ microversion _ eq ( version,'1. 0') : rule = self. shares _ client. create _ access _ rule ( self. share [ " id " ], self. access _ type, self. access _ to,'ro') else : rule = self. shares _ v2 _ client. create _ access _ rule ( self. share [... | [
0.5622887015342712,
-0.6707029938697815,
0.749383807182312,
-0.6901715397834778,
0.6329805850982666,
-0.01030696090310812,
0.8486823439598083,
0.4220374524593353,
-0.4304387867450714,
0.33545681834220886,
0.8978030681610107,
0.6189232468605042,
0.15268263220787048,
-0.25256824493408203,
... |
def getidtable ( self ) : return self. _ _ idtable | [
0.6762088537216187,
-0.5017619729042053,
0.31372663378715515,
0.006246298551559448,
0.06638041138648987,
0.8995072841644287,
0.7254349589347839,
-0.5210257768630981,
0.1491277664899826,
-0.5574591755867004,
-0.5491856336593628,
0.6192550659179688,
-1.2619497776031494,
-0.6815564632415771,
... |
def max ( self ) - > dataframe : if self. downsample : return wrap _ df ( self. _ df. downsample ( self. by, self. rule, self. n, " max " ) ) return wrap _ df ( self. _ df. groupby ( self. by, self. selection, " max " ) ) | [
-0.37587815523147583,
0.43134286999702454,
0.34120792150497437,
0.6082936525344849,
0.17159681022167206,
-0.8208847045898438,
-0.014841101132333279,
-0.26503050327301025,
0.20413970947265625,
-0.12914912402629852,
1.4995037317276,
0.8212847709655762,
0.03824577108025551,
-0.741457819938659... |
def _ marshaled _ single _ dispatch ( self, request, dispatch _ method = none ) : method = request. get ('method') params = request. get ('params') # prepare a request - specific configuration if'jsonrpc'not in request and self. json _ config. version > = 2 : # json - rpc 1. 0 request on a json - rpc 2. 0 # = > compati... | [
-0.1538442075252533,
-0.00972719956189394,
1.1327098608016968,
-0.0076719312928617,
0.06270812451839447,
-0.640921413898468,
-0.08151041716337204,
-0.9420087933540344,
0.585940420627594,
0.028153007850050926,
0.026455314829945564,
0.5284048318862915,
-0.31146666407585144,
0.544353306293487... |
def rotate ( self, steps = 1, direction = 1, rpm = none, step _ type = 0 ) : # while there is another process goin on sleep for 0. 001s # while len ( self. status )! = 0 : # time. sleep ( 0. 001 ) if self. busy : raise exception return self. status. append ( 1 ) self. busy = true # direction analysis self. direction = ... | [
-0.11467176675796509,
0.02440381608903408,
0.5988165736198425,
0.011367100290954113,
0.380852073431015,
-0.2699732184410095,
0.15333575010299683,
-0.1486792117357254,
-0.4200565814971924,
-0.986638069152832,
0.043867114931344986,
-0.10920693725347519,
-1.2199363708496094,
0.736304044723510... |
def _ update _ proxy ( self, change ) : if change ['name'] = ='data'and change ['type'] = ='container': self. proxy. update _ data ( change ) else : super ( dataset, self ). _ update _ proxy ( change ) | [
-0.8444550633430481,
0.2845180928707123,
0.44496405124664307,
-0.5677672624588013,
-0.3806086480617523,
-0.44805657863616943,
-0.7263140678405762,
-0.023434346541762352,
0.45986098051071167,
-0.06577979028224945,
0.46212583780288696,
1.0088883638381958,
-0.055244624614715576,
0.95718252658... |
def put ( id : int, options : dict ) : return request ( " put ", f " groups / { id } ", dumps ( options ) ) | [
-1.6803905963897705,
0.5676860213279724,
0.3336661458015442,
-0.5461513996124268,
0.20602476596832275,
-0.19913916289806366,
-0.23295876383781433,
-1.282164216041565,
0.05741940811276436,
-0.2081855982542038,
-0.2986845076084137,
0.574770987033844,
-1.6853069067001343,
-0.6724615693092346,... |
def read _ stw105 ( ) : stw105 = np. loadtxt ( get _ data ( " stw105. txt " ), dtype = np. float ) stw105 _ iso = np. zeros ( ( stw105. shape [ 0 ], 4 ) ) for index, row in enumerate ( stw105 [ : : - 1, : ] ) : depth = ( 6371000 - row [ 0 ] ) / 1000 rho = row [ 1 ] / 1000 vpv, vsv = row [ 2 ] / 1000, row [ 3 ] / 1000 v... | [
0.04141272231936455,
-0.2868903875350952,
0.7067140340805054,
-0.08970587700605392,
-0.3751984238624573,
0.5929907560348511,
0.9883924126625061,
0.5203327536582947,
-0.9259961247444153,
1.0888655185699463,
-0.9473438858985901,
0.3832213580608368,
-0.6403154730796814,
-0.1422576904296875,
... |
def getname ( self ) : return self. _ _ name | [
-0.6084238290786743,
-1.473409652709961,
0.47882524132728577,
-0.36268770694732666,
-0.42803794145584106,
0.6401790976524353,
0.2086898684501648,
-0.548409640789032,
0.1128849908709526,
-0.18862822651863098,
-0.4940372109413147,
0.2678069472312927,
0.24317312240600586,
-0.22250236570835114... |
def calc _ matrix ( ) : # reading the data file data = open ( data _ file,'r') reader = csv. reader ( data, delimiter = ',') # two unnecessary lines reader. next ( ) reader. next ( ) # opening the output file output = open ( matrix _ file,'wb') for row, i in enumerate ( reader ) : # parsing the two points points = [ po... | [
0.1139141097664833,
-0.7309535145759583,
0.822729229927063,
-0.2313695251941681,
-0.14713159203529358,
0.1850387156009674,
0.3966156244277954,
-0.041040629148483276,
0.09624794125556946,
0.687761664390564,
-0.25711485743522644,
-0.4979795515537262,
0.565329372882843,
-0.35339275002479553,
... |
def url _ for ( self, version, * * kwargs ) : data = self. data _ for ( version, * * kwargs ) return data ['url'] if data else none | [
-0.6582046747207642,
-0.3001689016819,
0.2587087154388428,
0.08759880065917969,
0.11256413906812668,
-0.2132064551115036,
-0.7595701217651367,
0.15033994615077972,
-0.6472641825675964,
-0.2035212218761444,
-0.314808189868927,
0.21402588486671448,
0.19001783430576324,
-0.022996600717306137,... |
def liveronly _ label _ processor ( img, seg ) : seg [ seg = = 2 ] = 1 return img, seg | [
-1.2620816230773926,
-1.029655933380127,
0.22139336168766022,
-0.5116084814071655,
0.4152318239212036,
0.49757951498031616,
-0.11486434936523438,
1.090364694595337,
0.8715294003486633,
0.489230751991272,
-0.3986734449863434,
0.31624048948287964,
-0.005424987059086561,
0.1475178748369217,
... |
def _ getfeatures ( self, indices ) : featurelist = self. featurelist featurerecords = featurelist. featurerecord features = [ featurerecords [ index ] for index in sorted ( indices ) ] return features | [
-0.8259682059288025,
-0.19808459281921387,
0.17080380022525787,
0.36170414090156555,
0.5779687762260437,
-0.8444016575813293,
-0.33208534121513367,
0.032442621886730194,
0.262246310710907,
0.09834835678339005,
-0.6665533185005188,
0.3825138211250305,
-0.6531835794448853,
-0.378726541996002... |
def test _ write _ queue _ submit _ script ( self ) : self. job _ 4. number _ of _ processes, self. job _ 4. workers = 1, none self. job _ 4. write _ submit _ script ( ) with open ( os. path. join ( self. job _ 4. local _ path, submit _ filenames [ servers [ self. job _ 4. server ] ['cluster _ soft'] ] ),'r') as f : li... | [
0.10645110160112381,
-0.7987433671951294,
0.5447638630867004,
0.3382258117198944,
0.7308281064033508,
0.3693934381008148,
0.3746553063392639,
-0.6081412434577942,
-1.109611988067627,
-0.008485742844641209,
-0.1926126629114151,
0.9172060489654541,
-0.4154195189476013,
0.7572712898254395,
... |
def print _ agents ( log, barreleye _ instance, agents, status = false, print _ table = true, field _ string = none ) : # pylint : disable = too - many - branches, too - many - locals, too - many - statements if not print _ table and len ( agents ) > 1 : log. cl _ error ( " failed to print non - table output with multi... | [
0.10359504818916321,
0.1167929396033287,
0.7678863406181335,
0.19266676902770996,
-0.09681032598018646,
-0.6034398078918457,
-0.07384703308343887,
0.3733491897583008,
-0.5608107447624207,
0.567966103553772,
-0.023530486971139908,
0.29535648226737976,
-0.29189783334732056,
0.533033430576324... |
def cone ( self, origin, direction, length = 1 ) : result = self. slice ( origin, direction, length ) result. extend ( self. slice ( origin, ( direction + 1 ) % 6, length ) ) return filter ( self. valid _ cell, set ( result ) ) | [
-0.47681695222854614,
-0.5118995904922485,
0.44716307520866394,
1.109963297843933,
-0.7460968494415283,
-0.7874240279197693,
-0.5388158559799194,
0.3652493953704834,
0.1466912031173706,
0.3727967143058777,
-0.5272800922393799,
0.05692401900887489,
-0.33455362915992737,
-0.9063372015953064,... |
def _ _ virtual _ _ ( ) : if " splunk. list _ users " in _ _ salt _ _ : return " splunk " return ( false, " splunk module could not be loaded " ) | [
0.32227209210395813,
-0.0741686075925827,
0.49115440249443054,
0.47345197200775146,
-0.2885691225528717,
1.1971708536148071,
-0.08968517929315567,
0.36354130506515503,
0.7341741919517517,
0.5547470450401306,
0.022750124335289,
0.8956148028373718,
-0.7079216241836548,
0.3516322672367096,
... |
def heatmap _ state ( df, cols, legend, color ='ylgn') : url ='https : / / raw. githubusercontent. com / python - visualization / folium / master / examples / data'state _ geo = f'{ url } / us - states. json'm = folium. map ( location = [ 48, - 102 ], zoom _ start = 3 ) folium. choropleth ( geo _ data = state _ geo, na... | [
0.25401318073272705,
0.013790743425488472,
0.4526352882385254,
-0.5059136748313904,
0.12072460353374481,
0.05894330143928528,
-0.3201208710670471,
0.9239502549171448,
0.8296670913696289,
-0.19910076260566711,
-0.567997932434082,
0.738592267036438,
0.9393162727355957,
-0.6558914184570312,
... |
def pathtest ( step _ input _ filename, reffile, comparison _ filename, writefile = true, show _ figs = true, save _ figs = false, threshold _ diff = 1. 0e - 7, debug = false ) : log _ msgs = [ ] # start the timer pathtest _ start _ time = time. time ( ) # get info from the rate file header msg ='step _ input _ filenam... | [
0.521795392036438,
0.22145546972751617,
0.9666695594787598,
0.27227815985679626,
0.646771252155304,
0.4365042448043823,
0.8501909375190735,
-0.32348787784576416,
-0.3788331151008606,
-0.5150830745697021,
0.5492327809333801,
0.11469350010156631,
-0.8052332401275635,
0.8403559923171997,
-0... |
def record _ holder ( self ) : return reduce ( lambda a1, a2 : a1 if self. _ players [ a1 ]. points > self. _ players [ a2 ]. points else a2, self. _ players ) | [
0.17329588532447815,
-0.6512086391448975,
0.38595151901245117,
-0.04842255264520645,
0.895127534866333,
0.3084884583950043,
-0.2649509906768799,
-0.19125713407993317,
-0.6322382688522339,
0.5232235789299011,
0.6993436813354492,
0.5894781947135925,
-0.9324122667312622,
-0.6859349012374878,
... |
def supprimerdossier ( ftp, dossier _ chemin, dossier _ nom ) : try : ftp. cwd ( dossier _ chemin ) ftp. cwd ( dossier _ nom ) liste _ sous _ dossiers = listerdossiers ( ftp ) liste _ fichiers = listerfichiers ( ftp ) print ( liste _ fichiers + liste _ sous _ dossiers ) if ( not liste _ sous _ dossiers and not liste _ ... | [
0.0888722687959671,
-0.005903015844523907,
0.866354763507843,
-0.174818754196167,
-0.05749650299549103,
0.570989727973938,
-0.11544711887836456,
0.1924964189529419,
-0.48332566022872925,
0.15174295008182526,
0.03362871706485748,
0.3983655571937561,
-0.2631692588329315,
1.229935884475708,
... |
def train ( self, x, y ) : # todo : check if one training point will work... if not raise error " " " self. x = [ ] self. y = [ ] for ins, out in zip ( x, y ) : if ins not in self. x : self. x. append ( ins ) self. y. append ( out ) else : " duplicate training point " " " " self. x = x self. y = y self. m = len ( x [ 0... | [
-0.4857983887195587,
-0.23815326392650604,
0.5138490796089172,
0.2593218982219696,
-0.3036157190799713,
-0.31092411279678345,
-0.40919414162635803,
0.14319995045661926,
0.2073346972465515,
-0.1530178338289261,
-0.5106240510940552,
0.5435519218444824,
-0.11231136322021484,
0.316462755203247... |
def gems ( ) : roll = d. hundred ( ) if roll < = 25 : gem _ list = ['banded eye ','moss agate ','azurite ','blue quartz ','hematite ','lapis lazuli ','malachite ','obsidian ','rhodochrosite ','tiger eye ','turquoise ','pearl ( freshwater irregular )'] gem = r. choice ( gem _ list ) return gem elif roll < = 50 : gem _ l... | [
-0.4626865088939667,
-0.19303956627845764,
0.9426752924919128,
-0.43342262506484985,
-0.7642838954925537,
0.3898448348045349,
0.35253509879112244,
-0.5517526865005493,
0.1755708009004593,
0.7121797204017639,
-0.3476935923099518,
1.0935604572296143,
0.9310386180877686,
-0.00439224811270833,... |
def high _ pass _ isoenergy ( self, sigma = none, truncate = 2. 0 ) : print ('applying high pass filter to each energy slice...') if sigma is not none : self. sigma _ highpass = sigma lp = skfilt. gaussian ( self. processed, sigma = ( 0, self. sigma _ highpass, self. sigma _ highpass ), preserve _ range = true, truncat... | [
0.501452624797821,
-0.17815320193767548,
0.5591325163841248,
1.5526257753372192,
0.19195561110973358,
0.0835442915558815,
0.4788813292980194,
1.1967391967773438,
-0.3039184510707855,
0.4999166429042816,
0.258366197347641,
0.6663572788238525,
0.10956481099128723,
0.017509393393993378,
-0.... |
def _ _ setitem _ _ ( self, name, value ) : if self. _ readonly : raise readonlyerror, read _ only _ message node = self. _ findbyid ( self. _ tree, name ) if hasattr ( value,'_ tree') and value. _ tree is node : return # x [ " y " ] = x. y if node : self. _ replacenodecontent ( node, value ) return raise keyerror, " n... | [
-0.6073926091194153,
0.41424494981765747,
0.47845059633255005,
-0.2820015549659729,
-0.9191523790359497,
-0.2514907121658325,
-0.059028297662734985,
-0.6561458706855774,
-0.2875051200389862,
0.9096361398696899,
-0.5131953954696655,
0.44505220651626587,
0.08093302696943283,
0.20307351648807... |
def _ get _ blueprint _ allocation ( self, name ) : apps = self. client. get _ applications _ metadata ( ) for app in apps : if app. blueprintname = = name : return app. numstartedvms else : return - 1 | [
-0.684066891670227,
-0.5410810708999634,
0.8814061880111694,
0.2548236548900604,
0.3538886606693268,
-0.02523771859705448,
0.2932160198688507,
0.08747946470975876,
0.08446212857961655,
0.7601093053817749,
0.5620076060295105,
0.7184543609619141,
-0.5499840378761292,
-0.1718955785036087,
0... |
def adddocumentprivateattributes ( self, doclist, collectionname, styletype = " rowwise _ by _ name " ) : if styletype not in [ " rowwise _ by _ name ", " rowwise _ by _ name _ with _ cardinality " ] : logger. error ( " unsupported document style % s ", styletype ) return doclist try : doc = { } privdockeyl = self. _ _... | [
-1.6651660203933716,
-0.4694529175758362,
0.6999025344848633,
0.06933501362800598,
-0.7166929841041565,
-0.11959398537874222,
-0.6018021702766418,
-0.7025102376937866,
0.34530404210090637,
0.8436979651451111,
-0.40719643235206604,
-0.13158921897411346,
-0.6109996438026428,
1.01375401020050... |
def save ( self ) : self. updated _ at = datetime. now ( ) models. storage. save ( ) | [
-0.7335155010223389,
-1.2561289072036743,
0.31488725543022156,
0.22556275129318237,
0.9472505450248718,
0.960083544254303,
-0.5426222085952759,
0.42659586668014526,
-0.7169128656387329,
0.43560341000556946,
-1.5942556858062744,
-0.9055356383323669,
0.22724349796772003,
0.297058641910553,
... |
def _ prepare _ notification _ data ( self, ev, result ) : agent _ info = ev. data ['context'] context = agent _ info ['context'] # retrieve notification and remove it from context. context is used # as transport from batch processing function to this last event # processing function. to keep the context unchanged, del... | [
-0.2827015221118927,
-0.2082558572292328,
0.7091741561889648,
-0.3759053349494934,
-0.07234891504049301,
-0.5942779183387756,
-0.46728402376174927,
-0.40846630930900574,
0.3787795901298523,
0.6140933632850647,
-0.3343997597694397,
-0.16464319825172424,
0.8043737411499023,
0.208048909902572... |
def _ _ call _ _ ( self, batch _ size ) : sliced _ data = super ( cacheddatareader, self ). _ _ call _ _ ( batch _ size ) # we need to make sure we read the cached batch before we update it! with tf. control _ dependencies ( self. _ cached _ batch ) : batch _ size _ assign _ op = self. _ cached _ batch _ size. assign (... | [
-0.9182092547416687,
-0.4883771538734436,
0.6155608296394348,
0.6723324656486511,
-0.165630504488945,
-0.1296640783548355,
0.048162516206502914,
0.12308456003665924,
0.5110070705413818,
0.017541322857141495,
-1.1935608386993408,
-0.0012249971041455865,
0.79517662525177,
0.02741117402911186... |
def test _ avg _ score ( my _ team ) : score = average _ score ( my _ team ) assert set ( score. keys ( ) ) = = set ( range ( 5 ) ) for v in score. values ( ) : assert 0. < = v < = 1. | [
-0.37460675835609436,
0.49783003330230713,
0.2883595824241638,
-0.10130453109741211,
0.457015722990036,
0.3736804127693176,
0.11754266917705536,
-0.9786440134048462,
-0.5829856395721436,
0.8692670464515686,
-0.45932725071907043,
-0.20865364372730255,
-0.269052118062973,
0.07124931365251541... |
def _ _ init _ _ ( _ _ self _ _, *, principal _ id : str, tenant _ id : str, type : optional [ str ] = none, user _ assigned _ identities : optional [ mapping [ str,'outputs. userassignedidentityresponse'] ] = none ) : pulumi. set ( _ _ self _ _, " principal _ id ", principal _ id ) pulumi. set ( _ _ self _ _, " tenant... | [
0.14517472684383392,
-0.4142944812774658,
0.540533185005188,
0.33189311623573303,
0.969759464263916,
0.5930259823799133,
-0.22986145317554474,
-0.15108659863471985,
0.4113609194755554,
0.14193187654018402,
-0.8704637289047241,
0.8229557871818542,
0.553065299987793,
-0.7918161749839783,
-... |
def outer ( self, other _ vec ) : assert type ( other _ vec ) = = vector,'incompatible vector'dimension = self. dimension * other _ vec. dimension elements = np. zeros ( dimension, dtype = complex ) for i, element in enumerate ( self. elements ) : for j, other _ element in enumerate ( other _ vec. elements ) : elements... | [
-0.5578637719154358,
-0.09599746018648148,
0.9508964419364929,
0.153343066573143,
-0.3819374740123749,
0.21677207946777344,
1.0014625787734985,
-0.23105186223983765,
0.462997168302536,
-0.6377395391464233,
0.10230757296085358,
0.7199661135673523,
-0.15255337953567505,
0.22075948119163513,
... |
def reshape ( self, bottom, top ) : pass | [
-0.9398985505104065,
-0.030227024108171463,
0.4302726089954376,
0.3850257098674774,
1.1418395042419434,
-1.1848200559616089,
-0.5755351781845093,
0.3725254237651825,
-0.939808189868927,
-0.6774216294288635,
-0.15250946581363678,
0.34905102849006653,
-0.4320928454399109,
-1.2791107892990112... |
def is _ stream ( self, stream _ name : str ) - > bool : return self. rawdata. nosql. is _ stream ( stream _ name ) | [
0.10623831301927567,
0.6483868956565857,
0.4436759948730469,
0.42588114738464355,
-0.11783603578805923,
-0.11482366919517517,
-0.6545338034629822,
-0.4865029454231262,
0.7527740001678467,
-0.07674578577280045,
-0.7277650237083435,
1.055122971534729,
-0.27774378657341003,
0.4701761901378631... |
def send _ int ( self, integer ) : # packing and sending integer packed _ int = pack ( int _ fmt, integer ) sentbytes = self. _ sendall ( packed _ int ) return sentbytes | [
-1.1387799978256226,
0.4832528233528137,
0.3896387815475464,
-0.16623811423778534,
-0.8762332797050476,
-0.08637525886297226,
-0.3298753798007965,
-1.518933892250061,
0.6695349216461182,
0.4195743203163147,
-1.3420671224594116,
0.33899617195129395,
-1.0647414922714233,
1.3556691408157349,
... |
def integration _ time ( self, it = none ) : if it is not none : ii = { self. atime [ k ] : k for k in self. atime. keys ( ) } if it not in ii : raise attributeerror ('integration time must be one of { } '. \ format ( sorted ( ii. keys ( ) ) ) ) self. _ write ( 0x01, ii [ it ] ) tmp = self. _ read ( 0x01 ) self. _ it =... | [
-0.5457049608230591,
0.39454126358032227,
0.5608067512512207,
-0.42056596279144287,
-0.040310006588697433,
-0.13680247962474823,
0.2598428726196289,
-0.5265939831733704,
-0.06342428922653198,
0.7629756927490234,
-0.5574755072593689,
-0.34330615401268005,
-0.9680374264717102,
-0.26941937208... |
def filter _ pre _ tags ( tags, input _ ids, exclude _ token _ ids ) : # filter by tokens (,, tokens should be allocated as'o'in bert ) for i, cur _ ids in enumerate ( input _ ids ) : for j, idx in enumerate ( cur _ ids ) : if idx in exclude _ token _ ids : tags [ i ] [ j ] = pre _ tag2idx ['o'] # filter by tags tags _... | [
-0.28482306003570557,
-0.17313210666179657,
0.5961417555809021,
0.04183273762464523,
-0.9932951331138611,
0.3140096068382263,
0.18184401094913483,
-0.04934750124812126,
-0.2990233302116394,
0.6759351491928101,
-0.12049049884080887,
1.1474756002426147,
-0.2600898742675781,
-0.41218397021293... |
def get _ possible _ references ( self, _ force = none ) : raise exception ( " this source does not support listing references. " ) | [
-0.8874582648277283,
0.3999703526496887,
0.45923858880996704,
0.7768325209617615,
0.5406647324562073,
0.1850491166114807,
-0.48756304383277893,
-0.07807324826717377,
0.11864721029996872,
-0.4070082902908325,
-0.6215676069259644,
1.0163215398788452,
-0.8256170749664307,
0.7855430841445923,
... |
def test _ set _ cpu _ and _ mem ( self ) : # htcondor self. job _ 4. cpu _ cores = none self. job _ 4. set _ cpu _ and _ mem ( ) self. assertequal ( self. job _ 4. cpu _ cores, 8 ) expected _ memory = math. ceil ( ( 14 * 1024 * 1. 1 ) ) self. assertequal ( self. job _ 4. submit _ script _ memory, expected _ memory ) #... | [
0.41325071454048157,
0.16837021708488464,
0.6217146515846252,
-0.10288891941308975,
0.041905518621206284,
-0.06267156451940536,
0.34191492199897766,
0.22385679185390472,
-0.5809441208839417,
-0.4097602069377899,
-0.5814517140388489,
0.9869137406349182,
-0.9371154308319092,
0.92948853969573... |
def fib ( cv = 1, lv = 0 ) : if cv is none : cv = 1 if lv is none : lv = 0 return cv + lv | [
0.9189350008964539,
-0.05140356719493866,
0.5104143023490906,
1.197945237159729,
0.7674063444137573,
-0.06646449863910675,
-0.4647483825683594,
0.3167929947376251,
0.4704054892063141,
-0.6000425219535828,
-0.4709157645702362,
0.3266311287879944,
-0.5571069717407227,
0.7611045837402344,
-... |
def delete _ sent _ message ( conn : sqlite3. connection, sent _ timestamp ) : with conn : conn. execute ('delete from sentmessage where sent _ timestamp =? ', ( sent _ timestamp, ) ) | [
0.2818475067615509,
-0.3138038218021393,
0.4676855504512787,
-0.25656408071517944,
0.4782286286354065,
-0.7222414612770081,
-0.08537332713603973,
-0.6253487467765808,
0.08084686845541,
0.8799209594726562,
-0.37806689739227295,
-0.1812557429075241,
-0.6033306121826172,
-0.05235704407095909,... |
def int _ to _ flux ( intensity : float, wavelength : float ) - > float : e = 1000 * 1. 24 / wavelength intm2 = intensity * 10000 fluxm2s = intm2 / ( 1. 60218e - 19 * e ) fluxnm2s = fluxm2s * 1e - 18 fluxnm2ms = fluxnm2s * 1e - 3 return fluxnm2ms | [
0.6177704334259033,
-0.5121837854385376,
0.2182234525680542,
-0.8422866463661194,
0.04877961426973343,
-0.9576770067214966,
-0.41442716121673584,
-0.8890025615692139,
-0.010237795300781727,
-0.18394064903259277,
-0.5669207572937012,
0.3854639530181885,
-0.5524712204933167,
0.69536769390106... |
def check _ date ( year _ month _ day ) : # year _ month _ day = j _ now j _ now = year _ month _ day. split ('-') y, m, d = int ( j _ now [ 0 ] ), int ( j _ now [ 1 ] ), int ( j _ now [ 2 ] ) j _ now = date ( y, m, d ) now = date. today ( ) if j _ now = = now : return true else : return false | [
-0.2093460112810135,
-0.5594284534454346,
0.8415655493736267,
0.43233850598335266,
-0.5133152604103088,
0.5746476054191589,
-0.4197928011417389,
-0.2260923534631729,
-0.6893993616104126,
-0.24483998119831085,
-0.1404195874929428,
0.21892975270748138,
-0.3164486289024353,
0.4565639495849609... |
def get _ variable _ by _ id ( variable _ id ) : " " " example variable _ id = 3409643000002275025 " " " # get instance of variablesoperations class variables _ operations = variablesoperations ( ) # get instance of parametermap class param _ instance = parametermap ( ) # possible parameters of get variable by id opera... | [
0.045518919825553894,
-0.6014779806137085,
0.8816908597946167,
-0.37093597650527954,
0.5183270573616028,
-0.6809989213943481,
0.551773726940155,
-0.6977351307868958,
-0.1215483620762825,
0.3582945168018341,
-0.2883034348487854,
1.0693730115890503,
-0.7137911915779114,
0.2553652822971344,
... |
def sender _ id ( self ) : warnings. warn ( "'sender _ id'is deprecated. ", deprecationwarning, stacklevel = 2 ) return self. user _ id | [
0.6089470386505127,
0.05759558081626892,
0.2985253632068634,
0.7704211473464966,
-0.2975483536720276,
-0.2417546659708023,
0.07601284235715866,
0.26962441205978394,
-0.23106370866298676,
-0.15976330637931824,
-0.7796480655670166,
0.24153991043567657,
-0.05039259046316147,
0.853617072105407... |
def get _ position ( self, find _ cell ) : pos _ tuple = np. where ( self. maze = = self. maze _ dict [ find _ cell ] ) return pos _ tuple [ 0 ] [ 0 ], pos _ tuple [ 1 ] [ 0 ], pos _ tuple [ 2 ] [ 0 ] | [
-0.7247836589813232,
0.05703267455101013,
0.4411906898021698,
0.6031126379966736,
0.9984777569770813,
-0.593860387802124,
0.7220668792724609,
0.33753901720046997,
-1.2114638090133667,
1.4339473247528076,
-0.879701554775238,
-1.3633967638015747,
-0.9181564450263977,
-0.122656911611557,
0.... |
def dice _ index2 ( batch _ output, batch _ target ) : smooth = epsilon if torch. is _ tensor ( batch _ output ) : batch _ output = batch _ output. data. cpu ( ). numpy ( ) if torch. is _ tensor ( batch _ target ) : batch _ target = batch _ target. data. cpu ( ). numpy ( ) size = batch _ output. shape [ 0 ] sum = 0. 0 ... | [
-0.038074344396591187,
-0.40147823095321655,
0.8663254976272583,
0.5713062882423401,
-0.43834903836250305,
0.30128759145736694,
1.0126837491989136,
0.4923610985279083,
-0.3911341428756714,
0.39851289987564087,
0.29810377955436707,
0.922549307346344,
0.17595957219600677,
0.06734731793403625... |
def option ( self ) - > optional [ str ] : return pulumi. get ( self, " option " ) | [
1.2183880805969238,
0.4085211753845215,
0.45698240399360657,
0.5595111846923828,
1.7280595302581787,
1.1066443920135498,
0.0798153355717659,
-0.5148206949234009,
0.9914715886116028,
0.43793874979019165,
0.6542584300041199,
0.25424039363861084,
0.3933653235435486,
-1.5224168300628662,
-1.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.