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
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j N Y' DATETIME_FORMAT = "j N Y, G:i:s" TIME_FORMAT = 'G:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'd-m-Y' SHORT_DATETIME_FORMAT = 'd-m-Y G:i:s' FIRST_DAY_OF_WEEK = 1 #M...
ajibawa-2023/Python-Code-Large/train/row_85130
14
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_85130:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1163, 0.0233, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = r'j \de F \de Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = r'j \de F \de Y \a \le\s G:i' YEAR_MONTH_FORMAT = r'F \de\l Y' MONTH_DAY_FORMAT = r'j \de F' SHORT_DATE_FORMAT = 'd/m/Y' SHORT_DATETIME_FORMAT = 'd...
ajibawa-2023/Python-Code-Large/train/row_85131
14
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_85131:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0333, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'd.m.Y' SHORT_DATETIME_FORMAT = 'd.m.Y H:i' FIRST_DAY_OF_WEEK = 1 # Monday DATE_INPUT_FORMATS = ( '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10...
ajibawa-2023/Python-Code-Large/train/row_85132
14
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85132:Assign_L1_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'd F Y' TIME_FORMAT = 'g:i:s A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = # MONTH_DAY_FORMAT = SHORT_DATE_FORMAT = 'j M Y' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_INPUT_FORMATS = # TI...
ajibawa-2023/Python-Code-Large/train/row_85133
3
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85133:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'j M, Y' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_INPUT_FORMATS = ...
ajibawa-2023/Python-Code-Large/train/row_85134
7
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85134:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j F Y' TIME_FORMAT = 'h:i:s A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'j M Y' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_INPUT_FORMATS = #...
ajibawa-2023/Python-Code-Large/train/row_85135
4
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85135:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j בF Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j בF Y H:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j בF' SHORT_DATE_FORMAT = 'd/m/Y' SHORT_DATETIME_FORMAT = 'd/m/Y H:i:s' # FIRST_DAY_OF_WEEK = ...
ajibawa-2023/Python-Code-Large/train/row_85136
9
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85136:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'd.m.Y' SHORT_DATETIME_FORMAT = 'd.m.Y H:i' FIRST_DAY_OF_WEEK = 1 # Monday DATE_INPUT_FORMATS = ( '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10...
ajibawa-2023/Python-Code-Large/train/row_85137
14
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85137:Assign_L1_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'd F Y H:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'd F' SHORT_DATE_FORMAT = 'd M Y' SHORT_DATETIME_FORMAT = 'd M Y H:i:s' FIRST_DAY_OF_WEEK = 1 # P...
ajibawa-2023/Python-Code-Large/train/row_85138
14
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_85138:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'j.n.Y' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_INPUT_FORMATS =...
ajibawa-2023/Python-Code-Large/train/row_85139
7
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85139:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'd. F Y' TIME_FORMAT = 'H:i:s' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'j. M. Y' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_INPUT_FORMATS = ...
ajibawa-2023/Python-Code-Large/train/row_85140
6
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85140:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i:s' DATETIME_FORMAT = 'Y년 n월 j일 g:i:s A' YEAR_MONTH_FORMAT = 'Y년 F월' MONTH_DAY_FORMAT = 'F월 j일' SHORT_DATE_FORMAT = 'Y-n-j.' SHORT_DATETIME_FORMAT = 'Y-n-j H:i' # FIRST_DAY_...
ajibawa-2023/Python-Code-Large/train/row_85141
13
44
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85141:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0227, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j. N Y.' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j. N. Y. G:i T' YEAR_MONTH_FORMAT = 'F Y.' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'Y M j' # SHORT_DATETIME_FORMAT = # FIRST_DAY_OF_WEEK = # DATE_I...
ajibawa-2023/Python-Code-Large/train/row_85142
8
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85142:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh...
[]
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ...
ajibawa-2023/Python-Code-Large/train/row_85143
8
11
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85143:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85143:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85143:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85143:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85143:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')), # Uncomment the admin/doc line below to enable a...
ajibawa-2023/Python-Code-Large/train/row_85144
2
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_85144:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n...
[]
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
ajibawa-2023/Python-Code-Large/train/row_85145
19
96
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85145:Assign_L3_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0312, 0.0104, 0, 0.66, 0.0, 309, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name"...
[]
from django.conf.urls.defaults import * urlpatterns = patterns('django.views', (r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'), )
ajibawa-2023/Python-Code-Large/train/row_85146
2
5
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85146:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":...
[]
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver from django.core.exceptions import ImproperlyConfigured __all__ = ['handler404', 'handler500', 'include', 'patterns', 'url'] handler404 = 'django.views.defaults.page_not_found' handler500 = 'django.views.defaults.server_error' def include(arg, na...
ajibawa-2023/Python-Code-Large/train/row_85147
29
42
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85147:ImportFrom_L1_C0", "label": "from django.core.urlresolvers import RegexURLPattern, RegexURLResolver", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 749, 0, 2, 0, 0, 749, 0, 0], "semantic": {"name": "dja...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85147:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85147:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85147:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85147:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^setlang/$', 'django.views.i18n.set_language'), )
ajibawa-2023/Python-Code-Large/train/row_85148
2
5
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85148:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":...
[]
# Default Django settings. Override these with settings in the module # pointed-to by the DJANGO_SETTINGS_MODULE environment variable. # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. gettext_noop = lambda s: s #################...
ajibawa-2023/Python-Code-Large/train/row_85150
116
524
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85150:Assign_L6_C0", "label": "gettext_noop =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0115, 0.0019, 0, 0.66, 0.0, 651, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "gettext_noop", "arg_names": [], "import_names": [], "...
[]
from django.db import models # Create your models here.
ajibawa-2023/Python-Code-Large/train/row_85151
1
3
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85151:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["...
[]
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ ...
ajibawa-2023/Python-Code-Large/train/row_85152
7
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_85152:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1522, 0.2609, 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_85152:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85152:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85152:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85152:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Co...
# Create your views here.
ajibawa-2023/Python-Code-Large/train/row_85153
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
""" Parser and utilities for the smart 'if' tag """ import operator # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (left = lbp, right = rbp) class TokenBase(object): """ Ba...
ajibawa-2023/Python-Code-Large/train/row_85154
101
206
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85154:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0097, 0.0146, 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_85154:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85154:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85154:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85154:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ from django.core.exceptions import ImproperlyConfigured from django.template import TemplateDoesNotExist from django.template.loader import BaseLoader, get_template_from_str...
ajibawa-2023/Python-Code-Large/train/row_85155
37
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85155:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0424, 0.0678, 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_85155:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85155:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85155:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85155:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Cod...
# Wrapper for loading templates from eggs via pkg_resources.resource_string. try: from pkg_resources import resource_string except ImportError: resource_string = None from django.template import TemplateDoesNotExist from django.template.loader import BaseLoader from django.conf import settings class Loader(B...
ajibawa-2023/Python-Code-Large/train/row_85156
21
39
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85156:Try_L3_C0", "label": "try", "type": "try", "loc": [3, 6], "level": 0, "parent": null, "vector": [7, 0, 0.1154, 0.1026, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85156:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85156:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85156:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85156:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils....
ajibawa-2023/Python-Code-Large/train/row_85157
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_85157:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85157:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85157:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85157:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85157:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Cod...
""" Wrapper for loading templates from the filesystem. """ from django.conf import settings from django.template 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, template_...
ajibawa-2023/Python-Code-Large/train/row_85158
33
61
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85158:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0328, 0.0492, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85158:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85158:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85158:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85158:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable from django.template import Library, Node, TextNode from django.template.loader import get_template from django.conf import settings from django.utils.safestring import mark_safe register = Library() BLOCK_CONTEXT_KEY = 'block_context' c...
ajibawa-2023/Python-Code-Large/train/row_85165
141
218
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85165:ImportFrom_L1_C0", "label": "from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0046, 0, 0.66, 0.0, 213, 0, 3, 0, 0, 213, 0, 0], "semantic": {"na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85165:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85165:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85165:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85165:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-...
""" Extra HTML Widget classes """ import time 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 setting...
ajibawa-2023/Python-Code-Large/train/row_85167
104
141
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85167:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0142, 0.0213, 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_85167:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85167:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85167:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85167:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Co...
from widgets import *
ajibawa-2023/Python-Code-Large/train/row_85168
1
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85168:ImportFrom_L1_C0", "label": "from widgets import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "widgets", "arg_names": [], "import_names": ["*"], "rhs_cal...
[]
from django.utils.html import conditional_escape from django.utils.encoding import StrAndUnicode, force_unicode from django.utils.safestring import mark_safe # Import ValidationError so that it can be imported from this # module to maintain backwards compatibility. from django.core.exceptions import ValidationError d...
ajibawa-2023/Python-Code-Large/train/row_85171
31
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85171:ImportFrom_L1_C0", "label": "from django.utils.html import conditional_escape", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 535, 0, 1, 0, 0, 535, 0, 0], "semantic": {"name": "django.utils.html", "arg_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85171:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85171:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85171:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85171:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" HTML Widget classes """ import django.utils.copycompat as copy from itertools import chain from django.conf import settings from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.html import escape, conditional_escape from django.utils.translation import ugettext from django.utils.enco...
ajibawa-2023/Python-Code-Large/train/row_85172
515
785
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85172:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0025, 0.0038, 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_85172:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85172:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85172:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85172:If_L32_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 django.core.exceptions import Valida...
ajibawa-2023/Python-Code-Large/train/row_85173
6
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_85173:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.3529, 0.6471, 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, 2, 5, 'final', 0) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] != 'final': version = '%s %...
ajibawa-2023/Python-Code-Large/train/row_85175
14
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_85175:Assign_L1_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0625, 0.0625, 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_85175:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85175:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85175:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85175:If_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
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"]) post_save = Signal(providing_args=["instance", "raw", "created"])...
ajibawa-2023/Python-Code-Large/train/row_85177
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_85177: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 datetime import datetime from django.utils import tree from django.utils.copycompat import deepcopy class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % o...
ajibawa-2023/Python-Code-Large/train/row_85178
69
113
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85178:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85178:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85178:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85178:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85178:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.core.exceptions import FieldError from django.db import connections from django.db.backends.util import truncate_name from django.db.models.sql.constants import * from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sq...
ajibawa-2023/Python-Code-Large/train/row_85180
599
979
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85180:ImportFrom_L1_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.001, 0.001, 0, 0.66, 0.0, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85180:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85180:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85180:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85180:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-...
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models.sql.expressions import SQLEval...
ajibawa-2023/Python-Code-Large/train/row_85181
115
212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85181:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0094, 0.0142, 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_85181:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85181:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85181:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85181:Assign_L23_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_85182
52
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_85182:ImportFrom_L1_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0115, 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_85182:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85182:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85182:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85182: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_85183
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_85183: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 """ class AggregateField(object): """An internal field mockup used to identify aggregates in the data-conversion parts of the database backend. """ def __init__(self, internal_type): self.internal_type = internal_type def get_int...
ajibawa-2023/Python-Code-Large/train/row_85184
66
128
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85184:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0156, 0.0234, 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_85184:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85184:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85184:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85184:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.query_utils import QueryWrapper from datastructures import EmptyResultSet, FullResultSet # Connection...
ajibawa-2023/Python-Code-Large/train/row_85185
194
345
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85185:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0058, 0.0087, 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_85185:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85185:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85185:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85185:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from query import * from subqueries import * from where import AND, OR from datastructures import EmptyResultSet __all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']
ajibawa-2023/Python-Code-Large/train/row_85186
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_85186:ImportFrom_L1_C0", "label": "from query import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 546, 0, 1, 0, 0, 546, 0, 0], "semantic": {"name": "query", "arg_names": [], "import_names": ["*"], "rhs_c...
[]
""" 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_85187
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_85187: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_85187:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85187:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85187:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85187:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
import datetime import os import django.utils.copycompat as copy from django.conf import settings from django.db.models.fields import Field from django.core.files.base import File, ContentFile from django.core.files.storage import default_storage from django.core.files.images import ImageFile, get_image_dimensions fr...
ajibawa-2023/Python-Code-Large/train/row_85188
204
390
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85188:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0026, 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_85188:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85188:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85188:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85188:Expr_L21_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_85189
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_85189: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_85189:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85189:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85189:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85189:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.conf import settings from django.db import connection, router, transaction 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 dja...
ajibawa-2023/Python-Code-Large/train/row_85190
634
1,183
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85190:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0008, 0.0008, 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_85190:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85190:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85190:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85190:If_L47_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. """ from inspect import getargspec from warnings i...
ajibawa-2023/Python-Code-Large/train/row_85191
66
117
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85191:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0598, 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_85191:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85191:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85191:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85191:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Co...
"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_85193
111
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_85193:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0044, 0.0044, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85193:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85193:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85193:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85193:Assign_L24_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_85194
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_85194: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_85194:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85194:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85194:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85194: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_85195
300
489
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85195:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.002, 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_85195:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85195:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85195:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85195:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-...
class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def template_name(self): raise NotImplementedError def __repr__(self): return repr(self.__d...
ajibawa-2023/Python-Code-Large/train/row_85197
32
50
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85197:ClassDef_L1_C0", "label": "BoundRelatedObject", "type": "class", "loc": [1, 10], "level": 0, "parent": null, "vector": [3, 0, 0.11, 0.2, 0, 0.66, 0.0, 875, 0, 3, 0, 0, 186, 0, 1], "semantic": {"name": "BoundRelatedObject", "arg_names": [], "import_names": [], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85197:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85197:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85197:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85197:Assign_L3_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_85198
22
33
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85198:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 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_85198:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85198:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85198:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85198:ImportFrom_L29_C4"}, {"f": "ajibawa-2023/Python-...
from django.utils import copycompat as copy from django.conf import settings 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, ...
ajibawa-2023/Python-Code-Large/train/row_85199
131
216
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85199:ImportFrom_L1_C0", "label": "from django.utils import copy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0046, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85199:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85199:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85199:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85199:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" 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.utils.copycompat import deepcopy from django.u...
ajibawa-2023/Python-Code-Large/train/row_85200
135
278
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85200:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0144, 0.0252, 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_85200:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85200:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85200:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85200:Expr_L24_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_85202
199
351
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85202:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0199, 0.037, 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_85202:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85202:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85202:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85202:Import_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
from django.db.backends.postgresql.introspection import DatabaseIntrospection as PostgresDatabaseIntrospection class DatabaseIntrospection(PostgresDatabaseIntrospection): def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} ...
ajibawa-2023/Python-Code-Large/train/row_85203
9
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85203:ImportFrom_L1_C0", "label": "from django.db.backends.postgresql.introspection import PostgresDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 789, 0, 1, 0, 0, 789, 0, 0], "semantic"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85203:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85203:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85203:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85203:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-L...
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_85205
46
98
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85205:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0102, 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_85205:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85205:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85205:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85205: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_85206
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_85206: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_85206:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85206:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85206:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85206: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_85207
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_85207: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_85207:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85207:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85207:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85207: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_85208
20
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_85208:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 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_85208:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85208:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85208:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85208:FunctionDef_L32_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_85209
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_85209: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_85209:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85209:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85209:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85209: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_85211
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_85211: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_85212
32
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_85212:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0804, 0.1429, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85212:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85212:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85212:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85212:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
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: 'T...
ajibawa-2023/Python-Code-Large/train/row_85214
27
88
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85214:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0114, 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_85214:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85214:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85214:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85214:FunctionDef_L23_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_85215
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_85215: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_85215:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85215:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85215:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85215:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(Databas...
ajibawa-2023/Python-Code-Large/train/row_85216
86
179
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85216:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0056, 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_85216:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85216:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85216:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85216:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-...
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__...
ajibawa-2023/Python-Code-Large/train/row_85217
28
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_85217:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0133, 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_85217:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85217:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85217:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85217:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" 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_v...
ajibawa-2023/Python-Code-Large/train/row_85218
13
31
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85218:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "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": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85218:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85218:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85218:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85218:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code...
import datetime import decimal from time import time from django.utils.hashcompat import md5_constructor class CursorDebugWrapper(object): def __init__(self, cursor, db): self.cursor = cursor self.db = db # Instance of a BaseDatabaseWrapper subclass def execute(self, sql, params=()): ...
ajibawa-2023/Python-Code-Large/train/row_85220
86
128
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85220:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0078, 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_85220:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85220:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85220:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85220:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
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: # Maps SQL types to Django...
ajibawa-2023/Python-Code-Large/train/row_85221
63
141
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85221:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 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_85221:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85221:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85221:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85221: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_85222
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_85222: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_85222:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85222:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85222:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85222:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La...
import decimal from threading import local from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.utils import datetime_safe from django.utils.importlib import import_module class BaseDatabaseWrapper(local): """ Represents a database connection. """ ops = None def ...
ajibawa-2023/Python-Code-Large/train/row_85225
276
592
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85225:Import_L1_C0", "label": "decimal import decimal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0017, 0, 0.66, 0.0, 349, 0, 1, 0, 0, 349, 0, 0], "semantic": {"name": "decimal", "arg_names": [], "import_names": ["decimal"],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85225:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85225:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85225:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85225:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
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_85226
48
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_85226:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 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_85226:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85226:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85226:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85226: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_85227
27
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_85227:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0152, 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_85227:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85227:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85227:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85227: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_85228
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_85228: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_85228:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85228:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85228:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85228: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 from django.utils.functional import curry ...
ajibawa-2023/Python-Code-Large/train/row_85231
43
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85231:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 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_85231:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85231:Import_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85231:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85231:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
import re import unittest from urlparse import urlsplit, urlunsplit from xml.dom.minidom import parseString, Node from django.conf import settings from django.core import mail from django.core.management import call_command from django.core.urlresolvers import clear_url_caches from django.db import transaction, connec...
ajibawa-2023/Python-Code-Large/train/row_85232
286
554
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85232:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0018, 0.0018, 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_85232:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85232:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85232:Try_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85232:ImportFrom_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
from django.dispatch import Signal template_rendered = Signal(providing_args=["template", "context"])
ajibawa-2023/Python-Code-Large/train/row_85236
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_85236: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...
[]
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate class Approximate(object): def __init__(s...
ajibawa-2023/Python-Code-Large/train/row_85237
66
124
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85237:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0081, 0.0081, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85237:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85237:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85237:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85237:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-...
""" Django Unit Test and Doctest framework. """ from django.test.client import Client from django.test.testcases import TestCase, TransactionTestCase from django.test.utils import Approximate
ajibawa-2023/Python-Code-Large/train/row_85238
4
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_85238:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.2857, 0.4286, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
import sys, os from setuptools import setup, find_packages import argparse long_description = open('README.txt').read() setup_args = dict( name="argparse", version=argparse.__version__, description='Python command-line parsing library', long_description=long_description, author="Steven Bethard"...
ajibawa-2023/Python-Code-Large/train/row_85239
7
45
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85239:Import_L1_C0", "label": "sys import sys, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0222, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85239:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85239:Expr_L44_C4"}]
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
ajibawa-2023/Python-Code-Large/train/row_85240
1,135
2,362
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85240:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 62], "level": 0, "parent": null, "vector": [8, 0, 0.0138, 0.0254, 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_85240:Try_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85240:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85240:Try_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85240:ImportFrom_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
from collections import MutableMapping from webob.compat import ( iteritems_, string_types, ) from webob.multidict import MultiDict __all__ = ['ResponseHeaders', 'EnvironHeaders'] class ResponseHeaders(MultiDict): """ Dictionary view on the response headerlist. Keys are normalized for ...
ajibawa-2023/Python-Code-Large/train/row_85241
99
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_85241:ImportFrom_L1_C0", "label": "from collections import MutableMapping", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "imp...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85241:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85241:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85241:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85241:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-...
# code stolen from "six" import sys import types # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: # pragma: no cover string_types = str, integer_types = int, class_types = type, text_type = str long = int else: string_types = basestring, integer_types = (int, l...
ajibawa-2023/Python-Code-Large/train/row_85242
91
131
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85242:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0229, 0.0076, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85242:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85242:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85242:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85242:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
import collections from datetime import ( date, datetime, timedelta, ) import re import string import time from webob.compat import ( PY3, text_type, bytes_, text_, native_, string_types, ) __all__ = ['Cookie'] _marker = object() class RequestCookies(collections.MutableM...
ajibawa-2023/Python-Code-Large/train/row_85243
241
370
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85243:Import_L1_C0", "label": "collections import collections", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0027, 0.0027, 0, 0.66, 0.0, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85243:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85243:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85243:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85243:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Cod...
""" Decorators to wrap functions to make them WSGI applications. The main decorator :class:`wsgify` turns a function into a WSGI application (while also allowing normal calling of the method with an instantiated request). """ from webob.compat import ( bytes_, text_type, ) from webob.request import Reque...
ajibawa-2023/Python-Code-Large/train/row_85244
119
299
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85244:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0134, 0.0234, 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_85244:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85244:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85244:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85244:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import errno import sys import re try: import httplib except ImportError: # pragma: no cover import http.client as httplib from webob.compat import url_quote import socket from webob import exc from webob.compat import PY3 __all__ = ['send_request_app', 'SendRequest'] class SendRequest: """ Sends the...
ajibawa-2023/Python-Code-Large/train/row_85245
106
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_85245:Import_L1_C0", "label": "errno import errno", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 0, 0.66, 0.0, 546, 0, 1, 0, 0, 546, 0, 0], "semantic": {"name": "errno", "arg_names": [], "import_names": ["errno"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85245:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85245:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85245:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85245:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
# (c) 2005 Ian Bicking and contributors; written for Paste # (http://pythonpaste.org) Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ Gives a multi-value dictionary object (MultiDict) plus several wrappers """ from collections import MutableMapping import binascii import warnin...
ajibawa-2023/Python-Code-Large/train/row_85246
326
508
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85246:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0098, 0.0059, 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_85246:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85246:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85246:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85246:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-...
import mimetypes import os from webob import exc from webob.dec import wsgify from webob.response import Response __all__ = [ 'FileApp', 'DirectoryApp', ] mimetypes._winreg = None # do not load mimetypes from windows registry mimetypes.add_type('text/javascript', '.js') # stdlib default is application/x-javascri...
ajibawa-2023/Python-Code-Large/train/row_85247
89
168
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85247:Import_L1_C0", "label": "mimetypes import mimetypes", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 583, 0, 1, 0, 0, 583, 0, 0], "semantic": {"name": "mimetypes", "arg_names": [], "import_names": ["mimety...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85247:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85247:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85247:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85247:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-...
import binascii import cgi import io import os import re import sys import tempfile import mimetypes try: import simplejson as json except ImportError: import json import warnings from webob.acceptparse import ( AcceptLanguage, AcceptCharset, MIMEAccept, MIMENilAccept, NoAccept, accept_...
ajibawa-2023/Python-Code-Large/train/row_85248
901
1,720
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85248:Import_L1_C0", "label": "binascii import binascii", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0006, 0.0006, 0, 0.66, 0.0, 984, 0, 1, 0, 0, 984, 0, 0], "semantic": {"name": "binascii", "arg_names": [], "import_names": ["binasci...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85248:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85248:Import_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85248:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85248:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from base64 import b64encode from datetime import ( datetime, timedelta, ) from hashlib import md5 import re import struct import zlib try: import simplejson as json except ImportError: import json from webob.byterange import ContentRange from webob.cachecontrol import ( CacheControl, seri...
ajibawa-2023/Python-Code-Large/train/row_85249
647
1,291
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85249:ImportFrom_L1_C0", "label": "from base64 import b64encode", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0008, 0.0008, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["b...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85249:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85249:Import_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85249:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85249:Import_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
""" Represents the Cache-Control header """ import re class UpdateDict(dict): """ Dict that has a callback on all updates """ # these are declared as class attributes so that # we don't need to override constructor just to # set some defaults updated = None updated_args = None def ...
ajibawa-2023/Python-Code-Large/train/row_85250
137
229
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85250:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0087, 0.0131, 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_85250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85250:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85250:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
import warnings from webob.compat import ( escape, string_types, text_, text_type, ) from webob.headers import _trans_key def html_escape(s): """HTML-escape a string or object This converts any non-string objects passed into it to strings (actually, using ``unicode()``). All values ...
ajibawa-2023/Python-Code-Large/train/row_85251
34
132
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85251:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warning...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85251:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85251:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85251:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85251:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from datetime import ( date, datetime, ) import re from webob.byterange import ( ContentRange, Range, ) from webob.compat import ( PY3, text_type, ) from webob.datetime_utils import ( parse_date, serialize_date, ) from webob.util import ( header_docstring, wa...
ajibawa-2023/Python-Code-Large/train/row_85252
206
339
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85252:ImportFrom_L1_C0", "label": "from datetime import date, datetime", "type": "import", "loc": [1, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0118, 0, 0.66, 0.0, 426, 0, 2, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85252:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85252:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85252:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85252:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
""" Parses a variety of ``Accept-*`` headers. These headers generally take the form of:: value1; q=0.5, value2; q=0 Where the ``q`` parameter is optional. In theory other parameters exists, but this ignores them. """ import re from webob.headers import _trans_name as header_to_key from webob.util import ( ...
ajibawa-2023/Python-Code-Large/train/row_85253
196
339
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85253:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0162, 0.0295, 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_85253:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85253:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85253:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85253:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import calendar from datetime import ( date, datetime, timedelta, tzinfo, ) from email.utils import ( formatdate, mktime_tz, parsedate_tz, ) import time from webob.compat import ( integer_types, long, native_, text_type, ) __all__ = [ 'UTC', 'timedelta_to...
ajibawa-2023/Python-Code-Large/train/row_85254
63
117
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85254:Import_L1_C0", "label": "calendar import calendar", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0085, 0, 0.66, 0.0, 917, 0, 1, 0, 0, 917, 0, 0], "semantic": {"name": "calendar", "arg_names": [], "import_names": ["calenda...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85254:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85254:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85254:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85254:Return_L36_C8"}, {"f": "ajibawa-2023/Python-...
""" Does parsing of ETag-related headers: If-None-Matches, If-Matches Also If-Range parsing """ from webob.datetime_utils import ( parse_date, serialize_date, ) from webob.descriptors import _rx_etag from webob.util import ( header_docstring, warn_deprecation, ) __all__ = ['AnyETag', 'NoETag...
ajibawa-2023/Python-Code-Large/train/row_85255
104
189
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85255:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0159, 0.0265, 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_85255:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85255:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85255:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85255:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Pyth...
from webob.datetime_utils import * from webob.request import * from webob.response import * from webob.util import html_escape __all__ = [ 'Request', 'LegacyRequest', 'Response', 'UTC', 'day', 'week', 'hour', 'minute', 'second', 'month', 'year', 'html_escape' ] BaseRequest.ResponseClass = Response __version_...
ajibawa-2023/Python-Code-Large/train/row_85256
7
13
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85256:ImportFrom_L1_C0", "label": "from webob.datetime_utils import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 676, 0, 1, 0, 0, 676, 0, 0], "semantic": {"name": "webob.datetime_utils", "arg_names": [],...
[]