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 |
|---|---|---|---|---|---|---|---|
#!/usr/bin/env python
##########################
#By:Anatoliy Liberman #
#For: Genome Center UCD #
#Supervisor: #
# Alexander Kozik #
# #
##########################
import sys
import os
import fileinput
import re
opts = None
#Returns the number of dom... | ajibawa-2023/Python-Code-Large/train/row_98265 | 236 | 299 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98265:Import_L12_C0", "label": "sys import sys", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0401, 0.0033, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98265:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98265:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98265:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98265:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
##########################
#By:Anatoliy Liberman #
#For: Genome Center UCD #
#Supervisor: #
# Alexander Kozik #
# #
##########################
import sys
import os
import fileinput
import re
opts = None
#Returns the number of dom... | ajibawa-2023/Python-Code-Large/train/row_98268 | 236 | 299 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98268:Import_L12_C0", "label": "sys import sys", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0401, 0.0033, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98268:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98268:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98268:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98268:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_98269 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98269:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98269:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98269:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98269:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98269:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import bisect
#Entrada edificios (izq,alt,der)
#Entrada de ejemplo del enunciado
a = [
(4,15,10),
(2,11,9),
(7,7,18),
(12,13,16),
(20,9,28),
(22,20,25),
(26,13,29)
]
#Entrada con edificios solapados
#a = [
#(22,20,25),
#(24,13,29),
#(25,13,29),
#(26,13,29),
#(27,13,29),
... | ajibawa-2023/Python-Code-Large/train/row_98270 | 28 | 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_98270:Import_L3_C0", "label": "bisect import bisect", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0361, 0.012, 0, 0.66, 0.0, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "bisect", "arg_names": [], "import_names": ["bisect"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98270:For_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98270:Expr_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98270:For_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98270:Expr_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/usr/bin/python
import random,\
sys
MIN_CARGAS = 5
MAX_CARGAS = 5
MIN_CARGAS_PELIGRO = 1
MAX_CARGAS_PELIGRO = 6
cargas_disponibles = range(10)
#menor cantidad de cargas utilizadas
#hasta ahora en la mejor solucion.
#menor_cantidad = -1
# for i in range(len(cargas_disponibles)):
# for c in solucion.camiones
# ... | ajibawa-2023/Python-Code-Large/train/row_98271 | 15 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98271:Import_L3_C0", "label": "random import random, sys", "type": "import", "loc": [3, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1029, 0.0588, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98271:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98271:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98271:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98271:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import sys
#aca se puede ver los lugares a los que se puede saltar desde
#la o, las x son los saltos posibles con 1 salto.
#| |x| |x| |
#|x| | | |x|
#| | |o| | |
#|x| | | |x|
#| |x| |x| |
#quiero saltar desde (x,y) a (w,z), el tablero tiene nXx y matriz es la tabla dinamica
recorridoCount = 0
def ca... | ajibawa-2023/Python-Code-Large/train/row_98272 | 54 | 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_98272:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0235, 0.0118, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98272:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98272:Expr_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98272:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98272:If_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
#matriz 4x4, tengo 4 ciudades
#esta matriz, lo que indica, es para la posicion i,j
#la lista de vuelos que hay. Osea lista de vuelos desde la ciudad i a la ciudad j
#entonces por ej en [(0,1),(0,2)] estoy diciendo que hay 2 vuelos uno sale a las
#0 y llega a las 2 y el otro sale a las 0 y llega a... | ajibawa-2023/Python-Code-Large/train/row_98273 | 23 | 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_98273:Assign_L10_C0", "label": "ciudades =", "type": "assigned_variable", "loc": [10, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1154, 0.0481, 0, 0.66, 0.0, 350, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ciudades", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98273:While_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98273:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98273:While_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98273:Assign_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from random import uniform
NUMTEST = 30
for test in range(0,NUMTEST):
cantFilas = test
for cantCaballos in range(0,int(cantFilas*cantFilas/2)):
#cantCaballos = int(uniform(0,cantFilas*cantFilas))
print cantFilas,cantCaballos
for c in range(1,cantCaballos+1):
print int(uniform(1,cantFilas)),int(uniform(1,cant... | ajibawa-2023/Python-Code-Large/train/row_98274 | 9 | 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_98274:ImportFrom_L1_C0", "label": "from random import uniform", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["uni... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98274:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98274:Assign_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98274:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98274:For_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9827... |
from random import uniform
NUMTEST = 100
for test in range(1,NUMTEST+1):
cantNodos = test
print cantNodos,(cantNodos*(cantNodos-1))/2
for u in range(1,cantNodos+1):
for v in range(u+1,cantNodos+1):
print u,v,int(uniform(0,100))
print 0
| ajibawa-2023/Python-Code-Large/train/row_98275 | 9 | 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_98275:ImportFrom_L1_C0", "label": "from random import uniform", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["uni... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98275:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98275:Assign_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98275:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98275:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_982... |
#!/usr/bin/python
import random,\
sys
MIN_VERTICES = 3
MAX_VERTICES = 10
INSTANCIAS = 50
MAX_EJE_PESO = 5
for i in range(INSTANCIAS):
#cantidad de vertices.
v = random.randint(MIN_VERTICES,MAX_VERTICES)
#cantidad de ejes.
#grafo esparso
w = random.randint(v, max(int( ( (v*(v-1))* 0.5 )... | ajibawa-2023/Python-Code-Large/train/row_98276 | 21 | 35 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98276:Import_L2_C0", "label": "random import random, sys", "type": "import", "loc": [2, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0571, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98276:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98276:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98276:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98276:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import random,\
sys
MIN_VERTICES = 3
MAX_VERTICES = 15
INSTANCIAS = 500
MAX_EJE_PESO = 50
for i in range(INSTANCIAS):
v = random.randint(MIN_VERTICES,MAX_VERTICES)
w = random.randint(v,(v*(v-1))/2);
k = random.randint(2,int(v/2)+1)
ejes = set([])
pesos = dict([])
... | ajibawa-2023/Python-Code-Large/train/row_98277 | 21 | 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_98277:Import_L2_C0", "label": "random import random, sys", "type": "import", "loc": [2, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0741, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98277:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98277:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98277:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98277:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import random,\
sys
MIN_VERTICES = 3
MAX_VERTICES = 15
INSTANCIAS = 300
MAX_EJE_PESO = 50
for i in range(INSTANCIAS):
v = random.randint(MIN_VERTICES,MAX_VERTICES)
w = random.randint(v,int((v*(v-1))/4)+2);
k = random.randint(2,int(v/4)+2)
ejes = set([])
pesos = dict([]... | ajibawa-2023/Python-Code-Large/train/row_98278 | 21 | 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_98278:Import_L2_C0", "label": "random import random, sys", "type": "import", "loc": [2, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0741, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98278:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98278:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98278:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98278:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import random,\
sys
MIN_VERTICES = 3
MAX_VERTICES = 30
INSTANCIAS = 500
MAX_EJE_PESO = 100
for i in range(INSTANCIAS):
v = random.randint(MIN_VERTICES,MAX_VERTICES)
w = random.randint(((v*(v-1))/4),((v*(v-1))/2));
k = random.randint(2,int(v/2)+1)
ejes = set([])
pesos =... | ajibawa-2023/Python-Code-Large/train/row_98279 | 21 | 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_98279:Import_L2_C0", "label": "random import random, sys", "type": "import", "loc": [2, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0741, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98279:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98279:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98279:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98279:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import random,\
sys
MIN_VERTICES = 3
MAX_VERTICES = 50
INSTANCIAS = 2000
MAX_EJE_PESO = 5
kmax = 1
disperso = False
if(len(sys.argv) > 2 and sys.argv[2] == "-e"):
disperso = True
sys.stderr.write("Generando grafos dispersos\n")
elif(len(sys.argv) > 1):
sys.stderr.write("Generando gra... | ajibawa-2023/Python-Code-Large/train/row_98280 | 34 | 55 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98280:Import_L2_C0", "label": "random import random, sys", "type": "import", "loc": [2, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0364, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98280:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98280:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98280:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98280:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import differential as p1
import numpy as np
import matplotlib.pylab as mp
from math import sqrt
## ------------------------- pendule simple ------------------------------##
## equation :
## y'' + W^2sin(y) = 0 si y petit y'' + W^2y = 0 avec W^2=g/l
d = np.pi / 2
step = 0.001
N = int (d / step)
# tige de longueur ... | ajibawa-2023/Python-Code-Large/train/row_98281 | 55 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98281:Import_L1_C0", "label": "differential import p1", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0106, 0, 0.66, 0.0, 439, 0, 1, 0, 0, 439, 0, 0], "semantic": {"name": "differential", "arg_names": [], "import_names": ["p1"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98281:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98281:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98281:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98281:Assign_L29_C1"}, {"f": "ajibawa-2023/Python-Co... |
import numpy as np
import differential as p1
import matplotlib.pyplot as plt
def resolution_eq(y0,t0,N,h,meth):
""" Resolution des equations de Malthus et Verhuslt """
gamma = 2.9
k = 20e9
Malthus = lambda y,t : y
Verhulst = lambda y,t : gamma*y*(1-(y/k))
X = p1.meth_N_step(y0,t0,N,h,Malthus,m... | ajibawa-2023/Python-Code-Large/train/row_98282 | 46 | 68 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98282:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98282:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98282:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98282:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98282:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import differential as p1
import numpy as np
import matplotlib.pyplot as mp
from math import sqrt
d = 3.14
step = 0.001
# tige de longueur 10cm
N=3500
l=0.1
g=9.81
## pendule a deux maillons ##
# longueur de le tige 10cm masse de 1g
m = 1
# Y=[y1, y2, y1', y2'] F(Y,t)=[y1', y2', y1'', y2''] ou y1'' et y2'' verifie... | ajibawa-2023/Python-Code-Large/train/row_98283 | 71 | 101 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98283:Import_L1_C0", "label": "differential import p1", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 0.0099, 0, 0.66, 0.0, 439, 0, 1, 0, 0, 439, 0, 0], "semantic": {"name": "differential", "arg_names": [], "import_names": ["p1"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98283:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98283:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98283:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98283:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Co... |
import numpy as np
import matplotlib.pylab as mp
from math import exp
## CI dans un tableau ##
## METHODE D'EULER
def step_euler(y,t,h,F):
n=np.shape(y)
z=np.zeros(n)
z=y+h*F(y,t)
return z
## METHODE DU POINT MILIEU
def step_pt_milieu(y,t,h,F):
n=np.shape(y)
y_aux=np.zeros(n) ##y_aux repre... | ajibawa-2023/Python-Code-Large/train/row_98284 | 123 | 180 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98284:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0056, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98284:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98284:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98284:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98284:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code... |
'''
Created on 21-03-2011
@author: maciek
'''
from formater import formatString
import os
class IndexGenerator(object):
'''
Generates Index.html for iOS app OTA distribution
'''
basePath = os.path.dirname(__file__)
templateFile = os.path.join(basePath,"templates/index.tmpl")
releaseUrls = ""
... | ajibawa-2023/Python-Code-Large/train/row_98285 | 31 | 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_98285:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0526, 0.0877, 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_98285:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98285:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98285:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98285:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
'''
Created on 21-03-2011
@author: maciek
'''
def formatString(format, **kwargs):
'''
'''
if not format: return ''
for arg in kwargs.keys():
format = format.replace("{" + arg + "}", "##" + arg + "##")
format = format.replace ("{", "{{")
format = format.replace("}", "}}")
for... | ajibawa-2023/Python-Code-Large/train/row_98286 | 15 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98286:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1304, 0.2174, 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_98286:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98286:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98286:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98286:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
'''
Created on 21-03-2011
@author: maciek
'''
from IndexGenerator import IndexGenerator
from optparse import OptionParser
import os
import tempfile
import shutil
import logging
logging.basicConfig(level = logging.DEBUG)
parser = OptionParser()
parser.add_option('-n', '--app-name', action='store', dest='appName', hel... | ajibawa-2023/Python-Code-Large/train/row_98287 | 69 | 88 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98287:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0341, 0.0568, 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_98287:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98287:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98287:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98287:If_L28_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98287... |
#! /usr/bin/env python
# encoding: utf-8
# waf 1.6.2
VERSION='0.3.3'
import sys
APPNAME='p2t'
top = '.'
out = 'build'
CPP_SOURCES = ['poly2tri/common/shapes.cc',
'poly2tri/sweep/cdt.cc',
'poly2tri/sweep/advancing_front.cc',
'poly2tri/sweep/sweep_context.cc',
... | ajibawa-2023/Python-Code-Large/train/row_98288 | 25 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98288:Assign_L5_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.0222, 0, 0.66, 0.0, 557, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VERSION", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98288:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98288:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98288:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98288:If_L25_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_982... |
#!/usr/bin/env python
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ajibawa-2023/Python-Code-Large/train/row_98289 | 17 | 39 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98289:Import_L18_C0", "label": "urllib import urllib", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.4615, 0.0256, 0, 0.66, 0.0, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98289:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98289:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98289:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98289:If_L27_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ajibawa-2023/Python-Code-Large/train/row_98290 | 32 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98290:Import_L18_C0", "label": "csv import csv", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0159, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98290:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98290:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98290:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98290:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98291 | 12 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98291:Import_L17_C0", "label": "bigint_patch import bigint_patch", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.4474, 0.0263, 0, 0.66, 0.0, 521, 0, 1, 0, 0, 521, 0, 0], "semantic": {"name": "bigint_patch", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98291:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98291:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98291:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98291:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98292 | 3 | 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_98292:ImportFrom_L17_C0", "label": "from django.contrib import admin", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.85, 0.05, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_... | [] |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98293 | 11 | 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_98293:ImportFrom_L17_C0", "label": "from django_ip2country.models import Ip2Country", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5312, 0.0312, 0, 0.66, 0.0, 6, 0, 1, 0, 0, 6, 0, 0], "semantic": {"name": "django_ip2country.models", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98293:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98293:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98293:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98293:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98294 | 0 | 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"] | [] | [] |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98295 | 44 | 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_98295:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 24], "level": 0, "parent": null, "vector": [8, 0, 0.2158, 0.0842, 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_98295:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98295:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98295:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98295:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | ajibawa-2023/Python-Code-Large/train/row_98296 | 38 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98296:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 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_98296:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98296:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98296:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98296:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-... |
import numpy as np
import householder as hh
# fonction auxiliaire :
def completeMat(A,n):
"fonction qui sert a completer la matrice A avec des '1' sur l'element diagonale des lignes/colonnes deja traitees"
#cette fonction ne modifie pas A si taille(A)=n
Id=np.identity(n)
i=A.shape[0]
for j in... | ajibawa-2023/Python-Code-Large/train/row_98297 | 34 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98297:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98297:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98297:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98297:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98297:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Partie I : Transformations de Householder
import numpy as np
from numpy import linalg as la
# Question I
def computeUtU(U):
"""Calcule le produit d'un vecteur par sa transposee"""
n = len(U)
RES = np.zeros([n,n])
for i in range(n):
for j in range(n):
RES[i,j] = U[i]*U[j]
ret... | ajibawa-2023/Python-Code-Large/train/row_98298 | 36 | 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_98298:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0192, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98298:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98298:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98298:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98298:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Fichier pour tester les differentes parties du projet
import householder as hh
import bidiagonale as bd
import decompositionSVD as svd
import compression as comp
import numpy as np
import matplotlib.pyplot as mp
print "#############################################"
print "# ... | ajibawa-2023/Python-Code-Large/train/row_98299 | 121 | 150 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98299:Import_L4_C0", "label": "householder import hh", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0267, 0.0067, 0, 0.66, 0.0, 583, 0, 1, 0, 0, 583, 0, 0], "semantic": {"name": "householder", "arg_names": [], "import_names": ["hh"], "... | [] |
# Partie III : Transformations QR et decompostion SVD
import numpy as np
import householder as hh
import matplotlib.pyplot as plt
# Question I,II
def externDiagNorme(A):
"""Affiche la norme-2 hors diagonale de la matrice"""
n = len(A)
p = len(A[0])
res = 0.
for i in range(n):
for j in ra... | ajibawa-2023/Python-Code-Large/train/row_98300 | 91 | 126 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98300:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0079, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98300:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98300:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98300:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98300:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Partie 4: Application a la compression d'image
import numpy as np
import bidiagonale as bd
import decompositionSVD as svd
import matplotlib.pyplot as mp
#Question 1
def clean(compressed_img):
"""mise zero tous les elements inferieurs a valeur e"""
e=pow(10,-5)
img=compressed_img
n=img.shape[0]
for i in n... | ajibawa-2023/Python-Code-Large/train/row_98301 | 72 | 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_98301:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0096, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98301:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98301:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98301:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98301:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code... |
from google.appengine.api import urlfetch
from django.utils import simplejson as json
class Mendeley:
'''Mendeley open client for algos'''
REQUEST_TOKEN_URL = 'http://www.mendeley.com/oauth/request_token/'
ACCESS_TOKEN_URL = 'http://www.mendeley.com/oauth/access_token/'
AUTHORIZATION_URL ... | ajibawa-2023/Python-Code-Large/train/row_98302 | 29 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98302:ImportFrom_L1_C0", "label": "from google.appengine.api import urlfetch", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "google.appengine.api", "arg_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98302:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98302:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98302:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98302:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | ajibawa-2023/Python-Code-Large/train/row_98303 | 389 | 655 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98303:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0183, 0.0351, 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_98303:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98303:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98303:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98303:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.conf.urls.defaults import *
urlpatterns = patterns('articles.views',
(r'^$', 'index'),
(r'^articles.js$', 'get_articles_json')
) | ajibawa-2023/Python-Code-Large/train/row_98304 | 2 | 6 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98304:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n... | [] |
from django.core.cache import cache
from django import http
from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from articles.Mendeley import Mendeley
def get_articles_json(request):
mendeley = Mendel... | ajibawa-2023/Python-Code-Large/train/row_98305 | 13 | 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_98305:ImportFrom_L1_C0", "label": "from django.core.cache import cache", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 734, 0, 1, 0, 0, 734, 0, 0], "semantic": {"name": "django.core.cache", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98305:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98305:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98305:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98305:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.conf.urls.defaults import *
urlpatterns = patterns('massmedia.views',
(r'^$', 'index')
) | ajibawa-2023/Python-Code-Large/train/row_98306 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98306:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
# -*- encoding: utf-8 -*-
from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
def index(request):
title_p... | ajibawa-2023/Python-Code-Large/train/row_98307 | 8 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98307:ImportFrom_L2_C0", "label": "from django.core.cache import cache", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 734, 0, 1, 0, 0, 734, 0, 0], "semantic": {"name": "django.core.cache", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98307:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98307:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98307:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98307:Return_L10_C4"}] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | ajibawa-2023/Python-Code-Large/train/row_98308 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98308:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98308:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98308:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98308:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98308:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
from django.conf.urls.defaults import *
urlpatterns = patterns('tractament.views',
(r'^$', 'index'),
) | ajibawa-2023/Python-Code-Large/train/row_98309 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98309:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
from django.views.generic.simple import direct_to_template
from contact.contact_form import ContactForm
def index(request):
title_page = 'Tractament'
if request.method == 'GET': # If the form has been submitted...
form = ContactForm({'subject' : '[web algos] Formulari de tractament'}) # An ... | ajibawa-2023/Python-Code-Large/train/row_98310 | 7 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98310:ImportFrom_L1_C0", "label": "from django.views.generic.simple import direct_to_template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 956, 0, 1, 0, 0, 956, 0, 0], "semantic": {"name": "django.views.ge... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98310:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98310:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98310:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98310:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files.storage import Storage
from django.core.files.uploadedfile import UploadedFile
from django.core.files.uploadhandler im... | ajibawa-2023/Python-Code-Large/train/row_98311 | 104 | 169 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98311:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0059, 0.0059, 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_98311:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98311:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98311:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98311:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from .testmodels import OrderedModel
from django.test import TestCase
class OrderTest(TestCase):
def create_ordered_model_items(self):
pks = []
priorities = [5, 2, 9, 1]
for pk, priority in enumerate(priorities):
pk += 1
model = OrderedModel(pk=pk, priority=priority)... | ajibawa-2023/Python-Code-Large/train/row_98312 | 28 | 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_98312:ImportFrom_L1_C0", "label": "from testmodels import OrderedModel", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0175, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "testmodels", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98312:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98312:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98312:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98312:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
from .testmodels import DecimalModel
from django.test import TestCase
from decimal import Decimal
D = Decimal
class DecimalTest(TestCase):
DECIMALS = D("12345.6789"), D("5"), D("345.67"), D("45.6"), D("2345.678"),
def setUp(self):
for d in self.DECIMALS:
DecimalModel(decimal=d).save()
... | ajibawa-2023/Python-Code-Large/train/row_98313 | 21 | 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_98313:ImportFrom_L1_C0", "label": "from testmodels import DecimalModel", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "testmodels", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98313:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98313:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98313:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98313:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from .testmodels import FieldsWithOptionsModel, EmailModel, DateTimeModel, OrderedModel
from ..db.utils import get_cursor
import datetime, time
from django.test import TestCase
from django.db.models import Q
from django.db.utils import DatabaseError
from djangoappengine.db.utils import set_cursor
from djangoappe... | ajibawa-2023/Python-Code-Large/train/row_98314 | 137 | 426 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98314:ImportFrom_L1_C0", "label": "from testmodels import FieldsWithOptionsModel, EmailModel, DateTimeModel\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 808, 0, 4, 0, 0, 808, 0, 0], "semantic": {"nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98314:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98314:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98314:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98314:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.db import models
from django.test import TestCase
from django.db.utils import DatabaseError
class A(models.Model):
value = models.IntegerField()
class B(A):
other = models.IntegerField()
class BackendTest(TestCase):
def test_model_forms(self):
from django import forms
class F(... | ajibawa-2023/Python-Code-Large/train/row_98315 | 20 | 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_98315:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["mode... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98315:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98315:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98315:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98315:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from .testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel
import datetime
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['app-engine@scholard... | ajibawa-2023/Python-Code-Large/train/row_98316 | 52 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98316:ImportFrom_L1_C0", "label": "from testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0104, 0, 0.66, 0.0, 808, 0, 3, 0, 0, 808, 0, 0], "semantic": {"na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98316:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98316:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98316:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98316:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django.test import TestCase
from django.db.utils import DatabaseError
from django.db.models.fields import NOT_PROVIDED
from .testmodels import FieldsWithOptionsModel
from google.appengine.api.datastore import Get
from google.appengine.ext.db import Key
from google.appengine.api.datastore_types import Text, C... | ajibawa-2023/Python-Code-Large/train/row_98317 | 46 | 80 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98317:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0125, 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_98317:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98317:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98317:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98317:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-... |
from .backend import BackendTest
from .field_db_conversion import FieldDBConversionTest
from .field_options import FieldOptionsTest
from .filter import FilterTest
from .order import OrderTest
from .not_return_sets import NonReturnSetsTest
from .decimals import DecimalTest
| ajibawa-2023/Python-Code-Large/train/row_98318 | 7 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98318:ImportFrom_L1_C0", "label": "from backend import BackendTest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 631, 0, 1, 0, 0, 631, 0, 0], "semantic": {"name": "backend", "arg_names": [], "import_names":... | [] |
from django.db import models
from ..db.db_settings import get_indexes
from djangotoolbox.fields import BlobField
class EmailModel(models.Model):
email = models.EmailField()
class DateTimeModel(models.Model):
datetime = models.DateTimeField()
datetime_auto_now = models.DateTimeField(auto_now=True)... | ajibawa-2023/Python-Code-Large/train/row_98319 | 61 | 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_98319:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 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_98319:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98319:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98319:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98319:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from .testmodels import FieldsWithoutOptionsModel
from django.test import TestCase
from google.appengine.api.datastore import Get
from google.appengine.ext.db import Key
from google.appengine.api.datastore_types import Text, Category, Email, Link, \
PhoneNumber, PostalAddress, Text, Blob, ByteString, GeoPt, IM, Key... | ajibawa-2023/Python-Code-Large/train/row_98320 | 18 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98320:ImportFrom_L1_C0", "label": "from testmodels import FieldsWithoutOptionsModel", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "testmodels", "arg_names":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98320:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98320:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98320:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98320:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
# Initialize App Engine SDK if necessary
try:
from google.appengine.api import api_proxy_stub_map
except ImportError:
from .boot import setup_env
setup_env()
from djangoappengine.utils import on_production_server, have_appserver
DEBUG = not on_production_server
TEMPLATE_DEBUG = DEBUG
ROOT_URL... | ajibawa-2023/Python-Code-Large/train/row_98322 | 21 | 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_98322:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.1026, 0.1282, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98322:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98322:ImportFrom_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98322:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98322:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
import os
import sys
# Add parent folder to sys.path, so we can import boot.
# App Engine causes main.py to be reloaded if an exception gets raised
# on the first request of a main.py instance, so don't add project_dir multiple
# times.
project_dir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirna... | ajibawa-2023/Python-Code-Large/train/row_98323 | 63 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98323:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0106, 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_98323:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98323:While_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98323:While_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98323:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
from django.core.management import execute_from_command_line
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Runs a command with access to the remote App Engine production ' \
'server (e.g. manage.py remote shell)'
args = 'remotecommand'
def run_from_argv... | ajibawa-2023/Python-Code-Large/train/row_98325 | 12 | 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_98325:ImportFrom_L1_C0", "label": "from django.core.management import execute_from_command_line", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98325:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98325:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98325:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98325:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | ajibawa-2023/Python-Code-Large/train/row_98326 | 37 | 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_98326:ImportFrom_L21_C0", "label": "from django.conf import settings", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.2917, 0.0139, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98326:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98326:ImportFrom_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98326:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98326:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | ajibawa-2023/Python-Code-Large/train/row_98327 | 47 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98327:Import_L18_C0", "label": "logging import logging", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0108, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98327:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98327:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98327:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98327:ImportFrom_L34_C4"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | ajibawa-2023/Python-Code-Large/train/row_98328 | 37 | 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_98328:ImportFrom_L21_C0", "label": "from django.conf import settings", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.2917, 0.0139, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98328:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98328:ImportFrom_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98328:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98328:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_98329 | 31 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98329:Import_L18_C0", "label": "os import os", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2466, 0.0137, 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_98329:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98329:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98329:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98329:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_98330 | 31 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98330:Import_L18_C0", "label": "os import os", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2466, 0.0137, 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_98330:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98330:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98330:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98330:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | ajibawa-2023/Python-Code-Large/train/row_98331 | 47 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98331:Import_L18_C0", "label": "logging import logging", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0108, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98331:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98331:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98331:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98331:ImportFrom_L34_C4"}, {"f": "ajibawa-2023/Python-... |
from .db_settings import get_indexes
from djangotoolbox.db.creation import NonrelDatabaseCreation
class StringType(object):
def __init__(self, internal_type):
self.internal_type = internal_type
def __mod__(self, field):
indexes = get_indexes().get(field['model'], {})
if field['name'] i... | ajibawa-2023/Python-Code-Large/train/row_98333 | 30 | 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_98333:ImportFrom_L1_C0", "label": "from db_settings import get_indexes", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 236, 0, 1, 0, 0, 236, 0, 0], "semantic": {"name": "db_settings", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98333:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98333:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98333:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98333:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
from google.appengine.datastore.datastore_pb import CompiledCursor
import base64
def get_cursor(queryset):
# Evaluate QuerySet
len(queryset)
cursor = getattr(queryset.query, '_gae_cursor', None)
return base64.urlsafe_b64encode(cursor.Encode())
def set_cursor(queryset, start=None, end=None):
... | ajibawa-2023/Python-Code-Large/train/row_98334 | 16 | 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_98334:ImportFrom_L1_C0", "label": "from google.appengine.datastore.datastore_pb import CompiledCursor", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 334, 0, 1, 0, 0, 334, 0, 0], "semantic": {"name": "google.appe... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98334:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98334:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98334:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98334:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.conf import settings
from django.utils.importlib import import_module
_MODULE_NAMES = getattr(settings, 'GAE_SETTINGS_MODULES', ())
FIELD_INDEXES = None
# TODO: add support for eventual consistency setting on specific models
def get_indexes():
global FIELD_INDEXES
if FIELD_INDEXES is None:
... | ajibawa-2023/Python-Code-Large/train/row_98335 | 12 | 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_98335:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98335:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98335:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98335:If_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98335:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
from google.appengine.api.memcache import *
| ajibawa-2023/Python-Code-Large/train/row_98337 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98337:ImportFrom_L1_C0", "label": "from google.appengine.api.memcache import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 901, 0, 1, 0, 0, 901, 0, 0], "semantic": {"name": "google.appengine.api.memcache", "arg... | [] |
import os, sys
parent_dir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
# Initialize Django
from djangoappengine.main import main as gaemain
# Import and run the actual handler
from google.appengine.ext.deferred.handle... | ajibawa-2023/Python-Code-Large/train/row_98339 | 8 | 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_98339:Import_L1_C0", "label": "os import os, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98339:If_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98339:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98339:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98339:Expr_L13_C4"}] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | ajibawa-2023/Python-Code-Large/train/row_98340 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98340:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98340:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98340:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98340:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98340:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
from django import forms
class ContactForm(forms.Form):
message = forms.CharField(widget=forms.Textarea)
subject = forms.CharField(widget=forms.HiddenInput)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False) | ajibawa-2023/Python-Code-Large/train/row_98341 | 6 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98341:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 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_98341:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98341:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98341:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98341:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django.conf.urls.defaults import *
urlpatterns = patterns('contact.views',
(r'^contactForm', 'contactForm')
) | ajibawa-2023/Python-Code-Large/train/row_98342 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98342:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
from django.conf.urls.defaults import *
from django.contrib.auth.forms import AuthenticationForm
from django.views.generic.simple import direct_to_template
from django.views.generic.simple import redirect_to
handler500 = 'djangotoolbox.errorviews.server_error'
urlpatterns = patterns('',
(r'^$', direct_to_... | ajibawa-2023/Python-Code-Large/train/row_98344 | 6 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98344:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n... | [] |
from .fields import ListField, SetField, DictField, EmbeddedModelField
from django.db import models, connections
from django.db.models import Q
from django.db.utils import DatabaseError
from django.test import TestCase
from django.utils import unittest
class ListModel(models.Model):
floating_point = models... | ajibawa-2023/Python-Code-Large/train/row_98345 | 135 | 252 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98345:ImportFrom_L1_C0", "label": "from fields import ListField, SetField, DictField\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.004, 0.004, 0, 0.66, 0.0, 358, 0, 4, 0, 0, 358, 0, 0], "semantic": {"name": "fields", "arg_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98345:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98345:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98345:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98345:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse
from django.utils import simplejson
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(DjangoJSONEncoder):
def default(self, ob... | ajibawa-2023/Python-Code-Large/train/row_98346 | 17 | 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_98346: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_98346:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98346:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98346:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98346:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
... | ajibawa-2023/Python-Code-Large/train/row_98347 | 133 | 234 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98347:ImportFrom_L3_C0", "label": "from django.db import models", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0043, 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_98347:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98347:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98347:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98347:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.cache import patch_cache_control
LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ())
NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ())
class LoginRequiredMiddleware(obj... | ajibawa-2023/Python-Code-Large/train/row_98348 | 30 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98348:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 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_98348:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98348:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98348:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98348:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.conf import settings
from django.core.cache import cache
from django.contrib.sites.models import Site
from djangotoolbox.utils import make_tls_property
_default_site_id = getattr(settings, 'SITE_ID', None)
SITE_ID = settings.__class__.SITE_ID = make_tls_property()
class DynamicSiteIDMiddleware(obj... | ajibawa-2023/Python-Code-Large/train/row_98349 | 36 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98349:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0172, 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_98349:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98349:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98349:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98349:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from .utils import object_list_to_table, equal_lists
from django.test import TestCase
from django.test.simple import DjangoTestSuiteRunner, DjangoTestRunner
import sys
try:
from StringIO import StringIO
except ImportError:
from cStringIO import StringIO
class ModelTestCase(TestCase):
"""
A... | ajibawa-2023/Python-Code-Large/train/row_98350 | 61 | 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_98350:ImportFrom_L1_C0", "label": "from utils import object_list_to_table, equal_lists", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0096, 0.0096, 0, 0.66, 0.0, 970, 0, 2, 0, 0, 970, 0, 0], "semantic": {"name": "utils", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98350:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98350:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98350:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98350:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
def make_tls_property(default=None):
"""Creates a class-wide instance property with a thread-specific value."""
class TLSProperty(object):
def __init__(self):
from threading import local
self.local = local()
def __get__(self, instance, cls):
if not instance:
... | ajibawa-2023/Python-Code-Large/train/row_98351 | 48 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98351:FunctionDef_L1_C0", "label": "make_tls_property", "type": "function", "loc": [1, 22], "level": 0, "parent": null, "vector": [2, 0, 0.1223, 0.234, 0, 0.66, 0.0, 317, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "make_tls_property", "arg_names": ["default"], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98351:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98351:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98351:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98351:ClassDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User, Group
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('username', 'email', 'first_name', 'last_name', 'is_active',
... | ajibawa-2023/Python-Code-Large/train/row_98352 | 14 | 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_98352:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98352:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98352:ClassDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98352:ClassDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98352:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django.forms import widgets
from django.template.defaultfilters import filesizeformat
from django.utils.safestring import mark_safe
class BlobWidget(widgets.FileInput):
def render(self, name, value, attrs=None):
try:
blob_size = len(value)
except:
blob_size = 0
... | ajibawa-2023/Python-Code-Large/train/row_98353 | 11 | 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_98353:ImportFrom_L1_C0", "label": "from django.forms import widgets", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 666, 0, 1, 0, 0, 666, 0, 0], "semantic": {"name": "django.forms", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98353:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98353:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98353:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98353:Try_L7_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
from django.db.backends.creation import BaseDatabaseCreation
class NonrelDatabaseCreation(BaseDatabaseCreation):
data_types = {
'AutoField': 'integer',
'BigIntegerField': 'long',
'BooleanField': 'bool',
'CharField': 'text',
'CommaSeparatedInteg... | ajibawa-2023/Python-Code-Large/train/row_98354 | 3 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98354:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "django.db.bac... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98354:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98354:Assign_L4_C4"}] |
from django.conf import settings
from django.db.models.sql import aggregates as sqlaggregates
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.constants import LOOKUP_SEP, MULTI, SINGLE
from django.db.models.sql.where import AND, OR, Constraint
from django.db.utils import DatabaseErr... | ajibawa-2023/Python-Code-Large/train/row_98355 | 202 | 361 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98355:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 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_98355:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98355:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98355:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98355:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-... |
import datetime
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, \
BaseDatabaseWrapper, BaseDatabaseClient, BaseDatabaseValidation, \
BaseDatabaseIntrospection
from .creation import NonrelDatabaseCreation
class NonrelDatabaseFeatures(BaseDatabaseFeatures):
can_return_id... | ajibawa-2023/Python-Code-Large/train/row_98356 | 55 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98356:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0111, 0.0111, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98356:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98356:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98356:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98356:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from django import http
from django.template import Context, RequestContext, loader
def server_error(request, template_name='500.html'):
"""
500 error handler.
Templates: `500.html`
Context:
request_path
The path of the requested URL (e.g., '/app/pages/bad_page/')
"""
t = l... | ajibawa-2023/Python-Code-Large/train/row_98357 | 6 | 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_98357:ImportFrom_L1_C0", "label": "from django import http", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["http"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98357:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98357:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98357:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98357:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from djangoappengine.settings_base import *
import os
SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'
LANGUAGE_CODE = 'ca'
INSTALLED_APPS = (
'djangoappengine',
'djangotoolbox',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'... | ajibawa-2023/Python-Code-Large/train/row_98358 | 12 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98358:ImportFrom_L1_C0", "label": "from djangoappengine.settings_base import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 0, 0.66, 0.0, 423, 0, 1, 0, 0, 423, 0, 0], "semantic": {"name": "djangoappengine.settings_base", ... | [] |
"""
Mendeley Open API Example Client
Copyright (c) 2010, Mendeley Ltd. <copyright@mendeley.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWAR... | ajibawa-2023/Python-Code-Large/train/row_98359 | 121 | 526 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98359:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 54], "level": 0, "parent": null, "vector": [8, 0, 0.0523, 0.1027, 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_98359:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98359:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98359:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98359:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | ajibawa-2023/Python-Code-Large/train/row_98360 | 385 | 758 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98360:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0158, 0.0303, 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_98360:Try_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98360:ImportFrom_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98360:Try_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98360:ImportFrom_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | ajibawa-2023/Python-Code-Large/train/row_98361 | 9 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98361:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.3, 0.575, 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_98361:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98361:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98361:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98361:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | ajibawa-2023/Python-Code-Large/train/row_98362 | 10 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98362:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.2927, 0.561, 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_98362:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98362:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98362:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98362:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
Mendeley Open API Example Client
Copyright (c) 2010, Mendeley Ltd. <copyright@mendeley.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWAR... | ajibawa-2023/Python-Code-Large/train/row_98363 | 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_98363:ImportFrom_L1_C0", "label": "from pprint import pprint", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "pprint", "arg_names": [], "import_names": ["pprint"], ... | [] |
class AlgosSection:
titlePage = "under construction" | ajibawa-2023/Python-Code-Large/train/row_98364 | 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_98364:ClassDef_L1_C0", "label": "AlgosSection", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.75, 1.0, 0, 0.66, 0.0, 167, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "AlgosSection", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98364:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98364:Assign_L2_C4"}] |
from django.conf.urls.defaults import *
urlpatterns = patterns('algos.views',
(r'^$', 'index'),
(r'^sobrealgos$', 'index'),
(r'^quisom$', 'quisom'),
(r'^contactar$', 'contactar')
) | ajibawa-2023/Python-Code-Large/train/row_98365 | 2 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98365:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_nam... | [] |
from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from algos.models import AlgosSection
def index(request):
... | ajibawa-2023/Python-Code-Large/train/row_98366 | 15 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98366:ImportFrom_L1_C0", "label": "from django.core.cache import cache", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 734, 0, 1, 0, 0, 734, 0, 0], "semantic": {"name": "django.core.cache", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98366:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98366:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98366:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98366:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.conf.urls.defaults import *
urlpatterns = patterns('projects.views',
(r'^$', 'index')
) | ajibawa-2023/Python-Code-Large/train/row_98367 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98367:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from algos.models import AlgosSection
def index(request):
... | ajibawa-2023/Python-Code-Large/train/row_98368 | 9 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98368:ImportFrom_L1_C0", "label": "from django.core.cache import cache", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 734, 0, 1, 0, 0, 734, 0, 0], "semantic": {"name": "django.core.cache", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98368:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98368:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98368:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98368:Return_L10_C4"}] |
from django.conf.urls.defaults import *
urlpatterns = patterns('linies.views',
(r'^$', 'index')
) | ajibawa-2023/Python-Code-Large/train/row_98369 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98369:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
def index(request):
title_page = "Recerca"
return... | ajibawa-2023/Python-Code-Large/train/row_98370 | 8 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98370:ImportFrom_L1_C0", "label": "from django.core.cache import cache", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 734, 0, 1, 0, 0, 734, 0, 0], "semantic": {"name": "django.core.cache", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98370:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98370:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98370:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98370:Return_L9_C4"}] |
import datetime
import os
import re
import sys
from django.conf import settings
from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
from django.template import (Template, Context, TemplateDoesNotExist,
TemplateSyntaxError)
from django.utils.html import escape
from django.u... | ajibawa-2023/Python-Code-Large/train/row_98371 | 173 | 856 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98371:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0012, 0.0012, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98371:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98371:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98371:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98371:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code... |
"""
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators im... | ajibawa-2023/Python-Code-Large/train/row_98372 | 74 | 164 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98372:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0122, 0.0183, 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_98372:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98372:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98372:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98372:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.