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
from django import http from django.conf import settings from utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response from django.template import RequestContext from django.template....
ajibawa-2023/Python-Code-Large/train/row_85472
58
135
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85472:ImportFrom_L1_C0", "label": "from django import http", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["http"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85472:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85472:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85472:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85472:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-...
import time import datetime from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import force_...
ajibawa-2023/Python-Code-Large/train/row_85473
106
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_85473:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85473:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85473:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85473:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85473:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import datetime from django.contrib.auth.models import User from django.contrib.comments.managers import CommentManager from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.db import models from django.core im...
ajibawa-2023/Python-Code-Large/train/row_85474
103
191
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85474:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 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_85474:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85474:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85474:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85474:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
ajibawa-2023/Python-Code-Large/train/row_85475
97
355
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85475:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 55], "level": 0, "parent": null, "vector": [8, 0, 0.0789, 0.1549, 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_85475:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85475:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85475:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85475:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Signals relating to comments. """ from django.dispatch import Signal # Sent just before a comment will be posted (after it's been approved and # moderated; this can be used to modify the comment (in place) with posting # details or other such actions. If any receiver returns False the comment will be # discarded a...
ajibawa-2023/Python-Code-Large/train/row_85476
5
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_85476:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0952, 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...
[]
from django.conf import settings from django.contrib.syndication.views import Feed from django.contrib.sites.models import Site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(sel...
ajibawa-2023/Python-Code-Large/train/row_85477
28
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85477:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 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_85477:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85477:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85477:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85477:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode class CommentManager(models.Manager): def in_moderation(self): """ QuerySet for all comments currently in the moderation queue. """ return self.ge...
ajibawa-2023/Python-Code-Large/train/row_85478
14
22
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85478:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85478:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85478:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85478:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85478:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from django.conf.urls.defaults import * urlpatterns = patterns('django.contrib.comments.views', url(r'^post/$', 'comments.post_comment', name='comments-post-comment'), url(r'^posted/$', 'comments.comment_done', name='comments-comment-done'), url(r'^flag/(\d+)/$', 'moderation....
ajibawa-2023/Python-Code-Large/train/row_85479
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_85479: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...
[]
from django import template from django.template.loader import render_to_string from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib import comments from django.utils.encoding import smart_unicode register = template.Library() class BaseCommentNode(template.N...
ajibawa-2023/Python-Code-Large/train/row_85480
146
333
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85480:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["temp...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85480:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85480:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85480:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85480:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.contrib import admin from django.contrib.comments.models import Comment from django.utils.translation import ugettext_lazy as _, ungettext from django.contrib.comments import get_model from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete class CommentsAdmin(adm...
ajibawa-2023/Python-Code-Large/train/row_85481
42
73
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85481:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0137, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85481:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85481:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85481:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85481:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.utils.importlib import import_module DEFAULT_COMMENTS_APP = 'django.contrib....
ajibawa-2023/Python-Code-Large/train/row_85482
47
91
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85482:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.011, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85482:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85482:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85482:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85482:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code...
""" Create a superuser from the command line. Deprecated; use manage.py createsuperuser instead. """ if __name__ == "__main__": from django.core.management import call_command call_command("createsuperuser")
ajibawa-2023/Python-Code-Large/train/row_85483
4
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85483:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.3125, 0.5, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85483:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85483:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85483:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85483:Expr_L8_C4"}]
from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.template import Context, loader from django import forms from django.utils.translation import ugett...
ajibawa-2023/Python-Code-Large/train/row_85484
133
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_85484:ImportFrom_L1_C0", "label": "from django.contrib.auth.models import User", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0046, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "django.contrib.auth.models", "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85484:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85484:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85484:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85484:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.utils.functional import lazy, memoize, SimpleLazyObject from django.contrib import messages # PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, module_name): self.user, self...
ajibawa-2023/Python-Code-Large/train/row_85485
25
60
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85485:ImportFrom_L1_C0", "label": "from django.utils.functional import lazy, memoize, SimpleLazyObject", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0167, 0, 0.66, 0.0, 375, 0, 3, 0, 0, 375, 0, 0], "semantic": {"name": "django...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85485:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85485:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85485:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85485:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
from django.db import connection from django.contrib.auth.models import User, Permission class ModelBackend(object): """ Authenticates against django.contrib.auth.models.User. """ supports_object_permissions = False supports_anonymous_user = True supports_inactive_user = True # TODO: Mode...
ajibawa-2023/Python-Code-Large/train/row_85486
67
126
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85486:ImportFrom_L1_C0", "label": "from django.db import connection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0079, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85486:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85486:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85486:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85486:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
import datetime import urllib from django.contrib import auth from django.contrib.auth.signals import user_logged_in from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.manager import EmptyManager from django.contrib.contenttypes.models import ContentType from dja...
ajibawa-2023/Python-Code-Large/train/row_85487
281
484
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85487:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 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_85487:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85487:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85487:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85487:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code...
from mod_python import apache import os def authenhandler(req, **kwargs): """ Authentication handler that checks against Django's auth database. """ # mod_python fakes the environ, and thus doesn't process SetEnv. This fixes # that so that the following import works os.environ.update(req.subp...
ajibawa-2023/Python-Code-Large/train/row_85488
34
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_85488:ImportFrom_L1_C0", "label": "from mod_python import apache", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 889, 0, 1, 0, 0, 889, 0, 0], "semantic": {"name": "mod_python", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85488:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85488:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85488:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85488:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.dispatch import Signal user_logged_in = Signal(providing_args=['request', 'user']) user_logged_out = Signal(providing_args=['request', 'user'])
ajibawa-2023/Python-Code-Large/train/row_85489
3
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85489:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "import_...
[]
import warnings from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured from django.test import TestCase class BackendTest(TestCase): backend ...
ajibawa-2023/Python-Code-Large/train/row_85490
248
356
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85490:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 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_85490:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85490:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85490:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85490:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm from django.test import TestCase class UserCreationFormTest(TestCase): fixtures = ['authtestdata.json'] def test_use...
ajibawa-2023/Python-Code-Large/train/row_85491
139
270
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85491:ImportFrom_L1_C0", "label": "from django.contrib.auth.models import User", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0037, 0.0037, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "django.contrib.auth.models", "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85491:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85491:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85491:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85491:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-L...
from django.conf import settings from django.test import TestCase from django.contrib.auth.models import User, SiteProfileNotAvailable class ProfileTestCase(TestCase): fixtures = ['authtestdata.json'] def setUp(self): """Backs up the AUTH_PROFILE_MODULE""" self.old_AUTH_PROFILE_MODULE = getattr...
ajibawa-2023/Python-Code-Large/train/row_85492
21
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85492:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 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_85492:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85492:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85492:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85492:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.test import TestCase from django.contrib.auth import signals class SignalTestCase(TestCase): urls = 'django.contrib.auth.tests.urls' fixtures = ['authtestdata.json'] def listener_login(self, user, **kwargs): self.logged_in.append(user) def listener_logout(self, user, **kwargs): ...
ajibawa-2023/Python-Code-Large/train/row_85493
34
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85493:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85493:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85493:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85493:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85493:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.test import TestCase from django.contrib.auth.models import User, AnonymousUser from django.core.management import call_command from StringIO import StringIO class BasicTestCase(TestCase): def test_user(self): "Check that users can be created and can set their password" u = User.objects...
ajibawa-2023/Python-Code-Large/train/row_85494
61
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85494:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0105, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85494:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85494:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85494:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85494:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L...
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.contrib.auth.management import create_permissions from django.contrib.auth import models as auth_models from django.contrib.contenttypes import models as contenttypes_models from django.core.management import call...
ajibawa-2023/Python-Code-Large/train/row_85495
20
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85495:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 4], "level": 0, "parent": null, "vector": [7, 0, 0.0658, 0.1053, 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_85495:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85495:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85495:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85495:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.conf.urls.defaults import patterns from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.template import Template, RequestContext from django.views.decor...
ajibawa-2023/Python-Code-Large/train/row_85496
13
25
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85496:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import patterns", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "ar...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85496:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85496:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85496:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85496:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code...
from datetime import datetime from django.conf import settings from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.models import User from django.test import TestCase class RemoteUserTest(TestCase): urls = 'django.contrib.auth.tests.urls' middleware = 'django.contrib.auth.mid...
ajibawa-2023/Python-Code-Large/train/row_85497
100
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85497:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0059, 0.0059, 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_85497:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85497:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85497:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85497:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.tests.views import AuthViewsTestCase class LoginRequiredTestCase(AuthViewsTestCase): """ Tests the login_required decorators """ urls = 'django.contrib.auth.tests.urls' def testCalla...
ajibawa-2023/Python-Code-Large/train/row_85498
26
46
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85498:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 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_85498:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85498:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85498:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85498:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.test import TestCase class TokenGeneratorTest(TestCase): def test_make_token(self): """ ...
ajibawa-2023/Python-Code-Large/train/row_85499
53
85
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85499:ImportFrom_L1_C0", "label": "from datetime import date, timedelta", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0118, 0, 0.66, 0.0, 426, 0, 2, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85499:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85499:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85499:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85499:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Cod...
import os import re import urllib from django.conf import settings from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.test import Test...
ajibawa-2023/Python-Code-Large/train/row_85500
251
413
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85500:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0024, 0.0024, 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_85500:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85500:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85500:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85500:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.contrib.auth.tests.auth_backends import (BackendTest, RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest, NoBackendsTest, InActiveUserBackendTest, NoInActiveUserBackendTest) from django.contrib.auth.tests.basic import BasicTestCase from django.contrib.auth.tests.decorators imp...
ajibawa-2023/Python-Code-Large/train/row_85501
10
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_85501:ImportFrom_L1_C0", "label": "from django.contrib.auth.tests.auth_backends import BackendTest, RowlevelBackendTest, AnonymousUserBackendTest\u2026", "type": "import", "loc": [1, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1667, 0, 0.66, 0.0, 769, 0, ...
[]
# These URLs are normally mapped to /admin/urls.py. This URLs file is # provided as a convenience to those who want to deploy these URLs elsewhere. # This file is also used to provide a reliable view deployment for test purposes. from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^login/$', 'dj...
ajibawa-2023/Python-Code-Large/train/row_85502
2
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_85502:ImportFrom_L5_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0588, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n...
[]
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class LazyUser(object): def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from django.contrib.auth import get_user request._cached_user = get_user(request) ...
ajibawa-2023/Python-Code-Large/train/row_85503
34
81
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85503:ImportFrom_L1_C0", "label": "from django.contrib import auth", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0123, 0.0123, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85503:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85503:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85503:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85503:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
import urlparse try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.decorators import available_attrs def user_passes_test(test_func, login...
ajibawa-2023/Python-Code-Large/train/row_85504
31
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_85504:Import_L1_C0", "label": "urlparse import urlparse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlpars...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85504:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85504:ImportFrom_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85504:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85504:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.db import transaction from django.conf import settings from django.contrib import admin from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm from django.contrib.auth.models import User, Group from django.contrib import messages from django.core.exceptions import Pe...
ajibawa-2023/Python-Code-Large/train/row_85505
81
156
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85505:ImportFrom_L1_C0", "label": "from django.db import transaction", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0064, 0.0064, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85505:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85505:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85505:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85505:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Management utility to create superusers. """ import getpass import re import sys from optparse import make_option from django.contrib.auth.models import User from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _ RE_V...
ajibawa-2023/Python-Code-Large/train/row_85506
72
137
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85506:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0146, 0.0219, 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_85506:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85506:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85506:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85506:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User import getpass class Command(BaseCommand): help = "Change a user's password for django.contrib.auth." requires_model_validation = False def _get_pass(self, prompt="Password: "): p = getpa...
ajibawa-2023/Python-Code-Large/train/row_85507
31
48
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85507:ImportFrom_L1_C0", "label": "from django.core.management.base import BaseCommand, CommandError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 931, 0, 2, 0, 0, 931, 0, 0], "semantic": {"name": "django.c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85507:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85507:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85507:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85507:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
ajibawa-2023/Python-Code-Large/train/row_85508
39
76
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85508:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0263, 0.0395, 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_85508:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85508:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85508:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85508:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-...
from datetime import date from django.conf import settings from django.utils.hashcompat import sha_constructor from django.utils.http import int_to_base36, base36_to_int from django.utils.crypto import constant_time_compare, salted_hmac class PasswordResetTokenGenerator(object): """ Strategy object used to ge...
ajibawa-2023/Python-Code-Large/train/row_85509
39
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85509:ImportFrom_L1_C0", "label": "from datetime import date", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0122, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["da...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85509:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85509:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85509:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85509:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.http import base36_to_int from django.utils.translation impo...
ajibawa-2023/Python-Code-Large/train/row_85510
126
254
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85510:Import_L1_C0", "label": "urlparse import urlparse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0039, 0.0039, 0, 0.66, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlpars...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85510:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85510:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85510:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85510:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code...
from django.db import models from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ class Redirect(models.Model): site = models.ForeignKey(Site) old_path = models.CharField(_('redirect from'), max_length=200, db_index=True, help_text=_("This should be an ab...
ajibawa-2023/Python-Code-Large/train/row_85512
15
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85512:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["mode...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85512:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85512:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85512:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85512:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.contrib.redirects.models import Redirect from django import http from django.conf import settings class RedirectFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a redirect for non-404 re...
ajibawa-2023/Python-Code-Large/train/row_85513
19
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_85513:ImportFrom_L1_C0", "label": "from django.contrib.redirects.models import Redirect", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 909, 0, 1, 0, 0, 909, 0, 0], "semantic": {"name": "django.contrib.redirect...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85513:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85513:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85513:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85513:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.contrib import admin from django.contrib.redirects.models import Redirect class RedirectAdmin(admin.ModelAdmin): list_display = ('old_path', 'new_path') list_filter = ('site',) search_fields = ('old_path', 'new_path') radio_fields = {'site': admin.VERTICAL} admin.site.register(Redirect, R...
ajibawa-2023/Python-Code-Large/train/row_85514
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_85514:ImportFrom_L2_C0", "label": "from django.contrib import admin", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85514:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85514:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85514:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85514:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Empty models.py to allow for specifying admindocs as a test label.
ajibawa-2023/Python-Code-Large/train/row_85515
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
from django.db import models class CustomField(models.Field): description = "A custom field type" class DescriptionLackingField(models.Field): pass
ajibawa-2023/Python-Code-Large/train/row_85516
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_85516:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85516:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85516:Assign_L4_C4"}]
from django.contrib.admindocs import views from django.db.models import fields as builtin_fields from django.utils import unittest import fields class TestFieldType(unittest.TestCase): def setUp(self): pass def test_field_name(self): self.assertRaises(AttributeError, views.get_re...
ajibawa-2023/Python-Code-Large/train/row_85517
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_85517:ImportFrom_L1_C0", "label": "from django.contrib.admindocs import views", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 601, 0, 1, 0, 0, 601, 0, 0], "semantic": {"name": "django.contrib.admindocs", "arg...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85517:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85517:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85517:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85517:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-C...
from django.conf.urls.defaults import * from django.contrib.admindocs import views urlpatterns = patterns('', url('^$', views.doc_index, name='django-admindocs-docroot' ), url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets' ), url('^tags/$...
ajibawa-2023/Python-Code-Large/train/row_85518
3
41
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85518:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n...
[]
"Misc. utility functions/classes for admin documentation generator." import re from email.Parser import HeaderParser from email.Errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import smart_str try: import docutils....
ajibawa-2023/Python-Code-Large/train/row_85519
69
105
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85519:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0095, 0.0095, 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_85519:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85519:Import_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85519:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85519:Import_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from django.db import models from django.utils.translation import ugettext_lazy as _ SITE_CACHE = {} class SiteManager(models.Manager): def get_current(self): """ Returns the current ``Site`` based on the SITE_ID in the project's settings. The ``Site`` object is cached the first ...
ajibawa-2023/Python-Code-Large/train/row_85521
50
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85521:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0105, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85521:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85521:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85521:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85521:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
from django.conf import settings from django.contrib.sites.models import Site, RequestSite, get_current_site from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.test import TestCase class SitesFrameworkTests(TestCase): def setUp(self): Site(id=settings.SI...
ajibawa-2023/Python-Code-Large/train/row_85522
37
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_85522:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 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_85522:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85522:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85522:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85522:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
ajibawa-2023/Python-Code-Large/train/row_85523
24
41
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85523:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 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_85523:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85523:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85523:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85523:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.contrib import admin from django.contrib.sites.models import Site class SiteAdmin(admin.ModelAdmin): list_display = ('domain', 'name') search_fields = ('domain', 'name') admin.site.register(Site, SiteAdmin)
ajibawa-2023/Python-Code-Large/train/row_85524
6
9
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85524:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85524:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85524:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85524:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85524:Assign_L7_C4"}]
""" Creates the default Site object. """ from django.db.models import signals from django.contrib.sites.models import Site from django.contrib.sites import models as site_app def create_default_site(app, created_models, verbosity, db, **kwargs): if Site in created_models: if verbosity >= 2: pr...
ajibawa-2023/Python-Code-Large/train/row_85525
12
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_85525:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1176, 0.1765, 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_85525:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85525:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85525:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85525:If_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from django.contrib.admin.filterspecs import FilterSpec from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.util import quote, get_fields_from_path from django.core.exceptions import SuspiciousOperation from django.core.paginator import InvalidPage from django.db import models f...
ajibawa-2023/Python-Code-Large/train/row_85526
179
285
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85526:ImportFrom_L1_C0", "label": "from django.contrib.admin.filterspecs import FilterSpec", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0035, 0, 0.66, 0.0, 229, 0, 1, 0, 0, 229, 0, 0], "semantic": {"name": "django.contrib.adm...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85526:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85526:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85526:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85526:Return_L34_C9"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.utils.translation import ugettext as _ from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth.views import login from django.contrib.auth import RE...
ajibawa-2023/Python-Code-Large/train/row_85527
15
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_85527:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 4], "level": 0, "parent": null, "vector": [7, 0, 0.0781, 0.125, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85527:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85527:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85527:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85527:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy, ugettext as _ ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. " ...
ajibawa-2023/Python-Code-Large/train/row_85528
24
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_85528:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85528:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85528:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85528:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85528:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.contrib.admin.util import quote from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode from django.utils.safestring import mark...
ajibawa-2023/Python-Code-Large/train/row_85529
44
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_85529:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85529:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85529:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85529:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85529:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-...
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
ajibawa-2023/Python-Code-Large/train/row_85530
33
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85530:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0213, 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_85530:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85530:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85530:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85530:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code...
""" FilterSpec encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ from django.db import models from djan...
ajibawa-2023/Python-Code-Large/train/row_85531
133
279
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85531:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0143, 0.0251, 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_85531:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85531:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85531:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85531:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django import template register = template.Library() def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and inlines. """ prepopulated_fields = [] if context['add'] and 'adminform'...
ajibawa-2023/Python-Code-Large/train/row_85532
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_85532:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["te...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85532:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85532:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85532:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85532:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.template import Library from django.templatetags.static import PrefixNode register = Library() @register.simple_tag def admin_media_prefix(): """ Returns the string contained in the setting ADMIN_MEDIA_PREFIX. """ return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX")
ajibawa-2023/Python-Code-Large/train/row_85533
6
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_85533:ImportFrom_L1_C0", "label": "from django.template import Library", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "im...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85533:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85533:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85533:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85533:Return_L11_C4"}]
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
ajibawa-2023/Python-Code-Large/train/row_85534
29
57
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85534:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0175, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["te...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85534:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85534:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85534:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85534:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code...
import datetime from django.conf import settings from django.contrib.admin.util import lookup_field, display_for_field, label_for_field from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE, ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR) from django.core.exceptions import ObjectDoesNotExis...
ajibawa-2023/Python-Code-Large/train/row_85535
178
330
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85535:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85535:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85535:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85535:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85535:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django import forms from django.conf import settings from django.contrib.admin.util import (flatten_fieldsets, lookup_field, display_for_field, label_for_field, help_text_for_field) from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db.m...
ajibawa-2023/Python-Code-Large/train/row_85538
234
344
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85538:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0029, 0.0029, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85538:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85538:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85538:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85538:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django import forms, template from django.forms.formsets import all_valid from django.forms.models import (modelform_factory, modelformset_factory, inlineformset_factory, BaseInlineFormSet) from django.contrib.contenttypes.models import ContentType from django.contrib.admin import widgets, helpers from django....
ajibawa-2023/Python-Code-Large/train/row_85539
712
1,349
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85539:ImportFrom_L1_C0", "label": "from django import forms, template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0007, 0.0007, 0, 0.66, 0.0, 294, 0, 2, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85539:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85539:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85539:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85539:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import re from django import http, template from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.contenttypes import views as contenttype_views from django.views.decorators.csrf import ...
ajibawa-2023/Python-Code-Large/train/row_85540
187
432
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85540:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 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_85540:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85540:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85540:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85540:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Form Widget classes specific to the Django admin site. """ import django.utils.copycompat as copy from django import forms from django.forms.widgets import RadioFieldRenderer from django.forms.util import flatatt from django.utils.html import escape from django.utils.text import truncate_words from django.utils.t...
ajibawa-2023/Python-Code-Large/train/row_85541
208
296
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85541:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0068, 0.0101, 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_85541:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85541:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85541:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85541:ClassDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInli...
ajibawa-2023/Python-Code-Large/train/row_85542
17
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85542:ImportFrom_L3_C0", "label": "from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.0, 140, 0, 1, 0, 0, 140, 0, 0], "semantic": {"name": "django.contr...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85542:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85542:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85542:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85542:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" Built-in, globally-available admin actions. """ from django import template from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.shortcuts import render_to_resp...
ajibawa-2023/Python-Code-Large/train/row_85543
35
85
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85543:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0235, 0.0353, 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_85543:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85543:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85543:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85543:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code...
import cStringIO, zipfile from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = cStringIO.StringIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('doc....
ajibawa-2023/Python-Code-Large/train/row_85544
21
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_85544:Import_L1_C0", "label": "cStringIO import cStringIO, zipfile", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 764, 0, 2, 0, 0, 764, 0, 0], "semantic": {"name": "cStringIO", "arg_names": [], "import_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85544:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85544:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85544:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85544:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.db import connection if (hasattr(connection.ops, 'spatial_version') and not connection.ops.mysql): # Getting the `SpatialRefSys` and `GeometryColumns` # models for the default spatial backend. These # aliases are provided for backwards-compatibility. SpatialRefSys = connection.ops.spat...
ajibawa-2023/Python-Code-Large/train/row_85545
4
9
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85545:ImportFrom_L1_C0", "label": "from django.db import connection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85545:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85545:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85545:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85545:Assign_L9_C4"}]
from django.core import urlresolvers from django.contrib.sitemaps import Sitemap class GeoRSSSitemap(Sitemap): """ A minimal hook to produce sitemaps for GeoRSS feeds. """ def __init__(self, feed_dict, slug_dict=None): """ This sitemap object initializes on a feed dictionary (as would b...
ajibawa-2023/Python-Code-Large/train/row_85546
25
53
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85546:ImportFrom_L1_C0", "label": "from django.core import urlresolvers", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "impor...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85546:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85546:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85546:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85546:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.core import urlresolvers from django.contrib.sitemaps import Sitemap from django.contrib.gis.db.models.fields import GeometryField from django.db import models class KMLSitemap(Sitemap): """ A minimal hook to produce KML sitemaps. """ geo_format = 'kml' def __init__(self, locations=Non...
ajibawa-2023/Python-Code-Large/train/row_85547
35
63
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85547:ImportFrom_L1_C0", "label": "from django.core import urlresolvers", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "impor...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85547:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85547:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85547:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85547:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
ajibawa-2023/Python-Code-Large/train/row_85548
68
111
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85548:ImportFrom_L1_C0", "label": "from django.http import HttpResponse, Http404", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.009, 0, 0.66, 0.0, 779, 0, 2, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85548:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85548:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85548:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85548:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code...
# Geo-enabled Sitemap classes. from django.contrib.gis.sitemaps.georss import GeoRSSSitemap from django.contrib.gis.sitemaps.kml import KMLSitemap, KMZSitemap
ajibawa-2023/Python-Code-Large/train/row_85549
2
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85549:ImportFrom_L2_C0", "label": "from django.contrib.gis.sitemaps.georss import GeoRSSSitemap", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.25, 0, 0.66, 0.0, 81, 0, 1, 0, 0, 81, 0, 0], "semantic": {"name": "django.contrib.gis.s...
[]
from django.contrib.gis.geos import \ GEOSGeometry as Geometry, \ GEOSException as GeometryException
ajibawa-2023/Python-Code-Large/train/row_85550
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_85550:ImportFrom_L1_C0", "label": "from django.contrib.gis.geos import Geometry, GeometryException", "type": "import", "loc": [1, 3], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 1.0, 0, 0.66, 0.0, 886, 0, 2, 0, 0, 886, 0, 0], "semantic": {"name": "django.contri...
[]
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend') except ImportError, e: ...
ajibawa-2023/Python-Code-Large/train/row_85551
3
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85551:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names"...
[]
import re # Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure # to prevent potentially malicious input from reaching the underlying C # library. Not a substitute for good Web security programming practices. hex_regex = re.compile(r'^[0-9A-F]+$', re.I) wkt_regex = re.compile(r'^(SRID=(?P<srid...
ajibawa-2023/Python-Code-Large/train/row_85552
4
12
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85552:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[]
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from math import pi, sin, cos, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 180. / pi class GoogleZoom(object): ...
ajibawa-2023/Python-Code-Large/train/row_85553
70
161
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85553:ImportFrom_L1_C0", "label": "from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0062, 0.0062, 0, 0.66, 0.0, 886, 0, 4, 0, 0, 886, 0, 0], "semantic": {"name":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85553:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85553:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85553:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85553:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.utils.safestring import mark_safe from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon class GEvent(object): """ A Python wrapper for the Google GEvent object. Events can be attached to any object derived from GOverlayBase with the add_event() call. For ...
ajibawa-2023/Python-Code-Large/train/row_85554
98
301
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85554:ImportFrom_L1_C0", "label": "from django.utils.safestring import mark_safe", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0033, 0.0033, 0, 0.66, 0.0, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.safestring", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85554:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85554:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85554:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85554:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
ajibawa-2023/Python-Code-Large/train/row_85555
4
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_85555:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 58], "level": 0, "parent": null, "vector": [8, 0, 0.4836, 0.9508, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
from django.conf import settings from django.contrib.gis import geos from django.template.loader import render_to_string from django.utils.safestring import mark_safe class GoogleMapException(Exception): pass from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon # The default Google ...
ajibawa-2023/Python-Code-Large/train/row_85556
109
226
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85556:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0044, 0.0044, 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_85556:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85556:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85556:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85556:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class GeoFeedMixin(object): """ This mixin provides the necessary routines for SyndicationFeed subclasses to produce simple GeoRSS or W3C Geo elements. """ ...
ajibawa-2023/Python-Code-Large/train/row_85557
78
135
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85557:ImportFrom_L1_C0", "label": "from django.contrib.syndication.feeds import BaseFeed, FeedDoesNotExist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 211, 0, 2, 0, 0, 211, 0, 0], "semantic": {"name": "dj...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85557:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85557:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85557:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85557:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Utilities for manipulating Geometry WKT. """ def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated to that number: >>> pnt =...
ajibawa-2023/Python-Code-Large/train/row_85558
29
55
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85558:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0545, 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_85558:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85558:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85558:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85558:If_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
ajibawa-2023/Python-Code-Large/train/row_85559
169
361
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85559:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 40], "level": 0, "parent": null, "vector": [8, 0, 0.0568, 0.1108, 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_85559:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85559:Expr_L45_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85559:If_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85559:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. Author: Travis Pinney, Dane Springmeyer, & Justin Bronn """ from itertools import izip # Requires GDAL to use. from django.contrib.gis.gdal import DataSourc...
ajibawa-2023/Python-Code-Large/train/row_85560
90
225
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85560:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0178, 0.0311, 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_85560:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85560:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85560:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85560:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num_...
ajibawa-2023/Python-Code-Large/train/row_85561
31
53
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85561:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0566, 0.0943, 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_85561:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85561:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85561:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85561:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" This module contains useful utilities for GeoDjango. """ # Importing the utilities that depend on GDAL, if available. from django.contrib.gis.gdal import HAS_GDAL if HAS_GDAL: from django.contrib.gis.utils.ogrinfo import ogrinfo, sample from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect ...
ajibawa-2023/Python-Code-Large/train/row_85563
13
25
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85563:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.08, 0.12, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85563:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85563:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85563:If_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85563:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
from django.contrib.gis.gdal import SpatialReference from django.db import connections, DEFAULT_DB_ALIAS def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None, database=DEFAULT_DB_ALIAS): """ This function takes a GDAL SpatialReference system and adds its information ...
ajibawa-2023/Python-Code-Large/train/row_85564
20
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85564:ImportFrom_L1_C0", "label": "from django.contrib.gis.gdal import SpatialReference", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 793, 0, 1, 0, 0, 793, 0, 0], "semantic": {"name": "django.contrib.gis.gdal...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85564:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85564:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85564:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85564:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap from models import City, Country from feeds import feed_dict sitemaps = {'kml' : KMLSitemap([City, Country]), 'kmz' : KMZSitemap([City, Country]), 'georss' : GeoRSSSitemap(feed_dict), }
ajibawa-2023/Python-Code-Large/train/row_85565
4
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85565:ImportFrom_L1_C0", "label": "from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 123, 0, 3, 0, 0, 123, 0, 0], "semantic": {"name":...
[]
from django.contrib.gis.db import models from django.contrib.gis.tests.utils import mysql, spatialite # MySQL spatial indices can't handle NULL geometries. null_flag = not mysql class Country(models.Model): name = models.CharField(max_length=30) mpoly = models.MultiPolygonField() # SRID, by default, is 4326 ...
ajibawa-2023/Python-Code-Large/train/row_85566
41
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_85566:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85566:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85566:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85566:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85566:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import re from django.db import connection from django.contrib.gis import gdal from django.contrib.gis.geos import fromstr, GEOSGeometry, \ Point, LineString, LinearRing, Polygon, GeometryCollection from django.contrib.gis.measure import Distance from django.contrib.gis.tests.utils import \ no_mysql, no_oracle,...
ajibawa-2023/Python-Code-Large/train/row_85567
431
735
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85567:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0014, 0.0014, 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_85567:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85567:ImportFrom_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85567:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85567:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.contrib.gis import feeds from django.contrib.gis.tests.utils import mysql from models import City, Country class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/...
ajibawa-2023/Python-Code-Large/train/row_85568
33
63
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85568:ImportFrom_L1_C0", "label": "from django.contrib.gis import feeds", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "django.contrib.gis", "arg_names": [],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85568:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85568:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85568:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85568:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.conf.urls.defaults import * from feeds import feed_dict urlpatterns = patterns('', (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feed_dict}), ) from sitemaps import sitemaps urlpatterns += patterns('django.contrib.gis.sitemaps.views', (r'^sitemap.xml$', 'index', ...
ajibawa-2023/Python-Code-Large/train/row_85569
4
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85569:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n...
[]
from django.contrib.gis.db import models class City3D(models.Model): name = models.CharField(max_length=30) point = models.PointField(dim=3) objects = models.GeoManager() def __unicode__(self): return self.name class Interstate2D(models.Model): name = models.CharField(max_length=30) l...
ajibawa-2023/Python-Code-Large/train/row_85570
52
69
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85570:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85570:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85570:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85570:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85570:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import os import re from django.utils.unittest import TestCase from django.contrib.gis.db.models import Union, Extent3D from django.contrib.gis.geos import GEOSGeometry, Point, Polygon from django.contrib.gis.utils import LayerMapping, LayerMapError from models import City3D, Interstate2D, Interstate3D, \ Intersta...
ajibawa-2023/Python-Code-Large/train/row_85571
120
231
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85571:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 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_85571:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85571:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85571:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85571:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Co...
# Create your views here.
ajibawa-2023/Python-Code-Large/train/row_85572
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
from django.contrib.gis.db import models class SouthTexasCity(models.Model): "City model on projected coordinate system for South Texas." name = models.CharField(max_length=30) point = models.PointField(srid=32140) objects = models.GeoManager() def __unicode__(self): return self.name class SouthTe...
ajibawa-2023/Python-Code-Large/train/row_85573
50
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_85573:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85573:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85573:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85573:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85573:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
import os from decimal import Decimal from django.db import connection from django.db.models import Q from django.contrib.gis.geos import GEOSGeometry, Point, LineString from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_s...
ajibawa-2023/Python-Code-Large/train/row_85574
191
358
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85574:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 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_85574:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85574:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85574:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85574:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.contrib.gis.db import models class City(models.Model): name = models.CharField(max_length=30) point = models.PointField(geography=True) objects = models.GeoManager() def __unicode__(self): return self.name class Zipcode(models.Model): code = models.CharField(max_length=10) poly = m...
ajibawa-2023/Python-Code-Large/train/row_85575
20
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85575:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85575:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85575:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85575:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85575:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Tests for geography support in PostGIS 1.5+ """ import os from django.contrib.gis import gdal from django.contrib.gis.measure import D from django.test import TestCase from models import City, County, Zipcode class GeographyTest(TestCase): def test01_fixture_load(self): "Ensure geography features load...
ajibawa-2023/Python-Code-Large/train/row_85576
53
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_85576:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0345, 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_85576:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85576:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85576:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85576:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co...