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 |
|---|---|---|---|---|---|---|---|
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | ajibawa-2023/Python-Code-Large/train/row_3809 | 12 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3809:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1528, 0.1111, 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_3809:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3809:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3809:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3809:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""Fix function attribute names (f.func_x -> f.__x__)."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixFuncattrs(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_glo... | ajibawa-2023/Python-Code-Large/train/row_3810 | 9 | 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_3810:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0417, 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_3810:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3810:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3810:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3810:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... | ajibawa-2023/Python-Code-Large/train/row_3811 | 33 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3811:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 20], "level": 0, "parent": null, "vector": [8, 0, 0.1304, 0.1848, 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_3811:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3811:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3811:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3811:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that transforms `xyzzy` into repr(xyzzy)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name, parenthesize
class FixRepr(fixer_base.BaseFix):
BM_compatible = True
PATT... | ajibawa-2023/Python-Code-Large/train/row_3812 | 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_3812:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.0417, 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_3812:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3812:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3812:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3812:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... | ajibawa-2023/Python-Code-Large/train/row_3813 | 442 | 738 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3813:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0088, 0.0081, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3813:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3813:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3813:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3813:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
def f(x):
print '%s\t-> α(%2i):%s β(%s)'
| ajibawa-2023/Python-Code-Large/train/row_3815 | 3 | 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_3815:Expr_L3_C0", "label": "print()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.1667, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3815:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3815:Expr_L6_C4"}] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
def f(x):
print '%s\t-> α(%2i):%s β(%s)'
| ajibawa-2023/Python-Code-Large/train/row_3816 | 3 | 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_3816:Expr_L3_C0", "label": "print()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.1667, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3816:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3816:Expr_L6_C4"}] |
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
# NOTE: When you run this test as a script from the command line, you
# get warnings about certain hex/oct constants. Since those are
# issued by the parser, you can't suppress them by adding a
# filterwarnings() call to this... | ajibawa-2023/Python-Code-Large/train/row_3817 | 600 | 923 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3817:ImportFrom_L11_C0", "label": "from test.support import run_unittest, check_syntax_error", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.0011, 0, 0.66, 0.0, 364, 0, 2, 0, 0, 364, 0, 0], "semantic": {"name": "test.support",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3817:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3817:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3817:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3817:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code... |
# coding: utf-8
print "BOM BOOM!"
| ajibawa-2023/Python-Code-Large/train/row_3818 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3818:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.5, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annot... | [] |
print "hi"
print "Like bad Windows newlines?"
| ajibawa-2023/Python-Code-Large/train/row_3819 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3819:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", ... | [] |
# This file is used to verify that 2to3 falls back to a slower, iterative pattern matching
# scheme in the event that the faster recursive system fails due to infinite recursion.
from ctypes import *
STRING = c_char_p
OSUnknownByteOrder = 0
UIT_PROMPT = 1
P_PGID = 2
P_PID = 1
UIT_ERROR = 5
UIT_INFO = 4
UIT_NONE = 0
P... | ajibawa-2023/Python-Code-Large/train/row_3820 | 697 | 2,669 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3820:ImportFrom_L3_C0", "label": "from ctypes import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0011, 0.0004, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["*"], "rhs_... | [] |
def parrot():
pass
| ajibawa-2023/Python-Code-Large/train/row_3821 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3821:FunctionDef_L1_C0", "label": "parrot", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.75, 1.0, 0, 0.66, 0.0, 862, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parrot", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
# This is empty so trying to fetch the fixer class gives an AttributeError
| ajibawa-2023/Python-Code-Large/train/row_3822 | 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"] | [] | [] |
from lib2to3.fixer_base import BaseFix
from lib2to3.fixer_util import Name
class FixParrot(BaseFix):
"""
Change functions named 'parrot' to 'cheese'.
"""
PATTERN = """funcdef < 'def' name='parrot' any* >"""
def transform(self, node, results):
name = results["name"]
name.replace(Na... | ajibawa-2023/Python-Code-Large/train/row_3823 | 8 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3823:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3823:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3823:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3823:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3823:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from lib2to3.fixer_base import BaseFix
class FixPreorder(BaseFix):
order = "pre"
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3824 | 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_3824:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3824:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3824:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3824:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3824:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixLast(BaseFix):
run_order = 10
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3825 | 5 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3825:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3825:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3825:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3825:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3825:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixFirst(BaseFix):
run_order = 1
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3826 | 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_3826:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3826:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3826:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3826:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3826:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
| ajibawa-2023/Python-Code-Large/train/row_3827 | 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_3827:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3827:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3827:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3827:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3827:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixBadOrder(BaseFix):
order = "crazy"
| ajibawa-2023/Python-Code-Large/train/row_3828 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3828:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3828:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3828:Assign_L5_C4"}] |
#!/usr/bin/env python3
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Main program for testing the infrastructure."""
__author__ = "Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
from . import support
# Python imports
import... | ajibawa-2023/Python-Code-Large/train/row_3829 | 59 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3829:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0543, 0.0109, 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_3829:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3829:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3829:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3829:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
"""Support code for test_*.py files"""
# Author: Collin Winter
# Python imports
import unittest
import sys
import os
import os.path
import re
from textwrap import dedent
# Local imports
from lib2to3 import pytree, refactor
from lib2to3.pgen2 import driver
test_dir = os.path.dirname(__file__)
proj_dir = os.path.normp... | ajibawa-2023/Python-Code-Large/train/row_3830 | 35 | 54 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3830:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0185, 0.0185, 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_3830:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3830:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3830:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3830:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/env python3
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Main program for testing the infrastructure."""
__author__ = "Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
from . import support
# Python imports
import... | ajibawa-2023/Python-Code-Large/train/row_3831 | 59 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3831:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0543, 0.0109, 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_3831:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3831:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3831:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3831:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
"""Make tests/ into a package. This allows us to "import tests" and
have tests.all_tests be a TestSuite representing all test cases
from all test_*.py files in tests/."""
# Author: Collin Winter
import os
import os.path
import unittest
import types
from . import support
all_tests = unittest.TestSuite()
tests_dir = ... | ajibawa-2023/Python-Code-Large/train/row_3832 | 14 | 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_3832:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.125, 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_3832:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3832:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3832:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3832:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_383... |
#empty
| ajibawa-2023/Python-Code-Large/train/row_3833 | 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"] | [] | [] |
from __future__ import with_statement
from flask import Flask, request, session, g, redirect, url_for, abort, jsonify
import sqlite3
from contextlib import closing
import os
#config
DATABASE = './data/notel.db'
DEBUG = True
SECRET_KEY = 'notel_dev'
app = Flask(__name__)
app.config.from_object(__name__)
app.config.fro... | ajibawa-2023/Python-Code-Large/train/row_3834 | 47 | 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_3834:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0115, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3834:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3834:Expr_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3834:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3834:Expr_L23_C3"}, {"f": "ajibawa-2023/Python-Code-Large... |
import os
import sys
import warnings
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = os.path.join... | ajibawa-2023/Python-Code-Large/train/row_3835 | 70 | 97 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3835:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 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_3835:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3835:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3835:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3835:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3835:If... |
"""Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | ajibawa-2023/Python-Code-Large/train/row_3836 | 416 | 737 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3836:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 64], "level": 0, "parent": null, "vector": [8, 0, 0.0441, 0.0868, 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_3836:Try_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3836:Import_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3836:Try_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3836:Import_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_3837 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3837:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3837:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3837:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3837:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3837:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code... |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... | ajibawa-2023/Python-Code-Large/train/row_3838 | 94 | 191 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3838:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0209, 0.0052, 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_3838:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3838:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3838:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3838:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""Utility functions, node construction macros, etc."""
# Author: Collin Winter
# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp
###########################################################
### Common node-construction "macros"
##... | ajibawa-2023/Python-Code-Large/train/row_3839 | 253 | 420 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3839:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0024, 0.0024, 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_3839:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3839:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3839:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3839:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes buffer(...) into memoryview(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixBuffer(fixer_base.BaseFix):
#TODO Matt: Change this back after testing
... | ajibawa-2023/Python-Code-Large/train/row_3840 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3840:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1905, 0.0476, 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_3840:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3840:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3840:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3840:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
"""Fixer for it.next() -> next(it), per PEP 3114."""
# Author: Collin Winter
# Things that currently aren't covered:
# - listcomp "next" names aren't warned
# - "with" statement targets aren't checked
# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
f... | ajibawa-2023/Python-Code-Large/train/row_3841 | 59 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3841:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0098, 0.0098, 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_3841:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3841:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3841:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3841:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Dummy file to make this directory a package.
| ajibawa-2023/Python-Code-Large/train/row_3842 | 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"] | [] | [] |
# Copyright 2010 G. M. Bond. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
State machine based node matcher.
"""
EPSILON = 0 #Empty transition
TYPE = 1 #Transition based on type
STRING = 2 #Transition based on string matching
ANY = 3 #Transition matches any node
CLOSE = 4 #Transi... | ajibawa-2023/Python-Code-Large/train/row_3844 | 72 | 136 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3844:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0368, 0.0221, 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_3844:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3844:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3844:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3844:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
"""
__autho... | ajibawa-2023/Python-Code-Large/train/row_3846 | 541 | 1,087 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3846:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0069, 0.0074, 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_3846:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3846:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3846:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3846:ImportFrom_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
# coding: utf-8
print "BOM BOOM!"
| ajibawa-2023/Python-Code-Large/train/row_3848 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3848:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.5, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annot... | [] |
# This file is used to verify that 2to3 falls back to a slower, iterative pattern matching
# scheme in the event that the faster recursive system fails due to infinite recursion.
from ctypes import *
STRING = c_char_p
OSUnknownByteOrder = 0
UIT_PROMPT = 1
P_PGID = 2
P_PID = 1
UIT_ERROR = 5
UIT_INFO = 4
UIT_NONE = 0
P... | ajibawa-2023/Python-Code-Large/train/row_3849 | 697 | 2,669 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3849:ImportFrom_L3_C0", "label": "from ctypes import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0011, 0.0004, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["*"], "rhs_... | [] |
from lib2to3.fixer_base import BaseFix
from lib2to3.fixer_util import Name
class FixParrot(BaseFix):
"""
Change functions named 'parrot' to 'cheese'.
"""
PATTERN = """funcdef < 'def' name='parrot' any* >"""
def transform(self, node, results):
name = results["name"]
name.replace(Na... | ajibawa-2023/Python-Code-Large/train/row_3850 | 8 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3850:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3850:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3850:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3850:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3850:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from lib2to3.fixer_base import BaseFix
class FixLast(BaseFix):
run_order = 10
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3851 | 5 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3851:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3851:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3851:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3851:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3851:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixPreorder(BaseFix):
order = "pre"
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3852 | 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_3852:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3852:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3852:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3852:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3852:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixFirst(BaseFix):
run_order = 1
def match(self, node): return False
| ajibawa-2023/Python-Code-Large/train/row_3853 | 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_3853:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3853:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3853:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3853:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3853:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from lib2to3.fixer_base import BaseFix
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
| ajibawa-2023/Python-Code-Large/train/row_3854 | 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_3854:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3854:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3854:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3854:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3854:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
def parrot():
pass
| ajibawa-2023/Python-Code-Large/train/row_3855 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3855:FunctionDef_L1_C0", "label": "parrot", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.75, 1.0, 0, 0.66, 0.0, 862, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parrot", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
from lib2to3.fixer_base import BaseFix
class FixBadOrder(BaseFix):
order = "crazy"
| ajibawa-2023/Python-Code-Large/train/row_3856 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3856:ImportFrom_L1_C0", "label": "from lib2to3.fixer_base import BaseFix", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 67, 0, 1, 0, 0, 67, 0, 0], "semantic": {"name": "lib2to3.fixer_base", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3856:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3856:Assign_L5_C4"}] |
# This is empty so trying to fetch the fixer class gives an AttributeError
| ajibawa-2023/Python-Code-Large/train/row_3857 | 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
# -*- coding: utf-8 -*-
print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
def f(x):
print '%s\t-> α(%2i):%s β(%s)'
| ajibawa-2023/Python-Code-Large/train/row_3859 | 3 | 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_3859:Expr_L3_C0", "label": "print()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.1667, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3859:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3859:Expr_L6_C4"}] |
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
# NOTE: When you run this test as a script from the command line, you
# get warnings about certain hex/oct constants. Since those are
# issued by the parser, you can't suppress them by adding a
# filterwarnings() call to this... | ajibawa-2023/Python-Code-Large/train/row_3860 | 600 | 923 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3860:ImportFrom_L11_C0", "label": "from test.support import run_unittest, check_syntax_error", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.0011, 0, 0.66, 0.0, 364, 0, 2, 0, 0, 364, 0, 0], "semantic": {"name": "test.support",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3860:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3860:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3860:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3860:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code... |
print "hi"
print "Like bad Windows newlines?"
| ajibawa-2023/Python-Code-Large/train/row_3861 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3861:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", ... | [] |
"""Support code for test_*.py files"""
# Author: Collin Winter
# Python imports
import unittest
import sys
import os
import os.path
import re
from textwrap import dedent
# Local imports
from lib2to3 import pytree, refactor
from lib2to3.pgen2 import driver
test_dir = os.path.dirname(__file__)
proj_dir = os.path.normp... | ajibawa-2023/Python-Code-Large/train/row_3862 | 35 | 54 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3862:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0185, 0.0185, 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_3862:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3862:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3862:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3862:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""Make tests/ into a package. This allows us to "import tests" and
have tests.all_tests be a TestSuite representing all test cases
from all test_*.py files in tests/."""
# Author: Collin Winter
import os
import os.path
import unittest
import types
from . import support
all_tests = unittest.TestSuite()
tests_dir = ... | ajibawa-2023/Python-Code-Large/train/row_3863 | 14 | 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_3863:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.125, 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_3863:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3863:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3863:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3863:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_386... |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
from . import grammar, token, tokenize
class PgenGrammar(grammar.Grammar):
pass
class ParserGenerator(object):
def __init__(self, filename, stream=None):
close_stream =... | ajibawa-2023/Python-Code-Large/train/row_3864 | 274 | 386 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3864:ImportFrom_L5_C0", "label": "from import grammar, token, tokenize", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.0026, 0, 0.66, 0.0, 0, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": ["gram... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3864:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3864:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3864:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3864:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code... |
#! /usr/bin/env python
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
C... | ajibawa-2023/Python-Code-Large/train/row_3866 | 69 | 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_3866:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0366, 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_3866:For_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3866:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3866:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3866:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3866:F... |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Safely evaluate Python string literals without using eval()."""
import re
simple_escapes = {"a": "\a",
"b": "\b",
"f": "\f",
"n": "\n",
... | ajibawa-2023/Python-Code-Large/train/row_3867 | 31 | 60 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3867:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0167, 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_3867:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3867:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3867:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3867:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""The pgen2 package."""
| ajibawa-2023/Python-Code-Large/train/row_3869 | 1 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3869:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.25, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ... | [] |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | ajibawa-2023/Python-Code-Large/train/row_3871 | 55 | 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_3871:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0462, 0.0543, 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_3871:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3871:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3871:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3871:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Export the Python grammar and symbols."""
# Python imports
import os
# Local imports
from .pgen2 import token
from .pgen2 import driver
from . import pytree
# The grammar file
_GRAMMAR_FILE = os.path.join(os.path.... | ajibawa-2023/Python-Code-Large/train/row_3873 | 14 | 35 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3873:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1143, 0.0286, 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_3873:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3873:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3873:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3873:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
#empty
| ajibawa-2023/Python-Code-Large/train/row_3874 | 0 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
#!/usr/bin/env python
import sys
from lib2to3.main import main
sys.exit(main("lib2to3.fixes"))
| ajibawa-2023/Python-Code-Large/train/row_3875 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3875:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.4, 0.2, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "... | [] |
#!/usr/bin/env python2.5
"""
This is a benchmarking script to test the speed of 2to3's pattern matching
system. It's equivalent to "refactor.py -f all" for every Python module
in sys.modules, but without engaging the actual transformations.
"""
__author__ = "Collin Winter <collinw at gmail.com>"
# Python imports
impo... | ajibawa-2023/Python-Code-Large/train/row_3876 | 31 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3876:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.069, 0.0862, 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_3876:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3876:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3876:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3876:For_L26_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
#!/usr/bin/env python
"""Script that makes determining PATTERN for a new fix much easier.
Figuring out exactly what PATTERN I want for a given fixer class is
getting tedious. This script will step through each possible subtree
for a given string, allowing you to select which one you want. It will
then try to figure o... | ajibawa-2023/Python-Code-Large/train/row_3877 | 38 | 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_3877:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 40], "level": 0, "parent": null, "vector": [8, 0, 0.224, 0.3958, 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_3877:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3877:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3877:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3877:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Copyright 2010 G. M. Bond. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
__author__ = "G. Matthew Bond <gmattbond+python@gmail.com>"
import sys
import gvgen
from . import graph
class GvGraph(graph.Graph):
"""This is an implementation of the Graph class using GvGen."""
def __init__... | ajibawa-2023/Python-Code-Large/train/row_3878 | 18 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3878:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0357, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3878:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3878:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3878:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3878:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
"""Main test file for 2to3.
Running "python test.py" will run all tests in tests/test_*.py.
"""
# Author: Collin Winter
import unittest
from lib2to3 import tests
import lib2to3.tests.support
from sys import exit, argv
if "-h" in argv or "--help" in argv or len(argv) > 2:
print "Usage: %s [... | ajibawa-2023/Python-Code-Large/train/row_3879 | 24 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3879:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1098, 0.0976, 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_3879:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3879:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3879:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3879:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3879:If... |
#!/usr/bin/python
def buffer_examples():
x = buffer(y)
| ajibawa-2023/Python-Code-Large/train/row_3881 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3881:FunctionDef_L3_C0", "label": "buffer_examples", "type": "function", "loc": [3, 4], "level": 0, "parent": null, "vector": [2, 0, 0.875, 0.5, 0, 0.66, 0.0, 356, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "buffer_examples", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3881:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3881:Assign_L4_C4"}] |
#!/usr/bin/env python
# Copyright 2010 G. M. Bond. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
#Python imports
import sys
import re
import graph
#import lib2to3.pytree as pytree
#For testing, let's just import one fixer by hand. Later this should take
# a list of fixers on the command lin... | ajibawa-2023/Python-Code-Large/train/row_3882 | 40 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3882:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0609, 0.0087, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3882:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3882:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3882:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3882:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Copyright 2010 G. M. Bond. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
__author__ = "G. Matthew Bond <gmattbond+python@gmail.com>"
import sys
class Graph(object):
"""
Base class for adapting graphviz dot libraries for use in lib2to3.
This class provides the interface tha... | ajibawa-2023/Python-Code-Large/train/row_3883 | 10 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3883:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.0312, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3883:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3883:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3883:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3883:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
#!/usr/bin/python
# Copyright (C) 2007-2009 Mihai Preda.
#
# 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... | ajibawa-2023/Python-Code-Large/train/row_3884 | 30 | 143 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3884:Assign_L17_C0", "label": "bytecodesStr =", "type": "assigned_variable", "loc": [17, 61], "level": 0, "parent": null, "vector": [14, 0, 0.2727, 0.3147, 0, 0.66, 0.0, 680, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "bytecodesStr", "arg_names": [], "import_names": [],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3884:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3884:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3884:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3884:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Co... |
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | ajibawa-2023/Python-Code-Large/train/row_3885 | 49 | 121 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3885:Expr_L14_C0", "label": "expression", "type": "expression", "loc": [14, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1364, 0.0496, 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_3885:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3885:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3885:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3885:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_388... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | ajibawa-2023/Python-Code-Large/train/row_3886 | 63 | 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_3886:Import_L5_C0", "label": "logging import logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0118, 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_3886:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3886:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3886:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3886:FunctionDef_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | ajibawa-2023/Python-Code-Large/train/row_3887 | 20 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3887:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 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_3887:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3887:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3887:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3887:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_38... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | ajibawa-2023/Python-Code-Large/train/row_3888 | 50 | 111 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3888:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0631, 0.0991, 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_3888:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3888:Return_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3888:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3888:Assign_L57_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | ajibawa-2023/Python-Code-Large/train/row_3889 | 42 | 149 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3889:Import_L3_C0", "label": "datetime import datetime", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0201, 0.0067, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3889:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3889:Assign_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3889:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3889:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | ajibawa-2023/Python-Code-Large/train/row_3890 | 44 | 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_3890:Import_L3_C0", "label": "logging import logging", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0088, 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_3890:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3890:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3890:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3890:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
#
# Copyright (c) 2005 Niels Provos <provos@citi.umich.edu>
# All rights reserved.
#
# Generates marshaling code based on libevent.
import sys
import re
#
_NAME = "event_rpcgen.py"
_VERSION = "0.1"
_STRUCT_RE = '[a-z][a-z_0-9]*'
# Globals
line_count = 0
white = re.compile(r'^\s+')
cppcomment =... | ajibawa-2023/Python-Code-Large/train/row_3891 | 608 | 1,423 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3891:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0007, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3891:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3891:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3891:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3891:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
#
# Copyright (c) 2005 Niels Provos <provos@citi.umich.edu>
# All rights reserved.
#
# Generates marshaling code based on libevent.
import sys
import re
#
_NAME = "event_rpcgen.py"
_VERSION = "0.1"
_STRUCT_RE = '[a-z][a-z_0-9]*'
# Globals
line_count = 0
white = re.compile(r'^\s+')
cppcomment =... | ajibawa-2023/Python-Code-Large/train/row_3892 | 608 | 1,423 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3892:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0007, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3892:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3892:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3892:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3892:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code... |
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| ajibawa-2023/Python-Code-Large/train/row_3893 | 4 | 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_3893:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3893:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3893:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3893:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3893:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_389... |
# -*- coding: utf-8 -*-
__author__ = """RedTurtle Technology"""
__docformat__ = 'plaintext'
import string
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import getFSVersionTuple
from StringIO import StringIO
from Products.PloneboardNotify import config
def install(self, re... | ajibawa-2023/Python-Code-Large/train/row_3895 | 22 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3895:Assign_L3_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0882, 0.0294, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3895:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3895:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3895:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3895:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: utf-8 -*-
from Products.Five.browser import BrowserView
# from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile # Plone 2.5 compatibility
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard... | ajibawa-2023/Python-Code-Large/train/row_3896 | 45 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3896:ImportFrom_L3_C0", "label": "from Products.Five.browser import BrowserView", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0448, 0.0149, 0, 0.66, 0.0, 595, 0, 1, 0, 0, 595, 0, 0], "semantic": {"name": "Products.Five.browser", "arg_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3896:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3896:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3896:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3896:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# -*- coding: utf-8 -*-
import zope.interface
from Products.Five.browser import BrowserView
# from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile # Plone 2.5 compatibility
from Products.CMFCore.utils import getToolByName
f... | ajibawa-2023/Python-Code-Large/train/row_3897 | 49 | 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_3897:Import_L3_C0", "label": "zope.interface import zope.interface", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0141, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3897:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3897:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3897:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3897:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from zope.interface import Interface
class ILocalBoardNotify(Interface):
"""
Marker interface for Ploneboard objects that use local notification parameters
"""
| ajibawa-2023/Python-Code-Large/train/row_3898 | 3 | 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_3898:ImportFrom_L1_C0", "label": "from zope.interface import Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3898:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3898:Expr_L4_C4"}] |
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
| ajibawa-2023/Python-Code-Large/train/row_3899 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3899:FunctionDef_L2_C0", "label": "initialize", "type": "function", "loc": [2, 3], "level": 0, "parent": null, "vector": [2, 0, 0.8333, 0.6667, 0, 0.66, 0.0, 393, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "initialize", "arg_names": ["context"], "import_names": [], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3899:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3899:Expr_L3_C4"}] |
PROJECTNAME = "PloneboardNotify" | ajibawa-2023/Python-Code-Large/train/row_3900 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3900:Assign_L1_C0", "label": "PROJECTNAME =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 239, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PROJECTNAME", "arg_names": [], "import_names": [], "rhs_call_... | [] |
from setuptools import setup, find_packages
import os
version = '0.3.0'
setup(name='Products.PloneboardNotify',
version=version,
description="A configurable product that rely on Zope 3 events, for sending emails when new message is added on Ploneboard forum",
long_description=open("README.txt").read... | ajibawa-2023/Python-Code-Large/train/row_3901 | 4 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3901:ImportFrom_L1_C0", "label": "from setuptools import setup, find_packages", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "setuptools", "arg_names": [], "... | [] |
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| ajibawa-2023/Python-Code-Large/train/row_3902 | 4 | 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_3902:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3902:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3902:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3902:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3902:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_390... |
from Acquisition import Explicit
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.interface import implements
from zope.viewlet.interfaces import IViewlet
from zope impor... | ajibawa-2023/Python-Code-Large/train/row_3903 | 212 | 414 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3903:ImportFrom_L1_C0", "label": "from Acquisition import Explicit", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0024, 0.0024, 0, 0.66, 0.0, 62, 0, 1, 0, 0, 62, 0, 0], "semantic": {"name": "Acquisition", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3903:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3903:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3903:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3903:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from Acquisition import aq_inner
from DateTime import DateTime
from kss.core import kssaction, KSSView
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent
from Products.CMFCore.utils import getToolByName
from zope.i18n import translate
from plonehrm.contracts import ContractsMess... | ajibawa-2023/Python-Code-Large/train/row_3904 | 243 | 468 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3904:ImportFrom_L1_C0", "label": "from Acquisition import aq_inner", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 0, 0.66, 0.0, 62, 0, 1, 0, 0, 62, 0, 0], "semantic": {"name": "Acquisition", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3904:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3904:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3904:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3904:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from zope.interface import Interface
class IContractView(Interface):
"""Provide a view for an Employee specifically for Contracts.
"""
def current_contract():
"""Return a link to the contract"""
def expires():
"""Return the expiration date of the current contract."""
def trial_p... | ajibawa-2023/Python-Code-Large/train/row_3905 | 26 | 46 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3905:ImportFrom_L1_C0", "label": "from zope.interface import Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3905:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3905:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3905:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3905:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
# python package
| ajibawa-2023/Python-Code-Large/train/row_3906 | 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"] | [] | [] |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Acquisition import aq_chain, aq_inner
from DateTime import DateTime
from Products.Archetypes.utils import IntDisplayList
from Products.Archetypes.interfaces import IBaseContent
fr... | ajibawa-2023/Python-Code-Large/train/row_3907 | 218 | 465 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3907:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0022, 0.0022, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3907:ClassDef_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3907:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3907:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3907:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-... |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from Acquisition import aq_parent, aq_chain
from Products.Archetypes.atapi import registerType
from zope import component
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Products.Archetypes... | ajibawa-2023/Python-Code-Large/train/row_3908 | 33 | 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_3908:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3908:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3908:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3908:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3908:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
# # Classes
import contract
import letter
| ajibawa-2023/Python-Code-Large/train/row_3909 | 4 | 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_3909:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [] |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Acquisition import aq_inner, aq_parent
from Products.Archetypes.atapi import BaseFolder
from Products.Archetypes.atapi import BaseFolderSchema
from Products.Archetypes.atapi impor... | ajibawa-2023/Python-Code-Large/train/row_3910 | 54 | 131 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3910:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3910:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3910:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3910:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3910:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Products.CMFCore.utils import getToolByName
def setup(context):
# This is the main method that gets called by genericsetup.
if context.readDataFile('plonehrm.contracts.txt') is None:
return
site = context.getSite()
logger = context.getLogger('plonehrm')
add_currency_property(site, log... | ajibawa-2023/Python-Code-Large/train/row_3911 | 16 | 31 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3911:ImportFrom_L1_C0", "label": "from Products.CMFCore.utils import getToolByName", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 287, 0, 1, 0, 0, 287, 0, 0], "semantic": {"name": "Products.CMFCore.utils", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3911:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3911:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3911:If_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3911:Return_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_39... |
from zope.interface import Interface
class IContract(Interface):
def getId():
""" """
def setId():
""" """
def Title():
""" """
def Description():
""" """
def setDescription():
""" """
def getWage():
"""return the current wage"""
def s... | ajibawa-2023/Python-Code-Large/train/row_3912 | 44 | 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_3912:ImportFrom_L1_C0", "label": "from zope.interface import Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3912:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3912:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3912:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3912:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
import logging
from DateTime import DateTime
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
from Products.CMFCore.utils import getToolByName
from Acquisition import aq_parent
from Products.plonehrm import utils
from Products.plonehrm.controlpanel import IHRMNotificationsPanelSchema
from pl... | ajibawa-2023/Python-Code-Large/train/row_3913 | 77 | 125 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3913:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.008, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3913:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3913:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3913:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3913:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from plonehrm.notifications.interfaces import IHRMModuleEvent
from plonehrm.notifications.interfaces import IHRMEmailer
class IContractEvent(IHRMModuleEvent):
pass
class IContractEmailer(IHRMEmailer):
pass
| ajibawa-2023/Python-Code-Large/train/row_3914 | 4 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3914:ImportFrom_L1_C0", "label": "from plonehrm.notifications.interfaces import IHRMModuleEvent", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 835, 0, 1, 0, 0, 835, 0, 0], "semantic": {"name": "plonehrm.notificati... | [] |
try:
import zope.annotation
except ImportError:
# BBB for Zope 2.9
import zope.app.annotation
import zope.app.annotation.interfaces
import sys
sys.modules['zope.annotation'] = zope.app.annotation
sys.modules['zope.annotation.interfaces'] = zope.app.annotation.interfaces
| ajibawa-2023/Python-Code-Large/train/row_3915 | 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_3915:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 9], "level": 0, "parent": null, "vector": [7, 0, 0.5556, 1.0, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3915:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3915:Import_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3915:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3915:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3915:... |
from zope.i18n import translate
from zope.interface import implements
from zope.component.interfaces import ObjectEvent
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName
from plonehrm.contracts import ContractsMessageFactory as _
from plonehrm.contracts.notifications.interfaces import ... | ajibawa-2023/Python-Code-Large/train/row_3916 | 46 | 80 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3916:ImportFrom_L1_C0", "label": "from zope.i18n import translate", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0125, 0, 0.66, 0.0, 500, 0, 1, 0, 0, 500, 0, 0], "semantic": {"name": "zope.i18n", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3916:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3916:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3916:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3916:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from Products.PloneTestCase import PloneTestCase as ptc
from Products.plonehrm.tests.base import PlonehrmLayer
ptc.setupPloneSite()
class BaseTestCase(ptc.PloneTestCase):
layer = PlonehrmLayer
| ajibawa-2023/Python-Code-Large/train/row_3917 | 5 | 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_3917:ImportFrom_L1_C0", "label": "from Products.PloneTestCase import ptc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 104, 0, 1, 0, 0, 104, 0, 0], "semantic": {"name": "Products.PloneTestCase", "arg_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3917:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3917:Assign_L9_C4"}] |
# -*- coding: utf-8 -*-
#
# File: tests.py
#
# Copyright (c) 2007 by []
# Generator: ArchGenXML Version 1.6.0-beta-svn
# http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General P... | ajibawa-2023/Python-Code-Large/train/row_3918 | 2 | 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_3918:Assign_L27_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.9643, 0.0357, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rh... | [] |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
import logging
from zope.i18nmessageid import MessageFactory
from Products.Archetypes import listTypes
from Products.Archetypes.atapi import process_types
from Products.CMFCore import utils as cmfutils
from Products.validation.... | ajibawa-2023/Python-Code-Large/train/row_3919 | 22 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3919:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.025, 0.025, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3919:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3919:ImportFrom_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3919:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3919:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.