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,401
[ 0.016446130350232124, 0.026065312325954437, -0.05050070583820343, -0.03617881238460541, -0.015043332241475582, -0.015751410275697708, -0.025343872606754303, 0.013707335107028484, 0.016619808971881866, 0.00600530905649066, 0.03545737639069557, -0.055791258811950684, -0.0012107477523386478, ...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Name = params.get("Name") self.Quantity = params.get("Quantity") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: ...
15,402
[ 0.020209956914186478, 0.014314296655356884, -0.01468032505363226, -0.042067039757966995, -0.011457974091172218, -0.022824440151453018, -0.03231501579284668, -0.03260260820388794, 0.01891578733921051, 0.009817385114729404, 0.007144076284021139, -0.06086517497897148, 0.04808035120368004, -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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.PrometheusId = params.get("PrometheusId") self.DisplayName = params.get("DisplayName") self.InstanceId = params.get("InstanceId") self.VpcId = params.get("VpcId") self.State = params.get("State") self.Region = params.get("Region") ...
15,403
[ 0.004910042509436607, 0.0511440634727478, -0.0062370807863771915, -0.02693888172507286, -0.01746382564306259, -0.011578410863876343, -0.013721577823162079, 0.007491132244467735, 0.03513997793197632, 0.006960316561162472, 0.00607451843097806, -0.06247697025537491, 0.029460253193974495, 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): if params.get("Limits") is not None: self.Limits = [] for item in params.get("Limits"): obj = Resource() obj._deserialize(item) self.Limits.append(obj) if params.get("Requests") is not None: ...
15,404
[ 0.010831702500581741, 0.03000609017908573, -0.03110925666987896, -0.03993457555770874, -0.018160855397582054, -0.01577526144683361, -0.021166980266571045, -0.0009230389259755611, 0.03292948007583618, 0.011452232487499714, 0.012934611178934574, -0.05229002609848976, 0.005457220133394003, 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Name = params.get("Name") self.TargetAverageUtilization = params.get("TargetAverageUtilization") self.TargetAverageValue = params.get("TargetAverageValue") memeber_set = set(params.keys()) for name, value in vars(self).items(): if ...
15,405
[ 0.01383864413946867, 0.03586200997233391, -0.035835087299346924, -0.025469567626714706, -0.01756753958761692, -0.03580816462635994, -0.007410674821585417, -0.012384778819978237, 0.010089555755257607, 0.0385543555021286, 0.010190519504249096, -0.05446610227227211, 0.011597268283367157, 0.02...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Namespace = params.get("Namespace") self.ClusterName = params.get("ClusterName") self.ItemName = params.get("ItemName") self.Gateways = params.get("Gateways") memeber_set = set(params.keys()) for name, value in vars(self).items(): ...
15,406
[ 0.032772090286016464, 0.027935167774558067, -0.03929029777646065, -0.03887644037604332, -0.014484901912510395, -0.04019560292363167, -0.027857569977641106, 0.005945922806859016, 0.017304284498095512, 0.03841085731983185, 0.02126176655292511, -0.05845692381262779, 0.025891762226819992, -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}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): if params.get("Items") is not None: self.Items = [] for item in params.get("Items"): obj = SelectedItems() obj._deserialize(item) self.Items.append(obj) self.All = params.get("All") memeber_se...
15,407
[ -0.0035912131424993277, 0.03235843405127525, -0.034513842314481735, -0.03871552646160126, -0.008962685242295265, -0.01923498697578907, -0.009569747373461723, -0.003649190766736865, -0.0016003577038645744, 0.019876154139637947, 0.006138825789093971, -0.07110124081373215, 0.05456734076142311, ...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Type = params.get("Type") self.CLBDirectAccess = params.get("CLBDirectAccess") self.ExternalTrafficPolicy = params.get("ExternalTrafficPolicy") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in meme...
15,408
[ 0.028031036257743835, 0.03505883738398552, -0.010234401561319828, -0.03652852773666382, -0.024704188108444214, -0.03476489707827568, -0.007154728285968304, -0.014322817325592041, -0.0154985710978508, 0.007174769416451454, 0.03575360029935837, -0.05053068697452545, 0.018718533217906952, -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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.IstioMetaDNSCapture = params.get("IstioMetaDNSCapture") self.IstioMetaDNSAutoAllocate = params.get("IstioMetaDNSAutoAllocate") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: ...
15,409
[ 0.020283684134483337, 0.022790076211094856, -0.06129032000899315, -0.04351302608847618, -0.0010287187760695815, -0.015374258160591125, -0.018345752730965614, 0.017686856910586357, 0.02710520476102829, 0.014159820973873138, 0.03700157627463341, -0.050644613802433014, 0.021614398807287216, 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Key = params.get("Key") self.Value = params.get("Value") self.Passthrough = params.get("Passthrough") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remov...
15,410
[ 0.03789575397968292, 0.04257424175739288, -0.016759997233748436, -0.016250867396593094, -0.03002488613128662, -0.02716275304555893, -0.007781426887959242, -0.0180947408080101, 0.015067484229803085, 0.008896008133888245, 0.00862080231308937, -0.062251415103673935, 0.03396032005548477, 0.033...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Sampling = params.get("Sampling") self.Enable = params.get("Enable") if params.get("APM") is not None: self.APM = APM() self.APM._deserialize(params.get("APM")) if params.get("Zipkin") is not None: self.Zipkin = Tra...
15,411
[ 0.03177766501903534, 0.01301560178399086, -0.02685212716460228, -0.0026133819483220577, -0.023263899609446526, -0.008288674056529999, -0.02159557119011879, 0.022562142461538315, 0.00365443155169487, 0.012141716666519642, 0.0282556414604187, -0.07425381243228912, 0.03564394637942314, 0.0137...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Address = params.get("Address") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are usel...
15,412
[ 0.032623689621686935, 0.02375279925763607, -0.01742401532828808, -0.004058101214468479, -0.033471059054136276, -0.024851731956005096, 0.008764968253672123, -0.009552756324410439, -0.004044861067086458, 0.02670535072684288, 0.013068011961877346, -0.054390471428632736, 0.03161744028329849, 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.MeshId = params.get("MeshId") self.ClusterId = params.get("ClusterId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0...
15,413
[ 0.023335741832852364, 0.03801644593477249, -0.012879851274192333, -0.023554857820272446, -0.022267557680606842, -0.024294370785355568, 0.007929222658276558, -0.04097449779510498, 0.020446164533495903, 0.013413943350315094, -0.0027509198989719152, -0.07351306825876236, 0.017981121316552162, ...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.Replicas = params.get("Replicas") if params.get("Resources") is not None: self.Resources = ResourceRequirements() self.Resources._deserialize(params.get("Resources")) if params.get("HorizontalPodAutoscaler") is not None: se...
15,414
[ 0.03125946223735809, 0.031442876905202866, -0.024879178032279015, -0.009950361214578152, -0.04027308523654938, -0.016861243173480034, -0.00966868456453085, -0.008103091269731522, 0.004329946357756853, 0.022586466744542122, 0.017201874405145645, -0.06304296851158142, 0.03843891993165016, 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _deserialize(self, params): self.MeshID = params.get("MeshID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useles...
15,415
[ 0.0005350058781914413, -0.00807249452918768, 0.03426746651530266, 0.005035150330513716, 0.0016244878061115742, 0.014885353855788708, -0.03678673505783081, -0.006734979338943958, 0.02998741902410984, 0.0013722224393859506, 0.04060627147555351, -0.019693635404109955, -0.026438772678375244, 0...
12
{"_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_sfm(): fdata, fbvals, fbvecs = dpd.get_fnames() data = load_nifti_data(fdata) gtab = grad.gradient_table(fbvals, fbvecs) for iso in [sfm.ExponentialIsotropicModel, None]: sfmodel = sfm.SparseFascicleModel(gtab, isotropic=iso) sffit1 = sfmodel.fit(data[0, 0, 0]) sphere = ...
15,416
[ -0.023804279044270515, -0.0013176931533962488, 0.034492917358875275, 0.010676378384232521, 0.007777453865855932, 0.03427227959036827, -0.005387219600379467, -0.00813292432576418, 0.00015992351109161973, 0.011258615180850029, 0.008194212801754475, -0.01381432730704546, 0.00090706319315359, ...
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_design_matrix(): data, gtab = dpd.dsi_voxels() sphere = dpd.get_sphere() # Make it with NNLS, so that it gets tested regardless of sklearn sparse_fascicle_model = sfm.SparseFascicleModel(gtab, sphere, solver='NNLS') npt.assert_equal(sparse...
15,417
[ -0.009278705343604088, -0.00924017746001482, 0.01213616132736206, -0.02325776405632496, 0.002550841309130192, 0.005631435662508011, -0.004587982781231403, -0.02509424276649952, 0.015899013727903366, 0.007904557511210442, 0.02943500690162182, 0.0009872671216726303, -0.016502611339092255, 0....
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": "Call", "_fields": {"a...
def test_sfm_background(): fdata, fbvals, fbvecs = dpd.get_fnames() data = load_nifti_data(fdata) gtab = grad.gradient_table(fbvals, fbvecs) to_fit = data[0, 0, 0] to_fit[gtab.b0s_mask] = 0 sfmodel = sfm.SparseFascicleModel(gtab, solver='NNLS') sffit = sfmodel.fit(to_fit) npt.assert_equa...
15,418
[ -0.017207326367497444, -0.014862134121358395, 0.022744199261069298, -0.007764112204313278, -0.00245273788459599, 0.026865631341934204, -0.03147275373339653, -0.013987891376018524, 0.009415460750460625, -0.0002452304179314524, 0.00843020249158144, -0.03388733044266701, -0.008971400558948517, ...
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_predict(): SNR = 1000 S0 = 100 _, fbvals, fbvecs = dpd.get_fnames('small_64D') bvals, bvecs = read_bvals_bvecs(fbvals, fbvecs) gtab = grad.gradient_table(bvals, bvecs) mevals = np.array(([0.0015, 0.0003, 0.0003], [0.0015, 0.0003, 0.0003])) angles = [(0, 0), (6...
15,419
[ 0.0047276136465370655, 0.011785928159952164, 0.027862463146448135, -0.03551669418811798, -0.01700351946055889, 0.033901095390319824, -0.05056030675768852, -0.012428195215761662, 0.001988047733902931, -0.01758619397878647, 0.05747295171022415, -0.0494479276239872, -0.02876296080648899, 0.00...
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 test_sfm_stick(): fdata, fbvals, fbvecs = dpd.get_fnames() data = load_nifti_data(fdata) gtab = grad.gradient_table(fbvals, fbvecs) sfmodel = sfm.SparseFascicleModel(gtab, solver='NNLS', response=[0.001, 0, 0]) sffit1 = sfmodel.fit(data[0, 0, 0]) sphere ...
15,420
[ 0.02255323715507984, 0.0033366517163813114, 0.004278375767171383, -0.01645158790051937, 0.022396786138415337, 0.025561941787600517, -0.02830587886273861, -0.006787633989006281, -0.011685802601277828, 0.04652658477425575, 0.015548977069556713, -0.07355677336454391, -0.006847808137536049, 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": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fie...
def test_sfm_sklearnlinearsolver(): class SillySolver(opt.SKLearnLinearSolver): def fit(self, X, y): self.coef_ = np.ones(X.shape[-1]) class EvenSillierSolver(object): def fit(self, X, y): self.coef_ = np.ones(X.shape[-1]) fdata, fbvals, fbvecs = dpd.get_fnames() ...
15,421
[ 0.03594672679901123, 0.019547976553440094, 0.04154074192047119, -0.053412485867738724, -0.02204456366598606, -0.02680983580648899, -0.025173068046569824, -0.009054017253220081, 0.002742621349170804, 0.004436364863067865, 0.0297104362398386, -0.01659557968378067, 0.019765520468354225, 0.005...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "payload", "annotation":...
class MockWorkflowExecutionPublisher(object): @classmethod def publish_create(cls, payload): try: if isinstance(payload, wf_ex_db.WorkflowExecutionDB): workflows.get_engine().process(payload) except Exception: traceback.print_exc() print(payloa...
15,422
[ -0.015265765599906445, -0.016405610367655754, 0.007958552800118923, 0.002167738741263747, -0.01637846976518631, 0.027953313663601875, -0.056178018450737, 0.008352070115506649, 0.014994374476373196, -0.00863703154027462, 0.04648934677243233, -0.026772761717438698, -0.001372222788631916, -0....
12
{"_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_exponential_iso(): fdata, fbvals, fbvecs = dpd.get_fnames() data_dti = load_nifti_data(fdata) gtab_dti = grad.gradient_table(fbvals, fbvecs) data_multi, gtab_multi = dpd.dsi_deconv_voxels() for data, gtab in zip([data_dti, data_multi], [gtab_dti, gtab_multi]): sfmodel = sfm.SparseF...
15,423
[ 0.046546515077352524, 0.014296742156147957, 0.046064846217632294, -0.05158212035894394, -0.027214165776968002, -0.01712105982005596, -0.027214165776968002, -0.012173029594123363, 0.004783825483173132, 0.0011856936616823077, 0.02493719570338726, -0.002620430663228035, 0.016891174018383026, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "threads", "ctx": {"_type": "Store", "_fields": {}}}}], "type_...
class MockWorkflowExecutionPublisherNonBlocking(object): threads = [] @classmethod def publish_create(cls, payload): try: if isinstance(payload, wf_ex_db.WorkflowExecutionDB): thread = eventlet.spawn(workflows.get_engine().process, payload) cls.threads.ap...
15,424
[ 0.07218089699745178, 0.037295613437891006, 0.040566783398389816, -0.037575386464595795, 0.008807403035461903, -0.01790533773601055, -0.0000810394121799618, 0.013267597183585167, -0.029892444610595703, 0.011944065801799297, 0.017270473763346672, 0.008317803964018822, 0.024490714073181152, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "payload", "annotation": null, "type_comment": null}}], "kwarg": nu...
def publish_create(cls, payload): try: if isinstance(payload, wf_ex_db.WorkflowExecutionDB): thread = eventlet.spawn(workflows.get_engine().process, payload) cls.threads.append(thread) except Exception: traceback.print_exc() print(paylo...
15,425
[ 0.04068600758910179, 0.04312310740351677, 0.002025274094194174, -0.03276543691754341, -0.02346835844218731, 0.05027644336223602, 0.017973603680729866, 0.024100197479128838, -0.033961422741413116, 0.04145324230194092, 0.015728313475847244, -0.0035371780395507812, -0.034457866102457047, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def wait_all(cls): for thread in cls.threads: try: thread.wait() except Exception as e: print(six.text_type(e)) finally: cls.threads.remove(thread)
15,426
[ 0.055112194269895554, 0.01937364600598812, 0.041922569274902344, -0.02033955231308937, 0.002133043948560953, -0.0012580379843711853, -0.03352917358279228, 0.0010887266835197806, -0.018418841063976288, 0.019084984436631203, 0.034372955560684204, -0.005784337874501944, 0.013056393712759018, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "payload", "annotation": null, "type_comment": null}}, {"_type": "a...
def publish_state(cls, payload, state): try: if isinstance(payload, wf_ex_db.WorkflowExecutionDB): thread = eventlet.spawn(workflows.get_engine().process, payload) cls.threads.append(thread) except Exception: traceback.print_exc() print...
15,427
[ -0.002376232761889696, -0.030457662418484688, 0.037926651537418365, -0.03948559984564781, 0.005273084621876478, -0.0402069054543972, -0.001673833467066288, 0.04451146349310875, -0.0018585223006084561, 0.03141164407134056, 0.010720678605139256, 0.03222602233290672, -0.005584292579442263, -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": "split", "annotation": null, "type_comment": null}}], "kwarg": nul...
def setup_network(self, split=False): self.nodes = start_nodes(3, self.options.tmpdir) #connect to a local machine for debugging #url = "http://bitcoinrpc:DP6DvqZtqXarpeNWyN3LZTFchCCyCUuHwNF7E8pX99x1@%s:%d" % ('127.0.0.1', 18332) #proxy = AuthServiceProxy(url) #proxy.url = url #...
15,428
[ 0.00857607927173376, -0.00931850727647543, 0.0330553762614727, -0.04135391116142273, 0.016652582213282585, -0.024146243929862976, 0.011774762533605099, 0.03233376145362854, 0.02271689660847187, 0.007403460331261158, 0.04454565793275833, 0.021912021562457085, -0.02336912229657173, 0.0009748...
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 RawTransactionsTest(BitcoinTestFramework): def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) initialize_chain_clean(self.options.tmpdir, 3) def setup_network(self, split=False): self.nodes = start_nodes(3, self.options.tmpdir) #connect to a...
15,429
[ 0.02462964504957199, 0.00014971692871768028, -0.002280676271766424, 0.022073738276958466, 0.008132429793477058, -0.0266212597489357, -0.02732939086854458, 0.01886502467095852, 0.003078705631196499, 0.029232488945126534, -0.025514807552099228, 0.0164861511439085, -0.0006918789003975689, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "auth/widgets/read_only_password_hash.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", ...
class ReadOnlyPasswordHashWidget(forms.Widget): template_name = 'auth/widgets/read_only_password_hash.html' def get_context(self, name, value, attrs): context = super().get_context(name, value, attrs) summary = [] if not value or value.startswith(UNUSABLE_PASSWORD_PREFIX): s...
15,430
[ 0.02220524661242962, -0.006539138965308666, 0.02681046910583973, -0.038260918110609055, 0.009579142555594444, -0.025530468672513962, 0.009349577128887177, 0.03213917091488838, 0.038539182394742966, 0.009899143129587173, 0.046580929309129715, 0.025586120784282684, -0.03202786669135094, -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 run_test(self): #prepare some coins for multiple *rawtransaction commands self.nodes[2].generate(1) self.sync_all() self.nodes[0].generate(101) self.sync_all() self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5) self.nodes[0].sendtoaddress(self.nod...
15,431
[ -0.004101855680346489, -0.02277216501533985, -0.03283872827887535, 0.024109596386551857, 0.003698834916576743, -0.004886999726295471, 0.029256321489810944, 0.0548824705183506, 0.01744632050395012, 0.03145353123545647, -0.0014859524089843035, 0.033149201422929764, -0.0006317723309621215, -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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_context(self, name, value, attrs): context = super().get_context(name, value, attrs) summary = [] if not value or value.startswith(UNUSABLE_PASSWORD_PREFIX): summary.append({'label': ugettext("No password set.")}) else: try: hasher = identi...
15,432
[ 0.024907700717449188, 0.02805572748184204, 0.024737536907196045, 0.03052309900522232, 0.02007930725812912, -0.03296920284628868, 0.0022679620888084173, 0.01351737231016159, -0.019813425838947296, 0.0054399180226027966, -0.005176696460694075, 0.019526274874806404, 0.005562223494052887, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "ReadOnlyPasswordHashWidget", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "widget", "ctx": {"_type": "Store", "_...
class ReadOnlyPasswordHashField(forms.Field): widget = ReadOnlyPasswordHashWidget def __init__(self, *args, **kwargs): kwargs.setdefault("required", False) super().__init__(*args, **kwargs) def bound_data(self, data, initial): # Always return initial because the widget doesn't ...
15,433
[ 0.028820423409342766, 0.014539317227900028, -0.0079896729439497, 0.0026938454248011112, -0.01155994925647974, -0.006639025639742613, 0.011708918027579784, 0.03952628746628761, -0.009921296499669552, 0.00876927375793457, 0.0027484672609716654, 0.03398466110229492, 0.004732230212539434, 0.05...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "ReadOnlyPasswordHashField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_f...
class UserChangeForm(forms.ModelForm): password = ReadOnlyPasswordHashField( label=_("Password"), help_text=_( "Raw passwords are not stored, so there is no way to see this " "user's password, but you can change the password using " "<a href=\"../password/\">this ...
15,434
[ 0.05698757991194725, -0.026524970307946205, 0.026157168671488762, -0.007577790413051844, -0.010969135910272598, 0.03474641218781471, 0.0537855438888073, 0.04389817640185356, -0.0075669726356863976, 0.028017811477184296, 0.00011595209070947021, -0.009341073222458363, 0.010482339188456535, 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 clean_password2(self): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise forms.ValidationError( self.error_messages['password_mismatch'], code=...
15,435
[ 0.03505752980709076, 0.021673496812582016, -0.009525328874588013, 0.015521159395575523, 0.030437879264354706, -0.0027847420424222946, 0.03732417896389961, 0.058501169085502625, 0.02015160210430622, 0.057033244520425797, -0.008748191408813, -0.015715444460511208, 0.030502639710903168, 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 clean(self): username = self.cleaned_data.get('username') password = self.cleaned_data.get('password') if username is not None and password: self.user_cache = authenticate(self.request, username=username, password=password) if self.user_cache is None: ...
15,436
[ 0.055052876472473145, -0.025749173015356064, 0.018513169139623642, 0.00018562757759355009, -0.006897477898746729, 0.022131171077489853, 0.05839582532644272, 0.03482591733336449, 0.002745238598436117, 0.037089813500642776, -0.008896900340914726, -0.016069430857896805, 0.0037978445179760456, ...
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 clean_new_password2(self): password1 = self.cleaned_data.get('new_password1') password2 = self.cleaned_data.get('new_password2') if password1 and password2: if password1 != password2: raise forms.ValidationError( self.error_messages['password_m...
15,437
[ 0.05479976162314415, -0.02939337119460106, 0.023497730493545532, -0.0018012983491644263, -0.008032280020415783, 0.03195945918560028, 0.050685539841651917, 0.03403778001666069, 0.0020624136086553335, 0.03369846194982529, -0.0046391054056584835, -0.012533537112176418, 0.010778630152344704, 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 clean_password2(self): password1 = self.cleaned_data.get('password1') password2 = self.cleaned_data.get('password2') if password1 and password2: if password1 != password2: raise forms.ValidationError( self.error_messages['password_mismatch'], ...
15,438
[ 0.007045809179544449, 0.06692672520875931, 0.008394046686589718, -0.019913295283913612, -0.005359102040529251, 0.0017741448245942593, 0.01913481578230858, 0.005968347657471895, 0.02115435153245926, 0.08366968482732773, 0.028250930830836296, 0.022891828790307045, 0.008614051155745983, 0.037...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lexer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}, {"_type": "a...
def check_indent1(lexer, match, ctx): indent, reallen = CleanLexer.indent_len(match.group(0)) if indent > ctx.indent: yield match.start(), Whitespace, match.group(0) ctx.pos = match.start() + reallen + 1 else: ctx.indent = 0 ctx.pos = match.start()...
15,439
[ -0.0015372243942692876, 0.06259888410568237, 0.0009517472353763878, -0.03505093604326248, -0.00880713015794754, 0.018901756033301353, 0.022286977618932724, 0.006959131453186274, 0.023507878184318542, 0.09172290563583374, 0.03125504404306412, 0.01844669319689274, 0.011315525509417057, 0.043...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lexer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}, {"_type": "a...
def check_indent2(lexer, match, ctx): indent, reallen = CleanLexer.indent_len(match.group(0)) if indent > ctx.indent: yield match.start(), Whitespace, match.group(0) ctx.pos = match.start() + reallen + 1 else: ctx.indent = 0 ctx.pos = match.start()...
15,440
[ -0.0022615117486566305, 0.06630347669124603, 0.006549406331032515, -0.029686082154512405, 0.00685151107609272, 0.003990064840763807, 0.0282040573656559, 0.004574324004352093, 0.030164889991283417, 0.07660924643278122, 0.024898003786802292, 0.023803586140275, 0.014740439131855965, 0.0450535...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lexer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}, {"_type": "a...
def check_indent3(lexer, match, ctx): indent, reallen = CleanLexer.indent_len(match.group(0)) if indent > ctx.indent: yield match.start(), Whitespace, match.group(0) ctx.pos = match.start() + reallen + 1 else: ctx.indent = 0 ctx.pos = match.start()...
15,441
[ 0.02436261624097824, 0.02970879152417183, 0.027973629534244537, -0.03456255793571472, -0.02186538837850094, 0.005114625208079815, 0.01593301072716713, -0.02520674839615822, -0.04448111727833748, 0.027176393195986748, -0.004619283135980368, -0.03559427335858345, 0.027598459273576736, -0.027...
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": "meta_file", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, meta_file, averages=100, exp_name=None, save_chandb=True, **kwargs): super(QubitExperiment, self).__init__(**kwargs) if not pipeline.pipelineMgr: raise Exception("Could not find pipeline manager, have you declared one using PipelineManager()?") self.cw_mode = Fal...
15,442
[ -0.011485799215734005, 0.010600573383271694, -0.020161006599664688, 0.0030263641383498907, -0.016786085441708565, 0.010949131101369858, -0.03078371100127697, -0.041583459824323654, -0.03237711638212204, 0.0014537059469148517, 0.01263659168034792, 0.012371024116873741, -0.0032725674100220203,...
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": "qubit_name", "annotation": null, "type_comment": null}}], "kwarg"...
def is_in_measured_qubit_names(self,qubit_name): labels = [] if qubit_name is not None: labels = qubit_name.split('-') for l in labels: if l in self.measured_qubit_names: return True return False
15,443
[ 0.025664666667580605, 0.022411979734897614, 0.021821828559041023, -0.01984551176428795, -0.014314570464193821, 0.031181883066892624, -0.005338799674063921, 0.006656344048678875, -0.028711488470435143, 0.015522319823503494, 0.031181883066892624, -0.03288371115922928, -0.021835552528500557, ...
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 init_instruments(self): for name, instr in self._instruments.items(): instr.configure_with_proxy(instr.proxy_obj) self.digitizers = [v for _, v in self._instruments.items() if "Digitizer" in v.instrument_type] self.awgs = [v for _, v in self._instruments.items() if "AWG" i...
15,444
[ -0.002656384836882353, -0.022078251466155052, 0.010138966143131256, -0.05527469888329506, 0.01014504861086607, 0.0222972109913826, -0.01757745072245598, -0.02732107788324356, -0.030946046113967896, 0.04113975167274475, 0.023087890818715096, -0.035519834607839584, 0.01481614913791418, -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": "graph", "annotation": null, "type_comment": null}}], "kwarg": nul...
def instantiate_filters(self, graph): # Configure the individual filter nodes for _, dat in graph.nodes(data=True): node = dat['node_obj'] if isinstance(node, bbndb.auspex.FilterProxy): if all(name in self.measured_qubit_names for name in node.qubit_name.split('-'...
15,445
[ 0.039542172104120255, 0.012045505456626415, -0.046079203486442566, -0.02875378727912903, -0.012834063731133938, 0.020205363631248474, -0.02363387681543827, -0.03972502797842026, 0.023679589852690697, 0.036319371312856674, 0.025485273450613022, -0.033713702112436295, -0.015851154923439026, ...
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": "instrument_name", "annotation": null, "type_comment": null}}, {"_...
def add_instrument_sweep(self, instrument_name, attribute, values, channel=None): param = FloatParameter() # Create the parameter param.name = f"{instrument_name} {attribute} {channel}" instr = self._instruments[instrument_name] def method(value, channel=channel, instr=instr, prop=attrib...
15,446
[ 0.025637205690145493, 0.031086547300219536, -0.027568617835640907, -0.02090064436197281, -0.040973540395498276, 0.011628714390099049, -0.007110588252544403, 0.006006923504173756, 0.027729569002985954, 0.057666465640068054, 0.03513331711292267, -0.0029804687947034836, -0.03750159591436386, ...
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": "label", "annotation": null, "type_comment": null}}, {"_type": "ar...
def add_manual_sweep(self, label, prompt, values, channel=None): param = FloatParameter() # Create the parameter param.name = label def method(value): print(f'Manually set {label} to {value}, then press enter.') input() param.assign_method(method) self.add...
15,447
[ 0.025739477947354317, 0.01691526174545288, 0.027022523805499077, -0.021327368915081024, -0.07677329331636429, 0.029143476858735085, 0.04050759971141815, 0.011802715249359608, -0.020973877981305122, 0.009014054201543331, 0.04797021672129631, -0.01921950839459896, -0.013511261902749538, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def run(self): # Begin acquisition before enabling the AWGs for dig in self.digitizers: dig.acquire() dig.last_timestamp.value = datetime.datetime.now().timestamp() # Set flag to enable acquisition process self.dig_run.set() time.sleep(1) # Start ...
15,448
[ -0.0032613847870379686, -0.03424913436174393, 0.02961888536810875, 0.0028739995323121548, -0.017124567180871964, 0.02313898876309395, 0.013008791022002697, -0.011851228773593903, -0.002543267561122775, 0.026948532089591026, 0.02170581743121147, -0.038683392107486725, -0.03170127421617508, ...
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 TestCiscoApicTopologyService(base.BaseTestCase, mocked.ControllerMixin, mocked.ConfigMixin): def setUp(self): super(TestCiscoApicTopologyService, self).setUp() mocked.ControllerMixin.set_up_mocks(self) mocked.ConfigMi...
15,449
[ -0.002540295012295246, -0.03774799033999443, 0.014936255291104317, 0.000670434208586812, -0.0439261719584465, -0.008480851538479328, 0.031162461265921593, -0.0012199357151985168, -0.002704367507249117, -0.01860242709517479, 0.0007446911768056452, -0.04738866537809372, -0.027269981801509857, ...
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 setUp(self): super(TestCiscoApicTopologyService, self).setUp() mocked.ControllerMixin.set_up_mocks(self) mocked.ConfigMixin.set_up_mocks(self) # Patch notifier notifier_c = mock.patch(NOTIFIER).start() self.notifier = mock.Mock() notifier_c.return_value = self...
15,450
[ -0.027117010205984116, -0.031334683299064636, 0.0007491133874282241, 0.006034607067704201, 0.0031364469323307276, 0.008870217017829418, 0.004569144919514656, -0.00010909056436503306, -0.020790502429008484, 0.026163864880800247, 0.023363998159766197, -0.009084675461053848, 0.01183092780411243...
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_update_link_add_nopeers(self): self.service.peers = {} args = (mocked.SERVICE_HOST, mocked.SERVICE_HOST_IFACE, mocked.SERVICE_HOST_MAC, mocked.APIC_EXT_SWITCH, mocked.APIC_EXT_MODULE, mocked.APIC_EXT_PORT) self.service.update_link(None, *args) sel...
15,451
[ -0.01967531442642212, -0.03212851285934448, 0.015421192161738873, -0.0019910279661417007, 0.0017653369577601552, 0.026266729459166527, 0.0011269095120951533, -0.002191985724493861, -0.004167555365711451, 0.042318619787693024, 0.03709990158677101, -0.028764789924025536, -0.0055062435567379, ...
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_update_link_add_with_peers_diff(self): args = (mocked.SERVICE_HOST, mocked.SERVICE_HOST_IFACE, mocked.SERVICE_HOST_MAC, mocked.APIC_EXT_SWITCH, mocked.APIC_EXT_MODULE, mocked.APIC_EXT_PORT) args_prime = args[:2] + tuple(x + '1' for x in args[2:]) self.ser...
15,452
[ -0.032168544828891754, -0.034052178263664246, 0.010800314135849476, 0.013050888665020466, -0.006100403610616922, 0.027863098308444023, 0.005397099070250988, -0.0015281587839126587, -0.009271390736103058, 0.036596305668354034, 0.03329383209347725, -0.01950906030833721, 0.0046081747859716415, ...
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_update_link_rem_with_peers(self): args = (mocked.SERVICE_HOST, mocked.SERVICE_HOST_IFACE, mocked.SERVICE_HOST_MAC, 0, mocked.APIC_EXT_MODULE, mocked.APIC_EXT_PORT) self.service.peers = {args[:2]: args} self.service.update_link(None, *args) self.se...
15,453
[ -0.022126052528619766, -0.02062315121293068, 0.026813674718141556, 0.004282076843082905, -0.023211481049656868, 0.024284983053803444, 0.003453095443546772, -0.014659254811704159, 0.0017340026097372174, 0.02445197105407715, 0.0021991864778101444, -0.0235335323959589, -0.030415866523981094, ...
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 TestCiscoApicTopologyAgent(base.BaseTestCase, mocked.ControllerMixin, mocked.ConfigMixin): def setUp(self): super(TestCiscoApicTopologyAgent, self).setUp() mocked.ControllerMixin.set_up_mocks(self) mocke...
15,454
[ -0.016123156994581223, -0.03526364639401436, 0.0037428755313158035, -0.005804336164146662, -0.05081097409129143, 0.010220929980278015, 0.02904471382498741, -0.013232504948973656, -0.0072669368237257, -0.014326576143503189, 0.0021679888013750315, -0.024345966055989265, -0.037267524749040604, ...
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 setUp(self): super(TestCiscoApicTopologyAgent, self).setUp() mocked.ControllerMixin.set_up_mocks(self) mocked.ConfigMixin.set_up_mocks(self) # Patch notifier notifier_c = mock.patch(NOTIFIER).start() self.notifier = mock.Mock() noti...
15,455
[ -0.030022742226719856, 0.000048459918616572395, 0.0011220390442758799, 0.011581944301724434, -0.004680374637246132, 0.026996059343218803, 0.012546089477837086, 0.02850940078496933, 0.014767284505069256, 0.02672756463289261, 0.005821483209729195, -0.0490371473133564, 0.029095211997628212, 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 test_check_for_new_peers_no_peers(self): self.agent.peers = {} expected = (mocked.SERVICE_HOST, mocked.SERVICE_HOST_IFACE, mocked.SERVICE_HOST_MAC, mocked.APIC_EXT_SWITCH, mocked.APIC_EXT_MODULE, mocked.APIC_EXT_PORT) peers = {mocke...
15,456
[ -0.036464713513851166, -0.00025158034986816347, 0.004354822915047407, 0.010446647182106972, -0.0021389140747487545, 0.025254277512431145, 0.01012634951621294, 0.02068386971950531, 0.008142964914441109, 0.026880405843257904, 0.007311421446502209, -0.049991149455308914, 0.018996143713593483, ...
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 test_check_for_new_peers_with_peers(self): expected = (mocked.SERVICE_HOST, mocked.SERVICE_HOST_IFACE, mocked.SERVICE_HOST_MAC, mocked.APIC_EXT_SWITCH, mocked.APIC_EXT_MODULE, mocked.APIC_EXT_PORT) peers = {mocked.SERVICE_HOST_IFACE: [expected]...
15,457
[ 0.050944745540618896, -0.012559141032397747, 0.03171321377158165, -0.018999159336090088, -0.0556364431977272, 0.01338904071599245, 0.020515108481049538, -0.020194213837385178, 0.015900868922472, 0.02491910569369793, 0.015369732864201069, -0.0357852540910244, 0.044703904539346695, -0.009787...
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": "args", "annotation": null, "type_comment": null}}], "kwarg": null...
def __init__(self, args): # type: (t.Any) -> None super(CoverageConfig, self).__init__(args, 'coverage') self.group_by = frozenset(args.group_by) if 'group_by' in args and args.group_by else set() # type: t.FrozenSet[str] self.all = args.all if 'all' in args else False # type: bool s...
15,458
[ 0.018911484628915787, -0.0246693454682827, 0.033589620143175125, 0.0005311374552547932, 0.02070057950913906, 0.03006182797253132, 0.00488536199554801, -0.0006401997525244951, 0.004031762480735779, -0.003779777092859149, -0.011137743480503559, -0.044047001749277115, -0.03837733715772629, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0.05}}, "targets": [{"_type": "Name", "_fields": {"id": "goal_time", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ...
class TimeSecondary: goal_time = 0.05 def time_factorial(self): x = 1 for i in xrange(100): x *= i # This is to generate invalid output sys.stdout.write("X") def time_exception(self): raise RuntimeError()
15,459
[ -0.0739932656288147, -0.04065033793449402, 0.12730517983436584, -0.004819903057068586, -0.02422015741467476, -0.03400932624936104, -0.0024372395128011703, -0.027345338836312294, 0.027896840125322342, 0.04193717986345291, -0.008548290468752384, 0.01452290266752243, 0.020980078727006912, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lonlat_pts", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def get_dem_bounds(lonlat_pts): minlat = np.min(lonlat_pts[:,1]) minlon = np.min(lonlat_pts[:,0]) maxlat = np.max(lonlat_pts[:,1]) maxlon = np.max(lonlat_pts[:,0]) latrange = maxlat - minlat lonrange = maxlon - minlon bounds = [ minlat - latrange * 0.1, minlon - lonrange * 0....
15,460
[ 0.032403118908405304, -0.03712772578001022, 0.034086134284734726, -0.011132234707474709, 0.01506603043526411, -0.04083847254514694, 0.05069323629140854, 0.03207867965102196, -0.06253518164157867, -0.04029098525643349, -0.01521810982376337, -0.027313517406582832, 0.000017425800251658075, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "y", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def download_file(x, y, z, save_path): BUCKET_NAME = 'elevation-tiles-prod' KEY = 'geotiff/{z}/{x}/{y}.tif'.format(x = x, y = y, z = z) s3 = boto3.resource('s3') try: bucket = s3.Bucket(BUCKET_NAME) bucket.download_file(KEY, save_path) except botocore.exceptions.ClientError as e: ...
15,461
[ -0.060285534709692, -0.007419669069349766, 0.07249115407466888, 0.014410053379833698, -0.01637084223330021, -0.06144576519727707, 0.026058759540319443, -0.01160229742527008, -0.006561099085956812, 0.006479883100837469, 0.02321619726717472, 0.013690710999071598, -0.02761346660554409, -0.044...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inx", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "iny", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def project(inx, iny, dem, proj_name, inverse = False): wgs84 = pyproj.Proj('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') if proj_name == 'ellps': proj = pyproj.Proj('+proj=geocent +datum=WGS84 +units=m +no_defs') elif proj_name.startswith('utm'): zone = proj_name[3:] # print(z...
15,462
[ -0.031957365572452545, 0.024018343538045883, 0.08180548995733261, -0.028871210291981697, -0.011908535845577717, -0.02202799543738365, 0.02730577066540718, 0.01667194999754429, -0.03059319593012333, 0.021088730543851852, 0.016828494146466255, 0.005272182635962963, 0.016515405848622322, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "zoom", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bounds", "annotation": null, "type_comment": null}}, {"_type": "a...
def get_dem(zoom, bounds, n_width, dest_dir = 'dem_download'): print('downloading dem data for bounds = ' + str(bounds) + ' and zoom = ' + str(zoom)) if os.path.exists(dest_dir): shutil.rmtree(dest_dir) os.makedirs(dest_dir) dest = os.path.join(dest_dir, 'raw_merc.tif') download(dest, tiles(...
15,463
[ 0.006544529460370541, 0.013366011902689934, -0.04585384950041771, 0.0016903189243748784, 0.024624770507216454, -0.013402136042714119, 0.01258331723511219, 0.03460713475942612, -0.011505607515573502, 0.03761749714612961, 0.0374007523059845, -0.017195193096995354, 0.04768415167927742, 0.0355...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "flavorid", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ctxt", "annotation": null, "type_comment": null}}, {"_type": ...
def fake_get_flavor_by_flavor_id(flavorid, ctxt=None, read_deleted='yes'): if flavorid == 'failtest': raise exception.FlavorNotFound(flavor_id=flavorid) elif not str(flavorid) == '1234': raise Exception("This test expects flavorid 1234, not %s" % flavorid) if read_deleted != 'no': ra...
15,464
[ 0.012952500954270363, 0.01022462546825409, 0.019847417250275612, 0.02768433466553688, 0.024099500849843025, -0.0018872709479182959, 0.03898833692073822, 0.03582216799259186, 0.005972541868686676, 0.022581834346055984, -0.009047125466167927, -0.03940700367093086, 0.000014220459888747428, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "updates", "annotation": null, "type_comment": null}}, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def fake_db_flavor(**updates): db_flavor = { 'root_gb': 1, 'ephemeral_gb': 1, 'name': u'frob', 'deleted': False, 'created_at': datetime.datetime(2012, 1, 19, 18, 49, 30, 877329), 'updated_at': None, 'memory_mb': 256, 'vcpus': 1, 'flavorid': 1, ...
15,465
[ -0.0006301277317106724, -0.018355593085289, -0.004739606287330389, -0.01952434703707695, -0.018011119216680527, -0.015772031620144844, 0.028886685147881508, 0.03060906007885933, -0.010777144692838192, 0.03553013131022453, 0.045716747641563416, 0.00005425672497949563, 0.0038138297386467457, ...
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 setUp(self): super(FlavorManageTestV21, self).setUp() self.stubs.Set(flavors, "get_flavor_by_flavor_id", fake_get_flavor_by_flavor_id) self.stubs.Set(flavors, "destroy", fake_destroy) self.stubs.Set(db, "flavor_create", fake_create) ...
15,466
[ 0.006490839179605246, -0.0049065821804106236, 0.00202415743842721, 0.011880389414727688, 0.02486822009086609, -0.049268852919340134, 0.034601401537656784, 0.028325898572802544, -0.01122822891920805, 0.03644713759422302, 0.012932458892464638, -0.033124811947345734, 0.01702999323606491, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, {"_type":...
def fake_create(context, kwargs, projects=None): newflavor = fake_db_flavor() flavorid = kwargs.get('flavorid') if flavorid is None: flavorid = 1234 newflavor['flavorid'] = flavorid newflavor["name"] = kwargs.get('name') newflavor["memory_mb"] = int(kwargs.get('memory_mb')) newflav...
15,467
[ 0.015770113095641136, -0.016272928565740585, 0.00002159418181690853, -0.029391834512352943, 0.005750949028879404, 0.012867498211562634, -0.02936897985637188, 0.06993702799081802, 0.03583701327443123, 0.023380907252430916, 0.056818120181560516, -0.03426000103354454, -0.014387371949851513, -...
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_delete(self): res = self.controller._delete(self._get_http_request(), 1234) # NOTE: on v2.1, http status code is set as wsgi_code of API # method instead of status_int in a response object. if isinstance(self.controller, flavormanage_v21.FlavorManageContro...
15,468
[ 0.046395305544137955, 0.048333365470170975, -0.01314100343734026, -0.012987376190721989, 0.011297481134533882, -0.014901802875101566, 0.002393033355474472, 0.029803605750203133, 0.027156498283147812, 0.028881844133138657, 0.018021609634160995, -0.031032619997859, 0.018175236880779266, 0.00...
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": "parameter", "annotation": null, "type_comment": null}}], "kwarg":...
def _test_create_missing_parameter(self, parameter): body = { "flavor": { "name": "azAZ09. -_", "ram": 512, "vcpus": 2, "disk": 1, "OS-FLV-EXT-DATA:ephemeral": 1, "id": six.text_type('1234'), ...
15,469
[ 0.023072944954037666, -0.018471693620085716, -0.030852841213345528, -0.013503674417734146, 0.03936626762151718, -0.033520232886075974, -0.0005029146559536457, 0.026651697233319283, 0.037676919251680374, 0.009191390126943588, 0.00539313443005085, -0.015104110352694988, -0.018849574029445648, ...
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": "body", "annotation": null, "type_comment": null}}], "kwarg": null...
def _create_flavor_success_case(self, body): req = self._get_http_request(url=self.base_url) req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = jsonutils.dumps(body) res = req.get_response(self.app) self.assertEqual(200, res.status_code) ...
15,470
[ 0.008409186266362667, 0.006530210375785828, -0.022732526063919067, -0.006616458762437105, 0.03780129551887512, -0.020810425281524658, 0.014945557340979576, 0.02236289158463478, 0.02483944222331047, 0.002428807085379958, 0.04711608588695526, -0.005944955628365278, 0.031862497329711914, -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 test_flavor_exists_exception_returns_409(self): expected = { "flavor": { "name": "test", "ram": 512, "vcpus": 2, "disk": 1, "OS-FLV-EXT-DATA:ephemeral": 1, "id": 1235, "swap": 512, ...
15,471
[ 0.01201480720192194, 0.006903164088726044, -0.0052583892829716206, -0.03118347004055977, 0.03265092894434929, -0.009636303409934044, -0.0076674651354551315, 0.019223691895604134, 0.0118252607062459, 0.00862131267786026, 0.03336019814014435, -0.008168846368789673, 0.0017747062956914306, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "FlavorManageController", "value": {"_type": "Name", "_fields...
class PrivateFlavorManageTestV21(test.TestCase): controller = flavormanage_v21.FlavorManageController() base_url = '/v2/fake/flavors' def setUp(self): super(PrivateFlavorManageTestV21, self).setUp() self.flavor_access_controller = (flavor_access_v21. ...
15,472
[ 0.008896533399820328, 0.013493258506059647, -0.003158874111250043, 0.0016055548330768943, 0.02197190746665001, -0.04126055911183357, 0.005517720244824886, 0.03081345558166504, 0.007142519578337669, 0.03670782223343849, 0.045175474137067795, -0.023203566670417786, 0.017166240140795708, -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}}, {"_type": "arg", "_fields": {"arg": "mock_create", "annotation": null, "type_comment": null}}], "kwarg...
def test_flavor_create_db_failed(self, mock_create): request_dict = { "flavor": { "name": "test", 'id': "12345", "ram": 512, "vcpus": 2, "disk": 1, "OS-FLV-EXT-DATA:ephemeral": 1, "swap": ...
15,473
[ 0.04767484962940216, 0.02311507798731327, -0.024475496262311935, 0.013423600234091282, 0.03484116494655609, 0.008583880960941315, -0.0032656067050993443, 0.03089233860373497, 0.02995328977704048, -0.010979662649333477, 0.01898566633462906, -0.014952566474676132, 0.015301700681447983, 0.008...
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_create_private_flavor_should_not_grant_flavor_access(self): self.expected["flavor"]["os-flavor-access:is_public"] = False body = self._get_response() for key in self.expected["flavor"]: self.assertEqual(body["flavor"][key], self.expected["flavor"][key]) # Because for...
15,474
[ 0.016985993832349777, -0.03803597018122673, 0.008365237154066563, -0.0229481253772974, 0.006059473380446434, -0.012240623123943806, 0.026695752516388893, 0.044095445424318314, -0.001565059763379395, 0.006406250409781933, 0.046115268021821976, 0.007118056062608957, -0.005280745681375265, -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): super(PrivateFlavorManageTestV21, self).setUp() self.flavor_access_controller = (flavor_access_v21. FlavorAccessController()) self.app = self._setup_app() self.expected = { "flavor": { "name": "test", ...
15,475
[ -0.010116910561919212, 0.01532331109046936, -0.006572529673576355, -0.03386993333697319, 0.0013826549984514713, -0.004240036942064762, -0.007453903090208769, 0.002118444535881281, 0.008322685956954956, 0.05011238902807236, 0.03170426934957504, -0.028430597856640816, 0.001307108672335744, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "FlavorManageController", "value": {"_type": "Name", "_fields...
class FlavorManageTestV2(FlavorManageTestV21): controller = flavormanage_v2.FlavorManageController() validation_error = webob.exc.HTTPBadRequest def setUp(self): super(FlavorManageTestV2, self).setUp() self.flags( osapi_compute_extension=[ 'nova.api.openstack.com...
15,476
[ 0.0026052033063024282, -0.007679779082536697, 0.005845300853252411, -0.04915546998381615, 0.007191398646682501, -0.005366077646613121, -0.008619911037385464, 0.014871178194880486, -0.0005810961592942476, 0.03323427587747574, 0.01560374815016985, -0.027153940871357918, -0.005311134736984968, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "FlavorManageController", "value": {"_type": "Name", "_fields...
class PrivateFlavorManageTestV2(PrivateFlavorManageTestV21): controller = flavormanage_v2.FlavorManageController() def setUp(self): super(PrivateFlavorManageTestV2, self).setUp() self.flags( osapi_compute_extension=[ 'nova.api.openstack.compute.contrib.select_extensi...
15,477
[ 0.04295201972126961, 0.006939899176359177, 0.0010338444262742996, -0.027224823832511902, 0.0041293008252978325, 0.023153254762291908, -0.00497096125036478, 0.01853475719690323, 0.014560419134795666, 0.0344199538230896, 0.05051176995038986, -0.016225509345531464, -0.003120523877441883, -0.0...
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 FlavorManagerPolicyEnforcementV21(test.NoDBTestCase): def setUp(self): super(FlavorManagerPolicyEnforcementV21, self).setUp() self.controller = flavormanage_v21.FlavorManageController() def test_create_policy_failed(self): rule_name = "os_compute_api:os-flavor-manage" sel...
15,478
[ 0.023957230150699615, -0.02495805360376835, -0.002289385301992297, -0.03220151737332344, -0.002641237573698163, 0.007506181485950947, -0.0067305429838597775, 0.019015660509467125, 0.0028116905596107244, 0.026671964675188065, 0.0444866381585598, -0.007975317537784576, 0.00644906098023057, -...
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): super(PrivateFlavorManageTestV2, self).setUp() self.flags( osapi_compute_extension=[ 'nova.api.openstack.compute.contrib.select_extensions'], osapi_compute_ext_list=['Flavormanage', 'Flavorextradata', 'Flavor_access', 'Flavor_rxtx'...
15,479
[ 0.04143862798810005, 0.02595987729728222, -0.006813889369368553, -0.02794967219233513, -0.007658395450562239, -0.0053533571772277355, -0.045325666666030884, 0.016323255375027657, 0.038268838077783585, 0.009098682552576065, 0.047130364924669266, -0.03315553069114685, -0.0011076908558607101, ...
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_create_policy_failed(self): rule_name = "os_compute_api:os-flavor-manage" self.policy.set_rules({rule_name: "project:non_fake"}) req = fakes.HTTPRequest.blank('') exc = self.assertRaises( exception.PolicyNotAuthorized, self.controller._create, req, ...
15,480
[ 0.047854211181402206, 0.03908560425043106, -0.014505516737699509, -0.0514456108212471, -0.01385253481566906, 0.029827259480953217, -0.05172545835375786, 0.02590937167406082, 0.04379639774560928, 0.0038858226034790277, 0.05158553272485733, -0.060354143381118774, -0.014423893764615059, -0.04...
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_delete_policy_failed(self): rule_name = "os_compute_api:os-flavor-manage" self.policy.set_rules({rule_name: "project:non_fake"}) req = fakes.HTTPRequest.blank('') exc = self.assertRaises( exception.PolicyNotAuthorized, self.controller._delete, req, ...
15,481
[ 0.018124936148524284, 0.04687679558992386, 0.03522586449980736, -0.03968598693609238, -0.0039139846339821815, 0.011901244521141052, 0.004352032672613859, -0.02780749648809433, -0.02669246681034565, -0.0019143254030495882, -0.038024816662073135, 0.007736946456134319, 0.017396751791238785, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Flag', fields=[ ('id', models...
15,482
[ 0.018160605803132057, 0.008245128206908703, 0.030018901452422142, -0.011390360072255135, 0.015791315585374832, 0.02003234438598156, 0.031985409557819366, 0.0009951016400009394, -0.004868890158832073, -0.000660809688270092, 0.004670462571084499, -0.0033081206493079662, -0.02435629814863205, ...
10
{"_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 TestIm2colNDKernelMemo(unittest.TestCase): def setUp(self): chainer.backends.cuda.clear_memo() def test_im2col_nd_kernel_memo(self): ndim = self.ndim with mock.patch( 'chainer.utils.conv_nd_kernel.Im2colNDKernel._generate') as m: conv_nd_kernel.Im2colN...
15,483
[ 0.036031804978847504, 0.007546884473413229, 0.0217863991856575, -0.0159539133310318, 0.02132686972618103, 0.02745392732322216, 0.03914246708154678, -0.0048162201419472694, 0.010362973436713219, -0.01517624780535698, 0.005979771725833416, -0.012348376214504242, -0.03120085783302784, 0.03551...
10
{"_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 TestCol2imNDKernelMemo(unittest.TestCase): def setUp(self): chainer.backends.cuda.clear_memo() def test_col2im_nd_kernel_memo(self): ndim = self.ndim with mock.patch( 'chainer.utils.conv_nd_kernel.Col2imNDKernel._generate') as m: conv_nd_kernel.Col2imN...
15,484
[ 0.024458764120936394, -0.0019252081401646137, 0.00607446301728487, -0.015930378809571266, 0.004577397834509611, 0.006212388165295124, 0.01540166512131691, -0.0130684282630682, -0.005511267576366663, 0.0024208773393183947, 0.01944747567176819, 0.006896268110722303, -0.0026062147226184607, 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 test_im2col_nd_kernel_memo(self): ndim = self.ndim with mock.patch( 'chainer.utils.conv_nd_kernel.Im2colNDKernel._generate') as m: conv_nd_kernel.Im2colNDKernel.generate(ndim) m.assert_called_once_with(ndim) conv_nd_kernel.Im2colNDKernel.generate(n...
15,485
[ 0.026079533621668816, 0.02605431154370308, 0.03591610863804817, -0.04191894084215164, -0.020467640832066536, 0.040203843265771866, 0.021640462800860405, 0.007427874952554703, -0.014073868282139301, 0.029383612796664238, 0.008966416120529175, -0.03848874941468239, 0.028349511325359344, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "rules", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co...
class RuleMatcherTestCase(CleanDbTestCase): rules = [] def test_get_matching_rules(self): self._setup_sample_trigger("st2.test.trigger1") rule_db_1 = self._setup_sample_rule(RULE_1) rule_db_2 = self._setup_sample_rule(RULE_2) rule_db_3 = self._setup_sample_rule(RULE_3) r...
15,486
[ 0.03977000340819359, -0.003126427996903658, -0.0028534403536468744, -0.019988449290394783, 0.0028347622137516737, 0.009425261057913303, 0.020747069269418716, -0.014551683329045773, 0.008494229055941105, -0.0038247019983828068, 0.017517192289233208, 0.003715506987646222, -0.005583317950367927...
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_col2im_nd_kernel_memo(self): ndim = self.ndim with mock.patch( 'chainer.utils.conv_nd_kernel.Col2imNDKernel._generate') as m: conv_nd_kernel.Col2imNDKernel.generate(ndim) m.assert_called_once_with(ndim) conv_nd_kernel.Col2imNDKernel.generate(n...
15,487
[ 0.050200026482343674, 0.022745458409190178, 0.031020691618323326, -0.0463595874607563, -0.027820324525237083, 0.045765236020088196, 0.032712314277887344, 0.040896106511354446, 0.003423248650506139, 0.009303920902311802, 0.006217854097485542, -0.013052921742200851, 0.007337982300668955, -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_trigger_instance_payload_with_special_values(self): # Test a rule where TriggerInstance payload contains a dot (".") and $ self._setup_sample_trigger("st2.test.trigger1") self._setup_sample_trigger("st2.test.trigger2") rule_db_1 = self._setup_sample_rule(RULE_1) rule_db_...
15,488
[ 0.003364012110978365, 0.0071370406076312065, 0.09185679256916046, -0.05899321287870407, -0.058518990874290466, 0.01975134387612343, 0.03608829155564308, 0.006366429850459099, -0.01351532619446516, 0.024280164390802383, 0.0012885499745607376, -0.02705436199903488, 0.03464191406965256, -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_get_matching_rules(self): self._setup_sample_trigger("st2.test.trigger1") rule_db_1 = self._setup_sample_rule(RULE_1) rule_db_2 = self._setup_sample_rule(RULE_2) rule_db_3 = self._setup_sample_rule(RULE_3) rules = [rule_db_1, rule_db_2, rule_db_3] trigger_instanc...
15,489
[ 0.05926456302404404, 0.027146678417921066, 0.03523707017302513, -0.003859385149553418, -0.006987710949033499, 0.028925590217113495, 0.027171047404408455, 0.004291928838938475, -0.020165059715509415, 0.03760083019733429, 0.02491694688796997, -0.028340741991996765, 0.04649538919329643, -0.02...
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_rule_enforcement_is_created_on_exception_1(self): # 1. Exception in _render_criteria_pattern rule_enforcement_dbs = list(RuleEnforcement.get_all()) self.assertEqual(rule_enforcement_dbs, []) self._setup_sample_trigger("st2.test.trigger4") rule_4_db = self._setup_sample_...
15,490
[ 0.07027118653059006, 0.009995470754802227, 0.024098170921206474, -0.013351526111364365, -0.02180830016732216, 0.044319313019514084, 0.022401969879865646, 0.010752703063189983, -0.012539772316813469, 0.02544301748275757, 0.03307592123746872, -0.001224445179104805, 0.052582234144210815, -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 test_rule_enforcement_is_created_on_exception_2(self): # 1. Exception in payload_lookup.get_value rule_enforcement_dbs = list(RuleEnforcement.get_all()) self.assertEqual(rule_enforcement_dbs, []) self._setup_sample_trigger("st2.test.trigger4") rule_4_db = self._setup_sample_...
15,491
[ 0.06604097783565521, 0.005448874551802874, 0.02884661965072155, -0.013571248389780521, -0.014793772250413895, 0.040503814816474915, 0.01912817358970642, 0.0056341057643294334, -0.01241046842187643, 0.021313898265361786, 0.03114348277449608, -0.004584463778883219, 0.05542107671499252, -0.02...
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_rule_enforcement_is_created_on_exception_3(self): # 1. Exception in payload_lookup.get_value rule_enforcement_dbs = list(RuleEnforcement.get_all()) self.assertEqual(rule_enforcement_dbs, []) self._setup_sample_trigger("st2.test.trigger4") rule_4_db = self._setup_sample_...
15,492
[ 0.028403738513588905, 0.03459373489022255, -0.015639616176486015, -0.009603273123502731, -0.00898866355419159, 0.01614447496831417, 0.07366533577442169, 0.014937206171452999, 0.0037288139574229717, -0.019338248297572136, -0.009317918680608273, 0.03064267337322235, 0.06967037916183472, -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}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def _setup_sample_trigger(self, name): trigtype = TriggerTypeDB( name=name, pack="dummy_pack_1", payload_schema={}, parameters_schema={} ) TriggerType.add_or_update(trigtype) created = TriggerDB( name=name, pack="dummy_pack_1", type=trigty...
15,493
[ 0.036607854068279266, 0.03571334481239319, 0.051702722907066345, -0.04445718601346016, -0.04380866512656212, 0.008883610367774963, 0.060737282037734985, -0.028669070452451706, -0.016559630632400513, 0.026365704834461212, 0.004374716896563768, -0.03459520637989044, -0.007748699747025967, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setUpClass(cls): super(BackstopRuleMatcherTestCase, cls).setUpClass() fixturesloader = FixturesLoader() # Create TriggerTypes before creation of Rule to avoid failure. Rule requires the # Trigger and therefore TriggerType to be created prior to rule creation. cls.models = fix...
15,494
[ 0.041508134454488754, 0.02306646667420864, 0.0661277025938034, -0.030003663152456284, -0.03755059838294983, 0.032143495976924896, 0.029727555811405182, 0.0038137324154376984, 0.0027740157674998045, 0.02786383219063282, -0.020385924726724625, -0.04461434483528137, -0.0020334154833108187, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "models", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_...
class BackstopRuleMatcherTestCase(DbTestCase): models = None @classmethod def setUpClass(cls): super(BackstopRuleMatcherTestCase, cls).setUpClass() fixturesloader = FixturesLoader() # Create TriggerTypes before creation of Rule to avoid failure. Rule requires the # Trigger a...
15,495
[ 0.050339050590991974, 0.0005750944255851209, 0.05272722989320755, -0.01727917231619358, -0.034581758081912994, 0.049074724316596985, 0.04694409295916557, 0.04792746156454086, -0.007954740896821022, 0.005592902656644583, -0.0238700769841671, 0.006292381323873997, 0.0023779349867254496, -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 test_backstop_ignore(self): trigger_instance = container_utils.create_trigger_instance( self.models["triggers"]["trigger1.yaml"].ref, {"k1": "v1"}, date_utils.get_datetime_utc_now(), ) trigger = self.models["triggers"]["trigger1.yaml"] rules = [rul...
15,496
[ 0.040639977902173996, 0.00749574089422822, 0.06916655600070953, -0.01689864881336689, -0.04325221851468086, 0.038305144757032394, 0.03869813680648804, 0.051227640360593796, -0.0020530931651592255, 0.01344263181090355, -0.012945612892508507, -0.002498098649084568, 0.007715354207903147, -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 test_backstop_apply(self): trigger_instance = container_utils.create_trigger_instance( self.models["triggers"]["trigger1.yaml"].ref, {"k1": "v1"}, date_utils.get_datetime_utc_now(), ) trigger = self.models["triggers"]["trigger1.yaml"] success_rule ...
15,497
[ 0.010912320576608181, 0.040286701172590256, -0.0011759658809751272, -0.04926072061061859, 0.017230544239282608, 0.021589046344161034, -0.004757407587021589, -0.022531425580382347, -0.002472406253218651, 0.07037857919931412, -0.006821538787335157, -0.04549120366573334, -0.0003681168018374592,...
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": "module", "annotation":...
class Blacklist(object): def __init__(self, module, filename): if not os.path.exists(filename): open(filename, 'a').close() self.filename = filename self.module = module def get_pattern(self): return '^blacklist\s*' + self.module + '$' def readlines(self): ...
15,498
[ -0.002127238782122731, 0.022181807085871696, 0.023662125691771507, -0.010465498082339764, -0.002843012334778905, 0.05967170000076294, -0.031763706356287, 0.00033188797533512115, 0.015239235013723373, 0.073947012424469, -0.00957042258232832, -0.03818988800048828, 0.02008182182908058, 0.0417...
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 module_listed(self): lines = self.readlines() pattern = self.get_pattern() for line in lines: stripped = line.strip() if stripped.startswith('#'): continue if re.match(pattern, stripped): return True return False
15,499
[ 0.003066906938329339, 0.012906567193567753, -0.00703994557261467, -0.032690439373254776, -0.03585028275847435, 0.05311325192451477, -0.005038904957473278, -0.01762309856712818, 0.019656086340546608, 0.06872659921646118, 0.015346151776611805, -0.04289022833108902, 0.019574766978621483, 0.04...
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": "Call", "_fields": {"a...
def main(): module = AnsibleModule( argument_spec=dict( name=dict(required=True), state=dict(required=False, choices=['present', 'absent'], default='present'), blacklist_file=dict(required=False, default=None) ), supports_check_mode=...
15,500
[ 0.0655902624130249, 0.047991812229156494, 0.0330134741961956, -0.051790978759527206, -0.0010651048505678773, 0.04281707853078842, -0.016135554760694504, 0.0007607892039231956, 0.022249160334467888, 0.04759879410266876, -0.0016744185704737902, -0.02550247311592102, -0.01373378001153469, 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 remove_module(self): lines = self.readlines() pattern = self.get_pattern() f = open(self.filename, 'w') for line in lines: if not re.match(pattern, line.strip()): f.write(line) f.close()