Search is not available for this dataset
id
int64
0
10.8M
vector
listlengths
1.54k
1.54k
ast_depth
int64
3
164
ast_data
stringlengths
297
510k
full_path
stringlengths
0
319
code
stringlengths
60
56.5k
15,001
[ -0.011734160594642162, -0.06635426729917526, 0.0363919734954834, 0.022396709769964218, 0.019578367471694946, 0.016920767724514008, 0.032105520367622375, 0.049551378935575485, 0.02760474756360054, -0.023832669481635094, -0.01956765167415142, -0.012527154758572578, -0.015484806150197983, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "provider", "annotation": null, "type_comment": null}}], "kwarg": ...
def update_provider(self, provider): self._provider = provider self._hmac = hmac.new(self._provider.secret_key.encode('utf-8'), digestmod=sha) if sha256: self._hmac_256 = hmac.new(self._provider.secret_key.encode('utf-8'), ...
15,002
[ -0.01115038525313139, 0.009352747350931168, 0.006461441051214933, -0.05440684035420418, 0.002930590184405446, -0.006461441051214933, -0.012866312637925148, -0.01903233677148819, -0.00892533641308546, 0.018768347799777985, 0.02765597216784954, 0.004082398489117622, 0.005672617349773645, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_plinalg(): #np.random.seed(10) V = np.random.rand(4, 100) V_path = os.path.join(my_path,'plinalg_A.txt') np.savetxt(V_path, V) v = np.random.rand(100) v_path = os.path.join(my_path, 'plinalg_b.txt') np.savetxt(v_path, v) Q, R = np.linalg.qr(V.T) S = np.diag(np.sign(np.diag(...
15,003
[ -0.02790568396449089, -0.014899314381182194, 0.029289772734045982, -0.029269417747855186, 0.03240397199988365, -0.039772212505340576, -0.0026028002612292767, 0.022165782749652863, -0.009149237535893917, 0.005938353948295116, -0.025890611112117767, -0.014237801544368267, -0.027763202786445618...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def add_auth(self, http_request, **kwargs): headers = http_request.headers if 'Date' not in headers: headers['Date'] = formatdate(usegmt=True) if self._provider.security_token: key = self._provider.security_token_header headers[key] = self._provider.security_t...
15,004
[ 0.0029077029321342707, -0.001988722011446953, 0.021310919895768166, -0.030707860365509987, 0.027771316468715668, -0.038636527955532074, -0.007629770785570145, 0.01895119622349739, 0.0010487657273188233, 0.015553195960819721, -0.04383840784430504, -0.02092287689447403, -0.04388035833835602, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def add_auth(self, http_request, **kwargs): headers = http_request.headers method = http_request.method auth_path = http_request.auth_path if 'Date' not in headers: headers['Date'] = formatdate(usegmt=True) if self._provider.security_token: key = self._pr...
15,005
[ -0.009768662974238396, -0.027555769309401512, 0.027616823092103004, -0.014154385775327682, 0.04802925884723663, -0.03435312956571579, -0.008807060308754444, 0.03146323561668396, 0.007229828275740147, -0.004507830832153559, -0.009478655643761158, -0.022488275542855263, -0.04383687302470207, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def add_auth(self, http_request, **kwargs): headers = http_request.headers if 'Date' not in headers: headers['Date'] = formatdate(usegmt=True) if self._provider.security_token: key = self._provider.security_token_header headers[key] = self._provider.security_...
15,006
[ 0.04579233378171921, 0.006773028988391161, -0.026567623019218445, 0.024207400158047676, 0.015997057780623436, 0.013727613724768162, -0.004049696493893862, 0.034031569957733154, 0.010822725482285023, -0.026406239718198776, -0.007342911325395107, 0.007700979243963957, -0.031469620764255524, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _sign(self, key, msg, hex=False): if not isinstance(key, bytes): key = key.encode('utf-8') if hex: sig = hmac.new(key, msg.encode('utf-8'), sha256).hexdigest() else: sig = hmac.new(key, msg.encode('utf-8'), sha256).digest() return sig
15,007
[ 0.014493712224066257, -0.04171149432659149, -0.04451252520084381, -0.015427390113472939, 0.009695044718682766, -0.04338342696428299, -0.01891239546239376, 0.027163496240973473, 0.017370741814374924, 0.026902936398983, -0.03469805791974068, -0.05054885894060135, -0.06088444963097572, -0.009...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def canonical_query_string(self, http_request): # POST requests pass parameters in through the # http_request.body field. if http_request.method == 'POST': return "" l = [] for param in sorted(http_request.params): value = boto.utils.get_utf8_value(http_re...
15,008
[ 0.0023822076618671417, -0.03264007344841957, -0.04540860280394554, -0.04301978647708893, -0.02159445360302925, -0.023571038618683815, -0.02116108499467373, 0.027439648285508156, 0.011542409658432007, 0.017968952655792236, -0.03447924926877022, -0.0914091244339943, -0.01643630675971508, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def query_string(self, http_request): parameter_names = sorted(http_request.params.keys()) pairs = [] for pname in parameter_names: pval = boto.utils.get_utf8_value(http_request.params[pname]) pairs.append(urllib.parse.quote(pname, safe='') + '=' + ...
15,009
[ 0.0034004354383796453, -0.02155865542590618, -0.03990954905748367, 0.01612212508916855, 0.039201345294713974, -0.026766059920191765, 0.044825341552495956, 0.016611620783805847, 0.05069929361343384, 0.051990728825330734, 0.008326640352606773, -0.020652567967772484, -0.026974357664585114, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def canonical_uri(self, http_request): path = http_request.auth_path # Normalize the path # in windows normpath('/') will be '\\' so we chane it back to '/' normalized = posixpath.normpath(path).replace('\\', '/') # Then urlencode whatever's left. encoded = urllib.parse.q...
15,010
[ 0.030636008828878403, -0.04191005975008011, 0.007694744039326906, -0.01284669991582632, 0.038315434008836746, -0.025918062776327133, -0.012448430992662907, 0.04574977234005928, 0.010855359025299549, -0.0333932489156723, 0.0007135636988095939, -0.01312242355197668, -0.04534129053354263, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def payload(self, http_request): body = http_request.body # If the body is a file like object, we can use # boto.utils.compute_hash, which will avoid reading # the entire body into memory. if hasattr(body, 'seek') and hasattr(body, 'read'): return boto.utils.compute_h...
15,011
[ -0.0045138997957110405, -0.05481046810746193, 0.08426672965288162, 0.019168389961123466, -0.03447473794221878, -0.015164520591497421, -0.05655602738261223, -0.024939635768532753, -0.014935416169464588, 0.025616038590669632, -0.01803377829492092, 0.03550025075674057, -0.019201120361685753, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "host", "annotation": null, "type_comment": null}}], "kwarg": null...
def determine_region_name(self, host): parts = self.split_host_parts(host) if self.region_name is not None: region_name = self.region_name elif len(parts) > 1: if parts[1] == 'us-gov': region_name = 'us-gov-west-1' else: if len(...
15,012
[ 0.0422944575548172, -0.02555241994559765, 0.021864084526896477, -0.03901079669594765, 0.01868448406457901, -0.025806786492466927, -0.017782634124159813, -0.04192446544766426, 0.01159108616411686, 0.04888489842414856, -0.014776467345654964, -0.012417782098054886, -0.038987673819065094, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def canonical_request(self, http_request): cr = [http_request.method.upper()] cr.append(self.canonical_uri(http_request)) cr.append(self.canonical_query_string(http_request)) headers_to_sign = self.headers_to_sign(http_request) cr.append(self.canonical_headers(headers_to_sign) + ...
15,013
[ 0.04347079619765282, -0.04882477596402168, 0.04635709896683693, -0.01615007221698761, 0.031440865248441696, -0.001476200413890183, -0.03159509599208832, 0.03155102953314781, 0.030383288860321045, 0.024037830531597137, 0.03657451644539833, -0.04794346168637276, -0.005615620408207178, 0.0021...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def credential_scope(self, http_request): scope = [] http_request.timestamp = http_request.headers['X-Amz-Date'][0:8] scope.append(http_request.timestamp) # The service_name and region_name either come from: # * The service_name/region_name attrs or (if these values are None) ...
15,014
[ 0.02354716695845127, -0.05385304614901543, 0.06256137788295746, -0.024283694103360176, 0.035288259387016296, -0.007202790584415197, -0.013030010275542736, 0.015120444819331169, 0.014882156625390053, -0.00405360059812665, 0.004744093399494886, -0.04744093492627144, -0.03149731457233429, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}, {"_typ...
def signature(self, http_request, string_to_sign): key = self._provider.secret_key k_date = self._sign(('AWS4' + key).encode('utf-8'), http_request.timestamp) k_region = self._sign(k_date, http_request.region_name) k_service = self._sign(k_region, http_request...
15,015
[ 0.04812609776854515, -0.013232492841780186, -0.020099850371479988, -0.01627858728170395, 0.019018979743123055, -0.02718556672334671, 0.011693068780004978, 0.0020266349893063307, 0.020460141822695732, 0.032928381115198135, 0.00935117993503809, -0.001871054875664413, -0.03513379767537117, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def canonical_uri(self, http_request): # S3 does **NOT** do path normalization that SigV4 typically does. # Urlencode the path, **NOT** ``auth_path`` (because vhosting). path = urllib.parse.urlparse(http_request.path) # Because some quoting may have already been applied, let's back it ou...
15,016
[ 0.0068959882482886314, -0.044386040419340134, -0.03779945522546768, -0.030709436163306236, -0.0014316386077553034, -0.039897095412015915, -0.02143787033855915, 0.017452357336878777, 0.0045597427524626255, 0.02144835889339447, -0.04188985005021095, -0.06498485803604126, -0.051853638142347336,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def canonical_query_string(self, http_request): # Note that we just do not return an empty string for # POST request. Query strings in url are included in canonical # query string. l = [] for param in sorted(http_request.params): value = boto.utils.get_utf8_value(http...
15,017
[ 0.03892682120203972, 0.007220297586172819, 0.0026270647067576647, 0.013603459112346172, 0.04987567663192749, -0.004078283905982971, -0.01825176551938057, 0.03923523798584938, 0.023968523368239403, 0.019121946766972542, 0.01770101860165596, -0.005766324233263731, -0.02874900959432125, 0.032...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}], "kwarg": {"_ty...
def add_auth(self, req, **kwargs): if 'x-amz-content-sha256' not in req.headers: if '_sha256' in req.headers: req.headers['x-amz-content-sha256'] = req.headers.pop('_sha256') else: req.headers['x-amz-content-sha256'] = self.payload(req) updated_req...
15,018
[ 0.022851642221212387, -0.07066181302070618, 0.055056944489479065, -0.012838130816817284, -0.004601584281772375, 0.007385687902569771, -0.03421958163380623, -0.017167672514915466, -0.015801668167114258, 0.04579589515924454, -0.008375462144613266, -0.00002064291766146198, -0.01387999951839447,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "host", "annotation": null, "type_comment": null}}], "kwarg": null...
def determine_region_name(self, host): # S3's different format(s) of representing region/service from the # rest of AWS makes this hurt too. # # Possible domain formats: # - s3.amazonaws.com (Classic) # - s3-us-west-2.amazonaws.com (Specific region) # - bukkit.s3....
15,019
[ 0.012429490685462952, -0.005275368690490723, 0.002408147556707263, -0.002116250805556774, 0.024943897500634193, -0.04419846087694168, -0.013087584637105465, 0.037553831934928894, -0.012344575487077236, 0.009483988396823406, -0.03608904406428337, -0.04141748324036598, -0.037511374801397324, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def add_auth(self, http_request, **kwargs): headers = http_request.headers qs = self._build_query_string( http_request.params ) boto.log.debug('query_string in body: %s' % qs) headers['Content-Type'] = 'application/x-www-form-urlencoded' # This will be a POST...
15,020
[ 0.011581272818148136, -0.009807204827666283, -0.02565421350300312, -0.048079222440719604, -0.03823215141892433, -0.016873575747013092, -0.04401282221078873, 0.044371623545885086, 0.004106268752366304, -0.004744135774672031, -0.058245230466127396, -0.05429842695593834, -0.020431676879525185, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _build_query_string(self, params): keys = list(params.keys()) keys.sort(key=lambda x: x.lower()) pairs = [] for key in keys: val = boto.utils.get_utf8_value(params[key]) pairs.append(key + '=' + self._escape_value(val.decode('utf-8'))) return '&'.join(...
15,021
[ 0.021580560132861137, -0.010203980840742588, 0.024186335504055023, -0.02473117969930172, -0.017257342115044594, -0.016522986814379692, -0.013301299884915352, 0.004181085620075464, 0.014639721252024174, -0.024565357714891434, -0.022385980933904648, -0.017328407615423203, -0.037002015858888626...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _calc_signature(self, params, *args): boto.log.debug('using _calc_signature_0') hmac = self._get_hmac() s = params['Action'] + params['Timestamp'] hmac.update(s.encode('utf-8')) keys = params.keys() keys.sort(cmp=lambda x, y: cmp(x.lower(), y.lower())) pairs =...
15,022
[ -0.006668500602245331, -0.03893595188856125, 0.00623741652816534, -0.018627095967531204, 0.0077009741216897964, -0.0330391488969326, -0.02079848386347294, 0.03631751611828804, 0.0025425986386835575, 0.026141799986362457, -0.03137867525219917, -0.040468696504831314, -0.007567923050373793, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "http_request", "annotation": null, "type_comment": null}}], "kwar...
def add_auth(self, http_request, **kwargs): headers = http_request.headers params = http_request.params params['AWSAccessKeyId'] = self._provider.access_key params['SignatureVersion'] = self.SignatureVersion params['Timestamp'] = boto.utils.get_ts() qs, signature = self._...
15,023
[ 0.03162148967385292, -0.01458180882036686, 0.041547518223524094, -0.027060244232416153, -0.020041124895215034, -0.027107510715723038, -0.02661120891571045, 0.00581677071750164, 0.007403162773698568, -0.01582256145775318, -0.028430981561541557, -0.00826578214764595, -0.04109848290681839, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _calc_signature(self, params, *args): boto.log.debug('using _calc_signature_1') hmac = self._get_hmac() keys = params.keys() keys.sort(cmp=lambda x, y: cmp(x.lower(), y.lower())) pairs = [] for key in keys: hmac.update(key.encode('utf-8')) val ...
15,024
[ 0.03558306396007538, -0.0039009409956634045, 0.03671746328473091, -0.04037531837821007, -0.035073742270469666, 0.004167177248746157, -0.010649452917277813, 0.008745284751057625, 0.02463264763355255, 0.02304680459201336, -0.011089321225881577, -0.005877456162124872, -0.03380043804645538, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}, {"_type": "a...
def _calc_signature(self, params, verb, path, server_name): boto.log.debug('using _calc_signature_2') string_to_sign = '%s\n%s\n%s\n' % (verb, server_name.lower(), path) hmac = self._get_hmac() params['SignatureMethod'] = self.algorithm() if self._provider.security_token: ...
15,025
[ 0.0311450008302927, 0.007524840999394655, 0.012958411127328873, 0.012858826667070389, -0.03283793479204178, 0.009292462840676308, -0.0339333601295948, 0.028754975646734238, 0.04214907065033913, 0.0051970575004816055, 0.004453286994248629, 0.015970837324857712, 0.018149245530366898, 0.01959...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def detect_potential_sigv4(func): def _wrapper(self): if os.environ.get('EC2_USE_SIGV4', False): return ['hmac-v4'] if boto.config.get('ec2', 'use-sigv4', False): return ['hmac-v4'] if hasattr(self, 'region'): # If you're making changes here, you should ...
15,026
[ 0.02206047810614109, -0.0291281845420599, 0.006809399928897619, -0.0029457935597747564, 0.004083441570401192, -0.026050489395856857, -0.029853640124201775, 0.0383392833173275, 0.007749196141958237, 0.018839890137314796, -0.02719363197684288, -0.024731475859880447, 0.007413947023451328, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}], "kwarg": {"_ty...
def add_auth(self, req, **kwargs): req.params['AWSAccessKeyId'] = self._provider.access_key req.params['SignatureVersion'] = self.SignatureVersion req.params['Timestamp'] = boto.utils.get_ts() qs, signature = self._calc_signature(req.params, req.method, ...
15,027
[ 0.03472915291786194, -0.001794579322449863, 0.05071558803319931, 0.010473871603608131, 0.007495888974517584, 0.010989177040755749, -0.0334109328687191, 0.04652124643325806, 0.03679037466645241, 0.022793253883719444, -0.02099567838013172, -0.0006916919955983758, 0.012834686785936356, -0.000...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _wrapper(self): if os.environ.get('EC2_USE_SIGV4', False): return ['hmac-v4'] if boto.config.get('ec2', 'use-sigv4', False): return ['hmac-v4'] if hasattr(self, 'region'): # If you're making changes here, you should also check # ``boto/iam/co...
15,028
[ 0.035457536578178406, 0.00455837557092309, 0.005861219018697739, -0.01403159461915493, -0.0122713353484869, -0.004552066326141357, -0.01949533447623253, 0.030637329444289207, 0.036366056650877, -0.0068265218287706375, 0.0016530025750398636, 0.019949596375226974, 0.01608838327229023, 0.0051...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def detect_potential_s3sigv4(func): def _wrapper(self): if os.environ.get('S3_USE_SIGV4', False): return ['hmac-v4-s3'] if boto.config.get('s3', 'use-sigv4', False): return ['hmac-v4-s3'] if hasattr(self, 'host'): # If you're making changes here, you sho...
15,029
[ 0.001954335719347, 0.040404755622148514, 0.015952832996845245, -0.059493616223335266, 0.007039017044007778, 0.022065812721848488, -0.0056528025306761265, -0.05376695469021797, -0.027519773691892624, 0.04322263225913048, -0.02044098824262619, -0.009322863072156906, 0.013487189076840878, -0....
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "base", "annotation": n...
class Type(Node): def __init__(self, base=None, const=False, unsigned=False, reference=None, arraylength=-1): if base == "char": self.base_type = "int" self.length = 8 elif base == "short": self.base_type = "int" self.length = 16 elif base == "...
15,030
[ 0.03604404255747795, 0.0038460881914943457, 0.030768705531954765, -0.02912476472556591, 0.02775072306394577, -0.007489750627428293, -0.034007515758275986, 0.023726744577288628, 0.024475106969475746, 0.01147692371159792, -0.02404571883380413, 0.013360096141695976, 0.011219291016459465, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _wrapper(self): if os.environ.get('S3_USE_SIGV4', False): return ['hmac-v4-s3'] if boto.config.get('s3', 'use-sigv4', False): return ['hmac-v4-s3'] if hasattr(self, 'host'): # If you're making changes here, you should also check # ``boto/iam/...
15,031
[ 0.02055910974740982, 0.02883777767419815, 0.07068131864070892, -0.0229851845651865, -0.0181705504655838, -0.008403723128139973, 0.004076806362718344, -0.017720350995659828, -0.025036092847585678, 0.010204521007835865, 0.004233125597238541, -0.04224371537566185, 0.009310374967753887, 0.0117...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ExternalAuthMap' db.create_table('external_auth_externalauthmap', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('external_id', self.gf('django.db.models.fields.CharField')...
15,032
[ 0.041272420436143875, 0.011393530294299126, 0.04394903406500816, -0.0030679486226290464, -0.02235689014196396, 0.021723585203289986, -0.011507047340273857, -0.04514395073056221, -0.023456213995814323, 0.051859382539987564, -0.02738749049603939, -0.0061896685510873795, 0.02256002649664879, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "base", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, base=None, const=False, unsigned=False, reference=None, arraylength=-1): if base == "char": self.base_type = "int" self.length = 8 elif base == "short": self.base_type = "int" self.length = 16 elif base == "int" or base == "long"...
15,033
[ 0.018744908273220062, 0.017697833478450775, 0.07297653704881668, 0.005682086106389761, -0.016764571890234947, -0.005667859222739935, 0.022364143282175064, 0.00527805183082819, -0.008968420326709747, -0.002375834621489048, 0.0038070259615778923, -0.01871076412498951, 0.04431856423616409, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding model 'ExternalAuthMap' db.create_table('external_auth_externalauthmap', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('external_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), ...
15,034
[ -0.025810685008764267, -0.031777799129486084, 0.045350052416324615, -0.0018471722723916173, 0.00827205553650856, -0.018930956721305847, 0.02653609961271286, 0.006230367347598076, 0.011308263055980206, 0.028057128190994263, -0.012917042709887028, -0.04228459671139717, 0.009366026148200035, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"...
def forecast_grid(): forecast_data = np.arange(9, dtype=np.float32).reshape(3, 3) / 8.0 forecast_data_stack = np.stack([forecast_data, forecast_data]) forecast_1 = set_up_probability_cube(forecast_data_stack, _thresholds) forecast_2 = set_up_probability_cube( forecast_data_stack, _thresh...
15,035
[ -0.0392051637172699, -0.02344345487654209, 0.0272329431027174, 0.022942470386624336, 0.006278349552303553, -0.02456103265285492, 0.003551843808963895, 0.013732083141803741, -0.012286938726902008, 0.04123478755354881, 0.017778487876057625, -0.010565611533820629, -0.0015880531864240766, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def truth_grid(): truth_data = np.linspace(281, 285, 9, dtype=np.float32).reshape(3, 3) # Threshold the truths, giving fields of zeroes and ones. truth_data_a = (truth_data > _thresholds[0]).astype(int) truth_data_b = (truth_data > _thresholds[1]).astype(int) truth_data_stack = np.stack([truth_data_...
15,036
[ 0.0019531911239027977, 0.024876905605196953, 0.018879003822803497, -0.01236098911613226, -0.004622921347618103, -0.02000775933265686, 0.0029878844507038593, -0.011752345599234104, -0.0066840085200965405, -0.014098388142883778, -0.017871975898742676, -0.0272672139108181, 0.05356059595942497, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "forecast_grid", "annotation": null, "type_comment": null}}, {"...
def create_rel_table_inputs( request, forecast_grid, forecast_spot, truth_grid, truth_spot, expected_table_shape_grid, expected_table_shape_spot, ): if request.param == "grid": return RelTableInputs( forecast=forecast_grid, truth=truth_grid, ex...
15,037
[ 0.012302146293222904, -0.014960276894271374, 0.05685146525502205, 0.037635765969753265, -0.015599193051457405, -0.011162946932017803, -0.0005413456237874925, -0.07416246831417084, -0.015490697696805, 0.006389159709215164, 0.014357526786625385, -0.03512832149863243, 0.02656926028430462, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "forecast_grid", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "truth_grid", "annotation": null, "type_comment": null}},...
def reliability_table_agg(forecast_grid, truth_grid, reliability_data): reliability_cube_format = CalPlugin().process(forecast_grid, truth_grid) reliability_cube_format = reliability_cube_format.collapsed( [ reliability_cube_format.coord(axis="x"), reliability_cube_format.coord(a...
15,038
[ -0.00530369533225894, 0.013006751425564289, 0.05048580840229988, 0.0023862251546233892, -0.05917254462838173, -0.027040965855121613, -0.040794964879751205, -0.01919488236308098, -0.027344534173607826, -0.0478704497218132, -0.0017177901463583112, -0.023339763283729553, 0.04348037764430046, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reliability_table_point_spot", "annotation": null, "type_comme...
def create_rel_tables_point( request, reliability_table_point_spot, reliability_table_point_grid, ): if request.param == "point_spot": return RelTables( table=reliability_table_point_spot, indices0=(0, slice(0, None), slice(0, None), 0), indices1=(0, slice(0, None), s...
15,039
[ 0.02368917688727379, -0.011301844380795956, -0.03241564705967903, -0.03601265698671341, 0.006321370601654053, 0.02852066233754158, 0.023306064307689667, -0.02398715354502201, -0.00868922472000122, -0.0039907642640173435, 0.019251447170972824, -0.05793525651097298, 0.03814106434583664, -0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "connection", "annotati...
class Instance(object): def __init__(self, connection=None): self.connection = connection self.instance_id = None self.health_status = None self.launch_config_name = None self.lifecycle_state = None self.availability_zone = None self.group_name = None def...
15,040
[ -0.015632130205631256, -0.015016692690551281, 0.00006783443677704781, -0.002995132701471448, -0.01757076196372509, 0.008923853747546673, -0.0029976970981806517, -0.01716046966612339, -0.009616222232580185, 0.005297897383570671, 0.006862136069685221, 0.004574757535010576, 0.023140477016568184...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs...
def ns(container): image_name = container.attrs['Image'] image = client.images.get(image_name) if len(image.tags) > 0: image_name = image.tags[0].split(":")[0] else: image_name = image.short_id.split(":")[1] image_name.replace('/', '-') return image_name, container.na...
15,041
[ 0.07639532536268234, -0.01567983441054821, -0.03208422288298607, -0.034144677221775055, 0.01751386560499668, -0.02391033247113228, 0.0009085246711038053, -0.029299214482307434, 0.026921765878796577, -0.04949619993567467, 0.0287784393876791, -0.026876481249928474, 0.012928787618875504, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def endElement(self, name, value, connection): if name == 'InstanceId': self.instance_id = value elif name == 'HealthStatus': self.health_status = value elif name == 'LaunchConfigurationName': self.launch_config_name = value elif name == 'LifecycleStat...
15,042
[ 0.038274746388196945, -0.010465167462825775, 0.0297083742916584, -0.003164140973240137, -0.007053560111671686, 0.006487033795565367, -0.004410809371620417, -0.017630787566304207, 0.01142390351742506, 0.022412016987800598, 0.006431004032492638, -0.060811273753643036, 0.02876208908855915, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __repr__(self): r = 'Instance<id:%s, state:%s, health:%s' % (self.instance_id, self.lifecycle_state, self.health_status) if self.group_name: r += ' group:%s' % self.group_name ...
15,043
[ -0.005640026647597551, 0.012564166449010372, 0.0005767493858002126, -0.027167806401848793, -0.0005252117407508194, -0.00846004020422697, 0.03386533632874489, 0.06561566889286041, 0.024435918778181076, -0.018921785056591034, 0.07533463835716248, 0.004802835173904896, 0.014641407877206802, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "db", "annotation": null, "type_comment": null}}], "kwarg":...
def test_lock(monkeypatch, db): class FakeContext: obj = {'database': str(db)} ctx = FakeContext() monkeypatch.setattr(click, 'get_current_context', lambda: ctx) def background_lock(): passata.lock_file(str(db)) assert '_lock' in ctx.obj time.sleep(1) # lockf lock...
15,044
[ 0.018735963851213455, -0.014749588444828987, 0.05602186173200607, -0.010789789259433746, 0.028569022193551064, -0.009753331542015076, 0.009979226626455784, 0.030030693858861923, 0.03080139309167862, -0.048500899225473404, 0.039624571800231934, 0.009992513805627823, -0.01354703214019537, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def test_default_gpg_id(monkeypatch): monkeypatch.setattr(passata, 'out', lambda cmd: output) output = textwrap.dedent("""\ /home/user/.gnupg/pubring.kbx ------------------------------ sec rsa4096 2015-02-26 [SC] [expires: 2018-12-20] 0123456789ABCDEF0123456789ABCDEF0123456...
15,045
[ -0.013101650401949883, -0.017822779715061188, 0.03989251330494881, -0.0301822442561388, 0.05929243937134743, -0.03143983706831932, -0.015420982614159584, -0.009014471434056759, 0.04366529732942581, 0.022698530927300453, -0.0011500022374093533, 0.014390167780220509, -0.055993836373090744, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def _numerical_gradient_1d(f, x): h = 1e-4 # 0.0001 grad = np.zeros_like(x) for idx in range(x.size): tmp_val = x[idx] x[idx] = float(tmp_val) + h fxh1 = f(x) # f(x+h) x[idx] = tmp_val - h fxh2 = f(x) # f(x-h) grad[idx] = (fxh1 - fxh2) / (2 * h) ...
15,046
[ 0.004010660108178854, -0.014804180711507797, 0.060179971158504486, -0.012476335279643536, 0.009707001969218254, -0.027521329000592232, 0.03224582225084305, 0.07683037221431732, 0.010698916390538216, 0.03430992364883423, 0.01643252559006214, -0.02082447148859501, 0.04277272894978523, 0.0011...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "db", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def test_keywords(db): db = passata.DB(str(db)) # The `keywords` field is empty db.put('internet/reddit', { 'username': 'takis', 'password': 'pass', }) assert db.keywords('internet/reddit') == [] # The `keywords` field contains a string db.put('internet/reddit', { '...
15,047
[ 0.007357489317655563, 0.006345267873257399, 0.0396428182721138, -0.03023570589721203, 0.04500104486942291, -0.0010424369247630239, 0.011068967171013355, -0.008742369711399078, 0.02019406668841839, 0.048949211835861206, -0.00041483447421342134, -0.008661794476211071, -0.007004974409937859, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "X", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def numerical_gradient_2d(f, X): if X.ndim == 1: return _numerical_gradient_1d(f, X) else: grad = np.zeros_like(X) for idx, x in enumerate(X): grad[idx] = _numerical_gradient_1d(f, x) return grad
15,048
[ 0.0022741411812603474, -0.005345515441149473, 0.029900293797254562, -0.039218463003635406, 0.056557606905698776, -0.022052276879549026, -0.014669088646769524, 0.002003892557695508, 0.05089319497346878, 0.006367054767906666, 0.003996975254267454, 0.004705026280134916, -0.0642542839050293, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def numerical_gradient(f, x): h = 1e-4 # 0.0001 grad = np.zeros_like(x) it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite']) while not it.finished: idx = it.multi_index tmp_val = x[idx] x[idx] = float(tmp_val) + h fxh1 = f(x) # f(x+h) x[idx] = tmp_...
15,049
[ 0.037803005427122116, 0.020127009600400925, 0.033717986196279526, 0.01199008896946907, -0.026652002707123756, 0.0025393376126885414, -0.020745282992720604, -0.01636216603219509, -0.0007438602624461055, 0.021319394931197166, -0.01787472888827324, -0.046326350420713425, 0.008644788525998592, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "addressPattern", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class PageWidget(object): addressPattern = None def __init__(self, receiver, callbacks=[], page=1): self.receiver = receiver self.page = page self.callbacks = callbacks def _callback(self, cb, node, message, address): (v,) = message.arguments v = float(v) i...
15,050
[ 0.014610937796533108, 0.0038001409266144037, 0.028797345235943794, -0.002283327514305711, -0.048538029193878174, 0.007399809081107378, 0.0014423731481656432, 0.028278473764657974, 0.009882135316729546, -0.0010672234930098057, 0.008573165163397789, -0.019610967487096786, 0.012217055074870586,...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def attach(self): self._recv_callbacks = [] for (idx, cb) in enumerate(self.callbacks): node = self.addressPattern % (self.page, idx + 1) recvcb = partial(self._callback, cb, node) self._recv_callbacks.append((node, recvcb)) self.receiver.addCallback(node,...
15,051
[ 0.00748536828905344, 0.0022336815018206835, 0.03311455249786377, -0.00786709226667881, -0.05019669979810715, -0.0010810542153194547, 0.0034563911613076925, 0.016700422391295433, 0.0040587992407381535, -0.0005610298248939216, 0.0027197832241654396, -0.016998644918203354, 0.012274811044335365,...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def attach(self): self._recv_callbacks = [] for (j, row) in enumerate(self.callbacks): for (k, cb) in enumerate(row): node = self.addressPattern % (self.page, j + 1, k + 1) recvcb = partial(self._callback, cb, node) self._recv_callbacks.append(...
15,052
[ 0.017620831727981567, 0.019017405807971954, 0.037227414548397064, 0.022432463243603706, -0.048705507069826126, -0.0034832509700208902, -0.011576286517083645, -0.01750081405043602, -0.007473851088434458, 0.002814968815073371, -0.008963165804743767, -0.018973762169480324, -0.000943096354603767...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class GridWidget(PageWidget): def attach(self): self._recv_callbacks = [] for (j, row) in enumerate(self.callbacks): for (k, cb) in enumerate(row): node = self.addressPattern % (self.page, j + 1, k + 1) recvcb = partial(self._callback, cb, node) ...
15,053
[ 0.03630227968096733, 0.008030809462070465, 0.018893800675868988, -0.0054598175920546055, -0.04025474563241005, 0.0029910989105701447, 0.014047622680664062, 0.007961578667163849, 0.007810528390109539, 0.0036598085425794125, 0.00277711171656847, -0.033432334661483765, -0.006171009968966246, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def attach(self): self._recv_callbacks = [] if self.callbacks: for (idx, cb) in enumerate(self.callbacks): node = '/%d/xy%d' % (self.page, idx + 1) recvcb = partial(self._callback, cb, node) self._recv_callbacks.append((node, recvcb)) ...
15,054
[ 0.02976379729807377, 0.014699522405862808, -0.013739007525146008, 0.00705188000574708, -0.02167845144867897, 0.0063102166168391705, 0.0339219756424427, -0.02818320319056511, 0.009653780609369278, -0.02677282691001892, -0.004501652903854847, -0.09308481961488724, 0.022967243567109108, -0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "receiver", "annotation...
class XY(object): def __init__(self, receiver, callback=lambda x, y: None, callbacks=None, page=1): self.receiver = receiver self.callbacks = callbacks self.callback = callback self.page = page def attach(self): self._recv_callbacks = [] if self...
15,055
[ 0.027169466018676758, -0.01698707975447178, 0.012857419438660145, -0.02576414868235588, -0.03523154929280281, 0.04773147404193878, -0.004274506587535143, -0.042159516364336014, -0.005350067280232906, -0.016752859577536583, 0.0043916162103414536, -0.053549982607364655, -0.0015609499532729387,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "/%d/led%d"}}, "targets": [{"_type": "Name", "_fields": {"id": "ledAddressPattern", "ctx": {"_type": "Store", "_fields": {}}}}], "type_com...
class TouchOSCStepSequencer: ledAddressPattern = '/%d/led%d' def __init__(self, receiver, send, stepSequencer, page=1): self.stepSequencer = ss = stepSequencer self.receiver = receiver self.send = send self.page = page # Listeners for multifader and toggle widgets ...
15,056
[ 0.033799149096012115, -0.0014433051692321897, 0.019216064363718033, 0.015723325312137604, -0.014066974632441998, 0.013754908926784992, -0.002646559616550803, 0.010688260197639465, -0.005974263418465853, 0.01506318524479866, 0.010748272761702538, -0.011438419111073017, -0.009812074713408947, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cb", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _callback(self, cb, node, message, address): (x, y) = message.arguments x = float(x) y = float(y) if DEBUG: cn = self.__class__.__name__ log.msg('[%s] %s %s %s' % (cn, node, x, y)) cb(x, y)
15,057
[ 0.025305477902293205, -0.011590647511184216, 0.015898384153842926, -0.03393414244055748, -0.0220334455370903, 0.01523869950324297, 0.0032341007608920336, 0.006530871614813805, -0.0017003354150801897, -0.0014257420552894473, 0.013371794484555721, -0.047286149114370346, -0.008562698028981686, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def attach(self): ss = self.stepSequencer clock = ss.clock beats = ss.beats #players = self.players #self.step = 0 ss.step = 0 # Clear out the multifader and toggle widgets for beat in range(1, beats + 1): for index in range(1, len(ss.notes) +...
15,058
[ 0.04832000657916069, -0.020825175568461418, -0.0016120272921398282, -0.024346567690372467, -0.030946258455514908, 0.010004480369389057, 0.01631266623735428, -0.021886257454752922, -0.0164992306381464, -0.01787513680756092, -0.006150772795081139, -0.026608651503920555, -0.019321005791425705, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "receiver", "annotation": null, "type_comment": null}}, {"_type": ...
def __init__(self, receiver, send, stepSequencer, page=1): self.stepSequencer = ss = stepSequencer self.receiver = receiver self.send = send self.page = page # Listeners for multifader and toggle widgets self._multifader = MultiFader(receiver, [partial(self.se...
15,059
[ 0.03366522863507271, -0.04583398997783661, 0.010364817455410957, -0.017687443643808365, -0.020792489871382713, 0.03665713593363762, 0.0261477492749691, -0.05005785450339317, 0.005477827973663807, 0.0059555270709097385, 0.012206473387777805, -0.04196210950613022, -0.023407265543937683, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def updateLEDs(self): ss = self.stepSequencer on = ss.step + 1 off = on - 1 off = off or ss.beats self.send(self.ledAddressPattern % (self.page, on), 1.0) self.send(self.ledAddressPattern % (self.page, off), 0.0) # really only want this for udp, but alas s...
15,060
[ 0.019459595903754234, 0.005131735932081938, -0.006283692084252834, -0.010380620136857033, -0.019641825929284096, 0.04795260727405548, 0.015762923285365105, -0.0016018371097743511, -0.008532283827662468, -0.019576743245124817, 0.028453964740037918, -0.04248569905757904, -0.01101191807538271, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def refreshUI(self): ss = self.stepSequencer col = ss.on_off[self._refresh_col] for (index, on_off) in enumerate(col): self.send(MultiToggle.addressPattern % (self.page, index + 1, self._refresh_col + 1), on_off) for beat in range(ss.beats): ...
15,061
[ 0.02847610041499138, 0.0320463664829731, 0.02514241822063923, -0.00068051484413445, 0.02546503394842148, 0.0020822074729949236, -0.01685122773051262, -0.02645438350737095, 0.003954715561121702, 0.06955567002296448, 0.014248804189264774, -0.03791794925928116, 0.004901051055639982, -0.009818...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "array", "annotation": null, "type_comment": null}}, {"_type": "ar...
def validate_metadata(self, array, key, is_required=False, is_list=False, is_url=False, is_issuer=False): if not self.raise_errors: return if key not in array: if is_required: raise ValueError("key {} is a mandatory metadata.".format(key)) elif is_issuer...
15,062
[ 0.015811508521437645, 0.002282414585351944, 0.0983533188700676, 0.025051428005099297, -0.01130181085318327, 0.015557907521724701, 0.008523219265043736, 0.029131107032299042, 0.019869135692715645, 0.022250784561038017, 0.01913038268685341, -0.05962945893406868, 0.002315493067726493, -0.0394...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "endpoints", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, endpoints, claims={}, raise_errors=True): assert isinstance(claims, dict) for endpoint in endpoints: assert isinstance(endpoint, BaseEndpoint) BaseEndpoint.__init__(self) self.raise_errors = raise_errors self.endpoints = endpoints self.init...
15,063
[ 0.017154596745967865, 0.011620855890214443, 0.08645164966583252, -0.019336769357323647, -0.013938762247562408, -0.0014813197776675224, -0.012863337062299252, 0.027564294636249542, -0.009010600857436657, 0.005679915193468332, 0.01931588724255562, -0.029944846406579018, -0.003469028975814581, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "claims", "annotation": null, "type_comment": null}}, {"_type": "a...
def validate_metadata_authorization(self, claims, endpoint): claims.setdefault("response_types_supported", list(filter(lambda x: x != "none", endpoint._response_types.keys()))) claims.setdefault("response_modes_supported", ["query", "fragment"]) # The OAuth2.0 Implicit...
15,064
[ 0.017152005806565285, 0.02377774380147457, 0.05703558772802353, -0.014788439497351646, -0.023119045421481133, -0.04771047458052635, 0.01681619882583618, -0.05636397376656532, 0.003845639992505312, 0.018262753263115883, 0.018301500007510185, -0.029318565502762794, 0.008989304304122925, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def createWidgets(self): #---------------------------------------- # Create the XML entry self.xml_value = StringVar() self.xml_label = Label( self, text="XML" ) self.xml_label.grid(row=0, column = 0) self.xml_entry = Entry( self, width = 26, textvariable=self.xml_valu...
15,065
[ 0.06700445711612701, -0.02085813693702221, 0.0416470542550087, -0.07872562855482101, -0.037886131554841995, -0.03345608338713646, 0.020039040595293045, 0.019704479724168777, -0.01500909123569727, 0.027964672073721886, 0.0323716439306736, -0.02241557650268078, 0.04388515278697014, -0.002990...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": nu...
def prepare_config(self, config): if isinstance(config, basestring): config = [config] if isinstance(config, list): config = {'on_output': {'for_accepted': config}} if not config.get('encoding'): config['encoding'] = io_encoding for phase_name in confi...
15,066
[ 0.04469755291938782, 0.013084192760288715, 0.0634821355342865, -0.041493259370326996, -0.06571120768785477, -0.0289315078407526, 0.026493458077311516, -0.06561832875013351, 0.05614477023482323, 0.003958926070481539, 0.015580289997160435, -0.019492777064442635, -0.03515433520078659, -0.0073...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def generateHeaders(self): # Verify settings rex = re.compile(".*\\.xml$", re.IGNORECASE) if not self.xml_value.get(): tkinter.messagebox.showerror('Error Generating Headers','An XML message definition file must be specified.') return if not self.out_value.get():...
15,067
[ 0.029968688264489174, 0.04057970643043518, 0.010472182184457779, -0.015351267531514168, -0.005260883364826441, 0.007675633765757084, 0.034173429012298584, 0.06223808601498604, 0.015024011954665184, 0.05017920956015587, 0.04855284467339516, 0.03915168344974518, -0.02098403312265873, 0.02010...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def execute_cmd(self, cmd, allow_background, encoding): log.verbose('Executing: %s', cmd) p = subprocess.Popen(text_to_native_str(cmd, encoding=io_encoding), shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=False) if not ...
15,068
[ 0.058561861515045166, 0.04209133982658386, 0.028038298711180687, -0.06696657836437225, 0.01019523199647665, 0.002458434784784913, 0.014527499675750732, 0.06624358892440796, 0.009223719127476215, 0.04875636473298073, 0.030207257717847824, 0.007489682640880346, 0.030885057523846626, 0.002906...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "task", "annotation": null, "type_comment": null}}, {"_type": "arg...
def execute(self, task, phase_name, config): config = self.prepare_config(config) if phase_name not in config: log.debug('phase %s not configured' % phase_name) return name_map = {'for_entries': task.entries, 'for_accepted': task.accepted, 'for_reject...
15,069
[ 0.001585490652360022, 0.05059489980340004, 0.018046138808131218, -0.026306530460715294, 0.01668505184352398, -0.014326616190373898, 0.005394481588155031, 0.005344613920897245, -0.003813391085714102, 0.06322015821933746, 0.03412104770541191, 0.036561619490385056, -0.0062187607400119305, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def must_be_branched_from_node(func): @autoload_draft @must_be_valid_project @functools.wraps(func) def wrapper(*args, **kwargs): node = kwargs['node'] draft = kwargs['draft'] if not draft.branched_from._id == node._id: raise HTTPError( http.BAD_REQUES...
15,070
[ -0.009635645896196365, 0.039006952196359634, -0.008297822438180447, -0.040488507598638535, 0.005497791338711977, -0.010868433862924576, 0.0026093085762113333, 0.03361143171787262, -0.017336422577500343, 0.051390111446380615, 0.010155296884477139, 0.017601776868104935, -0.019481362774968147, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"...
def wrapper(*args, **kwargs): node = kwargs['node'] draft = kwargs['draft'] if not draft.branched_from._id == node._id: raise HTTPError( http.BAD_REQUEST, data={ 'message_short': 'Not a draft of this node', 'mess...
15,071
[ 0.0135416928678751, -0.01426338218152523, 0.007302089594304562, 0.027303902432322502, 0.006775858346372843, -0.06483173370361328, 0.011035827919840813, 0.007467476651072502, 0.008700362406671047, 0.017260396853089333, -0.02884751372039318, 0.031213050708174706, 0.024156535044312477, 0.0333...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def _matmul_cpu(a, b, transa=False, transb=False, transout=False): if transout: # (A B)^T = B^T A^T a, b, transa, transb = b, a, not transb, not transa a = _as_mat(a) b = _as_mat(b) if transa: a = a.T if transb: b = b.T return numpy.dot(a, b)
15,072
[ 0.035606227815151215, 0.0776730626821518, 0.002351383212953806, -0.01654013618826866, -0.013917030766606331, 0.06178870424628258, 0.005774475168436766, 0.02637678198516369, 0.00915658101439476, 0.04277119040489197, 0.05717398226261139, -0.018568186089396477, 0.005759295076131821, 0.0592627...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "draft", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def check_draft_state(draft): registered_and_deleted = draft.registered_node and draft.registered_node.is_deleted if draft.registered_node and not registered_and_deleted: raise HTTPError(http.FORBIDDEN, data={ 'message_short': 'This draft has already been registered', 'message_lo...
15,073
[ 0.015869176015257835, -0.035744164139032364, 0.010214819572865963, 0.0389077290892601, 0.0004638139216694981, -0.05419144034385681, 0.02063506469130516, 0.0001489340211264789, 0.00815542135387659, 0.0038389028050005436, -0.029088355600833893, 0.012192047201097012, 0.03202595189213753, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def _matmul_gpu(a, b, transa=False, transb=False, transout=False, out=None): if transout: # (A B)^T = B^T A^T a, b, transa, transb = b, a, not transb, not transa a = _as_mat(a) b = _as_mat(b) with cuda.using_cumisc(): return cuda.culinalg.dot(a, b, ...
15,074
[ -0.0037416412960737944, -0.03335529565811157, 0.014479231089353561, 0.040026355534791946, -0.01772812381386757, -0.07351160794496536, 0.0180421844124794, -0.011208679527044296, 0.00012936345592606813, -0.016341930255293846, -0.016753455623984337, 0.018854405730962753, 0.02625105157494545, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def _batch_matmul_gpu(a, b, out, transa=False, transb=False, transout=False): if transout: # (A B)^T = B^T A^T a, b, transa, transb = b, a, not transb, not transa a = _as_batch_mat(a) b = _as_batch_mat(b) alpha = numpy.float32(1.0) beta = numpy.float32(0.0) l, m, k = a.shape ...
15,075
[ -0.01647200621664524, 0.015344643965363503, -0.03392523527145386, -0.013121236115694046, 0.00516968360170722, -0.01940523274242878, 0.033737339079380035, -0.0498126819729805, 0.03707766905426979, 0.0412113294005394, 0.004992228467017412, 0.01772462949156761, 0.05515721067786217, 0.04947865...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "in_type", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vector_ndim", "annotation": null, "type_comment": null}}], "kw...
def _convert_type(in_type, vector_ndim=1): if in_type.ndim.eval() == vector_ndim: in_type = type_check.Variable( type_check.TypeInfo(in_type.shape.eval() + (1,), in_type.dtype), '%s(1-D array)' % in_type.name) else: in_type.name = '%s(2-D a...
15,076
[ -0.003303124336525798, 0.013748755678534508, -0.002497310284525156, -0.014091048389673233, 0.0032489278819411993, -0.056638024747371674, 0.003314533969387412, 0.011752048507332802, 0.02062883786857128, -0.005516616627573967, -0.012185619212687016, -0.009783864952623844, 0.010428516194224358,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "transa", "annotation":...
class MatMul(function.Function): def __init__(self, transa=False, transb=False): self.transa = transa self.transb = transb def check_type_forward(self, in_types): type_check.expect(in_types.size() == 2) a_type, b_type = in_types type_check.expect( a_type.dty...
15,077
[ 0.0055537596344947815, -0.007197191007435322, 0.03445464000105858, 0.009729334153234959, -0.013038072735071182, -0.04443007707595825, -0.0003828293120022863, 0.020935295149683952, 0.031216995790600777, -0.01516004092991352, -0.033229585736989975, 0.014700645580887794, 0.011736453510820866, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def backward_cpu(self, x, gy): gx0 = _matmul_cpu( gy[0], x[1], transb=not self.transb, transout=self.transa ).reshape(x[0].shape) gx1 = _matmul_cpu( x[0], gy[0], transa=not self.transa, transout=self.transb ).reshape(x[1].shape) return gx0, gx1
15,078
[ 0.012121951207518578, 0.013095246627926826, 0.008472094312310219, -0.04357708990573883, 0.0028479949105530977, 0.010247251950204372, 0.007548569235950708, -0.026301095262169838, 0.020649345591664314, 0.03764883428812027, 0.018923958763480186, -0.011900748126208782, 0.03289296105504036, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "in_types", "annotation": null, "type_comment": null}}], "kwarg": ...
def check_type_forward(self, in_types): type_check.expect(in_types.size() == 2) a_type, b_type = in_types type_check.expect( a_type.dtype == numpy.float32, b_type.dtype == numpy.float32 ) _check_ndim(a_type) _check_ndim(b_type) a_type = ...
15,079
[ -0.00530287204310298, 0.002419309224933386, 0.01321825198829174, -0.007676044013351202, -0.004743460565805435, -0.06842117756605148, 0.005219248589128256, 0.0083969347178936, 0.006661029998213053, -0.023737488314509392, -0.004922241438180208, -0.026944009587168694, 0.0025173502508550882, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "transa", "annotation":...
class BatchMatMul(function.Function): def __init__(self, transa=False, transb=False): self.transa = transa self.transb = transb def _output_shape(self, a, b): batch_size = a.shape[0] a_mat_shape = _as_mat(a[0]).shape b_mat_shape = _as_mat(b[0]).shape m = a_mat_sh...
15,080
[ -0.008798991329967976, -0.044365961104631424, 0.028706084936857224, 0.006855349522083998, -0.009336122311651707, -0.035705406218767166, 0.00044022640213370323, 0.006988248322159052, 0.021906109526753426, -0.01323447935283184, -0.04071125388145447, 0.0008354611345566809, 0.023080047219991684,...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def backward_gpu(self, x, gy): gx0 = _matmul_gpu( gy[0], x[1], transb=not self.transb, transout=self.transa ).reshape(x[0].shape) gx1 = _matmul_gpu( x[0], gy[0], transa=not self.transa, transout=self.transb ).reshape(x[1].shape) return gx0, gx1
15,081
[ 0.01083605270832777, 0.017607182264328003, 0.014025107957422733, -0.04711717739701271, 0.00012299341324251145, 0.009864738211035728, 0.005207481328397989, -0.03267659246921539, 0.018292155116796494, 0.0470273457467556, 0.01557471975684166, -0.008185992017388344, 0.025242948904633522, 0.066...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "in_types", "annotation": null, "type_comment": null}}], "kwarg": ...
def check_type_forward(self, in_types): type_check.expect(in_types.size() == 2) a_type, b_type = in_types type_check.expect( a_type.dtype == numpy.float32, b_type.dtype == numpy.float32 ) _check_ndim(a_type, lower=2, upper=3) _check_ndim(b_type, ...
15,082
[ 0.02963172271847725, -0.03919818624854088, 0.020723965018987656, -0.004362673033028841, 0.002989520551636815, -0.07393743097782135, -0.004106790293008089, 0.02997627668082714, 0.027280641719698906, -0.04856197535991669, -0.01805873028934002, 0.025720009580254555, -0.0024004837032407522, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def forward_cpu(self, x): a, b = x batch_size = a.shape[0] shape = self._output_shape(a, b) ret_dtype = numpy.find_common_type([a.dtype, b.dtype], []) ret = numpy.empty(shape, dtype=ret_dtype) for i in six.moves.range(batch_size): ret[i] = _matmul_cpu( ...
15,083
[ 0.010654867626726627, -0.06641178578138351, 0.029139406979084015, 0.00920576136559248, -0.008885608986020088, -0.037968847900629044, 0.004195670131593943, -0.002295823534950614, 0.013131829909980297, -0.03084688074886799, -0.02877993881702423, -0.016086211428046227, 0.0023323320783674717, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def backward_gpu(self, x, gy): a, b = x batch_size = a.shape[0] ga = cuda.empty((batch_size,) + _as_mat(a[0]).shape) gb = cuda.empty((batch_size,) + _as_mat(b[0]).shape) _batch_matmul_gpu(gy[0], b, transb=not self.transb, transout=self.transa, out=ga) ...
15,084
[ 0.014891179278492928, -0.015205860137939453, 0.0323447659611702, 0.005223151296377182, -0.024410294368863106, -0.051877494901418686, -0.000289570220047608, 0.018431346863508224, 0.018285244703292847, -0.029355289414525032, -0.010541831143200397, 0.002209794707596302, -0.001563573838211596, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def backward_cpu(self, x, gy): a, b = x batch_size = a.shape[0] ga = numpy.empty_like(a) gb = numpy.empty_like(b) for i in six.moves.range(batch_size): ga[i] = _matmul_cpu(gy[0][i], b[i], transb=not self.transb, transout=self.transa ...
15,085
[ 0.009515434503555298, -0.015294747427105904, 0.0036806634161621332, -0.02201976627111435, 0.002751011401414871, 0.001402504974976182, 0.04144759848713875, 0.03383525088429451, 0.01113831251859665, 0.059030719101428986, -0.0004549749428406358, -0.035142891108989716, 0.020642071962356567, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}, {"_type": "arg...
def integrate(self, expr, variables=None, **kwargs): if variables is None: variables = self.symbols if not variables: return expr assert frozenset(variables) == frozenset(self.symbols) # assumes only intervals return Integral(expr, (self.symbol, self.set),...
15,086
[ 0.03319276496767998, -0.011410734616219997, 0.036680661141872406, -0.017531877383589745, 0.012323131784796715, 0.0028916627634316683, 0.03774319961667061, 0.05880917236208916, 0.01113932579755783, 0.07936697453260422, -0.021551044657826424, -0.020142026245594025, 0.003727545263245702, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}, {"_type": "arg...
def integrate(self, expr, rvs=None, **kwargs): if rvs is None: rvs = self.values else: rvs = frozenset(rvs) expr = expr.xreplace(dict((rv, rv.symbol) for rv in rvs)) domain_symbols = frozenset(rv.symbol for rv in rvs) return self.domain.integrate(self.p...
15,087
[ 0.05896763503551483, -0.008511494845151901, 0.02962000109255314, 0.031049933284521103, 0.009691755287349224, 0.017545027658343315, 0.03286571800708771, 0.08575047552585602, 0.0286440160125494, 0.07231365889310837, 0.030777564272284508, -0.03200322017073631, 0.00867605023086071, 0.031662762...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}], "kwarg": {"_t...
def compute_cdf(self, expr, **kwargs): if not self.domain.set.is_Interval: raise ValueError( "CDF not well defined on multivariate expressions") d = self.compute_density(expr, **kwargs) x, z = symbols('x, z', real=True, bounded=True, cls=Dummy) left_bound = s...
15,088
[ 0.07015527039766312, -0.020212197676301003, -0.0118863545358181, 0.026613926514983177, 0.0402325838804245, 0.01245579682290554, 0.026829713955521584, 0.06185939535498619, 0.011892348527908325, 0.03579692915081978, -0.029059529304504395, 0.01057364046573639, 0.005664450582116842, 0.03419050...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}], "kwarg": {"_t...
def compute_density(self, expr, **kwargs): # Common case Density(X) where X in self.values if expr in self.values: # Marginalize all other random symbols out of the density randomsymbols = tuple(set(self.values) - frozenset([expr])) symbols = tuple(rs.symbol for rs in...
15,089
[ 0.06825417280197144, 0.023576529696583748, 0.01750815659761429, 0.052344225347042084, 0.03407902270555496, 0.033982887864112854, 0.05176742747426033, 0.029320456087589264, 0.041000571101903915, 0.06335140764713287, -0.04306742176413536, -0.013194205239415169, 0.008117199875414371, 0.012437...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "condition", "annotation": null, "type_comment": null}}, {"_type":...
def conditional_space(self, condition, normalize=True, **kwargs): condition = condition.xreplace(dict((rv, rv.symbol) for rv in self.values)) domain = ConditionalContinuousDomain(self.domain, condition) if normalize: pdf = self.pdf / domain.integrate(self.pdf, **kwargs) ...
15,090
[ 0.05004500225186348, -0.0228322371840477, 0.023507144302129745, 0.0312749445438385, 0.028371568769216537, -0.0013044490478932858, 0.07380682975053787, 0.009926228784024715, 0.011664433404803276, 0.07752518355846405, -0.028779059648513794, -0.029543105512857437, 0.008971171453595161, -0.014...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "condition", "annotation": null, "type_comment": null}}], "kwarg":...
def where(self, condition): rvs = frozenset(random_symbols(condition)) if not (len(rvs) == 1 and rvs.issubset(self.values)): raise NotImplementedError( "Multiple continuous random variables not supported") rv = tuple(rvs)[0] interval = reduce_rational_inequali...
15,091
[ 0.03608560934662819, -0.01862630620598793, 0.019701780751347542, -0.016727063804864883, 0.0050198351964354515, -0.015560059808194637, 0.03336259722709656, 0.06576413661241531, 0.0152053814381361, 0.06196564808487892, -0.006767481565475464, -0.03578813746571541, 0.02858016826212406, 0.01398...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}, {"_type": "arg...
def integrate(self, expr, rvs=None, **kwargs): rvs = rvs or (self.value,) if self.value not in rvs: return expr expr = expr.xreplace(dict((rv, rv.symbol) for rv in rvs)) x = self.value.symbol try: return self.distribution.expectation(expr, x, evaluate=Fa...
15,092
[ 0.03022708371281624, -0.015576201491057873, -0.024785326793789864, 0.00680770305916667, 0.031196465715765953, -0.010751323774456978, 0.03727713227272034, 0.05300755426287651, 0.016016829758882523, 0.0258868969976902, -0.034787584096193314, -0.00039897492388263345, -0.0244107935577631, 0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expr", "annotation": null, "type_comment": null}}], "kwarg": {"_t...
def compute_density(self, expr, **kwargs): # http://en.wikipedia.org/wiki/Random_variable#Functions_of_random_variables if expr == self.value: return self.density y = Dummy('y') gs = solve(expr - y, self.value) if not gs: raise ValueError("Can not solve %s...
15,093
[ 0.027328088879585266, 0.01674387790262699, 0.09031283110380173, -0.020767178386449814, -0.009076829999685287, -0.02007313258945942, 0.02472541481256485, 0.07560771703720093, 0.017394546419382095, 0.047021664679050446, 0.02695937640964985, 0.019324863329529762, -0.011440926231443882, -0.008...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "jobs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "threads", "annotation": null, "type_comment": null}}], "kwarg": n...
def run(jobs, threads=None): if threads is None: threads = len(jobs) pool = multiprocessing.pool.ThreadPool(processes=threads) try: futures = [] for job in jobs: kwargs = dict(job) args = () del kwargs['callback'] if 'args' in job: ...
15,094
[ 0.02030671201646328, -0.02575230598449707, -0.004877528641372919, 0.008964989334344864, -0.0009459598222747445, 0.04189320653676987, -0.006588255055248737, 0.012288499623537064, 0.04562807455658913, 0.044609472155570984, 0.06242192164063454, -0.030558010563254356, -0.03285638988018036, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_fractional_pow(): mp.dps = 15 assert mpf(16) ** 2.5 == 1024 assert mpf(64) ** 0.5 == 8 assert mpf(64) ** -0.5 == 0.125 assert mpf(16) ** -2.5 == 0.0009765625 assert (mpf(10) ** 0.5).ae(3.1622776601683791) assert (mpf(10) ** 2.5).ae(316.2277660168379) assert (mpf(10) ** -0.5).ae(...
15,095
[ 0.045218341052532196, -0.007227521855384111, 0.009751158766448498, -0.026773443445563316, 0.03128655627369881, 0.019131675362586975, -0.004025282803922892, -0.03904823958873749, -0.010923041962087154, -0.0059956819750368595, 0.012187586165964603, -0.04530555009841919, 0.04491310566663742, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "configuration", "annotation": null, "type_comment": null}}, {"_ty...
def __init__(self, configuration=None, name=None): SimpleService.__init__(self, configuration=configuration, name=name) self.order = ORDER self.definitions = deepcopy(CHARTS) self.user = configuration.get('user') self.password = configuration.get('password') self.server =...
15,096
[ -0.01728162169456482, -0.053569894284009933, 0.09409231692552567, -0.051688045263290405, 0.05093530938029289, -0.023585807532072067, 0.009367412887513638, -0.019686203449964523, 0.01435430534183979, 0.036528728902339935, -0.026575852185487747, -0.038138750940561295, 0.030088631436228752, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _path_to_apache_config_file(self): if self._is_redhat_based(): config_name = 'fedora-httpd.conf' else: config_name = 'apache2-debian-httpd.conf' return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_name)
15,097
[ 0.026790427044034004, -0.0027069945354014635, 0.06152679771184921, 0.022904295474290848, 0.07212138921022415, 0.031197603791952133, 0.004654130898416042, 0.033694278448820114, -0.01687970571219921, -0.01408994011580944, -0.015056045725941658, -0.047849349677562714, 0.040576424449682236, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def check(self): if not HAS_ORACLE: self.error("'cx_Oracle' package is needed to use oracledb module") return False if not all([ self.user, self.password, self.server, self.service, ]): self.error("one of these ...
15,098
[ 0.008975651115179062, 0.004415397997945547, 0.029228540137410164, 0.03405704349279404, 0.06403668224811554, 0.03448624536395073, 0.013541270047426224, 0.029636280611157417, 0.009243901818990707, 0.002368649234995246, 0.02955044060945511, -0.015601431019604206, 0.029979640617966652, 0.04558...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def connect(self): if self.conn: self.conn.close() self.conn = None try: self.conn = cx_Oracle.connect( CX_CONNECT_STRING.format( self.user, self.password, self.server, se...
15,099
[ 0.02982521988451481, -0.004105794709175825, 0.0766415074467659, 0.010392260737717152, 0.03502703085541725, 0.037048693746328354, -0.04829277843236923, -0.04077400639653206, -0.02373751439154148, -0.01805868186056614, 0.004185298457741737, -0.023305922746658325, 0.0033561892341822386, -0.03...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def add_tablespace_to_charts(self, name): self.charts['tablespace_size'].add_dimension( [ '{0}_tablespace_size'.format(name), name, 'absolute', 1, 1024 * 1000, ]) self.charts['tablespace_usage'].add_d...
15,100
[ 0.04047735035419464, 0.011585318483412266, 0.0418618880212307, -0.0009645948302932084, 0.04395226761698723, -0.002814886160194874, -0.025247443467378616, -0.023401392623782158, 0.0028030090034008026, 0.004598156549036503, 0.020170805975794792, -0.0012411628849804401, -0.0005234432755969465, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def get_data(self): if not self.alive and not self.reconnect(): return None data = dict() # SYSTEM try: rv = self.gather_system_metrics() except cx_Oracle.Error as error: self.error(error) self.alive = False return Non...