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 |
|---|---|---|---|---|---|---|---|
import re
from django.utils.text import compress_sequence, compress_string
from django.utils.cache import patch_vary_headers
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header accor... | ajibawa-2023/Python-Code-Large/train/row_83272 | 30 | 52 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83272:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.0192, 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_83272:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83272:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83272:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83272:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.conf import settings
from django import http
class XViewMiddleware(object):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and ... | ajibawa-2023/Python-Code-Large/train/row_83273 | 10 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83273:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83273:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83273:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83273:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83273:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
"""
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import hashlib
import logging
import re
import random
from django.conf import settings
from django.core.urlresolvers import g... | ajibawa-2023/Python-Code-Large/train/row_83274 | 90 | 229 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83274:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0153, 0.0262, 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_83274:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83274:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83274:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83274:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code... |
import hashlib
import logging
import re
from django.conf import settings
from django import http
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.utils import six
from django.core import urlresolvers
logger = logging.getLogger('django.request')
class CommonMiddleware(ob... | ajibawa-2023/Python-Code-Large/train/row_83275 | 82 | 167 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83275:Import_L1_C0", "label": "hashlib import hashlib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83275:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83275:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83275:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83275:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... | ajibawa-2023/Python-Code-Large/train/row_83276 | 22 | 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_83276:ImportFrom_L1_C0", "label": "from django.db import transaction", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 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_83276:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83276:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83276:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83276:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
class XFrameOptionsMiddleware(object):
"""
Middleware that sets the X-Frame-Options HTTP heade... | ajibawa-2023/Python-Code-Large/train/row_83277 | 14 | 51 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83277:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0686, 0.1176, 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_83277:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83277:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83277:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83277:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | ajibawa-2023/Python-Code-Large/train/row_83278 | 95 | 213 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83278:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 49], "level": 0, "parent": null, "vector": [8, 0, 0.1174, 0.23, 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_83278:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83278:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83278:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83278:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.template import Library
from django.template.defaulttags import url as default_url, ssi as default_ssi
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return default_ssi(parser, token)
@register.tag
def url(parser, toke... | ajibawa-2023/Python-Code-Large/train/row_83279 | 7 | 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_83279:ImportFrom_L1_C0", "label": "from django.template import Library", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 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_83279:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83279:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83279:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83279:Return_L14_C4"}] |
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import formats
from django.utils.encoding import force_text
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Forces a value to be rendered as a localized value,
regardle... | ajibawa-2023/Python-Code-Large/train/row_83280 | 34 | 62 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83280:ImportFrom_L1_C0", "label": "from django.template import Node", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83280:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83280:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83280:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83280:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
try:
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
from django import template
from django.template.base import Node
from django.utils.encoding import iri_to_uri
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
... | ajibawa-2023/Python-Code-Large/train/row_83281 | 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_83281:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 4], "level": 0, "parent": null, "vector": [7, 0, 0.0155, 0.0248, 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_83281:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83281:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83281:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83281:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from datetime import datetime, tzinfo
try:
import pytz
except ImportError:
pytz = None
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import six
from django.utils import timezone
register = Library()
# HACK: datetime is an old-style class, create... | ajibawa-2023/Python-Code-Large/train/row_83282 | 85 | 197 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83282:ImportFrom_L1_C0", "label": "from datetime import datetime, tzinfo", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 426, 0, 2, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83282:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83282:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83282:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83282:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8... |
from __future__ import unicode_literals
import re
from django.template import (Node, Variable, TemplateSyntaxError,
TokenParser, Library, TOKEN_TEXT, TOKEN_VAR)
from django.template.base import _render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six
from django.ut... | ajibawa-2023/Python-Code-Large/train/row_83283 | 221 | 479 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83283:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83283:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83283:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83283:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83283:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-... |
from __future__ import unicode_literals
import hashlib
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
from django.template import resolve_variable
from django.core.cache import cache
from django.utils.encoding import force_bytes
from django.utils.http import urlquote
re... | ajibawa-2023/Python-Code-Large/train/row_83284 | 34 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83284:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83284:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83284:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83284:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83284:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
"""
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import decimal
import yaml
from io import StringIO
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSerializer
fr... | ajibawa-2023/Python-Code-Large/train/row_83285 | 34 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83285:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0448, 0.0746, 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_83285:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83285:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83285:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83285:Return_L20_C8"}, {"f": "ajibawa-2023/Python-... |
"""
Serialize data to/from JSON
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
import datetime
import decimal
import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSerializer
from django.... | ajibawa-2023/Python-Code-Large/train/row_83286 | 71 | 107 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83286:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0187, 0.028, 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_83286:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83286:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83286:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83286:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""
XML serializer.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.serializers import base
from django.db import models, DEFAULT_DB_ALIAS
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import smart_text
from xml.dom import pulldom
from x... | ajibawa-2023/Python-Code-Large/train/row_83287 | 220 | 387 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83287:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0078, 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_83287:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83287:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83287:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83287:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.serializers import base
from django.db... | ajibawa-2023/Python-Code-Large/train/row_83288 | 86 | 154 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83288:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0195, 0.0325, 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_83288:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83288:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83288:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83288:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""
Module for abstract serializer/unserializer base classes.
"""
from django.db import models
from django.utils.encoding import smart_text
from django.utils import six
class SerializerDoesNotExist(KeyError):
"""The requested serializer was not found."""
pass
class SerializationError(Exception):
"""Somet... | ajibawa-2023/Python-Code-Large/train/row_83289 | 84 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83289:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0116, 0.0174, 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_83289:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83289:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83289:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83289:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_query_set)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | ajibawa-2023/Python-Code-Large/train/row_83290 | 59 | 125 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83290:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 17], "level": 0, "parent": null, "vector": [8, 0, 0.072, 0.136, 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_83290:Try_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83290:Import_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83290:Try_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83290:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
"""
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ i... | ajibawa-2023/Python-Code-Large/train/row_83291 | 42 | 75 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83291:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.06, 0.1067, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83291:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83291:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83291:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83291:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python... |
from __future__ import unicode_literals
import mimetypes
import os
import random
import sys
import time
from email import charset as Charset, encoders as Encoders
from email.generator import Generator
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBa... | ajibawa-2023/Python-Code-Large/train/row_83292 | 216 | 373 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83292:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0027, 0.0027, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83292:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83292:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83292:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83292:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code... |
"""
Email message and email sending related helper functions.
"""
import socket
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which slows down the restart of the server.
class CachedDnsName(object):
def __str__(self):
return self.get_fqdn()
def get_fqdn(sel... | ajibawa-2023/Python-Code-Large/train/row_83293 | 10 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83293:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1053, 0.1579, 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_83293:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83293:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83293:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83293:Return_L12_C8"}, {"f": "ajibawa-2023/Python-... |
"""
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(email_messages)
| ajibawa-2023/Python-Code-Large/train/row_83294 | 5 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83294:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.3333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83294:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83294:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83294:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83294:Return_L9_C8"}] |
"""
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream', sys.stdout)
self._loc... | ajibawa-2023/Python-Code-Large/train/row_83295 | 24 | 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_83295:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0625, 0.0938, 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_83295:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83295:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83295:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83295:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
"""SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.utils import DNS_NAME
from django.core.mail.message import sanitize_address
from django.utils.encoding import force_bytes
class... | ajibawa-2023/Python-Code-Large/train/row_83296 | 78 | 118 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83296:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0085, 0.0085, 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_83296:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83296:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83296:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83296:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... | ajibawa-2023/Python-Code-Large/train/row_83297 | 11 | 39 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83297:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0256, 0.0256, 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_83297:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83297:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83297:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83297:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# Mail backends shipped with Django.
| ajibawa-2023/Python-Code-Large/train/row_83298 | 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"] | [] | [] |
"""
Backend for test environment.
"""
from django.core import mail
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
"""A email backend for use during test sessions.
The test connection stores email messages in a dummy outbox,
rather than sending them out o... | ajibawa-2023/Python-Code-Large/train/row_83299 | 15 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83299:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.1154, 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_83299:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83299:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83299:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83299:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
from django.utils import six
class EmailBackend(ConsoleEmailBackend)... | ajibawa-2023/Python-Code-Large/train/row_83300 | 39 | 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_83300:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0167, 0.0167, 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_83300:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83300:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83300:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83300:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
"""
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be... | ajibawa-2023/Python-Code-Large/train/row_83301 | 41 | 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_83301:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.018, 0.027, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83301:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83301:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83301:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83301:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code... |
from __future__ import unicode_literals
import logging
import sys
import types
from django import http
from django.conf import settings
from django.core import exceptions
from django.core import urlresolvers
from django.core import signals
from django.utils.encoding import force_text
from django.utils.importlib impor... | ajibawa-2023/Python-Code-Large/train/row_83302 | 138 | 274 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83302:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0036, 0.0036, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83302:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83302:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83302:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83302:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from __future__ import unicode_literals
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures... | ajibawa-2023/Python-Code-Large/train/row_83303 | 141 | 268 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83303:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0037, 0.0037, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83303:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83303:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83303:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83303:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import functools
import re
fr... | ajibawa-2023/Python-Code-Large/train/row_83304 | 346 | 578 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83304:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0078, 0.0138, 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_83304:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83304:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83304:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83304:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-... |
from django.dispatch import Signal
request_started = Signal()
request_finished = Signal()
got_request_exception = Signal(providing_args=["request"])
| ajibawa-2023/Python-Code-Large/train/row_83305 | 4 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83305:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "import_na... | [] |
from math import ceil
from django.utils import six
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = ... | ajibawa-2023/Python-Code-Large/train/row_83306 | 100 | 163 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83306:ImportFrom_L1_C0", "label": "from math import ceil", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["ceil"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83306:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83306:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83306:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83306:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-... |
"""
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... | ajibawa-2023/Python-Code-Large/train/row_83307 | 73 | 185 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83307:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0378, 0.0703, 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_83307:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83307:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83307:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83307:If_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | ajibawa-2023/Python-Code-Large/train/row_83308 | 102 | 186 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83308:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0242, 0.043, 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_83308:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83308:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83308:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83308:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... | ajibawa-2023/Python-Code-Large/train/row_83309 | 94 | 211 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83309:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 34], "level": 0, "parent": null, "vector": [8, 0, 0.0829, 0.1611, 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_83309:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83309:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83309:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83309:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... | ajibawa-2023/Python-Code-Large/train/row_83310 | 7 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83310:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.2292, 0.4167, 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_83310:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83310:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83310:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83310:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-... |
from __future__ import unicode_literals
import re
try:
from urllib.parse import urlsplit, urlunsplit
except ImportError: # Python 2
from urlparse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encodin... | ajibawa-2023/Python-Code-Large/train/row_83311 | 102 | 197 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83311:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83311:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83311:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83311:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83311:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""
Global Django exception and warning classes.
"""
from functools import reduce
class DjangoRuntimeWarning(RuntimeWarning):
pass
class ObjectDoesNotExist(Exception):
"The requested object does not exist"
silent_variable_failure = True
class MultipleObjectsReturned(Exception):
"The query returned... | ajibawa-2023/Python-Code-Large/train/row_83312 | 52 | 99 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83312:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0202, 0.0303, 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_83312:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83312:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83312:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83312:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError: # Python 2
from urllib import urlretrieve
from optparse import make_option
from os import path
import django
fr... | ajibawa-2023/Python-Code-Large/train/row_83313 | 177 | 315 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83313:Import_L1_C0", "label": "cgi import cgi", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0032, 0, 0.66, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["cgi"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83313:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83313:ImportFrom_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83313:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83313:ImportFrom_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_all
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the CREATE TABLE, custom SQL and CREATE INDEX S... | ajibawa-2023/Python-Code-Large/train/row_83314 | 11 | 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_83314:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83314:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83314:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83314:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83314:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core import serializers
from django.db import router, DEFAULT_DB_ALIAS
from django.utils.datastructures import SortedDict
from optparse import make_option
class Command(BaseCommand):
... | ajibawa-2023/Python-Code-Large/train/row_83315 | 109 | 196 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83315:ImportFrom_L1_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.except... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83315:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83315:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83315:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83315:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import os
from django.core.management.base import NoArgsCommand
from optparse import make_option
class Command(NoArgsCommand):
shells = ['ipython', 'bpython']
option_list = NoArgsCommand.option_list + (
make_option('--plain', action='store_true', dest='plain',
help='Tells Django to use pl... | ajibawa-2023/Python-Code-Large/train/row_83316 | 45 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83316:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0108, 0.0108, 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_83316:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83316:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83316:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83316:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from __future__ import unicode_literals
import codecs
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.utils._os import npath
def has_bom(fn):
with open(fn, 'rb') as f:
sample = f.read(4)
return sample[:3] == b'\xef\xbb... | ajibawa-2023/Python-Code-Large/train/row_83317 | 41 | 66 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83317:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0152, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83317:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83317:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83317:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83317:Return_L13_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.core.management.base import NoArgsCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"Converts a module namespace to a Python dictionary. Used by get_settings_diff."
return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
class Command(NoArgsComm... | ajibawa-2023/Python-Code-Large/train/row_83318 | 19 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83318:ImportFrom_L1_C0", "label": "from django.core.management.base import NoArgsCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.manageme... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83318:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83318:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83318:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83318:Return_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from __future__ import unicode_literals
import keyword
import re
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
from django.utils import six
class Command(NoArgsCommand):
help = "Introspects the database tab... | ajibawa-2023/Python-Code-Large/train/row_83319 | 139 | 224 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83319:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0045, 0.0045, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83319:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83319:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83319:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83319:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | ajibawa-2023/Python-Code-Large/train/row_83320 | 42 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83320:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0109, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83320:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83320:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83320:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83320:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
option_lis... | ajibawa-2023/Python-Code-Large/train/row_83321 | 11 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83321:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83321:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83321:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83321:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83321:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Validates all installed models."
requires_model_validation = False
def handle_noargs(self, **options):
self.validate(display_num_errors=True)
| ajibawa-2023/Python-Code-Large/train/row_83322 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83322:ImportFrom_L1_C0", "label": "from django.core.management.base import NoArgsCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.management.bas... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83322:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83322:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83322:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83322:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
args = '[various KEY=val options, use `runfcgi help` for help]'
def handle(self, *args, **options):
from django.conf import settings
from djan... | ajibawa-2023/Python-Code-Large/train/row_83323 | 14 | 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_83323:ImportFrom_L1_C0", "label": "from django.core.management.base import BaseCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.management.bas... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83323:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83323:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83323:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83323:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_indexes
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the CREATE INDEX SQL statements for the give... | ajibawa-2023/Python-Code-Large/train/row_83324 | 11 | 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_83324:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83324:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83324:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83324:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83324:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
import django
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.text import get_text_list
from django.utils.jslex import prep... | ajibawa-2023/Python-Code-Large/train/row_83325 | 223 | 396 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83325:Import_L1_C0", "label": "fnmatch import fnmatch", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0025, 0.0025, 0, 0.66, 0.0, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "fnmatch", "arg_names": [], "import_names": ["fnmatch"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83325:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83325:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83325:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83325:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_create
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the CREATE TABLE SQL statements for the given... | ajibawa-2023/Python-Code-Large/train/row_83326 | 11 | 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_83326:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83326:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83326:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83326:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83326:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.core.management.sql import sql_flush
from django.db import connections, DEFAULT_DB_ALIAS
class Command(NoArgsCommand):
help = "Returns a list of the SQL statements required t... | ajibawa-2023/Python-Code-Large/train/row_83327 | 11 | 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_83327:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83327:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83327:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83327:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83327:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.db import connections, models, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = 'Prints the SQL statements for resetting sequences for the given app name(s).'
option_list... | ajibawa-2023/Python-Code-Large/train/row_83328 | 11 | 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_83328:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83328:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83328:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83328:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83328:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
import logging
import sys
import os
from optparse import make_option, OptionParser
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput',
... | ajibawa-2023/Python-Code-Large/train/row_83329 | 45 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83329:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0109, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83329:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83329:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83329:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83329:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from __future__ import unicode_literals
import sys
import os
import gzip
import zipfile
from optparse import make_option
import traceback
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_s... | ajibawa-2023/Python-Code-Large/train/row_83330 | 134 | 264 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83330:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0038, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83330:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83330:Import_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83330:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83330:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from optparse import make_option
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import LabelCommand, CommandError
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.db.utils import DatabaseError
from django.utils.encoding import fo... | ajibawa-2023/Python-Code-Large/train/row_83331 | 44 | 66 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83331:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0152, 0.0152, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83331:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83331:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83331:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83331:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.crypto import get_random_string
from django.utils.importlib import import_module
class Command(TemplateCommand):
help = ("Creates a Django project directory structure for the given "... | ajibawa-2023/Python-Code-Large/train/row_83332 | 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_83332:ImportFrom_L1_C0", "label": "from django.core.management.base import CommandError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.managemen... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83332:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83332:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83332:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83332:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.importlib import import_module
class Command(TemplateCommand):
help = ("Creates a Django app directory structure for the given app "
"name in the current directory or opt... | ajibawa-2023/Python-Code-Large/train/row_83333 | 10 | 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_83333:ImportFrom_L1_C0", "label": "from django.core.management.base import CommandError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.management.ba... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83333:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83333:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83333:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83333:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_delete
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the DROP TABLE SQL statements for the given a... | ajibawa-2023/Python-Code-Large/train/row_83334 | 11 | 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_83334:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83334:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83334:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83334:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83334:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells Django to NOT prompt the user for input of any... | ajibawa-2023/Python-Code-Large/train/row_83335 | 18 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83335:ImportFrom_L1_C0", "label": "from django.core.management.base import BaseCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0222, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.management... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83335:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83335:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83335:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83335:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_custom
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the custom table modifying SQL statements for... | ajibawa-2023/Python-Code-Large/train/row_83336 | 11 | 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_83336:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83336:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83336:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83336:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83336:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from optparse import make_option
import traceback
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
f... | ajibawa-2023/Python-Code-Large/train/row_83337 | 95 | 163 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83337:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83337:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83337:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83337:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83337:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.core.management.base import AppCommand, CommandError
class Command(AppCommand):
help = "RENAMED: see 'sqlcustom'"
def handle(self, *apps, **options):
raise CommandError("This command has been renamed. Use the 'sqlcustom' command instead.")
| ajibawa-2023/Python-Code-Large/train/row_83338 | 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_83338:ImportFrom_L1_C0", "label": "from django.core.management.base import AppCommand, CommandError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 931, 0, 2, 0, 0, 931, 0, 0], "semantic": {"name": "django.co... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83338:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83338:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83338:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83338:FunctionDef_L6_C4"}] |
from optparse import make_option
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.utils import autoreload
naiveip_re = re.com... | ajibawa-2023/Python-Code-Large/train/row_83339 | 71 | 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_83339:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0073, 0.0073, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83339:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83339:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83339:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83339:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import warnings
from django.contrib.sessions.management.commands import clearsessions
class Command(clearsessions.Command):
def handle_noargs(self, **options):
warnings.warn(
"The `cleanup` command has been deprecated in favor of `clearsessions`.",
PendingDeprecationWarning)
... | ajibawa-2023/Python-Code-Large/train/row_83340 | 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_83340:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 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_83340:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83340:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83340:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83340:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from __future__ import unicode_literals
import codecs
import os
import re
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
from django.utils._os import upath
def sql_create(app, style, connection):
"Returns... | ajibawa-2023/Python-Code-Large/train/row_83341 | 117 | 195 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83341:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83341:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83341:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83341:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83341:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color, and False
otherwise.
"""
unsupported_platform = (sys.platform in ('win32', 'Pocket PC'))
# isatty is not ... | ajibawa-2023/Python-Code-Large/train/row_83342 | 32 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83342:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.06, 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_83342:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83342:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83342:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83342:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code... |
import collections
import sys
from django.conf import settings
from django.core.management.color import color_style
from django.utils.encoding import force_str
from django.utils.itercompat import is_iterable
from django.utils import six
class ModelErrorCollection:
def __init__(self, outfile=sys.stdout):
... | ajibawa-2023/Python-Code-Large/train/row_83343 | 230 | 363 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83343:Import_L1_C0", "label": "collections import collections", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 0, 0.66, 0.0, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83343:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83343:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83343:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83343:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from optparse import make_option, OptionParser
import traceback
import django
from django.core.exceptions import ImproperlyConfigured
from django.core.managem... | ajibawa-2023/Python-Code-Large/train/row_83344 | 145 | 392 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83344:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0077, 0.0128, 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_83344:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83344:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83344:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83344:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... | ajibawa-2023/Python-Code-Large/train/row_83345 | 202 | 469 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83345:Import_L1_C0", "label": "collections import collections", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 0, 0.66, 0.0, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83345:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83345:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83345:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83345:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code... |
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application():
"""
The public interface to Django's WSGI support. Should return a WSGI
callable.
Allows us to avoid making django.core.handlers.WSGIHandler public API, in
case the internal WSGI implementation changes or moves in the f... | ajibawa-2023/Python-Code-Large/train/row_83346 | 4 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83346:ImportFrom_L1_C0", "label": "from django.core.handlers.wsgi import WSGIHandler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 643, 0, 1, 0, 0, 643, 0, 0], "semantic": {"name": "django.core.handlers.wsg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83346:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83346:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83346:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83346:Return_L13_C4"}] |
import os
import errno
try:
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import... | ajibawa-2023/Python-Code-Large/train/row_83347 | 148 | 300 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83347:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0033, 0.0033, 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_83347:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83347:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83347:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83347:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""
Classes representing uploaded files.
"""
import os
from io import BytesIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',... | ajibawa-2023/Python-Code-Large/train/row_83348 | 64 | 125 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83348:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.016, 0.024, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83348:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83348:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83348:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83348:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""
Utility functions for handling images.
Requires PIL, as you might imagine.
"""
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def _get_width(self):
ret... | ajibawa-2023/Python-Code-Large/train/row_83349 | 41 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83349:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0448, 0.0746, 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_83349:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83349:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83349:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83349:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
"""
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile... | ajibawa-2023/Python-Code-Large/train/row_83350 | 96 | 221 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83350:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.009, 0.0136, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83350:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83350:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83350:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83350:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | ajibawa-2023/Python-Code-Large/train/row_83351 | 26 | 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_83351:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0982, 0.1786, 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_83351:If_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83351:ClassDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83351:ClassDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83351:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
"""
encoding = property(la... | ajibawa-2023/Python-Code-Large/train/row_83352 | 20 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83352:ClassDef_L1_C0", "label": "FileProxyMixin", "type": "class", "loc": [1, 29], "level": 0, "parent": null, "vector": [3, 0, 0.5172, 1.0, 0, 0.66, 0.0, 369, 0, 1, 0, 0, 186, 0, 17], "semantic": {"name": "FileProxyMixin", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83352:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83352:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83352:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83352:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | ajibawa-2023/Python-Code-Large/train/row_83353 | 41 | 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_83353:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0412, 0.0706, 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_83353:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83353:ImportFrom_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83353:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83353:Import_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.utils.encoding import smart_text
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import force_bytes, python_2_unicode_compatible
@python_2_un... | ajibawa-2023/Python-Code-Large/train/row_83354 | 101 | 158 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83354:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83354:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83354:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83354:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83354:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from django.core.files.base import File
| ajibawa-2023/Python-Code-Large/train/row_83355 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83355:ImportFrom_L1_C0", "label": "from django.core.files.base import File", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 293, 0, 1, 0, 0, 293, 0, 0], "semantic": {"name": "django.core.files.base", "arg_names": []... | [] |
"""
Portable file locking utilities.
Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Example Usage::
>>> from django.core.files import locks
>>> with open('.... | ajibawa-2023/Python-Code-Large/train/row_83356 | 36 | 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_83356:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 15], "level": 0, "parent": null, "vector": [8, 0, 0.1159, 0.2174, 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_83356:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83356:Import_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83356:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83356:Import_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from __future__ import absolute_import, unicode_literals
from django.utils.encoding import force_str
from django.utils import six
from django.utils.six.moves import http_cookies
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = http_cookies.SimpleCookie().value_enc... | ajibawa-2023/Python-Code-Large/train/row_83357 | 49 | 86 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83357:ImportFrom_L1_C0", "label": "from __future__ import absolute_import, unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 777, 0, 2, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83357:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83357:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83357:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83357:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
"""
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
from __future__ import unicode_literals
import base64
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
fro... | ajibawa-2023/Python-Code-Large/train/row_83358 | 322 | 639 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83358:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0055, 0.0094, 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_83358:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83358:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83358:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83358:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from __future__ import absolute_import, unicode_literals
import copy
import os
import re
import sys
import warnings
from io import BytesIO
from pprint import pformat
try:
from urllib.parse import parse_qsl, urlencode, quote, urljoin
except ImportError:
from urllib import urlencode, quote
from urlparse impo... | ajibawa-2023/Python-Code-Large/train/row_83359 | 271 | 500 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83359:ImportFrom_L1_C0", "label": "from __future__ import absolute_import, unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.002, 0, 0.66, 0.0, 777, 0, 2, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83359:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83359:ImportFrom_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83359:Try_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83359:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from __future__ import absolute_import, unicode_literals
import datetime
import time
import warnings
from email.header import Header
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.conf import settings
from django.core import signals
from django.core import... | ajibawa-2023/Python-Code-Large/train/row_83360 | 227 | 447 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83360:ImportFrom_L1_C0", "label": "from __future__ import absolute_import, unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0022, 0.0022, 0, 0.66, 0.0, 777, 0, 2, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83360:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83360:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83360:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83360:ImportFrom_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... | ajibawa-2023/Python-Code-Large/train/row_83361 | 18 | 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_83361:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0488, 0.0732, 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_83361:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83361:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83361:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83361:If_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (HttpRequest, QueryDict, UnreadablePostError,
build_request_repr)
from django.http.response import (HttpResponse, StreamingHttpResponse,
CompatibleStreamingHttpResponse, HttpResponsePermanentRedirect,
HttpResponseRedir... | ajibawa-2023/Python-Code-Large/train/row_83362 | 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_83362:ImportFrom_L1_C0", "label": "from django.http.cookie import SimpleCookie, parse_cookie", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 470, 0, 2, 0, 0, 470, 0, 0], "semantic": {"name": "django.http.cook... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DA... | ajibawa-2023/Python-Code-Large/train/row_83363 | 14 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83363:ImportFrom_L7_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1892, 0.027, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impo... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'G.i.s'
DA... | ajibawa-2023/Python-Code-Large/train/row_83364 | 15 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83364:ImportFrom_L4_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0303, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 januari 2009'
TIME_FORMAT = 'H:i' ... | ajibawa-2023/Python-Code-Large/train/row_83365 | 14 | 54 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83365:Assign_L7_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1296, 0.0185, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | ajibawa-2023/Python-Code-Large/train/row_83366 | 13 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83366:Assign_L7_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.175, 0.025, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FORMAT = 'H:i:s' # 14:30:59
DATETIME_FORMAT... | ajibawa-2023/Python-Code-Large/train/row_83367 | 13 | 42 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83367:Assign_L7_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0238, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rh... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
# DATE_FORMAT =
# TIME_FORMAT =
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DA... | ajibawa-2023/Python-Code-Large/train/row_83368 | 0 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DA... | ajibawa-2023/Python-Code-Large/train/row_83369 | 7 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83369:ImportFrom_L4_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0417, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i:s'
DAT... | ajibawa-2023/Python-Code-Large/train/row_83370 | 15 | 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_83370:ImportFrom_L4_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.093, 0.0233, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impo... | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i:s'
# DA... | ajibawa-2023/Python-Code-Large/train/row_83371 | 7 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83371:ImportFrom_L4_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0417, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.