code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
from PIL import Image, ImageDraw import os import re import numpy as np import math def goThroughCameraData(foldername): allImagesInFolderColorIdArray =[] for files in os.listdir('.\\' + foldername): if files.endswith('.jpg'): image = Image.open(foldername + '\\' + files) singl...
ajibawa-2023/Python-Code-Large/train/row_88345
81
143
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88345:ImportFrom_L1_C0", "label": "from PIL import Image, ImageDraw", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.007, 0, 0.66, 0.0, 556, 0, 2, 0, 0, 556, 0, 0], "semantic": {"name": "PIL", "arg_names": [], "import_names": ["Im...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88345:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88345:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88345:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88345:For_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
from PIL import Image, ImageDraw import os import re import numpy as np import math #goThroughCameraData will take data from folders cam_a and cam_b. #It will then open an image and pass it on to getColorId to get #the color code for the image. We iterate through all of the images #in the folders and save them as a...
ajibawa-2023/Python-Code-Large/train/row_88346
81
167
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88346:ImportFrom_L1_C0", "label": "from PIL import Image, ImageDraw", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 556, 0, 2, 0, 0, 556, 0, 0], "semantic": {"name": "PIL", "arg_names": [], "import_names": ["Im...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88346:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88346:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88346:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88346:For_L14_C4"}, {"f": "ajibawa-2023/Python-Code-...
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
ajibawa-2023/Python-Code-Large/train/row_88347
38
74
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88347:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88347:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88347:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88347:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88347:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-...
# Run from the commandline: # # python server.py # POST audio to http://localhost:9000 # GET audio from http://localhost:9000 # # A simple server to collect audio using python. To be more secure, # you might want to check the file names and place size restrictions # on the incoming data. import cgi from BaseHTTPSe...
ajibawa-2023/Python-Code-Large/train/row_88348
34
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_88348:Import_L11_C0", "label": "cgi import cgi", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2075, 0.0189, 0, 0.66, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["cgi"], "rhs_call_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88348:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88348:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88348:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88348:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- class NoTrainError(Exception): def __init__(self, number): self.number = number def __str__(self): return 'No train with this number: '+str(number) def correct(s): return s.replace('e'',"e'") def train_existence(number): train = Train.all().filter('number = ', number).order('-chec...
ajibawa-2023/Python-Code-Large/train/row_88349
193
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_88349:ClassDef_L2_C0", "label": "NoTrainError", "type": "class", "loc": [2, 6], "level": 0, "parent": null, "vector": [3, 0, 0.0188, 0.0235, 0, 0.66, 0.0, 484, 0, 2, 0, 0, 645, 0, 1], "semantic": {"name": "NoTrainError", "arg_names": [], "import_names": [], "rhs_call_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88349:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88349:FunctionDef_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88349:FunctionDef_L3_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88349:Assign_L4_C2"}, {"f": "ajibawa-2023/Python-Code...
# -*- coding: utf-8 -*- import os from google.appengine.ext import webapp from google.appengine.ext import db from google.appengine.ext.webapp import template from google.appengine.ext.db import djangoforms from google.appengine.ext.webapp.util import run_wsgi_app from django.newforms.util import ErrorList, ValidationE...
ajibawa-2023/Python-Code-Large/train/row_88350
59
76
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88350:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0132, 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_88350:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88350:ClassDef_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88350:ClassDef_L12_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88350:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-L...
import os import sys import xbmcaddon import time import subprocess __scriptname__ = "Opera Web Browser" __author__ = "MCPC-VDR" __url__ = "http://www.mcpc.org.ua" __settings__ = xbmcaddon.Addon(id='web.browser.opera') __cwd__ = __settings__.getAddonInfo('path') __start__ = xbmc.translatePath(...
ajibawa-2023/Python-Code-Large/train/row_88351
15
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88351:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 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_88351:While_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88351:Expr_L18_C2"}]
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (c) 2011-2012 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # * Writer (c) 2011, Kostynoy S.A., E-mail: seppius2@gmail.com # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public Licen...
ajibawa-2023/Python-Code-Large/train/row_88352
115
188
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88352:Import_L24_C0", "label": "urllib import urllib, urllib2, os\u2026", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1277, 0.0053, 0, 0.66, 0.0, 614, 0, 4, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88352:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88352:Try_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88352:Try_L34_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88352:Assign_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (c) 2011-2012 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # * Writer (c) 2011, Kostynoy S.A., E-mail: seppius2@gmail.com # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public Licen...
ajibawa-2023/Python-Code-Large/train/row_88353
115
188
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88353:Import_L24_C0", "label": "urllib import urllib, urllib2, os\u2026", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1277, 0.0053, 0, 0.66, 0.0, 614, 0, 4, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88353:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88353:Try_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88353:Try_L34_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88353:Assign_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (C) 2011 Silen # * # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License as published by # * the Free Software Foundation; either version 2, or (at your option) # * any la...
ajibawa-2023/Python-Code-Large/train/row_88359
189
326
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88359:Import_L22_C0", "label": "re import re, os, urllib\u2026", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0675, 0.0031, 0, 0.66, 0.0, 540, 0, 5, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88359:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88359:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88359:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88359:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (C) 2011 Silen # * # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License as published by # * the Free Software Foundation; either version 2, or (at your option) # * any la...
ajibawa-2023/Python-Code-Large/train/row_88360
189
326
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88360:Import_L22_C0", "label": "re import re, os, urllib\u2026", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0675, 0.0031, 0, 0.66, 0.0, 540, 0, 5, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88360:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88360:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88360:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88360:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/python # Writer (c) 2012, MrStealth # Rev. 1.0.0 # -*- coding: utf-8 -*- import urllib, re, os, sys import xbmc, xbmcplugin,xbmcgui,xbmcaddon import CommonFunctions from helpers import * BASE_URL = 'http://go2load.com' common = CommonFunctions pluginhandle = int(sys.argv[1]) Addon = xbmcaddon.Addon(id=...
ajibawa-2023/Python-Code-Large/train/row_88361
116
188
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88361:Import_L6_C0", "label": "urllib import urllib, re, os\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0319, 0.0053, 0, 0.66, 0.0, 614, 0, 4, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88361:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88361:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88361:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88361:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/python # Writer (c) 2012, MrStealth # Rev. 1.0.1 # -*- coding: utf-8 -*- import urllib, sys import HTMLParser def get_params(): param=[] paramstring=sys.argv[2] if len(paramstring)>=2: params=sys.argv[2] cleanedparams=params.replace('?','') if (params[len(params)-1]=='/'...
ajibawa-2023/Python-Code-Large/train/row_88362
58
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_88362:Import_L6_C0", "label": "urllib import urllib, sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0102, 0, 0.66, 0.0, 614, 0, 2, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88362:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88362:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88362:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88362:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/python # Writer (c) 2012, MrStealth # Rev. 1.0.1 # -*- coding: utf-8 -*- import urllib, sys import HTMLParser def get_params(): param=[] paramstring=sys.argv[2] if len(paramstring)>=2: params=sys.argv[2] cleanedparams=params.replace('?','') if (params[len(params)-1]=='/'...
ajibawa-2023/Python-Code-Large/train/row_88363
58
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_88363:Import_L6_C0", "label": "urllib import urllib, sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0102, 0, 0.66, 0.0, 614, 0, 2, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88363:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88363:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88363:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88363:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/python # Writer (c) 2012, MrStealth # Rev. 1.0.0 # -*- coding: utf-8 -*- import urllib, re, os, sys import xbmc, xbmcplugin,xbmcgui,xbmcaddon import CommonFunctions from helpers import * BASE_URL = 'http://go2load.com' common = CommonFunctions pluginhandle = int(sys.argv[1]) Addon = xbmcaddon.Addon(id=...
ajibawa-2023/Python-Code-Large/train/row_88364
116
188
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88364:Import_L6_C0", "label": "urllib import urllib, re, os\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0319, 0.0053, 0, 0.66, 0.0, 614, 0, 4, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88364:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88364:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88364:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88364:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88370
1,122
2,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_88370:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0276, 0.0519, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88370:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88370:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88370:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88370:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (c) 2011-2012 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # * Writer (c) 2011, Kostynoy S.A., E-mail: seppius2@gmail.com # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public Licen...
ajibawa-2023/Python-Code-Large/train/row_88371
67
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_88371:Import_L23_C0", "label": "urllib import urllib, urllib2, os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2072, 0.009, 0, 0.66, 0.0, 614, 0, 3, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88371:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88371:Assign_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88371:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88371:Expr_L33_C1"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88372
1,122
2,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_88372:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0276, 0.0519, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88372:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88372:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88372:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88372:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/python # -*- coding: utf-8 -*- #/* # * Copyright (c) 2011-2012 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # * Writer (c) 2011, Kostynoy S.A., E-mail: seppius2@gmail.com # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public Licen...
ajibawa-2023/Python-Code-Large/train/row_88373
67
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_88373:Import_L23_C0", "label": "urllib import urllib, urllib2, os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2072, 0.009, 0, 0.66, 0.0, 614, 0, 3, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88373:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88373:Assign_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88373:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88373:Expr_L33_C1"}, {"f": "ajibawa-2023/Python-Code...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88374
1,126
2,145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88374:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0275, 0.0517, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88374:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88374:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88374:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88374:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88376
1,126
2,145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88376:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0275, 0.0517, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88376:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88376:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88376:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88376:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88380
1,126
2,145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88380:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0275, 0.0517, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88380:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88380:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88380:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88380:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
ajibawa-2023/Python-Code-Large/train/row_88382
1,126
2,145
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88382:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 114], "level": 0, "parent": null, "vector": [8, 0, 0.0275, 0.0517, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88382:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88382:Import_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88382:Try_L157_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88382:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
import zlib import httplib import urllib import urllib2 import gzip import StringIO import cookielib import socket import urllib2 class HTTPComm : def testStream( self, url ) : timeout = 10 socket.setdefaulttimeout(timeout) try : # Set useragent, sites don't like to interact with scripts headers = { 'User...
ajibawa-2023/Python-Code-Large/train/row_88385
76
132
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88385:Import_L1_C0", "label": "zlib import zlib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 373, 0, 1, 0, 0, 373, 0, 0], "semantic": {"name": "zlib", "arg_names": [], "import_names": ["zlib"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88385:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88385:FunctionDef_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88385:FunctionDef_L12_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88385:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-...
######################################## # Sky.fm XBMC plugin # by Tim C. 'Bitcrusher' Steinmetz # http://qualisoft.dk # Github: https://github.com/Bitcrusher/Sky-FM-XBMC-plugin # Git Read-only: git://github.com/Bitcrusher/Sky-FM-XBMC-plugin.git # # This Program is free software; you can redistribute it and/or mo...
ajibawa-2023/Python-Code-Large/train/row_88386
233
408
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88386:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0025, 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_88386:ClassDef_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88386:FunctionDef_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88386:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88386:Expr_L79_C2"}, {"f": "ajibawa-2023/Python-Co...
import zlib import httplib import urllib import urllib2 import gzip import StringIO import cookielib import socket import urllib2 class HTTPComm : # Login def post( self, url, postdata ) : timeout = 10 socket.setdefaulttimeout(timeout) cj = cookielib.CookieJar() # create an opener opener...
ajibawa-2023/Python-Code-Large/train/row_88388
52
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_88388:Import_L1_C0", "label": "zlib import zlib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0098, 0.0098, 0, 0.66, 0.0, 373, 0, 1, 0, 0, 373, 0, 0], "semantic": {"name": "zlib", "arg_names": [], "import_names": ["zlib"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88388:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88388:FunctionDef_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88388:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88388:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-...
######################################## # Digitally Imported XBMC plugin # by Tim C. 'Bitcrusher' Steinmetz # http://qualisoft.dk # Github: https://github.com/Bitcrusher/Digitally-Imported-XBMC-plugin # Git Read-only: git://github.com/Bitcrusher/Digitally-Imported-XBMC-plugin.git # # This Program is free ...
ajibawa-2023/Python-Code-Large/train/row_88389
223
365
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88389:Assign_L25_C0", "label": "__plugin__ =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.0685, 0.0027, 0, 0.66, 0.0, 623, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__plugin__", "arg_names": [], "import_names": [], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88389:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88389:FunctionDef_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88389:FunctionDef_L73_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_88389:Expr_L74_C2"}, {"f": "ajibawa-2023/Python-Co...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # Writer (c) 25/05/2011, Kostynoy S.A., E-mail: seppius2@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
ajibawa-2023/Python-Code-Large/train/row_88393
5
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_88393:Import_L22_C0", "label": "sys import sys, os", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.7857, 0.0357, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88393:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88393:Import_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88393:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88393:Expr_L28_C1"}]
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: from collections import deque except ImportError: from utils import deque from constants import spaceCharacters from constants import ent...
ajibawa-2023/Python-Code-Large/train/row_88394
1,081
1,586
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88394:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 6], "level": 0, "parent": null, "vector": [7, 0, 0.0022, 0.0038, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88394:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88394:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88394:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88394:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
import re from xml.sax.saxutils import escape, unescape from tokenizer import HTMLTokenizer from constants import tokenTypes class HTMLSanitizerMixin(object): """ sanitization of XHTML+MathML+SVG and of inline style attributes.""" acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', 'b', ...
ajibawa-2023/Python-Code-Large/train/row_88395
81
230
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88395:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88395:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88395:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88395:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88395:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
from htmlserializer import HTMLSerializer class XHTMLSerializer(HTMLSerializer): quote_attr_values = True minimize_boolean_attributes = False use_trailing_solidus = True escape_lt_in_attrs = True omit_optional_tags = False escape_rcdata = True
ajibawa-2023/Python-Code-Large/train/row_88396
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_88396:ImportFrom_L1_C0", "label": "from htmlserializer import HTMLSerializer", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 528, 0, 1, 0, 0, 528, 0, 0], "semantic": {"name": "htmlserializer", "arg_names": []...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88396:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88396:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88396:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88396:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import ImmutableSet as frozenset import gettext _ = gettext.gettext from html5lib.constants import voidElements, booleanAttributes, spaceCharacters from html5lib.constants import rcdataElements from xml.sax.saxutils i...
ajibawa-2023/Python-Code-Large/train/row_88397
170
234
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88397:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 5], "level": 0, "parent": null, "vector": [7, 0, 0.0128, 0.0214, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88397:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88397:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88397:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88397:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
import string, gettext _ = gettext.gettext try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset EOF = None E = { "null-character": _(u"Null character in input stream, replaced with U+FFFD."), ...
ajibawa-2023/Python-Code-Large/train/row_88401
35
1,169
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88401:Import_L1_C0", "label": "string import string, gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0009, 0.0009, 0, 0.66, 0.0, 890, 0, 2, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["stri...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88401:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88401:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88401:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88401:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
import new import warnings import re import _base from html5lib.constants import DataLossWarning import html5lib.constants as constants import etree as etree_builders from html5lib import ihatexml try: import lxml.etree as etree except ImportError: pass fullTree = True """Module for supporting the lxml.etre...
ajibawa-2023/Python-Code-Large/train/row_88402
219
335
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88402:Import_L1_C0", "label": "new import new", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 145, 0, 1, 0, 0, 145, 0, 0], "semantic": {"name": "new", "arg_names": [], "import_names": ["new"], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88402:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88402:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88402:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88402:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import new import re import _base from html5lib import ihatexml from html5lib import constants from html5lib.constants import namespaces tag_regexp = re.compile("{([^}]*)}(.*)") moduleCache = {} def getETreeModule(ElementTreeImplementation, fullTree=False): name = "_" + ElementTreeImplementation.__name__+"build...
ajibawa-2023/Python-Code-Large/train/row_88403
237
329
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88403:Import_L1_C0", "label": "new import new", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 145, 0, 1, 0, 0, 145, 0, 0], "semantic": {"name": "new", "arg_names": [], "import_names": ["new"], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88403:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88403:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88403:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88403:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import warnings warnings.warn("BeautifulSoup 3.x (as of 3.1) is not fully compatible with html5lib and support will be removed in the future", DeprecationWarning) from BeautifulSoup import BeautifulSoup, Tag, NavigableString, Comment, Declaration import _base from html5lib.constants import namespaces, DataLossWarnin...
ajibawa-2023/Python-Code-Large/train/row_88404
161
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_88404:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0044, 0.0044, 0, 0.66, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warning...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88404:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88404:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88404:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88404:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-...
import _base from html5lib.constants import voidElements, namespaces, prefixes from xml.sax.saxutils import escape # Really crappy basic implementation of a DOM-core like thing class Node(_base.Node): type = -1 def __init__(self, name): self.name = name self.parent = None self.value = N...
ajibawa-2023/Python-Code-Large/train/row_88405
168
248
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88405:Import_L1_C0", "label": "_base import _base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.004, 0.004, 0, 0.66, 0.0, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "_base", "arg_names": [], "import_names": ["_base"], "rhs_call...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88405:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88405:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88405:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88405:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from html5lib.constants import scopingElements, tableInsertModeElements, namespaces try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset # The scope markers are inserted when entering buttons, object element...
ajibawa-2023/Python-Code-Large/train/row_88406
181
345
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88406:ImportFrom_L1_C0", "label": "from html5lib.constants import scopingElements, tableInsertModeElements, namespaces", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0029, 0.0029, 0, 0.66, 0.0, 970, 0, 3, 0, 0, 970, 0, 0], "semantic": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88406:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88406:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88406:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88406:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
ajibawa-2023/Python-Code-Large/train/row_88407
34
92
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88407:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 31], "level": 0, "parent": null, "vector": [8, 0, 0.1739, 0.337, 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_88407:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88407:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88407:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88407:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code...
try: frozenset except NameError: #Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset class MethodDispatcher(dict): """Dict with 2 special properties: On initiation, keys that are lists, sets or tuples are converted to multiple ...
ajibawa-2023/Python-Code-Large/train/row_88409
95
156
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88409:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 6], "level": 0, "parent": null, "vector": [7, 0, 0.0224, 0.0385, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88409:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88409:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88409:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88409:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
from lxml import etree from html5lib.treebuilders.etree import tag_regexp from gettext import gettext _ = gettext import _base from html5lib.constants import voidElements from html5lib import ihatexml class Root(object): def __init__(self, et): self.elementtree = et self.children =...
ajibawa-2023/Python-Code-Large/train/row_88410
118
175
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88410:ImportFrom_L1_C0", "label": "from lxml import etree", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0057, 0, 0.66, 0.0, 123, 0, 1, 0, 0, 123, 0, 0], "semantic": {"name": "lxml", "arg_names": [], "import_names": ["etree"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88410:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88410:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88410:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88410:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-...
import gettext _ = gettext.gettext import new import copy import re import _base from html5lib.constants import voidElements tag_regexp = re.compile("{([^}]*)}(.*)") moduleCache = {} def getETreeModule(ElementTreeImplementation): name = "_" + ElementTreeImplementation.__name__+"builder" if name in moduleCa...
ajibawa-2023/Python-Code-Large/train/row_88411
81
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_88411:Import_L1_C0", "label": "gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0077, 0.0077, 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_88411:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88411:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88411:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88411:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import re import gettext _ = gettext.gettext from BeautifulSoup import BeautifulSoup, Declaration, Comment, Tag from html5lib.constants import namespaces import _base class TreeWalker(_base.NonRecursiveTreeWalker): doctype_regexp = re.compile( r'(?P<name>[^\s]*)(\s*PUBLIC\s*"(?P<publicId>.*)"\s*"(?P<syste...
ajibawa-2023/Python-Code-Large/train/row_88412
38
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88412:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88412:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88412:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88412:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88412:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-...
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS import _base from html5lib.constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None previous = None for event in self.tree: ...
ajibawa-2023/Python-Code-Large/train/row_88413
40
56
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88413:ImportFrom_L1_C0", "label": "from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, COMMENT\u2026", "type": "import", "loc": [1, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0268, 0.0357, 0, 0.66, 0.0, 412, 0, 5, 0, 0, 412, 0, 0], "semantic": {"name": "xml....
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88413:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88413:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88413:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88413:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod...
import gettext _ = gettext.gettext import _base class TreeWalker(_base.NonRecursiveTreeWalker): """Given that simpletree has no performant way of getting a node's next sibling, this implementation returns "nodes" as tuples with the following content: 1. The parent Node (Element, Document or DocumentF...
ajibawa-2023/Python-Code-Large/train/row_88414
38
72
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88414:Import_L1_C0", "label": "gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0139, 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_88414:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88414:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88414:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88414:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import gettext _ = gettext.gettext from html5lib.constants import voidElements, spaceCharacters spaceCharacters = u"".join(spaceCharacters) class TreeWalker(object): def __init__(self, tree): self.tree = tree def __iter__(self): raise NotImplementedError def error(self, msg): ret...
ajibawa-2023/Python-Code-Large/train/row_88415
109
165
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88415:Import_L1_C0", "label": "gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 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_88415:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88415:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88415:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88415:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
ajibawa-2023/Python-Code-Large/train/row_88416
22
52
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88416:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0962, 0.1731, 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_88416:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88416:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88416:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88416:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code...
from xml.dom import Node import gettext _ = gettext.gettext import _base from html5lib.constants import voidElements class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYPE, node.name, node.publicId, nod...
ajibawa-2023/Python-Code-Large/train/row_88417
24
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88417:ImportFrom_L1_C0", "label": "from xml.dom import Node", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["Node"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88417:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88417:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88417:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88417:If_L11_C8"}, {"f": "ajibawa-2023/Python-Code-...
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from genshi.output import NamespaceFlattener import _base from html5lib.constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): de...
ajibawa-2023/Python-Code-Large/train/row_88418
51
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_88418:ImportFrom_L1_C0", "label": "from genshi.core import START, END, XML_NAMESPACE\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 0, 0.66, 0.0, 987, 0, 5, 0, 0, 987, 0, 0], "semantic": {"name": "genshi.core", "arg...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88418:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88418:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88418:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88418:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C...
import _base from html5lib.sanitizer import HTMLSanitizerMixin class Filter(_base.Filter, HTMLSanitizerMixin): def __iter__(self): for token in _base.Filter.__iter__(self): token = self.sanitize_token(token) if token: yield token
ajibawa-2023/Python-Code-Large/train/row_88419
8
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_88419:Import_L1_C0", "label": "_base import _base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "_base", "arg_names": [], "import_names": ["_base"], "rhs_call...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88419:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88419:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88419:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88419:For_L6_C8"}, {"f": "ajibawa-2023/Python-Code-La...
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import ImmutableSet as frozenset import re import _base from html5lib.constants import rcdataElements, spaceCharacters spaceCharacters = u"".join(spaceCharacters) SPACES_REGEX = re.compile(u"[%s]+" % spaceCharacters) ...
ajibawa-2023/Python-Code-Large/train/row_88420
23
41
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88420:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 5], "level": 0, "parent": null, "vector": [7, 0, 0.0732, 0.122, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88420:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88420:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88420:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88420:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.encoding is None) pending = [] for token in _base.Filter.__iter...
ajibawa-2023/Python-Code-Large/train/row_88421
46
63
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88421:Import_L1_C0", "label": "_base import _base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "_base", "arg_names": [], "import_names": ["_base"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88421:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88421:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88421:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88421:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-L...
import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2 = previous1 previous1 = token yield previous2, previous...
ajibawa-2023/Python-Code-Large/train/row_88422
93
202
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88422:Import_L1_C0", "label": "_base import _base", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.005, 0.005, 0, 0.66, 0.0, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "_base", "arg_names": [], "import_names": ["_base"], "rhs_call...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88422:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88422:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88422:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88422:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code...
class Filter(object): def __init__(self, source): self.source = source def __iter__(self): return iter(self.source) def __getattr__(self, name): return getattr(self.source, name)
ajibawa-2023/Python-Code-Large/train/row_88423
7
10
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88423:ClassDef_L2_C0", "label": "Filter", "type": "class", "loc": [2, 10], "level": 0, "parent": null, "vector": [3, 0, 0.6, 0.9, 0, 0.66, 0.0, 813, 0, 3, 0, 0, 186, 0, 2], "semantic": {"name": "Filter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88423:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88423:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88423:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88423:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code...
from gettext import gettext _ = gettext import _base from html5lib.constants import cdataElements, rcdataElements, voidElements from html5lib.constants import spaceCharacters spaceCharacters = u"".join(spaceCharacters) class LintError(Exception): pass class Filter(_base.Filter): def __iter__(self): open...
ajibawa-2023/Python-Code-Large/train/row_88424
55
88
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88424:ImportFrom_L1_C0", "label": "from gettext import gettext", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0114, 0, 0.66, 0.0, 723, 0, 1, 0, 0, 723, 0, 0], "semantic": {"name": "gettext", "arg_names": [], "import_names": ["g...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88424:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88424:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88424:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88424:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-...
# # The goal is to finally have a form filler where you pass data for # each form, using the algorithm for "Seeding a form with initial values" # See http://www.whatwg.org/specs/web-forms/current-work/#seeding # import _base from html5lib.constants import spaceCharacters spaceCharacters = u"".join(spaceCharacters) c...
ajibawa-2023/Python-Code-Large/train/row_88425
96
127
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88425:Import_L7_C0", "label": "_base import _base", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0551, 0.0079, 0, 0.66, 0.0, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "_base", "arg_names": [], "import_names": ["_base"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88425:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88425:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88425:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88425:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Co...
""" HTML parsing library based on the WHATWG "HTML5" specification. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage: import html5lib f = open("my_document.html") tree = h...
ajibawa-2023/Python-Code-Large/train/row_88426
6
17
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88426:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.3824, 0.7059, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[]
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: from collections import deque except ImportError: from utils import deque from constants import contentModelFlags, spaceCharacters from c...
ajibawa-2023/Python-Code-Large/train/row_88427
749
1,212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88427:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 6], "level": 0, "parent": null, "vector": [7, 0, 0.0029, 0.005, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88427:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88427:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88427:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88427:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 XBMC-Russia, HD-lab Team, E-mail: dev@hd-lab.ru # Writer (c) 25/05/2011, Kostynoy S.A., E-mail: seppius2@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
ajibawa-2023/Python-Code-Large/train/row_88430
5
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_88430:Import_L22_C0", "label": "sys import sys, os", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.7857, 0.0357, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "r...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88430:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88430:Import_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88430:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88430:Expr_L28_C1"}]
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. class TransmissionError(Exception): """ This exception is raised when there has occurred an error related to communication with Transmission. It is a subclass of Exception. """ def __...
ajibawa-2023/Python-Code-Large/train/row_88431
36
52
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88431:ClassDef_L5_C0", "label": "TransmissionError", "type": "class", "loc": [5, 20], "level": 0, "parent": null, "vector": [3, 0, 0.2404, 0.3077, 0, 0.66, 0.0, 557, 0, 2, 0, 0, 645, 0, 3], "semantic": {"name": "TransmissionError", "arg_names": [], "import_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88431:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88431:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88431:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88431:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. class Session(object): """ Session is a class holding the session data for a Transmission daemon. Access the session field can be done through attributes. The attributes available ...
ajibawa-2023/Python-Code-Large/train/row_88432
22
44
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88432:ClassDef_L5_C0", "label": "Session", "type": "class", "loc": [5, 44], "level": 0, "parent": null, "vector": [3, 0, 0.5568, 0.9091, 0, 0.66, 0.0, 712, 0, 4, 0, 0, 186, 0, 9], "semantic": {"name": "Session", "arg_names": [], "import_names": [], "rhs_call_name": "", ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88432:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88432:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88432:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88432:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. import sys, datetime from transmissionrpc.constants import PRIORITY from transmissionrpc.utils import format_timedelta class Torrent(object): """ Torrent is a class holding the data recei...
ajibawa-2023/Python-Code-Large/train/row_88434
116
222
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88434:Import_L5_C0", "label": "sys import sys, datetime", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0045, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "datet...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88434:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88434:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88434:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88434:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-...
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. import logging LOGGER = logging.getLogger('transmissionrpc') LOGGER.setLevel(logging.ERROR) def mirror_dict(source): """ Creates a dictionary with all values as keys and all keys as value...
ajibawa-2023/Python-Code-Large/train/row_88435
23
291
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88435:Import_L5_C0", "label": "logging import logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0034, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"],...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88435:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88435:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88435:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88435:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-L...
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. import socket, datetime, logging import transmissionrpc.constants as constants from transmissionrpc.constants import LOGGER UNITS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'] def format_size...
ajibawa-2023/Python-Code-Large/train/row_88436
115
191
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88436:Import_L5_C0", "label": "socket import socket, datetime, logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0262, 0.0052, 0, 0.66, 0.0, 687, 0, 3, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88436:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88436:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88436:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88436:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code...
# -*- coding: utf-8 -*- # Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. from transmissionrpc.constants import DEFAULT_PORT, DEFAULT_TIMEOUT, PRIORITY, RATIO_LIMIT, LOGGER from transmissionrpc.error import TransmissionError, HTTPHandlerError from transmissionrpc.httphan...
ajibawa-2023/Python-Code-Large/train/row_88438
11
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_88438:ImportFrom_L5_C0", "label": "from transmissionrpc.constants import DEFAULT_PORT, DEFAULT_TIMEOUT, PRIORITY\u2026", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.3125, 0.0625, 0, 0.66, 0.0, 702, 0, 5, 0, 0, 702, 0, 0], "semantic": ...
[]
"""Restrictive-List base class""" class rlist( list ): """Sub-class of list that calls a method before insertion allowed """ def __init__(self, value= None): """Initialize the restricted list object""" if value is not None: value = self.beforeMultipleAdd([ self.beforeAdd(item) for item in value ]) else: ...
ajibawa-2023/Python-Code-Large/train/row_88439
42
48
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88439:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0208, 0.0208, 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_88439:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88439:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88439:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88439:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Larg...
"""Spike test for filesystem-path objects ## Create a path representing an existing directory >>> from filepath import path >>> p = path( 'c:\\temp' ) >>> p FileSystemPath('c:\\temp') ## Lists the current contents of the directory >>> p.list() [FileSystemPath('c:\\temp\\abook.mab'), FileSystemPath('c:\\temp\\impab...
ajibawa-2023/Python-Code-Large/train/row_88440
154
360
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88440:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 85], "level": 0, "parent": null, "vector": [8, 0, 0.1194, 0.2361, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88440:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88440:Expr_L91_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88440:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88440:Assign_L97_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Base-class for file-path strings """ import os class BasePath (str): """Representation of a path in a virtual file system Interact with the paths in an object-oriented way (following are ideas for what to do) * Support for standard os and os.path queries * listdir * isfile/dir/symlink * create sub-d...
ajibawa-2023/Python-Code-Large/train/row_88441
83
154
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88441:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0097, 0.013, 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_88441:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88441:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88441:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88441:Assign_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
"""URL manipulation and object-oriented class hierarchy""" def path( value, target = None, force=0 ): """Convert value to the target path-type XXX this becomes a hook-point for creating virtual file-systems, with force true requiring the particular target and false allowing substitutes """ if target is None: ...
ajibawa-2023/Python-Code-Large/train/row_88442
9
18
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88442:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0556, 0.0556, 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_88442:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88442:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88442:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88442:If_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/...
"""Module providing "late-binding" for type specifiers This is a generically useful utility module, it is provided here just because this is where it is used the most. """ import sys def bind( specifier ): """Find the class(es) specified by specifier Allows you to pass a type specifier, one of: string -> fully-...
ajibawa-2023/Python-Code-Large/train/row_88443
25
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88443:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0515, 0.0882, 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_88443:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88443:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88443:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88443:If_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Mapping from core types/classes to stand-in DataTypeDefinitions""" REGISTRY = { } def registerDT( base, DT ): """Register a DataTypeDefinition for a given base-class""" REGISTRY[ base ] = DT def getDT( base ): """Return the appropriate DT for the given base-class This looks up the base in the registry, return...
ajibawa-2023/Python-Code-Large/train/row_88444
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_88444:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88444:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88444:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88444:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88444:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Lar...
"""Logging facilities for basictypes If the logging package (from Python 2.3) is available, we use it for our logging needs, otherwise we use a simplistic locally-defined class for logging. """ import traceback, cStringIO def getException(error): """Get formatted exception""" exception = str(error) file = cStringIO...
ajibawa-2023/Python-Code-Large/train/row_88445
46
57
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88445:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0614, 0.1053, 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_88445:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88445:Expr_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88445:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88445:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-La...
"""Core-python interface definitions""" from protocols import Interface, Attribute, declareImplementation import sys ### Python-object protocols class IObjectPyDoc(Interface): """Object which contains python doc string """ __doc__ = Attribute( "__doc__","""Python documentation string for the object""", ) class IO...
ajibawa-2023/Python-Code-Large/train/row_88446
461
893
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88446:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0011, 0.0011, 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_88446:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88446:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88446:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88446:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
"""wxPython colour data-type definition """ import wx from basictypes import datatypedefinition, enumeration, registry ##from basictypes.wx import wxcopyreg from basicproperty import basic __all__ = ( "wxPen_DT", "PenStyleProperty", "PenCapProperty") class wxPen(wx.Pen): """A somewhat easier-to-use Pen class for use...
ajibawa-2023/Python-Code-Large/train/row_88448
103
212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88448:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0071, 0.0094, 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_88448:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88448:Expr_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88448:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88448:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Data-type definition for wxPython font class""" from wxPython.wx import * from basictypes import datatypedefinition, registry ##from basictypes.wx import wxcopyreg __all__ = ( "wxFont_DT", ) class wxFont_DT( datatypedefinition.BaseType_DT ): """Data-type definition for wxPython font class""" dataType = "wx.font"...
ajibawa-2023/Python-Code-Large/train/row_88449
10
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_88449:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.0769, 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_88449:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88449:Expr_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88449:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88449:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
"""wxPython colour data-type definition """ import wx from basictypes import datatypedefinition, registry #from basictypes.wxtypes import wxcopyreg from wxPython.lib import colourdb COLOUR_DB_INITIALISED = 0 __all__ = ( "wxColour_DT", ) class wxColour_DT( datatypedefinition.BaseType_DT ): """Colour data-modelling t...
ajibawa-2023/Python-Code-Large/train/row_88450
37
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88450:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0254, 0.0339, 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_88450:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88450:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88450:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88450:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""wxPython data-type models"""
ajibawa-2023/Python-Code-Large/train/row_88451
1
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88451:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ...
[]
"""This belongs over in basicproperty/basictypes, obviously""" class RestrictedString( unicode ): """Data-type definition for a string with restricted contents ACCEPTED_CHARACTERS -- set of (unicode) characters accepted by the string-type REPLACE_CHARACTER -- character with which to replace unaccepted charact...
ajibawa-2023/Python-Code-Large/train/row_88453
47
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_88453:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0149, 0.0149, 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_88453:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88453:Expr_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88453:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88453:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
"""Preliminary callable-object modelling classes""" from basicproperty import propertied, basic, common import inspect from basictypes import list_types __NULL__ = [] class Argument( propertied.Propertied ): """Representation of a single argument on a callable object""" name = common.StringLocaleProperty( 'name',...
ajibawa-2023/Python-Code-Large/train/row_88454
171
309
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88454:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0032, 0.0032, 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_88454:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88454:Expr_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88454:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88454:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
"""wxPython colour data-type definition """ import wx from basictypes import datatypedefinition, enumeration, registry ##from basictypes.wx import wxcopyreg from basicproperty import basic __all__ = ( "wxPen_DT", "PenStyleProperty", "PenCapProperty") class wxPen(wx.Pen): """A somewhat easier-to-use Pen class for use...
ajibawa-2023/Python-Code-Large/train/row_88455
103
212
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88455:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0071, 0.0094, 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_88455:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88455:Expr_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88455:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88455:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Data-type definition for wxPython font class""" from wxPython.wx import * from basictypes import datatypedefinition, registry ##from basictypes.wx import wxcopyreg __all__ = ( "wxFont_DT", ) class wxFont_DT( datatypedefinition.BaseType_DT ): """Data-type definition for wxPython font class""" dataType = "wx.font"...
ajibawa-2023/Python-Code-Large/train/row_88456
10
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_88456:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0769, 0.0769, 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_88456:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88456:Expr_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88456:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88456:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tr...
"""wxPython colour data-type definition """ import wx from basictypes import datatypedefinition, registry #from basictypes.wxtypes import wxcopyreg from wxPython.lib import colourdb COLOUR_DB_INITIALISED = 0 __all__ = ( "wxColour_DT", ) class wxColour_DT( datatypedefinition.BaseType_DT ): """Colour data-modelling t...
ajibawa-2023/Python-Code-Large/train/row_88457
37
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88457:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0254, 0.0339, 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_88457:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88457:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88457:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88457:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""wxPython data-type models"""
ajibawa-2023/Python-Code-Large/train/row_88458
1
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88458:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ...
[]
"""Interface/base class for data type definitions""" class DataTypeDefinition( object ): """Interface for explicit data type definitions The data-type definition allows for creating stand-alone mechanisms for annotating a particular type without actually modifying the type itself. The API for the DataTypeDefin...
ajibawa-2023/Python-Code-Large/train/row_88460
34
91
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88460:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.011, 0.011, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88460:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88460:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88460:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88460:FunctionDef_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Lar...
"""Stand-alone type-definition objects for date-based data types Three possible sources (1 implemented): * mx.DateTime (prefered, and implemented) * Python 2.3 datetime * standard time module (least interesting) XXX Would be nice to get a Python 2.3 datetime module implementation, but it's pretty low on my list o...
ajibawa-2023/Python-Code-Large/train/row_88462
43
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_88462:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0602, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88462:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88462:ImportFrom_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88462:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88462:ImportFrom_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""String sub-class representing a domain name""" class DomainName( str ): """Domain-name data-type""" def __new__( cls, value ): """Create a new DomainName from a (non-null) string value""" if not value: raise ValueError( """Null domain-name specified""" ) else: return str.__new__( cls, value ) def che...
ajibawa-2023/Python-Code-Large/train/row_88463
23
37
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88463:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.027, 0.027, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88463:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88463:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88463:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88463:FunctionDef_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Larg...
"""Interfaces for basictypes and basicproperty XXX Should we do adapters from basicproperty objects to zope schema field objects? """ from zope.interface import Interface, Attribute ### Really generic interfaces... class IName( Interface ): """Provide a generic name for an object""" name = Attribute ( "name", ...
ajibawa-2023/Python-Code-Large/train/row_88464
103
257
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88464:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0117, 0.0195, 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_88464:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88464:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88464:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88464:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Restricted lists with base-datatype meta-type support This module is normally used to easily create a baseType definition for a property like so: listof_Blarghs = list_types.listof( name = "listof_Blarghs", baseType = Blargh, dataType = "list.Blargh", ) class X(propertied.Propertied): blarghs = common.L...
ajibawa-2023/Python-Code-Large/train/row_88465
120
227
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88465:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 24], "level": 0, "parent": null, "vector": [8, 0, 0.0551, 0.1057, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88465:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88465:Expr_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88465:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88465:FunctionDef_L37_C1"}, {"f": "ajibawa-2023/Python-Code-...
"""mxDateTime-based date value-types XXX Still need: full RelativeDateTime definition """ from mx.DateTime import * from basictypes import datatypedefinition, registry import time, re, traceback __all__ = ( "mxDateTime_DT", "mxDateTimeDelta_DT", "mxTimeOfDay", 'RelativeDateTime') class mxDateTime_DT( datatypedefini...
ajibawa-2023/Python-Code-Large/train/row_88466
198
383
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88466:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0078, 0.0131, 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_88466:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88466:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88466:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88466:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large...
"""Common data-modeling Python types The idea of the basictypes package is to provide types which provide enough metadata to allow an application to use introspection to perform much of the housekeeping required to create business applications. """
ajibawa-2023/Python-Code-Large/train/row_88467
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_88467:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.5625, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[]
from xml.sax import saxutils import locale defaultEncoding = locale.getdefaultlocale()[-1] class Generator( saxutils.XMLGenerator ): """Friendly generator for XML code""" def __init__( self, out=None, encoding="utf-8"): """Initialise the generator Just overrides the default encoding of the base-class """ su...
ajibawa-2023/Python-Code-Large/train/row_88469
45
55
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88469:ImportFrom_L1_C0", "label": "from xml.sax import saxutils", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0182, 0.0182, 0, 0.66, 0.0, 587, 0, 1, 0, 0, 587, 0, 0], "semantic": {"name": "xml.sax", "arg_names": [], "import_names": ["...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88469:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88469:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88469:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88469:FunctionDef_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Larg...
"""(preliminary) Model of a Factory Callable object""" from basicproperty import propertied, basic, common from basictypes import list_types, callable class Factory( callable.Callable ): """An object intended to create instances of a type The factory allows you to create instances of a type through the GUI. Most ...
ajibawa-2023/Python-Code-Large/train/row_88470
6
20
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88470:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.05, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88470:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88470:Expr_L6_C1"}]
"""Python 2.3 datetime (+dateutils) implementation """ import datetime from dateutil import parser from dateutil import relativedelta from basictypes import datatypedefinition, registry import time, re, traceback class DateTime( datetime.datetime ): """Datatype for the standard Python 2.3+ datetime.datetime type ""...
ajibawa-2023/Python-Code-Large/train/row_88472
79
196
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88472:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0077, 0.0102, 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_88472:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88472:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88472:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88472:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/t...
import re import socket from urllib2 import urlopen from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup socket.setdefaulttimeout(15) class Search: def __init__(self): return NotImplemented def search(terms): return NotImplemented class Mininova(Search): def __init__(self): ...
ajibawa-2023/Python-Code-Large/train/row_88476
54
73
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88476:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0137, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88476:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88476:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88476:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88476:Return_L10_C8"}, {"f": "ajibawa-2023/Python-Cod...
# -*- coding: utf-8 -*- # Copyright (c) 2010 Correl J. Roush import sys import base64 import xbmc import xbmcgui from basictypes.bytes import Bytes from repeater import Repeater import search _ = sys.modules[ "__main__" ].__language__ __settings__ = sys.modules[ "__main__" ].__settings__ KEY_BUTTON_BACK = 275 KEY_KE...
ajibawa-2023/Python-Code-Large/train/row_88477
182
250
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88477:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.004, 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_88477:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88477:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88477:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88477:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-...
# -*- coding: utf-8 -*- # Copyright (c) 2010 Correl J. Roush import threading import time class Repeater: def __init__(self, interval, action, arguments = []): self.interval = interval self.action = action self.arguments = arguments self.event = None def start(self): if...
ajibawa-2023/Python-Code-Large/train/row_88478
33
42
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88478:Import_L4_C0", "label": "threading import threading", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["thread...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88478:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88478:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88478:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88478:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
# -*- coding: utf-8 -*- # Copyright (c) 2010 Correl J. Roush import os import sys import xbmc import xbmcaddon __scriptname__ = "Transmission-XBMC" __author__ = "Correl Roush <correl@gmail.com>" __url__ = "http://github.com/correl/Transmission-XBMC" __svn_url__ = "" __credits__ = "" __version__ = "0.5.2" __XBMC_Revis...
ajibawa-2023/Python-Code-Large/train/row_88479
21
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88479:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0333, 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_88479:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88479:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88479:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88479:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train...
import xbmc import xbmcaddon import xbmcgui import qfpynm import time import sys #enable localization getLS = sys.modules[ "__main__" ].__language__ __cwd__ = sys.modules[ "__main__" ].__cwd__ __addon__ = xbmcaddon.Addon() class GUI(xbmcgui.WindowXMLDialog): def __init__(self, *args, **kwargs): x...
ajibawa-2023/Python-Code-Large/train/row_88481
165
225
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88481:Import_L1_C0", "label": "xbmc import xbmc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0044, 0.0044, 0, 0.66, 0.0, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "xbmc", "arg_names": [], "import_names": ["xbmc"], "rhs_call_n...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_88481:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88481:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88481:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88481:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Co...
import sys import xbmc import xbmcaddon import xbmcgui import qfpynm import time #enable localization getLS = sys.modules[ "__main__" ].__language__ __cwd__ = sys.modules[ "__main__" ].__cwd__ #Longer term #TODO Build a service that monitor state and display a notification about changes #TODO Display network detai...
ajibawa-2023/Python-Code-Large/train/row_88483
165
261
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88483: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_88483:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88483:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88483:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_88483:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Co...
import sys import os import xbmc import xbmcaddon __addon__ = xbmcaddon.Addon() __version__ = __addon__.getAddonInfo('version') __id__ = __addon__.getAddonInfo('id') __language__ = __addon__.getLocalizedString __cwd__ = __addon__.getAddonInfo('path') BASE_RESOURCE_PATH = xbmc.translatePa...
ajibawa-2023/Python-Code-Large/train/row_88484
16
23
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_88484:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 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_88484:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88484:Import_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_88484:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_88484:Assign_L20_C4"}]