code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
import cv2.cv as cv import tesseract import sys api = tesseract.TessBaseAPI() api.Init(".","eng",tesseract.OEM_DEFAULT) api.SetPageSegMode(tesseract.PSM_AUTO) image=cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE) tesseract.SetCvImage(image,api) text=api.GetUTF8Text() conf=api.MeanTextConf() print "scanned text:...
ajibawa-2023/Python-Code-Large/train/row_1406
11
13
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1406:Import_L1_C0", "label": "cv2.cv import cv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 369, 0, 1, 0, 0, 369, 0, 0], "semantic": {"name": "cv2.cv", "arg_names": [], "import_names": ["cv"], "rhs_call_na...
[]
#!/usr/bin/env python # -*- encoding:utf8 -*- # protoc-gen-erl # Google's Protocol Buffers project, ported to lua. # https://code.google.com/p/protoc-gen-lua/ # # Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com # All rights reserved. # # Use, modification and distribution are subject to the "New BSD License" #...
ajibawa-2023/Python-Code-Large/train/row_1407
295
450
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1407:Import_L13_C0", "label": "sys import sys", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0289, 0.0022, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_nam...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1407:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1407:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1407:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1407:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1407:...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Zdenko Podobný # Author: Zdenko Podobný # # 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/LIC...
ajibawa-2023/Python-Code-Large/train/row_1409
3
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1409:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "an...
[]
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
ajibawa-2023/Python-Code-Large/train/row_1410
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_1410:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sub...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1410:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1410:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1410:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1410:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_141...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
ajibawa-2023/Python-Code-Large/train/row_1412
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_1412:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sub...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1412:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1412:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1412:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1412:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_141...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
ajibawa-2023/Python-Code-Large/train/row_1414
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_1414:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sub...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1414:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1414:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1414:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1414:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_141...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
ajibawa-2023/Python-Code-Large/train/row_1416
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_1416:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sub...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1416:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1416:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1416:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1416:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_141...
#!/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_1418
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_1418: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_1418:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1418:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1418:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1418:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/python # -*- coding: utf-8 -*- # Dieses Script kontrolliert eine Lösung. Es wird ausgegeben, wie viele Farben # verwendet wurden und wie groß das Dreieck ist. # Funktioniert nur mit korrekter Eingabedatei (keine Leerzeichen zum trennen der # Farben, neue Zeilen für eine neue Ebene des n-Traumrechtecks) i...
ajibawa-2023/Python-Code-Large/train/row_1419
56
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_1419:Import_L9_C0", "label": "copy import copy, os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0957, 0.0106, 0, 0.66, 0.0, 739, 0, 2, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy", "os"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1419:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1419:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1419:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1419:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-L...
#!/usr/bin/python # -*- coding: utf-8 -*- # Dieses Script kontrolliert eine Lösung. Es wird ausgegeben, wie viele Farben # verwendet wurden und wie groß das Dreieck ist. # Funktioniert nur mit korrekter Eingabedatei (keine Leerzeichen zum trennen der # Farben, neue Zeilen für eine neue Ebene des n-Traumrechtecks) i...
ajibawa-2023/Python-Code-Large/train/row_1420
56
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_1420:Import_L9_C0", "label": "copy import copy, os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0957, 0.0106, 0, 0.66, 0.0, 739, 0, 2, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy", "os"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1420:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1420:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1420:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1420:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-L...
''' Module which brings history information about files from Mercurial. @author: Rodrigo Damazio ''' import re import subprocess REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*') def _GetOutputLines(args): ''' Runs an external process and returns its output as a list of lines. @param args: the argume...
ajibawa-2023/Python-Code-Large/train/row_1421
38
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_1421:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0532, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1421:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1421:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1421:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1421:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/python ''' Entry point for My Tracks i18n tool. @author: Rodrigo Damazio ''' import mytracks.files import mytracks.translate import mytracks.validate import sys def Usage(): print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0] print 'Commands are:' print ' cleanup' print ' translate' p...
ajibawa-2023/Python-Code-Large/train/row_1422
58
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_1422:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0521, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1422:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1422:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1422:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1422:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large...
''' Module which prompts the user for translations and saves them. TODO: implement @author: Rodrigo Damazio ''' class Translator(object): ''' classdocs ''' def __init__(self, language): ''' Constructor ''' self._language = language def Translate(self, string_names): print string_names
ajibawa-2023/Python-Code-Large/train/row_1423
8
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1423:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1905, 0.3333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1423:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1423:Expr_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1423:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1423:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/...
''' Module which compares languague files to the master file and detects issues. @author: Rodrigo Damazio ''' import os from mytracks.parser import StringsParser import mytracks.history class Validator(object): def __init__(self, languages): ''' Builds a strings file validator. Params: @para...
ajibawa-2023/Python-Code-Large/train/row_1424
65
115
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1424:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0304, 0.0522, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1424:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1424:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1424:FunctionDef_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_1424:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L...
''' Module for dealing with resource files (but not their contents). @author: Rodrigo Damazio ''' import os.path from glob import glob import re MYTRACKS_RES_DIR = 'MyTracks/res' ANDROID_MASTER_VALUES = 'values' ANDROID_VALUES_MASK = 'values-*' def GetMyTracksDir(): ''' Returns the directory in which the MyTrac...
ajibawa-2023/Python-Code-Large/train/row_1425
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_1425:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1425:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1425:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1425:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1425:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
''' Module which parses a string XML file. @author: Rodrigo Damazio ''' from xml.parsers.expat import ParserCreate import re #import xml.etree.ElementTree as ET class StringsParser(object): ''' Parser for string XML files. This object is not thread-safe and should be used for parsing a single file at a time...
ajibawa-2023/Python-Code-Large/train/row_1426
54
115
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1426:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0261, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1426:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1426:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1426:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1426:FunctionDef_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Larg...
''' Created on 18 avr. 12 @author: peterd ''' class CalculationError: pass def get_1d_cutting_plan(stock_piece_length, custom_pieces, cut_thickness): num_custom_pieces = len(custom_pieces) cutting_schema = {} i = 0 while i < num_custom_pieces: num_elem = 1 prev_custom_packs = [] wh...
ajibawa-2023/Python-Code-Large/train/row_1427
105
155
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1427:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0194, 0.0323, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1427:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1427:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1427:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1427:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-L...
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('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 custo...
ajibawa-2023/Python-Code-Large/train/row_1428
10
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1428:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 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_1428:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1428:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1428:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1428:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1428:Tr...
from django.conf.urls.defaults import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', url(r'^solver$', '1d-cutter.views.cutting_plan_solver'), url(r'^1d-cutter/solver', '1d-cutter.views.cutting_plan_so...
ajibawa-2023/Python-Code-Large/train/row_1429
2
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_1429:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import patterns, include, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 341, 0, 3, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.ur...
[]
# Django settings for app project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
ajibawa-2023/Python-Code-Large/train/row_1430
24
147
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1430:Assign_L3_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0204, 0.0068, 0, 0.66, 0.0, 309, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name":...
[]
from django.views.generic.simple import direct_to_template from solver import * def init(request): return direct_to_template(request, '1d-cutter/1d_cutting_plan_form.html', {}) def cutting_plan_solver(request): order_num = request.GET['order_num'] stock_type = request.GET['stock_type'] stock_length...
ajibawa-2023/Python-Code-Large/train/row_1431
22
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_1431: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.0294, 0.0294, 0, 0.66, 0.0, 956, 0, 1, 0, 0, 956, 0, 0], "semantic": {"name": "django.views.gen...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1431:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1431:Return_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1431:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1431:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Larg...
import time, urllib , sys, threading workers = [] pendingurls = [] def ex(line): if "http://" in line: #and (".pls" in line.lower() or ".m3u" in line.lower()): url = line.split("'")[1].replace("''", "") pendingurls.append(url) class Worker(threading.Thread): def run(self): ...
ajibawa-2023/Python-Code-Large/train/row_1432
44
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1432:Import_L1_C0", "label": "time import time, urllib, sys\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 654, 0, 4, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["t...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1432:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1432:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1432:If_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1432:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_14...
import struct, string, time, os pasw = 704 dst = [] def crypt(text): text = text.replace("http://", "") key = len(text) % 10 result = "" for i in xrange(len(text)): result += chr( ( ord(text[i]) ^ ( (pasw * (i+1)) + key ) ) % 256) return result def writeint8(num): data...
ajibawa-2023/Python-Code-Large/train/row_1433
70
113
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1433:Import_L1_C0", "label": "struct import struct, string, time\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 399, 0, 4, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1433:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1433:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1433:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1433:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
import struct, string, time, os pasw = 704 dst = [] def crypt(text): text = text.replace("http://", "") return text #key = len(text) % 10 #result = "" #for i in xrange(len(text)): # result += chr( ( ord(text[i]) ^ ( (pasw * (i+1)) + key ) ) % 256) #return result def wri...
ajibawa-2023/Python-Code-Large/train/row_1434
80
130
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1434:Import_L1_C0", "label": "struct import struct, string, time\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0077, 0.0077, 0, 0.66, 0.0, 399, 0, 4, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1434:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1434:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1434:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1434:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
extlist = [".bk1",".bk2",".$$$",".local",".a",".tmp",".drc",".o",".cfg",".ddp", ".stat",".pec2bac",".identcache",".dcu",".ppu",".depend",".layout",".win"] #put extensions to delete import sys, os, subprocess print "START THE CLEARING PROCESS" print "DELETING FILES WITH THE FOLLOWING EXT" print extlist i = ...
ajibawa-2023/Python-Code-Large/train/row_1435
15
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1435:Assign_L1_C0", "label": "extlist =", "type": "assigned_variable", "loc": [1, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0714, 0.0952, 0, 0.66, 0.0, 699, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "extlist", "arg_names": [], "import_names": [], "rhs_call_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1435:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1435:For_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1435:For_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1435:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1435...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: models.py Type: Class definition Last modified: 2010-05-24 22:27 Description: This file contains a class that would turn a dictionary containing user information as was returned by json request into a T163User...
ajibawa-2023/Python-Code-Large/train/row_1436
109
332
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1436:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0241, 0.0331, 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_1436:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1436:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1436:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1436:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: utils.py Type: Utility Last modified: 2010-07-18 14:06 Description: Utility functions for this project. """ import locale import os import urllib2 from datetime import datetime, timedelta ############## # E...
ajibawa-2023/Python-Code-Large/train/row_1437
74
166
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1437:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0422, 0.0542, 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_1437:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1437:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1437:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1437:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: __init__.py Type: Module meta information holder Last modified: 2010-05-16 20:44 Description: """ __author__ = "xiaket" __version__ = "0.2b"
ajibawa-2023/Python-Code-Large/train/row_1439
3
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_1439:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 10], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.6154, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: models.py Type: Class definition Last modified: 2010-05-24 22:27 Description: This file contains a class that would turn a dictionary containing user information as was returned by json request into a T163User...
ajibawa-2023/Python-Code-Large/train/row_1440
109
332
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1440:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0241, 0.0331, 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_1440:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1440:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1440:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1440:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: tests.py Type: Unit test module Last modified: 2010-05-21 16:51 Description: This file contains unit test cases for this project. """ import os import time import unittest from models import T163UserBase, Use...
ajibawa-2023/Python-Code-Large/train/row_1441
131
590
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1441:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0119, 0.0153, 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_1441:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1441:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1441:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1441:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: utils.py Type: Utility Last modified: 2010-07-18 14:06 Description: Utility functions for this project. """ import locale import os import urllib2 from datetime import datetime, timedelta ############## # E...
ajibawa-2023/Python-Code-Large/train/row_1442
74
166
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1442:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0422, 0.0542, 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_1442:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1442:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1442:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1442:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: tests.py Type: Unit test module Last modified: 2010-05-21 16:51 Description: This file contains unit test cases for this project. """ import os import time import unittest from models import T163UserBase, Use...
ajibawa-2023/Python-Code-Large/train/row_1443
131
590
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1443:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0119, 0.0153, 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_1443:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1443:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1443:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1443:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: __init__.py Type: Module meta information holder Last modified: 2010-05-16 20:44 Description: """ __author__ = "xiaket" __version__ = "0.2b"
ajibawa-2023/Python-Code-Large/train/row_1445
3
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_1445:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 10], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.6154, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
import pygtk pygtk.require('2.0') import gtk class TreeViewColumnExample(object): # close the window and quit def delete_event(self, widget, event, data=None): gtk.main_quit() return False def __init__(self): # Create a new window self.window = gtk.Window(gtk.WINDOW_TOPLEV...
ajibawa-2023/Python-Code-Large/train/row_1446
42
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1446:Import_L1_C0", "label": "pygtk import pygtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 106, 0, 1, 0, 0, 106, 0, 0], "semantic": {"name": "pygtk", "arg_names": [], "import_names": ["pygtk"], "rhs_call_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1446:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1446:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1446:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1446:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large...
# MySQL for Python import MySQLdb db = MySQLdb.connect ( host = 'localhost', user = 'root', passwd = '', db = 'db_1clic2learn' #bd = 'mysql' ) cursor = db.cursor() cursor.execute('SELECT * FROM db.PL_SQLINJECTION') result = cursor.fetchall() if result: for z in result: print z
ajibawa-2023/Python-Code-Large/train/row_1447
8
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_1447:Import_L3_C0", "label": "MySQLdb import MySQLdb", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0526, 0, 0.66, 0.0, 838, 0, 1, 0, 0, 838, 0, 0], "semantic": {"name": "MySQLdb", "arg_names": [], "import_names": ["MySQLdb"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1447:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1447:For_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1447:For_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1447:Expr_L19_C8"}]
import sys import time, tkMessageBox import Controller try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gtk.glade except: sys.exit(1) ######################################################################## class JanelaPrincipal: ...
ajibawa-2023/Python-Code-Large/train/row_1448
184
266
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1448:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0038, 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_1448:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1448:Import_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1448:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1448:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1448:Tr...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access ######################################################################## # CLASSE PLUGINSQL FILHO DE PLUGINS class PluginSQL (object): """ Responsavel por...
ajibawa-2023/Python-Code-Large/train/row_1449
90
174
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1449:Import_L2_C0", "label": "urllib import urllib, requests, urllib2\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0057, 0, 0.66, 0.0, 614, 0, 5, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1449:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1449:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1449:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1449:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access ######################################################################## # CLASSE PLUGINSQL FILHO DE PLUGINS class PluginSQL (object): """ Responsavel por...
ajibawa-2023/Python-Code-Large/train/row_1451
90
174
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1451:Import_L2_C0", "label": "urllib import urllib, requests, urllib2\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0057, 0, 0.66, 0.0, 614, 0, 5, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1451:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1451:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1451:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1451:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access from bs4 import BeautifulSoup ######################################################################## class PluginXSS (object): """ Responsavel por monta...
ajibawa-2023/Python-Code-Large/train/row_1452
92
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1452:Import_L2_C0", "label": "urllib import urllib, requests, urllib2\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0059, 0, 0.66, 0.0, 614, 0, 5, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1452:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1452:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1452:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1452:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import urllib from Business import PluginSQL from bs4 import BeautifulSoup from urlparse import urlparse # Estava pensando em colocar o Exploiter para fazer o ataque e a análise ######################################################################## class Exploiter(object): """""" #-------------------------...
ajibawa-2023/Python-Code-Large/train/row_1453
38
121
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1453:Import_L1_C0", "label": "urllib import urllib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 0, 0.66, 0.0, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1453:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1453:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1453:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1453:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
from urlparse import urlparse from Business import Exploiter from Business import PluginSQL from Business import PluginXSS from bs4 import BeautifulSoup ######################################################################## class Controller (object): """""" #--------------------------------------------------...
ajibawa-2023/Python-Code-Large/train/row_1454
54
111
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1454:ImportFrom_L1_C0", "label": "from urlparse import urlparse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.009, 0, 0.66, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["u...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1454:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1454:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1454:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1454:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access from bs4 import BeautifulSoup ######################################################################## class PluginXSS (object): """ Responsavel por monta...
ajibawa-2023/Python-Code-Large/train/row_1455
92
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1455:Import_L2_C0", "label": "urllib import urllib, requests, urllib2\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0059, 0, 0.66, 0.0, 614, 0, 5, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1455:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1455:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1455:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1455:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import MySQLdb ######################################################################## class Data_Access (object): #---------------------------------------------------------------------- def __init__ (self, id_vulnerability, pl_attack): """ Construtor: Cria conexão com a Base de Dados ...
ajibawa-2023/Python-Code-Large/train/row_1456
37
70
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1456:Import_L1_C0", "label": "MySQLdb import MySQLdb", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 0, 0.66, 0.0, 838, 0, 1, 0, 0, 838, 0, 0], "semantic": {"name": "MySQLdb", "arg_names": [], "import_names": ["MySQLdb"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1456:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1456:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1456:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1456:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large...
import MySQLdb ######################################################################## class Data_Access (object): """ Cria conexao com a Base de Dados """ dba = MySQLdb.connect (host = 'localhost', user = 'root', passwd = '', db = 'DB_1CLIC2LEARN') #---------------------------------------...
ajibawa-2023/Python-Code-Large/train/row_1457
26
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_1457:Import_L1_C0", "label": "MySQLdb import MySQLdb", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 838, 0, 1, 0, 0, 838, 0, 0], "semantic": {"name": "MySQLdb", "arg_names": [], "import_names": ["MySQLdb"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1457:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1457:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1457:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1457:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) class MainPage(webapp...
ajibawa-2023/Python-Code-Large/train/row_1458
13
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_1458:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 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_1458:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1458:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1458:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1458:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code...
#! /usr/bin/env python # encoding: utf-8 # waf 1.6.10 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_1459
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_1459: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_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1459:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1459:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1459:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1459:If_L25_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1459:If...
#!/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_1460
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_1460: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_1460:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1460:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1460:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1460:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Zdenko Podobný # Author: Zdenko Podobný # # 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/LIC...
ajibawa-2023/Python-Code-Large/train/row_1462
3
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1462:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "an...
[]
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import os import cgi import time import logging import simplejson from datetime import date from google.appengine.api import xmpp from google.appengine.ext import webapp from google.appengine.ext.webapp.uti...
ajibawa-2023/Python-Code-Large/train/row_1463
175
228
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1463:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0175, 0.0044, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1463:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1463:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1463:If_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1463:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
# $Id: CheetahWrapper.py,v 1.26 2007/10/02 01:22:04 tavis_rudd Exp $ """Cheetah command-line interface. 2002-09-03 MSO: Total rewrite. 2002-09-04 MSO: Bugfix, compile command was using wrong output ext. 2002-11-08 MSO: Another rewrite. Meta-Data ========================================================================...
ajibawa-2023/Python-Code-Large/train/row_1464
397
632
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1464:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0127, 0.0206, 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_1464:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1464:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1464:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1464:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
''' Provides an abstract Servlet baseclass for Cheetah's Template class ''' import sys import os.path isWebwareInstalled = False try: try: from ds.appserver.Servlet import Servlet as BaseServlet except: from WebKit.Servlet import Servlet as BaseServlet isWebwareInstalled = True if not...
ajibawa-2023/Python-Code-Large/train/row_1465
53
112
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1465:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0179, 0.0268, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1465:Try_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1465:Try_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1465:Try_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1465:ImportFrom_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1...
# $Id: ErrorCatchers.py,v 1.7 2005/01/03 19:59:07 tavis_rudd Exp $ """ErrorCatcher class for Cheetah Templates Meta-Data ================================================================================ Author: Tavis Rudd <tavis@damnsimple.com> Version: $Revision: 1.7 $ Start Date: 2001/08/01 Last Revision Date: $Date:...
ajibawa-2023/Python-Code-Large/train/row_1467
33
62
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1467:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0968, 0.1452, 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_1467:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1467:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1467:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1467:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-La...
""" Nothing, but in a friendly way. Good for filling in for objects you want to hide. If $form.f1 is a RecursiveNull object, then $form.f1.anything["you"].might("use") will resolve to the empty string. This module was contributed by Ian Bicking. """ class RecursiveNull(object): def __getattr__(self, attr): ...
ajibawa-2023/Python-Code-Large/train/row_1468
20
28
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1468:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.25, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1468:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1468:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1468:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1468:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-...
""" @@TR: This code is pretty much unsupported. MondoReport.py -- Batching module for Python and Cheetah. Version 2001-Nov-18. Doesn't do much practical yet, but the companion testMondoReport.py passes all its tests. -Mike Orr (Iron) TODO: BatchRecord.prev/next/prev_batches/next_batches/query, prev.query, next.quer...
ajibawa-2023/Python-Code-Large/train/row_1469
270
464
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1469:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0162, 0.0302, 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_1469:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1469:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1469:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1469:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
"""This package contains classes, functions, objects and packages contributed by Cheetah users. They are not used by Cheetah itself. There is no guarantee that this directory will be included in Cheetah releases, that these objects will remain here forever, or that they will remain backward-compatible. ""...
ajibawa-2023/Python-Code-Large/train/row_1470
1
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_1470:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.4375, 0.75, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
# $Id: CGITemplate.py,v 1.6 2006/01/29 02:09:59 tavis_rudd Exp $ """A subclass of Cheetah.Template for use in CGI scripts. Usage in a template: #extends Cheetah.Tools.CGITemplate #implements respond $cgiHeaders#slurp Usage in a template inheriting a Python class: 1. The template #extends MyPythonClass...
ajibawa-2023/Python-Code-Large/train/row_1471
19
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1471:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 37], "level": 0, "parent": null, "vector": [8, 0, 0.2532, 0.4675, 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_1471:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1471:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1471:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1471:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# $Id: SiteHierarchy.py,v 1.1 2001/10/11 03:25:54 tavis_rudd Exp $ """Create menus and crumbs from a site hierarchy. You define the site hierarchy as lists/tuples. Each location in the hierarchy is a (url, description) tuple. Each list has the base URL/text in the 0 position, and all the children coming after it. A...
ajibawa-2023/Python-Code-Large/train/row_1472
85
166
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1472:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0512, 0.0843, 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_1472:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1472:ImportFrom_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1472:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1472:ImportFrom_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#
ajibawa-2023/Python-Code-Large/train/row_1473
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
from turbocheetah import cheetahsupport TurboCheetah = cheetahsupport.TurboCheetah __all__ = ["TurboCheetah"]
ajibawa-2023/Python-Code-Large/train/row_1474
3
5
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1474:ImportFrom_L1_C0", "label": "from turbocheetah import cheetahsupport", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 172, 0, 1, 0, 0, 172, 0, 0], "semantic": {"name": "turbocheetah", "arg_names": [], "import_n...
[]
"Template support for Cheetah" import sys, os, imp from Cheetah import Compiler import pkg_resources def _recompile_template(package, basename, tfile, classname): tmpl = pkg_resources.resource_string(package, "%s.tmpl" % basename) c = Compiler.Compiler(source=tmpl, mainClassName='GenTemplate') code = str...
ajibawa-2023/Python-Code-Large/train/row_1475
66
110
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1475:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0091, 0.0091, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1475:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1475:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1475:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1475:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import Cheetah.Template def render(template_file, **kwargs): ''' Cheetah.Django.render() takes the template filename (the filename should be a file in your Django TEMPLATE_DIRS) Any additional keyword arguments are passed into the template are propogated into the templat...
ajibawa-2023/Python-Code-Large/train/row_1477
8
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1477:Import_L1_C0", "label": "Cheetah.Template import Cheetah.Template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "Cheetah.Template", "arg_names": [], "i...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1477:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1477:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1477:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1477:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
''' Provides several CacheStore backends for Cheetah's caching framework. The methods provided by these classes have the same semantics as those in the python-memcached API, except for their return values: set(key, val, time=0) set the value unconditionally add(key, val, time=0) set only if the server doesn't alr...
ajibawa-2023/Python-Code-Large/train/row_1479
53
108
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1479:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0787, 0.1481, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1479:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1479:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1479:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1479:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Co...
try: from ds.sys.Unspecified import Unspecified except ImportError: class _Unspecified: def __repr__(self): return 'Unspecified' def __str__(self): return 'Unspecified' Unspecified = _Unspecified()
ajibawa-2023/Python-Code-Large/train/row_1480
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_1480:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 9], "level": 0, "parent": null, "vector": [7, 0, 0.5556, 1.0, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1480:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1480:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1480:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1480:ClassDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
# $Id: CacheRegion.py,v 1.3 2006/01/28 04:19:30 tavis_rudd Exp $ ''' Cache holder classes for Cheetah: Cache regions are defined using the #cache Cheetah directive. Each cache region can be viewed as a dictionary (keyed by cacheRegionID) handling at least one cache item (the default one). It's possible to add cacheIte...
ajibawa-2023/Python-Code-Large/train/row_1481
69
136
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1481:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0809, 0.1397, 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_1481:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1481:ImportFrom_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1481:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1481:ImportFrom_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python ''' Tests for the 'cheetah' command. Besides unittest usage, recognizes the following command-line options: --list CheetahWrapper.py List all scenarios that are tested. The argument is the path of this script. --nodelete Don't delete scratch directory at end. ...
ajibawa-2023/Python-Code-Large/train/row_1483
394
573
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1483:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0131, 0.0209, 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_1483:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1483:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1483:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1483:ClassDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
#!/usr/bin/env python ''' Core module of Cheetah's Unit-testing framework TODO ================================================================================ # combo tests # negative test cases for expected exceptions # black-box vs clear-box testing # do some tests that run the Template for long enough to check tha...
ajibawa-2023/Python-Code-Large/train/row_1484
24
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_1484:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.1226, 0.1887, 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_1484:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1484:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1484:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1484:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1484:...
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli. __revision__ = "$Id: /private/python/stdlib/xmlrunner.py 16654 2007-11-12T12:46:35.368945Z srittau $" import os.path import re import sys import time...
ajibawa-2023/Python-Code-Large/train/row_1485
198
381
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1485:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0079, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1485:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1485:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1485:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1485:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#!/usr/bin/env python # -*- encoding: utf8 -*- from Cheetah.Template import Template from Cheetah import CheetahWrapper from Cheetah import DummyTransaction import imp import os import sys import tempfile import unittest class CommandLineTest(unittest.TestCase): def createAndCompile(self, source): sourcef...
ajibawa-2023/Python-Code-Large/train/row_1487
121
237
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1487:ImportFrom_L4_C0", "label": "from Cheetah.Template import Template", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0042, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "Cheetah.Template", "arg_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1487:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1487:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1487:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1487:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python import sys import types import os import os.path import unittest from Cheetah.NameMapper import NotFound, valueForKey, \ valueForName, valueFromSearchList, valueFromFrame, valueFromFrameOrSearchList class DummyClass: classVar1 = 123 def __init__(self): self.instanceVar1 ...
ajibawa-2023/Python-Code-Large/train/row_1489
335
525
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1489:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0019, 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_1489:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1489:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1489:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1489:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
#!/usr/bin/env python import hotshot import hotshot.stats import os import sys import unittest from test import pystone import time import Cheetah.NameMapper import Cheetah.Template # This can be turned on with the `--debug` flag when running the test # and will cause the tests to all just dump out how long they t...
ajibawa-2023/Python-Code-Large/train/row_1490
114
243
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1490:Import_L3_C0", "label": "hotshot import hotshot", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0123, 0.0041, 0, 0.66, 0.0, 974, 0, 1, 0, 0, 974, 0, 0], "semantic": {"name": "hotshot", "arg_names": [], "import_names": ["hotshot"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1490:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1490:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1490:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1490:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
#!/usr/bin/env python import unittest from Cheetah import DirectiveAnalyzer class AnalyzerTests(unittest.TestCase): def test_set(self): template = ''' #set $foo = "bar" Hello ${foo}! ''' calls = DirectiveAnalyzer.analyze(template) self.assertEquals(1, calls.get('s...
ajibawa-2023/Python-Code-Large/train/row_1491
13
29
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1491:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0345, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1491:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1491:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1491:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1491:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La...
#!/usr/bin/env python import unittest from Cheetah import SettingsManager class SettingsManagerTests(unittest.TestCase): def test_mergeDictionaries(self): left = {'foo' : 'bar', 'abc' : {'a' : 1, 'b' : 2, 'c' : (3,)}} right = {'xyz' : (10, 9)} expect = {'xyz': (10, 9), 'foo': 'bar', 'abc...
ajibawa-2023/Python-Code-Large/train/row_1493
11
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1493:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.05, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1493:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1493:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1493:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1493:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La...
#
ajibawa-2023/Python-Code-Large/train/row_1494
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
#!/usr/bin/env python import Cheetah.NameMapper import Cheetah.Template import sys import unittest majorVer, minorVer = sys.version_info[0], sys.version_info[1] versionTuple = (majorVer, minorVer) def isPython23(): ''' Python 2.3 is still supported by Cheetah, but doesn't support decorators ''' return maj...
ajibawa-2023/Python-Code-Large/train/row_1495
79
246
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1495:Import_L3_C0", "label": "Cheetah.NameMapper import Cheetah.NameMapper", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0041, 0, 0.66, 0.0, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "Cheetah.NameMapper", "arg_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1495:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1495:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1495:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1495:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/env python import unittest from Cheetah import Parser class ArgListTest(unittest.TestCase): def setUp(self): super(ArgListTest, self).setUp() self.al = Parser.ArgList() def test_merge1(self): ''' Testing the ArgList case results from Template.Preprocessors.tes...
ajibawa-2023/Python-Code-Large/train/row_1496
28
49
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1496:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1496:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1496:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1496:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1496:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large...
from glob import glob import os from os import listdir import os.path import re from tempfile import mktemp def _escapeRegexChars(txt, escapeRE=re.compile(r'([\$\^\*\+\.\?\{\}\[\]\(\)\|\\])')): return escapeRE.sub(r'\\\1', txt) def findFiles(*args, **kw): """Recursively find all the file...
ajibawa-2023/Python-Code-Large/train/row_1497
199
357
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1497:ImportFrom_L2_C0", "label": "from glob import glob", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0028, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1497:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1497:Return_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1497:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1497:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#
ajibawa-2023/Python-Code-Large/train/row_1499
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
import gettext _ = gettext.gettext class I18n(object): def __init__(self, parser): pass ## junk I'm playing with to test the macro framework # def parseArgs(self, parser, startPos): # parser.getWhiteSpace() # args = parser.getExpression(useNameMapper=False, # ...
ajibawa-2023/Python-Code-Large/train/row_1500
10
67
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1500:Import_L1_C0", "label": "gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0149, 0, 0.66, 0.0, 723, 0, 1, 0, 0, 723, 0, 0], "semantic": {"name": "gettext", "arg_names": [], "import_names": ["gettext"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1500:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1500:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1500:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1500:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-...
''' Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. ''' import sys import os import os.path from os.path import getmtime, exi...
ajibawa-2023/Python-Code-Large/train/row_1501
1,179
1,999
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1501:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0025, 0.0045, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1501:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1501:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1501:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1501:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-...
"""SourceReader class for Cheetah's Parser and CodeGenerator """ import re import sys EOLre = re.compile(r'[ \f\t]*(?:\r\n|\r|\n)') EOLZre = re.compile(r'(?:\r\n|\r|\n|\Z)') ENCODINGsearch = re.compile("coding[=:]\s*([-\w.]+)").search class Error(Exception): pass class SourceReade...
ajibawa-2023/Python-Code-Large/train/row_1502
187
290
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1502:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0069, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1502:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1502:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1502:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1502:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code...
""" Indentation maker. @@TR: this code is unsupported and largely undocumented ... This version is based directly on code by Robert Kuzelj <robert_kuzelj@yahoo.com> and uses his directive syntax. Some classes and attributes have been renamed. Indentation is output via $self._CHEETAH__indenter.indent() to prevent '_i...
ajibawa-2023/Python-Code-Large/train/row_1504
86
123
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1504:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0488, 0.0894, 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_1504:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1504:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1504:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1504:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
## statprof.py ## Copyright (C) 2004,2005 Andy Wingo <wingo at pobox dot com> ## Copyright (C) 2001 Rob Browning <rlb at defaultvalue dot org> ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foun...
ajibawa-2023/Python-Code-Large/train/row_1505
102
304
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1505:Expr_L22_C0", "label": "expression", "type": "expression", "loc": [22, 120], "level": 0, "parent": null, "vector": [8, 0, 0.2336, 0.3257, 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_1505:Try_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1505:Import_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1505:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1505:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
"""This is a copy of the htmlDecode function in Webware. @@TR: It implemented more efficiently. """ from Cheetah.Utils.htmlEncode import htmlCodesReversed def htmlDecode(s, codes=htmlCodesReversed): """ Returns the ASCII decoded version of the given HTML string. This does NOT remove normal HTML tags like <p...
ajibawa-2023/Python-Code-Large/train/row_1506
7
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1506:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.2143, 0.3571, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1506:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1506:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1506:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1506:For_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
#!/usr/bin/env python """ Miscellaneous functions/objects used by Cheetah but also useful standalone. """ import os # Used in mkdirsWithPyInitFile. import sys # Used in die. ################################################## ## MISCELLANEOUS FUNCTIONS def die(reason): sys.stderr.write(reason...
ajibawa-2023/Python-Code-Large/train/row_1507
29
67
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1507:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0448, 0.0448, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1507:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1507:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1507:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1507:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# $Id: WebInputMixin.py,v 1.10 2006/01/06 21:56:54 tavis_rudd Exp $ """Provides helpers for Template.webInput(), a method for importing web transaction variables in bulk. See the docstring of webInput for full details. Meta-Data ================================================================================ Author: ...
ajibawa-2023/Python-Code-Large/train/row_1508
46
102
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1508:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0735, 0.1176, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1508:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1508:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1508:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1508:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
#
ajibawa-2023/Python-Code-Large/train/row_1509
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
"""This is a copy of the htmlEncode function in Webware. @@TR: It implemented more efficiently. """ htmlCodes = [ ['&', '&amp;'], ['<', '&lt;'], ['>', '&gt;'], ['"', '&quot;'], ] htmlCodesReversed = htmlCodes[:] htmlCodesReversed.reverse() def htmlEncode(s, codes=htmlCodes): """ Returns the HTML...
ajibawa-2023/Python-Code-Large/train/row_1510
9
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1510:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.2857, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1510:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1510:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1510:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1510:For_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
import sys import os.path import copy as copyModule from ConfigParser import ConfigParser import re from tokenize import Intnumber, Floatnumber, Number from types import * import types import new import time from StringIO import StringIO # not cStringIO because of unicode support import imp # used by S...
ajibawa-2023/Python-Code-Large/train/row_1511
153
290
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1511:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0034, 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_1511:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1511:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1511:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1511:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
Version = '2.4.1' VersionTuple = (2, 4, 1, 'final', 0) MinCompatibleVersion = '2.0rc6' MinCompatibleVersionTuple = (2, 0, 0, 'candidate', 6) #### def convertVersionStringToTuple(s): versionNum = [0, 0, 0] releaseType = 'final' releaseTypeSubNum = 0 if s.find('a')!=-1: num, releaseTypeSubNum = ...
ajibawa-2023/Python-Code-Large/train/row_1512
31
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_1512:Assign_L1_C0", "label": "Version =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0172, 0, 0.66, 0.0, 444, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Version", "arg_names": [], "import_names": [], "rhs_call_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1512:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1512:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1512:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1512:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
''' Cheetah is an open source template engine and code generation tool. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code. Homepage ...
ajibawa-2023/Python-Code-Large/train/row_1513
2
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_1513:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 18], "level": 0, "parent": null, "vector": [8, 0, 0.475, 0.9, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[]
import os.path import string l = ['_'] * 256 for c in string.digits + string.letters: l[ord(c)] = c _pathNameTransChars = string.join(l, '') del l, c def convertTmplPathToModuleName(tmplPath, _pathNameTransChars=_pathNameTransChars, splitdrive=os.pat...
ajibawa-2023/Python-Code-Large/train/row_1514
8
15
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1514:Import_L1_C0", "label": "os.path import os.path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1514:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1514:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1514:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1514:Return_L15_C4"}]
#!/usr/bin/env python import os import pprint try: from functools import reduce except ImportError: # Assume we have reduce pass from Cheetah import Parser from Cheetah import Compiler from Cheetah import Template class Analyzer(Parser.Parser): def __init__(self, *args, **kwargs): self.calls...
ajibawa-2023/Python-Code-Large/train/row_1516
63
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_1516:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0306, 0.0102, 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_1516:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1516:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1516:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1516:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
# $Id: ImportHooks.py,v 1.27 2007/11/16 18:28:47 tavis_rudd Exp $ """Provides some import hooks to allow Cheetah's .tmpl files to be imported directly like Python .py modules. To use these: import Cheetah.ImportHooks Cheetah.ImportHooks.install() Meta-Data ========================================================...
ajibawa-2023/Python-Code-Large/train/row_1517
75
138
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1517:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0761, 0.1159, 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_1517:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1517:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1517:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1517:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
# $Id: _SkeletonPage.py,v 1.13 2002/10/01 17:52:02 tavis_rudd Exp $ """A baseclass for the SkeletonPage template Meta-Data ========== Author: Tavis Rudd <tavis@damnsimple.com>, Version: $Revision: 1.13 $ Start Date: 2001/04/05 Last Revision Date: $Date: 2002/10/01 17:52:02 $ """ __author__ = "Tavis Rudd <tavis@damnsim...
ajibawa-2023/Python-Code-Large/train/row_1519
102
213
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1519:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0282, 0.0423, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1519:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1519:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1519:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1519:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Parser classes for Cheetah's Compiler Classes: ParseError( Exception ) _LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer _HighLevelParser( _LowLevelParser ) Parser === _HighLevelParser (an alias) """ import os import sys import re from re import DOTALL, MULTILINE from types import St...
ajibawa-2023/Python-Code-Large/train/row_1520
1,645
2,661
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1520:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0019, 0.0034, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1520:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1520:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1520:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1520:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import datetime from xml.parsers.expat import ParserCreate codes = { 0 : u'龙卷风', # tornado 1 : u'热带风暴', # tropical storm 2 : u'飓风', # hurricane 3 : u'风暴', # severe thunderstorm...
ajibawa-2023/Python-Code-Large/train/row_1521
133
233
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1521:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0043, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1521:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1521:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1521:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1521:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from os import path from Cheetah.Template import Template def main(): file = path.join(path.split(__file__)[0], 'home.html') print 'Compile template %s...' % file cc = Template.compile(source=None,...
ajibawa-2023/Python-Code-Large/train/row_1522
17
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_1522:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1739, 0.0435, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1522:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1522:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1522:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1522:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from google.appengine.ext import db class City(db.Model): name = db.StringProperty(required=True) aliases = db.StringListProperty(required=True) code = db.IntegerProperty(required=True) def f...
ajibawa-2023/Python-Code-Large/train/row_1523
163
265
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1523:Assign_L4_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0151, 0.0038, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1523:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1523:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1523:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1523:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################## ## DEPENDENCIES import sys import os import os.path import __builtin__ from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVers...
ajibawa-2023/Python-Code-Large/train/row_1524
82
356
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1524:Import_L9_C0", "label": "sys import sys", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0253, 0.0028, 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_1524:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1524:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1524:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1524:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-L...
''' Cookie-handlin' mix-in helper; inspired by WebOb. This module offers a cookie-handling mixin class meant to be used with Google App Engine; this class can in fact be mixed into any class that shares the following features with webapp.RequestHandler subclasses: - a self.request.cookies object with a get(key, defa...
ajibawa-2023/Python-Code-Large/train/row_1526
48
130
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_1526:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0538, 0.1, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_1526:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1526:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1526:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1526:Return_L25_C2"}, {"f": "ajibawa-2023/Python-Code-L...