code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
import os from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.geoip import GeoIP, GeoIPException from django.utils import unittest # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory ...
ajibawa-2023/Python-Code-Large/train/row_86361
86
117
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86361:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0085, 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_86361:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86361:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86361:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86361:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Co...
import os import re from ctypes import c_char_p from django.core.validators import ipv4_re from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS from django.contrib.gis.geoip.prototypes import ( GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info, GeoIP_lib_version, GeoIP_record_by_addr...
ajibawa-2023/Python-Code-Large/train/row_86362
133
263
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86362:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0038, 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_86362:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86362:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86362:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86362:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
ajibawa-2023/Python-Code-Large/train/row_86363
5
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_86363:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.3889, 0.7222, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86363:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86363:ImportFrom_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86363:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86363:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
import os from ctypes import CDLL from ctypes.util import find_library from django.conf import settings # Creating the settings dictionary with any settings, if needed. GEOIP_SETTINGS = dict((key, getattr(settings, key)) for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY...
ajibawa-2023/Python-Code-Large/train/row_86364
17
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_86364: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_86364:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86364:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86364:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86364:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER from django.contrib.gis.geoip.libgeoip import lgeoip, free #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('country...
ajibawa-2023/Python-Code-Large/train/row_86365
57
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_86365:ImportFrom_L1_C0", "label": "from ctypes import c_char_p, c_float, c_int\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0092, 0.0092, 0, 0.66, 0.0, 182, 0, 6, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": []...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86365:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86365:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86365:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86365:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
""" DataSource is a wrapper for the OGR Data Source object, which provides an interface for reading vector geometry data from many different file formats (including ESRI shapefiles). When instantiating a DataSource object, use the filename of a GDAL-supported data source. For example, a SHP file or a TIGER/Line...
ajibawa-2023/Python-Code-Large/train/row_86366
53
128
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86366:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 35], "level": 0, "parent": null, "vector": [8, 0, 0.1406, 0.2734, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86366:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86366:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86366:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86366:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" This module houses the OGR & SRS Exception objects, and the check_err() routine which checks the status code returned by OGR methods. """ #### OGR & SRS Exceptions #### class GDALException(Exception): pass class OGRException(Exception): pass class SRSException(Exception): pass class OGRIndexError(OGRException, K...
ajibawa-2023/Python-Code-Large/train/row_86367
15
42
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86367:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.119, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86367:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86367:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86367:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86367:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/...
ajibawa-2023/Python-Code-Large/train/row_86368
98
186
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86368:ImportFrom_L1_C0", "label": "from ctypes import byref, c_int", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0054, 0.0054, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86368:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86368:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86368:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86368:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-...
# Needed ctypes routines from ctypes import c_double, byref # Other GDAL imports. from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException from django.contrib.gis.gdal.feature...
ajibawa-2023/Python-Code-Large/train/row_86369
108
212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86369:ImportFrom_L2_C0", "label": "from ctypes import c_double, byref", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0047, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86369:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86369:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86369:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86369:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-...
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import...
ajibawa-2023/Python-Code-Large/train/row_86370
71
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86370:ImportFrom_L1_C0", "label": "from ctypes import c_char_p, c_double, c_int\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 0, 0.66, 0.0, 182, 0, 5, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86370:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86370:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86370:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86370:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L...
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import check_err, OGRException, SRSException from django.contrib.gis.gdal.libgdal import lgdal # Helper routines for retrieving pointers and/or values f...
ajibawa-2023/Python-Code-Large/train/row_86371
74
127
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86371:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0197, 0.0315, 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_86371:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86371:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86371:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86371:Return_L13_C4"}, {"f": "ajibawa-2023/Python-Code...
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
ajibawa-2023/Python-Code-Large/train/row_86372
52
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_86372:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0429, 0.0714, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_errcode, check_geom, check_geom_offset, check_pointer, check_srs, check_str_a...
ajibawa-2023/Python-Code-Large/train/row_86373
69
119
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86373:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.021, 0.0336, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86373:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86373:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86373:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86373:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code...
from ctypes import c_char_p, c_int, c_void_p, POINTER from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import (const_string_output, double_output, int_output, srs_output, string_output, void_output) ## Shortcut generation for routines with known paramet...
ajibawa-2023/Python-Code-Large/train/row_86374
39
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_86374:ImportFrom_L1_C0", "label": "from ctypes import c_char_p, c_int, c_void_p\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.0141, 0, 0.66, 0.0, 182, 0, 4, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86374:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86374:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86374:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86374:Return_L12_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.contrib.gis.gdal.error import OGRException #### OGRGeomType #### class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0 : 'Unknown', 1 : 'Point', 2 ...
ajibawa-2023/Python-Code-Large/train/row_86375
45
85
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86375:ImportFrom_L1_C0", "label": "from django.contrib.gis.gdal.error import OGRException", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0118, 0, 0.66, 0.0, 76, 0, 1, 0, 0, 76, 0, 0], "semantic": {"name": "django.contrib.gis.gd...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86375:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86375:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86375:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86375:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Module for executing all of the GDAL tests. None of these tests require the use of the database. """ from django.utils.unittest import TestSuite, TextTestRunner # Importing the GDAL test modules. import test_driver, test_ds, test_envelope, test_geom, test_srs test_suites = [test_driver.suite(), te...
ajibawa-2023/Python-Code-Large/train/row_86376
12
25
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86376:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.16, 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_86376:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86376:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86376:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86376:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code...
# The GDAL C library, OGR exception, and the Field object from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType # ctypes function pro...
ajibawa-2023/Python-Code-Large/train/row_86377
64
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_86377:ImportFrom_L2_C0", "label": "from django.contrib.gis.gdal.base import GDALBase", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0092, 0, 0.66, 0.0, 771, 0, 1, 0, 0, 771, 0, 0], "semantic": {"name": "django.contrib.gis.gdal....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86377:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86377:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86377:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86377:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
ajibawa-2023/Python-Code-Large/train/row_86378
397
737
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86378:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 40], "level": 0, "parent": null, "vector": [8, 0, 0.0278, 0.0543, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86378:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86378:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86378:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86378:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-...
import os import re from ctypes import c_char_p, CDLL from ctypes.util import find_library from django.contrib.gis.gdal.error import OGRException # Custom library path set? try: from django.conf import settings lib_path = settings.GDAL_LIBRARY_PATH except (AttributeError, EnvironmentError, ImportError): li...
ajibawa-2023/Python-Code-Large/train/row_86379
61
105
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86379:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0095, 0.0095, 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_86379:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86379:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86379:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86379:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/...
# prerequisites imports from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/ogr__api_8h.html # # ...
ajibawa-2023/Python-Code-Large/train/row_86380
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_86380:ImportFrom_L2_C0", "label": "from ctypes import c_void_p", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0308, 0.0154, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["c_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86380:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86380:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86380:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86380:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
ajibawa-2023/Python-Code-Large/train/row_86381
84
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_86381:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0371, 0.0686, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86381:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86381:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86381:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86381:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from ctypes import c_void_p from types import NoneType from django.contrib.gis.gdal.error import GDALException class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _ptr ...
ajibawa-2023/Python-Code-Large/train/row_86382
16
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_86382:ImportFrom_L1_C0", "label": "from ctypes import c_void_p", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["c_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86382:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86382:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86382:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86382:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-...
ajibawa-2023/Python-Code-Large/train/row_86383
13
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_86383:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 33], "level": 0, "parent": null, "vector": [8, 0, 0.3148, 0.6111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86383:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86383:ImportFrom_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86383:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86383:ImportFrom_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print srs GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORI...
ajibawa-2023/Python-Code-Large/train/row_86384
170
336
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86384:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 28], "level": 0, "parent": null, "vector": [8, 0, 0.0432, 0.0833, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86384:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86384:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86384:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86384:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.contrib.admin import ModelAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.gdal import OGRGeomType from django.contrib.gis.db import models class GeoModelAdmin(ModelAdmin): """ The administration options class for Geographic models. Map settings may be...
ajibawa-2023/Python-Code-Large/train/row_86385
73
129
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86385:ImportFrom_L1_C0", "label": "from django.contrib.admin import ModelAdmin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0078, 0, 0.66, 0.0, 703, 0, 1, 0, 0, 703, 0, 0], "semantic": {"name": "django.contrib.admin", "arg_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86385:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86385:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86385:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86385:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.forms.widgets import Textarea from django.template import loader, Context from django.templatetags.static import static from django.utils import translation from django.contrib.gis.gdal import OGRException from django.contrib.gis.geos import GEOSGeometry, GEOSException # Creating a template context that c...
ajibawa-2023/Python-Code-Large/train/row_86386
54
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_86386:ImportFrom_L1_C0", "label": "from django.forms.widgets import Textarea", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 0, 0.66, 0.0, 260, 0, 1, 0, 0, 260, 0, 0], "semantic": {"name": "django.forms.widgets", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86386:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86386:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86386:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86386:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-...
# Getting the normal admin routines, classes, and `site` instance. from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL # Geographic admin options classes and widgets. from django.contrib.gis.admin.options import GeoModelAdmin from django.contri...
ajibawa-2023/Python-Code-Large/train/row_86387
7
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_86387:ImportFrom_L2_C0", "label": "from django.contrib.admin import autodiscover, site, AdminSite\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0833, 0, 0.66, 0.0, 703, 0, 8, 0, 0, 703, 0, 0], "semantic": {"name": "djang...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86387:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86387:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86387:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86387:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/...
from django.contrib.gis.geos.base import numpy from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.point import Point from django.contrib.gis.geos import prototypes as cap...
ajibawa-2023/Python-Code-Large/train/row_86388
95
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_86388:ImportFrom_L1_C0", "label": "from django.contrib.gis.geos.base import numpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "django.contrib.gis.geos.bas...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86388:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86388:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86388:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86388:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
""" This module houses the GEOS exceptions, specifically, GEOSException and GEOSGeometryIndexError. """ class GEOSException(Exception): "The base GEOS exception, indicates a GEOS-related error." pass class GEOSIndexError(GEOSException, KeyError): """ This exception is raised when an invalid index is...
ajibawa-2023/Python-Code-Large/train/row_86389
6
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86389:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.2, 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_86389:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86389:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86389:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86389:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Module that holds classes for performing I/O operations on GEOS geometry objects. Specifically, this has Python implementations of WKB/WKT reader and writer classes. """ from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WK...
ajibawa-2023/Python-Code-Large/train/row_86390
11
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86390:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.15, 0.25, 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_86390:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86390:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86390:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86390:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Co...
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import c_int, c_uint, byref from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos i...
ajibawa-2023/Python-Code-Large/train/row_86391
73
123
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86391:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0203, 0.0325, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86391:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86391:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86391:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86391:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod...
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero) from django.contrib.gis.geos.prototypes.threadsafe import G...
ajibawa-2023/Python-Code-Large/train/row_86392
75
119
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86392:ImportFrom_L1_C0", "label": "from ctypes import c_char_p, c_int, c_size_t\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0084, 0.0084, 0, 0.66, 0.0, 182, 0, 5, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86392:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86392:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86392:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86392:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code...
import threading from ctypes import byref, c_char_p, c_int, c_char, c_size_t, Structure, POINTER from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string, check_sized_string from django.contrib...
ajibawa-2023/Python-Code-Large/train/row_86393
163
242
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86393:Import_L1_C0", "label": "threading import threading", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["thread...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86393:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86393:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86393:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86393:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Co...
""" Error checking functions for GEOS ctypes prototype functions. """ import os from ctypes import c_void_p, string_at, CDLL from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOS_VERSION from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the...
ajibawa-2023/Python-Code-Large/train/row_86394
53
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86394:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0211, 0.0316, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86394:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86394:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86394:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86394:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', 'geos_difference', 'geos_envelope', 'geos_intersection', 'geos_linemerge', 'geos_pointonsurface', 'geos_pre...
ajibawa-2023/Python-Code-Large/train/row_86395
37
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_86395:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.049, 0.0784, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86395:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86395:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86395:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86395:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code...
import threading from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR class GEOSContextHandle(object): """ Python object representing a GEOS context handle. """ def __init__(self): # Initializing the context handler for this thread with # the notice and erro...
ajibawa-2023/Python-Code-Large/train/row_86396
48
86
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86396:Import_L1_C0", "label": "threading import threading", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["thread...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86396:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86396:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86396:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86396:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from ctypes import c_char from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Prepared geometry constructor and destructors. geos_prepare = GEOSFunc('GEOSPrepare')...
ajibawa-2023/Python-Code-Large/train/row_86397
19
25
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86397:ImportFrom_L1_C0", "label": "from ctypes import c_char", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["c_char"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86397:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86397:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86397:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86397:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Co...
from ctypes import c_double, c_int, c_uint, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc ## Error-checking routines specific to coordinate seq...
ajibawa-2023/Python-Code-Large/train/row_86398
53
83
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86398:ImportFrom_L1_C0", "label": "from ctypes import c_double, c_int, c_uint\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.012, 0, 0.66, 0.0, 182, 0, 4, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86398:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86398:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86398:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86398:If_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import c_int, c_double, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string f...
ajibawa-2023/Python-Code-Large/train/row_86399
23
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_86399:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0641, 0.1026, 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_86399:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86399:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86399:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86399:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code...
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, cs_clone, cs_getordinate, cs_setordinate, cs...
ajibawa-2023/Python-Code-Large/train/row_86400
6
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86400:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.1667, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
ajibawa-2023/Python-Code-Large/train/row_86401
34
44
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86401:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0568, 0.0909, 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_86401:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86401:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86401:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86401:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code...
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://www.aryehleib.com/MutableLists.html Author: Aryeh Leib Taurog. """ class ListMixin(obj...
ajibawa-2023/Python-Code-Large/train/row_86402
171
309
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86402:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 10], "level": 0, "parent": null, "vector": [8, 0, 0.021, 0.0259, 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_86402:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86402:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86402:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86402:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import os import re import sys from ctypes import c_char...
ajibawa-2023/Python-Code-Large/train/row_86403
71
143
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86403:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0315, 0.0559, 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_86403:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86403:ImportFrom_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86403:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86403:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" GEOS Testing module. """ from django.utils.unittest import TestSuite, TextTestRunner import test_geos, test_io, test_geos_mutation, test_mutable_list test_suites = [ test_geos.suite(), test_io.suite(), test_geos_mutation.suite(), test_mutable_list.suite(), ] def suite(): "Builds a test sui...
ajibawa-2023/Python-Code-Large/train/row_86404
14
25
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86404:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.08, 0.12, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86404:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86404:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86404:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86404:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code...
from ctypes import c_uint, byref from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR from django.contrib.gis.geos.linestring import LinearRing from django.contrib.gis.geos import prototypes as capi class Polygon(GEOSGeometry): _minlength =...
ajibawa-2023/Python-Code-Large/train/row_86405
94
165
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86405:ImportFrom_L1_C0", "label": "from ctypes import c_uint, byref", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86405:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86405:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86405:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86405:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-L...
from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the co...
ajibawa-2023/Python-Code-Large/train/row_86406
20
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86406:ImportFrom_L1_C0", "label": "from django.contrib.gis.geos.base import GEOSBase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "django.contrib.gis.geos....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86406:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86406:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86406:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86406:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
""" This module houses the GEOSCoordSeq object, which is used internally by GEOSGeometry to house the actual coordinates of the Point, LineString, and LinearRing geometries. """ from ctypes import c_double, c_uint, byref from django.contrib.gis.geos.base import GEOSBase, numpy from django.contrib.gis.geos.error impo...
ajibawa-2023/Python-Code-Large/train/row_86407
103
156
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86407:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0192, 0.0321, 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_86407:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86407:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86407:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86407:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException # Trying to import GDAL libraries, if available. Have to place in # try/except since this package may be used outside GeoDjango. try: from django.contrib.gis import gdal except ImportError: # A 'dumm...
ajibawa-2023/Python-Code-Large/train/row_86408
23
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_86408:ImportFrom_L1_C0", "label": "from ctypes import c_void_p", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.0192, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["c_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86408:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86408:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86408:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86408:ClassDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ # Python, ctypes and types dependencies. import warnings from ctypes import addressof, byref, c_double # super-class for mutable list behavior from django.contrib.gis.geos.mutable_list import ListMixin # GEO...
ajibawa-2023/Python-Code-Large/train/row_86409
331
687
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86409:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0036, 0.0058, 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_86409:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86409:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86409:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86409:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from ctypes import c_uint from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos import prototypes as capi class Point(GEOSGeometry): _minlength = 2 _maxlength = 3 def __init__(self, x, y=None, z=None, srid=None): ...
ajibawa-2023/Python-Code-Large/train/row_86410
89
135
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86410:ImportFrom_L1_C0", "label": "from ctypes import c_uint", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["c_ui...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86410:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86410:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86410:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86410:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" The GeoDjango GEOS module. Please consult the GeoDjango documentation for more details: http://geodjango.org/docs/geos.html """ from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex from django.contrib.gis.geos.point import Point from django.contrib.gis.geos.linestring import LineStrin...
ajibawa-2023/Python-Code-Large/train/row_86411
10
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_86411:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.2143, 0.3571, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex def fromfile(file_h): """ Given a string file name, returns a GEOSGeometry. The file may contain WKB, WKT, or HEX. """ # If given a file name, get a real handle. if isinstance(file_h, basestring): file_h = ...
ajibawa-2023/Python-Code-Large/train/row_86412
12
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_86412:ImportFrom_L1_C0", "label": "from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 843, 0, 3, 0, 0, 843, 0, 0], "semantic": {"na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86412:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86412:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86412:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86412:If_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.core.management.commands.inspectdb import Command as InspectDBCommand class Command(InspectDBCommand): db_module = 'django.contrib.gis.db' gis_tables = {} def get_field_type(self, connection, table_name, row): field_type, field_params, field_notes = super(Command, self).get_field_type(...
ajibawa-2023/Python-Code-Large/train/row_86413
19
29
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86413:ImportFrom_L1_C0", "label": "from django.core.management.commands.inspectdb import InspectDBCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0345, 0, 0.66, 0.0, 296, 0, 1, 0, 0, 296, 0, 0], "semantic": {"name": "dja...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86413:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86413:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86413:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86413:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.http import Http404 from django.utils.translation import ugettext as _ def feed(request, url, feed_dict=None): """Provided for backwards compatibility.""" if not feed_dict: raise Http404(_(u"No feeds are registered.")) try: slug, param = url.split('/', 1) except ValueError:...
ajibawa-2023/Python-Code-Large/train/row_86415
15
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_86415:ImportFrom_L1_C0", "label": "from django.http import Http404", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [], "import_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86415:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86415:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86415:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86415:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django import forms from django.utils.translation import ugettext_lazy as _ # While this couples the geographic forms to the GEOS library, # it decouples from database (by not importing SpatialBackend). from django.contrib.gis.geos import GEOSGeometry class GeometryField(forms.Field): """ This is the bas...
ajibawa-2023/Python-Code-Large/train/row_86416
27
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_86416:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0149, 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_86416:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86416:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86416:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86416:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.forms import * from django.contrib.gis.forms.fields import GeometryField
ajibawa-2023/Python-Code-Large/train/row_86417
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_86417:ImportFrom_L1_C0", "label": "from django.forms import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 666, 0, 1, 0, 0, 666, 0, 0], "semantic": {"name": "django.forms", "arg_names": [], "import_names": ["*"]...
[]
from django.db import connections from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField from django.contrib.gis.db.models.sql import AreaField, Distan...
ajibawa-2023/Python-Code-Large/train/row_86418
338
777
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86418:ImportFrom_L1_C0", "label": "from django.db import connections", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0013, 0.0013, 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_86418:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86418:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86418:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86418:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.db.models.fields import Field from django.db.models.sql.expressions import SQLEvaluator from django.utils.translation import ugettext_lazy as _ from django.contrib.gis import forms from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.geometry.backend import Geometry, Geometry...
ajibawa-2023/Python-Code-Large/train/row_86419
135
294
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86419:ImportFrom_L1_C0", "label": "from django.db.models.fields import Field", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 0, 0.66, 0.0, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86419:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86419:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86419:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86419:Try_L21_C4"}, {"f": "ajibawa-2023/Python-Code-La...
""" The GeometryProxy object, allows for lazy-geometries. The proxy uses Python descriptors for instantiating and setting Geometry objects corresponding to geographic model fields. Thanks to Robert Coup for providing this functionality (see #4322). """ class GeometryProxy(object): def __init__(self, klass, field...
ajibawa-2023/Python-Code-Large/train/row_86420
27
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_86420:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0625, 0.1094, 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_86420:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86420:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86420:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86420:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
from django.db import connections from django.db.models.query import sql from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import aggregates as gis_aggregates from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contri...
ajibawa-2023/Python-Code-Large/train/row_86421
62
119
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86421:ImportFrom_L1_C0", "label": "from django.db import connections", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0084, 0.0084, 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_86421:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86421:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86421:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86421:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from itertools import izip from django.db.backends.util import truncate_name, typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import TABLE_NAME, MULTI SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(compiler.SQLCompiler): def get_columns(self, with_aliases...
ajibawa-2023/Python-Code-Large/train/row_86422
155
293
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86422:ImportFrom_L1_C0", "label": "from itertools import izip", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86422:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86422:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86422:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86422:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
""" This module holds simple classes used by GeoQuery.convert_values to convert geospatial values from the database. """ class BaseField(object): empty_strings_allowed = True def get_internal_type(self): "Overloaded method so OracleQuery.convert_values doesn't balk." return None class AreaFiel...
ajibawa-2023/Python-Code-Large/train/row_86423
16
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_86423:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0926, 0.1481, 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_86423:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86423:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86423:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86423:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.db.models.sql.aggregates import * from django.contrib.gis.db.models.fields import GeometryField class GeoAggregate(Aggregate): # Default SQL template for spatial aggregates. sql_template = '%(function)s(%(field)s)' # Conversion class, if necessary. conversion_class = None # Flags for ...
ajibawa-2023/Python-Code-Large/train/row_86424
30
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_86424:ImportFrom_L1_C0", "label": "from django.db.models.sql.aggregates import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0167, 0, 0.66, 0.0, 101, 0, 1, 0, 0, 101, 0, 0], "semantic": {"name": "django.db.models.sql.aggrega...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86424:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86424:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86424:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86424:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Constraint...
ajibawa-2023/Python-Code-Large/train/row_86425
48
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_86425:ImportFrom_L1_C0", "label": "from django.db.models.fields import FieldDoesNotExist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 0, 0.66, 0.0, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86425:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86425:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86425:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86425:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contrib.gis.db.models.sql.query import GeoQuery from django.contrib.gis.db.models.sql.where import GeoWhereNode
ajibawa-2023/Python-Code-Large/train/row_86426
3
3
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86426:ImportFrom_L1_C0", "label": "from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 100, 0, 3, 0, 0, 100, 0, 0], "sem...
[]
from django.db.models import Aggregate from django.contrib.gis.db.models.sql import GeomField class Collect(Aggregate): name = 'Collect' class Extent(Aggregate): name = 'Extent' class Extent3D(Aggregate): name = 'Extent3D' class MakeLine(Aggregate): name = 'MakeLine' class Union(Aggregate): nam...
ajibawa-2023/Python-Code-Large/train/row_86427
12
17
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86427:ImportFrom_L1_C0", "label": "from django.db.models import Aggregate", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86427:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86427:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86427:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86427:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Want to get everything from the 'normal' models package. from django.db.models import * # Geographic aggregate functions from django.contrib.gis.db.models.aggregates import * # The GeoManager from django.contrib.gis.db.models.manager import GeoManager # The geographic-enabled fields. from django.contrib.gis.db.mod...
ajibawa-2023/Python-Code-Large/train/row_86428
4
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86428:ImportFrom_L2_C0", "label": "from django.db.models import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 0, 0.66, 0.0, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import...
[]
from django.db.models.manager import Manager from django.contrib.gis.db.models.query import GeoQuerySet class GeoManager(Manager): "Overrides Manager to return Geographic QuerySets." # This manager should be used for queries on related fields # so that geometry columns on Oracle and MySQL are selected ...
ajibawa-2023/Python-Code-Large/train/row_86429
67
103
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86429:ImportFrom_L1_C0", "label": "from django.db.models.manager import Manager", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 0, 0.66, 0.0, 59, 0, 1, 0, 0, 59, 0, 0], "semantic": {"name": "django.db.models.manager", "arg...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86429:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86429:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86429:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86429:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
ajibawa-2023/Python-Code-Large/train/row_86430
16
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_86430:ImportFrom_L1_C0", "label": "from MySQLdb.constants import FIELD_TYPE", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 412, 0, 1, 0, 0, 412, 0, 0], "semantic": {"name": "MySQLdb.constants", "arg_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86430:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86430:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86430:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86430:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler from django.db.backends.mysql import compiler SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): def resolve_columns(self, row, fields=()): """ Integrate the cases hand...
ajibawa-2023/Python-Code-Large/train/row_86431
13
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_86431:ImportFrom_L1_C0", "label": "from django.contrib.gis.db.models.sql.compiler import BaseGeoSQLCompiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 973, 0, 1, 0, 0, 973, 0, 0], "semantic": {"name": "d...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86431:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86431:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86431:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86431:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'django.contrib.gis.db.backends.mysq...
ajibawa-2023/Python-Code-Large/train/row_86432
30
65
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86432:ImportFrom_L1_C0", "label": "from django.db.backends.mysql.base import DatabaseOperations", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 150, 0, 1, 0, 0, 150, 0, 0], "semantic": {"name": "django.db.bac...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86432:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86432:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86432:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86432:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.db.backends.mysql.creation import DatabaseCreation class MySQLCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): from django.contrib.gis.db.models.fields import GeometryField output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style) ...
ajibawa-2023/Python-Code-Large/train/row_86433
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_86433:ImportFrom_L1_C0", "label": "from django.db.backends.mysql.creation import DatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 326, 0, 1, 0, 0, 326, 0, 0], "semantic": {"name": "django.db.b...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86433:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86433:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86433:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86433:ImportFrom_L6_C8"}, {"f": "ajibawa-2023/Python-...
from django.db.backends.mysql.base import * from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper from django.contrib.gis.db.backends.mysql.creation import MySQLCreation from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection from django.contrib.gis.db.backends.mysq...
ajibawa-2023/Python-Code-Large/train/row_86434
11
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_86434:ImportFrom_L1_C0", "label": "from django.db.backends.mysql.base import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 150, 0, 1, 0, 0, 150, 0, 0], "semantic": {"name": "django.db.backends.mysql.base"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86434:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86434:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86434:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86434:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-...
class WKTAdapter(object): """ This provides an adaptor for Geometries sent to the MySQL and Oracle database backends. """ def __init__(self, geom): self.wkt = geom.wkt self.srid = geom.srid def __eq__(self, other): if not isinstance(other, WKTAdapter): return...
ajibawa-2023/Python-Code-Large/train/row_86435
13
19
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86435:ClassDef_L1_C0", "label": "WKTAdapter", "type": "class", "loc": [1, 19], "level": 0, "parent": null, "vector": [3, 0, 0.5263, 1.0, 0, 0.66, 0.0, 868, 0, 4, 0, 0, 186, 0, 1], "semantic": {"name": "WKTAdapter", "arg_names": [], "import_names": [], "rhs_call_name": "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86435:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86435:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86435:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86435:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` dict for geometry field types. ...
ajibawa-2023/Python-Code-Large/train/row_86436
24
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_86436:ImportFrom_L1_C0", "label": "from django.contrib.gis.gdal import OGRGeomType", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 793, 0, 1, 0, 0, 793, 0, 0], "semantic": {"name": "django.contrib.gis.gdal", ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86436:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86436:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86436:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86436:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.db.backends.sqlite3.base import Database from django.contrib.gis.db.backends.adapter import WKTAdapter class SpatiaLiteAdapter(WKTAdapter): "SQLite adaptor for geometry objects." def __conform__(self, protocol): if protocol is Database.PrepareProtocol: return str(self)
ajibawa-2023/Python-Code-Large/train/row_86437
7
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_86437:ImportFrom_L1_C0", "label": "from django.db.backends.sqlite3.base import Database", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 460, 0, 1, 0, 0, 460, 0, 0], "semantic": {"name": "django.db.backends.sqli...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86437:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86437:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86437:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86437:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
from django.db.backends.sqlite3.client import DatabaseClient class SpatiaLiteClient(DatabaseClient): executable_name = 'spatialite'
ajibawa-2023/Python-Code-Large/train/row_86438
3
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_86438:ImportFrom_L1_C0", "label": "from django.db.backends.sqlite3.client import DatabaseClient", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "django.db.backends....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86438:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86438:Assign_L4_C4"}]
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin class GeometryColumns(models.Model): """ The 'geometry_columns' table from SpatiaLite. """ f_table_name = models.CharField(ma...
ajibawa-2023/Python-Code-Large/train/row_86439
35
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_86439: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_86439:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86439:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86439:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86439:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
import re from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.geometry.backend import G...
ajibawa-2023/Python-Code-Large/train/row_86440
187
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_86440:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86440:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86440:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86440:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86440:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-...
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
ajibawa-2023/Python-Code-Large/train/row_86441
57
135
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86441:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 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_86441:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86441:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86441:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86441:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection from django.contrib.gis.gdal import OGRGeomType class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # intro...
ajibawa-2023/Python-Code-Large/train/row_86443
46
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86443:ImportFrom_L1_C0", "label": "from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0105, 0, 0.66, 0.0, 862, 0, 1, 0, 0, 862, 0, 0], "semantic...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86443:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86443:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86443:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86443:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-...
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy pickling ...
ajibawa-2023/Python-Code-Large/train/row_86444
26
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_86444:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0444, 0.0667, 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_86444:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86444:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86444:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86444:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-...
""" The GeometryColumns and SpatialRefSys models for the PostGIS backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin class GeometryColumns(models.Model): """ The 'geometry_columns' table from the PostGIS. See the PostGIS documentation at Ch. 4.2.2. ...
ajibawa-2023/Python-Code-Large/train/row_86445
37
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_86445: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_86445:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86445:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86445:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86445:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
import re from decimal import Decimal from django.conf import settings from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter from django.contrib.gi...
ajibawa-2023/Python-Code-Large/train/row_86446
290
588
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86446:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0017, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86446:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86446:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86446:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86446:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.conf import settings from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_opts = 'GIST_GEOMETRY_OPS' def sql_indexes_for_field(self, model, f, style): "Return any spatial index creation...
ajibawa-2023/Python-Code-Large/train/row_86447
26
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_86447:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0167, 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_86447:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86447:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86447:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86447:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.db.backends.postgresql_psycopg2.base import * from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as Psycopg2DatabaseWrapper from django.contrib.gis.db.backends.postgis.creation import PostGISCreation from django.contrib.gis.db.backends.postgis.introspection import PostGISIntrospection f...
ajibawa-2023/Python-Code-Large/train/row_86448
11
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_86448:ImportFrom_L1_C0", "label": "from django.db.backends.postgresql_psycopg2.base import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "django.db.backen...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86448:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86448:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86448:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86448:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-L...
""" A collection of utility routines and classes used by the spatial backends. """ def gqn(val): """ The geographic quote name function; used for quoting tables and geometries (they use single rather than the double quotes of the backend quotename function). """ if isinstance(val, basestring): ...
ajibawa-2023/Python-Code-Large/train/row_86449
29
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_86449:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0446, 0.0714, 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_86449:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86449:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86449:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86449:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler from django.db.backends.oracle import compiler SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): pass class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler): pass c...
ajibawa-2023/Python-Code-Large/train/row_86452
9
22
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86452:ImportFrom_L1_C0", "label": "from django.contrib.gis.db.models.sql.compiler import BaseGeoSQLCompiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 973, 0, 1, 0, 0, 973, 0, 0], "semantic": {"name": "d...
[]
from cx_Oracle import CLOB from django.contrib.gis.db.backends.adapter import WKTAdapter class OracleSpatialAdapter(WKTAdapter): input_size = CLOB
ajibawa-2023/Python-Code-Large/train/row_86453
4
5
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86453:ImportFrom_L1_C0", "label": "from cx_Oracle import CLOB", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 554, 0, 1, 0, 0, 554, 0, 0], "semantic": {"name": "cx_Oracle", "arg_names": [], "import_names": ["CLOB"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86453:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86453:Assign_L5_C4"}]
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
ajibawa-2023/Python-Code-Large/train/row_86454
35
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_86454:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0781, 0.1406, 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_86454:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86454:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86454:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86454:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
""" This module contains the spatial lookup types, and the `get_geo_where_clause` routine for Oracle Spatial. Please note that WKT support is broken on the XE version, and thus this backend will not work on such platforms. Specifically, XE lacks support for an internal JVM, and Java libraries are required to use...
ajibawa-2023/Python-Code-Large/train/row_86455
159
299
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86455:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0167, 0.0301, 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_86455:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86455:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86455:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86455:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from django.db.backends.oracle.creation import DatabaseCreation from django.db.backends.util import truncate_name class OracleCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): "Return any spatial index creation SQL for the field." from django.contrib.gis.db.models.field...
ajibawa-2023/Python-Code-Large/train/row_86456
16
42
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86456:ImportFrom_L1_C0", "label": "from django.db.backends.oracle.creation import DatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "django.db....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86456:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86456:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86456:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86456:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from django.db.backends.oracle.base import * from django.db.backends.oracle.base import DatabaseWrapper as OracleDatabaseWrapper from django.contrib.gis.db.backends.oracle.creation import OracleCreation from django.contrib.gis.db.backends.oracle.introspection import OracleIntrospection from django.contrib.gis.db.backen...
ajibawa-2023/Python-Code-Large/train/row_86457
11
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_86457:ImportFrom_L1_C0", "label": "from django.db.backends.oracle.base import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 759, 0, 1, 0, 0, 759, 0, 0], "semantic": {"name": "django.db.backends.oracle.bas...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86457:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86457:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86457:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86457:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-L...
""" Set of "markup" template filters for Django. These filters transform plain text markup syntaxes to HTML; currently there is support for: * Textile, which requires the PyTextile library available at http://loopcore.com/python-textile/ * Markdown, which requires the Python-markdown library from ...
ajibawa-2023/Python-Code-Large/train/row_86459
46
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86459:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.065, 0.12, 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_86459:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86459:Try_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86459:Try_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86459:Import_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionManager(models.Manager): def encode(self, session_dict): """ Returns the given session dictionary pickled and encoded as a string. """ return SessionStore().encode(session_dict) d...
ajibawa-2023/Python-Code-Large/train/row_86460
25
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_86460:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 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_86460:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86460:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86460:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86460:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-L...
from __future__ import with_statement from datetime import datetime, timedelta import shutil import string import tempfile import warnings from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as...
ajibawa-2023/Python-Code-Large/train/row_86461
274
435
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86461:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86461:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86461:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86461:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86461:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Cod...
import time from django.conf import settings from django.utils.cache import patch_vary_headers from django.utils.http import cookie_date from django.utils.importlib import import_module class SessionMiddleware(object): def process_request(self, request): engine = import_module(settings.SESSION_ENGINE) ...
ajibawa-2023/Python-Code-Large/train/row_86462
27
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_86462:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86462:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86462:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86462:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_86462:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod...
try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core import signing from django.contrib.sessions.backends.base import SessionBase class PickleSerializer(object): """ Simple wrapper around pickle to be used in signing.dumps and signing....
ajibawa-2023/Python-Code-Large/train/row_86463
41
93
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86463:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 4], "level": 0, "parent": null, "vector": [7, 0, 0.0269, 0.043, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86463:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86463:Import_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86463:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86463:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, transaction, router from django.utils.encoding import force_unicode from django.utils import timezone class SessionStore(SessionBase): """ Imp...
ajibawa-2023/Python-Code-Large/train/row_86465
42
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86465:ImportFrom_L1_C0", "label": "from django.contrib.sessions.backends.base import SessionBase, CreateError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 907, 0, 2, 0, 0, 907, 0, 0], "semantic": {"name": "d...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86465:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86465:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86465:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86465:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import base64 import time from datetime import datetime, timedelta try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.crypto import constant_time_compare from django.utils.crypto import get_ra...
ajibawa-2023/Python-Code-Large/train/row_86466
160
280
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_86466:Import_L1_C0", "label": "base64 import base64", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0036, 0.0036, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_86466:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86466:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_86466:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_86466:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...