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
# -*- coding: utf-8 -*- """ A list of Argentinean provinces and autonomous cities as `choices` in a formfield. From http://www.argentina.gov.ar/argentina/portal/paginas.dhtml?pagina=425 This exists in this standalone file so that it's only imported into memory when explicitly needed. """ PROVINCE_CHOICES = ( ('B'...
ajibawa-2023/Python-Code-Large/train/row_85369
2
36
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85369:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1528, 0.2222, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
# -*- coding: utf-8 -*- """ BR-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, CharField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ ...
ajibawa-2023/Python-Code-Large/train/row_85370
96
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_85370:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0184, 0.0184, 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_85370:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85370:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85370:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85370:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- """ An alphabetical list of Brazilian states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', u'Amapá'), ('AM', 'Amazonas'), ...
ajibawa-2023/Python-Code-Large/train/row_85371
2
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_85371:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1216, 0.1622, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" Slovak-specific form helpers """ from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ class SKRegionSelect(Select): """ A select widget widget with list of Slovak regions as choices. """ def __init__(self, attrs=None): from sk_regions i...
ajibawa-2023/Python-Code-Large/train/row_85372
22
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_85372:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0465, 0.0698, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85372:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85372:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85372:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85372:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ DISTRICT_CHOICES = ( ('BB', _('Banska Bystrica')), ('BS', _('Banska Stiavnica')), ('BJ', _('Bardejov')), ('BN', _('Banovce nad Bebravo...
ajibawa-2023/Python-Code-Large/train/row_85373
3
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85373:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0345, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
""" Slovak regions according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ REGION_CHOICES = ( ('BB', _('Banska Bystrica region')), ('BA', _('Bratislava region')), ('KE', _('Kosice region')), ('NR', _('Nitra regi...
ajibawa-2023/Python-Code-Large/train/row_85374
3
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85374:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.1875, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
""" Mexican-specific form helpers. """ from django.forms.fields import Select class MXStateSelect(Select): """ A Select widget that uses a list of Mexican states as its choices. """ def __init__(self, attrs=None): from mx_states import STATE_CHOICES super(MXStateSelect, self).__init__(...
ajibawa-2023/Python-Code-Large/train/row_85375
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_85375:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.2143, 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_85375:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85375:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85375:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85375:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- coding: utf-8 -*- """ A list of Mexican states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ from django.utils.translation import ugettext_lazy as _ STATE_CHOICES = ( ('AGU', _(u'Aguascalientes')), ('BCN', _(u...
ajibawa-2023/Python-Code-Large/train/row_85376
3
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_85376:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.1333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
# -*- coding: utf-8 -*- """ Spanish-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ import re class ESPostalCodeField(RegexField): """ A...
ajibawa-2023/Python-Code-Large/train/row_85377
76
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_85377:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0162, 0.0162, 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_85377:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85377:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85377:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85377:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ REGION_CHOICES = ( ('AN', _('Andalusia')), ('AR', _('Aragon')), ('O', _('Principality of Asturias')), ('IB', _('Balearic Islands')), ('PV', _('Basque Country')), ('CN', _('Canary Islands')), ('S', _('Cantabria')...
ajibawa-2023/Python-Code-Large/train/row_85378
2
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_85378:ImportFrom_L2_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_name...
[]
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ PROVINCE_CHOICES = ( ('01', _('Arava')), ('02', _('Albacete')), ('03', _('Alacant')), ('04', _('Almeria')), ('05', _('Avila')), ('06', _('Badajoz')), ('07', _('Illes Balears')), ('08', _('Barcelona')), (...
ajibawa-2023/Python-Code-Large/train/row_85379
2
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85379:ImportFrom_L2_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0172, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_nam...
[]
""" Israeli-specific form helpers """ import re from django.core.exceptions import ValidationError from django.core.validators import EMPTY_VALUES from django.forms.fields import RegexField, Field, EMPTY_VALUES from django.utils.checksums import luhn from django.utils.translation import ugettext_lazy as _ # Israeli I...
ajibawa-2023/Python-Code-Large/train/row_85380
29
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_85380:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0303, 0.0455, 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_85380:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85380:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85380:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85380:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" FR-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.com...
ajibawa-2023/Python-Code-Large/train/row_85381
28
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85381:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0392, 0.0588, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85381:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85381:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85381:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85381:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- DEPARTMENT_ASCII_CHOICES = ( ('01', '01 - Ain'), ('02', '02 - Aisne'), ('03', '03 - Allier'), ('04', '04 - Alpes-de-Haute-Provence'), ('05', '05 - Hautes-Alpes'), ('06', '06 - Alpes-Maritimes'), ('07', '07 - Ardeche'), ('08', '08 - Ardennes'), ('09', '09 - Ar...
ajibawa-2023/Python-Code-Large/train/row_85382
1
110
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85382:Assign_L3_C0", "label": "DEPARTMENT_ASCII_CHOICES =", "type": "assigned_variable", "loc": [3, 110], "level": 0, "parent": null, "vector": [14, 0, 0.5136, 0.9818, 0, 0.66, 0.0, 807, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DEPARTMENT_ASCII_CHOICES", "arg_names":...
[]
""" South Africa-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField from django.utils.checksums import luhn from django.utils.translation import gettext as _ import re from datetime import date id_re = re...
ajibawa-2023/Python-Code-Large/train/row_85383
28
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_85383:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.05, 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_85383:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85383:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85383:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85383:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.utils.translation import gettext_lazy as _ PROVINCE_CHOICES = ( ('EC', _('Eastern Cape')), ('FS', _('Free State')), ('GP', _('Gauteng')), ('KN', _('KwaZulu-Natal')), ('LP', _('Limpopo')), ('MP', _('Mpumalanga')), ('NC', _('Northern Cape')), ('NW', _('North West')), ('WC'...
ajibawa-2023/Python-Code-Large/train/row_85384
2
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_85384:ImportFrom_L1_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_nam...
[]
""" Belgium-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ class BEPostalCodeField(RegexField): """ A form field that validat...
ajibawa-2023/Python-Code-Large/train/row_85385
26
71
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85385:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0282, 0.0423, 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_85385:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85385:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85385:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85385:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.utils.translation import ugettext_lazy as _ # ISO codes PROVINCE_CHOICES = ( ('VAN', _('Antwerp')), ('BRU', _('Brussels')), ('VOV', _('East Flanders')), ('VBR', _('Flemish Brabant')), ('WHT', _('Hainaut')), ('WLG', _('Liege')), ('VLI', _('Limburg')), ('WLX', _('Luxembourg'))...
ajibawa-2023/Python-Code-Large/train/row_85386
2
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85386:ImportFrom_L1_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_nam...
[]
from django.utils.translation import ugettext_lazy as _ # ISO codes REGION_CHOICES = ( ('BRU', _('Brussels Capital Region')), ('VLG', _('Flemish Region')), ('WAL', _('Wallonia')) )
ajibawa-2023/Python-Code-Large/train/row_85387
2
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85387:ImportFrom_L1_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names...
[]
""" UK-specific Form helpers """ import re from django.forms.fields import CharField, Select from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ class UKPostcodeField(CharField): """ A form field that validates its input is a UK postcode. The regular expressi...
ajibawa-2023/Python-Code-Large/train/row_85388
30
53
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85388:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0377, 0.0566, 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_85388:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85388:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85388:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85388:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" Sources: English regions: http://www.statistics.gov.uk/geography/downloads/31_10_01_REGION_names_and_codes_12_00.xls Northern Ireland regions: http://en.wikipedia.org/wiki/List_of_Irish_counties_by_area Welsh regions: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales Scottish regions: http://...
ajibawa-2023/Python-Code-Large/train/row_85389
8
97
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85389:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0412, 0.0722, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
# -*- coding: utf-8 -*- """ An alphabetical list of Finnish municipalities for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ MUNICIPALITY_CHOICES = ( ('akaa', u"Akaa"), ('alajarvi', u"Alajärvi"), ('alavieska', u"Alav...
ajibawa-2023/Python-Code-Large/train/row_85390
2
353
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85390:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0142, 0.0198, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" FI-specific Form helpers """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class FIZipCodeField(RegexField): default_error_messages = { ...
ajibawa-2023/Python-Code-Large/train/row_85391
28
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85391:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0392, 0.0588, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85391:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85391:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85391:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85391:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Cod...
""" Kuwait-specific Form helpers """ import re from datetime import date from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField from django.utils.translation import gettext as _ id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<...
ajibawa-2023/Python-Code-Large/train/row_85392
32
63
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85392:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0317, 0.0476, 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_85392:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85392:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85392:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85392:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django import forms DEFAULT_DATE_INPUT_FORMATS = ( '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06' '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006' '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006' '%B %d %Y', '%B %d, %Y', ...
ajibawa-2023/Python-Code-Large/train/row_85393
18
48
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85393:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85393:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85393:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85393:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85393:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" UK-specific Form helpers """ from django.forms.fields import Select class IECountySelect(Select): """ A Select widget that uses a list of Irish Counties as its choices. """ def __init__(self, attrs=None): from ie_counties import IE_COUNTY_CHOICES super(IECountySelect, self).__init_...
ajibawa-2023/Python-Code-Large/train/row_85394
7
13
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85394:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1538, 0.2308, 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_85394:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85394:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85394:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85394:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" Sources: Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland """ from django.utils.translation import ugettext_lazy as _ IE_COUNTY_CHOICES = ( ('antrim', _('Antrim')), ('armagh', _('Armagh')), ('carlow', _('Carlow')), ('cavan', _('Cavan')), ('clare', _('Clare')), ('cork...
ajibawa-2023/Python-Code-Large/train/row_85395
3
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_85395:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0625, 0.1, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
# -*- coding: utf-8 -*- """ Romanian specific form helpers. """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError, Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class ROCIFField(RegexField): """ A Romanian fiscal identity co...
ajibawa-2023/Python-Code-Large/train/row_85396
112
206
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85396:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0146, 0.0146, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85396:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85396:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85396:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85396:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# -*- coding: utf-8 -*- """ A list of Romanian counties as `choices` in a formfield. This exists as a standalone file so that it's only imported into memory when explicitly needed. """ COUNTIES_CHOICES = ( ('AB', u'Alba'), ('AR', u'Arad'), ('AG', u'Argeş'), ('BC', u'Bacău'), ('BH', u'Bihor'), ...
ajibawa-2023/Python-Code-Large/train/row_85397
2
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_85397:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0865, 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...
[]
""" Polish-specific form helpers """ import re from django.forms import ValidationError from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ from django.core.validators import EMPTY_VALUES class PLProvinceSelect(Select): """ A select widget with list of P...
ajibawa-2023/Python-Code-Large/train/row_85398
78
160
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85398:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0125, 0.0187, 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_85398:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85398:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85398:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85398:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" Polish voivodeship as in http://en.wikipedia.org/wiki/Poland#Administrative_division """ from django.utils.translation import ugettext_lazy as _ VOIVODESHIP_CHOICES = ( ('lower_silesia', _('Lower Silesia')), ('kuyavia-pomerania', _('Kuyavia-Pomerania')), ('lublin', _('Lublin')), ('lubusz', _('Lubu...
ajibawa-2023/Python-Code-Large/train/row_85399
3
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_85399:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.125, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', u'Wrocław'), ('jeleniagora', u'Jelenia Góra'), ('legnica', u'Legnica'), ('boleslawiecki', u'bolesławiecki'), ('dzierzoniows...
ajibawa-2023/Python-Code-Large/train/row_85400
2
385
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85400:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0078, 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...
[]
# -*- coding: utf-8 -*- """ UY-specific form helpers. """ import re from django.core.validators import EMPTY_VALUES from django.forms.fields import Select, RegexField from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.uy.util import get_vali...
ajibawa-2023/Python-Code-Large/train/row_85401
28
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_85401:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.05, 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_85401:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85401:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85401:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85401:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
# -*- coding: utf-8 -*- """A list of Urguayan departaments as `choices` in a formfield.""" DEPARTAMENT_CHOICES = ( ('G', u'Artigas'), ('A', u'Canelones'), ('E', u'Cerro Largo'), ('L', u'Colonia'), ('Q', u'Durazno'), ('N', u'Flores'), ('O', u'Florida'), ('P', u'Lavalleja'), ('B', u'M...
ajibawa-2023/Python-Code-Large/train/row_85402
2
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_85402:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.0417, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
# -*- coding: utf-8 -*- def get_validation_digit(number): """ Calculates the validation digit for the given number. """ sum = 0 dvs = [4, 3, 6, 7, 8, 9, 2] number = str(number) for i in range(0, len(number)): sum = (int(number[-1 - i]) * dvs[i] + sum) % 10 return (10-sum) % 10
ajibawa-2023/Python-Code-Large/train/row_85403
8
12
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85403:FunctionDef_L3_C0", "label": "get_validation_digit", "type": "function", "loc": [3, 12], "level": 0, "parent": null, "vector": [2, 0, 0.625, 0.8333, 0, 0.66, 0.0, 198, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_validation_digit", "arg_names": ["number"], "imp...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85403:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85403:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85403:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85403:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- coding: utf-8 -*- """ PE-specific Form helpers. """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, CharField, Select from django.utils.translation import ugettext_lazy as _ class PERegionSelect(Select): """ A Select wi...
ajibawa-2023/Python-Code-Large/train/row_85404
36
72
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85404:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85404:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85404:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85404:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85404:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-...
# -*- coding: utf-8 -*- """ A list of Peru regions as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ REGION_CHOICES = ( ('AMA', u'Amazonas'), ('ANC', u'Ancash'), ('APU', u'Apurímac'), ('ARE', u'Arequipa'), ('AYA', u'...
ajibawa-2023/Python-Code-Large/train/row_85405
2
35
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85405:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1286, 0.1714, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" USA-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits...
ajibawa-2023/Python-Code-Large/train/row_85406
58
122
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85406:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0164, 0.0246, 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_85406:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85406:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85406:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85406:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import CharField from django.contrib.localflavor.us.us_states import STATE_CHOICES from django.contrib.localflavor.us.us_states import USPS_CHOICES class USStateField(CharField): description = _("...
ajibawa-2023/Python-Code-Large/train/row_85407
27
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_85407:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85407:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85407:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85407:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85407:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and alphabetical lists of US states, territories, military mail regions and non-US states to which the US provides postal service. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ # The...
ajibawa-2023/Python-Code-Large/train/row_85408
10
326
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85408:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0153, 0.0276, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" ID-specific Form helpers """ import re import time from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode postcode_re = re.compil...
ajibawa-2023/Python-Code-Large/train/row_85409
96
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_85409:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0095, 0.0142, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85409:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85409:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85409:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85409:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import warnings from django.utils.translation import ugettext_lazy as _ # Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia # Indonesia does not have an official Province code standard. # I decided to use unambiguous and consistent (some are common) 3-letter codes. warnings.warn( 'There have been...
ajibawa-2023/Python-Code-Large/train/row_85410
5
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_85410:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 0, 0.66, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warning...
[]
""" Canada-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re...
ajibawa-2023/Python-Code-Large/train/row_85411
69
134
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85411:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0149, 0.0224, 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_85411:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85411:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85411:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85411:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" An alphabetical list of provinces and territories for use as `choices` in a formfield., and a mapping of province misspellings/abbreviations to normalized abbreviations Source: http://www.canada.gc.ca/othergov/prov_e.html This exists in this standalone file so that it's only imported into memory when explici...
ajibawa-2023/Python-Code-Large/train/row_85412
5
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_85412:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0821, 0.1493, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
""" Swiss-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re id_re = re.compile(r"...
ajibawa-2023/Python-Code-Large/train/row_85413
67
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_85413:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0169, 0.0254, 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_85413:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85413:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85413:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85413:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -* from django.utils.translation import ugettext_lazy as _ STATE_CHOICES = ( ('AG', _('Aargau')), ('AI', _('Appenzell Innerrhoden')), ('AR', _('Appenzell Ausserrhoden')), ('BS', _('Basel-Stadt')), ('BL', _('Basel-Land')), ('BE', _('Berne')), ('FR', _('Fribourg')), ('...
ajibawa-2023/Python-Code-Large/train/row_85414
2
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_85414:ImportFrom_L2_C0", "label": "from django.utils.translation import _", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0645, 0.0323, 0, 0.66, 0.0, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_nam...
[]
""" Norwegian-specific Form helpers """ import re, datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class NOZipCodeField(RegexField): default_error_mes...
ajibawa-2023/Python-Code-Large/train/row_85415
49
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85415:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0244, 0.0366, 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_85415:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85415:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85415:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85415:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- """ An alphabetical list of Norwegian municipalities (fylker) fro use as `choices` in a formfield. This exists in this standalone file so that it's on ly imported into memory when explicitly needed. """ MUNICIPALITY_CHOICES = ( ('akershus', u'Akershus'), ('austagder', u'Aust-Agder'), ...
ajibawa-2023/Python-Code-Large/train/row_85416
2
32
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85416:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1562, 0.2188, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" TR-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_...
ajibawa-2023/Python-Code-Large/train/row_85417
48
91
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85417:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.022, 0.033, 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_85417:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85417:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85417:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85417:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- """ This exists in this standalone file so that it's only imported into memory when explicitly needed. """ PROVINCE_CHOICES = ( ('01', ('Adana')), ('02', ('Adıyaman')), ('03', ('Afyonkarahisar')), ('04', ('Ağrı')), ('68', ('Aksaray')), ('05', ('Amasya')), ('06', ('An...
ajibawa-2023/Python-Code-Large/train/row_85418
2
89
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85418:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0393, 0.0449, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import FileSystemStorage from django.utils.importlib import import_module from django.contrib.staticfiles import utils class StaticFilesStorage(FileSystemStorage): """ Standard fi...
ajibawa-2023/Python-Code-Large/train/row_85419
31
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_85419:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 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_85419:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85419:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85419:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85419:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.conf import settings from django.conf.urls.static import static urlpatterns = [] def staticfiles_urlpatterns(prefix=None): """ Helper function to return a URL pattern for serving static files. """ if prefix is None: prefix = settings.STATIC_URL return static(prefix, view='djang...
ajibawa-2023/Python-Code-Large/train/row_85422
9
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85422:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_85422:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85422:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85422:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85422:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
import os import fnmatch from django.conf import settings from django.core.exceptions import ImproperlyConfigured def is_ignored(path, ignore_patterns=[]): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ for patter...
ajibawa-2023/Python-Code-Large/train/row_85423
29
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_85423:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85423:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85423:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85423:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85423:For_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import os from optparse import make_option from django.core.management.base import LabelCommand from django.utils.encoding import smart_str, smart_unicode from django.contrib.staticfiles import finders class Command(LabelCommand): help = "Finds the absolute paths for the given static file(s)." args = "[file ....
ajibawa-2023/Python-Code-Large/train/row_85424
21
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_85424:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 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_85424:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85424:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85424:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85424:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
import os import sys import shutil from optparse import make_option from django.conf import settings from django.core.files.storage import get_storage_class from django.core.management.base import CommandError, NoArgsCommand from django.utils.encoding import smart_str from django.contrib.staticfiles import finders c...
ajibawa-2023/Python-Code-Large/train/row_85425
110
204
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85425:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 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_85425:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85425:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85425:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85425:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from optparse import make_option from django.conf import settings from django.core.management.commands.runserver import BaseRunserverCommand from django.contrib.staticfiles.handlers import StaticFilesHandler class Command(BaseRunserverCommand): option_list = BaseRunserverCommand.option_list + ( make_opti...
ajibawa-2023/Python-Code-Large/train/row_85426
15
27
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85426:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 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_85426:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85426:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85426:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85426:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath import urllib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from dja...
ajibawa-2023/Python-Code-Large/train/row_85427
17
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_85427:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.1282, 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_85427:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85427:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85427:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85427:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware, CsrfResponseMiddleware from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt, csrf_response_exempt import warnings warnings.warn("This import for CSRF functionality is deprecated. Please use django.middleware.csrf for the middlewa...
ajibawa-2023/Python-Code-Large/train/row_85428
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_85428:ImportFrom_L1_C0", "label": "from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware, CsrfResponseMiddleware", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 574, 0, 3, 0, 0, 574, 0, 0], "s...
[]
from django.db import models from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_(...
ajibawa-2023/Python-Code-Large/train/row_85429
20
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_85429:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 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_85429:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85429:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85429:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85429:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import os from django.conf import settings from django.contrib.auth.models import AnonymousUser, User from django.template import Template, Context, TemplateSyntaxError from django.test import TestCase class FlatpageTemplateTagTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.te...
ajibawa-2023/Python-Code-Large/train/row_85430
56
134
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85430:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0075, 0.0075, 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_85430:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85430:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85430:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85430:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.conf import settings from django.contrib.flatpages.admin import FlatpageForm from django.test import TestCase class FlatpageAdminFormTests(TestCase): def setUp(self): self.form_data = { 'title': "A test page", 'content': "This is a test", 'sites': [settings.S...
ajibawa-2023/Python-Code-Large/train/row_85431
16
23
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85431: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_85431:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85431:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85431:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85431:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code...
from django.conf.urls.defaults import * # special urls for flatpage test cases urlpatterns = patterns('', (r'^flatpage_root', include('django.contrib.flatpages.urls')), (r'^accounts/', include('django.contrib.auth.urls')), )
ajibawa-2023/Python-Code-Large/train/row_85432
2
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85432:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_nam...
[]
import os from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase class FlatpageMiddlewareTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.old_MIDDLEWARE_CLASSES = settings.MIDD...
ajibawa-2023/Python-Code-Large/train/row_85433
55
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85433:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 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_85433:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85433:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85433:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85433:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import os from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase, Client class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.client = Client(enforce_csrf_checks=...
ajibawa-2023/Python-Code-Large/train/row_85434
61
79
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85434:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0127, 0.0127, 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_85434:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85434:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85434:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85434:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.test import TestCase class FlatpageViewTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): ...
ajibawa-2023/Python-Code-Large/train/row_85435
54
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_85435:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0133, 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_85435:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85435:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85435:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85435:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.contrib.flatpages.tests.csrf import * from django.contrib.flatpages.tests.forms import * from django.contrib.flatpages.tests.middleware import * from django.contrib.flatpages.tests.templatetags import * from django.contrib.flatpages.tests.views import *
ajibawa-2023/Python-Code-Large/train/row_85436
5
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_85436:ImportFrom_L1_C0", "label": "from django.contrib.flatpages.tests.csrf import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 500, 0, 1, 0, 0, 500, 0, 0], "semantic": {"name": "django.contrib.flatpages.tests...
[]
from django.conf.urls.defaults import * urlpatterns = patterns('django.contrib.flatpages.views', (r'^(?P<url>.*)$', 'flatpage'), )
ajibawa-2023/Python-Code-Large/train/row_85437
2
5
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85437:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":...
[]
from django.contrib.flatpages.views import flatpage from django.http import Http404 from django.conf import settings class FlatpageFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a flatpage for non...
ajibawa-2023/Python-Code-Large/train/row_85438
12
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85438:ImportFrom_L1_C0", "label": "from django.contrib.flatpages.views import flatpage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 240, 0, 1, 0, 0, 240, 0, 0], "semantic": {"name": "django.contrib.flatpag...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85438:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85438:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85438:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85438:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name = context_name if starts_with: ...
ajibawa-2023/Python-Code-Large/train/row_85439
40
98
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85439:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0102, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["te...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85439:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85439:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85439:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85439:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C...
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
ajibawa-2023/Python-Code-Large/train/row_85440
15
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_85440:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85440:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85440:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85440:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85440:ClassDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.contrib.flatpages.models import FlatPage from django.template import loader, RequestContext from django.shortcuts import get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.core.xheaders import populate_xheaders from django.utils.safestri...
ajibawa-2023/Python-Code-Large/train/row_85441
31
64
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85441:ImportFrom_L1_C0", "label": "from django.contrib.flatpages.models import FlatPage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0156, 0, 0.66, 0.0, 268, 0, 1, 0, 0, 268, 0, 0], "semantic": {"name": "django.contrib.flatpa...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85441:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85441:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85441:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85441:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# This file intentionally left blank
ajibawa-2023/Python-Code-Large/train/row_85442
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"]
[]
[]
import os from datetime import date from django.conf import settings from django.contrib.auth.models import User from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils.unittest im...
ajibawa-2023/Python-Code-Large/train/row_85443
81
173
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85443:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0058, 0.0058, 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_85443:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85443:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85443:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85443:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod...
from datetime import datetime from django.conf.urls.defaults import * from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap from django.contrib.auth.models import User class SimpleSitemap(Sitemap): changefreq = "never" priority = 0.5 location = '/location/' lastmod = datetime.now...
ajibawa-2023/Python-Code-Large/train/row_85444
15
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85444:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85444:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85444:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85444:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85444:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.contrib.sitemaps.tests.basic import *
ajibawa-2023/Python-Code-Large/train/row_85445
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_85445:ImportFrom_L1_C0", "label": "from django.contrib.sitemaps.tests.basic import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "django.contrib.sitemaps.tests.ba...
[]
from django.core.management.base import BaseCommand from django.contrib.sitemaps import ping_google class Command(BaseCommand): help = "Ping Google with an updated sitemap, pass optional url of sitemap" def execute(self, *args, **options): if len(args) == 1: sitemap_url = args[0] ...
ajibawa-2023/Python-Code-Large/train/row_85446
9
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_85446:ImportFrom_L1_C0", "label": "from django.core.management.base import BaseCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 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_85446:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85446:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85446:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85446:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.utils.encoding import smart_str from django.core.paginator import EmptyPage, PageNotAnInteger def index(request, sitemaps, template_...
ajibawa-2023/Python-Code-Large/train/row_85447
37
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85447:ImportFrom_L1_C0", "label": "from django.http import HttpResponse, Http404", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 779, 0, 2, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85447:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85447:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85447:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85447:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.contrib.sites.models import Site, get_current_site from django.core import urlresolvers, paginator from django.core.exceptions import ImproperlyConfigured import urllib PING_URL = "http://www.google.com/webmasters/tools/ping" class SitemapNotFound(Exception): pass def ping_google(sitemap_url=None, pi...
ajibawa-2023/Python-Code-Large/train/row_85448
68
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85448:ImportFrom_L1_C0", "label": "from django.contrib.sites.models import Site, get_current_site", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0092, 0.0092, 0, 0.66, 0.0, 890, 0, 2, 0, 0, 890, 0, 0], "semantic": {"name": "django.cont...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85448:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85448:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85448:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85448:If_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored mes...
ajibawa-2023/Python-Code-Large/train/row_85449
30
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_85449:ImportFrom_L1_C0", "label": "from django.contrib.messages.storage.base import BaseStorage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 63, 0, 1, 0, 0, 63, 0, 0], "semantic": {"name": "django.contrib....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85449:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85449:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85449:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85449:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.contrib.messages.storage.base import BaseStorage class SessionStorage(BaseStorage): """ Stores messages in the session (that is, django.contrib.sessions). """ session_key = '_messages' def __init__(self, request, *args, **kwargs): assert hasattr(request, 'session'), "The sessi...
ajibawa-2023/Python-Code-Large/train/row_85450
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_85450:ImportFrom_L1_C0", "label": "from django.contrib.messages.storage.base import BaseStorage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 63, 0, 1, 0, 0, 63, 0, 0], "semantic": {"name": "django.contrib....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85450:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85450:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85450:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85450:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.conf import settings from django.contrib.messages import constants from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils import simplejson as json from django.utils.crypto import salted_hmac, constant_time_compare class MessageEncoder(...
ajibawa-2023/Python-Code-Large/train/row_85451
84
152
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85451:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 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_85451:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85451:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85451:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85451:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.conf import settings from django.utils.encoding import force_unicode, StrAndUnicode from django.contrib.messages import constants, utils LEVEL_TAGS = utils.get_level_tags() class Message(StrAndUnicode): """ Represents an actual message that can be stored in any of the supported storage class...
ajibawa-2023/Python-Code-Large/train/row_85452
89
181
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85452:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 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_85452:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85452:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85452:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85452:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-La...
""" Storages used to assist in the deprecation of contrib.auth User messages. """ from django.contrib.messages import constants from django.contrib.messages.storage.base import BaseStorage, Message from django.contrib.auth.models import User from django.contrib.messages.storage.fallback import FallbackStorage class ...
ajibawa-2023/Python-Code-Large/train/row_85453
32
64
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85453:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0391, 0.0625, 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_85453:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85453:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85453:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85453:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.contrib.messages.api import get_messages def messages(request): """ Returns a lazy 'messages' context variable. """ return {'messages': get_messages(request)}
ajibawa-2023/Python-Code-Large/train/row_85455
4
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85455:ImportFrom_L1_C0", "label": "from django.contrib.messages.api import get_messages", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "django.contrib.messages...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85455:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85455:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85455:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85455:Return_L8_C4"}]
# Models module required so tests are discovered.
ajibawa-2023/Python-Code-Large/train/row_85456
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
from django.contrib.messages import constants from django.contrib.messages.storage.fallback import FallbackStorage, \ CookieStorage from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.tests.cookie import set_cookie_data, \ stored_cookie_messages_count from django.contrib.message...
ajibawa-2023/Python-Code-Large/train/row_85457
101
175
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85457:ImportFrom_L1_C0", "label": "from django.contrib.messages import constants", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0057, 0, 0.66, 0.0, 698, 0, 1, 0, 0, 698, 0, 0], "semantic": {"name": "django.contrib.messages", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85457:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85457:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85457:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85457:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Cod...
from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.session import SessionStorage def set_session_data(storage, messages): """ Sets the messages into the backend request's session and remove the backend's loaded data cache. """ storage.request.session[stora...
ajibawa-2023/Python-Code-Large/train/row_85458
23
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85458:ImportFrom_L1_C0", "label": "from django.contrib.messages.tests.base import BaseTest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 377, 0, 1, 0, 0, 377, 0, 0], "semantic": {"name": "django.contrib.mes...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85458:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85458:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85458:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85458:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.cookie import CookieStorage, \ MessageEncoder, MessageDecoder from django.contrib.messages.storage.base import Message from django.utils ...
ajibawa-2023/Python-Code-Large/train/row_85459
82
141
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85459:ImportFrom_L1_C0", "label": "from django.contrib.messages import constants", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 0, 0.66, 0.0, 698, 0, 1, 0, 0, 698, 0, 0], "semantic": {"name": "django.contrib.messages", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85459:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85459:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85459:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85459:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code...
from django.conf.urls.defaults import * from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, redirect from django.template import RequestContext, Template from django.template.response...
ajibawa-2023/Python-Code-Large/train/row_85460
28
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85460:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0172, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85460:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85460:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85460:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85460:For_L26_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django import http from django.contrib.messages.middleware import MessageMiddleware from django.utils import unittest class MiddlewareTest(unittest.TestCase): def setUp(self): self.middleware = MessageMiddleware() def test_response_without_messages(self): """ Makes sure that the...
ajibawa-2023/Python-Code-Large/train/row_85461
11
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85461:ImportFrom_L1_C0", "label": "from django import http", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["http"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85461:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85461:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85461:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85461:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
import warnings from django import http from django.test import TestCase from django.conf import settings from django.utils.translation import ugettext_lazy from django.utils.unittest import skipIf from django.contrib.messages import constants, utils, get_level, set_level from django.contrib.messages.api import Messag...
ajibawa-2023/Python-Code-Large/train/row_85462
271
439
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85462:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 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_85462:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85462:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85462:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85462:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code...
from django import http from django.contrib.auth.models import User from django.contrib.messages.storage.user_messages import UserMessagesStorage,\ LegacyFallbackStorage from django.contrib.messages.tests.base import skipUnlessAuthIsInstalled from django.contrib.messages.tests.cookie import set_cookie_data from dja...
ajibawa-2023/Python-Code-Large/train/row_85463
48
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85463:ImportFrom_L1_C0", "label": "from django import http", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["http"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85463:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85463:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85463:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85463:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-...
from django.contrib.messages.tests.cookie import CookieTest from django.contrib.messages.tests.fallback import FallbackTest from django.contrib.messages.tests.middleware import MiddlewareTest from django.contrib.messages.tests.session import SessionTest from django.contrib.messages.tests.user_messages import \ ...
ajibawa-2023/Python-Code-Large/train/row_85464
5
6
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85464:ImportFrom_L1_C0", "label": "from django.contrib.messages.tests.cookie import CookieTest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "django.contrib...
[]
DEBUG = 10 INFO = 20 SUCCESS = 25 WARNING = 30 ERROR = 40 DEFAULT_TAGS = { DEBUG: 'debug', INFO: 'info', SUCCESS: 'success', WARNING: 'warning', ERROR: 'error', }
ajibawa-2023/Python-Code-Large/train/row_85465
6
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_85465:Assign_L1_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 309, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name"...
[]
from django.conf import settings from django.contrib.messages.storage import default_storage class MessageMiddleware(object): """ Middleware that handles temporary messages. """ def process_request(self, request): request._messages = default_storage(request) def process_response(self, re...
ajibawa-2023/Python-Code-Large/train/row_85466
12
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_85466:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 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_85466:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85466:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85466:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85466:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.conf import settings from django.contrib.messages import constants def get_level_tags(): """ Returns the message level tags. """ level_tags = constants.DEFAULT_TAGS.copy() level_tags.update(getattr(settings, 'MESSAGE_TAGS', {})) return level_tags
ajibawa-2023/Python-Code-Large/train/row_85467
7
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_85467:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 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_85467:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85467:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85467:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85467:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from api import * from constants import *
ajibawa-2023/Python-Code-Large/train/row_85468
2
2
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85468:ImportFrom_L1_C0", "label": "from api import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 976, 0, 1, 0, 0, 976, 0, 0], "semantic": {"name": "api", "arg_names": [], "import_names": ["*"], "rhs_call_name":...
[]
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage from django.utils.functional import lazy, memoize __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception...
ajibawa-2023/Python-Code-Large/train/row_85469
49
114
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85469:ImportFrom_L1_C0", "label": "from django.contrib.messages import constants", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 698, 0, 1, 0, 0, 698, 0, 0], "semantic": {"name": "django.contrib.messages", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85469:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85469:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85469:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85469:If_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django import template from django.conf import settings from django.shortcuts import get_object_or_404, render_to_response from django.contrib.auth.decorators import login_required, permission_required from utils import next_redirect, confirmation_view from django.contrib import comments from django.contrib.commen...
ajibawa-2023/Python-Code-Large/train/row_85470
47
159
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85470:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["te...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85470:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85470:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85470:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85470:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code...
""" A few bits of helper functions for comment views. """ import urllib import textwrap from django.http import HttpResponseRedirect from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from...
ajibawa-2023/Python-Code-Large/train/row_85471
32
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_85471:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0308, 0.0462, 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_85471:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85471:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85471:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85471:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code...