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
""" Tutorial - Sessions Storing session data in CherryPy applications is very easy: cherrypy provides a dictionary called "session" that represents the session data for the current user. If you use RAM based sessions, you can store any kind of object into that dictionary; otherwise, you are limited to objects that can...
ajibawa-2023/Python-Code-Large/train/row_4252
14
44
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_4252:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1136, 0.2045, 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_4252:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4252:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4252:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4252:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-La...
# This is used in test_config to test unrepr of "from A import B" thing2 = object()
ajibawa-2023/Python-Code-Large/train/row_4253
1
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_4253:Assign_L3_C0", "label": "thing2 = object()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.3333, 0, 0.66, 0.0, 699, 3, 0, 0, 0, 186, 10, 1], "semantic": {"name": "thing2", "arg_names": [], "import_names": [], "rhs_...
[]
""" Tutorial - Object inheritance You are free to derive your request handler classes from any base class you wish. In most real-world applications, you will probably want to create a central base class used for all your pages, which takes care of things like printing a common page header and footer. """ import cherr...
ajibawa-2023/Python-Code-Large/train/row_4254
25
83
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_4254:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0964, 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_4254:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4254:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4254:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4254:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
###**********************************************### ### Unique Keychain Python Code ### ### ECE 387, Miami University, Spring 2013 ### ### Created By: Andrew Heldt, Lee Mondini and ### ### Shiloh Womack ### ###********************************************...
ajibawa-2023/Python-Code-Large/train/row_4255
20
42
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_4255:Import_L7_C0", "label": "serial import serial, sys, feedparser\u2026", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0238, 0, 0.66, 0.0, 601, 0, 6, 0, 0, 601, 0, 0], "semantic": {"name": "serial", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4255:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4255:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4255:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4255:Expr_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_425...
#!/usr/bin/python import pyglet from anim3d import * #3d projection setup func def setup_gl(dims): global angle glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() gluPerspective(40, float(dims[0])/dims[1], 0.1, 100) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity() ...
ajibawa-2023/Python-Code-Large/train/row_4256
44
66
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_4256:Import_L2_C0", "label": "pyglet import pyglet", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0152, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "pyglet", "arg_names": [], "import_names": ["pyglet"], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4256:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4256:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4256:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4256:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
#!/usr/bin/python import pyglet from anim3d import * #3d projection setup func def setup_gl(dims): global angle glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() gluPerspective(40, float(dims[0])/dims[1], 0.1, 100) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity() ...
ajibawa-2023/Python-Code-Large/train/row_4257
44
66
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_4257:Import_L2_C0", "label": "pyglet import pyglet", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0152, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "pyglet", "arg_names": [], "import_names": ["pyglet"], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4257:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4257:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4257:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4257:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from pyglet.gl import * import math class Face: def __init__(self, ind, uv): self.indices = ind self.uv = uv class KeyFrame: def __init__(self, fp, nv): self.verts = [] self.frame_num = int(fp.readline()) for i in xrange(nv): (v1, v2, v3) = fp.readline().sp...
ajibawa-2023/Python-Code-Large/train/row_4258
86
113
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_4258:ImportFrom_L1_C0", "label": "from pyglet.gl import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 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_4258:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4258:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4258:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4258:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!BPY """ Name: '3Danim (.txt)' Blender: 243 Group: 'Export' Tooltip: 'export an animated text format.' """ __author__ = 'V Vamsi Krishna' __version__ = '0.1' __url__ = ["3danim project, http://code.google.com/p/3danim", "", "blender", "blenderartists.org"] __email__ = ["V.Vamsi Krishna, vamsikrishna.v:gmail*com...
ajibawa-2023/Python-Code-Large/train/row_4259
62
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_4259:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0579, 0.0632, 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_4259:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4259:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4259:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4259:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
bl_info = { "name": "Export 3DAnim Format(.txt)", "author": "V.Vamsi Krishna(vkrishna)", "version": (1, 0), "blender": (2, 64, 0), "api": 40000, "location": "File > Export > 3DAnim (.txt)", "description": "Export 3dAnim (.txt)", "warning": "", "category": "Import-Export"} ...
ajibawa-2023/Python-Code-Large/train/row_4260
75
108
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_4260:Assign_L1_C0", "label": "bl_info =", "type": "assigned_variable", "loc": [1, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0509, 0.0926, 0, 0.66, 0.0, 767, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "bl_info", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4260:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4260:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4260:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4260:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from os import path from Cheetah.Template import Template def main(): file = path.join(path.split(__file__)[0], 'home.html') print 'Compile template %s...' % file cc = Template.compile(source=None,...
ajibawa-2023/Python-Code-Large/train/row_4261
17
23
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_4261:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1739, 0.0435, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4261:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4261:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4261:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4261:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import datetime from xml.parsers.expat import ParserCreate codes = { 0 : u'龙卷风', # tornado 1 : u'热带风暴', # tropical storm 2 : u'飓风', # hurricane 3 : u'风暴', # severe thunderstorm...
ajibawa-2023/Python-Code-Large/train/row_4262
133
233
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_4262:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0043, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4262:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4262:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4262:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4262:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################## ## DEPENDENCIES import sys import os import os.path import __builtin__ from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVers...
ajibawa-2023/Python-Code-Large/train/row_4263
82
356
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_4263:Import_L9_C0", "label": "sys import sys", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0253, 0.0028, 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_4263:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4263:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4263:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4263:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-L...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from google.appengine.ext import db class City(db.Model): name = db.StringProperty(required=True) aliases = db.StringListProperty(required=True) code = db.IntegerProperty(required=True) def f...
ajibawa-2023/Python-Code-Large/train/row_4264
163
265
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_4264:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0151, 0.0038, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4264:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4264:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4264:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4264:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import os import cgi import time import logging import simplejson from datetime import date from google.appengine.api import xmpp from google.appengine.ext import webapp from google.appengine.ext.webapp.uti...
ajibawa-2023/Python-Code-Large/train/row_4265
175
228
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_4265:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0175, 0.0044, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4265:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4265:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4265:If_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4265:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
''' Provides an abstract Servlet baseclass for Cheetah's Template class ''' import sys import os.path isWebwareInstalled = False try: try: from ds.appserver.Servlet import Servlet as BaseServlet except: from WebKit.Servlet import Servlet as BaseServlet isWebwareInstalled = True if not...
ajibawa-2023/Python-Code-Large/train/row_4267
53
112
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_4267:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0179, 0.0268, 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_4267:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4267:Try_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4267:Try_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4267:ImportFrom_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
#
ajibawa-2023/Python-Code-Large/train/row_4268
0
1
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"]
[]
[]
"Template support for Cheetah" import sys, os, imp from Cheetah import Compiler import pkg_resources def _recompile_template(package, basename, tfile, classname): tmpl = pkg_resources.resource_string(package, "%s.tmpl" % basename) c = Compiler.Compiler(source=tmpl, mainClassName='GenTemplate') code = str...
ajibawa-2023/Python-Code-Large/train/row_4269
66
110
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_4269:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0091, 0.0091, 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_4269:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4269:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4269:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4269:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from turbocheetah import cheetahsupport TurboCheetah = cheetahsupport.TurboCheetah __all__ = ["TurboCheetah"]
ajibawa-2023/Python-Code-Large/train/row_4270
3
5
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_4270:ImportFrom_L1_C0", "label": "from turbocheetah import cheetahsupport", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 172, 0, 1, 0, 0, 172, 0, 0], "semantic": {"name": "turbocheetah", "arg_names": [], "import_n...
[]
""" @@TR: This code is pretty much unsupported. MondoReport.py -- Batching module for Python and Cheetah. Version 2001-Nov-18. Doesn't do much practical yet, but the companion testMondoReport.py passes all its tests. -Mike Orr (Iron) TODO: BatchRecord.prev/next/prev_batches/next_batches/query, prev.query, next.quer...
ajibawa-2023/Python-Code-Large/train/row_4271
270
464
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_4271:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0162, 0.0302, 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_4271:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4271:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4271:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4271:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# $Id: CGITemplate.py,v 1.6 2006/01/29 02:09:59 tavis_rudd Exp $ """A subclass of Cheetah.Template for use in CGI scripts. Usage in a template: #extends Cheetah.Tools.CGITemplate #implements respond $cgiHeaders#slurp Usage in a template inheriting a Python class: 1. The template #extends MyPythonClass...
ajibawa-2023/Python-Code-Large/train/row_4272
19
77
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_4272:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 37], "level": 0, "parent": null, "vector": [8, 0, 0.2532, 0.4675, 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_4272:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4272:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4272:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4272:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# $Id: SiteHierarchy.py,v 1.1 2001/10/11 03:25:54 tavis_rudd Exp $ """Create menus and crumbs from a site hierarchy. You define the site hierarchy as lists/tuples. Each location in the hierarchy is a (url, description) tuple. Each list has the base URL/text in the 0 position, and all the children coming after it. A...
ajibawa-2023/Python-Code-Large/train/row_4273
85
166
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_4273:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0512, 0.0843, 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_4273:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4273:ImportFrom_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4273:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4273:ImportFrom_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Nothing, but in a friendly way. Good for filling in for objects you want to hide. If $form.f1 is a RecursiveNull object, then $form.f1.anything["you"].might("use") will resolve to the empty string. This module was contributed by Ian Bicking. """ class RecursiveNull(object): def __getattr__(self, attr): ...
ajibawa-2023/Python-Code-Large/train/row_4274
20
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_4274:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.25, 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_4274:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4274:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4274:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4274:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-...
"""This package contains classes, functions, objects and packages contributed by Cheetah users. They are not used by Cheetah itself. There is no guarantee that this directory will be included in Cheetah releases, that these objects will remain here forever, or that they will remain backward-compatible. ""...
ajibawa-2023/Python-Code-Large/train/row_4275
1
8
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_4275:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.4375, 0.75, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
Version = '2.4.1' VersionTuple = (2, 4, 1, 'final', 0) MinCompatibleVersion = '2.0rc6' MinCompatibleVersionTuple = (2, 0, 0, 'candidate', 6) #### def convertVersionStringToTuple(s): versionNum = [0, 0, 0] releaseType = 'final' releaseTypeSubNum = 0 if s.find('a')!=-1: num, releaseTypeSubNum = ...
ajibawa-2023/Python-Code-Large/train/row_4276
31
58
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_4276:Assign_L1_C0", "label": "Version =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0172, 0, 0.66, 0.0, 444, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Version", "arg_names": [], "import_names": [], "rhs_call_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4276:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4276:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4276:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4276:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
"""SourceReader class for Cheetah's Parser and CodeGenerator """ import re import sys EOLre = re.compile(r'[ \f\t]*(?:\r\n|\r|\n)') EOLZre = re.compile(r'(?:\r\n|\r|\n|\Z)') ENCODINGsearch = re.compile("coding[=:]\s*([-\w.]+)").search class Error(Exception): pass class SourceReade...
ajibawa-2023/Python-Code-Large/train/row_4277
187
290
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_4277:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0069, 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_4277:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4277:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4277:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4277:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code...
import gettext _ = gettext.gettext class I18n(object): def __init__(self, parser): pass ## junk I'm playing with to test the macro framework # def parseArgs(self, parser, startPos): # parser.getWhiteSpace() # args = parser.getExpression(useNameMapper=False, # ...
ajibawa-2023/Python-Code-Large/train/row_4278
10
67
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_4278:Import_L1_C0", "label": "gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0149, 0, 0.66, 0.0, 723, 0, 1, 0, 0, 723, 0, 0], "semantic": {"name": "gettext", "arg_names": [], "import_names": ["gettext"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4278:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4278:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4278:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4278:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-...
#
ajibawa-2023/Python-Code-Large/train/row_4279
0
1
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: ErrorCatchers.py,v 1.7 2005/01/03 19:59:07 tavis_rudd Exp $ """ErrorCatcher class for Cheetah Templates Meta-Data ================================================================================ Author: Tavis Rudd <tavis@damnsimple.com> Version: $Revision: 1.7 $ Start Date: 2001/08/01 Last Revision Date: $Date:...
ajibawa-2023/Python-Code-Large/train/row_4280
33
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_4280:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0968, 0.1452, 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_4280:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4280:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4280:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4280:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-La...
''' Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. ''' import sys import os import os.path from os.path import getmtime, exi...
ajibawa-2023/Python-Code-Large/train/row_4281
1,179
1,999
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_4281:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0025, 0.0045, 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_4281:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4281:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4281:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4281:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-...
''' Provides several CacheStore backends for Cheetah's caching framework. The methods provided by these classes have the same semantics as those in the python-memcached API, except for their return values: set(key, val, time=0) set the value unconditionally add(key, val, time=0) set only if the server doesn't alr...
ajibawa-2023/Python-Code-Large/train/row_4282
53
108
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_4282:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0787, 0.1481, 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_4282:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4282:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4282:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4282:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Co...
# $Id: ImportHooks.py,v 1.27 2007/11/16 18:28:47 tavis_rudd Exp $ """Provides some import hooks to allow Cheetah's .tmpl files to be imported directly like Python .py modules. To use these: import Cheetah.ImportHooks Cheetah.ImportHooks.install() Meta-Data ========================================================...
ajibawa-2023/Python-Code-Large/train/row_4284
75
138
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_4284:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0761, 0.1159, 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_4284:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4284:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4284:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4284:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
import os.path import string l = ['_'] * 256 for c in string.digits + string.letters: l[ord(c)] = c _pathNameTransChars = string.join(l, '') del l, c def convertTmplPathToModuleName(tmplPath, _pathNameTransChars=_pathNameTransChars, splitdrive=os.pat...
ajibawa-2023/Python-Code-Large/train/row_4285
8
15
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_4285:Import_L1_C0", "label": "os.path import os.path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4285:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4285:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4285:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4285:Return_L15_C4"}]
""" Parser classes for Cheetah's Compiler Classes: ParseError( Exception ) _LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer _HighLevelParser( _LowLevelParser ) Parser === _HighLevelParser (an alias) """ import os import sys import re from re import DOTALL, MULTILINE from types import St...
ajibawa-2023/Python-Code-Large/train/row_4287
1,645
2,661
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_4287:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0019, 0.0034, 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_4287:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4287:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4287:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4287:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
#!/usr/bin/env python import os import pprint try: from functools import reduce except ImportError: # Assume we have reduce pass from Cheetah import Parser from Cheetah import Compiler from Cheetah import Template class Analyzer(Parser.Parser): def __init__(self, *args, **kwargs): self.calls...
ajibawa-2023/Python-Code-Large/train/row_4288
63
98
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_4288:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0306, 0.0102, 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_4288:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4288:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4288:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4288:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
try: from ds.sys.Unspecified import Unspecified except ImportError: class _Unspecified: def __repr__(self): return 'Unspecified' def __str__(self): return 'Unspecified' Unspecified = _Unspecified()
ajibawa-2023/Python-Code-Large/train/row_4289
8
9
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_4289:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 9], "level": 0, "parent": null, "vector": [7, 0, 0.5556, 1.0, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4289:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4289:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4289:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4289:ClassDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
# $Id: WebInputMixin.py,v 1.10 2006/01/06 21:56:54 tavis_rudd Exp $ """Provides helpers for Template.webInput(), a method for importing web transaction variables in bulk. See the docstring of webInput for full details. Meta-Data ================================================================================ Author: ...
ajibawa-2023/Python-Code-Large/train/row_4292
46
102
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_4292:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0735, 0.1176, 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_4292:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4292:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4292:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4292:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
## statprof.py ## Copyright (C) 2004,2005 Andy Wingo <wingo at pobox dot com> ## Copyright (C) 2001 Rob Browning <rlb at defaultvalue dot org> ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foun...
ajibawa-2023/Python-Code-Large/train/row_4293
102
304
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_4293:Expr_L22_C0", "label": "expression", "type": "expression", "loc": [22, 120], "level": 0, "parent": null, "vector": [8, 0, 0.2336, 0.3257, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4293:Try_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4293:Import_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4293:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4293:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
"""This is a copy of the htmlDecode function in Webware. @@TR: It implemented more efficiently. """ from Cheetah.Utils.htmlEncode import htmlCodesReversed def htmlDecode(s, codes=htmlCodesReversed): """ Returns the ASCII decoded version of the given HTML string. This does NOT remove normal HTML tags like <p...
ajibawa-2023/Python-Code-Large/train/row_4294
7
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_4294:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.2143, 0.3571, 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_4294:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4294:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4294:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4294:For_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
#!/usr/bin/env python """ Miscellaneous functions/objects used by Cheetah but also useful standalone. """ import os # Used in mkdirsWithPyInitFile. import sys # Used in die. ################################################## ## MISCELLANEOUS FUNCTIONS def die(reason): sys.stderr.write(reason...
ajibawa-2023/Python-Code-Large/train/row_4295
29
67
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_4295:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0448, 0.0448, 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_4295:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4295:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4295:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4295:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Indentation maker. @@TR: this code is unsupported and largely undocumented ... This version is based directly on code by Robert Kuzelj <robert_kuzelj@yahoo.com> and uses his directive syntax. Some classes and attributes have been renamed. Indentation is output via $self._CHEETAH__indenter.indent() to prevent '_i...
ajibawa-2023/Python-Code-Large/train/row_4296
86
123
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_4296:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0488, 0.0894, 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_4296:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4296:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4296:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4296:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
"""This is a copy of the htmlEncode function in Webware. @@TR: It implemented more efficiently. """ htmlCodes = [ ['&', '&amp;'], ['<', '&lt;'], ['>', '&gt;'], ['"', '&quot;'], ] htmlCodesReversed = htmlCodes[:] htmlCodesReversed.reverse() def htmlEncode(s, codes=htmlCodes): """ Returns the HTML...
ajibawa-2023/Python-Code-Large/train/row_4297
9
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_4297:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.2857, 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_4297:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4297:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4297:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4297:For_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
#
ajibawa-2023/Python-Code-Large/train/row_4298
0
1
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"]
[]
[]
import sys import os.path import copy as copyModule from ConfigParser import ConfigParser import re from tokenize import Intnumber, Floatnumber, Number from types import * import types import new import time from StringIO import StringIO # not cStringIO because of unicode support import imp # used by S...
ajibawa-2023/Python-Code-Large/train/row_4299
153
290
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_4299:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 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_4299:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4299:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4299:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4299:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# $Id: _SkeletonPage.py,v 1.13 2002/10/01 17:52:02 tavis_rudd Exp $ """A baseclass for the SkeletonPage template Meta-Data ========== Author: Tavis Rudd <tavis@damnsimple.com>, Version: $Revision: 1.13 $ Start Date: 2001/04/05 Last Revision Date: $Date: 2002/10/01 17:52:02 $ """ __author__ = "Tavis Rudd <tavis@damnsim...
ajibawa-2023/Python-Code-Large/train/row_4300
102
213
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_4300:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0282, 0.0423, 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_4300:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4300:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4300:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4300:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# $Id: CacheRegion.py,v 1.3 2006/01/28 04:19:30 tavis_rudd Exp $ ''' Cache holder classes for Cheetah: Cache regions are defined using the #cache Cheetah directive. Each cache region can be viewed as a dictionary (keyed by cacheRegionID) handling at least one cache item (the default one). It's possible to add cacheIte...
ajibawa-2023/Python-Code-Large/train/row_4302
69
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_4302:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0809, 0.1397, 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_4302:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4302:ImportFrom_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4302:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4302:ImportFrom_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# $Id: CheetahWrapper.py,v 1.26 2007/10/02 01:22:04 tavis_rudd Exp $ """Cheetah command-line interface. 2002-09-03 MSO: Total rewrite. 2002-09-04 MSO: Bugfix, compile command was using wrong output ext. 2002-11-08 MSO: Another rewrite. Meta-Data ========================================================================...
ajibawa-2023/Python-Code-Large/train/row_4303
397
632
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_4303:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0127, 0.0206, 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_4303:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4303:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4303:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4303:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
''' Cheetah is an open source template engine and code generation tool. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code. Homepage ...
ajibawa-2023/Python-Code-Large/train/row_4304
2
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_4304:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 18], "level": 0, "parent": null, "vector": [8, 0, 0.475, 0.9, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[]
#!/usr/bin/env python ''' Core module of Cheetah's Unit-testing framework TODO ================================================================================ # combo tests # negative test cases for expected exceptions # black-box vs clear-box testing # do some tests that run the Template for long enough to check tha...
ajibawa-2023/Python-Code-Large/train/row_4305
24
53
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_4305:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.1226, 0.1887, 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_4305:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4305:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4305:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4305:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4305:...
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli. __revision__ = "$Id: /private/python/stdlib/xmlrunner.py 16654 2007-11-12T12:46:35.368945Z srittau $" import os.path import re import sys import time...
ajibawa-2023/Python-Code-Large/train/row_4306
198
381
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_4306:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0079, 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_4306:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4306:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4306:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4306:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # -*- encoding: utf8 -*- from Cheetah.Template import Template from Cheetah import CheetahWrapper from Cheetah import DummyTransaction import imp import os import sys import tempfile import unittest class CommandLineTest(unittest.TestCase): def createAndCompile(self, source): sourcef...
ajibawa-2023/Python-Code-Large/train/row_4307
121
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_4307:ImportFrom_L4_C0", "label": "from Cheetah.Template import Template", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0042, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "Cheetah.Template", "arg_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4307:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4307:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4307:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4307:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python import unittest from Cheetah import SettingsManager class SettingsManagerTests(unittest.TestCase): def test_mergeDictionaries(self): left = {'foo' : 'bar', 'abc' : {'a' : 1, 'b' : 2, 'c' : (3,)}} right = {'xyz' : (10, 9)} expect = {'xyz': (10, 9), 'foo': 'bar', 'abc...
ajibawa-2023/Python-Code-Large/train/row_4309
11
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_4309:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.05, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4309:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4309:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4309:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4309:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La...
#!/usr/bin/env python import unittest from Cheetah import Parser class ArgListTest(unittest.TestCase): def setUp(self): super(ArgListTest, self).setUp() self.al = Parser.ArgList() def test_merge1(self): ''' Testing the ArgList case results from Template.Preprocessors.tes...
ajibawa-2023/Python-Code-Large/train/row_4310
28
49
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_4310:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 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_4310:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4310:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4310:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4310:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python import unittest from Cheetah import DirectiveAnalyzer class AnalyzerTests(unittest.TestCase): def test_set(self): template = ''' #set $foo = "bar" Hello ${foo}! ''' calls = DirectiveAnalyzer.analyze(template) self.assertEquals(1, calls.get('s...
ajibawa-2023/Python-Code-Large/train/row_4311
13
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_4311:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0345, 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_4311:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4311:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4311:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4311:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La...
#!/usr/bin/env python import Cheetah.NameMapper import Cheetah.Template import sys import unittest majorVer, minorVer = sys.version_info[0], sys.version_info[1] versionTuple = (majorVer, minorVer) def isPython23(): ''' Python 2.3 is still supported by Cheetah, but doesn't support decorators ''' return maj...
ajibawa-2023/Python-Code-Large/train/row_4313
79
246
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_4313:Import_L3_C0", "label": "Cheetah.NameMapper import Cheetah.NameMapper", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0041, 0, 0.66, 0.0, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "Cheetah.NameMapper", "arg_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4313:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4313:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4313:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4313:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python ''' Tests for the 'cheetah' command. Besides unittest usage, recognizes the following command-line options: --list CheetahWrapper.py List all scenarios that are tested. The argument is the path of this script. --nodelete Don't delete scratch directory at end. ...
ajibawa-2023/Python-Code-Large/train/row_4314
394
573
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_4314:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0131, 0.0209, 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_4314:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4314:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4314:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4314:ClassDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
#
ajibawa-2023/Python-Code-Large/train/row_4315
0
1
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"]
[]
[]
#!/usr/bin/env python import hotshot import hotshot.stats import os import sys import unittest from test import pystone import time import Cheetah.NameMapper import Cheetah.Template # This can be turned on with the `--debug` flag when running the test # and will cause the tests to all just dump out how long they t...
ajibawa-2023/Python-Code-Large/train/row_4316
114
243
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_4316:Import_L3_C0", "label": "hotshot import hotshot", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0123, 0.0041, 0, 0.66, 0.0, 974, 0, 1, 0, 0, 974, 0, 0], "semantic": {"name": "hotshot", "arg_names": [], "import_names": ["hotshot"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4316:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4316:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4316:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4316:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
#!/usr/bin/env python import sys import types import os import os.path import unittest from Cheetah.NameMapper import NotFound, valueForKey, \ valueForName, valueFromSearchList, valueFromFrame, valueFromFrameOrSearchList class DummyClass: classVar1 = 123 def __init__(self): self.instanceVar1 ...
ajibawa-2023/Python-Code-Large/train/row_4317
335
525
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_4317:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0019, 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_4317:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4317:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4317:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4317:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
import Cheetah.Template def render(template_file, **kwargs): ''' Cheetah.Django.render() takes the template filename (the filename should be a file in your Django TEMPLATE_DIRS) Any additional keyword arguments are passed into the template are propogated into the templat...
ajibawa-2023/Python-Code-Large/train/row_4319
8
16
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_4319:Import_L1_C0", "label": "Cheetah.Template import Cheetah.Template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "Cheetah.Template", "arg_names": [], "i...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4319:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4319:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4319:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4319:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from glob import glob import os from os import listdir import os.path import re from tempfile import mktemp def _escapeRegexChars(txt, escapeRE=re.compile(r'([\$\^\*\+\.\?\{\}\[\]\(\)\|\\])')): return escapeRE.sub(r'\\\1', txt) def findFiles(*args, **kw): """Recursively find all the file...
ajibawa-2023/Python-Code-Large/train/row_4322
199
357
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_4322:ImportFrom_L2_C0", "label": "from glob import glob", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0028, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4322:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4322:Return_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4322:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4322:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Sep 8 2010) ## http://www.wxformbuilder.org/ ## ## PLEASE DO "NOT" EDIT THIS FILE! ##########################################################################...
ajibawa-2023/Python-Code-Large/train/row_4323
88
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_4323:Import_L10_C0", "label": "wx import wx", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0704, 0.007, 0, 0.66, 0.0, 666, 0, 1, 0, 0, 666, 0, 0], "semantic": {"name": "wx", "arg_names": [], "import_names": ["wx"], "rhs_call_name": "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4323:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4323:FunctionDef_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4323:FunctionDef_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_4323:Expr_L25_C2"}, {"f": "ajibawa-2023/Python-Code-L...
""" some utility function for use in load_balance benchmark """ # MPI imports from mpi4py import MPI comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() import sys import os from os.path import join, exists import traceback from optparse import OptionParser # logging imports import logging # local ...
ajibawa-2023/Python-Code-Large/train/row_4325
185
330
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_4325:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.003, 0.003, 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_4325:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4325:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4325:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4325:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
''' Module to run bench modules which need to be run in mpi This module imports the given module to run, and returns the result of the bench functions of the modules. Also results are written to mpirunner.log file Usage: 1. Print the result in formatted form: $ mpiexec -n <num_procs> python mpirunner.py <bench_name> ...
ajibawa-2023/Python-Code-Large/train/row_4326
46
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_4326:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0959, 0.1781, 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_4326:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4326:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4326:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4326:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" Time comparison for the Cython and OpenCL integrators. We use the NBody integration example as the benchmark. Here, and all neighbor locator is used. The setup consists of four points at the vertices of the unit square in 2D. """ import numpy from time import time import pysph.solver.api as solver import pysp...
ajibawa-2023/Python-Code-Large/train/row_4327
54
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_4327:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0446, 0.0792, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
""" Benchmark for the PySPH neighbor search functions. """ import sys import numpy import time #PySPH imports import pysph.base.api as base def get_points(np = 10000): """ Get np particles in domain [1, -1] X [-1, 1] """ x = numpy.random.random(np)*2.0 - 1.0 y = numpy.random.random(np)*2.0 - 1.0 z =...
ajibawa-2023/Python-Code-Large/train/row_4328
67
109
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_4328:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0092, 0.0092, 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_4328:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4328:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4328:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4328:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from setuptools import find_packages, setup from Cython.Distutils import build_ext from numpy.distutils.extension import Extension ext_modules = [Extension("cython_nnps", ["cython_nnps.pyx"], language="c++", extra_compile_args=["-O3", "-Wall"] ...
ajibawa-2023/Python-Code-Large/train/row_4329
5
22
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_4329:ImportFrom_L1_C0", "label": "from setuptools import find_packages, setup", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "setuptools", "arg_names": [], "...
[]
"""This module compiles the specified (all) the cython .pyx files in the specified (current) directory into python extensions """ import sys import os from setuptools import setup from Cython.Distutils import build_ext from numpy.distutils.extension import Extension import numpy def get_spcl_extn(extn): """ spe...
ajibawa-2023/Python-Code-Large/train/row_4330
35
61
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_4330:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 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_4330:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4330:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4330:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4330:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import pysph.base.api as base import pysph.solver.api as solver import pysph.sph.api as sph import numpy import time import pyopencl as cl CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType # number of particles np = 1 << 20 # number of times a single calc is evaluated neval = 5 x = numpy...
ajibawa-2023/Python-Code-Large/train/row_4331
74
126
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_4331:Import_L1_C0", "label": "pysph.base.api import base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0079, 0, 0.66, 0.0, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "pysph.base.api", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4331:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4331:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4331:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4331:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4331:...
""" Benchmark example for binning particles in Cython and OpenCL """ import numpy import numpy.random as random from time import time import pysph.base.api as base import pysph.solver.api as solver CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType # number of points np = 2**20 # number o...
ajibawa-2023/Python-Code-Large/train/row_4332
36
61
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_4332:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0164, 0.0164, 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_4332:For_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4332:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4332:For_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4332:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_433...
import pysph.base.api as base import pysph.solver.api as solver import pysph.sph.api as sph import numpy import time import pyopencl as cl CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType Locator = base.NeighborLocatorType # number of particles np = 16384 # number of times a single calc ...
ajibawa-2023/Python-Code-Large/train/row_4333
74
130
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_4333:Import_L1_C0", "label": "pysph.base.api import base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0077, 0.0077, 0, 0.66, 0.0, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "pysph.base.api", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4333:For_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4333:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4333:For_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4333:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4333:...
from cStringIO import StringIO import compiler import inspect import textwrap import tokenize from compiler_unparse import unparse class Comment(object): """ A comment block. """ is_comment = True def __init__(self, start_lineno, end_lineno, text): # int : The first line number in the block. ...
ajibawa-2023/Python-Code-Large/train/row_4335
97
158
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_4335:ImportFrom_L1_C0", "label": "from cStringIO import StringIO", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 764, 0, 1, 0, 0, 764, 0, 0], "semantic": {"name": "cStringIO", "arg_names": [], "import_names":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4335:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4335:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4335:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4335:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Turn compiler.ast structures back into executable python code. The unparse method takes a compiler.ast tree and transforms it back into valid python code. It is incomplete and currently only works for import statements, function calls, function definitions, assignments, and basic expressions. ...
ajibawa-2023/Python-Code-Large/train/row_4336
386
860
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_4336:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0076, 0.014, 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_4336:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4336:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4336:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4336:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import inspect import os import pydoc import docscrape from docscrape_sphinx import SphinxClassDoc, SphinxFunctionDoc import numpydoc import comment_eater class SphinxTraitsDoc(SphinxClassDoc): def __init__(self, cls, modulename='', func_doc=SphinxFunctionDoc): if not inspect.isclass(cls): rai...
ajibawa-2023/Python-Code-Large/train/row_4337
78
141
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_4337:Import_L1_C0", "label": "inspect import inspect", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 0, 0.66, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4337:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4337:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4337:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4337:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
import re, textwrap from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): # string conversion routines def _str_header(self, name, symbol='`'): return ['.. rubric:: ' + name, ''] def _str_field_list(self, name): return [':' + name + ':'] de...
ajibawa-2023/Python-Code-Large/train/row_4338
59
108
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_4338:Import_L1_C0", "label": "re import re, textwrap", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 0, 0.66, 0.0, 540, 0, 2, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re", "textwrap"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4338:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4338:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4338:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4338:Return_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
def exact_solution(tf=0.00076, dt=1e-4): """ Exact solution for the the elliptical drop equations """ import numpy A0 = 100 a0 = 1.0 t = 0.0 theta = numpy.linspace(0,2*numpy.pi, 101) Anew = A0 anew = a0 while t <= tf: t += dt Aold = Anew aold = anew ...
ajibawa-2023/Python-Code-Large/train/row_4340
17
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_4340:FunctionDef_L1_C0", "label": "exact_solution", "type": "function", "loc": [1, 27], "level": 0, "parent": null, "vector": [2, 0, 0.4667, 0.9, 0, 0.66, 0.0, 167, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "exact_solution", "arg_names": ["tf", "dt"], "import_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4340:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4340:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4340:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4340:Import_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" An example solving stress test case """ import sys import numpy from numpy import pi, sin, sinh, cos, cosh import pysph.base.api as base import pysph.sph.api as sph import pysph.solver.api as solver from pysph.solver.stress_solver import StressSolver, get_particle_array from pysph.sph.funcs import stress_funcs fr...
ajibawa-2023/Python-Code-Large/train/row_4341
118
172
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_4341:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0058, 0.0058, 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_4341:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4341:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4341:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4341:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code...
""" An example solving stress test case """ import sys import numpy from numpy import pi, sin, sinh, cos, cosh import pysph.base.api as base import pysph.sph.api as sph import pysph.solver.api as solver from pysph.solver.stress_solver import StressSolver from pysph.sph.funcs import stress_funcs from pysph.sph.api imp...
ajibawa-2023/Python-Code-Large/train/row_4342
119
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_4342:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0051, 0.0051, 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_4342:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4342:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4342:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4342:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code...
""" Balls colliding in 2D """ import numpy import pysph.base.api as base import pysph.sph.api as sph import pysph.solver.api as solver import pysph.sph.funcs.stress_funcs as stress_funcs app = solver.Application() Solid = base.ParticleType.Solid E = 1e7 nu = 0.3975 G = E/(2.0*(1+nu)) K = sph.get_K(G, nu) ro = 1.0...
ajibawa-2023/Python-Code-Large/train/row_4343
106
342
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_4343:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0029, 0.0029, 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_4343:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4343:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4343:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4343:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" An example solving stress test case """ import numpy import sys import pysph.base.api as base import pysph.solver.api as solver from pysph.solver.stress_solver import StressSolver, get_particle_array from pysph.sph.funcs import stress_funcs, arithmetic_funcs from pysph.sph.api import SPHFunction app = solver.App...
ajibawa-2023/Python-Code-Large/train/row_4344
83
124
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_4344:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0081, 0.0081, 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_4344:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4344:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4344:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4344:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" An example solving stress test case : colliding rubber balls """ import sys import numpy from numpy import pi, sin, sinh, cos, cosh import pysph.base.api as base import pysph.sph.api as sph import pysph.solver.api as solver from pysph.solver.stress_solver import StressSolver from pysph.sph.funcs import stress_fun...
ajibawa-2023/Python-Code-Large/train/row_4345
82
141
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_4345:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0071, 0.0071, 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_4345:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4345:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4345:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4345:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" An example solving stress test case """ import numpy import sys import os import pysph.base.api as base import pysph.solver.api as solver from pysph.solver.stress_solver import StressSolver, get_particle_array from pysph.sph.funcs import stress_funcs, arithmetic_funcs from pysph.sph.api import SPHFunction app = ...
ajibawa-2023/Python-Code-Large/train/row_4346
111
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_4346:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.006, 0.006, 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_4346:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4346:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4346:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4346:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Example file showing the use of solver controller and various interfaces Usage: Run this file after running the `controller_elliptical_drop.py` example file A matplotlib plot window will open showing the current position of all the particles and colored according to their velocities. The plot is update...
ajibawa-2023/Python-Code-Large/train/row_4347
91
156
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_4347:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0353, 0.0641, 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_4347:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4347:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4347:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4347:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" An example solving the Elliptical drop test case with various interfaces """ import pysph.base.api as base import pysph.solver.api as solver app = solver.Application() app.process_command_line(['-q', '--interactive', '--xml-rpc=0.0.0.0:8900', '--multiproc=pysph@0.0.0.0:8800']) s = solver.Flu...
ajibawa-2023/Python-Code-Large/train/row_4348
12
22
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_4348:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0455, 0.0455, 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_4348:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4348:Expr_L21_C4"}]
""" Simple motion. """ import numpy import pysph.base.api as base import pysph.solver.api as solver import pysph.sph.api as sph from random import randint from numpy import random nx = 1 << 5 dx = 0.5/nx def create_particles_3d(**kwargs): x, y, z = numpy.mgrid[0.25:0.75+1e-10:dx, 0.25...
ajibawa-2023/Python-Code-Large/train/row_4349
68
163
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_4349:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0061, 0.0061, 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_4349:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4349:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4349:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4349:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" A script to demonstrate the simplest of calculations in parallel Setup: ------ Two particle arrays are created on two separate processors with the following procerties: processor 0: x ~ [0,1], dx = 0.1, h = 0.2, m = 0.1, fval = x*x processor 1: x ~ [1.1, 2], dx = 0.1, h = 0.2, m = 0.1, fval = x*x """ #...
ajibawa-2023/Python-Code-Large/train/row_4350
7
10
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_4350:ImportFrom_L1_C0", "label": "from mpi4py import MPI", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 985, 0, 1, 0, 0, 985, 0, 0], "semantic": {"name": "mpi4py", "arg_names": [], "import_names": ["MPI"], "rhs_ca...
[]
""" The moving square test case is part of the SPHERIC benchmark tests. Refer to the document for the test details. Numerical Parameters: --------------------- dx = dy = 0.005 h = 0.0065 => h/dx = 1.3 Length of Box = 10 Height of Box = 5 Number of particles = 27639 + 1669 = 29308 ro = 1000.0 Vmax = 1.0 co = 15 (1...
ajibawa-2023/Python-Code-Large/train/row_4351
122
268
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_4351:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 27], "level": 0, "parent": null, "vector": [8, 0, 0.0522, 0.1007, 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_4351:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4351:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4351:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4351:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code...
""" 2D Dam Break Over a dry bed. The case is described in "State of the art classical SPH for free surface flows", Benedict D Rogers, Robert A, Dalrymple and Alex J.C Crespo, Journal of Hydraulic Research, Vol 48, Extra Issue (2010), pp 6-27 Setup: ------ x x ! x x ! x ...
ajibawa-2023/Python-Code-Large/train/row_4352
72
273
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_4352:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 74], "level": 0, "parent": null, "vector": [8, 0, 0.1374, 0.2711, 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_4352:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4352:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4352:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4352:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code...
""" 2D Dam Break Over a dry bed. The case is described in "State of the art classical SPH for free surface flows", Benedict D Rogers, Robert A, Dalrymple and Alex J.C Crespo, Journal of Hydraulic Research, Vol 48, Extra Issue (2010), pp 6-27 Setup: ------ x x ! x x ! x ...
ajibawa-2023/Python-Code-Large/train/row_4353
120
338
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_4353:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 74], "level": 0, "parent": null, "vector": [8, 0, 0.1109, 0.2189, 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_4353:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4353:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4353:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4353:Return_L118_C4"}, {"f": "ajibawa-2023/Python-Code...
""" A tiny dam break problem Setup: ------ x x ! x x ! x x ! x x ! x o o o o o x ! x o o o o o x !3m x o o o o o x ! x o o o o o x ! x o o o o o x ! x x ! xxxxxxxxxxxxxxxxxxxxx | ...
ajibawa-2023/Python-Code-Large/train/row_4354
61
204
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_4354:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 63], "level": 0, "parent": null, "vector": [8, 0, 0.1569, 0.3088, 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_4354:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4354:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4354:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4354:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" 2D Dam Break Over a dry bed. The case is described in "State of the art classical SPH for free surface flows", Benedict D Rogers, Robert A, Dalrymple and Alex J.C Crespo, Journal of Hydraulic Research, Vol 48, Extra Issue (2010), pp 6-27 Setup: ------ x x ! x x ! x ...
ajibawa-2023/Python-Code-Large/train/row_4355
75
262
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_4355:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 74], "level": 0, "parent": null, "vector": [8, 0, 0.1431, 0.2824, 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_4355:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4355:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4355:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4355:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code...
""" Dam break simulation over a wet bed. This is part of the SPHERIC validation test cases (case 5) (http://wiki.manchester.ac.uk/spheric/index.php/SPHERIC_Home_Page) The main reference for this test case is 'State-of-the-art classical SPH for free-surface flows' by Moncho Gomez-Gesteira and Benedict D. Rogers and Ro...
ajibawa-2023/Python-Code-Large/train/row_4356
88
261
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_4356:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0211, 0.0383, 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_4356:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4356:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4356:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4356:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" An example Script to study the behavior of Monaghan type repulsive particles (Smoothed Particle Hydrodynamics, Reports on Progresses in Physics) The boundary particles are an improvement over the Lenard Jones type repulsive boundary particles. One of the main features is that a particle moving parallel to the wall...
ajibawa-2023/Python-Code-Large/train/row_4357
42
204
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_4357:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 84], "level": 0, "parent": null, "vector": [8, 0, 0.2083, 0.4118, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" A simple example in which two drops collide """ import pysph.solver.api as solver import pysph.base.api as base import pysph.sph.api as sph import numpy def get_circular_patch(name="", type=0, dx=0.05): x,y = numpy.mgrid[-1.05:1.05+1e-4:dx, -1.05:1.05+1e-4:dx] x = x.ravel() y = y.ravel() m...
ajibawa-2023/Python-Code-Large/train/row_4358
41
75
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_4358:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0133, 0.0133, 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_4358:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4358:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4358:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4358:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" NBody Example """ import pysph.base.api as base import pysph.solver.api as solver import pysph.sph.api as sph import numpy Fluid = base.ParticleType.Fluid # number of particles, time step and final time np = 1024 dt = 1e-2 tf = 10.0 nsteps = tf/dt def get_particles(**kwargs): x = numpy.random.random(...
ajibawa-2023/Python-Code-Large/train/row_4359
29
61
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_4359:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0164, 0.0164, 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_4359:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4359:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4359:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4359:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" Shock tube problem with the ADKE procedure of Sigalotti """ import pysph.solver.api as solver import pysph.base.api as base import pysph.sph.api as sph from pysph.base.kernels import CubicSplineKernel import numpy Fluid = base.ParticleType.Fluid Boundary = base.ParticleType.Boundary # Shock tube parameters nl ...
ajibawa-2023/Python-Code-Large/train/row_4360
71
206
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_4360:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0049, 0.0049, 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_4360:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4360:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4360:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4360:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code...
""" Sjogreen's test case """ import numpy import pysph.base.api as base import pysph.solver.api as solver import get_shock_tube_data as get_data CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType Locator = base.NeighborLocatorType # shock tube parameters xl = -1.0; xr = 1.0 pl = 0.4; pr =...
ajibawa-2023/Python-Code-Large/train/row_4361
45
85
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_4361:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0118, 0.0118, 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_4361:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4361:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4361:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4361:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Standard shock tube problem by Monaghan """ import numpy import pysph.base.api as base import pysph.solver.api as solver import get_shock_tube_data as data CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType Locator = base.NeighborLocatorType kernel = base.CubicSplineKernel hks=False ...
ajibawa-2023/Python-Code-Large/train/row_4362
46
85
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_4362:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0118, 0.0118, 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_4362:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4362:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4362:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4362:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Woodward and COllela interacting blast wave.""" import numpy import pysph.sph.api as sph import pysph.base.api as base import pysph.solver.api as solver xl = 0 xr = 1.0 np = 5001 nbp = 100 dx = (xr-xl)/(np-1) D = 1.5 h0 = D*dx adke_eps = 0.5 adke_k = 1.0 g1 = 0.2 g2 = 0.4 alpha = 1.0 beta = 1.0 gamma = 1.4 t...
ajibawa-2023/Python-Code-Large/train/row_4363
96
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_4363:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0064, 0.0064, 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_4363:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4363:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4363:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4363:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code...
"""1D shock tube problem which simulates the collision of two strong shocks. The test is described in 'An adaptive SPH method for strong shocks' by Leonardo Di. G. Sigalotti and Henri Lopez and Leonardo Trujillo, JCP, vol 228, pp (5888-5907) """ import pysph.solver.api as solver import pysph.base.api as base import p...
ajibawa-2023/Python-Code-Large/train/row_4364
43
85
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_4364:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0412, 0.0706, 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_4364:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4364:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4364:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4364:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" Robert's problem """ import numpy import pysph.base.api as base import pysph.solver.api as solver import get_shock_tube_data as get_data CLDomain = base.DomainManagerType CLLocator = base.OpenCLNeighborLocatorType Locator = base.NeighborLocatorType # Roberts problem parameters vc = 0.42 xl = -4.8; xr = 8.0 pl...
ajibawa-2023/Python-Code-Large/train/row_4365
50
96
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_4365:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0104, 0.0104, 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_4365:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4365:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4365:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4365:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-L...