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
""" Functions to get the initial data for the shock tube problems """ import numpy import pysph.base.api as base def get_shock_tube_data(nl, nr, xl, xr, pl, pr, rhol, rhor, ul, ur, g1, g2, h0, gamma=1.4, m0=None): dxl = numpy.abs(xl)/nl ...
ajibawa-2023/Python-Code-Large/train/row_4366
58
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_4366:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0099, 0.0099, 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_4366:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4366:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4366:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4366:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" An example script for running the shock tube problem using Standard SPH. Global properties for the shock tube problem: --------------------------------------------- x ~ [-.6,.6], dxl = 0.001875, dxr = dxl*4, m = dxl, h = 2*dxr rhol = 1.0, rhor = 0.25, el = 2.5, er = 1.795, pl = 1.0, pr = 0.1795 These are obtaine...
ajibawa-2023/Python-Code-Large/train/row_4367
16
50
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4367:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.12, 0.22, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[]
""" 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_4368
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_4368: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_4368:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4368:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4368:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4368:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Cylindrical Noh's implosion problem using the ADKE algorithm. Particles are distributed on concentric circles about the origin with increasing number of particles with increasing radius. The velocity is initially uniform and directed towards the origin. """ import numpy import pysph.sph.api as sp import pysph.ba...
ajibawa-2023/Python-Code-Large/train/row_4369
64
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_4369:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.0648, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4369:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4369:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4369:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4369:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-L...
"""Sedov point explosion problem using the ADKE algorithm. Particles are distributed on concentric circles about the origin with increasing number of particles with increasing radius. A unit charge is distributed about the center which gives the initial pressure disturbance. """ import numpy import pysph.sph.api as...
ajibawa-2023/Python-Code-Large/train/row_4370
64
114
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_4370:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0395, 0.0702, 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_4370:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4370:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4370:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4370:Assign_L46_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_4371
85
226
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_4371:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0044, 0.0044, 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_4371:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4371:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4371:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4371:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code...
""" Strong blaswave problem proposed by Sigalotti. Mach number = 771 """ import numpy import pysph.base.api as base import pysph.solver.api as solver import get_shock_tube_data as data Locator = base.NeighborLocatorType kernel = base.CubicSplineKernel hks=False # shock tube parameters xl = -1.5; xr = 1.5 pl = 1e4...
ajibawa-2023/Python-Code-Large/train/row_4372
46
82
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_4372:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0122, 0.0122, 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_4372:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4372:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4372:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4372:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" An example solving the Ellptical drop test case """ import pysph.base.api as base import pysph.solver.api as solver import warnings dt = 1e-4 tf = 0.0076 app = solver.Application() # set the integrator type integrator_type = solver.RK2Integrator s = solver.FluidSolver(dim=2, integrator_type=integrator_type) ...
ajibawa-2023/Python-Code-Large/train/row_4373
18
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_4373:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0189, 0.0189, 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_4373:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4373:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4373:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4373:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4373:...
""" PySPH ===== A general purpose Smoothed Particle Hydrodynamics framework. This package provides a general purpose framework for SPH simulations in Python. The framework emphasizes flexibility and efficiency while allowing most of the user code to be written in pure Python. See here: http://pysph.googlecode....
ajibawa-2023/Python-Code-Large/train/row_4374
76
198
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_4374:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0379, 0.0707, 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_4374:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4374:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4374:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4374:ImportFrom_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Helper functions to generate commonly used geometries. PySPH used an axis convention as follows: Y | | | | | | /Z | / | / | / | / | / |/_________________X """ import numpy def create_2D_tank(x1,y1,x2,y2,dx): """ Generate an open rectangular tank. Parameters: ----------- x1,y1...
ajibawa-2023/Python-Code-Large/train/row_4376
73
140
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_4376:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 21], "level": 0, "parent": null, "vector": [8, 0, 0.0786, 0.15, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4376:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4376:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4376:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4376:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Module to implement various space filling curves for load balancing """ import numpy from pysph.base.point import IntPoint try: from hilbert import Hilbert_to_int have_hilbert = True except ImportError: # TODO: implement Hilbert's SFC have_hilbert = False def morton_sfc(cell_id, maxlen=20, dim=3):...
ajibawa-2023/Python-Code-Large/train/row_4378
35
46
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4378:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0217, 0.0217, 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_4378:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4378:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4378:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4378:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
from parallel_manager import ParallelManager from parallel_controller import ParallelController from pysph.base.particle_array import get_local_real_tag, get_dummy_tag from pysph.base.fast_utils import arange_long # logger imports import logging logger = logging.getLogger() # Constants Dummy = get_dummy_tag() LocalR...
ajibawa-2023/Python-Code-Large/train/row_4379
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_4379:ImportFrom_L1_C0", "label": "from parallel_manager import ParallelManager", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0118, 0, 0.66, 0.0, 501, 0, 1, 0, 0, 501, 0, 0], "semantic": {"name": "parallel_manager", "arg_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4379:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4379:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4379:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4379:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Module to implement parallel decomposition of particles to assign to different processes during parallel simulations. The method used is an extension of k-means clustering algorithm """ # logging imports import logging logger = logging.getLogger() # standard imports import numpy # local imports from pysph.base.c...
ajibawa-2023/Python-Code-Large/train/row_4380
179
314
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_4380:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0096, 0.0159, 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_4380:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4380:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4380:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4380:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Contains class to perform load balancing using space filling curves. """ # logging imports import logging logger = logging.getLogger() # standard imports import numpy # local imports from pysph.base.particle_array import ParticleArray from pysph.base.cell import py_construct_immediate_neighbor_list from load_bal...
ajibawa-2023/Python-Code-Large/train/row_4381
60
94
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_4381:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0213, 0.0319, 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_4381:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4381:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4381:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4381:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-L...
""" Contains class to perform load balancing. """ #FIXME: usage documentation # logging imports import logging logger = logging.getLogger() # standard imports import numpy # local imports from pysph.base.particle_array import ParticleArray, get_particle_array from pysph.base.cell import CellManager, py_construct_im...
ajibawa-2023/Python-Code-Large/train/row_4382
830
1,497
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_4382:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.001, 0.0013, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4382:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4382:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4382:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4382:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Tests for the parallel cell manager """ import nose.plugins.skip as skip raise skip.SkipTest("Dont run this test via nose") from pysph.parallel.simple_block_manager import SimpleBlockManager from pysph.base.particles import Particles from pysph.base.particle_array import get_particle_array from pysph.base.point i...
ajibawa-2023/Python-Code-Large/train/row_4383
116
203
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_4383: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_4383:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4383:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4383:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4383:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Tests for the parallel cell manager """ import nose.plugins.skip as skip raise skip.SkipTest("Dont run this test via nose") import pysph.base.api as base import pysph.parallel.api as parallel import numpy import pylab import time # mpi imports from mpi4py import MPI comm = MPI.COMM_WORLD num_procs = comm.Get_si...
ajibawa-2023/Python-Code-Large/train/row_4384
48
68
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_4384:Import_L1_C0", "label": "nose.plugins.skip import skip", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "nose.plugins.skip", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4384:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4384:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4384:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4384:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Tests for the parallel cell manager """ import pysph.base.api as base import pysph.parallel.api as parallel import numpy import time import pdb # mpi imports from mpi4py import MPI comm = MPI.COMM_WORLD num_procs = comm.Get_size() pid = comm.Get_rank() import logging logger = logging.getLogger() logger.setLevel...
ajibawa-2023/Python-Code-Large/train/row_4385
7
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_4385:Import_L1_C0", "label": "pysph.base.api import base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "pysph.base.api", "arg_names": [], "import_names": ["...
[]
""" Simple script to check if the load balancing works on 2-d data. """ try: import mpi4py.MPI as mpi except ImportError: import nose.plugins.skip as skip reason = "mpi4py not installed" raise skip.SkipTest(reason) # mpi imports from mpi4py import MPI comm = MPI.COMM_WORLD num_procs = comm.Get_size() ...
ajibawa-2023/Python-Code-Large/train/row_4386
36
57
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_4386:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0351, 0.0526, 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_4386:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4386:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4386:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4386:Import_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4386:...
""" Test the share_data function for various cases cases to run are chosen based on the size of the MPI.COMM_wORLD case 1: for 5 processes Processors arrangement: 4 0 1 2 3 Nbr lists: 0: 1,4 1: 0,2,4 2: 1,3,4 3: 2 4: 0,1,2 case 2: for 2 processes both neighbors of each other case 3,4,5: n processes (n>1 for case...
ajibawa-2023/Python-Code-Large/train/row_4388
87
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_4388:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0851, 0.1631, 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_4388:Try_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4388:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4388:Try_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4388:Import_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
""" Simple script to check if the load balancing works on 1-d data. """ try: import mpi4py.MPI as mpi except ImportError: import nose.plugins.skip as skip reason = "mpi4py not installed" raise skip.SkipTest(reason) # mpi imports from mpi4py import MPI comm = MPI.COMM_WORLD num_procs = comm.Get_size() ...
ajibawa-2023/Python-Code-Large/train/row_4390
36
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4390:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0339, 0.0508, 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_4390:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4390:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4390:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4390:Import_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4390:...
""" Some checks for the parallel cell manager. Run this script only with less than 5 processors. example : mpiexec -n 2 python parallel_cell_check.py """ import time try: import mpi4py.MPI as mpi except ImportError: import nose.plugins.skip as skip reason = "mpi4py not installed" raise skip.SkipTest(...
ajibawa-2023/Python-Code-Large/train/row_4391
69
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_4391:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0244, 0.0407, 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_4391:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4391:Import_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4391:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4391:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_439...
#!/bin/env python """ Simple test for checking if the control tree is setup properly. Run this script with the following command mpiexec -n [num_procs] python controller_check.py """ try: import mpi4py.MPI as mpi except ImportError: import nose.plugins.skip as skip reason = "mpi4py not installed" rai...
ajibawa-2023/Python-Code-Large/train/row_4393
21
57
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_4393:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0877, 0.1228, 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_4393:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4393:Import_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4393:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4393:Import_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
"""A parallel manager that uses blocks to partition the domain. At every iteration, the particles are placed in large bins and these bins are exchanged across processors. """ from parallel_controller import ParallelController from parallel_manager import ParallelManager from parallel_cell import share_data from pys...
ajibawa-2023/Python-Code-Large/train/row_4394
256
534
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_4394:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0056, 0.0094, 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_4394:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4394:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4394:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4394:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
"""API module to simplify import of common names from pysph.parallel package""" from parallel_cell import ParallelCellManager, ProcessorMap
ajibawa-2023/Python-Code-Large/train/row_4395
2
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_4395:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.2, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "...
[]
""" Contains class to perform load balancing using METIS[1]/SCOTCH[2] [1] METIS: http://glaros.dtc.umn.edu/gkhome/views/metis [2] SCOTCH: http://www.labri.fr/perso/pelegrin/scotch/ Note: Either of METIS/SCOTCH is acceptable. Installing one of these is enough. First METIS is attempted to load and if it fails SCOTCH is...
ajibawa-2023/Python-Code-Large/train/row_4396
98
196
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4396:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0281, 0.051, 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_4396:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4396:Try_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4396:Try_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4396:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4396:...
import pysph.base.api as base import pysph.solver.api as solver import pysph.sph.api as sph if solver.HAS_CL: import pyopencl as cl else: try: import nose.plugins.skip as skip reason = "PyOpenCL not installed" raise skip.SkipTest(reason) except ImportError: pass import...
ajibawa-2023/Python-Code-Large/train/row_4397
68
140
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_4397:Import_L1_C0", "label": "pysph.base.api import base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 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_4397:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4397:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4397:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4397:Try_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4397:Try_L...
""" Module containing some data required for tests of the sph module. """ # standard imports import numpy # local imports from pysph.base.particle_array import * def generate_sample_dataset_1(): """ Generate test test data. Look at image sph_test_data1.png """ x = numpy.array([-1.0, 0.0, 1.0, -1.0...
ajibawa-2023/Python-Code-Large/train/row_4398
27
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_4398:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0328, 0.0492, 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_4398:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4398:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4398:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4398:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
"""API module to simplify import of common names from pysph.sph package""" #Import from calc from sph_calc import SPHCalc, CLCalc from sph_func import SPHFunction, SPHFunctionParticle, CSPHFunctionParticle ############################################################################ # IMPORT FUNCTIONS ################...
ajibawa-2023/Python-Code-Large/train/row_4399
18
69
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4399:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
import numpy from pysph.solver.cl_utils import cl_read, get_real, HAS_CL, get_pysph_root,\ create_some_context, enqueue_copy import pysph.solver.cl_utils as clu if HAS_CL: import pyopencl as cl mf = cl.mem_flags # Cython functions for neighbor list construction from nnps_util import cbin, unflatten fro...
ajibawa-2023/Python-Code-Large/train/row_4401
414
1,034
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_4401:Import_L1_C0", "label": "numpy import numpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.001, 0.001, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_call_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4401:If_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4401:Import_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4401:If_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4401:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4401:C...
# OpenCL conditional imports import pysph.solver.cl_utils as clu if clu.HAS_CL: import pyopencl as cl mf = cl.mem_flags import numpy as np class Scan(object): def __init__(self, GPUContext, CommandQueue, numElements): # Constants MAX_WORKGROUP_INCLUSIVE...
ajibawa-2023/Python-Code-Large/train/row_4402
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_4402:Import_L2_C0", "label": "pysph.solver.cl_utils import clu", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0104, 0, 0.66, 0.0, 529, 0, 1, 0, 0, 529, 0, 0], "semantic": {"name": "pysph.solver.cl_utils", "arg_names": [], "impo...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4402:If_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4402:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4402:If_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4402:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4402:Cl...
#! python ''' Module to collect and generate source files from template files The template files have very similar syntax to php files. * All text in input is copied straight to output except that within `<?py` and `?>` tags. * Text within `<?py=` and `?>` tags is evaluated and the result is written into the out...
ajibawa-2023/Python-Code-Large/train/row_4403
81
146
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_4403:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 33], "level": 0, "parent": null, "vector": [8, 0, 0.1199, 0.2192, 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_4403:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4403:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4403:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4403:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import nnps_util as util import pysph.solver.cl_utils as clu import numpy # PySPH imports from carray import LongArray #CHANGE class OpenCLNeighborLocatorType: AllPairNeighborLocator = 0 LinkedListSPHNeighborLocator = 1 RadixSortNeighborLocator = 2 class OpenCLNeighborLocator(object): pass class Lin...
ajibawa-2023/Python-Code-Large/train/row_4404
185
1,184
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_4404:Import_L1_C0", "label": "nnps_util import util", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0008, 0.0008, 0, 0.66, 0.0, 501, 0, 1, 0, 0, 501, 0, 0], "semantic": {"name": "nnps_util", "arg_names": [], "import_names": ["util"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4404:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4404:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4404:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4404:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# standard imports import numpy # local imports from pysph.base.particle_array import * def generate_sample_dataset_1(): """ Generate test test data. Look at image test_cell_case1.png for details. """ x = numpy.array([0.25, 0.8, 0.5, 0.8, 0.2, 0.5, 1.5, 1.5]) y = numpy.array([0.25, 0.1, 0.5,...
ajibawa-2023/Python-Code-Large/train/row_4405
23
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_4405:Import_L2_C0", "label": "numpy import numpy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0227, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_cal...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4405:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4405:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4405:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4405:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
""" Tests for the particle array module. """ # standard imports import unittest import numpy # local imports import pysph from pysph.base import particle_array from pysph.base.carray import LongArray, IntArray, DoubleArray from pysph.base import carray import pickle def check_array(x, y): """Check if two arrays...
ajibawa-2023/Python-Code-Large/train/row_4406
359
590
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_4406:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0034, 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_4406:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4406:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4406:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4406:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
class ParticleType: """ An empty class to provide an enum for the different particle types used in PySPH. The types defined are: Fluid -- The default particle type used to represent fluids. Solid -- Use this to represent solids DummyFluid -- Probe -- Boundary -- Boundary partic...
ajibawa-2023/Python-Code-Large/train/row_4407
9
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4407:ClassDef_L1_C0", "label": "ParticleType", "type": "class", "loc": [1, 33], "level": 0, "parent": null, "vector": [3, 0, 0.4595, 0.8919, 0, 0.66, 0.0, 894, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "ParticleType", "arg_names": [], "import_names": [], "rhs_call_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4407:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4407:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4407:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4407:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/...
from cell import CellManager from nnps import NNPSManager, NeighborLocatorType from particle_array import ParticleArray from particle_types import ParticleType from domain_manager import DomainManagerType as CLDomain from locator import OpenCLNeighborLocatorType as CLLocator import locator import domain_manager from...
ajibawa-2023/Python-Code-Large/train/row_4409
144
515
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_4409:ImportFrom_L1_C0", "label": "from cell import CellManager", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 787, 0, 1, 0, 0, 787, 0, 0], "semantic": {"name": "cell", "arg_names": [], "import_names": ["Cell...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4409:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4409:Import_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4409:Try_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4409:ImportFrom_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
"""API module to simplify import of common names from pysph.base package""" # fast utils from fast_utils import arange_long # carray from carray import LongArray, DoubleArray, IntArray, FloatArray from cell import Cell, CellManager, PeriodicDomain from kernels import KernelBase, DummyKernel, CubicSplineKernel, \ ...
ajibawa-2023/Python-Code-Large/train/row_4410
22
48
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4410:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
''' Implement infrastructure for the solver to add various interfaces ''' from functools import wraps, partial import threading, thread from pysph.base.particle_array import ParticleArray import logging logger = logging.getLogger() class DummyComm(object): ''' A dummy MPI.Comm implementation as placeholder for f...
ajibawa-2023/Python-Code-Large/train/row_4411
274
441
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_4411:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0023, 0.0023, 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_4411:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4411:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4411:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4411:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Module contains some common functions. """ # standard imports import pickle import numpy import sys import os import platform import commands from numpy.lib import format HAS_PBAR = True try: import progressbar except ImportError: HAS_PBAR = False import pysph def check_array(x, y): """Check if two ...
ajibawa-2023/Python-Code-Large/train/row_4412
161
412
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_4412:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0049, 0.0073, 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_4412:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4412:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4412:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4412:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
""" An example solver for the circular patch of fluid """ import numpy from optparse import OptionGroup, Option import pysph.base.api as base import pysph.sph.api as sph from pysph.sph.funcs import stress_funcs from pysph.sph.funcs import eos_funcs from pysph.sph.funcs import viscosity_funcs from solver import Sol...
ajibawa-2023/Python-Code-Large/train/row_4413
109
305
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_4413:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0033, 0.0033, 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_4413:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4413:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4413:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4413:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from pysph.sph.sph_calc import SPHCalc from pysph.sph.funcs.arithmetic_funcs import PropertyGet import numpy import logging logger = logging.getLogger() ############################################################################# #`Integrator` class ###################################################################...
ajibawa-2023/Python-Code-Large/train/row_4414
295
851
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_4414:ImportFrom_L1_C0", "label": "from pysph.sph.sph_calc import SPHCalc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0012, 0.0012, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "pysph.sph.sph_calc", "arg_names": [], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4414:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4414:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4414:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4414:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import numpy class TimeStep(object): def compute_time_step(self, solver): return solver.dt class ViscousTimeStep(TimeStep): def __init__(self, cfl, co, particles): self.cfl = cfl self.co = co self.particles = particles def compute_time_step(self, solver): cfl =...
ajibawa-2023/Python-Code-Large/train/row_4415
43
71
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_4415:Import_L1_C0", "label": "numpy import numpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.0141, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_cal...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4415:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4415:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4415:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4415:Return_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
from integrator import Integrator from cl_utils import HAS_CL, get_pysph_root, get_cl_include,\ get_scalar_buffer, cl_read, get_real, enqueue_copy if HAS_CL: import pyopencl as cl from os import path import numpy class CLIntegrator(Integrator): def setup_integrator(self, context): """ Setup the...
ajibawa-2023/Python-Code-Large/train/row_4417
124
383
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_4417:ImportFrom_L1_C0", "label": "from integrator import Integrator", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0026, 0, 0.66, 0.0, 352, 0, 1, 0, 0, 352, 0, 0], "semantic": {"name": "integrator", "arg_names": [], "import_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4417:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4417:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4417:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4417:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
""" Post step functions for the solver """ import pickle import os import pysph.base.api as base from pysph.base.cell import py_find_cell_id class SaveCellManagerData(object): """Post-step function to save the cell manager's data. Two files are created, 'neighbors' contains partile neighbor information ...
ajibawa-2023/Python-Code-Large/train/row_4418
59
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4418:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0097, 0.0097, 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_4418:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4418:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4418:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4418:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
# Standard imports. import logging, os from optparse import OptionParser, OptionGroup, Option from os.path import basename, splitext, abspath import sys from utils import mkdir # PySPH imports. from pysph.base.particles import Particles, CLParticles, ParticleArray from pysph.solver.controller import CommandManager fr...
ajibawa-2023/Python-Code-Large/train/row_4419
230
584
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_4419:Import_L2_C0", "label": "logging import logging, os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0017, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4419:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4419:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4419:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4419:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
""" A simple shock tube solver """ from optparse import OptionGroup, Option import numpy import pysph.base.api as base import pysph.sph.api as sph from solver import Solver from sph_equation import SPHOperation, SPHIntegration from integrator import GSPHIntegrator Fluids = base.Fluid Solids = base.Solid Boundary = ...
ajibawa-2023/Python-Code-Large/train/row_4420
167
678
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_4420:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0015, 0.0015, 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_4420:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4420:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4420:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4420:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Classes for generators of some simple elements. """ # standard imports import logging logger = logging.getLogger() import numpy # local imports from pysph.base.carray import DoubleArray, LongArray from pysph.base.nnps import * from pysph.base.point import Point from pysph.solver.particle_generator import * from ...
ajibawa-2023/Python-Code-Large/train/row_4422
400
825
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_4422:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0024, 0.0036, 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_4422:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4422:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4422:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4422:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
HAS_CL = True try: import pyopencl as cl except ImportError: HAS_CL=False from os import path import numpy from utils import get_pysph_root # Return all available devices on the host def get_cl_devices(): """ Return a dictionary keyed on device type for all devices """ _devices = {'CPU':[], 'GPU':[]...
ajibawa-2023/Python-Code-Large/train/row_4425
117
271
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_4425:Assign_L1_C0", "label": "HAS_CL =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0037, 0.0037, 0, 0.66, 0.0, 94, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "HAS_CL", "arg_names": [], "import_names": [], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4425:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4425:Import_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4425:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4425:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4425:...
from numpy import arccos, sin, cos, array, sqrt, pi r = 2.0/pi dt = 1e-3 def force(x,y): theta = arccos(x/sqrt((x**2+y**2))) return array([-sin(theta), cos(theta)]) def rk2(nsteps=1000, x0=r, y0=0): t = 0 xinitial = x0 yinitial = y0 while t < nsteps: _x = xinitial _y = yiniti...
ajibawa-2023/Python-Code-Large/train/row_4426
55
76
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4426:ImportFrom_L1_C0", "label": "from numpy import arccos, sin, cos\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 954, 0, 6, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4426:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4426:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4426:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4426:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" An example solver for the circular patch of fluid """ import numpy import pysph.base.api as base import pysph.sph.api as sph from solver import Solver from sph_equation import SPHOperation, SPHIntegration Fluids = base.ParticleType.Fluid Solids = base.ParticleType.Solid def get_circular_patch(name="", type=0...
ajibawa-2023/Python-Code-Large/train/row_4427
37
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4427:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0115, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4427:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4427:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4427:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4427:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-L...
from integrator import EulerIntegrator, RK2Integrator, RK4Integrator,\ PredictorCorrectorIntegrator, LeapFrogIntegrator from cl_integrator import CLEulerIntegrator from sph_equation import SPHIntegration, SPHOperation from solver import Solver from shock_tube_solver import ShockTubeSolver, ADKEShockTubeSolver,\...
ajibawa-2023/Python-Code-Large/train/row_4428
15
38
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_4428:ImportFrom_L1_C0", "label": "from integrator import EulerIntegrator, RK2Integrator, RK4Integrator\u2026", "type": "import", "loc": [1, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0395, 0.0526, 0, 0.66, 0.0, 352, 0, 5, 0, 0, 352, 0, 0], "semantic": {"name": "...
[]
#! /usr/bin/env python # Author: Stefan Behnel <scoder@users.berlios.de> # http://hg.cython.org/cython-devel/file/tip/Tools/cython-epydoc.py # # -------------------------------------------------------------------- import re from epydoc import docstringparser as dsp CYTHON_SIGNATURE_RE = re.compile( # Class name ...
ajibawa-2023/Python-Code-Large/train/row_4429
17
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4429:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1489, 0.0213, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4429:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4429:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4429:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4429:Try_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4430
13
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_4430:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.3864, 0.0227, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[]
#!/usr/bin/env python
ajibawa-2023/Python-Code-Large/train/row_4432
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 # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4433
232
446
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_4433:ImportFrom_L20_C0", "label": "from datetime import datetime", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0448, 0.0022, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4433:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4433:Expr_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4433:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4433:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4434
13
45
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_4434:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.3778, 0.0222, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4434:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4434:Expr_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4434:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4434:Expr_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4435
65
134
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_4435:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.1269, 0.0075, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4435:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4435:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4435:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4435:FunctionDef_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4436
83
182
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_4436:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.0934, 0.0055, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4436:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4436:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4436:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4436:Assign_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
ajibawa-2023/Python-Code-Large/train/row_4437
507
1,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_4437:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 71], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.0449, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4437:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4437:Expr_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4437:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4437:FunctionDef_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4438
48
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4438:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.1954, 0.0115, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4438:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4438:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4438:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4438:FunctionDef_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4439
60
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_4439:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.1083, 0.0064, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4439:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4439:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4439:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4439:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4440
17
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_4440:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.3864, 0.0227, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4440:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4440:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4440:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4440:FunctionDef_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python """ISO 8601 date time string parsing Basic usage: >>> import iso8601 >>> iso8601.parse_date("2007-01-25T12:00:00Z") datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>) >>> """ from datetime import datetime, timedelta, tzinfo import re __all__ = ["parse_date", "ParseError"] ...
ajibawa-2023/Python-Code-Large/train/row_4441
55
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4441:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0583, 0.0874, 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_4441:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4441:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4441:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4441:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
#!/usr/bin/env python
ajibawa-2023/Python-Code-Large/train/row_4442
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 # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4443
27
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4443:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.2429, 0.0143, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4443:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4443:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4443:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4443:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python # # Copyright 2011 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
ajibawa-2023/Python-Code-Large/train/row_4444
360
846
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_4444:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 21], "level": 0, "parent": null, "vector": [8, 0, 0.0225, 0.0059, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4444:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4444:Expr_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4444:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4444:Assign_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#! /usr/bin/env python # -*- coding: utf-8 -*- # import sys,os import re import ConfigParser import memcache import urlparse import smtplib from email.mime.text import MIMEText import urlparse from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler class RequestHandler(BaseHTTPRequestHandler): ...
ajibawa-2023/Python-Code-Large/train/row_4445
53
78
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4445:Import_L1_C0", "label": "sys import sys, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4445:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4445:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4445:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4445:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code...
#! /usr/bin/env python # -*- coding: utf-8 -*- # import sys,os import re import ConfigParser import memcache import urlparse import smtplib from email.mime.text import MIMEText import urlparse from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler class RequestHandler(BaseHTTPRequestHandler): ...
ajibawa-2023/Python-Code-Large/train/row_4446
53
78
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4446:Import_L1_C0", "label": "sys import sys, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4446:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4446:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4446:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4446:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code...
import sys, string, re, Queue arith = ['sub', 'div', 'mod', 'cmple', 'add', 'mul', 'cmpeq', 'cmplt'] operators = ['-', '/', '%', '<=', '+', '*', '==', '<'] arith1 = ['neg'] local_size = 0; # get operand def getOperand(t, sline, access_local): #GP if sline[t] == 'GP': print '(char*)global', return t+1 #FP...
ajibawa-2023/Python-Code-Large/train/row_4447
141
239
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_4447:Import_L1_C0", "label": "sys import sys, string, re\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0042, 0.0042, 0, 0.66, 0.0, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4447:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4447:If_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4447:If_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_4447:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
import logging from web.webbase import * from classes import classes from imports.n3tagvalue import svalue def gettag(t): return t if t[0].isalpha() else t[1:] def getprop(t): t=gettag(t) ns = 'ofx' if t.isupper() else 'a3' return ns+':'+t def getclass(items,typ,acctids,dtstart,dtend,uniqueids,fltrex...
ajibawa-2023/Python-Code-Large/train/row_4448
79
134
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_4448:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0075, 0.0075, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4448:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4448:Return_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4448:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4448:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import os from rdflib import Namespace, BNode, Literal, RDF, URIRef from semprog.pysesame import connection import cherrypy from mako.lookup import TemplateLookup import urllib from simplejson import dumps from classes import classes user_cfg = os.path.expanduser("~/cherrypy.cfg") if os.path.exists(user_cfg): cher...
ajibawa-2023/Python-Code-Large/train/row_4449
81
114
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_4449:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 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_4449:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4449:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4449:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4449:If_L13_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4449:If...
from web.webbase import * from get import getclass,getpositions,getassets def accounts(): items={} getclass(items,'account',None,None,None,None) return items.values() def accounttotals(acctids,dtstart,dtend): # collect information on positions positions={} getpositions(positions,acctids,dtstar...
ajibawa-2023/Python-Code-Large/train/row_4450
35
56
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_4450:ImportFrom_L1_C0", "label": "from web.webbase import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 686, 0, 1, 0, 0, 686, 0, 0], "semantic": {"name": "web.webbase", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4450:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4450:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4450:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4450:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from get import * def asset(uniqueids): items={} getpositions(items,None,None,None,uniqueids) gettransactions(items,None,None,None,uniqueids) getassets(items,uniqueids) return items.values()
ajibawa-2023/Python-Code-Large/train/row_4451
7
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_4451:ImportFrom_L1_C0", "label": "from get import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 607, 0, 1, 0, 0, 607, 0, 0], "semantic": {"name": "get", "arg_names": [], "import_names": ["*"], "rhs_call_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4451:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4451:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4451:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4451:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""A dictonary of all the classes of objects that can be found in flat lines. the keys are the class types (names). The values describe each class: * The key list describes all the tags that must appear in a flat line in order for an object of the class to be said to be in the line. The object is uniquely identi...
ajibawa-2023/Python-Code-Large/train/row_4452
2
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_4452:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.3182, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
from get import * def transactions(acctids,dtstart,dtend): items={} gettransactions(items,acctids,dtstart,dtend) # add information on assets uniqueids=set(o['UNIQUEID'][0] for o in items.itervalues() if 'UNIQUEID' in o) # get all uniqueids in use getassets(items,...
ajibawa-2023/Python-Code-Large/train/row_4453
7
11
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_4453:ImportFrom_L1_C0", "label": "from get import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 607, 0, 1, 0, 0, 607, 0, 0], "semantic": {"name": "get", "arg_names": [], "import_names": ["*"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4453:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4453:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4453:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4453:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from get import * def positions(acctids,dtstart,dtend): items={} getpositions(items,acctids,dtstart,dtend) # add information on assets uniqueids=set(o['UNIQUEID'][0] for o in items.itervalues()) # get all uniqueids in use getassets(items,uniqueids) return items.values() def positionspe...
ajibawa-2023/Python-Code-Large/train/row_4454
38
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4454:ImportFrom_L1_C0", "label": "from get import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 607, 0, 1, 0, 0, 607, 0, 0], "semantic": {"name": "get", "arg_names": [], "import_names": ["*"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4454:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4454:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4454:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4454:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from get import * def checking(acctids,dtstart,dtend): items={} getchecking(items,acctids,dtstart,dtend) return items.values()
ajibawa-2023/Python-Code-Large/train/row_4455
5
6
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_4455:ImportFrom_L1_C0", "label": "from get import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 607, 0, 1, 0, 0, 607, 0, 0], "semantic": {"name": "get", "arg_names": [], "import_names": ["*"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4455:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4455:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4455:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4455:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
__version__ = "$Id$" import os import threading import random import urllib2 import cherrypy from mako.template import Template from mako.lookup import TemplateLookup from urllib import quote_plus from web.webbase import * from web.position import positions,positionspercents from web.asset import asset from web.account...
ajibawa-2023/Python-Code-Large/train/row_4456
104
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_4456:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4456:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4456:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4456:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4456:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code...
# Load an RDF file into local sesame server #import os #import sys #from optparse import OptionParser #from httplib import BadStatusLine from rdflib.graph import ConjunctiveGraph from semprog import pysesame __version__ = "$Id$" def loadGraph2Server(g,url,fname=None): data = g.serialize(format='xml') c = pyses...
ajibawa-2023/Python-Code-Large/train/row_4459
17
25
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_4459:ImportFrom_L6_C0", "label": "from rdflib.graph import ConjunctiveGraph", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.24, 0.04, 0, 0.66, 0.0, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "rdflib.graph", "arg_names": [], "impo...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4459:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4459:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4459:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4459:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-L...
######################################################################## # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation version 2...
ajibawa-2023/Python-Code-Large/train/row_4461
6
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_4461:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 19], "level": 0, "parent": null, "vector": [8, 0, 0.6607, 0.0714, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4461:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4461:Expr_L26_C1"}]
######################################################################## # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation version 2...
ajibawa-2023/Python-Code-Large/train/row_4462
187
378
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_4462:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0159, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4462:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4462:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4462:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4462:Return_L41_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
######################################################################## # 3account - personal finance data-base # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published ...
ajibawa-2023/Python-Code-Large/train/row_4464
89
200
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_4464:Expr_L19_C0", "label": "expression", "type": "expression", "loc": [19, 22], "level": 0, "parent": null, "vector": [8, 0, 0.1025, 0.02, 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_4464:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4464:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4464:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4464:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
######################################################################## # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation version 2...
ajibawa-2023/Python-Code-Large/train/row_4466
46
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_4466:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 40], "level": 0, "parent": null, "vector": [8, 0, 0.29, 0.23, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4466:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4466:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4466:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4466:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
"""ofx2n3.py -- interpret OFX format as RDF Converts OFX format (as in downloaded back statements etc The conversion is only syntactic. The OFX modelling is pretty weel thought out, so taking it as defining an effecive RDF ontolofy seems to make sense. Rules can then be used to define mapping into your favor...
ajibawa-2023/Python-Code-Large/train/row_4468
57
137
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_4468:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 52], "level": 0, "parent": null, "vector": [8, 0, 0.1934, 0.3796, 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_4468:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4468:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4468:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4468:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
######################################################################## # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation version 2...
ajibawa-2023/Python-Code-Large/train/row_4469
49
147
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_4469:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 62], "level": 0, "parent": null, "vector": [8, 0, 0.2721, 0.3061, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4469:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4469:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4469:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4469:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
######################################################################## # xls2csv2 - convert excel to csv and handle encoding # Copyright (C) 2007,8,9 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
ajibawa-2023/Python-Code-Large/train/row_4470
55
94
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_4470:Expr_L19_C0", "label": "expression", "type": "expression", "loc": [19, 24], "level": 0, "parent": null, "vector": [8, 0, 0.2287, 0.0638, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4470:Try_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4470:Import_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4470:Try_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4470:Import_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
"""Init.py I'm not actually sure what this does. """ __version__ = "$Revision: 1.1 $" __all__ = [ "string" ]
ajibawa-2023/Python-Code-Large/train/row_4471
3
11
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_4471:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.3182, 0.5455, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
import hashlib import logging import re import ConfigParser # List of tags which we want their value to be hashed if "hashing" is True hash_list = ["ACCTID", "INTU_USERID","owner"]; # List of tags that may contain a sub-string that needs to be hashed # usually transfers write the account to which the transfer is...
ajibawa-2023/Python-Code-Large/train/row_4472
76
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_4472:Import_L1_C0", "label": "hashlib import hashlib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0081, 0.0081, 0, 0.66, 0.0, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4472:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4472:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4472:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4472:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
######################################################################## # Copyright (C) 2009 Ehud Ben-Reuven # udi@benreuven.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation version 2. # ...
ajibawa-2023/Python-Code-Large/train/row_4474
152
280
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_4474:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0661, 0.0071, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4474:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4474:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4474:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4474:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from rdflib import Namespace, URIRef, Literal, BNode from rdflib.graph import Graph from urllib import quote_plus from httplib import HTTPConnection from cStringIO import StringIO import xml.dom from simplejson import loads owlNS = Namespace("http://www.w3.org/2002/07/owl#") owlClass = owlNS["Class"] owlObjectProperty...
ajibawa-2023/Python-Code-Large/train/row_4476
298
403
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_4476:ImportFrom_L1_C0", "label": "from rdflib import Namespace, URIRef, Literal\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0025, 0.0025, 0, 0.66, 0.0, 926, 0, 4, 0, 0, 926, 0, 0], "semantic": {"name": "rdflib", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4476:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4476:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4476:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4476:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code...
import urllib2 from urllib import quote_plus from simplejson import loads from httplib import HTTPConnection import urlparse class connection: def __init__(self,url): self.baseurl=url self.sparql_prefix="" self.host=urlparse.urlparse(url).netloc def addnamespace(self,id,ns): ...
ajibawa-2023/Python-Code-Large/train/row_4477
55
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_4477:Import_L1_C0", "label": "urllib2 import urllib2", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0118, 0, 0.66, 0.0, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "urllib2", "arg_names": [], "import_names": ["urllib2"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4477:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4477:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4477:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4477:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- 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_4478
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_4478: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_4478:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4478:FunctionDef_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4478:FunctionDef_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_4478:Expr_L25_C2"}, {"f": "ajibawa-2023/Python-Code-L...
#!/usr/bin/python # -*- coding: UTF-8 -*- # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: # Author: Huang Jiahua <jhuangjiahua@gmail.com> # License: LGPLv3+ # Last modified: '''文档格式转换 ''' import os import subprocess def doc2html(docfile): '''将 mso doc 转换为 html 依赖 wv ''' dir = os.tmpnam() ...
ajibawa-2023/Python-Code-Large/train/row_4479
11
24
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_4479:Expr_L8_C0", "label": "expression", "type": "expression", "loc": [8, 9], "level": 0, "parent": null, "vector": [8, 0, 0.3542, 0.0833, 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_4479:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4479:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4479:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4479:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/python # -*- coding: UTF-8 -*- '''WebkitLinkView @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' import gobject import gtk import webkit import re def proc(html): """处理 html 链接 >>> proc(' <a href="#3.2.1">3.2.1 heading</a>') '<a href="#3.2.1" onDblClick="window.loca...
ajibawa-2023/Python-Code-Large/train/row_4480
27
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_4480:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0616, 0.0548, 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_4480:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4480:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4480:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4480:Return_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/python # -*- coding: UTF-8 -*- '''Gtk 对话框 @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' import os import gtk import gobject __all__ = ['error', 'info', 'inputbox', 'messagedialog', 'open', 'save', 'warning', 'yesno'] try: import i18n except: from gettext import gettext a...
ajibawa-2023/Python-Code-Large/train/row_4481
340
528
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_4481:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0085, 0.0076, 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_4481:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4481:Import_L16_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4481:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4481:ImportFrom_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
#!/usr/bin/python # -*- coding: UTF-8 -*- '''Gtk LaTex @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' import gtk, gobject import thread import time import subprocess import os, sys import base64 try: import gtksourceview2 except: gtksourceview2 = None try: import i18n except: from gettext i...
ajibawa-2023/Python-Code-Large/train/row_4482
182
405
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_4482:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0111, 0.0099, 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_4482:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4482:Import_L16_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4482:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4482:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...
#!/usr/bin/python # -*- coding: UTF-8 -*- '''GWrite @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' __version__ = '0.5.1' import gtk, gobject import gtkdialogs import gtklatex import config import os, sys import thread import re import urllib2 try: import i18n except: from gettext import get...
ajibawa-2023/Python-Code-Large/train/row_4483
1,548
2,485
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_4483:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0018, 0.0016, 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_4483:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4483:Import_L20_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4483:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4483:ImportFrom_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
#!/usr/bin/python # -*- coding: UTF-8 -*- # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: # Author: Huang Jiahua <jhuangjiahua@gmail.com> # License: LGPLv3+ # Last modified: app = 'gwrite' import os, sys import gettext if os.path.isdir(os.path.dirname(sys.argv[0]) + '/../build/mo'): gettext.install(app,...
ajibawa-2023/Python-Code-Large/train/row_4484
8
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_4484:Assign_L8_C0", "label": "app =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.3636, 0.0455, 0, 0.66, 0.0, 494, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_4484:If_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4484:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4484:If_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4484:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4484:If...
#!/usr/bin/python # -*- coding: UTF-8 -*- '''config @author: U{Jiahua Huang <jhuangjiahua@gmail.com>} @license: LGPLv3+ ''' import gtk, gobject import os, sys try: import cPickle as pickle except: import pickle try: import i18n except: from gettext import gettext as _ single_instance_mode = 0 mdi_mode = 1 def getc...
ajibawa-2023/Python-Code-Large/train/row_4485
100
147
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_4485:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0306, 0.0272, 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_4485:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4485:Import_L11_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4485:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4485:Import_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4...