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,501
[ 0.03650645166635513, -0.00031455804128199816, 0.01710723154246807, -0.0134093277156353, 0.013090339489281178, 0.00025917807943187654, -0.027078572660684586, -0.002135450253263116, 0.01441355049610138, 0.013822831213474274, 0.006350232288241386, -0.040381573140621185, 0.007242218591272831, ...
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 TestAlgorithm(PythonAlgorithm): def PyInit(self): self.declareProperty("StringInput", "", StringMandatoryValidator()) self.declareProperty(FloatArrayProperty("ArrayInput", FloatArrayMandatoryValidator())) def PyExec(self): pass
16,502
[ 0.0023906566202640533, 0.006989466957747936, 0.04021790996193886, -0.03149919584393501, -0.025721237063407898, -0.008780840784311295, 0.003600869793444872, 0.026673875749111176, -0.03959662467241287, 0.035247623920440674, 0.009003468789160252, 0.013264454901218414, -0.044691167771816254, -...
11
{"_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 build(self, **kwargs): checkout_path = self.project.checkout_path(self.version.slug) build_command = [ 'python', self.project.venv_bin(version=self.version.slug, filename='mkdocs'), self.builder, '--clean', '--site-dir', self.build_dir, ...
16,503
[ 0.0074617257341742516, 0.040294304490089417, -0.01788453198969364, -0.038838356733322144, 0.002629065653309226, 0.015523537993431091, 0.01039821282029152, -0.010457237251102924, -0.008873404003679752, -0.026128336787223816, -0.02351156808435917, -0.010496587492525578, 0.02835160680115223, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "mkdocs_json"}}, "targets": [{"_type": "Name", "_fields": {"id": "type", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null...
class MkdocsJSON(BaseMkdocs): type = 'mkdocs_json' builder = 'json' build_dir = '_build/json' use_theme = False def build(self, **kwargs): user_config = yaml.safe_load( open(os.path.join(self.root_path, 'mkdocs.yml'), 'r') ) if user_config['theme_dir'] == TEMPLAT...
16,504
[ 0.045234281569719315, 0.03369975462555885, -0.00960851926356554, -0.031526271253824234, -0.005552066955715418, 0.00334092415869236, 0.024446310475468636, 0.006165376864373684, -0.025672929361462593, -0.0032440857030451298, -0.01206175796687603, -0.015354262664914131, -0.007461934816092253, ...
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 build(self, **kwargs): user_config = yaml.safe_load( open(os.path.join(self.root_path, 'mkdocs.yml'), 'r') ) if user_config['theme_dir'] == TEMPLATE_DIR: del user_config['theme_dir'] yaml.dump( user_config, open(os.path.join(self.root_p...
16,505
[ 0.020187783986330032, 0.04812394082546234, 0.040258873254060745, 0.004874824546277523, -0.03244048357009888, -0.02480880171060562, 0.0033694927114993334, -0.01074736937880516, -0.02159976214170456, 0.05549890175461769, -0.013466302305459976, -0.0076666902750730515, -0.009037825278937817, 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 GetBrowserStartupArgs(self): args = super(CrOSBrowserBackend, self).GetBrowserStartupArgs() args.extend([ '--enable-smooth-scrolling', '--enable-threaded-compositing', '--enable-per-tile-painting', '--force-compositing-mode', # Disables the start p...
16,506
[ 0.010566993616521358, 0.05360937863588333, 0.031925808638334274, 0.01135389693081379, -0.011984668672084808, -0.011953442357480526, 0.01581301912665367, 0.03232550621032715, 0.03412414342164993, 0.04783875122666359, 0.016974637284874916, -0.0370219461619854, -0.02093413844704628, 0.0279788...
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 Close(self): super(CrOSBrowserBackend, self).Close() self._RestartUI() # Logs out. if not self._cri.local: if self._forwarder: self._forwarder.Close() self._forwarder = None if self._login_ext_dir: self._cri.RmRF(self._login_ext_dir) self._login_ext_dir = None ...
16,507
[ 0.021379509940743446, -0.015481000766158104, 0.018150852993130684, -0.000356044911313802, 0.058736737817525864, 0.003389056073501706, 0.016598613932728767, 0.017343688756227493, 0.009923984296619892, 0.03379742428660393, 0.00650388328358531, -0.0062813954427838326, 0.030196230858564377, 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": "cri", "annotation": nu...
class SSHForwarder(object): def __init__(self, cri, forwarding_flag, *port_pairs): self._proc = None if forwarding_flag == 'R': self._host_port = port_pairs[0].remote_port command_line = ['-%s%i:localhost:%i' % (forwarding_flag, port_pair.remote_port,...
16,508
[ 0.031690072268247604, -0.00391671946272254, 0.03474104776978493, 0.008089542388916016, 0.07268896698951721, 0.01507672481238842, 0.03240270912647247, 0.015577797777950764, 0.023917876183986664, 0.032714489847421646, 0.006786752957850695, -0.004757408052682877, 0.02436327375471592, 0.027636...
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": "cri", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __init__(self, cri, forwarding_flag, *port_pairs): self._proc = None if forwarding_flag == 'R': self._host_port = port_pairs[0].remote_port command_line = ['-%s%i:localhost:%i' % (forwarding_flag, port_pair.remote_port, ...
16,509
[ 0.033529821783304214, 0.0134119288995862, -0.0027915453538298607, -0.008864134550094604, 0.01090344786643982, 0.02018044888973236, -0.004588456358760595, 0.03295431286096573, 0.021156316623091698, 0.03312946856021881, -0.022394919767975807, -0.0168900229036808, 0.02465943433344364, -0.0170...
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_do_nothing(self): # Testing DO_NOTHING is a bit harder: It would raise IntegrityError for a normal model, # so we connect to pre_delete and set the fk to a known value. replacement_r = R.objects.create() def check_do_nothing(sender, **kwargs): obj = kwargs['instance'...
16,510
[ 0.07342018187046051, 0.0304450411349535, 0.04517567902803421, -0.03725375235080719, -0.035389769822359085, 0.019041094928979874, 0.05550524592399597, 0.0163227878510952, 0.02451654151082039, 0.026471134275197983, 0.042612701654434204, -0.018717486411333084, -0.008206699043512344, 0.0076371...
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_m2m(self): m = M.objects.create() r = R.objects.create() MR.objects.create(m=m, r=r) r.delete() self.assertFalse(MR.objects.exists()) r = R.objects.create() MR.objects.create(m=m, r=r) m.delete() self.assertFalse(MR.objects.exists()) ...
16,511
[ 0.03900022432208061, -0.02451782487332821, 0.019309867173433304, -0.04035571962594986, -0.02125987969338894, 0.02343580685555935, 0.044041719287633896, 0.047751493752002716, -0.023982761427760124, 0.03150932863354683, -0.00022610172163695097, -0.06301865726709366, -0.04748990759253502, -0....
14
{"_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_instance_update(self): deleted = [] related_setnull_sets = [] def pre_delete(sender, **kwargs): obj = kwargs['instance'] deleted.append(obj) if isinstance(obj, R): related_setnull_sets.append(list(a.pk for a in obj.setnull_set.all())) ...
16,512
[ 0.07695090025663376, 0.0006879996508359909, 0.0018808728782460093, -0.0693865492939949, -0.010430161841213703, 0.030537553131580353, -0.017311617732048035, 0.03333916515111923, -0.023335080593824387, 0.0017860266380012035, 0.03116791509091854, -0.03534698486328125, -0.01539718359708786, -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_deletion_order(self): pre_delete_order = [] post_delete_order = [] def log_post_delete(sender, **kwargs): pre_delete_order.append((sender, kwargs['instance'].pk)) def log_pre_delete(sender, **kwargs): post_delete_order.append((sender, kwargs['instance']...
16,513
[ 0.06888280808925629, 0.04979880526661873, -0.02969413995742798, -0.023380279541015625, -0.023558301851153374, 0.05203001946210861, 0.0010228871833533049, 0.03054864890873432, -0.005575069226324558, -0.015760919079184532, 0.0403517484664917, -0.035390857607126236, -0.028768423944711685, -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_relational_post_delete_signals_happen_before_parent_object(self): deletions = [] def log_post_delete(instance, **kwargs): self.assertTrue(R.objects.filter(pk=instance.r_id)) self.assertIs(type(instance), S) deletions.append(instance.id) r = R.object...
16,514
[ 0.05471867322921753, 0.04169408604502678, 0.008246335200965405, 0.02057730406522751, 0.016287153586745262, 0.030596215277910233, 0.012472260743379593, 0.014129234477877617, 0.010423521511256695, 0.031366899609565735, 0.02107824943959713, -0.020281873643398285, 0.00863167829811573, 0.000975...
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_can_defer_constraint_checks(self): u = User.objects.create( avatar=Avatar.objects.create() ) a = Avatar.objects.get(pk=u.avatar_id) # 1 query to find the users for the avatar. # 1 query to delete the user # 1 query to delete the avatar # The i...
16,515
[ 0.05979572981595993, 0.045692961663007736, 0.01743614673614502, 0.004532115999609232, 0.007980883121490479, 0.03889799118041992, 0.013833531178534031, 0.013961737975478172, 0.02367982640862465, 0.01873103715479374, 0.01610279455780983, -0.035077426582574844, 0.0030144662596285343, -0.00316...
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_cannot_defer_constraint_checks(self): u = User.objects.create( avatar=Avatar.objects.create() ) # Attach a signal to make sure we will not do fast_deletes. calls = [] def noop(*args, **kwargs): calls.append('') models.signals.post_delete.c...
16,516
[ 0.020788898691534996, 0.030112186446785927, 0.029777074232697487, -0.05098486319184303, 0.010855227708816528, 0.021734392270445824, -0.013679741881787777, 0.03008824959397316, 0.030638791620731354, 0.034420765936374664, 0.0450725331902504, -0.037173472344875336, -0.014577362686395645, -0.0...
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 FastDeleteTests(TestCase): def test_fast_delete_fk(self): u = User.objects.create( avatar=Avatar.objects.create() ) a = Avatar.objects.get(pk=u.avatar_id) # 1 query to fast-delete the user # 1 query to delete the avatar self.assertNumQueries(2, a.de...
16,517
[ 0.01713601127266884, 0.01938372105360031, -0.01915004849433899, -0.021119575947523117, 0.025681760162115097, 0.011505606584250927, 0.011984080076217651, 0.03522896766662598, 0.03890096768736839, 0.017970556393265724, 0.038099806755781174, -0.029086709022521973, -0.024457760155200958, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_fast_delete_fk(self): u = User.objects.create( avatar=Avatar.objects.create() ) a = Avatar.objects.get(pk=u.avatar_id) # 1 query to fast-delete the user # 1 query to delete the avatar self.assertNumQueries(2, a.delete) self.assertFalse(User.ob...
16,518
[ 0.03315391764044762, 0.018221450969576836, 0.020742204040288925, -0.03382611647248268, 0.017681289464235306, 0.003769127419218421, 0.00340901967138052, 0.038435496389865875, 0.021582456305623055, 0.024019185453653336, 0.03262576088309288, -0.05329594388604164, -0.016408909112215042, 0.0057...
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_fast_delete_joined_qs(self): a = Avatar.objects.create(desc='a') User.objects.create(avatar=a) u2 = User.objects.create() expected_queries = 1 if connection.features.update_can_self_select else 2 self.assertNumQueries(expected_queries, User....
16,519
[ 0.0476573146879673, 0.019795939326286316, 0.031940050423145294, -0.03940805047750473, 0.03040049597620964, 0.023690786212682724, -0.00441760802641511, 0.025643955916166306, 0.0218410212546587, 0.01716490648686886, 0.05436702445149422, -0.009570525959134102, 0.017452135682106018, -0.0102426...
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_fast_delete_inheritance(self): c = Child.objects.create() p = Parent.objects.create() # 1 for self, 1 for parent # However, this doesn't work as child.parent access creates a query, # and this means we will be generating extra queries (a lot for large # querysets...
16,520
[ 0.003993628546595573, -0.027394404634833336, 0.05656622350215912, -0.01029234193265438, 0.013375045731663704, 0.00812611822038889, -0.005254482384771109, 0.0008602409507147968, -0.014808086678385735, 0.011808698996901512, -0.007470696233212948, -0.03257112577557564, 0.011664284393191338, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "PositiveIntegerModel", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields"...
class PositiveIntegerFieldTests(IntegerFieldTests): model = PositiveIntegerModel documented_range = (0, 2147483647) @unittest.skipIf(connection.vendor == 'sqlite', "SQLite doesn't have a constraint.") def test_negative_values(self): p = PositiveIntegerModel.objects.create(value=0) p.val...
16,521
[ -0.002475408371537924, -0.03158466890454292, 0.07807034999132156, -0.023631365969777107, 0.015883751213550568, -0.02117452584207058, 0.013712591491639614, 0.011747119948267937, 0.022877173498272896, 0.07738472521305084, -0.001221277634613216, -0.06001543998718262, -0.03802958503365517, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 1}}, "targets": [{"_type": "Name", "_fields": {"id": "A", "ctx": {"_type": "Store", "_fields": ...
class ValidationTests(SimpleTestCase): class Choices(models.IntegerChoices): A = 1 def test_integerfield_cleans_valid_string(self): f = models.IntegerField() self.assertEqual(f.clean('2', None), 2) def test_integerfield_raises_error_on_invalid_intput(self): f = models.Inte...
16,522
[ 0.009747885167598724, -0.023922758176922798, 0.0006240653456188738, -0.06859397888183594, 0.016953902319073677, -0.026902461424469948, -0.06839938461780548, 0.014776893891394138, 0.024190323427319527, 0.0068958839401602745, -0.004551648162305355, -0.016114719212055206, 0.0006385077722370625,...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "response", "annotation": null, "type_comment": null}}], "kwarg...
def main(request, response): headers = [("Content-Type", "text/plain")] stashed_data = {'control_request_headers': "", 'preflight': "0", 'preflight_referrer': ""} token = None if "token" in request.GET: token = request.GET.first("token") if "origin" in request.GET: for origin in re...
16,523
[ 0.019055968150496483, 0.005335935857146978, 0.00915109645575285, -0.006836874410510063, -0.013098498806357384, 0.035810939967632294, 0.005504543427377939, 0.004945823922753334, -0.0027489657513797283, 0.019717175513505936, -0.014665558002889156, -0.03091801144182682, 0.023525724187493324, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "model", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ratio", "annotation": null, "type_comment": null}}], "kwarg": nu...
def get_ranksel(model, ratio): conf = json.loads(model.symbol.tojson()) _, output_shapes, _ = model.symbol.get_internals().infer_shape(data=(1,3,224,224)) out_names = model.symbol.get_internals().list_outputs() out_shape_dic = dict(zip(out_names, output_shapes)) nodes = conf['nodes'] nodes = utils.topsort(n...
16,524
[ 0.034556012600660324, 0.01415071077644825, 0.04404573515057564, -0.015324944630265236, -0.019842147827148438, 0.018236564472317696, 0.02104034647345543, 0.006230626255273819, -0.041074205189943314, 0.009873146191239357, -0.01939881592988968, -0.0422484390437603, -0.02071683295071125, -0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def main(): director.init( resizable=True ) main_scene = cocos.scene.Scene() main_scene.add( BackgroundLayer(), z=0 ) #main_scene.do( Liquid( waves=5, grid=(16,16), duration=10) + StopGrid() ) main_scene.do( Liquid( waves=5, grid=(16,16), duration=10) ) director.run (main_scene)
16,525
[ 0.010105390101671219, 0.020682718604803085, 0.011881059966981411, -0.009627551771700382, 0.04542411118745804, 0.032988522201776505, -0.033153701573610306, -0.006447864230722189, 0.005728157237172127, 0.043489161878824234, 0.015137437731027603, -0.014323342591524124, -0.006613042671233416, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "permission", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def permissions_required(permission): def decorator(f): @wraps(f) def decorated_function(*args, **kwargs): if not current_user.can(permission): abort(403) return f(*args, **kwargs) return decorated_function return decorator
16,526
[ 0.006480616983026266, -0.0069746109656989574, 0.037856586277484894, -0.019417395815253258, 0.0385608933866024, -0.021266205236315727, 0.08256061375141144, 0.008006618358194828, -0.015709994360804558, 0.02193138562142849, -0.007365893572568893, 0.025296416133642197, -0.01733381673693657, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"...
def _setup_path(): # Destination site for this push. env.site = env.environment + "." + env.domain # Root directory for project. Default: {env.home}/www/{env.site} env.root = os.path.join(os.path.join(env.home, "www"), env.site) # Root directory for source code. Default: {env.root}/{env.project} ...
16,527
[ 0.030937930569052696, 0.0020059198141098022, 0.07019489258527756, -0.011327909305691719, -0.0036026567686349154, -0.04565621167421341, 0.049914177507162094, 0.026753801852464676, -0.0182994045317173, 0.002888893708586693, 0.0073160696774721146, 0.017708703875541687, 0.0075191231444478035, ...
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": "depth", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _create_random_ind_full(self, depth=0, output=None): if depth == 0: output.append(self.random_terminal()) else: func = self.random_function() output.append(func) depth -= 1 [self._create_random_ind_full(depth=depth, output=output) ...
16,528
[ 0.006230780389159918, -0.029569804668426514, 0.03325429558753967, -0.03933253511786461, 0.010519575327634811, -0.05510309711098671, 0.014996115118265152, 0.019290776923298836, 0.01863367110490799, 0.04074062034487724, -0.03163499757647514, -0.01076012384146452, -0.0016823693877086043, 0.03...
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 random_function(self): func = np.random.randint(len(self._function_set)) func = self._function_set[func] if issubclass(func, Add) and func.nargs > 1: return func(range(func.nargs), weight=np.ones(func.nargs)) elif func.nargs == 1: return func(0, weight=1) ...
16,529
[ 0.03629219904541969, 0.0178794227540493, 0.06472957134246826, 0.00047766848001629114, -0.0023349313996732235, -0.04761381074786186, 0.033504221588373184, 0.014121714048087597, -0.027322182431817055, 0.003172839991748333, 0.0006409318302758038, 0.004060750361531973, 0.004421369172632694, -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": "depth", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _create_random_ind_grow(self, depth=0, output=None): if self.grow_use_function(depth=depth): func = self.random_function() output.append(func) depth -= 1 [self._create_random_ind_grow(depth=depth, output=output) for x in range(func.nargs)] ...
16,530
[ 0.00461099436506629, -0.0023667183704674244, 0.03746134415268898, 0.005677137523889542, 0.03621900454163551, -0.0013729953207075596, 0.02442871406674385, 0.033256497234106064, 0.021131733432412148, -0.012937065213918686, 0.030270103365182877, -0.024918483570218086, 0.0015469527570530772, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwa...
def fake_ssh_environment(monkeypatch, tmpdir): def fake_which_ssh(*_): return os.path.join(os.sep, 'usr', 'bin', 'ssh') monkeypatch.setattr(edi.lib.helpers, 'which', fake_which_ssh) def intercept_command_run(*popenargs, **kwargs): if get_command(popenargs) == 'ssh' and get_sub_command(pope...
16,531
[ 0.030699534341692924, 0.04677414894104004, 0.05265822634100914, -0.0037814790848642588, 0.029740173369646072, 0.003485676134005189, 0.013846768997609615, 0.06054630130529404, 0.02249167300760746, 0.0074403733015060425, 0.0055163223296403885, 0.0216069296002388, 0.030699534341692924, 0.0040...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "popenargs", "annotation": null, "type_com...
def intercept_command_run(*popenargs, **kwargs): if get_command(popenargs) == 'ssh' and get_sub_command(popenargs) == '-G': return subprocess.CompletedProcess("fakerun", 0, stdout=fake_config) elif get_command(popenargs) == "getent" and get_sub_command(popenargs) == "passwd": ret...
16,532
[ 0.029177522286772728, -0.027935925871133804, 0.03295006603002548, -0.008297208696603775, 0.03655547276139259, -0.023542582988739014, 0.01620044931769371, 0.02178763411939144, 0.0021638404577970505, 0.003527805907651782, 0.038179099559783936, -0.0390147902071476, 0.02657494507730007, 0.0139...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwa...
def test_ssh_identity_files(monkeypatch, tmpdir): fake_ssh_environment(monkeypatch, tmpdir) assert get_user_ssh_pub_keys() == [] create_file(tmpdir, 'blabla') create_file(tmpdir, 'blabla.pub') assert get_user_ssh_pub_keys() == [] create_file(tmpdir, 'bongo.pub') assert get_user_ssh_pub_...
16,533
[ 0.015852190554142, 0.018771713599562645, 0.04206927493214607, -0.04415632411837578, -0.002317151753231883, -0.01607496477663517, 0.017810264602303505, -0.03222028166055679, 0.0034881853498518467, 0.019944213330745697, 0.045774370431900024, -0.032923780381679535, 0.03787172585725784, -0.048...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "glimmer_prediction", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "genome_sequence", "annotation": null, "type_comment...
def glimmer2seq(glimmer_prediction=sys.argv[1], genome_sequence=sys.argv[2], outfile=sys.argv[3]): if len(sys.argv) >= 4: glimmerfile = open(glimmer_prediction, "r") sequence = open(genome_sequence) else: print("Missing input values.") sys.exit() fastafile = SeqIO.parse(sequ...
16,534
[ 0.024024896323680878, 0.017947930842638016, 0.04435780271887779, -0.04427695274353027, -0.04756471514701843, -0.008030756376683712, 0.0324733592569828, 0.04168986529111862, 0.001424078131094575, 0.03630009666085243, 0.04532795771956444, -0.01548211183398962, -0.018648602068424225, 0.023041...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def test_create(monkeypatch): monkeypatch.setattr('errata_tool.cli.release.Release', FakeMissingRelease) argv = ['errata-tool', 'release', 'create', '--name', 'rhceph-2.4', '--product', 'RHCEPH', '--product_version', 'RHEL-7-CEPH-2', '--type', 'QuarterlyUpdate', ...
16,535
[ -0.014488425105810165, 0.03880498558282852, 0.0247318334877491, -0.047295019030570984, -0.03585193306207657, -0.019886977970600128, -0.032991159707307816, -0.05080177262425423, -0.02657749317586422, -0.011385411024093628, 0.02696969546377659, -0.007699859794229269, 0.007797910366207361, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "mrp.workorder"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n...
class mrp_workorder(osv.osv): _name = "mrp.workorder" _description = "Work Order Report" _auto = False _columns = { 'year': fields.char('Year', size=64, readonly=True), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','Jun...
16,536
[ -0.03890546038746834, -0.017175206914544106, 0.0172421932220459, -0.030277665704488754, -0.0032689161598682404, -0.010402923449873924, -0.014415384270250797, -0.023069974035024643, 0.04889976978302002, 0.022748440504074097, 0.0216364748775959, -0.03089393675327301, -0.00938473641872406, -0...
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 TestUrlForHelpers(unittest.TestCase): def setUp(self): def dummy_view(): return {} def dummy_guid_project_view(): return {} def dummy_guid_profile_view(): return {} self.app = Flask(__name__) api_rule = Rule([ '/api/v...
16,537
[ -0.002205746714025736, 0.0004019508196506649, 0.04903135821223259, -0.017353646457195282, -0.03962371498346329, -0.03260784596204758, -0.014191189780831337, -0.03212949261069298, 0.005570839159190655, 0.009653463959693909, 0.029498539865016937, -0.058412425220012665, 0.014483517967164516, ...
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 setUp(self): def dummy_view(): return {} def dummy_guid_project_view(): return {} def dummy_guid_profile_view(): return {} self.app = Flask(__name__) api_rule = Rule([ '/api/v1/<pid>/', '/api/v1/<pid>/component/<...
16,538
[ -0.029490169137716293, -0.021748686209321022, 0.02209886722266674, -0.03336716443300247, -0.005899909418076277, -0.0372941829264164, 0.0001557441719342023, -0.026063404977321625, 0.037169117480516434, 0.013982191681861877, 0.010424111969769001, -0.01649598404765129, 0.0035987261217087507, ...
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_web_url_for_guid(self): with self.app.test_request_context(): # check /project/<pid> assert_equal('/pid123/', web_url_for('dummy_guid_project_view', pid='pid123', _guid=True)) assert_equal('/project/pid123/', web_url_for('dummy_guid_project_view', pid='pid123', _guid...
16,539
[ -0.004919791594147682, 0.017965253442525864, 0.045868732035160065, -0.005083167925477028, -0.02199726179242134, -0.0068494840525090694, 0.005302030593156815, -0.007743431255221367, 0.02337825670838356, 0.06559722125530243, 0.015474531799554825, -0.0341302827000618, -0.0224164929240942, -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_web_url_for_guid_regex_conditions(self): with self.app.test_request_context(): # regex matches limit keys to a minimum of 5 alphanumeric characters. # check /project/<pid> assert_not_equal('/123/', web_url_for('dummy_guid_project_view', pid='123', _guid=True)) ...
16,540
[ -0.005461882799863815, -0.020834388211369514, 0.026146898046135902, -0.012294107116758823, -0.006851708050817251, -0.034576769918203354, -0.0008507808088324964, -0.028549866750836372, 0.04369506239891052, 0.029537031427025795, 0.017288384959101677, -0.010098963044583797, 0.001545693376101553...
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_web_url_for_guid_case_sensitive(self): with self.app.test_request_context(): # check /project/<pid> assert_equal('/ABCdef/', web_url_for('dummy_guid_project_view', pid='ABCdef', _guid=True)) # check /project/<pid>/node/<nid> assert_equal('/GHIjkl/', web_u...
16,541
[ 0.011708714999258518, -0.018407421186566353, 0.020600859075784683, -0.028838708996772766, -0.03579290211200714, -0.03870917484164238, 0.011010803282260895, -0.029087962582707405, 0.026470795273780823, 0.023392505943775177, 0.005112826358526945, -0.023130787536501884, -0.008786209858953953, ...
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_web_url_for_guid_invalid_unicode(self): with self.app.test_request_context(): # unicode id's are not supported when encoding guid url's. # check /project/<pid> assert_not_equal('/ø∆≤µ©/', web_url_for('dummy_guid_project_view', pid='ø∆≤µ©', _guid=True)) as...
16,542
[ -0.052892278879880905, -0.007684004958719015, 0.013186508789658546, -0.023496847599744797, -0.030687272548675537, -0.055865947157144547, 0.023314040154218674, -0.013929924927651882, 0.023582156747579575, 0.02842045947909355, 0.010170185938477516, -0.02131534554064274, 0.00030258437618613243,...
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_waterbutler_url_for(self): with self.app.test_request_context(): url = waterbutler_url_for('upload', 'provider', 'path', mock.Mock(_id='_id')) assert_in('nid=_id', url) assert_in('/file?', url) assert_in('path=path', url) assert_in('provider=provider', url)
16,543
[ -0.03537099063396454, -0.02385719306766987, 0.004455940332263708, -0.039644673466682434, -0.02178320102393627, -0.03006660006940365, 0.030468828976154327, -0.004569067154079676, 0.022348836064338684, 0.025453537702560425, 0.030795639380812645, -0.04303847625851631, -0.0016733345109969378, ...
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_waterbutler_url_for_cookie_not_required(self): with self.app.test_request_context(): url = waterbutler_url_for('upload', 'provider', 'path', mock.Mock(_id='_id')) assert_not_in('cookie', url) assert_in('nid=_id', url) assert_in('/file?', url) assert_in('pat...
16,544
[ -0.03449179604649544, -0.03385487571358681, -0.005600629840046167, -0.019058676436543465, -0.017135661095380783, -0.04323723167181015, 0.03402635455131531, 0.00005086001328891143, 0.025746362283825874, 0.007612447254359722, 0.044658057391643524, -0.01746637187898159, -0.0025890283286571503, ...
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_waterbutler_url_for_implicit_cookie(self): with self.app.test_request_context() as context: context.request.cookies = {settings.COOKIE_NAME: 'cookie'} url = waterbutler_url_for('upload', 'provider', 'path', mock.Mock(_id='_id')) assert_in('nid=_id', url) assert_...
16,545
[ -0.001742338528856635, 0.00383146689273417, 0.009268234483897686, -0.06192993000149727, 0.0068630799651145935, -0.025908546522259712, 0.0003555293660610914, 0.005481514614075422, 0.02201555296778679, -0.000433487119153142, 0.004978110082447529, -0.0022876933217048645, -0.002567362505942583, ...
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 TestGetMimeTypes(unittest.TestCase): def test_get_markdown_mimetype_from_filename(self): name = 'test.md' mimetype = get_mimetype(name) assert_equal('text/x-markdown', mimetype) @unittest.skipIf(not LIBMAGIC_AVAILABLE, 'Must have python-magic and libmagic installed') def test_...
16,546
[ -0.03711079806089401, -0.0055622742511332035, 0.016610775142908096, -0.015307118184864521, 0.018924769014120102, -0.008479208685457706, 0.0017911718459799886, -0.015372300520539284, 0.04545421153306961, 0.026724988594651222, 0.02959303744137287, -0.006442243233323097, 0.020641252398490906, ...
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 TestWebpackFilter(unittest.TestCase): def setUp(self): self.asset_paths = {'assets': 'assets.07123e.js'} def test_resolve_asset(self): asset = paths.webpack_asset('assets.js', self.asset_paths, debug=False) assert_equal(asset, '/static/public/js/assets.07123e.js') def test_r...
16,547
[ -0.007705518044531345, 0.006771516054868698, 0.06367697566747665, -0.041398271918296814, -0.0041377670131623745, 0.017127951607108116, 0.009037844836711884, -0.0266877394169569, -0.019476693123579025, 0.03030012920498848, 0.05367765575647354, 0.019792605191469193, -0.02201772853732109, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ctl", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "hosts", "annotation": null, "type_comment": null}}, {"_type": "arg...
def do_task(ctl, hosts, ifaces, aliases): m1, m2, sw = hosts m1_if1, m2_if1, sw_if1, sw_if2 = ifaces m1_if1_10 = m1.create_vlan(m1_if1, 10, ip=test_ip(1,1)) m2_if1_20 = m2.create_vlan(m2_if1, 20, ip=test_ip(1,2)) sw_if1_10 = sw.create_vlan(sw_if1, 10) sw_if2_20 = sw.create_vlan(sw_if2, 20) ...
16,548
[ 0.014465856365859509, 0.029014023020863533, -0.03681282699108124, -0.02864363044500351, -0.02117406390607357, -0.04144272580742836, -0.034240663051605225, 0.031277526170015335, -0.02006288804113865, 0.004627325106412172, 0.0017503583803772926, -0.03866478428244591, 0.004107747692614794, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def _search_album(query): params = { "q": query } resp = requests.get(base_url + "search/albums", params=params) albums = resp.json()["results"]["albums"] if not albums: raise VGMException.NoResults return albums
16,549
[ -0.01539717335253954, -0.006100766826421022, 0.00138771696947515, -0.02824198454618454, -0.02842874266207218, -0.030752845108509064, -0.050217196345329285, -0.0192257147282362, -0.004632640164345503, 0.018987080082297325, 0.011267743073403835, -0.02286749891936779, -0.0037662896793335676, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _extract_artist(data): artist = data["performers"][0] artist_name = artist["names"]["en"] if "link" not in artist: raise VGMException.ArtistNotComplete resp = requests.get(base_url + artist["link"]) data = resp.json() artist_image = data["picture_full"] return artist_name, ar...
16,550
[ 0.0023829892743378878, -0.004087178967893124, -0.02682984247803688, -0.041395269334316254, 0.007449537981301546, -0.00541889201849699, -0.011050627566874027, -0.02105429209768772, 0.015577876009047031, -0.017073536291718483, 0.03143187239766121, -0.020179906859993935, -0.01532476395368576, ...
11
{"_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": "query", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _extract_song_title(data, query): disc = data["discs"][0] clean_query = re.sub(r"\W", "", query).strip() song_title = None similarities = [] for track in disc["tracks"]: title = list(track["names"].values())[0] clean_title = re.sub(r"\W", "", title).strip() sim = simil...
16,551
[ 0.013938549906015396, -0.007021130062639713, -0.03175583481788635, -0.04281126335263252, -0.021696018055081367, -0.05699871480464935, -0.010080559179186821, 0.014726742170751095, -0.043557971715927124, -0.00006254976324271411, 0.01878178119659424, -0.08400465548038483, -0.011667313054203987,...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def _get_entry(query): albums = _search_album(query) fields = {} album = albums[0] album_name = list(album["titles"].values())[0] fields["album"] = album_name resp = requests.get(base_url + album["link"]) data = resp.json() song_title = _extract_song_title(data, query) fields["so...
16,552
[ -0.019176209345459938, -0.022089216858148575, 0.019881602376699448, -0.07095719873905182, 0.04511895775794983, -0.02296442538499832, -0.043603669852018356, 0.010489438660442829, 0.018627570942044258, 0.049090053886175156, 0.007596026174724102, -0.021344637498259544, -0.019032519310712814, ...
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": "List", "_fields": {"c...
def test(): tests = [ "3-Nen E-Gumi Utatan - QUESTION", "3-nen E-gumi Utatan - Bye Bye YESTERDAY", "3-nen E-gumi Utatan - Jiriki Hongan Revolution", "AAA - Wake up!", "Aimer - Dareka Umi Wo", "Angela - Sidonia", "Anonymuz - Evan...
16,553
[ -0.0005641846801154315, 0.037705082446336746, 0.044916968792676926, 0.01748518832027912, -0.019856881350278854, -0.05619461089372635, -0.03017858788371086, 0.0008636714774183929, -0.005284883081912994, 0.010835976339876652, -0.0257498137652874, 0.0007857746677473187, -0.013443629257380962, ...
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 defineCharacteristics(self): self.name = 'Points displacement' self.group = 'Vector geometry tools' self.addParameter(ParameterVector(self.INPUT_LAYER, 'Input layer', [ParameterVector.VECTOR_TYPE_POINT])) self.addParameter(ParameterNumber(self.DISTANCE, ...
16,554
[ 0.009712282568216324, 0.045263245701789856, 0.0876595750451088, 0.00863718893378973, 0.0029398028273135424, -0.02648252062499523, -0.022400811314582825, -0.015986695885658264, -0.036249469965696335, -0.002302035689353943, -0.013265556655824184, -0.010416863486170769, -0.02852337621152401, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "INPUT_LAYER"}}, "targets": [{"_type": "Name", "_fields": {"id": "INPUT_LAYER", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment...
class PointsDisplacement(GeoAlgorithm): INPUT_LAYER = 'INPUT_LAYER' DISTANCE = 'DISTANCE' HORIZONTAL = 'HORIZONTAL' OUTPUT_LAYER = 'OUTPUT_LAYER' def defineCharacteristics(self): self.name = 'Points displacement' self.group = 'Vector geometry tools' self.addParameter(Param...
16,555
[ -0.000697443843819201, 0.007882168516516685, 0.09062133729457855, -0.01769273728132248, -0.012467176653444767, -0.002931371098384261, 0.0026886353734880686, 0.005033395253121853, -0.006462838966399431, 0.05032720789313316, -0.0012305353302508593, -0.016897104680538177, -0.027011092752218246,...
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": "progress", "annotation": null, "type_comment": null}}], "kwarg": ...
def processAlgorithm(self, progress): radius = self.getParameterValue(self.DISTANCE) horizontal = self.getParameterValue(self.HORIZONTAL) output = self.getOutputFromName(self.OUTPUT_LAYER) layer = dataobjects.getObjectFromUri( self.getParameterValue(self.INPUT_LAYER)) ...
16,556
[ 0.045350104570388794, 0.01805218681693077, 0.016504257917404175, -0.01930726319551468, -0.0020865648984909058, -0.02922236919403076, 0.015155050903558731, -0.02817647159099579, -0.019809294492006302, 0.06413441896438599, 0.02813463658094406, 0.017853466793894768, -0.005015077069401741, -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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Define(Node): def __init__(self, start, end, name, definition): Node.__init__(self, start, end) self.name = name self.definition = definition def __str__(self): value = '%s %s' % (self.name, self.definition) return self._StringHelper(self.__class__.__name__, value)
16,557
[ 0.022183269262313843, 0.024861164391040802, 0.01073497161269188, -0.05365147069096565, 0.004812026862055063, 0.022311901673674583, 0.04609723016619682, 0.02528214454650879, -0.026241041719913483, 0.09691878408193588, 0.01955214887857437, -0.02360992133617401, 0.029562100768089294, -0.01955...
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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Expr(Node): def __init__(self, start, end, expr): Node.__init__(self, start, end) self.expr = expr def Requires(self, node): # TODO(nnorwitz): impl. return False def __str__(self): return self._StringHelper(self.__class__.__name__, str(self.expr))
16,558
[ 0.01794639229774475, 0.022703779861330986, -0.011649226769804955, -0.05950981378555298, -0.014410209842026234, -0.016279183328151703, 0.008197996765375137, -0.03553173318505287, -0.03264331817626953, 0.04103246331214905, 0.005301619414240122, 0.00006255353218875825, 0.0025313440710306168, ...
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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Include(Node): def __init__(self, start, end, filename, system): Node.__init__(self, start, end) self.filename = filename self.system = system def __str__(self): fmt = '"%s"' if self.system: fmt = '<%s>' return self._StringHelper(self.__class__....
16,559
[ 0.009661822579801083, 0.02686275541782379, -0.01730252243578434, -0.04777977243065834, 0.00027970896917395294, -0.003815003205090761, 0.003988776821643114, -0.0190883819013834, -0.008956033736467361, 0.05304110795259476, -0.02087424322962761, -0.0296003594994545, 0.015591518953442574, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Parameter(Node): def __init__(self, start, end, name, parameter_type, default): Node.__init__(self, start, end) self.name = name self.type = parameter_type self.default = default def Requires(self, node): # TODO(nnorwitz): handle namespaces, etc. return sel...
16,560
[ 0.019652094691991806, 0.022852694615721703, 0.014779842458665371, 0.017154810950160027, 0.0013059774646535516, -0.014382315799593925, -0.005529699847102165, -0.030640142038464546, -0.013699385337531567, 0.04126124456524849, 0.0036032237112522125, -0.01345475297421217, 0.014922544360160828, ...
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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class _GenericDeclaration(Node): def __init__(self, start, end, name, namespace): Node.__init__(self, start, end) self.name = name self.namespace = namespace[:] def FullName(self): prefix = '' if self.namespace and self.namespace[-1]: prefix = '::'.join(self....
16,561
[ 0.012918860651552677, 0.05300578474998474, 0.05583275854587555, 0.008158733136951923, 0.017907639965415, -0.011484586633741856, -0.004562654998153448, -0.04909790679812431, -0.037415847182273865, 0.005851422902196646, -0.0004644501896109432, -0.008610841818153858, 0.04560576006770134, -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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class _NestedType(_GenericDeclaration): def __init__(self, start, end, name, fields, namespace): _GenericDeclaration.__init__(self, start, end, name, namespace) self.fields = fields def IsDefinition(self): return True def IsExportable(self): return True def __str__(sel...
16,562
[ 0.009086599573493004, 0.024304717779159546, 0.029307328164577484, 0.0035582727286964655, 0.021814480423927307, -0.014122413471341133, -0.01624741591513157, -0.04453651234507561, -0.006718107499182224, 0.04679432883858681, 0.002499921713024378, -0.011278009042143822, 0.05254954472184181, -0...
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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Typedef(_GenericDeclaration): def __init__(self, start, end, name, alias, namespace): _GenericDeclaration.__init__(self, start, end, name, namespace) self.alias = alias def IsDefinition(self): return True def IsExportable(self): return True def Requires(self, nod...
16,563
[ 0.01995697245001793, 0.04045981168746948, 0.042861636728048325, 0.006446713116019964, 0.0014615643303841352, -0.005813505034893751, -0.006921619176864624, -0.03858202323317528, -0.01925825886428356, 0.012598657049238682, -0.008477346040308475, -0.030328484252095222, 0.025066306814551353, -...
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": "start", "annotation": ...
class Class(_GenericDeclaration): def __init__(self, start, end, name, bases, templated_types, body, namespace): _GenericDeclaration.__init__(self, start, end, name, namespace) self.bases = bases self.body = body self.templated_types = templated_types def IsDeclaration(self): ...
16,564
[ -0.004420181270688772, 0.0118317985907197, 0.01682124473154545, -0.019611764699220657, 0.004556916654109955, 0.00949892494827509, -0.008410622365772724, 0.013528433628380299, -0.02676665410399437, 0.04647887498140335, -0.02397613413631916, 0.014343265444040298, 0.0022142764646559954, 0.002...
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": "node", "annotation": null, "type_comment": null}}], "kwarg": null...
def Requires(self, node): # TODO(nnorwitz): handle namespaces, etc. if self.bases: for token_list in self.bases: # TODO(nnorwitz): bases are tokens, do name comparison. for token in token_list: if token.name == node.name: ...
16,565
[ 0.011236689984798431, 0.03607398644089699, 0.007447950541973114, 0.004582108464092016, 0.018468758091330528, -0.003653813386335969, -0.020357731729745865, -0.019656112417578697, -0.0009923854377120733, 0.039182696491479874, 0.0030736287590116262, -0.023250557482242584, 0.01885734684765339, ...
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}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class Function(_GenericDeclaration): def __init__(self, start, end, name, return_type, parameters, modifiers, templated_types, body, namespace): _GenericDeclaration.__init__(self, start, end, name, namespace) converter = TypeConverter(namespace) self.return_type = converter....
16,566
[ 0.033233191817998886, 0.03835706785321236, 0.010463825426995754, 0.020001647993922234, -0.0016179316444322467, -0.013447609730064869, 0.0051933289505541325, -0.00890505500137806, -0.0004720039141830057, 0.03022882714867592, 0.024981481954455376, -0.01189398393034935, 0.028479712083935738, ...
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": "start", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__(self, start, end, name, return_type, parameters, modifiers, templated_types, body, namespace): _GenericDeclaration.__init__(self, start, end, name, namespace) converter = TypeConverter(namespace) self.return_type = converter.CreateReturnType(return_type) sel...
16,567
[ 0.005844756029546261, 0.0029886700212955475, -0.02005336806178093, -0.021213481202721596, 0.013777714222669601, 0.021423405036330223, -0.0067838942632079124, 0.042205989360809326, -0.009501871652901173, 0.048481643199920654, -0.014904679730534554, -0.011844193562865257, -0.007678837981075048...
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": "node", "annotation": null, "type_comment": null}}], "kwarg": null...
def Requires(self, node): if self.parameters: # TODO(nnorwitz): parameters are tokens, do name comparison. for p in self.parameters: if p.name == node.name: return True # TODO(nnorwitz): search in body too. return False
16,568
[ 0.04914455488324165, -0.001393086276948452, -0.01880277320742607, -0.0018276149639859796, 0.004799272865056992, 0.009930603206157684, 0.003535896772518754, -0.011476747691631317, -0.009126400575041771, 0.026896681636571884, -0.0527556836605072, -0.0207432359457016, 0.052340611815452576, -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 __str__(self): prefix = '' if self.modifiers: prefix = ' '.join(self.modifiers) + ' ' name = str(self.name) if self.templated_types: name += '<%s>' % self.templated_types suffix = prefix + name if self.reference: suffix += '&' ...
16,569
[ 0.08182976394891739, -0.01221471931785345, 0.022648125886917114, -0.0680660828948021, -0.011550875380635262, -0.0040577431209385395, -0.03359047695994377, 0.047708213329315186, -0.024805616587400436, 0.03916676342487335, 0.010427873581647873, -0.044344741851091385, -0.003606882644817233, -...
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": "tokens", "annotation": null, "type_comment": null}}, {"_type": "a...
def _GetTemplateEnd(self, tokens, start): count = 1 end = start while 1: token = tokens[end] end += 1 if token.name == '<': count += 1 elif token.name == '>': count -= 1 if count == 0: ...
16,570
[ 0.04197441041469574, 0.018886109814047813, 0.0015313061885535717, -0.0018503284081816673, 0.013651179149746895, 0.008784237317740917, -0.031480807811021805, -0.009354026056826115, 0.009217513725161552, 0.02457212284207344, 0.010095937177538872, -0.020642956718802452, 0.050948575139045715, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parts", "annotation": null, "type_comment": null}}, {"_type": "ar...
def DeclarationToParts(self, parts, needs_name_removed): name = None default = [] if needs_name_removed: # Handle default (initial) values properly. for i, t in enumerate(parts): if t.name == '=': default = parts[i+1:] ...
16,571
[ 0.03212637081742287, 0.008459411561489105, -0.027357611805200577, -0.029548045247793198, -0.008151381276547909, -0.024870555847883224, -0.03760245442390442, 0.03858358785510063, -0.012332601472735405, 0.03283369541168213, -0.03155594319105148, -0.06320315599441528, 0.004757349379360676, -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": "tokens", "annotation": null, "type_comment": null}}], "kwarg": nu...
def ToParameters(self, tokens): if not tokens: return [] result = [] name = type_name = '' type_modifiers = [] pointer = reference = array = False first_token = None default = [] def AddParameter(end): if default: ...
16,572
[ 0.026708140969276428, 0.050384096801280975, -0.0239667147397995, -0.014112116768956184, -0.024257471784949303, 0.03239867836236954, -0.02830730564892292, 0.0020521758124232292, -0.010062281973659992, 0.036012377589941025, 0.0006438198615796864, -0.021910645067691803, 0.0867287665605545, -0...
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": "return_type_seq", "annotation": null, "type_comment": null}}], "k...
def CreateReturnType(self, return_type_seq): if not return_type_seq: return None start = return_type_seq[0].start end = return_type_seq[-1].end _, name, templated_types, modifiers, default, other_tokens = \ self.DeclarationToParts(return_type_seq, False) na...
16,573
[ 0.022269750013947487, 0.010508708655834198, -0.011859050020575523, -0.027573108673095703, -0.012349093332886696, -0.012359983287751675, -0.013013374991714954, 0.01850186102092266, -0.007290756795555353, 0.026222767308354378, -0.0036862152628600597, -0.0020867681596428156, 0.05013688281178474...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "templated_types", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poson...
def AddType(templated_types): # Partition tokens into name and modifier tokens. names = [] modifiers = [] for t in name_tokens: if keywords.IsKeyword(t.name): modifiers.append(t.name) else: names.appe...
16,574
[ 0.05921810492873192, -0.007838564924895763, 0.06560397893190384, -0.062153227627277374, -0.005191004369407892, 0.009087976068258286, -0.03791862353682518, 0.004883609712123871, -0.026356616988778114, -0.0029053757898509502, 0.019435279071331024, -0.03369442746043205, 0.031235268339514732, ...
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": "names", "annotation": null, "type_comment": null}}], "kwarg": nul...
def GetTemplateIndices(self, names): # names is a list of strings. start = names.index('<') end = len(names) - 1 while end > 0: if names[end] == '>': break end -= 1 return start, end+1
16,575
[ 0.0482676699757576, 0.017159799113869667, -0.0260838121175766, -0.015450701117515564, -0.033516667783260345, 0.006664333865046501, -0.02087622694671154, 0.02216091752052307, 0.01947683095932007, 0.0206812284886837, -0.021690627560019493, -0.059095777571201324, 0.03542076051235199, 0.005935...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "end", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def AddParameter(end): if default: del default[0] # Remove flag. parts = self.DeclarationToParts(type_modifiers, True) (name, type_name, templated_types, modifiers, unused_default, unused_other_tokens) = parts parameter_type = Type(first_toke...
16,576
[ 0.013353553600609303, 0.017631052061915398, -0.003601945238187909, -0.03346870467066765, 0.0019948536064475775, 0.013038496486842632, 0.013147554360330105, 0.0034898577723652124, -0.025640761479735374, 0.028815561905503273, 0.045125801116228104, 0.010360515676438808, 0.025204528123140335, ...
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": "token_stream", "annotation": null, "type_comment": null}}, {"_typ...
def __init__(self, token_stream, filename, in_class='', visibility=None, namespace_stack=[]): self.tokens = token_stream self.filename = filename # TODO(nnorwitz): use a better data structure (deque) for the queue. # Switching directions of the "queue" improved perf by a...
16,577
[ 0.004399926867336035, 0.004399926867336035, -0.026464832946658134, -0.0373830609023571, 0.005577790085226297, -0.023925159126520157, -0.014229297637939453, 0.016258664429187775, 0.025681568309664726, 0.034867119044065475, 0.013552842661738396, -0.02435239404439926, 0.03800017759203911, -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": "token", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _GenerateOne(self, token): if token.token_type == tokenize.NAME: if (keywords.IsKeyword(token.name) and not keywords.IsBuiltinType(token.name)): method = getattr(self, 'handle_' + token.name) return method() elif token.name == self.in_c...
16,578
[ 0.0045331064611673355, 0.02423952706158161, 0.020021218806505203, -0.009922466240823269, -0.010363184846937656, -0.013032680377364159, 0.0041679395362734795, 0.03442642465233803, 0.030296260491013527, 0.005238255951553583, -0.0016668610041961074, -0.014442980289459229, -0.020285651087760925,...
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 Generate(self): while 1: token = self._GetNextToken() if not token: break # Get the next token. self.current_token = token # Dispatch on the next token type. if token.token_type == _INTERNAL_TOKEN: if t...
16,579
[ 0.019138377159833908, 0.03558703884482384, -0.028483424335718155, -0.056323155760765076, -0.00741971330717206, -0.031839825212955475, -0.017322244122624397, 0.012701446190476418, 0.003870780114084482, 0.02882825955748558, -0.01660958305001259, -0.04103543981909752, -0.0470355823636055, -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": "expected_token_type", "annotation": null, "type_comment": null}}]...
def _GetVarTokensUpTo(self, expected_token_type, *expected_tokens): last_token = self._GetNextToken() tokens = [] while (last_token.token_type != expected_token_type or last_token.name not in expected_tokens): tokens.append(last_token) last_token = self._Ge...
16,580
[ 0.022034991532564163, 0.017417779192328453, -0.031131776049733162, -0.0005963117582723498, 0.000673343543894589, -0.022034991532564163, 0.028454042971134186, 0.017818186432123184, -0.004229316953569651, 0.0031250647734850645, 0.03558632358908653, -0.020608535036444664, -0.021446891129016876,...
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 _SkipIf0Blocks(self): count = 1 while 1: token = self._GetNextToken() if token.token_type != tokenize.PREPROCESSOR: continue name = token.name[1:].lstrip() if name.startswith('endif'): count -= 1 if coun...
16,581
[ 0.024839144200086594, -0.007474624551832676, -0.018686562776565552, -0.008726751431822777, 0.01652553118765354, -0.006244743708521128, 0.003673752536997199, 0.05374611169099808, -0.042356207966804504, 0.045661311596632004, -0.010875070467591286, -0.005393043626099825, -0.026237457990646362, ...
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": "tokens", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _AddBackTokens(self, tokens): if tokens: if tokens[-1].whence == tokenize.WHENCE_STREAM: for token in tokens: token.whence = tokenize.WHENCE_QUEUE self.token_queue[:0] = reversed(tokens) else: assert tokens[-1].whenc...
16,582
[ 0.03037760965526104, 0.037994153797626495, 0.012875058688223362, -0.022428950294852257, -0.01639549620449543, -0.009061251766979694, 0.03232602775096893, 0.03482797369360924, 0.03378733992576599, 0.03409731760621071, 0.031573228538036346, -0.045389287173748016, -0.007771531585603952, 0.034...
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": "open_paren", "annotation": null, "type_comment": null}}, {"_type"...
def _GetMatchingChar(self, open_paren, close_paren, GetNextToken=None): if GetNextToken is None: GetNextToken = self._GetNextToken # Assumes the current token is open_paren and we will consume # and return up to the close_paren. count = 1 token = GetNextToken() ...
16,583
[ 0.041883472353219986, 0.035326071083545685, -0.01054262463003397, -0.08319289982318878, -0.029475189745426178, -0.002813666360452771, -0.050074703991413116, -0.0015303364489227533, -0.01621687412261963, 0.007595105096697807, -0.0028260857798159122, -0.04627715423703194, 0.034906573593616486,...
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": "token_seq", "annotation": null, "type_comment": null}}], "kwarg":...
def _GetReturnTypeAndClassName(self, token_seq): # Splitting the return type from the class name in a method # can be tricky. For example, Return::Type::Is::Hard::To::Find(). # Where is the return type and where is the class name? # The heuristic used is to pull the last name as the cla...
16,584
[ 0.01784249022603035, 0.03943350538611412, -0.020259302109479904, -0.042762789875268936, 0.00008169073407771066, 0.03911290690302849, -0.017756175249814987, -0.005789252929389477, -0.003782435320317745, 0.03612888231873512, -0.005949551705271006, -0.03849637508392334, 0.08177705109119415, 0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "return_type_and_name", "annotation": null, "type_comment": null}}...
def _GetMethod(self, return_type_and_name, modifiers, templated_types, get_paren): template_portion = None if get_paren: token = self._GetNextToken() assert token.token_type == tokenize.SYNTAX, token if token.name == '<': # Handle te...
16,585
[ 0.014379053376615047, 0.01828227937221527, -0.02281429059803486, -0.021355031058192253, 0.015956953167915344, 0.0341443195939064, -0.017689082771539688, -0.018792426213622093, 0.020738108083605766, -0.008648787625133991, 0.03998136147856712, -0.03763230890035629, 0.06311597675085068, 0.021...
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 handle_struct(self): # Special case the handling typedef/aliasing of structs here. # It would be a pain to handle in the class code. name_tokens, var_token = self.GetName() if name_tokens: next_token = self._GetNextToken() is_syntax = (var_token.token_type == ...
16,586
[ 0.002005078364163637, 0.0414668545126915, -0.0077957212924957275, -0.033334244042634964, -0.003173845587298274, -0.016123373061418533, -0.010567665100097656, 0.0017435464542359114, -0.034067124128341675, 0.013641035184264183, -0.022884786128997803, -0.005939878523349762, 0.04669158533215523,...
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": "ctor", "annotation": null, "type_comment": null}}], "kwarg": null...
def _GetNestedType(self, ctor): name = None name_tokens, token = self.GetName() if name_tokens: name = ''.join([t.name for t in name_tokens]) # Handle forward declarations. if token.token_type == tokenize.SYNTAX and token.name == ';': return ctor(token.st...
16,587
[ 0.0058922418393194675, 0.016086943447589874, -0.034419674426317215, -0.017280757427215576, 0.006158190779387951, 0.00006745678547304124, -0.01691433973610401, 0.030306335538625717, 0.04266999661922455, 0.032386645674705505, 0.011725383810698986, -0.010567029006779194, 0.038249336183071136, ...
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 handle_typedef(self): token = self._GetNextToken() if (token.token_type == tokenize.NAME and keywords.IsKeyword(token.name)): # Token must be struct/enum/union/class. method = getattr(self, 'handle_' + token.name) self._handling_typedef = True ...
16,588
[ -0.011196588166058064, 0.034691572189331055, -0.026738855987787247, -0.03747379407286644, -0.030530553311109543, 0.024646036326885223, -0.032401781529188156, 0.04702690243721008, 0.012827756814658642, 0.03134306147694588, 0.014982130378484726, -0.03545483574271202, 0.013948031701147556, -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 handle_virtual(self): # What follows must be a method. token = token2 = self._GetNextToken() if token.name == 'inline': # HACK(nnorwitz): handle inline dtors by ignoring 'inline'. token2 = self._GetNextToken() if token2.token_type == tokenize.SYNTAX and token2...
16,589
[ 0.04861832410097122, 0.006338875275105238, -0.037765584886074066, -0.05523703247308731, 0.008449805900454521, 0.00695329625159502, -0.02601250633597374, 0.005654496140778065, 0.007008046377450228, 0.010597237385809422, -0.003012790810316801, -0.0443599633872509, 0.05650237575173378, -0.010...
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 handle_template(self): token = self._GetNextToken() assert token.token_type == tokenize.SYNTAX, token assert token.name == '<', token templated_types = self._GetTemplatedTypes() # TODO(nnorwitz): for now, just ignore the template params. token = self._GetNextToken() ...
16,590
[ 0.0002621125604491681, 0.023737788200378418, -0.02028774656355381, -0.041125498712062836, -0.006271950900554657, -0.019400235265493393, -0.019837740808725357, 0.028450343757867813, -0.012975157238543034, 0.014387674629688263, -0.022700274363160133, -0.03315040096640587, 0.017275208607316017,...
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 _GetTemplatedTypes(self): result = {} tokens = list(self._GetMatchingChar('<', '>')) len_tokens = len(tokens) - 1 # Ignore trailing '>'. i = 0 while i < len_tokens: key = tokens[i].name i += 1 if keywords.IsKeyword(key) or key == ',': ...
16,591
[ -0.0256752111017704, 0.01615625061094761, 0.04646103084087372, -0.0534762442111969, -0.0003989607794210315, -0.01393594779074192, -0.01615625061094761, 0.009093795903027058, -0.0409102737903595, -0.0037703823763877153, -0.016959339380264282, -0.04494933411478996, 0.030848046764731407, -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 _GetBases(self): # Get base classes. bases = [] while 1: token = self._GetNextToken() assert token.token_type == tokenize.NAME, token # TODO(nnorwitz): store kind of inheritance...maybe. if token.name not in ('public', 'protected', 'private'): ...
16,592
[ -0.008291144855320454, 0.03333578258752823, -0.005836207885295153, -0.06750312447547913, -0.0034515864681452513, 0.026952333748340607, -0.025680536404252052, -0.03764032945036888, -0.0038581949193030596, 0.020617801696062088, 0.007936508394777775, -0.043925944715738297, 0.04424389451742172, ...
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": "class_type", "annotation": null, "type_comment": null}}, {"_type"...
def _GetClass(self, class_type, visibility, templated_types): class_name = None class_token = self._GetNextToken() if class_token.token_type != tokenize.NAME: assert class_token.token_type == tokenize.SYNTAX, class_token token = class_token else: # Ski...
16,593
[ 0.02900424227118492, 0.014773298986256123, -0.02392260544002056, -0.002287326380610466, 0.011301043443381786, -0.006590801291167736, -0.049189306795597076, -0.002207741606980562, 0.023297715932130814, 0.04315265268087387, 0.009090353734791279, -0.002733885543420911, 0.006643857806921005, 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 handle_namespace(self): token = self._GetNextToken() # Support anonymous namespaces. name = None if token.token_type == tokenize.NAME: name = token.name token = self._GetNextToken() self.namespace_stack.append(name) assert token.token_type == t...
16,594
[ -0.02552350051701069, 0.012507964856922626, 0.026224428787827492, -0.0712047666311264, -0.037898529320955276, -0.010471643880009651, -0.013607699424028397, -0.006924699526280165, 0.004743358585983515, 0.04145151749253273, 0.029414866119623184, -0.035409022122621536, 0.00599717628210783, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def main(argv): for filename in argv[1:]: source = utils.ReadFile(filename) if source is None: continue print('Processing %s' % filename) builder = BuilderFromSource(source, filename) try: entire_ast = filter(None, builder.Generate()) except K...
16,595
[ 0.03497222438454628, -0.00803292728960514, 0.0511292889714241, 0.022202933207154274, -0.013994102366268635, -0.04909662529826164, 0.024652551859617233, -0.011590087786316872, 0.02151234820485115, 0.007739754859358072, 0.034789808094501495, -0.05701880156993866, 0.04940934479236603, 0.02647...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "app", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "db", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def test_mod_somecontact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contact.create_new_(Infos(firstname='test')) old_conts = db.get_contact_list() contact = random.choice(old_conts) app.contact.edit_contact_by_id(contact.id) new_conts = db.get_contact_list() assert len(o...
16,596
[ -0.0020002115052193403, -0.03093281015753746, 0.06482678651809692, -0.04088688641786575, -0.07020244747400284, -0.0050225951708853245, 0.021445684134960175, -0.0327095091342926, -0.032003384083509445, 0.01625225320458412, -0.018063120543956757, -0.02810831181704998, 0.013473311439156532, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "release_group", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly...
def get_short_group_name(release_group): short_group_list = [] try: group = app.ADBA_CONNECTION.group(gname=release_group) except AniDBCommandTimeoutError: log.debug('Timeout while loading group from AniDB. Trying next group') except Exception: log.debug('Failed while loading gr...
16,597
[ 0.03978027030825615, 0.0739412009716034, 0.030180558562278748, -0.05839434638619423, 0.010343104600906372, 0.022500788792967796, 0.008282678201794624, -0.04799856245517731, -0.024069523438811302, 0.024163179099559784, 0.020709622651338577, -0.005993966478854418, -0.02069791592657566, 0.024...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": ...
def blame(path, filename, rev=None): annotresult = {} path = core.svn_path_canonicalize(path) repos_ptr = repos.open(path) fsob = repos.fs(repos_ptr) if rev is None: rev = fs.youngest_rev(fsob) filedata = '' for i in range(0, rev+1): root = fs.revision_root(fsob, i) if fs.check_path(root, f...
16,598
[ 0.02226080745458603, 0.04573911055922508, 0.012652273289859295, -0.05415090173482895, -0.04075844585895538, 0.0025370263028889894, -0.01426407229155302, 0.01501117181032896, 0.025442898273468018, 0.018511472269892693, 0.050332389771938324, -0.024668129161000252, -0.0038185101002454758, 0.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 main(): opts, args = getopt.getopt(sys.argv[1:], 'r:') if len(args) != 2: usage() rev = None for name, value in opts: if name == '-r': rev = int(value) blame(args[0], args[1], rev)
16,599
[ 0.019687818363308907, -0.017244955524802208, 0.03974827751517296, -0.016220195218920708, 0.0032088453881442547, -0.021054165437817574, -0.04268799349665642, 0.018507791683077812, -0.009523024782538414, 0.00387390423566103, 0.007934128865599632, -0.037822969257831573, 0.0006220372742973268, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def extract_range_numbers(data): ret = [] arr = re.split("bis", data) s = extract_number(arr[0]) e = extract_number(arr[1]) for i in range(int(s[-4:]), int(e[-4:])+1): a = s[:-4]+"%04d" % i ret.append(a) return ret
16,600
[ 0.008073071949183941, 0.010959471575915813, 0.00984251219779253, -0.03852956369519234, 0.025922302156686783, 0.0070445844903588295, -0.038308385759592056, 0.021830471232533455, 0.02497122623026371, 0.021045280620455742, 0.011042414233088493, -0.026563722640275955, -0.01852382905781269, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def extract_slashed_numbers(data): ret = [] arr = data.split("/") a0 = extract_number(arr[0]) if (a0 != ""): ret.append(a0) base = a0[0:-2] for ax in arr[1:]: ax = extract_number(ax) if (ax != ""): ax = extract_number(base + ax) ret.append(ax) return ret