code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
#! /usr/bin/env python #coding=utf-8 # -*- coding: utf-8 -*- import log # # transitionMap = { # (fromState, event):toState, # (fromState, event):toState, # ... # } # # # class IFsmCallbackObj(object): def __init__(self): pass def OnEnterState(self, state): pass def OnLeaveState(s...
ajibawa-2023/Python-Code-Large/train/row_3706
24
51
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3706:Import_L4_C0", "label": "log import log", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0196, 0, 0.66, 0.0, 432, 0, 1, 0, 0, 432, 0, 0], "semantic": {"name": "log", "arg_names": [], "import_names": ["log"], "rhs_call_name":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3706:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3706:FunctionDef_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3706:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3706:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Co...
#! /usr/bin/env python #coding=utf-8 import math3d,math LEFT_SIDE = 0x01 RIGHT_SIDE = 0x02 NONE_SIDE = 0x03 def angle(o, s, e): cosfi = 0 fi = 0 norm = 0 dsx = s[0] - o[0] dsy = s[1] - o[1] dex = e[0] - o[0] dey = e[1] - o[1] cosfi = dsx * dex + dsy * dey norm = (dsx * dsx + dsy * dsy)...
ajibawa-2023/Python-Code-Large/train/row_3707
140
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_3707:Import_L3_C0", "label": "math3d import math3d, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0135, 0.0045, 0, 0.66, 0.0, 679, 0, 2, 0, 0, 679, 0, 0], "semantic": {"name": "math3d", "arg_names": [], "import_names": ["math3d",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3707:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3707:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3707:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3707:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-L...
#-- coding: utf-8 -*- import utils, sys lstDir = utils.listdir("tgame/script/") print "lstDir = %s" % str(lstDir) sys.path.extend(lstDir) import tgame_net_handler, t_cmd import tgame_room_logic import iapi import tgame_ready import tgame_menu tgame_API = None GAMEID = -1 GAME_MODE = None UID = None GA...
ajibawa-2023/Python-Code-Large/train/row_3708
49
120
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3708:Import_L2_C0", "label": "utils import utils, sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0083, 0, 0.66, 0.0, 970, 0, 2, 0, 0, 970, 0, 0], "semantic": {"name": "utils", "arg_names": [], "import_names": ["utils", "sys...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3708:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3708:If_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3708:If_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_3708:Assign_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
#! /usr/bin/env python #coding=utf-8 #-- coding: utf-8 -*- import tgame_room_logic, t_cmd def init(): #网络消息到具体回调函数的映射表 global MSG_MAP MSG_MAP = { #游戏模式信息 "game_s_game_mode" : tgame_room_logic.inst.s_game_mode, \ #玩家进入 "game_s_user_in_game" : tgame_room_logic.inst.s_user_in_game, \ #玩家退出 "g...
ajibawa-2023/Python-Code-Large/train/row_3709
3
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_3709:Import_L4_C0", "label": "tgame_room_logic import tgame_room_logic, t_cmd", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0244, 0, 0.66, 0.0, 102, 0, 2, 0, 0, 102, 0, 0], "semantic": {"name": "tgame_room_logic", "arg_names":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3709:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3709:Assign_L9_C1"}]
#-- coding: utf-8 -*- #游戏客户端的入口函数,当使用独立公共大厅的时候,这个函数将在玩家登陆游戏房间的时候被调用,从此程序逻辑将交给各个游戏自己完成 def init(**kargs): #进入游戏自己的初始化函数 import tgame_game tgame_game.start_from_init(int(kargs["gameid"]), int(kargs["gamemode"]), int(kargs["uid"])) #游戏客户端的退出函数,当玩家从游戏房间退出时,公共大厅逻辑会调用这个函数,游戏逻辑需要在这个函数里完成游戏对象的释放工作,防止内存泄漏 def force_...
ajibawa-2023/Python-Code-Large/train/row_3710
6
12
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3710:FunctionDef_L3_C0", "label": "init", "type": "function", "loc": [3, 6], "level": 0, "parent": null, "vector": [2, 0, 0.375, 0.3333, 0, 0.66, 0.0, 319, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "init", "arg_names": ["kargs"], "import_names": [], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3710:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3710:Import_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3710:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3710:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/t...
#! /usr/bin/env python #coding=utf-8 #-- coding: utf-8 -*- import tgame_room_logic, t_cmd def init(): #网络消息到具体回调函数的映射表 global MSG_MAP MSG_MAP = { #游戏模式信息 "game_s_game_mode" : tgame_room_logic.inst.s_game_mode, \ #玩家进入 "game_s_user_in_game" : tgame_room_logic.inst.s_user_in_game, \ #玩家退出 "g...
ajibawa-2023/Python-Code-Large/train/row_3711
3
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_3711:Import_L4_C0", "label": "tgame_room_logic import tgame_room_logic, t_cmd", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0244, 0, 0.66, 0.0, 102, 0, 2, 0, 0, 102, 0, 0], "semantic": {"name": "tgame_room_logic", "arg_names":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3711:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3711:Assign_L9_C1"}]
import iapi API = None def init(): global API API = iapi.API()
ajibawa-2023/Python-Code-Large/train/row_3712
4
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_3712:Import_L1_C0", "label": "iapi import iapi", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 692, 0, 1, 0, 0, 692, 0, 0], "semantic": {"name": "iapi", "arg_names": [], "import_names": ["iapi"], "rhs_call_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3712:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3712:Assign_L8_C1"}]
from t_const import * #关卡开启需求信息,key是关卡id,value是一个列表,表示开启关卡必须完成的其他关卡的id列表 STAGE_REQUIRE = { 1 : [], } DATA = { 1 : { "monster" : "tgame_map_demo", }, } def set_stage_info(): global DATA for value in DATA.values(): tgame_map = value["monster"] tgame_map = __import__(tgame_map) s...
ajibawa-2023/Python-Code-Large/train/row_3713
16
32
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3713:ImportFrom_L1_C0", "label": "from t_const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 855, 0, 1, 0, 0, 855, 0, 0], "semantic": {"name": "t_const", "arg_names": [], "import_names": ["*"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3713:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3713:For_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3713:For_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_3713:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/...
# 事件定义 # 转向 C_TUREND = 0x01 S_TUREND = 0x01 # 移动 C_MOVE = 0x02 S_MOVE = 0x02 # 移动2 C_RUN = 0x03 S_RUN = 0x03 # 攻击 C_ATK = 0x04 S_ATK = 0X04 # 拾取 C_PICKITEM = 0X05 S_PICKITEM = 0X05 # 使用物品 C_USEITEM = 0X06 S_USEITEM = 0X06 # 游戏时间 S_GAMETIME = 0x91 # 出现僵尸 S_GAME_BULZB = 0x71 # 事件 S_GAME_EVENT = 0x...
ajibawa-2023/Python-Code-Large/train/row_3714
17
185
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3714:Assign_L3_C0", "label": "C_TUREND =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0162, 0.0054, 0, 0.66, 0.0, 682, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "C_TUREND", "arg_names": [], "import_names": [], "rhs_call_...
[]
#-- coding: utf-8 -*- import t_const """巫师指令定义方面客户端和服务端公用,其他的函数为客户端专用""" WIZARD_CHANGE_SUN = 0x01 #改变阳光数量 WIZARD_END_GAME = 0x02 #立刻结束游戏 WIZARD_ADD_ZOMBIE = 0x03 #立刻刷新僵尸 #帮助文字字典 HELP_TEXT = {WIZARD_CHANGE_SUN : "改变阳光数量指令//change_sun:参数1:整数(可正负,代表阳光数量的改变值),示例://change_sun 100", \ WIZARD_END_GAM...
ajibawa-2023/Python-Code-Large/train/row_3715
65
106
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3715:Import_L2_C0", "label": "t_const import t_const", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0094, 0, 0.66, 0.0, 855, 0, 1, 0, 0, 855, 0, 0], "semantic": {"name": "t_const", "arg_names": [], "import_names": ["t_const"], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3715:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3715:Import_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3715:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3715:Expr_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Lar...
# -*- coding: utf-8 -*- import base_object import t_cmd import cg_network import cPickle import tgame_room_logic import tgame_mapmgr inst = None #模块初始化函数 def init(): global inst if not inst: inst = CCommand() #模块自清理函数,释放引用 def destroy(): global inst if inst: inst.destroy() inst = None ...
ajibawa-2023/Python-Code-Large/train/row_3716
58
97
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3716:Import_L2_C0", "label": "base_object import base_object", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0206, 0.0103, 0, 0.66, 0.0, 882, 0, 1, 0, 0, 882, 0, 0], "semantic": {"name": "base_object", "arg_names": [], "import_names": [...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3716:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3716:If_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3716:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_3716:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro...
''' main.py Main file for 2 Pints 2 Pints is an implementation of Quarto written in Python Dave Schwantes 2010 www.dinosaurseateverybody.com ''' from QuartoGame import * def main(): print "2 Pints" print "a Quarto implementation by Dave Schwantes" print "" game = QuartoGame() print "The Boa...
ajibawa-2023/Python-Code-Large/train/row_3717
31
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_3717:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1058, 0.1923, 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_3717:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3717:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3717:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3717:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
''' QuartoGame.py Class for the QuartoGame object ''' import math from QuartoBoard import * from QuartoPiece import * class QuartoGame: def __init__(self): self.board = QuartoBoard() self.turn = 0 self.availablePieces = [] self.buildPieces() self.history ...
ajibawa-2023/Python-Code-Large/train/row_3719
87
131
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3719:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0229, 0.0382, 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_3719:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3719:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3719:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3719:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code...
''' main.py Main file for 2 Pints 2 Pints is an implementation of Quarto written in Python Dave Schwantes 2010 www.dinosaurseateverybody.com ''' from QuartoGame import * from TwoPints import * def main(): print "2 Pints" print "a Quarto playing bot by Dave Schwantes" print "" game = QuartoGame() ...
ajibawa-2023/Python-Code-Large/train/row_3720
41
65
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3720:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0846, 0.1538, 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_3720:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3720:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3720:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3720:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
''' QuartoPiece.py Class for the QuartoPiece object def of ''' class QuartoPiece: def __init__(self, height, color, shape, fill): self.attributes = (height, color, shape, fill) self.onBoard = False self.placedBy = None pass def displayPiece(self): print self.at...
ajibawa-2023/Python-Code-Large/train/row_3722
8
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_3722:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.3889, 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_3722:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3722:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3722:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3722:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-...
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('settings') # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've custo...
ajibawa-2023/Python-Code-Large/train/row_3723
10
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3723:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3723:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3723:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3723:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3723:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3723:Tr...
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('settings') # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've custo...
ajibawa-2023/Python-Code-Large/train/row_3724
10
14
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3724:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0714, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3724:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3724:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3724:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3724:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3724:Tr...
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() from django.views.generic.simple import direct_to_template import settings urlpatterns = patterns('', (r'^$', 'Exam.views.exam_list'), (r'^exams/?$', 'Exam.views.exam_list'), (r'^view...
ajibawa-2023/Python-Code-Large/train/row_3725
6
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3725:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import patterns, include, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 341, 0, 3, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.ur...
[]
import os.path # Django settings for YourSchool project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', ...
ajibawa-2023/Python-Code-Large/train/row_3726
28
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_3726:Import_L1_C0", "label": "os.path import os.path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0069, 0.0069, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "r...
[]
from django.db import models class Exam(models.Model): name = models.CharField(max_length=64) created = models.DateField() deadline = models.DateField() author = models.CharField(max_length=64) class ExamQuestion(models.Model): question = models.CharField(max_length=64) exam = models.ForeignKey(...
ajibawa-2023/Python-Code-Large/train/row_3727
33
40
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3727:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["mod...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3727:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3727:Assign_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3727:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3727:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests...
ajibawa-2023/Python-Code-Large/train/row_3728
6
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_3728:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 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_3728:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3728:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3728:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3728:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-L...
# Create your views here. # -*- coding: utf-8 -*- from audioop import reverse from datetime import datetime, date import string from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, redirect, HttpResponse, RequestContext, get_object_or_404 from django.contrib.auth import l...
ajibawa-2023/Python-Code-Large/train/row_3729
124
200
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3729:ImportFrom_L3_C0", "label": "from audioop import reverse", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.015, 0.005, 0, 0.66, 0.0, 296, 0, 1, 0, 0, 296, 0, 0], "semantic": {"name": "audioop", "arg_names": [], "import_names": ["reve...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3729:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3729:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3729:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3729:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import liblo, math #import pyglet, rabbyt class touchList(list): """a class that responds to OSC messages with TUIO data""" lastAlive=[] lastSet=[] def tuioAlive(self,pointsList): """process the arguments of a TUIO Alive message""" for x in self: if x[0] not in pointsList: self.remove(x) self.statsR...
ajibawa-2023/Python-Code-Large/train/row_3731
130
183
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3731:Import_L1_C0", "label": "liblo import liblo, math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 0, 0.66, 0.0, 925, 0, 2, 0, 0, 925, 0, 0], "semantic": {"name": "liblo", "arg_names": [], "import_names": ["liblo", "ma...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3731:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3731:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3731:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3731:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r...
#!/usr/bin/python # gameswf_batch_test.py -Thatcher Ulrich <tu@tulrich.com> 2005 # This source code has been donated to the Public Domain. Do # whatever you want with it. # Script for batch regression tests on gameswf. import string import sys import commands import difflib import re GAMESWF = "./g...
ajibawa-2023/Python-Code-Large/train/row_3732
74
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3732:Import_L10_C0", "label": "string import string", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0059, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3732:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3732:Expr_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3732:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3732:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/python # gameswf_batch_test.py -Thatcher Ulrich <tu@tulrich.com> 2005 # This source code has been donated to the Public Domain. Do # whatever you want with it. # Script to interactively run all the .swf's in samples/ one-by-one. # # Pass a path argument to start with a particular test file. i...
ajibawa-2023/Python-Code-Large/train/row_3733
24
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3733:Import_L12_C0", "label": "glob import glob", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0185, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3733:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3733:Expr_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3733:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3733:Expr_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large...
#!/usr/bin/python # gameswf_batch_test.py -Thatcher Ulrich <tu@tulrich.com> 2005 # This source code has been donated to the Public Domain. Do # whatever you want with it. # Script for batch regression tests on gameswf. import string import sys import commands import difflib import re GAMESWF = "./g...
ajibawa-2023/Python-Code-Large/train/row_3734
74
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3734:Import_L10_C0", "label": "string import string", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0059, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3734:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3734:Expr_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3734:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3734:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Lar...
#!/usr/bin/python # gameswf_batch_test.py -Thatcher Ulrich <tu@tulrich.com> 2005 # This source code has been donated to the Public Domain. Do # whatever you want with it. # Script to interactively run all the .swf's in samples/ one-by-one. # # Pass a path argument to start with a particular test file. i...
ajibawa-2023/Python-Code-Large/train/row_3735
24
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3735:Import_L12_C0", "label": "glob import glob", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0185, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3735:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3735:Expr_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3735:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3735:Expr_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large...
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
ajibawa-2023/Python-Code-Large/train/row_3736
4
6
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3736:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3736:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3736:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3736:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3736:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_373...
import unittest from zope.testing import doctestunit from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import zcml from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPlo...
ajibawa-2023/Python-Code-Large/train/row_3737
21
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_3737:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3737:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3737:ClassDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3737:ClassDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3737:FunctionDef_L18_C8"}, {"f": "ajibawa-2023/Python-Code-...
from plone.theme.interfaces import IDefaultPloneLayer class IThemeSpecific(IDefaultPloneLayer): """Marker interface that defines a Zope 3 browser layer. If you need to register a viewlet only for the "My315okTheme" theme, this interface must be its layer (in my315oktheme/viewlets/configure.zcm...
ajibawa-2023/Python-Code-Large/train/row_3738
3
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_3738:ImportFrom_L1_C0", "label": "from plone.theme.interfaces import IDefaultPloneLayer", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 862, 0, 1, 0, 0, 862, 0, 0], "semantic": {"name": "plone.theme.interfaces"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3738:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3738:Expr_L4_C4"}]
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from plone.app.layout.viewlets.common import ViewletBase # Sample code for a basic viewlet (In order to use it, you'll have to): # - Un-comment the following useable piece of code (viewlet python class). # - Rename the viewlet template file ('brow...
ajibawa-2023/Python-Code-Large/train/row_3739
2
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3739:ImportFrom_L1_C0", "label": "from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 624, 0, 1, 0, 0, 624, 0, 0], "semantic": {"name": "Pro...
[]
#
ajibawa-2023/Python-Code-Large/train/row_3740
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
def setupVarious(context): # Ordinarily, GenericSetup handlers check for the existence of XML files. # Here, we are not parsing an XML file, but we use this text file as a # flag to check that we actually meant for this import step to be run. # The file is found in profiles/default. if context.rea...
ajibawa-2023/Python-Code-Large/train/row_3741
3
11
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3741:FunctionDef_L1_C0", "label": "setupVarious", "type": "function", "loc": [1, 9], "level": 0, "parent": null, "vector": [2, 0, 0.4545, 0.8182, 0, 0.66, 0.0, 222, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setupVarious", "arg_names": ["context"], "import_names": [], ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3741:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3741:If_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3741:If_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3741:Return_L9_C8"}]
def initialize(context): """Initializer called when used as a Zope 2 product."""
ajibawa-2023/Python-Code-Large/train/row_3742
2
3
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3742:FunctionDef_L2_C0", "label": "initialize", "type": "function", "loc": [2, 3], "level": 0, "parent": null, "vector": [2, 0, 0.8333, 0.6667, 0, 0.66, 0.0, 393, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "initialize", "arg_names": ["context"], "import_names": [], "rhs...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3742:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3742:Expr_L3_C4"}]
from setuptools import setup, find_packages import os version = '1.0' setup(name='Products.my315oktheme', version=version, description="A theme that integrated portletmanager function to Ptortal-header,portal-footer and body", long_description=open("README.txt").read() + "\n" + ...
ajibawa-2023/Python-Code-Large/train/row_3743
4
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_3743:ImportFrom_L1_C0", "label": "from setuptools import setup, find_packages", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "setuptools", "arg_names": [], "im...
[]
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Base class for fixers (optional, but recommended).""" # Python imports import logging import itertools # Local imports from .patcomp import PatternCompiler from . import pygram from .fixer_util import does_tree_imp...
ajibawa-2023/Python-Code-Large/train/row_3744
89
187
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3744:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0214, 0.0053, 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_3744:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3744:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3744:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3744:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
"Utility functions used by the btm_matcher module" from . import pytree from .pgen2 import grammar, token from .pygram import pattern_symbols, python_symbols syms = pattern_symbols.__dict__ pysyms = python_symbols.__dict__ tokens = grammar.opmap token_labels = token.__dict__ TYPE_ANY = -1 TYPE_ALTERNATIVES = -2 TYPE...
ajibawa-2023/Python-Code-Large/train/row_3745
173
287
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3745:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0035, 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_3745:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3745:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3745:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3745:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Main program for 2to3. """ from __future__ import with_statement import sys import os import difflib import logging import shutil import optparse from . import refactor def diff_texts(a, b, filename): """Return a unified diff of two strings.""" a = a.splitlines() b = b.splitlines() return diffl...
ajibawa-2023/Python-Code-Large/train/row_3746
115
181
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3746:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.011, 0.0166, 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_3746:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3746:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3746:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3746:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Pattern compiler. The grammer is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ __author__ = "Guido van Rossum <guido@python.org>" # Python imports import os # ...
ajibawa-2023/Python-Code-Large/train/row_3747
123
204
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3747:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0294, 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_3747:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3747:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3747:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3747:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path....
ajibawa-2023/Python-Code-Large/train/row_3748
17
40
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3748:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.025, 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_3748:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3748:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3748:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3748:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-L...
"""Utility functions, node construction macros, etc.""" # Author: Collin Winter # Local imports from .pgen2 import token from .pytree import Leaf, Node from .pygram import python_symbols as syms from . import patcomp ########################################################### ### Common node-construction "macros" ##...
ajibawa-2023/Python-Code-Large/train/row_3749
253
420
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3749:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0024, 0.0024, 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_3749:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3749:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3749:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3749:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-L...
#! /usr/bin/env python3 """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 ...
ajibawa-2023/Python-Code-Large/train/row_3750
69
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3750:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0366, 0.0122, 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_3750:For_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3750:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3750:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3750:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3750:F...
#! /usr/bin/env python3 """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 ...
ajibawa-2023/Python-Code-Large/train/row_3751
69
82
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3751:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0366, 0.0122, 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_3751:For_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3751:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3751:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3751:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3751:F...
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
ajibawa-2023/Python-Code-Large/train/row_3752
270
500
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3752:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 26], "level": 0, "parent": null, "vector": [8, 0, 0.03, 0.046, 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_3752:Try_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3752:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3752:Try_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3752:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_375...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Convert graminit.[ch] spit out by pgen to Python code. Pgen is the Python parser generator. It is useful to quickly create a parser from a grammar file in Python's grammar notation. But I don't wa...
ajibawa-2023/Python-Code-Large/train/row_3753
126
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_3753:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 27], "level": 0, "parent": null, "vector": [8, 0, 0.0603, 0.0934, 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_3753:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3753:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3753:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3753:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Safely evaluate Python string literals without using eval().""" import re simple_escapes = {"a": "\a", "b": "\b", "f": "\f", "n": "\n", ...
ajibawa-2023/Python-Code-Large/train/row_3754
31
60
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3754:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0167, 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_3754:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3754:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3754:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3754:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-L...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports from . import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filename, stream=None): close_stream =...
ajibawa-2023/Python-Code-Large/train/row_3755
274
386
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3755:ImportFrom_L5_C0", "label": "from import grammar, token, tokenize", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.0026, 0, 0.66, 0.0, 0, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": ["gram...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3755:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3755:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3755:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3755:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """This module defines the data structures used to represent a grammar. These are a bit arcane because they are derived from the data structures used by Python's 'pgen' parser generator. There's also ...
ajibawa-2023/Python-Code-Large/train/row_3756
55
184
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3756:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0462, 0.0543, 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_3756:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3756:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3756:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3756:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """The pgen2 package."""
ajibawa-2023/Python-Code-Large/train/row_3757
1
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3757:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.25, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ...
[]
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser driver. This provides a high-level interface to parse a file into a synta...
ajibawa-2023/Python-Code-Large/train/row_3758
98
147
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3758:Expr_L8_C0", "label": "expression", "type": "expression", "loc": [8, 12], "level": 0, "parent": null, "vector": [8, 0, 0.068, 0.034, 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_3758:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3758:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3758:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3758:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
ajibawa-2023/Python-Code-Large/train/row_3759
465
894
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3759:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0084, 0.0089, 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_3759:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3759:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3759:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3759:ImportFrom_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
"""A bottom-up tree matching algorithm implementation meant to speed up 2to3's matching process. After the tree patterns are reduced to their rarest linear path, a linear Aho-Corasick automaton is created. The linear automaton traverses the linear paths from the leaves to the root of the AST and returns a set of nodes ...
ajibawa-2023/Python-Code-Large/train/row_3760
100
170
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3760:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0206, 0.0353, 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_3760:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3760:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3760:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3760:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that turns <> into !=.""" # Local imports from .. import pytree from ..pgen2 import token from .. import fixer_base class FixNe(fixer_base.BaseFix): # This is so simple that we don't need the pattern com...
ajibawa-2023/Python-Code-Large/train/row_3761
11
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_3761:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1739, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3761:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3761:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3761:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3761:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
"""Fixer for generator.throw(E, V, T). g.throw(E) -> g.throw(E) g.throw(E, V) -> g.throw(E(V)) g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) g.throw("foo"[, V[, T]]) will warn about string exceptions.""" # Author: Collin Winter # Local imports from .. import pytree from ..pgen2 import token from .. im...
ajibawa-2023/Python-Code-Large/train/row_3762
30
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3762:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.069, 0.1207, 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_3762:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3762:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3762:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3762:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for apply(). This converts apply(func, v, k) into (func)(*v, **k).""" # Local imports from .. import pytree from ..pgen2 import token from .. import fixer_base from ..fixer_util import Call, Comma, parenthesi...
ajibawa-2023/Python-Code-Large/train/row_3763
28
60
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3763:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 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_3763:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3763:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3763:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3763:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for import statements. If spam is being imported from the local directory, this import: from spam import eggs Becomes: from .spam import eggs And this import: import spam Becomes: from . import spam """ # Local imports from .. import fixer_base from os.path import dirname, join, exists, sep f...
ajibawa-2023/Python-Code-Large/train/row_3764
58
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3764:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.06, 0.11, 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_3764:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3764:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3764:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3764:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
"""Fixer for 'raise E, V, T' raise -> raise raise E -> raise E raise E, V -> raise E(V) raise E, V, T -> raise E(V).with_traceback(T) raise (((E, E'), E''), E'''), V -> raise E(V) raise "foo", V, T -> warns about string exceptions CAVEATS: 1) "raise E, V" will be incorrectly translate...
ajibawa-2023/Python-Code-Large/train/row_3765
36
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3765:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 21], "level": 0, "parent": null, "vector": [8, 0, 0.131, 0.25, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3765:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3765:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3765:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3765:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: 'print' into 'print()' 'print ...' into 'print(...)' 'print ... ,' into 'print(..., end=" ")' 'print >>x, ...' into 'print(..., file=x)' No changes are appl...
ajibawa-2023/Python-Code-Large/train/row_3766
45
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3766:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 14], "level": 0, "parent": null, "vector": [8, 0, 0.1034, 0.1264, 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_3766:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3766:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3766:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3766:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that changes input(...) into eval(input(...)).""" # Author: Andre Roberge # Local imports from .. import fixer_base from ..fixer_util import Call, Name from .. import patcomp context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >") class FixInput(fixer_base.BaseFix): BM_compatible ...
ajibawa-2023/Python-Code-Large/train/row_3767
14
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_3767:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0357, 0.0357, 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_3767:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3767:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3767:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3767:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that changes 'a ,b' into 'a, b'. This also changes '{a :b}' into '{a: b}', but does not touch other uses of colons. It does not touch other uses of whitespace. """ from .. import pytree from ..pgen2 import token from .. import fixer_base class FixWsComma(fixer_base.BaseFix): explicit = True # The use...
ajibawa-2023/Python-Code-Large/train/row_3768
25
39
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3768:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0897, 0.1538, 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_3768:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3768:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3768:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3768:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
ajibawa-2023/Python-Code-Large/train/row_3769
56
152
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3769:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 27], "level": 0, "parent": null, "vector": [8, 0, 0.0921, 0.1776, 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_3769:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3769:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3769:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3769:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for StandardError -> Exception.""" # Local imports from .. import fixer_base from ..fixer_util import Name class FixStandarderror(fixer_base.BaseFix): BM_compatible = True PATTERN = """ ...
ajibawa-2023/Python-Code-Large/train/row_3770
8
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_3770:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.2, 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_3770:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3770:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3770:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3770:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
ajibawa-2023/Python-Code-Large/train/row_3771
31
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_3771:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0694, 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_3771:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3771:Return_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3771:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3771:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes xrange(...) into range(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name, Call, consuming_calls from .. import patcomp class FixXrange(fixer_base.BaseFix): BM...
ajibawa-2023/Python-Code-Large/train/row_3772
40
75
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3772:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0533, 0.0133, 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_3772:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3772:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3772:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3772:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that turns 'long' into 'int' everywhere. """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import is_probably_builtin class FixLong(fixer_base.BaseFix): BM_compatible = True ...
ajibawa-2023/Python-Code-Large/train/row_3773
10
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3773:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 5], "level": 0, "parent": null, "vector": [8, 0, 0.2143, 0.0952, 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_3773:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3773:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3773:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3773:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int,...
ajibawa-2023/Python-Code-Large/train/row_3774
27
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3774:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1296, 0.1296, 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_3774:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3774:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3774:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3774:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls w...
ajibawa-2023/Python-Code-Large/train/row_3775
19
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_3775:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1023, 0.1818, 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_3775:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3775:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3775:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3775:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fix changes imports of urllib which are now incompatible. This is rather similar to fix_imports, but because of the more complex nature of the fixing for urllib, it has its own fixer. """ # Author: Nick Edds # Local imports from .fix_imports import alternates, FixImports from .. import fixer_base from ..fixer...
ajibawa-2023/Python-Code-Large/train/row_3776
95
180
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3776:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0139, 0.0222, 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_3776:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3776:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3776:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3776:For_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes buffer(...) into memoryview(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name class FixBuffer(fixer_base.BaseFix): BM_compatible = True explicit = True #...
ajibawa-2023/Python-Code-Large/train/row_3777
10
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_3777:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1739, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3777:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3777:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3777:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3777:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for __metaclass__ = X -> (metaclass=X) methods. The various forms of classef (inherits nothing, inherits once, inherints many) don't parse the same in the CST so we look at ALL classes for a __metaclass__ and if we find one normalize the inherits to all be an arglist. For one-liner classes ('c...
ajibawa-2023/Python-Code-Large/train/row_3778
122
229
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3778:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 17], "level": 0, "parent": null, "vector": [8, 0, 0.0393, 0.0742, 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_3778:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3778:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3778:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3778:For_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fixer will chan...
ajibawa-2023/Python-Code-Large/train/row_3779
38
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_3779:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1532, 0.2432, 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_3779:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3779:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3779:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3779:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Fixer that changes os.getcwdu() to os.getcwd(). """ # Author: Victor Stinner # Local imports from .. import fixer_base from ..fixer_util import Name class FixGetcwdu(fixer_base.BaseFix): BM_compatible = True PATTERN = """ power< 'os' trailer< dot='.' name='getcwdu' > any* > "...
ajibawa-2023/Python-Code-Large/train/row_3780
9
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_3780:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.15, 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_3780:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3780:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3780:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3780:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from .. import pytree from .. import fixer_base from ..fixer_util import Name, Attr, touch_import class FixIntern(fixer_base.BaseFix): BM_compatible = True ...
ajibawa-2023/Python-Code-Large/train/row_3781
20
46
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3781:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1087, 0.0652, 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_3781:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3781:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3781:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3781:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
ajibawa-2023/Python-Code-Large/train/row_3782
50
146
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3782:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0068, 0.0068, 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_3782:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3782:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3782:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3782:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-L...
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer for reduce(). Makes sure reduce() is imported from the functools module if reduce is used in that module. """ from lib2to3 import fixer_base from lib2to3.fixer_util import touch_import class FixReduce(fixer_base.BaseFix): ...
ajibawa-2023/Python-Code-Large/train/row_3783
8
34
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3783:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1765, 0.1471, 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_3783:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3783:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3783:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3783:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for basestring -> str.""" # Author: Christian Heimes # Local imports from .. import fixer_base from ..fixer_util import Name class FixBasestring(fixer_base.BaseFix): BM_compatible = True PATTERN = "'basestring'" def transform(self, node, results): return Name("str", prefix=node.prefix)...
ajibawa-2023/Python-Code-Large/train/row_3784
8
15
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3784:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0667, 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_3784:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3784:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3784:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3784:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
""" Optional fixer to transform set() calls to set literals. """ # Author: Benjamin Peterson from lib2to3 import fixer_base, pytree from lib2to3.fixer_util import token, syms class FixSetLiteral(fixer_base.BaseFix): BM_compatible = True explicit = True PATTERN = """power< 'set' trailer< '(' ...
ajibawa-2023/Python-Code-Large/train/row_3785
25
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3785:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.0556, 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_3785:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3785:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3785:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3785:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for function definitions with tuple parameters. def func(((a, b), c), d): ... -> def func(x, d): ((a, b), c) = x ... It will also support lambdas: lambda (x, y): x + y -> lambda t: t[0] + t[1] # The parens are a syntax error in Python 3 lambda (x): x + y -> lambda x: x + y """...
ajibawa-2023/Python-Code-Large/train/row_3786
104
176
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3786:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 18], "level": 0, "parent": null, "vector": [8, 0, 0.054, 0.1023, 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_3786:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3786:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3786:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3786:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
""" Convert use of sys.exitfunc to use the atexit module. """ # Author: Benjamin Peterson from lib2to3 import pytree, fixer_base from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms class FixExitfunc(fixer_base.BaseFix): keep_line_order = True BM_compatible = True PATTERN = """ ...
ajibawa-2023/Python-Code-Large/train/row_3787
36
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_3787:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0274, 0.0411, 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_3787:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3787:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3787:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3787:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that turns 1L into 1, 0755 into 0o755. """ # Copyright 2007 Georg Brandl. # Licensed to PSF under a Contributor Agreement. # Local imports from ..pgen2 import token from .. import fixer_base from ..fixer_util import Number class FixNumliterals(fixer_base.BaseFix): # This is so simple that we don't need ...
ajibawa-2023/Python-Code-Large/train/row_3788
17
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_3788:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.0667, 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_3788:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3788:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3788:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3788:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
"""Fix "for x in f.xreadlines()" -> "for x in f". This fixer will also convert g(f.xreadlines) into g(f.__iter__).""" # Author: Collin Winter # Local imports from .. import fixer_base from ..fixer_util import Name class FixXreadlines(fixer_base.BaseFix): BM_compatible = True PATTERN = """ power< c...
ajibawa-2023/Python-Code-Large/train/row_3789
11
27
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3789:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0741, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3789:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3789:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3789:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3789:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Dummy file to make this directory a package.
ajibawa-2023/Python-Code-Large/train/row_3790
0
1
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for execfile. This converts usages of the execfile function into calls to the built-in exec() function. """ from .. import fixer_base from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, ...
ajibawa-2023/Python-Code-Large/train/row_3791
26
53
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3791:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1132, 0.0943, 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_3791:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3791:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3791:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3791:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that changes unicode to str, unichr to chr, and u"..." into "...". """ import re from ..pgen2 import token from .. import fixer_base _mapping = {"unichr" : "chr", "unicode" : "str"} _literal_re = re.compile(r"[uU][rR]?[\'\"]") class FixUnicode(fixer_base.BaseFix): BM_compatible = True PATTERN = "...
ajibawa-2023/Python-Code-Large/train/row_3792
19
27
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3792:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0741, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3792:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3792:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3792:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3792:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import BlankLine, syms, token class FixItertoolsImports(fixer_base.BaseFix): BM_compatible = True PATTERN = """ import_from< 'from' 'itertools' 'i...
ajibawa-2023/Python-Code-Large/train/row_3793
37
58
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3793:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0172, 0.0172, 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_3793:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3793:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3793:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3793:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for dict methods. d.keys() -> list(d.keys()) d.items() -> list(d.items()) d.values() -> list(d.values()) d.iterkeys() -> iter(d.keys()) d.iteritems() -> iter(d.items()) d.itervalues() -> iter(d.values()) d.v...
ajibawa-2023/Python-Code-Large/train/row_3794
48
107
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3794:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 28], "level": 0, "parent": null, "vector": [8, 0, 0.1495, 0.2336, 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_3794:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3794:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3794:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3794:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for __nonzero__ -> __bool__ methods.""" # Author: Collin Winter # Local imports from .. import fixer_base from ..fixer_util import Name, syms class FixNonzero(fixer_base.BaseFix): BM_compatible = True PATTERN = """ classdef< 'class' any+ ':' suite< any* fu...
ajibawa-2023/Python-Code-Large/train/row_3795
10
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_3795:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3795:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3795:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3795:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3795:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
"""Fixer for except statements with named exceptions. The following cases will be converted: - "except E, T:" where T is a name: except E as T: - "except E, T:" where T is not a name, tuple or list: except E as t: T = t This is done because the target of an "except" clause must be a ...
ajibawa-2023/Python-Code-Large/train/row_3796
40
94
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3796:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 21], "level": 0, "parent": null, "vector": [8, 0, 0.117, 0.2234, 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_3796:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3796:For_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3796:For_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3796:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
ajibawa-2023/Python-Code-Large/train/row_3797
22
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3797:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 14], "level": 0, "parent": null, "vector": [8, 0, 0.1169, 0.1429, 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_3797:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3797:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3797:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3797:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
""" Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...) unless there exists a 'from future_builtins import zip' statement in the top-level namespace. We avoid the transformation if the zip() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. """ #...
ajibawa-2023/Python-Code-Large/train/row_3798
17
36
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3798:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.2222, 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_3798:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3798:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3798:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3798:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fix incompatible imports and module references that must be fixed after fix_imports.""" from . import fix_imports MAPPING = { 'whichdb': 'dbm', 'anydbm': 'dbm', } class FixImports2(fix_imports.FixImports): run_order = 7 mapping = MAPPING
ajibawa-2023/Python-Code-Large/train/row_3799
6
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_3799:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0938, 0.125, 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_3799:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3799:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3799:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3799:Assign_L16_C4"}]
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
ajibawa-2023/Python-Code-Large/train/row_3800
15
32
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3800:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1094, 0.1875, 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_3800:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3800:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3800:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3800:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for removing uses of the types module. These work for only the known names in the types module. The forms above can include types. or not. ie, It is assumed the module is imported either as: import type...
ajibawa-2023/Python-Code-Large/train/row_3801
14
64
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3801:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 20], "level": 0, "parent": null, "vector": [8, 0, 0.1875, 0.2656, 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_3801:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3801:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3801:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3801:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Remove __future__ imports from __future__ import foo is replaced with an empty line. """ # Author: Christian Heimes # Local imports from .. import fixer_base from ..fixer_util import BlankLine class FixFuture(fixer_base.BaseFix): BM_compatible = True PATTERN = """import_from< 'from' module_name="__f...
ajibawa-2023/Python-Code-Large/train/row_3802
11
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_3802:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1087, 0.1739, 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_3802:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3802:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3802:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3802:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fix bound method attributes (method.im_? -> method.__?__). """ # Author: Christian Heimes # Local imports from .. import fixer_base from ..fixer_util import Name MAP = { "im_func" : "__func__", "im_self" : "__self__", "im_class" : "__self__.__class__" } class FixMethodattrs(fixer_base.BaseFix): ...
ajibawa-2023/Python-Code-Large/train/row_3803
11
26
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3803:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0577, 0.0769, 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_3803:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3803:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3803:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3803:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that addes parentheses where they are required This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.""" # By Taek Joo Kim and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import LParen, RParen # XXX This doesn't support nested for loops like [x for x in 1, 2 for x...
ajibawa-2023/Python-Code-Large/train/row_3804
13
45
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3804:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0444, 0.0667, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3804:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3804:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3804:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3804:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for it.next() -> next(it), per PEP 3114.""" # Author: Collin Winter # Things that currently aren't covered: # - listcomp "next" names aren't warned # - "with" statement targets aren't checked # Local imports from ..pgen2 import token from ..pygram import python_symbols as syms from .. import fixer_base f...
ajibawa-2023/Python-Code-Large/train/row_3805
60
105
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_3805:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0095, 0.0095, 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_3805:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3805:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3805:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3805:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer that changes raw_input(...) into input(...).""" # Author: Andre Roberge # Local imports from .. import fixer_base from ..fixer_util import Name class FixRawInput(fixer_base.BaseFix): BM_compatible = True PATTERN = """ power< name='raw_input' trailer< '(' [any] ')' > any* > ...
ajibawa-2023/Python-Code-Large/train/row_3806
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_3806: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": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3806:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3806:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3806:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3806:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for exec. This converts usages of the exec statement into calls to a built-in exec() function. exec code in ns1, ns2 -> exec(code, ns1, ns2) """ # Local imports from .. import pytree from .. import fixer_bas...
ajibawa-2023/Python-Code-Large/train/row_3807
19
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_3807:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 10], "level": 0, "parent": null, "vector": [8, 0, 0.1707, 0.1707, 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_3807:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3807:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3807:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3807:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...
"""Fixer for operator.{isCallable,sequenceIncludes} operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) """ # Local imports from .. import fixer_base from ..fixer_util import Call, Name, String class FixOperator(fixer_base.BaseFix): BM_compatible = True ...
ajibawa-2023/Python-Code-Large/train/row_3808
21
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_3808:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.119, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_3808:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3808:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3808:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3808:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t...