code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
#!/usr/bin/env python '''Test that the code snippets mentioned in issue 471 (and related issues 241 and 429) don't have exceptions. (Most of them delete all text in a formatted document with some styles set; one of them (like the test in EMPTY_BOLD.py) sets style on a 0-length range of text in an empty document.) '''...
ajibawa-2023/Python-Code-Large/train/row_91305
41
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91305:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0968, 0.1129, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91305:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91305:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91305:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91305:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Test an unformatted document is editable. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. Press ESC to exit the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: STYLE.py 1754 2008-02-10 13:26:52Z Alex.Holk...
ajibawa-2023/Python-Code-Large/train/row_91306
47
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91306:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.0833, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91306:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91306:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91306:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91306:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test that inline elements are positioned correctly and are repositioned within an incremental layout. Examine and type over the text in the window that appears. There are several elements drawn with grey boxes. These should maintain their sizes and relative document positions as the text is...
ajibawa-2023/Python-Code-Large/train/row_91307
52
149
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91307:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.047, 0.0604, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91307:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91307:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91307:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91307:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Cod...
#!/usr/bin/env python '''Test content_valign = 'center' property of IncrementalTextLayout. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. When the content height is less than the window height, the content should be aligned to the center of the w...
ajibawa-2023/Python-Code-Large/train/row_91308
48
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91308:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0805, 0.1034, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91308:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91308:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91308:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91308:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test content_valign = 'bottom' property of IncrementalTextLayout. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. When the content height is less than the window height, the content should be aligned to the bottom of the w...
ajibawa-2023/Python-Code-Large/train/row_91309
48
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91309:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0805, 0.1034, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91309:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91309:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91309:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91309:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test that a scheduled function gets called every interval with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE_IN...
ajibawa-2023/Python-Code-Large/train/row_91310
34
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91310:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0741, 0.0556, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91310:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91310:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91310:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91310:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python '''Test that the clock effectively limits the FPS to 20 Hz when requested. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class FPS_LIMIT(unittest.TestCase): def test_fps_limit(self): clock....
ajibawa-2023/Python-Code-Large/train/row_91311
20
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91311:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1167, 0.0667, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91311:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91311:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91311:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91311:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test that a scheduled function gets called every tick with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE(unitte...
ajibawa-2023/Python-Code-Large/train/row_91312
56
80
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91312:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.0375, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91312:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91312:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91312:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91312:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python # Contributed by Claudio Canepa # Integrated by Ben Smith """ There is the possibility that time.clock be non monotonic in multicore hardware, due to the underlaying use of win32 QueryPerformanceCounter. If your update is seeing a negative dt, then time.clock is probably the culprit. AM...
ajibawa-2023/Python-Code-Large/train/row_91313
19
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91313:Expr_L6_C0", "label": "expression", "type": "expression", "loc": [6, 9], "level": 0, "parent": null, "vector": [8, 0, 0.2143, 0.1143, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91313:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91313:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91313:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91313:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Test that the clock returns a reasonable average FPS calculation when stimulated at 5 Hz. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class FPS(unittest.TestCase): def test_fps(self): ...
ajibawa-2023/Python-Code-Large/train/row_91314
18
28
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91314:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.1071, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91314:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91314:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91314:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91314:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test that the clock tick function returns the elaspsed time between frames, in seconds. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class TICK(unittest.TestCase): def test_tick(self): ...
ajibawa-2023/Python-Code-Large/train/row_91315
20
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91315:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1333, 0.1, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91315:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91315:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91315:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91315:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Test that a scheduled function gets called every once with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE_ONCE(u...
ajibawa-2023/Python-Code-Large/train/row_91316
34
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91316:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0741, 0.0556, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91316:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91316:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91316:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91316:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions /...
ajibawa-2023/Python-Code-Large/train/row_91317
53
79
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91317:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0443, 0.0253, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91317:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91317:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91317:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91317:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions /...
ajibawa-2023/Python-Code-Large/train/row_91319
52
78
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91319:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0449, 0.0256, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91319:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91319:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91319:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91319:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' from operator import add import random from pyglet.gl import * n_vertices = 42 v3f_data = [v/float(n_vertices*3 + 10) for v in range(n_vertices * 3)] v2f_data = reduce(add, zip(v3f_data[::3], v3f_data[1::3])) c4f_data = [v/floa...
ajibawa-2023/Python-Code-Large/train/row_91320
49
65
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91320:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0538, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91320:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91320:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91320:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91320:For_L29_C4"}, {"f": "ajibawa-2023/Python-Code-...
#!/usr/bin/python # $Id:$ import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions / 4: self.fail('Incorrect number of vertices in feedb...
ajibawa-2023/Python-Code-Large/train/row_91321
50
73
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91321:Import_L4_C0", "label": "unittest import unittest", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0137, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91321:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91321:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91321:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91321:If_L14_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/python # $Id:$ import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions / 4: self.fail('Incorrect number of vertices in feedb...
ajibawa-2023/Python-Code-Large/train/row_91322
49
72
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91322:Import_L4_C0", "label": "unittest import unittest", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0139, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91322:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91322:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91322:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91322:If_L14_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python '''Draws a full-window quad with two texture units enabled and multi texcoords. Texture unit 0 is a checker pattern of yellow and cyan with env mode replace. Texture unit 1 is a checker pattern of cyan and yellow, with env mode modulate. The result should be flat green (with some variation in ...
ajibawa-2023/Python-Code-Large/train/row_91323
46
76
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91323:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0987, 0.1316, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91323:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91323:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91323:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91323:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/python # $Id:$ '''OpenGL viewports and projections. This is a simplified interface for setting up projections, and viewports within projections. A `Viewport` is a rectangular area in space that can be rendered into. Most viewports, with the exception of the top-level viewport, belong to an owning project...
ajibawa-2023/Python-Code-Large/train/row_91324
72
157
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91324:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 58], "level": 0, "parent": null, "vector": [8, 0, 0.1975, 0.3503, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91324:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91324:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91324:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91324:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Cod...
#!/usr/bin/python # $Id:$ from pyglet.gl import * def fillrect(x, y, width, height): glBegin(GL_QUADS) glVertex2f(x, y) glVertex2f(x + width, y) glVertex2f(x + width, y + height) glVertex2f(x, y + height) glEnd() def rect(x, y, width, height): glBegin(GL_LINE_LOOP) glVertex2f(x, y) ...
ajibawa-2023/Python-Code-Large/train/row_91325
15
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91325:ImportFrom_L4_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.05, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91325:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91325:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91325:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91325:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $' import unittest from pyglet.gl import * from pyglet.ext import projection from pyglet import window import base_projection class VIEWPORT_CLIP(unittest.TestCase): def tes...
ajibawa-2023/Python-Code-Large/train/row_91326
27
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91326:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0463, 0.037, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91326:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91326:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91326:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91326:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $' import unittest from pyglet.gl import * from pyglet.ext import projection from pyglet import window import base_projection class VIEWPORT_ORTHO(unittest.TestCase): def te...
ajibawa-2023/Python-Code-Large/train/row_91327
27
52
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91327:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0481, 0.0385, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91327:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91327:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91327:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91327:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python ''' Model code for managing sprites =============================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from scene2d.drawable import * class SpriteLayer(object): '''Represents a group of sprites at the same z depth. ''' def __init__...
ajibawa-2023/Python-Code-Large/train/row_91328
196
303
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91328:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0165, 0.0165, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91328:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91328:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91328:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91328:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from ctypes import * from pyglet.gl import * from scene2d.sprite import Sprite from pyglet.font import GlyphString # TODO: inherit from Sprite class TextSprite(object): _layout_width = None # Width to layout text to _tex...
ajibawa-2023/Python-Code-Large/train/row_91329
83
144
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91329:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0243, 0.0139, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91329:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91329:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91329:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91329:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python ''' Simple images etc. to aid debugging =================================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import math from scene2d import * from pyglet import image from scene2d.drawable import * from pyglet.gl import * def brensenham_line(x, y, x2, y2): '''...
ajibawa-2023/Python-Code-Large/train/row_91330
82
111
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91330:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 7], "level": 0, "parent": null, "vector": [8, 0, 0.045, 0.045, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91330:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91330:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91330:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91330:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code...
from pyglet.gl import * class DrawEnv(object): '''Sets up drawing environment. My have either or both of a "before" and "after" method. ''' pass class DrawBlended(DrawEnv): '''Sets up texture env for an alpha-blended draw. ''' def before(self): glPushAttrib(GL_ENABLE_BIT | GL_CO...
ajibawa-2023/Python-Code-Large/train/row_91331
153
229
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91331:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0044, 0.0044, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91331:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91331:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91331:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91331:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python ''' Management of tile sets ======================= ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import xml.dom import xml.dom.minidom from scene2d.image import Image2d, Drawable from resource import Resource, register_factory from scene2d.drawable import * @registe...
ajibawa-2023/Python-Code-Large/train/row_91332
64
105
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91332:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91332:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91332:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91332:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91332:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Co...
""" """ from scene2d.map import RectMap, HexMap, RectCell, HexCell from scene2d.camera import FlatCamera from scene2d.view import FlatView, ViewScrollHandler from scene2d.sprite import Sprite, RotatableSprite, SpriteLayer from scene2d.image import Image2d from scene2d.tile import TileSet, Tile __all__ = [ 'RectMap', ...
ajibawa-2023/Python-Code-Large/train/row_91335
8
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91335:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.1071, 0.1429, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
#!/usr/bin/env python ''' Camera for projecting 2d flat scenes ==================================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.event import * class Camera(object): def project(self): '''Set up the GL projection matrix. Leave us in GL_...
ajibawa-2023/Python-Code-Large/train/row_91337
26
46
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91337:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1087, 0.1087, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91337:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91337:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91337:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91337:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python ''' Support for loading XML resource files ====================================== This module provides the Resource class which loads XML resource files which may contain scene2d image files, atlases, tile sets and maps. --------------- Getting Started --------------- Assuming the following XM...
ajibawa-2023/Python-Code-Large/train/row_91338
88
237
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91338:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 100], "level": 0, "parent": null, "vector": [8, 0, 0.2173, 0.4135, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91338:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91338:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91338:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91338:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python...
#!/usr/bin/env python '''Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygl...
ajibawa-2023/Python-Code-Large/train/row_91339
55
73
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91339:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0959, 0.0959, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91339:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91339:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91339:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91339:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing hex map debug rendering. You should see a checkered hex map. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import RenderBase import scene2d from scene2d.debug import gen_hex_map cla...
ajibawa-2023/Python-Code-Large/train/row_91340
15
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91340:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 8], "level": 0, "parent": null, "vector": [8, 0, 0.2115, 0.2308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91340:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91340:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91340:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91340:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Testing loading of a map. You should see a simple map with a circular road on it. The tiles are not well-designed :) Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from render_base import RenderBase...
ajibawa-2023/Python-Code-Large/train/row_91341
16
29
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91341:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.2069, 0.2414, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91341:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91341:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91341:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91341:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing mouse interaction The cell the mouse is hovering over should highlight in red. Clicking in a cell should highliht that cell green. Clicking again will clear the highlighting. Clicking on the ball sprite should highlight it and not underlying cells. You may press the arrow keys to s...
ajibawa-2023/Python-Code-Large/train/row_91342
36
69
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91342:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 16], "level": 0, "parent": null, "vector": [8, 0, 0.1377, 0.2029, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91342:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91342:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91342:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91342:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Testing flat map allow_oob enforcement. Press arrow keys to move view focal point (little ball) around map. Press "o" to turn allow_oob on and off. You should see no black border with allow_oob=False. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtex...
ajibawa-2023/Python-Code-Large/train/row_91343
23
39
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91343:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.1795, 0.2308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91343:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91343:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91343:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91343:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Testing rect map debug rendering. You should see a checkered square grid. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import RenderBase import scene2d from scene2d.debug import gen_rect_ma...
ajibawa-2023/Python-Code-Large/train/row_91344
15
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91344:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 8], "level": 0, "parent": null, "vector": [8, 0, 0.2115, 0.2308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91344:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91344:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91344:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91344:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Testing flat map scrolling. Press arrow keys to move view focal point (little ball) around map. You will be able to move "off" the map. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import ...
ajibawa-2023/Python-Code-Large/train/row_91345
15
28
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91345:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 10], "level": 0, "parent": null, "vector": [8, 0, 0.2321, 0.2857, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91345:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91345:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91345:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91345:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Base class for rendering tests. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import * import pyglet.window from pyglet.window.event import * from pyglet.window import key from pyglet import clock from scene2d import * from scene2d.draw...
ajibawa-2023/Python-Code-Large/train/row_91346
45
65
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91346:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0538, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91346:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91346:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91346:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91346:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Cod...
#!/usr/bin/env python '''Testing mouse interaction The cell the mouse is hovering over should highlight in red. Clicking in a cell should highliht that cell green. Clicking again will clear the highlighting. Clicking on the ball sprite should highlight it and not underlying cells. You may press the arrow keys to s...
ajibawa-2023/Python-Code-Large/train/row_91347
36
69
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91347:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 16], "level": 0, "parent": null, "vector": [8, 0, 0.1377, 0.2029, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91347:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91347:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91347:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91347:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python '''Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygle...
ajibawa-2023/Python-Code-Large/train/row_91348
44
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91348:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0968, 0.1129, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91348:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91348:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91348:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91348:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing loading of a map. You should see a simple map with a circular road on it. The tiles are not well-designed :) Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from render_base import RenderBase...
ajibawa-2023/Python-Code-Large/train/row_91349
16
29
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91349:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.2069, 0.2414, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91349:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91349:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91349:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91349:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing the map model. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.window import Window from scene2d import RectMap, HexMap, RectCell, HexCell from scene2d.debug import gen_hex_map, gen_rect_map rmd = [...
ajibawa-2023/Python-Code-Large/train/row_91350
57
254
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91350:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0177, 0.0157, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91350:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91350:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91350:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91350:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing the sprite model. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.window import Window from pyglet.image import SolidColorImagePattern from scene2d import Sprite, Image2d class SpriteModelTest(unitt...
ajibawa-2023/Python-Code-Large/train/row_91351
41
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91351:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0474, 0.0421, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91351:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91351:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91351:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91351:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Testing flat map allow_oob enforcement. Press 0-9 to set the size of the view in the window (1=10%, 0=100%) Press arrow keys to move view focal point (little ball) around map. Press "o" to turn allow_oob on and off. You should see no black border with allow_oob=False. Press escape or close...
ajibawa-2023/Python-Code-Large/train/row_91352
32
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91352:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 13], "level": 0, "parent": null, "vector": [8, 0, 0.1569, 0.2157, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91352:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91352:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91352:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91352:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Co...
# Lots Of Sprites ''' Results (us per sprite per frame): sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 28.3 29.3 20.6 22.0 after __slots__ removal sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 ''' import os import sys import random from pyglet ...
ajibawa-2023/Python-Code-Large/train/row_91353
52
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91353:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.1286, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91353:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91353:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91353:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91353:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Cod...
import sys sys.path.insert(0, '/home/richard/src/pyglet.googlecode.com/trunk') import os import math import pyglet.window from resource import * from pyglet.window import key from pyglet import clock from scene2d import * from scene2d.textsprite import * from pyglet import font from layout import * class RocketSpri...
ajibawa-2023/Python-Code-Large/train/row_91354
136
191
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91354:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91354:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91354:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91354:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91354:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.window import Window from pyglet import clock from scene2d.textsprite import * from pyglet import font width, height = 640, 480 window = Window(width=width, height=height) arial = font.load('Arial', 500, bold=True) co...
ajibawa-2023/Python-Code-Large/train/row_91355
26
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91355:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0946, 0.0541, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91355:While_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91355:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91355:While_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91355:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
import os import math import pyglet.window from pyglet.window.event import * from pyglet.window import key from pyglet import clock from euclid import Vector2, Matrix3 from scene2d import * class CarSprite(RotatableSprite): def update(self, dt): # handle input and move the car self.angle += (keybo...
ajibawa-2023/Python-Code-Large/train/row_91356
35
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91356:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91356:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91356:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91356:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91356:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python '''Example of simple text wrapping without using layout. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.window import Window from pyglet.window import key from pyglet import clock from pyglet import font from scene2d.textsprite import * window =...
ajibawa-2023/Python-Code-Large/train/row_91357
32
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91357:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0686, 0.0392, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91357:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91357:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91357:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91357:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Co...
import os import math import pyglet.window from resource import * from pyglet.window import key from pyglet import clock from scene2d import * class PlayerSprite(Sprite): bullets = [] def update(self, dt): self.x += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * 200 * dt if self.left < 0: self.l...
ajibawa-2023/Python-Code-Large/train/row_91358
77
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91358:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91358:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91358:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91358:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91358:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Cod...
class Rect(object): '''Define a rectangular area. Many convenience handles and other properties are also defined - all of which may be assigned to which will result in altering the position and sometimes dimensions of the Rect. The Rect area includes the bottom and left borders but not the top an...
ajibawa-2023/Python-Code-Large/train/row_91359
115
142
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91359:ClassDef_L2_C0", "label": "Rect", "type": "class", "loc": [2, 141], "level": 0, "parent": null, "vector": [3, 0, 0.5035, 0.9859, 0, 0.66, 0.0, 333, 0, 35, 0, 0, 186, 0, 19], "semantic": {"name": "Rect", "arg_names": [], "import_names": [], "rhs_call_name": "", "an...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91359:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91359:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91359:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91359:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
Blocker = object() Start = False End = object() class Path(dict): @classmethod def determine_path(cls, field, width, height): path = cls() path.width = width path.height = height path.ends = set() path.starts = [] cells = [] for y in range(height): ...
ajibawa-2023/Python-Code-Large/train/row_91360
151
201
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91360:Assign_L1_C0", "label": "Blocker = object()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.005, 0.005, 0, 0.66, 0.0, 454, 3, 0, 0, 0, 186, 10, 1], "semantic": {"name": "Blocker", "arg_names": [], "import_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91360:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91360:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91360:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91360:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code...
# desktop tower defense clone import math import random from pyglet import window from pyglet import image from pyglet import resource from pyglet import clock from pyglet.window import mouse import view import tilemap import spryte import path field_cells = ''' +++++++++++EEEEE++++++++++++ +##########.....########...
ajibawa-2023/Python-Code-Large/train/row_91361
251
387
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91361:Import_L2_C0", "label": "math import math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0026, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91361:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91361:Return_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91361:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91361:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-...
# Lots Of Sprites ''' Results for 2000 sprites: platform us per sprite per frame --------------------------------------------------------------------- Intel C2Quad Q6600 (2.4GHz), GeForce 7800 18.2478245656 Intel C2Duo T7500 (2.2GHz), GeForce 8400M GS 19.115903827 AMD 64 3500...
ajibawa-2023/Python-Code-Large/train/row_91362
54
81
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91362:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0926, 0.1235, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91362:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91362:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91362:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91362:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-...
import sys import random import math from pyglet import window from pyglet import clock from pyglet import resource import spryte NUM_CARS = 100 if len(sys.argv) > 1: NUM_CARS = int(sys.argv[1]) win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) cars = spryte.SpriteBatch() car = reso...
ajibawa-2023/Python-Code-Large/train/row_91363
27
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91363:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91363:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91363:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91363:For_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91363:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
import random import math from pyglet import window from pyglet import image from pyglet import clock from pyglet import gl from pyglet import resource from pyglet.window import key import spryte win = window.Window(width=640, height=400,vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) balls = spryte.Sprit...
ajibawa-2023/Python-Code-Large/train/row_91364
66
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91364:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.01, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91364:For_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91364:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91364:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91364:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import operator from pyglet import gl, event import spryte import tilemap class View(object): '''Render a flat view of a scene2d.Scene. Attributes: scene -- a scene2d.Scene instance allow_oob -- indicates whether the viewport will allow viewing of ...
ajibawa-2023/Python-Code-Large/train/row_91365
131
208
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91365:Import_L1_C0", "label": "operator import operator", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0048, 0.0048, 0, 0.66, 0.0, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["operato...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91365:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91365:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91365:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91365:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import os import math from pyglet import image, gl, clock, graphics, sprite class SpriteBatchGroup(graphics.Group): def __init__(self, x, y, parent=None): super(SpriteBatchGroup, self).__init__(parent) self.x, self.y = x, y def set(self): if self.x or self.y: gl.glTranslat...
ajibawa-2023/Python-Code-Large/train/row_91366
130
196
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91366:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91366:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91366:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91366:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91366:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from pyglet import image import spryte class Map(spryte.SpriteBatch): '''Rectangular map. "cells" argument must be a row-major list of lists of Sprite instances. ''' def set_cells(self, cell_width, cell_height, cells, origin=None): self.cell_width, self.cell_height = cell_width, cell_height ...
ajibawa-2023/Python-Code-Large/train/row_91367
55
86
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91367:ImportFrom_L1_C0", "label": "from pyglet import image", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "pyglet", "arg_names": [], "import_names": ["image...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91367:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91367:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91367:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91367:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import os import math from pyglet import window from pyglet import resource from pyglet import image from pyglet.window import key from pyglet import clock import spryte import view win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) map = [ [ 0, 1, 1, 1, 2, 3], [ 5, 6, 16, 1...
ajibawa-2023/Python-Code-Large/train/row_91368
43
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91368:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91368:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91368:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91368:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91368:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code...
import sys import random from pyglet import window from pyglet import image from pyglet import clock from pyglet import resource import spryte NUM_BOOMS = 20 if len(sys.argv) > 1: NUM_BOOMS = int(sys.argv[1]) win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) explosions = spryte.Spri...
ajibawa-2023/Python-Code-Large/train/row_91369
34
48
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91369:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91369:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91369:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91369:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91369:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
''' Code by Richard Jones, released into the public domain. Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game) ''' import sys import math import euclid import primitives import pyglet from pyglet.window import key from pyglet.gl import * window = pyglet.window.Window(fullscreen='-fs' in ...
ajibawa-2023/Python-Code-Large/train/row_91370
87
168
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91370:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0179, 0.0298, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91370:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91370:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91370:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91370:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-...
import math import pyglet from pyglet.gl import * class SmoothLineGroup(pyglet.graphics.Group): def set_state(self): glPushAttrib(GL_ENABLE_BIT) glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glEnable(GL_LINE_SMOOTH) glLineWidth(2) def unset_state...
ajibawa-2023/Python-Code-Large/train/row_91372
30
40
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91372:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91372:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91372:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91372:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91372:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L...
''' Code by Richard Jones, released into the public domain. Inspired by http://screamyguy.net/lines/index.htm This code uses a single drawing buffer so that successive drawing passes may be used to create the line fading effect. The fading is achieved by drawing a translucent black quad over the entire scene before d...
ajibawa-2023/Python-Code-Large/train/row_91373
51
101
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91373:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0693, 0.1287, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91373:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91373:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91373:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91373:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: obj_test.py 111 2006-10-20 06:39:12Z r1chardj0n3s $' import sys import os import ctypes import pyglet from pyglet.gl import * from model import obj, geometric w = pyglet.window.Window() fourfv = ctypes.c_float * 4 glLightfv(GL_LI...
ajibawa-2023/Python-Code-Large/train/row_91374
41
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91374:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0593, 0.0339, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91374:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91374:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91374:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91374:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-L...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: gl_tree_test.py 114 2006-10-22 09:46:11Z r1chardj0n3s $' import math import random from pyglet.window import * from pyglet.window import mouse from pyglet import clock from ctypes import * from pyglet.window.event import * from pygl...
ajibawa-2023/Python-Code-Large/train/row_91375
65
90
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91375:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0389, 0.0222, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91375:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91375:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91375:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91375:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import os import warnings from pyglet.gl import * from pyglet import image class Material(object): diffuse = [.8, .8, .8] ambient = [.2, .2, .2] specular = [0., 0., 0.] emission = [0., 0., 0.] shininess = 0. opacity = 1. texture = None def __init__(self, name): self.name = nam...
ajibawa-2023/Python-Code-Large/train/row_91376
156
210
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91376:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0048, 0.0048, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91376:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91376:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91376:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91376:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import math import random from pyglet.gl import * import euclid M_2PI = math.pi * 2.0 class DisplayList(int): def draw(self): glCallList(self) def _TRI((v1, n1, t1, b1), (v2, n2, t2, b2), (v3, n3, t3, b3)): glNormal3f(n1[0], n1[1], n1[2]); glVertex3f(v1[0], v1[1], v1[2]) glNormal3f(n2[0], n2[1],...
ajibawa-2023/Python-Code-Large/train/row_91377
148
151
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91377:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91377:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91377:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91377:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91377:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: //depot/task/DEV-99/client/tests.py#13 $' import sys sys.path.insert(0, '../../') sys.path.insert(0, '../layout/') from pyglet.window import * from pyglet import clock from pyglet.gl import * from pyglet import media import layout...
ajibawa-2023/Python-Code-Large/train/row_91378
178
245
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91378:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0143, 0.0082, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91378:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91378:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91378:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91378:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91378...
import os from pyglet import image _data = {} filename = os.path.join dirname = os.path.dirname(__file__) def load_gui_image(filename): if not os.path.isabs(filename): filename = os.path.join(dirname, 'data', filename) return load_image(filename) def load_image(*filename): filename = os.path.jo...
ajibawa-2023/Python-Code-Large/train/row_91379
14
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91379:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91379:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91379:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91379:If_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91379:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
'''Clipboard implementation for OS X using Win32 Based on implementation from: http://aspn.activestate.com/ASPN/Mail/Message/ctypes-users/1771866 ''' from ctypes import * from pyglet.window.win32.constants import CF_TEXT, GHND OpenClipboard = windll.user32.OpenClipboard EmptyClipboard = windll.user32.EmptyClipboard ...
ajibawa-2023/Python-Code-Large/train/row_91380
27
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91380:ImportFrom_L1_C0", "label": "from ctypes import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["*"], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91380:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91380:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91380:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91380:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
'''Clipboard implementation for X11 using xlib. ''' from ctypes import * from pyglet import window from pyglet.window.xlib import xlib XA_PRIMARY = xlib.Atom(1) XA_STRING = xlib.Atom(31) CurrentTime = 0 AnyPropertyType = 0 class XlibClipboard(object): def get_text(self): display = window.get_platform().g...
ajibawa-2023/Python-Code-Large/train/row_91381
35
55
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91381:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0273, 0.0364, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91381:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91381:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91381:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91381:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-...
'''Interaction with the Operating System text clipboard ''' import sys def get_text(): '''Get a string from the clipboard. ''' return _clipboard.get_text() def put_text(text): '''Put the string onto the clipboard. ''' return _clipboard.put_text(text) # Try to determine which platform to use....
ajibawa-2023/Python-Code-Large/train/row_91383
16
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91383:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0577, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91383:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91383:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91383:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91383:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import sys import xml.sax.saxutils from pyglet.gl import * from pyglet.window import mouse, key from wydget import event, layouts, loadxml from wydget.widgets.frame import Frame from wydget.widgets.label import Label class MenuItem(Label): name = 'menu-item' @event.default('menu-item') def on_element_enter(item...
ajibawa-2023/Python-Code-Large/train/row_91384
64
99
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91384:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0101, 0.0101, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91384:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91384:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91384:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91384:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-...
from wydget import anim from wydget.widgets.frame import Frame class Drawer(Frame): '''A *transparent container* that may hide and expose its contents. ''' name='drawer' HIDDEN='hidden' EXPOSED='exposed' LEFT='left' RIGHT='right' TOP='top' BOTTOM='bottom' def __init__(self, pa...
ajibawa-2023/Python-Code-Large/train/row_91386
146
169
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91386:ImportFrom_L1_C0", "label": "from wydget import anim", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0059, 0.0059, 0, 0.66, 0.0, 601, 0, 1, 0, 0, 601, 0, 0], "semantic": {"name": "wydget", "arg_names": [], "import_names": ["anim"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91386:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91386:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91386:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91386:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from pyglet.gl import * from pyglet import clock from pyglet.window import mouse from wydget import element, event, data, util, anim from wydget.widgets.button import Button, RepeaterButton from wydget.widgets.label import Label from wydget.widgets.frame import Frame class SliderCommon(Frame): slider_size = 16 ...
ajibawa-2023/Python-Code-Large/train/row_91387
250
358
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91387:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91387:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91387:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91387:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91387:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Cod...
from pyglet.gl import * from pyglet.window import mouse from pyglet import media, clock from wydget import element, event, util, data, layouts, anim from wydget.widgets.frame import Frame from wydget.widgets.label import Image, Label from wydget.widgets.button import Button class Movie(Frame): name='movie' de...
ajibawa-2023/Python-Code-Large/train/row_91389
146
195
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91389:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91389:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91389:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91389:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91389:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Cod...
from pyglet.gl import * from pyglet import clock from pyglet.window import key, mouse from wydget import element, event, util, anim, data class Checkbox(element.Element): name='checkbox' is_focusable = True def __init__(self, parent, value=False, width=16, height=16, **kw): self.parent = parent ...
ajibawa-2023/Python-Code-Large/train/row_91391
37
50
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91391:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91391:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91391:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91391:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91391:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from wydget.widgets.button import Button, TextButton, RepeaterButton from wydget.widgets.frame import Frame, TabbedFrame from wydget.widgets.drawer import Drawer from wydget.widgets.label import Image, Label, XHTML from wydget.widgets.menu import MenuItem, PopupMenu from wydget.widgets.movie import Movie from wydget.wi...
ajibawa-2023/Python-Code-Large/train/row_91392
18
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91392:ImportFrom_L1_C0", "label": "from wydget.widgets.button import Button, TextButton, RepeaterButton", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 570, 0, 3, 0, 0, 570, 0, 0], "semantic": {"name": "wydge...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91392:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91392:Assign_L33_C4"}]
import sys import string from pyglet.gl import * from pyglet.window import key, mouse from wydget import event, anim, util, element from wydget.widgets.frame import Frame from wydget.widgets.label import Label from wydget import clipboard # for detecting words later letters = set(string.letters) class Cursor(elemen...
ajibawa-2023/Python-Code-Large/train/row_91393
372
501
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91393:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.002, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91393:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91393:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91393:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91393:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod...
import os from pyglet.gl import * from pyglet.window import mouse from pyglet import media, clock from wydget import element, event, util, data, layouts from wydget.widgets.frame import Frame from wydget.widgets.label import Image, Label from wydget.widgets.button import Button class Music(Frame): name='music' ...
ajibawa-2023/Python-Code-Large/train/row_91395
106
151
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91395:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91395:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91395:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91395:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91395:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Cod...
from pyglet.gl import * from wydget import loadxml from wydget import util from wydget.widgets.label import Label class Progress(Label): name = 'progress' def __init__(self, parent, value=0.0, show_value=True, bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white', width=None, height...
ajibawa-2023/Python-Code-Large/train/row_91397
31
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91397:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91397:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91397:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91397:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91397:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from pyglet.window import mouse import event def DragHandler(rule, buttons=mouse.LEFT): class _DragHandler(object): original_position = None mouse_buttons = buttons @event.select(rule) def on_drag(self, widget, x, y, dx, dy, buttons, modifiers): if not buttons & self....
ajibawa-2023/Python-Code-Large/train/row_91399
22
32
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91399:ImportFrom_L2_C0", "label": "from pyglet.window import mouse", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0312, 0, 0.66, 0.0, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "pyglet.window", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91399:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91399:ClassDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91399:ClassDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91399:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-La...
import math class RestartLayout(Exception): '''During layout an element has mutated the scene (eg. through adding scrollbars) and thus layout must be restarted). ''' def parse_value(value, base_value=0): '''Parse a numeric value spec which is one of: NNN integer NN.MMM float ...
ajibawa-2023/Python-Code-Large/train/row_91400
247
394
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91400:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0025, 0.0025, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91400:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91400:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91400:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91400:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
import os, sys from wydget import event, widgets, layouts from wydget.dialogs import base if sys.platform == 'darwin': default_dir = os.path.expanduser('~/Desktop') elif sys.platform in ('win32', 'cygwin'): default_dir = 'c:/' else: default_dir = os.path.expanduser('~/Desktop') class FileOpen(base.Dialog...
ajibawa-2023/Python-Code-Large/train/row_91401
97
136
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91401:Import_L1_C0", "label": "os import os, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91401:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91401:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91401:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91401:If_L8_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91401:I...
from wydget import event from wydget import widgets from wydget import layouts from wydget.dialogs import base class Question(base.Dialog): id = '-question-dialog' name = 'question-dialog' classes = ('dialog', ) def __init__(self, parent, text, callback=None, cancel=True, font_size=None, p...
ajibawa-2023/Python-Code-Large/train/row_91402
40
60
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91402:ImportFrom_L1_C0", "label": "from wydget import event", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0167, 0, 0.66, 0.0, 601, 0, 1, 0, 0, 601, 0, 0], "semantic": {"name": "wydget", "arg_names": [], "import_names": ["event...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91402:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91402:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91402:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91402:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from wydget import widgets, event class Dialog(widgets.Frame): def __init__(self, parent, x=0, y=0, z=0, width=None, height=None, classes=(), border='black', bgcolor='white', padding=2, **kw): if 'dialog' not in classes: classes = ('dialog', ) + classes super(Dialog, self)....
ajibawa-2023/Python-Code-Large/train/row_91403
22
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91403:ImportFrom_L2_C0", "label": "from wydget import widgets, event", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0294, 0, 0.66, 0.0, 601, 0, 2, 0, 0, 601, 0, 0], "semantic": {"name": "wydget", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91403:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91403:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91403:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91403:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
from wydget.dialogs.question import Question, Message from wydget.dialogs.file import FileOpen
ajibawa-2023/Python-Code-Large/train/row_91404
2
3
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91404:ImportFrom_L2_C0", "label": "from wydget.dialogs.question import Question, Message", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.3333, 0, 0.66, 0.0, 703, 0, 2, 0, 0, 703, 0, 0], "semantic": {"name": "wydget.dialogs.quest...
[]
import operator import math from wydget import util from wydget.widgets.label import Label TOP = 'top' BOTTOM = 'bottom' LEFT = 'left' RIGHT = 'right' CENTER = 'center' FILL = 'fill' intceil = lambda i: int(math.ceil(i)) class Layout(object): '''Absolute positioning layout -- also base class for other layouts. ...
ajibawa-2023/Python-Code-Large/train/row_91405
310
458
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91405:Import_L1_C0", "label": "operator import operator", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0022, 0.0022, 0, 0.66, 0.0, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["operato...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91405:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91405:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91405:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91405:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-...
'''Define the core `Element` class from which all gui widgets are derived. All gui elements have: - the parent widget - an id, element name and list of classes - a list of children widgets - a position in 3D space, relative to their parent's position - dimensions available as width, height, rect and inner_rect - scal...
ajibawa-2023/Python-Code-Large/train/row_91406
310
572
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91406:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 58], "level": 0, "parent": null, "vector": [8, 0, 0.0516, 0.1014, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91406:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91406:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91406:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91406:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import math from pyglet import clock linear = lambda t: t cosine90 = lambda t: 1-math.cos(t * math.pi/2) cosine180 = lambda t: 1-abs(math.cos(t * math.pi)) exponential = lambda t: (math.exp(t)-1) / (math.exp(1)-1) half_parabola = lambda t: (1000*t)**2 / 1000**2 inverted_half_parabola = lambda t: 1-((1000*t)**2 / 1000...
ajibawa-2023/Python-Code-Large/train/row_91407
112
180
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91407:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0056, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91407:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91407:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91407:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91407:Return_L18_C4"}, {"f": "ajibawa-2023/Python-Code...
from pyglet.gl import * from pyglet import font from layout import * import util class Style(object): font_name = '' font_size = 14 def getFont(self, name=None, size=None): if name is None: name = self.font_name if size is None: size = self.font_size return font.load(name, size)...
ajibawa-2023/Python-Code-Large/train/row_91410
105
145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91410:ImportFrom_L2_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0138, 0.0069, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "pyglet.gl", "arg_names": [], "import_names": ["*"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91410:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91410:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91410:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91410:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
'''Usage: %s <arguments> -h h draw hexes with given height in a rectangular grid -x h draw hexes with given height in a hex grid -r w[,h] draw a rect grid -s w,h map size in cells (default=5,5) -f render flat (default) -o render orthographic projection -...
ajibawa-2023/Python-Code-Large/train/row_91411
18
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91411:Import_L1_C0", "label": "sys import sys, getopt, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "get...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91411:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91411:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91411:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_91411:If_L13_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import shutil import sys import time from xml.dom.minidom import parse try: from xml.etree import ElementTree except ImportError: from elementtree import ElementTree def get_elem_by_id(doc, name, id): for el...
ajibawa-2023/Python-Code-Large/train/row_91412
102
145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91412:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0241, 0.0138, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91412:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91412:ImportFrom_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91412:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91412:ImportFrom_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python '''Generate PDF documentation Requires docutils, docbook XSL stylesheets, xsltproc and Apache FOP (with Batik). ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import shutil import subprocess from xml.dom.minidom import parse from docutils.core import publish_doctree, pu...
ajibawa-2023/Python-Code-Large/train/row_91413
105
188
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91413:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0266, 0.0266, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91413:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91413:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91413:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91413:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code...
# epydoc -- Backwards compatibility # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <[email protected]> # URL: <http://epydoc.sf.net> # # $Id: util.py 956 2006-03-10 01:30:51Z edloper $ """ Backwards compatibility with previous versions of Python. This module provides backwards compatibility by defining se...
ajibawa-2023/Python-Code-Large/train/row_91414
28
250
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91414:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 19], "level": 0, "parent": null, "vector": [8, 0, 0.056, 0.044, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91414:Try_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91414:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91414:Try_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91414:Try_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91...
# # objdoc: epydoc documentation completeness checker # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: checker.py 1366 2006-09-07 15:54:59Z edloper $ # """ Documentation completeness checker. This module defines a single class, C{DocChecker}, which can be used to check the that specified classes of objects are d...
ajibawa-2023/Python-Code-Large/train/row_91415
133
349
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91415:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0315, 0.0143, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91415:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91415:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91415:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91415:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# # epydoc.py: epydoc LaTeX output generator # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: latex.py 1479 2007-02-13 22:01:15Z edloper $ # """ The LaTeX output generator for epydoc. The main interface provided by this module is the L{LatexWriter} class. @todo: Inheritance=listed """ __docformat__ = 'epytext e...
ajibawa-2023/Python-Code-Large/train/row_91419
560
1,006
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91419:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0114, 0.006, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91419:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91419:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91419:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91419:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# # epydoc.css: default epydoc CSS stylesheets # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html_css.py 1517 2007-02-16 06:13:56Z edloper $ # """ Predefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}). @type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)} @var STYLESHEE...
ajibawa-2023/Python-Code-Large/train/row_91422
26
540
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91422:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 24], "level": 0, "parent": null, "vector": [8, 0, 0.0306, 0.0296, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_91422:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91422:Assign_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91422:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91422:For_L369_C4"}, {"f": "ajibawa-2023/Python-C...
# # epydoc.css: default help page # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html_help.py 1239 2006-07-05 11:29:50Z edloper $ # """ Default help file for the HTML outputter (L{epydoc.docwriter.html}). @type HTML_HELP: C{string} @var HTML_HELP: The contents of the HTML body for the default help page. """ __...
ajibawa-2023/Python-Code-Large/train/row_91424
3
190
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_91424:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0632, 0.0368, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]