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
""" Wrapper for loading templates from the filesystem. """ from django.conf import settings from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils._os import safe_join class Loader(BaseLoader): is_usable = True def get_template_sources(self, temp...
ajibawa-2023/Python-Code-Large/train/row_86692
28
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86692:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0392, 0.0588, 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_86692:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86692:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86692:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86692:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django.http import HttpResponse from django.template import loader, Context, RequestContext class ContentNotRenderedError(Exception): pass class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] def __init__(self, template, context=...
ajibawa-2023/Python-Code-Large/train/row_86694
75
158
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86694:ImportFrom_L1_C0", "label": "from django.http import HttpResponse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [], "impor...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86694:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86694:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86694:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86694:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
ajibawa-2023/Python-Code-Large/train/row_86696
7
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_86696:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 50], "level": 0, "parent": null, "vector": [8, 0, 0.3187, 0.625, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
from django.conf import settings from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\ token_kwargs, Variable from django.template.loader import get_template from django.utils.safestring import mark_safe register = Library() BLOCK_CONTEXT_KEY = 'block_context' class ExtendsError(Excepti...
ajibawa-2023/Python-Code-Large/train/row_86701
161
264
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86701:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0038, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86701:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86701:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86701:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86701:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-...
""" Extra HTML Widget classes """ import datetime import re from django.forms.widgets import Widget, Select from django.utils import datetime_safe from django.utils.dates import MONTHS from django.utils.safestring import mark_safe from django.utils.formats import get_format from django.conf import settings __all__ =...
ajibawa-2023/Python-Code-Large/train/row_86703
107
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_86703:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.014, 0.021, 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_86703:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86703:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86703:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86703:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co...
from __future__ import absolute_import from django.forms.extras.widgets import *
ajibawa-2023/Python-Code-Large/train/row_86704
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_86704:ImportFrom_L1_C0", "label": "from __future__ import absolute_import", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impo...
[]
""" HTML Widget classes """ from __future__ import absolute_import import copy import datetime from itertools import chain from urlparse import urljoin from django.conf import settings from django.forms.util import flatatt, to_current_timezone from django.utils.datastructures import MultiValueDict, MergeDict from dj...
ajibawa-2023/Python-Code-Large/train/row_86708
577
901
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86708:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0022, 0.0033, 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_86708:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86708:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86708:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86708:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code...
""" Django validation and HTML form handling. TODO: Default value for field Field labels Nestable Forms FatalValidationError -- short-circuits all other validators on a form ValidationWarning "This form field requires foo.js" and form.js_includes() """ from __future__ import absolute_import f...
ajibawa-2023/Python-Code-Large/train/row_86709
7
19
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86709:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.3158, 0.5789, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
VERSION = (1, 4, 3, 'final', 0) def get_version(version=None): """Derives a PEP386-compliant version number from VERSION.""" if version is None: version = VERSION assert len(version) == 5 assert version[3] in ('alpha', 'beta', 'rc', 'final') # Now build the two parts of the version number:...
ajibawa-2023/Python-Code-Large/train/row_86711
17
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86711:Assign_L1_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 557, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "VERSION", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86711:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86711:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86711:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86711:If_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.dispatch import Signal class_prepared = Signal(providing_args=["class"]) pre_init = Signal(providing_args=["instance", "args", "kwargs"]) post_init = Signal(providing_args=["instance"]) pre_save = Signal(providing_args=["instance", "raw", "using"]) post_save = Signal(providing_args=["instance", "raw", "c...
ajibawa-2023/Python-Code-Large/train/row_86713
10
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86713:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "imp...
[]
from functools import wraps from operator import attrgetter from django.db import connections, transaction, IntegrityError from django.db.models import signals, sql from django.utils.datastructures import SortedDict class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.pr...
ajibawa-2023/Python-Code-Large/train/row_86714
147
279
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86714:ImportFrom_L1_C0", "label": "from functools import wraps", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0036, 0.0036, 0, 0.66, 0.0, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86714:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86714:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86714:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86714:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C...
import datetime from django.utils import tree class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % operator - it is quoted # because it can be u...
ajibawa-2023/Python-Code-Large/train/row_86715
79
152
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86715:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86715:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86715:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86715:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86715:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from itertools import izip from django.core.exceptions import FieldError from django.db import transaction from django.db.backends.util import truncate_name from django.db.models.query_utils import select_related_descend from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Empty...
ajibawa-2023/Python-Code-Large/train/row_86717
652
1,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_86717:ImportFrom_L1_C0", "label": "from itertools import izip", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0009, 0.0009, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86717:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86717:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86717:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86717:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-...
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db.models.fields import DateField, FieldDoesNotExist from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models...
ajibawa-2023/Python-Code-Large/train/row_86718
120
224
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86718:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0089, 0.0134, 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_86718:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86718:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86718:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86718:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.core.exceptions import FieldError from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True): self.expression = expression self.opts = query.get_meta() ...
ajibawa-2023/Python-Code-Large/train/row_86719
58
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_86719:ImportFrom_L1_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 0, 0.66, 0.0, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "ar...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86719:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86719:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86719:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86719:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code...
import re # Valid query types (a dictionary is used for speedy lookups). QUERY_TERMS = dict([(x, None) for x in ( 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', 'month', 'day', 'week_day', 'isnull', 'search'...
ajibawa-2023/Python-Code-Large/train/row_86720
15
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86720:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", ...
[]
""" Classes to represent the default SQL aggregate functions """ from django.db.models.fields import IntegerField, FloatField # Fake fields used to identify aggregate types in data-conversion operations. ordinal_aggregate_field = IntegerField() computed_aggregate_field = FloatField() class Aggregate(object): """...
ajibawa-2023/Python-Code-Large/train/row_86721
61
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_86721:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0165, 0.0248, 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_86721:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86721:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86721:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86721:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Code to manage the creation and SQL rendering of 'where' constraints. """ from __future__ import absolute_import import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.sql.datastructures import EmptyResultSet, FullResultSet from ...
ajibawa-2023/Python-Code-Large/train/row_86722
194
349
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86722:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0057, 0.0086, 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_86722:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86722:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86722:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86722:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from __future__ import absolute_import from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.subqueries import * from django.db.models.sql.query import * from django.db.models.sql.where import AND, OR __all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']
ajibawa-2023/Python-Code-Large/train/row_86723
6
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_86723:ImportFrom_L1_C0", "label": "from __future__ import absolute_import", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impo...
[]
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class FullResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was att...
ajibawa-2023/Python-Code-Large/train/row_86724
25
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_86724:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0543, 0.087, 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_86724:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86724:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86724:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86724:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
import datetime import os from django import forms from django.db.models.fields import Field from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils.encoding import force_unicode,...
ajibawa-2023/Python-Code-Large/train/row_86725
201
394
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86725:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0025, 0.0025, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86725:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86725:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86725:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86725:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Co...
""" Field-like classes that aren't really fields. It's easier to use objects that have the same attributes as fields sometimes (avoids a lot of special casing). """ from django.db.models import fields class OrderWrt(fields.IntegerField): """ A proxy for the _order database field that is used when Meta.ord...
ajibawa-2023/Python-Code-Large/train/row_86726
8
17
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86726:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1471, 0.2353, 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_86726:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86726:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86726:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86726:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from operator import attrgetter from django.db import connection, router from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from django.db.models...
ajibawa-2023/Python-Code-Large/train/row_86727
676
1,294
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86727:ImportFrom_L1_C0", "label": "from operator import attrgetter", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0008, 0.0008, 0, 0.66, 0.0, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86727:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86727:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86727:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86727:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the __metaclass__ for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ class SubfieldBase(type): """ A metacl...
ajibawa-2023/Python-Code-Large/train/row_86728
24
52
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86728:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.1346, 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_86728:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86728:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86728:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86728:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-La...
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule im...
ajibawa-2023/Python-Code-Large/train/row_86730
120
252
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86730:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.004, 0.004, 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_86730:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86730:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86730:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86730:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
ajibawa-2023/Python-Code-Large/train/row_86731
29
67
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86731:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0448, 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_86731:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86731:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86731:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86731:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import re from bisect import bisect from django.conf import settings from django.db.models.related import RelatedObject from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy import OrderWrt from django.db.models.loa...
ajibawa-2023/Python-Code-Large/train/row_86732
311
517
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86732:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86732:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86732:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86732:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86732:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-...
from django.utils.encoding import smart_unicode from django.db.models.fields import BLANK_CHOICE_DASH class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def templ...
ajibawa-2023/Python-Code-Large/train/row_86734
42
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_86734:ImportFrom_L1_C0", "label": "from django.utils.encoding import smart_unicode", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 96, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86734:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86734:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86734:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86734:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code...
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db import connection from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models from django.db.models.query import Q from django.db.models.expressions import F fro...
ajibawa-2023/Python-Code-Large/train/row_86735
24
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_86735:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0278, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86735:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86735:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86735:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86735:ImportFrom_L31_C4"}, {"f": "ajibawa-2023/Python-...
import copy from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, **kwargs): """ Ensures that a Model subclass contains a d...
ajibawa-2023/Python-Code-Large/train/row_86736
136
224
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86736:Import_L1_C0", "label": "copy import copy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0045, 0.0045, 0, 0.66, 0.0, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86736:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86736:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86736:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86736:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-La...
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import weakref from django.db.backends import util from django.utils impo...
ajibawa-2023/Python-Code-Large/train/row_86737
83
169
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86737:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0237, 0.0414, 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_86737:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86737:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86737:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86737:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
ajibawa-2023/Python-Code-Large/train/row_86739
148
290
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86739:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0241, 0.0448, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86739:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86739:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86739:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86739:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: '...
ajibawa-2023/Python-Code-Large/train/row_86740
28
94
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86740:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0106, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backend...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86740:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86740:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86740:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86740:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'psql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] if settings_dict['USER']: args += ["-U"...
ajibawa-2023/Python-Code-Large/train/row_86741
16
23
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86741:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 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_86741:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86741:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86741:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86741:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.db.backends import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functio...
ajibawa-2023/Python-Code-Large/train/row_86742
100
201
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86742:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseOperations", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.005, 0.005, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86742:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86742:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86742:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86742:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-L...
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
ajibawa-2023/Python-Code-Large/train/row_86743
35
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_86743:Import_L1_C0", "label": "psycopg2.extensions import psycopg2.extensions", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0115, 0, 0.66, 0.0, 928, 0, 1, 0, 0, 928, 0, 0], "semantic": {"name": "psycopg2.extensions", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86743:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86743:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86743:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86743:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL 8.3.6 # EnterpriseDB 8.3 # PostgreSQL 8.3 beta4 # PostgreSQL 8.4beta1 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
ajibawa-2023/Python-Code-Large/train/row_86744
16
43
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86744:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0465, 0.0698, 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_86744:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86744:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86744:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86744:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code...
from django.db.backends import BaseDatabaseIntrospection from MySQLdb import ProgrammingError, OperationalError from MySQLdb.constants import FIELD_TYPE import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseI...
ajibawa-2023/Python-Code-Large/train/row_86746
56
112
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86746:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0089, 0.0089, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backend...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86746:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86746:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86746:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86746:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-L...
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): values = [] index_extra_select = len(self.query.extra_select.keys()) for value, field in map(None, row[index_extra_select:], fields): if (field and field...
ajibawa-2023/Python-Code-Large/train/row_86747
15
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_86747:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "django.db.models.sql", "arg_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86747:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86747:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86747:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86747:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code...
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_d...
ajibawa-2023/Python-Code-Large/train/row_86748
24
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_86748:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 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_86748:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86748:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86748:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86748:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict_...
ajibawa-2023/Python-Code-Large/train/row_86749
20
66
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86749:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0152, 0, 0.66, 0.0, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "django.db.bac...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86749:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86749:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86749:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86749:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-L...
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in...
ajibawa-2023/Python-Code-Large/train/row_86750
15
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86750:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseValidation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86750:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86750:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86750:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86750:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from django.dispatch import Signal connection_created = Signal(providing_args=["connection"])
ajibawa-2023/Python-Code-Large/train/row_86752
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_86752:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "imp...
[]
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
ajibawa-2023/Python-Code-Large/train/row_86753
41
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_86753:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0652, 0.1159, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86753:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86753:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86753:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86753:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import datetime import decimal import hashlib from time import time from django.conf import settings from django.utils.log import getLogger from django.utils.timezone import utc logger = getLogger('django.db.backends') class CursorWrapper(object): def __init__(self, cursor, db): self.cursor = cursor ...
ajibawa-2023/Python-Code-Large/train/row_86755
97
151
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86755:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86755:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86755:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86755:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86755:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-...
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict(object): # Maps SQL types t...
ajibawa-2023/Python-Code-Large/train/row_86756
86
182
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86756:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86756:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86756:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86756:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86756:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-...
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlite3' def runshell(self): args = [self.executable_name, self.connection.settings_dict['NAME']] if os.name == 'nt': sys.exit(os.sys...
ajibawa-2023/Python-Code-Large/train/row_86757
10
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86757:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_86757:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86757:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86757:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86757:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.db.utils import DatabaseError try: import thread except ImportError: import dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.db.transaction import TransactionManageme...
ajibawa-2023/Python-Code-Large/train/row_86760
474
1,018
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86760:ImportFrom_L1_C0", "label": "from django.db.utils import DatabaseError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.001, 0.001, 0, 0.66, 0.0, 495, 0, 1, 0, 0, 495, 0, 0], "semantic": {"name": "django.db.utils", "arg_names": [],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86760:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86760:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86760:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86760:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
from django.db.backends import BaseDatabaseIntrospection import cx_Oracle import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_re...
ajibawa-2023/Python-Code-Large/train/row_86761
49
122
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86761:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0082, 0.0082, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backend...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86761:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86761:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86761:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86761:Try_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If this query has limit/offset information, then we expect the # first column to be an extra "_RN" column that we need to throw # away. if self.query.high...
ajibawa-2023/Python-Code-Large/train/row_86762
29
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86762:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "django.db.models.sql", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86762:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86762:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86762:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86762:If_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlplus' def runshell(self): conn_string = self.connection._connect_string() args = [self.executable_name, "-L", conn_string] if os.name == 'nt': ...
ajibawa-2023/Python-Code-Large/train/row_86763
11
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86763:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_86763:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86763:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86763:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86763:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured from django.db.utils import (ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, DatabaseError, IntegrityError) __all__ = ('backend', 'connection', 'connections', 'router', 'Dat...
ajibawa-2023/Python-Code-Large/train/row_86766
30
65
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86766:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86766:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86766:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86766:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86766:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-...
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases...
ajibawa-2023/Python-Code-Large/train/row_86768
189
385
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86768:Import_L1_C0", "label": "unittest import real_unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0026, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["real...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86768:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86768:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86768:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86768:Import_L23_C8"}, {"f": "ajibawa-2023/Python-...
from django.conf import settings from django.db import connections from django.dispatch import Signal template_rendered = Signal(providing_args=["template", "context"]) setting_changed = Signal(providing_args=["setting", "value"]) def update_connections_time_zone(**kwargs): if kwargs['setting'] == 'USE_TZ' and s...
ajibawa-2023/Python-Code-Large/train/row_86771
17
23
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86771:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86771:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86771:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86771:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86771:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train...
from __future__ import with_statement import warnings from django.conf import settings, UserSettingsHolder from django.core import mail from django.test.signals import template_rendered, setting_changed from django.template import Template, loader, TemplateDoesNotExist from django.template.loaders import cached from d...
ajibawa-2023/Python-Code-Large/train/row_86772
122
223
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86772:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0045, 0.0045, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86772:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86772:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86772:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86772:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-...
""" Comparing two html documents. """ import re from HTMLParser import HTMLParseError from django.utils.encoding import force_unicode from django.utils.html_parser import HTMLParser WHITESPACE = re.compile('\s+') def normalize_whitespace(string): return WHITESPACE.sub(' ', string) class Element(object): d...
ajibawa-2023/Python-Code-Large/train/row_86773
152
221
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86773:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.009, 0.0136, 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_86773:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86773:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86773:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86773:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-...
""" Django Unit Test and Doctest framework. """ from django.test.client import Client, RequestFactory from django.test.testcases import (TestCase, TransactionTestCase, SimpleTestCase, LiveServerTestCase, skipIfDBFeature, skipUnlessDBFeature) from django.test.utils import Approximate
ajibawa-2023/Python-Code-Large/train/row_86774
4
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_86774:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.3333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
ajibawa-2023/Python-Code-Large/train/row_86775
54
86
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86775:ClassDef_L4_C0", "label": "Event", "type": "class", "loc": [4, 13], "level": 0, "parent": null, "vector": [3, 0, 0.0988, 0.1163, 0, 0.66, 0.0, 9, 0, 2, 0, 0, 186, 0, 3], "semantic": {"name": "Event", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86775:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86775:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86775:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86775:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code...
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] class Mark(object): def __init__(self, name, index, line, column, buffer, pointer): self.name = name self.index = index self.line = line self.column = column self.buffer = buffer self.pointer = pointer def get...
ajibawa-2023/Python-Code-Large/train/row_86776
50
75
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86776:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0267, 0.0133, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86776:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86776:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86776:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86776:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code...
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
ajibawa-2023/Python-Code-Large/train/row_86777
29
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86777:ClassDef_L2_C0", "label": "Node", "type": "class", "loc": [2, 23], "level": 0, "parent": null, "vector": [3, 0, 0.2551, 0.449, 0, 0.66, 0.0, 345, 0, 2, 0, 0, 186, 0, 1], "semantic": {"name": "Node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86777:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86777:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86777:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86777:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code...
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
ajibawa-2023/Python-Code-Large/train/row_86778
77
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_86778:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.018, 0.009, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86778:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86778:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86778:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86778:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Cod...
# Emitter expects events obeying the following grammar: # stream ::= STREAM-START document* STREAM-END # document ::= DOCUMENT-START node DOCUMENT-END # node ::= SCALAR | sequence | mapping # sequence ::= SEQUENCE-START node* SEQUENCE-END # mapping ::= MAPPING-START (node node)* MAPPING-END __all__ = ['Emitter', 'Emi...
ajibawa-2023/Python-Code-Large/train/row_86779
787
1,140
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86779:Assign_L9_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0079, 0.0009, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86779:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86779:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86779:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86779:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-...
__all__ = ['Composer', 'ComposerError'] from error import MarkedYAMLError from events import * from nodes import * class ComposerError(MarkedYAMLError): pass class Composer(object): def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if se...
ajibawa-2023/Python-Code-Large/train/row_86781
87
139
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86781:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0144, 0.0072, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86781:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86781:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86781:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86781:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-...
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
ajibawa-2023/Python-Code-Large/train/row_86783
36
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_86783:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0235, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86783:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86783:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86783:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86783:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Co...
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from emitter import * from serializer import * from representer import * from resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, c...
ajibawa-2023/Python-Code-Large/train/row_86784
23
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86784:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0323, 0.0161, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86784:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86784:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86784:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86784:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Cod...
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
ajibawa-2023/Python-Code-Large/train/row_86785
76
104
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86785:ClassDef_L2_C0", "label": "Token", "type": "class", "loc": [2, 12], "level": 0, "parent": null, "vector": [3, 0, 0.0673, 0.1058, 0, 0.66, 0.0, 92, 0, 2, 0, 0, 186, 0, 4], "semantic": {"name": "Token", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86785:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86785:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86785:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86785:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code...
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
ajibawa-2023/Python-Code-Large/train/row_86786
116
163
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86786:ImportFrom_L1_C0", "label": "from error import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 771, 0, 1, 0, 0, 771, 0, 0], "semantic": {"name": "error", "arg_names": [], "import_names": ["*"], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86786:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86786:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86786:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86786:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', 'RepresenterError'] from error import * from nodes import * import datetime import sys, copy_reg, types class RepresenterError(YAMLError): pass class BaseRepresenter(object): yaml_representers = {} yaml_multi_representers = {} d...
ajibawa-2023/Python-Code-Large/train/row_86787
298
484
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86787:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0052, 0.0041, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86787:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86787:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86787:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86787:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from error import * from tokens import * from events import * from nodes import * from loader import * from dumper import * __version__ = '3.10' try: from cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False def scan(stream, Loader=Loader): """ Scan a YAML stream...
ajibawa-2023/Python-Code-Large/train/row_86788
162
315
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86788:ImportFrom_L2_C0", "label": "from error import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0032, 0, 0.66, 0.0, 771, 0, 1, 0, 0, 771, 0, 0], "semantic": {"name": "error", "arg_names": [], "import_names": ["*"], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86788:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86788:ImportFrom_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86788:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86788:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
__all__ = ['BaseLoader', 'SafeLoader', 'Loader'] from reader import * from scanner import * from parser import * from composer import * from constructor import * from resolver import * class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream): Reader....
ajibawa-2023/Python-Code-Large/train/row_86789
31
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_86789:Assign_L2_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.05, 0.025, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86789:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86789:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86789:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86789:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Co...
# The following YAML grammar is LL(1) and is parsed by a recursive descent # parser. # # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END # implicit_document ::= block_node DOCUMENT-END* # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* # block_node_or_inden...
ajibawa-2023/Python-Code-Large/train/row_86790
339
589
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86790:Assign_L62_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.1053, 0.0017, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_cal...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86790:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86790:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86790:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86790:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Cod...
from jinja2 import nodes from jinja2.ext import Extension class FragmentCacheExtension(Extension): # a set of names that trigger the extension. tags = set(['cache']) def __init__(self, environment): super(FragmentCacheExtension, self).__init__(environment) # add the defaults to the envir...
ajibawa-2023/Python-Code-Large/train/row_86792
24
56
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86792:ImportFrom_L1_C0", "label": "from jinja2 import nodes", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 436, 0, 1, 0, 0, 436, 0, 0], "semantic": {"name": "jinja2", "arg_names": [], "import_names": ["nodes...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86792:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86792:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86792:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86792:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
# -*- coding: utf-8 -*- # # Jinja2 documentation build configuration file, created by # sphinx-quickstart on Sun Apr 27 21:42:41 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
ajibawa-2023/Python-Code-Large/train/row_86793
34
160
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86793:Import_L14_C0", "label": "sys import sys, os", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0875, 0.0063, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86793:Try_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86793:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86793:Try_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86793:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
# -*- coding: utf-8 -*- """ Jinja Documentation Extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for automatically documenting filters and tests. :copyright: Copyright 2008 by Armin Ronacher. :license: BSD. """ import os import re import inspect import jinja2 from itertools import islice from typ...
ajibawa-2023/Python-Code-Large/train/row_86794
110
193
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86794:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0311, 0.0466, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86794:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86794:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86794:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86794:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Co...
# -*- coding: utf-8 -*- """ Jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a `Django`_ inspired non-XML syntax but supports inline expressions and an optional `sandboxed`_ environment. Nutshell -------- Here a small example of a Jinja template:: {% extends 'base.html' %} {% b...
ajibawa-2023/Python-Code-Large/train/row_86795
16
110
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86795:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 37], "level": 0, "parent": null, "vector": [8, 0, 0.1773, 0.3273, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86795:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86795:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86795:Try_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86795:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
# -*- coding: utf-8 -*- """ Inline Gettext ~~~~~~~~~~~~~~ An example extension for Jinja2 that supports inline gettext calls. Requires the i18n extension to be loaded. :copyright: (c) 2009 by the Jinja Team. :license: BSD. """ import re from jinja2.ext import Extension from jinja2.lexer import...
ajibawa-2023/Python-Code-Large/train/row_86796
43
78
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86796:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.1282, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86796:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86796:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86796:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86796:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-...
# -*- coding: utf-8 -*- """ Django to Jinja ~~~~~~~~~~~~~~~ Helper module that can convert django templates into Jinja2 templates. This file is not intended to be used as stand alone application but to be used as library. To convert templates you basically create your own writer, add extra co...
ajibawa-2023/Python-Code-Large/train/row_86797
481
767
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86797:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 70], "level": 0, "parent": null, "vector": [8, 0, 0.0469, 0.09, 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_86797:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86797:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86797:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86797:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code...
from django.conf import settings settings.configure(TEMPLATE_DIRS=['templates'], TEMPLATE_DEBUG=True) from django2jinja import convert_templates, Writer writer = Writer(use_jinja_autoescape=True) convert_templates('converted', writer=writer)
ajibawa-2023/Python-Code-Large/train/row_86798
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_86798:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[]
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from itertools import chain, imap from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup, partial, soft_unicode, escape, miss...
ajibawa-2023/Python-Code-Large/train/row_86800
270
548
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86800:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0109, 0.0164, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86800:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86800:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86800:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86800:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code...
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
ajibawa-2023/Python-Code-Large/train/row_86801
131
301
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86801:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0498, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86801:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86801:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86801:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86801:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
ajibawa-2023/Python-Code-Large/train/row_86802
1,063
1,649
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86802:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0036, 0.0055, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86802:Try_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86802:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86802:Try_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86802:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
ajibawa-2023/Python-Code-Large/train/row_86803
36
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_86803:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0637, 0.098, 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_86803:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86803:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86803:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86803:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.tests ~~~~~~~~~~~~~~~~~~~~~~ Who tests the tests? :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment env = Environm...
ajibawa-2023/Python-Code-Large/train/row_86805
32
93
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86805:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0645, 0.0968, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86805:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86805:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86805:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86805:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.debug ~~~~~~~~~~~~~~~~~~~~~~ Tests the debug system. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import sys import unittest from jinja2.testsuite import JinjaTestCase, filesystem_loader from jinja2 import E...
ajibawa-2023/Python-Code-Large/train/row_86806
22
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_86806:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.15, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86806:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86806:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86806:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86806:FunctionDef_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
# -*- coding: utf-8 -*- """ jinja2.testsuite.doctests ~~~~~~~~~~~~~~~~~~~~~~~~~ The doctests. Collects all tests we want to test from the Jinja modules. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest import doctest def suite(): f...
ajibawa-2023/Python-Code-Large/train/row_86807
16
29
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86807:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.2241, 0.3448, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86807:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86807:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86807:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86807:Assign_L19_C4"}, {"f": "ajibawa-2023/Pytho...
# -*- coding: utf-8 -*- """ jinja2.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~ Tests utilities jinja uses. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import gc import unittest import pickle from jinja2.testsuite import JinjaTestCase from jinja2.utils imp...
ajibawa-2023/Python-Code-Large/train/row_86808
46
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86808:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0732, 0.1098, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86808:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86808:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86808:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86808:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.ext ~~~~~~~~~~~~~~~~~~~~ Tests for the extensions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, DictLoader...
ajibawa-2023/Python-Code-Large/train/row_86809
179
455
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86809:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0198, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86809:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86809:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86809:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86809:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# -*- coding: utf-8 -*- """ jinja2.testsuite.inheritance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the template inheritance feature. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Env...
ajibawa-2023/Python-Code-Large/train/row_86810
55
227
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86810:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0264, 0.0396, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86810:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86810:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86810:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86810:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
ajibawa-2023/Python-Code-Large/train/row_86811
103
285
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86811:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0211, 0.0316, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86811:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86811:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86811:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86811:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment en...
ajibawa-2023/Python-Code-Large/train/row_86813
156
356
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86813:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0169, 0.0253, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86813:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86813:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86813:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86813:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.testsuite.loader ~~~~~~~~~~~~~~~~~~~~~~~ Test the loaders. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import tempfile import shutil import unittest from jinja2.testsuite import JinjaTestCase, dic...
ajibawa-2023/Python-Code-Large/train/row_86815
107
190
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86815:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0316, 0.0474, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86815:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86815:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86815:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86815:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
ajibawa-2023/Python-Code-Large/train/row_86819
452
910
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86819:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0088, 0.0143, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86819:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86819:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86819:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86819:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from jinja2.runtime import Undefined try: from collections import Mapping as MappingType ...
ajibawa-2023/Python-Code-Large/train/row_86820
67
161
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86820:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0373, 0.0559, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86820:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86820:ImportFrom_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86820:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86820:Import_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# -*- coding: utf-8 -*- """ jinja2.optimizer ~~~~~~~~~~~~~~~~ The jinja optimizer is currently trying to constant fold a few expressions and modify the AST in place so that it should be easier to evaluate it. Because the AST does not contain all the scoping information and the compiler has to ...
ajibawa-2023/Python-Code-Large/train/row_86822
31
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86822:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 18], "level": 0, "parent": null, "vector": [8, 0, 0.1471, 0.25, 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_86822:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86822:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86822:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86822:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code...
# -*- coding: utf-8 -*- """ jinja.constants ~~~~~~~~~~~~~~~ Various constants. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ #: list of lorem ipsum words used by the lipsum() helper function LOREM_IPSUM_WORDS = u'''\ a ac accumsan ad adipiscing aenean a...
ajibawa-2023/Python-Code-Large/train/row_86824
2
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_86824:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1875, 0.2812, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
# -*- coding: utf-8 -*- """ jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environm...
ajibawa-2023/Python-Code-Large/train/row_86825
117
361
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86825:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0222, 0.036, 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_86825:Try_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86825:ImportFrom_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86825:Try_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86825:ImportFrom_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import gc import unittest from jinja2._markupsafe import Markup, escape, escape_silent class MarkupTestCase(unittest.TestCase): def test_markup_operations(self): # adding two strings should escape the unsafe one unsafe = '<script type="application/x-some-script">alert("foo");</script>' sa...
ajibawa-2023/Python-Code-Large/train/row_86826
36
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_86826:Import_L1_C0", "label": "gc import gc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0125, 0, 0.66, 0.0, 92, 0, 1, 0, 0, 92, 0, 0], "semantic": {"name": "gc", "arg_names": [], "import_names": ["gc"], "rhs_call_name": "", ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86826:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86826:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86826:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86826:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- """ markupsafe._constants ~~~~~~~~~~~~~~~~~~~~~ Highlevel implementation of the Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ HTML_ENTITIES = { 'AElig': 198, 'Aacute': 193, 'Acirc': 194, 'Agrave': 1...
ajibawa-2023/Python-Code-Large/train/row_86827
2
267
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86827:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0225, 0.0337, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
# -*- coding: utf-8 -*- """ jinja2._markupsafe._bundle ~~~~~~~~~~~~~~~~~~~~~~~~~~ This script pulls in markupsafe from a source folder and bundles it with Jinja2. It does not pull in the speedups module though. :copyright: Copyright 2010 by the Jinja team, see AUTHORS. :license: BSD, see ...
ajibawa-2023/Python-Code-Large/train/row_86828
29
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86828:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 12], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.2245, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86828:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86828:For_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86828:For_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86828:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from itertools import imap __all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent'] _striptags_re = re.compile...
ajibawa-2023/Python-Code-Large/train/row_86829
110
225
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86829:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0267, 0.04, 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_86829:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86829:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86829:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86829:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large...