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 |
|---|---|---|---|---|---|
16,801 | [
0.0022083164658397436,
-0.020757872611284256,
-0.009292136877775192,
0.00983553659170866,
-0.000278115039691329,
-0.027628861367702484,
-0.01054195687174797,
0.00409361207857728,
0.0358402356505394,
-0.011109507642686367,
0.016048407182097435,
-0.029971519485116005,
-0.02252090349793434,
-... | 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": "body", "annotation": null, "type_comment": null}}], "kwarg": null... | def _test_add_fixed_ip_bad_request(self, body):
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dumps(body)
req.headers['content-type'] = 'application/json'
resp = req.get_response(self.app)
se... | |
16,802 | [
0.0034345868043601513,
-0.02882884256541729,
0.031686216592788696,
0.0021079496946185827,
0.003973532933741808,
-0.02913499064743519,
-0.0065375142730772495,
0.005418164189904928,
0.009248190559446812,
0.020218458026647568,
-0.003252811962738633,
0.004474211018532515,
-0.012507380917668343,
... | 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 test_add_fixed_ip(self):
global last_add_fixed_ip
last_add_fixed_ip = (None, None)
body = dict(addFixedIp=dict(networkId='test_net'))
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dumps(... | |
16,803 | [
-0.02772008441388607,
-0.010332934558391571,
-0.008252686820924282,
0.004725579172372818,
-0.01707666553556919,
-0.041008833795785904,
-0.009351802989840508,
-0.013077620416879654,
0.03142106533050537,
-0.01010938547551632,
0.007240505889058113,
-0.037059467285871506,
-0.017424408346414566,
... | 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": "mock_add_fixed_ip", "annotation": null, "type_comment": null}}], ... | def test_add_fixed_ip_no_more_ips_available(self, mock_add_fixed_ip):
mock_add_fixed_ip.side_effect = exception.NoMoreFixedIps(net='netid')
body = dict(addFixedIp=dict(networkId='test_net'))
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method... | |
16,804 | [
0.006474600173532963,
-0.01126798614859581,
0.015798281878232956,
-0.00733445817604661,
0.006590103730559349,
-0.033033937215805054,
0.001054769498296082,
0.0033816793002188206,
0.018519025295972824,
0.029389167204499245,
-0.0007728292257525027,
-0.01081880647689104,
-0.016221793368458748,
... | 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 test_add_fixed_ip_no_network(self):
global last_add_fixed_ip
last_add_fixed_ip = (None, None)
body = dict(addFixedIp=dict())
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dumps(body)
... | |
16,805 | [
0.013239163905382156,
-0.018654031679034233,
0.018869612365961075,
-0.00516441510990262,
-0.008509078994393349,
-0.008115962147712708,
-0.029597900807857513,
0.015572503209114075,
0.025742817670106888,
0.0228134635835886,
0.032058052718639374,
-0.027797171846032143,
-0.007887700572609901,
... | 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 test_remove_fixed_ip(self):
global last_remove_fixed_ip
last_remove_fixed_ip = (None, None)
body = dict(removeFixedIp=dict(address='10.10.10.1'))
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = json... | |
16,806 | [
0.013854146003723145,
-0.0040139066986739635,
-0.004516831133514643,
-0.01538506057113409,
-0.0014589554630219936,
-0.01023562066257,
-0.027455247938632965,
0.013512536883354187,
0.028011944144964218,
0.024823592975735664,
0.03347769007086754,
-0.03347769007086754,
-0.008211269974708557,
-... | 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 test_remove_fixed_ip_no_address(self):
global last_remove_fixed_ip
last_remove_fixed_ip = (None, None)
body = dict(removeFixedIp=dict())
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dum... | |
16,807 | [
0.0005545751191675663,
-0.014851002022624016,
-0.005766676738858223,
-0.004614547826349735,
-0.007684880867600441,
-0.01007358729839325,
-0.025383027270436287,
0.01906139962375164,
0.05602603778243065,
-0.0017040650127455592,
0.011491128243505955,
-0.047556985169649124,
-0.01474242378026247,... | 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": "_remove_fixed_ip", "annotation": null, "type_comment": null}}], "... | def test_remove_fixed_ip_not_found(self, _remove_fixed_ip):
body = {'remove_fixed_ip': {'address': '10.10.10.1'}}
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dumps(body)
req.headers['content-type'... | |
16,808 | [
0.013785403221845627,
-0.017057757824659348,
-0.0014980484265834093,
-0.011386084370315075,
-0.010653466917574406,
-0.022613434121012688,
-0.03843795508146286,
0.023565836250782013,
0.050697073340415955,
-0.005073370411992073,
0.03435972332954407,
-0.04627695307135582,
-0.024628130719065666,... | 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 test_remove_fixed_ip_invalid_address(self):
body = {'remove_fixed_ip': {'address': ''}}
req = webob.Request.blank(
self._get_url() + '/servers/%s/action' % UUID)
req.method = 'POST'
req.body = jsonutils.dumps(body)
req.headers['content-type'] = 'application/json'
... | |
16,809 | [
0.029113998636603355,
0.07056480646133423,
0.04241325706243515,
-0.02434551529586315,
-0.019959822297096252,
0.029267115518450737,
0.01769588701426983,
0.054596949368715286,
0.005536800250411034,
0.02049572952091694,
0.033969976007938385,
-0.021053511649370193,
-0.011243121698498726,
-0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "info", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "debug", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
active_children=process.active_children,
current_process=process.current_process):
# We hold on to references to functions in the arglist due to the
# situation described below, where this function ... | |
16,810 | [
-0.024970760568976402,
-0.03202560544013977,
0.05837824568152428,
-0.02271611988544464,
-0.027783002704381943,
-0.020194800570607185,
-0.013891501352190971,
-0.007333646062761545,
0.030716460198163986,
0.03224379941821098,
0.006715437863022089,
-0.0357590988278389,
-0.013503605499863625,
-... | 9 | {"_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 FixedIpTestV2(FixedIpTestV21):
def setUp(self):
super(FixedIpTestV2, self).setUp()
self.flags(
osapi_compute_extension=[
'nova.api.openstack.compute.contrib.select_extensions'],
osapi_compute_ext_list=['Multinic'])
def _get_app(self):
return... | |
16,811 | [
0.013578726910054684,
0.02332700416445732,
0.0859483927488327,
-0.04811732843518257,
-0.003593736095353961,
-0.0006038875435478985,
0.04979583993554115,
-0.006133022718131542,
-0.026103004813194275,
-0.05121611803770065,
-0.025801733136177063,
-0.023671314120292664,
0.035636089742183685,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "base.config.settings"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_c... | class BaseConfigSettings(models.TransientModel):
_inherit = 'base.config.settings'
paperformat_id = fields.Many2one(related="company_id.paperformat_id", string='Paper format *')
def edit_external_header(self):
return self.company_id.edit_external_header()
def edit_external_footer(self):
... | |
16,812 | [
0.042524464428424835,
0.035901185125112534,
0.07360871881246567,
-0.04392940178513527,
0.002176399575546384,
-0.006384941283613443,
0.030858458951115608,
-0.01647038944065571,
-0.039664410054683685,
-0.016595829278230667,
0.01251272950321436,
-0.0022500960621982813,
-0.0341951884329319,
0.... | 14 | {"_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": "options", "annotation"... | class Workload:
def __init__(self, options):
self.db = options["db"]
self.table = options["table"]
self.count = 1
# Get the current max key from environment variables
max_key = os.getenv("X_MAX_KEY")
max_key_file = os.getenv("X_MAX_KEY_FILE")
if max_key is N... | |
16,813 | [
0.036641962826251984,
0.012422002851963043,
0.10361480712890625,
-0.010532209649682045,
-0.0036265181843191385,
0.00586659973487258,
0.03744262456893921,
-0.011715537868440151,
-0.042340777814388275,
-0.0051925149746239185,
0.01211586780846119,
-0.012916527688503265,
-0.007200051564723253,
... | 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": "options", "annotation": null, "type_comment": null}}], "kwarg": n... | def __init__(self, options):
self.db = options["db"]
self.table = options["table"]
self.count = 1
# Get the current max key from environment variables
max_key = os.getenv("X_MAX_KEY")
max_key_file = os.getenv("X_MAX_KEY_FILE")
if max_key is None:
if ... | |
16,814 | [
0.07889586687088013,
0.02605368383228779,
0.03893227502703667,
-0.0091722896322608,
-0.009894212707877159,
0.0018869906198233366,
0.03772047534584999,
0.030294982716441154,
-0.026608018204569817,
-0.014257978647947311,
0.028644872829318047,
0.01329111773520708,
-0.06028056889772415,
-0.014... | 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 update_max_key(self):
if self.count % 1000 == 0:
self.count = 1
if self.key_file is not None:
self.key_file.seek(0)
new_max_key = x_stress_util.perform_ignore_interrupt(lambda: self.key_file.readline())
self.key_dist = x_stress_util.Par... | |
16,815 | [
0.0746283084154129,
0.04338529333472252,
0.06192561984062195,
-0.020817002281546593,
0.012866144999861717,
0.021751023828983307,
0.03708064928650856,
0.060431186109781265,
-0.049689941108226776,
-0.013531635515391827,
0.008161012083292007,
-0.011459275148808956,
-0.011073991656303406,
0.01... | 13 | {"_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": "conn", "annotation": null, "type_comment": null}}], "kwarg": null... | def run(self, conn):
self.update_max_key()
original_key = self.key_dist.get()
key = md5.new(str(original_key)).hexdigest()
rql_res = r.db(self.db).table(self.table).get(key).run(conn)
if rql_res is None:
return {"errors": ["key not found: %d" % original_key]}
... | |
16,816 | [
0.02499409392476082,
-0.0034333865623921156,
0.05714307725429535,
-0.02344546839594841,
0.011830777861177921,
-0.010630292817950249,
-0.039111796766519547,
-0.01961592212319374,
0.026434674859046936,
0.013409415259957314,
0.00011732862913049757,
-0.025882452726364136,
0.002509013283997774,
... | 8 | {"_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 TestLoadBalancer(base.TestCase):
def test_basic(self):
sot = load_balancer.LoadBalancer()
self.assertEqual('loadbalancer', sot.resource_key)
self.assertEqual('loadbalancers', sot.resources_key)
self.assertEqual('/lbaas/loadbalancers', sot.base_path)
self.assertTrue(sot... | |
16,817 | [
0.02893962897360325,
-0.009184177033603191,
0.036443401128053665,
-0.023305688053369522,
0.01141453254967928,
-0.021362530067563057,
-0.044436015188694,
0.001743038184940815,
0.04580478370189667,
-0.013834315352141857,
0.015435283072292805,
-0.02581102028489113,
-0.007839852944016457,
-0.0... | 7 | {"_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 test_basic(self):
sot = load_balancer.LoadBalancer()
self.assertEqual('loadbalancer', sot.resource_key)
self.assertEqual('loadbalancers', sot.resources_key)
self.assertEqual('/lbaas/loadbalancers', sot.base_path)
self.assertTrue(sot.allow_create)
self.assertTrue(sot.a... | |
16,818 | [
0.027493279427289963,
-0.0404047816991806,
0.01253370102494955,
-0.0155097097158432,
0.010220500640571117,
0.0014474071795120835,
-0.047191936522722244,
-0.010300037451088428,
0.04570724442601204,
0.025769978761672974,
0.03899962827563286,
-0.015337378717958927,
-0.013905713334679604,
-0.0... | 7 | {"_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 test_make_it(self):
sot = load_balancer.LoadBalancer(**EXAMPLE)
self.assertTrue(sot.is_admin_state_up)
self.assertEqual(EXAMPLE['description'], sot.description)
self.assertEqual(EXAMPLE['id'], sot.id)
self.assertEqual(EXAMPLE['listeners'], sot.listener_ids)
self.asser... | |
16,819 | [
0.01573900133371353,
0.07519512623548508,
0.06354281306266785,
-0.04076213017106056,
-0.008382957428693771,
0.02072686143219471,
0.027055993676185608,
0.01614767126739025,
0.06928513944149017,
0.022717813029885292,
0.021355582401156425,
0.013360337354242802,
-0.023493237793445587,
-0.02902... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data_train", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data_test", "annotation": null, "type_comment": null}}, {"_... | def train_hyp_config(data_train, data_test, hyp_params, num_boost_rounds):
# Returns validation metric after training configuration for allocated resources
# Inputs: data - DMatrix tuple: (train, test)
# Add evaluation metrics for validation set
hyp_params['eval_metric'] = 'error@0.5'
pList = list(... | |
16,820 | [
-0.0036464612931013107,
0.0020912555046379566,
0.051487237215042114,
0.00545976497232914,
-0.015062333084642887,
0.011018798686563969,
0.01385787595063448,
0.0384896881878376,
0.029648177325725555,
0.00002219322050223127,
-0.014413779601454735,
-0.011892360635101795,
-0.012190165929496288,
... | 8 | {"_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": "Dict", "_fields": {"k... | def xgb_hyp():
gbtree_hyp = {
'booster': 'gbtree',
'eta': hp.uniform('lr', 0.01, 0.17),
'gamma': hp.uniform('mlr', 0.05, 2.5),
'min_child_weight': hp.uniform('mcw', 0, 2),
'max_depth': hp.quniform('md', 3, 9, 1),
'subsample': hp.uniform('ss', 0.7, 1),
'colsamp... | |
16,821 | [
0.00040679884841665626,
-0.022142451256513596,
0.03182834014296532,
0.01747124083340168,
0.008048677816987038,
-0.04536111280322075,
0.021604346111416817,
0.03764445707201958,
-0.003949920181185007,
0.003861190052703023,
-0.019864091649651527,
-0.020436543971300125,
-0.026630476117134094,
... | 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": "Call", "_fields": {"a... | def get_hyp_config():
# Returns a set of i.i.d samples from a distribution over the hyperparameter space
gbtree_hyp, dart_hyp = xgb_hyp()
space = hp.choice('booster', [gbtree_hyp, {**gbtree_hyp, **dart_hyp}])
params = hyperopt.pyll.stochastic.sample(space)
for k, v in params.items():
if type... | |
16,822 | [
0.025510188192129135,
0.010976739227771759,
0.03308693319559097,
0.005876746028661728,
-0.02582361549139023,
0.02305728569626808,
0.007018027361482382,
0.0293258149176836,
0.006115222815424204,
0.025060489773750305,
0.0427350178360939,
-0.029571104794740677,
-0.018328635022044182,
0.023684... | 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ControllabilityTests(unittest.TestCase):
def setUp(self):
controllability_dir = dirname(__file__)
self.examples_dir = join(controllability_dir, join('..', 'examples'))
def assert_dc_result(self, example_file, expected_result):
for solver in DynamicControllability.SOLVERS:
... | |
16,823 | [
0.043730493634939194,
0.02458580769598484,
0.007437458727508783,
0.016990909352898598,
-0.007985349744558334,
0.016147032380104065,
0.012368475086987019,
0.01516460720449686,
-0.022469816729426384,
0.041287027299404144,
0.028842981904745102,
-0.03463676944375038,
0.007141471840441227,
0.01... | 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": "example_file", "annotation": null, "type_comment": null}}, {"_typ... | def assert_dc_result(self, example_file, expected_result):
for solver in DynamicControllability.SOLVERS:
path = join(self.examples_dir, example_file)
if Tpnu.isCCTP(path):
tpnu = Tpnu.parseCCTP(path)
elif Tpnu.isTPN(path):
obj = Tpn.parseTPN(... | |
16,824 | [
0.024798011407256126,
0.013449768535792828,
0.03577539697289467,
-0.006595083978027105,
0.00030151495593599975,
-0.0061284215189516544,
0.007812732830643654,
-0.01834508776664734,
-0.023302217945456505,
0.03802526369690895,
0.016787486150860786,
-0.016218839213252068,
0.030880074948072433,
... | 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": "example_file", "annotation": null, "type_comment": null}}, {"_typ... | def assert_sc_result(self, example_file, expected_result):
path = join(self.examples_dir, example_file)
if Tpnu.isCCTP(path):
tpnu = Tpnu.parseCCTP(path)
elif Tpnu.isTPN(path):
obj = Tpn.parseTPN(join(self.examples_dir, example_file))
tpnu = Tpnu.from_tpn_aut... | |
16,825 | [
0.032269615679979324,
0.015267863869667053,
0.025237729772925377,
-0.007206479553133249,
-0.004924729000777006,
0.009717008098959923,
0.01708604022860527,
-0.017651962116360664,
-0.029524290934205055,
0.051053423434495926,
0.014509286731481552,
-0.002739305142313242,
0.027549583464860916,
... | 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": "example_file", "annotation": null, "type_comment": null}}, {"_typ... | def assert_consistency_result(self, example_file, expected_result):
path = join(self.examples_dir, example_file)
if Tpnu.isCCTP(path):
tpnu = Tpnu.parseCCTP(path)
elif Tpnu.isTPN(path):
obj = Tpn.parseTPN(join(self.examples_dir, example_file))
tpnu = Tpnu.fro... | |
16,826 | [
0.010337033309042454,
-0.008189504966139793,
0.044999588280916214,
-0.001940656453371048,
0.005782565101981163,
0.027162622660398483,
0.0079859159886837,
0.012097086757421494,
0.01788950338959694,
0.03866864740848541,
0.037276364862918854,
0.002050659852102399,
-0.0030587504152208567,
0.01... | 7 | {"_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 test_dc(self):
self.assert_dc_result('test1.tpn', True)
self.assert_dc_result('test2.tpn', False)
self.assert_dc_result('test3.tpn', True)
self.assert_dc_result('test4.tpn', False)
self.assert_dc_result('ControllabilityTest.tpn', False)
self.assert_dc_result('Route1_2... | |
16,827 | [
-0.013751482591032982,
-0.009378262795507908,
0.04511972889304161,
-0.028122400864958763,
-0.014085978269577026,
-0.005289984866976738,
-0.013441764749586582,
-0.014061200432479382,
0.010679079219698906,
0.0032520396634936333,
0.024145621806383133,
0.00003208485577488318,
-0.0123949171975255... | 7 | {"_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 test_sc(self):
self.assert_sc_result('test1.tpn', True)
self.assert_sc_result('test2.tpn', False)
self.assert_sc_result('test3.tpn', True)
self.assert_sc_result('test4.tpn', False)
self.assert_sc_result('ControllabilityTest.tpn', False)
self.assert_sc_result('Route1_2... | |
16,828 | [
-0.0014732263516634703,
-0.012411605566740036,
0.04171968251466751,
-0.026479728519916534,
-0.022050078958272934,
0.005374476779252291,
0.005638292524963617,
-0.009362387470901012,
0.00722118653357029,
0.020835300907492638,
0.015215413644909859,
0.023804759606719017,
0.0010330223012715578,
... | 7 | {"_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 test_consistency(self):
self.assert_consistency_result('test1.tpn', True)
self.assert_consistency_result('test2.tpn', True)
self.assert_consistency_result('test3.tpn', True)
self.assert_consistency_result('test4.tpn', True)
self.assert_consistency_result('ControllabilityTest.... | |
16,829 | [
-0.016323797404766083,
0.042309656739234924,
0.06885489821434021,
-0.023748328909277916,
-0.014353246428072453,
0.007761432323604822,
-0.019247842952609062,
-0.019807225093245506,
0.019019003957509995,
0.017544269561767578,
0.04884426295757294,
-0.06783784180879593,
-0.01094609871506691,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mela", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idx", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_mela_to_degrees(mela, idx):
degrees = librosa.mela_to_degrees(mela)
assert np.allclose(degrees, librosa.mela_to_degrees(idx))
assert len(degrees) == 7
assert np.all(degrees >= 0) and np.all(degrees < 12)
if idx < 37:
# check shuddha
assert np.isin(5, degrees)
else:
... | |
16,830 | [
0.007959544658660889,
0.03174453601241112,
0.042162176221609116,
0.004210950341075659,
-0.030574016273021698,
0.027624301612377167,
0.005047873128205538,
0.006197910290211439,
0.014362296089529991,
0.06461277604103088,
0.01065759640187025,
-0.08760181069374084,
-0.014034549705684185,
0.044... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mela", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "svara", "annotation": null, "type_comment": null}}, {"_type": "ar... | def test_mela_to_svara(mela, svara, abbr, unicode):
svara_est = librosa.mela_to_svara(mela, abbr=abbr, unicode=unicode)
for (s1, s2) in zip(svara_est, svara):
assert s1[0] == s2[0]
if abbr:
for s in svara_est:
assert len(s) in (1, 2)
else:
for s in svara_est:
... | |
16,831 | [
-0.02068755030632019,
0.01041494868695736,
0.04652326554059982,
-0.022787148132920265,
-0.003528983099386096,
-0.043462835252285004,
-0.027686206623911858,
0.020711274817585945,
0.03031959943473339,
0.035467762500047684,
0.04877706989645958,
0.024673225358128548,
-0.05613159015774727,
0.00... | 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 test_ValidFeature(self):
myPath = os.path.join(unitTestDataPath(), 'points.shp')
myLayer = QgsVectorLayer(myPath, 'Points', 'ogr')
provider = myLayer.dataProvider()
fit = provider.getFeatures()
feat = QgsFeature()
fit.nextFeature(feat)
fit.close()
myVa... | |
16,832 | [
0.018948551267385483,
0.011647387407720089,
0.010736281052231789,
-0.003352009691298008,
-0.035927142947912216,
-0.035114534199237823,
0.007572032976895571,
-0.00524809630587697,
0.013691221363842487,
0.01545187272131443,
0.06663389503955841,
0.0033981807064265013,
-0.006556272506713867,
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 test_CreateFeature(self):
feat = QgsFeature(0)
feat.initAttributes(1)
feat.setAttribute(0, "text")
feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(123, 456)))
myId = feat.id()
myExpectedId = 0
myMessage = '\nExpected: %s\nGot: %s' % (myExpectedId, myId)
... | |
16,833 | [
-0.004492761101573706,
0.036699533462524414,
0.04517805576324463,
-0.023480860516428947,
-0.027512434870004654,
-0.033449843525886536,
-0.0286363884806633,
-0.0290517620742321,
-0.004373646341264248,
0.043687596917152405,
0.05639316141605377,
-0.007201856002211571,
-0.03826329484581947,
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 test_Validity(self):
f = QgsFeature()
self.assertFalse(f.isValid())
f.setGeometry(QgsGeometry())
self.assertTrue(f.isValid())
f.setValid(False)
self.assertFalse(f.isValid())
fields = QgsFields()
field1 = QgsField('my_field')
fields.append(field... | |
16,834 | [
-0.0369642935693264,
0.001475792727433145,
0.0450754277408123,
-0.04778728261590004,
0.022000228986144066,
-0.017675919458270073,
-0.007311014924198389,
-0.0123071800917387,
0.01605124957859516,
0.010688617825508118,
0.028828728944063187,
-0.0007249173359014094,
0.00779352942481637,
-0.002... | 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 test_Attributes(self):
myPath = os.path.join(unitTestDataPath(), 'lines.shp')
myLayer = QgsVectorLayer(myPath, 'Lines', 'ogr')
provider = myLayer.dataProvider()
fit = provider.getFeatures()
feat = QgsFeature()
fit.nextFeature(feat)
fit.close()
myAttrib... | |
16,835 | [
0.020188255235552788,
0.038292720913887024,
0.0019443606724962592,
-0.05917965993285179,
-0.03402707725763321,
-0.0017788831610232592,
-0.01722191832959652,
-0.0029203714802861214,
0.019673436880111694,
0.0029663376044481993,
0.06104281172156334,
-0.0101431580260396,
-0.017307721078395844,
... | 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 test_DeleteAttribute(self):
feat = QgsFeature()
feat.initAttributes(3)
feat[0] = "text1"
feat[1] = "text2"
feat[2] = "text3"
feat.deleteAttribute(1)
myAttrs = [feat[0], feat[1]]
myExpectedAttrs = ["text1", "text3"]
myMessage = '\nExpected: %s\n... | |
16,836 | [
0.017490340396761894,
0.01972872205078602,
0.00513458764180541,
-0.024455519393086433,
0.012346822768449783,
0.0005011804169043899,
-0.022967234253883362,
-0.016514023765921593,
0.017657028511166573,
-0.01976444199681282,
0.048625290393829346,
-0.02187185548245907,
-0.008048651739954948,
-... | 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 test_setAttribute(self):
feat = QgsFeature()
feat.initAttributes(1)
with self.assertRaises(KeyError):
feat.setAttribute(-1, 5)
with self.assertRaises(KeyError):
feat.setAttribute(10, 5)
self.assertTrue(feat.setAttribute(0, 5)) | |
16,837 | [
0.0020515669602900743,
0.004798529669642448,
0.04662460833787918,
0.007519904058426619,
-0.001298221992328763,
-0.0034438632428646088,
0.019832316786050797,
-0.02668391913175583,
0.012920507229864597,
0.017725057899951935,
0.024660950526595116,
-0.027599070221185684,
-0.018399380147457123,
... | 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 test_SetGeometry(self):
feat = QgsFeature()
feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(123, 456)))
myGeometry = feat.geometry()
myExpectedGeometry = "!None"
myMessage = '\nExpected: %s\nGot: %s' % (myExpectedGeometry, myGeometry)
assert myGeometry is not None... | |
16,838 | [
0.03486322984099388,
0.04902572184801102,
0.010278335772454739,
-0.06888424605131149,
-0.0343756303191185,
-0.015370406210422516,
-0.0068596117198467255,
0.017642168328166008,
-0.015326078981161118,
0.0008200505399145186,
0.05203996226191521,
-0.007363832090049982,
0.0261307992041111,
0.02... | 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 test_DeleteAttributeByName(self):
fields = QgsFields()
field1 = QgsField('my_field')
fields.append(field1)
field2 = QgsField('my_field2')
fields.append(field2)
feat = QgsFeature(fields)
feat.initAttributes(2)
feat[0] = "text1"
feat[1] = "text2... | |
16,839 | [
-0.028066018596291542,
0.016788028180599213,
0.06537014245986938,
-0.03643658384680748,
-0.02677643485367298,
-0.03533457592129707,
-0.016788028180599213,
-0.014290926046669483,
0.0019915266893804073,
0.019988538697361946,
0.04260313883423805,
-0.00909742247313261,
-0.02846461720764637,
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 testResizeAttributes(self):
f = QgsFeature()
f.resizeAttributes(3)
self.assertEqual(f.attributes(), [NULL, NULL, NULL])
f.setAttributes([1, 2, 3])
f.resizeAttributes(3)
self.assertEqual(f.attributes(), [1, 2, 3])
f.resizeAttributes(5)
self.assertEqual(... | |
16,840 | [
-0.009466980583965778,
0.0004569419543258846,
0.06767021119594574,
-0.023030191659927368,
-0.006537479814141989,
-0.0463901087641716,
-0.016055187210440636,
-0.03411410376429558,
0.05625656619668007,
0.0016216881340369582,
0.009308458305895329,
-0.009676231071352959,
-0.0007660613628104329,
... | 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 testPadAttributes(self):
f = QgsFeature()
f.padAttributes(3)
self.assertEqual(f.attributes(), [NULL, NULL, NULL])
f.setAttributes([1, 2, 3])
f.padAttributes(0)
self.assertEqual(f.attributes(), [1, 2, 3])
f.padAttributes(2)
self.assertEqual(f.attributes... | |
16,841 | [
-0.0009370619081892073,
0.03590814769268036,
0.013030101545155048,
-0.05707787349820137,
-0.028378155082464218,
0.004274141509085894,
-0.005198642145842314,
0.06302683800458908,
0.011897923424839973,
-0.027520647272467613,
0.03296046331524849,
-0.011435672640800476,
-0.06366996467113495,
-... | 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": "g", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def execute(self, g):
self.printer.path_planner.wait_until_done()
for i in range(g.num_tokens()):
axis = g.token_letter(i)
stepper = self.printer.steppers[axis]
stepper.set_microstepping(int(g.token_value(i)))
self.printer.path_planner.update_steps_pr... | |
16,842 | [
0.00752688106149435,
0.039249081164598465,
-0.015637530013918877,
-0.06205329671502113,
-0.05574363097548485,
0.037559881806373596,
-0.012389544397592545,
0.04665175825357437,
0.035448379814624786,
-0.026977533474564552,
0.044838350266218185,
-0.046403344720602036,
-0.03522481024265289,
0.... | 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": "g", "annotation": null... | class M350(GCodeCommand):
def execute(self, g):
self.printer.path_planner.wait_until_done()
for i in range(g.num_tokens()):
axis = g.token_letter(i)
stepper = self.printer.steppers[axis]
stepper.set_microstepping(int(g.token_value(i)))
self.print... | |
16,843 | [
0.040618471801280975,
-0.02459036000072956,
-0.05487148091197014,
0.01773795112967491,
-0.028845379129052162,
-0.005866967607289553,
0.03884337097406387,
-0.04427308961749077,
-0.01421385444700718,
0.013574295677244663,
0.028271082788705826,
-0.016798190772533417,
0.000540850858669728,
-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": "val", "annotation": null, "type_comment": null}}], "kwarg": null,... | def SetbackImage(self, val):
self.__dict__['backImage'] = val
if len(val) > 292:
log.ThugLogging.log_exploit_event(self._window.url,
"MPS.StormPlayer.1 ActiveX",
"backImage Console Overflow")
log.DFT.check_shell... | |
16,844 | [
-0.019166067242622375,
-0.026542892679572105,
-0.06959528475999832,
0.006270872429013252,
0.025197505950927734,
-0.020534256473183632,
0.004301248583942652,
-0.001681733992882073,
-0.003021420445293188,
0.042824357748031616,
0.05103350058197975,
-0.011122247204184532,
-0.0047516110353171825,... | 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": "val", "annotation": null, "type_comment": null}}], "kwarg": null,... | def SetURL(self, val):
self.__dict__['URL'] = val
if len(val) > 259:
log.ThugLogging.log_exploit_event(self._window.url,
"MPS.StormPlayer.1 ActiveX",
"URL Console Overflow")
log.DFT.check_shellcode(val) | |
16,845 | [
0.028529170900583267,
0.03580324724316597,
0.020145490765571594,
-0.009739863686263561,
0.00957958772778511,
0.015448164194822311,
0.0103316530585289,
0.022709911689162254,
-0.012168665416538715,
0.06933797150850296,
0.040759481489658356,
0.017950939014554024,
-0.00720626674592495,
-0.0011... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ctx", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "verbose", "annotation": null, "type_comment": null}}], "kwarg": nu... | def cmd(ctx, verbose):
# we start with warning level
log_level = logbook.WARNING
# log_level=1 is info – for messages you usually don’t want to see
if verbose == 1:
log_level = logbook.INFO
# log_level>1 is debug – for debug messages
elif verbose > 1:
log_level = logbook.DEBUG... | |
16,846 | [
0.023488137871026993,
-0.007831317372620106,
-0.05423201620578766,
-0.010278967209160328,
-0.03081364557147026,
-0.028953198343515396,
0.03588336333632469,
-0.009069676510989666,
-0.001571205211803317,
-0.01333707571029663,
0.06269704550504684,
0.018883531913161278,
0.023883482441306114,
-... | 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": "val", "annotation": null, "type_comment": null}}], "kwarg": null,... | def SettitleImage(self, val):
self.__dict__['titleImage'] = val
if len(val) > 296:
log.ThugLogging.log_exploit_event(self._window.url,
"MPS.StormPlayer.1 ActiveX",
"titleImage Console Overflow")
log.DFT.check_sh... | |
16,847 | [
0.018266616389155388,
0.021037578582763672,
0.02373247593641281,
-0.018136218190193176,
-0.004754101857542992,
-0.020961513742804527,
0.006471011787652969,
-0.0027505874168127775,
0.016712704673409462,
0.026688169687986374,
0.015506521798670292,
-0.030382784083485603,
0.046726029366254807,
... | 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": "sis_login_id", "annotation": null, "type_comment": null}}, {"_typ... | def get_authentication_count_for_sis_login_id_from_start_date(self, sis_login_id, start_date):
url = "/api/v1/audit/authentication/users/sis_login_id:%s" % (sis_login_id)
params = {
'start_time': start_date
}
data = self._get_resource(url, params=params)
return len(... | |
16,848 | [
0.04142969846725464,
0.03174800053238869,
0.03981238976120949,
-0.011708874255418777,
-0.008225013501942158,
-0.010916836559772491,
0.02123549021780491,
-0.006087063811719418,
0.014278844930231571,
0.033099450170993805,
0.014600091613829136,
-0.03482753410935402,
0.03055163286626339,
-0.04... | 8 | {"_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": "sis_login_id", "annota... | class Authentications(Canvas):
def get_authentication_count_for_sis_login_id_from_start_date(self, sis_login_id, start_date):
url = "/api/v1/audit/authentication/users/sis_login_id:%s" % (sis_login_id)
params = {
'start_time': start_date
}
data = self._get_resource(url, ... | |
16,849 | [
-0.011907759122550488,
-0.01114340964704752,
-0.011896265670657158,
-0.03202221915125847,
0.01273532584309578,
0.0038820905610919,
-0.0067009879276156425,
-0.0315854474902153,
0.005830319598317146,
0.04220588132739067,
0.008994036354124546,
-0.013459445908665657,
0.018861614167690277,
0.04... | 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 TestView(TestCase):
def test_type(self):
x = np.array([1,2,3])
assert(isinstance(x.view(np.matrix),np.matrix))
def test_keywords(self):
x = np.array([(1,2)],dtype=[('a',np.int8),('b',np.int8)])
# We must be specific about the endianness here:
y = x.view(dtype='<i2'... | |
16,850 | [
0.03727854788303375,
-0.02495257742702961,
-0.0014222274767234921,
-0.017610182985663414,
0.007741311565041542,
-0.00895540788769722,
-0.004330277908593416,
0.01698579080402851,
0.050182659178972244,
0.03628414496779442,
0.003046804340556264,
-0.026293864473700523,
0.008082414977252483,
0.... | 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 test_keywords(self):
x = np.array([(1,2)],dtype=[('a',np.int8),('b',np.int8)])
# We must be specific about the endianness here:
y = x.view(dtype='<i2', type=np.matrix)
assert_array_equal(y,[[513]])
assert(isinstance(y,np.matrix))
assert_equal(y.dtype, np.dtype('<i2')... | |
16,851 | [
-0.009630893357098103,
0.014562937431037426,
0.006937508005648851,
-0.0021861896384507418,
0.0016017481684684753,
0.008161774836480618,
-0.04703513905405998,
0.007625429425388575,
0.017337940633296967,
0.04486643895506859,
0.04442337155342102,
-0.007992709055542946,
0.02384404093027115,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,... | def webfilter_fortiguard(data, fos):
vdom = data['vdom']
webfilter_fortiguard_data = data['webfilter_fortiguard']
filtered_data = underscore_to_hyphen(filter_webfilter_fortiguard_data(webfilter_fortiguard_data))
return fos.set('webfilter',
'fortiguard',
data=filter... | |
16,852 | [
-0.030357861891388893,
0.02941151335835457,
0.0013362502213567495,
0.01042851060628891,
0.025551406666636467,
0.02906285785138607,
-0.040668077766895294,
0.023559095337986946,
0.054190900176763535,
0.04507606849074364,
0.032126039266586304,
-0.024692222476005554,
0.023110825568437576,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,... | def fortios_webfilter(data, fos):
if data['webfilter_fortiguard']:
resp = webfilter_fortiguard(data, fos)
return not is_successful_status(resp), \
resp['status'] == "success", \
resp | |
16,853 | [
0.037841640412807465,
0.012405915185809135,
0.01602930575609207,
-0.019748682156205177,
-0.018284928053617477,
-0.016701193526387215,
0.002336607314646244,
-0.005186128430068493,
0.004289279226213694,
0.022484222427010536,
0.023264091461896896,
-0.02321609854698181,
0.050583500415086746,
-... | 13 | {"_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": "company", "annotation": null, "type_comment": null}}, {"_type": "... | def _find_moves_from_stock_planning(
self, company, to_date, from_date=None, category=None, template=None,
product=None, location_id=None, location_dest_id=None):
cond = [('company_id', '=', company.id),
('date', '<=', to_date),
('state', '!=', 'cancel')]
... | |
16,854 | [
0.04712776467204094,
0.015394918620586395,
-0.0009415895910933614,
-0.03435736894607544,
-0.024745484814047813,
-0.023132143542170525,
0.0042634266428649426,
-0.020098606124520302,
-0.014451908878982067,
-0.01974639669060707,
0.0182807557284832,
-0.03251679614186287,
0.03253951668739319,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.move"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class StockMove(models.Model):
_inherit = 'stock.move'
def _find_moves_from_stock_planning(
self, company, to_date, from_date=None, category=None, template=None,
product=None, location_id=None, location_dest_id=None):
cond = [('company_id', '=', company.id),
('date',... | |
16,855 | [
0.03642396256327629,
-0.016112297773361206,
0.0240468867123127,
-0.049419891089200974,
-0.009509350173175335,
-0.007973266765475273,
-0.0157255157828331,
0.0014987863833084702,
-0.013824749737977982,
0.039363518357276917,
-0.030323831364512444,
-0.006293521262705326,
0.03918670117855072,
-... | 13 | {"_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": "template", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, template, start='${', end='}$'):
if len(start) != 2 or len(end) != 2:
raise ValueError('each delimiter must be two characters long')
delimiter = re.compile('%s(.*?)%s' % (re.escape(start), re.escape(end)), re.DOTALL)
offset = 0
tokens = []
for i, pa... | |
16,856 | [
-0.006056783255189657,
-0.027425114065408707,
0.011615179479122162,
-0.01832955703139305,
-0.016460606828331947,
0.05161071568727493,
-0.0026701760943979025,
0.046820662915706635,
0.033059652894735336,
-0.010874521918594837,
0.014605499804019928,
-0.01798345521092415,
-0.011705165728926659,
... | 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 testBijector(self):
with self.cached_session():
chain = Chain((Exp(), Softplus()))
self.assertEqual("chain_of_exp_of_softplus", chain.name)
x = np.asarray([[[1., 2.],
[2., 3.]]])
self.assertAllClose(1. + np.exp(x), chain.forward(x).eval())
self.assertAllClose... | |
16,857 | [
0.0039029258769005537,
-0.015858139842748642,
0.02666434645652771,
-0.001040420844219625,
0.020491130650043488,
0.05431443452835083,
0.002495161723345518,
0.03755680471658707,
0.018260886892676353,
0.004032304510474205,
0.035191021859645844,
0.004528256598860025,
0.04016902297735214,
0.016... | 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 testShapeGetters(self):
with self.cached_session():
chain = Chain([
SoftmaxCentered(validate_args=True),
SoftmaxCentered(validate_args=True),
])
x = tensor_shape.TensorShape([1])
y = tensor_shape.TensorShape([2 + 1])
self.assertAllEqual(y, chain.forward_event_sh... | |
16,858 | [
0.012974311597645283,
-0.021347030997276306,
0.012960697524249554,
-0.002697309013456106,
0.0058030434884130955,
0.03357256203889847,
-0.010408039204776287,
0.03104032576084137,
0.022994346916675568,
-0.0058166575618088245,
-0.00396172609180212,
-0.018011556938290596,
0.016745438799262047,
... | 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 testBijectorIdentity(self):
with self.cached_session():
chain = Chain()
self.assertEqual("identity", chain.name)
x = np.asarray([[[1., 2.],
[2., 3.]]])
self.assertAllClose(x, chain.forward(x).eval())
self.assertAllClose(x, chain.inverse(x).eval())
self.... | |
16,859 | [
-0.00454124016687274,
0.00798765942454338,
0.0650414377450943,
0.00622234120965004,
0.03635583445429802,
0.05747486650943756,
0.017854005098342896,
0.004107198677957058,
-0.0026350205298513174,
0.01746531017124653,
0.01412254385650158,
0.007935833185911179,
0.014200282283127308,
0.06172458... | 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 testMinEventNdimsShapeChangingAddDims(self):
chain = Chain([ShapeChanging()])
self.assertEqual(0, chain.forward_min_event_ndims)
self.assertEqual(3, chain.inverse_min_event_ndims)
chain = Chain([ShapeChanging(), Affine()])
self.assertEqual(1, chain.forward_min_event_ndims)
self.assertEqual(... | |
16,860 | [
0.0013575636548921466,
0.0003008423082064837,
0.03790735453367233,
-0.02615920640528202,
0.029265938326716423,
0.060829292982816696,
0.0001623528660275042,
-0.0030153575353324413,
0.015350911766290665,
0.033678021281957626,
0.028613263741135597,
-0.00990760326385498,
-0.0124465087428689,
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 testMinEventNdimsChain(self):
chain = Chain([Exp(), Exp(), Exp()])
self.assertEqual(0, chain.forward_min_event_ndims)
self.assertEqual(0, chain.inverse_min_event_ndims)
chain = Chain([Affine(), Affine(), Affine()])
self.assertEqual(1, chain.forward_min_event_ndims)
self.assertEqual(1, chain... | |
16,861 | [
0.002952652983367443,
0.012326519936323166,
0.022699959576129913,
-0.02869432233273983,
0.008899415843188763,
0.04402416571974754,
0.02218405157327652,
0.012971405871212482,
-0.00399214681237936,
0.07345549762248993,
0.03314095735549927,
-0.02412484958767891,
-0.020034434273838997,
0.02281... | 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 testChainExpAffine(self):
scale_diag = np.array([1., 2., 3.], dtype=np.float32)
chain = Chain([Exp(), Affine(scale_diag=scale_diag)])
x = [0., np.log(2., dtype=np.float32), np.log(3., dtype=np.float32)]
y = [1., 4., 27.]
self.assertAllClose(y, self.evaluate(chain.forward(x)))
self.assertAllC... | |
16,862 | [
-0.007391457445919514,
0.004792546387761831,
0.05588945373892784,
0.013290471397340298,
0.037105247378349304,
0.059594832360744476,
0.013329069130122662,
0.0032743706833571196,
-0.003525255713611841,
0.02148604765534401,
0.01888713613152504,
0.008575120009481907,
0.014448401518166065,
0.06... | 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 testMinEventNdimsShapeChangingRemoveDims(self):
chain = Chain([ShapeChanging(3, 0)])
self.assertEqual(3, chain.forward_min_event_ndims)
self.assertEqual(0, chain.inverse_min_event_ndims)
chain = Chain([ShapeChanging(3, 0), Affine()])
self.assertEqual(3, chain.forward_min_event_ndims)
self.a... | |
16,863 | [
0.00984422117471695,
-0.021971335634589195,
0.010085796937346458,
-0.019797151908278465,
0.027877869084477425,
0.011372189037501812,
-0.005589464213699102,
0.03418300300836563,
0.00300460122525692,
0.005498873069882393,
0.043217942118644714,
0.005903513170778751,
0.015738675370812416,
-0.0... | 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 testChainIldjWithPlaceholder(self):
chain = Chain((Exp(), Exp()))
samples = array_ops.placeholder(
dtype=np.float32, shape=[None, 10], name="samples")
ildj = chain.inverse_log_det_jacobian(samples, event_ndims=0)
self.assertTrue(ildj is not None)
with self.cached_session():
ildj.ev... | |
16,864 | [
0.004327248781919479,
0.011352629400789738,
0.02268116921186447,
-0.03025761805474758,
0.010057766921818256,
0.04514552280306816,
0.02039257436990738,
0.016080383211374283,
-0.0038785641081631184,
0.07386135309934616,
0.032088492065668106,
-0.024247048422694206,
-0.018682152032852173,
0.02... | 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 testChainAffineExp(self):
scale_diag = np.array([1., 2., 3.], dtype=np.float32)
chain = Chain([Affine(scale_diag=scale_diag), Exp()])
x = [0., np.log(2., dtype=np.float32), np.log(3., dtype=np.float32)]
y = [1., 4., 9.]
self.assertAllClose(y, self.evaluate(chain.forward(x)))
self.assertAllCl... | |
16,865 | [
0.018487323075532913,
0.020997947081923485,
-0.03248926252126694,
0.03334267437458038,
0.04282946139574051,
0.050291869789361954,
-0.02689245529472828,
-0.028976373374462128,
0.015510298311710358,
0.04540954902768135,
-0.006817386485636234,
-0.04985523968935013,
0.0410432443022728,
-0.0160... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fie... | class _StateEnum(object):
class State(object):
name = None
def __repr__(self):
return "states.%s" % self.name
def __setattr__(self, key, value):
if isinstance(value, self.State):
value.name = key
object.__setattr__(self, key, value) | |
16,866 | [
0.018583768978714943,
-0.0029698095750063658,
0.038194265216588974,
-0.0007591366884298623,
-0.014312582090497017,
-0.041952088475227356,
0.029015321284532547,
0.022074643522500992,
-0.010488022118806839,
0.02273174747824669,
-0.04143872484564781,
0.00028555860626511276,
0.012043514288961887... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Create"}}, "targets": [{"_type": "Name", "_fields": {"id": "button_prefix", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class ProjectCreateForm(forms.ModelForm):
button_prefix = "Create"
class Meta:
model = models.Project
fields = [
'name',
'description',
'use_repo_fabfile',
'repo_url',
'fabfile_requirements',
]
def __init__(self, *args, *... | |
16,867 | [
0.014459445141255856,
-0.024050530046224594,
0.031602729111909866,
0.015010775998234749,
-0.0026786380913108587,
-0.035264402627944946,
0.014220188371837139,
0.011775605380535126,
-0.013086318038403988,
0.046062175184488297,
-0.024674678221344948,
-0.008717277087271214,
0.0006150465342216194... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.layout = Layout(
'name',
'description',
'use_repo_fabfile',
'repo_url',
'fabfile_requirements',
FormActions(
Submit('submit', '%s Project' %... | |
16,868 | [
0.03819170966744423,
0.003686985932290554,
0.02276645414531231,
-0.02934294566512108,
-0.021531997248530388,
0.0030533703975379467,
0.05785563588142395,
-0.0032063121907413006,
-0.021389979869127274,
0.03508917987346649,
-0.02853453904390335,
-0.021881578490138054,
-0.002608201000839472,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Update"}}, "targets": [{"_type": "Name", "_fields": {"id": "button_prefix", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class ConfigurationUpdateForm(forms.ModelForm):
button_prefix = "Update"
class Meta:
model = models.Configuration
fields = [
'key',
'data_type',
'value',
'value_number',
'value_boolean',
'value_ssh_key',
'task_... | |
16,869 | [
0.06318828463554382,
-0.01379641704261303,
0.012882824055850506,
-0.023475881665945053,
-0.012131133116781712,
0.019439879804849625,
0.047691889107227325,
0.017601128667593002,
-0.008661790750920773,
0.04149333015084267,
0.004570858087390661,
-0.032126106321811676,
-0.006984942127019167,
0... | 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 clean(self):
cleaned_data = super(ConfigurationUpdateForm, self).clean()
key = self.cleaned_data.get('key', None)
task_argument = self.cleaned_data.get('task_argument', None)
data_type = self.cleaned_data.get('data_type', None)
task_name = self.cleaned_data.get('task_name', N... | |
16,870 | [
0.035741228610277176,
-0.02090904302895069,
0.022274747490882874,
0.014366365037858486,
-0.004263856448233128,
-0.010200436227023602,
0.05407766252756119,
-0.0000063738252720213495,
-0.023820428177714348,
0.04628573730587959,
-0.03868437558412552,
-0.016346106305718422,
0.009035882540047169,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-lg-2'
self.helper.field_class = 'col-lg-8'
self.helper.layout = Layout(
'data_type',
'key',
'value',
... | |
16,871 | [
0.032910462468862534,
0.03167429193854332,
0.05341870337724686,
0.02551371417939663,
-0.003860494354739785,
0.0049674734473228455,
0.003977018408477306,
0.007391681428998709,
-0.0062213740311563015,
0.02403436414897442,
-0.025351593270897865,
-0.015330519527196884,
0.02237262949347496,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "comments"}}]}}... | class DeploymentForm(forms.ModelForm):
class Meta:
fields = ['comments']
model = models.Deployment
def __init__(self, *args, **kwargs):
super(DeploymentForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.layout = Layout(
'comments'... | |
16,872 | [
0.03030460886657238,
-0.021760227158665657,
0.05334249883890152,
0.05777439847588539,
0.007790760137140751,
-0.00982204731553793,
0.020801978185772896,
0.018396375700831413,
-0.030524207279086113,
0.01438370905816555,
-0.022518839687108994,
-0.004274686798453331,
0.019654076546430588,
-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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
super(DeploymentForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.layout = Layout(
'comments',
FormActions(
Submit('submit', 'Go!', css_class='btn btn-success')
)
) | |
16,873 | [
0.051617249846458435,
-0.017722615972161293,
0.035570114850997925,
0.015724528580904007,
-0.011686728335916996,
-0.03438374772667885,
0.011946896091103554,
0.025454796850681305,
-0.021750010550022125,
0.04300050064921379,
-0.019273215904831886,
0.00982913188636303,
0.0026133835781365633,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.layout = Layout(
'name',
FormActions(
Submit('submit', '%s Stage' % self.button_prefix, css_class='button')
)
)
super(StageCreateForm, self).__init__(*args, **... | |
16,874 | [
0.048033107072114944,
0.0016694675432518125,
0.0279400497674942,
-0.01915181428194046,
-0.0250073354691267,
-0.03832344710826874,
0.033468615263700485,
0.029881983995437622,
-0.014871636405587196,
0.023560794070363045,
-0.023838212713599205,
0.0023692073300480843,
0.02039029262959957,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Create"}}, "targets": [{"_type": "Name", "_fields": {"id": "button_prefix", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class StageCreateForm(forms.ModelForm):
button_prefix = "Create"
class Meta:
model = models.Stage
fields = [
'name',
]
def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.layout = Layout(
'name',
FormAction... | |
16,875 | [
0.04779167100787163,
0.024149276316165924,
-0.02493373490869999,
-0.032247308641672134,
-0.03750922158360481,
0.028457768261432648,
-0.044798657298088074,
-0.02073386125266552,
0.003376191947609186,
0.009172138758003712,
-0.01530298963189125,
-0.00013944895181339234,
0.03941605985164642,
-... | 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 activate(self):
self.commands.register("signal_list", "List of all signals", self.list_signals)
self.commands.register("receiver_list", "List of all signal receivers", self.list_receivers)
self.documents.register(name="signals_overview",
content=signal_conten... | |
16,876 | [
-0.008195198141038418,
-0.00011337106843711808,
0.021007690578699112,
-0.054008353501558304,
0.004342455416917801,
-0.02376607432961464,
-0.002935779746621847,
-0.028383368626236916,
-0.012402732856571674,
0.024705523625016212,
0.007570564281195402,
-0.01599062979221344,
0.009984149597585201... | 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 test_plugins__get_package_paths_with_package(self):
# the _get_package_paths() call uses __import__ to load a
# python library, and then uses the __file__ attribute of
# the result for that to get the library path, so we mock
# that here and patch the builtin to use our mocked result... | |
16,877 | [
0.002709868596866727,
-0.01210001576691866,
0.013901639729738235,
-0.0083243353292346,
0.001957705244421959,
-0.03334490954875946,
-0.015935156494379044,
0.051658447831869125,
-0.009638391435146332,
0.011992989107966423,
0.001969597302377224,
0.008116226643323898,
0.001639596768654883,
-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 setUp(self):
assert os.geteuid() == 0, 'Run test as root since we might need to logout'
pyauto.PyUITest.setUp(self)
if self.GetLoginInfo()['is_logged_in']:
self.Logout()
self.LoginAsGuest()
login_info = self.GetLoginInfo()
self.assertTrue(login_info['is_logged_in'], msg='Not logged in ... | |
16,878 | [
-0.0007228896138258278,
0.01972045935690403,
0.01719127781689167,
-0.035551704466342926,
-0.0035283276811242104,
-0.024981634691357613,
-0.008547917939722538,
-0.03941705822944641,
0.0315193310379982,
0.010939903557300568,
0.03369060903787613,
-0.0414213165640831,
0.01691688410937786,
-0.0... | 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": "filename", "annotation... | class HTMLItem(pytest.Item, pytest.Collector):
def __init__(self, filename, parent):
self.filename = filename
with io.open(filename, encoding=ENC) as f:
markup = f.read()
parsed = html5lib.parse(markup, namespaceHTMLElements=False)
name = None
self.expected = Non... | |
16,879 | [
0.00013440518523566425,
-0.0008441657410003245,
0.014651915989816189,
-0.05791054666042328,
0.015062717720866203,
-0.024461355060338974,
-0.013108299113810062,
0.002497485838830471,
0.020390687510371208,
0.02850712649524212,
-0.021423915401101112,
-0.004655749071389437,
0.022731009870767593,... | 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 runtest(self):
driver = self.session.config.driver
server = self.session.config.server
driver.get(server.url(HARNESS))
actual = driver.execute_async_script('runTest("%s", "foo", arguments[0])' % server.url(str(self.filename)))
# Test object ordering is not guaranteed. This... | |
16,880 | [
0.010327069088816643,
0.03890759497880936,
0.004912601318210363,
-0.012696707621216774,
0.009840724058449268,
-0.021833784878253937,
0.01141358446329832,
-0.047806672751903534,
0.02665584161877632,
0.016577119007706642,
0.0449506901204586,
-0.021481959149241447,
0.014497218653559685,
-0.05... | 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": "filename", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, filename, parent):
self.filename = filename
with io.open(filename, encoding=ENC) as f:
markup = f.read()
parsed = html5lib.parse(markup, namespaceHTMLElements=False)
name = None
self.expected = None
for element in parsed.getiterator():
... | |
16,881 | [
0.0588606521487236,
0.025704067200422287,
-0.04120245575904846,
-0.005666524637490511,
-0.030593298375606537,
0.050173960626125336,
0.013374184258282185,
-0.017551392316818237,
0.0785125121474266,
0.04117872193455696,
0.015593325719237328,
-0.008063672110438347,
0.011570390313863754,
-0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "status_obj", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def _expand_status(status_obj):
for key, value in [item for item in status_obj.items()]:
# In "status" and "test" objects, the "status" value enum
# definitions are interspersed with properties for unrelated
# metadata. The following condition is a best-effort attempt to
... | |
16,882 | [
0.06142148748040199,
0.04889891669154167,
0.04495417699217796,
-0.010629624128341675,
-0.05408797413110733,
-0.02613060735166073,
0.012542426586151123,
-0.03327879682183266,
0.024330321699380875,
0.014389042742550373,
-0.0358203761279583,
-0.055226389318704605,
0.04177720099687576,
-0.0240... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "core", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def addTemplate(core):
mobileTemplate = MobileTemplate()
mobileTemplate.setCreatureName('tatooine_opening_cultist_10')
mobileTemplate.setLevel(4)
mobileTemplate.setDifficulty(Difficulty.NORMAL)
mobileTemplate.setMinSpawnDistance(4)
mobileTemplate.setMaxSpawnDistance(8)
mobileTemplate.setDeathblow(False)
mobi... | |
16,883 | [
0.005569822154939175,
-0.020941808819770813,
0.06829584389925003,
-0.04359462857246399,
0.004373922012746334,
-0.010766114108264446,
0.02944866567850113,
0.005358958151191473,
-0.01731494814157486,
0.009741917252540588,
0.04082327336072922,
-0.026460422202944756,
-0.006283747497946024,
-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": "hosts", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self, hosts, n, b, verbose, python_executable,
externalHostname, executable, arguments, tunnel, path, debug,
nice, env, profile, pythonPath, prolog, backend, rsh,
ssh_executable):
# Assure setup sanity
assert type(hosts) == list and hosts, (
"... | |
16,884 | [
0.020718811079859734,
-0.010126871056854725,
0.04483262449502945,
-0.014265982434153557,
0.015079853124916553,
0.022451192140579224,
0.020183982327580452,
-0.03008994460105896,
-0.024067305028438568,
0.025276483967900276,
0.02283487282693386,
-0.05418050289154053,
0.01854461431503296,
-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": "tile", "annotation": n... | class Food(pygame.sprite.Sprite):
def __init__(self, tile, x, y):
super(Food, self).__init__()
self.tile = tile
self.energy = 1000
w = self.w = 9
h = self.h = 5
self.image = pygame.Surface((w, h), SRCALPHA).convert_alpha()
self.rect = self.image.get_rect()
... | |
16,885 | [
-0.007832830771803856,
-0.01750192977488041,
0.054996225982904434,
0.0034028340596705675,
0.014839340932667255,
0.010087997652590275,
0.02403215691447258,
-0.03833209350705147,
-0.015332837589085102,
0.03931909054517746,
0.02944914810359478,
-0.05472078546881676,
-0.019854648038744926,
-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": "tile", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, tile, x, y):
super(Food, self).__init__()
self.tile = tile
self.energy = 1000
w = self.w = 9
h = self.h = 5
self.image = pygame.Surface((w, h), SRCALPHA).convert_alpha()
self.rect = self.image.get_rect()
self.rect.x = tile.rect.x + x
... | |
16,886 | [
0.016440637409687042,
0.017782730981707573,
0.07011277973651886,
0.014138254337012768,
-0.03792569413781166,
0.003916365560144186,
0.02089499682188034,
0.009828516282141209,
-0.0438031330704689,
0.03357546031475067,
0.021392498165369034,
-0.007150115445256233,
-0.0002847247233148664,
-0.03... | 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 draw(self):
if self.redraw:
pygame.draw.ellipse(self.image, (96, 96, 0), Rect(3, 2, 3, 3), 0)
pygame.draw.ellipse(self.image, (128, 128, 0), Rect(0, 0, 9, 5), 0)
if self.tile.world.active_item is self:
pygame.draw.lines(self.image, (0, 0, 255), 1, [
... | |
16,887 | [
0.005244284402579069,
0.02718789130449295,
-0.05268578231334686,
-0.018051322549581528,
-0.042968276888132095,
0.01506213378161192,
-0.004132580477744341,
-0.014565696008503437,
0.010763193480670452,
0.06612128764390945,
0.01574869640171528,
0.0061156912706792355,
0.02010045014321804,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def removeDir(path):
result = ""
if not QFile(path).exists():
result = QCoreApplication.translate("QgsPluginInstaller", "Nothing to remove! Plugin directory doesn't exist:") + "\n" + path
elif QFile(path).remove(): # if it is only link, just remove it without resolving.
pass
else:
... | |
16,888 | [
0.0029086684808135033,
0.0337367057800293,
-0.006548512727022171,
-0.026732811704277992,
-0.03206911310553551,
0.03432677686214447,
0.01867705024778843,
-0.014867240563035011,
-0.017496908083558083,
0.020947543904185295,
0.05320907011628151,
-0.0023570796474814415,
0.021422166377305984,
0.... | 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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _ProcessDurationEvent(self, event):
thread = (self._GetOrCreateProcess(event['pid'])
.GetOrCreateThread(event['tid']))
if not thread.IsTimestampValidForBeginOrEnd(event['ts'] / 1000.0):
self._model.import_errors.append(
'Timestamps are moving backward.')
return
if event['ph'... | |
16,889 | [
0.021793201565742493,
0.03241686150431633,
-0.01678580418229103,
-0.03705684095621109,
-0.01298564113676548,
0.019221268594264984,
-0.013437042012810707,
-0.043460432440042496,
-0.029708459973335266,
0.02454359643161297,
0.015610063448548317,
0.02765091322362423,
0.02107935957610607,
-0.03... | 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": "model", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self, model, trace_data):
super(TraceEventTimelineImporter, self).__init__(
model, trace_data, import_order=1)
assert isinstance(trace_data, trace_data_module.TraceData)
self._trace_data = trace_data
self._all_async_events = []
self._all_object_events = []
self._all_flow_ev... | |
16,890 | [
0.010046236217021942,
0.0018919409485533834,
-0.051638856530189514,
0.001618226058781147,
-0.00553445378318429,
0.0004147080471739173,
0.026252560317516327,
0.006827831268310547,
-0.0013918849872425199,
0.01844416745007038,
0.05255324766039848,
0.02502535469830036,
-0.0011956224916502833,
... | 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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _ProcessCompleteEvent(self, event):
thread = (self._GetOrCreateProcess(event['pid'])
.GetOrCreateThread(event['tid']))
thread.PushCompleteSlice(
event['cat'],
event['name'],
event['ts'] / 1000.0,
event['dur'] / 1000.0 if 'dur' in event else None,
event['tts'] ... | |
16,891 | [
0.01857111230492592,
0.03721066936850548,
-0.0004901581560261548,
-0.004083819687366486,
-0.0014080906985327601,
0.023795664310455322,
0.005298698786646128,
-0.02491358108818531,
-0.040838196873664856,
-0.015491136349737644,
0.024023810401558876,
0.01873081550002098,
0.013802853412926197,
... | 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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _ProcessMetadataEvent(self, event):
if event['name'] == 'thread_name':
thread = (self._GetOrCreateProcess(event['pid'])
.GetOrCreateThread(event['tid']))
thread.name = event['args']['name']
elif event['name'] == 'process_name':
process = self._GetOrCreateProcess(event['pid'])
... | |
16,892 | [
-0.0195204708725214,
0.01810147427022457,
-0.03509242832660675,
0.0030570144299417734,
-0.010056374594569206,
-0.007736621890217066,
0.026430372148752213,
-0.004725879058241844,
0.022617587819695473,
0.03427804633975029,
0.04291542246937752,
0.0011251725954934955,
0.017681943252682686,
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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _ProcessInstantEvent(self, event):
# Treat an Instant event as a duration 0 slice.
# SliceTrack's redraw() knows how to handle this.
thread = (self._GetOrCreateProcess(event['pid'])
.GetOrCreateThread(event['tid']))
thread.BeginSlice(event['cat'],
event['name'],
... | |
16,893 | [
0.009367735125124454,
0.01926521025598049,
-0.013200236484408379,
0.01726517453789711,
-0.012519143521785736,
0.028411319479346275,
-0.03290869668126106,
-0.01003801729530096,
-0.00008408090070588514,
-0.020994970574975014,
0.03762229532003403,
-0.015621901489794254,
0.021773362532258034,
... | 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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _ProcessMemoryDumpEvent(self, event):
dump_id = event.get('id')
if not dump_id:
self._model.import_errors.append(
'Memory dump event with missing dump id.')
return
self._all_memory_dump_events_by_dump_id.setdefault(dump_id, [])
self._all_memory_dump_events_by_dump_id[dump_id].a... | |
16,894 | [
0.005815024487674236,
-0.01104204822331667,
-0.045208025723695755,
-0.05733942240476608,
0.007489281240850687,
0.005923340562731028,
0.006430878769606352,
-0.011004910804331303,
-0.00990318227559328,
-0.0017732884734869003,
0.039117567241191864,
-0.023173445835709572,
0.024782713502645493,
... | 17 | {"_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 _CreateAsyncSlices(self):
if len(self._all_async_events) == 0:
return
self._all_async_events.sort(key=lambda x: x['event']['ts'])
async_event_states_by_name_then_id = {}
all_async_events = self._all_async_events
for async_event_state in all_async_events:
event = async_event_state[... | |
16,895 | [
0.026383250951766968,
0.009589528664946556,
-0.036816079169511795,
-0.044911760836839676,
0.020383771508932114,
-0.044068459421396255,
-0.047273002564907074,
-0.023166662082076073,
-0.012866351753473282,
0.039683301001787186,
0.019901884719729424,
-0.00034673191839829087,
0.02681694738566875... | 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 _CreateFlowSlices(self):
if len(self._all_flow_events) == 0:
return
self._all_flow_events.sort(key=lambda x: x['event']['ts'])
flow_id_to_event = {}
for data in self._all_flow_events:
event = data['event']
thread = data['thread']
if 'name' not in event:
self._model.... | |
16,896 | [
0.054800186306238174,
0.0398823581635952,
0.028272835537791252,
-0.06287813931703568,
-0.02200125902891159,
0.0029683434404432774,
-0.010462775826454163,
-0.00789021234959364,
-0.02581697702407837,
0.0009818366961553693,
-0.017495466396212578,
-0.03955761715769768,
-0.004658015910536051,
0... | 15 | {"_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": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _load_migrations_module(self, module):
self._migrations = module
filenames = []
dirname = self.migrations_dir()
for f in os.listdir(dirname):
if self.MIGRATION_FILENAME.match(os.path.basename(f)):
full_path = os.path.join(dirname, f)
# If i... | |
16,897 | [
0.04261985421180725,
0.020841576159000397,
0.05861066281795502,
-0.028547050431370735,
-0.011820263229310513,
-0.027855675667524338,
-0.0009283366962336004,
-0.006395208183676004,
-0.030732683837413788,
0.005179728381335735,
-0.009523117914795876,
-0.06512296199798584,
-0.009640204720199108,... | 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": "application", "annotation": null, "type_comment": null}}], "kwarg... | def __call__(self, application, **kwds):
app_label = application_to_app_label(application)
# If we don't already have an instance, make one
if app_label not in self.instances:
self.instances[app_label] = super(MigrationsMetaclass, self).__call__(app_label_to_app_mod... | |
16,898 | [
0.056221913546323776,
0.024724915623664856,
0.0490407794713974,
-0.0365874208509922,
-0.048404473811388016,
0.015214458107948303,
-0.014475892297923565,
0.028133681043982506,
-0.030178939923644066,
0.05204049125313759,
-0.02527031861245632,
-0.005056336056441069,
0.020384419709444046,
0.02... | 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": "prefix", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _guess_migration(self, prefix):
prefix = Migration.strip_filename(prefix)
matches = [m for m in self if m.name().startswith(prefix)]
if len(matches) == 1:
return matches[0]
elif len(matches) > 1:
raise exceptions.MultiplePrefixMatches(prefix, matches)
... | |
16,899 | [
0.05950639024376869,
0.04264293611049652,
0.0007264448795467615,
-0.014665494672954082,
0.01954571343958378,
-0.01740984246134758,
0.02560563012957573,
0.0006845346069894731,
-0.004442489705979824,
-0.012212966568768024,
-0.022302478551864624,
-0.061244893819093704,
0.02784084528684616,
-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 prev_orm(self):
if getattr(self.migration_class(), 'symmetrical', False):
return self.orm()
previous = self.previous()
if previous is None:
# First migration? The 'previous ORM' is empty.
return FakeORM(None, self.app_label())
return previous.orm() | |
16,900 | [
0.018946338444948196,
-0.010038454085588455,
0.03637697175145149,
-0.015442819334566593,
0.005363988224416971,
0.00711264181882143,
0.018176062032580376,
-0.0052055842243134975,
0.033370405435562134,
0.03573093190789223,
0.008566229604184628,
-0.0366254486143589,
0.034364309161901474,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "handler", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": n... | def call_handler(handler, path):
odd = os.getcwd()
ndd,arg1 = os.path.split(path)
common.g_curr_dir = ndd
if ndd:
os.chdir(ndd)
try:
handler(arg1)
finally:
os.chdir(odd)
common.g_curr_dir = '' |