code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
from django.contrib.gis.db import models class State(models.Model): name = models.CharField(max_length=20) objects = models.GeoManager() class County(models.Model): name = models.CharField(max_length=25) state = models.ForeignKey(State) mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in...
ajibawa-2023/Python-Code-Large/train/row_85577
41
69
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85577:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85577:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85577:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85577:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85577:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import os from decimal import Decimal from django.utils.copycompat import copy from django.utils.unittest import TestCase from django.contrib.gis.gdal import DataSource, OGRException from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, Invalid...
ajibawa-2023/Python-Code-Large/train/row_85578
150
277
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85578:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0036, 0.0036, 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_85578:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85578:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85578:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85578:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Co...
from django.contrib.gis.db import models from django.contrib.localflavor.us.models import USStateField class Location(models.Model): point = models.PointField() objects = models.GeoManager() def __unicode__(self): return self.point.wkt class City(models.Model): name = models.CharField(max_length=50) ...
ajibawa-2023/Python-Code-Large/train/row_85579
42
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85579:ImportFrom_L1_C0", "label": "from django.contrib.gis.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0204, 0, 0.66, 0.0, 964, 0, 1, 0, 0, 964, 0, 0], "semantic": {"name": "django.contrib.gis.db", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85579:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85579:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85579:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85579:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.test import TestCase from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati...
ajibawa-2023/Python-Code-Large/train/row_85580
162
284
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85580:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0035, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85580:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85580:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85580:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85580:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co...
from django.conf import settings from django.db import DEFAULT_DB_ALIAS # function that will pass a test. def pass_test(*args): return def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: ...
ajibawa-2023/Python-Code-Large/train/row_85581
22
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85581:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85581:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85581:Return_L5_C22"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85581:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85581:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest def run_tests(*args, **kwargs): from django.test.simple import run_tests as base_run_tests return base_run_tests(*args, **kwargs) def run_gis_tests(test_labels, verbosity=1, in...
ajibawa-2023/Python-Code-Large/train/row_85582
73
139
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85582:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0072, 0.0072, 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_85582:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85582:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85582:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85582:Return_L7_C4"}, {"f": "ajibawa-2023/Python-Co...
# Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, #...
ajibawa-2023/Python-Code-Large/train/row_85583
129
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_85583:Expr_L29_C0", "label": "expression", "type": "expression", "loc": [29, 37], "level": 0, "parent": null, "vector": [8, 0, 0.0982, 0.0268, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85583:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85583:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85583:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85583:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Co...
""" 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_85584
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_85584: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_85584:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85584:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85584:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85584: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_85585
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_85585: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_85585:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85585:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85585:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85585: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_85586
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_85586: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_85586:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85586:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85586:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85586: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_85587
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_85587: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_85587:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85587:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85587:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85587:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-...
import re from datetime import date from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, 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...
ajibawa-2023/Python-Code-Large/train/row_85588
73
106
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85588:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0094, 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_85588:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85588:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85588:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85588:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code...
""" 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_85589
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_85589: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_85589:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85589:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85589:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85589: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_85590
52
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_85590:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0423, 0.0704, 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...
ajibawa-2023/Python-Code-Large/train/row_85591
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_85591: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_85591:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85591:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85591:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85591: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 p...
ajibawa-2023/Python-Code-Large/train/row_85592
39
72
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85592: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.0139, 0.0139, 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_85592:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85592:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85592:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85592:Return_L13_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_85593
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_85593: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_85593:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85593:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85593:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85593: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_85594
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_85594: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_85594:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85594:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85594:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85594: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 from django.contrib.gi...
ajibawa-2023/Python-Code-Large/train/row_85595
65
110
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85595: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.0182, 0.0091, 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_85595:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85595:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85595:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85595:FunctionDef_L19_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_85596
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_85596: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_85596:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85596:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85596:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85596:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-...
import os, re, sys 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): lib...
ajibawa-2023/Python-Code-Large/train/row_85597
60
104
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85597:Import_L1_C0", "label": "os import os, re, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0096, 0.0096, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "re", "sys"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85597:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85597:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85597:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85597:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
# 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_85598
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_85598: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_85598:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85598:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85598:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85598: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_85599
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_85599: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_85599:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85599:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85599:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85599: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_85600
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_85600: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_85600:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85600:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85600:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85600: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_85601
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_85601: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_85601:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85601:ImportFrom_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85601:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85601: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_85602
171
337
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85602:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 28], "level": 0, "parent": null, "vector": [8, 0, 0.043, 0.0831, 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_85602:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85602:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85602:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85602:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.conf import settings 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 Geographi...
ajibawa-2023/Python-Code-Large/train/row_85603
76
131
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85603:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 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_85603:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85603:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85603:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85603:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from django.conf import settings from django.contrib.gis.gdal import OGRException from django.contrib.gis.geos import GEOSGeometry, GEOSException from django.forms.widgets import Textarea from django.template import loader, Context from django.utils import translation # Creating a template context that contains Django...
ajibawa-2023/Python-Code-Large/train/row_85604
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_85604:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 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_85604:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85604:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85604:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85604: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_85605
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_85605: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_85605:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85605:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85605:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85605: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_85606
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_85606: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_85606:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85606:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85606:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85606: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_85607
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_85607: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_85607:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85607:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85607:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85607: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_85608
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_85608: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_85608:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85608:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85608:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85608: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, GEOSIndexError from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gi...
ajibawa-2023/Python-Code-Large/train/row_85609
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_85609: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_85609:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85609:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85609:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85609:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod...
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE from django.contrib.gis.geos.prototypes.errcheck import \ check_geom, check_minus_one, check_sized_string, check_string, check_zero from django.contrib.gis....
ajibawa-2023/Python-Code-Large/train/row_85610
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_85610: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, 6, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85610:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85610:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85610:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85610: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_85611
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_85611: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_85611:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85611:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85611:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85611: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_85612
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_85612: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_85612:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85612:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85612:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85612: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_85613
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_85613: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_85613:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85613:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85613:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85613: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_85614
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_85614: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_85614:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85614:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85614:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85614: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_85615
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_85615: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_85615:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85615:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85615:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85615: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_85616
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_85616: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_85616:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85616:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85616:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85616: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_85617
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_85617: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_85617:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85617:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85617:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85617: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, c...
ajibawa-2023/Python-Code-Large/train/row_85618
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_85618: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_85619
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_85619: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_85619:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85619:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85619:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85619: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_85620
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_85620: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_85620:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85620:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85620:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85620: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, re, sys from ctypes import c_char_p, Structur...
ajibawa-2023/Python-Code-Large/train/row_85621
69
141
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85621:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0567, 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_85621:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85621:ImportFrom_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85621:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85621:Assign_L17_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_85622
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_85622: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_85622:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85622:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85622:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85622:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code...
from ctypes import c_uint, byref from django.contrib.gis.geos.error import GEOSIndexError 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 prototyp...
ajibawa-2023/Python-Code-Large/train/row_85623
95
166
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85623:ImportFrom_L1_C0", "label": "from ctypes import c_uint, byref", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 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_85623:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85623:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85623:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85623:FunctionDef_L11_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_85624
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_85624: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_85624:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85624:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85624:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85624: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_85625
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_85625: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_85625:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85625:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85625:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85625: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, GEOSIndexError # 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 ImportErro...
ajibawa-2023/Python-Code-Large/train/row_85626
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_85626: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_85626:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85626:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85626:Try_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85626: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 re import warnings from ctypes import addressof, byref, c_double, c_size_t # super-class for mutable list behavior from django.contrib.gis.geos.mutable_list imp...
ajibawa-2023/Python-Code-Large/train/row_85627
332
688
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85627: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_85627:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85627:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85627:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85627:Assign_L37_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_85628
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_85628: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_85628:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85628:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85628:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85628: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_85629
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_85629: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_85630
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_85630: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_85630:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85630:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85630:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85630:If_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from optparse import make_option from django.core.management.base import CommandError 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...
ajibawa-2023/Python-Code-Large/train/row_85631
21
32
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85631:ImportFrom_L1_C0", "label": "from optparse import make_option", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85631:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85631:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85631:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85631:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
from django.core.management.base import BaseCommand, CommandError class ArgsCommand(BaseCommand): """ Command class for commands that take multiple arguments. """ args = '<arg arg ...>' def handle(self, *args, **options): if not args: raise CommandError('Must provide the follow...
ajibawa-2023/Python-Code-Large/train/row_85633
8
15
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85633:ImportFrom_L1_C0", "label": "from django.core.management.base import BaseCommand, CommandError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 931, 0, 2, 0, 0, 931, 0, 0], "semantic": {"name": "django.c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85633:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85633:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85633:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85633:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
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_85634
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_85634: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_85634:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85634:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85634:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85634: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_85635
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_85635: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 connection if hasattr(connection.ops, 'spatial_version'): from warnings import warn warn('The `django.contrib.gis.db.backend` module was refactored and ' 'renamed to `django.contrib.gis.db.backends` in 1.2. ' 'All functionality of `SpatialBackend` ' 'has been m...
ajibawa-2023/Python-Code-Large/train/row_85636
5
11
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85636:ImportFrom_L1_C0", "label": "from django.db import connection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 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_85636:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85636:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85636:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85636:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8...
from django.db import connections from django.db.models.query import QuerySet, Q, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, GeometryField, PointField, LineStringField from django.contrib.gis.db.models.sql import...
ajibawa-2023/Python-Code-Large/train/row_85637
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_85637: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_85637:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85637:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85637:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85637: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_85638
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_85638: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_85638:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85638:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85638:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85638: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_85639
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_85639: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_85639:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85639:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85639:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85639: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_85640
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_85640: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_85640:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85640:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85640:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85640:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
from itertools import izip from django.db.backends.util import truncate_name from django.db.models.sql import compiler from django.db.models.sql.constants import TABLE_NAME from django.db.models.sql.query import get_proxied_model SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(compiler.SQLCompiler): def ...
ajibawa-2023/Python-Code-Large/train/row_85641
143
278
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85641:ImportFrom_L1_C0", "label": "from itertools import izip", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0036, 0.0036, 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_85641:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85641:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85641:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85641:Expr_L12_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_85642
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_85642: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_85642:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85642:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85642:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85642: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 from django.contrib.gis.db.models.sql.conversion import GeomField class GeoAggregate(Aggregate): # Default SQL template for spatial aggregates. sql_template = '%(function)s(%(field)s)' # Conversion ...
ajibawa-2023/Python-Code-Large/train/row_85643
31
61
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85643:ImportFrom_L1_C0", "label": "from django.db.models.sql.aggregates import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 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_85643:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85643:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85643:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85643:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from django.db.models.fields import Field, 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(Con...
ajibawa-2023/Python-Code-Large/train/row_85644
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_85644:ImportFrom_L1_C0", "label": "from django.db.models.fields import Field, FieldDoesNotExist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 0, 0.66, 0.0, 5, 0, 2, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85644:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85644:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85644:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85644: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_85645
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_85645: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_85646
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_85646: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_85646:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85646:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85646:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85646: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_85647
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_85647: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_85648
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_85648: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_85648:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85648:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85648:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85648: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_85649
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_85649: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_85649:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85649:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85649:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85649:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
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.models.sql.co...
ajibawa-2023/Python-Code-Large/train/row_85650
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_85650: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_85650:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85650:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85650:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85650: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_85651
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_85651: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_85651:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85651:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85651:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85651: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_85652
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_85652: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_85652:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85652:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85652:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85652: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): return self.wkt == other.wkt and self.srid == other.srid...
ajibawa-2023/Python-Code-Large/train/row_85653
11
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_85653:ClassDef_L1_C0", "label": "WKTAdapter", "type": "class", "loc": [1, 17], "level": 0, "parent": null, "vector": [3, 0, 0.5294, 1.0, 0, 0.66, 0.0, 868, 0, 4, 0, 0, 186, 0, 0], "semantic": {"name": "WKTAdapter", "arg_names": [], "import_names": [], "rhs_call_name": "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85653:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85653:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85653:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85653: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_85654
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_85654: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_85654:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85654:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85654:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85654:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
from django.db.backends.util import typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import MULTI from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCo...
ajibawa-2023/Python-Code-Large/train/row_85655
18
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_85655:ImportFrom_L1_C0", "label": "from django.db.backends.util import typecast_timestamp", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 446, 0, 1, 0, 0, 446, 0, 0], "semantic": {"name": "django.db.backends....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85655:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85655:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85655:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85655:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-...
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_85656
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_85656: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_85656:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85656:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85656:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85656: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_85657
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_85657: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_85657:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85657: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_85658
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_85658: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_85658:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85658:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85658:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85658: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_85659
183
342
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85659:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0029, 0.0029, 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_85659:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85659:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85659:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85659: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_85660
60
136
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85660: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_85660:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85660:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85660:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85660: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_85662
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_85662: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_85662:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85662:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85662:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85662: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_85663
20
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_85663:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0571, 0.0857, 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_85663:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85663:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85663:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85663: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_85664
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_85664: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_85664:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85664:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85664:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85664: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_85665
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_85665: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_85665:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85665:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85665:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85665:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-...
from django.conf import settings from django.db.backends.postgresql.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 SQL for ...
ajibawa-2023/Python-Code-Large/train/row_85666
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_85666: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_85666:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85666:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85666:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85666: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_85667
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_85667: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_85667:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85667:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85667:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85667: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_85668
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_85668: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_85668:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85668:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85668:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85668: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): def pla...
ajibawa-2023/Python-Code-Large/train/row_85671
21
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_85671: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.0227, 0.0227, 0, 0.66, 0.0, 973, 0, 1, 0, 0, 973, 0, 0], "semantic": {"name": "d...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_85671:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85671:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85671:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85671:If_L11_C8"}, {"f": "ajibawa-2023/Python-Code-...
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_85672
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_85672: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_85672:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85672: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_85673
36
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_85673:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.1385, 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_85673:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85673:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85673:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85673:Assign_L16_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_85674
158
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_85674:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0171, 0.0307, 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_85674:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85674:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85674:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85674:Assign_L22_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_85675
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_85675: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_85675:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85675:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85675:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85675: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_85676
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_85676: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_85676:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85676:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85676:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85676: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_85678
42
91
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85678:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.1319, 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_85678:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85678:Try_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85678:Try_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85678:Import_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
import base64 import cPickle as pickle 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 Se...
ajibawa-2023/Python-Code-Large/train/row_85679
27
57
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85679:Import_L1_C0", "label": "base64 import base64", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0175, 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_85679:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85679:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85679:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85679:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-...
import base64 from datetime import datetime, timedelta import pickle import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.session...
ajibawa-2023/Python-Code-Large/train/row_85680
252
378
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_85680:Import_L1_C0", "label": "base64 import base64", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0026, 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_85680:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85680:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85680:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85680:FunctionDef_L28_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_85681
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_85681: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_85681:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85681:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85681:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_85681:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod...